@things-factory/figure-ui 10.1.112 → 10.1.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/client/modeller/editor.ts +39 -5
  2. package/client/modeller/face-mapping.ts +39 -0
  3. package/client/modeller/figure-face-mapping.ts +78 -0
  4. package/client/modeller/figure-section-editor.ts +12 -4
  5. package/client/modeller/figure-section-panel.ts +5 -1
  6. package/dist-client/modeller/clips.d.ts +1 -1
  7. package/dist-client/modeller/editor.d.ts +4 -0
  8. package/dist-client/modeller/editor.js +40 -5
  9. package/dist-client/modeller/editor.js.map +1 -1
  10. package/dist-client/modeller/face-mapping.d.ts +15 -0
  11. package/dist-client/modeller/face-mapping.js +20 -0
  12. package/dist-client/modeller/face-mapping.js.map +1 -0
  13. package/dist-client/modeller/figure-face-mapping.d.ts +16 -0
  14. package/dist-client/modeller/figure-face-mapping.js +85 -0
  15. package/dist-client/modeller/figure-face-mapping.js.map +1 -0
  16. package/dist-client/modeller/figure-section-editor.d.ts +4 -1
  17. package/dist-client/modeller/figure-section-editor.js +14 -3
  18. package/dist-client/modeller/figure-section-editor.js.map +1 -1
  19. package/dist-client/modeller/figure-section-panel.d.ts +4 -1
  20. package/dist-client/modeller/figure-section-panel.js +6 -0
  21. package/dist-client/modeller/figure-section-panel.js.map +1 -1
  22. package/dist-client/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +5 -5
  24. package/test/browser/acceptance-page.js +11 -0
  25. package/test/clip-consent.test.ts +1 -1
  26. package/test/face-mapping.test.ts +80 -0
  27. package/test/section-panel.test.ts +1 -1
  28. package/translations/en.json +7 -1
  29. package/translations/ja.json +7 -1
  30. package/translations/ko.json +7 -1
  31. package/translations/ms.json +7 -1
  32. package/translations/zh.json +7 -1
