@things-factory/figure-ui 10.1.156 → 10.1.158

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 (37) hide show
  1. package/client/modeller/clips.ts +43 -4
  2. package/client/modeller/data-interface.ts +110 -0
  3. package/client/modeller/editor.ts +16 -2
  4. package/client/modeller/figure-clips.ts +125 -12
  5. package/client/modeller/figure-data-panel.ts +308 -0
  6. package/client/modeller/figure-preview.ts +41 -4
  7. package/client/modeller/refusals.ts +46 -0
  8. package/dist-client/modeller/clips.d.ts +32 -2
  9. package/dist-client/modeller/clips.js +32 -4
  10. package/dist-client/modeller/clips.js.map +1 -1
  11. package/dist-client/modeller/data-interface.d.ts +42 -0
  12. package/dist-client/modeller/data-interface.js +95 -0
  13. package/dist-client/modeller/data-interface.js.map +1 -0
  14. package/dist-client/modeller/editor.d.ts +3 -0
  15. package/dist-client/modeller/editor.js +18 -0
  16. package/dist-client/modeller/editor.js.map +1 -1
  17. package/dist-client/modeller/figure-clips.d.ts +10 -0
  18. package/dist-client/modeller/figure-clips.js +125 -10
  19. package/dist-client/modeller/figure-clips.js.map +1 -1
  20. package/dist-client/modeller/figure-data-panel.d.ts +39 -0
  21. package/dist-client/modeller/figure-data-panel.js +317 -0
  22. package/dist-client/modeller/figure-data-panel.js.map +1 -0
  23. package/dist-client/modeller/figure-preview.d.ts +7 -0
  24. package/dist-client/modeller/figure-preview.js +49 -4
  25. package/dist-client/modeller/figure-preview.js.map +1 -1
  26. package/dist-client/modeller/refusals.d.ts +5 -0
  27. package/dist-client/modeller/refusals.js +58 -0
  28. package/dist-client/modeller/refusals.js.map +1 -1
  29. package/dist-client/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +6 -6
  31. package/test/data-motion.test.ts +137 -0
  32. package/translations/en.json +86 -2
  33. package/translations/es.json +86 -2
  34. package/translations/ja.json +86 -2
  35. package/translations/ko.json +86 -2
  36. package/translations/ms.json +86 -2
  37. package/translations/zh.json +86 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C;;6CAAc;AAEV;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2CAAkC;AAEpC;IAA5B,KAAK,CAAC,YAAY,CAAC;8BAAiB,cAAc;4CAAA;AAClC;IAAhB,KAAK,EAAE;;6CAAoB;AAEX;IAAhB,KAAK,EAAE;;8CAA6C;AACpC;IAAhB,KAAK,EAAE;;6CAA4C;AAExC;IAAX,QAAQ,EAAE;;+CAAc;AACR;IAAhB,KAAK,EAAE;;gDAAuB;AAhKpB,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA+YzB","sourcesContent":["import { css, html, LitElement, nothing, unsafeCSS } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { compileFigureAsset } from '@hatiolab/figure-model'\nimport type { FigureAsset } from '@hatiolab/figure-model'\nimport { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene'\n\nimport { DEFAULT_VIEW, previewBoardDepth, sceneLook, WORKBENCH, type ViewSettings } from '@things-factory/figure-viewer/dist-client/figure-view.js'\nimport { dialShape } from './angle-dial.js'\nimport { derivedOf, type FigureRevision } from './revision.js'\nimport { authoredSizeOf, PREVIEW_FACTOR, PREVIEW_WAYS, previewClampsOf, previewInstances, previewTypeOf, setupPartOf } from '@things-factory/figure-viewer/dist-client/preview-model.js'\n\n/**\n * The figure placed on a board.\n *\n * The editing canvas shows the figure at the size it was made. Half of what a figure is lies in how it answers a\n * different size, so here the figure being authored is registered as a board registers it and placed as\n * `FigureInstance`s: the size it was made, and each of the seven ways of growing one, two or three axes twice as\n * large, side by side at one scale, four to a row. The board draws them as it will on a real board --\n * placement, lights, environment, the same renderer.\n *\n * The controls: each value that poses the figure with a slider (and a dial for an angle), each clip's\n * speed, and 「이 자세를 기본으로」 to keep the pose as the one it stands in. Nothing here is edited; the canvas edits.\n */\n\ninterface SceneHandle {\n dispose?: () => void\n resize?: () => void\n fit?: (type?: string) => void\n /** The scene's container: it can make the content again while keeping the 3D renderer and the camera (undo and redo use it). */\n rootContainer?: { rebuildContentModel?: (model: unknown, options?: { preserveThreeD?: boolean }) => void }\n root?: {\n set?: (patch: Record<string, unknown>) => void\n fitCameraToModel?: () => void\n components?: { set?: (property: string, value: unknown) => void }[]\n }\n}\n\n@customElement('figure-preview')\nexport class FigurePreview extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n position: relative;\n display: flex;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n background-color: ${unsafeCSS(WORKBENCH)};\n font-size: 0.76rem;\n }\n div[stage] {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n }\n /*\n The size help and the posing controls share the stage's bottom edge. Each stood in its own corner, so on a narrow\n stage (the 1024 width, both side panels open) the controls lay over the help's button. One row that wraps keeps both\n whole: side by side when there is room, the controls above the help when there is not.\n */\n div[foot] {\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: 8px;\n display: flex;\n flex-wrap: wrap-reverse;\n justify-content: space-between;\n align-items: flex-end;\n gap: 8px;\n pointer-events: none;\n }\n div[foot] > * { pointer-events: auto; }\n div[setup] { max-width: min(320px, 100%); padding: 12px; border-radius: 8px; background: rgba(28,28,30,.9); color: #fff; display: grid; gap: 8px; }\n div[setup] p { margin: 0; line-height: 1.5; }\n div[setup] select, div[setup] button { font: inherit; padding: 8px; min-width: 0; }\n /* Which is which: side by side means nothing without a legend. */\n div[legend] {\n position: absolute;\n top: 8px;\n left: 8px;\n display: flex;\n gap: 6px;\n padding: 4px 8px;\n color: rgba(255, 255, 255, 0.9);\n background-color: rgba(28, 28, 30, 0.6);\n border-radius: 6px;\n font-size: 0.72rem;\n flex-wrap: wrap;\n max-width: calc(100% - 16px);\n }\n /* A variant drawn at another size than it asks: the figure does not declare that size. */\n div[legend] small[clamp] {\n margin-left: 4px;\n color: #ffcc80;\n }\n div[clips] {\n margin-left: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 8px;\n font-size: 0.72rem;\n }\n div[clips] label {\n display: grid;\n grid-template-columns: auto 20px 96px 34px;\n align-items: center;\n gap: 8px;\n }\n div[clips] svg[dial] {\n width: 20px;\n height: 20px;\n }\n div[clips] svg[dial] path {\n fill: rgba(255, 255, 255, 0.22);\n }\n div[clips] svg[dial] line {\n stroke: var(--md-sys-color-primary, #7cc6ff);\n stroke-width: 2;\n stroke-linecap: round;\n }\n div[clips] svg[dial] circle {\n fill: none;\n stroke: rgba(255, 255, 255, 0.35);\n }\n div[clips] button[pose] {\n align-self: stretch;\n padding: 4px 8px;\n font: inherit;\n font-size: 0.7rem;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\n cursor: pointer;\n }\n div[clips] button[pose]:hover {\n background-color: rgba(255, 255, 255, 0.24);\n }\n div[clips] span[drive] {\n opacity: 0.6;\n font-size: 0.66rem;\n }\n div[clips] input {\n width: 96px;\n accent-color: var(--md-sys-color-primary);\n }\n div[clips] output {\n font-variant-numeric: tabular-nums;\n text-align: right;\n opacity: 0.85;\n }\n div[cannot] {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n text-align: center;\n line-height: 1.6;\n color: #f4f4f4;\n background-color: ${unsafeCSS(WORKBENCH)};\n }\n `\n\n /** The figure being authored, as the editor holds it now. */\n @property({ attribute: false }) revision?: FigureRevision\n private get asset(): FigureAsset | undefined {\n return this.revision?.asset\n }\n /** The size the figure was made at, once per version: without a declared size it is measured by evaluating the figure. */\n private authoredSize(): { x: number; y: number; z: number } {\n const shown = this.revision!\n return derivedOf(shown, 'authored-size', () => authoredSizeOf(shown.asset))\n }\n /** Which figure: the type it is registered under here is this one's own, never a real type a board uses. */\n @property() context = ''\n /**\n * In front. Once made, the preview stays standing behind the edit canvas, so coming back to it is not a new 3D scene\n * (about 300 ms): out of sight it does not follow the figure, and when it is shown again it makes its content again\n * inside the scene that stands if the figure changed meanwhile.\n */\n @property({ type: Boolean }) active = true\n private stale = false\n @property({ attribute: false }) view: ViewSettings = DEFAULT_VIEW\n\n @query('div[stage]') private stage!: HTMLDivElement\n @state() private cannot = ''\n /** Clip speeds and control values given here -- the preview's, not the figure's. */\n @state() private driving: Record<string, number> = {}\n @state() private giving: Record<string, number> = {}\n /** The part chosen in the editor. The size help starts on it, so the help speaks of the part the author was working on. */\n @property() selected = ''\n @state() private setupPart = ''\n\n /** What is being tried here now -- clip speeds and control values -- for the AI dock to hear with a request; none when nothing is. */\n tried(): { clips?: Record<string, number>; controls?: Record<string, number> } | undefined {\n const clips = Object.keys(this.driving).length ? { ...this.driving } : undefined\n const controls = Object.keys(this.giving).length ? { ...this.giving } : undefined\n return clips || controls ? { ...(clips ? { clips } : {}), ...(controls ? { controls } : {}) } : undefined\n }\n\n private scene?: SceneHandle\n private standing?: string\n private registered?: string\n private watcher?: ResizeObserver\n\n render() {\n const asset = this.asset\n const controls = asset ? asset.document.model.inputs.filter(i => i.role === 'state') : []\n const clips = asset ? [...new Set((asset.drivers ?? []).map(d => d.clip))] : []\n let clampsByWay: ReturnType<typeof previewClampsOf> = {}\n try {\n clampsByWay = asset ? previewClampsOf(asset, this.authoredSize()) : {}\n } catch {\n clampsByWay = {}\n }\n /* The part the help speaks of: the one picked in it, else the one chosen in the editor, else the first. */\n const setupPart = setupPartOf(this.setupPart, this.selected, asset?.appearance.map(p => p.target) ?? [])\n return html`<div stage></div>\n ${this.cannot\n ? html`<div cannot>${this.cannot}</div>`\n : html`<div legend>\n ${PREVIEW_WAYS.map(way => {\n const clamps = clampsByWay[way.name] ?? []\n return html`<span>\n ${way.axes.length ? way.name : i18next.t('figure.label.preview-base')}\n ${clamps.length\n ? html`<small clamp>${clamps.map(c => i18next.t('figure.text.preview-clamped', { axis: c.axis.toUpperCase(), asked: c.asked.toLocaleString(), used: c.used.toLocaleString() })).join(' · ')}</small>`\n : nothing}\n </span>`\n })}\n </div>\n <div foot>${asset?.appearance.length ? html`<div setup>\n <p>${i18next.t('figure.text.preview-setup')}</p>\n <select aria-label=${i18next.t('figure.label.resize-part')} @change=${(e: Event) => this.setupPart = (e.target as HTMLSelectElement).value}>\n ${asset.appearance.map(p => html`<option value=${p.target} ?selected=${p.target === setupPart}>${p.target}</option>`)}\n </select>\n <button @click=${() => this.dispatchEvent(new CustomEvent('configure-size', { detail: { part: setupPart }, bubbles: true, composed: true }))}>${i18next.t('figure.button.configure-size')}</button>\n </div>` : nothing}\n ${controls.length + clips.length ? this.renderDrivers(asset!, controls, clips) : nothing}</div>`}`\n }\n\n private renderDrivers(asset: FigureAsset, controls: FigureAsset['document']['model']['inputs'], clips: string[]) {\n const changed = controls.filter(c => this.giving[c.id] !== undefined && this.giving[c.id] !== asset.stateDefaults[c.id])\n return html`<div clips>\n ${changed.length\n ? html`<button pose title=${i18next.t('figure.text.pose-as-default-explained')} @click=${() => this.poseAsDefault()}>\n ${i18next.t('figure.button.pose-as-default')}\n </button>`\n : nothing}\n ${controls.map(control => {\n const value = this.giving[control.id] ?? asset.stateDefaults[control.id] ?? control.min\n const step = Math.max((control.max - control.min) / 100, 0.01)\n const label = asset.stateInputs?.[control.id]?.label ?? control.id\n return html`<label>\n <span>${label} <span drive>${control.unit}</span></span>\n ${this.renderDial(control, value)}\n <input\n type=\"range\"\n min=${control.min}\n max=${control.max}\n step=${step}\n .value=${String(value)}\n @input=${(e: Event) => this.give(control.id, Number((e.target as HTMLInputElement).value))}\n />\n <output>${Math.round(value)}</output>\n </label>`\n })}\n ${clips.map(clip => {\n /*\n A clip nothing has driven stands still, here as on a board: the instances get a speed only from `drive`. The\n slider showed 1.00 over rollers that did not turn (2026-10-03). It shows what plays -- 0 until moved.\n */\n const value = this.driving[clip] ?? 0\n return html`<label>\n <span>${clip} <span drive>${i18next.t('figure.label.playback-speed')}</span></span>\n <span></span>\n <input type=\"range\" min=\"0\" max=\"3\" step=\"0.05\" .value=${String(value)} @input=${(e: Event) => this.drive(clip, Number((e.target as HTMLInputElement).value))} />\n <output>${value.toFixed(2)}</output>\n </label>`\n })}\n </div>`\n }\n\n private renderDial(control: { unit: string; min: number; max: number }, value: number) {\n if (control.unit !== 'deg') return html`<span></span>`\n const dial = dialShape(control.min, control.max, value)\n const span = dial.radius * 2 + 2\n return html`<svg dial viewBox=\"0 0 ${span} ${span}\" aria-hidden=\"true\">\n <path d=${dial.sector}></path>\n <circle cx=${dial.centre.x} cy=${dial.centre.y} r=${dial.radius}></circle>\n <line x1=${dial.centre.x} y1=${dial.centre.y} x2=${dial.needle.x} y2=${dial.needle.y}></line>\n </svg>`\n }\n\n private drive(clip: string, value: number) {\n this.driving = { ...this.driving, [clip]: value }\n this.tellInstances('clips', this.driving)\n }\n\n private give(id: string, value: number) {\n this.giving = { ...this.giving, [id]: value }\n this.tellInstances('parameters', this.giving)\n }\n\n private poseAsDefault() {\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-state-defaults', values: { ...this.giving } } }, bubbles: true, composed: true }))\n this.giving = {}\n }\n\n private tellInstances(key: 'clips' | 'parameters', values: Record<string, number>) {\n for (const component of this.scene?.root?.components ?? []) component.set?.(key, { ...values })\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (!this.hasUpdated) return\n if (!this.active) {\n this.stale = true\n return\n }\n if (this.stale || changed.has('active')) {\n this.stale = false\n this.standUp()\n return\n }\n if (changed.has('revision') || changed.has('context')) {\n this.standUp()\n return\n }\n if (!changed.has('view')) return\n const before = changed.get('view') as ViewSettings | undefined\n const now = this.view ?? DEFAULT_VIEW\n if (before?.placement !== now.placement || before?.ceilingHeight !== now.ceilingHeight) this.standUp()\n else this.scene?.root?.set?.(sceneLook(now))\n }\n\n firstUpdated() {\n this.standUp()\n this.watcher = new ResizeObserver(() => {\n if (this.active) this.scene?.resize?.()\n })\n this.watcher.observe(this)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.watcher?.disconnect()\n this.watcher = undefined\n this.teardown()\n }\n\n private standUp() {\n const asset = this.asset\n const view = this.view ?? DEFAULT_VIEW\n if (!asset || !asset.appearance.length) {\n this.cannot = i18next.t('figure.text.preview-needs-a-part')\n this.teardown()\n return\n }\n const signature = JSON.stringify([asset, view.placement, view.ceilingHeight])\n if (this.scene && this.standing === signature) return\n try {\n compileFigureAsset(asset)\n } catch {\n this.cannot = i18next.t('figure.text.preview-blocked-by-errors')\n this.teardown()\n return\n }\n try {\n /* Registered as a board registers it, under a type of this preview's own: a real type's drawings stay as they are. */\n const type = previewTypeOf(this.context)\n const size = this.authoredSize()\n /*\n The figure changed under a scene that is standing: the same type is registered again and the content made again\n inside the same 3D scene. Making a scene anew costs about a third of a second and its first drawing compiles the\n shaders again -- a value typed beside the preview held the screen for seconds. The scene is made anew only when\n there is none, for another figure, or when the content cannot be made again in place.\n */\n const again = this.scene?.rootContainer?.rebuildContentModel && this.registered === type\n if (!again) this.teardown()\n this.driving = {}\n registerFigure(type, asset)\n this.registered = type\n const { components, board } = previewInstances(type, size)\n const model = {\n type: 'model-layer',\n width: board.width,\n height: board.height,\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, view.ceilingHeight, PREVIEW_FACTOR),\n threed: true,\n sky: 'color',\n ...sceneLook(view),\n placement: view.placement,\n heights: { floor: 0, ceiling: view.ceilingHeight },\n pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),\n components\n }\n if (again) {\n try {\n this.scene!.rootContainer!.rebuildContentModel!(model, { preserveThreeD: true })\n this.standing = signature\n this.cannot = ''\n return\n } catch {\n this.teardown()\n registerFigure(type, asset)\n this.registered = type\n }\n }\n this.scene = create({\n target: this.stage,\n model,\n mode: 0\n }) as SceneHandle\n this.standing = signature\n this.scene.resize?.()\n this.scene.fit?.('ratio')\n this.scene.root?.fitCameraToModel?.()\n this.cannot = ''\n } catch (error) {\n this.cannot = (error as Error).message\n }\n }\n\n private teardown() {\n this.scene?.dispose?.()\n this.scene = undefined\n this.standing = undefined\n if (this.registered) unregisterFigure(this.registered)\n this.registered = undefined\n }\n}\n"]}
1
+ {"version":3,"file":"figure-preview.js","sourceRoot":"","sources":["../../client/modeller/figure-preview.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEjF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAqB,MAAM,0DAA0D,CAAA;AACnJ,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAuB,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4DAA4D,CAAA;AA6BjL,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAzD;;QA8IL,4GAA4G;QAChG,YAAO,GAAG,EAAE,CAAA;QACxB;;;;WAIG;QAC0B,WAAM,GAAG,IAAI,CAAA;QAClC,UAAK,GAAG,KAAK,CAAA;QACW,SAAI,GAAiB,YAAY,CAAA;QAGhD,WAAM,GAAG,EAAE,CAAA;QAC5B,oFAAoF;QACnE,YAAO,GAA2B,EAAE,CAAA;QACpC,WAAM,GAA2B,EAAE,CAA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B,CAAC;;AA9S+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CAA0B;AAU7C;IAAX,QAAQ,EAAE;;8CAAa;AAMK;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;6CAAc;AAEV;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2CAAkC;AAEpC;IAA5B,KAAK,CAAC,YAAY,CAAC;8BAAiB,cAAc;4CAAA;AAClC;IAAhB,KAAK,EAAE;;6CAAoB;AAEX;IAAhB,KAAK,EAAE;;8CAA6C;AACpC;IAAhB,KAAK,EAAE;;6CAA4C;AAEnC;IAAhB,KAAK,EAAE;;6CAAqE;AAE7C;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CAA8C;AAEjE;IAAX,QAAQ,EAAE;;+CAAc;AACR;IAAhB,KAAK,EAAE;;gDAAuB;AApKpB,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAobzB","sourcesContent":["import { css, html, LitElement, nothing, unsafeCSS } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { compileFigureAsset } from '@hatiolab/figure-model'\nimport type { FigureAsset } from '@hatiolab/figure-model'\nimport { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene'\n\nimport { DEFAULT_VIEW, previewBoardDepth, sceneLook, WORKBENCH, type ViewSettings } from '@things-factory/figure-viewer/dist-client/figure-view.js'\nimport { dialShape } from './angle-dial.js'\nimport { derivedOf, type FigureRevision } from './revision.js'\nimport { authoredSizeOf, PREVIEW_FACTOR, PREVIEW_WAYS, previewClampsOf, previewInstances, previewTypeOf, setupPartOf } from '@things-factory/figure-viewer/dist-client/preview-model.js'\n\n/**\n * The figure placed on a board.\n *\n * The editing canvas shows the figure at the size it was made. Half of what a figure is lies in how it answers a\n * different size, so here the figure being authored is registered as a board registers it and placed as\n * `FigureInstance`s: the size it was made, and each of the seven ways of growing one, two or three axes twice as\n * large, side by side at one scale, four to a row. The board draws them as it will on a real board --\n * placement, lights, environment, the same renderer.\n *\n * The controls: each value that poses the figure with a slider (and a dial for an angle), each clip's\n * speed, and 「이 자세를 기본으로」 to keep the pose as the one it stands in. Nothing here is edited; the canvas edits.\n */\n\ninterface SceneHandle {\n dispose?: () => void\n resize?: () => void\n fit?: (type?: string) => void\n /** The scene's container: it can make the content again while keeping the 3D renderer and the camera (undo and redo use it). */\n rootContainer?: { rebuildContentModel?: (model: unknown, options?: { preserveThreeD?: boolean }) => void }\n root?: {\n set?: (patch: Record<string, unknown>) => void\n fitCameraToModel?: () => void\n components?: { set?: (property: string, value: unknown) => void }[]\n }\n}\n\n@customElement('figure-preview')\nexport class FigurePreview extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n position: relative;\n display: flex;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n background-color: ${unsafeCSS(WORKBENCH)};\n font-size: 0.76rem;\n }\n div[stage] {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n }\n /*\n The size help and the posing controls share the stage's bottom edge. Each stood in its own corner, so on a narrow\n stage (the 1024 width, both side panels open) the controls lay over the help's button. One row that wraps keeps both\n whole: side by side when there is room, the controls above the help when there is not.\n */\n div[foot] {\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: 8px;\n display: flex;\n flex-wrap: wrap-reverse;\n justify-content: space-between;\n align-items: flex-end;\n gap: 8px;\n pointer-events: none;\n }\n div[foot] > * { pointer-events: auto; }\n div[setup] { max-width: min(320px, 100%); padding: 12px; border-radius: 8px; background: rgba(28,28,30,.9); color: #fff; display: grid; gap: 8px; }\n div[setup] p { margin: 0; line-height: 1.5; }\n div[setup] select, div[setup] button { font: inherit; padding: 8px; min-width: 0; }\n /* Which is which: side by side means nothing without a legend. */\n div[legend] {\n position: absolute;\n top: 8px;\n left: 8px;\n display: flex;\n gap: 6px;\n padding: 4px 8px;\n color: rgba(255, 255, 255, 0.9);\n background-color: rgba(28, 28, 30, 0.6);\n border-radius: 6px;\n font-size: 0.72rem;\n flex-wrap: wrap;\n max-width: calc(100% - 16px);\n }\n /* A variant drawn at another size than it asks: the figure does not declare that size. */\n div[legend] small[clamp] {\n margin-left: 4px;\n color: #ffcc80;\n }\n div[clips] {\n margin-left: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 8px;\n font-size: 0.72rem;\n }\n div[clips] label {\n display: grid;\n grid-template-columns: auto 20px 96px 34px;\n align-items: center;\n gap: 8px;\n }\n div[clips] svg[dial] {\n width: 20px;\n height: 20px;\n }\n div[clips] svg[dial] path {\n fill: rgba(255, 255, 255, 0.22);\n }\n div[clips] svg[dial] line {\n stroke: var(--md-sys-color-primary, #7cc6ff);\n stroke-width: 2;\n stroke-linecap: round;\n }\n div[clips] svg[dial] circle {\n fill: none;\n stroke: rgba(255, 255, 255, 0.35);\n }\n div[clips] button[pose] {\n align-self: stretch;\n padding: 4px 8px;\n font: inherit;\n font-size: 0.7rem;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\n cursor: pointer;\n }\n div[clips] button[pose]:hover {\n background-color: rgba(255, 255, 255, 0.24);\n }\n div[clips] span[drive] {\n opacity: 0.6;\n font-size: 0.66rem;\n }\n div[clips] input {\n width: 96px;\n accent-color: var(--md-sys-color-primary);\n }\n div[clips] output {\n font-variant-numeric: tabular-nums;\n text-align: right;\n opacity: 0.85;\n }\n div[cannot] {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n text-align: center;\n line-height: 1.6;\n color: #f4f4f4;\n background-color: ${unsafeCSS(WORKBENCH)};\n }\n `\n\n /** The figure being authored, as the editor holds it now. */\n @property({ attribute: false }) revision?: FigureRevision\n private get asset(): FigureAsset | undefined {\n return this.revision?.asset\n }\n /** The size the figure was made at, once per version: without a declared size it is measured by evaluating the figure. */\n private authoredSize(): { x: number; y: number; z: number } {\n const shown = this.revision!\n return derivedOf(shown, 'authored-size', () => authoredSizeOf(shown.asset))\n }\n /** Which figure: the type it is registered under here is this one's own, never a real type a board uses. */\n @property() context = ''\n /**\n * In front. Once made, the preview stays standing behind the edit canvas, so coming back to it is not a new 3D scene\n * (about 300 ms): out of sight it does not follow the figure, and when it is shown again it makes its content again\n * inside the scene that stands if the figure changed meanwhile.\n */\n @property({ type: Boolean }) active = true\n private stale = false\n @property({ attribute: false }) view: ViewSettings = DEFAULT_VIEW\n\n @query('div[stage]') private stage!: HTMLDivElement\n @state() private cannot = ''\n /** Clip speeds and control values given here -- the preview's, not the figure's. */\n @state() private driving: Record<string, number> = {}\n @state() private giving: Record<string, number> = {}\n /** Per motion group, the clip played here and how fast (ADR-0051 §3.2) -- the preview's, as a board's \\`motion\\`. */\n @state() private moving: Record<string, { clip: string; speed: number }> = {}\n /** Data values tried in the data tab: the preview's figures run on them as a live snapshot; null when none are. */\n @property({ attribute: false }) sample: Record<string, unknown> | null = null\n /** The part chosen in the editor. The size help starts on it, so the help speaks of the part the author was working on. */\n @property() selected = ''\n @state() private setupPart = ''\n\n /** What is being tried here now -- clip speeds and control values -- for the AI dock to hear with a request; none when nothing is. */\n tried(): { clips?: Record<string, number>; controls?: Record<string, number> } | undefined {\n const clips = Object.keys(this.driving).length ? { ...this.driving } : undefined\n const controls = Object.keys(this.giving).length ? { ...this.giving } : undefined\n return clips || controls ? { ...(clips ? { clips } : {}), ...(controls ? { controls } : {}) } : undefined\n }\n\n private scene?: SceneHandle\n private standing?: string\n private registered?: string\n private watcher?: ResizeObserver\n\n render() {\n const asset = this.asset\n const controls = asset ? asset.document.model.inputs.filter(i => i.role === 'state') : []\n /* Clips in a motion group are played by the group's choice of clip, not each by its own speed. */\n const grouped = new Set((asset?.motionGroups ?? []).flatMap(g => g.clips))\n const clips = asset ? [...new Set((asset.drivers ?? []).map(d => d.clip))].filter(c => !grouped.has(c)) : []\n let clampsByWay: ReturnType<typeof previewClampsOf> = {}\n try {\n clampsByWay = asset ? previewClampsOf(asset, this.authoredSize()) : {}\n } catch {\n clampsByWay = {}\n }\n /* The part the help speaks of: the one picked in it, else the one chosen in the editor, else the first. */\n const setupPart = setupPartOf(this.setupPart, this.selected, asset?.appearance.map(p => p.target) ?? [])\n return html`<div stage></div>\n ${this.cannot\n ? html`<div cannot>${this.cannot}</div>`\n : html`<div legend>\n ${PREVIEW_WAYS.map(way => {\n const clamps = clampsByWay[way.name] ?? []\n return html`<span>\n ${way.axes.length ? way.name : i18next.t('figure.label.preview-base')}\n ${clamps.length\n ? html`<small clamp>${clamps.map(c => i18next.t('figure.text.preview-clamped', { axis: c.axis.toUpperCase(), asked: c.asked.toLocaleString(), used: c.used.toLocaleString() })).join(' · ')}</small>`\n : nothing}\n </span>`\n })}\n </div>\n <div foot>${asset?.appearance.length ? html`<div setup>\n <p>${i18next.t('figure.text.preview-setup')}</p>\n <select aria-label=${i18next.t('figure.label.resize-part')} @change=${(e: Event) => this.setupPart = (e.target as HTMLSelectElement).value}>\n ${asset.appearance.map(p => html`<option value=${p.target} ?selected=${p.target === setupPart}>${p.target}</option>`)}\n </select>\n <button @click=${() => this.dispatchEvent(new CustomEvent('configure-size', { detail: { part: setupPart }, bubbles: true, composed: true }))}>${i18next.t('figure.button.configure-size')}</button>\n </div>` : nothing}\n ${controls.length + clips.length + (asset?.motionGroups?.length ?? 0) ? this.renderDrivers(asset!, controls, clips) : nothing}</div>`}`\n }\n\n private renderDrivers(asset: FigureAsset, controls: FigureAsset['document']['model']['inputs'], clips: string[]) {\n const changed = controls.filter(c => this.giving[c.id] !== undefined && this.giving[c.id] !== asset.stateDefaults[c.id])\n return html`<div clips>\n ${changed.length\n ? html`<button pose title=${i18next.t('figure.text.pose-as-default-explained')} @click=${() => this.poseAsDefault()}>\n ${i18next.t('figure.button.pose-as-default')}\n </button>`\n : nothing}\n ${controls.map(control => {\n const value = this.giving[control.id] ?? asset.stateDefaults[control.id] ?? control.min\n const step = Math.max((control.max - control.min) / 100, 0.01)\n const label = asset.stateInputs?.[control.id]?.label ?? control.id\n return html`<label>\n <span>${label} <span drive>${control.unit}</span></span>\n ${this.renderDial(control, value)}\n <input\n type=\"range\"\n min=${control.min}\n max=${control.max}\n step=${step}\n .value=${String(value)}\n @input=${(e: Event) => this.give(control.id, Number((e.target as HTMLInputElement).value))}\n />\n <output>${Math.round(value)}</output>\n </label>`\n })}\n ${clips.map(clip => {\n /*\n A clip nothing has driven stands still, here as on a board: the instances get a speed only from `drive`. The\n slider showed 1.00 over rollers that did not turn (2026-10-03). It shows what plays -- 0 until moved.\n */\n const value = this.driving[clip] ?? 0\n return html`<label>\n <span>${clip} <span drive>${i18next.t('figure.label.playback-speed')}</span></span>\n <span></span>\n <input type=\"range\" min=\"0\" max=\"3\" step=\"0.05\" .value=${String(value)} @input=${(e: Event) => this.drive(clip, Number((e.target as HTMLInputElement).value))} />\n <output>${value.toFixed(2)}</output>\n </label>`\n })}\n ${(asset.motionGroups ?? []).map(group => {\n const playing = this.moving[group.id] ?? { clip: group.defaultClip, speed: 0 }\n return html`<label>\n <span>${group.label} <span drive>${i18next.t('figure.label.playback-speed')}</span></span>\n <select aria-label=${group.label} @change=${(e: Event) => this.move(group.id, { ...playing, clip: (e.target as HTMLSelectElement).value })}>\n ${group.clips.map(c => html`<option value=${c} ?selected=${c === playing.clip}>${c}</option>`)}\n </select>\n <input type=\"range\" min=\"0\" max=\"3\" step=\"0.05\" .value=${String(playing.speed)} @input=${(e: Event) => this.move(group.id, { ...playing, speed: Number((e.target as HTMLInputElement).value) })} />\n <output>${playing.speed.toFixed(2)}</output>\n </label>`\n })}\n </div>`\n }\n\n private move(group: string, playing: { clip: string; speed: number }) {\n this.moving = { ...this.moving, [group]: playing }\n this.tellInstances('motion', Object.fromEntries(Object.entries(this.moving).map(([id, m]) => [id, { ...m, paused: false }])))\n }\n\n private renderDial(control: { unit: string; min: number; max: number }, value: number) {\n if (control.unit !== 'deg') return html`<span></span>`\n const dial = dialShape(control.min, control.max, value)\n const span = dial.radius * 2 + 2\n return html`<svg dial viewBox=\"0 0 ${span} ${span}\" aria-hidden=\"true\">\n <path d=${dial.sector}></path>\n <circle cx=${dial.centre.x} cy=${dial.centre.y} r=${dial.radius}></circle>\n <line x1=${dial.centre.x} y1=${dial.centre.y} x2=${dial.needle.x} y2=${dial.needle.y}></line>\n </svg>`\n }\n\n private drive(clip: string, value: number) {\n this.driving = { ...this.driving, [clip]: value }\n this.tellInstances('clips', this.driving)\n }\n\n private give(id: string, value: number) {\n this.giving = { ...this.giving, [id]: value }\n this.tellInstances('parameters', this.giving)\n }\n\n private poseAsDefault() {\n this.dispatchEvent(new CustomEvent('part-edit', { detail: { edit: { kind: 'set-state-defaults', values: { ...this.giving } } }, bubbles: true, composed: true }))\n this.giving = {}\n }\n\n private tellInstances(key: 'clips' | 'parameters' | 'motion' | 'figureData', values: Record<string, unknown> | null) {\n for (const component of this.scene?.root?.components ?? []) {\n const value = values === null ? null : { ...values }\n /* A live snapshot is transient on the figure (its \\`figureData\\` accessor), never written into the saved model. */\n if (key === 'figureData') (component as { figureData?: unknown }).figureData = value\n else component.set?.(key, value)\n }\n }\n\n\n /** The data sample to the figures standing now: a live snapshot, transient on each, never saved with the board. */\n private tellSample() {\n if (this.sample) this.tellInstances('figureData', { ...this.sample })\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('sample') && this.scene) this.tellInstances('figureData', this.sample ? { ...this.sample } : null)\n if (!this.hasUpdated) return\n if (!this.active) {\n this.stale = true\n return\n }\n if (this.stale || changed.has('active')) {\n this.stale = false\n this.standUp()\n return\n }\n if (changed.has('revision') || changed.has('context')) {\n this.standUp()\n return\n }\n if (!changed.has('view')) return\n const before = changed.get('view') as ViewSettings | undefined\n const now = this.view ?? DEFAULT_VIEW\n if (before?.placement !== now.placement || before?.ceilingHeight !== now.ceilingHeight) this.standUp()\n else this.scene?.root?.set?.(sceneLook(now))\n }\n\n firstUpdated() {\n this.standUp()\n this.watcher = new ResizeObserver(() => {\n if (this.active) this.scene?.resize?.()\n })\n this.watcher.observe(this)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.watcher?.disconnect()\n this.watcher = undefined\n this.teardown()\n }\n\n private standUp() {\n const asset = this.asset\n const view = this.view ?? DEFAULT_VIEW\n if (!asset || !asset.appearance.length) {\n this.cannot = i18next.t('figure.text.preview-needs-a-part')\n this.teardown()\n return\n }\n const signature = JSON.stringify([asset, view.placement, view.ceilingHeight])\n if (this.scene && this.standing === signature) return\n try {\n compileFigureAsset(asset)\n } catch {\n this.cannot = i18next.t('figure.text.preview-blocked-by-errors')\n this.teardown()\n return\n }\n try {\n /* Registered as a board registers it, under a type of this preview's own: a real type's drawings stay as they are. */\n const type = previewTypeOf(this.context)\n const size = this.authoredSize()\n /*\n The figure changed under a scene that is standing: the same type is registered again and the content made again\n inside the same 3D scene. Making a scene anew costs about a third of a second and its first drawing compiles the\n shaders again -- a value typed beside the preview held the screen for seconds. The scene is made anew only when\n there is none, for another figure, or when the content cannot be made again in place.\n */\n const again = this.scene?.rootContainer?.rebuildContentModel && this.registered === type\n if (!again) this.teardown()\n this.driving = {}\n this.moving = {}\n registerFigure(type, asset)\n this.registered = type\n const { components, board } = previewInstances(type, size)\n const model = {\n type: 'model-layer',\n width: board.width,\n height: board.height,\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, view.ceilingHeight, PREVIEW_FACTOR),\n threed: true,\n sky: 'color',\n ...sceneLook(view),\n placement: view.placement,\n heights: { floor: 0, ceiling: view.ceilingHeight },\n pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),\n components\n }\n if (again) {\n try {\n this.scene!.rootContainer!.rebuildContentModel!(model, { preserveThreeD: true })\n this.standing = signature\n this.cannot = ''\n this.tellSample()\n return\n } catch {\n this.teardown()\n registerFigure(type, asset)\n this.registered = type\n }\n }\n this.scene = create({\n target: this.stage,\n model,\n mode: 0\n }) as SceneHandle\n this.standing = signature\n this.scene.resize?.()\n this.scene.fit?.('ratio')\n this.scene.root?.fitCameraToModel?.()\n this.cannot = ''\n this.tellSample()\n } catch (error) {\n this.cannot = (error as Error).message\n }\n }\n\n private teardown() {\n this.scene?.dispose?.()\n this.scene = undefined\n this.standing = undefined\n if (this.registered) unregisterFigure(this.registered)\n this.registered = undefined\n }\n}\n"]}
@@ -79,6 +79,11 @@ export declare function slotLayoutRefusalOf(error: unknown, say: Say): string |
79
79
  * 2026-09-27).
80
80
  */
81
81
  export declare function editRefusalOf(error: unknown, say: Say): string;
82
+ /**
83
+ * A data property, a connection, a motion group or a clip's tracks refused (ADR-0051 §2.2, §3.2), said with the ids and
84
+ * numbers the kernel gave. Nothing for any other refusal.
85
+ */
86
+ export declare function dataMotionRefusalOf(error: unknown, say: Say): string | null;
82
87
  /**
83
88
  * A value outside the range its input declares, with the range and the value given. The figure's own size is named by
84
89
  * its axis; any other input by its range only.
@@ -244,8 +244,66 @@ export function editRefusalOf(error, say) {
244
244
  documentLimitRefusalOf(error, say) ??
245
245
  sectionRefusalOf(error, say) ??
246
246
  slotLayoutRefusalOf(error, say) ??
247
+ dataMotionRefusalOf(error, say) ??
247
248
  say('figure.text.edit-refused', { code: codeOf(error) ?? '' }));
248
249
  }
250
+ /**
251
+ * A data property, a connection, a motion group or a clip's tracks refused (ADR-0051 §2.2, §3.2), said with the ids and
252
+ * numbers the kernel gave. Nothing for any other refusal.
253
+ */
254
+ export function dataMotionRefusalOf(error, say) {
255
+ const invalidId = detailsOf(error, 'data-id-invalid');
256
+ if (invalidId)
257
+ return say('figure.text.data-id-invalid', { id: invalidId.id });
258
+ const twice = detailsOf(error, 'data-id-duplicate');
259
+ if (twice)
260
+ return say('figure.text.data-id-duplicate', { id: twice.id });
261
+ const property = detailsOf(error, 'data-property-invalid');
262
+ if (property)
263
+ return say('figure.text.data-property-invalid-' + property.field, { property: property.property });
264
+ const absent = detailsOf(error, 'data-property-absent');
265
+ if (absent)
266
+ return say('figure.text.data-property-absent', { property: absent.property });
267
+ const target = detailsOf(error, 'data-target-absent');
268
+ if (target)
269
+ return say('figure.text.data-target-absent-' + target.target, { id: target.id });
270
+ const writers = detailsOf(error, 'data-target-duplicate');
271
+ if (writers)
272
+ return say('figure.text.data-target-duplicate', { a: writers.connections[0], b: writers.connections[1], id: writers.id });
273
+ const domain = detailsOf(error, 'data-transform-domain');
274
+ if (domain)
275
+ return say('figure.text.data-transform-' + domain.why, {
276
+ from: domain.from ?? '',
277
+ to: domain.to ?? '',
278
+ min: domain.min === undefined ? '' : numberOf(domain.min),
279
+ max: domain.max === undefined ? '' : numberOf(domain.max),
280
+ low: domain.within ? numberOf(domain.within[0]) : '',
281
+ high: domain.within ? numberOf(domain.within[1]) : '',
282
+ value: domain.value === undefined ? '' : String(domain.value)
283
+ });
284
+ const connected = detailsOf(error, 'data-property-connected');
285
+ if (connected)
286
+ return say('figure.text.data-property-connected', { property: connected.property, connections: connected.connections.join(', ') });
287
+ const clipAbsent = detailsOf(error, 'motion-clip-absent');
288
+ if (clipAbsent)
289
+ return say('figure.text.motion-clip-absent', { clip: clipAbsent.clip, group: clipAbsent.group });
290
+ const shared = detailsOf(error, 'motion-clip-shared');
291
+ if (shared)
292
+ return say('figure.text.motion-clip-shared', { clip: shared.clip, group: shared.groups[0] });
293
+ const many = detailsOf(error, 'driver-writers');
294
+ if (many)
295
+ return say('figure.text.driver-writers', { state: many.state, clips: many.clips.join(', ') });
296
+ const which = detailsOf(error, 'driver-clip-required');
297
+ if (which)
298
+ return say('figure.text.driver-clip-required', { state: which.state, clips: which.clips.join(', ') });
299
+ const setting = detailsOf(error, 'motion-setting');
300
+ if (setting)
301
+ return say('figure.text.motion-setting-' + setting.why, { group: setting.group, clip: setting.clip ?? '' });
302
+ const key = codeOf(error) === 'MOTION_GROUP' ? detailsOf(error, 'value-outside-range') : undefined;
303
+ if (key)
304
+ return say('figure.text.motion-key-outside-range', { input: key.input, value: numberOf(key.value), min: numberOf(key.min), max: numberOf(key.max) });
305
+ return null;
306
+ }
249
307
  /**
250
308
  * A value outside the range its input declares, with the range and the value given. The figure's own size is named by
251
309
  * its axis; any other input by its range only.
@@ -1 +1 @@
1
- {"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../client/modeller/refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,2BAA2B,EAAkD,MAAM,wBAAwB,CAAA;AAKpH,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAE,KAA8C,EAAE,IAAI,CAAA;AACxF,sEAAsE;AACtE,SAAS,SAAS,CAAmB,KAAc,EAAE,MAAS;IAC5D,MAAM,OAAO,GAAI,KAA+D,EAAE,OAAO,CAAA;IACzF,OAAO,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAE,OAAwD,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3G,CAAC;AACD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAA;AACvF,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAA;AACjG,6FAA6F;AAC7F,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,cAAc,EAAE,CAAA;AAEzE,kIAAkI;AAClI,MAAM,UAAU,kBAAkB,CAAC,KAAc,EAAE,GAAQ;IACzD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,qBAAqB;QAAE,OAAO,IAAI,CAAA;IACxD,MAAM,KAAK,GAAG,SAA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KAAK,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IAC5I,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;IAC5H,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,8BAA8B,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IACnI,OAAO,GAAG,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC","sourcesContent":["/*\n * A command figure-model refused, in the author's words with the numbers and where to put it right -- not the kernel's\n * English (user, 2026-09-24: 「what is this warning message means?」). Kept apart from the element so it is tested\n * without a browser.\n *\n * Every sentence here is made from the refusal's `code` and `details` (ADR-0127), never from its message: the kernel's\n * English is for logs and readers of the kernel, and a screen that read it went quiet whenever a sentence changed or a\n * new one came under the same code (ADR-0054). A refusal with no details the screen knows is said with its code.\n */\nimport { FIGURE_INSTANCE_SIZE_INPUTS, type FigureClipLoss, type FigureRefusalDetails } from '@hatiolab/figure-model'\n\ntype Say = (key: string, params: Record<string, string>) => string\ntype Reason = FigureRefusalDetails['reason']\n\nconst codeOf = (error: unknown) => (error as { code?: string } | null | undefined)?.code\n/** The refusal's details when they are of this reason, or nothing. */\nfunction detailsOf<R extends Reason>(error: unknown, reason: R): Extract<FigureRefusalDetails, { reason: R }> | undefined {\n const details = (error as { details?: FigureRefusalDetails } | null | undefined)?.details\n return details?.reason === reason ? (details as Extract<FigureRefusalDetails, { reason: R }>) : undefined\n}\nconst mmOf = (mm: number) => mm.toLocaleString(undefined, { maximumFractionDigits: 1 })\nconst numberOf = (value: number) => value.toLocaleString(undefined, { maximumFractionDigits: 3 })\n/** Bytes in KiB, rounded up: a figure a few bytes over its limit is not said to be at it. */\nconst kibOf = (bytes: number) => Math.ceil(bytes / 1024).toLocaleString()\n\n/** A size range the figure cannot be drawn over, or one that leaves out its own size, in words; nothing for any other refusal. */\nexport function sizeRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const reach = detailsOf(error, 'size-cannot-reach')\n if (reach)\n return say(reach.bound === 'min' ? 'figure.text.size-range-too-small' : 'figure.text.size-range-too-large', { axis: reach.axis.toUpperCase(), mm: mmOf(reach.need), part: reach.part ?? '' })\n const outside = detailsOf(error, 'size-outside-range')\n if (outside) return say('figure.text.size-range-leaves-out-size', { axis: outside.axis.toUpperCase(), at: mmOf(outside.at), min: mmOf(outside.min), max: mmOf(outside.max) })\n const zero = detailsOf(error, 'size-min-not-positive')\n if (zero) return say('figure.text.size-range-from-zero', { axis: zero.axis.toUpperCase() })\n const gone = detailsOf(error, 'size-already-gone')\n if (gone) return say('figure.text.size-range-part-gone', { axis: gone.axis.toUpperCase(), at: mmOf(gone.at) })\n return null\n}\n\n/**\n * A link refused because the size range it would leave cannot hold: measuring again cannot help (the link is not there\n * to measure), so the author is offered the same link that narrows the range to what the figure then allows.\n */\nexport function narrowingRetryOf<A extends { kind: string }>(action: A, error: unknown, say: Say): { message: string; label: string; retry: A & { narrowRange: true } } | null {\n if (action.kind !== 'link-dimension' || codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const reach = detailsOf(error, 'size-cannot-reach')\n if (!reach) return null\n const words = { axis: reach.axis.toUpperCase(), mm: mmOf(reach.need), part: reach.part ?? '' }\n const below = reach.bound === 'min'\n return {\n message: say(below ? 'figure.text.link-needs-smaller-range' : 'figure.text.link-needs-larger-range', words),\n label: say(below ? 'figure.button.narrow-range-from' : 'figure.button.narrow-range-to', words),\n retry: { ...action, narrowRange: true }\n }\n}\n\n/**\n * A placement refused because a part is fastened to the mounting plane by a face the new plane does not take (a bottom\n * on the floor, when the figure is to hang on a wall), said in the author's words with the parts it names.\n */\nexport function placementRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'PLACEMENT_PLANE') return null\n const misfit = detailsOf(error, 'placement-face')\n if (!misfit) return null\n return say('figure.text.placement-plane-refused', {\n parts: misfit.parts.map(p => `${p.part} (${p.face})`).join(', '),\n placement: say('figure.label.placement-' + misfit.placement, {}),\n faces: misfit.takes.join(', ')\n })\n}\n\n/** A refusal carried on in a record (an AI proposal's outcome) in figure-model's own shape: its code and details. */\nexport interface FigureRefusalRecord {\n code?: string\n details?: FigureRefusalDetails\n}\n\n/** The record of a refusal: figure-model's code and details, copied as they are. */\nexport function refusalRecordOf(error: unknown): FigureRefusalRecord {\n const { details } = (error ?? {}) as FigureRefusalRecord\n return { code: codeOf(error), ...(details ? { details } : {}) }\n}\n\n/** The clips an edit would stop, as figure-model named them (CLIPS_DROPPED) -- the person is asked before any go; nothing for any other refusal. */\nexport function clipLossOf(error: unknown): FigureClipLoss[] | null {\n return codeOf(error) === 'CLIPS_DROPPED' ? (detailsOf(error, 'clips-dropped')?.clips ?? []) : null\n}\n\n/** A part refused because the declared room reads it -- the one refusal deleting it with the room refitted answers. */\nexport function inDeclaredRoom(error: unknown): boolean {\n return codeOf(error) === 'PART_REFERENCED' && !!detailsOf(error, 'in-declared-space')\n}\n\n/**\n * Why a part cannot be deleted, in the author's words. Since the chief architect's ruling of 2026-09-27 a part that\n * holds others, leads a motion or is followed goes, and what depended on it is let go of (`removalNoticeOf`); what is\n * left is the declared space (with a way on: fit it again) and a row -- one laid along the part, or hanging in its row.\n */\nexport function partRefusalOf(error: unknown, part: string, say: Say): string | null {\n const code = codeOf(error)\n if (code !== 'PART_REFERENCED' && code !== 'PART_ROW') return null\n if (detailsOf(error, 'in-declared-space')) return say('figure.text.part-in-declared-space', { part })\n const along = detailsOf(error, 'row-along')\n if (along) return say('figure.text.part-row-along', { part, rows: along.rows.join(', ') })\n const carried = detailsOf(error, 'hangs-in-row')\n if (carried) return say('figure.text.part-row-carries', { part, others: carried.parts.join(', ') })\n return say('figure.text.part-is-referenced', { part })\n}\n\n/** A part the gizmo cannot move because a joint or a fastening places it, named as the author knows it (`part`). */\nexport function placedRefusalOf(error: unknown, part: string, say: Say): string | null {\n if (codeOf(error) !== 'EDIT_TARGET') return null\n if (detailsOf(error, 'placed-by-joint')) return say('figure.text.gizmo-joint-places', { part })\n if (detailsOf(error, 'placed-by-fastening')) return say('figure.text.gizmo-fastening-places', { part })\n return null\n}\n\n/** A part name refused: not a name, already used, or another part is named under the part. The rule is the kernel's. */\nexport function partNameRefusalOf(error: unknown, say: Say): string | null {\n /* A new part named as one already is: the same sentence as a part renamed so. */\n const takenId = detailsOf(error, 'part-id-taken')\n if (takenId) return say('figure.text.part-name-taken', { name: takenId.part })\n if (codeOf(error) !== 'PART_ID') return null\n const invalid = detailsOf(error, 'name-invalid')\n if (invalid) return say('figure.text.part-name-invalid', { name: invalid.name })\n const taken = detailsOf(error, 'name-taken')\n if (taken) return say('figure.text.part-name-taken', { name: taken.name })\n const nested = detailsOf(error, 'name-has-nested')\n if (nested) return say('figure.text.part-name-has-nested', { nested: nested.nested })\n return null\n}\n\n/** What removing a part let go of (figure-model's `RemovalNotice`), said in one line, or nothing when it let go of nothing. */\nexport function removalNoticeOf(\n notice:\n | {\n released: Array<{ part: string; control?: string }>\n fixed: Array<{ part: string }>\n controls: Array<{ part: string; control: string; min: number; max: number }>\n mountingFace?: boolean\n bindings?: Array<{ id: string; label?: string }>\n }\n | undefined,\n say: Say\n): string | null {\n if (!notice) return null\n const lines: string[] = []\n const still = notice.released.filter(r => !r.control).map(r => r.part)\n if (still.length) lines.push(say('figure.text.removal-released', { parts: still.join(', ') }))\n for (const r of notice.released.filter(r => r.control)) lines.push(say('figure.text.removal-released-motion', { part: r.part, control: r.control! }))\n for (const c of notice.controls) lines.push(say('figure.text.removal-own-control', { part: c.part, control: c.control, min: numberOf(c.min), max: numberOf(c.max) }))\n const fixed = [...new Set(notice.fixed.map(f => f.part))]\n if (fixed.length) lines.push(say('figure.text.removal-fixed', { parts: fixed.join(', ') }))\n if (notice.bindings?.length) lines.push(say('figure.text.removal-bindings', { places: notice.bindings.map(b => b.label ?? b.id).join(', ') }))\n if (notice.mountingFace) lines.push(say('figure.text.removal-mounting-face', {}))\n return lines.length ? lines.join(' ') : null\n}\n\n/**\n * A recipe refused at one of its steps: which step, and why -- the particular sentence when there is one (a size\n * range, a value's range, a placement), otherwise the kernel's code. The step is the refusal's path, `steps[2]`: the\n * contract's path grammar, not its English (ADR-0127 decision 6).\n */\nexport function recipeRefusalOf(error: unknown, say: Say): string | null {\n const step = /^steps\\[(\\d+)\\]$/.exec((error as { path?: string })?.path ?? '')\n if (!step) return null\n const why = sizeRangeRefusalOf(error, say) ?? inputRangeRefusalOf(error, say) ?? placementRefusalOf(error, say)\n return say('figure.text.recipe-step-refused', { step: String(Number(step[1]) + 1), why: why ?? '', code: codeOf(error) ?? '' })\n}\n\n/**\n * A corner or an inside the part cannot take (ADR-0100 stage 1): what was too large or too thick, or what holds on\n * to what the edit would take away.\n */\nfunction sectionRefusalOf(error: unknown, say: Say): string | null {\n const mapping = detailsOf(error, 'faces-taken-away')\n if (mapping) return say('figure.text.section-face-in-use', { faces: mapping.lost.map(l => say('figure.label.face-' + l.face, {})).join(', ') })\n if (codeOf(error) === 'DIMENSION_LINKED') return say('figure.text.section-dimension-linked', {})\n if (detailsOf(error, 'section-invalid')?.issues.some(i => i.code === 'CORNER_TOO_LARGE')) return say('figure.text.section-corner-too-large', {})\n const inside = detailsOf(error, 'inside-invalid')?.refusal\n if (inside?.code === 'CAVITY' && inside.refused === 'NO_ROOM_INSIDE') return say('figure.text.section-wall-too-thick', {})\n if (inside?.code === 'CAVITY_NO_LENGTH') return say('figure.text.section-ends-too-thick', {})\n return null\n}\n\n/**\n * A slot layout refused (ADR-0118): the anchor, slot or value it was refused for. The layout's own findings are named\n * by where they are; the editor checks them before Apply, so they rarely reach here.\n */\nexport function slotLayoutRefusalOf(error: unknown, say: Say): string | null {\n if (detailsOf(error, 'slot-layout-label-missing')) return say('figure.text.slot-layout-label-missing', {})\n if (detailsOf(error, 'slot-anchors-missing')) return say('figure.text.slot-anchors-missing', {})\n const twice = detailsOf(error, 'slot-anchor-duplicate')\n if (twice) return say('figure.text.slot-anchor-duplicate', { anchor: twice.anchor })\n const flat = detailsOf(error, 'slot-anchor-not-flat')\n if (flat) return say('figure.text.slot-anchor-not-flat', { anchor: flat.anchor, part: flat.part })\n const gone = detailsOf(error, 'slot-anchor-no-part')\n if (gone) return say('figure.text.slot-anchor-no-part', { anchor: gone.anchor, part: gone.part })\n const issues = detailsOf(error, 'slot-layout-issues')\n if (issues) return say('figure.text.slot-layout-issues', { path: issues.issues[0]?.path ?? '' })\n const empty = detailsOf(error, 'slot-accepts-empty')\n if (empty) return say('figure.text.slot-accepts-empty', { slot: empty.slot })\n const taken = detailsOf(error, 'slot-id-taken')\n if (taken) return say('figure.text.slot-id-taken', { slot: taken.slot })\n return null\n}\n\n/** The figure's limits: its nodes, its size saved, how deep it nests. */\nfunction documentLimitRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'DOCUMENT_LIMIT') return null\n const nodes = detailsOf(error, 'node-limit')\n if (nodes) return say('figure.text.edit-refused-node-limit', { max: String(nodes.max) })\n const large = detailsOf(error, 'document-too-large')\n if (large)\n return large.at === undefined\n ? say('figure.text.document-too-large-unmeasured', { max: kibOf(large.max) })\n : say('figure.text.document-too-large', { max: kibOf(large.max), at: kibOf(large.at) })\n const deep = detailsOf(error, 'nesting-too-deep')\n if (deep) return say('figure.text.document-nesting-too-deep', { max: String(deep.max), at: String(deep.at) })\n return null\n}\n\n/**\n * A refusal in the author's words when the screen has words for it, otherwise said as a refusal with its code -- never\n * the kernel's English on the screen (the duplicate of a row's part showed 「EDIT_TARGET: … not a repeated template」,\n * 2026-09-27).\n */\nexport function editRefusalOf(error: unknown, say: Say): string {\n return (\n sizeRangeRefusalOf(error, say) ??\n inputRangeRefusalOf(error, say) ??\n repeatPitchRefusalOf(error, say) ??\n rowLimitRefusalOf(error, say) ??\n placementRefusalOf(error, say) ??\n partNameRefusalOf(error, say) ??\n documentLimitRefusalOf(error, say) ??\n sectionRefusalOf(error, say) ??\n slotLayoutRefusalOf(error, say) ??\n say('figure.text.edit-refused', { code: codeOf(error) ?? '' })\n )\n}\n\n/**\n * A value outside the range its input declares, with the range and the value given. The figure's own size is named by\n * its axis; any other input by its range only.\n */\nexport function inputRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INPUT_RANGE') return null\n const range = detailsOf(error, 'value-outside-range')\n if (!range) return null\n const axis = (Object.entries(FIGURE_INSTANCE_SIZE_INPUTS) as Array<[string, string]>).find(([, id]) => id === range.input)?.[0]\n const params = { value: numberOf(range.value), min: numberOf(range.min), max: numberOf(range.max) }\n return axis ? say('figure.text.input-range-size', { ...params, axis: axis.toUpperCase() }) : say('figure.text.input-range', params)\n}\n\n/**\n * A row past its limits: a pitch so fine it would hold more copies than a row takes, a row that would expand to more\n * bodies than a figure draws, a number of copies outside what a row may have or more than its length holds apart, a\n * row inside a row along the same axis, or a part whose face something holds made into a row.\n */\nexport function rowLimitRefusalOf(error: unknown, say: Say): string | null {\n const copies = detailsOf(error, 'copies-over-limit')\n if (copies) return say('figure.text.row-copies-over-limit', { count: copies.count.toLocaleString(), limit: copies.limit.toLocaleString() })\n const bodies = detailsOf(error, 'geometry-over-limit')\n if (bodies) return say('figure.text.row-geometry-over-limit', { count: bodies.count.toLocaleString(), limit: bodies.limit.toLocaleString() })\n const count = detailsOf(error, 'row-copies-out-of-range')\n if (count) return say('figure.text.row-copies-out-of-range', { count: count.count.toLocaleString(), min: String(count.min), max: String(count.max) })\n const fit = detailsOf(error, 'row-does-not-fit')\n if (fit) return say('figure.text.row-does-not-fit', { count: fit.count.toLocaleString(), length: mmOf(fit.length), extent: mmOf(fit.extent) })\n const axis = detailsOf(error, 'row-same-axis')\n if (axis) return say('figure.text.row-same-axis', { part: axis.part, outer: axis.outer, axis: axis.axis.toUpperCase() })\n const held = detailsOf(error, 'surface-on-row')\n if (held) return say(`figure.text.row-face-held-${heldByOf(held.at)}`, { part: held.part })\n return null\n}\n\n/* What holds a face, from the contract path the kernel names it by: the slot layout, a place, the footprint. */\nconst heldByOf = (at: string) => (at.startsWith('slotLayout') ? 'slot-layout' : at.startsWith('bindings') ? 'place' : at.startsWith('occupancy') ? 'footprint' : 'other')\n\n/** A row's pitch under which the figure, at the length it is authored, would hold more copies than a row takes. */\nexport function repeatPitchRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INPUT_RANGE') return null\n const pitch = detailsOf(error, 'pitch-too-many-copies')\n if (!pitch) return null\n return say('figure.text.repeat-pitch-too-small', { length: pitch.length.toLocaleString(), min: String(pitch.least), limit: String(pitch.limit) })\n}\n\n/**\n * Why \"follow the size and keep where the figure is placed\" was not applied, in the author's words (ADR-0097): the plan\n * says what it would have had to overwrite, and for a part through the plane how far. A code the screen has no words\n * for is said as a refusal with its code, never in the kernel's English.\n */\nexport function resizeRefusalOf(plan: { mode: string; refusal?: { code: string; axis?: string; mm?: number } }, part: string, say: Say): string {\n const refusal = plan.refusal\n if (!refusal) return ''\n const place = say(`figure.label.resize-place-${plan.mode}`, {})\n const params = { part, place, axis: (refusal.axis ?? '').toUpperCase(), mm: refusal.mm === undefined ? '' : String(Math.round(refusal.mm)) }\n const known = ['HELD', 'TURNED', 'UNIFORM_POLICY', 'SHAPE_EDIT', 'DIMENSION_RULE', 'POSITION_RULE', 'GAP_CHOICE', 'NO_FACE']\n if (known.includes(refusal.code)) return say(`figure.text.resize-refused-${refusal.code.toLowerCase().replace(/_/g, '-')}`, params)\n return say('figure.text.edit-refused', { code: refusal.code })\n}\n"]}
1
+ {"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../client/modeller/refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,2BAA2B,EAAkD,MAAM,wBAAwB,CAAA;AAKpH,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAE,KAA8C,EAAE,IAAI,CAAA;AACxF,sEAAsE;AACtE,SAAS,SAAS,CAAmB,KAAc,EAAE,MAAS;IAC5D,MAAM,OAAO,GAAI,KAA+D,EAAE,OAAO,CAAA;IACzF,OAAO,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAE,OAAwD,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3G,CAAC;AACD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAA;AACvF,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAA;AACjG,6FAA6F;AAC7F,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,cAAc,EAAE,CAAA;AAEzE,kIAAkI;AAClI,MAAM,UAAU,kBAAkB,CAAC,KAAc,EAAE,GAAQ;IACzD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,qBAAqB;QAAE,OAAO,IAAI,CAAA;IACxD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAA;IACnD,IAAI,KAAK;QACP,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAA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CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AACnJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAA8E,EAAE,IAAY,EAAE,GAAQ;IACpI,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAA;IACvB,MAAM,KAAK,GAAG,GAAG,CAAC,6BAA6B,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;IAC/D,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;IAC5I,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;IAC5H,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,8BAA8B,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IACnI,OAAO,GAAG,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC","sourcesContent":["/*\n * A command figure-model refused, in the author's words with the numbers and where to put it right -- not the kernel's\n * English (user, 2026-09-24: 「what is this warning message means?」). Kept apart from the element so it is tested\n * without a browser.\n *\n * Every sentence here is made from the refusal's `code` and `details` (ADR-0127), never from its message: the kernel's\n * English is for logs and readers of the kernel, and a screen that read it went quiet whenever a sentence changed or a\n * new one came under the same code (ADR-0054). A refusal with no details the screen knows is said with its code.\n */\nimport { FIGURE_INSTANCE_SIZE_INPUTS, type FigureClipLoss, type FigureRefusalDetails } from '@hatiolab/figure-model'\n\ntype Say = (key: string, params: Record<string, string>) => string\ntype Reason = FigureRefusalDetails['reason']\n\nconst codeOf = (error: unknown) => (error as { code?: string } | null | undefined)?.code\n/** The refusal's details when they are of this reason, or nothing. */\nfunction detailsOf<R extends Reason>(error: unknown, reason: R): Extract<FigureRefusalDetails, { reason: R }> | undefined {\n const details = (error as { details?: FigureRefusalDetails } | null | undefined)?.details\n return details?.reason === reason ? (details as Extract<FigureRefusalDetails, { reason: R }>) : undefined\n}\nconst mmOf = (mm: number) => mm.toLocaleString(undefined, { maximumFractionDigits: 1 })\nconst numberOf = (value: number) => value.toLocaleString(undefined, { maximumFractionDigits: 3 })\n/** Bytes in KiB, rounded up: a figure a few bytes over its limit is not said to be at it. */\nconst kibOf = (bytes: number) => Math.ceil(bytes / 1024).toLocaleString()\n\n/** A size range the figure cannot be drawn over, or one that leaves out its own size, in words; nothing for any other refusal. */\nexport function sizeRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const reach = detailsOf(error, 'size-cannot-reach')\n if (reach)\n return say(reach.bound === 'min' ? 'figure.text.size-range-too-small' : 'figure.text.size-range-too-large', { axis: reach.axis.toUpperCase(), mm: mmOf(reach.need), part: reach.part ?? '' })\n const outside = detailsOf(error, 'size-outside-range')\n if (outside) return say('figure.text.size-range-leaves-out-size', { axis: outside.axis.toUpperCase(), at: mmOf(outside.at), min: mmOf(outside.min), max: mmOf(outside.max) })\n const zero = detailsOf(error, 'size-min-not-positive')\n if (zero) return say('figure.text.size-range-from-zero', { axis: zero.axis.toUpperCase() })\n const gone = detailsOf(error, 'size-already-gone')\n if (gone) return say('figure.text.size-range-part-gone', { axis: gone.axis.toUpperCase(), at: mmOf(gone.at) })\n return null\n}\n\n/**\n * A link refused because the size range it would leave cannot hold: measuring again cannot help (the link is not there\n * to measure), so the author is offered the same link that narrows the range to what the figure then allows.\n */\nexport function narrowingRetryOf<A extends { kind: string }>(action: A, error: unknown, say: Say): { message: string; label: string; retry: A & { narrowRange: true } } | null {\n if (action.kind !== 'link-dimension' || codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const reach = detailsOf(error, 'size-cannot-reach')\n if (!reach) return null\n const words = { axis: reach.axis.toUpperCase(), mm: mmOf(reach.need), part: reach.part ?? '' }\n const below = reach.bound === 'min'\n return {\n message: say(below ? 'figure.text.link-needs-smaller-range' : 'figure.text.link-needs-larger-range', words),\n label: say(below ? 'figure.button.narrow-range-from' : 'figure.button.narrow-range-to', words),\n retry: { ...action, narrowRange: true }\n }\n}\n\n/**\n * A placement refused because a part is fastened to the mounting plane by a face the new plane does not take (a bottom\n * on the floor, when the figure is to hang on a wall), said in the author's words with the parts it names.\n */\nexport function placementRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'PLACEMENT_PLANE') return null\n const misfit = detailsOf(error, 'placement-face')\n if (!misfit) return null\n return say('figure.text.placement-plane-refused', {\n parts: misfit.parts.map(p => `${p.part} (${p.face})`).join(', '),\n placement: say('figure.label.placement-' + misfit.placement, {}),\n faces: misfit.takes.join(', ')\n })\n}\n\n/** A refusal carried on in a record (an AI proposal's outcome) in figure-model's own shape: its code and details. */\nexport interface FigureRefusalRecord {\n code?: string\n details?: FigureRefusalDetails\n}\n\n/** The record of a refusal: figure-model's code and details, copied as they are. */\nexport function refusalRecordOf(error: unknown): FigureRefusalRecord {\n const { details } = (error ?? {}) as FigureRefusalRecord\n return { code: codeOf(error), ...(details ? { details } : {}) }\n}\n\n/** The clips an edit would stop, as figure-model named them (CLIPS_DROPPED) -- the person is asked before any go; nothing for any other refusal. */\nexport function clipLossOf(error: unknown): FigureClipLoss[] | null {\n return codeOf(error) === 'CLIPS_DROPPED' ? (detailsOf(error, 'clips-dropped')?.clips ?? []) : null\n}\n\n/** A part refused because the declared room reads it -- the one refusal deleting it with the room refitted answers. */\nexport function inDeclaredRoom(error: unknown): boolean {\n return codeOf(error) === 'PART_REFERENCED' && !!detailsOf(error, 'in-declared-space')\n}\n\n/**\n * Why a part cannot be deleted, in the author's words. Since the chief architect's ruling of 2026-09-27 a part that\n * holds others, leads a motion or is followed goes, and what depended on it is let go of (`removalNoticeOf`); what is\n * left is the declared space (with a way on: fit it again) and a row -- one laid along the part, or hanging in its row.\n */\nexport function partRefusalOf(error: unknown, part: string, say: Say): string | null {\n const code = codeOf(error)\n if (code !== 'PART_REFERENCED' && code !== 'PART_ROW') return null\n if (detailsOf(error, 'in-declared-space')) return say('figure.text.part-in-declared-space', { part })\n const along = detailsOf(error, 'row-along')\n if (along) return say('figure.text.part-row-along', { part, rows: along.rows.join(', ') })\n const carried = detailsOf(error, 'hangs-in-row')\n if (carried) return say('figure.text.part-row-carries', { part, others: carried.parts.join(', ') })\n return say('figure.text.part-is-referenced', { part })\n}\n\n/** A part the gizmo cannot move because a joint or a fastening places it, named as the author knows it (`part`). */\nexport function placedRefusalOf(error: unknown, part: string, say: Say): string | null {\n if (codeOf(error) !== 'EDIT_TARGET') return null\n if (detailsOf(error, 'placed-by-joint')) return say('figure.text.gizmo-joint-places', { part })\n if (detailsOf(error, 'placed-by-fastening')) return say('figure.text.gizmo-fastening-places', { part })\n return null\n}\n\n/** A part name refused: not a name, already used, or another part is named under the part. The rule is the kernel's. */\nexport function partNameRefusalOf(error: unknown, say: Say): string | null {\n /* A new part named as one already is: the same sentence as a part renamed so. */\n const takenId = detailsOf(error, 'part-id-taken')\n if (takenId) return say('figure.text.part-name-taken', { name: takenId.part })\n if (codeOf(error) !== 'PART_ID') return null\n const invalid = detailsOf(error, 'name-invalid')\n if (invalid) return say('figure.text.part-name-invalid', { name: invalid.name })\n const taken = detailsOf(error, 'name-taken')\n if (taken) return say('figure.text.part-name-taken', { name: taken.name })\n const nested = detailsOf(error, 'name-has-nested')\n if (nested) return say('figure.text.part-name-has-nested', { nested: nested.nested })\n return null\n}\n\n/** What removing a part let go of (figure-model's `RemovalNotice`), said in one line, or nothing when it let go of nothing. */\nexport function removalNoticeOf(\n notice:\n | {\n released: Array<{ part: string; control?: string }>\n fixed: Array<{ part: string }>\n controls: Array<{ part: string; control: string; min: number; max: number }>\n mountingFace?: boolean\n bindings?: Array<{ id: string; label?: string }>\n }\n | undefined,\n say: Say\n): string | null {\n if (!notice) return null\n const lines: string[] = []\n const still = notice.released.filter(r => !r.control).map(r => r.part)\n if (still.length) lines.push(say('figure.text.removal-released', { parts: still.join(', ') }))\n for (const r of notice.released.filter(r => r.control)) lines.push(say('figure.text.removal-released-motion', { part: r.part, control: r.control! }))\n for (const c of notice.controls) lines.push(say('figure.text.removal-own-control', { part: c.part, control: c.control, min: numberOf(c.min), max: numberOf(c.max) }))\n const fixed = [...new Set(notice.fixed.map(f => f.part))]\n if (fixed.length) lines.push(say('figure.text.removal-fixed', { parts: fixed.join(', ') }))\n if (notice.bindings?.length) lines.push(say('figure.text.removal-bindings', { places: notice.bindings.map(b => b.label ?? b.id).join(', ') }))\n if (notice.mountingFace) lines.push(say('figure.text.removal-mounting-face', {}))\n return lines.length ? lines.join(' ') : null\n}\n\n/**\n * A recipe refused at one of its steps: which step, and why -- the particular sentence when there is one (a size\n * range, a value's range, a placement), otherwise the kernel's code. The step is the refusal's path, `steps[2]`: the\n * contract's path grammar, not its English (ADR-0127 decision 6).\n */\nexport function recipeRefusalOf(error: unknown, say: Say): string | null {\n const step = /^steps\\[(\\d+)\\]$/.exec((error as { path?: string })?.path ?? '')\n if (!step) return null\n const why = sizeRangeRefusalOf(error, say) ?? inputRangeRefusalOf(error, say) ?? placementRefusalOf(error, say)\n return say('figure.text.recipe-step-refused', { step: String(Number(step[1]) + 1), why: why ?? '', code: codeOf(error) ?? '' })\n}\n\n/**\n * A corner or an inside the part cannot take (ADR-0100 stage 1): what was too large or too thick, or what holds on\n * to what the edit would take away.\n */\nfunction sectionRefusalOf(error: unknown, say: Say): string | null {\n const mapping = detailsOf(error, 'faces-taken-away')\n if (mapping) return say('figure.text.section-face-in-use', { faces: mapping.lost.map(l => say('figure.label.face-' + l.face, {})).join(', ') })\n if (codeOf(error) === 'DIMENSION_LINKED') return say('figure.text.section-dimension-linked', {})\n if (detailsOf(error, 'section-invalid')?.issues.some(i => i.code === 'CORNER_TOO_LARGE')) return say('figure.text.section-corner-too-large', {})\n const inside = detailsOf(error, 'inside-invalid')?.refusal\n if (inside?.code === 'CAVITY' && inside.refused === 'NO_ROOM_INSIDE') return say('figure.text.section-wall-too-thick', {})\n if (inside?.code === 'CAVITY_NO_LENGTH') return say('figure.text.section-ends-too-thick', {})\n return null\n}\n\n/**\n * A slot layout refused (ADR-0118): the anchor, slot or value it was refused for. The layout's own findings are named\n * by where they are; the editor checks them before Apply, so they rarely reach here.\n */\nexport function slotLayoutRefusalOf(error: unknown, say: Say): string | null {\n if (detailsOf(error, 'slot-layout-label-missing')) return say('figure.text.slot-layout-label-missing', {})\n if (detailsOf(error, 'slot-anchors-missing')) return say('figure.text.slot-anchors-missing', {})\n const twice = detailsOf(error, 'slot-anchor-duplicate')\n if (twice) return say('figure.text.slot-anchor-duplicate', { anchor: twice.anchor })\n const flat = detailsOf(error, 'slot-anchor-not-flat')\n if (flat) return say('figure.text.slot-anchor-not-flat', { anchor: flat.anchor, part: flat.part })\n const gone = detailsOf(error, 'slot-anchor-no-part')\n if (gone) return say('figure.text.slot-anchor-no-part', { anchor: gone.anchor, part: gone.part })\n const issues = detailsOf(error, 'slot-layout-issues')\n if (issues) return say('figure.text.slot-layout-issues', { path: issues.issues[0]?.path ?? '' })\n const empty = detailsOf(error, 'slot-accepts-empty')\n if (empty) return say('figure.text.slot-accepts-empty', { slot: empty.slot })\n const taken = detailsOf(error, 'slot-id-taken')\n if (taken) return say('figure.text.slot-id-taken', { slot: taken.slot })\n return null\n}\n\n/** The figure's limits: its nodes, its size saved, how deep it nests. */\nfunction documentLimitRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'DOCUMENT_LIMIT') return null\n const nodes = detailsOf(error, 'node-limit')\n if (nodes) return say('figure.text.edit-refused-node-limit', { max: String(nodes.max) })\n const large = detailsOf(error, 'document-too-large')\n if (large)\n return large.at === undefined\n ? say('figure.text.document-too-large-unmeasured', { max: kibOf(large.max) })\n : say('figure.text.document-too-large', { max: kibOf(large.max), at: kibOf(large.at) })\n const deep = detailsOf(error, 'nesting-too-deep')\n if (deep) return say('figure.text.document-nesting-too-deep', { max: String(deep.max), at: String(deep.at) })\n return null\n}\n\n/**\n * A refusal in the author's words when the screen has words for it, otherwise said as a refusal with its code -- never\n * the kernel's English on the screen (the duplicate of a row's part showed 「EDIT_TARGET: … not a repeated template」,\n * 2026-09-27).\n */\nexport function editRefusalOf(error: unknown, say: Say): string {\n return (\n sizeRangeRefusalOf(error, say) ??\n inputRangeRefusalOf(error, say) ??\n repeatPitchRefusalOf(error, say) ??\n rowLimitRefusalOf(error, say) ??\n placementRefusalOf(error, say) ??\n partNameRefusalOf(error, say) ??\n documentLimitRefusalOf(error, say) ??\n sectionRefusalOf(error, say) ??\n slotLayoutRefusalOf(error, say) ??\n dataMotionRefusalOf(error, say) ??\n say('figure.text.edit-refused', { code: codeOf(error) ?? '' })\n )\n}\n\n/**\n * A data property, a connection, a motion group or a clip's tracks refused (ADR-0051 §2.2, §3.2), said with the ids and\n * numbers the kernel gave. Nothing for any other refusal.\n */\nexport function dataMotionRefusalOf(error: unknown, say: Say): string | null {\n const invalidId = detailsOf(error, 'data-id-invalid')\n if (invalidId) return say('figure.text.data-id-invalid', { id: invalidId.id })\n const twice = detailsOf(error, 'data-id-duplicate')\n if (twice) return say('figure.text.data-id-duplicate', { id: twice.id })\n const property = detailsOf(error, 'data-property-invalid')\n if (property) return say('figure.text.data-property-invalid-' + property.field, { property: property.property })\n const absent = detailsOf(error, 'data-property-absent')\n if (absent) return say('figure.text.data-property-absent', { property: absent.property })\n const target = detailsOf(error, 'data-target-absent')\n if (target) return say('figure.text.data-target-absent-' + target.target, { id: target.id })\n const writers = detailsOf(error, 'data-target-duplicate')\n if (writers) return say('figure.text.data-target-duplicate', { a: writers.connections[0], b: writers.connections[1], id: writers.id })\n const domain = detailsOf(error, 'data-transform-domain')\n if (domain)\n return say('figure.text.data-transform-' + domain.why, {\n from: domain.from ?? '',\n to: domain.to ?? '',\n min: domain.min === undefined ? '' : numberOf(domain.min),\n max: domain.max === undefined ? '' : numberOf(domain.max),\n low: domain.within ? numberOf(domain.within[0]) : '',\n high: domain.within ? numberOf(domain.within[1]) : '',\n value: domain.value === undefined ? '' : String(domain.value)\n })\n const connected = detailsOf(error, 'data-property-connected')\n if (connected) return say('figure.text.data-property-connected', { property: connected.property, connections: connected.connections.join(', ') })\n const clipAbsent = detailsOf(error, 'motion-clip-absent')\n if (clipAbsent) return say('figure.text.motion-clip-absent', { clip: clipAbsent.clip, group: clipAbsent.group })\n const shared = detailsOf(error, 'motion-clip-shared')\n if (shared) return say('figure.text.motion-clip-shared', { clip: shared.clip, group: shared.groups[0] })\n const many = detailsOf(error, 'driver-writers')\n if (many) return say('figure.text.driver-writers', { state: many.state, clips: many.clips.join(', ') })\n const which = detailsOf(error, 'driver-clip-required')\n if (which) return say('figure.text.driver-clip-required', { state: which.state, clips: which.clips.join(', ') })\n const setting = detailsOf(error, 'motion-setting')\n if (setting) return say('figure.text.motion-setting-' + setting.why, { group: setting.group, clip: setting.clip ?? '' })\n const key = codeOf(error) === 'MOTION_GROUP' ? detailsOf(error, 'value-outside-range') : undefined\n if (key) return say('figure.text.motion-key-outside-range', { input: key.input, value: numberOf(key.value), min: numberOf(key.min), max: numberOf(key.max) })\n return null\n}\n\n/**\n * A value outside the range its input declares, with the range and the value given. The figure's own size is named by\n * its axis; any other input by its range only.\n */\nexport function inputRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INPUT_RANGE') return null\n const range = detailsOf(error, 'value-outside-range')\n if (!range) return null\n const axis = (Object.entries(FIGURE_INSTANCE_SIZE_INPUTS) as Array<[string, string]>).find(([, id]) => id === range.input)?.[0]\n const params = { value: numberOf(range.value), min: numberOf(range.min), max: numberOf(range.max) }\n return axis ? say('figure.text.input-range-size', { ...params, axis: axis.toUpperCase() }) : say('figure.text.input-range', params)\n}\n\n/**\n * A row past its limits: a pitch so fine it would hold more copies than a row takes, a row that would expand to more\n * bodies than a figure draws, a number of copies outside what a row may have or more than its length holds apart, a\n * row inside a row along the same axis, or a part whose face something holds made into a row.\n */\nexport function rowLimitRefusalOf(error: unknown, say: Say): string | null {\n const copies = detailsOf(error, 'copies-over-limit')\n if (copies) return say('figure.text.row-copies-over-limit', { count: copies.count.toLocaleString(), limit: copies.limit.toLocaleString() })\n const bodies = detailsOf(error, 'geometry-over-limit')\n if (bodies) return say('figure.text.row-geometry-over-limit', { count: bodies.count.toLocaleString(), limit: bodies.limit.toLocaleString() })\n const count = detailsOf(error, 'row-copies-out-of-range')\n if (count) return say('figure.text.row-copies-out-of-range', { count: count.count.toLocaleString(), min: String(count.min), max: String(count.max) })\n const fit = detailsOf(error, 'row-does-not-fit')\n if (fit) return say('figure.text.row-does-not-fit', { count: fit.count.toLocaleString(), length: mmOf(fit.length), extent: mmOf(fit.extent) })\n const axis = detailsOf(error, 'row-same-axis')\n if (axis) return say('figure.text.row-same-axis', { part: axis.part, outer: axis.outer, axis: axis.axis.toUpperCase() })\n const held = detailsOf(error, 'surface-on-row')\n if (held) return say(`figure.text.row-face-held-${heldByOf(held.at)}`, { part: held.part })\n return null\n}\n\n/* What holds a face, from the contract path the kernel names it by: the slot layout, a place, the footprint. */\nconst heldByOf = (at: string) => (at.startsWith('slotLayout') ? 'slot-layout' : at.startsWith('bindings') ? 'place' : at.startsWith('occupancy') ? 'footprint' : 'other')\n\n/** A row's pitch under which the figure, at the length it is authored, would hold more copies than a row takes. */\nexport function repeatPitchRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INPUT_RANGE') return null\n const pitch = detailsOf(error, 'pitch-too-many-copies')\n if (!pitch) return null\n return say('figure.text.repeat-pitch-too-small', { length: pitch.length.toLocaleString(), min: String(pitch.least), limit: String(pitch.limit) })\n}\n\n/**\n * Why \"follow the size and keep where the figure is placed\" was not applied, in the author's words (ADR-0097): the plan\n * says what it would have had to overwrite, and for a part through the plane how far. A code the screen has no words\n * for is said as a refusal with its code, never in the kernel's English.\n */\nexport function resizeRefusalOf(plan: { mode: string; refusal?: { code: string; axis?: string; mm?: number } }, part: string, say: Say): string {\n const refusal = plan.refusal\n if (!refusal) return ''\n const place = say(`figure.label.resize-place-${plan.mode}`, {})\n const params = { part, place, axis: (refusal.axis ?? '').toUpperCase(), mm: refusal.mm === undefined ? '' : String(Math.round(refusal.mm)) }\n const known = ['HELD', 'TURNED', 'UNIFORM_POLICY', 'SHAPE_EDIT', 'DIMENSION_RULE', 'POSITION_RULE', 'GAP_CHOICE', 'NO_FACE']\n if (known.includes(refusal.code)) return say(`figure.text.resize-refused-${refusal.code.toLowerCase().replace(/_/g, '-')}`, params)\n return say('figure.text.edit-refused', { code: refusal.code })\n}\n"]}