@things-factory/figure-ui 10.1.200 → 10.1.201

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 (73) hide show
  1. package/client/modeller/editor.ts +7 -3
  2. package/client/modeller/fasten-form.ts +18 -35
  3. package/client/modeller/fasten-geometry.ts +67 -115
  4. package/client/modeller/figure-fasten-dialog.ts +4 -12
  5. package/client/modeller/figure-links.ts +6 -7
  6. package/client/modeller/joint-drag.ts +5 -5
  7. package/client/modeller/links.ts +35 -99
  8. package/client/modeller/refusals.ts +2 -6
  9. package/dist-client/modeller/editor.js +7 -2
  10. package/dist-client/modeller/editor.js.map +1 -1
  11. package/dist-client/modeller/fasten-form.d.ts +5 -8
  12. package/dist-client/modeller/fasten-form.js +16 -28
  13. package/dist-client/modeller/fasten-form.js.map +1 -1
  14. package/dist-client/modeller/fasten-geometry.d.ts +20 -19
  15. package/dist-client/modeller/fasten-geometry.js +54 -113
  16. package/dist-client/modeller/fasten-geometry.js.map +1 -1
  17. package/dist-client/modeller/figure-fasten-dialog.js +4 -12
  18. package/dist-client/modeller/figure-fasten-dialog.js.map +1 -1
  19. package/dist-client/modeller/figure-links.d.ts +1 -1
  20. package/dist-client/modeller/figure-links.js +6 -7
  21. package/dist-client/modeller/figure-links.js.map +1 -1
  22. package/dist-client/modeller/joint-drag.js +5 -5
  23. package/dist-client/modeller/joint-drag.js.map +1 -1
  24. package/dist-client/modeller/links.d.ts +19 -26
  25. package/dist-client/modeller/links.js +36 -94
  26. package/dist-client/modeller/links.js.map +1 -1
  27. package/dist-client/modeller/refusals.d.ts +1 -1
  28. package/dist-client/modeller/refusals.js +2 -6
  29. package/dist-client/modeller/refusals.js.map +1 -1
  30. package/dist-client/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +6 -6
  32. package/test/ai-proposal.test.ts +1 -1
  33. package/test/browser/acceptance-page.js +11 -11
  34. package/test/browser/detail-page.js +1 -1
  35. package/test/browser/detail-tabs-page.js +1 -1
  36. package/test/browser/editing-page.js +1 -1
  37. package/test/browser/fix-alignment.check.mjs +3 -3
  38. package/test/browser/links.check.mjs +20 -8
  39. package/test/browser/modeller-page.js +3 -3
  40. package/test/browser/part-ids.check.mjs +2 -2
  41. package/test/browser/parts-page.js +2 -2
  42. package/test/browser/product-page.check.mjs +3 -3
  43. package/test/browser/product-page.js +1 -1
  44. package/test/browser/row-preview.check.mjs +2 -2
  45. package/test/browser/screen-page.js +3 -3
  46. package/test/browser/section-page.js +3 -3
  47. package/test/browser/section.check.mjs +4 -4
  48. package/test/clip-ai-proposal.test.ts +1 -1
  49. package/test/clip-consent.test.ts +1 -1
  50. package/test/command-preview.test.ts +8 -8
  51. package/test/face-mapping.test.ts +2 -2
  52. package/test/fasten-drawing.test.ts +14 -2
  53. package/test/fasten-form.test.ts +11 -3
  54. package/test/fasten-geometry.test.ts +22 -31
  55. package/test/fix-alignment.test.ts +16 -4
  56. package/test/gizmo.test.ts +2 -2
  57. package/test/joint-drag.test.ts +13 -2
  58. package/test/joint-fan.test.ts +1 -1
  59. package/test/joint-frames.test.ts +45 -23
  60. package/test/joints.ts +1 -1
  61. package/test/links.test.ts +68 -68
  62. package/test/live.test.ts +2 -2
  63. package/test/preview-size.test.ts +1 -1
  64. package/test/refusals.test.ts +18 -20
  65. package/test/resize-with-placement.test.ts +6 -6
  66. package/test/revision.test.ts +4 -5
  67. package/test/section-panel.test.ts +1 -1
  68. package/translations/en.json +9 -11
  69. package/translations/es.json +9 -11
  70. package/translations/ja.json +9 -11
  71. package/translations/ko.json +9 -11
  72. package/translations/ms.json +9 -11
  73. package/translations/zh.json +9 -11