@@ -0,0 +1,15 @@
1
+ import type { FigureFaceMappingNeed, FigureFaceReference, FigureFaceRemap } from '@hatiolab/figure-model';
2
+ export interface FaceMappingRow {
3
+ ref: FigureFaceReference;
4
+ /** The face it is on now, which the edit takes away. */
5
+ lost: string;
6
+ /** The faces it may go to: those that remain, looking the way the lost one did. */
7
+ faces: string[];
8
+ /** Whether it may be let go where it stands: a joint may, a named face may not. */
9
+ detach: boolean;
10
+ }
11
+ export declare const DETACH = "__detach";
12
+ export declare function faceMappingRowsOf(need: FigureFaceMappingNeed): FaceMappingRow[];
13
+ /** The remap a command takes, once every row is chosen; undefined while one is not. */
14
+ export declare function remapOf(rows: readonly FaceMappingRow[], picks: Readonly<Record<string, string>>): FigureFaceRemap[] | undefined;
15
+ export declare const rowKey: (row: FaceMappingRow) => string;
@@ -0,0 +1,20 @@
1
+ export const DETACH = '__detach';
2
+ export function faceMappingRowsOf(need) {
3
+ return need.lost.flatMap(lost => {
4
+ const faces = need.remain.filter(r => lost.axis === undefined || (r.axis === lost.axis && r.normal === lost.normal)).map(r => r.face);
5
+ return lost.refs.map(ref => ({ ref, lost: lost.face, faces, detach: ref.kind === 'joint' }));
6
+ });
7
+ }
8
+ /** The remap a command takes, once every row is chosen; undefined while one is not. */
9
+ export function remapOf(rows, picks) {
10
+ const out = [];
11
+ for (const row of rows) {
12
+ const pick = picks[rowKey(row)];
13
+ if (!pick)
14
+ return undefined;
15
+ out.push({ ref: { kind: row.ref.kind, id: row.ref.id }, to: pick === DETACH ? 'detach' : { face: pick } });
16
+ }
17
+ return out;
18
+ }
19
+ export const rowKey = (row) => `${row.ref.kind}:${row.ref.id}:${row.lost}`;
20
+ //# sourceMappingURL=face-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"face-mapping.js","sourceRoot":"","sources":["../../client/modeller/face-mapping.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAA;AAEhC,MAAM,UAAU,iBAAiB,CAAC,IAA2B;IAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,M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AAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAA","sourcesContent":["import type { FigureFaceMappingNeed, FigureFaceReference, FigureFaceRemap } from '@hatiolab/figure-model'\n\n/*\n * Where what stands on a face an edit takes away goes instead (ADR-0100 A8, user 2026-10-02): one row per thing that\n * refers to a lost face, its choices the faces that remain looking the same way, and -- for a joint, never a named\n * face -- let go where it stands. Nothing is chosen for the author: where it goes only they know.\n */\n\nexport interface FaceMappingRow {\n ref: FigureFaceReference\n /** The face it is on now, which the edit takes away. */\n lost: string\n /** The faces it may go to: those that remain, looking the way the lost one did. */\n faces: string[]\n /** Whether it may be let go where it stands: a joint may, a named face may not. */\n detach: boolean\n}\n\nexport const DETACH = '__detach'\n\nexport function faceMappingRowsOf(need: FigureFaceMappingNeed): FaceMappingRow[] {\n return need.lost.flatMap(lost => {\n const faces = need.remain.filter(r => lost.axis === undefined || (r.axis === lost.axis && r.normal === lost.normal)).map(r => r.face)\n return lost.refs.map(ref => ({ ref, lost: lost.face, faces, detach: ref.kind === 'joint' }))\n })\n}\n\n/** The remap a command takes, once every row is chosen; undefined while one is not. */\nexport function remapOf(rows: readonly FaceMappingRow[], picks: Readonly<Record<string, string>>): FigureFaceRemap[] | undefined {\n const out: FigureFaceRemap[] = []\n for (const row of rows) {\n const pick = picks[rowKey(row)]\n if (!pick) return undefined\n out.push({ ref: { kind: row.ref.kind, id: row.ref.id }, to: pick === DETACH ? 'detach' : { face: pick } })\n }\n return out\n}\n\nexport const rowKey = (row: FaceMappingRow) => `${row.ref.kind}:${row.ref.id}:${row.lost}`\n"]}
@@ -0,0 +1,16 @@
1
+ import { LitElement, nothing, type PropertyValues } from 'lit';
2
+ import type { FigureFaceMappingNeed } from '@hatiolab/figure-model';
3
+ declare const FigureFaceMapping_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ /**
5
+ * 없어지는 면에 붙은 것을 옮길 곳 (ADR-0100 A8): shown where the edit was made, under it. Each thing on a lost face
6
+ * is a row; apply is held until every row is chosen, and then the same edit goes again with the remap, one step.
7
+ */
8
+ export declare class FigureFaceMapping extends FigureFaceMapping_base {
9
+ static styles: import("lit").CSSResult[];
10
+ need?: FigureFaceMappingNeed;
11
+ private picks;
12
+ protected willUpdate(changed: PropertyValues<this>): void;
13
+ private face;
14
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
15
+ }
16
+ export {};
@@ -0,0 +1,85 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { css, html, LitElement, nothing } from 'lit';
3
+ import { customElement, property, state } from 'lit/decorators.js';
4
+ import { i18next, localize } from '@operato/i18n';
5
+ import { SidePanelStyles } from './side-panel-styles.js';
6
+ import { DETACH, faceMappingRowsOf, remapOf, rowKey } from './face-mapping.js';
7
+ /**
8
+ * 없어지는 면에 붙은 것을 옮길 곳 (ADR-0100 A8): shown where the edit was made, under it. Each thing on a lost face
9
+ * is a row; apply is held until every row is chosen, and then the same edit goes again with the remap, one step.
10
+ */
11
+ let FigureFaceMapping = class FigureFaceMapping extends localize(i18next)(LitElement) {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.picks = {};
15
+ this.face = (face) => i18next.t('figure.label.face-' + face, { defaultValue: face });
16
+ }
17
+ static { this.styles = [
18
+ SidePanelStyles,
19
+ css `
20
+ :host {
21
+ display: grid;
22
+ gap: 8px;
23
+ padding: 10px 12px;
24
+ border: 1px solid var(--md-sys-color-error);
25
+ border-radius: 8px;
26
+ }
27
+ div[row] {
28
+ display: grid;
29
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
30
+ gap: 8px;
31
+ align-items: center;
32
+ }
33
+ div[buttons] {
34
+ display: flex;
35
+ gap: 8px;
36
+ justify-content: flex-end;
37
+ }
38
+ `
39
+ ]; }
40
+ willUpdate(changed) {
41
+ /* Another refusal is another question: what was chosen for the last one does not carry over. */
42
+ if (changed.has('need'))
43
+ this.picks = {};
44
+ }
45
+ render() {
46
+ if (!this.need)
47
+ return nothing;
48
+ const rows = faceMappingRowsOf(this.need);
49
+ const remap = remapOf(rows, this.picks);
50
+ const lost = [...new Set(this.need.lost.map(l => this.face(l.face)))].join(', ');
51
+ return html `<p>${i18next.t('figure.text.face-mapping-lost', { faces: lost })}</p>
52
+ ${rows.map(row => html `<div row>
53
+ <span>${row.ref.part ?? row.ref.id} · ${this.face(row.lost)}</span>
54
+ <select
55
+ aria-label=${i18next.t('figure.label.face-mapping-to', { part: row.ref.part ?? row.ref.id })}
56
+ @change=${(e) => (this.picks = { ...this.picks, [rowKey(row)]: e.target.value })}
57
+ >
58
+ <option value="" ?selected=${!this.picks[rowKey(row)]}>${i18next.t('figure.label.face-mapping-choose')}</option>
59
+ ${row.faces.map(f => html `<option value=${f}>${this.face(f)}</option>`)}
60
+ ${row.detach ? html `<option value=${DETACH}>${i18next.t('figure.label.face-mapping-detach')}</option>` : nothing}
61
+ </select>
62
+ </div>`)}
63
+ <div buttons>
64
+ <button @click=${() => this.dispatchEvent(new CustomEvent('face-mapping-cancel', { bubbles: true, composed: true }))}>
65
+ ${i18next.t('figure.button.face-mapping-cancel')}
66
+ </button>
67
+ <button act ?disabled=${!remap} @click=${() => remap && this.dispatchEvent(new CustomEvent('face-mapped', { detail: { remap }, bubbles: true, composed: true }))}>
68
+ ${i18next.t('figure.button.face-mapping-apply')}
69
+ </button>
70
+ </div>`;
71
+ }
72
+ };
73
+ __decorate([
74
+ property({ attribute: false }),
75
+ __metadata("design:type", Object)
76
+ ], FigureFaceMapping.prototype, "need", void 0);
77
+ __decorate([
78
+ state(),
79
+ __metadata("design:type", Object)
80
+ ], FigureFaceMapping.prototype, "picks", void 0);
81
+ FigureFaceMapping = __decorate([
82
+ customElement('figure-face-mapping')
83
+ ], FigureFaceMapping);
84
+ export { FigureFaceMapping };
85
+ //# sourceMappingURL=figure-face-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure-face-mapping.js","sourceRoot":"","sources":["../../client/modeller/figure-face-mapping.ts"],"names":[],"mappings":";AAAA,OAAO,EA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AqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAChH,OAAO,CAAC,CAAC,CAAC,mCAAmC,CAAC;;gCAE1B,CAAC,KAAK,WAAW,GAAG,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5J,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC;;aAE5C,CAAA;IACX,CAAC;;AArC+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CAA6B;AAC3C;IAAhB,KAAK,EAAE;;gDAA2C;AA1BxC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA+D7B","sourcesContent":["import { css, html, LitElement, nothing, type PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureFaceMappingNeed } from '@hatiolab/figure-model'\n\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { DETACH, faceMappingRowsOf, remapOf, rowKey } from './face-mapping.js'\n\n/**\n * 없어지는 면에 붙은 것을 옮길 곳 (ADR-0100 A8): shown where the edit was made, under it. Each thing on a lost face\n * is a row; apply is held until every row is chosen, and then the same edit goes again with the remap, one step.\n */\n@customElement('figure-face-mapping')\nexport class FigureFaceMapping extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n css`\n :host {\n display: grid;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--md-sys-color-error);\n border-radius: 8px;\n }\n div[row] {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n gap: 8px;\n align-items: center;\n }\n div[buttons] {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n `\n ]\n\n @property({ attribute: false }) need?: FigureFaceMappingNeed\n @state() private picks: Record<string, string> = {}\n\n protected willUpdate(changed: PropertyValues<this>) {\n /* Another refusal is another question: what was chosen for the last one does not carry over. */\n if (changed.has('need')) this.picks = {}\n }\n\n private face = (face: string) => i18next.t('figure.label.face-' + face, { defaultValue: face })\n\n render() {\n if (!this.need) return nothing\n const rows = faceMappingRowsOf(this.need)\n const remap = remapOf(rows, this.picks)\n const lost = [...new Set(this.need.lost.map(l => this.face(l.face)))].join(', ')\n return html`<p>${i18next.t('figure.text.face-mapping-lost', { faces: lost })}</p>\n ${rows.map(\n row => html`<div row>\n <span>${row.ref.part ?? row.ref.id} · ${this.face(row.lost)}</span>\n <select\n aria-label=${i18next.t('figure.label.face-mapping-to', { part: row.ref.part ?? row.ref.id })}\n @change=${(e: Event) => (this.picks = { ...this.picks, [rowKey(row)]: (e.target as HTMLSelectElement).value })}\n >\n <option value=\"\" ?selected=${!this.picks[rowKey(row)]}>${i18next.t('figure.label.face-mapping-choose')}</option>\n ${row.faces.map(f => html`<option value=${f}>${this.face(f)}</option>`)}\n ${row.detach ? html`<option value=${DETACH}>${i18next.t('figure.label.face-mapping-detach')}</option>` : nothing}\n </select>\n </div>`\n )}\n <div buttons>\n <button @click=${() => this.dispatchEvent(new CustomEvent('face-mapping-cancel', { bubbles: true, composed: true }))}>\n ${i18next.t('figure.button.face-mapping-cancel')}\n </button>\n <button act ?disabled=${!remap} @click=${() => remap && this.dispatchEvent(new CustomEvent('face-mapped', { detail: { remap }, bubbles: true, composed: true }))}>\n ${i18next.t('figure.button.face-mapping-apply')}\n </button>\n </div>`\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { LitElement, nothing } from 'lit';
2
- import type { FigureEvaluatedShape, FigureSectionMeasure } from '@hatiolab/figure-model';
2
+ import type { FigureEvaluatedShape, FigureFaceMappingNeed, FigureSectionMeasure } from '@hatiolab/figure-model';
3
3
  import './figure-cavity-drawing.js';
