@things-factory/figure-ui 10.1.270 → 10.1.272

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 (113) hide show
  1. package/client/graphql/index.ts +2 -0
  2. package/client/modeller/canvas.ts +4 -2
  3. package/client/modeller/clips.ts +74 -4
  4. package/client/modeller/data-interface.ts +14 -0
  5. package/client/modeller/editor-styles.ts +11 -0
  6. package/client/modeller/editor.ts +39 -11
  7. package/client/modeller/fasten-form.ts +73 -3
  8. package/client/modeller/fasten-geometry.ts +11 -1
  9. package/client/modeller/figure-cavity-drawing.ts +1 -3
  10. package/client/modeller/figure-clips.ts +101 -8
  11. package/client/modeller/figure-fasten-dialog.ts +41 -30
  12. package/client/modeller/figure-fasten-drawing.ts +5 -4
  13. package/client/modeller/figure-first-save.ts +4 -3
  14. package/client/modeller/figure-links.ts +85 -28
  15. package/client/modeller/figure-preview.ts +50 -4
  16. package/client/modeller/figure-size-editor.ts +7 -2
  17. package/client/modeller/first-save.ts +8 -0
  18. package/client/modeller/focus-on-render.ts +4 -0
  19. package/client/modeller/palette.ts +27 -0
  20. package/client/modeller/pivot.ts +76 -0
  21. package/client/modeller/product-session.ts +5 -1
  22. package/client/modeller/size-response.ts +14 -0
  23. package/client/modeller/stage-model.ts +50 -6
  24. package/client/types.ts +2 -0
  25. package/dist-client/graphql/index.js +2 -0
  26. package/dist-client/graphql/index.js.map +1 -1
  27. package/dist-client/modeller/canvas.d.ts +1 -0
  28. package/dist-client/modeller/canvas.js +3 -2
  29. package/dist-client/modeller/canvas.js.map +1 -1
  30. package/dist-client/modeller/clips.d.ts +23 -6
  31. package/dist-client/modeller/clips.js +69 -4
  32. package/dist-client/modeller/clips.js.map +1 -1
  33. package/dist-client/modeller/data-interface.d.ts +5 -0
  34. package/dist-client/modeller/data-interface.js +15 -0
  35. package/dist-client/modeller/data-interface.js.map +1 -1
  36. package/dist-client/modeller/editor-styles.js +11 -0
  37. package/dist-client/modeller/editor-styles.js.map +1 -1
  38. package/dist-client/modeller/editor.d.ts +6 -0
  39. package/dist-client/modeller/editor.js +35 -11
  40. package/dist-client/modeller/editor.js.map +1 -1
  41. package/dist-client/modeller/fasten-form.d.ts +8 -0
  42. package/dist-client/modeller/fasten-form.js +68 -5
  43. package/dist-client/modeller/fasten-form.js.map +1 -1
  44. package/dist-client/modeller/fasten-geometry.d.ts +6 -0
  45. package/dist-client/modeller/fasten-geometry.js +10 -1
  46. package/dist-client/modeller/fasten-geometry.js.map +1 -1
  47. package/dist-client/modeller/figure-cavity-drawing.js +1 -3
  48. package/dist-client/modeller/figure-cavity-drawing.js.map +1 -1
  49. package/dist-client/modeller/figure-clips.d.ts +9 -0
  50. package/dist-client/modeller/figure-clips.js +104 -8
  51. package/dist-client/modeller/figure-clips.js.map +1 -1
  52. package/dist-client/modeller/figure-fasten-dialog.js +39 -24
  53. package/dist-client/modeller/figure-fasten-dialog.js.map +1 -1
  54. package/dist-client/modeller/figure-fasten-drawing.js +5 -4
  55. package/dist-client/modeller/figure-fasten-drawing.js.map +1 -1
  56. package/dist-client/modeller/figure-first-save.js +4 -3
  57. package/dist-client/modeller/figure-first-save.js.map +1 -1
  58. package/dist-client/modeller/figure-links.d.ts +9 -0
  59. package/dist-client/modeller/figure-links.js +89 -35
  60. package/dist-client/modeller/figure-links.js.map +1 -1
  61. package/dist-client/modeller/figure-preview.js +48 -4
  62. package/dist-client/modeller/figure-preview.js.map +1 -1
  63. package/dist-client/modeller/figure-size-editor.js +7 -3
  64. package/dist-client/modeller/figure-size-editor.js.map +1 -1
  65. package/dist-client/modeller/first-save.d.ts +5 -0
  66. package/dist-client/modeller/first-save.js +7 -0
  67. package/dist-client/modeller/first-save.js.map +1 -1
  68. package/dist-client/modeller/focus-on-render.d.ts +2 -0
  69. package/dist-client/modeller/focus-on-render.js +4 -0
  70. package/dist-client/modeller/focus-on-render.js.map +1 -0
  71. package/dist-client/modeller/links.d.ts +1 -1
  72. package/dist-client/modeller/palette.d.ts +14 -0
  73. package/dist-client/modeller/palette.js +23 -0
  74. package/dist-client/modeller/palette.js.map +1 -1
  75. package/dist-client/modeller/pivot.d.ts +12 -0
  76. package/dist-client/modeller/pivot.js +59 -0
  77. package/dist-client/modeller/pivot.js.map +1 -0
  78. package/dist-client/modeller/product-session.js +6 -2
  79. package/dist-client/modeller/product-session.js.map +1 -1
  80. package/dist-client/modeller/size-response.d.ts +6 -0
  81. package/dist-client/modeller/size-response.js +14 -0
  82. package/dist-client/modeller/size-response.js.map +1 -1
  83. package/dist-client/modeller/stage-model.d.ts +17 -3
  84. package/dist-client/modeller/stage-model.js +44 -6
  85. package/dist-client/modeller/stage-model.js.map +1 -1
  86. package/dist-client/route.d.ts +1 -1
  87. package/dist-client/tsconfig.tsbuildinfo +1 -1
  88. package/dist-client/types.d.ts +2 -0
  89. package/dist-client/types.js.map +1 -1
  90. package/package.json +5 -5
  91. package/test/browser/editing.check.mjs +6 -5
  92. package/test/browser/section.check.mjs +21 -0
  93. package/test/clips.test.ts +49 -4
  94. package/test/data-motion.test.ts +8 -0
  95. package/test/fasten-form.test.ts +57 -0
  96. package/test/fasten-geometry.test.ts +25 -1
  97. package/test/first-part-on-plane.test.ts +52 -0
  98. package/test/first-save.test.ts +11 -1
  99. package/test/pivot.test.ts +57 -0
  100. package/test/save-landed.test.ts +20 -1
  101. package/test/size-response.test.ts +10 -2
  102. package/test/stage-model.test.ts +23 -1
  103. package/translations/en.json +9 -0
  104. package/translations/es.json +9 -0
  105. package/translations/ja.json +9 -0
  106. package/translations/ko.json +9 -0
  107. package/translations/ms.json +9 -0
  108. package/translations/zh.json +9 -0
  109. package/tutorial/humanoid/README.md +22 -0
  110. package/tutorial/humanoid/chapters.mjs +247 -0
  111. package/tutorial/humanoid/encode.mjs +26 -0
  112. package/tutorial/humanoid/lib.mjs +197 -0
  113. package/tutorial/humanoid/record.mjs +65 -0