@@ -11,7 +11,7 @@ import { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-
11
11
  import './figure-fasten-drawing.js';
12
12
  import { turnsInPlace } from './fasten-geometry.js';
13
13
  import { aimFasten, fastenChanged, fastenDetailWordsOf, fastenFormOf, fastenPlanOf, fastenSentenceOf, fastenTargetsOf } from './fasten-form.js';
14
- import { fieldWordsOf, hasInstanceSize, heldBy } from './links.js';
14
+ import { fieldWordsOf, hasInstanceSize, heldBy, mountingPlaneOf } from './links.js';
15
15
  /** The target list's entry for the plane the figure stands by. */
16
16
  const PLANE = '__plane';
17
17
  /**
@@ -189,7 +189,7 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
189
189
  const plan = fastenPlanOf(revision, this.partId, f);
190
190
  const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'));
191
191
  const modes = f.toPlane
192
- ? ['meet']
192
+ ? mountingPlaneOf(asset).facings
193
193
  : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? ['centre'] : [])];
194
194
  const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params));
195
195
  const drawing = (show) => html `<figure-fasten-drawing
@@ -211,7 +211,7 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
211
211
  return html `
212
212
  ${plan.aim
213
213
  ? html `<p fasten-sentence role="status">
214
- ${fastenSentenceOf(this.partId, f, plan, planeWord, (key, params) => i18next.t(key, params))}
214
+ ${fastenSentenceOf(f, plan, planeWord, (key, params) => i18next.t(key, params))}
215
215
  </p>`
216
216
  : html `<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`}
217
217
  <div question="what">
@@ -222,7 +222,7 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
222
222
  ? html `<div question="face">
223
223
  <h4>
224
224
  ${
225
- /* The face asked is the target's, named: the part's own face follows from it. */ f.toPlane
225
+ /* The face asked is the target's, named: the part meets it by its real shape, by no face of its own. */ f.toPlane
226
226
  ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })
227
227
  : i18next.t('figure.label.fasten-face-on-part', { part: f.target })}
228
228
  </h4>
@@ -250,14 +250,6 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
250
250
  placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}
251
251
  @change=${(e) => this.set({ gap: Number(e.target.value) || 0, gapKept: undefined })}
252
252
  />
253
- <span>${i18next.t('figure.label.twist')}</span>
254
- <input
255
- twist
256
- type="number"
257
- step="any"
258
- .value=${String(f.twist)}
259
- @change=${(e) => this.set({ twist: Number(e.target.value) || 0 })}
260
- />
261
253
  </div>
262
254
  </details>
