@things-factory/figure-ui 10.1.90 → 10.1.92
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/editor.ts +61 -90
- package/client/modeller/fields.ts +8 -1
- package/client/modeller/figure-section-close-choice.ts +52 -0
- package/client/modeller/figure-section-editor.ts +58 -3
- package/client/modeller/figure-section-panel.ts +3 -0
- package/client/modeller/side-panel-styles.ts +4 -11
- package/dist-client/modeller/editor.d.ts +10 -4
- package/dist-client/modeller/editor.js +59 -88
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/fields.js +8 -1
- package/dist-client/modeller/fields.js.map +1 -1
- package/dist-client/modeller/figure-section-close-choice.d.ts +17 -0
- package/dist-client/modeller/figure-section-close-choice.js +58 -0
- package/dist-client/modeller/figure-section-close-choice.js.map +1 -0
- package/dist-client/modeller/figure-section-editor.d.ts +11 -1
- package/dist-client/modeller/figure-section-editor.js +57 -3
- package/dist-client/modeller/figure-section-editor.js.map +1 -1
- package/dist-client/modeller/figure-section-panel.js +3 -0
- package/dist-client/modeller/figure-section-panel.js.map +1 -1
- package/dist-client/modeller/side-panel-styles.js +4 -11
- package/dist-client/modeller/side-panel-styles.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/test/layout.test.ts +19 -4
- package/test/section-editor.test.ts +31 -8
- package/translations/en.json +19 -15
- package/translations/ja.json +15 -11
- package/translations/ko.json +19 -15
- package/translations/ms.json +15 -11
- package/translations/zh.json +15 -11
|
@@ -27,7 +27,14 @@ export function groupFields(fields, part) {
|
|
|
27
27
|
AXES.forEach((axis, i) => byId.has(ids[i]) && (cells[axis] = byId.get(ids[i])));
|
|
28
28
|
vectors.push({ kind: 'vector', name, cells });
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
/*
|
|
31
|
+
A drawn section's points and a pyramid's apex are edited in the section editor, where a move is checked as it is made
|
|
32
|
+
and the points stand in the outline's order (user 2026-10-01): not here, one field each, in the order they were made.
|
|
33
|
+
*/
|
|
34
|
+
const drawn = (id) => /^(point\.[^.]+|apex)\.[xyz]$/.test(id.slice(prefix.length));
|
|
35
|
+
const singles = own
|
|
36
|
+
.filter(f => !used.has(f.id) && !drawn(f.id))
|
|
37
|
+
.map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }));
|
|
31
38
|
return { vectors, singles };
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../client/modeller/fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAO9C,+GAA+G;AAC/G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAA4B,EAAE,IAAa;IACrE;;;MAGE;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACpH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7C,MAAM,IAAI,GAA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AAC,CAAC,IAAI,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IACvB,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped: position, rotation and size\n * as one row of three cells each (X · Y · Z read together), and the shape's own measures one to a line under their\n * own title. Kept apart from the editor so the grouping is tested without a browser.\n */\nexport interface FieldLike {\n id: string\n unit: string\n role?: string\n value: number\n}\n\nexport type Axis3 = 'x' | 'y' | 'z'\nconst AXES: readonly Axis3[] = ['x', 'y', 'z']\n\nexport type FieldGroup =\n /* A cell is missing where a rule sets that axis instead of a number: a floor part's height position (ADR-0097). */\n | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: Partial<Record<Axis3, FieldLike>> }\n | { kind: 'single'; name: string; field: FieldLike }\n\n/** The name a single value goes by: its id without the part, `dimension.` and corner numbers read as words. */\nfunction nameOf(rest: string): string {\n return rest.replace(/^dimension\\./, '')\n}\n\n/**\n * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come\n * first, each as one row when any of its axes is there -- an axis a rule sets shows as held, not as a stray single\n * further down; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\n /*\n A part is always placed and turned, so its position and turn rows stand even when a rule sets every axis (a\n fastened part): the screen shows the numbers the rule gives. Its size row stands only when it has a field of its own.\n */\n const prefix = part ? `${part}.` : ''\n const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\\.[xyz]$/.test(f.id)))\n const byId = new Map(own.map(f => [f.id, f]))\n const used = new Set<string>()\n const vectors: FieldGroup[] = []\n for (const name of ['position', 'rotation', 'size'] as const) {\n const ids = AXES.map(axis => `${prefix}${name}.${axis}`)\n if (!ids.some(id => byId.has(id)) && !(part && name !== 'size')) continue\n ids.forEach(id => used.add(id))\n const cells: Partial<Record<Axis3, FieldLike>> = {}\n AXES.forEach((axis, i) => byId.has(ids[i]!) && (cells[axis] = byId.get(ids[i]!)!))\n vectors.push({ kind: 'vector', name, cells })\n }\n const singles: FieldGroup[] = own.filter(f => !used.has(f.id)).map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }))\n return { vectors, singles }\n}\n\n/**\n * The part a copy copies: the member at the end of its path. A row repeats its part and what is fastened to it\n * (ADR-0093, 2026-09-26), so the copies of one row are of several parts -- a roller's and the mark on it.\n */\nconst memberOf = (path: unknown[]): string => {\n const last = [...path].reverse().find((step): step is string => typeof step === 'string')!\n return last.replace(/\\.(placed|value)$/, '').replace(/\\.repeat$/, '')\n}\n\n/**\n * The name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.placed\"]`), which the list showed as it was; it reads as the part it copies and its place counted from 1 --\n * `roller 1`, and `mark 1` for the mark the first roller carries. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n const path = pathOf(id)\n if (!path) return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${memberOf(path)} ${places.join('·')}` : id\n}\n\n/**\n * The repeat a body is a copy of: its name, how many copies it makes, and which copy this is (counted from 1). Nothing\n * for a body that is not a copy.\n */\nexport function repeatOf(id: string, geometry: readonly unknown[] | undefined): { name: string; count: number; index: number } | null {\n const path = pathOf(id)\n const paths = (geometry ?? []).map(g => pathOf((g as { id?: string }).id ?? '')).filter((p): p is unknown[] => !!p)\n if (!path) {\n /* The part itself, by its name: how many copies of it the row makes now. */\n const copies = paths.filter(p => memberOf(p) === id).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const name = memberOf(path)\n const count = paths.filter(p => p[0] === path[0] && memberOf(p) === name).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name, count, index: (index ?? 0) + 1 }\n}\n\nfunction pathOf(id: string): unknown[] | null {\n if (!id.startsWith('[')) return null\n try {\n const path = JSON.parse(id)\n return Array.isArray(path) && typeof path[0] === 'string' ? path : null\n } catch {\n return null\n }\n}\n\n/**\n * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The\n * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\nexport function ownerOf(id: string): string {\n const path = pathOf(id)\n return path ? memberOf(path) : id\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../client/modeller/fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAO9C,+GAA+G;AAC/G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAA4B,EAAE,IAAa;IACrE;;;MAGE;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACpH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,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ED,SAAS,MAAM,CAAC,EAAU;IACxB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IACvB,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped: position, rotation and size\n * as one row of three cells each (X · Y · Z read together), and the shape's own measures one to a line under their\n * own title. Kept apart from the editor so the grouping is tested without a browser.\n */\nexport interface FieldLike {\n id: string\n unit: string\n role?: string\n value: number\n}\n\nexport type Axis3 = 'x' | 'y' | 'z'\nconst AXES: readonly Axis3[] = ['x', 'y', 'z']\n\nexport type FieldGroup =\n /* A cell is missing where a rule sets that axis instead of a number: a floor part's height position (ADR-0097). */\n | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: Partial<Record<Axis3, FieldLike>> }\n | { kind: 'single'; name: string; field: FieldLike }\n\n/** The name a single value goes by: its id without the part, `dimension.` and corner numbers read as words. */\nfunction nameOf(rest: string): string {\n return rest.replace(/^dimension\\./, '')\n}\n\n/**\n * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come\n * first, each as one row when any of its axes is there -- an axis a rule sets shows as held, not as a stray single\n * further down; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\n /*\n A part is always placed and turned, so its position and turn rows stand even when a rule sets every axis (a\n fastened part): the screen shows the numbers the rule gives. Its size row stands only when it has a field of its own.\n */\n const prefix = part ? `${part}.` : ''\n const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\\.[xyz]$/.test(f.id)))\n const byId = new Map(own.map(f => [f.id, f]))\n const used = new Set<string>()\n const vectors: FieldGroup[] = []\n for (const name of ['position', 'rotation', 'size'] as const) {\n const ids = AXES.map(axis => `${prefix}${name}.${axis}`)\n if (!ids.some(id => byId.has(id)) && !(part && name !== 'size')) continue\n ids.forEach(id => used.add(id))\n const cells: Partial<Record<Axis3, FieldLike>> = {}\n AXES.forEach((axis, i) => byId.has(ids[i]!) && (cells[axis] = byId.get(ids[i]!)!))\n vectors.push({ kind: 'vector', name, cells })\n }\n /*\n A drawn section's points and a pyramid's apex are edited in the section editor, where a move is checked as it is made\n and the points stand in the outline's order (user 2026-10-01): not here, one field each, in the order they were made.\n */\n const drawn = (id: string) => /^(point\\.[^.]+|apex)\\.[xyz]$/.test(id.slice(prefix.length))\n const singles: FieldGroup[] = own\n .filter(f => !used.has(f.id) && !drawn(f.id))\n .map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }))\n return { vectors, singles }\n}\n\n/**\n * The part a copy copies: the member at the end of its path. A row repeats its part and what is fastened to it\n * (ADR-0093, 2026-09-26), so the copies of one row are of several parts -- a roller's and the mark on it.\n */\nconst memberOf = (path: unknown[]): string => {\n const last = [...path].reverse().find((step): step is string => typeof step === 'string')!\n return last.replace(/\\.(placed|value)$/, '').replace(/\\.repeat$/, '')\n}\n\n/**\n * The name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.placed\"]`), which the list showed as it was; it reads as the part it copies and its place counted from 1 --\n * `roller 1`, and `mark 1` for the mark the first roller carries. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n const path = pathOf(id)\n if (!path) return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${memberOf(path)} ${places.join('·')}` : id\n}\n\n/**\n * The repeat a body is a copy of: its name, how many copies it makes, and which copy this is (counted from 1). Nothing\n * for a body that is not a copy.\n */\nexport function repeatOf(id: string, geometry: readonly unknown[] | undefined): { name: string; count: number; index: number } | null {\n const path = pathOf(id)\n const paths = (geometry ?? []).map(g => pathOf((g as { id?: string }).id ?? '')).filter((p): p is unknown[] => !!p)\n if (!path) {\n /* The part itself, by its name: how many copies of it the row makes now. */\n const copies = paths.filter(p => memberOf(p) === id).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const name = memberOf(path)\n const count = paths.filter(p => p[0] === path[0] && memberOf(p) === name).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name, count, index: (index ?? 0) + 1 }\n}\n\nfunction pathOf(id: string): unknown[] | null {\n if (!id.startsWith('[')) return null\n try {\n const path = JSON.parse(id)\n return Array.isArray(path) && typeof path[0] === 'string' ? path : null\n } catch {\n return null\n }\n}\n\n/**\n * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The\n * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\nexport function ownerOf(id: string): string {\n const path = pathOf(id)\n return path ? memberOf(path) : id\n}\n\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@operato/popup/ox-popup-actions.js';
|
|
3
|
+
import '@material/web/button/filled-button.js';
|
|
4
|
+
import '@material/web/button/text-button.js';
|
|
5
|
+
/** What to do with a section edit not applied yet, when its editor is about to close (user 2026-10-01). */
|
|
6
|
+
export type SectionCloseChoice = 'apply' | 'discard';
|
|
7
|
+
/**
|
|
8
|
+
* Closing the section editor with changes not applied: apply them, let them go, or keep editing. Closes with the choice,
|
|
9
|
+
* or with nothing -- then the editor stays open as it was. Apply is not offered while the working shape would be refused
|
|
10
|
+
* or the figure changed since the editor opened; the words say which.
|
|
11
|
+
*/
|
|
12
|
+
export declare class FigureSectionCloseChoice extends LitElement {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
/** Why the working shape cannot be applied now, or empty when it can. */
|
|
15
|
+
held: string;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { i18next } from '@operato/i18n';
|
|
5
|
+
import { closePopup } from '@operato/popup';
|
|
6
|
+
import '@operato/popup/ox-popup-actions.js';
|
|
7
|
+
import { CommonPopupStyles } from '@operato/styles';
|
|
8
|
+
import '@material/web/button/filled-button.js';
|
|
9
|
+
import '@material/web/button/text-button.js';
|
|
10
|
+
/**
|
|
11
|
+
* Closing the section editor with changes not applied: apply them, let them go, or keep editing. Closes with the choice,
|
|
12
|
+
* or with nothing -- then the editor stays open as it was. Apply is not offered while the working shape would be refused
|
|
13
|
+
* or the figure changed since the editor opened; the words say which.
|
|
14
|
+
*/
|
|
15
|
+
let FigureSectionCloseChoice = class FigureSectionCloseChoice extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/** Why the working shape cannot be applied now, or empty when it can. */
|
|
19
|
+
this.held = '';
|
|
20
|
+
}
|
|
21
|
+
static { this.styles = [
|
|
22
|
+
CommonPopupStyles,
|
|
23
|
+
css `
|
|
24
|
+
:host {
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
}
|
|
27
|
+
p {
|
|
28
|
+
margin: 0 0 12px;
|
|
29
|
+
}
|
|
30
|
+
`
|
|
31
|
+
]; }
|
|
32
|
+
render() {
|
|
33
|
+
return html `
|
|
34
|
+
<p>${i18next.t('figure.text.section-editor-close-changed')}</p>
|
|
35
|
+
${this.held ? html `<p>${this.held}</p>` : nothing}
|
|
36
|
+
<ox-popup-actions>
|
|
37
|
+
<md-text-button slot="cancel" @click=${() => closePopup(this)}>${i18next.t('figure.button.keep-editing')}</md-text-button>
|
|
38
|
+
<md-text-button slot="start" destructive @click=${() => closePopup(this, 'discard')}
|
|
39
|
+
>${i18next.t('figure.button.section-editor-discard')}</md-text-button
|
|
40
|
+
>
|
|
41
|
+
${this.held
|
|
42
|
+
? nothing
|
|
43
|
+
: html `<md-filled-button slot="confirm" @click=${() => closePopup(this, 'apply')}
|
|
44
|
+
>${i18next.t('figure.button.section-editor-apply-and-close')}</md-filled-button
|
|
45
|
+
>`}
|
|
46
|
+
</ox-popup-actions>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: String }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], FigureSectionCloseChoice.prototype, "held", void 0);
|
|
54
|
+
FigureSectionCloseChoice = __decorate([
|
|
55
|
+
customElement('figure-section-close-choice')
|
|
56
|
+
], FigureSectionCloseChoice);
|
|
57
|
+
export { FigureSectionCloseChoice };
|
|
58
|
+
//# sourceMappingURL=figure-section-close-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figure-section-close-choice.js","sourceRoot":"","sources":["../../client/modeller/figure-section-close-choice.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAK5C;;;;GAIG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,UAAU;IAAjD;;QAaL,yEAAyE;QAC7C,SAAI,GAAG,EAAE,CAAA;IAmBvC,CAAC;aAhCQ,WAAM,GAAG;QACd,iBAAiB;QACjB,GAAG,CAAA;;;;;;;KAOF;KACF,AAVY,CAUZ;IAKD,MAAM;QACJ,OAAO,IAAI,CAAA;WACJ,OAAO,CAAC,CAAC,CAAC,0CAA0C,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO;;+CAER,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC;0DACtD,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,SAAsC,CAAC;aAC3G,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC;;UAEpD,IAAI,CAAC,IAAI;YACT,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,CAAA,2CAA2C,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,OAAoC,CAAC;iBACtG,OAAO,CAAC,CAAC,CAAC,8CAA8C,CAAC;cAC5D;;KAET,CAAA;IACH,CAAC;;AAlB2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAU;AAd1B,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAiCpC","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\n/** What to do with a section edit not applied yet, when its editor is about to close (user 2026-10-01). */\nexport type SectionCloseChoice = 'apply' | 'discard'\n\n/**\n * Closing the section editor with changes not applied: apply them, let them go, or keep editing. Closes with the choice,\n * or with nothing -- then the editor stays open as it was. Apply is not offered while the working shape would be refused\n * or the figure changed since the editor opened; the words say which.\n */\n@customElement('figure-section-close-choice')\nexport class FigureSectionCloseChoice extends LitElement {\n static styles = [\n CommonPopupStyles,\n css`\n :host {\n overflow-y: auto;\n }\n p {\n margin: 0 0 12px;\n }\n `\n ]\n\n /** Why the working shape cannot be applied now, or empty when it can. */\n @property({ type: String }) held = ''\n\n render() {\n return html`\n <p>${i18next.t('figure.text.section-editor-close-changed')}</p>\n ${this.held ? html`<p>${this.held}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => closePopup(this)}>${i18next.t('figure.button.keep-editing')}</md-text-button>\n <md-text-button slot=\"start\" destructive @click=${() => closePopup(this, 'discard' satisfies SectionCloseChoice)}\n >${i18next.t('figure.button.section-editor-discard')}</md-text-button\n >\n ${this.held\n ? nothing\n : html`<md-filled-button slot=\"confirm\" @click=${() => closePopup(this, 'apply' satisfies SectionCloseChoice)}\n >${i18next.t('figure.button.section-editor-apply-and-close')}</md-filled-button\n >`}\n </ox-popup-actions>\n `\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing } from 'lit';
|
|
2
2
|
import type { FigureEvaluatedShape, FigureSectionMeasure } from '@hatiolab/figure-model';
|
|
3
|
+
import './figure-section-close-choice.js';
|
|
3
4
|
type Axis = 'x' | 'y' | 'z';
|
|
4
5
|
/** The editor's width and room for the solid beside it: below this the two take turns. */
|
|
5
6
|
export declare const NARROW_BELOW = 900;
|
|
@@ -21,7 +22,8 @@ declare const FigureSectionEditor_base: (new (...args: any[]) => LitElement) & t
|
|
|
21
22
|
*
|
|
22
23
|
* What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows
|
|
23
24
|
* the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel
|
|
24
|
-
* or Esc sends nothing and lets the preview go
|
|
25
|
+
* or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep
|
|
26
|
+
* editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor
|
|
25
27
|
* is open, apply is refused until it is opened again.
|
|
26
28
|
*/
|
|
27
29
|
export declare class FigureSectionEditor extends FigureSectionEditor_base {
|
|
@@ -77,6 +79,14 @@ export declare class FigureSectionEditor extends FigureSectionEditor_base {
|
|
|
77
79
|
/** A width across set: a circle's two are one. */
|
|
78
80
|
private across;
|
|
79
81
|
private apply;
|
|
82
|
+
/** Whether anything was changed since the editor opened. */
|
|
83
|
+
get dirty(): boolean;
|
|
84
|
+
private asking;
|
|
85
|
+
/**
|
|
86
|
+
* Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the
|
|
87
|
+
* editor closed; false when the person keeps editing.
|
|
88
|
+
*/
|
|
89
|
+
requestClose(): Promise<boolean>;
|
|
80
90
|
private cancel;
|
|
81
91
|
private close;
|
|
82
92
|
private svgPoint;
|
|
@@ -7,6 +7,8 @@ import { figureCavitySectionOf, figureSectionSidesOf } from '@hatiolab/figure-mo
|
|
|
7
7
|
import { SidePanelStyles } from './side-panel-styles.js';
|
|
8
8
|
import { apexOver, drawnOf, insertAfter, markedBy, movePoint, pointLabel, removePoint, sectionOf, workingIssuesOf, workingOf } from './section-drawing.js';
|
|
9
9
|
import { END_FACE } from './section-controls.js';
|
|
10
|
+
import { openPopup } from '@operato/layout';
|
|
11
|
+
import './figure-section-close-choice.js';
|
|
10
12
|
/** How the section is laid on the screen, by the axis it is pushed along: across to the right, then down. */
|
|
11
13
|
const SCREEN = { y: ['x', 'z'], x: ['z', 'y'], z: ['x', 'y'] };
|
|
12
14
|
/** The editor's width and room for the solid beside it: below this the two take turns. */
|
|
@@ -28,7 +30,8 @@ export const NARROW_BELOW = 900;
|
|
|
28
30
|
*
|
|
29
31
|
* What the kernel would refuse is marked on the outline and said in the list; apply is held back, and the solid shows
|
|
30
32
|
* the last valid state, which the caption names. Apply sends one `set-section` command (one step of the history); cancel
|
|
31
|
-
* or Esc sends nothing and lets the preview go
|
|
33
|
+
* or Esc sends nothing and lets the preview go -- after asking, when something was changed: apply it, let it go, or keep
|
|
34
|
+
* editing (`requestClose`). The undo here is the editor's own. If the figure changes while the editor
|
|
32
35
|
* is open, apply is refused until it is opened again.
|
|
33
36
|
*/
|
|
34
37
|
let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(LitElement) {
|
|
@@ -62,10 +65,13 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
|
|
|
62
65
|
*/
|
|
63
66
|
this.keys = (e) => {
|
|
64
67
|
const inField = e.composedPath()[0]?.tagName === 'INPUT';
|
|
68
|
+
/* While the close is being asked, the question has the keys: Esc there is 계속 편집. */
|
|
69
|
+
if (this.asking)
|
|
70
|
+
return;
|
|
65
71
|
const take = () => (e.preventDefault(), e.stopImmediatePropagation());
|
|
66
72
|
if (e.key === 'Escape') {
|
|
67
73
|
take();
|
|
68
|
-
this.
|
|
74
|
+
this.requestClose();
|
|
69
75
|
}
|
|
70
76
|
else if ((e.key === 'Delete' || e.key === 'Backspace') && !inField && this.selected) {
|
|
71
77
|
/* In a field the key deletes a character; outside, the chosen point. */
|
|
@@ -77,6 +83,7 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
|
|
|
77
83
|
this.back();
|
|
78
84
|
}
|
|
79
85
|
};
|
|
86
|
+
this.asking = false;
|
|
80
87
|
}
|
|
81
88
|
static { this.styles = [SidePanelStyles, css `
|
|
82
89
|
:host {
|
|
@@ -362,6 +369,53 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
|
|
|
362
369
|
this.dispatchEvent(new CustomEvent('command', { detail: { action: this.action(this.working) }, bubbles: true, composed: true }));
|
|
363
370
|
this.close();
|
|
364
371
|
}
|
|
372
|
+
/** Whether anything was changed since the editor opened. */
|
|
373
|
+
get dirty() {
|
|
374
|
+
const key = (w) => JSON.stringify([
|
|
375
|
+
w.points.map(p => [p.id, p.x ?? 0, p.y ?? 0, p.z ?? 0]),
|
|
376
|
+
Object.entries(w.across).sort(),
|
|
377
|
+
w.length,
|
|
378
|
+
w.apex ? Object.entries(w.apex).sort() : null
|
|
379
|
+
]);
|
|
380
|
+
return !!this.opened && key(this.working) !== key(this.opened);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Close, asking first when something was changed (user 2026-10-01): apply it, let it go, or keep editing. True when the
|
|
384
|
+
* editor closed; false when the person keeps editing.
|
|
385
|
+
*/
|
|
386
|
+
async requestClose() {
|
|
387
|
+
if (!this.dirty) {
|
|
388
|
+
this.cancel();
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
if (this.asking)
|
|
392
|
+
return false;
|
|
393
|
+
const held = this.stale
|
|
394
|
+
? i18next.t('figure.text.section-editor-stale')
|
|
395
|
+
: this.valid(this.working)
|
|
396
|
+
? ''
|
|
397
|
+
: i18next.t('figure.text.section-editor-close-invalid');
|
|
398
|
+
this.asking = true;
|
|
399
|
+
try {
|
|
400
|
+
const choice = await openPopup(html `<figure-section-close-choice .held=${held}></figure-section-close-choice>`, {
|
|
401
|
+
backdrop: true,
|
|
402
|
+
size: 'small',
|
|
403
|
+
title: i18next.t('figure.label.section-editor')
|
|
404
|
+
}).result;
|
|
405
|
+
if (choice === 'apply' && !held) {
|
|
406
|
+
this.apply();
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
if (choice === 'discard') {
|
|
410
|
+
this.cancel();
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
finally {
|
|
416
|
+
this.asking = false;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
365
419
|
cancel() {
|
|
366
420
|
this.dispatchEvent(new CustomEvent('command-live', { detail: { action: null }, bubbles: true, composed: true }));
|
|
367
421
|
this.close();
|
|
@@ -410,7 +464,7 @@ let FigureSectionEditor = class FigureSectionEditor extends localize(i18next)(Li
|
|
|
410
464
|
? i18next.t('figure.text.section-editor-stale')
|
|
411
465
|
: i18next.t(this.kind === 'polygon' ? 'figure.text.section-editor-hint' : 'figure.text.section-editor-hint-sized')}
|
|
412
466
|
</span>
|
|
413
|
-
<button @click=${() => this.
|
|
467
|
+
<button @click=${() => this.requestClose()}>${i18next.t('figure.button.section-editor-cancel')}</button>
|
|
414
468
|
<button primary ?disabled=${this.stale || words.length > 0} @click=${() => this.apply()}>${i18next.t('figure.button.section-editor-apply')}</button>
|
|
415
469
|
</footer>
|
|
416
470
|
`;
|
|
@@ -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,EAAuB,MAAM,sBAAsB,CAAA;AAC/K,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,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C3E;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AAxNf,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA+qB/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, type SectionWorking } from './section-drawing.js'\nimport { END_FACE } from './section-controls.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 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 * 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. 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 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 }\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\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 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 const take = () => (e.preventDefault(), e.stopImmediatePropagation())\n if (e.key === 'Escape') {\n take()\n this.cancel()\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() {\n this.dispatchEvent(\n new CustomEvent('command-live', { detail: { action: this.action(this.lastValid) }, bubbles: true, composed: true })\n )\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 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 }\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 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.cancel()}>${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 cavity = this.body!.shape.cavity\n const inside = cavity && !invalid ? figureCavitySectionOf(section, this.axis, 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 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.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,EAAuB,MAAM,sBAAsB,CAAA;AAC/K,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,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,EAAE,CAAA;AAE1F,0FAA0F;AAC1F,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;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K,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;;oDAAoF;AAC3E;IAAhB,KAAK,EAAE;;qDAAuC;AAC9B;IAAhB,KAAK,EAAE;;iDAAkB;AAxNf,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAkuB/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, type SectionWorking } from './section-drawing.js'\nimport { END_FACE } from './section-controls.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 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 * 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 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 }\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\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 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 /* 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() {\n this.dispatchEvent(\n new CustomEvent('command-live', { detail: { action: this.action(this.lastValid) }, bubbles: true, composed: true })\n )\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 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 }\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 ])\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 cavity = this.body!.shape.cavity\n const inside = cavity && !invalid ? figureCavitySectionOf(section, this.axis, 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 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.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"]}
|
|
@@ -83,6 +83,9 @@ let FigureSectionPanel = class FigureSectionPanel extends localize(i18next)(LitE
|
|
|
83
83
|
<button act ?disabled=${this.locked} @click=${() => this.dispatchEvent(new CustomEvent('section-editor-open', { bubbles: true, composed: true }))}>
|
|
84
84
|
${i18next.t('figure.button.section-editor-open')}
|
|
85
85
|
</button>
|
|
86
|
+
${e.section.kind === 'polygon'
|
|
87
|
+
? html `<small>${i18next.t(e.apex ? 'figure.text.section-points-apex' : 'figure.text.section-points', { points: String(e.section.points.length) })}</small>`
|
|
88
|
+
: nothing}
|
|
86
89
|
</div>`
|
|
87
90
|
: nothing}
|
|
88
91
|
${kind === 'rectangle' ? this.renderCorner(body) : nothing}
|