@things-factory/figure-ui 10.1.193 → 10.1.195
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-styles.ts +10 -3
- package/client/modeller/editor.ts +61 -47
- package/client/modeller/figure-fasten-dialog.ts +11 -5
- package/client/modeller/refusal-teller.ts +8 -0
- package/client/pages/figure-list-page.ts +27 -40
- package/client/pages/figure-public-list-page.ts +21 -0
- package/client/route.ts +4 -0
- package/dist-client/modeller/editor-styles.js +10 -3
- package/dist-client/modeller/editor-styles.js.map +1 -1
- package/dist-client/modeller/editor.d.ts +18 -9
- package/dist-client/modeller/editor.js +62 -46
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/figure-fasten-dialog.d.ts +3 -3
- package/dist-client/modeller/figure-fasten-dialog.js +11 -5
- package/dist-client/modeller/figure-fasten-dialog.js.map +1 -1
- package/dist-client/modeller/refusal-teller.d.ts +8 -0
- package/dist-client/modeller/refusal-teller.js +7 -0
- package/dist-client/modeller/refusal-teller.js.map +1 -1
- package/dist-client/pages/figure-list-page.d.ts +6 -3
- package/dist-client/pages/figure-list-page.js +25 -42
- package/dist-client/pages/figure-list-page.js.map +1 -1
- package/dist-client/pages/figure-public-list-page.d.ts +16 -0
- package/dist-client/pages/figure-public-list-page.js +21 -0
- package/dist-client/pages/figure-public-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/test/align.test.ts +13 -5
- package/test/browser/editing.check.mjs +9 -13
- package/test/browser/links.check.mjs +36 -22
- package/test/browser/list-page.js +35 -0
- package/test/browser/list.check.mjs +68 -0
- package/test/browser/modeller-page.js +48 -4
- package/test/browser/product-page.js +6 -0
- package/test/browser/props.check.mjs +2 -2
- package/test/figure-released.test.ts +1 -1
- package/things-factory.config.js +1 -0
- package/translations/en.json +4 -6
- package/translations/es.json +4 -6
- package/translations/ja.json +4 -6
- package/translations/ko.json +4 -6
- package/translations/ms.json +4 -6
- package/translations/zh.json +4 -6
|
@@ -7,9 +7,9 @@ import './figure-fasten-drawing.js';
|
|
|
7
7
|
import type { FigureRevision } from './revision.js';
|
|
8
8
|
declare const FigureFastenDialog_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
9
9
|
/**
|
|
10
|
-
* 붙이기 창: what the selected part is fastened to, on which face, how
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* 붙이기 창: what the selected part is fastened to, on which face, how (user 2026-10-17: 「속성에는 심플하고 직관적인
|
|
11
|
+
* 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」). The editor stands it over the side panel with its title and close,
|
|
12
|
+
* where the canvas stays in sight (2026-10-19: the standard popup, always modal, hid the 3D it was choosing for).
|
|
13
13
|
*
|
|
14
14
|
* Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes
|
|
15
15
|
* (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;
|
|
@@ -15,9 +15,9 @@ import { fieldWordsOf, hasInstanceSize, heldBy } from './links.js';
|
|
|
15
15
|
/** The target list's entry for the plane the figure stands by. */
|
|
16
16
|
const PLANE = '__plane';
|
|
17
17
|
/**
|
|
18
|
-
* 붙이기 창: what the selected part is fastened to, on which face, how
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* 붙이기 창: what the selected part is fastened to, on which face, how (user 2026-10-17: 「속성에는 심플하고 직관적인
|
|
19
|
+
* 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」). The editor stands it over the side panel with its title and close,
|
|
20
|
+
* where the canvas stays in sight (2026-10-19: the standard popup, always modal, hid the 3D it was choosing for).
|
|
21
21
|
*
|
|
22
22
|
* Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes
|
|
23
23
|
* (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;
|
|
@@ -137,6 +137,14 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
|
|
|
137
137
|
margin: 0;
|
|
138
138
|
color: var(--md-sys-color-error);
|
|
139
139
|
}
|
|
140
|
+
/* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the panel. */
|
|
141
|
+
ox-popup-actions {
|
|
142
|
+
position: sticky;
|
|
143
|
+
bottom: calc(-1 * var(--popup-padding, 16px));
|
|
144
|
+
margin-bottom: calc(-1 * var(--popup-padding, 16px));
|
|
145
|
+
padding-bottom: var(--popup-padding, 16px);
|
|
146
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
147
|
+
}
|
|
140
148
|
`
|
|
141
149
|
]; }
|
|
142
150
|
willUpdate() {
|
|
@@ -398,8 +406,6 @@ let FigureFastenDialog = class FigureFastenDialog extends localize(i18next)(LitE
|
|
|
398
406
|
this.setAttribute('role', 'dialog');
|
|
399
407
|
this.setAttribute('aria-label', i18next.t('figure.label.fastening'));
|
|
400
408
|
this.addEventListener('keydown', this.onKey);
|
|
401
|
-
/* The popup's fitting width is the overlay's own setting; the window asks it for room for the face and the way side by side. */
|
|
402
|
-
this.closest('ox-floating-overlay')?.style.setProperty('--overlay-center-fit-width', '640px');
|
|
403
409
|
}
|
|
404
410
|
};
|
|
405
411
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,2CAA2C,CAA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AAS,EAAE,KAAK,EAAE,CAAC;;oDAA0B;AAE7C;IAAX,QAAQ,EAAE;;kDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;kDAAe;AAEX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AA5EvB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA6Z9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how -- chosen with room to see it, in the standard\n * popup the editor opens (`openPopup`: its title, its close, moved by its head) (user 2026-10-17: 「속성에는 심플하고\n * 직관적인 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」; 2026-10-18: the standard popup, not a window of its own).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 320px;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? ['meet']\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => (this.form = fastenChanged(revision, this.partId, this.form!, e.detail))}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(this.partId, f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part's own face follows from it. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${plan.alignRows.length ? this.renderAlignment(plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined })}\n />\n <span>${i18next.t('figure.label.twist')}</span>\n <input\n twist\n type=\"number\"\n step=\"any\"\n .value=${String(f.twist)}\n @change=${(e: Event) => this.set({ twist: Number((e.target as HTMLInputElement).value) || 0 })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part })\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${\n edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>\n ${i18next.t(`figure.label.align-${axis}-min`)}\n </option>\n <option value=\"max\" ?selected=${how === 'max'}>\n ${i18next.t(`figure.label.align-${axis}-max`)}\n </option>`\n : nothing\n }\n ${\n f.alignInput?.[axis]\n ? html`<option value=\"input\" ?selected=${how === 'input'}>\n ${i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) })}\n </option>`\n : nothing\n }\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${\n this.revision && hasInstanceSize(this.revision.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>\n ${i18next.t('figure.label.align-share')}\n </option>`\n : nothing\n }\n </select>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n /* The popup's fitting width is the overlay's own setting; the window asks it for room for the face and the way side by side. */\n this.closest<HTMLElement>('ox-floating-overlay')?.style.setProperty('--overlay-center-fit-width', '640px')\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"figure-fasten-dialog.js","sourceRoot":"","sources":["../../client/modeller/figure-fasten-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,2CAA2C,CAAA;AAClD,OAAO,oCAAoC,CAAA;AAC3C,OA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/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA4B;AAE/C;IAAX,QAAQ,EAAE;;iDAAW;AAEL;IAAhB,KAAK,EAAE;;gDAA0B;AApFvB,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAma9B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles } from '@operato/styles'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\n\nimport './figure-fasten-drawing.js'\nimport type { FastenChange } from './figure-fasten-drawing.js'\nimport { turnsInPlace, type FastenMode } from './fasten-geometry.js'\nimport {\n aimFasten,\n fastenChanged,\n fastenDetailWordsOf,\n fastenFormOf,\n fastenPlanOf,\n fastenSentenceOf,\n fastenTargetsOf,\n type FastenForm\n} from './fasten-form.js'\nimport { fieldWordsOf, hasInstanceSize, heldBy, type Alignment, type Axis } from './links.js'\nimport type { FigureRevision } from './revision.js'\n\n/** The target list's entry for the plane the figure stands by. */\nconst PLANE = '__plane'\n\n/**\n * 붙이기 창: what the selected part is fastened to, on which face, how (user 2026-10-17: 「속성에는 심플하고 직관적인\n * 결과 위주로, 편집은 팝업에서 넓은 공간을 써서」). The editor stands it over the side panel with its title and close,\n * where the canvas stays in sight (2026-10-19: the standard popup, always modal, hid the 3D it was choosing for).\n *\n * Everything chosen here is tried, not done: the command it comes to is told to the editor as it changes\n * (`preview-command`), and the canvas draws it. 「적용」 sends it once (`fasten-apply`), one step of the history;\n * 「취소」 and Esc close it with nothing written (`fasten-cancel`). A row of the target list under the pointer or the\n * arrows asks the canvas to light that part (`fasten-hover`). The window is the only one telling the preview while it\n * is open; the editor keeps the panel quiet.\n */\n@customElement('figure-fasten-dialog')\nexport class FigureFastenDialog extends localize(i18next)(LitElement) {\n static styles = [\n SidePanelStyles,\n CommonPopupStyles,\n css`\n :host {\n display: grid;\n gap: 16px;\n padding: var(--popup-padding, 16px);\n overflow: auto;\n }\n /* The result in one line, at the top: it changes with every choice below it. */\n p[fasten-sentence] {\n margin: 0;\n font-size: var(--ui-t-body, 13px);\n font-weight: 600;\n }\n div[question] {\n display: grid;\n align-content: start;\n gap: 6px;\n }\n h4 {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n font-weight: 600;\n color: var(--md-sys-color-on-surface-variant);\n }\n /* The chips are part names, identifiers: shown as they are written, not capitalized as filter words are. */\n ox-input-select-buttons {\n --ox-input-select-buttons-label-text-transform: none;\n }\n p[loops] {\n margin: 0;\n }\n details[fasten-detail] {\n margin: 0;\n }\n details[fasten-detail] > div[form] {\n margin-top: 8px;\n max-width: 320px;\n }\n span[fasten-summary] {\n opacity: 0.8;\n }\n ul[preview-words] {\n margin: 0;\n padding: 8px 12px 8px 26px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n display: grid;\n gap: 4px;\n }\n p[preview-words] {\n margin: 0;\n padding: 8px 12px;\n border-radius: 6px;\n background: var(--md-sys-color-surface-container, #8881);\n }\n p[error] {\n margin: 0;\n color: var(--md-sys-color-error);\n }\n /* 취소 · 적용 stay in sight at the window's foot when what is above them is taller than the panel. */\n ox-popup-actions {\n position: sticky;\n bottom: calc(-1 * var(--popup-padding, 16px));\n margin-bottom: calc(-1 * var(--popup-padding, 16px));\n padding-bottom: var(--popup-padding, 16px);\n background: var(--md-sys-color-surface-container-lowest);\n }\n `\n ]\n\n /** The figure at the version on screen. */\n @property({ attribute: false }) revision?: FigureRevision\n /** The part being fastened. */\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n /** What the command would do, in words (the editor works it out: `command-preview.ts`). */\n @property({ attribute: false }) previewWords: string[] = []\n /** Why the last 「적용」 was refused, in the editor's words. */\n @property() error = ''\n\n @state() private form?: FastenForm\n /** The command the part's own fastening comes to, as opened: tried unchanged, nothing new is said of it. */\n private opened?: string\n private told = ''\n private loadedFor?: string\n private hovered: string | null = null\n\n willUpdate() {\n /* Opened on what the part has now; another part is another window's. */\n if (this.revision && this.partId && this.partId !== this.loadedFor) {\n this.loadedFor = this.partId\n this.form = fastenFormOf(this.revision, this.partId)\n this.opened = JSON.stringify(fastenPlanOf(this.revision, this.partId, this.form).action ?? null)\n }\n }\n\n async firstUpdated() {\n /* Into the list, on what is chosen, so the arrows go from there. */\n const list = this.renderRoot.querySelector<HTMLElement & { updateComplete?: Promise<unknown> }>(\n 'ox-input-select-buttons'\n )\n await list?.updateComplete\n const chips = list?.shadowRoot?.querySelectorAll<HTMLElement>('md-filter-chip')\n ;([...(chips ?? [])].find(c => c.hasAttribute('selected')) ?? chips?.[0])?.focus()\n }\n\n updated() {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n const candidate = plan?.action ? { action: plan.action, ...(plan.face ? { face: plan.face } : {}) } : null\n const said = JSON.stringify(candidate)\n if (said === this.told) return\n this.told = said\n this.dispatchEvent(new CustomEvent('preview-command', { detail: candidate, bubbles: true, composed: true }))\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n /* Closed: what it showed goes with it. */\n if (this.told && this.told !== 'null')\n this.dispatchEvent(new CustomEvent('preview-command', { detail: null, bubbles: true, composed: true }))\n this.told = ''\n this.hover(null)\n }\n\n render() {\n const revision = this.revision\n const f = this.form\n if (!revision || !f) return nothing\n const asset = revision.asset\n const held = !!heldBy(asset, this.partId)\n const plan = fastenPlanOf(revision, this.partId, f)\n const planeWord = i18next.t('figure.label.resize-place-' + (asset.placement ?? 'floor'))\n const modes: FastenMode[] = f.toPlane\n ? ['meet']\n : ['meet', 'flush', ...(turnsInPlace(asset, this.partId) ? (['centre'] as FastenMode[]) : [])]\n const detail = fastenDetailWordsOf(f, (key, params) => i18next.t(key, params))\n const drawing = (show: 'face' | 'how') =>\n html`<figure-fasten-drawing\n show=${show}\n .target=${f.toPlane ? '' : f.target}\n .planeWord=${planeWord}\n .faces=${plan.theirFaces}\n .face=${plan.targetFace}\n .modes=${modes}\n .mode=${plan.mode}\n .view=${plan.view}\n .align=${f.align}\n .alignMm=${f.alignMm}\n .gap=${f.gap}\n .partName=${this.partId}\n ?locked=${this.locked}\n @fasten-change=${(e: CustomEvent<FastenChange>) => (this.form = fastenChanged(revision, this.partId, this.form!, e.detail))}\n ></figure-fasten-drawing>`\n return html`\n ${\n plan.aim\n ? html`<p fasten-sentence role=\"status\">\n ${fastenSentenceOf(this.partId, f, plan, planeWord, (key, params) => i18next.t(key, params))}\n </p>`\n : html`<p hint fasten-sentence>${i18next.t('figure.text.fasten-target-first')}</p>`\n }\n <div question=\"what\">\n <h4 id=\"what\">${i18next.t('figure.label.fasten-what')}</h4>\n ${this.renderTargets(revision, f, planeWord)}\n </div>\n ${\n plan.aim\n ? html`<div question=\"face\">\n <h4>\n ${\n /* The face asked is the target's, named: the part's own face follows from it. */ f.toPlane\n ? i18next.t('figure.label.fasten-face-on-plane', { plane: planeWord })\n : i18next.t('figure.label.fasten-face-on-part', { part: f.target })\n }\n </h4>\n ${drawing('face')}\n </div>\n ${\n modes.length > 1\n ? html`<div question=\"how\">\n <h4>${i18next.t('figure.label.fasten-how')}</h4>\n ${drawing('how')}\n </div>`\n : nothing\n }\n <div question=\"detail\">\n <details fasten-detail>\n <summary>\n ${i18next.t('figure.label.fasten-detail')}${detail.length ? html` · <span fasten-summary>${detail.join(' · ')}</span>` : nothing}\n </summary>\n ${plan.alignRows.length ? this.renderAlignment(plan.alignRows) : nothing}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input\n gap\n type=\"number\"\n step=\"any\"\n .value=${f.gapKept !== undefined ? '' : String(f.gap)}\n placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}\n @change=${(e: Event) => this.set({ gap: Number((e.target as HTMLInputElement).value) || 0, gapKept: undefined })}\n />\n <span>${i18next.t('figure.label.twist')}</span>\n <input\n twist\n type=\"number\"\n step=\"any\"\n .value=${String(f.twist)}\n @change=${(e: Event) => this.set({ twist: Number((e.target as HTMLInputElement).value) || 0 })}\n />\n </div>\n </details>\n </div>\n ${/* The one it has, tried unchanged: that it stays where it is goes without saying. */ JSON.stringify(plan.action ?? null) === this.opened ? nothing : this.renderPreviewWords()}`\n : nothing\n }\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" cancel @click=${this.cancel}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" apply ?disabled=${this.locked || !plan.action} @click=${this.apply}>\n ${i18next.t(held ? 'figure.button.apply' : 'figure.button.fasten')}\n </md-filled-button>\n </ox-popup-actions>\n `\n }\n\n /**\n * What to fasten to: the plane and the other parts, as the standard choice chips. The arrows move among them and\n * the canvas lights the part under the focus or the pointer; a part hanging from this one is not offered, and why is\n * said under them.\n */\n private renderTargets(revision: FigureRevision, f: FastenForm, planeWord: string) {\n const chosen = f.toPlane ? PLANE : f.target\n const targets = fastenTargetsOf(revision, this.partId)\n const chipOf = (e: Event) =>\n (e.composedPath().find(n => (n as Element).localName === 'md-filter-chip') as Element | undefined)?.getAttribute(\n 'data-value'\n ) ?? null\n return html`<ox-input-select-buttons\n targets\n aria-labelledby=\"what\"\n .options=${[{ value: PLANE, display: planeWord }, ...targets.filter(t => !t.loops).map(t => ({ value: t.part, display: t.part }))]}\n .value=${chosen || undefined}\n ?disabled=${this.locked}\n @change=${(e: CustomEvent) => {\n /* A chip pressed again lets go of it; what to fasten to is always one thing once chosen. */\n if (e.detail) this.aim(e.detail)\n else (e.target as HTMLElement & { value?: string }).value = chosen || undefined\n }}\n @pointerover=${(e: Event) => this.hover(chipOf(e))}\n @pointerleave=${() => this.hover(null)}\n @focusin=${(e: Event) => this.hover(chipOf(e))}\n @keyup=${(e: KeyboardEvent) => {\n /* The arrows move the focus among the chips inside the list, which tells nothing outside it: read where it is. */\n const at = (e.currentTarget as Element).shadowRoot?.activeElement\n if (at?.localName === 'md-filter-chip') this.hover(at.getAttribute('data-value'))\n }}\n ></ox-input-select-buttons>\n ${this.renderLoops(targets.filter(t => t.loops).map(t => t.part))}`\n }\n\n /**\n * The parts that hang from this one, in one line: a line each made a list longer than the chips (2026-10-18, :3300,\n * the robot arm's forearm and the six parts it carries).\n */\n private renderLoops(parts: string[]) {\n if (!parts.length) return nothing\n return html`<p hint loops targets=${parts.join(',')}>\n ${i18next.t('figure.text.target-would-loop', { part: parts.join(', '), mine: this.partId })}\n </p>`\n }\n\n private aim(part: string) {\n if (this.locked || !this.revision || !this.form) return\n const chosen = this.form.toPlane ? PLANE : this.form.target\n if (part === chosen) return\n this.form = aimFasten(this.revision, this.partId, this.form, part === PLANE ? { plane: true } : { part })\n }\n\n /** The part under the pointer or the focus in the list, for the canvas to light; the plane lights nothing. */\n private hover(part: string | null) {\n const lit = part && part !== PLANE ? part : null\n if (lit === this.hovered) return\n this.hovered = lit\n const face =\n lit && this.revision && this.form\n ? fastenPlanOf(this.revision, this.partId, aimFasten(this.revision, this.partId, this.form, { part: lit }))\n .targetFace\n : undefined\n this.dispatchEvent(\n new CustomEvent('fasten-hover', { detail: lit ? { part: lit, face } : null, bubbles: true, composed: true })\n )\n }\n\n private set(change: Partial<FastenForm>) {\n this.form = { ...this.form!, ...change }\n }\n\n /**\n * Where on the target face the part sits, on the axes the drawing cannot set: centred, level with the target's edge on\n * either side, a distance off centre, a share of the figure's size, or the position field it follows.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.form!\n const set = (axis: Axis, how: Alignment) => this.set({ align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => this.set({ alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how =\n f.align[axis] === 'min' || f.align[axis] === 'max'\n ? edges\n ? f.align[axis]!\n : 'centre'\n : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${\n edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>\n ${i18next.t(`figure.label.align-${axis}-min`)}\n </option>\n <option value=\"max\" ?selected=${how === 'max'}>\n ${i18next.t(`figure.label.align-${axis}-max`)}\n </option>`\n : nothing\n }\n ${\n f.alignInput?.[axis]\n ? html`<option value=\"input\" ?selected=${how === 'input'}>\n ${i18next.t('figure.label.align-input', { field: fieldWordsOf(f.alignInput[axis]!, key => i18next.t(key)) })}\n </option>`\n : nothing\n }\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${\n this.revision && hasInstanceSize(this.revision.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>\n ${i18next.t('figure.label.align-share')}\n </option>`\n : nothing\n }\n </select>\n ${\n how === 'mm' || how === 'share'\n ? html`<span></span\n ><input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.align-mm')}\n .value=${String(f.alignMm[axis] ?? 0)}\n @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)}\n />`\n : nothing\n }`\n })}\n </div>`\n }\n\n private renderPreviewWords() {\n if (this.previewWords.length === 1) return html`<p preview-words role=\"status\">${this.previewWords[0]}</p>`\n return this.previewWords.length\n ? html`<ul preview-words role=\"status\">\n ${this.previewWords.map(line => html`<li>${line}</li>`)}\n </ul>`\n : nothing\n }\n\n /** Enter applies what is chosen, Esc closes with nothing written; a key the window does not take goes on. */\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'dialog')\n this.setAttribute('aria-label', i18next.t('figure.label.fastening'))\n this.addEventListener('keydown', this.onKey)\n }\n\n private onKey = async (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n this.cancel()\n return\n }\n if (e.key !== 'Enter' || e.isComposing) return\n const path = e.composedPath() as Element[]\n const target = path[0] as HTMLElement\n /* On a chip of the list Enter applies, as it does anywhere in the window; a chip is chosen by Space or a press. */\n const onChip = path.some(n => n.localName === 'ox-input-select-buttons')\n /* A button, a fold or a list of options does what Enter does to it. */\n if (\n !onChip &&\n (target.localName === 'button' ||\n target.localName === 'summary' ||\n target.localName === 'select' ||\n /^md-.*button$/.test(target.localName))\n )\n return\n e.preventDefault()\n e.stopPropagation()\n /* A number typed and Enter: the number first, as leaving the field would take it. */\n if (target.localName === 'input') target.dispatchEvent(new Event('change', { bubbles: true, composed: true }))\n await this.updateComplete\n this.apply()\n }\n\n private apply = () => {\n const plan = this.revision && this.form ? fastenPlanOf(this.revision, this.partId, this.form) : undefined\n if (this.locked || !plan?.action) return\n this.dispatchEvent(\n new CustomEvent('fasten-apply', { detail: { action: plan.action }, bubbles: true, composed: true })\n )\n }\n\n private cancel = () => {\n this.dispatchEvent(new CustomEvent('fasten-cancel', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -30,6 +30,14 @@ export declare class RefusalTeller {
|
|
|
30
30
|
constructor(of: RefusalHost);
|
|
31
31
|
/** After the editor's update: what changed in its refusal and notice, and the session's own error, said once. */
|
|
32
32
|
tell(changed: PropertyValues): void;
|
|
33
|
+
/**
|
|
34
|
+
* What cannot be done this way, with the way it can, as a notice: nothing went wrong, so not the error's red
|
|
35
|
+
* (user 2026-10-19, the size drag on a part attached turned). Given more time than a plain notice, for its button.
|
|
36
|
+
*/
|
|
37
|
+
point(message: string, way: {
|
|
38
|
+
label: string;
|
|
39
|
+
run: () => void;
|
|
40
|
+
}): void;
|
|
33
41
|
askClipLoss(error: unknown, again: () => void): boolean;
|
|
34
42
|
private confirmClipLoss;
|
|
35
43
|
private ask;
|
|
@@ -31,6 +31,13 @@ export class RefusalTeller {
|
|
|
31
31
|
notify({ level: 'error', message: viewError });
|
|
32
32
|
this.toldViewError = viewError;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* What cannot be done this way, with the way it can, as a notice: nothing went wrong, so not the error's red
|
|
36
|
+
* (user 2026-10-19, the size drag on a part attached turned). Given more time than a plain notice, for its button.
|
|
37
|
+
*/
|
|
38
|
+
point(message, way) {
|
|
39
|
+
notify({ level: 'info', message, option: { action: { label: way.label, callback: way.run }, timer: 8000 } });
|
|
40
|
+
}
|
|
34
41
|
/*
|
|
35
42
|
An edit that would stop clips is refused by figure-model with the clips named (CLIPS_DROPPED). The person is told
|
|
36
43
|
which, and why, before anything is written; agreed, the same edit is made again letting exactly those go, as one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusal-teller.js","sourceRoot":"","sources":["../../client/modeller/refusal-teller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAiB1C;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAGxB,YAA6B,EAAe;QAAf,OAAE,GAAF,EAAE,CAAa;QAFpC,kBAAa,GAAG,EAAE,CAAA;IAEqB,CAAC;IAEhD,iHAAiH;IACjH,IAAI,CAAC,OAAuB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;QAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;YAC7B,IAAI,KAAK;gBAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;;gBAC5B,MAAM,CAAC,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,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC;YACjC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,OAAO;YACb,aAAa,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE;YACpC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,EAAE;SAChE,CAAC,CAAA;QACF,IAAI,CAAC,MAAM;YAAE,OAAM;QACnB,IAAI,KAAK,CAAC,GAAG;YAAE,KAAK,CAAC,GAAG,EAAE,CAAA;;YACrB,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAO,CAAC,CAAA;IACrC,CAAC;CACF","sourcesContent":["import type { PropertyValues } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport type { FigureAuthoringAction, FigureClipLoss } from '@hatiolab/figure-model'\nimport type { FigureProductSession } from './product-session.js'\nimport { clipLossOf } from './refusals.js'\n\n/** The same link offered again with the size range narrowed, after a link the declared range could not hold. */\nexport type Retry = { label: string; action?: FigureAuthoringAction; run?: () => void }\n\n/** What the teller reads of the editor, and what it asks of it. */\nexport interface RefusalHost {\n session(): FigureProductSession | undefined\n error(): string\n notice(): string\n retry(): Retry | undefined\n /** Said as the editor's refusal. */\n refuse(message: string): void\n /** A narrowed link, confirmed: run as the editor runs a command. */\n command(action: FigureAuthoringAction): void\n}\n\n/**\n * Refusals and notices go to the app's shared surfaces, as every screen's do (user, 2026-09-27: 「왜 모두가 사용하는\n * notification 오류 표현 방법을 사용하지 않고」 · 「혹은 oxprompt 에서 확인하고 진행하던지」). A refusal with a way on --\n * delete and fit the space again, narrow the range -- asks in the app's prompt and goes on when confirmed; any\n * other refusal is the app's notification, which stays until it is closed.\n */\nexport class RefusalTeller {\n private toldViewError = ''\n\n constructor(private readonly of: RefusalHost) {}\n\n /** After the editor's update: what changed in its refusal and notice, and the session's own error, said once. */\n tell(changed: PropertyValues) {\n const error = this.of.error()\n if (changed.has('error') && error) {\n const retry = this.of.retry()\n if (retry) this.ask(error, retry)\n else notify({ level: 'error', message: error })\n }\n const notice = this.of.notice()\n if (changed.has('notice') && notice) notify({ level: 'info', message: notice })\n const viewError = this.of.session()?.read()?.error ?? ''\n if (viewError && viewError !== this.toldViewError) notify({ level: 'error', message: viewError })\n this.toldViewError = viewError\n }\n\n /*\n An edit that would stop clips is refused by figure-model with the clips named (CLIPS_DROPPED). The person is told\n which, and why, before anything is written; agreed, the same edit is made again letting exactly those go, as one\n step undo brings back (designer 2026-09-27).\n */\n askClipLoss(error: unknown, again: () => void): boolean {\n const clips = clipLossOf(error)\n if (!clips) return false\n /* The consent is for this edit, on this figure as it is now: held with it while the person reads. */\n const session = this.of.session()!\n const { context, revision } = session.read()\n void this.confirmClipLoss(clips, again, { session, context: context!, revision: revision! })\n return true\n }\n\n private async confirmClipLoss(clips: FigureClipLoss[], again: () => void, asked: { session: FigureProductSession; context: string; revision: number }) {\n const agreed = await OxPrompt.open({\n type: 'warning',\n text: i18next.t('figure.text.clips-would-go', { clips: clips.map(c => i18next.t(`figure.text.clip-${c.why}`, { clip: c.clip })).join(', ') }),\n confirmButton: { text: i18next.t('figure.button.let-clips-go') },\n cancelButton: { text: i18next.t('figure.button.keep-editing') }\n })\n if (!agreed) return\n /* Changed while the person read -- another figure, or an edit in between: the consent was not for this; nothing is applied. */\n const now = this.of.session() === asked.session ? asked.session.read() : undefined\n if (!now || now.context !== asked.context || now.revision !== asked.revision) {\n this.of.refuse(i18next.t('figure.text.clips-consent-stale'))\n return\n }\n asked.session.withConsent({ dropClips: clips.map(c => c.id), context: asked.context, revision: asked.revision }, again)\n }\n\n private async ask(message: string, retry: Retry) {\n const agreed = await OxPrompt.open({\n type: 'question',\n text: message,\n confirmButton: { text: retry.label },\n cancelButton: { text: i18next.t('figure.button.keep-editing') }\n })\n if (!agreed) return\n if (retry.run) retry.run()\n else this.of.command(retry.action!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C,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,EAAE;SAChE,CAAC,CAAA;QACF,IAAI,CAAC,MAAM;YAAE,OAAM;QACnB,IAAI,KAAK,CAAC,GAAG;YAAE,KAAK,CAAC,GAAG,EAAE,CAAA;;YACrB,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAO,CAAC,CAAA;IACrC,CAAC;CACF","sourcesContent":["import type { PropertyValues } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport type { FigureAuthoringAction, FigureClipLoss } from '@hatiolab/figure-model'\nimport type { FigureProductSession } from './product-session.js'\nimport { clipLossOf } from './refusals.js'\n\n/** The same link offered again with the size range narrowed, after a link the declared range could not hold. */\nexport type Retry = { label: string; action?: FigureAuthoringAction; run?: () => void }\n\n/** What the teller reads of the editor, and what it asks of it. */\nexport interface RefusalHost {\n session(): FigureProductSession | undefined\n error(): string\n notice(): string\n retry(): Retry | undefined\n /** Said as the editor's refusal. */\n refuse(message: string): void\n /** A narrowed link, confirmed: run as the editor runs a command. */\n command(action: FigureAuthoringAction): void\n}\n\n/**\n * Refusals and notices go to the app's shared surfaces, as every screen's do (user, 2026-09-27: 「왜 모두가 사용하는\n * notification 오류 표현 방법을 사용하지 않고」 · 「혹은 oxprompt 에서 확인하고 진행하던지」). A refusal with a way on --\n * delete and fit the space again, narrow the range -- asks in the app's prompt and goes on when confirmed; any\n * other refusal is the app's notification, which stays until it is closed.\n */\nexport class RefusalTeller {\n private toldViewError = ''\n\n constructor(private readonly of: RefusalHost) {}\n\n /** After the editor's update: what changed in its refusal and notice, and the session's own error, said once. */\n tell(changed: PropertyValues) {\n const error = this.of.error()\n if (changed.has('error') && error) {\n const retry = this.of.retry()\n if (retry) this.ask(error, retry)\n else notify({ level: 'error', message: error })\n }\n const notice = this.of.notice()\n if (changed.has('notice') && notice) notify({ level: 'info', message: notice })\n const viewError = this.of.session()?.read()?.error ?? ''\n if (viewError && viewError !== this.toldViewError) notify({ level: 'error', message: viewError })\n this.toldViewError = viewError\n }\n\n /**\n * What cannot be done this way, with the way it can, as a notice: nothing went wrong, so not the error's red\n * (user 2026-10-19, the size drag on a part attached turned). Given more time than a plain notice, for its button.\n */\n point(message: string, way: { label: string; run: () => void }) {\n notify({ level: 'info', message, option: { action: { label: way.label, callback: way.run }, timer: 8000 } })\n }\n\n /*\n An edit that would stop clips is refused by figure-model with the clips named (CLIPS_DROPPED). The person is told\n which, and why, before anything is written; agreed, the same edit is made again letting exactly those go, as one\n step undo brings back (designer 2026-09-27).\n */\n askClipLoss(error: unknown, again: () => void): boolean {\n const clips = clipLossOf(error)\n if (!clips) return false\n /* The consent is for this edit, on this figure as it is now: held with it while the person reads. */\n const session = this.of.session()!\n const { context, revision } = session.read()\n void this.confirmClipLoss(clips, again, { session, context: context!, revision: revision! })\n return true\n }\n\n private async confirmClipLoss(clips: FigureClipLoss[], again: () => void, asked: { session: FigureProductSession; context: string; revision: number }) {\n const agreed = await OxPrompt.open({\n type: 'warning',\n text: i18next.t('figure.text.clips-would-go', { clips: clips.map(c => i18next.t(`figure.text.clip-${c.why}`, { clip: c.clip })).join(', ') }),\n confirmButton: { text: i18next.t('figure.button.let-clips-go') },\n cancelButton: { text: i18next.t('figure.button.keep-editing') }\n })\n if (!agreed) return\n /* Changed while the person read -- another figure, or an edit in between: the consent was not for this; nothing is applied. */\n const now = this.of.session() === asked.session ? asked.session.read() : undefined\n if (!now || now.context !== asked.context || now.revision !== asked.revision) {\n this.of.refuse(i18next.t('figure.text.clips-consent-stale'))\n return\n }\n asked.session.withConsent({ dropClips: clips.map(c => c.id), context: asked.context, revision: asked.revision }, again)\n }\n\n private async ask(message: string, retry: Retry) {\n const agreed = await OxPrompt.open({\n type: 'question',\n text: message,\n confirmButton: { text: retry.label },\n cancelButton: { text: i18next.t('figure.button.keep-editing') }\n })\n if (!agreed) return\n if (retry.run) retry.run()\n else this.of.command(retry.action!)\n }\n}\n"]}
|
|
@@ -30,8 +30,12 @@ export declare class FigureListPage extends FigureListPageBase {
|
|
|
30
30
|
static styles: import("lit").CSSResult[];
|
|
31
31
|
gristConfig: any;
|
|
32
32
|
private grist;
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The domain's own figures, or other domains' public ones (LV figure-server design G2), read only. Each is a screen
|
|
35
|
+
* of its own on the rail (user 2026-10-19): the own catalogue is where figures are made and changed, the public one
|
|
36
|
+
* only looked at, so a switch inside one list mixed two jobs. `figure-public-list-page` sets it.
|
|
37
|
+
*/
|
|
38
|
+
protected readonly scope: 'own' | 'public';
|
|
35
39
|
private listen?;
|
|
36
40
|
get context(): {
|
|
37
41
|
title: string;
|
|
@@ -72,7 +76,6 @@ export declare class FigureListPage extends FigureListPageBase {
|
|
|
72
76
|
}>;
|
|
73
77
|
/** The modeller that can edit this figure, by its format; a new figure starts in (`modeller-route.ts`). */
|
|
74
78
|
private openModeller;
|
|
75
|
-
private toggleScope;
|
|
76
79
|
/** `remove` 는 HTMLElement 의 메서드다 — 가리면 조용한 결함이 된다. */
|
|
77
80
|
private removeFigure;
|
|
78
81
|
}
|
|
@@ -2,8 +2,8 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import '@operato/data-grist';
|
|
3
3
|
import '@material/web/icon/icon.js';
|
|
4
4
|
import '../viewparts/figure-thumb.js';
|
|
5
|
-
import { css, html } from 'lit';
|
|
6
|
-
import { customElement, property, query
|
|
5
|
+
import { css, html, nothing } from 'lit';
|
|
6
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { p13n } from '@operato/p13n';
|
|
9
9
|
import { auth } from '@things-factory/auth-base/dist-client';
|
|
@@ -72,7 +72,11 @@ const FigureListPageBase = p13n(localize(i18next)(PageView));
|
|
|
72
72
|
let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
73
73
|
constructor() {
|
|
74
74
|
super(...arguments);
|
|
75
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* The domain's own figures, or other domains' public ones (LV figure-server design G2), read only. Each is a screen
|
|
77
|
+
* of its own on the rail (user 2026-10-19): the own catalogue is where figures are made and changed, the public one
|
|
78
|
+
* only looked at, so a switch inside one list mixed two jobs. `figure-public-list-page` sets it.
|
|
79
|
+
*/
|
|
76
80
|
this.scope = 'own';
|
|
77
81
|
this.cardsChanged = () => {
|
|
78
82
|
if (this.active)
|
|
@@ -96,23 +100,6 @@ let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
|
96
100
|
카드 · 그림 칸 · 만들기 FAB 는 모든 카드 카탈로그와 같다(@operato/styles CardCatalogStyles,
|
|
97
101
|
ADR-0117 개정 2026-10-13). 여기에는 이 화면에만 있는 것만 둔다.
|
|
98
102
|
*/
|
|
99
|
-
/* Which figures are listed: quiet words beside the filters, coloured when they are on. */
|
|
100
|
-
button[scope] {
|
|
101
|
-
font: inherit;
|
|
102
|
-
padding: 0 8px;
|
|
103
|
-
border: none;
|
|
104
|
-
background: none;
|
|
105
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
106
|
-
cursor: pointer;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
}
|
|
109
|
-
button[scope]:hover {
|
|
110
|
-
color: var(--md-sys-color-on-surface);
|
|
111
|
-
}
|
|
112
|
-
button[scope][aria-pressed='true'] {
|
|
113
|
-
color: var(--md-sys-color-primary);
|
|
114
|
-
font-weight: 600;
|
|
115
|
-
}
|
|
116
103
|
ox-grist {
|
|
117
104
|
/* 상태와 성숙도는 짧은 표식이다 — 두 줄로 세우지 않고 한 줄에 뉜다 */
|
|
118
105
|
--data-card-detail-direction: row;
|
|
@@ -123,7 +110,7 @@ let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
|
123
110
|
]; }
|
|
124
111
|
get context() {
|
|
125
112
|
return {
|
|
126
|
-
title: i18next.t('figure.title.figures'),
|
|
113
|
+
title: i18next.t(this.scope === 'public' ? 'figure.title.public-figures' : 'figure.title.figures'),
|
|
127
114
|
search: {
|
|
128
115
|
handler: (search) => {
|
|
129
116
|
this.grist.searchText = search;
|
|
@@ -159,15 +146,16 @@ let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
|
159
146
|
<div class="filters">
|
|
160
147
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
161
148
|
</div>
|
|
162
|
-
<button scope aria-pressed=${String(this.scope === 'public')} @click=${() => this.toggleScope()}>${i18next.t('figure.button.public-figures')}</button>
|
|
163
149
|
</div>
|
|
164
150
|
|
|
165
151
|
<ox-grist-personalizer slot="setting"></ox-grist-personalizer>
|
|
166
152
|
</ox-grist>
|
|
167
153
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
154
|
+
${this.scope === 'own'
|
|
155
|
+
? html `<button fab title=${i18next.t('figure.button.new-figure')} @click=${() => this.openModeller()}>
|
|
156
|
+
<md-icon>add</md-icon>${i18next.t('figure.button.new-figure')}
|
|
157
|
+
</button>`
|
|
158
|
+
: nothing}
|
|
171
159
|
`;
|
|
172
160
|
}
|
|
173
161
|
/**
|
|
@@ -321,15 +309,18 @@ let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
|
321
309
|
이름표는 비워 둔다. 단추에 「초안」·「발행됨」이라고 적혀 있으니 그 앞의 「상태」는
|
|
322
310
|
같은 말을 한 번 더 하는 것이고, 걸러 보기 줄에서 자리만 먹는다.
|
|
323
311
|
*/
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
312
|
+
/* Another domain's public figures are released ones only: no draft to tell apart, no choice to offer. */
|
|
313
|
+
filter: this.scope === 'own'
|
|
314
|
+
? {
|
|
315
|
+
type: 'select-buttons',
|
|
316
|
+
operator: 'in',
|
|
317
|
+
label: '',
|
|
318
|
+
options: [
|
|
319
|
+
{ display: i18next.t('figure.label.draft'), value: 'draft' },
|
|
320
|
+
{ display: i18next.t('figure.label.figure-released'), value: 'released' }
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
: undefined,
|
|
333
324
|
width: 120
|
|
334
325
|
},
|
|
335
326
|
{
|
|
@@ -524,10 +515,6 @@ let FigureListPage = class FigureListPage extends FigureListPageBase {
|
|
|
524
515
|
openModeller(figure) {
|
|
525
516
|
navigate(modellerPathOf(figure));
|
|
526
517
|
}
|
|
527
|
-
toggleScope() {
|
|
528
|
-
this.scope = this.scope === 'public' ? 'own' : 'public';
|
|
529
|
-
this.grist?.fetch();
|
|
530
|
-
}
|
|
531
518
|
/** `remove` 는 HTMLElement 의 메서드다 — 가리면 조용한 결함이 된다. */
|
|
532
519
|
async removeFigure(figure) {
|
|
533
520
|
if (this.scope === 'public')
|
|
@@ -559,10 +546,6 @@ __decorate([
|
|
|
559
546
|
query('ox-grist'),
|
|
560
547
|
__metadata("design:type", Function)
|
|
561
548
|
], FigureListPage.prototype, "grist", void 0);
|
|
562
|
-
__decorate([
|
|
563
|
-
state(),
|
|
564
|
-
__metadata("design:type", String)
|
|
565
|
-
], FigureListPage.prototype, "scope", void 0);
|
|
566
549
|
FigureListPage = __decorate([
|
|
567
550
|
customElement('figure-list-page')
|
|
568
551
|
], FigureListPage);
|