263
255
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,2CAA2C,CAAA;AAClD,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAEhG,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAA;AACpE,OAAO,EACL,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAA6B,MAAM,YAAY,CAAA;AAG7F,kEAAkE;AAClE,MAAM,KAAK,GAAG,SAAS,CAAA;AAEvB;;;;;;;;;;GAUG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA9D;;QA4EL,+BAA+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AAC,CAAC,IAAI,CAAA;YACA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,OAAO,IAAI,OAAO,CAAC;cACnD;YACR,CAAC,CAAC,OAAO,CAAA;IACb,CAAC;IAED,6GAA6G;IAC7G,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACnC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAC9C,CAAC;;AA9S+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA0B;AAE7C;IAAX,QAAQ,EAAE;;kDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AApFvB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAma9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how (user 2026-10-17: 「속성에는 심플하고 직관적인\n * 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」). The editor stands it over the side panel with its title and close,\n * where the canvas stays in sight (2026-10-19: the standard popup, always modal, hid the 3D it was choosing for).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 320px;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n /* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the panel. */\n ox-popup-actions {\n position: sticky;\n bottom: calc(-1 * var(--popup-padding, 16px));\n margin-bottom: calc(-1 * var(--popup-padding, 16px));\n padding-bottom: var(--popup-padding, 16px);\n background: var(--md-sys-color-surface-container-lowest);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? ['meet']\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => (this.form = fastenChanged(revision, this.partId, this.form!, e.detail))}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(this.partId, f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part's own face follows from it. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${plan.alignRows.length ? this.renderAlignment(plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined })}\n />\n <span>${i18next.t('figure.label.twist')}</span>\n <input\n twist\n type=\"number\"\n step=\"any\"\n .value=${String(f.twist)}\n @change=${(e: Event) => this.set({ twist: Number((e.target as HTMLInputElement).value) || 0 })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part })\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${\n edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>\n ${i18next.t(`figure.label.align-${axis}-min`)}\n </option>\n <option value=\"max\" ?selected=${how === 'max'}>\n ${i18next.t(`figure.label.align-${axis}-max`)}\n </option>`\n : nothing\n }\n ${\n f.alignInput?.[axis]\n ? html`<option value=\"input\" ?selected=${how === 'input'}>\n ${i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) })}\n </option>`\n : nothing\n }\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${\n this.revision && hasInstanceSize(this.revision.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>\n ${i18next.t('figure.label.align-share')}\n </option>`\n : nothing\n }\n </select>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,2CAA2C,CAAA;AAClD,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAEhG,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAA;AACpE,OAAO,EACL,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAA6B,MAAM,YAAY,CAAA;AAG9G,kEAAkE;AAClE,MAAM,KAAK,GAAG,SAAS,CAAA;AAEvB;;;;;;;;;;GAUG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA9D;;QA4EL,+BAA+B;QACnB,WAAM,GAAG,EAAE,CAAA;QACM,WAAM,GAAG,KAAK,CAAA;QAC3C,2FAA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,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAC9C,CAAC;;AAtS+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA0B;AAE7C;IAAX,QAAQ,EAAE;;kDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AApFvB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA2Z9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, mountingPlaneOf, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how (user 2026-10-17: 「속성에는 심플하고 직관적인\n * 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」). The editor stands it over the side panel with its title and close,\n * where the canvas stays in sight (2026-10-19: the standard popup, always modal, hid the 3D it was choosing for).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 320px;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n /* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the panel. */\n ox-popup-actions {\n position: sticky;\n bottom: calc(-1 * var(--popup-padding, 16px));\n margin-bottom: calc(-1 * var(--popup-padding, 16px));\n padding-bottom: var(--popup-padding, 16px);\n background: var(--md-sys-color-surface-container-lowest);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? mountingPlaneOf(asset).facings\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => (this.form = fastenChanged(revision, this.partId, this.form!, e.detail))}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part meets it by its real shape, by no face of its own. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${plan.alignRows.length ? this.renderAlignment(plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part })\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${\n edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>\n ${i18next.t(`figure.label.align-${axis}-min`)}\n </option>\n <option value=\"max\" ?selected=${how === 'max'}>\n ${i18next.t(`figure.label.align-${axis}-max`)}\n </option>`\n : nothing\n }\n ${\n f.alignInput?.[axis]\n ? html`<option value=\"input\" ?selected=${how === 'input'}>\n ${i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) })}\n </option>`\n : nothing\n }\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${\n this.revision && hasInstanceSize(this.revision.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>\n ${i18next.t('figure.label.align-share')}\n </option>`\n : nothing\n }\n </select>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -84,7 +84,7 @@ export declare class FigureLinks extends FigureLinks_base {
84
84
  /** The fastening window, asked of the editor: it opens over the canvas on what the part has now. */
85
85
  private openFastening;
86
86
  /**
87
- * What holds the part, said as its state -- 「아랫면을 바닥에 유지 중」 -- with the ways to change it: open the fastening,
87
+ * What holds the part, said as its state -- 「바닥에 붙어 있음」 -- with the ways to change it: open the fastening,
88
88
  * or take it off. Right after "follow size, attached" this is the result, not a refusal (designer 2026-09-27).
89
89
  */
90
90
  private heldWords;
@@ -394,7 +394,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
394
394
  if (!revision)
395
395
  return;
396
396
  const form = fastenFormOf(revision, this.partId);
397
- /* Whether it is out is the kernel's measure (a round face is not measured there); the drawing's sizes say how far to move. */
397
+ /* Whether it is out, and the least move that brings it in, are the kernel's measure (ADR-0140 3.8). */
398
398
  const own = figureFaceOverhangOf(revision.asset, this.partId, revision.inputs);
399
399
  const fixed = own?.state === 'unknown'
400
400
  ? { cannot: 'unmeasured' }
@@ -415,21 +415,20 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
415
415
  this.dispatchEvent(new CustomEvent('fasten-open', { bubbles: true, composed: true }));
416
416
  }
