@things-factory/figure-ui 10.1.223 → 10.1.224

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 (59) hide show
  1. package/client/modeller/canvas.ts +2 -2
  2. package/client/modeller/consumer-capabilities.ts +66 -0
  3. package/client/modeller/data-interface.ts +230 -80
  4. package/client/modeller/editor.ts +14 -7
  5. package/client/modeller/figure-capability-panel.ts +145 -1
  6. package/client/modeller/figure-data-panel.ts +495 -188
  7. package/client/modeller/figure-links.ts +130 -12
  8. package/client/modeller/figure-preview.ts +19 -2
  9. package/client/modeller/figure-slot-layout-panel.ts +7 -3
  10. package/client/modeller/links.ts +58 -0
  11. package/client/modeller/refusals.ts +12 -4
  12. package/client/modeller/slot-layout-host.ts +76 -5
  13. package/dist-client/modeller/canvas.js +2 -2
  14. package/dist-client/modeller/canvas.js.map +1 -1
  15. package/dist-client/modeller/consumer-capabilities.d.ts +29 -0
  16. package/dist-client/modeller/consumer-capabilities.js +60 -0
  17. package/dist-client/modeller/consumer-capabilities.js.map +1 -0
  18. package/dist-client/modeller/data-interface.d.ts +83 -17
  19. package/dist-client/modeller/data-interface.js +194 -82
  20. package/dist-client/modeller/data-interface.js.map +1 -1
  21. package/dist-client/modeller/editor.d.ts +5 -2
  22. package/dist-client/modeller/editor.js +16 -5
  23. package/dist-client/modeller/editor.js.map +1 -1
  24. package/dist-client/modeller/figure-capability-panel.d.ts +12 -0
  25. package/dist-client/modeller/figure-capability-panel.js +123 -1
  26. package/dist-client/modeller/figure-capability-panel.js.map +1 -1
  27. package/dist-client/modeller/figure-data-panel.d.ts +57 -13
  28. package/dist-client/modeller/figure-data-panel.js +461 -180
  29. package/dist-client/modeller/figure-data-panel.js.map +1 -1
  30. package/dist-client/modeller/figure-links.d.ts +11 -0
  31. package/dist-client/modeller/figure-links.js +137 -16
  32. package/dist-client/modeller/figure-links.js.map +1 -1
  33. package/dist-client/modeller/figure-preview.d.ts +4 -0
  34. package/dist-client/modeller/figure-preview.js +19 -1
  35. package/dist-client/modeller/figure-preview.js.map +1 -1
  36. package/dist-client/modeller/figure-slot-layout-panel.js +6 -4
  37. package/dist-client/modeller/figure-slot-layout-panel.js.map +1 -1
  38. package/dist-client/modeller/links.d.ts +22 -0
  39. package/dist-client/modeller/links.js +48 -0
  40. package/dist-client/modeller/links.js.map +1 -1
  41. package/dist-client/modeller/refusals.js +14 -6
  42. package/dist-client/modeller/refusals.js.map +1 -1
  43. package/dist-client/modeller/slot-layout-host.d.ts +28 -3
  44. package/dist-client/modeller/slot-layout-host.js +68 -6
  45. package/dist-client/modeller/slot-layout-host.js.map +1 -1
  46. package/dist-client/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +7 -7
  48. package/test/browser/data-table-page.js +9 -0
  49. package/test/browser/links.check.mjs +25 -3
  50. package/test/consumer-capabilities.test.ts +116 -0
  51. package/test/data-motion.test.ts +94 -27
  52. package/test/links.test.ts +15 -0
  53. package/test/slot-layout-host.test.ts +63 -5
  54. package/translations/en.json +81 -23
  55. package/translations/es.json +81 -23
  56. package/translations/ja.json +81 -23
  57. package/translations/ko.json +81 -23
  58. package/translations/ms.json +81 -23
  59. package/translations/zh.json +81 -23