@@ -1 +1 @@
1
- {"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/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C,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC5C,gIAAgI;QAChI,IAAI,CAAC,OAAO,CAAc,qBAAqB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAA;IAC5G,CAAC;;AAjU+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA0B;AAE7C;IAAX,QAAQ,EAAE;;kDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AAEjB;IAAhB,KAAK,EAAE;;mDAAqB;AA3FlB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA2b9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n aimFastenAt,\n keptGapOf,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, mountingPlaneOf, surfaceOf, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how -- chosen with room to see it, in the standard\n * popup the editor opens (`openPopup`: its title, its close, moved by its head; no backdrop, so the canvas can be\n * pressed while it is open) (user 2026-10-17: 「속성에는 심플하고 직관적인 결과 위주로, 편집은 팝업에서 넓은 공간을\n * 써서」; 2026-10-18: the standard popup, not a window of its own; put back 2026-10-20).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n /*\n The popup holds it at its own height and cuts what is past the screen: the window scrolls itself, within the\n screen less the popup's head and margins, 취소 · 적용 kept at its foot (below).\n */\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n max-height: calc(100dvh - 32px - 56px);\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 320px;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n /* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the screen. */\n ox-popup-actions {\n position: sticky;\n bottom: calc(-1 * var(--popup-padding, 16px));\n margin-bottom: calc(-1 * var(--popup-padding, 16px));\n padding-bottom: var(--popup-padding, 16px);\n background: var(--md-sys-color-surface-container-lowest);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** Why a press on the canvas aimed at nothing, or only at the part (ADR-0140 stage 4); cleared by the next choice. */\n @state() private aimNote = ''\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? mountingPlaneOf(asset).facings\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .drawnFaces=${plan.drawnFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n .surfaceForm=${f.toPlane || !f.target ? '' : (surfaceOf(asset, f.target)?.form ?? '')}\n .surface=${plan.surface}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => {\n this.aimNote = ''\n this.form = fastenChanged(revision, this.partId, this.form!, e.detail)\n }}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim || plan.surface\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim || plan.surface\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part meets it by its real shape, by no face of its own. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : /* A sphere has no face to choose: where on its surface. */ plan.theirFaces.length\n ? i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n : i18next.t('figure.label.fasten-face-on-surface', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${plan.alignRows.length ? this.renderAlignment(plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined, gapFrom: 'typed' })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.aimNote ? html`<p hint aim-note role=\"status\">${this.aimNote}</p>` : nothing}\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n this.aimNote = ''\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = keptGapOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part }))\n }\n\n /**\n * A part pressed on the canvas while the window is open (ADR-0140 stage 4): aimed at, on the face or the point pressed\n * -- the kernel's reading of the press (`figureFastenTargetAt`), the point and normal brought into that part's own\n * frame by the pose it is drawn at. The part itself, or one hanging from it, is not aimed at; and a press on a curve\n * there is no fastening to aims at the part alone. Each is said.\n */\n aimAt(at: { id: string; point?: number[]; normal?: number[] }) {\n if (this.locked || !this.revision || !this.form) return\n const aimed = aimFastenAt(this.revision, this.partId, this.form, at)\n this.aimNote = aimed.note ? i18next.t(`figure.text.${aimed.note}`, { part: aimed.part, mine: this.partId }) : ''\n if (aimed.form) this.form = aimed.form\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${\n edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>\n ${i18next.t(`figure.label.align-${axis}-min`)}\n </option>\n <option value=\"max\" ?selected=${how === 'max'}>\n ${i18next.t(`figure.label.align-${axis}-max`)}\n </option>`\n : nothing\n }\n ${\n f.alignInput?.[axis]\n ? html`<option value=\"input\" ?selected=${how === 'input'}>\n ${i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) })}\n </option>`\n : nothing\n }\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${\n this.revision && hasInstanceSize(this.revision.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>\n ${i18next.t('figure.label.align-share')}\n </option>`\n : nothing\n }\n </select>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n /* The popup's fitting width is the overlay's own setting; the window asks it for room for the face and the way side by side. */\n this.closest<HTMLElement>('ox-floating-overlay')?.style.setProperty('--overlay-center-fit-width', '640px')\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAA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AAA;YACA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,OAAO,IAAI,OAAO,CAAC;cACnD;YACR,CAAC,CAAC,OAAO,CAAA;IACb,CAAC;IAED,6GAA6G;IAC7G,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACnC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC5C,gIAAgI;QAChI,IAAI,CAAC,OAAO,CAAc,qBAAqB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAA;IAC5G,CAAC;;AAvT+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA0B;AAE7C;IAAX,QAAQ,EAAE;;kDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AAEjB;IAAhB,KAAK,EAAE;;mDAAqB;AAhHlB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAsc9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n aimFastenAt,\n keptGapOf,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, mountingPlaneOf, surfaceOf, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how -- chosen with room to see it, in the standard\n * popup the editor opens (`openPopup`: its title, its close, moved by its head; no backdrop, so the canvas can be\n * pressed while it is open) (user 2026-10-17: 「속성에는 심플하고 직관적인 결과 위주로, 편집은 팝업에서 넓은 공간을\n * 써서」; 2026-10-18: the standard popup, not a window of its own; put back 2026-10-20).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n /*\n The popup holds it at its own height and cuts what is past the screen: the window scrolls itself, within the\n screen less the popup's head and margins, 취소 · 적용 kept at its foot (below).\n */\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n max-height: calc(100dvh - 32px - 56px);\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 420px;\n }\n /* Where across the face, as buttons: a list the system draws is not seen in a recording, nor reached by a key in every browser. */\n div[align-choices] {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n }\n div[align-choices] button {\n font: inherit;\n font-size: var(--ui-t-small, 11.5px);\n padding: 3px 8px;\n border-radius: 12px;\n border: 1px solid var(--md-sys-color-outline-variant, #c4c7c5);\n background: transparent;\n color: inherit;\n cursor: pointer;\n }\n div[align-choices] button[aria-pressed='true'] {\n border-color: var(--md-sys-color-primary, #0d8f86);\n background: var(--md-sys-color-primary-container, #cdeeea);\n font-weight: 600;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n /* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the screen. */\n ox-popup-actions {\n position: sticky;\n bottom: calc(-1 * var(--popup-padding, 16px));\n margin-bottom: calc(-1 * var(--popup-padding, 16px));\n padding-bottom: var(--popup-padding, 16px);\n background: var(--md-sys-color-surface-container-lowest);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** Why a press on the canvas aimed at nothing, or only at the part (ADR-0140 stage 4); cleared by the next choice. */\n @state() private aimNote = ''\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? mountingPlaneOf(asset).facings\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .drawnFaces=${plan.drawnFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n .surfaceForm=${f.toPlane || !f.target ? '' : (surfaceOf(asset, f.target)?.form ?? '')}\n .surface=${plan.surface}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => {\n this.aimNote = ''\n this.form = fastenChanged(revision, this.partId, this.form!, e.detail)\n }}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim || plan.surface\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim || plan.surface\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part meets it by its real shape, by no face of its own. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : /* A sphere has no face to choose: where on its surface. */ plan.theirFaces.length\n ? i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n : i18next.t('figure.label.fasten-face-on-surface', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${(plan.alignAxes ?? plan.alignRows).length ? this.renderAlignment(plan.alignAxes ?? plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined, gapFrom: 'typed' })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.aimNote ? html`<p hint aim-note role=\"status\">${this.aimNote}</p>` : nothing}\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n this.aimNote = ''\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = keptGapOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part }))\n }\n\n /**\n * A part pressed on the canvas while the window is open (ADR-0140 stage 4): aimed at, on the face or the point pressed\n * -- the kernel's reading of the press (`figureFastenTargetAt`), the point and normal brought into that part's own\n * frame by the pose it is drawn at. The part itself, or one hanging from it, is not aimed at; and a press on a curve\n * there is no fastening to aims at the part alone. Each is said.\n */\n aimAt(at: { id: string; point?: number[]; normal?: number[] }) {\n if (this.locked || !this.revision || !this.form) return\n const aimed = aimFastenAt(this.revision, this.partId, this.form, at)\n this.aimNote = aimed.note ? i18next.t(`figure.text.${aimed.note}`, { part: aimed.part, mine: this.partId }) : ''\n if (aimed.form) this.form = aimed.form\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <div align-choices role=\"group\" aria-label=${i18next.t('figure.label.align-' + axis)}>\n ${[\n { value: 'centre' as Alignment, words: i18next.t('figure.label.align-centre'), shown: true },\n { value: 'min' as Alignment, words: i18next.t(`figure.label.align-${axis}-min`), shown: edges },\n { value: 'max' as Alignment, words: i18next.t(`figure.label.align-${axis}-max`), shown: edges },\n {\n value: 'input' as Alignment,\n words: f.alignInput?.[axis] ? i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) }) : '',\n shown: !!f.alignInput?.[axis]\n },\n { value: 'mm' as Alignment, words: i18next.t('figure.label.align-mm'), shown: true },\n { value: 'share' as Alignment, words: i18next.t('figure.label.align-share'), shown: !!this.revision && hasInstanceSize(this.revision.asset, axis) }\n ]\n .filter(choice => choice.shown)\n .map(\n choice => html`<button type=\"button\" aria-pressed=${String(how === choice.value)} @click=${() => set(axis, choice.value)}>${choice.words}</button>`\n )}\n </div>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n /* The popup's fitting width is the overlay's own setting; the window asks it for room for the face and the way side by side. */\n this.closest<HTMLElement>('ox-floating-overlay')?.style.setProperty('--overlay-center-fit-width', '640px')\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -4,7 +4,8 @@ import { customElement, property, state } from 'lit/decorators.js';
4
4
  import { i18next, localize } from '@operato/i18n';
5
5
  import { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js';
6
6
  import { figureAroundNormalOf, figureAroundOf, figureCaughtAngleOf, figureSurfaceAnglesOf, figureSurfacePlaceOf } from '@hatiolab/figure-model';
7
- import { alignmentAt, fastenLabelsOf, offsetOf, overhangOf, screenOf } from './fasten-geometry.js';
7
+ import { focusOnRender } from './focus-on-render.js';
8
+ import { alignmentAt, drawingSpanOf, fastenLabelsOf, offsetOf, overhangOf, screenOf } from './fasten-geometry.js';
8
9
  const AXES = ['x', 'y', 'z'];
9
10
  const SEEN = [
10
11
  ['top', 'M60 30 L100 10 L200 10 L160 30 Z'],
@@ -312,8 +313,7 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
312
313
  return nothing;
313
314
  const { h, v, sign } = screenOf(view.axes);
314
315
  const W = WHERE_W, H = WHERE_H;
315
- /* Room around the face for the part to go past its edges by about half itself; a plane with no size, three parts wide. */
316
- const span = (a) => (view.face[a] !== undefined ? view.face[a] + view.part[a] : view.part[a] * 3);
316
+ const span = (a) => drawingSpanOf(view.face[a], view.part[a]);
317
317
  const k = Math.min((W - 40) / span(h), (H - 40) / span(v));
318
318
  this.scale = k;
319
319
  const cx = W / 2, cy = H / 2;
@@ -409,7 +409,8 @@ let FigureFastenDrawing = class FigureFastenDrawing extends localize(i18next)(Li
409
409
  this.change({ axis: a, how: 'mm', mm: Math.round(value) });
410
410
  this.released();
411
411
  }}
412
- @blur=${() => (this.typing = undefined)} />`;
412
+ @blur=${() => (this.typing = undefined)}
413
+ ${focusOnRender()} />`;
413
414
  }
414
415
  grab(ev, at, caught) {
415
416
  if (this.locked)
@@ -1 +1 @@
1
- {"version":3,"file":"figure-fasten-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAChG,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG/I,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAkC,MAAM,sBAAsB,CAAA;AAIlI,MAAM,IAAI,GAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAapC,MAAM,IAAI,GAAgC;IACxC,CAAC,KAAK,EAAE,kCAAkC,CAAC;IAC3C,CAAC,OAAO,EAAE,mCAAmC,CAAC;IAC9C,CAAC,OAAO,EAAE,oCAAoC,CAAC;CAChD,CAAA;AACD,sFAAsF;AACtF,mHAAmH;AACnH,MAAM,MAAM,GAAwC;IAClD,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC;IACnB,C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,CAAC;;kDAAqB;AAEpB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uDAAqD;AACxE;IAAX,QAAQ,EAAE;;iDAAU;AACW;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAAwC;AAC3D;IAAX,QAAQ,EAAE;;iDAA0B;AACL;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAgB;AACf;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAA6C;AAC5C;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA4C;AAC/C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAQ;AAEvB;IAAX,QAAQ,EAAE;;qDAAc;AACI;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;mDAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;iDAAa;AAE7B;IAAX,QAAQ,EAAE;;iDAA8B;AAE7B;IAAX,QAAQ,EAAE;;wDAA2C;AAEtB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oDAA+E;AAE7F;IAAhB,KAAK,EAAE;;oDAA4E;AAGnE;IAAhB,KAAK,EAAE;;oDAAsF;AAC7E;IAAhB,KAAK,EAAE;;mDAAsB;AAnInB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAylB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport { figureAroundNormalOf, figureAroundOf, figureCaughtAngleOf, figureSurfaceAnglesOf, figureSurfacePlaceOf } from '@hatiolab/figure-model'\nimport type { FigureFace, FigureSurfacePlace } from '@hatiolab/figure-model'\n\nimport { alignmentAt, fastenLabelsOf, offsetOf, overhangOf, screenOf, type FaceView, type FastenMode } from './fasten-geometry.js'\nimport type { Alignment } from './links.js'\n\ntype Axis = 'x' | 'y' | 'z'\nconst AXES: Axis[] = ['x', 'y', 'z']\ntype SidePlace = Extract<FigureSurfacePlace, { around: number }>\ntype RoundPlace = Extract<FigureSurfacePlace, { toward: unknown }>\n\n/** A change the drawing asks of the fastening form. */\nexport type FastenChange =\n | { targetFace: string }\n | { onSurface: true }\n | { surface: FigureSurfacePlace }\n | { mode: FastenMode }\n | { axis: Axis; how: Alignment; mm?: number }\n | { gap: number }\n\nconst SEEN: Array<[FigureFace, string]> = [\n ['top', 'M60 30 L100 10 L200 10 L160 30 Z'],\n ['front', 'M60 30 L160 30 L160 100 L60 100 Z'],\n ['right', 'M160 30 L200 10 L200 80 L160 100 Z']\n]\n/** The faces the drawing cannot show on the box, as tags beside it where they are. */\n/* The box is drawn a little left of its picture's middle, and the viewBox shifts it back to the panel's centre. */\nconst HIDDEN: Array<[FigureFace, number, number]> = [\n ['bottom', 30, 114],\n ['left', 24, 62],\n ['back', 236, 14]\n]\nconst PANEL_W = 300\n/* The face seen from above, beside the box in the fastening window: taller than the panel's was, for a long face's parts. */\nconst WHERE_W = 360\nconst WHERE_H = 200\n\n\n/**\n * 붙이기 그림 (user 2026-10-01) — which face of what the part is fastened to, how, and where on it; each of them chosen\n * by pressing or dragging the drawing, none by a list of faces.\n *\n * The target is drawn as a box whose faces are pressed (the three it hides as tags beside it), or as the one plane the\n * figure stands by. How is three small side views -- set on it, flush with it, its centre on it (only for a part that\n * turns about a joint) -- and the chosen one's gap is dragged. Where is the face seen from above with the part's\n * footprint on it: dragged, caught at the centre and at the edges from inside and outside, a guide drawn where it is\n * caught and a dimension where it is not, which is pressed to type the number. It may go past the edges: the part that\n * does is shaded, and a part off the face altogether is said so. Nothing is decided here: every change goes to the form\n * (`fasten-change`), and a press or a drag let go says so (`fasten-release`). The window draws it twice, under its own\n * questions: the face (`show=\"face\"`: the box and the face seen from above, side by side) and the way (`show=\"how\"`).\n */\n@customElement('figure-fasten-drawing')\nexport class FigureFastenDrawing extends localize(i18next)(LitElement) {\n /* The panel's own field rows (where along a cylinder's side), as the window's other rows are. */\n static styles = [SidePanelStyles, css`\n :host {\n display: grid;\n gap: 8px;\n outline: none;\n }\n svg {\n width: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n svg text {\n font: inherit;\n }\n div[modes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));\n gap: 6px;\n }\n div[modes] svg {\n width: 48px;\n height: 33px;\n }\n /* A choice drawn, not a box to press (the side's rule: no boxed buttons): the chosen one on the primary's ground. */\n div[modes] button {\n display: grid;\n justify-items: center;\n align-content: center;\n gap: 2px;\n padding: 4px 4px 6px;\n font: inherit;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n }\n div[modes] button:hover:not([on]):not(:disabled) {\n background: var(--md-sys-color-surface-container);\n }\n /* Faces beyond the box's six and a curved surface: tags as the hidden faces are drawn beside the box -- one look for every face. */\n div[face-tags] {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: 6px;\n }\n button[face-tag] {\n height: 20px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--md-sys-color-on-surface-variant);\n background: transparent;\n border: 1px dashed var(--md-sys-color-outline);\n border-radius: 10px;\n cursor: pointer;\n }\n button[face-tag][on] {\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary);\n }\n div[modes] button[on] {\n background: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n /* The box and the face seen from above side by side, one under the other where the window is narrow. */\n div[face-row] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n gap: 12px;\n align-items: start;\n }\n div[face-row] > div {\n display: grid;\n gap: 8px;\n }\n /* The place is drawn at its own size, never blown up past it: its words stay the window's size. */\n div[where] {\n position: relative;\n width: 100%;\n max-width: 360px;\n justify-self: center;\n }\n div[where] input {\n position: absolute;\n width: 72px;\n font: inherit;\n }\n small[warn] {\n color: var(--md-sys-color-tertiary);\n }\n small[off] {\n color: var(--md-sys-color-error);\n }\n `]\n\n /** The target's name, or empty for the plane the figure stands by. */\n @property() target = ''\n /** The plane's name by the figure's placement: 바닥 · 천장 · 벽 · 중심. */\n @property() planeWord = ''\n @property({ attribute: false }) faces: string[] = []\n /** The target's own face at each place of the box, as it is drawn: a turned target's faces where they are seen. */\n @property({ attribute: false }) drawnFaces?: Partial<Record<FigureFace, FigureFace>>\n @property() face = ''\n @property({ attribute: false }) modes: FastenMode[] = ['meet', 'flush']\n @property() mode: FastenMode = 'meet'\n @property({ attribute: false }) view?: FaceView\n @property({ attribute: false }) align: Partial<Record<Axis, Alignment>> = {}\n @property({ attribute: false }) alignMm: Partial<Record<Axis, number>> = {}\n @property({ type: Number }) gap = 0\n /** The part being fastened (not `part`: that is every element's own). */\n @property() partName = ''\n @property({ type: Boolean }) locked = false\n /** The form already says how the fastening it has lies on the face: the drawing says it only while dragging. */\n @property({ type: Boolean }) said = false\n /** Which of its questions it draws: the face, or the way. */\n @property() show: 'face' | 'how' = 'face'\n /** The curved surface the target offers to be fastened to at a point (ADR-0140 3.9), if any. */\n @property() surfaceForm: 'around' | 'toward' | '' = ''\n /** Fastened to a point of that surface: which, about which axis, and where; undefined while on a face. */\n @property({ attribute: false }) surface?: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }\n /** The angles while one is dragged round the surface, told to the form when let go. */\n @state() private turning?: { around?: number; azimuth?: number; elevation?: number }\n\n /** Where the footprint is while dragging, and what it is caught by; undefined when nothing is dragged. */\n @state() private dragged?: { at: Record<Axis, number>; caught: Partial<Record<Axis, string>> }\n @state() private typing?: Axis\n private scale = 1\n private gapFrom?: { y: number; gap: number }\n\n private change(detail: FastenChange) {\n this.dispatchEvent(new CustomEvent('fasten-change', { detail, bubbles: true, composed: true }))\n }\n private released() {\n this.dispatchEvent(new CustomEvent('fasten-release', { bubbles: true, composed: true }))\n }\n\n render() {\n if (this.show === 'how') return this.renderModes()\n /* A part with no face (a sphere) has only its surface: its tag above, the place across the whole width. */\n if (this.target && !this.faces.length) return html`${this.renderTarget()}<div>${this.renderWhere()}</div>`\n return html`<div face-row>${this.target ? html`<div>${this.renderTarget()}</div>` : nothing}<div>${this.renderWhere()}</div></div>`\n }\n\n /** The target box, its faces pressed; or the plane. */\n private renderTarget() {\n /* The plane is one face, named in the list and on the face drawn below: nothing to pick, so no picture of it. */\n if (!this.target) return nothing\n const has = (f: string) => this.faces.includes(f)\n /* A press is a whole change, as a drag let go is: the form applies a fastening the part already has. */\n const pick = (f: string) => () => {\n if (this.locked || !has(f) || (!this.surface && f === this.face)) return\n this.change({ targetFace: f })\n this.released()\n }\n /* The face at each place as the target is drawn: its own name, pressed as its own. */\n const own = (place: FigureFace) => this.drawnFaces?.[place] ?? place\n const seen = SEEN.map(([place, d]) => {\n const f = own(place)\n const on = !this.surface && this.face === f\n return svg`<path face=${f} place=${place} d=${d} @click=${pick(f)}\n style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary-container)' : 'var(--md-sys-color-surface-container)'};fill-opacity:${has(f) ? 1 : 0.4};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-width:${on ? 2 : 1}`}>\n <title>${i18next.t('figure.label.face-' + f)}</title></path>`\n })\n const hidden = HIDDEN.map(([place, x, y]) => {\n const f = own(place)\n const on = !this.surface && this.face === f\n return svg`<g face=${f} place=${place} @click=${pick(f)} style=${`cursor:${has(f) ? 'pointer' : 'default'};opacity:${has(f) ? 1 : 0.35}`}>\n <rect x=${x - 26} y=${y - 10} width=\"52\" height=\"20\" rx=\"10\"\n style=${`fill:${on ? 'var(--md-sys-color-primary-container)' : 'transparent'};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-dasharray:${on ? '' : '3 2'}`} />\n <text x=${x} y=${y + 4} text-anchor=\"middle\" font-size=\"11\" style=${`fill:${on ? 'var(--md-sys-color-on-primary-container)' : 'var(--md-sys-color-on-surface-variant)'}`}>${i18next.t('figure.label.face-' + f)}</text>\n </g>`\n })\n /* A shape's faces beyond its six outer ones -- a door frame's opening -- are tags of their own under the box. */\n const others = this.faces.filter(f => !SEEN.some(([s]) => own(s) === f) && !HIDDEN.some(([h]) => own(h) === f))\n /* A sphere has no face: no box of faces it has not, only its surface. */\n return html`${this.faces.length\n ? svg`<svg viewBox=\"-20 0 ${PANEL_W} 126\" role=\"img\" aria-label=${this.target}>\n ${seen}\n <text x=\"110\" y=\"70\" text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.target}</text>\n ${hidden}\n </svg>`\n : nothing}\n ${others.length || this.surfaceForm\n ? html`<div face-tags>\n ${others.map(f => html`<button face-tag ?on=${!this.surface && f === this.face} ?disabled=${this.locked} @click=${pick(f)}>${i18next.t('figure.label.face-' + f, { defaultValue: f })}</button>`)}\n ${this.surfaceForm\n ? html`<button face-tag surface ?on=${!!this.surface} ?disabled=${this.locked}\n @click=${() => {\n if (this.locked || this.surface) return\n this.change({ onSurface: true })\n this.released()\n }}>${i18next.t('figure.label.surface-' + this.surfaceForm)}</button>`\n : nothing}\n </div>`\n : nothing}`\n }\n\n /** How: three side views; the chosen one's gap is dragged. */\n private renderModes() {\n /* One way only (the plane is set on): the sentence says it; a single choice is not offered as a button. */\n if (this.modes.length < 2) return nothing\n const icon = (m: FastenMode, on: boolean) => {\n const g = on && m !== 'centre' ? Math.min(this.gap / 4, 10) : 0\n const base = svg`<rect x=\"6\" y=\"30\" width=\"52\" height=\"14\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary)\" />`\n const gapDrag = on && !this.locked ? 'ns-resize' : 'pointer'\n if (m === 'meet')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${18 - g} width=\"20\" height=\"12\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n ${g ? svg`<text x=\"46\" y=${26 - g / 2} font-size=\"10\" style=\"fill:currentColor\">${this.gap}</text>` : nothing}</svg>`\n if (m === 'flush')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${30 - g} width=\"20\" height=\"10\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n <line x1=\"4\" y1=\"30\" x2=\"60\" y2=\"30\" style=\"stroke:currentColor;stroke-dasharray:2 2\" /></svg>`\n return svg`<svg viewBox=\"0 0 64 48\">${base}<circle cx=\"32\" cy=\"30\" r=\"11\" style=\"fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor\" /><circle cx=\"32\" cy=\"30\" r=\"2\" style=\"fill:currentColor\" /></svg>`\n }\n return html`<div modes>\n ${this.modes.map(m => {\n const on = m === this.mode\n return html`<button mode=${m} ?on=${on} ?disabled=${this.locked}\n @click=${() => {\n if (on) return\n this.change({ mode: m })\n this.released()\n }}\n @pointerdown=${(ev: PointerEvent) => {\n if (!on || this.locked || !(ev.target as Element).hasAttribute?.('gap')) return\n ev.preventDefault()\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n this.gapFrom = { y: ev.clientY, gap: this.gap }\n }}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.gapFrom) return\n this.change({ gap: Math.max(0, Math.round(this.gapFrom.gap + (this.gapFrom.y - ev.clientY) * 2)) })\n }}\n @pointerup=${() => {\n if (!this.gapFrom) return\n this.gapFrom = undefined\n this.released()\n }}>\n ${icon(m, on)}<span>${i18next.t('figure.label.fasten-mode-' + m)}</span>\n </button>`\n })}\n </div>`\n }\n\n /** Where the part's centre is on each axis now: the drag's, or the form's. */\n private centreOf(view: FaceView): Record<Axis, number> {\n if (this.dragged) return this.dragged.at\n const at = { x: 0, y: 0, z: 0 }\n for (const a of view.axes) at[a] = offsetOf(this.align[a], this.alignMm[a], view.face[a], view.part[a])\n return at\n }\n\n /** What each axis is caught by now: at the centre, level with an edge, touching one from outside, or nothing. */\n private caughtOf(view: FaceView, at: Record<Axis, number>): Partial<Record<Axis, string>> {\n if (this.dragged) return this.dragged.caught\n const out: Partial<Record<Axis, string>> = {}\n for (const a of view.axes) {\n const how = this.align[a] ?? 'centre'\n if (how === 'centre') out[a] = 'centre'\n else if (how === 'min' || how === 'max') out[a] = 'inside'\n else if (view.face[a] !== undefined && Math.abs(Math.abs(at[a]) - (view.face[a]! + view.part[a]) / 2) < 0.5) out[a] = 'outside'\n }\n return out\n }\n\n private renderWhere() {\n if (this.surface) return this.renderSurfaceWhere(this.surface)\n const view = this.view\n if (!view) return nothing\n const { h, v, sign } = screenOf(view.axes)\n const W = WHERE_W,\n H = WHERE_H\n /* Room around the face for the part to go past its edges by about half itself; a plane with no size, three parts wide. */\n const span = (a: Axis) => (view.face[a] !== undefined ? view.face[a]! + view.part[a] : view.part[a] * 3)\n const k = Math.min((W - 40) / span(h), (H - 40) / span(v))\n this.scale = k\n const cx = W / 2,\n cy = H / 2\n const at = this.centreOf(view)\n const caught = this.caughtOf(view, at)\n const fw = (view.face[h] ?? 0) * k,\n fh = (view.face[v] ?? 0) * k\n const pw = view.part[h] * k,\n ph = view.part[v] * k\n const px = cx + sign[h] * at[h] * k - pw / 2,\n py = cy + sign[v] * at[v] * k - ph / 2\n const faceSized = view.face[h] !== undefined && view.face[v] !== undefined\n /* An end disc is drawn as the disc it is: its overhang is measured on it (ADR-0140 3.9). */\n const disc = !!view.measure.disc\n const fx = cx - fw / 2,\n fy = cy - fh / 2\n const ix = Math.max(fx, px),\n iy = Math.max(fy, py)\n const iw = Math.min(fx + fw, px + pw) - ix,\n ih = Math.min(fy + fh, py + ph) - iy\n const { touching, sides } = faceSized ? overhangOf(view, at) : { touching: true, sides: [] as ReturnType<typeof overhangOf>['sides'] }\n const round = this.mode === 'centre'\n const guide = (a: Axis) => {\n const c = caught[a]\n if (!c) return nothing\n const along = a === h\n const edge = c === 'centre' ? 0 : Math.sign(at[a]) * (view.face[a] ?? 0) / 2\n const pos = (along ? cx : cy) + sign[a] * edge * k\n const style = `stroke:var(--md-sys-color-primary);stroke-width:${c === 'centre' ? 1 : 2.5};stroke-dasharray:${c === 'centre' ? '4 3' : ''}`\n return along ? svg`<line x1=${pos} y1=\"4\" x2=${pos} y2=${H - 4} style=${style} />` : svg`<line x1=\"4\" y1=${pos} x2=${W - 4} y2=${pos} style=${style} />`\n }\n const dim = (a: Axis) => {\n /* Caught by the centre or an edge, the guide says where it is; a number only where nothing caught it. */\n if (caught[a]) return nothing\n const along = a === h\n const mm = Math.round(at[a])\n const label = `${mm > 0 ? '+' : ''}${mm} mm`\n const to = sign[a] * at[a] * k\n const tx = along ? cx + to / 2 : 8,\n ty = along ? H - 6 : cy + to / 2 + 4\n return svg`${along\n ? svg`<line x1=${cx} y1=${H - 16} x2=${cx + to} y2=${H - 16} style=\"stroke:var(--md-sys-color-on-surface)\" />`\n : svg`<line x1=\"20\" y1=${cy} x2=\"20\" y2=${cy + to} style=\"stroke:var(--md-sys-color-on-surface)\" />`}\n <text dim=${a} x=${tx} y=${ty} font-size=\"11\" text-anchor=${along ? 'middle' : 'start'}\n style=\"fill:var(--md-sys-color-primary);cursor:text;text-decoration:underline dotted\" @click=${() => !this.locked && (this.typing = a)}>${label}</text>`\n }\n const faceName = this.target ? `${this.target} ${i18next.t('figure.label.face-' + this.face)}` : this.planeWord\n const sizeWords = faceSized ? ` ${Math.round(view.face[h]!)} × ${Math.round(view.face[v]!)}` : ''\n const labels = fastenLabelsOf(faceSized ? { x: fx, y: fy, w: fw, h: fh } : { x: 6, y: 4, w: W - 12, h: H - 8 }, { x: px, y: py, w: pw, h: ph }, this.partName, H)\n return html`<div where tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.keys(ev, view)}>\n ${svg`<svg viewBox=\"0 0 ${W} ${H}\" role=\"img\" aria-label=${faceName}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, view, cx, cy)}\n @pointerup=${() => this.drop()} @pointercancel=${() => this.drop()}>\n ${faceSized\n ? svg`<rect x=${fx} y=${fy} width=${fw} height=${fh} rx=${disc ? fw / 2 : 4} ry=${disc ? fh / 2 : 4} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`\n : svg`<rect x=\"1\" y=\"1\" width=${W - 2} height=${H - 2} rx=\"8\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`}\n <text face-name x=${labels.face.x} y=${labels.face.y} font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${faceName}${sizeWords}</text>\n ${guide(h)}${guide(v)}\n <g footprint style=${`cursor:${this.locked ? 'default' : 'grab'}`} @pointerdown=${(ev: PointerEvent) => this.grab(ev, at, caught)}>\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-tertiary-container)\" />\n ${faceSized && iw > 0 && ih > 0\n ? svg`<rect x=${ix} y=${iy} width=${iw} height=${ih} rx=${round ? Math.min(iw, ih) / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : !faceSized\n ? svg`<rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : nothing}\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2}\n style=${`fill:none;stroke:var(--md-sys-color-on-surface);stroke-width:1.5;stroke-dasharray:${touching ? '' : '4 3'}`} />\n <text part-name x=${labels.part.x} y=${labels.part.y} text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.partName}</text>\n </g>\n ${dim(h)}${dim(v)}\n </svg>`}\n ${this.typing ? this.renderTyping(view, this.typing, at) : nothing}\n </div>\n ${this.said && !this.dragged\n ? nothing\n : !touching\n ? html`<small off role=\"status\">${i18next.t('figure.text.fasten-off-face', { face: faceName })}</small>`\n : sides.length\n ? html`<small warn role=\"status\">${i18next.t('figure.text.fasten-past-edges', {\n sides: sides.map(s => i18next.t(`figure.text.overhang-side-${s.side}`, { axis: s.axis.toUpperCase(), mm: String(s.mm) })).join(' · ')\n })}</small>`\n : nothing}`\n }\n\n private renderTyping(view: FaceView, a: Axis, at: Record<Axis, number>) {\n const along = a === screenOf(view.axes).h\n return html`<input type=\"number\" step=\"1\" aria-label=${`${a.toUpperCase()} mm`} .value=${String(Math.round(at[a]))}\n style=${along ? 'left: calc(50% - 36px); bottom: 0' : 'left: 4px; top: calc(50% - 12px)'}\n @keydown=${(ev: KeyboardEvent) => {\n ev.stopPropagation()\n if (ev.key === 'Escape') this.typing = undefined\n if (ev.key !== 'Enter') return\n const value = Number((ev.target as HTMLInputElement).value)\n this.typing = undefined\n if (!Number.isFinite(value)) return\n this.change({ axis: a, how: 'mm', mm: Math.round(value) })\n this.released()\n }}\n @blur=${() => (this.typing = undefined)} />`\n }\n\n private grab(ev: PointerEvent, at: Record<Axis, number>, caught: Partial<Record<Axis, string>>) {\n if (this.locked) return\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragged = { at: { ...at }, caught: { ...caught } }\n }\n\n /** The footprint follows the pointer, caught at the centre and edges within a few pixels. */\n private drag(ev: PointerEvent, view: FaceView, cx: number, cy: number) {\n if (!this.dragged) return\n const svgEl = ev.currentTarget as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n const p = pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n const { h, v, sign } = screenOf(view.axes)\n const at = { ...this.dragged.at },\n caught: Partial<Record<Axis, string>> = {}\n for (const [a, d] of [\n [h, (sign[h] * (p.x - cx)) / this.scale],\n [v, (sign[v] * (p.y - cy)) / this.scale]\n ] as const) {\n const got = alignmentAt(d, view.face[a], view.part[a], view.edges[a], 8 / this.scale)\n at[a] = offsetOf(got.how, got.mm, view.face[a], view.part[a])\n if (got.caught) caught[a] = got.caught\n }\n this.dragged = { at, caught }\n }\n\n private drop() {\n const d = this.dragged\n if (!d || !this.view) return\n this.dragged = undefined\n for (const a of this.view.axes) {\n const got = alignmentAt(d.at[a], this.view.face[a], this.view.part[a], this.view.edges[a], 0.5)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n }\n this.released()\n }\n\n /** Arrows move the part a millimetre, ten with Shift; the centre and edges still catch it. */\n private keys(ev: KeyboardEvent, view: FaceView) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[ev.key]\n if (!step || this.locked || this.typing) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 10 : 1\n const at = this.centreOf(view)\n const { h, v, sign } = screenOf(view.axes)\n ;[h, v].forEach((a, i) => {\n if (!step[i]) return\n /* Up the screen is up the face: a Y that rises goes up with the arrow. */\n const got = alignmentAt(at[a] + sign[a] * step[i]! * by, view.face[a], view.part[a], view.edges[a], by / 2)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n })\n this.released()\n }\n\n /**\n * Where on a curved surface (ADR-0140 3.9). A cylinder's side is seen from its end: its section a circle, the point\n * on its rim at the angle `around`, dragged round it -- caught at every 45°, where the faces it had are named -- and\n * along its length chosen below it. A sphere is seen from above and from the side: its point dragged round the\n * first for the direction across its axis, along the second for how high. Nothing is told the form until let go.\n */\n private renderSurfaceWhere(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const R = 56\n const axis = surface.axis\n const across = (['x', 'y', 'z'] as Axis[]).filter(a => a !== axis) as [Axis, Axis]\n const { h, v, sign } = screenOf(across)\n const deg = (r: number) => (r * 180) / Math.PI\n const rad = (d: number) => (d * Math.PI) / 180\n /* A direction across the axis on the circle drawn at (cx, cy): its point there, and the way back from a pointer. */\n const onCircle = (n: number[], cx: number, cy: number, r = R) => ({ x: cx + sign[h] * n[AXES.indexOf(h)]! * r, y: cy + sign[v] * n[AXES.indexOf(v)]! * r })\n const angleAt = (p: { x: number; y: number }, cx: number, cy: number) => {\n const d = [0, 0, 0]\n d[AXES.indexOf(h)] = sign[h] * (p.x - cx)\n d[AXES.indexOf(v)] = sign[v] * (p.y - cy)\n return figureAroundOf(axis, d)\n }\n const caught = (a: number) => figureCaughtAngleOf(a) % 360\n /* The faces the four quarters were named by, round the circle: where a part fastened to one of them now stands. */\n const FACE_AT: Record<Axis, [string, string]> = { x: ['left', 'right'], y: ['bottom', 'top'], z: ['back', 'front'] }\n const ticks = (cx: number, cy: number) =>\n [0, 90, 180, 270].map(t => {\n const n = figureAroundNormalOf(axis, t)\n const k = n.findIndex(c => Math.abs(c) > 0.5)\n const word = i18next.t('figure.label.face-' + FACE_AT[AXES[k]!][n[k]! > 0 ? 1 : 0])\n const p = onCircle(n, cx, cy, R + 16)\n return svg`<text x=${p.x} y=${p.y + 4} text-anchor=\"middle\" font-size=\"10\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface-variant)\">${word}</text>`\n })\n const marker = (p: { x: number; y: number }, cx: number, cy: number, label: string) => svg`\n <line x1=${cx} y1=${cy} x2=${p.x} y2=${p.y} style=\"stroke:var(--md-sys-color-primary);stroke-dasharray:3 2\" />\n <circle marker cx=${p.x} cy=${p.y} r=\"8\" style=${`fill:var(--md-sys-color-tertiary-container);stroke:var(--md-sys-color-on-surface);cursor:${this.locked ? 'default' : 'grab'}`} />\n <text x=${cx} y=${Math.hypot(p.x - cx, p.y - cy) < 16 ? cy - 14 : cy + 4} text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${label}</text>`\n const drag = (on: (p: { x: number; y: number }) => void) => ({\n down: (ev: PointerEvent) => {\n if (this.locked) return\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n on(this.pointIn(ev))\n },\n move: (ev: PointerEvent) => {\n if (!this.turning || !(ev.currentTarget as Element).hasPointerCapture?.(ev.pointerId)) return\n on(this.pointIn(ev))\n },\n up: () => this.letGo(surface)\n })\n if (surface.form === 'around') {\n const place = surface.place as SidePlace\n const around = this.turning?.around ?? place.around\n /* The section in the middle under its name, the ticks clear of both. */\n const cx = WHERE_W / 2,\n cy = 110\n const d = drag(p => (this.turning = { around: caught(angleAt(p, cx, cy)) }))\n return html`<div where surface tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.turnKeys(ev, surface)}>\n ${svg`<svg viewBox=\"0 0 ${WHERE_W} ${WHERE_H}\" role=\"img\" aria-label=${i18next.t('figure.label.surface-seen-end', { part: this.target })}\n @pointerdown=${d.down} @pointermove=${d.move} @pointerup=${d.up} @pointercancel=${d.up}>\n <text x=${WHERE_W / 2} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-end', { part: this.target })}</text>\n <circle cx=${cx} cy=${cy} r=${R} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n ${ticks(cx, cy)}\n ${marker(onCircle(figureAroundNormalOf(axis, around), cx, cy), cx, cy, `${Math.round(around)}°`)}\n </svg>`}\n </div>\n ${this.renderAlong(surface.axis, place.along)}`\n }\n /* A sphere: its direction across its axis (the azimuth, by the same rule as a cylinder's around) and how high. */\n const now = figureSurfaceAnglesOf(surface, surface.place) as { azimuth: number; elevation: number }\n const azimuth = this.turning?.azimuth ?? now.azimuth\n const elevation = this.turning?.elevation ?? now.elevation\n const ax = 110,\n ay = 110,\n sx = 250,\n sy = 110\n const aboveAt = onCircle(figureAroundNormalOf(axis, azimuth), ax, ay, R * Math.cos(rad(elevation)) || 0)\n const sideAt = { x: sx + R * Math.cos(rad(elevation)), y: sy - R * Math.sin(rad(elevation)) }\n const d = drag(p => {\n const above = Math.hypot(p.x - ax, p.y - ay) <= R + 16 && p.x < (ax + sx) / 2\n this.turning = above\n ? { azimuth: caught(angleAt(p, ax, ay)), elevation }\n : { azimuth, elevation: Math.max(-90, Math.min(90, figureCaughtAngleOf(deg(Math.atan2(sy - p.y, Math.max(0, p.x - sx)))))) }\n })\n return html`<div where surface tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.turnKeys(ev, surface)}>\n ${svg`<svg viewBox=\"0 0 ${WHERE_W} ${WHERE_H}\" role=\"img\" aria-label=${i18next.t('figure.label.surface-toward')}\n @pointerdown=${d.down} @pointermove=${d.move} @pointerup=${d.up} @pointercancel=${d.up}>\n <text x=${ax} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-above')}</text>\n <circle cx=${ax} cy=${ay} r=${R} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n ${ticks(ax, ay)}\n ${marker(aboveAt, ax, ay, `${Math.round(azimuth)}°`)}\n <text x=${sx + R / 2} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-side')}</text>\n <path d=${`M ${sx} ${sy - R} A ${R} ${R} 0 0 1 ${sx} ${sy + R}`} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n <line x1=${sx} y1=${sy - R} x2=${sx} y2=${sy + R} style=\"stroke:var(--md-sys-color-primary)\" />\n ${marker(sideAt, sx, sy, `${Math.round(elevation)}°`)}\n </svg>`}\n </div>`\n }\n\n /** Where along a cylinder's side: centred, level with an end, or a distance from the middle -- its alignment words. */\n private renderAlong(axis: Axis, along: unknown) {\n const how = along === 'min' || along === 'max' ? along : along && typeof along === 'object' ? 'mm' : 'centre'\n const mm = how === 'mm' ? Number((along as { mm: number }).mm) || 0 : 0\n const place = this.surface!.place as SidePlace\n const tell = (next: unknown) => {\n this.change({ surface: { around: place.around, along: next as never } })\n this.released()\n }\n return html`<div form along>\n <span>${i18next.t('figure.label.align-' + axis)}</span>\n <select ?disabled=${this.locked} @change=${(e: Event) => {\n const v = (e.target as HTMLSelectElement).value\n tell(v === 'mm' ? { mm } : v)\n }}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n <option value=\"min\" ?selected=${how === 'min'}>${i18next.t(`figure.label.align-${axis}-min`)}</option>\n <option value=\"max\" ?selected=${how === 'max'}>${i18next.t(`figure.label.align-${axis}-max`)}</option>\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n </select>\n ${how === 'mm'\n ? html`<span></span><input type=\"number\" step=\"any\" aria-label=${i18next.t('figure.label.align-mm')} .value=${String(mm)}\n ?disabled=${this.locked} @change=${(e: Event) => tell({ mm: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}\n </div>`\n }\n\n /** A pointer's place in the drawing's own units. */\n private pointIn(ev: PointerEvent) {\n const svgEl = (ev.currentTarget as Element).closest('svg') as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n return pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n }\n\n /** Let go: the angles dragged become the place, told to the form once. */\n private letGo(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const t = this.turning\n if (!t) return\n this.turning = undefined\n this.change({ surface: this.placeOf(surface, t) })\n this.released()\n }\n\n /** The place the angles come to: the kernel's (`figureSurfacePlaceOf`), along a side kept. */\n private placeOf(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }, t: { around?: number; azimuth?: number; elevation?: number }): FigureSurfacePlace {\n const now = figureSurfaceAnglesOf(surface, surface.place) as { around?: number; azimuth?: number; elevation?: number }\n const angles = surface.form === 'around' ? { around: t.around ?? now.around! } : { azimuth: t.azimuth ?? now.azimuth!, elevation: t.elevation ?? now.elevation! }\n return figureSurfacePlaceOf(surface, surface.place, angles)\n }\n\n /** Arrows turn it a degree, fifteen with Shift: round the side, or round and up and down a sphere. */\n private turnKeys(ev: KeyboardEvent, surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] }[ev.key]\n if (!step || this.locked) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 15 : 1\n const now = figureSurfaceAnglesOf(surface, surface.place) as { around?: number; azimuth?: number; elevation?: number }\n if (surface.form === 'around') {\n if (!step[0]) return\n this.change({ surface: this.placeOf(surface, { around: now.around! + step[0] * by }) })\n } else this.change({ surface: this.placeOf(surface, { azimuth: now.azimuth! + step[0] * by, elevation: Math.max(-90, Math.min(90, now.elevation! + step[1] * by)) }) })\n this.released()\n }\n}\n"]}
1
+ {"version":3,"file":"figure-fasten-drawing.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAChG,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG/I,OAAO,EAAE,aAAa,EAAE,M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E;IAAhB,KAAK,EAAE;;oDAAsF;AAC7E;IAAhB,KAAK,EAAE;;mDAAsB;AAnInB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAylB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport { figureAroundNormalOf, figureAroundOf, figureCaughtAngleOf, figureSurfaceAnglesOf, figureSurfacePlaceOf } from '@hatiolab/figure-model'\nimport type { FigureFace, FigureSurfacePlace } from '@hatiolab/figure-model'\n\nimport { focusOnRender } from './focus-on-render.js'\nimport { alignmentAt, drawingSpanOf, fastenLabelsOf, offsetOf, overhangOf, screenOf, type FaceView, type FastenMode } from './fasten-geometry.js'\nimport type { Alignment } from './links.js'\n\ntype Axis = 'x' | 'y' | 'z'\nconst AXES: Axis[] = ['x', 'y', 'z']\ntype SidePlace = Extract<FigureSurfacePlace, { around: number }>\ntype RoundPlace = Extract<FigureSurfacePlace, { toward: unknown }>\n\n/** A change the drawing asks of the fastening form. */\nexport type FastenChange =\n | { targetFace: string }\n | { onSurface: true }\n | { surface: FigureSurfacePlace }\n | { mode: FastenMode }\n | { axis: Axis; how: Alignment; mm?: number }\n | { gap: number }\n\nconst SEEN: Array<[FigureFace, string]> = [\n ['top', 'M60 30 L100 10 L200 10 L160 30 Z'],\n ['front', 'M60 30 L160 30 L160 100 L60 100 Z'],\n ['right', 'M160 30 L200 10 L200 80 L160 100 Z']\n]\n/** The faces the drawing cannot show on the box, as tags beside it where they are. */\n/* The box is drawn a little left of its picture's middle, and the viewBox shifts it back to the panel's centre. */\nconst HIDDEN: Array<[FigureFace, number, number]> = [\n ['bottom', 30, 114],\n ['left', 24, 62],\n ['back', 236, 14]\n]\nconst PANEL_W = 300\n/* The face seen from above, beside the box in the fastening window: taller than the panel's was, for a long face's parts. */\nconst WHERE_W = 360\nconst WHERE_H = 200\n\n\n/**\n * 붙이기 그림 (user 2026-10-01) — which face of what the part is fastened to, how, and where on it; each of them chosen\n * by pressing or dragging the drawing, none by a list of faces.\n *\n * The target is drawn as a box whose faces are pressed (the three it hides as tags beside it), or as the one plane the\n * figure stands by. How is three small side views -- set on it, flush with it, its centre on it (only for a part that\n * turns about a joint) -- and the chosen one's gap is dragged. Where is the face seen from above with the part's\n * footprint on it: dragged, caught at the centre and at the edges from inside and outside, a guide drawn where it is\n * caught and a dimension where it is not, which is pressed to type the number. It may go past the edges: the part that\n * does is shaded, and a part off the face altogether is said so. Nothing is decided here: every change goes to the form\n * (`fasten-change`), and a press or a drag let go says so (`fasten-release`). The window draws it twice, under its own\n * questions: the face (`show=\"face\"`: the box and the face seen from above, side by side) and the way (`show=\"how\"`).\n */\n@customElement('figure-fasten-drawing')\nexport class FigureFastenDrawing extends localize(i18next)(LitElement) {\n /* The panel's own field rows (where along a cylinder's side), as the window's other rows are. */\n static styles = [SidePanelStyles, css`\n :host {\n display: grid;\n gap: 8px;\n outline: none;\n }\n svg {\n width: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n svg text {\n font: inherit;\n }\n div[modes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));\n gap: 6px;\n }\n div[modes] svg {\n width: 48px;\n height: 33px;\n }\n /* A choice drawn, not a box to press (the side's rule: no boxed buttons): the chosen one on the primary's ground. */\n div[modes] button {\n display: grid;\n justify-items: center;\n align-content: center;\n gap: 2px;\n padding: 4px 4px 6px;\n font: inherit;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n }\n div[modes] button:hover:not([on]):not(:disabled) {\n background: var(--md-sys-color-surface-container);\n }\n /* Faces beyond the box's six and a curved surface: tags as the hidden faces are drawn beside the box -- one look for every face. */\n div[face-tags] {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: 6px;\n }\n button[face-tag] {\n height: 20px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--md-sys-color-on-surface-variant);\n background: transparent;\n border: 1px dashed var(--md-sys-color-outline);\n border-radius: 10px;\n cursor: pointer;\n }\n button[face-tag][on] {\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary);\n }\n div[modes] button[on] {\n background: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n /* The box and the face seen from above side by side, one under the other where the window is narrow. */\n div[face-row] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n gap: 12px;\n align-items: start;\n }\n div[face-row] > div {\n display: grid;\n gap: 8px;\n }\n /* The place is drawn at its own size, never blown up past it: its words stay the window's size. */\n div[where] {\n position: relative;\n width: 100%;\n max-width: 360px;\n justify-self: center;\n }\n div[where] input {\n position: absolute;\n width: 72px;\n font: inherit;\n }\n small[warn] {\n color: var(--md-sys-color-tertiary);\n }\n small[off] {\n color: var(--md-sys-color-error);\n }\n `]\n\n /** The target's name, or empty for the plane the figure stands by. */\n @property() target = ''\n /** The plane's name by the figure's placement: 바닥 · 천장 · 벽 · 중심. */\n @property() planeWord = ''\n @property({ attribute: false }) faces: string[] = []\n /** The target's own face at each place of the box, as it is drawn: a turned target's faces where they are seen. */\n @property({ attribute: false }) drawnFaces?: Partial<Record<FigureFace, FigureFace>>\n @property() face = ''\n @property({ attribute: false }) modes: FastenMode[] = ['meet', 'flush']\n @property() mode: FastenMode = 'meet'\n @property({ attribute: false }) view?: FaceView\n @property({ attribute: false }) align: Partial<Record<Axis, Alignment>> = {}\n @property({ attribute: false }) alignMm: Partial<Record<Axis, number>> = {}\n @property({ type: Number }) gap = 0\n /** The part being fastened (not `part`: that is every element's own). */\n @property() partName = ''\n @property({ type: Boolean }) locked = false\n /** The form already says how the fastening it has lies on the face: the drawing says it only while dragging. */\n @property({ type: Boolean }) said = false\n /** Which of its questions it draws: the face, or the way. */\n @property() show: 'face' | 'how' = 'face'\n /** The curved surface the target offers to be fastened to at a point (ADR-0140 3.9), if any. */\n @property() surfaceForm: 'around' | 'toward' | '' = ''\n /** Fastened to a point of that surface: which, about which axis, and where; undefined while on a face. */\n @property({ attribute: false }) surface?: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }\n /** The angles while one is dragged round the surface, told to the form when let go. */\n @state() private turning?: { around?: number; azimuth?: number; elevation?: number }\n\n /** Where the footprint is while dragging, and what it is caught by; undefined when nothing is dragged. */\n @state() private dragged?: { at: Record<Axis, number>; caught: Partial<Record<Axis, string>> }\n @state() private typing?: Axis\n private scale = 1\n private gapFrom?: { y: number; gap: number }\n\n private change(detail: FastenChange) {\n this.dispatchEvent(new CustomEvent('fasten-change', { detail, bubbles: true, composed: true }))\n }\n private released() {\n this.dispatchEvent(new CustomEvent('fasten-release', { bubbles: true, composed: true }))\n }\n\n render() {\n if (this.show === 'how') return this.renderModes()\n /* A part with no face (a sphere) has only its surface: its tag above, the place across the whole width. */\n if (this.target && !this.faces.length) return html`${this.renderTarget()}<div>${this.renderWhere()}</div>`\n return html`<div face-row>${this.target ? html`<div>${this.renderTarget()}</div>` : nothing}<div>${this.renderWhere()}</div></div>`\n }\n\n /** The target box, its faces pressed; or the plane. */\n private renderTarget() {\n /* The plane is one face, named in the list and on the face drawn below: nothing to pick, so no picture of it. */\n if (!this.target) return nothing\n const has = (f: string) => this.faces.includes(f)\n /* A press is a whole change, as a drag let go is: the form applies a fastening the part already has. */\n const pick = (f: string) => () => {\n if (this.locked || !has(f) || (!this.surface && f === this.face)) return\n this.change({ targetFace: f })\n this.released()\n }\n /* The face at each place as the target is drawn: its own name, pressed as its own. */\n const own = (place: FigureFace) => this.drawnFaces?.[place] ?? place\n const seen = SEEN.map(([place, d]) => {\n const f = own(place)\n const on = !this.surface && this.face === f\n return svg`<path face=${f} place=${place} d=${d} @click=${pick(f)}\n style=${`cursor:${has(f) ? 'pointer' : 'default'};fill:${on ? 'var(--md-sys-color-primary-container)' : 'var(--md-sys-color-surface-container)'};fill-opacity:${has(f) ? 1 : 0.4};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-width:${on ? 2 : 1}`}>\n <title>${i18next.t('figure.label.face-' + f)}</title></path>`\n })\n const hidden = HIDDEN.map(([place, x, y]) => {\n const f = own(place)\n const on = !this.surface && this.face === f\n return svg`<g face=${f} place=${place} @click=${pick(f)} style=${`cursor:${has(f) ? 'pointer' : 'default'};opacity:${has(f) ? 1 : 0.35}`}>\n <rect x=${x - 26} y=${y - 10} width=\"52\" height=\"20\" rx=\"10\"\n style=${`fill:${on ? 'var(--md-sys-color-primary-container)' : 'transparent'};stroke:${on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-outline)'};stroke-dasharray:${on ? '' : '3 2'}`} />\n <text x=${x} y=${y + 4} text-anchor=\"middle\" font-size=\"11\" style=${`fill:${on ? 'var(--md-sys-color-on-primary-container)' : 'var(--md-sys-color-on-surface-variant)'}`}>${i18next.t('figure.label.face-' + f)}</text>\n </g>`\n })\n /* A shape's faces beyond its six outer ones -- a door frame's opening -- are tags of their own under the box. */\n const others = this.faces.filter(f => !SEEN.some(([s]) => own(s) === f) && !HIDDEN.some(([h]) => own(h) === f))\n /* A sphere has no face: no box of faces it has not, only its surface. */\n return html`${this.faces.length\n ? svg`<svg viewBox=\"-20 0 ${PANEL_W} 126\" role=\"img\" aria-label=${this.target}>\n ${seen}\n <text x=\"110\" y=\"70\" text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.target}</text>\n ${hidden}\n </svg>`\n : nothing}\n ${others.length || this.surfaceForm\n ? html`<div face-tags>\n ${others.map(f => html`<button face-tag ?on=${!this.surface && f === this.face} ?disabled=${this.locked} @click=${pick(f)}>${i18next.t('figure.label.face-' + f, { defaultValue: f })}</button>`)}\n ${this.surfaceForm\n ? html`<button face-tag surface ?on=${!!this.surface} ?disabled=${this.locked}\n @click=${() => {\n if (this.locked || this.surface) return\n this.change({ onSurface: true })\n this.released()\n }}>${i18next.t('figure.label.surface-' + this.surfaceForm)}</button>`\n : nothing}\n </div>`\n : nothing}`\n }\n\n /** How: three side views; the chosen one's gap is dragged. */\n private renderModes() {\n /* One way only (the plane is set on): the sentence says it; a single choice is not offered as a button. */\n if (this.modes.length < 2) return nothing\n const icon = (m: FastenMode, on: boolean) => {\n const g = on && m !== 'centre' ? Math.min(this.gap / 4, 10) : 0\n const base = svg`<rect x=\"6\" y=\"30\" width=\"52\" height=\"14\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary)\" />`\n const gapDrag = on && !this.locked ? 'ns-resize' : 'pointer'\n if (m === 'meet')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${18 - g} width=\"20\" height=\"12\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n ${g ? svg`<text x=\"46\" y=${26 - g / 2} font-size=\"10\" style=\"fill:currentColor\">${this.gap}</text>` : nothing}</svg>`\n if (m === 'flush')\n return svg`<svg viewBox=\"0 0 64 48\">${base}<rect gap x=\"22\" y=${30 - g} width=\"20\" height=\"10\" style=${`fill:var(--md-sys-color-surface);stroke:currentColor;cursor:${gapDrag}`} />\n <line x1=\"4\" y1=\"30\" x2=\"60\" y2=\"30\" style=\"stroke:currentColor;stroke-dasharray:2 2\" /></svg>`\n return svg`<svg viewBox=\"0 0 64 48\">${base}<circle cx=\"32\" cy=\"30\" r=\"11\" style=\"fill:var(--md-sys-color-surface);fill-opacity:.85;stroke:currentColor\" /><circle cx=\"32\" cy=\"30\" r=\"2\" style=\"fill:currentColor\" /></svg>`\n }\n return html`<div modes>\n ${this.modes.map(m => {\n const on = m === this.mode\n return html`<button mode=${m} ?on=${on} ?disabled=${this.locked}\n @click=${() => {\n if (on) return\n this.change({ mode: m })\n this.released()\n }}\n @pointerdown=${(ev: PointerEvent) => {\n if (!on || this.locked || !(ev.target as Element).hasAttribute?.('gap')) return\n ev.preventDefault()\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n this.gapFrom = { y: ev.clientY, gap: this.gap }\n }}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.gapFrom) return\n this.change({ gap: Math.max(0, Math.round(this.gapFrom.gap + (this.gapFrom.y - ev.clientY) * 2)) })\n }}\n @pointerup=${() => {\n if (!this.gapFrom) return\n this.gapFrom = undefined\n this.released()\n }}>\n ${icon(m, on)}<span>${i18next.t('figure.label.fasten-mode-' + m)}</span>\n </button>`\n })}\n </div>`\n }\n\n /** Where the part's centre is on each axis now: the drag's, or the form's. */\n private centreOf(view: FaceView): Record<Axis, number> {\n if (this.dragged) return this.dragged.at\n const at = { x: 0, y: 0, z: 0 }\n for (const a of view.axes) at[a] = offsetOf(this.align[a], this.alignMm[a], view.face[a], view.part[a])\n return at\n }\n\n /** What each axis is caught by now: at the centre, level with an edge, touching one from outside, or nothing. */\n private caughtOf(view: FaceView, at: Record<Axis, number>): Partial<Record<Axis, string>> {\n if (this.dragged) return this.dragged.caught\n const out: Partial<Record<Axis, string>> = {}\n for (const a of view.axes) {\n const how = this.align[a] ?? 'centre'\n if (how === 'centre') out[a] = 'centre'\n else if (how === 'min' || how === 'max') out[a] = 'inside'\n else if (view.face[a] !== undefined && Math.abs(Math.abs(at[a]) - (view.face[a]! + view.part[a]) / 2) < 0.5) out[a] = 'outside'\n }\n return out\n }\n\n private renderWhere() {\n if (this.surface) return this.renderSurfaceWhere(this.surface)\n const view = this.view\n if (!view) return nothing\n const { h, v, sign } = screenOf(view.axes)\n const W = WHERE_W,\n H = WHERE_H\n const span = (a: Axis) => drawingSpanOf(view.face[a], view.part[a])\n const k = Math.min((W - 40) / span(h), (H - 40) / span(v))\n this.scale = k\n const cx = W / 2,\n cy = H / 2\n const at = this.centreOf(view)\n const caught = this.caughtOf(view, at)\n const fw = (view.face[h] ?? 0) * k,\n fh = (view.face[v] ?? 0) * k\n const pw = view.part[h] * k,\n ph = view.part[v] * k\n const px = cx + sign[h] * at[h] * k - pw / 2,\n py = cy + sign[v] * at[v] * k - ph / 2\n const faceSized = view.face[h] !== undefined && view.face[v] !== undefined\n /* An end disc is drawn as the disc it is: its overhang is measured on it (ADR-0140 3.9). */\n const disc = !!view.measure.disc\n const fx = cx - fw / 2,\n fy = cy - fh / 2\n const ix = Math.max(fx, px),\n iy = Math.max(fy, py)\n const iw = Math.min(fx + fw, px + pw) - ix,\n ih = Math.min(fy + fh, py + ph) - iy\n const { touching, sides } = faceSized ? overhangOf(view, at) : { touching: true, sides: [] as ReturnType<typeof overhangOf>['sides'] }\n const round = this.mode === 'centre'\n const guide = (a: Axis) => {\n const c = caught[a]\n if (!c) return nothing\n const along = a === h\n const edge = c === 'centre' ? 0 : Math.sign(at[a]) * (view.face[a] ?? 0) / 2\n const pos = (along ? cx : cy) + sign[a] * edge * k\n const style = `stroke:var(--md-sys-color-primary);stroke-width:${c === 'centre' ? 1 : 2.5};stroke-dasharray:${c === 'centre' ? '4 3' : ''}`\n return along ? svg`<line x1=${pos} y1=\"4\" x2=${pos} y2=${H - 4} style=${style} />` : svg`<line x1=\"4\" y1=${pos} x2=${W - 4} y2=${pos} style=${style} />`\n }\n const dim = (a: Axis) => {\n /* Caught by the centre or an edge, the guide says where it is; a number only where nothing caught it. */\n if (caught[a]) return nothing\n const along = a === h\n const mm = Math.round(at[a])\n const label = `${mm > 0 ? '+' : ''}${mm} mm`\n const to = sign[a] * at[a] * k\n const tx = along ? cx + to / 2 : 8,\n ty = along ? H - 6 : cy + to / 2 + 4\n return svg`${along\n ? svg`<line x1=${cx} y1=${H - 16} x2=${cx + to} y2=${H - 16} style=\"stroke:var(--md-sys-color-on-surface)\" />`\n : svg`<line x1=\"20\" y1=${cy} x2=\"20\" y2=${cy + to} style=\"stroke:var(--md-sys-color-on-surface)\" />`}\n <text dim=${a} x=${tx} y=${ty} font-size=\"11\" text-anchor=${along ? 'middle' : 'start'}\n style=\"fill:var(--md-sys-color-primary);cursor:text;text-decoration:underline dotted\" @click=${() => !this.locked && (this.typing = a)}>${label}</text>`\n }\n const faceName = this.target ? `${this.target} ${i18next.t('figure.label.face-' + this.face)}` : this.planeWord\n const sizeWords = faceSized ? ` ${Math.round(view.face[h]!)} × ${Math.round(view.face[v]!)}` : ''\n const labels = fastenLabelsOf(faceSized ? { x: fx, y: fy, w: fw, h: fh } : { x: 6, y: 4, w: W - 12, h: H - 8 }, { x: px, y: py, w: pw, h: ph }, this.partName, H)\n return html`<div where tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.keys(ev, view)}>\n ${svg`<svg viewBox=\"0 0 ${W} ${H}\" role=\"img\" aria-label=${faceName}\n @pointermove=${(ev: PointerEvent) => this.drag(ev, view, cx, cy)}\n @pointerup=${() => this.drop()} @pointercancel=${() => this.drop()}>\n ${faceSized\n ? svg`<rect x=${fx} y=${fy} width=${fw} height=${fh} rx=${disc ? fw / 2 : 4} ry=${disc ? fh / 2 : 4} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`\n : svg`<rect x=\"1\" y=\"1\" width=${W - 2} height=${H - 2} rx=\"8\" style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />`}\n <text face-name x=${labels.face.x} y=${labels.face.y} font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${faceName}${sizeWords}</text>\n ${guide(h)}${guide(v)}\n <g footprint style=${`cursor:${this.locked ? 'default' : 'grab'}`} @pointerdown=${(ev: PointerEvent) => this.grab(ev, at, caught)}>\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-tertiary-container)\" />\n ${faceSized && iw > 0 && ih > 0\n ? svg`<rect x=${ix} y=${iy} width=${iw} height=${ih} rx=${round ? Math.min(iw, ih) / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : !faceSized\n ? svg`<rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2} style=\"fill:var(--md-sys-color-surface)\" />`\n : nothing}\n <rect x=${px} y=${py} width=${pw} height=${ph} rx=${round ? pw / 2 : 2}\n style=${`fill:none;stroke:var(--md-sys-color-on-surface);stroke-width:1.5;stroke-dasharray:${touching ? '' : '4 3'}`} />\n <text part-name x=${labels.part.x} y=${labels.part.y} text-anchor=\"middle\" font-size=\"12\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface)\">${this.partName}</text>\n </g>\n ${dim(h)}${dim(v)}\n </svg>`}\n ${this.typing ? this.renderTyping(view, this.typing, at) : nothing}\n </div>\n ${this.said && !this.dragged\n ? nothing\n : !touching\n ? html`<small off role=\"status\">${i18next.t('figure.text.fasten-off-face', { face: faceName })}</small>`\n : sides.length\n ? html`<small warn role=\"status\">${i18next.t('figure.text.fasten-past-edges', {\n sides: sides.map(s => i18next.t(`figure.text.overhang-side-${s.side}`, { axis: s.axis.toUpperCase(), mm: String(s.mm) })).join(' · ')\n })}</small>`\n : nothing}`\n }\n\n private renderTyping(view: FaceView, a: Axis, at: Record<Axis, number>) {\n const along = a === screenOf(view.axes).h\n return html`<input type=\"number\" step=\"1\" aria-label=${`${a.toUpperCase()} mm`} .value=${String(Math.round(at[a]))}\n style=${along ? 'left: calc(50% - 36px); bottom: 0' : 'left: 4px; top: calc(50% - 12px)'}\n @keydown=${(ev: KeyboardEvent) => {\n ev.stopPropagation()\n if (ev.key === 'Escape') this.typing = undefined\n if (ev.key !== 'Enter') return\n const value = Number((ev.target as HTMLInputElement).value)\n this.typing = undefined\n if (!Number.isFinite(value)) return\n this.change({ axis: a, how: 'mm', mm: Math.round(value) })\n this.released()\n }}\n @blur=${() => (this.typing = undefined)}\n ${focusOnRender()} />`\n }\n\n private grab(ev: PointerEvent, at: Record<Axis, number>, caught: Partial<Record<Axis, string>>) {\n if (this.locked) return\n ;(ev.currentTarget as Element).closest('svg')!.setPointerCapture(ev.pointerId)\n this.dragged = { at: { ...at }, caught: { ...caught } }\n }\n\n /** The footprint follows the pointer, caught at the centre and edges within a few pixels. */\n private drag(ev: PointerEvent, view: FaceView, cx: number, cy: number) {\n if (!this.dragged) return\n const svgEl = ev.currentTarget as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n const p = pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n const { h, v, sign } = screenOf(view.axes)\n const at = { ...this.dragged.at },\n caught: Partial<Record<Axis, string>> = {}\n for (const [a, d] of [\n [h, (sign[h] * (p.x - cx)) / this.scale],\n [v, (sign[v] * (p.y - cy)) / this.scale]\n ] as const) {\n const got = alignmentAt(d, view.face[a], view.part[a], view.edges[a], 8 / this.scale)\n at[a] = offsetOf(got.how, got.mm, view.face[a], view.part[a])\n if (got.caught) caught[a] = got.caught\n }\n this.dragged = { at, caught }\n }\n\n private drop() {\n const d = this.dragged\n if (!d || !this.view) return\n this.dragged = undefined\n for (const a of this.view.axes) {\n const got = alignmentAt(d.at[a], this.view.face[a], this.view.part[a], this.view.edges[a], 0.5)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n }\n this.released()\n }\n\n /** Arrows move the part a millimetre, ten with Shift; the centre and edges still catch it. */\n private keys(ev: KeyboardEvent, view: FaceView) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] }[ev.key]\n if (!step || this.locked || this.typing) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 10 : 1\n const at = this.centreOf(view)\n const { h, v, sign } = screenOf(view.axes)\n ;[h, v].forEach((a, i) => {\n if (!step[i]) return\n /* Up the screen is up the face: a Y that rises goes up with the arrow. */\n const got = alignmentAt(at[a] + sign[a] * step[i]! * by, view.face[a], view.part[a], view.edges[a], by / 2)\n this.change({ axis: a, how: got.how, ...(got.how === 'mm' ? { mm: got.mm } : {}) })\n })\n this.released()\n }\n\n /**\n * Where on a curved surface (ADR-0140 3.9). A cylinder's side is seen from its end: its section a circle, the point\n * on its rim at the angle `around`, dragged round it -- caught at every 45°, where the faces it had are named -- and\n * along its length chosen below it. A sphere is seen from above and from the side: its point dragged round the\n * first for the direction across its axis, along the second for how high. Nothing is told the form until let go.\n */\n private renderSurfaceWhere(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const R = 56\n const axis = surface.axis\n const across = (['x', 'y', 'z'] as Axis[]).filter(a => a !== axis) as [Axis, Axis]\n const { h, v, sign } = screenOf(across)\n const deg = (r: number) => (r * 180) / Math.PI\n const rad = (d: number) => (d * Math.PI) / 180\n /* A direction across the axis on the circle drawn at (cx, cy): its point there, and the way back from a pointer. */\n const onCircle = (n: number[], cx: number, cy: number, r = R) => ({ x: cx + sign[h] * n[AXES.indexOf(h)]! * r, y: cy + sign[v] * n[AXES.indexOf(v)]! * r })\n const angleAt = (p: { x: number; y: number }, cx: number, cy: number) => {\n const d = [0, 0, 0]\n d[AXES.indexOf(h)] = sign[h] * (p.x - cx)\n d[AXES.indexOf(v)] = sign[v] * (p.y - cy)\n return figureAroundOf(axis, d)\n }\n const caught = (a: number) => figureCaughtAngleOf(a) % 360\n /* The faces the four quarters were named by, round the circle: where a part fastened to one of them now stands. */\n const FACE_AT: Record<Axis, [string, string]> = { x: ['left', 'right'], y: ['bottom', 'top'], z: ['back', 'front'] }\n const ticks = (cx: number, cy: number) =>\n [0, 90, 180, 270].map(t => {\n const n = figureAroundNormalOf(axis, t)\n const k = n.findIndex(c => Math.abs(c) > 0.5)\n const word = i18next.t('figure.label.face-' + FACE_AT[AXES[k]!][n[k]! > 0 ? 1 : 0])\n const p = onCircle(n, cx, cy, R + 16)\n return svg`<text x=${p.x} y=${p.y + 4} text-anchor=\"middle\" font-size=\"10\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-on-surface-variant)\">${word}</text>`\n })\n const marker = (p: { x: number; y: number }, cx: number, cy: number, label: string) => svg`\n <line x1=${cx} y1=${cy} x2=${p.x} y2=${p.y} style=\"stroke:var(--md-sys-color-primary);stroke-dasharray:3 2\" />\n <circle marker cx=${p.x} cy=${p.y} r=\"8\" style=${`fill:var(--md-sys-color-tertiary-container);stroke:var(--md-sys-color-on-surface);cursor:${this.locked ? 'default' : 'grab'}`} />\n <text x=${cx} y=${Math.hypot(p.x - cx, p.y - cy) < 16 ? cy - 14 : cy + 4} text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${label}</text>`\n const drag = (on: (p: { x: number; y: number }) => void) => ({\n down: (ev: PointerEvent) => {\n if (this.locked) return\n ;(ev.currentTarget as Element).setPointerCapture(ev.pointerId)\n on(this.pointIn(ev))\n },\n move: (ev: PointerEvent) => {\n if (!this.turning || !(ev.currentTarget as Element).hasPointerCapture?.(ev.pointerId)) return\n on(this.pointIn(ev))\n },\n up: () => this.letGo(surface)\n })\n if (surface.form === 'around') {\n const place = surface.place as SidePlace\n const around = this.turning?.around ?? place.around\n /* The section in the middle under its name, the ticks clear of both. */\n const cx = WHERE_W / 2,\n cy = 110\n const d = drag(p => (this.turning = { around: caught(angleAt(p, cx, cy)) }))\n return html`<div where surface tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.turnKeys(ev, surface)}>\n ${svg`<svg viewBox=\"0 0 ${WHERE_W} ${WHERE_H}\" role=\"img\" aria-label=${i18next.t('figure.label.surface-seen-end', { part: this.target })}\n @pointerdown=${d.down} @pointermove=${d.move} @pointerup=${d.up} @pointercancel=${d.up}>\n <text x=${WHERE_W / 2} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-end', { part: this.target })}</text>\n <circle cx=${cx} cy=${cy} r=${R} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n ${ticks(cx, cy)}\n ${marker(onCircle(figureAroundNormalOf(axis, around), cx, cy), cx, cy, `${Math.round(around)}°`)}\n </svg>`}\n </div>\n ${this.renderAlong(surface.axis, place.along)}`\n }\n /* A sphere: its direction across its axis (the azimuth, by the same rule as a cylinder's around) and how high. */\n const now = figureSurfaceAnglesOf(surface, surface.place) as { azimuth: number; elevation: number }\n const azimuth = this.turning?.azimuth ?? now.azimuth\n const elevation = this.turning?.elevation ?? now.elevation\n const ax = 110,\n ay = 110,\n sx = 250,\n sy = 110\n const aboveAt = onCircle(figureAroundNormalOf(axis, azimuth), ax, ay, R * Math.cos(rad(elevation)) || 0)\n const sideAt = { x: sx + R * Math.cos(rad(elevation)), y: sy - R * Math.sin(rad(elevation)) }\n const d = drag(p => {\n const above = Math.hypot(p.x - ax, p.y - ay) <= R + 16 && p.x < (ax + sx) / 2\n this.turning = above\n ? { azimuth: caught(angleAt(p, ax, ay)), elevation }\n : { azimuth, elevation: Math.max(-90, Math.min(90, figureCaughtAngleOf(deg(Math.atan2(sy - p.y, Math.max(0, p.x - sx)))))) }\n })\n return html`<div where surface tabindex=\"0\" @keydown=${(ev: KeyboardEvent) => this.turnKeys(ev, surface)}>\n ${svg`<svg viewBox=\"0 0 ${WHERE_W} ${WHERE_H}\" role=\"img\" aria-label=${i18next.t('figure.label.surface-toward')}\n @pointerdown=${d.down} @pointermove=${d.move} @pointerup=${d.up} @pointercancel=${d.up}>\n <text x=${ax} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-above')}</text>\n <circle cx=${ax} cy=${ay} r=${R} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n ${ticks(ax, ay)}\n ${marker(aboveAt, ax, ay, `${Math.round(azimuth)}°`)}\n <text x=${sx + R / 2} y=\"14\" text-anchor=\"middle\" font-size=\"11\" pointer-events=\"none\" style=\"fill:var(--md-sys-color-primary)\">${i18next.t('figure.label.surface-seen-side')}</text>\n <path d=${`M ${sx} ${sy - R} A ${R} ${R} 0 0 1 ${sx} ${sy + R}`} style=\"fill:var(--md-sys-color-primary-container);stroke:var(--md-sys-color-primary);stroke-width:2\" />\n <line x1=${sx} y1=${sy - R} x2=${sx} y2=${sy + R} style=\"stroke:var(--md-sys-color-primary)\" />\n ${marker(sideAt, sx, sy, `${Math.round(elevation)}°`)}\n </svg>`}\n </div>`\n }\n\n /** Where along a cylinder's side: centred, level with an end, or a distance from the middle -- its alignment words. */\n private renderAlong(axis: Axis, along: unknown) {\n const how = along === 'min' || along === 'max' ? along : along && typeof along === 'object' ? 'mm' : 'centre'\n const mm = how === 'mm' ? Number((along as { mm: number }).mm) || 0 : 0\n const place = this.surface!.place as SidePlace\n const tell = (next: unknown) => {\n this.change({ surface: { around: place.around, along: next as never } })\n this.released()\n }\n return html`<div form along>\n <span>${i18next.t('figure.label.align-' + axis)}</span>\n <select ?disabled=${this.locked} @change=${(e: Event) => {\n const v = (e.target as HTMLSelectElement).value\n tell(v === 'mm' ? { mm } : v)\n }}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n <option value=\"min\" ?selected=${how === 'min'}>${i18next.t(`figure.label.align-${axis}-min`)}</option>\n <option value=\"max\" ?selected=${how === 'max'}>${i18next.t(`figure.label.align-${axis}-max`)}</option>\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n </select>\n ${how === 'mm'\n ? html`<span></span><input type=\"number\" step=\"any\" aria-label=${i18next.t('figure.label.align-mm')} .value=${String(mm)}\n ?disabled=${this.locked} @change=${(e: Event) => tell({ mm: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}\n </div>`\n }\n\n /** A pointer's place in the drawing's own units. */\n private pointIn(ev: PointerEvent) {\n const svgEl = (ev.currentTarget as Element).closest('svg') as SVGSVGElement\n const pt = svgEl.createSVGPoint()\n pt.x = ev.clientX\n pt.y = ev.clientY\n return pt.matrixTransform(svgEl.getScreenCTM()!.inverse())\n }\n\n /** Let go: the angles dragged become the place, told to the form once. */\n private letGo(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const t = this.turning\n if (!t) return\n this.turning = undefined\n this.change({ surface: this.placeOf(surface, t) })\n this.released()\n }\n\n /** The place the angles come to: the kernel's (`figureSurfacePlaceOf`), along a side kept. */\n private placeOf(surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }, t: { around?: number; azimuth?: number; elevation?: number }): FigureSurfacePlace {\n const now = figureSurfaceAnglesOf(surface, surface.place) as { around?: number; azimuth?: number; elevation?: number }\n const angles = surface.form === 'around' ? { around: t.around ?? now.around! } : { azimuth: t.azimuth ?? now.azimuth!, elevation: t.elevation ?? now.elevation! }\n return figureSurfacePlaceOf(surface, surface.place, angles)\n }\n\n /** Arrows turn it a degree, fifteen with Shift: round the side, or round and up and down a sphere. */\n private turnKeys(ev: KeyboardEvent, surface: { form: 'around' | 'toward'; axis: Axis; place: FigureSurfacePlace }) {\n const step = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] }[ev.key]\n if (!step || this.locked) return\n ev.preventDefault()\n ev.stopPropagation()\n const by = ev.shiftKey ? 15 : 1\n const now = figureSurfaceAnglesOf(surface, surface.place) as { around?: number; azimuth?: number; elevation?: number }\n if (surface.form === 'around') {\n if (!step[0]) return\n this.change({ surface: this.placeOf(surface, { around: now.around! + step[0] * by }) })\n } else this.change({ surface: this.placeOf(surface, { azimuth: now.azimuth! + step[0] * by, elevation: Math.max(-90, Math.min(90, now.elevation! + step[1] * by)) }) })\n this.released()\n }\n}\n"]}
@@ -7,7 +7,7 @@ import '@operato/popup/ox-popup-actions.js';
7
7
  import { CommonPopupStyles, FormFieldStyles } from '@operato/styles';