417
417
  /**
418
- * What holds the part, said as its state -- 「아랫면을 바닥에 유지 중」 -- with the ways to change it: open the fastening,
418
+ * What holds the part, said as its state -- 「바닥에 붙어 있음」 -- with the ways to change it: open the fastening,
419
419
  * or take it off. Right after "follow size, attached" this is the result, not a refusal (designer 2026-09-27).
420
420
  */
421
421
  heldWords(asset) {
422
422
  const joint = (asset.joints ?? []).find(j => j.body1.part === this.partId);
423
- const face = joint ? i18next.t(endPlaceKeyOf(joint.body1)) : '';
424
423
  const gap = joint?.origin?.gap ?? 0;
425
424
  const place = i18next.t(`figure.label.resize-place-${asset.placement ?? 'floor'}`);
426
425
  const where = !joint
427
426
  ? i18next.t('figure.text.held-by-rule')
428
427
  : 'plane' in joint.body0
429
428
  ? typeof gap === 'number'
430
- ? i18next.t('figure.text.held-on-plane', { face, place, gap: String(gap) })
431
- : i18next.t('figure.text.held-on-plane-worked-out', { face, place })
432
- : i18next.t('figure.text.held-on-part', { face, other: joint.body0.part, otherFace: i18next.t(endPlaceKeyOf(joint.body0)) });
429
+ ? i18next.t('figure.text.held-on-plane', { place, gap: String(gap) })
430
+ : i18next.t('figure.text.held-on-plane-worked-out', { place })
431
+ : i18next.t('figure.text.held-on-part', { other: joint.body0.part, otherFace: i18next.t(endPlaceKeyOf(joint.body0)) });
433
432
  return where;
434
433
  }
435
434
  /** The same source, the same share, a new difference: a leaf the opening less its gaps (link-dimension's `plus`). */
@@ -499,7 +498,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
499
498
  return html `
500
499
  ${overhang}
501
500
  <div fastened-summary>
502
- <p fasten-sentence>${fastenSentenceOf(this.partId, form, plan, planeWord, (key, params) => i18next.t(key, params))}</p>
501
+ <p fasten-sentence>${fastenSentenceOf(form, plan, planeWord, (key, params) => i18next.t(key, params))}</p>
503
502
  <button act change-fastening ?disabled=${this.locked} @click=${() => this.openFastening()}>${i18next.t('figure.button.change-fastening')}</button>
504
503
  </div>
505
504
  ${this.renderDetachWords()}