@things-factory/figure-ui 10.1.48 → 10.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/client/modeller/figure-v3-parts.ts +85 -10
  2. package/client/modeller/side-panel-styles.ts +8 -0
  3. package/client/modeller/v3-canvas.ts +25 -5
  4. package/client/modeller/v3-editor.ts +159 -22
  5. package/client/modeller/v3-fields.ts +15 -1
  6. package/client/modeller/v3-stage-model.ts +24 -0
  7. package/dist-client/modeller/figure-v3-parts.d.ts +13 -0
  8. package/dist-client/modeller/figure-v3-parts.js +80 -10
  9. package/dist-client/modeller/figure-v3-parts.js.map +1 -1
  10. package/dist-client/modeller/side-panel-styles.js +8 -0
  11. package/dist-client/modeller/side-panel-styles.js.map +1 -1
  12. package/dist-client/modeller/v3-canvas.d.ts +2 -0
  13. package/dist-client/modeller/v3-canvas.js +27 -5
  14. package/dist-client/modeller/v3-canvas.js.map +1 -1
  15. package/dist-client/modeller/v3-clips.d.ts +1 -1
  16. package/dist-client/modeller/v3-editor.d.ts +19 -0
  17. package/dist-client/modeller/v3-editor.js +160 -20
  18. package/dist-client/modeller/v3-editor.js.map +1 -1
  19. package/dist-client/modeller/v3-fields.d.ts +6 -0
  20. package/dist-client/modeller/v3-fields.js +14 -2
  21. package/dist-client/modeller/v3-fields.js.map +1 -1
  22. package/dist-client/modeller/v3-stage-model.d.ts +8 -0
  23. package/dist-client/modeller/v3-stage-model.js +26 -0
  24. package/dist-client/modeller/v3-stage-model.js.map +1 -1
  25. package/dist-client/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +5 -5
  27. package/test/v3-fields.test.ts +37 -1
  28. package/test/v3-gizmo.test.ts +3 -1
  29. package/test/v3-maturity.test.ts +1 -1
  30. package/translations/en.json +11 -1
  31. package/translations/ja.json +11 -1
  32. package/translations/ko.json +11 -1
  33. package/translations/ms.json +11 -1
  34. package/translations/zh.json +11 -1
