@things-factory/figure-ui 10.1.113 → 10.1.115
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.
- package/client/modeller/canvas.ts +6 -0
- package/client/modeller/editor.ts +40 -5
- package/client/modeller/face-mapping.ts +39 -0
- package/client/modeller/figure-face-mapping.ts +78 -0
- package/client/modeller/figure-preview.ts +34 -10
- package/client/modeller/figure-section-editor.ts +12 -4
- package/client/modeller/figure-section-panel.ts +5 -1
- package/client/modeller/preview-model.ts +8 -0
- package/client/pages/figure-modeller-page.ts +7 -1
- package/dist-client/modeller/canvas.js +7 -0
- package/dist-client/modeller/canvas.js.map +1 -1
- package/dist-client/modeller/editor.d.ts +4 -0
- package/dist-client/modeller/editor.js +41 -5
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/face-mapping.d.ts +15 -0
- package/dist-client/modeller/face-mapping.js +20 -0
- package/dist-client/modeller/face-mapping.js.map +1 -0
- package/dist-client/modeller/figure-face-mapping.d.ts +16 -0
- package/dist-client/modeller/figure-face-mapping.js +85 -0
- package/dist-client/modeller/figure-face-mapping.js.map +1 -0
- package/dist-client/modeller/figure-preview.d.ts +2 -0
- package/dist-client/modeller/figure-preview.js +38 -10
- package/dist-client/modeller/figure-preview.js.map +1 -1
- package/dist-client/modeller/figure-section-editor.d.ts +4 -1
- package/dist-client/modeller/figure-section-editor.js +14 -3
- package/dist-client/modeller/figure-section-editor.js.map +1 -1
- package/dist-client/modeller/figure-section-panel.d.ts +4 -1
- package/dist-client/modeller/figure-section-panel.js +6 -0
- package/dist-client/modeller/figure-section-panel.js.map +1 -1
- package/dist-client/modeller/preview-model.d.ts +5 -0
- package/dist-client/modeller/preview-model.js +7 -0
- package/dist-client/modeller/preview-model.js.map +1 -1
- package/dist-client/pages/figure-modeller-page.d.ts +1 -0
- package/dist-client/pages/figure-modeller-page.js +7 -1
- package/dist-client/pages/figure-modeller-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/test/browser/acceptance-page.js +11 -0
- package/test/clip-consent.test.ts +1 -1
- package/test/face-mapping.test.ts +80 -0
- package/test/modeller-route.test.ts +8 -0
- package/test/preview.test.ts +39 -1
- package/test/section-panel.test.ts +1 -1
- package/translations/en.json +7 -1
- package/translations/ja.json +7 -1
- package/translations/ko.json +7 -1
- package/translations/ms.json +7 -1
- package/translations/zh.json +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-section-editor.js","sourceRoot":"","sources":["../../client/modeller/figure-section-editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAA;AAC/L,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACjH,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AAKzC,6GAA6G;AAC7G,MAAM,MA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C;;qDAAa;AAEX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAAsC;AAEtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDAAe;AAMzC;IAAhB,KAAK,EAAE;;oDAAkG;AAEzF;IAAhB,KAAK,EAAE;;oDAAwB;AACf;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AA9Of,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAwzB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureEvaluatedShape, FigureSection, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf, workingShapeOf, type SectionWorking } from './section-drawing.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, END_FACE, sameOf, sidesOf } from './section-controls.js'\nimport './figure-cavity-drawing.js'\nimport { openPopup } from '@operato/layout'\nimport './figure-section-close-choice.js'\nimport type { SectionCloseChoice } from './figure-section-close-choice.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */\nconst SCREEN: Record<Axis, [Axis, Axis]> = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] }\n\n/** The inside said so two can be compared: its walls by side, its ends. */\nconst cavityKey = (w: SectionWorking) =>\n w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null\n\n/** The editor's width and room for the solid beside it: below this the two take turns. */\nexport const NARROW_BELOW = 900\n\n/**\n * 단면 편집 — a pushed part's section and length in one editor (ADR-0100 §3.2, stage 2).\n *\n * The outline is drawn flat, looking along the push, in millimetres from the part's origin; the figure behind stays in\n * view and shows the solid the working state makes (`command-live`, the same preview the section panel uses), so the 2D\n * and the 3D stand side by side. A drawn section's point is dragged or typed, a side pressed gains a point in its\n * middle, a point is deleted, never below three. A rectangle's width and depth and an ellipse's diameters are dragged by\n * their handles or typed; a circle's two are one. The push's length is typed, and the face it keeps is the one the\n * part's placement or fastening keeps (§4.1: read here, changed elsewhere). A measure that follows another value is\n * shown and not offered.\n *\n * A drawn section's end can be drawn to one point -- a pyramid, a tetrahedron from three points (§4.1.1, A5-1): the\n * apex is dragged or typed like a point, and is not offered while something is fastened to the end it takes away (the\n * kernel's own refusal, `pointBlocked`).\n *\n * A rectangle's or ellipse's inside is made, changed or taken away here too, by the same drawing the section panel has\n * (figure-cavity-drawing), drawn and judged on the widths being typed: walls that fit only a wider section are taken\n * with it, in the same command (figure-model `set-section`'s `cavity`).\n *\n * What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows\n * the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel\n * or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep\n * editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor\n * is open, apply is refused until it is opened again.\n */\n@customElement('figure-section-editor')\nexport class FigureSectionEditor extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n position: absolute;\n left: 12px;\n top: 12px;\n bottom: 12px;\n z-index: 5;\n display: grid;\n grid-template-rows: auto auto minmax(0, 1fr) auto;\n width: min(560px, calc(100% - 24px));\n background: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 18%);\n overflow: hidden;\n }\n /* Each in its own row: the tabs are hidden on a wide screen, and without the rows named the body fell into theirs. */\n header {\n grid-row: 1;\n }\n nav[tabs] {\n grid-row: 2;\n }\n div[body] {\n grid-row: 3;\n }\n footer {\n grid-row: 4;\n }\n header {\n display: flex;\n align-items: baseline;\n gap: 10px;\n padding: 10px 14px 4px;\n }\n header h2 {\n margin: 0;\n font-size: var(--ui-t-body);\n }\n header span {\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n nav[tabs] {\n display: none;\n gap: 4px;\n padding: 0 14px 6px;\n }\n nav[tabs] button,\n footer button,\n li button {\n font: inherit;\n font-size: 0.78rem;\n min-height: 30px;\n padding: 0 12px;\n border-radius: 15px;\n border: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n }\n nav[tabs] button[on] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n div[body] {\n display: grid;\n grid-template-rows: minmax(160px, 1fr) auto;\n min-height: 0;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[outline] {\n position: relative;\n min-height: 0;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n div[caption] {\n position: absolute;\n left: 8px;\n top: 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n pointer-events: none;\n }\n div[caption][last-valid] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n aside {\n max-height: 34vh;\n overflow: auto;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[sizes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 6px;\n margin-bottom: 8px;\n }\n label[mm] {\n display: grid;\n gap: 2px;\n }\n label[mm] input {\n min-width: 0;\n font: inherit;\n }\n label[apex] {\n display: flex;\n align-items: center;\n gap: 6px;\n grid-column: 1 / -1;\n }\n label[apex] small {\n flex-basis: 100%;\n }\n ol[points] {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n gap: 4px;\n }\n ol[points] li {\n display: grid;\n grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) auto;\n gap: 6px;\n align-items: center;\n padding: 2px 4px;\n border-radius: 6px;\n }\n ol[points] li[selected] {\n background: var(--md-sys-color-secondary-container);\n }\n ol[points] li[marked] b {\n color: var(--md-sys-color-error);\n }\n ol[points] input {\n min-width: 0;\n font: inherit;\n }\n div[cavity] {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n /* The panel's width: wider, the drawing pushed the outline out of view. */\n div[cavity] figure-cavity-drawing {\n max-width: 340px;\n }\n label[toggle] {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n }\n label[toggle] small[result] {\n margin-left: auto;\n }\n ul[issues] {\n margin: 8px 0 0;\n padding: 0 0 0 16px;\n color: var(--md-sys-color-error);\n font-size: 0.76rem;\n }\n small {\n color: var(--md-sys-color-on-surface-variant);\n }\n footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n footer span[grow] {\n flex: 1;\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n footer span[grow][stale] {\n color: var(--md-sys-color-error);\n }\n footer button[primary] {\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border-color: transparent;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n /* Too little room beside the editor for the solid: the outline and the solid take turns (§7). */\n :host([narrow]) nav[tabs] {\n display: flex;\n }\n :host([narrow][show='solid']) div[body] {\n display: none;\n }\n :host([narrow][show='solid']) {\n bottom: auto;\n }\n `]\n\n /** The part and its evaluated shape as they stand when the editor opens. */\n @property({ attribute: false }) body?: { id: string; shape: FigureEvaluatedShape }\n /** Which of its measures can be set (figure-model's `figureSectionMeasuresOf`). */\n @property({ attribute: false }) measures?: { measures: Record<Axis, FigureSectionMeasure>; round: boolean }\n /** Along the push, the face a length change keeps: 1 its start, -1 its end, 0 its centre; undefined when it cannot be said. */\n @property({ attribute: false }) kept?: -1 | 0 | 1\n /** Why a push's end cannot be drawn to a point now, in the kernel's words (what is fastened to it); empty when it can. */\n @property({ attribute: false }) pointBlocked = ''\n /** The figure's revision now; the editor remembers the one it opened at. */\n @property({ type: Number }) revision = 0\n /** Narrow: the outline or the solid behind. */\n @property({ reflect: true }) show: 'outline' | 'solid' = 'outline'\n /** Set when the space the editor stands in leaves too little beside it to see the solid. */\n @property({ type: Boolean, reflect: true }) narrow = false\n private room = new ResizeObserver(([entry]) => {\n this.narrow = (entry?.contentRect.width ?? 0) < NARROW_BELOW\n if (!this.narrow) this.show = 'outline'\n })\n\n @state() private working: SectionWorking = { points: [], across: {}, length: 0, apex: null, cavity: null }\n /** Walls one per side in the inside's drawing; on when they open differing. */\n @state() private perSide = false\n @state() private selected: string | null = null\n @state() private note = ''\n private opened!: SectionWorking\n private history: SectionWorking[] = []\n private lastValid!: SectionWorking\n private openedAt = 0\n private dragging: string | null = null\n /** The state as it was when a drag began: kept once something moves, so a press alone is not a step back. */\n private dragFrom: SectionWorking | null = null\n private extent = 200\n\n private get axis(): Axis {\n return ((this.body && drawnOf(this.body.shape)?.axis) ?? 'y') as Axis\n }\n private get kind() {\n return this.body && drawnOf(this.body.shape)?.section.kind\n }\n /** A pushed rectangle or ellipse can have an inside; a drawn section's is a later stage. */\n private get hollowable() {\n return !!this.body?.shape.extrusion && (this.kind === 'rectangle' || this.kind === 'ellipse')\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.working = workingOf(this.body!.shape)\n this.opened = this.working\n this.lastValid = this.working\n this.openedAt = this.revision\n this.extent = this.extentOf(this.working)\n this.perSide = !!this.working.cavity && sameOf(Object.values(this.working.cavity.wall)) === undefined\n window.addEventListener('keydown', this.keys, true)\n if (this.parentElement) this.room.observe(this.parentElement)\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.keys, true)\n this.room.disconnect()\n super.disconnectedCallback()\n }\n\n /** How far the drawing reaches from the origin: the outline's farthest point with room around, in 50 mm steps. */\n private extentOf(w: SectionWorking): number {\n const [h, v] = SCREEN[this.axis]\n const far = Math.max(\n 1,\n ...w.points.flatMap(p => [Math.abs(p[h] ?? 0), Math.abs(p[v] ?? 0)]),\n ...Object.values(w.across).map(a => (a ?? 0) / 2),\n ...Object.values(w.apex ?? {}).map(a => Math.abs(a ?? 0))\n )\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n }\n\n /*\n * Heard first (capture on the window), and a key the editor takes goes no further: the scene behind listens too, and\n * would take Esc as \"select nothing\" and Delete as \"delete the part\".\n */\n private keys = (e: KeyboardEvent) => {\n const inField = (e.composedPath()[0] as HTMLElement)?.tagName === 'INPUT'\n /* A number being typed in the inside's drawing: Esc there puts the number back, not the editor away. */\n if (inField && e.composedPath().some(el => (el as HTMLElement).tagName === 'FIGURE-CAVITY-DRAWING')) return\n /* While the close is being asked, the question has the keys: Esc there is 계속 편집. */\n if (this.asking) return\n const take = () => (e.preventDefault(), e.stopImmediatePropagation())\n if (e.key === 'Escape') {\n take()\n this.requestClose()\n } else if ((e.key === 'Delete' || e.key === 'Backspace') && !inField && this.selected) {\n /* In a field the key deletes a character; outside, the chosen point. */\n take()\n this.removePoint(this.selected)\n } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'z' && !inField) {\n take()\n this.back()\n }\n }\n\n private get stale() {\n return this.revision !== this.openedAt\n }\n\n private valid(w: SectionWorking) {\n return workingIssuesOf(this.body!.shape, w).words.length === 0\n }\n\n private change(next: SectionWorking) {\n this.history.push(this.working)\n this.working = next\n this.note = ''\n if (this.valid(next)) this.lastValid = next\n this.preview()\n }\n\n private back() {\n const before = this.history.pop()\n if (!before) return\n this.working = before\n if (this.valid(before)) this.lastValid = before\n this.preview()\n }\n\n /** The solid behind shows the working state, or the last valid one while the working one is refused. */\n private preview(w = this.lastValid) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: this.action(w) }, bubbles: true, composed: true }))\n }\n\n /** One command for everything changed since the editor opened; a measure not changed is not sent (it may follow another). */\n private action(w: SectionWorking): FigureAuthoringAction {\n const o = this.opened\n const changed = (a: number | undefined, b: number | undefined) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9\n const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, o.across[k as Axis])))\n const apexMoved = !w.apex !== !o.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, o.apex![k as Axis])))\n const cavityMoved = JSON.stringify(cavityKey(w)) !== JSON.stringify(cavityKey(o))\n return {\n kind: 'set-section',\n part: this.body!.id,\n ...(this.kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),\n ...(Object.keys(across).length ? { across } : {}),\n ...(changed(w.length, o.length) ? { length: w.length } : {}),\n ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),\n ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})\n }\n }\n\n private removePoint(id: string) {\n const next = removePoint(this.working.points, id)\n if ('refused' in next) {\n this.note = i18next.t('figure.text.section-issue-too-few')\n return\n }\n this.selected = null\n this.change({ ...this.working, points: next })\n }\n\n /** A width across set: a circle's two are one. */\n private across(axis: Axis, value: number): SectionWorking {\n const [u, v] = SCREEN[this.axis]\n const both = this.measures?.round ? { [u]: value, [v]: value } : { [axis]: value }\n return { ...this.working, across: { ...this.working.across, ...both } }\n }\n\n private apply() {\n if (this.stale || !this.valid(this.working)) return\n this.dispatchEvent(new CustomEvent('command', { detail: { action: this.action(this.working) }, bubbles: true, composed: true }))\n this.close()\n }\n\n /** Whether anything was changed since the editor opened. */\n get dirty(): boolean {\n const key = (w: SectionWorking) =>\n JSON.stringify([\n w.points.map(p => [p.id, p.x ?? 0, p.y ?? 0, p.z ?? 0]),\n Object.entries(w.across).sort(),\n w.length,\n w.apex ? Object.entries(w.apex).sort() : null,\n cavityKey(w)\n ])\n return !!this.opened && key(this.working) !== key(this.opened)\n }\n\n private asking = false\n /**\n * Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the\n * editor closed; false when the person keeps editing.\n */\n async requestClose(): Promise<boolean> {\n if (!this.dirty) {\n this.cancel()\n return true\n }\n if (this.asking) return false\n const held = this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : this.valid(this.working)\n ? ''\n : i18next.t('figure.text.section-editor-close-invalid')\n this.asking = true\n try {\n const choice = await openPopup<SectionCloseChoice>(html`<figure-section-close-choice .held=${held}></figure-section-close-choice>`, {\n backdrop: true,\n size: 'small',\n title: i18next.t('figure.label.section-editor')\n }).result\n if (choice === 'apply' && !held) {\n this.apply()\n return true\n }\n if (choice === 'discard') {\n this.cancel()\n return true\n }\n return false\n } finally {\n this.asking = false\n }\n }\n\n private cancel() {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: null }, bubbles: true, composed: true }))\n this.close()\n }\n\n private close() {\n this.dispatchEvent(new CustomEvent('section-editor-close', { bubbles: true, composed: true }))\n }\n\n private svgPoint(e: PointerEvent): { h: number; v: number } {\n const el = this.renderRoot.querySelector('svg')!\n const pt = el.createSVGPoint()\n pt.x = e.clientX\n pt.y = e.clientY\n const p = pt.matrixTransform(el.getScreenCTM()!.inverse())\n return { h: Math.round(p.x), v: Math.round(p.y) }\n }\n\n /** Words for the face a length change keeps, by the part's relations; nothing when they cannot say. */\n private keptWords(): string {\n if (this.kept === undefined) return ''\n if (this.kept === 0) return i18next.t('figure.text.section-editor-keeps-centre')\n return i18next.t('figure.text.section-editor-keeps', {\n face: i18next.t('figure.label.face-' + END_FACE(this.axis, this.kept === 1 ? 'start' : 'end'))\n })\n }\n\n render() {\n if (!this.body) return nothing\n const { issues, words } = workingIssuesOf(this.body.shape, this.working)\n return html`\n <header>\n <h2>${i18next.t('figure.label.section-editor')}</h2>\n <span>${this.body.id}</span>\n </header>\n <nav tabs>\n ${(['outline', 'solid'] as const).map(\n one => html`<button ?on=${this.show === one} @click=${() => (this.show = one)}>${i18next.t(`figure.label.section-editor-${one}`)}</button>`\n )}\n </nav>\n <div body>\n <div outline>${this.drawing(issues, words.length > 0)}</div>\n <aside>${this.list(issues, words)}</aside>\n </div>\n <footer>\n <button ?disabled=${!this.history.length} @click=${() => this.back()}>${i18next.t('figure.button.section-editor-back')}</button>\n <span grow ?stale=${this.stale}>\n ${this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : i18next.t(this.kind === 'polygon' ? 'figure.text.section-editor-hint' : 'figure.text.section-editor-hint-sized')}\n </span>\n <button @click=${() => this.requestClose()}>${i18next.t('figure.button.section-editor-cancel')}</button>\n <button primary ?disabled=${this.stale || words.length > 0} @click=${() => this.apply()}>${i18next.t('figure.button.section-editor-apply')}</button>\n </footer>\n `\n }\n\n /** A section drawn as the screen lays it: across to the right, then down. */\n private outline(section: FigureSection, attrs: { fill: string; stroke: string; width: number; dash?: string }, centre: Partial<Record<Axis, number>> = {}) {\n const [h, v] = SCREEN[this.axis]\n const ch = centre[h] ?? 0,\n cv = centre[v] ?? 0\n if (section.kind === 'polygon')\n return svg`<polygon points=${section.points.map(p => `${p[h]},${p[v]}`).join(' ')} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n if (section.kind === 'ellipse')\n return svg`<ellipse cx=${ch} cy=${cv} rx=${section.radius[h]} ry=${section.radius[v]} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n const w = section.size[h]!,\n d = section.size[v]!\n return svg`<rect x=${ch - w / 2} y=${cv - d / 2} width=${w} height=${d} rx=${section.corner?.[h] ?? 0} ry=${section.corner?.[v] ?? 0}\n fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n }\n\n private drawing(issues: ReturnType<typeof workingIssuesOf>['issues'], invalid: boolean) {\n const [h, v] = SCREEN[this.axis]\n const e = this.extent\n const marked = markedBy(issues)\n const w = this.working\n const section = sectionOf(this.body!.shape, w)\n const pts = w.points\n const sides = this.kind === 'polygon' && pts.length >= 2 ? figureSectionSidesOf({ kind: 'polygon', points: pts }, this.axis) : []\n const at = (id: string) => pts.find(p => p.id === id)!\n const grid = Math.max(10, Math.pow(10, Math.floor(Math.log10(e))) / 2)\n const lines: number[] = []\n for (let g = -Math.floor(e / grid) * grid; g <= e; g += grid) lines.push(g)\n const inside = w.cavity && !invalid ? figureCavitySectionOf(section, this.axis, w.cavity.wall) : undefined\n const sized = (axis: Axis) => this.measures?.measures[axis] === 'editable'\n return html`<div caption ?last-valid=${invalid}>\n ${invalid ? i18next.t('figure.text.section-editor-last-valid') : i18next.t('figure.text.section-editor-units', { h: h.toUpperCase(), v: v.toUpperCase() })}\n </div>\n <svg\n viewBox=${`${-e} ${-e} ${2 * e} ${2 * e}`}\n role=\"img\"\n aria-label=${i18next.t('figure.label.section-editor')}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.dragging) return\n if (this.dragFrom) this.history.push(this.dragFrom), (this.dragFrom = null)\n const p = this.svgPoint(ev)\n const handle = /^handle:(.)$/.exec(this.dragging)\n this.working = handle\n ? this.across(handle[1] as Axis, Math.max(1, 2 * Math.abs(handle[1] === h ? p.h : p.v)))\n : this.dragging === 'apex'\n ? { ...this.working, apex: { [h]: p.h, [v]: p.v } }\n : { ...this.working, points: movePoint(this.working.points, this.dragging, { [h]: p.h, [v]: p.v }) }\n if (this.valid(this.working)) this.lastValid = this.working\n this.preview()\n }}\n @pointerup=${() => ((this.dragging = null), (this.dragFrom = null))}\n @pointerleave=${() => ((this.dragging = null), (this.dragFrom = null))}\n >\n ${svg`${lines.map(g => svg`<line x1=${g} y1=${-e} x2=${g} y2=${e} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />\n <line x1=${-e} y1=${g} x2=${e} y2=${g} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />`)}\n <line x1=${-e} y1=\"0\" x2=${e} y2=\"0\" stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <line x1=\"0\" y1=${-e} x2=\"0\" y2=${e} stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <text x=${e * 0.92} y=${-e * 0.02} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${h.toUpperCase()}</text>\n <text x=${e * 0.02} y=${e * 0.95} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${v.toUpperCase()}</text>\n ${invalid ? this.outline(sectionOf(this.body!.shape, this.lastValid), { fill: 'none', stroke: 'var(--md-sys-color-outline)', width: e / 250, dash: `${e / 50} ${e / 70}` }) : nothing}\n ${this.outline(section, {\n fill: invalid ? 'none' : 'color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent)',\n stroke: this.kind === 'polygon' ? 'none' : invalid ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)',\n width: e / 130\n })}\n ${inside && 'section' in inside\n ? this.outline(inside.section, { fill: 'var(--md-sys-color-surface)', stroke: 'var(--md-sys-color-primary)', width: e / 250, dash: `${e / 60} ${e / 90}` }, inside.centre)\n : nothing}\n ${sides.map(s => {\n const a = at(s.from!),\n b = at(s.to!)\n const bad = marked.sides.has(s.id)\n return svg`<line x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / (bad ? 90 : 130)}\n stroke-dasharray=${bad ? `${e / 40} ${e / 80}` : ''} />\n <line side=${s.id} x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]} stroke=\"transparent\" stroke-width=${e / 25} style=\"cursor: copy\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n const made = insertAfter(this.working.points, s.from!, this.axis)\n this.change({ ...this.working, points: made.points })\n this.selected = made.id\n }}><title>${i18next.t('figure.text.section-editor-add-here', { a: pointLabel(s.from!), b: pointLabel(s.to!) })}</title></line>`\n })}\n ${pts.map(p => {\n const bad = marked.points.has(p.id),\n on = this.selected === p.id\n return svg`<g point=${p.id} style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = p.id\n this.dragging = p.id\n }}>\n <circle cx=${p[h]} cy=${p[v]} r=${e / (on ? 28 : 36)} fill=${bad ? 'var(--md-sys-color-error)' : on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-surface)'}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / 250} />\n <text x=${p[h]! + e / 22} y=${p[v]! - e / 22} font-size=${e / 16} font-weight=\"600\"\n fill=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-on-surface)'}>${pointLabel(p.id)}</text>\n </g>`\n })}\n ${w.apex\n ? svg`${pts.map(p => svg`<line x1=${p[h]} y1=${p[v]} x2=${w.apex![h]} y2=${w.apex![v]} stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 300} stroke-dasharray=${`${e / 60} ${e / 90}`} />`)}\n <g apex style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = null\n this.dragging = 'apex'\n }}>\n <rect x=${w.apex[h]! - e / 34} y=${w.apex[v]! - e / 34} width=${e / 17} height=${e / 17}\n transform=${`rotate(45 ${w.apex[h]} ${w.apex[v]})`} fill=\"var(--md-sys-color-tertiary)\" stroke=\"var(--md-sys-color-surface)\" stroke-width=${e / 250} />\n <text x=${w.apex[h]! + e / 22} y=${w.apex[v]! + e / 12} font-size=${e / 16} font-weight=\"600\" fill=\"var(--md-sys-color-on-surface)\">${i18next.t('figure.label.section-editor-apex-mark')}</text>\n <title>${i18next.t('figure.label.section-editor-apex-mark')}</title>\n </g>`\n : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : ([h, v] as const).filter(sized).map(axis => {\n const half = (w.across[axis] ?? 0) / 2\n const cx = axis === h ? half : 0,\n cy = axis === h ? 0 : half\n return svg`<g handle=${axis} style=${`cursor: ${axis === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.dragging = `handle:${axis}`\n }}>\n <rect x=${cx - e / 40} y=${cy - e / 40} width=${e / 20} height=${e / 20} rx=${e / 120}\n fill=\"var(--md-sys-color-surface)\" stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 200} />\n <text x=${cx + e / 28} y=${cy - e / 28} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface)\">${Math.round((w.across[axis] ?? 0) * 10) / 10}</text>\n <title>${i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() })}</title>\n </g>`\n })}`}\n </svg>`\n }\n\n /** A millimetre field: committed to the working state on change, a bad number put back. */\n private field(label: string, now: number, set: (value: number) => void, disabled = false, note = '') {\n return html`<label mm>\n <span>${label}</span>\n <input\n type=\"number\"\n step=\"any\"\n min=\"0\"\n inputmode=\"decimal\"\n aria-label=${label}\n .value=${live(String(Math.round(now * 1000) / 1000))}\n ?disabled=${disabled}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(now)\n return\n }\n set(value)\n }}\n />\n ${note ? html`<small>${note}</small>` : nothing}\n </label>`\n }\n\n /** A drawn section's end: the section again (a push) or one point (a pyramid), and where that point is. */\n private apexFields() {\n const [h, v] = SCREEN[this.axis]\n const apex = this.working.apex\n /* The kernel's refusal holds only for turning a push into a pyramid; a pyramid can always be made a push again. */\n const blocked = !apex && !this.opened?.apex ? this.pointBlocked : ''\n return html`<label apex>\n <input\n type=\"checkbox\"\n .checked=${live(!!apex)}\n ?disabled=${!!blocked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n this.change({ ...this.working, apex: on ? (this.opened.apex ?? apexOver(this.working.points, this.axis)) : null })\n }}\n />\n <span>${i18next.t('figure.label.section-editor-apex')}</span>\n ${blocked ? html`<small>${blocked}</small>` : nothing}\n </label>\n ${apex\n ? ([h, v] as const).map(axis =>\n html`<label mm>\n <span>${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}</span>\n <input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}\n .value=${live(String(apex[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(apex[axis] ?? '')\n return\n }\n this.change({ ...this.working, apex: { ...apex, [axis]: value } })\n }}\n />\n </label>`\n )\n : nothing}`\n }\n\n /** The inside, as the section panel shows it, on the working section: on or off, what it makes, its drawing. */\n private cavityBlock(invalid: boolean) {\n const w = this.working\n const shape = workingShapeOf(this.body!.shape, w)\n return html`<div cavity>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!w.cavity)}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n const ask = cavityRequestOf(shape, {})\n const wall = typeof ask.wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, ask.wall as number])) : (ask.wall as Record<string, number>)\n this.change({ ...w, cavity: on ? { wall, start: ask.start, end: ask.end } : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n ${w.cavity && !invalid\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(shape.cavity!)}`),\n depth: String(cavityDepthOf(shape))\n })}\n </small>`\n : nothing}\n </label>\n ${w.cavity\n ? html`<figure-cavity-drawing\n .body=${{ id: this.body!.id, shape }}\n .perSide=${this.perSide}\n @command-live=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n this.preview(c && this.valid({ ...this.working, cavity: c }) ? { ...this.working, cavity: c } : this.lastValid)\n }}\n @command=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n if (c) this.change({ ...this.working, cavity: c })\n }}\n ></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}\n </div>`\n }\n\n /** The inside a drawing's set-cavity asks for, every wall written out; the drawing's commands stay in the editor. */\n private cavityOf(action: FigureAuthoringAction | null): SectionWorking['cavity'] | undefined {\n if (action?.kind !== 'set-cavity' || !action.cavity) return undefined\n const { wall, start, end } = action.cavity\n return { wall: typeof wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, wall])) : ({ ...wall } as Record<string, number>), start, end }\n }\n\n private list(issues: ReturnType<typeof workingIssuesOf>['issues'], words: ReturnType<typeof workingIssuesOf>['words']) {\n const [h, v] = SCREEN[this.axis]\n const marked = markedBy(issues)\n const m = this.measures?.measures\n const linked = i18next.t('figure.text.section-editor-linked')\n return html`<div sizes>\n ${this.field(\n i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'),\n this.working.length,\n value => this.change({ ...this.working, length: value }),\n m?.[this.axis] !== 'editable',\n m?.[this.axis] === 'linked' ? linked : this.keptWords()\n )}\n ${this.kind === 'polygon' ? this.apexFields() : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : this.measures?.round\n ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', m?.[h] === 'linked' ? linked : '')\n : ([h, v] as const).map(axis =>\n this.field(\n i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }),\n this.working.across[axis] ?? 0,\n value => this.change(this.across(axis, value)),\n m?.[axis] !== 'editable',\n m?.[axis] === 'linked' ? linked : ''\n )\n )}\n </div>\n ${this.kind === 'polygon'\n ? html`<ol points aria-label=${i18next.t('figure.label.section-editor-points')}>\n ${this.working.points.map(\n p => html`<li ?selected=${this.selected === p.id} ?marked=${marked.points.has(p.id)} @focusin=${() => (this.selected = p.id)}>\n <b>${pointLabel(p.id)}</b>\n ${([h, v] as const).map(\n axis => html`<input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-coordinate', { point: pointLabel(p.id), axis: axis.toUpperCase() })}\n .value=${live(String(p[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(p[axis] ?? '')\n return\n }\n this.change({ ...this.working, points: movePoint(this.working.points, p.id, { [axis]: value }) })\n }}\n />`\n )}\n <button\n ?disabled=${this.working.points.length <= 3}\n title=${this.working.points.length <= 3 ? i18next.t('figure.text.section-issue-too-few') : ''}\n aria-label=${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n @click=${() => this.removePoint(p.id)}\n >\n ${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n </button>\n </li>`\n )}\n </ol>`\n : nothing}\n ${this.hollowable ? this.cavityBlock(words.length > 0) : nothing}\n ${this.note ? html`<small role=\"status\">${this.note}</small>` : nothing}\n ${words.length\n ? html`<ul issues role=\"alert\">\n ${words.map(w => html`<li>${i18next.t(w.key, w.params)}</li>`)}\n </ul>`\n : nothing}`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"figure-section-editor.js","sourceRoot":"","sources":["../../client/modeller/fig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tB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDAAe;AAMzC;IAAhB,KAAK,EAAE;;oDAAkG;AAEzF;IAAhB,KAAK,EAAE;;oDAAwB;AACf;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AAhPf,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA+zB/B","sourcesContent":["import { css, html, LitElement, nothing, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureEvaluatedShape, FigureFaceMappingNeed, FigureSection, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf, workingShapeOf, type SectionWorking } from './section-drawing.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, END_FACE, sameOf, sidesOf } from './section-controls.js'\nimport './figure-cavity-drawing.js'\nimport './figure-face-mapping.js'\nimport { openPopup } from '@operato/layout'\nimport './figure-section-close-choice.js'\nimport type { SectionCloseChoice } from './figure-section-close-choice.js'\n\ntype Axis = 'x' | 'y' | 'z'\n\n/** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */\nconst SCREEN: Record<Axis, [Axis, Axis]> = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] }\n\n/** The inside said so two can be compared: its walls by side, its ends. */\nconst cavityKey = (w: SectionWorking) =>\n w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null\n\n/** The editor's width and room for the solid beside it: below this the two take turns. */\nexport const NARROW_BELOW = 900\n\n/**\n * 단면 편집 — a pushed part's section and length in one editor (ADR-0100 §3.2, stage 2).\n *\n * The outline is drawn flat, looking along the push, in millimetres from the part's origin; the figure behind stays in\n * view and shows the solid the working state makes (`command-live`, the same preview the section panel uses), so the 2D\n * and the 3D stand side by side. A drawn section's point is dragged or typed, a side pressed gains a point in its\n * middle, a point is deleted, never below three. A rectangle's width and depth and an ellipse's diameters are dragged by\n * their handles or typed; a circle's two are one. The push's length is typed, and the face it keeps is the one the\n * part's placement or fastening keeps (§4.1: read here, changed elsewhere). A measure that follows another value is\n * shown and not offered.\n *\n * A drawn section's end can be drawn to one point -- a pyramid, a tetrahedron from three points (§4.1.1, A5-1): the\n * apex is dragged or typed like a point, and is not offered while something is fastened to the end it takes away (the\n * kernel's own refusal, `pointBlocked`).\n *\n * A rectangle's or ellipse's inside is made, changed or taken away here too, by the same drawing the section panel has\n * (figure-cavity-drawing), drawn and judged on the widths being typed: walls that fit only a wider section are taken\n * with it, in the same command (figure-model `set-section`'s `cavity`).\n *\n * What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows\n * the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel\n * or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep\n * editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor\n * is open, apply is refused until it is opened again.\n */\n@customElement('figure-section-editor')\nexport class FigureSectionEditor extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n position: absolute;\n left: 12px;\n top: 12px;\n bottom: 12px;\n z-index: 5;\n display: grid;\n grid-template-rows: auto auto minmax(0, 1fr) auto;\n width: min(560px, calc(100% - 24px));\n background: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 18%);\n overflow: hidden;\n }\n /* Each in its own row: the tabs are hidden on a wide screen, and without the rows named the body fell into theirs. */\n header {\n grid-row: 1;\n }\n nav[tabs] {\n grid-row: 2;\n }\n div[body] {\n grid-row: 3;\n }\n footer {\n grid-row: 4;\n }\n header {\n display: flex;\n align-items: baseline;\n gap: 10px;\n padding: 10px 14px 4px;\n }\n header h2 {\n margin: 0;\n font-size: var(--ui-t-body);\n }\n header span {\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n nav[tabs] {\n display: none;\n gap: 4px;\n padding: 0 14px 6px;\n }\n nav[tabs] button,\n footer button,\n li button {\n font: inherit;\n font-size: 0.78rem;\n min-height: 30px;\n padding: 0 12px;\n border-radius: 15px;\n border: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n }\n nav[tabs] button[on] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n div[body] {\n display: grid;\n grid-template-rows: minmax(160px, 1fr) auto;\n min-height: 0;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[outline] {\n position: relative;\n min-height: 0;\n }\n svg {\n width: 100%;\n height: 100%;\n display: block;\n touch-action: none;\n user-select: none;\n }\n div[caption] {\n position: absolute;\n left: 8px;\n top: 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n pointer-events: none;\n }\n div[caption][last-valid] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n aside {\n max-height: 34vh;\n overflow: auto;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n div[sizes] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 6px;\n margin-bottom: 8px;\n }\n label[mm] {\n display: grid;\n gap: 2px;\n }\n label[mm] input {\n min-width: 0;\n font: inherit;\n }\n label[apex] {\n display: flex;\n align-items: center;\n gap: 6px;\n grid-column: 1 / -1;\n }\n label[apex] small {\n flex-basis: 100%;\n }\n ol[points] {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n gap: 4px;\n }\n ol[points] li {\n display: grid;\n grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) auto;\n gap: 6px;\n align-items: center;\n padding: 2px 4px;\n border-radius: 6px;\n }\n ol[points] li[selected] {\n background: var(--md-sys-color-secondary-container);\n }\n ol[points] li[marked] b {\n color: var(--md-sys-color-error);\n }\n ol[points] input {\n min-width: 0;\n font: inherit;\n }\n div[cavity] {\n display: grid;\n gap: 6px;\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n /* The panel's width: wider, the drawing pushed the outline out of view. */\n div[cavity] figure-cavity-drawing {\n max-width: 340px;\n }\n label[toggle] {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n }\n label[toggle] small[result] {\n margin-left: auto;\n }\n ul[issues] {\n margin: 8px 0 0;\n padding: 0 0 0 16px;\n color: var(--md-sys-color-error);\n font-size: 0.76rem;\n }\n small {\n color: var(--md-sys-color-on-surface-variant);\n }\n footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 14px;\n border-top: 1px solid var(--md-sys-color-outline-variant);\n }\n footer span[grow] {\n flex: 1;\n font-size: 0.72rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n footer span[grow][stale] {\n color: var(--md-sys-color-error);\n }\n footer button[primary] {\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border-color: transparent;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n /* Too little room beside the editor for the solid: the outline and the solid take turns (§7). */\n :host([narrow]) nav[tabs] {\n display: flex;\n }\n :host([narrow][show='solid']) div[body] {\n display: none;\n }\n :host([narrow][show='solid']) {\n bottom: auto;\n }\n `]\n\n /** The part and its evaluated shape as they stand when the editor opens. */\n @property({ attribute: false }) body?: { id: string; shape: FigureEvaluatedShape }\n /** Which of its measures can be set (figure-model's `figureSectionMeasuresOf`). */\n @property({ attribute: false }) measures?: { measures: Record<Axis, FigureSectionMeasure>; round: boolean }\n /** Along the push, the face a length change keeps: 1 its start, -1 its end, 0 its centre; undefined when it cannot be said. */\n @property({ attribute: false }) kept?: -1 | 0 | 1\n /** Why a push's end cannot be drawn to a point now, in the kernel's words (what is fastened to it); empty when it can. */\n @property({ attribute: false }) pointBlocked = ''\n /** The figure's revision now; the editor remembers the one it opened at. */\n @property({ type: Number }) revision = 0\n /** What stands on the faces the last apply takes away (ADR-0100 A8): asked here, where the edit was made. */\n @property({ attribute: false }) faceMapping?: FigureFaceMappingNeed\n /** Narrow: the outline or the solid behind. */\n @property({ reflect: true }) show: 'outline' | 'solid' = 'outline'\n /** Set when the space the editor stands in leaves too little beside it to see the solid. */\n @property({ type: Boolean, reflect: true }) narrow = false\n private room = new ResizeObserver(([entry]) => {\n this.narrow = (entry?.contentRect.width ?? 0) < NARROW_BELOW\n if (!this.narrow) this.show = 'outline'\n })\n\n @state() private working: SectionWorking = { points: [], across: {}, length: 0, apex: null, cavity: null }\n /** Walls one per side in the inside's drawing; on when they open differing. */\n @state() private perSide = false\n @state() private selected: string | null = null\n @state() private note = ''\n private opened!: SectionWorking\n private history: SectionWorking[] = []\n private lastValid!: SectionWorking\n private openedAt = 0\n private dragging: string | null = null\n /** The state as it was when a drag began: kept once something moves, so a press alone is not a step back. */\n private dragFrom: SectionWorking | null = null\n private extent = 200\n\n private get axis(): Axis {\n return ((this.body && drawnOf(this.body.shape)?.axis) ?? 'y') as Axis\n }\n private get kind() {\n return this.body && drawnOf(this.body.shape)?.section.kind\n }\n /** A pushed rectangle or ellipse can have an inside; a drawn section's is a later stage. */\n private get hollowable() {\n return !!this.body?.shape.extrusion && (this.kind === 'rectangle' || this.kind === 'ellipse')\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.working = workingOf(this.body!.shape)\n this.opened = this.working\n this.lastValid = this.working\n this.openedAt = this.revision\n this.extent = this.extentOf(this.working)\n this.perSide = !!this.working.cavity && sameOf(Object.values(this.working.cavity.wall)) === undefined\n window.addEventListener('keydown', this.keys, true)\n if (this.parentElement) this.room.observe(this.parentElement)\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.keys, true)\n this.room.disconnect()\n super.disconnectedCallback()\n }\n\n /** How far the drawing reaches from the origin: the outline's farthest point with room around, in 50 mm steps. */\n private extentOf(w: SectionWorking): number {\n const [h, v] = SCREEN[this.axis]\n const far = Math.max(\n 1,\n ...w.points.flatMap(p => [Math.abs(p[h] ?? 0), Math.abs(p[v] ?? 0)]),\n ...Object.values(w.across).map(a => (a ?? 0) / 2),\n ...Object.values(w.apex ?? {}).map(a => Math.abs(a ?? 0))\n )\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n }\n\n /*\n * Heard first (capture on the window), and a key the editor takes goes no further: the scene behind listens too, and\n * would take Esc as \"select nothing\" and Delete as \"delete the part\".\n */\n private keys = (e: KeyboardEvent) => {\n const inField = (e.composedPath()[0] as HTMLElement)?.tagName === 'INPUT'\n /* A number being typed in the inside's drawing: Esc there puts the number back, not the editor away. */\n if (inField && e.composedPath().some(el => (el as HTMLElement).tagName === 'FIGURE-CAVITY-DRAWING')) return\n /* While the close is being asked, the question has the keys: Esc there is 계속 편집. */\n if (this.asking) return\n const take = () => (e.preventDefault(), e.stopImmediatePropagation())\n if (e.key === 'Escape') {\n take()\n this.requestClose()\n } else if ((e.key === 'Delete' || e.key === 'Backspace') && !inField && this.selected) {\n /* In a field the key deletes a character; outside, the chosen point. */\n take()\n this.removePoint(this.selected)\n } else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'z' && !inField) {\n take()\n this.back()\n }\n }\n\n private get stale() {\n return this.revision !== this.openedAt\n }\n\n private valid(w: SectionWorking) {\n return workingIssuesOf(this.body!.shape, w).words.length === 0\n }\n\n private change(next: SectionWorking) {\n this.history.push(this.working)\n this.working = next\n this.note = ''\n if (this.valid(next)) this.lastValid = next\n this.preview()\n }\n\n private back() {\n const before = this.history.pop()\n if (!before) return\n this.working = before\n if (this.valid(before)) this.lastValid = before\n this.preview()\n }\n\n /** The solid behind shows the working state, or the last valid one while the working one is refused. */\n private preview(w = this.lastValid) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: this.action(w) }, bubbles: true, composed: true }))\n }\n\n /** One command for everything changed since the editor opened; a measure not changed is not sent (it may follow another). */\n private action(w: SectionWorking): FigureAuthoringAction {\n const o = this.opened\n const changed = (a: number | undefined, b: number | undefined) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9\n const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, o.across[k as Axis])))\n const apexMoved = !w.apex !== !o.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, o.apex![k as Axis])))\n const cavityMoved = JSON.stringify(cavityKey(w)) !== JSON.stringify(cavityKey(o))\n return {\n kind: 'set-section',\n part: this.body!.id,\n ...(this.kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),\n ...(Object.keys(across).length ? { across } : {}),\n ...(changed(w.length, o.length) ? { length: w.length } : {}),\n ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),\n ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})\n }\n }\n\n private removePoint(id: string) {\n const next = removePoint(this.working.points, id)\n if ('refused' in next) {\n this.note = i18next.t('figure.text.section-issue-too-few')\n return\n }\n this.selected = null\n this.change({ ...this.working, points: next })\n }\n\n /** A width across set: a circle's two are one. */\n private across(axis: Axis, value: number): SectionWorking {\n const [u, v] = SCREEN[this.axis]\n const both = this.measures?.round ? { [u]: value, [v]: value } : { [axis]: value }\n return { ...this.working, across: { ...this.working.across, ...both } }\n }\n\n private apply() {\n if (this.stale || !this.valid(this.working)) return\n const detail: { action: FigureAuthoringAction; held?: boolean } = { action: this.action(this.working) }\n this.dispatchEvent(new CustomEvent('command', { detail, bubbles: true, composed: true }))\n /* Held for a choice of where what stands on a lost face goes: stays open, the choice shown below. */\n if (!detail.held) this.close()\n }\n\n /** Whether anything was changed since the editor opened. */\n get dirty(): boolean {\n const key = (w: SectionWorking) =>\n JSON.stringify([\n w.points.map(p => [p.id, p.x ?? 0, p.y ?? 0, p.z ?? 0]),\n Object.entries(w.across).sort(),\n w.length,\n w.apex ? Object.entries(w.apex).sort() : null,\n cavityKey(w)\n ])\n return !!this.opened && key(this.working) !== key(this.opened)\n }\n\n private asking = false\n /**\n * Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the\n * editor closed; false when the person keeps editing.\n */\n async requestClose(): Promise<boolean> {\n if (!this.dirty) {\n this.cancel()\n return true\n }\n if (this.asking) return false\n const held = this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : this.valid(this.working)\n ? ''\n : i18next.t('figure.text.section-editor-close-invalid')\n this.asking = true\n try {\n const choice = await openPopup<SectionCloseChoice>(html`<figure-section-close-choice .held=${held}></figure-section-close-choice>`, {\n backdrop: true,\n size: 'small',\n title: i18next.t('figure.label.section-editor')\n }).result\n if (choice === 'apply' && !held) {\n this.apply()\n return true\n }\n if (choice === 'discard') {\n this.cancel()\n return true\n }\n return false\n } finally {\n this.asking = false\n }\n }\n\n private cancel() {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action: null }, bubbles: true, composed: true }))\n this.close()\n }\n\n private close() {\n this.dispatchEvent(new CustomEvent('section-editor-close', { bubbles: true, composed: true }))\n }\n\n private svgPoint(e: PointerEvent): { h: number; v: number } {\n const el = this.renderRoot.querySelector('svg')!\n const pt = el.createSVGPoint()\n pt.x = e.clientX\n pt.y = e.clientY\n const p = pt.matrixTransform(el.getScreenCTM()!.inverse())\n return { h: Math.round(p.x), v: Math.round(p.y) }\n }\n\n /** Words for the face a length change keeps, by the part's relations; nothing when they cannot say. */\n private keptWords(): string {\n if (this.kept === undefined) return ''\n if (this.kept === 0) return i18next.t('figure.text.section-editor-keeps-centre')\n return i18next.t('figure.text.section-editor-keeps', {\n face: i18next.t('figure.label.face-' + END_FACE(this.axis, this.kept === 1 ? 'start' : 'end'))\n })\n }\n\n render() {\n if (!this.body) return nothing\n const { issues, words } = workingIssuesOf(this.body.shape, this.working)\n return html`\n <header>\n <h2>${i18next.t('figure.label.section-editor')}</h2>\n <span>${this.body.id}</span>\n </header>\n <nav tabs>\n ${(['outline', 'solid'] as const).map(\n one => html`<button ?on=${this.show === one} @click=${() => (this.show = one)}>${i18next.t(`figure.label.section-editor-${one}`)}</button>`\n )}\n </nav>\n <div body>\n <div outline>${this.drawing(issues, words.length > 0)}</div>\n <aside>\n ${this.faceMapping ? html`<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}\n ${this.list(issues, words)}\n </aside>\n </div>\n <footer>\n <button ?disabled=${!this.history.length} @click=${() => this.back()}>${i18next.t('figure.button.section-editor-back')}</button>\n <span grow ?stale=${this.stale}>\n ${this.stale\n ? i18next.t('figure.text.section-editor-stale')\n : i18next.t(this.kind === 'polygon' ? 'figure.text.section-editor-hint' : 'figure.text.section-editor-hint-sized')}\n </span>\n <button @click=${() => this.requestClose()}>${i18next.t('figure.button.section-editor-cancel')}</button>\n <button primary ?disabled=${this.stale || words.length > 0} @click=${() => this.apply()}>${i18next.t('figure.button.section-editor-apply')}</button>\n </footer>\n `\n }\n\n /** A section drawn as the screen lays it: across to the right, then down. */\n private outline(section: FigureSection, attrs: { fill: string; stroke: string; width: number; dash?: string }, centre: Partial<Record<Axis, number>> = {}) {\n const [h, v] = SCREEN[this.axis]\n const ch = centre[h] ?? 0,\n cv = centre[v] ?? 0\n if (section.kind === 'polygon')\n return svg`<polygon points=${section.points.map(p => `${p[h]},${p[v]}`).join(' ')} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n if (section.kind === 'ellipse')\n return svg`<ellipse cx=${ch} cy=${cv} rx=${section.radius[h]} ry=${section.radius[v]} fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n const w = section.size[h]!,\n d = section.size[v]!\n return svg`<rect x=${ch - w / 2} y=${cv - d / 2} width=${w} height=${d} rx=${section.corner?.[h] ?? 0} ry=${section.corner?.[v] ?? 0}\n fill=${attrs.fill} stroke=${attrs.stroke} stroke-width=${attrs.width} stroke-dasharray=${attrs.dash ?? ''} />`\n }\n\n private drawing(issues: ReturnType<typeof workingIssuesOf>['issues'], invalid: boolean) {\n const [h, v] = SCREEN[this.axis]\n const e = this.extent\n const marked = markedBy(issues)\n const w = this.working\n const section = sectionOf(this.body!.shape, w)\n const pts = w.points\n const sides = this.kind === 'polygon' && pts.length >= 2 ? figureSectionSidesOf({ kind: 'polygon', points: pts }, this.axis) : []\n const at = (id: string) => pts.find(p => p.id === id)!\n const grid = Math.max(10, Math.pow(10, Math.floor(Math.log10(e))) / 2)\n const lines: number[] = []\n for (let g = -Math.floor(e / grid) * grid; g <= e; g += grid) lines.push(g)\n const inside = w.cavity && !invalid ? figureCavitySectionOf(section, this.axis, w.cavity.wall) : undefined\n const sized = (axis: Axis) => this.measures?.measures[axis] === 'editable'\n return html`<div caption ?last-valid=${invalid}>\n ${invalid ? i18next.t('figure.text.section-editor-last-valid') : i18next.t('figure.text.section-editor-units', { h: h.toUpperCase(), v: v.toUpperCase() })}\n </div>\n <svg\n viewBox=${`${-e} ${-e} ${2 * e} ${2 * e}`}\n role=\"img\"\n aria-label=${i18next.t('figure.label.section-editor')}\n @pointermove=${(ev: PointerEvent) => {\n if (!this.dragging) return\n if (this.dragFrom) this.history.push(this.dragFrom), (this.dragFrom = null)\n const p = this.svgPoint(ev)\n const handle = /^handle:(.)$/.exec(this.dragging)\n this.working = handle\n ? this.across(handle[1] as Axis, Math.max(1, 2 * Math.abs(handle[1] === h ? p.h : p.v)))\n : this.dragging === 'apex'\n ? { ...this.working, apex: { [h]: p.h, [v]: p.v } }\n : { ...this.working, points: movePoint(this.working.points, this.dragging, { [h]: p.h, [v]: p.v }) }\n if (this.valid(this.working)) this.lastValid = this.working\n this.preview()\n }}\n @pointerup=${() => ((this.dragging = null), (this.dragFrom = null))}\n @pointerleave=${() => ((this.dragging = null), (this.dragFrom = null))}\n >\n ${svg`${lines.map(g => svg`<line x1=${g} y1=${-e} x2=${g} y2=${e} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />\n <line x1=${-e} y1=${g} x2=${e} y2=${g} stroke=\"var(--md-sys-color-outline-variant)\" stroke-width=${e / 400} opacity=\"0.5\" />`)}\n <line x1=${-e} y1=\"0\" x2=${e} y2=\"0\" stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <line x1=\"0\" y1=${-e} x2=\"0\" y2=${e} stroke=\"var(--md-sys-color-outline)\" stroke-width=${e / 250} />\n <text x=${e * 0.92} y=${-e * 0.02} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${h.toUpperCase()}</text>\n <text x=${e * 0.02} y=${e * 0.95} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface-variant)\">${v.toUpperCase()}</text>\n ${invalid ? this.outline(sectionOf(this.body!.shape, this.lastValid), { fill: 'none', stroke: 'var(--md-sys-color-outline)', width: e / 250, dash: `${e / 50} ${e / 70}` }) : nothing}\n ${this.outline(section, {\n fill: invalid ? 'none' : 'color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent)',\n stroke: this.kind === 'polygon' ? 'none' : invalid ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)',\n width: e / 130\n })}\n ${inside && 'section' in inside\n ? this.outline(inside.section, { fill: 'var(--md-sys-color-surface)', stroke: 'var(--md-sys-color-primary)', width: e / 250, dash: `${e / 60} ${e / 90}` }, inside.centre)\n : nothing}\n ${sides.map(s => {\n const a = at(s.from!),\n b = at(s.to!)\n const bad = marked.sides.has(s.id)\n return svg`<line x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / (bad ? 90 : 130)}\n stroke-dasharray=${bad ? `${e / 40} ${e / 80}` : ''} />\n <line side=${s.id} x1=${a[h]} y1=${a[v]} x2=${b[h]} y2=${b[v]} stroke=\"transparent\" stroke-width=${e / 25} style=\"cursor: copy\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n const made = insertAfter(this.working.points, s.from!, this.axis)\n this.change({ ...this.working, points: made.points })\n this.selected = made.id\n }}><title>${i18next.t('figure.text.section-editor-add-here', { a: pointLabel(s.from!), b: pointLabel(s.to!) })}</title></line>`\n })}\n ${pts.map(p => {\n const bad = marked.points.has(p.id),\n on = this.selected === p.id\n return svg`<g point=${p.id} style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = p.id\n this.dragging = p.id\n }}>\n <circle cx=${p[h]} cy=${p[v]} r=${e / (on ? 28 : 36)} fill=${bad ? 'var(--md-sys-color-error)' : on ? 'var(--md-sys-color-primary)' : 'var(--md-sys-color-surface)'}\n stroke=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-primary)'} stroke-width=${e / 250} />\n <text x=${p[h]! + e / 22} y=${p[v]! - e / 22} font-size=${e / 16} font-weight=\"600\"\n fill=${bad ? 'var(--md-sys-color-error)' : 'var(--md-sys-color-on-surface)'}>${pointLabel(p.id)}</text>\n </g>`\n })}\n ${w.apex\n ? svg`${pts.map(p => svg`<line x1=${p[h]} y1=${p[v]} x2=${w.apex![h]} y2=${w.apex![v]} stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 300} stroke-dasharray=${`${e / 60} ${e / 90}`} />`)}\n <g apex style=\"cursor: grab\"\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.selected = null\n this.dragging = 'apex'\n }}>\n <rect x=${w.apex[h]! - e / 34} y=${w.apex[v]! - e / 34} width=${e / 17} height=${e / 17}\n transform=${`rotate(45 ${w.apex[h]} ${w.apex[v]})`} fill=\"var(--md-sys-color-tertiary)\" stroke=\"var(--md-sys-color-surface)\" stroke-width=${e / 250} />\n <text x=${w.apex[h]! + e / 22} y=${w.apex[v]! + e / 12} font-size=${e / 16} font-weight=\"600\" fill=\"var(--md-sys-color-on-surface)\">${i18next.t('figure.label.section-editor-apex-mark')}</text>\n <title>${i18next.t('figure.label.section-editor-apex-mark')}</title>\n </g>`\n : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : ([h, v] as const).filter(sized).map(axis => {\n const half = (w.across[axis] ?? 0) / 2\n const cx = axis === h ? half : 0,\n cy = axis === h ? 0 : half\n return svg`<g handle=${axis} style=${`cursor: ${axis === h ? 'ew-resize' : 'ns-resize'}`}\n @pointerdown=${(ev: PointerEvent) => {\n ev.stopPropagation()\n ;(ev.target as Element).setPointerCapture?.(ev.pointerId)\n this.dragFrom = this.working\n this.dragging = `handle:${axis}`\n }}>\n <rect x=${cx - e / 40} y=${cy - e / 40} width=${e / 20} height=${e / 20} rx=${e / 120}\n fill=\"var(--md-sys-color-surface)\" stroke=\"var(--md-sys-color-primary)\" stroke-width=${e / 200} />\n <text x=${cx + e / 28} y=${cy - e / 28} font-size=${e / 18} fill=\"var(--md-sys-color-on-surface)\">${Math.round((w.across[axis] ?? 0) * 10) / 10}</text>\n <title>${i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() })}</title>\n </g>`\n })}`}\n </svg>`\n }\n\n /** A millimetre field: committed to the working state on change, a bad number put back. */\n private field(label: string, now: number, set: (value: number) => void, disabled = false, note = '') {\n return html`<label mm>\n <span>${label}</span>\n <input\n type=\"number\"\n step=\"any\"\n min=\"0\"\n inputmode=\"decimal\"\n aria-label=${label}\n .value=${live(String(Math.round(now * 1000) / 1000))}\n ?disabled=${disabled}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(now)\n return\n }\n set(value)\n }}\n />\n ${note ? html`<small>${note}</small>` : nothing}\n </label>`\n }\n\n /** A drawn section's end: the section again (a push) or one point (a pyramid), and where that point is. */\n private apexFields() {\n const [h, v] = SCREEN[this.axis]\n const apex = this.working.apex\n /* The kernel's refusal holds only for turning a push into a pyramid; a pyramid can always be made a push again. */\n const blocked = !apex && !this.opened?.apex ? this.pointBlocked : ''\n return html`<label apex>\n <input\n type=\"checkbox\"\n .checked=${live(!!apex)}\n ?disabled=${!!blocked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n this.change({ ...this.working, apex: on ? (this.opened.apex ?? apexOver(this.working.points, this.axis)) : null })\n }}\n />\n <span>${i18next.t('figure.label.section-editor-apex')}</span>\n ${blocked ? html`<small>${blocked}</small>` : nothing}\n </label>\n ${apex\n ? ([h, v] as const).map(axis =>\n html`<label mm>\n <span>${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}</span>\n <input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-apex-at', { axis: axis.toUpperCase() })}\n .value=${live(String(apex[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(apex[axis] ?? '')\n return\n }\n this.change({ ...this.working, apex: { ...apex, [axis]: value } })\n }}\n />\n </label>`\n )\n : nothing}`\n }\n\n /** The inside, as the section panel shows it, on the working section: on or off, what it makes, its drawing. */\n private cavityBlock(invalid: boolean) {\n const w = this.working\n const shape = workingShapeOf(this.body!.shape, w)\n return html`<div cavity>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!w.cavity)}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n const ask = cavityRequestOf(shape, {})\n const wall = typeof ask.wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, ask.wall as number])) : (ask.wall as Record<string, number>)\n this.change({ ...w, cavity: on ? { wall, start: ask.start, end: ask.end } : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n ${w.cavity && !invalid\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(shape.cavity!)}`),\n depth: String(cavityDepthOf(shape))\n })}\n </small>`\n : nothing}\n </label>\n ${w.cavity\n ? html`<figure-cavity-drawing\n .body=${{ id: this.body!.id, shape }}\n .perSide=${this.perSide}\n @command-live=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n this.preview(c && this.valid({ ...this.working, cavity: c }) ? { ...this.working, cavity: c } : this.lastValid)\n }}\n @command=${(ev: CustomEvent) => {\n ev.stopPropagation()\n const c = this.cavityOf(ev.detail.action)\n if (c) this.change({ ...this.working, cavity: c })\n }}\n ></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}\n </div>`\n }\n\n /** The inside a drawing's set-cavity asks for, every wall written out; the drawing's commands stay in the editor. */\n private cavityOf(action: FigureAuthoringAction | null): SectionWorking['cavity'] | undefined {\n if (action?.kind !== 'set-cavity' || !action.cavity) return undefined\n const { wall, start, end } = action.cavity\n return { wall: typeof wall === 'number' ? Object.fromEntries(sidesOf(this.axis).map(side => [side, wall])) : ({ ...wall } as Record<string, number>), start, end }\n }\n\n private list(issues: ReturnType<typeof workingIssuesOf>['issues'], words: ReturnType<typeof workingIssuesOf>['words']) {\n const [h, v] = SCREEN[this.axis]\n const marked = markedBy(issues)\n const m = this.measures?.measures\n const linked = i18next.t('figure.text.section-editor-linked')\n return html`<div sizes>\n ${this.field(\n i18next.t(this.working.apex ? 'figure.label.section-editor-height' : 'figure.label.section-editor-length'),\n this.working.length,\n value => this.change({ ...this.working, length: value }),\n m?.[this.axis] !== 'editable',\n m?.[this.axis] === 'linked' ? linked : this.keptWords()\n )}\n ${this.kind === 'polygon' ? this.apexFields() : nothing}\n ${this.kind === 'polygon'\n ? nothing\n : this.measures?.round\n ? this.field(i18next.t('figure.label.section-editor-diameter'), this.working.across[h] ?? 0, value => this.change(this.across(h, value)), m?.[h] !== 'editable', m?.[h] === 'linked' ? linked : '')\n : ([h, v] as const).map(axis =>\n this.field(\n i18next.t('figure.label.section-editor-across', { axis: axis.toUpperCase() }),\n this.working.across[axis] ?? 0,\n value => this.change(this.across(axis, value)),\n m?.[axis] !== 'editable',\n m?.[axis] === 'linked' ? linked : ''\n )\n )}\n </div>\n ${this.kind === 'polygon'\n ? html`<ol points aria-label=${i18next.t('figure.label.section-editor-points')}>\n ${this.working.points.map(\n p => html`<li ?selected=${this.selected === p.id} ?marked=${marked.points.has(p.id)} @focusin=${() => (this.selected = p.id)}>\n <b>${pointLabel(p.id)}</b>\n ${([h, v] as const).map(\n axis => html`<input\n type=\"number\"\n step=\"any\"\n inputmode=\"decimal\"\n aria-label=${i18next.t('figure.label.section-editor-coordinate', { point: pointLabel(p.id), axis: axis.toUpperCase() })}\n .value=${live(String(p[axis] ?? ''))}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n const value = Number(input.value)\n if (input.value === '' || !Number.isFinite(value)) {\n input.value = String(p[axis] ?? '')\n return\n }\n this.change({ ...this.working, points: movePoint(this.working.points, p.id, { [axis]: value }) })\n }}\n />`\n )}\n <button\n ?disabled=${this.working.points.length <= 3}\n title=${this.working.points.length <= 3 ? i18next.t('figure.text.section-issue-too-few') : ''}\n aria-label=${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n @click=${() => this.removePoint(p.id)}\n >\n ${i18next.t('figure.button.section-editor-remove', { point: pointLabel(p.id) })}\n </button>\n </li>`\n )}\n </ol>`\n : nothing}\n ${this.hollowable ? this.cavityBlock(words.length > 0) : nothing}\n ${this.note ? html`<small role=\"status\">${this.note}</small>` : nothing}\n ${words.length\n ? html`<ul issues role=\"alert\">\n ${words.map(w => html`<li>${i18next.t(w.key, w.params)}</li>`)}\n </ul>`\n : nothing}`\n }\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { LitElement, nothing, type PropertyValues } from 'lit';
|
|
3
|
-
import type { FigureEvaluatedShape } from '@hatiolab/figure-model';
|
|
3
|
+
import type { FigureEvaluatedShape, FigureFaceMappingNeed } from '@hatiolab/figure-model';
|
|
4
4
|
import './figure-cavity-drawing.js';
|
|
5
|
+
import './figure-face-mapping.js';
|
|
5
6
|
type Body = {
|
|
6
7
|
id: string;
|
|
7
8
|
shape: FigureEvaluatedShape;
|
|
@@ -22,6 +23,8 @@ export declare class FigureSectionPanel extends FigureSectionPanel_base {
|
|
|
22
23
|
static styles: import("lit").CSSResult[];
|
|
23
24
|
body?: Body;
|
|
24
25
|
locked: boolean;
|
|
26
|
+
/** What stands on the faces the last edit here takes away (ADR-0100 A8): asked here, where the edit was made. */
|
|
27
|
+
faceMapping?: FigureFaceMappingNeed;
|
|
25
28
|
/** What each field would not take, by field, said under it. */
|
|
26
29
|
private refusals;
|
|
27
30
|
/** What is typed in a field and not yet sent, by field: the figure drawn with it must not type over it. */
|
|
@@ -7,6 +7,7 @@ import { i18next, localize } from '@operato/i18n';
|
|
|
7
7
|
import { SidePanelStyles } from './side-panel-styles.js';
|
|
8
8
|
import { drawnOf } from './section-drawing.js';
|
|
9
9
|
import './figure-cavity-drawing.js';
|
|
10
|
+
import './figure-face-mapping.js';
|
|
10
11
|
import { cavityDepthOf, cavityRequestOf, cavityResultOf, cornerLimitOf, cornerRefusalOf, mm, sameOf } from './section-controls.js';
|
|
11
12
|
/**
|
|
12
13
|
* 단면 — a pushed part's rounded corners and its inside (ADR-0100 §3.3).
|
|
@@ -92,6 +93,7 @@ let FigureSectionPanel = class FigureSectionPanel extends localize(i18next)(LitE
|
|
|
92
93
|
: nothing}
|
|
93
94
|
${kind === 'rectangle' ? this.renderCorner(body) : nothing}
|
|
94
95
|
${ /* No inside for a drawn section: the control is not there, rather than a line saying so. */kind === 'rectangle' || kind === 'ellipse' ? this.renderCavity(body) : nothing}
|
|
96
|
+
${this.faceMapping ? html `<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}
|
|
95
97
|
</section>`;
|
|
96
98
|
}
|
|
97
99
|
renderCorner(body) {
|
|
@@ -226,6 +228,10 @@ __decorate([
|
|
|
226
228
|
property({ type: Boolean }),
|
|
227
229
|
__metadata("design:type", Object)
|
|
228
230
|
], FigureSectionPanel.prototype, "locked", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ attribute: false }),
|
|
233
|
+
__metadata("design:type", Object)
|
|
234
|
+
], FigureSectionPanel.prototype, "faceMapping", void 0);
|
|
229
235
|
__decorate([
|
|
230
236
|
state(),
|
|
231
237
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-section-panel.js","sourceRoot":"","sources":["../../client/modeller/figure-section-panel.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,EA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,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAE1B;IAAhB,KAAK,EAAE;;oDAA8C;AAErC;IAAhB,KAAK,EAAE;;iDAA2C;AAElC;IAAhB,KAAK,EAAE;;mDAAwB;AAxCrB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA4M9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, nothing, type PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureAuthoringAction, FigureEvaluatedShape } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { drawnOf } from './section-drawing.js'\nimport './figure-cavity-drawing.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, cornerLimitOf, cornerRefusalOf, mm, sameOf } from './section-controls.js'\n\ntype Body = { id: string; shape: FigureEvaluatedShape }\n\n/**\n * 단면 — a pushed part's rounded corners and its inside (ADR-0100 §3.3).\n *\n * Corners for a rectangle; an inside for a rectangle or an ellipse, with its walls (one thickness, or one per side when\n * asked for), its two ends open or closed, and what that makes of the part and how deep. A drawn section says beside\n * the inside why it has none. A turned body shows nothing here.\n *\n * A value being typed is drawn at once and recorded nowhere (`command-live`); a value the kernel would refuse is said\n * under its field with the most it can be, and is not sent. Enter or leaving the field sends the one `command`, one step\n * of the undo history; Esc puts the value back.\n */\n@customElement('figure-section-panel')\nexport class FigureSectionPanel extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n display: block;\n }\n div[row] {\n display: flex;\n gap: 6px;\n align-items: center;\n }\n div[row] > * {\n flex: 1;\n min-width: 0;\n }\n div[sides] {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n /* A side's refusal under its field lengthens its cell only: the field beside it stays level. */\n align-items: start;\n }\n div[sides] > label {\n display: grid;\n gap: 2px;\n }\n small[refusal] {\n color: var(--md-sys-color-error);\n }\n input[aria-invalid='true'] {\n outline: 2px solid var(--md-sys-color-error);\n }\n `]\n\n @property({ attribute: false }) body?: Body\n @property({ type: Boolean }) locked = false\n /** What each field would not take, by field, said under it. */\n @state() private refusals: Record<string, string> = {}\n /** What is typed in a field and not yet sent, by field: the figure drawn with it must not type over it. */\n @state() private typed: Record<string, string> = {}\n /** Walls one per side, asked for or because they already differ. */\n @state() private perSide = false\n\n protected willUpdate(changed: PropertyValues<this>) {\n const before = changed.get('body') as Body | undefined\n if (changed.has('body') && before?.id !== this.body?.id) {\n this.refusals = {}\n this.typed = {}\n /* A part whose walls already differ opens with them one per side. */\n const walls = this.body?.shape.cavity?.wall\n this.perSide = !!walls && sameOf(Object.values(walls)) === undefined\n }\n }\n\n render() {\n const body = this.body\n /* A push, or a pyramid: a drawn section drawn to one point, which has no corners and no inside. */\n const e = body?.shape ? drawnOf(body.shape) : undefined\n if (!body || !e) return nothing\n const kind = e.section.kind\n return html`<section>\n <h3>${i18next.t('figure.label.group-section')}</h3>\n ${body.shape.dimensions.jamb === undefined\n ? html`<div field>\n <button act ?disabled=${this.locked} @click=${() => this.dispatchEvent(new CustomEvent('section-editor-open', { bubbles: true, composed: true }))}>\n <md-icon>edit</md-icon>${i18next.t('figure.button.section-editor-open')}\n </button>\n ${e.section.kind === 'polygon'\n ? html`<small>${i18next.t(e.apex ? 'figure.text.section-points-apex' : 'figure.text.section-points', { points: String(e.section.points.length) })}</small>`\n : nothing}\n </div>`\n : nothing}\n ${kind === 'rectangle' ? this.renderCorner(body) : nothing}\n ${/* No inside for a drawn section: the control is not there, rather than a line saying so. */ kind === 'rectangle' || kind === 'ellipse' ? this.renderCavity(body) : nothing}\n </section>`\n }\n\n private renderCorner(body: Body) {\n const d = body.shape.dimensions\n const reaches = Object.keys(d)\n .filter(k => k.startsWith('corner.'))\n .map(k => d[k])\n const now = reaches.length ? sameOf(reaches) : 0\n const max = cornerLimitOf(body.shape)\n return html`<div form>\n <label for=\"corner\">${i18next.t('figure.label.section-corner')}</label>\n <div>\n ${this.number('corner', now, {\n min: 0,\n ask: value => {\n const r = cornerRefusalOf(body.shape, value)\n return r ? i18next.t('figure.text.section-corner-over', { max: String(mm(r.max)) }) : ''\n },\n action: value => ({ kind: 'set-section-corner', part: body.id, corner: value > 0 ? value : null }),\n placeholder: now === undefined ? i18next.t('figure.text.section-corner-differs') : ''\n })}\n ${this.refusals.corner ? nothing : max !== undefined ? html`<small>${i18next.t('figure.text.section-at-most', { max: String(mm(max)) })}</small>` : nothing}\n </div>\n </div>`\n }\n\n /*\n * The inside: made or taken away here, and drawn -- walls dragged or their number pressed and typed, ends pressed\n * open or closed (figure-cavity-drawing). The number fields under the drawing went (user 2026-10-01): they said the\n * drawing again.\n */\n private renderCavity(body: Body) {\n const cavity = body.shape.cavity\n return html`<div field>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!cavity)}\n ?disabled=${this.locked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n ;(ev.target as HTMLInputElement).checked = !!cavity\n this.command({ kind: 'set-cavity', part: body.id, cavity: on ? cavityRequestOf(body.shape, {}) : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n </label>\n ${cavity\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(cavity)}`),\n depth: String(cavityDepthOf(body.shape))\n })}\n </small>`\n : nothing}\n </div>\n ${cavity\n ? html`<figure-cavity-drawing .body=${body} .perSide=${this.perSide} ?locked=${this.locked}></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} ?disabled=${this.locked} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}`\n }\n\n /**\n * A millimetre field. Typing draws the value (or, if the kernel would refuse it, says why under the field and draws the\n * figure as it stands); Enter or leaving sends it once; Esc puts the value back.\n */\n private number(\n key: string,\n now: number | undefined,\n o: { min: number; ask: (value: number) => string; action: (value: number) => FigureAuthoringAction; placeholder?: string }\n ) {\n const shown = now === undefined ? '' : String(mm(now))\n const done = () => {\n const { [key]: _, ...rest } = this.typed\n this.typed = rest\n }\n const read = (input: HTMLInputElement) => (input.value === '' ? NaN : Number(input.value))\n const judge = (input: HTMLInputElement) => {\n const value = read(input)\n const refusal = !Number.isFinite(value) || value < o.min ? '' : o.ask(value)\n this.refusals = { ...this.refusals, [key]: refusal }\n return Number.isFinite(value) && value >= o.min && !refusal ? value : undefined\n }\n return html`<input\n id=${key}\n type=\"number\"\n min=${o.min}\n step=\"any\"\n inputmode=\"decimal\"\n .value=${live(this.typed[key] ?? shown)}\n placeholder=${o.placeholder ?? ''}\n aria-invalid=${this.refusals[key] ? 'true' : 'false'}\n aria-describedby=${`${key}-refusal`}\n ?disabled=${this.locked}\n @input=${(ev: Event) => {\n this.typed = { ...this.typed, [key]: (ev.target as HTMLInputElement).value }\n const value = judge(ev.target as HTMLInputElement)\n this.preview(value === undefined ? null : o.action(value))\n }}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n if (input.value === shown) return done(), this.preview(null)\n const value = judge(input)\n /* A refused value stays typed with its reason under it, to be corrected; nothing is sent. */\n if (value === undefined) return this.preview(null)\n done()\n this.command(o.action(value))\n }}\n @keydown=${(ev: KeyboardEvent) => {\n if (ev.key !== 'Escape') return\n const input = ev.target as HTMLInputElement\n input.value = shown\n done()\n this.refusals = { ...this.refusals, [key]: '' }\n this.preview(null)\n }}\n />\n ${this.refusals[key] ? html`<small refusal id=${`${key}-refusal`} role=\"alert\">${this.refusals[key]}</small>` : nothing}`\n }\n\n private preview(action: FigureAuthoringAction | null) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action }, bubbles: true, composed: true }))\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\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C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACpB,CAAC;;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,qBAAqB,GAAG,GAAG,UAAU,iBAAiB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IAC7H,CAAC;IAEO,OAAO,CAAC,MAAoC;QAClD,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC5G,CAAC;IAEO,OAAO,CAAC,MAA6B;QAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACvG,CAAC;;AA7K+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;gDAAY;AACd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uDAAoC;AAElD;IAAhB,KAAK,EAAE;;oDAA8C;AAErC;IAAhB,KAAK,EAAE;;iDAA2C;AAElC;IAAhB,KAAK,EAAE;;mDAAwB;AA1CrB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA+M9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, nothing, type PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureAuthoringAction, FigureEvaluatedShape, FigureFaceMappingNeed } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { drawnOf } from './section-drawing.js'\nimport './figure-cavity-drawing.js'\nimport './figure-face-mapping.js'\nimport { cavityDepthOf, cavityRequestOf, cavityResultOf, cornerLimitOf, cornerRefusalOf, mm, sameOf } from './section-controls.js'\n\ntype Body = { id: string; shape: FigureEvaluatedShape }\n\n/**\n * 단면 — a pushed part's rounded corners and its inside (ADR-0100 §3.3).\n *\n * Corners for a rectangle; an inside for a rectangle or an ellipse, with its walls (one thickness, or one per side when\n * asked for), its two ends open or closed, and what that makes of the part and how deep. A drawn section says beside\n * the inside why it has none. A turned body shows nothing here.\n *\n * A value being typed is drawn at once and recorded nowhere (`command-live`); a value the kernel would refuse is said\n * under its field with the most it can be, and is not sent. Enter or leaving the field sends the one `command`, one step\n * of the undo history; Esc puts the value back.\n */\n@customElement('figure-section-panel')\nexport class FigureSectionPanel extends localize(i18next)(LitElement) {\n static styles = [SidePanelStyles, css`\n :host {\n display: block;\n }\n div[row] {\n display: flex;\n gap: 6px;\n align-items: center;\n }\n div[row] > * {\n flex: 1;\n min-width: 0;\n }\n div[sides] {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n /* A side's refusal under its field lengthens its cell only: the field beside it stays level. */\n align-items: start;\n }\n div[sides] > label {\n display: grid;\n gap: 2px;\n }\n small[refusal] {\n color: var(--md-sys-color-error);\n }\n input[aria-invalid='true'] {\n outline: 2px solid var(--md-sys-color-error);\n }\n `]\n\n @property({ attribute: false }) body?: Body\n @property({ type: Boolean }) locked = false\n /** What stands on the faces the last edit here takes away (ADR-0100 A8): asked here, where the edit was made. */\n @property({ attribute: false }) faceMapping?: FigureFaceMappingNeed\n /** What each field would not take, by field, said under it. */\n @state() private refusals: Record<string, string> = {}\n /** What is typed in a field and not yet sent, by field: the figure drawn with it must not type over it. */\n @state() private typed: Record<string, string> = {}\n /** Walls one per side, asked for or because they already differ. */\n @state() private perSide = false\n\n protected willUpdate(changed: PropertyValues<this>) {\n const before = changed.get('body') as Body | undefined\n if (changed.has('body') && before?.id !== this.body?.id) {\n this.refusals = {}\n this.typed = {}\n /* A part whose walls already differ opens with them one per side. */\n const walls = this.body?.shape.cavity?.wall\n this.perSide = !!walls && sameOf(Object.values(walls)) === undefined\n }\n }\n\n render() {\n const body = this.body\n /* A push, or a pyramid: a drawn section drawn to one point, which has no corners and no inside. */\n const e = body?.shape ? drawnOf(body.shape) : undefined\n if (!body || !e) return nothing\n const kind = e.section.kind\n return html`<section>\n <h3>${i18next.t('figure.label.group-section')}</h3>\n ${body.shape.dimensions.jamb === undefined\n ? html`<div field>\n <button act ?disabled=${this.locked} @click=${() => this.dispatchEvent(new CustomEvent('section-editor-open', { bubbles: true, composed: true }))}>\n <md-icon>edit</md-icon>${i18next.t('figure.button.section-editor-open')}\n </button>\n ${e.section.kind === 'polygon'\n ? html`<small>${i18next.t(e.apex ? 'figure.text.section-points-apex' : 'figure.text.section-points', { points: String(e.section.points.length) })}</small>`\n : nothing}\n </div>`\n : nothing}\n ${kind === 'rectangle' ? this.renderCorner(body) : nothing}\n ${/* No inside for a drawn section: the control is not there, rather than a line saying so. */ kind === 'rectangle' || kind === 'ellipse' ? this.renderCavity(body) : nothing}\n ${this.faceMapping ? html`<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}\n </section>`\n }\n\n private renderCorner(body: Body) {\n const d = body.shape.dimensions\n const reaches = Object.keys(d)\n .filter(k => k.startsWith('corner.'))\n .map(k => d[k])\n const now = reaches.length ? sameOf(reaches) : 0\n const max = cornerLimitOf(body.shape)\n return html`<div form>\n <label for=\"corner\">${i18next.t('figure.label.section-corner')}</label>\n <div>\n ${this.number('corner', now, {\n min: 0,\n ask: value => {\n const r = cornerRefusalOf(body.shape, value)\n return r ? i18next.t('figure.text.section-corner-over', { max: String(mm(r.max)) }) : ''\n },\n action: value => ({ kind: 'set-section-corner', part: body.id, corner: value > 0 ? value : null }),\n placeholder: now === undefined ? i18next.t('figure.text.section-corner-differs') : ''\n })}\n ${this.refusals.corner ? nothing : max !== undefined ? html`<small>${i18next.t('figure.text.section-at-most', { max: String(mm(max)) })}</small>` : nothing}\n </div>\n </div>`\n }\n\n /*\n * The inside: made or taken away here, and drawn -- walls dragged or their number pressed and typed, ends pressed\n * open or closed (figure-cavity-drawing). The number fields under the drawing went (user 2026-10-01): they said the\n * drawing again.\n */\n private renderCavity(body: Body) {\n const cavity = body.shape.cavity\n return html`<div field>\n <label toggle>\n <input\n type=\"checkbox\"\n .checked=${live(!!cavity)}\n ?disabled=${this.locked}\n @change=${(ev: Event) => {\n const on = (ev.target as HTMLInputElement).checked\n ;(ev.target as HTMLInputElement).checked = !!cavity\n this.command({ kind: 'set-cavity', part: body.id, cavity: on ? cavityRequestOf(body.shape, {}) : null })\n }}\n />\n ${i18next.t('figure.label.section-cavity')}\n </label>\n ${cavity\n ? html`<small result>\n ${i18next.t('figure.text.section-depth', {\n result: i18next.t(`figure.label.section-result-${cavityResultOf(cavity)}`),\n depth: String(cavityDepthOf(body.shape))\n })}\n </small>`\n : nothing}\n </div>\n ${cavity\n ? html`<figure-cavity-drawing .body=${body} .perSide=${this.perSide} ?locked=${this.locked}></figure-cavity-drawing>\n <label toggle>\n <input type=\"checkbox\" .checked=${live(this.perSide)} ?disabled=${this.locked} @change=${(ev: Event) => (this.perSide = (ev.target as HTMLInputElement).checked)} />\n ${i18next.t('figure.label.section-wall-per-side')}\n </label>`\n : nothing}`\n }\n\n /**\n * A millimetre field. Typing draws the value (or, if the kernel would refuse it, says why under the field and draws the\n * figure as it stands); Enter or leaving sends it once; Esc puts the value back.\n */\n private number(\n key: string,\n now: number | undefined,\n o: { min: number; ask: (value: number) => string; action: (value: number) => FigureAuthoringAction; placeholder?: string }\n ) {\n const shown = now === undefined ? '' : String(mm(now))\n const done = () => {\n const { [key]: _, ...rest } = this.typed\n this.typed = rest\n }\n const read = (input: HTMLInputElement) => (input.value === '' ? NaN : Number(input.value))\n const judge = (input: HTMLInputElement) => {\n const value = read(input)\n const refusal = !Number.isFinite(value) || value < o.min ? '' : o.ask(value)\n this.refusals = { ...this.refusals, [key]: refusal }\n return Number.isFinite(value) && value >= o.min && !refusal ? value : undefined\n }\n return html`<input\n id=${key}\n type=\"number\"\n min=${o.min}\n step=\"any\"\n inputmode=\"decimal\"\n .value=${live(this.typed[key] ?? shown)}\n placeholder=${o.placeholder ?? ''}\n aria-invalid=${this.refusals[key] ? 'true' : 'false'}\n aria-describedby=${`${key}-refusal`}\n ?disabled=${this.locked}\n @input=${(ev: Event) => {\n this.typed = { ...this.typed, [key]: (ev.target as HTMLInputElement).value }\n const value = judge(ev.target as HTMLInputElement)\n this.preview(value === undefined ? null : o.action(value))\n }}\n @change=${(ev: Event) => {\n const input = ev.target as HTMLInputElement\n if (input.value === shown) return done(), this.preview(null)\n const value = judge(input)\n /* A refused value stays typed with its reason under it, to be corrected; nothing is sent. */\n if (value === undefined) return this.preview(null)\n done()\n this.command(o.action(value))\n }}\n @keydown=${(ev: KeyboardEvent) => {\n if (ev.key !== 'Escape') return\n const input = ev.target as HTMLInputElement\n input.value = shown\n done()\n this.refusals = { ...this.refusals, [key]: '' }\n this.preview(null)\n }}\n />\n ${this.refusals[key] ? html`<small refusal id=${`${key}-refusal`} role=\"alert\">${this.refusals[key]}</small>` : nothing}`\n }\n\n private preview(action: FigureAuthoringAction | null) {\n this.dispatchEvent(new CustomEvent('command-live', { detail: { action }, bubbles: true, composed: true }))\n }\n\n private command(action: FigureAuthoringAction) {\n this.dispatchEvent(new CustomEvent('command', { detail: { action }, bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -45,3 +45,8 @@ export declare function previewClampsOf(asset: FigureAsset, size: {
|
|
|
45
45
|
asked: number;
|
|
46
46
|
used: number;
|
|
47
47
|
}>>;
|
|
48
|
+
/**
|
|
49
|
+
* The part the preview's size help speaks of: the one picked in the help, else the one chosen in the editor, else the
|
|
50
|
+
* first that has a size rule. A choice that is not among the parts (removed, or a part with no rule) is passed over.
|
|
51
|
+
*/
|
|
52
|
+
export declare function setupPartOf(picked: string, chosen: string, targets: string[]): string;
|
|
@@ -65,4 +65,11 @@ export function previewClampsOf(asset, size) {
|
|
|
65
65
|
})
|
|
66
66
|
]));
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The part the preview's size help speaks of: the one picked in the help, else the one chosen in the editor, else the
|
|
70
|
+
* first that has a size rule. A choice that is not among the parts (removed, or a part with no rule) is passed over.
|
|
71
|
+
*/
|
|
72
|
+
export function setupPartOf(picked, chosen, targets) {
|
|
73
|
+
return [picked, chosen].find(id => !!id && targets.includes(id)) ?? targets[0] ?? '';
|
|
74
|
+
}
|
|
68
75
|
//# sourceMappingURL=preview-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-model.js","sourceRoot":"","sources":["../../client/modeller/preview-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAGhI,iHAAiH;AAEjH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAE/B,MAAM,CAAC,MAAM,YAAY,GAAoE;IAC3F,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;IACjC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAA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C,GAAG,EAAE,GAAG,EAAE,GAAG,CAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAA;YAC1E,IAAI,CAAC,KAAK;gBAAE,OAAO,EAAE,CAAA;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAA;YACjG,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACtD,CAAC,CAAC;KACH,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["import { compileFigureAsset, figureOccupiedBoxesOf, figureWritersOf, FIGURE_INSTANCE_SIZE_INPUTS } from '@hatiolab/figure-model'\nimport type { FigureAsset } from '@hatiolab/figure-model'\n\n/* The preview's arithmetic, apart from the element so it is tested without a browser (see figure-preview.ts). */\n\nexport const PREVIEW_FACTOR = 2\n\nexport const PREVIEW_WAYS: readonly { name: string; axes: readonly ('x' | 'y' | 'z')[] }[] = [\n { name: 'base', axes: [] },\n { name: 'x', axes: ['x'] },\n { name: 'y', axes: ['y'] },\n { name: 'z', axes: ['z'] },\n { name: 'x·y', axes: ['x', 'y'] },\n { name: 'x·z', axes: ['x', 'z'] },\n { name: 'y·z', axes: ['y', 'z'] },\n { name: 'x·y·z', axes: ['x', 'y', 'z'] }\n]\n\n/** The size the figure was made at: its instance size when it declares one, else the room its bodies take. */\nexport function authoredSizeOf(asset: FigureAsset): { x: number; y: number; z: number } {\n const d = asset.designInputs\n const declared = (['x', 'y', 'z'] as const).map(axis => d[FIGURE_INSTANCE_SIZE_INPUTS[axis]])\n if (declared.every(v => typeof v === 'number' && v > 0)) return { x: declared[0]!, y: declared[1]!, z: declared[2]! }\n /* No declared size: the room its bodies take up, so the instance is placed at the size it draws. */\n const boxes = figureOccupiedBoxesOf(compileFigureAsset(asset).evaluate().geometry, figureWritersOf(asset))\n const span = (axis: 'x' | 'y' | 'z') =>\n boxes.length ? Math.max(...boxes.map(b => b.centre[axis] + b.extent[axis] / 2)) - Math.min(...boxes.map(b => b.centre[axis] - b.extent[axis] / 2)) : 0\n return { x: Math.max(1, Math.round(span('x'))), y: Math.max(1, Math.round(span('y'))), z: Math.max(1, Math.round(span('z'))) }\n}\n\n/** The eight instances: where each stands on the board and how large, in the scene's words. */\nexport function previewInstances(type: string, size: { x: number; y: number; z: number }) {\n const COLUMNS = 4\n const cell = { x: size.x * PREVIEW_FACTOR * 1.25, z: size.z * PREVIEW_FACTOR * 1.25 }\n const components = PREVIEW_WAYS.map((way, at) => {\n const grow = (axis: 'x' | 'y' | 'z') => (way.axes.includes(axis) ? PREVIEW_FACTOR : 1)\n const width = Math.round(size.x * grow('x'))\n const height = Math.round(size.z * grow('z'))\n const column = at % COLUMNS\n const row = Math.floor(at / COLUMNS)\n return {\n type,\n id: `at-${way.name}`,\n left: Math.round(column * cell.x + (cell.x - width) / 2),\n top: Math.round(row * cell.z + (cell.z - height) / 2),\n width,\n height,\n /* Always written: without it the height is taken as the plan's mean and \"grow y only\" would not grow it. */\n depth: Math.round(size.y * grow('y'))\n }\n })\n return { components, board: { width: Math.round(cell.x * COLUMNS), height: Math.round(cell.z * Math.ceil(PREVIEW_WAYS.length / COLUMNS)) } }\n}\n\n\n/**\n * Where a variant asks a size the figure does not declare, the size it is drawn at instead -- as the board draws it\n * (things-scene clamps each axis to the declared range; chief architect's ruling 2026-09-25). Per variant, empty when\n * it is drawn as asked. A figure that follows its height only is drawn at its one width in the wider variants, and\n * the preview says so rather than drawing them as though they grew.\n */\nexport function previewClampsOf(asset: FigureAsset, size: { x: number; y: number; z: number }): Record<string, Array<{ axis: 'x' | 'y' | 'z'; asked: number; used: number }>> {\n const inputs = asset.document.model.inputs\n return Object.fromEntries(\n PREVIEW_WAYS.map(way => [\n way.name,\n (['x', 'y', 'z'] as const).flatMap(axis => {\n const input = inputs.find(i => i.id === FIGURE_INSTANCE_SIZE_INPUTS[axis])\n if (!input) return []\n const asked = Math.round(size[axis] * (way.axes.includes(axis) ? PREVIEW_FACTOR : 1))\n const used = Math.round(Math.min(Math.max(asked, input.min ?? -Infinity), input.max ?? Infinity))\n return used === asked ? [] : [{ axis, asked, used }]\n })\n ])\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"preview-model.js","sourceRoot":"","sources":["../../client/modeller/preview-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAGhI,iHAAiH;AAEjH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAE/B,MAAM,CAAC,MAAM,YAAY,GAAoE;IAC3F,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,KAAK,EAAE,I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A;AACtF,CAAC","sourcesContent":["import { compileFigureAsset, figureOccupiedBoxesOf, figureWritersOf, FIGURE_INSTANCE_SIZE_INPUTS } from '@hatiolab/figure-model'\nimport type { FigureAsset } from '@hatiolab/figure-model'\n\n/* The preview's arithmetic, apart from the element so it is tested without a browser (see figure-preview.ts). */\n\nexport const PREVIEW_FACTOR = 2\n\nexport const PREVIEW_WAYS: readonly { name: string; axes: readonly ('x' | 'y' | 'z')[] }[] = [\n { name: 'base', axes: [] },\n { name: 'x', axes: ['x'] },\n { name: 'y', axes: ['y'] },\n { name: 'z', axes: ['z'] },\n { name: 'x·y', axes: ['x', 'y'] },\n { name: 'x·z', axes: ['x', 'z'] },\n { name: 'y·z', axes: ['y', 'z'] },\n { name: 'x·y·z', axes: ['x', 'y', 'z'] }\n]\n\n/** The size the figure was made at: its instance size when it declares one, else the room its bodies take. */\nexport function authoredSizeOf(asset: FigureAsset): { x: number; y: number; z: number } {\n const d = asset.designInputs\n const declared = (['x', 'y', 'z'] as const).map(axis => d[FIGURE_INSTANCE_SIZE_INPUTS[axis]])\n if (declared.every(v => typeof v === 'number' && v > 0)) return { x: declared[0]!, y: declared[1]!, z: declared[2]! }\n /* No declared size: the room its bodies take up, so the instance is placed at the size it draws. */\n const boxes = figureOccupiedBoxesOf(compileFigureAsset(asset).evaluate().geometry, figureWritersOf(asset))\n const span = (axis: 'x' | 'y' | 'z') =>\n boxes.length ? Math.max(...boxes.map(b => b.centre[axis] + b.extent[axis] / 2)) - Math.min(...boxes.map(b => b.centre[axis] - b.extent[axis] / 2)) : 0\n return { x: Math.max(1, Math.round(span('x'))), y: Math.max(1, Math.round(span('y'))), z: Math.max(1, Math.round(span('z'))) }\n}\n\n/** The eight instances: where each stands on the board and how large, in the scene's words. */\nexport function previewInstances(type: string, size: { x: number; y: number; z: number }) {\n const COLUMNS = 4\n const cell = { x: size.x * PREVIEW_FACTOR * 1.25, z: size.z * PREVIEW_FACTOR * 1.25 }\n const components = PREVIEW_WAYS.map((way, at) => {\n const grow = (axis: 'x' | 'y' | 'z') => (way.axes.includes(axis) ? PREVIEW_FACTOR : 1)\n const width = Math.round(size.x * grow('x'))\n const height = Math.round(size.z * grow('z'))\n const column = at % COLUMNS\n const row = Math.floor(at / COLUMNS)\n return {\n type,\n id: `at-${way.name}`,\n left: Math.round(column * cell.x + (cell.x - width) / 2),\n top: Math.round(row * cell.z + (cell.z - height) / 2),\n width,\n height,\n /* Always written: without it the height is taken as the plan's mean and \"grow y only\" would not grow it. */\n depth: Math.round(size.y * grow('y'))\n }\n })\n return { components, board: { width: Math.round(cell.x * COLUMNS), height: Math.round(cell.z * Math.ceil(PREVIEW_WAYS.length / COLUMNS)) } }\n}\n\n\n/**\n * Where a variant asks a size the figure does not declare, the size it is drawn at instead -- as the board draws it\n * (things-scene clamps each axis to the declared range; chief architect's ruling 2026-09-25). Per variant, empty when\n * it is drawn as asked. A figure that follows its height only is drawn at its one width in the wider variants, and\n * the preview says so rather than drawing them as though they grew.\n */\nexport function previewClampsOf(asset: FigureAsset, size: { x: number; y: number; z: number }): Record<string, Array<{ axis: 'x' | 'y' | 'z'; asked: number; used: number }>> {\n const inputs = asset.document.model.inputs\n return Object.fromEntries(\n PREVIEW_WAYS.map(way => [\n way.name,\n (['x', 'y', 'z'] as const).flatMap(axis => {\n const input = inputs.find(i => i.id === FIGURE_INSTANCE_SIZE_INPUTS[axis])\n if (!input) return []\n const asked = Math.round(size[axis] * (way.axes.includes(axis) ? PREVIEW_FACTOR : 1))\n const used = Math.round(Math.min(Math.max(asked, input.min ?? -Infinity), input.max ?? Infinity))\n return used === asked ? [] : [{ axis, asked, used }]\n })\n ])\n )\n}\n\n/**\n * The part the preview's size help speaks of: the one picked in the help, else the one chosen in the editor, else the\n * first that has a size rule. A choice that is not among the parts (removed, or a part with no rule) is passed over.\n */\nexport function setupPartOf(picked: string, chosen: string, targets: string[]): string {\n return [picked, chosen].find(id => !!id && targets.includes(id)) ?? targets[0] ?? ''\n}\n"]}
|
|
@@ -481,8 +481,14 @@ let FigureModellerPage = class FigureModellerPage extends PageView {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
get context() {
|
|
484
|
+
const view = this.session.read();
|
|
484
485
|
return {
|
|
485
|
-
title:
|
|
486
|
+
title: view.name ?? 'Figure',
|
|
487
|
+
/*
|
|
488
|
+
A figure that has an id was opened from the catalog (or saved there), so the rail marks the catalog. Without this
|
|
489
|
+
the rail matches the page name and marks "new figure" while an existing one is being edited.
|
|
490
|
+
*/
|
|
491
|
+
menu: view.id ? 'figure-list' : undefined,
|
|
486
492
|
actions: [],
|
|
487
493
|
/*
|
|
488
494
|
No heading line: the canvas is what this page is for, and the name is already in the properties' first section
|