4
+ import './figure-face-mapping.js';
4
5
  import './figure-section-close-choice.js';
5
6
  type Axis = 'x' | 'y' | 'z';
6
7
  /** The editor's width and room for the solid beside it: below this the two take turns. */
@@ -49,6 +50,8 @@ export declare class FigureSectionEditor extends FigureSectionEditor_base {
49
50
  pointBlocked: string;
50
51
  /** The figure's revision now; the editor remembers the one it opened at. */
51
52
  revision: number;
53
+ /** What stands on the faces the last apply takes away (ADR-0100 A8): asked here, where the edit was made. */
54
+ faceMapping?: FigureFaceMappingNeed;
52
55
  /** Narrow: the outline or the solid behind. */
53
56
  show: 'outline' | 'solid';
54
57
  /** Set when the space the editor stands in leaves too little beside it to see the solid. */
@@ -8,6 +8,7 @@ import { SidePanelStyles } from './side-panel-styles.js';
8
8
  import { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf, workingShapeOf } from './section-drawing.js';
9
9
  import { cavityDepthOf, cavityRequestOf, cavityResultOf, END_FACE, sameOf, sidesOf } from './section-controls.js';
10
10
  import './figure-cavity-drawing.js';
11
+ import './figure-face-mapping.js';
11
12
  import { openPopup } from '@operato/layout';
12
13
  import './figure-section-close-choice.js';
13
14
  /** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */
@@ -405,8 +406,11 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
405
406
  apply() {
406
407
  if (this.stale || !this.valid(this.working))
407
408
  return;
408
- this.dispatchEvent(new CustomEvent('command', { detail: { action: this.action(this.working) }, bubbles: true, composed: true }));
409
- this.close();
409
+ const detail = { action: this.action(this.working) };
410
+ this.dispatchEvent(new CustomEvent('command', { detail, bubbles: true, composed: true }));
411
+ /* Held for a choice of where what stands on a lost face goes: stays open, the choice shown below. */
412
+ if (!detail.held)
413
+ this.close();
410
414
  }
411
415
  /** Whether anything was changed since the editor opened. */
412
416
  get dirty() {
@@ -495,7 +499,10 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
495
499
  </nav>
496
500
  <div body>
497
501
  <div outline>${this.drawing(issues, words.length > 0)}</div>
498
- <aside>${this.list(issues, words)}</aside>
502
+ <aside>
503
+ ${this.faceMapping ? html `<figure-face-mapping .need=${this.faceMapping}></figure-face-mapping>` : nothing}
504
+ ${this.list(issues, words)}
505
+ </aside>
499
506
  </div>
500
507
  <footer>
501
508
  <button ?disabled=${!this.history.length} @click=${() => this.back()}>${i18next.t('figure.button.section-editor-back')}</button>
@@ -839,6 +846,10 @@ __decorate([
839
846
  property({ type: Number }),
840
847
  __metadata("design:type", Object)
841
848
  ], FigureSectionEditor.prototype, "revision", void 0);
849
+ __decorate([
850
+ property({ attribute: false }),
851
+ __metadata("design:type", Object)
852
+ ], FigureSectionEditor.prototype, "faceMapping", void 0);
842
853
  __decorate([
843
854
  property({ reflect: true }),
844
855
  __metadata("design:type", String)
@@ -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,c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E3E;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAkB;AAEjB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yDAAkB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;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/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,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AAKzC,6GAA6G;AAC7G,MAAM,MAAM,GAA+B,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAER;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAAoC;AAEtC;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;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. */