@@ -1 +1 @@
1
- {"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K,EAAE;;4CAAwC;AAzNrC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAs2B1B","sourcesContent":["import { LitElement, html, css, nothing, type PropertyValues } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport type { OxThreePane } from '@operato/layout'\nimport '@operato/layout'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport type { V3Asset, V3AuthoringAction, V3InputChange, V3PartEdit, V3PrimitiveCreation } from '@hatiolab/figure-model'\nimport type { V3ProductSession } from './v3-product-session.js'\nimport { captureV3Thumbnail } from './v3-thumbnail.js'\nimport { drawableV3Parts } from './v3-renderer.js'\nimport './v3-canvas.js'\nimport './figure-v3-parts.js'\nimport './figure-v3-material.js'\nimport './figure-v3-links.js'\nimport './figure-v3-controls.js'\nimport './figure-v3-clips.js'\nimport './figure-v3-preview.js'\nimport './figure-settings.js'\nimport { DEFAULT_VIEW, type ViewSettings } from './figure-view.js'\nimport './figure-v3-capability.js'\nimport { gizmoChanges, gizmoReachOf, type GizmoReach, type GizmoResult } from './v3-gizmo.js'\nimport { keyActionOf } from './v3-keys.js'\nimport { groupFields, partLabelOf, repeatOf, type FieldLike, type FieldGroup } from './v3-fields.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { alignChanges, boxOf, canMirror, mirrorChanges, type AlignTool } from './v3-align.js'\nimport type { V3PaletteKind, V3PartRow } from './figure-v3-parts.js'\nimport { paletteRecipe } from './v3-palette.js'\nimport type { FigureV3Canvas } from './v3-canvas.js'\nimport type { V3BudgetLine } from './v3-maturity.js'\nimport { instanceRangeOf, rangeDiffers, turnsAboutAJoint } from './v3-links.js'\nimport { jointFanOf } from './v3-joint-fan.js'\nimport { isLive, livePartsOf, NOTHING_LIVE, scrubbed, scrubStep, type LiveValues } from './v3-live.js'\n\n\n/**\n * The side's tabs, V2's six in V2's order where V3 has them: properties, what it does (places), motion, the verdict,\n * the release history. A figure-level tab (verdict, history) gives way to properties when a part is chosen; a tab about\n * parts keeps showing the newly chosen part.\n */\ntype SideTab = 'properties' | 'capability' | 'motion' | 'verdict' | 'view' | 'history'\n\n/** Product editor surface. The injected session is shared by page persistence and AI commands. */\n@customElement('figure-v3-editor')\nexport class FigureV3Editor extends LitElement {\n static styles = [SidePanelStyles, css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n /* The editor folds by the width it is given, not the window's (UX ruling, 2026-09-24). */\n container-type: inline-size;\n font: 13px sans-serif;\n color: var(--md-sys-color-on-surface);\n }\n /* The bar over the work is ox-canvas-bar (ADR-0060 decision 8): the folds at its edges, undo, redo and\n fit in the suite's places. What the editor puts in it - the mode switch, the status, save - is styled here. */\n ox-canvas-bar button[mode] {\n height: 28px;\n padding: 0 10px;\n border-radius: 999em;\n border-color: transparent;\n background: none;\n }\n ox-canvas-bar button[mode][aria-pressed='true'] {\n border-color: var(--md-sys-color-primary);\n }\n figure-v3-preview {\n min-width: 0;\n min-height: 0;\n }\n ox-canvas-bar .status {\n padding: 0 8px;\n color: var(--md-sys-color-on-surface-variant);\n }\n ox-canvas-bar .status[dirty] {\n color: var(--md-sys-color-primary);\n font-weight: 600;\n }\n ox-canvas-bar button[save] {\n height: 32px;\n padding: 0 14px;\n border: none;\n border-radius: 999em;\n color: var(--md-sys-color-on-primary);\n background: var(--md-sys-color-primary);\n }\n /* The three panes are ox-three-pane's (ADR-0060 decision 8): widths 200 | 1fr | 340, 160 | 300 under\n 860px and one column with the middle first under 560px are the frame's, as are the dividers. */\n ox-three-pane {\n flex: 1;\n min-height: 0;\n }\n figure-v3-parts {\n min-height: 0;\n }\n figure-v3-canvas {\n min-width: 0;\n min-height: 0;\n }\n /* The side: tabs over one panel at a time, each using the whole height (V2's side, and why it had tabs). */\n aside {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--md-sys-color-surface-container-lowest);\n }\n div[tabs] {\n display: flex;\n flex: none;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n button[tab] {\n flex: 1;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 38px;\n padding: 0;\n border: none;\n border-radius: 0;\n border-bottom: 2px solid transparent;\n background: none;\n color: var(--md-sys-color-on-surface-variant);\n }\n button[tab]:hover:not([on]) {\n background: var(--md-sys-color-surface-container);\n }\n button[tab][on] {\n color: var(--md-sys-color-primary);\n border-bottom-color: var(--md-sys-color-primary);\n }\n button[tab] md-icon {\n font-size: 20px;\n width: 20px;\n height: 20px;\n }\n span[badge] {\n position: absolute;\n top: 3px;\n right: 2px;\n padding: 0 5px;\n font-size: 0.62rem;\n font-weight: 700;\n line-height: 1.5;\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border-radius: 999em;\n pointer-events: none;\n }\n /* The sections inside carry the margins (side-panel-styles); the panel only scrolls. */\n div[panel] {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 0;\n }\n div[panel][flush] {\n padding: 0;\n }\n /* Hidden, not removed: a panel keeps what it holds (the verdict its last answer) while another tab is open. */\n [off] {\n display: none !important;\n }\n /* Which part the panel speaks of, and the way back to the whole figure. */\n div[subject] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 10px 0;\n }\n div[subject] button[chip] {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n height: 26px;\n padding: 0 10px 0 6px;\n border-radius: 999em;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[subject] md-icon {\n font-size: 16px;\n width: 16px;\n height: 16px;\n }\n button {\n font: inherit;\n box-sizing: border-box;\n height: 32px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n background: var(--md-sys-color-surface);\n color: inherit;\n padding: 0 8px;\n min-width: 0;\n }\n button {\n cursor: pointer;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n button[aria-pressed='true'] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n border-color: var(--md-sys-color-primary);\n }\n .error {\n padding: 10px;\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n white-space: pre-wrap;\n }\n .hint {\n color: var(--md-sys-color-on-surface-variant);\n line-height: 1.5;\n }\n `]\n @property({ attribute: false }) session?: V3ProductSession\n @property({ type: Number }) revision = 0\n /** The verdict's count, drawn on its tab so it stays in sight while another tab is open (V2's badge). */\n @property({ type: Number }) instances?: number\n /** The cost line the parts list shows, from the maturity report. */\n @property({ attribute: false }) budget?: V3BudgetLine\n @state() private selected = ''\n @state() private error = ''\n @state() private tab: SideTab = 'properties'\n /** The frame the bar folds - found after the first render, since the bar is drawn before it. */\n @state() private panes?: OxThreePane\n /** What the middle shows: the parts being edited, or the figure placed on a board at eight sizes (V2's two modes). */\n @state() private middle: 'edit' | 'preview' = 'edit'\n /**\n * How the workbench shows the figure -- V2's view settings, the board's own state names. The viewer's, kept in\n * their browser, never in the figure.\n */\n @state() private view: ViewSettings = FigureV3Editor.storedView()\n private static storedView(): ViewSettings {\n try {\n const stored = JSON.parse(localStorage.getItem('figure-v3-view') ?? 'null')\n return stored && typeof stored === 'object' ? { ...DEFAULT_VIEW, ...stored } : { ...DEFAULT_VIEW }\n } catch {\n return { ...DEFAULT_VIEW }\n }\n }\n private setView(view: ViewSettings) {\n this.view = { ...DEFAULT_VIEW, ...view }\n try {\n localStorage.setItem('figure-v3-view', JSON.stringify(this.view))\n } catch {\n /* A browser that keeps nothing still shows the change for this visit. */\n }\n }\n /**\n * Parts hidden on the workbench — the author's view while working, not the asset's visibility. Not saved, as in\n * the V2 modeller: a part hidden here is still in the figure, still checked, still drawn on a board.\n */\n @state() private hiddenParts = new Set<string>()\n /** A value in hand -- typed, held on a spinner, scrubbed, dragged -- drawn at once and recorded on release. */\n @state() private live: LiveValues = NOTHING_LIVE\n private lastContext: string | null = null\n /** The modeller's keys (`v3-keys.ts`): undo, redo, duplicate, remove, back to the whole figure. */\n private onKey = (e: KeyboardEvent) => {\n const view = this.session?.read()\n if (!view || view.loading || view.saving || !view.context || !this.isConnected) return\n const action = keyActionOf({ key: e.key, ctrlKey: e.ctrlKey, metaKey: e.metaKey, shiftKey: e.shiftKey, altKey: e.altKey, target: e.composedPath()[0] as HTMLElement }, this.selected)\n if (!action) return\n e.preventDefault()\n if (action === 'undo') view.canUndo && this.run(() => this.session!.undo())\n else if (action === 'redo') view.canRedo && this.run(() => this.session!.redo())\n else if (action === 'duplicate') this.duplicatePart(this.selected)\n else if (action === 'remove') this.removePart(this.selected)\n else this.selected = ''\n }\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('keydown', this.onKey)\n }\n disconnectedCallback() {\n window.removeEventListener('keydown', this.onKey)\n super.disconnectedCallback()\n }\n protected willUpdate(_changed: PropertyValues) {\n const view = this.session?.read()\n if (view?.context !== this.lastContext) {\n this.lastContext = view?.context ?? null\n this.selected = ''\n this.error = ''\n this.hiddenParts = new Set()\n }\n if (view && !view.geometry.some(g => g.id === this.selected)) this.selected = ''\n }\n private run(action: () => unknown) {\n try {\n action()\n this.error = ''\n this.changed()\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error)\n } finally {\n /* Committed or refused, the value in hand is gone: the figure as it stands is drawn again. */\n this.live = NOTHING_LIVE\n }\n }\n /** What the canvas draws: the figure with the value in hand when there is one, and without the parts hidden on the workbench. */\n private drawnParts(geometry: Parameters<typeof drawableV3Parts>[0] | undefined, asset: unknown) {\n const parts = (isLive(this.live) && asset ? livePartsOf(asset as V3Asset, this.live) : null) ?? drawableV3Parts(geometry ?? [])\n return parts.filter(body => !this.hiddenParts.has((body as { id: string }).id))\n }\n /**\n * Where the selected part turns and how far, with the pose as it is drawn now -- a value in hand included, so the\n * fan follows the arm while a control is dragged. Its size comes from what the joint turns (`v3-joint-fan`).\n */\n private fanOf(asset: V3Asset | undefined) {\n if (!asset || !this.selected || this.hiddenParts.has(this.selected)) return null\n try {\n return jointFanOf(asset, this.selected, this.live.values)\n } catch {\n return null\n }\n }\n /** A value in hand: an input's value (design or pose) or a part edit. Nothing is recorded. */\n private hold(values: Record<string, number>, edit?: V3PartEdit) {\n this.live = { values: { ...this.live.values, ...values }, ...(edit ? { edit } : this.live.edit ? { edit: this.live.edit } : {}) }\n }\n private changed() {\n this.requestUpdate()\n this.dispatchEvent(new CustomEvent('v3-changed', { bubbles: true, composed: true }))\n }\n private async save() {\n if (!this.session) return\n try {\n /*\n The card's picture is taken before the save starts, from a canvas of its own at the card's size —\n not from the one on screen, which stands wherever the author left it turned. A picture that cannot\n be taken is not an error: the save goes on without it (see `v3-thumbnail.ts`).\n */\n const view = this.session.read()\n const thumbnail = await captureV3Thumbnail(drawableV3Parts(view.geometry ?? []), view.palette ?? {})\n const promise = this.session.save({ thumbnail })\n this.changed()\n await promise\n this.error = ''\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error)\n } finally {\n this.changed()\n }\n }\n private add(kind: V3PaletteKind) {\n if (!this.session) return\n this.run(() => {\n const ids = new Set(this.session!.read().geometry.map(g => g.id))\n let n = 1\n while (ids.has(`${kind}-${n}`)) n++\n const part = paletteRecipe(kind, `${kind}-${n}`)\n this.session!.add(part)\n this.selected = part.id\n })\n }\n /**\n * The list's own operations, as V3 part edits — each one step of the session's history. The copy and the moved\n * part stay selected, as they do in the V2 list.\n */\n private duplicatePart(id: string) {\n this.run(() => {\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n this.selected = this.session!.read().geometry.find(g => !before.has(g.id))?.id ?? id\n })\n }\n private movePart(id: string, to: number) {\n this.run(() => this.session!.edit({ kind: 'move-part', target: id, to }))\n }\n private removePart(id: string) {\n try {\n this.session!.edit({ kind: 'remove-part', target: id })\n this.error = ''\n if (this.selected === id) this.selected = ''\n this.changed()\n } catch (error) {\n /* The refusal a person meets most: another part stands on this one or follows its size. Said in their words. */\n this.error =\n (error as { code?: string })?.code === 'PART_REFERENCED'\n ? i18next.t('figure.text.part-is-referenced', { part: id })\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n private toggleHiddenPart(id: string) {\n const next = new Set(this.hiddenParts)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n this.hiddenParts = next\n }\n /** What the gizmo may write for the selected part — read off the asset being edited. */\n private reachOf(id: string): GizmoReach {\n const none = { translate: false, rotate: false, scale: false }\n if (!id || !this.session) return none\n try {\n return gizmoReachOf(JSON.parse(this.session.source()), id)\n } catch {\n return none\n }\n }\n /** A drag, written back as the part's own inputs — one step of the history, like typing the numbers. */\n private transformed(id: string, result: GizmoResult) {\n const view = this.session!.read()\n const sizes = Object.fromEntries(view.fields.map(field => [field.id, field.value as number]))\n const changes = gizmoChanges(id, this.reachOf(id), result, sizes)\n if (changes.length) this.run(() => this.session!.apply(changes))\n else this.requestUpdate()\n }\n /** 맞추기 — one tool, one step of the history, through the same inputs as the gizmo. */\n private align(tool: AlignTool) {\n this.run(() => {\n const asset = JSON.parse(this.session!.source())\n const changes = alignChanges(asset, this.selected, this.reachOf(this.selected), tool)\n if (changes.length) this.session!.apply(changes)\n })\n }\n /** A mirrored copy: duplicate, then place the copy on the other side — two steps, as the V2 list makes it. */\n private mirror(axis: 'x' | 'z') {\n this.run(() => {\n const id = this.selected\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n const copy = this.session!.read().geometry.find(g => !before.has(g.id))?.id\n if (!copy) return\n this.session!.apply(mirrorChanges(JSON.parse(this.session!.source()), id, copy, axis))\n this.selected = copy\n })\n }\n private renderTools(unavailable: boolean) {\n const reach = this.reachOf(this.selected)\n if (!this.selected || !reach.translate) return null\n let asset: unknown\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const tool = (name: AlignTool, icon: string, label: string, title: string) =>\n html`<button ?disabled=${unavailable} aria-label=${i18next.t(label)} title=${i18next.t(title)} @click=${() => this.align(name)}>\n <md-icon>${icon}</md-icon>\n </button>`\n return html`<div tools title=${i18next.t('figure.text.tools-explained')}>\n ${tool('centre-x', 'horizontal_distribute', 'figure.button.center-x', 'figure.text.center-on-x')}\n ${tool('centre-z', 'vertical_align_center', 'figure.button.center-z', 'figure.text.center-on-z')}\n ${tool('floor', 'vertical_align_bottom', 'figure.button.to-floor', 'figure.text.put-on-floor')}\n ${(['x', 'z'] as const).map(axis => {\n const able = canMirror(asset as never, this.selected, axis, reach)\n return html`<button\n ?disabled=${unavailable || !able}\n aria-label=${i18next.t('figure.button.mirror-' + axis)}\n title=${i18next.t(able ? 'figure.text.mirror-explained' : 'figure.text.mirror-would-overlap')}\n @click=${() => this.mirror(axis)}\n >\n <md-icon>${axis === 'x' ? 'flip' : 'flip_camera_android'}</md-icon>\n </button>`\n })}\n ${tool('snap', 'grid_on', 'figure.button.snap', 'figure.text.snap-explained')}\n </div>`\n }\n /**\n * A part's name — the V2 part name field. It renames every value the part owns, and what refers to them follows\n * (figure-model's rename-part), as one step of the history.\n */\n /**\n * A repeated body is one of its repeat's copies and is named after it -- the list and this field read `roller 15`, not\n * its path through the repeat (user, 2026-09-24: 「부품 이름 ???」). A copy has no name of its own to change.\n */\n private renderRepeatNote(geometry: readonly unknown[] | undefined) {\n const repeat = repeatOf(this.selected, geometry)\n return repeat ? html`<p hint>${i18next.t('figure.text.repeat-member', { name: repeat.name, count: repeat.count, index: repeat.index })}</p>` : nothing\n }\n private renamePart(input: HTMLInputElement) {\n const name = input.value.trim()\n const from = this.selected\n if (!name || name === from) {\n input.value = from\n return\n }\n try {\n this.session!.edit({ kind: 'rename-part', target: from, name })\n this.selected = name\n this.error = ''\n this.changed()\n } catch (error) {\n input.value = from\n const code = (error as { code?: string })?.code\n this.error =\n code === 'PART_ID'\n ? i18next.t(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? 'figure.text.part-name-taken' : 'figure.text.part-name-invalid', { name })\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n /** Size response, fastening and motion for the selected part (parity ④ ⑤ ⑥), as authoring commands. */\n private renderLinks(unavailable: boolean, section: 'shape' | 'places' | 'motion') {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n let dims: [number, number, number] | undefined\n try {\n dims = boxOf(asset, this.selected)?.dims\n } catch {\n dims = undefined\n }\n return html`<figure-v3-links\n .asset=${asset}\n .section=${section}\n .partId=${this.selected}\n .dims=${dims}\n ?locked=${unavailable}\n @v3-command=${(e: CustomEvent) => this.linkCommand(e.detail.action)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-links>`\n }\n /** The figure's controls: try a value, name it, set its range and travel time, keep the pose (parity row ⑥). */\n private renderControls(view: { fields: Array<{ id: string; role?: string; value: number }> }, unavailable: boolean) {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const values = Object.fromEntries(view.fields.filter(f => f.role === 'state').map(f => [f.id, f.value]))\n return html`<figure-v3-controls\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-state=${(e: CustomEvent) => this.run(() => this.session!.apply([{ kind: 'set-state', input: e.detail.input, unit: e.detail.unit, value: e.detail.value }]))}\n @v3-state-live=${(e: CustomEvent) => this.hold({ [e.detail.input]: e.detail.value })}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-controls>\n <figure-v3-clips\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-states=${(e: CustomEvent) => this.run(() => this.session!.apply(e.detail.changes))}\n @v3-states-live=${(e: CustomEvent) => this.hold(e.detail.values)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-clips>`\n }\n /** One command, one step of the history. A refusal a person can meet here is said in their words. */\n private linkCommand(action: V3AuthoringAction) {\n try {\n this.session!.command(action)\n this.error = ''\n this.changed()\n } catch (error) {\n const code = (error as { code?: string })?.code\n this.error =\n code === 'DIMENSION_CYCLE'\n ? i18next.t('figure.text.follow-would-loop')\n : code === 'FASTEN_CYCLE' || code === 'ATTACH_CYCLE'\n ? i18next.t('figure.text.fasten-would-loop')\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n private changeField(field: { id: string; unit: V3InputChange['unit']; role?: string }, event: Event) {\n const input = event.target as HTMLInputElement,\n value = input.valueAsNumber\n this.run(() =>\n this.session!.apply([\n { kind: field.role === 'state' ? 'set-state' : 'set-design', input: field.id, unit: field.unit, value }\n ])\n )\n // Rejected edits must also restore the displayed numeric value.\n input.value = String(this.session!.read().fields.find(i => i.id === field.id)!.value)\n }\n /** Typing or a held spinner: each number on the way is drawn; the field's change records it. */\n private typing(field: { id: string }, event: Event) {\n const value = (event.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(value)) this.hold({ [field.id]: value })\n }\n /**\n * Drag a field's label (or an axis letter) sideways to scrub its value, as vector tools do: the figure follows the\n * pointer, and the release records one step. The field's number follows too, so the value in hand is always read.\n */\n private scrub(field: { id: string; unit: V3InputChange['unit']; role?: string; value: number }, down: PointerEvent, unavailable: boolean) {\n if (unavailable || down.button !== 0) return\n const label = down.currentTarget as HTMLElement\n const input = (label.closest('div[cell]')?.querySelector('input') ?? label.nextElementSibling) as HTMLInputElement | null\n if (!input) return\n down.preventDefault()\n label.setPointerCapture(down.pointerId)\n const start = field.value\n let value = start\n const move = (e: PointerEvent) => {\n value = scrubbed(start, e.clientX - down.clientX, scrubStep(field.unit, start, e.shiftKey))\n input.value = String(value)\n this.hold({ [field.id]: value })\n }\n const up = (e: PointerEvent) => {\n label.removeEventListener('pointermove', move)\n label.removeEventListener('pointerup', up)\n label.removeEventListener('pointercancel', up)\n /* A drag the system took away is not the author's value: the field goes back to where it was. */\n if (e.type === 'pointercancel') value = start\n if (value === start) {\n input.value = String(start)\n this.live = NOTHING_LIVE\n return\n }\n input.value = String(value)\n this.changeField(field, { target: input } as unknown as Event)\n }\n label.addEventListener('pointermove', move)\n label.addEventListener('pointerup', up)\n label.addEventListener('pointercancel', up)\n }\n /** The measured range, kept for the revision it was measured at: measuring evaluates the figure at its edges. */\n private range?: { at: string; of: ReturnType<typeof instanceRangeOf> }\n /** The sizes a board may give the figure, and the way to measure them again after its parts changed. */\n private renderInstanceRange(asset: V3Asset | undefined, unavailable: boolean) {\n if (!asset) return nothing\n /* Another figure, or another step of this one, is measured again. */\n const at = `${this.session?.read().context ?? ''}:${this.revision}`\n if (this.range?.at !== at) {\n let of: ReturnType<typeof instanceRangeOf>\n try {\n of = instanceRangeOf(asset)\n } catch {\n of = undefined\n }\n this.range = { at, of }\n }\n const range = this.range.of\n if (!range) return nothing\n const mm = (v: number) => Math.round(v).toLocaleString()\n const differs = rangeDiffers(range.declared, range.measured)\n return html`<section>\n <h3>${i18next.t('figure.label.instance-range')}</h3>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div inline-field>\n <label>${axis.toUpperCase()}</label><span>${mm(range.declared[axis].min)} – ${mm(range.declared[axis].max)} mm</span>\n </div>`\n )}\n ${differs\n ? html`<p hint>\n ${i18next.t('figure.text.instance-range-can-widen', {\n ranges: (['x', 'y', 'z'] as const)\n .filter(axis => rangeDiffers(range.declared, { ...range.declared, [axis]: range.measured[axis] }))\n .map(axis => `${axis.toUpperCase()} ${mm(range.measured[axis].min)} – ${mm(range.measured[axis].max)}`)\n .join(' · ')\n })}\n </p>\n <button act ?disabled=${unavailable} @click=${() => this.linkCommand({ kind: 'declare-instance-size', range: range.measured, replace: true })}>\n <md-icon>straighten</md-icon>${i18next.t('figure.button.remeasure-range')}\n </button>`\n : nothing}\n ${this.renderSizingRule(asset, unavailable)}\n </section>`\n }\n /**\n * How the figure grows. One ratio (`sizing: 'uniform'`) is said as it is; a figure with joints that has not declared\n * it is offered it -- a mechanism does not shear -- and the author decides (chief architect's ruling 2026-09-24).\n */\n private renderSizingRule(asset: V3Asset, unavailable: boolean) {\n if (asset.sizing === 'uniform') return html`<div inline-field><label>${i18next.t('figure.label.sizing-rule')}</label><span>${i18next.t('figure.label.sizing-uniform')}</span></div>`\n return html`${turnsAboutAJoint(asset) ? html`<p hint>${i18next.t('figure.text.sizing-uniform-proposed')}</p>` : nothing}\n <button act ?disabled=${unavailable} title=${i18next.t('figure.text.sizing-uniform-explained')} @click=${() => this.linkCommand({ kind: 'scale-uniformly' })}>\n <md-icon>aspect_ratio</md-icon>${i18next.t('figure.button.scale-uniformly')}\n </button>`\n }\n /** Choose a part, from the list, the canvas or a place row. A figure-level tab gives way to the part's properties. */\n private choose(id: string) {\n this.selected = id\n if (id && (this.tab === 'verdict' || this.tab === 'view' || this.tab === 'history')) this.tab = 'properties'\n }\n private asset(): unknown {\n try {\n return JSON.parse(this.session!.source())\n } catch {\n return undefined\n }\n }\n private renderTab(tab: SideTab, icon: string, label: string, badge?: number) {\n return html`<button tab ?on=${this.tab === tab} title=${label} aria-label=${label} @click=${() => (this.tab = tab)}>\n <md-icon>${icon}</md-icon>${badge == null ? '' : html`<span badge>${badge.toLocaleString()}</span>`}\n </button>`\n }\n updated(changed: PropertyValues<this>) {\n super.updated?.(changed)\n const panes = this.renderRoot.querySelector<OxThreePane>('ox-three-pane') ?? undefined\n if (panes !== this.panes) this.panes = panes\n }\n /** Which part the panel speaks of, with the way back to the whole figure. */\n private renderSubject() {\n if (!this.selected) return null\n return html`<div subject>\n <button chip title=${i18next.t('figure.button.whole-figure')} @click=${() => (this.selected = '')}>\n <md-icon>arrow_back</md-icon>${i18next.t('figure.button.whole-figure')}\n </button>\n </div>`\n }\n render() {\n const view = this.session?.read()\n if (!view) return html`<p>${i18next.t('figure.text.opening-model')}</p>`\n const unavailable = view.loading || !!view.error || view.saving || !view.context\n const part = view.geometry.find(g => g.id === this.selected)\n /* The controls (state inputs) have their own place in the motion tab; these are the design values. */\n const design = view.fields.filter(i => i.role !== 'state')\n const own = design.filter(i => this.selected && i.id.startsWith(this.selected + '.'))\n const common = design.filter(i => !view.geometry.some(g => i.id.startsWith(g.id + '.')))\n const status = view.loading\n ? 'figure.text.loading-figure'\n : view.saving\n ? 'figure.text.saving-figure'\n : view.dirty || !view.id\n ? 'figure.text.unsaved-changes'\n : 'figure.text.saved'\n const asset = this.asset()\n const tab = this.tab\n return html`<ox-canvas-bar\n history\n fit\n undo-shortcut=\"Ctrl+Z\"\n redo-shortcut=\"Ctrl+Y\"\n ?can-undo=${!unavailable && view.canUndo}\n ?can-redo=${!unavailable && view.canRedo}\n .pane=${this.panes}\n @canvas-undo=${() => this.run(() => this.session!.undo())}\n @canvas-redo=${() => this.run(() => this.session!.redo())}\n @canvas-fit=${() => this.renderRoot.querySelector<FigureV3Canvas>('figure-v3-canvas')?.fit()}\n >\n ${(['edit', 'preview'] as const).map(\n mode => html`<button slot=\"mode\" mode aria-pressed=${String(this.middle === mode)} title=${i18next.t('figure.text.mode-' + mode + '-explained')} @click=${() => (this.middle = mode)}>\n ${i18next.t('figure.label.mode-' + mode)}\n </button>`\n )}\n <span slot=\"status\" class=\"status\" role=\"status\" ?dirty=${status === 'figure.text.unsaved-changes'}>${i18next.t(status)}</span>\n <button slot=\"commit\" save ?disabled=${unavailable || (!view.dirty && !!view.id)} @click=${this.save}>${i18next.t('figure.button.save')}</button>\n </ox-canvas-bar>\n ${this.error || view.error ? html`<div role=\"alert\" class=\"error\">${this.error || view.error}</div>` : null}\n <ox-three-pane>\n <figure-v3-parts\n slot=\"start\"\n .budget=${this.budget}\n @show-maturity=${() => (this.tab = 'verdict')}\n .parts=${view.geometry.map(\n (g): V3PartRow => ({\n id: g.id,\n provider: (g as { shape?: { provider?: string } }).shape?.provider ?? '',\n hidden: this.hiddenParts.has(g.id),\n invisible: (g as { visible?: boolean }).visible === false\n })\n )}\n .selected=${this.selected}\n ?locked=${unavailable}\n @add-part=${(e: CustomEvent) => this.add(e.detail.kind)}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @toggle-part-hidden=${(e: CustomEvent) => this.toggleHiddenPart(e.detail.id)}\n @set-all-parts-hidden=${(e: CustomEvent) =>\n (this.hiddenParts = e.detail.hidden ? new Set(view.geometry.map(g => g.id)) : new Set())}\n @move-part-up=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @move-part-down=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @duplicate-part=${(e: CustomEvent) => this.duplicatePart(e.detail.id)}\n @remove-part=${(e: CustomEvent) => this.removePart(e.detail.id)}\n ></figure-v3-parts>\n ${this.middle === 'preview'\n ? html`<figure-v3-preview\n .asset=${asset}\n .context=${view.context ?? ''}\n .view=${this.view}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-preview>`\n : html`<figure-v3-canvas\n .view=${this.view}\n .parts=${this.drawnParts(view.geometry, asset)}\n .fan=${this.fanOf(asset as V3Asset | undefined)}\n .palette=${view.palette ?? {}}\n .context=${view.context ?? ''}\n .selected=${this.selected}\n .reach=${unavailable ? { translate: false, rotate: false, scale: false } : this.reachOf(this.selected)}\n @part-transformed=${(e: CustomEvent) => this.transformed(e.detail.id, e.detail.result)}\n @part-selected=${(e: CustomEvent<string>) => this.choose(e.detail)}\n @render-error=${(e: CustomEvent<Error>) => {\n this.error = e.detail.message\n }}\n ></figure-v3-canvas>`}\n <aside slot=\"end\">\n <div tabs>\n ${this.renderTab('properties', 'tune', i18next.t('figure.label.properties'))}\n ${this.renderTab('capability', 'conveyor_belt', i18next.t('figure.label.tab-capability'))}\n ${this.renderTab('motion', 'animation', i18next.t('figure.label.motion'))}\n ${this.renderTab('verdict', 'insights', i18next.t('figure.label.maturity'), this.instances)}\n ${this.renderTab('view', 'wb_sunny', i18next.t('figure.label.tab-environment'))}\n ${this.renderTab('history', 'history', i18next.t('figure.label.history'))}\n </div>\n <slot name=\"notice\"></slot>\n <div panel ?off=${tab !== 'properties'}>\n ${this.selected && part\n ? html`${this.renderSubject()}\n <section>\n <h3>${i18next.t('figure.label.group-part')}</h3>\n <div inline-field>\n <label>${i18next.t('figure.label.name')}</label>\n <input\n name-field\n aria-label=${i18next.t('figure.label.name')}\n .value=${partLabelOf(this.selected)}\n ?disabled=${unavailable || !!repeatOf(this.selected, view.geometry)}\n @change=${(e: Event) => this.renamePart(e.target as HTMLInputElement)}\n />\n </div>\n ${this.renderRepeatNote(view.geometry)}\n </section>\n ${this.renderGroups(groupFields(design, this.selected), 'figure.label.group-placement-size', 'figure.label.group-shape', unavailable, this.renderTools(unavailable))}\n ${this.renderLinks(unavailable, 'shape')}\n <figure-v3-material\n .body=${part}\n .palette=${view.palette ?? {}}\n ?locked=${unavailable}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n @v3-part-live=${(e: CustomEvent) => this.hold({}, e.detail.edit)}\n ></figure-v3-material>`\n : html`<slot name=\"figure\"></slot>\n ${this.renderGroups(groupFields(common), 'figure.label.group-figure-size', 'figure.label.design-inputs', unavailable)}\n ${this.renderInstanceRange(asset as V3Asset | undefined, unavailable)}`}\n </div>\n <div panel ?off=${tab !== 'capability'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'places') : null}\n <figure-v3-capability\n .asset=${asset}\n .selected=${this.selected}\n ?locked=${unavailable}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-capability>\n </div>\n <div panel ?off=${tab !== 'motion'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'motion') : html`<section><p hint>${i18next.t('figure.text.choose-a-part-to-move')}</p></section>`}\n ${this.renderControls(view, unavailable)}\n </div>\n <div panel flush ?off=${tab !== 'verdict'}><slot name=\"verdict\"></slot></div>\n <div panel flush ?off=${tab !== 'view'}>\n <figure-settings .view=${this.view} @update-view=${(e: CustomEvent) => this.setView(e.detail.view)}></figure-settings>\n </div>\n <div panel flush ?off=${tab !== 'history'}><slot name=\"history\"></slot></div>\n </aside>\n </ox-three-pane>`\n }\n /** Position, rotation and size as rows of three cells; the shape's own measures one to a line, under their title. */\n private renderGroups(\n groups: { vectors: FieldGroup[]; singles: FieldGroup[] },\n vectorTitle: string,\n singleTitle: string,\n unavailable: boolean,\n tools: unknown = null\n ) {\n return html`${groups.vectors.length || tools\n ? html`<section>\n <h3>${i18next.t(vectorTitle)}</h3>\n ${groups.vectors.map(g => this.renderVector(g, unavailable))}\n ${tools ? html`<div vector-row><label>${i18next.t('figure.label.tools')}</label>${tools}</div>` : nothing}\n </section>`\n : nothing}\n ${groups.singles.length\n ? html`<section>\n <h3>${i18next.t(singleTitle)}</h3>\n <div form>${groups.singles.map(g => (g.kind === 'single' ? this.renderSingle(g.name, g.field, unavailable) : nothing))}</div>\n </section>`\n : nothing}`\n }\n private renderVector(group: FieldGroup, unavailable: boolean) {\n if (group.kind !== 'vector') return nothing\n const unit = group.cells.x.unit === 'deg' ? '°' : group.cells.x.unit\n return html`<div vector-row>\n <label>${i18next.t('figure.label.group-' + group.name)}${group.name === 'rotation' ? '' : html` <span unit>${unit}</span>`}</label>\n <div triple>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div cell>\n <span axis ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(group.cells[axis] as never, e, unavailable)}>${axis.toUpperCase()}</span>\n <input\n aria-label=${group.cells[axis].id}\n type=\"number\"\n step=\"any\"\n .value=${String(group.cells[axis].value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(group.cells[axis] as never, e)}\n @change=${(e: Event) => this.changeField(group.cells[axis] as never, e)}\n />\n </div>`\n )}\n </div>\n </div>`\n }\n private renderSingle(name: string, field: FieldLike, unavailable: boolean) {\n const words = name.split('.').map(part => i18next.t('figure.label.field-' + part, { defaultValue: part }))\n return html`<span ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(field as never, e, unavailable)}>${words.join(' · ')} (${field.unit})</span\n ><input\n aria-label=${field.id}\n type=\"number\"\n step=\"any\"\n .value=${String(field.value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(field as never, e)}\n @change=${(e: Event) => this.changeField(field as never, e)}\n />`\n }\n}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;AAE/B;IAAhB,KAAK,EAAE;;4CAAwC;AAzNrC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4+B1B","sourcesContent":["import { LitElement, html, css, nothing, type PropertyValues } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport type { OxThreePane } from '@operato/layout'\nimport '@operato/layout'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { PART_LIMIT, v3PartCountOf } from '@hatiolab/figure-model'\nimport type { V3Asset, V3AuthoringAction, V3InputChange, V3PartEdit, V3PrimitiveCreation } from '@hatiolab/figure-model'\nimport type { V3ProductSession } from './v3-product-session.js'\nimport { captureV3Thumbnail } from './v3-thumbnail.js'\nimport { drawableV3Parts } from './v3-renderer.js'\nimport './v3-canvas.js'\nimport './figure-v3-parts.js'\nimport './figure-v3-material.js'\nimport './figure-v3-links.js'\nimport './figure-v3-controls.js'\nimport './figure-v3-clips.js'\nimport './figure-v3-preview.js'\nimport './figure-settings.js'\nimport { DEFAULT_VIEW, type ViewSettings } from './figure-view.js'\nimport './figure-v3-capability.js'\nimport { gizmoChanges, gizmoReachOf, type GizmoReach, type GizmoResult } from './v3-gizmo.js'\nimport { keyActionOf } from './v3-keys.js'\nimport { groupFields, ownerOf, partLabelOf, repeatOf, type FieldLike, type FieldGroup } from './v3-fields.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { alignChanges, boxOf, canMirror, mirrorChanges, type AlignTool } from './v3-align.js'\nimport type { V3PaletteKind, V3PartRow } from './figure-v3-parts.js'\nimport { paletteRecipe } from './v3-palette.js'\nimport type { FigureV3Canvas } from './v3-canvas.js'\nimport { nudgeOf } from './v3-stage-model.js'\nimport type { V3RenderPart } from './v3-renderer.js'\nimport type { V3BudgetLine } from './v3-maturity.js'\nimport { instanceRangeOf, rangeDiffers, turnsAboutAJoint } from './v3-links.js'\nimport { jointFanOf } from './v3-joint-fan.js'\nimport { isLive, livePartsOf, NOTHING_LIVE, scrubbed, scrubStep, type LiveValues } from './v3-live.js'\n\n\n/**\n * The side's tabs, V2's six in V2's order where V3 has them: properties, what it does (places), motion, the verdict,\n * the release history. A figure-level tab (verdict, history) gives way to properties when a part is chosen; a tab about\n * parts keeps showing the newly chosen part.\n */\ntype SideTab = 'properties' | 'capability' | 'motion' | 'verdict' | 'view' | 'history'\n\n/** Product editor surface. The injected session is shared by page persistence and AI commands. */\n@customElement('figure-v3-editor')\nexport class FigureV3Editor extends LitElement {\n static styles = [SidePanelStyles, css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n /* The editor folds by the width it is given, not the window's (UX ruling, 2026-09-24). */\n container-type: inline-size;\n font: 13px sans-serif;\n color: var(--md-sys-color-on-surface);\n }\n /* The bar over the work is ox-canvas-bar (ADR-0060 decision 8): the folds at its edges, undo, redo and\n fit in the suite's places. What the editor puts in it - the mode switch, the status, save - is styled here. */\n ox-canvas-bar button[mode] {\n height: 28px;\n padding: 0 10px;\n border-radius: 999em;\n border-color: transparent;\n background: none;\n }\n ox-canvas-bar button[mode][aria-pressed='true'] {\n border-color: var(--md-sys-color-primary);\n }\n figure-v3-preview {\n min-width: 0;\n min-height: 0;\n }\n ox-canvas-bar .status {\n padding: 0 8px;\n color: var(--md-sys-color-on-surface-variant);\n }\n ox-canvas-bar .status[dirty] {\n color: var(--md-sys-color-primary);\n font-weight: 600;\n }\n ox-canvas-bar button[save] {\n height: 32px;\n padding: 0 14px;\n border: none;\n border-radius: 999em;\n color: var(--md-sys-color-on-primary);\n background: var(--md-sys-color-primary);\n }\n /* The three panes are ox-three-pane's (ADR-0060 decision 8): widths 200 | 1fr | 340, 160 | 300 under\n 860px and one column with the middle first under 560px are the frame's, as are the dividers. */\n ox-three-pane {\n flex: 1;\n min-height: 0;\n }\n figure-v3-parts {\n min-height: 0;\n }\n figure-v3-canvas {\n min-width: 0;\n min-height: 0;\n }\n /* The side: tabs over one panel at a time, each using the whole height (V2's side, and why it had tabs). */\n aside {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--md-sys-color-surface-container-lowest);\n }\n div[tabs] {\n display: flex;\n flex: none;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n button[tab] {\n flex: 1;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 38px;\n padding: 0;\n border: none;\n border-radius: 0;\n border-bottom: 2px solid transparent;\n background: none;\n color: var(--md-sys-color-on-surface-variant);\n }\n button[tab]:hover:not([on]) {\n background: var(--md-sys-color-surface-container);\n }\n button[tab][on] {\n color: var(--md-sys-color-primary);\n border-bottom-color: var(--md-sys-color-primary);\n }\n button[tab] md-icon {\n font-size: 20px;\n width: 20px;\n height: 20px;\n }\n span[badge] {\n position: absolute;\n top: 3px;\n right: 2px;\n padding: 0 5px;\n font-size: 0.62rem;\n font-weight: 700;\n line-height: 1.5;\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border-radius: 999em;\n pointer-events: none;\n }\n /* The sections inside carry the margins (side-panel-styles); the panel only scrolls. */\n div[panel] {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 0;\n }\n div[panel][flush] {\n padding: 0;\n }\n /* Hidden, not removed: a panel keeps what it holds (the verdict its last answer) while another tab is open. */\n [off] {\n display: none !important;\n }\n /* Which part the panel speaks of, and the way back to the whole figure. */\n div[subject] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 10px 0;\n }\n div[subject] button[chip] {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n height: 26px;\n padding: 0 10px 0 6px;\n border-radius: 999em;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[subject] md-icon {\n font-size: 16px;\n width: 16px;\n height: 16px;\n }\n button {\n font: inherit;\n box-sizing: border-box;\n height: 32px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n background: var(--md-sys-color-surface);\n color: inherit;\n padding: 0 8px;\n min-width: 0;\n }\n button {\n cursor: pointer;\n }\n button:disabled {\n opacity: 0.45;\n cursor: default;\n }\n button[aria-pressed='true'] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n border-color: var(--md-sys-color-primary);\n }\n .error {\n padding: 10px;\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n white-space: pre-wrap;\n }\n .hint {\n color: var(--md-sys-color-on-surface-variant);\n line-height: 1.5;\n }\n `]\n @property({ attribute: false }) session?: V3ProductSession\n @property({ type: Number }) revision = 0\n /** The verdict's count, drawn on its tab so it stays in sight while another tab is open (V2's badge). */\n @property({ type: Number }) instances?: number\n /** The cost line the parts list shows, from the maturity report. */\n @property({ attribute: false }) budget?: V3BudgetLine\n @state() private selected = ''\n @state() private error = ''\n @state() private tab: SideTab = 'properties'\n /** The frame the bar folds - found after the first render, since the bar is drawn before it. */\n @state() private panes?: OxThreePane\n /** What the middle shows: the parts being edited, or the figure placed on a board at eight sizes (V2's two modes). */\n @state() private middle: 'edit' | 'preview' = 'edit'\n /**\n * How the workbench shows the figure -- V2's view settings, the board's own state names. The viewer's, kept in\n * their browser, never in the figure.\n */\n @state() private view: ViewSettings = FigureV3Editor.storedView()\n private static storedView(): ViewSettings {\n try {\n const stored = JSON.parse(localStorage.getItem('figure-v3-view') ?? 'null')\n return stored && typeof stored === 'object' ? { ...DEFAULT_VIEW, ...stored } : { ...DEFAULT_VIEW }\n } catch {\n return { ...DEFAULT_VIEW }\n }\n }\n private setView(view: ViewSettings) {\n this.view = { ...DEFAULT_VIEW, ...view }\n try {\n localStorage.setItem('figure-v3-view', JSON.stringify(this.view))\n } catch {\n /* A browser that keeps nothing still shows the change for this visit. */\n }\n }\n /**\n * Parts hidden on the workbench — the author's view while working, not the asset's visibility. Not saved, as in\n * the V2 modeller: a part hidden here is still in the figure, still checked, still drawn on a board.\n */\n @state() private hiddenParts = new Set<string>()\n /** A value in hand -- typed, held on a spinner, scrubbed, dragged -- drawn at once and recorded on release. */\n @state() private live: LiveValues = NOTHING_LIVE\n private lastContext: string | null = null\n /** The modeller's keys (`v3-keys.ts`): undo, redo, duplicate, remove, back to the whole figure. */\n private onKey = (e: KeyboardEvent) => {\n const view = this.session?.read()\n if (!view || view.loading || view.saving || !view.context || !this.isConnected) return\n const action = keyActionOf({ key: e.key, ctrlKey: e.ctrlKey, metaKey: e.metaKey, shiftKey: e.shiftKey, altKey: e.altKey, target: e.composedPath()[0] as HTMLElement }, this.selected)\n if (!action) return\n e.preventDefault()\n if (action === 'undo') view.canUndo && this.run(() => this.session!.undo())\n else if (action === 'redo') view.canRedo && this.run(() => this.session!.redo())\n else if (action === 'duplicate') this.duplicatePart(this.selected)\n else if (action === 'remove') this.removePart(this.selected)\n else this.selected = ''\n }\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('keydown', this.onKey)\n }\n disconnectedCallback() {\n window.removeEventListener('keydown', this.onKey)\n super.disconnectedCallback()\n }\n protected willUpdate(_changed: PropertyValues) {\n const view = this.session?.read()\n if (view?.context !== this.lastContext) {\n this.lastContext = view?.context ?? null\n this.selected = ''\n this.error = ''\n this.hiddenParts = new Set()\n }\n if (view && !view.geometry.some(g => ownerOf(g.id) === this.selected)) this.selected = ''\n }\n private run(action: () => unknown) {\n try {\n action()\n this.error = ''\n this.changed()\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error)\n } finally {\n /* Committed or refused, the value in hand is gone: the figure as it stands is drawn again. */\n this.live = NOTHING_LIVE\n }\n }\n /** What the canvas draws: the figure with the value in hand when there is one, and without the parts hidden on the workbench. */\n private drawnParts(geometry: Parameters<typeof drawableV3Parts>[0] | undefined, asset: unknown) {\n const parts = (isLive(this.live) && asset ? livePartsOf(asset as V3Asset, this.live) : null) ?? drawableV3Parts(geometry ?? [])\n return parts.filter(body => !this.hiddenParts.has(ownerOf((body as { id: string }).id)))\n }\n /**\n * Where the selected part turns and how far, with the pose as it is drawn now -- a value in hand included, so the\n * fan follows the arm while a control is dragged. Its size comes from what the joint turns (`v3-joint-fan`).\n */\n private fanOf(asset: V3Asset | undefined) {\n if (!asset || !this.selected || this.hiddenParts.has(this.selected)) return null\n try {\n return jointFanOf(asset, this.selected, this.live.values)\n } catch {\n return null\n }\n }\n /** A value in hand: an input's value (design or pose) or a part edit. Nothing is recorded. */\n private hold(values: Record<string, number>, edit?: V3PartEdit) {\n this.live = { values: { ...this.live.values, ...values }, ...(edit ? { edit } : this.live.edit ? { edit: this.live.edit } : {}) }\n }\n private changed() {\n this.requestUpdate()\n this.dispatchEvent(new CustomEvent('v3-changed', { bubbles: true, composed: true }))\n }\n private async save() {\n if (!this.session) return\n try {\n /*\n The card's picture is taken before the save starts, from a canvas of its own at the card's size —\n not from the one on screen, which stands wherever the author left it turned. A picture that cannot\n be taken is not an error: the save goes on without it (see `v3-thumbnail.ts`).\n */\n const view = this.session.read()\n const thumbnail = await captureV3Thumbnail(drawableV3Parts(view.geometry ?? []), view.palette ?? {})\n const promise = this.session.save({ thumbnail })\n this.changed()\n await promise\n this.error = ''\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error)\n } finally {\n this.changed()\n }\n }\n private add(kind: V3PaletteKind) {\n if (!this.session) return\n this.run(() => {\n const ids = new Set(this.session!.read().geometry.map(g => g.id))\n let n = 1\n while (ids.has(`${kind}-${n}`)) n++\n const part = paletteRecipe(kind, `${kind}-${n}`)\n this.session!.add(part)\n this.selected = part.id\n })\n }\n /**\n * The list's own operations, as V3 part edits — each one step of the session's history. The copy and the moved\n * part stay selected, as they do in the V2 list.\n */\n private duplicatePart(id: string) {\n this.run(() => {\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n this.selected = this.session!.read().geometry.find(g => !before.has(g.id))?.id ?? id\n })\n }\n private movePart(id: string, to: number) {\n this.run(() => this.session!.edit({ kind: 'move-part', target: id, to }))\n }\n private removePart(id: string) {\n try {\n this.session!.edit({ kind: 'remove-part', target: id })\n this.error = ''\n if (this.selected === id) this.selected = ''\n this.changed()\n } catch (error) {\n /* The refusal a person meets most: another part stands on this one or follows its size. Said in their words. */\n this.error =\n (error as { code?: string })?.code === 'PART_REFERENCED'\n ? i18next.t('figure.text.part-is-referenced', { part: id })\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n private toggleHiddenPart(id: string) {\n const next = new Set(this.hiddenParts)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n this.hiddenParts = next\n }\n /** What the gizmo may write for the selected part — read off the asset being edited. */\n private reachOf(id: string): GizmoReach {\n const none = { translate: false, rotate: false, scale: false }\n /* A repeat is moved and sized through its row, not by a gizmo on one copy. */\n if (!id || !this.session || !this.session.read().geometry.some(g => g.id === id)) return none\n try {\n return gizmoReachOf(JSON.parse(this.session.source()), id)\n } catch {\n return none\n }\n }\n /** A drag, written back as the part's own inputs — one step of the history, like typing the numbers. */\n private transformed(id: string, result: GizmoResult) {\n const view = this.session!.read()\n const sizes = Object.fromEntries(view.fields.map(field => [field.id, field.value as number]))\n const changes = gizmoChanges(id, this.reachOf(id), result, sizes)\n if (changes.length) {\n this.run(() => this.session!.apply(changes))\n return\n }\n /*\n A part whose place is worked out (a converted one) has no numbers for the gizmo to write: the drag is added beside\n its rule (`nudge-part`). A part a joint or a fastening places, or a size that is worked out, is refused -- said in\n words, not by the part silently springing back (user, 2026-09-24: 「기즈모 컨트롤도 전혀 작동이 안되는군」).\n */\n const body = view.geometry.find(g => g.id === id) as unknown as V3RenderPart | undefined\n if (!body) return this.requestUpdate()\n if (result.scale && !result.position && !result.rotation) {\n this.error = i18next.t('figure.text.gizmo-size-worked-out', { part: partLabelOf(id) })\n return this.requestUpdate()\n }\n const { by, turn } = nudgeOf(body, result)\n if (!Object.keys(by).length && !Object.keys(turn).length) return this.requestUpdate()\n try {\n this.session!.command({ kind: 'nudge-part', part: id, ...(Object.keys(by).length ? { by } : {}), ...(Object.keys(turn).length ? { turn } : {}) })\n this.error = ''\n this.changed()\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n this.error = /carried by a joint/.test(message)\n ? i18next.t('figure.text.gizmo-joint-places', { part: partLabelOf(id) })\n : /is fastened to/.test(message)\n ? i18next.t('figure.text.gizmo-fastening-places', { part: partLabelOf(id) })\n : message\n this.requestUpdate()\n }\n }\n /** 맞추기 — one tool, one step of the history, through the same inputs as the gizmo. */\n private align(tool: AlignTool) {\n this.run(() => {\n const asset = JSON.parse(this.session!.source())\n const changes = alignChanges(asset, this.selected, this.reachOf(this.selected), tool)\n if (changes.length) this.session!.apply(changes)\n })\n }\n /** A mirrored copy: duplicate, then place the copy on the other side — two steps, as the V2 list makes it. */\n private mirror(axis: 'x' | 'z') {\n this.run(() => {\n const id = this.selected\n const before = new Set(this.session!.read().geometry.map(g => g.id))\n this.session!.edit({ kind: 'duplicate-part', target: id })\n const copy = this.session!.read().geometry.find(g => !before.has(g.id))?.id\n if (!copy) return\n this.session!.apply(mirrorChanges(JSON.parse(this.session!.source()), id, copy, axis))\n this.selected = copy\n })\n }\n private renderTools(unavailable: boolean) {\n const reach = this.reachOf(this.selected)\n if (!this.selected || !reach.translate) return null\n let asset: unknown\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const tool = (name: AlignTool, icon: string, label: string, title: string) =>\n html`<button ?disabled=${unavailable} aria-label=${i18next.t(label)} title=${i18next.t(title)} @click=${() => this.align(name)}>\n <md-icon>${icon}</md-icon>\n </button>`\n return html`<div tools title=${i18next.t('figure.text.tools-explained')}>\n ${tool('centre-x', 'horizontal_distribute', 'figure.button.center-x', 'figure.text.center-on-x')}\n ${tool('centre-z', 'vertical_align_center', 'figure.button.center-z', 'figure.text.center-on-z')}\n ${tool('floor', 'vertical_align_bottom', 'figure.button.to-floor', 'figure.text.put-on-floor')}\n ${(['x', 'z'] as const).map(axis => {\n const able = canMirror(asset as never, this.selected, axis, reach)\n return html`<button\n ?disabled=${unavailable || !able}\n aria-label=${i18next.t('figure.button.mirror-' + axis)}\n title=${i18next.t(able ? 'figure.text.mirror-explained' : 'figure.text.mirror-would-overlap')}\n @click=${() => this.mirror(axis)}\n >\n <md-icon>${axis === 'x' ? 'flip' : 'flip_camera_android'}</md-icon>\n </button>`\n })}\n ${tool('snap', 'grid_on', 'figure.button.snap', 'figure.text.snap-explained')}\n </div>`\n }\n /**\n * A part's name — the V2 part name field. It renames every value the part owns, and what refers to them follows\n * (figure-model's rename-part), as one step of the history.\n */\n /**\n * A repeated body is one of its repeat's copies and is named after it -- the list and this field read `roller 15`, not\n * its path through the repeat (user, 2026-09-24: 「부품 이름 ???」). A copy has no name of its own to change.\n */\n private renderRepeatNote(geometry: readonly unknown[] | undefined) {\n const repeat = repeatOf(this.selected, geometry)\n return repeat?.index ? html`<p hint>${i18next.t('figure.text.repeat-member', { name: repeat.name, count: repeat.count, index: repeat.index })}</p>` : nothing\n }\n private renamePart(input: HTMLInputElement) {\n const name = input.value.trim()\n const from = this.selected\n if (!name || name === from) {\n input.value = from\n return\n }\n try {\n this.session!.edit({ kind: 'rename-part', target: from, name })\n this.selected = name\n this.error = ''\n this.changed()\n } catch (error) {\n input.value = from\n const code = (error as { code?: string })?.code\n this.error =\n code === 'PART_ID'\n ? i18next.t(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? 'figure.text.part-name-taken' : 'figure.text.part-name-invalid', { name })\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n /** Size response, fastening and motion for the selected part (parity ④ ⑤ ⑥), as authoring commands. */\n private renderLinks(unavailable: boolean, section: 'shape' | 'places' | 'motion') {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n let dims: [number, number, number] | undefined\n try {\n dims = boxOf(asset, this.selected)?.dims\n } catch {\n dims = undefined\n }\n return html`<figure-v3-links\n .asset=${asset}\n .section=${section}\n .partId=${this.selected}\n .dims=${dims}\n ?locked=${unavailable}\n @v3-command=${(e: CustomEvent) => this.linkCommand(e.detail.action)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-links>`\n }\n /** The figure's controls: try a value, name it, set its range and travel time, keep the pose (parity row ⑥). */\n private renderControls(view: { fields: Array<{ id: string; role?: string; value: number }> }, unavailable: boolean) {\n let asset\n try {\n asset = JSON.parse(this.session!.source())\n } catch {\n return null\n }\n const values = Object.fromEntries(view.fields.filter(f => f.role === 'state').map(f => [f.id, f.value]))\n return html`<figure-v3-controls\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-state=${(e: CustomEvent) => this.run(() => this.session!.apply([{ kind: 'set-state', input: e.detail.input, unit: e.detail.unit, value: e.detail.value }]))}\n @v3-state-live=${(e: CustomEvent) => this.hold({ [e.detail.input]: e.detail.value })}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-controls>\n <figure-v3-clips\n .asset=${asset}\n .values=${values}\n ?locked=${unavailable}\n @v3-states=${(e: CustomEvent) => this.run(() => this.session!.apply(e.detail.changes))}\n @v3-states-live=${(e: CustomEvent) => this.hold(e.detail.values)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-clips>`\n }\n /** One command, one step of the history. A refusal a person can meet here is said in their words. */\n private linkCommand(action: V3AuthoringAction) {\n try {\n this.session!.command(action)\n this.error = ''\n this.changed()\n } catch (error) {\n const code = (error as { code?: string })?.code\n this.error =\n code === 'DIMENSION_CYCLE'\n ? i18next.t('figure.text.follow-would-loop')\n : code === 'FASTEN_CYCLE' || code === 'ATTACH_CYCLE'\n ? i18next.t('figure.text.fasten-would-loop')\n : error instanceof Error\n ? error.message\n : String(error)\n }\n }\n private changeField(field: { id: string; unit: V3InputChange['unit']; role?: string }, event: Event) {\n const input = event.target as HTMLInputElement,\n value = input.valueAsNumber\n this.run(() =>\n this.session!.apply([\n { kind: field.role === 'state' ? 'set-state' : 'set-design', input: field.id, unit: field.unit, value }\n ])\n )\n // Rejected edits must also restore the displayed numeric value.\n input.value = String(this.session!.read().fields.find(i => i.id === field.id)!.value)\n }\n /** Typing or a held spinner: each number on the way is drawn; the field's change records it. */\n private typing(field: { id: string }, event: Event) {\n const value = (event.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(value)) this.hold({ [field.id]: value })\n }\n /**\n * Drag a field's label (or an axis letter) sideways to scrub its value, as vector tools do: the figure follows the\n * pointer, and the release records one step. The field's number follows too, so the value in hand is always read.\n */\n private scrub(field: { id: string; unit: V3InputChange['unit']; role?: string; value: number }, down: PointerEvent, unavailable: boolean) {\n if (unavailable || down.button !== 0) return\n const label = down.currentTarget as HTMLElement\n const input = (label.closest('div[cell]')?.querySelector('input') ?? label.nextElementSibling) as HTMLInputElement | null\n if (!input) return\n down.preventDefault()\n label.setPointerCapture(down.pointerId)\n const start = field.value\n let value = start\n const move = (e: PointerEvent) => {\n value = scrubbed(start, e.clientX - down.clientX, scrubStep(field.unit, start, e.shiftKey))\n input.value = String(value)\n this.hold({ [field.id]: value })\n }\n const up = (e: PointerEvent) => {\n label.removeEventListener('pointermove', move)\n label.removeEventListener('pointerup', up)\n label.removeEventListener('pointercancel', up)\n /* A drag the system took away is not the author's value: the field goes back to where it was. */\n if (e.type === 'pointercancel') value = start\n if (value === start) {\n input.value = String(start)\n this.live = NOTHING_LIVE\n return\n }\n input.value = String(value)\n this.changeField(field, { target: input } as unknown as Event)\n }\n label.addEventListener('pointermove', move)\n label.addEventListener('pointerup', up)\n label.addEventListener('pointercancel', up)\n }\n /** The measured range, kept for the revision it was measured at: measuring evaluates the figure at its edges. */\n private range?: { at: string; of: ReturnType<typeof instanceRangeOf> }\n /** The sizes a board may give the figure, and the way to measure them again after its parts changed. */\n private renderInstanceRange(asset: V3Asset | undefined, unavailable: boolean) {\n if (!asset) return nothing\n /* Another figure, or another step of this one, is measured again. */\n const at = `${this.session?.read().context ?? ''}:${this.revision}`\n if (this.range?.at !== at) {\n let of: ReturnType<typeof instanceRangeOf>\n try {\n of = instanceRangeOf(asset)\n } catch {\n of = undefined\n }\n this.range = { at, of }\n }\n const range = this.range.of\n if (!range) return nothing\n const mm = (v: number) => Math.round(v).toLocaleString()\n const differs = rangeDiffers(range.declared, range.measured)\n return html`<section>\n <h3>${i18next.t('figure.label.instance-range')}</h3>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div inline-field>\n <label>${axis.toUpperCase()}</label><span>${mm(range.declared[axis].min)} – ${mm(range.declared[axis].max)} mm</span>\n </div>`\n )}\n ${differs\n ? html`<p hint>\n ${i18next.t('figure.text.instance-range-can-widen', {\n ranges: (['x', 'y', 'z'] as const)\n .filter(axis => rangeDiffers(range.declared, { ...range.declared, [axis]: range.measured[axis] }))\n .map(axis => `${axis.toUpperCase()} ${mm(range.measured[axis].min)} – ${mm(range.measured[axis].max)}`)\n .join(' · ')\n })}\n </p>\n <button act ?disabled=${unavailable} @click=${() => this.linkCommand({ kind: 'declare-instance-size', range: range.measured, replace: true })}>\n <md-icon>straighten</md-icon>${i18next.t('figure.button.remeasure-range')}\n </button>`\n : nothing}\n ${this.renderSizingRule(asset, unavailable)}\n </section>`\n }\n /**\n * How the figure grows. One ratio (`sizing: 'uniform'`) is said as it is; a figure with joints that has not declared\n * it is offered it -- a mechanism does not shear -- and the author decides (chief architect's ruling 2026-09-24).\n */\n private renderSizingRule(asset: V3Asset, unavailable: boolean) {\n if (asset.sizing === 'uniform') return html`<div inline-field><label>${i18next.t('figure.label.sizing-rule')}</label><span>${i18next.t('figure.label.sizing-uniform')}</span></div>`\n return html`${turnsAboutAJoint(asset) ? html`<p hint>${i18next.t('figure.text.sizing-uniform-proposed')}</p>` : nothing}\n <button act ?disabled=${unavailable} title=${i18next.t('figure.text.sizing-uniform-explained')} @click=${() => this.linkCommand({ kind: 'scale-uniformly' })}>\n <md-icon>aspect_ratio</md-icon>${i18next.t('figure.button.scale-uniformly')}\n </button>`\n }\n /**\n * The parts list, one row per part the author made: a repeat is one row with how many copies it makes now (V2 listed\n * its parts the same way; user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\n private partRows(geometry: readonly { id: string }[]): V3PartRow[] {\n const rows = new Map<string, V3PartRow>()\n for (const g of geometry) {\n const id = ownerOf(g.id)\n const row = rows.get(id)\n if (row) {\n row.copies = (row.copies ?? 1) + 1\n continue\n }\n rows.set(id, {\n id,\n provider: (g as { shape?: { provider?: string } }).shape?.provider ?? '',\n hidden: this.hiddenParts.has(id),\n invisible: (g as { visible?: boolean }).visible === false,\n ...(id !== g.id ? { copies: 1 } : {})\n })\n }\n return [...rows.values()]\n }\n /** The detail level's part budget for the list's head, from figure-model's count (a repeat once). */\n private partBudgetOf(asset: V3Asset | undefined) {\n if (!asset) return undefined\n try {\n return { level: asset.detailLevel ?? null, used: v3PartCountOf(asset), limit: asset.detailLevel ? PART_LIMIT[asset.detailLevel] : null }\n } catch {\n return undefined\n }\n }\n /**\n * A repeat: which way its copies run, how many there are now, and how far apart -- V2's `repeat: { axis, pitch }`.\n * The pitch of a row that fills its length is edited as a number (`set-repeat` makes it the part's own the first\n * time); a row of a fixed count says its pitch cannot be set yet (figure-model refuses it the same way).\n */\n private renderRepeat(asset: V3Asset | undefined, geometry: readonly { id: string }[], unavailable: boolean) {\n const repeat = repeatOf(this.selected, geometry)\n if (!asset || !repeat || repeat.index) return nothing\n const model = asset.document.model as unknown as {\n nodes: { id: string; op: string; args: string[]; params?: Record<string, string> }[]\n constants: { id: string; value: number }[]\n inputs: { id: string; max?: number }[]\n }\n const layout = model.nodes.find(n => n.id === `${this.selected}.layout`)\n const axis = model.nodes.find(n => n.id === `${this.selected}.repeat`)?.params?.axis ?? '?'\n const own = `${this.selected}.repeat.pitch`\n const pitch = asset.designInputs[own] ?? model.constants.find(c => c.id === layout?.args[4])?.value\n const fits = layout?.op === 'fit-pitch@1'\n /* What the pitch gives, in numbers: this many copies at the length it is authored, and how long it may be placed. */\n const lengthRef = layout?.args[0] ?? ''\n const length = asset.designInputs[lengthRef]\n const longest = model.inputs.find(i => i.id === lengthRef)?.max\n const limit = model.constants.find(c => c.id === layout?.args[6])?.value\n const field = { id: own, unit: 'mm' as const, role: 'design', value: pitch ?? 0 }\n return html`<section>\n <h3>${i18next.t('figure.label.repeat')}</h3>\n <div inline-field><label>${i18next.t('figure.label.repeat-axis')}</label><span value>${axis.toUpperCase()}</span></div>\n <div inline-field><label>${i18next.t('figure.label.repeat-count')}</label><span value>${repeat.count}</span></div>\n <div inline-field>\n <label>${i18next.t('figure.label.repeat-gap')} <span unit>mm</span></label>\n <input\n type=\"number\"\n step=\"any\"\n aria-label=${own}\n .value=${String(pitch ?? '')}\n ?disabled=${unavailable || !fits}\n @change=${(e: Event) => this.setPitch(field, e)}\n />\n </div>\n <p hint>\n ${fits && length !== undefined && longest !== undefined && limit !== undefined\n ? i18next.t('figure.text.repeat-what-pitch-gives', {\n length: length.toLocaleString(),\n count: repeat.count,\n longest: longest.toLocaleString(),\n limit\n })\n : i18next.t(fits ? 'figure.text.repeat-fits-length' : 'figure.text.repeat-fixed-count')}\n </p>\n </section>`\n }\n /**\n * A pitch always goes through `set-repeat`: the command moves the longest length with it (at most `limit` copies),\n * which a plain input edit would not. Refused only when the authored length would already hold more copies than\n * that -- said with the numbers.\n */\n private setPitch(field: { id: string; value: number }, event: Event) {\n const input = event.target as HTMLInputElement\n const pitch = input.valueAsNumber\n if (!Number.isFinite(pitch) || pitch === field.value) return\n try {\n this.session!.command({ kind: 'set-repeat', part: this.selected, pitch })\n this.error = ''\n this.changed()\n } catch (error) {\n input.value = String(field.value)\n const code = (error as { code?: string })?.code\n const message = error instanceof Error ? error.message : String(error)\n const found = /\\((\\d[\\d.]*) mm\\) a pitch under ([\\d.]+) mm makes more than (\\d+)/.exec(message)\n this.error =\n code === 'INPUT_RANGE' && found\n ? i18next.t('figure.text.repeat-pitch-too-small', { length: Number(found[1]).toLocaleString(), min: found[2], limit: found[3] })\n : message\n }\n }\n /** Choose a part, from the list, the canvas or a place row. A figure-level tab gives way to the part's properties. */\n private choose(id: string) {\n /* A copy on the canvas selects its repeat: the part the author made. */\n this.selected = id ? ownerOf(id) : id\n if (id && (this.tab === 'verdict' || this.tab === 'view' || this.tab === 'history')) this.tab = 'properties'\n }\n private asset(): unknown {\n try {\n return JSON.parse(this.session!.source())\n } catch {\n return undefined\n }\n }\n private renderTab(tab: SideTab, icon: string, label: string, badge?: number) {\n return html`<button tab ?on=${this.tab === tab} title=${label} aria-label=${label} @click=${() => (this.tab = tab)}>\n <md-icon>${icon}</md-icon>${badge == null ? '' : html`<span badge>${badge.toLocaleString()}</span>`}\n </button>`\n }\n updated(changed: PropertyValues<this>) {\n super.updated?.(changed)\n const panes = this.renderRoot.querySelector<OxThreePane>('ox-three-pane') ?? undefined\n if (panes !== this.panes) this.panes = panes\n }\n /** Which part the panel speaks of, with the way back to the whole figure. */\n private renderSubject() {\n if (!this.selected) return null\n return html`<div subject>\n <button chip title=${i18next.t('figure.button.whole-figure')} @click=${() => (this.selected = '')}>\n <md-icon>arrow_back</md-icon>${i18next.t('figure.button.whole-figure')}\n </button>\n </div>`\n }\n render() {\n const view = this.session?.read()\n if (!view) return html`<p>${i18next.t('figure.text.opening-model')}</p>`\n const unavailable = view.loading || !!view.error || view.saving || !view.context\n const part = view.geometry.find(g => ownerOf(g.id) === this.selected)\n /* The controls (state inputs) have their own place in the motion tab; these are the design values. */\n const design = view.fields.filter(i => i.role !== 'state')\n /* A repeat's own row values (its pitch) have their own section, not the shape's. */\n const own = design.filter(i => this.selected && i.id.startsWith(this.selected + '.') && !i.id.startsWith(this.selected + '.repeat.'))\n const common = design.filter(i => !view.geometry.some(g => i.id.startsWith(ownerOf(g.id) + '.')))\n const status = view.loading\n ? 'figure.text.loading-figure'\n : view.saving\n ? 'figure.text.saving-figure'\n : view.dirty || !view.id\n ? 'figure.text.unsaved-changes'\n : 'figure.text.saved'\n const asset = this.asset()\n const tab = this.tab\n return html`<ox-canvas-bar\n history\n fit\n undo-shortcut=\"Ctrl+Z\"\n redo-shortcut=\"Ctrl+Y\"\n ?can-undo=${!unavailable && view.canUndo}\n ?can-redo=${!unavailable && view.canRedo}\n .pane=${this.panes}\n @canvas-undo=${() => this.run(() => this.session!.undo())}\n @canvas-redo=${() => this.run(() => this.session!.redo())}\n @canvas-fit=${() => this.renderRoot.querySelector<FigureV3Canvas>('figure-v3-canvas')?.fit()}\n >\n ${(['edit', 'preview'] as const).map(\n mode => html`<button slot=\"mode\" mode aria-pressed=${String(this.middle === mode)} title=${i18next.t('figure.text.mode-' + mode + '-explained')} @click=${() => (this.middle = mode)}>\n ${i18next.t('figure.label.mode-' + mode)}\n </button>`\n )}\n <span slot=\"status\" class=\"status\" role=\"status\" ?dirty=${status === 'figure.text.unsaved-changes'}>${i18next.t(status)}</span>\n <button slot=\"commit\" save ?disabled=${unavailable || (!view.dirty && !!view.id)} @click=${this.save}>${i18next.t('figure.button.save')}</button>\n </ox-canvas-bar>\n ${this.error || view.error ? html`<div role=\"alert\" class=\"error\">${this.error || view.error}</div>` : null}\n <ox-three-pane>\n <figure-v3-parts\n slot=\"start\"\n .budget=${this.budget}\n @show-maturity=${() => (this.tab = 'verdict')}\n .parts=${this.partRows(view.geometry)}\n .partBudget=${this.partBudgetOf(asset as V3Asset | undefined)}\n @set-detail-level=${(e: CustomEvent) => this.linkCommand({ kind: 'set-detail-level', level: e.detail.level })}\n .selected=${this.selected}\n ?locked=${unavailable}\n @add-part=${(e: CustomEvent) => this.add(e.detail.kind)}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @toggle-part-hidden=${(e: CustomEvent) => this.toggleHiddenPart(e.detail.id)}\n @set-all-parts-hidden=${(e: CustomEvent) =>\n (this.hiddenParts = e.detail.hidden ? new Set(view.geometry.map(g => ownerOf(g.id))) : new Set())}\n @move-part-up=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @move-part-down=${(e: CustomEvent) => this.movePart(e.detail.id, e.detail.to)}\n @duplicate-part=${(e: CustomEvent) => this.duplicatePart(e.detail.id)}\n @remove-part=${(e: CustomEvent) => this.removePart(e.detail.id)}\n ></figure-v3-parts>\n ${this.middle === 'preview'\n ? html`<figure-v3-preview\n .asset=${asset}\n .context=${view.context ?? ''}\n .view=${this.view}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-preview>`\n : html`<figure-v3-canvas\n .view=${this.view}\n .parts=${this.drawnParts(view.geometry, asset)}\n .fan=${this.fanOf(asset as V3Asset | undefined)}\n .palette=${view.palette ?? {}}\n .context=${view.context ?? ''}\n .selected=${this.selected}\n .reach=${unavailable ? { translate: false, rotate: false, scale: false } : this.reachOf(this.selected)}\n @part-transformed=${(e: CustomEvent) => this.transformed(e.detail.id, e.detail.result)}\n @part-selected=${(e: CustomEvent<string>) => this.choose(e.detail)}\n @render-error=${(e: CustomEvent<Error>) => {\n this.error = e.detail.message\n }}\n ></figure-v3-canvas>`}\n <aside slot=\"end\">\n <div tabs>\n ${this.renderTab('properties', 'tune', i18next.t('figure.label.properties'))}\n ${this.renderTab('capability', 'conveyor_belt', i18next.t('figure.label.tab-capability'))}\n ${this.renderTab('motion', 'animation', i18next.t('figure.label.motion'))}\n ${this.renderTab('verdict', 'insights', i18next.t('figure.label.maturity'), this.instances)}\n ${this.renderTab('view', 'wb_sunny', i18next.t('figure.label.tab-environment'))}\n ${this.renderTab('history', 'history', i18next.t('figure.label.history'))}\n </div>\n <slot name=\"notice\"></slot>\n <div panel ?off=${tab !== 'properties'}>\n ${this.selected && part\n ? html`${this.renderSubject()}\n <section>\n <h3>${i18next.t('figure.label.group-part')}</h3>\n <div inline-field>\n <label>${i18next.t('figure.label.name')}</label>\n <input\n name-field\n aria-label=${i18next.t('figure.label.name')}\n .value=${partLabelOf(this.selected)}\n ?disabled=${unavailable || !!repeatOf(this.selected, view.geometry)}\n @change=${(e: Event) => this.renamePart(e.target as HTMLInputElement)}\n />\n </div>\n ${this.renderRepeatNote(view.geometry)}\n </section>\n ${this.renderRepeat(asset as V3Asset | undefined, view.geometry, unavailable)}\n ${this.renderGroups(groupFields(own, this.selected), 'figure.label.group-placement-size', 'figure.label.group-shape', unavailable, this.renderTools(unavailable))}\n ${this.renderLinks(unavailable, 'shape')}\n <figure-v3-material\n .body=${{ ...part, id: this.selected }}\n .palette=${view.palette ?? {}}\n ?locked=${unavailable}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n @v3-part-live=${(e: CustomEvent) => this.hold({}, e.detail.edit)}\n ></figure-v3-material>`\n : html`<slot name=\"figure\"></slot>\n ${this.renderGroups(groupFields(common), 'figure.label.group-figure-size', 'figure.label.design-inputs', unavailable)}\n ${this.renderInstanceRange(asset as V3Asset | undefined, unavailable)}`}\n </div>\n <div panel ?off=${tab !== 'capability'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'places') : null}\n <figure-v3-capability\n .asset=${asset}\n .selected=${this.selected}\n ?locked=${unavailable}\n @select-part=${(e: CustomEvent) => this.choose(e.detail.id)}\n @v3-part-edit=${(e: CustomEvent) => this.run(() => this.session!.edit(e.detail.edit))}\n ></figure-v3-capability>\n </div>\n <div panel ?off=${tab !== 'motion'}>\n ${this.renderSubject()}\n ${this.selected && part ? this.renderLinks(unavailable, 'motion') : html`<section><p hint>${i18next.t('figure.text.choose-a-part-to-move')}</p></section>`}\n ${this.renderControls(view, unavailable)}\n </div>\n <div panel flush ?off=${tab !== 'verdict'}><slot name=\"verdict\"></slot></div>\n <div panel flush ?off=${tab !== 'view'}>\n <figure-settings .view=${this.view} @update-view=${(e: CustomEvent) => this.setView(e.detail.view)}></figure-settings>\n </div>\n <div panel flush ?off=${tab !== 'history'}><slot name=\"history\"></slot></div>\n </aside>\n </ox-three-pane>`\n }\n /** Position, rotation and size as rows of three cells; the shape's own measures one to a line, under their title. */\n private renderGroups(\n groups: { vectors: FieldGroup[]; singles: FieldGroup[] },\n vectorTitle: string,\n singleTitle: string,\n unavailable: boolean,\n tools: unknown = null\n ) {\n return html`${groups.vectors.length || tools\n ? html`<section>\n <h3>${i18next.t(vectorTitle)}</h3>\n ${groups.vectors.map(g => this.renderVector(g, unavailable))}\n ${tools ? html`<div vector-row><label>${i18next.t('figure.label.tools')}</label>${tools}</div>` : nothing}\n </section>`\n : nothing}\n ${groups.singles.length\n ? html`<section>\n <h3>${i18next.t(singleTitle)}</h3>\n <div form>${groups.singles.map(g => (g.kind === 'single' ? this.renderSingle(g.name, g.field, unavailable) : nothing))}</div>\n </section>`\n : nothing}`\n }\n private renderVector(group: FieldGroup, unavailable: boolean) {\n if (group.kind !== 'vector') return nothing\n const unit = group.cells.x.unit === 'deg' ? '°' : group.cells.x.unit\n return html`<div vector-row>\n <label>${i18next.t('figure.label.group-' + group.name)}${group.name === 'rotation' ? '' : html` <span unit>${unit}</span>`}</label>\n <div triple>\n ${(['x', 'y', 'z'] as const).map(\n axis => html`<div cell>\n <span axis ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(group.cells[axis] as never, e, unavailable)}>${axis.toUpperCase()}</span>\n <input\n aria-label=${group.cells[axis].id}\n type=\"number\"\n step=\"any\"\n .value=${String(group.cells[axis].value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(group.cells[axis] as never, e)}\n @change=${(e: Event) => this.changeField(group.cells[axis] as never, e)}\n />\n </div>`\n )}\n </div>\n </div>`\n }\n private renderSingle(name: string, field: FieldLike, unavailable: boolean) {\n const words = name.split('.').map(part => i18next.t('figure.label.field-' + part, { defaultValue: part }))\n return html`<span ?scrub=${!unavailable} @pointerdown=${(e: PointerEvent) => this.scrub(field as never, e, unavailable)}>${words.join(' · ')} (${field.unit})</span\n ><input\n aria-label=${field.id}\n type=\"number\"\n step=\"any\"\n .value=${String(field.value)}\n ?disabled=${unavailable}\n @input=${(e: Event) => this.typing(field as never, e)}\n @change=${(e: Event) => this.changeField(field as never, e)}\n />`\n }\n}\n"]}
@@ -37,3 +37,9 @@ export declare function repeatOf(id: string, geometry: readonly unknown[] | unde
37
37
  count: number;
38
38
  index: number;
39
39
  } | null;
40
+ /**
41
+ * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The
42
+ * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws
43
+ * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).
44
+ */
45
+ export declare function ownerOf(id: string): string;
@@ -49,8 +49,11 @@ export function partLabelOf(id) {
49
49
  */
50
50
  export function repeatOf(id, geometry) {
51
51
  const path = pathOf(id);
52
- if (!path)
53
- return null;
52
+ if (!path) {
53
+ /* The repeat itself, by its name: how many copies it makes now. */
54
+ const copies = (geometry ?? []).filter(g => pathOf(g.id ?? '')?.[0] === `${id}.repeat`).length;
55
+ return copies ? { name: id, count: copies, index: 0 } : null;
56
+ }
54
57
  const count = (geometry ?? []).filter(g => pathOf(g.id ?? '')?.[0] === path[0]).length;
55
58
  const index = path.find((step) => typeof step === 'number');
56
59
  return { name: String(path[0]).replace(/\.repeat$/, ''), count, index: (index ?? 0) + 1 };
@@ -66,4 +69,13 @@ function pathOf(id) {
66
69
  return null;
67
70
  }
68
71
  }
72
+ /**
73
+ * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The
74
+ * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws
75
+ * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).
76
+ */
77
+ export function ownerOf(id) {
78
+ const path = pathOf(id);
79
+ return path ? String(path[0]).replace(/\.repeat$/, '') : id;
80
+ }
69
81
  //# sourceMappingURL=v3-fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"v3-fields.js","sourceRoot":"","sources":["../../client/modeller/v3-fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAM9C,+GAA+G;AAC/G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,MAA4B,EAAE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E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped as V2's inspector showed them: 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 | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: 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 only when all three of its axes are there; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\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.every(id => byId.has(id))) continue\n ids.forEach(id => used.add(id))\n vectors.push({ kind: 'vector', name, cells: { x: byId.get(ids[0]!)!, y: byId.get(ids[1]!)!, z: byId.get(ids[2]!)! } })\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 name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.value\"]`), which the list showed as it was; it reads as the repeat's name and the member's place counted\n * from 1 -- `roller 1`, and `rack 2·3` inside two repeats. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n if (!id.startsWith('[')) return id\n let path: unknown\n try {\n path = JSON.parse(id)\n } catch {\n return id\n }\n if (!Array.isArray(path) || typeof path[0] !== 'string') return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${path[0].replace(/\\.repeat$/, '')} ${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 if (!path) return null\n const count = (geometry ?? []).filter(g => pathOf((g as { id?: string }).id ?? '')?.[0] === path[0]).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name: String(path[0]).replace(/\\.repeat$/, ''), 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"]}
1
+ {"version":3,"file":"v3-fields.js","sourceRoot":"","sources":["../../client/modeller/v3-fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAM9C,+GAA+G;AAC/G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,MAA4B,EAAE,IAAa;IACrE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CA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;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,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC7D,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped as V2's inspector showed them: 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 | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: 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 only when all three of its axes are there; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\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.every(id => byId.has(id))) continue\n ids.forEach(id => used.add(id))\n vectors.push({ kind: 'vector', name, cells: { x: byId.get(ids[0]!)!, y: byId.get(ids[1]!)!, z: byId.get(ids[2]!)! } })\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 name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.value\"]`), which the list showed as it was; it reads as the repeat's name and the member's place counted\n * from 1 -- `roller 1`, and `rack 2·3` inside two repeats. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n if (!id.startsWith('[')) return id\n let path: unknown\n try {\n path = JSON.parse(id)\n } catch {\n return id\n }\n if (!Array.isArray(path) || typeof path[0] !== 'string') return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${path[0].replace(/\\.repeat$/, '')} ${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 if (!path) {\n /* The repeat itself, by its name: how many copies it makes now. */\n const copies = (geometry ?? []).filter(g => pathOf((g as { id?: string }).id ?? '')?.[0] === `${id}.repeat`).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const count = (geometry ?? []).filter(g => pathOf((g as { id?: string }).id ?? '')?.[0] === path[0]).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name: String(path[0]).replace(/\\.repeat$/, ''), 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 ? String(path[0]).replace(/\\.repeat$/, '') : id\n}\n\n"]}
@@ -21,6 +21,14 @@ export declare function componentOf(part: V3RenderPart, palette: Record<string,
21
21
  * nothing.
22
22
  */
23
23
  export declare function gizmoResultOf(part: V3RenderPart, after: Record<string, unknown>, board: Board): GizmoResult;
24
+ /**
25
+ * A drag as amounts, for a part whose place is worked out (`nudge-part`): how far its origin moved and how far each of
26
+ * its angles turned (rigid@1's order, degrees). Nothing on an axis that did not change.
27
+ */
28
+ export declare function nudgeOf(part: V3RenderPart, result: GizmoResult): {
29
+ by: Partial<Record<'x' | 'y' | 'z', number>>;
30
+ turn: Partial<Record<'x' | 'y' | 'z', number>>;
31
+ };
24
32
  /** The keys of `next` whose values differ from `current` -- only those are set, so the scene raises no echo. */
25
33
  export declare function changedKeys(current: Record<string, unknown>, next: Record<string, unknown>): Record<string, unknown> | null;
26
34
  /** A board wide and deep enough for the figure, with room around it; its size only grows while a figure is edited. */
@@ -84,6 +84,32 @@ export function gizmoResultOf(part, after, board) {
84
84
  result.scale = scale.toArray();
85
85
  return result;
86
86
  }
87
+ /**
88
+ * A drag as amounts, for a part whose place is worked out (`nudge-part`): how far its origin moved and how far each of
89
+ * its angles turned (rigid@1's order, degrees). Nothing on an axis that did not change.
90
+ */
91
+ export function nudgeOf(part, result) {
92
+ const axes = ['x', 'y', 'z'];
93
+ const by = {};
94
+ const turn = {};
95
+ if (result.position)
96
+ axes.forEach((axis, i) => {
97
+ const d = round(result.position[i] - part.pose.t[i]);
98
+ if (Math.abs(d) > 1e-6)
99
+ by[axis] = d;
100
+ });
101
+ if (result.rotation) {
102
+ const r = part.pose.r;
103
+ const now = new THREE.Euler().setFromRotationMatrix(new THREE.Matrix4().set(r[0][0], r[0][1], r[0][2], 0, r[1][0], r[1][1], r[1][2], 0, r[2][0], r[2][1], r[2][2], 0, 0, 0, 0, 1), 'XYZ');
104
+ const was = [now.x, now.y, now.z].map(radians => (radians * 180) / Math.PI);
105
+ axes.forEach((axis, i) => {
106
+ const d = round(result.rotation[i] - was[i]);
107
+ if (Math.abs(d) > 1e-6)
108
+ turn[axis] = d;
109
+ });
110
+ }
111
+ return { by, turn };
112
+ }
87
113
  /** The keys of `next` whose values differ from `current` -- only those are set, so the scene raises no echo. */
88
114
  export function changedKeys(current, next) {
89
115
  const diff = {};