@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
@@ -1 +1 @@
1
- {"version":3,"file":"figure-links.js","sourceRoot":"","sources":["../../client/modeller/figure-links.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,2CAA2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,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAA4B;AAE3B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;gDAA2B;AAQzC;IAAhB,KAAK,EAAE;;4CAAwB;AAIf;IAAhB,KAAK,EAAE;;4CAAqB;AACZ;IAAhB,KAAK,EAAE;;2CAA2C;AAClC;IAAhB,KAAK,EAAE;;0CAA6B;AAEpB;IAAhB,KAAK,EAAE;;6CAAkC;AACzB;IAAhB,KAAK,EAAE;;wCAAyB;AAEhB;IAAhB,KAAK,EAAE;;kDAA8B;AArH3B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAuxBvB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport '@operato/input/ox-input-select-buttons.js'\nimport './figure-slot-layout-panel.js'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureFaceOverhangOf } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureAuthoringAction, FigureDimensionSource, FigureFace } from '@hatiolab/figure-model'\n\nimport {\n acceptsOf,\n AXES,\n canFasten,\n canFollow,\n followCommandOf,\n followableAxes,\n positionIsShare,\n choiceOf,\n followWordsOf,\n heldBy,\n followOf,\n shownWhenOf,\n visibilityControlsOf,\n fasteningOf,\n hasInstanceSize,\n holdsThings,\n leadersFor,\n motionOf,\n motionFormOf,\n motionFormRefusalOf,\n endPlaceKeyOf,\n motionJoint,\n placeFacesOf,\n placeIdFor,\n placesOn,\n rowAxesOf,\n rowBlockOf,\n fixedJointOf,\n rowOf,\n positionsWorkedOut,\n measureNow,\n type Axis,\n type Follow,\n type MotionForm\n} from './links.js'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport { insideAlignmentOf } from './fasten-geometry.js'\nimport { fastenFormOf, fastenPlanOf, fastenSentenceOf } from './fasten-form.js'\nimport type { FigureRevision } from './revision.js'\nimport { HelpToggles } from './help.js'\nimport { groupMenu, GroupMenuStyles } from './group-menu.js'\nimport { jointAxisWord } from './joint-axis.js'\nimport { placeTerms } from '@things-factory/figure-viewer/dist-client/detail-facts.js'\n\nconst freshMotion = (): MotionForm => ({ kind: 'slide', axis: 'x', id: '', min: 0, max: 500, follow: '', multiplier: 1, offset: 0, travel: '', travelPlus: 0 })\nconst freshRow = () => ({ axis: '' as Axis | '', pitch: 200, fills: true, count: 5 })\nconst freshPlace = () => ({ role: 'grip' as 'seat' | 'grip', face: 'top' as FigureFace, label: '', accepts: '', capacity: 1 })\n\n/**\n * What a part is tied to — its size response, what it is fastened to, how it moves.\n *\n * 「Build Once, Fit Anywhere」 lives here: a dimension that follows the instance size or another part is what lets\n * a figure be placed at any size, and a part fastened to the face it rests on is what keeps it there when that\n * happens. The release gate refuses a figure that falls apart when resized, and tells the author to fasten the\n * parts that come away — this is where they do it. Motion is a joint: a slide or a turn driven by a control.\n *\n * The sections are dimensions, placement and joint, in that order. Every\n * change is one figure-model authoring command, sent as `command` and run by the editor through the session — one\n * step of the undo history. The fastening is said here in one line; it is chosen in the fastening window\n * (`figure-fasten-dialog.ts`), which the editor opens when this asks (`fasten-open`). Choices the command would refuse (a round body fastened, a size following an instance\n * size the figure does not declare) are not offered, so the author is not sent into a refusal.\n */\n@customElement('figure-links')\nexport class FigureLinks extends localize(i18next)(LitElement) {\n private readonly help = new HelpToggles(this)\n static styles = [SidePanelStyles, GroupMenuStyles, css`\n :host {\n display: block;\n }\n /* A group's sub-question, under its title: quieter than the title, as a label is. */\n p[group-question] {\n margin: 4px 0 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The fastening a part has, in one line, and 「바꾸기」 at its end. */\n div[fastened-summary] {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n div[fastened-summary] > p {\n flex: 1;\n margin: 0;\n }\n /* Opening the form is an action: the primary colour, at the line's end. */\n div[fastened-summary] > button[act] {\n flex: none;\n margin: 0 -6px 0 0;\n }\n /* The measure's name, then its rule: X, or a cylinder's 반지름 · 길이, on one line. */\n div[row] > b {\n white-space: nowrap;\n }\n div[row] {\n display: grid;\n grid-template-columns: minmax(24px, max-content) minmax(0, 1fr);\n gap: 6px;\n align-items: center;\n }\n b[bound] {\n font-weight: 600;\n }\n /* What each direction does now: read-only rows. */\n div[resize-now] { display: grid; gap: 4px; margin: 12px 0; }\n div[resize-now] div[row] { grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; }\n div[resize-now] span[measure] { font-variant-numeric: tabular-nums; }\n /* Size behaviour is a choice about dimensions only. It never implies a placement or a fastening. */\n /* One of the size group's rows: the group's gap spaces it, as it does the rest (a margin on top of it left a hole). */\n details[resize-choice] { margin: 0; padding: 0; border: 0; }\n details[resize-choice] > div { display: grid; gap: 8px; padding: 8px 0; }\n p[fasten-mode] { margin: 0; font-weight: 600; }\n details { margin-top: 8px; }\n details[row-fold] { margin: 0; }\n details[row-fold] > summary { padding: 0; color: var(--md-sys-color-on-surface); }\n details[row-fold] > summary h3 { margin: 0; }\n details[row-fold][open] > summary { margin-bottom: 8px; }\n /* What the command would do, said beside the result drawn on the canvas. */\n 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; }\n p[preview-words] { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); }\n div[row-basis] { display: grid; gap: 4px; margin: 8px 0; }\n div[row-basis] label { display: flex; align-items: center; gap: 6px; }\n 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); }\n div[overhang] p { margin: 0; }\n ul[detach-words] { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 2px; }\n /* The difference a following measure keeps: under its choice, on the same line as its words. */\n label[inline-plus] {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n label[inline-plus] input {\n flex: 1;\n min-width: 0;\n }\n `]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n private get asset(): FigureAsset | undefined {\n return this.revision?.asset\n }\n /** The selected part. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */\n @property() section: 'shape' | 'response' | 'places' | 'motion' = 'shape'\n /**\n * Its tab is the one shown, and no window over it speaks instead. The response's row speaks of what a command would\n * draw, and the properties' says there is none: only the one in sight may, as the hidden one's silence would clear what\n * the shown one draws. While the fastening window is open it alone speaks (the editor sets this false).\n */\n @property({ type: Boolean }) active = true\n /** What the row's command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Where the selected part's motion takes it, at both ends of its range (the editor draws them on the canvas). */\n @property({ attribute: false }) motionEnds: { control: string; min: number; max: number; unit: string } | null = null\n /** Past the edge of the face it is fastened to, or parts fastened to it past theirs (ADR-0097 §5.5, Q3). */\n @property({ attribute: false }) overhangWords: string[] = []\n /** Wider than the face it is fastened to: how far past each edge, and whether off to one side -- a fact, not a warning. */\n @property({ attribute: false }) overhangNote: string[] = []\n /** What taking this part off would do, said beside the buttons that do it (worked out on a copy by the editor). */\n @property({ attribute: false }) detachWords: string[] = []\n /*\n What a section speaks of on the canvas: the response's row while its fold is open; the properties', the fastening the\n part has -- its face lit, as the one-line result says it.\n */\n private candidate?: { action: FigureAuthoringAction; face?: { part: string; face: string } }\n private fastenCandidate?: { action: FigureAuthoringAction; face?: { part: string; face: string } }\n private told = ''\n @state() private rowOpen = false\n private rowCandidate?: FigureAuthoringAction\n\n /** Why 정렬·간격 고치기 moved nothing, said under it; empty once it moved the part or the part changed. */\n @state() private fixNote = ''\n @state() private motion: MotionForm = freshMotion()\n @state() private place = freshPlace()\n /** How places are made here: one at a time, or by the figure's rule. Unset: by the rule when the figure has one. */\n @state() private placesBy?: 'one' | 'rule'\n @state() private row = freshRow()\n /** The motion form is open over the part's own motion, to change it where it is. */\n @state() private editingMotion = false\n\n /*\n The forms describe the next command for the selected part, so another part starts from the defaults: carrying the\n last part's choices over fastened a shutter curtain level with a right edge nobody chose for it (2026-09-25).\n */\n /* The part the forms were loaded for. A panel made with a part already chosen loaded nothing, and said \"editing the\n fastening it has\" over an empty target (2026-09-27, :3391, the doors). */\n private loadedFor?: string\n willUpdate(changed: Map<string, unknown>) {\n /* Its tab shown again: what it would draw is said again, over whatever the other tab left. */\n if (changed.has('active') && this.active && changed.get('active') === false) this.told = ''\n /* What 고치기 said is about the figure as it was: another step or another part, and it no longer holds. */\n if (changed.has('asset') || changed.has('partId')) this.fixNote = ''\n if (this.asset && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.motion = freshMotion()\n this.place = freshPlace()\n this.row = freshRow()\n this.editingMotion = false\n }\n }\n\n updated() {\n /* Only the sections that hold a form speak of what it would do, and only while their tab is shown: the panel has\n one of these per section, and the others' silence cleared what it showed (2026-09-27, :3391). */\n const speaks = this.active && (this.section === 'shape' || this.section === 'response')\n if (!speaks) return\n const said = JSON.stringify(this.candidate ?? null)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: this.candidate ?? null, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* The panel left: what it showed goes with it. */\n if (this.told && this.told !== 'null') this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n }\n\n render() {\n const asset = this.asset\n this.candidate = undefined\n this.fastenCandidate = undefined\n this.rowCandidate = undefined\n if (!asset || !this.partId) return nothing\n if (this.section === 'motion')\n return html`<section><h3>${i18next.t('figure.label.motion')}${this.help.button('figure.text.motion-explained')}</h3>${this.help.hint('figure.text.motion-explained')}\n ${this.renderMotion(asset)}${this.renderShown(asset)}</section>`\n if (this.section === 'places') {\n /*\n One idea, places, two ways to make them (ADR-0118): one at a time on this part, or many by a rule -- the figure's\n slot layout. One section with a choice, not two screens for the same thing (chief architect, 2026-10-11).\n */\n const byRule = (this.placesBy ?? (asset.document.capabilities.slotLayout ? 'rule' : 'one')) === 'rule'\n return html`<section><h3>${i18next.t('figure.label.places-on-part', { part: this.partId })}${this.help.button('figure.text.place-explained')}</h3>${this.help.hint('figure.text.place-explained')}\n <ox-input-select-buttons\n places-by\n .value=${byRule ? 'rule' : 'one'}\n .options=${[\n { value: 'one', display: i18next.t('figure.label.places-one') },\n { value: 'rule', display: i18next.t('figure.label.places-by-rule') }\n ]}\n @change=${(e: CustomEvent) => (this.placesBy = e.detail === 'rule' ? 'rule' : 'one')}\n ></ox-input-select-buttons>\n ${byRule\n ? html`<figure-slot-layout-panel .asset=${asset} .partId=${this.partId} ?locked=${this.locked}></figure-slot-layout-panel>`\n : placeFacesOf(asset, this.partId).length\n ? this.renderPlaces(asset)\n : html`<p hint>${i18next.t('figure.text.places-need-a-box')}</p>`}</section>`\n }\n /*\n Three groups in one order whatever the part's state (chief architect 2026-10-16): its size, its place, its row. The\n editor's own numbers go in through the slots, so a group keeps its place when a rule or a fastening takes them over.\n */\n /* Fastened, by a face or by an origin: either can be taken off, from the place group's 「⋯」. */\n const held = !!heldBy(asset, this.partId) || !!(this.revision && fasteningOf(this.revision, this.partId)?.atOrigin)\n if (this.section === 'response') {\n /*\n How the part answers a size it is placed at (user 2026-10-17, the 「반응형」 tab): its own measures, where it\n stands, and the row it may make -- what Build Once, Fit Anywhere is authored with, in one place.\n */\n const positions = positionsWorkedOut(asset, this.partId)\n const response = html`\n <section size-response>\n <h3>${i18next.t('figure.label.group-size')}</h3>\n <p group-question>${i18next.t('figure.label.resize-intent')}</p>\n ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n ${positions.length\n ? html`<section position-response>\n <h3>${i18next.t('figure.label.group-position-response')}</h3>\n ${this.renderPositions(asset)}\n </section>`\n : nothing}\n ${rowOf(asset, this.partId) ? html`<slot name=\"row\"></slot>` : this.renderRow(asset)}\n `\n this.candidate = this.rowOpen && this.rowCandidate ? { action: this.rowCandidate } : undefined\n return response\n }\n const shown = html`\n <section size>\n <h3>${i18next.t('figure.label.group-size')}</h3>\n <slot name=\"size\"></slot>\n </section>\n <section fastening>\n <h3>\n ${i18next.t('figure.label.group-place')}${this.help.button('figure.text.fastening-explained')}\n ${groupMenu([{ label: i18next.t('figure.button.detach'), icon: 'link_off', disabled: this.locked || !held, run: () => this.command({ kind: 'detach', part: this.partId }) }])}\n </h3>${this.help.hint('figure.text.fastening-explained')}\n <slot name=\"place\"></slot>\n ${canFasten(asset, this.partId) ? this.renderFastening(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n `\n this.candidate = this.fastenCandidate\n return shown\n }\n\n /** Where things are held on this part: a seat things rest on, or a grip things are held in. */\n private renderPlaces(asset: FigureAsset) {\n const faces = placeFacesOf(asset, this.partId)\n const p = this.place\n const face = faces.includes(p.face) ? p.face : faces[0]!\n const accepts = acceptsOf(p.accepts)\n const capacityOk = Number.isSafeInteger(p.capacity) && p.capacity >= 1\n const roleName = (role: string) => i18next.t('figure.label.place-' + role)\n return html`\n ${placesOn(asset, this.partId).map(\n one => html`<div pair>\n <span>\n <b bound>${one.label}</b>\n <small>${one.face ? i18next.t('figure.label.face-' + one.face) + ' · ' : ''}${placeTerms(one, (key, params) => i18next.t(key, params))}</small>\n </span>\n <button quiet ?disabled=${this.locked} @click=${() => this.command({ kind: 'remove-binding', id: one.id })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-place')}\n </button>\n </div>`\n )}\n ${holdsThings(asset)\n ? nothing\n : html`<p hint>${i18next.t('figure.text.place-needs-holding')}</p>\n <button act ?disabled=${this.locked} @click=${() => this.declareHolding(asset)}>\n <md-icon>inventory_2</md-icon>${i18next.t('figure.button.declare-holding')}\n </button>`}\n <div pair>\n <select @change=${(e: Event) => (this.place = { ...p, role: (e.target as HTMLSelectElement).value as 'seat' | 'grip' })}>\n <option value=\"grip\" ?selected=${p.role === 'grip'}>${roleName('grip')}</option>\n <option value=\"seat\" ?selected=${p.role === 'seat'}>${roleName('seat')}</option>\n </select>\n <select @change=${(e: Event) => (this.place = { ...p, face: (e.target as HTMLSelectElement).value as FigureFace })}>\n ${faces.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div form>\n <span>${i18next.t('figure.label.place-name')}</span>\n <input .value=${p.label} placeholder=${roleName(p.role)} @change=${(e: Event) => (this.place = { ...p, label: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-accepts')}</span>\n <input .value=${p.accepts} placeholder=\"BOX, TOTE\" @input=${(e: Event) => (this.place = { ...p, accepts: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-capacity')}</span>\n <input type=\"number\" min=\"1\" step=\"1\" .value=${String(p.capacity)} @change=${(e: Event) => (this.place = { ...p, capacity: (e.target as HTMLInputElement).valueAsNumber })} />\n </div>\n ${accepts.length ? nothing : html`<small>${i18next.t('figure.text.place-accepts-needed')}</small>`}\n <button\n act\n ?disabled=${this.locked || !accepts.length || !capacityOk}\n @click=${() =>\n this.command({\n kind: 'add-binding',\n id: placeIdFor(asset, this.partId, p.role),\n label: p.label.trim() || roleName(p.role),\n role: p.role,\n part: this.partId,\n face,\n accepts,\n capacity: p.capacity\n })}\n >\n <md-icon>back_hand</md-icon>${i18next.t('figure.button.add-place')}\n </button>\n `\n }\n\n /** The figure holds things: `Capacity` and `Holdable`, the ladder's middle rung. One part edit, one undo step. */\n private declareHolding(asset: FigureAsset) {\n const names = [...new Set([...(asset.document.capabilities.names ?? []), 'Capacity', 'Holdable'])]\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-capabilities', names } }, bubbles: true, composed: true }))\n }\n\n private renderDimensions(asset: FigureAsset) {\n const editable = followableAxes(asset, this.partId)\n const round = editable.length === 2\n const word = (axis: Axis) => i18next.t(round && axis === 'x' ? 'figure.label.resize-diameter' : `figure.label.resize-${axis}`)\n const others = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFollow(asset, one))\n const followsAll = editable.every(axis => followOf(asset, this.partId, axis).of === 'instance')\n /* A size of its own on every axis is the usual: nothing to read, only the way to make it follow (user 2026-10-01). */\n const allOwn = editable.every(axis => followOf(asset, this.partId, axis).of === 'own')\n return html`${asset.sizing === 'uniform' ? html`<p hint>${i18next.t('figure.text.resize-uniform-warning')}</p>` : nothing}\n ${allOwn ? nothing : html`<div resize-now>${editable.map(axis => {\n const now = followOf(asset, this.partId, axis)\n const following = now.of === 'instance' && now.axis === axis\n const custom = now.of !== 'own' && !following\n const mm = measureNow(this.revision!, this.partId, axis)\n return html`<div row>\n <b>${word(axis)}</b>\n <span measure>${mm === undefined ? '—' : `${Math.round(mm)} mm`}</span>\n <span>${custom ? followWordsOf(now, (key, params) => i18next.t(key, params)) : i18next.t(following ? 'figure.label.resize-following' : 'figure.label.follows-nothing')}</span>\n ${following\n ? html`<button quiet resize-unfollow=${axis} ?disabled=${this.locked}\n @click=${() => {\n this.follow(axis, 'own', now)\n }}>${i18next.t('figure.button.resize-unfollow')}</button>`\n : nothing}\n </div>`\n })}</div>`}\n ${followsAll\n ? nothing\n : html`<button act follow-size ?disabled=${this.locked || asset.sizing === 'uniform'} @click=${() => this.command({ kind: 'follow-size', part: this.partId })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.follow-size')}\n </button>`}\n <details resize-choice><summary>${i18next.t('figure.label.resize-advanced')}</summary><div>${followableAxes(asset, this.partId).map(axis => {\n const now = followOf(asset, this.partId, axis)\n const value = choiceOf(now)\n /* A cylinder's two measures are its radius and its length; its X and Y name them. */\n const name = round ? i18next.t(axis === 'x' ? 'figure.label.field-radius' : 'figure.label.field-length') : axis.toUpperCase()\n return html`<div row>\n <b>${name}</b>\n <select ?disabled=${this.locked} @change=${(e: Event) => this.follow(axis, (e.target as HTMLSelectElement).value, now)}>\n <option value=\"own\" ?selected=${value === 'own'}>${i18next.t('figure.label.follows-nothing')}</option>\n ${AXES.filter(one => hasInstanceSize(asset, one)).map(\n one => html`<option value=${`share:${one}`} ?selected=${value === `share:${one}`}>\n ${i18next.t('figure.label.follows-instance-share', { axis: one.toUpperCase() })}\n </option>\n <option value=${`instance:${one}`} ?selected=${value === `instance:${one}`}>\n ${i18next.t('figure.label.follows-instance', { axis: one.toUpperCase() })}\n </option>`\n )}\n ${others.flatMap(other =>\n AXES.map(\n one => html`<option value=${`part:${other}:${one}`} ?selected=${value === `part:${other}:${one}`}>${i18next.t('figure.label.follows-part-axis', { part: other, axis: one.toUpperCase() })}</option>`\n )\n )}\n ${now.of === 'expression' || now.of === 'input'\n ? html`<option value=${value} selected>${now.of === 'input' ? now.input : i18next.t('figure.label.follows-expression')}</option>`\n : nothing}\n </select>\n ${now.of === 'instance' || now.of === 'part'\n ? html`<span></span>\n <label inline-plus>\n ${i18next.t('figure.label.follows-plus')}\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.plus ?? 0)}\n @change=${(e: Event) => this.followPlus(axis, now, Number((e.target as HTMLInputElement).value) || 0)}\n />\n </label>`\n : nothing}\n </div>`\n })}</div></details>`\n }\n\n /**\n * 정렬·간격 고치기: the part moved inside the face it is fastened on, as one step -- the least move on each side it is\n * out, or centred when it is wider than the face. When nothing of it can be moved, why is said under the button, not\n * nothing at all (:3300, 2026-10-11: the button only scrolled to the drawing, which was already in view). The command\n * is the fastening window's for the same choice (`fasten-form.ts`), with only the place across the face changed.\n */\n private fixAlignment() {\n const revision = this.revision\n if (!revision) return\n const form = fastenFormOf(revision, this.partId)\n /* 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. */\n const own = figureFaceOverhangOf(revision.asset, this.partId, revision.inputs)\n const fixed =\n own?.state === 'unknown'\n ? ({ cannot: 'unmeasured' } as const)\n : own?.state === 'out' || own?.state === 'possible'\n ? insideAlignmentOf(fastenPlanOf(revision, this.partId, form).view, form.align, form.alignMm)\n : ({ cannot: 'inside' } as const)\n if ('cannot' in fixed) {\n this.fixNote = i18next.t(`figure.text.fix-alignment-${fixed.cannot}`, { part: this.partId, on: form.target })\n return\n }\n this.fixNote = ''\n const action = fastenPlanOf(revision, this.partId, { ...form, align: fixed.align, alignMm: fixed.alignMm }).action\n if (action) this.command(action)\n }\n\n /** The fastening window, asked of the editor: it opens over the canvas on what the part has now. */\n private openFastening() {\n this.dispatchEvent(new CustomEvent('fasten-open', { bubbles: true, composed: true }))\n }\n\n /**\n * What holds the part, said as its state -- 「아랫면을 바닥에 유지 중」 -- with the ways to change it: open the fastening,\n * or take it off. Right after \"follow size, attached\" this is the result, not a refusal (designer 2026-09-27).\n */\n private heldWords(asset: FigureAsset) {\n const joint = (asset.joints ?? []).find(j => j.body1.part === this.partId)\n const face = joint ? i18next.t(endPlaceKeyOf(joint.body1)) : ''\n const gap = joint?.origin?.gap ?? 0\n const place = i18next.t(`figure.label.resize-place-${asset.placement ?? 'floor'}`)\n const where = !joint\n ? i18next.t('figure.text.held-by-rule')\n : 'plane' in joint.body0\n ? typeof gap === 'number'\n ? i18next.t('figure.text.held-on-plane', { face, place, gap: String(gap) })\n : i18next.t('figure.text.held-on-plane-worked-out', { face, place })\n : i18next.t('figure.text.held-on-part', { face, other: joint.body0.part, otherFace: i18next.t(endPlaceKeyOf(joint.body0)) })\n return where\n }\n\n /** The same source, the same share, a new difference: a leaf the opening less its gaps (link-dimension's `plus`). */\n private followPlus(axis: Axis, now: Follow, plus: number) {\n if (now.of !== 'instance' && now.of !== 'part') return\n if ((now.plus ?? 0) === plus) return\n const source: FigureDimensionSource = now.of === 'instance' ? { of: 'instance', axis: now.axis } : { of: 'part', part: now.part, axis: now.axis }\n const times = now.of === 'instance' ? now.times : (now.times ?? 1)\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, ...(times !== 1 ? { times } : {}), ...(plus ? { plus } : {}), replace: true })\n }\n\n private follow(axis: Axis, choice: string, now: Follow) {\n const action = followCommandOf(this.revision!, this.partId, axis, choice, now)\n if (action) this.command(action)\n }\n\n /**\n * Positions worked out from other values, each with the way to\n * keep it where it is. This is the way out the release gate names when a resize leaves a part in the air.\n */\n private renderPositions(asset: FigureAsset) {\n return positionsWorkedOut(asset, this.partId).map(\n axis => html`<div pair>\n <span>${axis.toUpperCase()} · ${i18next.t(positionIsShare(asset, this.partId, axis) ? 'figure.label.position-in-proportion' : 'figure.label.position-worked-out')}</span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'fix-position', part: this.partId, axis })}>\n <md-icon>push_pin</md-icon>${i18next.t('figure.button.fix-position')}\n </button>\n ${hasInstanceSize(asset, axis) && !positionIsShare(asset, this.partId, axis)\n ? html`<button act ?disabled=${this.locked} title=${i18next.t('figure.text.scale-position-explained')} @click=${() => this.command({ kind: 'scale-position', part: this.partId, axis })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.scale-position')}\n </button>`\n : nothing}\n </div>`\n )\n }\n\n /**\n * The fastening in one line -- what, on which face, how -- and 「바꾸기」 to open the window where it is chosen (chief\n * architect 2026-10-16; user 2026-10-17: the result here, the editing in a window with room). Taking it off is in the\n * group's 「⋯」. What hangs over the face, and the way to fix it, stay here: they are about the fastening as it is now.\n */\n private renderFastening(asset: FigureAsset) {\n const revision = this.revision!\n const own = fasteningOf(revision, this.partId)\n /* Placed by an origin (ADR-0107 decision 4): attach writes faces, so the window would move it off its origin. Said, and taken off only. */\n if (own?.atOrigin)\n return html`<div fastened fasten-at-origin>\n <p>${this.heldWords(asset)}</p>\n ${this.renderDetachWords()}\n </div>`\n const overhang = html`${this.overhangNote.length ? html`<p hint overhang-note>${this.overhangNote.join(' ')}</p>` : nothing}\n ${this.overhangWords.length\n ? html`<div overhang role=\"status\">\n ${this.overhangWords.map(line => html`<p>${line}</p>`)}\n ${own\n ? html`<button act fix-alignment ?disabled=${this.locked} @click=${() => this.fixAlignment()}>\n <md-icon>tune</md-icon>${i18next.t('figure.button.fix-alignment')}\n </button>\n ${this.fixNote ? html`<p hint fix-note>${this.fixNote}</p>` : nothing}`\n : nothing}\n </div>`\n : nothing}`\n if (own && heldBy(asset, this.partId)) {\n const form = fastenFormOf(revision, this.partId)\n const plan = fastenPlanOf(revision, this.partId, form)\n if (plan.action) this.fastenCandidate = { action: plan.action, ...(plan.face ? { face: plan.face } : {}) }\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n return html`\n ${overhang}\n <div fastened-summary>\n <p fasten-sentence>${fastenSentenceOf(this.partId, form, plan, planeWord, (key, params) => i18next.t(key, params))}</p>\n <button act change-fastening ?disabled=${this.locked} @click=${() => this.openFastening()}>${i18next.t('figure.button.change-fastening')}</button>\n </div>\n ${this.renderDetachWords()}\n `\n }\n /* A blank attachment is not a form to decipher: what it does, and the way to the window. */\n return html`\n ${overhang}\n <p hint>${i18next.t('figure.text.fasten-start')}</p>\n <button act fasten-start ?disabled=${this.locked} @click=${() => this.openFastening()}>\n <md-icon>link</md-icon>${i18next.t('figure.button.fasten-start')}\n </button>\n `\n }\n\n private renderDetachWords() {\n /* One thing to say is a line, not a list of one. */\n if (this.detachWords.length === 1) return html`<p hint detach-words>${this.detachWords[0]}</p>`\n return this.detachWords.length ? html`<ul detach-words>${this.detachWords.map(line => html`<li>${line}</li>`)}</ul>` : nothing\n }\n\n /**\n * Making the part a row across what it is fastened to (figure-model `make-repeat`): along one of the axes across its\n * face, copies a pitch apart filling the parent's length, or a count spread over it. Once made, the row's own section\n * (the editor's) shows it and takes it away.\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 ? html`<ul preview-words role=\"status\">${this.previewWords.map(line => html`<li>${line}</li>`)}</ul>` : nothing\n }\n\n /**\n * A row (ADR-0097 §5.5): said as what it makes, \"arranged in a row\". Where it cannot be made here, why, rather than\n * nothing. Filling the length, the centre spacing is the author's; a count of their own is spread evenly over the\n * length -- figure-model draws it so, and the form does not ask for a spacing it would not use.\n */\n private renderRow(asset: FigureAsset) {\n if (rowOf(asset, this.partId)) return nothing\n const blocked = rowBlockOf(asset, this.partId)\n const axes = rowAxesOf(asset, this.partId)\n const r = this.row\n /*\n Folded, open while it is being worked (2026-10-02): a row is made now and then, and most parts stand on the plane,\n where the section said its reason open on every one. Opened, it says why or asks how.\n */\n const head = html`<summary><h3>${i18next.t('figure.label.repeat')}</h3></summary>`\n if (blocked || !axes.length)\n return html`<section row><details row-fold>\n ${head}\n <p hint row-blocked>${i18next.t(`figure.text.row-blocked-${blocked ?? 'unfastened'}`, { part: this.partId })}</p>\n ${blocked === 'unfastened'\n ? html`<button act @click=${() => this.dispatchEvent(new CustomEvent('go-fasten', { bubbles: true, composed: true }))}><md-icon>link</md-icon>${i18next.t('figure.button.go-fasten')}</button>`\n : nothing}\n </details></section>`\n const axis = axes.includes(r.axis as Axis) ? (r.axis as Axis) : axes[0]!\n const ok = r.fills ? r.pitch > 0 : Number.isSafeInteger(r.count) && r.count >= 1\n const action = ok\n ? ({ kind: 'make-repeat', part: this.partId, axis, pitch: r.fills ? r.pitch : Math.max(r.pitch, 1), ...(r.fills ? {} : { count: r.count }) } as FigureAuthoringAction)\n : undefined\n this.rowCandidate = action\n const set = (next: typeof r) => ((this.row = next), (this.rowOpen = true))\n /*\n Whether the row is being worked follows the fold's own toggle. A press on the heading focuses it before the click;\n set on focus, the fold opened there and the click then folded it again (2026-10-11: it took two clicks to open).\n */\n const toggled = (e: Event) => (this.rowOpen = (e.target as HTMLDetailsElement).open)\n return html`<section row><details row-fold ?open=${this.rowOpen} @toggle=${toggled}>\n ${head}\n <div form>\n <span>${i18next.t('figure.label.repeat-axis')}</span>\n <select @change=${(e: Event) => set({ ...r, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${axes.map(a => html`<option value=${a} ?selected=${a === axis}>${a.toUpperCase()}</option>`)}\n </select>\n </div>\n <div row-basis role=\"radiogroup\" aria-label=${i18next.t('figure.label.row-basis')}>\n <label><input type=\"radio\" name=\"row-basis\" .checked=${r.fills} @change=${() => set({ ...r, fills: true })} />${i18next.t('figure.label.repeat-fills')}</label>\n <label><input type=\"radio\" name=\"row-basis\" .checked=${!r.fills} @change=${() => set({ ...r, fills: false })} />${i18next.t('figure.label.row-by-count')}</label>\n </div>\n ${r.fills\n ? html`<div form>\n <span>${i18next.t('figure.label.repeat-pitch')} · mm</span>\n <input type=\"number\" step=\"any\" min=\"0\" .value=${String(r.pitch)} @change=${(e: Event) => set({ ...r, pitch: Number((e.target as HTMLInputElement).value) })} />\n </div>`\n : html`<div form>\n <span>${i18next.t('figure.label.repeat-count')}</span>\n <input type=\"number\" step=\"1\" min=\"1\" .value=${String(r.count)} @change=${(e: Event) => set({ ...r, count: Number((e.target as HTMLInputElement).value) })} />\n </div>\n <p hint>${i18next.t('figure.text.row-count-spreads')}</p>`}\n ${action && this.rowOpen ? this.renderPreviewWords() : nothing}\n <button act ?disabled=${this.locked || !action} @click=${() => action && this.command(action)}>\n <md-icon>view_week</md-icon>${i18next.t('figure.button.make-repeat')}\n </button>\n </details></section>`\n }\n\n /**\n * When the part is drawn: always, or while a control is at least a value -- a lamp lit while the gate is open. One\n * part edit (`set-visibility`), one step. Offered once the figure has a control; a motion is what makes one.\n */\n private renderShown(asset: FigureAsset) {\n const controls = visibilityControlsOf(asset)\n if (!controls.length) return nothing\n const now = shownWhenOf(asset, this.partId)\n const send = (shownWhen: { input: string; atLeast: number } | null) =>\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-visibility', target: this.partId, shownWhen } }, bubbles: true, composed: true }))\n const first = (id: string) => {\n const c = controls.find(one => one.id === id)!\n return Math.round((c.min + (c.max - c.min) * 0.01) * 1000) / 1000\n }\n const unit = now ? controls.find(c => c.id === now.input)?.unit : ''\n return html`<div form>\n <span>${i18next.t('figure.label.shown-when')}</span>\n <select\n ?disabled=${this.locked}\n @change=${(e: Event) => {\n const id = (e.target as HTMLSelectElement).value\n send(id ? { input: id, atLeast: now?.input === id ? now.atLeast : first(id) } : null)\n }}\n >\n <option value=\"\" ?selected=${!now}>${i18next.t('figure.label.shown-always')}</option>\n ${controls.map(c => html`<option value=${c.id} ?selected=${now?.input === c.id}>${i18next.t('figure.label.shown-while', { control: c.label })}</option>`)}\n </select>\n ${now\n ? html`<span>${i18next.t('figure.label.shown-at-least')}${unit ? ` (${unit})` : ''}</span>\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.atLeast)}\n @change=${(e: Event) => {\n const v = (e.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(v)) send({ input: now.input, atLeast: v })\n }}\n />`\n : nothing}\n </div>`\n }\n\n private renderMotion(asset: FigureAsset) {\n const now = motionOf(asset, this.partId)\n const joint = asset.joints?.find(j => j.body1.part === this.partId)\n if (now && !(this.editingMotion && joint)) {\n /* Which part moves, against what, which way, how far -- by name (ADR-0097 §5.5). */\n const against = joint ? ('plane' in joint.body0 ? i18next.t('figure.label.mounting-plane') : joint.body0.part) : ''\n const ends = this.motionEnds\n return html`<p motion-summary>\n ${i18next.t('figure.text.motion-summary', {\n part: this.partId,\n against,\n kind: i18next.t('figure.label.motion-' + now.kind),\n axis: now.vector ? jointAxisWord(now.vector) : String(now.axis).toUpperCase()\n })}\n </p>\n ${ends\n ? html`<p hint motion-ends>${i18next.t('figure.text.motion-ends-shown', { min: String(ends.min), max: String(ends.max), unit: ends.unit })}</p>`\n : nothing}\n <div pair>\n <span>\n ${i18next.t('figure.label.motion-' + now.kind)} · ${now.vector ? jointAxisWord(now.vector) : String(now.axis).toUpperCase()}\n ${now.travel\n ? html`<small>${i18next.t('figure.label.motion-travel-is', { part: now.travel.part, axis: now.travel.axis.toUpperCase(), plus: now.travel.plus ?? 0 })}</small>`\n : nothing}\n ${now.follows?.sum.length === 1\n ? html`<small>${i18next.t('figure.label.motion-follows', { joint: now.follows.sum[0]!.joint, multiplier: now.follows.sum[0]!.multiplier, offset: now.follows.offset })}</small>`\n : now.follows\n ? html`<small>${i18next.t('figure.label.motion-follow')}: ${now.follows.sum.map(t => `${t.joint} × ${t.multiplier}`).join(' + ')} + ${now.follows.offset}</small>`\n : now.control\n ? html`<small>${now.control.id} (${now.control.unit}) ${now.control.min} … ${now.control.max}</small>`\n : nothing}\n </span>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => joint && this.command({ kind: 'set-joint', joint: fixedJointOf(joint) })}\n >\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}\n </button>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => {\n if (!joint) return\n this.motion = motionFormOf(joint)\n this.editingMotion = true\n }}\n >\n <md-icon>edit</md-icon>${i18next.t('figure.button.change-motion')}\n </button>\n </div>`\n }\n /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */\n if (!joint)\n return html`<p hint>${i18next.t('figure.text.fasten-before-moving')}</p>\n <button act go-fasten @click=${() => this.dispatchEvent(new CustomEvent('go-fasten', { bubbles: true, composed: true }))}>\n <md-icon>link</md-icon>${i18next.t('figure.button.go-fasten')}\n </button>`\n const m = this.motion\n const unit = m.kind === 'slide' ? 'mm' : 'deg'\n /* A follower follows a joint that moves the same way; a choice the kind no longer allows is dropped. */\n const leaders = leadersFor(asset, this.partId, m.kind)\n const follow = leaders.some(j => j.id === m.follow) ? m.follow : ''\n const refusal = motionFormRefusalOf(m, follow)\n return html`\n <div pair>\n <select @change=${(e: Event) => this.setKind((e.target as HTMLSelectElement).value as 'slide' | 'turn' | 'continuous')}>\n <option value=\"slide\" ?selected=${m.kind === 'slide'}>${i18next.t('figure.label.motion-slide')}</option>\n <option value=\"turn\" ?selected=${m.kind === 'turn'}>${i18next.t('figure.label.motion-turn')}</option>\n <option value=\"continuous\" ?selected=${m.kind === 'continuous'}>${i18next.t('figure.label.motion-continuous')}</option>\n </select>\n ${m.axisVector\n ? html`<span motion-axis-vector>${i18next.t('figure.label.motion-axis')} ${jointAxisWord(m.axisVector)}</span>`\n : html`<select @change=${(e: Event) => (this.motion = { ...m, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${AXES.map(a => html`<option value=${a} ?selected=${a === m.axis}>${i18next.t('figure.label.motion-axis')} ${a.toUpperCase()}</option>`)}\n </select>`}\n </div>\n ${m.followSum\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <span>${m.followSum.map(t => `${t.joint} × ${t.multiplier}`).join(' + ')}</span>\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : leaders.length\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, follow: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!follow}>${i18next.t('figure.label.motion-own-control')}</option>\n ${leaders.map(j => html`<option value=${j.id} ?selected=${j.id === follow}>${j.body1.part}${j.state ? ` · ${j.state.id}` : ''}</option>`)}\n </select>\n </div>`\n : nothing}\n ${m.followSum\n ? nothing\n : follow\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-multiplier')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.multiplier)} @change=${(e: Event) => (this.motion = { ...m, multiplier: Number((e.target as HTMLInputElement).value) })} />\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : html`<div form>\n ${m.kind === 'slide'\n ? html`<span>${i18next.t('figure.label.motion-travel')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, travel: (e.target as HTMLSelectElement).value })}>\n ${m.travelSum\n ? html`<option value=\"\" ?selected=${!m.travel}>${m.travelSum.sum.map(t => `${t.from.of === 'input' ? t.from.input : `${t.from.of === 'part' ? t.from.part : i18next.t('figure.label.motion-travel')} · ${t.from.axis.toUpperCase()}`}${t.times !== undefined && t.times !== 1 ? ` × ${t.times}` : ''}`).join(' + ')}</option>`\n : html`<option value=\"\" ?selected=${!m.travel}>${i18next.t('figure.label.motion-travel-mm')}</option>`}\n ${asset.appearance\n .map(look => look.target)\n .filter(one => canFollow(asset, one))\n .flatMap(one => AXES.map(a => html`<option value=${`${one}:${a}`} ?selected=${m.travel === `${one}:${a}`}>${one} · ${a.toUpperCase()}</option>`))}\n </select>\n ${m.travel\n ? html`<span>${i18next.t('figure.label.follows-plus')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.travelPlus ?? 0)} @change=${(e: Event) => (this.motion = { ...m, travelPlus: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}`\n : nothing}\n <span>${i18next.t('figure.label.control-id')}</span>\n <input .value=${m.id} placeholder=${`${this.partId}-${m.kind}`} @change=${(e: Event) => (this.motion = { ...m, id: (e.target as HTMLInputElement).value.trim() })} />\n ${m.kind === 'continuous' || (m.kind === 'slide' && (m.travel || m.travelSum))\n ? nothing\n : html`<span>${i18next.t('figure.label.control-range')} (${unit})</span>\n <div pair>\n <input type=\"number\" step=\"any\" .value=${String(m.min)} @change=${(e: Event) => (this.motion = { ...m, min: Number((e.target as HTMLInputElement).value) })} />\n <input type=\"number\" step=\"any\" .value=${String(m.max)} @change=${(e: Event) => (this.motion = { ...m, max: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n </div>`}\n <button\n act\n ?disabled=${this.locked || !!refusal}\n title=${refusal === 'range' ? i18next.t('figure.text.range-needs-room') : ''}\n @click=${() => {\n this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })\n this.editingMotion = false\n }}\n >\n <md-icon>animation</md-icon>${i18next.t(this.editingMotion ? 'figure.button.apply-motion-change' : 'figure.button.add-motion')}\n </button>\n ${this.editingMotion\n ? html`<button act @click=${() => (this.editingMotion = false)}><md-icon>undo</md-icon>${i18next.t('figure.button.cancel-motion-change')}</button>`\n : nothing}\n `\n }\n\n private setKind(kind: 'slide' | 'turn' | 'continuous') {\n this.motion = kind === 'slide' ? { ...this.motion, kind, min: 0, max: 500 } : { ...this.motion, kind, min: -90, max: 90 }\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"figure-links.js","sourceRoot":"","sources":["../../client/modeller/figure-links.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,2CAA2C,CAAA;AAClD,OAAO,+BAA+B,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,SAAS,EACT,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACR,aAAa,EACb,MAAM,EACN,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,kBAAkB,EAClB,UAAU,EAIX,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,YAAY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AAO,EAAE,CAAC;;2CAAc;AAEV;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAA4B;AAE3B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CAAsF;AAErF;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAA6B;AAE5B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAA4B;AAE3B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;gDAA2B;AAQzC;IAAhB,KAAK,EAAE;;4CAAwB;AAIf;IAAhB,KAAK,EAAE;;4CAAqB;AACZ;IAAhB,KAAK,EAAE;;2CAA2C;AAClC;IAAhB,KAAK,EAAE;;0CAA6B;AAEpB;IAAhB,KAAK,EAAE;;6CAAkC;AACzB;IAAhB,KAAK,EAAE;;wCAAyB;AAEhB;IAAhB,KAAK,EAAE;;kDAA8B;AArH3B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAsxBvB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport '@operato/input/ox-input-select-buttons.js'\nimport './figure-slot-layout-panel.js'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureFaceOverhangOf } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureAuthoringAction, FigureDimensionSource, FigureFace } from '@hatiolab/figure-model'\n\nimport {\n acceptsOf,\n AXES,\n canFasten,\n canFollow,\n followCommandOf,\n followableAxes,\n positionIsShare,\n choiceOf,\n followWordsOf,\n heldBy,\n followOf,\n shownWhenOf,\n visibilityControlsOf,\n fasteningOf,\n hasInstanceSize,\n holdsThings,\n leadersFor,\n motionOf,\n motionFormOf,\n motionFormRefusalOf,\n endPlaceKeyOf,\n motionJoint,\n placeFacesOf,\n placeIdFor,\n placesOn,\n rowAxesOf,\n rowBlockOf,\n fixedJointOf,\n rowOf,\n positionsWorkedOut,\n measureNow,\n type Axis,\n type Follow,\n type MotionForm\n} from './links.js'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport { insideAlignmentOf } from './fasten-geometry.js'\nimport { fastenFormOf, fastenPlanOf, fastenSentenceOf } from './fasten-form.js'\nimport type { FigureRevision } from './revision.js'\nimport { HelpToggles } from './help.js'\nimport { groupMenu, GroupMenuStyles } from './group-menu.js'\nimport { jointAxisWord } from './joint-axis.js'\nimport { placeTerms } from '@things-factory/figure-viewer/dist-client/detail-facts.js'\n\nconst freshMotion = (): MotionForm => ({ kind: 'slide', axis: 'x', id: '', min: 0, max: 500, follow: '', multiplier: 1, offset: 0, travel: '', travelPlus: 0 })\nconst freshRow = () => ({ axis: '' as Axis | '', pitch: 200, fills: true, count: 5 })\nconst freshPlace = () => ({ role: 'grip' as 'seat' | 'grip', face: 'top' as FigureFace, label: '', accepts: '', capacity: 1 })\n\n/**\n * What a part is tied to — its size response, what it is fastened to, how it moves.\n *\n * 「Build Once, Fit Anywhere」 lives here: a dimension that follows the instance size or another part is what lets\n * a figure be placed at any size, and a part fastened to the face it rests on is what keeps it there when that\n * happens. The release gate refuses a figure that falls apart when resized, and tells the author to fasten the\n * parts that come away — this is where they do it. Motion is a joint: a slide or a turn driven by a control.\n *\n * The sections are dimensions, placement and joint, in that order. Every\n * change is one figure-model authoring command, sent as `command` and run by the editor through the session — one\n * step of the undo history. The fastening is said here in one line; it is chosen in the fastening window\n * (`figure-fasten-dialog.ts`), which the editor opens when this asks (`fasten-open`). Choices the command would refuse (a round body fastened, a size following an instance\n * size the figure does not declare) are not offered, so the author is not sent into a refusal.\n */\n@customElement('figure-links')\nexport class FigureLinks extends localize(i18next)(LitElement) {\n private readonly help = new HelpToggles(this)\n static styles = [SidePanelStyles, GroupMenuStyles, css`\n :host {\n display: block;\n }\n /* A group's sub-question, under its title: quieter than the title, as a label is. */\n p[group-question] {\n margin: 4px 0 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The fastening a part has, in one line, and 「바꾸기」 at its end. */\n div[fastened-summary] {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n div[fastened-summary] > p {\n flex: 1;\n margin: 0;\n }\n /* Opening the form is an action: the primary colour, at the line's end. */\n div[fastened-summary] > button[act] {\n flex: none;\n margin: 0 -6px 0 0;\n }\n /* The measure's name, then its rule: X, or a cylinder's 반지름 · 길이, on one line. */\n div[row] > b {\n white-space: nowrap;\n }\n div[row] {\n display: grid;\n grid-template-columns: minmax(24px, max-content) minmax(0, 1fr);\n gap: 6px;\n align-items: center;\n }\n b[bound] {\n font-weight: 600;\n }\n /* What each direction does now: read-only rows. */\n div[resize-now] { display: grid; gap: 4px; margin: 12px 0; }\n div[resize-now] div[row] { grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; }\n div[resize-now] span[measure] { font-variant-numeric: tabular-nums; }\n /* Size behaviour is a choice about dimensions only. It never implies a placement or a fastening. */\n /* One of the size group's rows: the group's gap spaces it, as it does the rest (a margin on top of it left a hole). */\n details[resize-choice] { margin: 0; padding: 0; border: 0; }\n details[resize-choice] > div { display: grid; gap: 8px; padding: 8px 0; }\n p[fasten-mode] { margin: 0; font-weight: 600; }\n details { margin-top: 8px; }\n details[row-fold] { margin: 0; }\n details[row-fold] > summary { padding: 0; color: var(--md-sys-color-on-surface); }\n details[row-fold] > summary h3 { margin: 0; }\n details[row-fold][open] > summary { margin-bottom: 8px; }\n /* What the command would do, said beside the result drawn on the canvas. */\n 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; }\n p[preview-words] { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--md-sys-color-surface-container, #8881); }\n div[row-basis] { display: grid; gap: 4px; margin: 8px 0; }\n div[row-basis] label { display: flex; align-items: center; gap: 6px; }\n 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); }\n div[overhang] p { margin: 0; }\n ul[detach-words] { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 2px; }\n /* The difference a following measure keeps: under its choice, on the same line as its words. */\n label[inline-plus] {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n label[inline-plus] input {\n flex: 1;\n min-width: 0;\n }\n `]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n private get asset(): FigureAsset | undefined {\n return this.revision?.asset\n }\n /** The selected part. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */\n @property() section: 'shape' | 'response' | 'places' | 'motion' = 'shape'\n /**\n * Its tab is the one shown, and no window over it speaks instead. The response's row speaks of what a command would\n * draw, and the properties' says there is none: only the one in sight may, as the hidden one's silence would clear what\n * the shown one draws. While the fastening window is open it alone speaks (the editor sets this false).\n */\n @property({ type: Boolean }) active = true\n /** What the row's command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Where the selected part's motion takes it, at both ends of its range (the editor draws them on the canvas). */\n @property({ attribute: false }) motionEnds: { control: string; min: number; max: number; unit: string } | null = null\n /** Past the edge of the face it is fastened to, or parts fastened to it past theirs (ADR-0097 §5.5, Q3). */\n @property({ attribute: false }) overhangWords: string[] = []\n /** Wider than the face it is fastened to: how far past each edge, and whether off to one side -- a fact, not a warning. */\n @property({ attribute: false }) overhangNote: string[] = []\n /** What taking this part off would do, said beside the buttons that do it (worked out on a copy by the editor). */\n @property({ attribute: false }) detachWords: string[] = []\n /*\n What a section speaks of on the canvas: the response's row while its fold is open; the properties', the fastening the\n part has -- its face lit, as the one-line result says it.\n */\n private candidate?: { action: FigureAuthoringAction; face?: { part: string; face: string } }\n private fastenCandidate?: { action: FigureAuthoringAction; face?: { part: string; face: string } }\n private told = ''\n @state() private rowOpen = false\n private rowCandidate?: FigureAuthoringAction\n\n /** Why 정렬·간격 고치기 moved nothing, said under it; empty once it moved the part or the part changed. */\n @state() private fixNote = ''\n @state() private motion: MotionForm = freshMotion()\n @state() private place = freshPlace()\n /** How places are made here: one at a time, or by the figure's rule. Unset: by the rule when the figure has one. */\n @state() private placesBy?: 'one' | 'rule'\n @state() private row = freshRow()\n /** The motion form is open over the part's own motion, to change it where it is. */\n @state() private editingMotion = false\n\n /*\n The forms describe the next command for the selected part, so another part starts from the defaults: carrying the\n last part's choices over fastened a shutter curtain level with a right edge nobody chose for it (2026-09-25).\n */\n /* The part the forms were loaded for. A panel made with a part already chosen loaded nothing, and said \"editing the\n fastening it has\" over an empty target (2026-09-27, :3391, the doors). */\n private loadedFor?: string\n willUpdate(changed: Map<string, unknown>) {\n /* Its tab shown again: what it would draw is said again, over whatever the other tab left. */\n if (changed.has('active') && this.active && changed.get('active') === false) this.told = ''\n /* What 고치기 said is about the figure as it was: another step or another part, and it no longer holds. */\n if (changed.has('asset') || changed.has('partId')) this.fixNote = ''\n if (this.asset && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.motion = freshMotion()\n this.place = freshPlace()\n this.row = freshRow()\n this.editingMotion = false\n }\n }\n\n updated() {\n /* Only the sections that hold a form speak of what it would do, and only while their tab is shown: the panel has\n one of these per section, and the others' silence cleared what it showed (2026-09-27, :3391). */\n const speaks = this.active && (this.section === 'shape' || this.section === 'response')\n if (!speaks) return\n const said = JSON.stringify(this.candidate ?? null)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: this.candidate ?? null, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* The panel left: what it showed goes with it. */\n if (this.told && this.told !== 'null') this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n }\n\n render() {\n const asset = this.asset\n this.candidate = undefined\n this.fastenCandidate = undefined\n this.rowCandidate = undefined\n if (!asset || !this.partId) return nothing\n if (this.section === 'motion')\n return html`<section><h3>${i18next.t('figure.label.motion')}${this.help.button('figure.text.motion-explained')}</h3>${this.help.hint('figure.text.motion-explained')}\n ${this.renderMotion(asset)}${this.renderShown(asset)}</section>`\n if (this.section === 'places') {\n /*\n One idea, places, two ways to make them (ADR-0118): one at a time on this part, or many by a rule -- the figure's\n slot layout. One section with a choice, not two screens for the same thing (chief architect, 2026-10-11).\n */\n const byRule = (this.placesBy ?? (asset.document.capabilities.slotLayout ? 'rule' : 'one')) === 'rule'\n return html`<section><h3>${i18next.t('figure.label.places-on-part', { part: this.partId })}${this.help.button('figure.text.place-explained')}</h3>${this.help.hint('figure.text.place-explained')}\n <ox-input-select-buttons\n places-by\n .value=${byRule ? 'rule' : 'one'}\n .options=${[\n { value: 'one', display: i18next.t('figure.label.places-one') },\n { value: 'rule', display: i18next.t('figure.label.places-by-rule') }\n ]}\n @change=${(e: CustomEvent) => (this.placesBy = e.detail === 'rule' ? 'rule' : 'one')}\n ></ox-input-select-buttons>\n ${byRule\n ? html`<figure-slot-layout-panel .asset=${asset} .partId=${this.partId} ?locked=${this.locked}></figure-slot-layout-panel>`\n : placeFacesOf(asset, this.partId).length\n ? this.renderPlaces(asset)\n : html`<p hint>${i18next.t('figure.text.places-need-a-box')}</p>`}</section>`\n }\n /*\n Three groups in one order whatever the part's state (chief architect 2026-10-16): its size, its place, its row. The\n editor's own numbers go in through the slots, so a group keeps its place when a rule or a fastening takes them over.\n */\n /* Fastened, by a face or by an origin: either can be taken off, from the place group's 「⋯」. */\n const held = !!heldBy(asset, this.partId) || !!(this.revision && fasteningOf(this.revision, this.partId)?.atOrigin)\n if (this.section === 'response') {\n /*\n How the part answers a size it is placed at (user 2026-10-17, the 「반응형」 tab): its own measures, where it\n stands, and the row it may make -- what Build Once, Fit Anywhere is authored with, in one place.\n */\n const positions = positionsWorkedOut(asset, this.partId)\n const response = html`\n <section size-response>\n <h3>${i18next.t('figure.label.group-size')}</h3>\n <p group-question>${i18next.t('figure.label.resize-intent')}</p>\n ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n ${positions.length\n ? html`<section position-response>\n <h3>${i18next.t('figure.label.group-position-response')}</h3>\n ${this.renderPositions(asset)}\n </section>`\n : nothing}\n ${rowOf(asset, this.partId) ? html`<slot name=\"row\"></slot>` : this.renderRow(asset)}\n `\n this.candidate = this.rowOpen && this.rowCandidate ? { action: this.rowCandidate } : undefined\n return response\n }\n const shown = html`\n <section size>\n <h3>${i18next.t('figure.label.group-size')}</h3>\n <slot name=\"size\"></slot>\n </section>\n <section fastening>\n <h3>\n ${i18next.t('figure.label.group-place')}${this.help.button('figure.text.fastening-explained')}\n ${groupMenu([{ label: i18next.t('figure.button.detach'), icon: 'link_off', disabled: this.locked || !held, run: () => this.command({ kind: 'detach', part: this.partId }) }])}\n </h3>${this.help.hint('figure.text.fastening-explained')}\n <slot name=\"place\"></slot>\n ${canFasten(asset, this.partId) ? this.renderFastening(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n `\n this.candidate = this.fastenCandidate\n return shown\n }\n\n /** Where things are held on this part: a seat things rest on, or a grip things are held in. */\n private renderPlaces(asset: FigureAsset) {\n const faces = placeFacesOf(asset, this.partId)\n const p = this.place\n const face = faces.includes(p.face) ? p.face : faces[0]!\n const accepts = acceptsOf(p.accepts)\n const capacityOk = Number.isSafeInteger(p.capacity) && p.capacity >= 1\n const roleName = (role: string) => i18next.t('figure.label.place-' + role)\n return html`\n ${placesOn(asset, this.partId).map(\n one => html`<div pair>\n <span>\n <b bound>${one.label}</b>\n <small>${one.face ? i18next.t('figure.label.face-' + one.face) + ' · ' : ''}${placeTerms(one, (key, params) => i18next.t(key, params))}</small>\n </span>\n <button quiet ?disabled=${this.locked} @click=${() => this.command({ kind: 'remove-binding', id: one.id })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-place')}\n </button>\n </div>`\n )}\n ${holdsThings(asset)\n ? nothing\n : html`<p hint>${i18next.t('figure.text.place-needs-holding')}</p>\n <button act ?disabled=${this.locked} @click=${() => this.declareHolding(asset)}>\n <md-icon>inventory_2</md-icon>${i18next.t('figure.button.declare-holding')}\n </button>`}\n <div pair>\n <select @change=${(e: Event) => (this.place = { ...p, role: (e.target as HTMLSelectElement).value as 'seat' | 'grip' })}>\n <option value=\"grip\" ?selected=${p.role === 'grip'}>${roleName('grip')}</option>\n <option value=\"seat\" ?selected=${p.role === 'seat'}>${roleName('seat')}</option>\n </select>\n <select @change=${(e: Event) => (this.place = { ...p, face: (e.target as HTMLSelectElement).value as FigureFace })}>\n ${faces.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div form>\n <span>${i18next.t('figure.label.place-name')}</span>\n <input .value=${p.label} placeholder=${roleName(p.role)} @change=${(e: Event) => (this.place = { ...p, label: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-accepts')}</span>\n <input .value=${p.accepts} placeholder=\"BOX, TOTE\" @input=${(e: Event) => (this.place = { ...p, accepts: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-capacity')}</span>\n <input type=\"number\" min=\"1\" step=\"1\" .value=${String(p.capacity)} @change=${(e: Event) => (this.place = { ...p, capacity: (e.target as HTMLInputElement).valueAsNumber })} />\n </div>\n ${accepts.length ? nothing : html`<small>${i18next.t('figure.text.place-accepts-needed')}</small>`}\n <button\n act\n ?disabled=${this.locked || !accepts.length || !capacityOk}\n @click=${() =>\n this.command({\n kind: 'add-binding',\n id: placeIdFor(asset, this.partId, p.role),\n label: p.label.trim() || roleName(p.role),\n role: p.role,\n part: this.partId,\n face,\n accepts,\n capacity: p.capacity\n })}\n >\n <md-icon>back_hand</md-icon>${i18next.t('figure.button.add-place')}\n </button>\n `\n }\n\n /** The figure holds things: `Capacity` and `Holdable`, the ladder's middle rung. One part edit, one undo step. */\n private declareHolding(asset: FigureAsset) {\n const names = [...new Set([...(asset.document.capabilities.names ?? []), 'Capacity', 'Holdable'])]\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-capabilities', names } }, bubbles: true, composed: true }))\n }\n\n private renderDimensions(asset: FigureAsset) {\n const editable = followableAxes(asset, this.partId)\n const round = editable.length === 2\n const word = (axis: Axis) => i18next.t(round && axis === 'x' ? 'figure.label.resize-diameter' : `figure.label.resize-${axis}`)\n const others = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFollow(asset, one))\n const followsAll = editable.every(axis => followOf(asset, this.partId, axis).of === 'instance')\n /* A size of its own on every axis is the usual: nothing to read, only the way to make it follow (user 2026-10-01). */\n const allOwn = editable.every(axis => followOf(asset, this.partId, axis).of === 'own')\n return html`${asset.sizing === 'uniform' ? html`<p hint>${i18next.t('figure.text.resize-uniform-warning')}</p>` : nothing}\n ${allOwn ? nothing : html`<div resize-now>${editable.map(axis => {\n const now = followOf(asset, this.partId, axis)\n const following = now.of === 'instance' && now.axis === axis\n const custom = now.of !== 'own' && !following\n const mm = measureNow(this.revision!, this.partId, axis)\n return html`<div row>\n <b>${word(axis)}</b>\n <span measure>${mm === undefined ? '—' : `${Math.round(mm)} mm`}</span>\n <span>${custom ? followWordsOf(now, (key, params) => i18next.t(key, params)) : i18next.t(following ? 'figure.label.resize-following' : 'figure.label.follows-nothing')}</span>\n ${following\n ? html`<button quiet resize-unfollow=${axis} ?disabled=${this.locked}\n @click=${() => {\n this.follow(axis, 'own', now)\n }}>${i18next.t('figure.button.resize-unfollow')}</button>`\n : nothing}\n </div>`\n })}</div>`}\n ${followsAll\n ? nothing\n : html`<button act follow-size ?disabled=${this.locked || asset.sizing === 'uniform'} @click=${() => this.command({ kind: 'follow-size', part: this.partId })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.follow-size')}\n </button>`}\n <details resize-choice><summary>${i18next.t('figure.label.resize-advanced')}</summary><div>${followableAxes(asset, this.partId).map(axis => {\n const now = followOf(asset, this.partId, axis)\n const value = choiceOf(now)\n /* A cylinder's two measures are its radius and its length; its X and Y name them. */\n const name = round ? i18next.t(axis === 'x' ? 'figure.label.field-radius' : 'figure.label.field-length') : axis.toUpperCase()\n return html`<div row>\n <b>${name}</b>\n <select ?disabled=${this.locked} @change=${(e: Event) => this.follow(axis, (e.target as HTMLSelectElement).value, now)}>\n <option value=\"own\" ?selected=${value === 'own'}>${i18next.t('figure.label.follows-nothing')}</option>\n ${AXES.filter(one => hasInstanceSize(asset, one)).map(\n one => html`<option value=${`share:${one}`} ?selected=${value === `share:${one}`}>\n ${i18next.t('figure.label.follows-instance-share', { axis: one.toUpperCase() })}\n </option>\n <option value=${`instance:${one}`} ?selected=${value === `instance:${one}`}>\n ${i18next.t('figure.label.follows-instance', { axis: one.toUpperCase() })}\n </option>`\n )}\n ${others.flatMap(other =>\n AXES.map(\n one => html`<option value=${`part:${other}:${one}`} ?selected=${value === `part:${other}:${one}`}>${i18next.t('figure.label.follows-part-axis', { part: other, axis: one.toUpperCase() })}</option>`\n )\n )}\n ${now.of === 'expression' || now.of === 'input'\n ? html`<option value=${value} selected>${now.of === 'input' ? now.input : i18next.t('figure.label.follows-expression')}</option>`\n : nothing}\n </select>\n ${now.of === 'instance' || now.of === 'part'\n ? html`<span></span>\n <label inline-plus>\n ${i18next.t('figure.label.follows-plus')}\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.plus ?? 0)}\n @change=${(e: Event) => this.followPlus(axis, now, Number((e.target as HTMLInputElement).value) || 0)}\n />\n </label>`\n : nothing}\n </div>`\n })}</div></details>`\n }\n\n /**\n * 정렬·간격 고치기: the part moved inside the face it is fastened on, as one step -- the least move on each side it is\n * out, or centred when it is wider than the face. When nothing of it can be moved, why is said under the button, not\n * nothing at all (:3300, 2026-10-11: the button only scrolled to the drawing, which was already in view). The command\n * is the fastening window's for the same choice (`fasten-form.ts`), with only the place across the face changed.\n */\n private fixAlignment() {\n const revision = this.revision\n if (!revision) return\n const form = fastenFormOf(revision, this.partId)\n /* Whether it is out, and the least move that brings it in, are the kernel's measure (ADR-0140 3.8). */\n const own = figureFaceOverhangOf(revision.asset, this.partId, revision.inputs)\n const fixed =\n own?.state === 'unknown'\n ? ({ cannot: 'unmeasured' } as const)\n : own?.state === 'out' || own?.state === 'possible'\n ? insideAlignmentOf(fastenPlanOf(revision, this.partId, form).view, form.align, form.alignMm)\n : ({ cannot: 'inside' } as const)\n if ('cannot' in fixed) {\n this.fixNote = i18next.t(`figure.text.fix-alignment-${fixed.cannot}`, { part: this.partId, on: form.target })\n return\n }\n this.fixNote = ''\n const action = fastenPlanOf(revision, this.partId, { ...form, align: fixed.align, alignMm: fixed.alignMm }).action\n if (action) this.command(action)\n }\n\n /** The fastening window, asked of the editor: it opens over the canvas on what the part has now. */\n private openFastening() {\n this.dispatchEvent(new CustomEvent('fasten-open', { bubbles: true, composed: true }))\n }\n\n /**\n * What holds the part, said as its state -- 「바닥에 붙어 있음」 -- with the ways to change it: open the fastening,\n * or take it off. Right after \"follow size, attached\" this is the result, not a refusal (designer 2026-09-27).\n */\n private heldWords(asset: FigureAsset) {\n const joint = (asset.joints ?? []).find(j => j.body1.part === this.partId)\n const gap = joint?.origin?.gap ?? 0\n const place = i18next.t(`figure.label.resize-place-${asset.placement ?? 'floor'}`)\n const where = !joint\n ? i18next.t('figure.text.held-by-rule')\n : 'plane' in joint.body0\n ? typeof gap === 'number'\n ? i18next.t('figure.text.held-on-plane', { place, gap: String(gap) })\n : i18next.t('figure.text.held-on-plane-worked-out', { place })\n : i18next.t('figure.text.held-on-part', { other: joint.body0.part, otherFace: i18next.t(endPlaceKeyOf(joint.body0)) })\n return where\n }\n\n /** The same source, the same share, a new difference: a leaf the opening less its gaps (link-dimension's `plus`). */\n private followPlus(axis: Axis, now: Follow, plus: number) {\n if (now.of !== 'instance' && now.of !== 'part') return\n if ((now.plus ?? 0) === plus) return\n const source: FigureDimensionSource = now.of === 'instance' ? { of: 'instance', axis: now.axis } : { of: 'part', part: now.part, axis: now.axis }\n const times = now.of === 'instance' ? now.times : (now.times ?? 1)\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, ...(times !== 1 ? { times } : {}), ...(plus ? { plus } : {}), replace: true })\n }\n\n private follow(axis: Axis, choice: string, now: Follow) {\n const action = followCommandOf(this.revision!, this.partId, axis, choice, now)\n if (action) this.command(action)\n }\n\n /**\n * Positions worked out from other values, each with the way to\n * keep it where it is. This is the way out the release gate names when a resize leaves a part in the air.\n */\n private renderPositions(asset: FigureAsset) {\n return positionsWorkedOut(asset, this.partId).map(\n axis => html`<div pair>\n <span>${axis.toUpperCase()} · ${i18next.t(positionIsShare(asset, this.partId, axis) ? 'figure.label.position-in-proportion' : 'figure.label.position-worked-out')}</span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'fix-position', part: this.partId, axis })}>\n <md-icon>push_pin</md-icon>${i18next.t('figure.button.fix-position')}\n </button>\n ${hasInstanceSize(asset, axis) && !positionIsShare(asset, this.partId, axis)\n ? html`<button act ?disabled=${this.locked} title=${i18next.t('figure.text.scale-position-explained')} @click=${() => this.command({ kind: 'scale-position', part: this.partId, axis })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.scale-position')}\n </button>`\n : nothing}\n </div>`\n )\n }\n\n /**\n * The fastening in one line -- what, on which face, how -- and 「바꾸기」 to open the window where it is chosen (chief\n * architect 2026-10-16; user 2026-10-17: the result here, the editing in a window with room). Taking it off is in the\n * group's 「⋯」. What hangs over the face, and the way to fix it, stay here: they are about the fastening as it is now.\n */\n private renderFastening(asset: FigureAsset) {\n const revision = this.revision!\n const own = fasteningOf(revision, this.partId)\n /* Placed by an origin (ADR-0107 decision 4): attach writes faces, so the window would move it off its origin. Said, and taken off only. */\n if (own?.atOrigin)\n return html`<div fastened fasten-at-origin>\n <p>${this.heldWords(asset)}</p>\n ${this.renderDetachWords()}\n </div>`\n const overhang = html`${this.overhangNote.length ? html`<p hint overhang-note>${this.overhangNote.join(' ')}</p>` : nothing}\n ${this.overhangWords.length\n ? html`<div overhang role=\"status\">\n ${this.overhangWords.map(line => html`<p>${line}</p>`)}\n ${own\n ? html`<button act fix-alignment ?disabled=${this.locked} @click=${() => this.fixAlignment()}>\n <md-icon>tune</md-icon>${i18next.t('figure.button.fix-alignment')}\n </button>\n ${this.fixNote ? html`<p hint fix-note>${this.fixNote}</p>` : nothing}`\n : nothing}\n </div>`\n : nothing}`\n if (own && heldBy(asset, this.partId)) {\n const form = fastenFormOf(revision, this.partId)\n const plan = fastenPlanOf(revision, this.partId, form)\n if (plan.action) this.fastenCandidate = { action: plan.action, ...(plan.face ? { face: plan.face } : {}) }\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n return html`\n ${overhang}\n <div fastened-summary>\n <p fasten-sentence>${fastenSentenceOf(form, plan, planeWord, (key, params) => i18next.t(key, params))}</p>\n <button act change-fastening ?disabled=${this.locked} @click=${() => this.openFastening()}>${i18next.t('figure.button.change-fastening')}</button>\n </div>\n ${this.renderDetachWords()}\n `\n }\n /* A blank attachment is not a form to decipher: what it does, and the way to the window. */\n return html`\n ${overhang}\n <p hint>${i18next.t('figure.text.fasten-start')}</p>\n <button act fasten-start ?disabled=${this.locked} @click=${() => this.openFastening()}>\n <md-icon>link</md-icon>${i18next.t('figure.button.fasten-start')}\n </button>\n `\n }\n\n private renderDetachWords() {\n /* One thing to say is a line, not a list of one. */\n if (this.detachWords.length === 1) return html`<p hint detach-words>${this.detachWords[0]}</p>`\n return this.detachWords.length ? html`<ul detach-words>${this.detachWords.map(line => html`<li>${line}</li>`)}</ul>` : nothing\n }\n\n /**\n * Making the part a row across what it is fastened to (figure-model `make-repeat`): along one of the axes across its\n * face, copies a pitch apart filling the parent's length, or a count spread over it. Once made, the row's own section\n * (the editor's) shows it and takes it away.\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 ? html`<ul preview-words role=\"status\">${this.previewWords.map(line => html`<li>${line}</li>`)}</ul>` : nothing\n }\n\n /**\n * A row (ADR-0097 §5.5): said as what it makes, \"arranged in a row\". Where it cannot be made here, why, rather than\n * nothing. Filling the length, the centre spacing is the author's; a count of their own is spread evenly over the\n * length -- figure-model draws it so, and the form does not ask for a spacing it would not use.\n */\n private renderRow(asset: FigureAsset) {\n if (rowOf(asset, this.partId)) return nothing\n const blocked = rowBlockOf(asset, this.partId)\n const axes = rowAxesOf(asset, this.partId)\n const r = this.row\n /*\n Folded, open while it is being worked (2026-10-02): a row is made now and then, and most parts stand on the plane,\n where the section said its reason open on every one. Opened, it says why or asks how.\n */\n const head = html`<summary><h3>${i18next.t('figure.label.repeat')}</h3></summary>`\n if (blocked || !axes.length)\n return html`<section row><details row-fold>\n ${head}\n <p hint row-blocked>${i18next.t(`figure.text.row-blocked-${blocked ?? 'unfastened'}`, { part: this.partId })}</p>\n ${blocked === 'unfastened'\n ? html`<button act @click=${() => this.dispatchEvent(new CustomEvent('go-fasten', { bubbles: true, composed: true }))}><md-icon>link</md-icon>${i18next.t('figure.button.go-fasten')}</button>`\n : nothing}\n </details></section>`\n const axis = axes.includes(r.axis as Axis) ? (r.axis as Axis) : axes[0]!\n const ok = r.fills ? r.pitch > 0 : Number.isSafeInteger(r.count) && r.count >= 1\n const action = ok\n ? ({ kind: 'make-repeat', part: this.partId, axis, pitch: r.fills ? r.pitch : Math.max(r.pitch, 1), ...(r.fills ? {} : { count: r.count }) } as FigureAuthoringAction)\n : undefined\n this.rowCandidate = action\n const set = (next: typeof r) => ((this.row = next), (this.rowOpen = true))\n /*\n Whether the row is being worked follows the fold's own toggle. A press on the heading focuses it before the click;\n set on focus, the fold opened there and the click then folded it again (2026-10-11: it took two clicks to open).\n */\n const toggled = (e: Event) => (this.rowOpen = (e.target as HTMLDetailsElement).open)\n return html`<section row><details row-fold ?open=${this.rowOpen} @toggle=${toggled}>\n ${head}\n <div form>\n <span>${i18next.t('figure.label.repeat-axis')}</span>\n <select @change=${(e: Event) => set({ ...r, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${axes.map(a => html`<option value=${a} ?selected=${a === axis}>${a.toUpperCase()}</option>`)}\n </select>\n </div>\n <div row-basis role=\"radiogroup\" aria-label=${i18next.t('figure.label.row-basis')}>\n <label><input type=\"radio\" name=\"row-basis\" .checked=${r.fills} @change=${() => set({ ...r, fills: true })} />${i18next.t('figure.label.repeat-fills')}</label>\n <label><input type=\"radio\" name=\"row-basis\" .checked=${!r.fills} @change=${() => set({ ...r, fills: false })} />${i18next.t('figure.label.row-by-count')}</label>\n </div>\n ${r.fills\n ? html`<div form>\n <span>${i18next.t('figure.label.repeat-pitch')} · mm</span>\n <input type=\"number\" step=\"any\" min=\"0\" .value=${String(r.pitch)} @change=${(e: Event) => set({ ...r, pitch: Number((e.target as HTMLInputElement).value) })} />\n </div>`\n : html`<div form>\n <span>${i18next.t('figure.label.repeat-count')}</span>\n <input type=\"number\" step=\"1\" min=\"1\" .value=${String(r.count)} @change=${(e: Event) => set({ ...r, count: Number((e.target as HTMLInputElement).value) })} />\n </div>\n <p hint>${i18next.t('figure.text.row-count-spreads')}</p>`}\n ${action && this.rowOpen ? this.renderPreviewWords() : nothing}\n <button act ?disabled=${this.locked || !action} @click=${() => action && this.command(action)}>\n <md-icon>view_week</md-icon>${i18next.t('figure.button.make-repeat')}\n </button>\n </details></section>`\n }\n\n /**\n * When the part is drawn: always, or while a control is at least a value -- a lamp lit while the gate is open. One\n * part edit (`set-visibility`), one step. Offered once the figure has a control; a motion is what makes one.\n */\n private renderShown(asset: FigureAsset) {\n const controls = visibilityControlsOf(asset)\n if (!controls.length) return nothing\n const now = shownWhenOf(asset, this.partId)\n const send = (shownWhen: { input: string; atLeast: number } | null) =>\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-visibility', target: this.partId, shownWhen } }, bubbles: true, composed: true }))\n const first = (id: string) => {\n const c = controls.find(one => one.id === id)!\n return Math.round((c.min + (c.max - c.min) * 0.01) * 1000) / 1000\n }\n const unit = now ? controls.find(c => c.id === now.input)?.unit : ''\n return html`<div form>\n <span>${i18next.t('figure.label.shown-when')}</span>\n <select\n ?disabled=${this.locked}\n @change=${(e: Event) => {\n const id = (e.target as HTMLSelectElement).value\n send(id ? { input: id, atLeast: now?.input === id ? now.atLeast : first(id) } : null)\n }}\n >\n <option value=\"\" ?selected=${!now}>${i18next.t('figure.label.shown-always')}</option>\n ${controls.map(c => html`<option value=${c.id} ?selected=${now?.input === c.id}>${i18next.t('figure.label.shown-while', { control: c.label })}</option>`)}\n </select>\n ${now\n ? html`<span>${i18next.t('figure.label.shown-at-least')}${unit ? ` (${unit})` : ''}</span>\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.atLeast)}\n @change=${(e: Event) => {\n const v = (e.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(v)) send({ input: now.input, atLeast: v })\n }}\n />`\n : nothing}\n </div>`\n }\n\n private renderMotion(asset: FigureAsset) {\n const now = motionOf(asset, this.partId)\n const joint = asset.joints?.find(j => j.body1.part === this.partId)\n if (now && !(this.editingMotion && joint)) {\n /* Which part moves, against what, which way, how far -- by name (ADR-0097 §5.5). */\n const against = joint ? ('plane' in joint.body0 ? i18next.t('figure.label.mounting-plane') : joint.body0.part) : ''\n const ends = this.motionEnds\n return html`<p motion-summary>\n ${i18next.t('figure.text.motion-summary', {\n part: this.partId,\n against,\n kind: i18next.t('figure.label.motion-' + now.kind),\n axis: now.vector ? jointAxisWord(now.vector) : String(now.axis).toUpperCase()\n })}\n </p>\n ${ends\n ? html`<p hint motion-ends>${i18next.t('figure.text.motion-ends-shown', { min: String(ends.min), max: String(ends.max), unit: ends.unit })}</p>`\n : nothing}\n <div pair>\n <span>\n ${i18next.t('figure.label.motion-' + now.kind)} · ${now.vector ? jointAxisWord(now.vector) : String(now.axis).toUpperCase()}\n ${now.travel\n ? html`<small>${i18next.t('figure.label.motion-travel-is', { part: now.travel.part, axis: now.travel.axis.toUpperCase(), plus: now.travel.plus ?? 0 })}</small>`\n : nothing}\n ${now.follows?.sum.length === 1\n ? html`<small>${i18next.t('figure.label.motion-follows', { joint: now.follows.sum[0]!.joint, multiplier: now.follows.sum[0]!.multiplier, offset: now.follows.offset })}</small>`\n : now.follows\n ? html`<small>${i18next.t('figure.label.motion-follow')}: ${now.follows.sum.map(t => `${t.joint} × ${t.multiplier}`).join(' + ')} + ${now.follows.offset}</small>`\n : now.control\n ? html`<small>${now.control.id} (${now.control.unit}) ${now.control.min} … ${now.control.max}</small>`\n : nothing}\n </span>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => joint && this.command({ kind: 'set-joint', joint: fixedJointOf(joint) })}\n >\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}\n </button>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => {\n if (!joint) return\n this.motion = motionFormOf(joint)\n this.editingMotion = true\n }}\n >\n <md-icon>edit</md-icon>${i18next.t('figure.button.change-motion')}\n </button>\n </div>`\n }\n /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */\n if (!joint)\n return html`<p hint>${i18next.t('figure.text.fasten-before-moving')}</p>\n <button act go-fasten @click=${() => this.dispatchEvent(new CustomEvent('go-fasten', { bubbles: true, composed: true }))}>\n <md-icon>link</md-icon>${i18next.t('figure.button.go-fasten')}\n </button>`\n const m = this.motion\n const unit = m.kind === 'slide' ? 'mm' : 'deg'\n /* A follower follows a joint that moves the same way; a choice the kind no longer allows is dropped. */\n const leaders = leadersFor(asset, this.partId, m.kind)\n const follow = leaders.some(j => j.id === m.follow) ? m.follow : ''\n const refusal = motionFormRefusalOf(m, follow)\n return html`\n <div pair>\n <select @change=${(e: Event) => this.setKind((e.target as HTMLSelectElement).value as 'slide' | 'turn' | 'continuous')}>\n <option value=\"slide\" ?selected=${m.kind === 'slide'}>${i18next.t('figure.label.motion-slide')}</option>\n <option value=\"turn\" ?selected=${m.kind === 'turn'}>${i18next.t('figure.label.motion-turn')}</option>\n <option value=\"continuous\" ?selected=${m.kind === 'continuous'}>${i18next.t('figure.label.motion-continuous')}</option>\n </select>\n ${m.axisVector\n ? html`<span motion-axis-vector>${i18next.t('figure.label.motion-axis')} ${jointAxisWord(m.axisVector)}</span>`\n : html`<select @change=${(e: Event) => (this.motion = { ...m, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${AXES.map(a => html`<option value=${a} ?selected=${a === m.axis}>${i18next.t('figure.label.motion-axis')} ${a.toUpperCase()}</option>`)}\n </select>`}\n </div>\n ${m.followSum\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <span>${m.followSum.map(t => `${t.joint} × ${t.multiplier}`).join(' + ')}</span>\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : leaders.length\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, follow: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!follow}>${i18next.t('figure.label.motion-own-control')}</option>\n ${leaders.map(j => html`<option value=${j.id} ?selected=${j.id === follow}>${j.body1.part}${j.state ? ` · ${j.state.id}` : ''}</option>`)}\n </select>\n </div>`\n : nothing}\n ${m.followSum\n ? nothing\n : follow\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-multiplier')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.multiplier)} @change=${(e: Event) => (this.motion = { ...m, multiplier: Number((e.target as HTMLInputElement).value) })} />\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : html`<div form>\n ${m.kind === 'slide'\n ? html`<span>${i18next.t('figure.label.motion-travel')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, travel: (e.target as HTMLSelectElement).value })}>\n ${m.travelSum\n ? html`<option value=\"\" ?selected=${!m.travel}>${m.travelSum.sum.map(t => `${t.from.of === 'input' ? t.from.input : `${t.from.of === 'part' ? t.from.part : i18next.t('figure.label.motion-travel')} · ${t.from.axis.toUpperCase()}`}${t.times !== undefined && t.times !== 1 ? ` × ${t.times}` : ''}`).join(' + ')}</option>`\n : html`<option value=\"\" ?selected=${!m.travel}>${i18next.t('figure.label.motion-travel-mm')}</option>`}\n ${asset.appearance\n .map(look => look.target)\n .filter(one => canFollow(asset, one))\n .flatMap(one => AXES.map(a => html`<option value=${`${one}:${a}`} ?selected=${m.travel === `${one}:${a}`}>${one} · ${a.toUpperCase()}</option>`))}\n </select>\n ${m.travel\n ? html`<span>${i18next.t('figure.label.follows-plus')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.travelPlus ?? 0)} @change=${(e: Event) => (this.motion = { ...m, travelPlus: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}`\n : nothing}\n <span>${i18next.t('figure.label.control-id')}</span>\n <input .value=${m.id} placeholder=${`${this.partId}-${m.kind}`} @change=${(e: Event) => (this.motion = { ...m, id: (e.target as HTMLInputElement).value.trim() })} />\n ${m.kind === 'continuous' || (m.kind === 'slide' && (m.travel || m.travelSum))\n ? nothing\n : html`<span>${i18next.t('figure.label.control-range')} (${unit})</span>\n <div pair>\n <input type=\"number\" step=\"any\" .value=${String(m.min)} @change=${(e: Event) => (this.motion = { ...m, min: Number((e.target as HTMLInputElement).value) })} />\n <input type=\"number\" step=\"any\" .value=${String(m.max)} @change=${(e: Event) => (this.motion = { ...m, max: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n </div>`}\n <button\n act\n ?disabled=${this.locked || !!refusal}\n title=${refusal === 'range' ? i18next.t('figure.text.range-needs-room') : ''}\n @click=${() => {\n this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })\n this.editingMotion = false\n }}\n >\n <md-icon>animation</md-icon>${i18next.t(this.editingMotion ? 'figure.button.apply-motion-change' : 'figure.button.add-motion')}\n </button>\n ${this.editingMotion\n ? html`<button act @click=${() => (this.editingMotion = false)}><md-icon>undo</md-icon>${i18next.t('figure.button.cancel-motion-change')}</button>`\n : nothing}\n `\n }\n\n private setKind(kind: 'slide' | 'turn' | 'continuous') {\n this.motion = kind === 'slide' ? { ...this.motion, kind, min: 0, max: 500 } : { ...this.motion, kind, min: -90, max: 90 }\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\n }\n}\n"]}
@@ -12,8 +12,8 @@ const round = (v, step) => Number((Math.round(v / step) * step).toFixed(Math.max
12
12
  /** `origin.parentRotate` (ADR-0107, named for its end by ADR-0140 3.6), URDF's rpy: Rz·Ry·Rx about the fixed axes. */
13
13
  const rotateMatrix = (j) => eulerMatrixOrder(AXES.map(a => j.origin?.parentRotate?.[a] ?? 0), 'ZYX');
14
14
  const eulerMatrixOrder = (deg, order) => new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(...deg.map(THREE.MathUtils.degToRad), order));
15
- /** The part's own quarter turn in the joint frame, as the record says it (`origin.childRotate`). */
16
- const turnMatrix = (j) => eulerMatrix(AXES.map(a => j.origin?.childRotate?.[a] ?? 0));
15
+ /** The part's own pose on its end, any angle, as the record says it (`origin.childRotate`, Rz·Ry·Rx, ADR-0140 3.11). */
16
+ const turnMatrix = (j) => eulerMatrixOrder(AXES.map(a => j.origin?.childRotate?.[a] ?? 0), 'ZYX');
17
17
  /** The joint frame's rotation in the figure: the part's rotation now, less its own turn and less the joint's. */
18
18
  function jointFrameRotation(j, part, angle) {
19
19
  const now = matrixOf(part.pose.r);
@@ -90,9 +90,9 @@ export function jointDragOf(asset, id, part, result, values) {
90
90
  }
91
91
  return { kind: 'joint', joint: { ...j, origin: { ...origin, offset } } };
92
92
  }
93
- const normal = 'plane' in j.body0 ? 'y' : FACE_AXIS[j.body0.face];
94
- /* Which way a larger gap moves the part: out of the face it meets (on the plane: up when it stands, down when it hangs). */
95
- const outward = 'plane' in j.body0 ? ('face' in j.body1 && j.body1.face === 'bottom' ? 1 : -1) : ((j.origin?.facing ?? 'meet') === 'meet' ? 1 : -1) * FACE_SIGN[j.body0.face];
93
+ const normal = 'plane' in j.body0 ? (asset.placement === 'wall' ? 'z' : 'y') : FACE_AXIS[j.body0.face];
94
+ /* Which way a larger gap moves the part: out of the face it meets or sits by its middle on, into it when flush with it (ADR-0140 3.11). */
95
+ const outward = ((j.origin?.facing ?? 'meet') === 'flush' ? -1 : 1) * ('plane' in j.body0 ? 1 : FACE_SIGN[j.body0.face]);
96
96
  const along = local[normal];
97
97
  if (Math.abs(along) >= 0.5) {
98
98
  const gap = origin.gap ?? 0;
@@ -1 +1 @@
1
- {"version":3,"file":"joint-drag.js","sourceRoot":"","sources":["../../client/modeller/joint-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAI/E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAsB9D,MAAM,IAAI,GAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACpC,wFAAwF;AACxF,MAAM,SAAS,GAAyB,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AAC/G,MAAM,SAAS,GAA2B,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,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EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAA;IAC/E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;AACnD,CAAC","sourcesContent":["import * as THREE from 'three'\nimport { compileFigureAsset, figureMimicTermsOf } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureJoint } from '@hatiolab/figure-model'\n\nimport type { GizmoResult } from './gizmo.js'\nimport { jointAxisUnit, jointAxisWord } from './joint-axis.js'\nimport type { FigureRenderPart } from './renderer.js'\n\n/*\n * A gizmo drag on a part that hangs from a joint edits the joint, not the part (ADR-0093; r3 §3: the modeller changes\n * the inputs of the relation, and never breaks it because a computed place was moved):\n *\n * - turning a part on a revolute or continuous joint sets the joint's value -- the turn about the joint's axis;\n * - sliding a part on a prismatic joint along its axis sets its value;\n * - moving a part any other way moves the joint's origin: the gap along the face it sits on, the offset across it;\n * at a parent's origin (ADR-0107 decision 4), its `origin.offset` in the parent's frame.\n *\n * What would break a relation is refused and said: an origin that follows another part's size, a joint that mimics\n * another, a turn on a joint that does not turn.\n */\n\nexport type JointDrag =\n | { kind: 'value'; input: string; unit: 'deg' | 'mm' | 'ratio'; value: number }\n | { kind: 'joint'; joint: FigureJoint }\n | { kind: 'refused'; reason: 'mimic' | 'fixed-turn' | 'origin-follows' | 'turned-slide' | 'off-axis'; joint: string; leader?: string; axis?: string }\n\ntype Axis = 'x' | 'y' | 'z'\nconst AXES: Axis[] = ['x', 'y', 'z']\n/** The axis each face faces along, and which way (as figure-model's `FIGURE_FACES`). */\nconst FACE_AXIS: Record<string, Axis> = { left: 'x', right: 'x', bottom: 'y', top: 'y', back: 'z', front: 'z' }\nconst FACE_SIGN: Record<string, number> = { left: -1, right: 1, bottom: -1, top: 1, back: -1, front: 1 }\n\nconst matrixOf = (r: number[][]) => new THREE.Matrix4().set(r[0]![0]!, r[0]![1]!, r[0]![2]!, 0, r[1]![0]!, r[1]![1]!, r[1]![2]!, 0, r[2]![0]!, r[2]![1]!, r[2]![2]!, 0, 0, 0, 0, 1)\nconst eulerMatrix = (deg: number[]) => new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(...(deg.map(THREE.MathUtils.degToRad) as [number, number, number]), 'XYZ'))\nconst unit = (axis: unknown) => new THREE.Vector3(...(jointAxisUnit(axis) ?? [0, 0, 0]))\nconst round = (v: number, step: number) => Number((Math.round(v / step) * step).toFixed(Math.max(0, -Math.floor(Math.log10(step)))))\n\n/** `origin.parentRotate` (ADR-0107, named for its end by ADR-0140 3.6), URDF's rpy: Rz·Ry·Rx about the fixed axes. */\nconst rotateMatrix = (j: FigureJoint) => eulerMatrixOrder(AXES.map(a => j.origin?.parentRotate?.[a] ?? 0), 'ZYX')\nconst eulerMatrixOrder = (deg: number[], order: THREE.EulerOrder) => new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(...(deg.map(THREE.MathUtils.degToRad) as [number, number, number]), order))\n\n/** The part's own quarter turn in the joint frame, as the record says it (`origin.childRotate`). */\nconst turnMatrix = (j: FigureJoint) => eulerMatrix(AXES.map(a => j.origin?.childRotate?.[a] ?? 0))\n\n/** The joint frame's rotation in the figure: the part's rotation now, less its own turn and less the joint's. */\nfunction jointFrameRotation(j: FigureJoint, part: FigureRenderPart, angle: number): THREE.Matrix4 {\n const now = matrixOf(part.pose.r as number[][])\n const own = turnMatrix(j)\n const turn = j.type === 'revolute' ? new THREE.Matrix4().makeRotationAxis(unit(j.axis!), THREE.MathUtils.degToRad(angle)) : new THREE.Matrix4()\n return now.multiply(own.invert()).multiply(turn.invert())\n}\n\nexport function jointDragOf(asset: FigureAsset, id: string, part: FigureRenderPart, result: GizmoResult, values: Record<string, number>): JointDrag | null {\n const j = asset.joints?.find(joint => joint.body1.part === id)\n /* A size is the part's own, not the joint's: a scale drag goes to the part's measures (the editor drops the shift). */\n if (!j || result.scale || (!result.rotation && !result.position)) return null\n const stateId = j.state?.id ?? j.id\n const now = values[stateId] ?? asset.stateDefaults[stateId] ?? 0\n const turns = j.type === 'revolute'\n /* A revolute joint without limits turns without end (USD). */\n const endless = turns && j.lowerLimit === undefined && j.upperLimit === undefined\n\n if (result.rotation) {\n if (!turns) return { kind: 'refused', reason: j.type === 'prismatic' ? 'turned-slide' : 'fixed-turn', joint: j.id }\n if (j.mimic) return { kind: 'refused', reason: 'mimic', joint: j.id, leader: figureMimicTermsOf(j.mimic)!.sum.map(t => t.joint).join(', ') }\n /* The turn about the joint's axis (the twist of the change): the only turn the joint can make. */\n const before = new THREE.Quaternion().setFromRotationMatrix(matrixOf(part.pose.r as number[][]))\n const after = new THREE.Quaternion().setFromRotationMatrix(eulerMatrix(result.rotation))\n const change = after.multiply(before.invert())\n const axis = unit(j.axis!).applyMatrix4(jointFrameRotation(j, part, now)).normalize()\n const twist = 2 * Math.atan2(change.x * axis.x + change.y * axis.y + change.z * axis.z, change.w)\n /* Turned about another axis: the joint cannot make that turn, and nothing is written for it. */\n const whole = 2 * Math.acos(Math.min(1, Math.abs(change.w)))\n if (Math.abs(twist) < whole * 0.5) return { kind: 'refused', reason: 'off-axis', joint: j.id, axis: jointAxisWord(j.axis) }\n let value = now + THREE.MathUtils.radToDeg(twist)\n if (endless) value = ((((value + 180) % 360) + 360) % 360) - 180\n else value = Math.min(Math.max(value, j.lowerLimit!), j.upperLimit!)\n return { kind: 'value', input: stateId, unit: 'deg', value: round(value, 0.1) }\n }\n\n const moved = new THREE.Vector3(...result.position!).sub(new THREE.Vector3(...(part.pose.t as [number, number, number])))\n if (moved.length() < 0.5) return null\n const frame = jointFrameRotation(j, part, turns ? now : 0)\n\n if (j.type === 'prismatic') {\n if (j.mimic) return { kind: 'refused', reason: 'mimic', joint: j.id, leader: figureMimicTermsOf(j.mimic)!.sum.map(t => t.joint).join(', ') }\n /* How far one unit of the value moves the part along its axis, measured on the figure itself (a ratio travels a length). */\n const along = unit(j.axis!).applyMatrix4(frame).normalize()\n const at = (v: number) => {\n const g = compileFigureAsset(asset).evaluate({ ...values, [stateId]: v }).geometry.find(g => g.id === id && 'pose' in g) as { pose: { t: number[] } } | undefined\n return g ? new THREE.Vector3(...(g.pose.t as [number, number, number])).dot(along) : 0\n }\n const step = j.travel ? 0.01 : 1\n const rate = (at(now + step) - at(now)) / step\n if (Math.abs(rate) > 1e-9 && Math.abs(moved.dot(along)) >= moved.length() * 0.7) {\n const value = Math.min(Math.max(now + moved.dot(along) / rate, j.lowerLimit!), j.upperLimit!)\n return { kind: 'value', input: stateId, unit: j.travel ? 'ratio' : 'mm', value: round(value, j.travel ? 0.001 : 1) }\n }\n }\n\n /* Moving the joint's origin: the change in the frame it is placed in, before `origin.parentRotate` turns the joint frame. */\n const local = moved.clone().applyMatrix4(frame.clone().multiply(rotateMatrix(j).invert()).invert())\n const origin: NonNullable<FigureJoint['origin']> = { ...(j.origin ?? {}) }\n if (!('plane' in j.body0) && !('face' in j.body0)) {\n /* At the parent's origin there is no face: the frame moves by its offset, along the parent's axes. */\n const offset = { ...(j.origin?.offset ?? {}) }\n for (const axis of AXES) {\n const d = local[axis]\n if (Math.abs(d) < 0.5) continue\n const was = offset[axis] ?? 0\n if (typeof was !== 'number') return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n offset[axis] = round(was + d, 1)\n }\n return { kind: 'joint', joint: { ...j, origin: { ...origin, offset } } as FigureJoint }\n }\n const normal: Axis = 'plane' in j.body0 ? 'y' : FACE_AXIS[j.body0.face]!\n /* Which way a larger gap moves the part: out of the face it meets (on the plane: up when it stands, down when it hangs). */\n const outward = 'plane' in j.body0 ? ('face' in j.body1 && j.body1.face === 'bottom' ? 1 : -1) : ((j.origin?.facing ?? 'meet') === 'meet' ? 1 : -1) * FACE_SIGN[j.body0.face]!\n const along = local[normal]\n if (Math.abs(along) >= 0.5) {\n const gap = origin.gap ?? 0\n if (typeof gap !== 'number') return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n origin.gap = round(gap + outward * along, 1)\n }\n for (const axis of AXES.filter(a => a !== normal)) {\n const d = local[axis]\n if (Math.abs(d) < 0.5) continue\n const how = origin.align?.[axis] ?? 'centre'\n const was = how === 'centre' ? 0 : typeof how === 'object' && typeof how.mm === 'number' ? how.mm : null\n if (was === null) return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n origin.align = { ...(origin.align ?? {}), [axis]: { mm: round(was + d, 1) } }\n }\n return { kind: 'joint', joint: { ...j, origin } }\n}\n"]}
1
+ {"version":3,"file":"joint-drag.js","sourceRoot":"","sources":["../../client/modeller/joint-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAI/E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAsB9D,MAAM,IAAI,GAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACpC,wFAAwF;AACxF,MAAM,SAAS,GAAyB,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AAC/G,MAAM,SAAS,GAA2B,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AAExG,MAAM,QAAQ,GAAG,CAAC,CAAa,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE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ureJoint } from '@hatiolab/figure-model'\n\nimport type { GizmoResult } from './gizmo.js'\nimport { jointAxisUnit, jointAxisWord } from './joint-axis.js'\nimport type { FigureRenderPart } from './renderer.js'\n\n/*\n * A gizmo drag on a part that hangs from a joint edits the joint, not the part (ADR-0093; r3 §3: the modeller changes\n * the inputs of the relation, and never breaks it because a computed place was moved):\n *\n * - turning a part on a revolute or continuous joint sets the joint's value -- the turn about the joint's axis;\n * - sliding a part on a prismatic joint along its axis sets its value;\n * - moving a part any other way moves the joint's origin: the gap along the face it sits on, the offset across it;\n * at a parent's origin (ADR-0107 decision 4), its `origin.offset` in the parent's frame.\n *\n * What would break a relation is refused and said: an origin that follows another part's size, a joint that mimics\n * another, a turn on a joint that does not turn.\n */\n\nexport type JointDrag =\n | { kind: 'value'; input: string; unit: 'deg' | 'mm' | 'ratio'; value: number }\n | { kind: 'joint'; joint: FigureJoint }\n | { kind: 'refused'; reason: 'mimic' | 'fixed-turn' | 'origin-follows' | 'turned-slide' | 'off-axis'; joint: string; leader?: string; axis?: string }\n\ntype Axis = 'x' | 'y' | 'z'\nconst AXES: Axis[] = ['x', 'y', 'z']\n/** The axis each face faces along, and which way (as figure-model's `FIGURE_FACES`). */\nconst FACE_AXIS: Record<string, Axis> = { left: 'x', right: 'x', bottom: 'y', top: 'y', back: 'z', front: 'z' }\nconst FACE_SIGN: Record<string, number> = { left: -1, right: 1, bottom: -1, top: 1, back: -1, front: 1 }\n\nconst matrixOf = (r: number[][]) => new THREE.Matrix4().set(r[0]![0]!, r[0]![1]!, r[0]![2]!, 0, r[1]![0]!, r[1]![1]!, r[1]![2]!, 0, r[2]![0]!, r[2]![1]!, r[2]![2]!, 0, 0, 0, 0, 1)\nconst eulerMatrix = (deg: number[]) => new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(...(deg.map(THREE.MathUtils.degToRad) as [number, number, number]), 'XYZ'))\nconst unit = (axis: unknown) => new THREE.Vector3(...(jointAxisUnit(axis) ?? [0, 0, 0]))\nconst round = (v: number, step: number) => Number((Math.round(v / step) * step).toFixed(Math.max(0, -Math.floor(Math.log10(step)))))\n\n/** `origin.parentRotate` (ADR-0107, named for its end by ADR-0140 3.6), URDF's rpy: Rz·Ry·Rx about the fixed axes. */\nconst rotateMatrix = (j: FigureJoint) => eulerMatrixOrder(AXES.map(a => j.origin?.parentRotate?.[a] ?? 0), 'ZYX')\nconst eulerMatrixOrder = (deg: number[], order: THREE.EulerOrder) => new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(...(deg.map(THREE.MathUtils.degToRad) as [number, number, number]), order))\n\n/** The part's own pose on its end, any angle, as the record says it (`origin.childRotate`, Rz·Ry·Rx, ADR-0140 3.11). */\nconst turnMatrix = (j: FigureJoint) => eulerMatrixOrder(AXES.map(a => j.origin?.childRotate?.[a] ?? 0), 'ZYX')\n\n/** The joint frame's rotation in the figure: the part's rotation now, less its own turn and less the joint's. */\nfunction jointFrameRotation(j: FigureJoint, part: FigureRenderPart, angle: number): THREE.Matrix4 {\n const now = matrixOf(part.pose.r as number[][])\n const own = turnMatrix(j)\n const turn = j.type === 'revolute' ? new THREE.Matrix4().makeRotationAxis(unit(j.axis!), THREE.MathUtils.degToRad(angle)) : new THREE.Matrix4()\n return now.multiply(own.invert()).multiply(turn.invert())\n}\n\nexport function jointDragOf(asset: FigureAsset, id: string, part: FigureRenderPart, result: GizmoResult, values: Record<string, number>): JointDrag | null {\n const j = asset.joints?.find(joint => joint.body1.part === id)\n /* A size is the part's own, not the joint's: a scale drag goes to the part's measures (the editor drops the shift). */\n if (!j || result.scale || (!result.rotation && !result.position)) return null\n const stateId = j.state?.id ?? j.id\n const now = values[stateId] ?? asset.stateDefaults[stateId] ?? 0\n const turns = j.type === 'revolute'\n /* A revolute joint without limits turns without end (USD). */\n const endless = turns && j.lowerLimit === undefined && j.upperLimit === undefined\n\n if (result.rotation) {\n if (!turns) return { kind: 'refused', reason: j.type === 'prismatic' ? 'turned-slide' : 'fixed-turn', joint: j.id }\n if (j.mimic) return { kind: 'refused', reason: 'mimic', joint: j.id, leader: figureMimicTermsOf(j.mimic)!.sum.map(t => t.joint).join(', ') }\n /* The turn about the joint's axis (the twist of the change): the only turn the joint can make. */\n const before = new THREE.Quaternion().setFromRotationMatrix(matrixOf(part.pose.r as number[][]))\n const after = new THREE.Quaternion().setFromRotationMatrix(eulerMatrix(result.rotation))\n const change = after.multiply(before.invert())\n const axis = unit(j.axis!).applyMatrix4(jointFrameRotation(j, part, now)).normalize()\n const twist = 2 * Math.atan2(change.x * axis.x + change.y * axis.y + change.z * axis.z, change.w)\n /* Turned about another axis: the joint cannot make that turn, and nothing is written for it. */\n const whole = 2 * Math.acos(Math.min(1, Math.abs(change.w)))\n if (Math.abs(twist) < whole * 0.5) return { kind: 'refused', reason: 'off-axis', joint: j.id, axis: jointAxisWord(j.axis) }\n let value = now + THREE.MathUtils.radToDeg(twist)\n if (endless) value = ((((value + 180) % 360) + 360) % 360) - 180\n else value = Math.min(Math.max(value, j.lowerLimit!), j.upperLimit!)\n return { kind: 'value', input: stateId, unit: 'deg', value: round(value, 0.1) }\n }\n\n const moved = new THREE.Vector3(...result.position!).sub(new THREE.Vector3(...(part.pose.t as [number, number, number])))\n if (moved.length() < 0.5) return null\n const frame = jointFrameRotation(j, part, turns ? now : 0)\n\n if (j.type === 'prismatic') {\n if (j.mimic) return { kind: 'refused', reason: 'mimic', joint: j.id, leader: figureMimicTermsOf(j.mimic)!.sum.map(t => t.joint).join(', ') }\n /* How far one unit of the value moves the part along its axis, measured on the figure itself (a ratio travels a length). */\n const along = unit(j.axis!).applyMatrix4(frame).normalize()\n const at = (v: number) => {\n const g = compileFigureAsset(asset).evaluate({ ...values, [stateId]: v }).geometry.find(g => g.id === id && 'pose' in g) as { pose: { t: number[] } } | undefined\n return g ? new THREE.Vector3(...(g.pose.t as [number, number, number])).dot(along) : 0\n }\n const step = j.travel ? 0.01 : 1\n const rate = (at(now + step) - at(now)) / step\n if (Math.abs(rate) > 1e-9 && Math.abs(moved.dot(along)) >= moved.length() * 0.7) {\n const value = Math.min(Math.max(now + moved.dot(along) / rate, j.lowerLimit!), j.upperLimit!)\n return { kind: 'value', input: stateId, unit: j.travel ? 'ratio' : 'mm', value: round(value, j.travel ? 0.001 : 1) }\n }\n }\n\n /* Moving the joint's origin: the change in the frame it is placed in, before `origin.parentRotate` turns the joint frame. */\n const local = moved.clone().applyMatrix4(frame.clone().multiply(rotateMatrix(j).invert()).invert())\n const origin: NonNullable<FigureJoint['origin']> = { ...(j.origin ?? {}) }\n if (!('plane' in j.body0) && !('face' in j.body0)) {\n /* At the parent's origin there is no face: the frame moves by its offset, along the parent's axes. */\n const offset = { ...(j.origin?.offset ?? {}) }\n for (const axis of AXES) {\n const d = local[axis]\n if (Math.abs(d) < 0.5) continue\n const was = offset[axis] ?? 0\n if (typeof was !== 'number') return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n offset[axis] = round(was + d, 1)\n }\n return { kind: 'joint', joint: { ...j, origin: { ...origin, offset } } as FigureJoint }\n }\n const normal: Axis = 'plane' in j.body0 ? (asset.placement === 'wall' ? 'z' : 'y') : FACE_AXIS[j.body0.face]!\n /* Which way a larger gap moves the part: out of the face it meets or sits by its middle on, into it when flush with it (ADR-0140 3.11). */\n const outward = ((j.origin?.facing ?? 'meet') === 'flush' ? -1 : 1) * ('plane' in j.body0 ? 1 : FACE_SIGN[j.body0.face]!)\n const along = local[normal]\n if (Math.abs(along) >= 0.5) {\n const gap = origin.gap ?? 0\n if (typeof gap !== 'number') return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n origin.gap = round(gap + outward * along, 1)\n }\n for (const axis of AXES.filter(a => a !== normal)) {\n const d = local[axis]\n if (Math.abs(d) < 0.5) continue\n const how = origin.align?.[axis] ?? 'centre'\n const was = how === 'centre' ? 0 : typeof how === 'object' && typeof how.mm === 'number' ? how.mm : null\n if (was === null) return { kind: 'refused', reason: 'origin-follows', joint: j.id }\n origin.align = { ...(origin.align ?? {}), [axis]: { mm: round(was + d, 1) } }\n }\n return { kind: 'joint', joint: { ...j, origin } }\n}\n"]}