8
8
  import '@material/web/button/filled-button.js';
9
9
  import '@material/web/button/text-button.js';
10
- import { firstSaveRefusalOf, offeredTypeOf, releasableType, typeOf } from './first-save.js';
10
+ import { firstSaveRefusalOf, offeredTypeOf, releasableType, typeOf, typingTypeOf } from './first-save.js';
11
11
  /**
12
12
  * The first save of a new figure: its type and its name, asked once, in the suite's popup look.
13
13
  * Closes with the answer, or with nothing when cancelled -- then nothing is saved.
@@ -31,6 +31,7 @@ let FigureFirstSave = class FigureFirstSave extends LitElement {
31
31
  this.confirm();
32
32
  };
33
33
  this.confirm = () => {
34
+ this.type = typeOf(this.type);
34
35
  this.refusal = firstSaveRefusalOf(this.type, this.taken);
35
36
  if (this.refusal)
36
37
  return;
@@ -107,13 +108,13 @@ let FigureFirstSave = class FigureFirstSave extends LitElement {
107
108
  .value=${this.type}
108
109
  placeholder=${i18next.t('figure.text.figure-type-example')}
109
110
  @input=${(e) => {
110
- this.type = typeOf(e.target.value);
111
+ this.type = typingTypeOf(e.target.value);
111
112
  e.target.value = this.type;
112
113
  this.refusal = null;
113
114
  }}
114
115
  @keydown=${this.onKey}
115
116
  />
116
- ${this.type && !releasableType(this.type)
117
+ ${typeOf(this.type) && !releasableType(typeOf(this.type))
117
118
  ? html `<div class="note">${i18next.t('figure.text.type-name-will-not-release')}</div>`
118
119
  : this.suggested && this.type === this.suggested
119
120
  ? html `<div class="note">${i18next.t('figure.text.identifier-suggested')}</div>`