@@ -1 +1 @@
1
- {"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../client/modeller/refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,2BAA2B,EAA2E,MAAM,wBAAwB,CAAA;AAK7I,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,CA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AG,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, type FigureSizeRangeFit } 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/**\n * The ends an author typed for the size on a drawing, refused: they leave out the size the figure is drawn at, or start\n * at zero. The only refusals the size range has left (ADR-0087 decision 6); nothing for any other refusal.\n */\nexport function sizeRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const outside = detailsOf(error, 'size-outside-range')\n if (outside)\n return say('figure.text.size-range-leaves-out-size', {\n axis: say(`figure.label.resize-${outside.axis}`, {}),\n range: `${mmOf(outside.min ?? 0)} – ${outside.max === undefined ? '∞' : mmOf(outside.max)}`,\n at: mmOf(outside.at)\n })\n const zero = detailsOf(error, 'size-min-not-positive')\n if (zero) return say('figure.text.size-range-from-zero', { axis: say(`figure.label.resize-${zero.axis}`, {}) })\n return null\n}\n\n/** What a command did to the ends the author typed, in one line each: what moved, from what to what. */\nexport function sizeRangeFitsOf(fits: readonly FigureSizeRangeFit[], say: Say): string {\n return fits\n .map(f => say(`figure.text.size-range-moved-${f.bound}`, { axis: say(`figure.label.resize-${f.axis}`, {}), from: mmOf(f.from), to: mmOf(f.to) }))\n .join(' ')\n}\n\n/**\n * A placement refused because a part is fastened to the mounting plane in a way the new plane does not take (standing\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', { parts: misfit.parts.map(p => p.part).join(', ') })\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/**\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 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 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 */\n/** The modeller session's own refusals (`product-session.ts`), by their code. Nothing for any other refusal. */\nconst SESSION_REFUSALS: Record<string, string> = {\n SESSION_NOT_OPEN: 'figure.text.session-not-open',\n SESSION_SAVING: 'figure.text.session-saving',\n SESSION_VERSION_MISSING: 'figure.text.session-version-missing',\n SESSION_NEW_FIGURE_TOUCHED: 'figure.text.session-new-figure-touched',\n SESSION_PROPOSAL_KEY: 'figure.text.session-proposal-key'\n}\nexport function sessionRefusalOf(error: unknown, say: Say): string | null {\n const key = SESSION_REFUSALS[codeOf(error) ?? '']\n return key ? say(key, {}) : null\n}\n\nexport function editRefusalOf(error: unknown, say: Say): string {\n return (\n sessionRefusalOf(error, say) ??\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 field, a binding, a status port, a motion group or a clip's tracks refused (ADR-0051 §8, §3.2), said with the ids\n * and 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 field = detailsOf(error, 'data-field-invalid')\n if (field) return say('figure.text.data-field-invalid-' + field.what, {})\n const fieldTwice = detailsOf(error, 'data-field-duplicate')\n if (fieldTwice) return say('figure.text.data-field-duplicate', { name: fieldTwice.name })\n const accessor = detailsOf(error, 'data-accessor-invalid')\n if (accessor) return say('figure.text.data-accessor-invalid-' + accessor.why, { accessor: accessor.accessor })\n const behavior = detailsOf(error, 'data-behavior-absent')\n if (behavior) return say('figure.text.data-behavior-absent-' + behavior.behavior, { id: behavior.id })\n const writers = detailsOf(error, 'data-behavior-duplicate')\n if (writers) return say('figure.text.data-behavior-duplicate', { a: writers.bindings[0], b: writers.bindings[1], id: writers.id })\n const domain = detailsOf(error, 'data-rule-domain')\n if (domain)\n return say('figure.text.data-rule-' + 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 port = detailsOf(error, 'data-port-invalid')\n if (port) return say('figure.text.data-port-invalid-' + port.what, { port: port.port, id: port.id ?? '' })\n const bound = detailsOf(error, 'data-port-bound')\n if (bound) return say('figure.text.data-port-bound', { port: bound.port, bindings: bound.bindings.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: range.min === undefined ? '−∞' : numberOf(range.min), max: range.max === undefined ? '∞' : 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,EAA2E,MAAM,wBAAwB,CAAA;AAK7I,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAE,KAA8C,EAAE,IAA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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, type FigureSizeRangeFit } 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/**\n * The ends an author typed for the size on a drawing, refused: they leave out the size the figure is drawn at, or start\n * at zero. The only refusals the size range has left (ADR-0087 decision 6); nothing for any other refusal.\n */\nexport function sizeRangeRefusalOf(error: unknown, say: Say): string | null {\n if (codeOf(error) !== 'INSTANCE_SIZE_RANGE') return null\n const outside = detailsOf(error, 'size-outside-range')\n if (outside)\n return say('figure.text.size-range-leaves-out-size', {\n axis: say(`figure.label.resize-${outside.axis}`, {}),\n range: `${mmOf(outside.min ?? 0)} – ${outside.max === undefined ? '∞' : mmOf(outside.max)}`,\n at: mmOf(outside.at)\n })\n const zero = detailsOf(error, 'size-min-not-positive')\n if (zero) return say('figure.text.size-range-from-zero', { axis: say(`figure.label.resize-${zero.axis}`, {}) })\n return null\n}\n\n/** What a command did to the ends the author typed, in one line each: what moved, from what to what. */\nexport function sizeRangeFitsOf(fits: readonly FigureSizeRangeFit[], say: Say): string {\n return fits\n .map(f => say(`figure.text.size-range-moved-${f.bound}`, { axis: say(`figure.label.resize-${f.axis}`, {}), from: mmOf(f.from), to: mmOf(f.to) }))\n .join(' ')\n}\n\n/**\n * A placement refused because a part is fastened to the mounting plane in a way the new plane does not take (standing\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', { parts: misfit.parts.map(p => p.part).join(', ') })\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/**\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 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 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 */\n/** The modeller session's own refusals (`product-session.ts`), by their code. Nothing for any other refusal. */\nconst SESSION_REFUSALS: Record<string, string> = {\n SESSION_NOT_OPEN: 'figure.text.session-not-open',\n SESSION_SAVING: 'figure.text.session-saving',\n SESSION_VERSION_MISSING: 'figure.text.session-version-missing',\n SESSION_NEW_FIGURE_TOUCHED: 'figure.text.session-new-figure-touched',\n SESSION_PROPOSAL_KEY: 'figure.text.session-proposal-key'\n}\nexport function sessionRefusalOf(error: unknown, say: Say): string | null {\n const key = SESSION_REFUSALS[codeOf(error) ?? '']\n return key ? say(key, {}) : null\n}\n\nexport function editRefusalOf(error: unknown, say: Say): string {\n return (\n sessionRefusalOf(error, say) ??\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 field, a binding, a status port, a motion group or a clip's tracks refused (ADR-0051 §8, §3.2), said with the ids\n * and 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 field = detailsOf(error, 'data-field-invalid')\n if (field) return say('figure.text.data-field-invalid-' + field.what, {})\n const fieldTwice = detailsOf(error, 'data-field-duplicate')\n if (fieldTwice) return say('figure.text.data-field-duplicate', { name: fieldTwice.name })\n const accessor = detailsOf(error, 'data-accessor-invalid')\n if (accessor) return say('figure.text.data-accessor-invalid-' + accessor.why, { accessor: accessor.accessor })\n const behavior = detailsOf(error, 'data-behavior-absent')\n if (behavior) return say('figure.text.data-behavior-absent-' + behavior.behavior, { id: behavior.id })\n const writers = detailsOf(error, 'data-behavior-duplicate')\n if (writers) return say('figure.text.data-behavior-duplicate', { a: writers.bindings[0], b: writers.bindings[1], id: writers.id })\n const domain = detailsOf(error, 'data-rule-domain')\n if (domain)\n return say('figure.text.data-rule-' + 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 target = detailsOf(error, 'data-table-target')\n if (target) return say('figure.text.data-table-target-' + target.what, { binding: target.binding, id: target.id ?? '' })\n const entry = detailsOf(error, 'data-table-entry')\n if (entry)\n return say('figure.text.data-table-entry-' + entry.what, {\n binding: entry.binding,\n key: entry.key === 'default' ? say('figure.label.data-otherwise', {}) : entry.key,\n id: entry.id ?? '',\n value: entry.value === undefined ? '' : String(typeof entry.value === 'object' ? JSON.stringify(entry.value) : entry.value)\n })\n const legend = detailsOf(error, 'data-legend-invalid')\n if (legend) return say('figure.text.data-legend-invalid', { role: legend.role })\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: range.min === undefined ? '−∞' : numberOf(range.min), max: range.max === undefined ? '∞' : 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,4 +1,4 @@
1
- import { type FigureAsset, type SlotLayout, type SlotPresetSize } from '@hatiolab/figure-model';
1
+ import { figureShapeBoundsOf, type FigureAsset, type SlotLayout, type SlotPresetSize } from '@hatiolab/figure-model';
2
2
  import type { FigureRenderPart } from './renderer.js';
3
3
  export type SlotAnchorFace = 'top' | 'bottom';
4
4
  export interface SlotAnchor {
@@ -23,8 +23,17 @@ export declare function slotLayoutFormOf(asset: FigureAsset, part: string): {
23
23
  form: SlotLayoutForm;
24
24
  layout?: SlotLayout;
25
25
  };
26
- /** How big each anchor's face is: things-scene's, the one a board's placed figure is measured with too. */
27
- export { figureAnchorFacesOf as anchorFacesOf } from '@hatiolab/things-scene';
26
+ /** How big each anchor's face is, and the room the figure leaves over it: things-scene's, the ones a board's placed figure is measured with too. */
27
+ export { figureAnchorFacesOf as anchorFacesOf, figureAnchorRoomOf as anchorRoomOf } from '@hatiolab/things-scene';
28
+ /**
29
+ * Where an author starts with no numbers to type (slot layout drawn on the face, step 1): the first anchor's face, and a
30
+ * slot as high as the room the figure leaves over it (a forklift's forks: up to its mast) -- the face's shorter side when
31
+ * the face is the figure's top. Nothing when the face is not known: the editor then asks for the size.
32
+ */
33
+ export declare function startSizeOf(anchors: readonly SlotAnchor[], faces: Record<string, {
34
+ width: number;
35
+ depth: number;
36
+ }>, room: Record<string, number>): Partial<SlotPresetSize>;
28
37
  /**
29
38
  * Where an author starts: the equipment presets (figure-model, ADR-0118 decision 8), laid out on this figure's anchors --
30
39
  * a one-anchor preset on the first, a twin fork on the first two. A single slot stands on a top and hangs from a bottom.
@@ -54,6 +63,7 @@ export declare function slotLayoutCommandOf(form: SlotLayoutForm, layout: SlotLa
54
63
  /** A new anchor's id: the part's, or the part's with a number when that is taken. */
55
64
  export declare function anchorIdFor(part: string, taken: readonly string[]): string;
56
65
  export declare const SLOT_MARK = "__slot";
66
+ export declare const SLOT_MARK_CHOSEN = "__slot_chosen";
57
67
  type Evaluated = {
58
68
  id: string;
59
69
  pose: {
@@ -69,3 +79,18 @@ type Evaluated = {
69
79
  * place -- or hanging from it, for a tier that hangs things -- so an author sees where every slot of the rule falls.
70
80
  */
71
81
  export declare function slotMarksOf(places: readonly Evaluated[], layout: SlotLayout | undefined): FigureRenderPart[];
82
+ type Body = {
83
+ id: string;
84
+ shape?: Parameters<typeof figureShapeBoundsOf>[0];
85
+ pose?: {
86
+ r: number[][];
87
+ t: number[];
88
+ };
89
+ };
90
+ /**
91
+ * The places held one by one -- a forklift's fork, a lift's plate -- drawn where they are, as the slot layout's are: a
92
+ * place given a size as a box of that size out of its face, one without as its part's face raised as high as a slot
93
+ * would start there (the room over it, else the face's shorter side), so an author sees which face things sit on or
94
+ * hang from and about how much room they have. The selected part's places in the primary colour.
95
+ */
96
+ export declare function placeMarksOf(places: readonly Evaluated[], asset: FigureAsset, geometry: readonly Body[], selected?: string): FigureRenderPart[];
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Kept free of Lit, i18n and the editor's element so node tests read it directly.
10
10
  */
11
- import { figureSlotLayoutOf, figureSlotLayoutIssues, slotLayoutPreset, SLOT_LAYOUT_PRESET_KEYS, SLOT_LAYOUT_PRESET_PARAMS } from '@hatiolab/figure-model';
11
+ import { figureBindingsOf, figureShapeBoundsOf, figureSlotLayoutOf, figureSlotLayoutIssues, slotLayoutPreset, SLOT_LAYOUT_PRESET_KEYS, SLOT_LAYOUT_PRESET_PARAMS } from '@hatiolab/figure-model';
12
12
  /** The figure's layout as the form and the layout, or a form to start one from on the selected part's top. */
13
13
  export function slotLayoutFormOf(asset, part) {
14
14
  const had = figureSlotLayoutOf(asset);
@@ -16,8 +16,23 @@ export function slotLayoutFormOf(asset, part) {
16
16
  return { form: { label: had.label, role: had.role, anchors: had.anchors.map(a => ({ ...a, face: a.face })) }, layout: had.layout };
17
17
  return { form: { label: '', role: 'seat', anchors: part ? [{ id: part, part, face: 'top' }] : [] } };
18
18
  }
19
- /** How big each anchor's face is: things-scene's, the one a board's placed figure is measured with too. */
20
- export { figureAnchorFacesOf as anchorFacesOf } from '@hatiolab/things-scene';
19
+ /** How big each anchor's face is, and the room the figure leaves over it: things-scene's, the ones a board's placed figure is measured with too. */
20
+ export { figureAnchorFacesOf as anchorFacesOf, figureAnchorRoomOf as anchorRoomOf } from '@hatiolab/things-scene';
21
+ import { figureAnchorRoomOf } from '@hatiolab/things-scene';
22
+ /* How high a place over a face is when nobody said: the room the figure leaves over it, else the face's shorter side. */
23
+ const heightOver = (room, width, depth) => ((room ?? 0) > 0 ? room : Math.min(width, depth));
24
+ /**
25
+ * Where an author starts with no numbers to type (slot layout drawn on the face, step 1): the first anchor's face, and a
26
+ * slot as high as the room the figure leaves over it (a forklift's forks: up to its mast) -- the face's shorter side when
27
+ * the face is the figure's top. Nothing when the face is not known: the editor then asks for the size.
28
+ */
29
+ export function startSizeOf(anchors, faces, room) {
30
+ const first = anchors[0];
31
+ const face = first && faces[first.id];
32
+ if (!face)
33
+ return {};
34
+ return { width: face.width, depth: face.depth, slotHeight: heightOver(room[first.id], face.width, face.depth) };
35
+ }
21
36
  /**
22
37
  * Where an author starts: the equipment presets (figure-model, ADR-0118 decision 8), laid out on this figure's anchors --
23
38
  * a one-anchor preset on the first, a twin fork on the first two. A single slot stands on a top and hangs from a bottom.
@@ -35,13 +50,13 @@ export function slotPresetsOf(anchors) {
35
50
  }));
36
51
  }
37
52
  /*
38
- * What figure-model asks beyond the editor's own checks: every slot names the types it takes (ADR-0118 decision 5) -- the
39
- * editor's "any type" is a board's, not a figure's. The kernel's own check (`figureSlotLayoutIssues`, the one a
53
+ * What figure-model asks beyond the editor's own checks: a slot names the types it takes or takes any item, never an
54
+ * empty list (ADR-0051 §4.1 decision 5, 2026-10-27). The kernel's own check (`figureSlotLayoutIssues`, the one a
40
55
  * placement's override is held to as well), said before Apply rather than refused after it; the editor already shows the
41
56
  * common findings, so only the figure's own are added.
42
57
  */
43
58
  export function figureSlotIssues(layout, anchors = layout.tiers.map(t => t.anchorId)) {
44
- return figureSlotLayoutIssues(layout, anchors).filter(issue => issue.code === 'ACCEPTS_REQUIRED');
59
+ return figureSlotLayoutIssues(layout, anchors).filter(issue => issue.code === 'ACCEPTS_EMPTY');
45
60
  }
46
61
  /** The command the panel sends: the whole layout, its anchors and its name, as one step of the history. */
47
62
  export function slotLayoutCommandOf(form, layout, fallbackLabel) {
@@ -64,6 +79,8 @@ export function anchorIdFor(part, taken) {
64
79
  }
65
80
  /* The token the canvas draws slots in: translucent, never picked, never saved. */
66
81
  export const SLOT_MARK = '__slot';
82
+ /* The token the selected part's places are drawn in: the same box, in the primary colour, so the list and the canvas meet. */
83
+ export const SLOT_MARK_CHOSEN = '__slot_chosen';
67
84
  /**
68
85
  * The unfolded slots as boxes the canvas draws (ADR-0118 decision 4): each as big as what it allows, standing on its
69
86
  * place -- or hanging from it, for a tier that hangs things -- so an author sees where every slot of the rule falls.
@@ -92,4 +109,49 @@ export function slotMarksOf(places, layout) {
92
109
  }
93
110
  return marks;
94
111
  }
112
+ /* Which way each face looks out of its part: the axis and the side. */
113
+ const OUTWARD = { top: ['y', 1], bottom: ['y', -1], right: ['x', 1], left: ['x', -1], front: ['z', 1], back: ['z', -1] };
114
+ /* The two axes a face lies along. */
115
+ const ACROSS = { x: ['y', 'z'], y: ['x', 'z'], z: ['x', 'y'] };
116
+ /**
117
+ * The places held one by one -- a forklift's fork, a lift's plate -- drawn where they are, as the slot layout's are: a
118
+ * place given a size as a box of that size out of its face, one without as its part's face raised as high as a slot
119
+ * would start there (the room over it, else the face's shorter side), so an author sees which face things sit on or
120
+ * hang from and about how much room they have. The selected part's places in the primary colour.
121
+ */
122
+ export function placeMarksOf(places, asset, geometry, selected) {
123
+ const at = new Map(places.map(p => [p.id, p]));
124
+ const marks = [];
125
+ for (const one of figureBindingsOf(asset)) {
126
+ const p = at.get(one.id);
127
+ if (one.slot || !one.face || !p)
128
+ continue;
129
+ const [axis, side] = OUTWARD[one.face];
130
+ const [u, v] = ACROSS[axis];
131
+ let size;
132
+ if (one.region)
133
+ size = one.region;
134
+ else {
135
+ const shape = geometry.find(g => g.id === one.part)?.shape;
136
+ if (!shape)
137
+ continue;
138
+ const b = figureShapeBoundsOf(shape);
139
+ const face = { x: b.x.max - b.x.min, y: b.y.max - b.y.min, z: b.z.max - b.z.min };
140
+ const room = axis === 'y' ? figureAnchorRoomOf([{ id: one.id, part: one.part, face: one.face }], geometry)[one.id] : 0;
141
+ size = { ...face, [axis]: heightOver(room, face[u], face[v]) };
142
+ }
143
+ const out = size[axis];
144
+ marks.push({
145
+ id: `${SLOT_MARK}:${one.id}`,
146
+ shape: {
147
+ provider: 'extrude',
148
+ dimensions: { width: size.x, height: size.y, depth: size.z },
149
+ extrusion: { axis, section: { kind: 'rectangle', size: { [u]: size[u], [v]: size[v] } }, start: side > 0 ? 0 : -out, end: side > 0 ? out : 0 }
150
+ },
151
+ pose: p.pose,
152
+ material: { token: one.part === selected ? SLOT_MARK_CHOSEN : SLOT_MARK, transparent: true }
153
+ });
154
+ }
155
+ return marks;
156
+ }
95
157
  //# sourceMappingURL=slot-layout-host.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slot-layout-host.js","sourceRoot":"","sources":["../../client/modeller/slot-layout-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAI1B,MAAM,wBAAwB,CAAA;AAsB/B,8GAA8G;AAC9G,MAAM,UAAU,gBAAgB,CAAC,KAAkB,EAAE,IAAY;IAC/D,MAAM,GAAG,GAAG,kBAAkB,CAAC,KAAc,CAAC,CAAA;IAC9C,IAAI,GAAG;QAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAA;IAC7J,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAA;AACtG,CAAC;AAED,2GAA2G;AAC3G,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,wBAA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C","sourcesContent":["/*\n * What the Figure modeller gives the shared slot layout editor (`@operato/slot-layout-editor`, the one fmsim hosts too),\n * and what it makes of the editor's result (ADR-0118). The editor edits tiers and slots; the modeller owns the anchors\n * -- a part's top or bottom face, named -- and sends the whole layout as one `set-slot-layout` command.\n *\n * A figure's released slot layout is the only one there is (ADR-0118 decision 8, user): no scene or run overrides it, so\n * this host offers no \"use default\" and no per-instance value.\n *\n * Kept free of Lit, i18n and the editor's element so node tests read it directly.\n */\nimport {\n figureSlotLayoutOf,\n figureSlotLayoutIssues,\n slotLayoutPreset,\n SLOT_LAYOUT_PRESET_KEYS,\n SLOT_LAYOUT_PRESET_PARAMS,\n type FigureAsset,\n type SlotLayout,\n type SlotPresetSize\n} from '@hatiolab/figure-model'\nimport type { FigureRenderPart } from './renderer.js'\n\nexport type SlotAnchorFace = 'top' | 'bottom'\nexport interface SlotAnchor {\n id: string\n part: string\n face: SlotAnchorFace\n}\n/** What the panel edits besides the tiers: the layout's name, what its slots are, and the anchors they stand on. */\nexport interface SlotLayoutForm {\n label: string\n role: 'seat' | 'grip'\n anchors: SlotAnchor[]\n}\n/** A layout problem as the editor shows it: a code, where, and its values. */\nexport interface SlotEditorIssue {\n code: string\n path: string\n params?: Record<string, string | number>\n}\n\n/** The figure's layout as the form and the layout, or a form to start one from on the selected part's top. */\nexport function slotLayoutFormOf(asset: FigureAsset, part: string): { form: SlotLayoutForm; layout?: SlotLayout } {\n const had = figureSlotLayoutOf(asset as never)\n if (had) return { form: { label: had.label, role: had.role, anchors: had.anchors.map(a => ({ ...a, face: a.face as SlotAnchorFace })) }, layout: had.layout }\n return { form: { label: '', role: 'seat', anchors: part ? [{ id: part, part, face: 'top' }] : [] } }\n}\n\n/** How big each anchor's face is: things-scene's, the one a board's placed figure is measured with too. */\nexport { figureAnchorFacesOf as anchorFacesOf } from '@hatiolab/things-scene'\n\n/**\n * Where an author starts: the equipment presets (figure-model, ADR-0118 decision 8), laid out on this figure's anchors --\n * a one-anchor preset on the first, a twin fork on the first two. A single slot stands on a top and hangs from a bottom.\n * The editor's own controls then make it what the equipment is.\n */\nexport function slotPresetsOf(anchors: readonly SlotAnchor[]) {\n const first = anchors[0]\n const on = { ...(first ? { anchor: first.id } : {}), ...(anchors.length >= 2 ? { forks: [anchors[0]!.id, anchors[1]!.id] as [string, string] } : {}) }\n const mount = first?.face === 'bottom' ? ('HANG' as const) : ('ON' as const)\n return SLOT_LAYOUT_PRESET_KEYS.map(key => ({\n key,\n /* The editor names a preset and its values from their keys (@operato/slot-layout-editor's own words). */\n params: SLOT_LAYOUT_PRESET_PARAMS[key].map(p => ({ key: p.key, integer: p.integer })),\n build: (size: SlotPresetSize, params: Record<string, number>) => slotLayoutPreset(key, size, params, { ...on, mount })\n }))\n}\n\n/*\n * What figure-model asks beyond the editor's own checks: every slot names the types it takes (ADR-0118 decision 5) -- the\n * editor's \"any type\" is a board's, not a figure's. The kernel's own check (`figureSlotLayoutIssues`, the one a\n * placement's override is held to as well), said before Apply rather than refused after it; the editor already shows the\n * common findings, so only the figure's own are added.\n */\nexport function figureSlotIssues(layout: SlotLayout, anchors: readonly string[] = layout.tiers.map(t => t.anchorId)): SlotEditorIssue[] {\n return figureSlotLayoutIssues(layout, anchors).filter(issue => issue.code === 'ACCEPTS_REQUIRED')\n}\n\n/** The command the panel sends: the whole layout, its anchors and its name, as one step of the history. */\nexport function slotLayoutCommandOf(form: SlotLayoutForm, layout: SlotLayout, fallbackLabel: string) {\n return {\n kind: 'set-slot-layout' as const,\n label: form.label.trim() || fallbackLabel,\n role: form.role,\n anchors: form.anchors.map(a => ({ id: a.id.trim(), part: a.part, face: a.face })),\n layout: structuredClone(layout)\n }\n}\n\n/** A new anchor's id: the part's, or the part's with a number when that is taken. */\nexport function anchorIdFor(part: string, taken: readonly string[]): string {\n if (!taken.includes(part)) return part\n let n = 2\n while (taken.includes(`${part}_${n}`)) n++\n return `${part}_${n}`\n}\n\n/* The token the canvas draws slots in: translucent, never picked, never saved. */\nexport const SLOT_MARK = '__slot'\n\ntype Evaluated = { id: string; pose: { r: number[][]; t: number[] }; region: { dimensions: number[] } | null }\n\n/**\n * The unfolded slots as boxes the canvas draws (ADR-0118 decision 4): each as big as what it allows, standing on its\n * place -- or hanging from it, for a tier that hangs things -- so an author sees where every slot of the rule falls.\n */\nexport function slotMarksOf(places: readonly Evaluated[], layout: SlotLayout | undefined) {\n if (!layout) return []\n const mountOf = new Map(layout.tiers.map(t => [t.tierNo, t.mount]))\n const marks: FigureRenderPart[] = []\n for (const p of places) {\n const slot = /^t(\\d+)_s\\d+$/.exec(p.id)\n if (!slot || !p.region) continue\n const [width, height, depth] = p.region.dimensions as [number, number, number]\n const down = mountOf.get(Number(slot[1])) === 'HANG'\n marks.push({\n id: `${SLOT_MARK}:${p.id}`,\n shape: {\n provider: 'extrude',\n dimensions: { width, height, depth },\n extrusion: { axis: 'y', section: { kind: 'rectangle', size: { x: width, z: depth } }, start: down ? -height : 0, end: down ? 0 : height }\n },\n pose: p.pose,\n material: { token: SLOT_MARK, transparent: true }\n })\n }\n return marks\n}\n"]}
1
+ {"version":3,"file":"slot-layout-host.js","sourceRoot":"","sources":["../../client/modeller/slot-layout-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAK1B,MAAM,wBAAwB,CAAA;AAsB/B,8GAA8G;AAC9G,MAAM,UAAU,gBAAgB,CAAC,KAAkB,EAAE,IAAY;IAC/D,MAAM,GAAG,GAAG,kBAAkB,CAAC,KAAc,CAAC,CAAA;IAC9C,IAAI,GAAG;QAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAA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IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,EAAE,GAAG,SAAS,IAAI,GAAG,CAAC,EAAE,EAAE;YAC5B,KAAK,EAAE;gBACL,QAAQ,EAAE,SAAS;gBACnB,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE;gBAC5D,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;aAC/I;YACD,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE;SAC7F,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["/*\n * What the Figure modeller gives the shared slot layout editor (`@operato/slot-layout-editor`, the one fmsim hosts too),\n * and what it makes of the editor's result (ADR-0118). The editor edits tiers and slots; the modeller owns the anchors\n * -- a part's top or bottom face, named -- and sends the whole layout as one `set-slot-layout` command.\n *\n * A figure's released slot layout is the only one there is (ADR-0118 decision 8, user): no scene or run overrides it, so\n * this host offers no \"use default\" and no per-instance value.\n *\n * Kept free of Lit, i18n and the editor's element so node tests read it directly.\n */\nimport {\n figureBindingsOf,\n figureShapeBoundsOf,\n figureSlotLayoutOf,\n figureSlotLayoutIssues,\n slotLayoutPreset,\n SLOT_LAYOUT_PRESET_KEYS,\n SLOT_LAYOUT_PRESET_PARAMS,\n type FigureAsset,\n type FigureFace,\n type SlotLayout,\n type SlotPresetSize\n} from '@hatiolab/figure-model'\nimport type { FigureRenderPart } from './renderer.js'\n\nexport type SlotAnchorFace = 'top' | 'bottom'\nexport interface SlotAnchor {\n id: string\n part: string\n face: SlotAnchorFace\n}\n/** What the panel edits besides the tiers: the layout's name, what its slots are, and the anchors they stand on. */\nexport interface SlotLayoutForm {\n label: string\n role: 'seat' | 'grip'\n anchors: SlotAnchor[]\n}\n/** A layout problem as the editor shows it: a code, where, and its values. */\nexport interface SlotEditorIssue {\n code: string\n path: string\n params?: Record<string, string | number>\n}\n\n/** The figure's layout as the form and the layout, or a form to start one from on the selected part's top. */\nexport function slotLayoutFormOf(asset: FigureAsset, part: string): { form: SlotLayoutForm; layout?: SlotLayout } {\n const had = figureSlotLayoutOf(asset as never)\n if (had) return { form: { label: had.label, role: had.role, anchors: had.anchors.map(a => ({ ...a, face: a.face as SlotAnchorFace })) }, layout: had.layout }\n return { form: { label: '', role: 'seat', anchors: part ? [{ id: part, part, face: 'top' }] : [] } }\n}\n\n/** How big each anchor's face is, and the room the figure leaves over it: things-scene's, the ones a board's placed figure is measured with too. */\nexport { figureAnchorFacesOf as anchorFacesOf, figureAnchorRoomOf as anchorRoomOf } from '@hatiolab/things-scene'\nimport { figureAnchorRoomOf } from '@hatiolab/things-scene'\n\n/* How high a place over a face is when nobody said: the room the figure leaves over it, else the face's shorter side. */\nconst heightOver = (room: number | undefined, width: number, depth: number) => ((room ?? 0) > 0 ? room! : Math.min(width, depth))\n\n/**\n * Where an author starts with no numbers to type (slot layout drawn on the face, step 1): the first anchor's face, and a\n * slot as high as the room the figure leaves over it (a forklift's forks: up to its mast) -- the face's shorter side when\n * the face is the figure's top. Nothing when the face is not known: the editor then asks for the size.\n */\nexport function startSizeOf(\n anchors: readonly SlotAnchor[],\n faces: Record<string, { width: number; depth: number }>,\n room: Record<string, number>\n): Partial<SlotPresetSize> {\n const first = anchors[0]\n const face = first && faces[first.id]\n if (!face) return {}\n return { width: face.width, depth: face.depth, slotHeight: heightOver(room[first.id], face.width, face.depth) }\n}\n\n/**\n * Where an author starts: the equipment presets (figure-model, ADR-0118 decision 8), laid out on this figure's anchors --\n * a one-anchor preset on the first, a twin fork on the first two. A single slot stands on a top and hangs from a bottom.\n * The editor's own controls then make it what the equipment is.\n */\nexport function slotPresetsOf(anchors: readonly SlotAnchor[]) {\n const first = anchors[0]\n const on = { ...(first ? { anchor: first.id } : {}), ...(anchors.length >= 2 ? { forks: [anchors[0]!.id, anchors[1]!.id] as [string, string] } : {}) }\n const mount = first?.face === 'bottom' ? ('HANG' as const) : ('ON' as const)\n return SLOT_LAYOUT_PRESET_KEYS.map(key => ({\n key,\n /* The editor names a preset and its values from their keys (@operato/slot-layout-editor's own words). */\n params: SLOT_LAYOUT_PRESET_PARAMS[key].map(p => ({ key: p.key, integer: p.integer })),\n build: (size: SlotPresetSize, params: Record<string, number>) => slotLayoutPreset(key, size, params, { ...on, mount })\n }))\n}\n\n/*\n * What figure-model asks beyond the editor's own checks: a slot names the types it takes or takes any item, never an\n * empty list (ADR-0051 §4.1 decision 5, 2026-10-27). The kernel's own check (`figureSlotLayoutIssues`, the one a\n * placement's override is held to as well), said before Apply rather than refused after it; the editor already shows the\n * common findings, so only the figure's own are added.\n */\nexport function figureSlotIssues(layout: SlotLayout, anchors: readonly string[] = layout.tiers.map(t => t.anchorId)): SlotEditorIssue[] {\n return figureSlotLayoutIssues(layout, anchors).filter(issue => issue.code === 'ACCEPTS_EMPTY')\n}\n\n/** The command the panel sends: the whole layout, its anchors and its name, as one step of the history. */\nexport function slotLayoutCommandOf(form: SlotLayoutForm, layout: SlotLayout, fallbackLabel: string) {\n return {\n kind: 'set-slot-layout' as const,\n label: form.label.trim() || fallbackLabel,\n role: form.role,\n anchors: form.anchors.map(a => ({ id: a.id.trim(), part: a.part, face: a.face })),\n layout: structuredClone(layout)\n }\n}\n\n/** A new anchor's id: the part's, or the part's with a number when that is taken. */\nexport function anchorIdFor(part: string, taken: readonly string[]): string {\n if (!taken.includes(part)) return part\n let n = 2\n while (taken.includes(`${part}_${n}`)) n++\n return `${part}_${n}`\n}\n\n/* The token the canvas draws slots in: translucent, never picked, never saved. */\nexport const SLOT_MARK = '__slot'\n/* The token the selected part's places are drawn in: the same box, in the primary colour, so the list and the canvas meet. */\nexport const SLOT_MARK_CHOSEN = '__slot_chosen'\n\ntype Evaluated = { id: string; pose: { r: number[][]; t: number[] }; region: { dimensions: number[] } | null }\n\n/**\n * The unfolded slots as boxes the canvas draws (ADR-0118 decision 4): each as big as what it allows, standing on its\n * place -- or hanging from it, for a tier that hangs things -- so an author sees where every slot of the rule falls.\n */\nexport function slotMarksOf(places: readonly Evaluated[], layout: SlotLayout | undefined) {\n if (!layout) return []\n const mountOf = new Map(layout.tiers.map(t => [t.tierNo, t.mount]))\n const marks: FigureRenderPart[] = []\n for (const p of places) {\n const slot = /^t(\\d+)_s\\d+$/.exec(p.id)\n if (!slot || !p.region) continue\n const [width, height, depth] = p.region.dimensions as [number, number, number]\n const down = mountOf.get(Number(slot[1])) === 'HANG'\n marks.push({\n id: `${SLOT_MARK}:${p.id}`,\n shape: {\n provider: 'extrude',\n dimensions: { width, height, depth },\n extrusion: { axis: 'y', section: { kind: 'rectangle', size: { x: width, z: depth } }, start: down ? -height : 0, end: down ? 0 : height }\n },\n pose: p.pose,\n material: { token: SLOT_MARK, transparent: true }\n })\n }\n return marks\n}\n\n/* Which way each face looks out of its part: the axis and the side. */\nconst OUTWARD: Record<FigureFace, ['x' | 'y' | 'z', 1 | -1]> = { top: ['y', 1], bottom: ['y', -1], right: ['x', 1], left: ['x', -1], front: ['z', 1], back: ['z', -1] }\n/* The two axes a face lies along. */\nconst ACROSS = { x: ['y', 'z'], y: ['x', 'z'], z: ['x', 'y'] } as const\n\ntype Body = { id: string; shape?: Parameters<typeof figureShapeBoundsOf>[0]; pose?: { r: number[][]; t: number[] } }\n\n/**\n * The places held one by one -- a forklift's fork, a lift's plate -- drawn where they are, as the slot layout's are: a\n * place given a size as a box of that size out of its face, one without as its part's face raised as high as a slot\n * would start there (the room over it, else the face's shorter side), so an author sees which face things sit on or\n * hang from and about how much room they have. The selected part's places in the primary colour.\n */\nexport function placeMarksOf(places: readonly Evaluated[], asset: FigureAsset, geometry: readonly Body[], selected?: string) {\n const at = new Map(places.map(p => [p.id, p] as const))\n const marks: FigureRenderPart[] = []\n for (const one of figureBindingsOf(asset)) {\n const p = at.get(one.id)\n if (one.slot || !one.face || !p) continue\n const [axis, side] = OUTWARD[one.face]\n const [u, v] = ACROSS[axis]\n let size: Record<'x' | 'y' | 'z', number>\n if (one.region) size = one.region\n else {\n const shape = geometry.find(g => g.id === one.part)?.shape\n if (!shape) continue\n const b = figureShapeBoundsOf(shape)\n const face = { x: b.x.max - b.x.min, y: b.y.max - b.y.min, z: b.z.max - b.z.min }\n const room = axis === 'y' ? figureAnchorRoomOf([{ id: one.id, part: one.part!, face: one.face }], geometry as never)[one.id] : 0\n size = { ...face, [axis]: heightOver(room, face[u], face[v]) }\n }\n const out = size[axis]\n marks.push({\n id: `${SLOT_MARK}:${one.id}`,\n shape: {\n provider: 'extrude',\n dimensions: { width: size.x, height: size.y, depth: size.z },\n extrusion: { axis, section: { kind: 'rectangle', size: { [u]: size[u], [v]: size[v] } }, start: side > 0 ? 0 : -out, end: side > 0 ? out : 0 }\n },\n pose: p.pose,\n material: { token: one.part === selected ? SLOT_MARK_CHOSEN : SLOT_MARK, transparent: true }\n })\n }\n return marks\n}\n"]}