@things-factory/figure-ui 10.1.270 → 10.1.272

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 (113) hide show
  1. package/client/graphql/index.ts +2 -0
  2. package/client/modeller/canvas.ts +4 -2
  3. package/client/modeller/clips.ts +74 -4
  4. package/client/modeller/data-interface.ts +14 -0
  5. package/client/modeller/editor-styles.ts +11 -0
  6. package/client/modeller/editor.ts +39 -11
  7. package/client/modeller/fasten-form.ts +73 -3
  8. package/client/modeller/fasten-geometry.ts +11 -1
  9. package/client/modeller/figure-cavity-drawing.ts +1 -3
  10. package/client/modeller/figure-clips.ts +101 -8
  11. package/client/modeller/figure-fasten-dialog.ts +41 -30
  12. package/client/modeller/figure-fasten-drawing.ts +5 -4
  13. package/client/modeller/figure-first-save.ts +4 -3
  14. package/client/modeller/figure-links.ts +85 -28
  15. package/client/modeller/figure-preview.ts +50 -4
  16. package/client/modeller/figure-size-editor.ts +7 -2
  17. package/client/modeller/first-save.ts +8 -0
  18. package/client/modeller/focus-on-render.ts +4 -0
  19. package/client/modeller/palette.ts +27 -0
  20. package/client/modeller/pivot.ts +76 -0
  21. package/client/modeller/product-session.ts +5 -1
  22. package/client/modeller/size-response.ts +14 -0
  23. package/client/modeller/stage-model.ts +50 -6
  24. package/client/types.ts +2 -0
  25. package/dist-client/graphql/index.js +2 -0
  26. package/dist-client/graphql/index.js.map +1 -1
  27. package/dist-client/modeller/canvas.d.ts +1 -0
  28. package/dist-client/modeller/canvas.js +3 -2
  29. package/dist-client/modeller/canvas.js.map +1 -1
  30. package/dist-client/modeller/clips.d.ts +23 -6
  31. package/dist-client/modeller/clips.js +69 -4
  32. package/dist-client/modeller/clips.js.map +1 -1
  33. package/dist-client/modeller/data-interface.d.ts +5 -0
  34. package/dist-client/modeller/data-interface.js +15 -0
  35. package/dist-client/modeller/data-interface.js.map +1 -1
  36. package/dist-client/modeller/editor-styles.js +11 -0
  37. package/dist-client/modeller/editor-styles.js.map +1 -1
  38. package/dist-client/modeller/editor.d.ts +6 -0
  39. package/dist-client/modeller/editor.js +35 -11
  40. package/dist-client/modeller/editor.js.map +1 -1
  41. package/dist-client/modeller/fasten-form.d.ts +8 -0
  42. package/dist-client/modeller/fasten-form.js +68 -5
  43. package/dist-client/modeller/fasten-form.js.map +1 -1
  44. package/dist-client/modeller/fasten-geometry.d.ts +6 -0
  45. package/dist-client/modeller/fasten-geometry.js +10 -1
  46. package/dist-client/modeller/fasten-geometry.js.map +1 -1
  47. package/dist-client/modeller/figure-cavity-drawing.js +1 -3
  48. package/dist-client/modeller/figure-cavity-drawing.js.map +1 -1
  49. package/dist-client/modeller/figure-clips.d.ts +9 -0
  50. package/dist-client/modeller/figure-clips.js +104 -8
  51. package/dist-client/modeller/figure-clips.js.map +1 -1
  52. package/dist-client/modeller/figure-fasten-dialog.js +39 -24
  53. package/dist-client/modeller/figure-fasten-dialog.js.map +1 -1
  54. package/dist-client/modeller/figure-fasten-drawing.js +5 -4
  55. package/dist-client/modeller/figure-fasten-drawing.js.map +1 -1
  56. package/dist-client/modeller/figure-first-save.js +4 -3
  57. package/dist-client/modeller/figure-first-save.js.map +1 -1
  58. package/dist-client/modeller/figure-links.d.ts +9 -0
  59. package/dist-client/modeller/figure-links.js +89 -35
  60. package/dist-client/modeller/figure-links.js.map +1 -1
  61. package/dist-client/modeller/figure-preview.js +48 -4
  62. package/dist-client/modeller/figure-preview.js.map +1 -1
  63. package/dist-client/modeller/figure-size-editor.js +7 -3
  64. package/dist-client/modeller/figure-size-editor.js.map +1 -1
  65. package/dist-client/modeller/first-save.d.ts +5 -0
  66. package/dist-client/modeller/first-save.js +7 -0
  67. package/dist-client/modeller/first-save.js.map +1 -1
  68. package/dist-client/modeller/focus-on-render.d.ts +2 -0
  69. package/dist-client/modeller/focus-on-render.js +4 -0
  70. package/dist-client/modeller/focus-on-render.js.map +1 -0
  71. package/dist-client/modeller/links.d.ts +1 -1
  72. package/dist-client/modeller/palette.d.ts +14 -0
  73. package/dist-client/modeller/palette.js +23 -0
  74. package/dist-client/modeller/palette.js.map +1 -1
  75. package/dist-client/modeller/pivot.d.ts +12 -0
  76. package/dist-client/modeller/pivot.js +59 -0
  77. package/dist-client/modeller/pivot.js.map +1 -0
  78. package/dist-client/modeller/product-session.js +6 -2
  79. package/dist-client/modeller/product-session.js.map +1 -1
  80. package/dist-client/modeller/size-response.d.ts +6 -0
  81. package/dist-client/modeller/size-response.js +14 -0
  82. package/dist-client/modeller/size-response.js.map +1 -1
  83. package/dist-client/modeller/stage-model.d.ts +17 -3
  84. package/dist-client/modeller/stage-model.js +44 -6
  85. package/dist-client/modeller/stage-model.js.map +1 -1
  86. package/dist-client/route.d.ts +1 -1
  87. package/dist-client/tsconfig.tsbuildinfo +1 -1
  88. package/dist-client/types.d.ts +2 -0
  89. package/dist-client/types.js.map +1 -1
  90. package/package.json +5 -5
  91. package/test/browser/editing.check.mjs +6 -5
  92. package/test/browser/section.check.mjs +21 -0
  93. package/test/clips.test.ts +49 -4
  94. package/test/data-motion.test.ts +8 -0
  95. package/test/fasten-form.test.ts +57 -0
  96. package/test/fasten-geometry.test.ts +25 -1
  97. package/test/first-part-on-plane.test.ts +52 -0
  98. package/test/first-save.test.ts +11 -1
  99. package/test/pivot.test.ts +57 -0
  100. package/test/save-landed.test.ts +20 -1
  101. package/test/size-response.test.ts +10 -2
  102. package/test/stage-model.test.ts +23 -1
  103. package/translations/en.json +9 -0
  104. package/translations/es.json +9 -0
  105. package/translations/ja.json +9 -0
  106. package/translations/ko.json +9 -0
  107. package/translations/ms.json +9 -0
  108. package/translations/zh.json +9 -0
  109. package/tutorial/humanoid/README.md +22 -0
  110. package/tutorial/humanoid/chapters.mjs +247 -0
  111. package/tutorial/humanoid/encode.mjs +26 -0
  112. package/tutorial/humanoid/lib.mjs +197 -0
  113. package/tutorial/humanoid/record.mjs +65 -0
@@ -1 +1 @@
1
- {"version":3,"file":"figure-preview.js","sourceRoot":"","sources":["../../client/modeller/fig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,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;AAE5D;IAAhB,KAAK,EAAE;;8CAAsD;AAE9B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CAAuB;AAEtB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;8CAAsC;AAEzD;IAAX,QAAQ,EAAE;;+CAAc;AACR;IAAhB,KAAK,EAAE;;gDAAuB;AAEd;IAAhB,KAAK,EAAE;;0CAAqC;AAE5B;IAAhB,KAAK,EAAE;;8CAA6C;AAEpC;IAAhB,KAAK,EAAE;;qDAA+B;AAEtB;IAAhB,KAAK,EAAE;;6CAAqD;AAY5C;IAAhB,KAAK,EAAE;;2CAA4D;AA1VzD,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA00BzB","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 { unitWord } from './unit-words.js'\nimport * as THREE from 'three'\nimport { compileFigureAsset } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureDataRow, FigureDataValue, FigureGraphStateInput } from '@hatiolab/figure-model'\nimport { create, figureLegendSourcesChanged, 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 { parametersForClip } from '@things-factory/figure-viewer/dist-client/detail-motion.js'\nimport { controlsOf } from '@things-factory/figure-viewer/dist-client/controls.js'\nimport { dialShape } from './angle-dial.js'\nimport { dataValueAt, domainOf, motionWrittenByData, typedValueOf, valueRowsOf } from './data-interface.js'\nimport { derivedOf, type FigureRevision } from './revision.js'\nimport { authoredSizeOf, bodyAtSize, PREVIEW_FACTOR, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeSpanOf, sizeWithinRange } from '@things-factory/figure-viewer/dist-client/preview-model.js'\nimport { previewSizeWordsOf } from './preview-size.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 a\n * `FigureInstance` the author stretches with a slider per axis the figure lets change, its size and its rows' counts\n * said beside it (first 15 minutes, 2026-10-16: eight variants side by side at one scale made a 60 mm roller on a 3 m\n * conveyor a speck). The eight -- the size it was made, and each of the seven ways of growing one, two or three axes\n * twice as large, four to a row -- are a choice in the legend. 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?: {\n rebuildContentModel?: (model: unknown, options?: { preserveThreeD?: boolean }) => void\n /** The scene's legends, by name (ADR-0166 7): what its figures' tables choose from. */\n style?: Record<string, unknown>\n }\n root?: {\n set?: (patch: Record<string, unknown>) => void\n fitCameraToModel?: () => void\n /** The scene's camera presets: the perspective, or a square-on view from one side. */\n setCameraView?: (view: PreviewView) => void\n components?: { set?: (property: string, value: unknown) => void }[]\n }\n}\n\n/* Where the preview looks from: the edit canvas's presets, which the preview's still scene does not draw (robot dog 2026-11-03). */\ntype PreviewView = 'perspective' | 'front' | 'right' | 'top'\nconst PREVIEW_VIEWS: readonly PreviewView[] = ['perspective', 'front', 'right', 'top']\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: var(--ui-t-small, 11.5px);\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 /* A variant's name over its box: small, on the stage, never in the way of the pointer. */\n div[tags] {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n }\n div[tags] span {\n position: absolute;\n transform: translate(-50%, calc(-100% - 4px));\n padding: 1px 6px;\n white-space: nowrap;\n font-size: var(--ui-t-micro, 11px);\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 4px;\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 /* The help's choice and button in the look of the controls beside it, not the browser's grey (sweep 2026-10-27 U7). */\n div[setup] select,\n div[setup] button {\n min-width: 0;\n padding: 4px 8px;\n font: inherit;\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 }\n div[setup] button {\n cursor: pointer;\n }\n div[setup] button:hover {\n background-color: rgba(255, 255, 255, 0.24);\n }\n div[setup] option {\n color: initial;\n }\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: var(--ui-t-micro, 11px);\n flex-wrap: wrap;\n max-width: calc(100% - 16px);\n }\n /* One figure or eight: two words in the legend, the one shown pressed. */\n div[legend] button[way] {\n padding: 0 6px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0.7;\n }\n div[legend] button[view] {\n padding: 0 6px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0.7;\n }\n div[legend] span[views] {\n display: flex;\n gap: 2px;\n padding-left: 6px;\n border-left: 1px solid rgba(255, 255, 255, 0.22);\n }\n div[legend] button[view][aria-pressed='true'],\n div[legend] button[way][aria-pressed='true'] {\n opacity: 1;\n background-color: rgba(255, 255, 255, 0.18);\n }\n /* The one figure's size: under the legend, in the controls' look. */\n div[sizes] {\n position: absolute;\n top: 40px;\n left: 8px;\n display: grid;\n gap: 6px;\n padding: 8px 10px;\n max-width: calc(100% - 16px);\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 8px;\n font-size: var(--ui-t-micro, 11px);\n }\n div[sizes] label {\n display: grid;\n grid-template-columns: 32px 160px 52px;\n align-items: center;\n gap: 8px;\n }\n div[sizes] input {\n width: 100%;\n accent-color: var(--md-sys-color-primary);\n }\n div[sizes] output {\n font-variant-numeric: tabular-nums;\n text-align: right;\n }\n div[sizes] p[said] {\n margin: 0;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\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 /*\n One grid for every row, each row its subgrid: the rows' names in one column, so a value's field starts where the one\n above it does whatever the names' lengths (a row of its own grid started 28px off, sweep 2026-10-27 U7).\n */\n div[clips] {\n margin-left: auto;\n display: grid;\n grid-template-columns: auto 20px 96px 44px;\n gap: 6px 8px;\n align-items: center;\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: var(--ui-t-micro, 11px);\n }\n div[clips] > * {\n grid-column: 1 / -1;\n }\n div[clips] label {\n display: grid;\n grid-template-columns: subgrid;\n align-items: center;\n }\n /* A motion group's clip: as wide as the dial, slider and value together, so its name reads. */\n div[clips] select {\n grid-column: 2 / -1;\n min-width: 0;\n font: inherit;\n color: inherit;\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\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 /* Folded, the controls are one button: what they covered -- a leg, say -- can be seen (robot dog 2026-11-03). */\n div[clips] button[fold-controls] {\n justify-self: end;\n padding: 0 4px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n cursor: pointer;\n opacity: 0.75;\n }\n div[clips] button[fold-controls]:hover {\n opacity: 1;\n }\n div[clips] button[pose] {\n align-self: stretch;\n padding: 4px 8px;\n font: inherit;\n font-size: var(--ui-t-micro, 11px);\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: var(--ui-t-micro, 11px);\n }\n div[clips] input {\n width: 96px;\n accent-color: var(--md-sys-color-primary);\n }\n /* A value typed, not slid: in the look of the group's clip choice, starting where the sliders start. */\n div[clips] input:not([type='range']) {\n box-sizing: border-box;\n min-width: 0;\n font: inherit;\n color: inherit;\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\n }\n div[clips] input:not([type='range']):not([type='number']) {\n grid-column: 3 / -1;\n width: auto;\n }\n /* A control's value, typed where the slider cannot land on it (a step of the range's hundredth, robot dog 2026-11-03). */\n div[clips] input[typed] {\n width: 100%;\n padding: 0 3px;\n text-align: right;\n font-variant-numeric: tabular-nums;\n }\n div[clips] label[sampled] output {\n grid-column: 3 / -1;\n text-align: left;\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 given here by accessor, as a board's saved `figureValues`: what moves a group whose clip or speed the data writes. */\n @state() private valuing: Record<string, FigureDataValue> = {}\n /** Data tried in the data tab: the preview's figures take it as their \\`data\\`, as a board's data source gives it; null when none is. */\n @property({ attribute: false }) sample: unknown = null\n /** Sample legends by role (ADR-0166 10): the scene's legends named as the roles, as a board would give them. */\n @property({ attribute: false }) legends: Record<string, unknown> = {}\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 /** One figure stretched by sliders, or the eight ways of growing side by side. */\n @state() private way: 'one' | 'eight' = 'one'\n /** Where the camera looks from; a new scene starts in perspective. */\n @state() private looking: PreviewView = 'perspective'\n /** The posing controls folded to their one button. */\n @state() private controlsFolded = false\n /** The size the one figure is tried at; the authored size when the figure stands up. */\n @state() private trying?: { x: number; y: number; z: number }\n private board = { width: 0, height: 0 }\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 /* The eight variants named over each one, where the camera shows it (sweep 2026-10-27 M4). */\n @state() private tags: { name: string; x: number; y: number }[] = []\n private tagFrame = 0\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.tags.length ? html`<div tags>${this.tags.map(t => html`<span style=${`left:${t.x}px;top:${t.y}px`}>${t.name}</span>`)}</div>` : nothing}\n ${this.cannot\n ? html`<div cannot>${this.cannot}</div>`\n : html`<div legend>\n ${(['one', 'eight'] as const).map(\n way => html`<button way=${way} aria-pressed=${String(this.way === way)} @click=${() => this.chooseWay(way)}>${i18next.t(`figure.label.preview-way-${way}`)}</button>`\n )}\n <span views>\n ${PREVIEW_VIEWS.map(\n view => html`<button view=${view} aria-pressed=${String(this.looking === view)} @click=${() => this.lookFrom(view)}>${i18next.t(`figure.label.preview-view-${view}`)}</button>`\n )}\n </span>\n ${this.way === 'one' ? nothing : 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 ${this.way === 'one' && asset && this.trying ? this.renderSizes(asset, this.trying) : nothing}\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) + (asset ? valueRowsOf(asset).length : 0) ? this.renderDrivers(asset!, controls, clips) : nothing}</div>`}`\n }\n\n private lookFrom(view: PreviewView) {\n this.scene?.root?.setCameraView?.(view)\n this.looking = view\n }\n\n /** The one figure's size: a slider per axis the figure lets change, and what it is at the size tried. */\n private renderSizes(asset: FigureAsset, size: { x: number; y: number; z: number }) {\n const say = (key: string, params?: Record<string, string>) => i18next.t(key, params)\n return html`<div sizes>\n ${(['x', 'y', 'z'] as const).map(axis => {\n const range = sizeSpanOf(asset, axis)\n if (!range) return nothing\n return html`<label>\n <span>${i18next.t(`figure.label.measure-${axis}`)}</span>\n <input type=\"range\" aria-label=${i18next.t(`figure.label.measure-${axis}`)} min=${range.min} max=${range.max} step=\"any\" .value=${String(size[axis])}\n @input=${(e: Event) => this.tryAxis(axis, (e.target as HTMLInputElement).valueAsNumber)}\n @change=${() => this.fitView()} />\n <output>${Math.round(size[axis]).toLocaleString()}</output>\n </label>`\n })}\n <p said>${previewSizeWordsOf(asset, size, say)}</p>\n </div>`\n }\n\n /*\n Each variant's name over its top, followed while the eight stand: the legend alone listed 「x · y · x·y …」 with\n nothing saying which box was which (sweep 2026-10-27 M4).\n */\n private followTags() {\n cancelAnimationFrame(this.tagFrame)\n if (this.way !== 'eight' || !this.scene) {\n if (this.tags.length) this.tags = []\n return\n }\n const names = new Map(PREVIEW_WAYS.map(way => [`at-${way.name}`, way.axes.length ? way.name : i18next.t('figure.label.preview-base')]))\n const box = new THREE.Box3()\n const top = new THREE.Vector3()\n const step = () => {\n const root = this.scene?.root as { activeCamera3d?: THREE.Camera; renderer3d?: THREE.WebGLRenderer; components?: { model?: { id?: string }; _realObject?: { object3d?: THREE.Object3D } }[] } | undefined\n const camera = root?.activeCamera3d\n const canvas = root?.renderer3d?.domElement\n if (!camera || !canvas || this.way !== 'eight') return\n const at = canvas.getBoundingClientRect()\n const host = this.getBoundingClientRect()\n const tags: { name: string; x: number; y: number }[] = []\n for (const component of root?.components ?? []) {\n const name = names.get(component.model?.id ?? '')\n const object = component._realObject?.object3d\n if (!name || !object) continue\n box.setFromObject(object)\n if (box.isEmpty()) continue\n box.getCenter(top)\n top.y = box.max.y\n top.project(camera)\n if (top.z > 1) continue\n tags.push({ name, x: Math.round((top.x * 0.5 + 0.5) * at.width + at.left - host.left), y: Math.round((-top.y * 0.5 + 0.5) * at.height + at.top - host.top) })\n }\n if (JSON.stringify(tags) !== JSON.stringify(this.tags)) this.tags = tags\n this.tagFrame = requestAnimationFrame(step)\n }\n this.tagFrame = requestAnimationFrame(step)\n }\n\n private chooseWay(way: 'one' | 'eight') {\n if (way === this.way) return\n this.way = way\n this.standUp()\n this.followTags()\n /* The content is made again inside the scene standing, which keeps the camera: from one figure to eight it stood inside them. */\n requestAnimationFrame(() => this.fitView())\n }\n\n /** The one figure at another size on an axis, held to what the figure declares, its centre kept on the board's. */\n private tryAxis(axis: 'x' | 'y' | 'z', value: number) {\n const asset = this.asset\n const used = asset ? sizeWithinRange(asset, axis, value) : undefined\n if (used === undefined || !this.trying) return\n this.trying = { ...this.trying, [axis]: used }\n const instance = this.scene?.root?.components?.[0] as { model?: { width?: number; height?: number }; set(props: Record<string, unknown>): void } | undefined\n /* The instance's box is the body at the sizes tried, not the sizes (bodyAtSize). */\n const box = bodyAtSize(asset!, this.trying) ?? this.trying\n instance?.set({ width: box.x, depth: box.y, height: box.z })\n const { width = 0, height = 0 } = instance?.model ?? {}\n instance?.set({ left: this.board.width / 2 - width / 2, top: this.board.height / 2 - height / 2 })\n }\n\n /** The figure as stretched, whole in view: done once the slider is let go, so the ground does not slide under a drag. */\n fitView() {\n this.scene?.fit?.('ratio')\n this.scene?.root?.fitCameraToModel?.()\n }\n\n private renderDrivers(asset: FigureAsset, controls: FigureGraphStateInput[], clips: string[]) {\n const steps = new Map(controlsOf(asset).map(c => [c.id, c.step]))\n const changed = controls.filter(c => this.giving[c.id] !== undefined && this.giving[c.id] !== asset.stateDefaults[c.id])\n const fold = html`<button fold-controls aria-expanded=${String(!this.controlsFolded)} @click=${() => (this.controlsFolded = !this.controlsFolded)}>\n ${i18next.t(this.controlsFolded ? 'figure.button.controls-unfold' : 'figure.button.controls-fold')}\n </button>`\n if (this.controlsFolded) return html`<div clips folded>${fold}</div>`\n return html`<div clips>\n ${fold}\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 ${Object.keys(this.giving).length\n ? html`<button clear-tried title=${i18next.t('figure.text.clear-tried-explained')} @click=${() => this.clearTried()}>\n ${i18next.t('figure.button.clear-tried')}\n </button>`\n : nothing}\n ${controls.map(control => {\n const value = this.giving[control.id] ?? asset.stateDefaults[control.id] ?? control.min\n /* The step the editor's controls take (\\`controlsOf\\`): a degree for an angle, a hundredth of the range otherwise. */\n const step = steps.get(control.id) ?? (control.max - control.min) / 100\n const label = asset.stateInputs?.[control.id]?.label ?? control.id\n return html`<label>\n <span>${label} <span drive>${unitWord(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 <input\n typed\n type=\"number\"\n step=\"any\"\n min=${control.min}\n max=${control.max}\n aria-label=${label}\n .value=${String(Math.round(value * 100) / 100)}\n @change=${(e: Event) => {\n const typed = (e.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(typed)) this.give(control.id, Math.min(Math.max(typed, control.min), control.max))\n }}\n />\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 ${valueRowsOf(asset).map(row => this.renderDataValue(row))}\n ${(asset.motionGroups ?? []).map(group => {\n const playing = this.moving[group.id] ?? { clip: group.defaultClip, speed: 0 }\n /* A field the data writes wins over the group's own setting, here as on a board: it is moved by the data values above. */\n const byData = motionWrittenByData(asset)[group.id] ?? { clip: false, speed: false }\n return html`${byData.clip\n ? nothing\n : html`<label>\n <span>${group.label} <span drive>${i18next.t('figure.label.clip')}</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 </label>`}\n ${byData.speed\n ? nothing\n : html`<label>\n <span>${group.label} <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(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 /** A value the data's bindings read, as the board's saved values give it: a number on a slider when it has a range, a choice when it is closed. */\n private renderDataValue(row: FigureDataRow) {\n const node = row.node\n const label = row.label ?? row.path\n /*\n The data tab's sample, when it gives the row, is what the figure shows: a value given here is not read. Said, and\n the field not offered, rather than one that changes nothing (robot dog 2026-11-03).\n */\n const sampled = this.sample === null || this.sample === undefined ? undefined : dataValueAt(this.sample, row.path)\n if (sampled !== undefined)\n return html`<label sampled title=${i18next.t('figure.text.data-value-from-sample')}>\n <span>${label} <span drive>${i18next.t('figure.label.data-value-from-sample')}</span></span>\n <output>${typeof sampled === 'object' ? JSON.stringify(sampled) : String(sampled)}</output>\n </label>`\n const fallback = 'default' in node ? node.default : undefined\n const value = this.valuing[row.path] ?? fallback\n if (node.kind === 'number') {\n const ranged = node.min !== undefined && node.max !== undefined && node.max > node.min\n return html`<label>\n <span>${label} <span drive>${unitWord(node.unit)}</span></span>\n <span></span>\n ${ranged\n ? html`<input type=\"range\" min=${node.min!} max=${node.max!} step=${Math.max((node.max! - node.min!) / 100, 0.01)} .value=${String(value ?? node.min)} @input=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n <output>${value === undefined ? '' : Number(value).toFixed(2)}</output>`\n : html`<input type=\"number\" step=\"any\" .value=${value === undefined ? '' : String(value)} @change=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n <span></span>`}\n </label>`\n }\n const domain = domainOf(node)\n if (!domain.length)\n return html`<label>\n <span>${label}</span>\n <input aria-label=${label} .value=${value === undefined ? '' : String(value)} @change=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n </label>`\n return html`<label>\n <span>${label}</span>\n <select aria-label=${label} @change=${(e: Event) => this.value(row, (e.target as HTMLSelectElement).value)}>\n ${domain.map(v => html`<option value=${String(v)} ?selected=${v === value}>${typeof v === 'boolean' ? i18next.t(v ? 'figure.label.data-true' : 'figure.label.data-false') : v}</option>`)}\n </select>\n </label>`\n }\n\n private value(row: FigureDataRow, typed: string) {\n const value = typedValueOf(row.node, typed)\n const next = { ...this.valuing }\n if (typeof value === 'number' && Number.isNaN(value)) delete next[row.path]\n else next[row.path] = value\n this.valuing = next\n this.tellInstances('figureValues', this.valuing)\n }\n\n private move(group: string, playing: { clip: string; speed: number }) {\n this.moving = { ...this.moving, [group]: playing }\n this.release(playing.clip)\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 if (value) this.release(clip)\n this.tellInstances('clips', this.driving)\n }\n\n /*\n A value given here wins over the clips for its control (things-scene's \\`parameters\\`), so a value left from trying held\n the control still while a clip played (robot dog, 2026-11-03). A clip played lets go of the controls it drives, as\n the detail view does (\\`parametersForClip\\`).\n */\n private release(clip: string) {\n const asset = this.asset\n if (!asset) return\n const next = parametersForClip(asset, this.giving, clip)\n if (Object.keys(next).length === Object.keys(this.giving).length) return\n this.giving = next\n this.tellInstances('parameters', this.giving)\n }\n\n /** Every value tried here let go: the figure stands in its default pose, and its clips move it again. Nothing is saved. */\n private clearTried() {\n this.giving = {}\n this.tellInstances('parameters', this.giving)\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' | 'figureValues', values: Record<string, unknown> | null) {\n for (const component of this.scene?.root?.components ?? []) component.set?.(key, values === null ? null : { ...values })\n }\n\n /** The tried data to the figures standing now, as their \\`data\\`: the preview's board is not saved. */\n private tellData(data: unknown) {\n for (const component of this.scene?.root?.components ?? []) component.set?.('data', data === null || data === undefined ? null : structuredClone(data))\n }\n\n\n /** The data sample to the figures standing now. */\n private tellSample() {\n if (this.sample !== null && this.sample !== undefined) this.tellData(this.sample)\n }\n\n /** The sample legends as the scene's (its root container's, where a board's are): its tables choose again. */\n private tellLegends() {\n const container = this.scene?.rootContainer\n if (!container) return\n container.style = { ...this.legends }\n figureLegendSourcesChanged()\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('sample') && this.scene) this.tellData(this.sample)\n if (changed.has('legends') && this.scene) this.tellLegends()\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, this.way])\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 this.valuing = {}\n registerFigure(type, asset)\n this.registered = type\n /* Each instance stands in its body at the size it is asked (bodyAtSize), as a board reads it. */\n const boxOf = (asked: { x: number; y: number; z: number }) => bodyAtSize(asset, asked) ?? asked\n const { components, board } = this.way === 'one' ? previewOneInstance(type, boxOf(size)) : previewInstances(type, size, boxOf)\n this.board = board\n this.trying = this.way === 'one' ? { ...size } : undefined\n const model = {\n type: 'model-layer',\n width: board.width,\n height: board.height,\n /* As tall as the figure may grow: twice for the eight, the top of the height slider for the one. */\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, view.ceilingHeight, this.way === 'one' ? Math.max(1, (sizeSpanOf(asset, 'y')?.max ?? size.y) / size.y) : 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.tellLegends()\n this.tellSample()\n this.followTags()\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 style: { ...this.legends },\n mode: 0\n }) as SceneHandle\n this.standing = signature\n this.looking = 'perspective'\n this.scene.resize?.()\n this.scene.fit?.('ratio')\n this.scene.root?.fitCameraToModel?.()\n this.cannot = ''\n this.tellSample()\n this.followTags()\n } catch (error) {\n this.cannot = (error as Error).message\n }\n }\n\n private teardown() {\n cancelAnimationFrame(this.tagFrame)\n this.tags = []\n this.scene?.dispose?.()\n this.scene = undefined\n this.standing = undefined\n if (this.registered) unregisterFigure(this.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AQ,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;AAE5D;IAAhB,KAAK,EAAE;;8CAAsD;AAE9B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CAAuB;AAEtB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;8CAAsC;AAEzD;IAAX,QAAQ,EAAE;;+CAAc;AACR;IAAhB,KAAK,EAAE;;gDAAuB;AAEd;IAAhB,KAAK,EAAE;;0CAAqC;AAE5B;IAAhB,KAAK,EAAE;;8CAA6C;AAEpC;IAAhB,KAAK,EAAE;;qDAA+B;AAEtB;IAAhB,KAAK,EAAE;;6CAAqD;AAY5C;IAAhB,KAAK,EAAE;;2CAA4D;AAhXzD,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAu3BzB","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 { unitWord } from './unit-words.js'\nimport * as THREE from 'three'\nimport { compileFigureAsset } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureDataRow, FigureDataValue, FigureGraphStateInput } from '@hatiolab/figure-model'\nimport { create, figureLegendSourcesChanged, 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 { parametersForClip } from '@things-factory/figure-viewer/dist-client/detail-motion.js'\nimport { controlsOf } from '@things-factory/figure-viewer/dist-client/controls.js'\nimport { dialShape } from './angle-dial.js'\nimport { dataValueAt, domainOf, motionWrittenByData, sampledStatesOf, typedValueOf, valueRowsOf } from './data-interface.js'\nimport { derivedOf, type FigureRevision } from './revision.js'\nimport { authoredSizeOf, bodyAtSize, PREVIEW_FACTOR, PREVIEW_WAYS, previewClampsOf, previewInstances, previewOneInstance, previewTypeOf, setupPartOf, sizeSpanOf, sizeWithinRange } from '@things-factory/figure-viewer/dist-client/preview-model.js'\nimport { previewSizeWordsOf } from './preview-size.js'\nimport { playedControlsOf } from './clips.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 a\n * `FigureInstance` the author stretches with a slider per axis the figure lets change, its size and its rows' counts\n * said beside it (first 15 minutes, 2026-10-16: eight variants side by side at one scale made a 60 mm roller on a 3 m\n * conveyor a speck). The eight -- the size it was made, and each of the seven ways of growing one, two or three axes\n * twice as large, four to a row -- are a choice in the legend. 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?: {\n rebuildContentModel?: (model: unknown, options?: { preserveThreeD?: boolean }) => void\n /** The scene's legends, by name (ADR-0166 7): what its figures' tables choose from. */\n style?: Record<string, unknown>\n }\n root?: {\n set?: (patch: Record<string, unknown>) => void\n fitCameraToModel?: () => void\n /** The scene's camera presets: the perspective, or a square-on view from one side. */\n setCameraView?: (view: PreviewView) => void\n components?: { set?: (property: string, value: unknown) => void }[]\n }\n}\n\n/* Where the preview looks from: the edit canvas's presets, which the preview's still scene does not draw (robot dog 2026-11-03). */\ntype PreviewView = 'perspective' | 'front' | 'right' | 'top'\nconst PREVIEW_VIEWS: readonly PreviewView[] = ['perspective', 'front', 'right', 'top']\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: var(--ui-t-small, 11.5px);\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 /* A variant's name over its box: small, on the stage, never in the way of the pointer. */\n div[tags] {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n }\n div[tags] span {\n position: absolute;\n transform: translate(-50%, calc(-100% - 4px));\n padding: 1px 6px;\n white-space: nowrap;\n font-size: var(--ui-t-micro, 11px);\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 4px;\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 /* The help's choice and button in the look of the controls beside it, not the browser's grey (sweep 2026-10-27 U7). */\n div[setup] select,\n div[setup] button {\n min-width: 0;\n padding: 4px 8px;\n font: inherit;\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 }\n div[setup] button {\n cursor: pointer;\n }\n div[setup] button:hover {\n background-color: rgba(255, 255, 255, 0.24);\n }\n div[setup] option {\n color: initial;\n }\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: var(--ui-t-micro, 11px);\n flex-wrap: wrap;\n max-width: calc(100% - 16px);\n }\n /* One figure or eight: two words in the legend, the one shown pressed. */\n div[legend] button[way] {\n padding: 0 6px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0.7;\n }\n div[legend] button[view] {\n padding: 0 6px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0.7;\n }\n div[legend] span[views] {\n display: flex;\n gap: 2px;\n padding-left: 6px;\n border-left: 1px solid rgba(255, 255, 255, 0.22);\n }\n div[legend] button[view][aria-pressed='true'],\n div[legend] button[way][aria-pressed='true'] {\n opacity: 1;\n background-color: rgba(255, 255, 255, 0.18);\n }\n /* The one figure's size: under the legend, in the controls' look. */\n div[sizes] {\n position: absolute;\n top: 40px;\n left: 8px;\n display: grid;\n gap: 6px;\n padding: 8px 10px;\n max-width: calc(100% - 16px);\n box-sizing: border-box;\n color: rgba(255, 255, 255, 0.92);\n background-color: rgba(28, 28, 30, 0.72);\n border-radius: 8px;\n font-size: var(--ui-t-micro, 11px);\n }\n div[sizes] label {\n display: grid;\n grid-template-columns: 32px 160px 52px;\n align-items: center;\n gap: 8px;\n }\n div[sizes] input {\n width: 100%;\n accent-color: var(--md-sys-color-primary);\n }\n div[sizes] output {\n font-variant-numeric: tabular-nums;\n text-align: right;\n }\n div[sizes] p[said] {\n margin: 0;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\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 /*\n One grid for every row, each row its subgrid: the rows' names in one column, so a value's field starts where the one\n above it does whatever the names' lengths (a row of its own grid started 28px off, sweep 2026-10-27 U7).\n */\n div[clips] {\n margin-left: auto;\n display: grid;\n grid-template-columns: auto 20px 96px 44px;\n gap: 6px 8px;\n align-items: center;\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: var(--ui-t-micro, 11px);\n }\n div[clips] > * {\n grid-column: 1 / -1;\n }\n div[clips] label {\n display: grid;\n grid-template-columns: subgrid;\n align-items: center;\n }\n /* A motion group's clip: as wide as the dial, slider and value together, so its name reads. */\n div[clips] select {\n grid-column: 2 / -1;\n min-width: 0;\n font: inherit;\n color: inherit;\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\n }\n /* A motion group's clips as buttons: a list the system draws is not seen in a recording of the preview. */\n div[clips] span[clip-choices] {\n grid-column: 2 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n min-width: 0;\n }\n div[clips] span[clip-choices] button {\n font: inherit;\n color: inherit;\n padding: 1px 8px;\n background-color: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 10px;\n cursor: pointer;\n }\n div[clips] span[clip-choices] button[aria-pressed='true'] {\n background-color: rgba(255, 255, 255, 0.3);\n border-color: rgba(255, 255, 255, 0.6);\n font-weight: 600;\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 /* Folded, the controls are one button: what they covered -- a leg, say -- can be seen (robot dog 2026-11-03). */\n div[clips] button[fold-controls] {\n justify-self: end;\n padding: 0 4px;\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n cursor: pointer;\n opacity: 0.75;\n }\n div[clips] button[fold-controls]:hover {\n opacity: 1;\n }\n div[clips] button[pose] {\n align-self: stretch;\n padding: 4px 8px;\n font: inherit;\n font-size: var(--ui-t-micro, 11px);\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: var(--ui-t-micro, 11px);\n }\n div[clips] input {\n width: 96px;\n accent-color: var(--md-sys-color-primary);\n }\n /* A value typed, not slid: in the look of the group's clip choice, starting where the sliders start. */\n div[clips] input:not([type='range']) {\n box-sizing: border-box;\n min-width: 0;\n font: inherit;\n color: inherit;\n background-color: rgba(255, 255, 255, 0.14);\n border: 1px solid rgba(255, 255, 255, 0.22);\n border-radius: 5px;\n }\n div[clips] input:not([type='range']):not([type='number']) {\n grid-column: 3 / -1;\n width: auto;\n }\n /* A control's value, typed where the slider cannot land on it (a step of the range's hundredth, robot dog 2026-11-03). */\n div[clips] input[typed] {\n width: 100%;\n padding: 0 3px;\n text-align: right;\n font-variant-numeric: tabular-nums;\n }\n div[clips] label[sampled] output {\n grid-column: 3 / -1;\n text-align: left;\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 given here by accessor, as a board's saved `figureValues`: what moves a group whose clip or speed the data writes. */\n @state() private valuing: Record<string, FigureDataValue> = {}\n /** Data tried in the data tab: the preview's figures take it as their \\`data\\`, as a board's data source gives it; null when none is. */\n @property({ attribute: false }) sample: unknown = null\n /** Sample legends by role (ADR-0166 10): the scene's legends named as the roles, as a board would give them. */\n @property({ attribute: false }) legends: Record<string, unknown> = {}\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 /** One figure stretched by sliders, or the eight ways of growing side by side. */\n @state() private way: 'one' | 'eight' = 'one'\n /** Where the camera looks from; a new scene starts in perspective. */\n @state() private looking: PreviewView = 'perspective'\n /** The posing controls folded to their one button. */\n @state() private controlsFolded = false\n /** The size the one figure is tried at; the authored size when the figure stands up. */\n @state() private trying?: { x: number; y: number; z: number }\n private board = { width: 0, height: 0 }\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 /* The eight variants named over each one, where the camera shows it (sweep 2026-10-27 M4). */\n @state() private tags: { name: string; x: number; y: number }[] = []\n private tagFrame = 0\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.tags.length ? html`<div tags>${this.tags.map(t => html`<span style=${`left:${t.x}px;top:${t.y}px`}>${t.name}</span>`)}</div>` : nothing}\n ${this.cannot\n ? html`<div cannot>${this.cannot}</div>`\n : html`<div legend>\n ${(['one', 'eight'] as const).map(\n way => html`<button way=${way} aria-pressed=${String(this.way === way)} @click=${() => this.chooseWay(way)}>${i18next.t(`figure.label.preview-way-${way}`)}</button>`\n )}\n <span views>\n ${PREVIEW_VIEWS.map(\n view => html`<button view=${view} aria-pressed=${String(this.looking === view)} @click=${() => this.lookFrom(view)}>${i18next.t(`figure.label.preview-view-${view}`)}</button>`\n )}\n </span>\n ${this.way === 'one' ? nothing : 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 ${this.way === 'one' && asset && this.trying ? this.renderSizes(asset, this.trying) : nothing}\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) + (asset ? valueRowsOf(asset).length : 0) ? this.renderDrivers(asset!, controls, clips) : nothing}</div>`}`\n }\n\n private lookFrom(view: PreviewView) {\n this.scene?.root?.setCameraView?.(view)\n this.looking = view\n }\n\n /** The one figure's size: a slider per axis the figure lets change, and what it is at the size tried. */\n private renderSizes(asset: FigureAsset, size: { x: number; y: number; z: number }) {\n const say = (key: string, params?: Record<string, string>) => i18next.t(key, params)\n return html`<div sizes>\n ${(['x', 'y', 'z'] as const).map(axis => {\n const range = sizeSpanOf(asset, axis)\n if (!range) return nothing\n return html`<label>\n <span>${i18next.t(`figure.label.measure-${axis}`)}</span>\n <input type=\"range\" aria-label=${i18next.t(`figure.label.measure-${axis}`)} min=${range.min} max=${range.max} step=\"any\" .value=${String(size[axis])}\n @input=${(e: Event) => this.tryAxis(axis, (e.target as HTMLInputElement).valueAsNumber)}\n @change=${() => this.fitView()} />\n <output>${Math.round(size[axis]).toLocaleString()}</output>\n </label>`\n })}\n <p said>${previewSizeWordsOf(asset, size, say)}</p>\n </div>`\n }\n\n /*\n Each variant's name over its top, followed while the eight stand: the legend alone listed 「x · y · x·y …」 with\n nothing saying which box was which (sweep 2026-10-27 M4).\n */\n private followTags() {\n cancelAnimationFrame(this.tagFrame)\n if (this.way !== 'eight' || !this.scene) {\n if (this.tags.length) this.tags = []\n return\n }\n const names = new Map(PREVIEW_WAYS.map(way => [`at-${way.name}`, way.axes.length ? way.name : i18next.t('figure.label.preview-base')]))\n const box = new THREE.Box3()\n const top = new THREE.Vector3()\n const step = () => {\n const root = this.scene?.root as { activeCamera3d?: THREE.Camera; renderer3d?: THREE.WebGLRenderer; components?: { model?: { id?: string }; _realObject?: { object3d?: THREE.Object3D } }[] } | undefined\n const camera = root?.activeCamera3d\n const canvas = root?.renderer3d?.domElement\n if (!camera || !canvas || this.way !== 'eight') return\n const at = canvas.getBoundingClientRect()\n const host = this.getBoundingClientRect()\n const tags: { name: string; x: number; y: number }[] = []\n for (const component of root?.components ?? []) {\n const name = names.get(component.model?.id ?? '')\n const object = component._realObject?.object3d\n if (!name || !object) continue\n box.setFromObject(object)\n if (box.isEmpty()) continue\n box.getCenter(top)\n top.y = box.max.y\n top.project(camera)\n if (top.z > 1) continue\n tags.push({ name, x: Math.round((top.x * 0.5 + 0.5) * at.width + at.left - host.left), y: Math.round((-top.y * 0.5 + 0.5) * at.height + at.top - host.top) })\n }\n if (JSON.stringify(tags) !== JSON.stringify(this.tags)) this.tags = tags\n this.tagFrame = requestAnimationFrame(step)\n }\n this.tagFrame = requestAnimationFrame(step)\n }\n\n private chooseWay(way: 'one' | 'eight') {\n if (way === this.way) return\n this.way = way\n this.standUp()\n this.followTags()\n /* The content is made again inside the scene standing, which keeps the camera: from one figure to eight it stood inside them. */\n requestAnimationFrame(() => this.fitView())\n }\n\n /** The one figure at another size on an axis, held to what the figure declares, its centre kept on the board's. */\n private tryAxis(axis: 'x' | 'y' | 'z', value: number) {\n const asset = this.asset\n const used = asset ? sizeWithinRange(asset, axis, value) : undefined\n if (used === undefined || !this.trying) return\n this.trying = { ...this.trying, [axis]: used }\n const instance = this.scene?.root?.components?.[0] as { model?: { width?: number; height?: number }; set(props: Record<string, unknown>): void } | undefined\n /* The instance's box is the body at the sizes tried, not the sizes (bodyAtSize). */\n const box = bodyAtSize(asset!, this.trying) ?? this.trying\n instance?.set({ width: box.x, depth: box.y, height: box.z })\n const { width = 0, height = 0 } = instance?.model ?? {}\n instance?.set({ left: this.board.width / 2 - width / 2, top: this.board.height / 2 - height / 2 })\n }\n\n /** The figure as stretched, whole in view: done once the slider is let go, so the ground does not slide under a drag. */\n fitView() {\n this.scene?.fit?.('ratio')\n this.scene?.root?.fitCameraToModel?.()\n }\n\n private renderDrivers(asset: FigureAsset, controls: FigureGraphStateInput[], clips: string[]) {\n const steps = new Map(controlsOf(asset).map(c => [c.id, c.step]))\n const sampledStates = sampledStatesOf(asset, this.sample)\n const changed = controls.filter(c => this.giving[c.id] !== undefined && this.giving[c.id] !== asset.stateDefaults[c.id])\n const fold = html`<button fold-controls aria-expanded=${String(!this.controlsFolded)} @click=${() => (this.controlsFolded = !this.controlsFolded)}>\n ${i18next.t(this.controlsFolded ? 'figure.button.controls-unfold' : 'figure.button.controls-fold')}\n </button>`\n if (this.controlsFolded) return html`<div clips folded>${fold}</div>`\n const played = playedControlsOf(asset, this.driving, this.moving)\n return html`<div clips>\n ${fold}\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 ${Object.keys(this.giving).length\n ? html`<button clear-tried title=${i18next.t('figure.text.clear-tried-explained')} @click=${() => this.clearTried()}>\n ${i18next.t('figure.button.clear-tried')}\n </button>`\n : nothing}\n ${controls.map(control => {\n /* A control the data tab's sample sets is what the figure shows, as a value row the sample gives: said, not offered. */\n const fromSample = sampledStates[control.id]\n if (fromSample !== undefined)\n return html`<label sampled title=${i18next.t('figure.text.data-value-from-sample')}>\n <span>${asset.stateInputs?.[control.id]?.label ?? control.id} <span drive>${i18next.t('figure.label.data-value-from-sample')}</span></span>\n <output>${Math.round(fromSample * 100) / 100} ${unitWord(control.unit)}</output>\n </label>`\n const value = this.giving[control.id] ?? asset.stateDefaults[control.id] ?? control.min\n /* The step the editor's controls take (\\`controlsOf\\`): a degree for an angle, a hundredth of the range otherwise. */\n const step = steps.get(control.id) ?? (control.max - control.min) / 100\n const label = asset.stateInputs?.[control.id]?.label ?? control.id\n /*\n A control a playing clip drives moves on the figure while its row stood still at its last number -- 0 under a\n walking leg (review 2026-11-11). The row says the clip has it, and is not given a value until the clip stops.\n */\n const by = played.get(control.id)\n if (by)\n return html`<label played title=${i18next.t('figure.text.control-played-explained', { clip: by })}>\n <span>${label} <span drive>${unitWord(control.unit)}</span></span>\n <span></span>\n <input type=\"range\" min=${control.min} max=${control.max} .value=${String(value)} disabled />\n <output>${i18next.t('figure.text.control-played', { clip: by })}</output>\n </label>`\n return html`<label>\n <span>${label} <span drive>${unitWord(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 <input\n typed\n type=\"number\"\n step=\"any\"\n min=${control.min}\n max=${control.max}\n aria-label=${label}\n .value=${String(Math.round(value * 100) / 100)}\n @change=${(e: Event) => {\n const typed = (e.target as HTMLInputElement).valueAsNumber\n if (Number.isFinite(typed)) this.give(control.id, Math.min(Math.max(typed, control.min), control.max))\n }}\n />\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 ${valueRowsOf(asset).map(row => this.renderDataValue(row))}\n ${(asset.motionGroups ?? []).map(group => {\n const playing = this.moving[group.id] ?? { clip: group.defaultClip, speed: 0 }\n /* A field the data writes wins over the group's own setting, here as on a board: it is moved by the data values above. */\n const byData = motionWrittenByData(asset)[group.id] ?? { clip: false, speed: false }\n return html`${byData.clip\n ? nothing\n : html`<label>\n <span>${group.label} <span drive>${i18next.t('figure.label.clip')}</span></span>\n <span clip-choices role=\"group\" aria-label=${group.label}>\n ${group.clips.map(\n c => html`<button type=\"button\" aria-pressed=${String(c === playing.clip)} @click=${() => this.move(group.id, { ...playing, clip: c })}>${c}</button>`\n )}\n </span>\n </label>`}\n ${byData.speed\n ? nothing\n : html`<label>\n <span>${group.label} <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(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 /** A value the data's bindings read, as the board's saved values give it: a number on a slider when it has a range, a choice when it is closed. */\n private renderDataValue(row: FigureDataRow) {\n const node = row.node\n const label = row.label ?? row.path\n /*\n The data tab's sample, when it gives the row, is what the figure shows: a value given here is not read. Said, and\n the field not offered, rather than one that changes nothing (robot dog 2026-11-03).\n */\n const sampled = this.sample === null || this.sample === undefined ? undefined : dataValueAt(this.sample, row.path)\n if (sampled !== undefined)\n return html`<label sampled title=${i18next.t('figure.text.data-value-from-sample')}>\n <span>${label} <span drive>${i18next.t('figure.label.data-value-from-sample')}</span></span>\n <output>${typeof sampled === 'object' ? JSON.stringify(sampled) : String(sampled)}</output>\n </label>`\n const fallback = 'default' in node ? node.default : undefined\n const value = this.valuing[row.path] ?? fallback\n if (node.kind === 'number') {\n const ranged = node.min !== undefined && node.max !== undefined && node.max > node.min\n return html`<label>\n <span>${label} <span drive>${unitWord(node.unit)}</span></span>\n <span></span>\n ${ranged\n ? html`<input type=\"range\" min=${node.min!} max=${node.max!} step=${Math.max((node.max! - node.min!) / 100, 0.01)} .value=${String(value ?? node.min)} @input=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n <output>${value === undefined ? '' : Number(value).toFixed(2)}</output>`\n : html`<input type=\"number\" step=\"any\" .value=${value === undefined ? '' : String(value)} @change=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n <span></span>`}\n </label>`\n }\n const domain = domainOf(node)\n if (!domain.length)\n return html`<label>\n <span>${label}</span>\n <input aria-label=${label} .value=${value === undefined ? '' : String(value)} @change=${(e: Event) => this.value(row, (e.target as HTMLInputElement).value)} />\n </label>`\n return html`<label>\n <span>${label}</span>\n <select aria-label=${label} @change=${(e: Event) => this.value(row, (e.target as HTMLSelectElement).value)}>\n ${domain.map(v => html`<option value=${String(v)} ?selected=${v === value}>${typeof v === 'boolean' ? i18next.t(v ? 'figure.label.data-true' : 'figure.label.data-false') : v}</option>`)}\n </select>\n </label>`\n }\n\n private value(row: FigureDataRow, typed: string) {\n const value = typedValueOf(row.node, typed)\n const next = { ...this.valuing }\n if (typeof value === 'number' && Number.isNaN(value)) delete next[row.path]\n else next[row.path] = value\n this.valuing = next\n this.tellInstances('figureValues', this.valuing)\n }\n\n private move(group: string, playing: { clip: string; speed: number }) {\n this.moving = { ...this.moving, [group]: playing }\n this.release(playing.clip)\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 if (value) this.release(clip)\n this.tellInstances('clips', this.driving)\n }\n\n /*\n A value given here wins over the clips for its control (things-scene's \\`parameters\\`), so a value left from trying held\n the control still while a clip played (robot dog, 2026-11-03). A clip played lets go of the controls it drives, as\n the detail view does (\\`parametersForClip\\`).\n */\n private release(clip: string) {\n const asset = this.asset\n if (!asset) return\n const next = parametersForClip(asset, this.giving, clip)\n if (Object.keys(next).length === Object.keys(this.giving).length) return\n this.giving = next\n this.tellInstances('parameters', this.giving)\n }\n\n /** Every value tried here let go: the figure stands in its default pose, and its clips move it again. Nothing is saved. */\n private clearTried() {\n this.giving = {}\n this.tellInstances('parameters', this.giving)\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' | 'figureValues', values: Record<string, unknown> | null) {\n for (const component of this.scene?.root?.components ?? []) component.set?.(key, values === null ? null : { ...values })\n }\n\n /** The tried data to the figures standing now, as their \\`data\\`: the preview's board is not saved. */\n private tellData(data: unknown) {\n for (const component of this.scene?.root?.components ?? []) component.set?.('data', data === null || data === undefined ? null : structuredClone(data))\n }\n\n\n /** The data sample to the figures standing now. */\n private tellSample() {\n if (this.sample !== null && this.sample !== undefined) this.tellData(this.sample)\n }\n\n /** The sample legends as the scene's (its root container's, where a board's are): its tables choose again. */\n private tellLegends() {\n const container = this.scene?.rootContainer\n if (!container) return\n container.style = { ...this.legends }\n figureLegendSourcesChanged()\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('sample') && this.scene) this.tellData(this.sample)\n if (changed.has('legends') && this.scene) this.tellLegends()\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, this.way])\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 this.valuing = {}\n registerFigure(type, asset)\n this.registered = type\n /* Each instance stands in its body at the size it is asked (bodyAtSize), as a board reads it. */\n const boxOf = (asked: { x: number; y: number; z: number }) => bodyAtSize(asset, asked) ?? asked\n const { components, board } = this.way === 'one' ? previewOneInstance(type, boxOf(size)) : previewInstances(type, size, boxOf)\n this.board = board\n this.trying = this.way === 'one' ? { ...size } : undefined\n const model = {\n type: 'model-layer',\n width: board.width,\n height: board.height,\n /* As tall as the figure may grow: twice for the eight, the top of the height slider for the one. */\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, view.ceilingHeight, this.way === 'one' ? Math.max(1, (sizeSpanOf(asset, 'y')?.max ?? size.y) / size.y) : 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.tellLegends()\n this.tellSample()\n this.followTags()\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 style: { ...this.legends },\n mode: 0\n }) as SceneHandle\n this.standing = signature\n this.looking = 'perspective'\n this.scene.resize?.()\n this.scene.fit?.('ratio')\n this.scene.root?.fitCameraToModel?.()\n this.cannot = ''\n this.tellSample()\n this.followTags()\n } catch (error) {\n this.cannot = (error as Error).message\n }\n }\n\n private teardown() {\n cancelAnimationFrame(this.tagFrame)\n this.tags = []\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"]}
@@ -6,7 +6,7 @@ import { i18next, localize } from '@operato/i18n';
6
6
  import { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js';
7
7
  import { AXES, followOf, followableAxes, measureNow } from './links.js';
8
8
  import { scrubLabel } from './live.js';
9
- import { measureFactor, sameSizeSource, sizeInputOf, sizeRelationOf, sizeRelationSteps, sourceMeasureOf, suggestedSizeSource } from './size-response.js';
9
+ import { measureFactor, sameSizeSource, sizeAxisWord, sizeInputOf, sizeRelationOf, sizeRelationSteps, sourceMeasureOf, suggestedSizeSource } from './size-response.js';
10
10
  /**
11
11
  * A part's measures and what each follows, one row an axis (ADR-0159 3). Made to follow, a measure takes what the part
12
12
  * hangs from, along the axis its own axis lies on as it stands -- the author turns it on, nothing more. Another source
@@ -28,10 +28,13 @@ let FigureSizeEditor = class FigureSizeEditor extends localize(i18next)(LitEleme
28
28
  :host { display: block; min-width: 0; }
29
29
  .heading, .fields {
30
30
  display: grid;
31
- grid-template-columns: 24px minmax(55px, .85fr) 32px minmax(65px, 1fr) 42px;
31
+ grid-template-columns: var(--axis-column, 24px) minmax(55px, .85fr) 32px minmax(65px, 1fr) 42px;
32
32
  gap: 6px;
33
33
  align-items: center;
34
34
  }
35
+ /* A round body's rows name its diameter (「X·Z · 지름」): every row's first column widens alike, so the rows still line up. */
36
+ :host([named-axes]) { --axis-column: 76px; }
37
+ .fields > span:first-child { white-space: nowrap; }
35
38
  .heading { color: var(--md-sys-color-on-surface-variant); padding-bottom: 6px; }
36
39
  .dimension { padding: 3px 0; }
37
40
  .variable { display: flex; align-items: center; justify-content: center; min-height: var(--figure-control-height); }
@@ -96,6 +99,7 @@ let FigureSizeEditor = class FigureSizeEditor extends localize(i18next)(LitEleme
96
99
  const axes = followableAxes(asset, this.partId);
97
100
  const targets = asset.appearance.map(a => a.target).filter(p => p !== this.partId && followableAxes(asset, p).length);
98
101
  const uniform = asset.sizing === 'uniform';
102
+ this.toggleAttribute('named-axes', axes.some(axis => measureFactor(asset, this.partId, axis) === 2));
99
103
  return html `
100
104
  <div class="heading" aria-hidden="true">
101
105
  <span>${i18next.t('figure.label.size-axis')}</span><span>${i18next.t('figure.label.size-measure')}</span><span>${i18next.t('figure.label.size-follows')}</span><span>${i18next.t('figure.label.size-source')}</span><span></span>
@@ -115,7 +119,7 @@ let FigureSizeEditor = class FigureSizeEditor extends localize(i18next)(LitEleme
115
119
  }
116
120
  const currentMode = mode === 'custom' ? 'ratio' : mode;
117
121
  const input = sizeInputOf(asset, this.partId, axis);
118
- const label = `${axis.toUpperCase()}${measureFactor(asset, this.partId, axis) === 2 ? ' · ' + i18next.t('figure.label.size-diameter') : ''}`;
122
+ const label = sizeAxisWord(asset, this.partId, axis, i18next.t('figure.label.size-diameter'));
119
123
  /* The selects show when asked for, or when what it follows is not what its fastening gives -- or nothing is. */
120
124
  const choosing = relation.variable && (this.choosing.has(key) || !sameSizeSource(source, suggested));
121
125
  const selectedSource = source ? (source.of === 'instance' ? '@figure' : source.part) : '@custom';
@@ -1 +1 @@
1
- {"version":3,"file":"figure-size-editor.js","sourceRoot":"","sources":["../../client/modeller/figure-size-editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAEhG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EAGpB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;GAMG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC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M+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAA0B;AAC7C;IAAX,QAAQ,EAAE;;gDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDAAe;AAC1B;IAAhB,KAAK,EAAE;;+CAAmB;AAEV;IAAhB,KAAK,EAAE;;kDAAqC;AANlC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA2M5B","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureAuthoringAction } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport type { FigureRevision } from './revision.js'\nimport { AXES, followOf, followableAxes, measureNow, type Axis } from './links.js'\nimport { scrubLabel } from './live.js'\nimport {\n measureFactor,\n sameSizeSource,\n sizeInputOf,\n sizeRelationOf,\n sizeRelationSteps,\n sourceMeasureOf,\n suggestedSizeSource,\n type SizeMode,\n type SizeSource\n} from './size-response.js'\n\n/**\n * A part's measures and what each follows, one row an axis (ADR-0159 3). Made to follow, a measure takes what the part\n * hangs from, along the axis its own axis lies on as it stands -- the author turns it on, nothing more. Another source\n * is there when asked for, or when there is no such axis (the part lies at an angle) or the measure already follows\n * something else; each way of following says what it will do, in millimetres. A measure of the part's own is a value in\n * hand as on any field (user 2026-09-24): drawn while it is typed or its label is dragged, written once on the release.\n */\n@customElement('figure-size-editor')\nexport class FigureSizeEditor extends localize(i18next)(LitElement) {\n @property({ attribute: false }) revision?: FigureRevision\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n @state() private error = ''\n /* Rows whose source the author asked to choose: `<part>:<axis>`. */\n @state() private choosing = new Set<string>()\n private equivalentModes = new Map<string, 'ratio' | 'difference'>()\n static styles = [SidePanelStyles, css`\n :host { display: block; min-width: 0; }\n .heading, .fields {\n display: grid;\n grid-template-columns: 24px minmax(55px, .85fr) 32px minmax(65px, 1fr) 42px;\n gap: 6px;\n align-items: center;\n }\n .heading { color: var(--md-sys-color-on-surface-variant); padding-bottom: 6px; }\n .dimension { padding: 3px 0; }\n .variable { display: flex; align-items: center; justify-content: center; min-height: var(--figure-control-height); }\n .source { grid-column: 4 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; }\n .source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .modes { margin: 4px 0 2px 30px; }\n .result { margin: 0 0 6px 30px; }\n [role=alert] { color: var(--md-sys-color-error); }\n `]\n private tell(name: 'size-input' | 'size-typing' | 'size-let-go', detail?: object) {\n this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }))\n }\n private apply(steps: FigureAuthoringAction[]) {\n if (this.locked) return\n this.error = ''\n this.dispatchEvent(new CustomEvent('size-recipe', { detail: { steps }, bubbles: true, composed: true }))\n this.requestUpdate()\n }\n private configure(axis: Axis, source: SizeSource, mode: 'ratio' | 'difference', mm?: number) {\n if (this.locked || this.revision?.asset.sizing === 'uniform') return\n try {\n this.apply(sizeRelationSteps(this.revision!, this.partId, axis, source, mode, mm))\n this.equivalentModes.set(`${this.partId}:${axis}`, mode)\n } catch (e) {\n this.error = i18next.t((e as Error).message === 'SIZE_VALUE' ? 'figure.text.size-invalid' : 'figure.text.size-unavailable-source')\n this.requestUpdate()\n }\n }\n private choose(key: string, on: boolean) {\n const next = new Set(this.choosing)\n if (on) next.add(key)\n else next.delete(key)\n this.choosing = next\n }\n /** What a source is called on the panel: the figure, or the part, with the axis it is measured along. */\n private sourceWords(source: SizeSource) {\n return `${source.of === 'instance' ? i18next.t('figure.label.size-figure') : source.part} ${source.axis.toUpperCase()}`\n }\n /** What following this way does, in millimetres: the share it is of its source, or the difference it keeps. */\n private resultWords(revision: FigureRevision, source: SizeSource, mode: 'ratio' | 'difference', mm: number | undefined) {\n const theirs = sourceMeasureOf(revision, source)\n if (mm === undefined || theirs === undefined || !(theirs > 0)) return nothing\n const words = { source: this.sourceWords(source), size: Number(theirs.toFixed(1)) }\n if (mode === 'ratio') return i18next.t('figure.text.size-ratio-result', { ...words, pct: Number(((mm / theirs) * 100).toFixed(1)) })\n const gap = Number((theirs - mm).toFixed(1))\n if (Math.abs(gap) < 0.05) return i18next.t('figure.text.size-difference-same', words)\n return i18next.t(gap > 0 ? 'figure.text.size-difference-less' : 'figure.text.size-difference-more', { ...words, gap: Math.abs(gap) })\n }\n render() {\n const revision = this.revision\n if (!revision) return nothing\n const asset = revision.asset\n const axes = followableAxes(asset, this.partId)\n const targets = asset.appearance.map(a => a.target).filter(p => p !== this.partId && followableAxes(asset, p).length)\n const uniform = asset.sizing === 'uniform'\n return html`\n <div class=\"heading\" aria-hidden=\"true\">\n <span>${i18next.t('figure.label.size-axis')}</span><span>${i18next.t('figure.label.size-measure')}</span><span>${i18next.t('figure.label.size-follows')}</span><span>${i18next.t('figure.label.size-source')}</span><span></span>\n </div>\n ${axes.map(axis => {\n const key = `${this.partId}:${axis}`\n const mm = measureNow(revision, this.partId, axis)\n const relation = sizeRelationOf(revision, this.partId, axis)\n const f = followOf(asset, this.partId, axis)\n const source = relation.source\n const suggested = suggestedSizeSource(asset, this.partId, axis)\n let mode: SizeMode = relation.mode\n if (source && (f.of === 'instance' || f.of === 'part') && !f.plus) {\n const same = (source.of === 'part' ? measureFactor(asset, source.part, source.axis) : 1) / measureFactor(asset, this.partId, axis)\n if (Math.abs((f.times ?? 1) - same) < 1e-6) mode = this.equivalentModes.get(key) ?? mode\n }\n const currentMode = mode === 'custom' ? 'ratio' : mode\n const input = sizeInputOf(asset, this.partId, axis)\n const label = `${axis.toUpperCase()}${measureFactor(asset, this.partId, axis) === 2 ? ' · ' + i18next.t('figure.label.size-diameter') : ''}`\n /* The selects show when asked for, or when what it follows is not what its fastening gives -- or nothing is. */\n const choosing = relation.variable && (this.choosing.has(key) || !sameSizeSource(source, suggested))\n const selectedSource = source ? (source.of === 'instance' ? '@figure' : source.part) : '@custom'\n const sourceAxes = source?.of === 'part' ? followableAxes(asset, source.part) : AXES\n const factor = measureFactor(asset, this.partId, axis)\n /* Its own measure, no rule over it: in hand while typed or scrubbed, as the input it is (a diameter, its radius). */\n const own = !relation.variable && !!input && !this.locked\n const typingSize = (e: Event) => {\n const value = (e.target as HTMLInputElement).valueAsNumber\n if (own && Number.isFinite(value) && value > 0) this.tell('size-typing', { input, value: value / factor })\n }\n const scrubSize = (down: PointerEvent) => {\n if (!own || mm === undefined) return\n const field = (down.currentTarget as HTMLElement).closest('.fields')?.querySelector<HTMLInputElement>('input[type=number]')\n if (!field) return\n scrubLabel(down, { value: mm, unit: 'mm' }, {\n move: value => {\n field.value = String(value)\n if (value > 0) this.tell('size-typing', { input, value: value / factor })\n },\n release: value => {\n if (!(value > 0)) {\n field.value = String(mm)\n this.tell('size-let-go')\n return\n }\n this.error = ''\n this.tell('size-input', { input, value: value / factor, part: this.partId })\n this.requestUpdate()\n },\n cancel: () => {\n field.value = String(mm)\n this.tell('size-let-go')\n }\n })\n }\n const changeSize = (e: Event) => {\n const value = (e.target as HTMLInputElement).valueAsNumber\n if (!(Number.isFinite(value) && value > 0)) {\n this.error = i18next.t('figure.text.size-invalid')\n this.requestUpdate()\n return\n }\n if (relation.variable && source && mode !== 'custom') this.configure(axis, source, mode, value)\n else if (!relation.variable && input) {\n this.error = ''\n this.tell('size-input', { input, value: value / factor, part: this.partId })\n this.requestUpdate()\n }\n }\n const follows = (e: Event) => {\n if ((e.target as HTMLInputElement).checked) {\n if (suggested) this.configure(axis, suggested, 'ratio')\n else {\n /* At an angle to what it hangs from: which of its measures it follows is the author's to pick. */\n this.choose(key, true)\n this.error = i18next.t('figure.text.size-unpaired')\n }\n } else if (mm !== undefined) {\n this.choose(key, false)\n this.apply([{ kind: 'unlink-dimension', part: this.partId, axis, mm: mm / measureFactor(asset, this.partId, axis) }])\n }\n }\n return html`<div class=\"dimension\" data-axis=${axis}>\n <div class=\"fields\">\n <span ?scrub=${own} @pointerdown=${scrubSize}>${label}</span>\n <input type=\"number\" step=\"any\" min=\"0\" aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-measure')}`} .value=${live(mm === undefined ? '' : String(Number(mm.toFixed(6))))}\n ?disabled=${this.locked} ?readonly=${relation.variable ? mode === 'custom' || uniform : !input} @input=${typingSize} @change=${changeSize}>\n <label class=\"variable\"><input type=\"checkbox\" aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-follows')}`} .checked=${live(relation.variable || this.choosing.has(key))} ?disabled=${this.locked || uniform}\n @change=${follows}></label>\n ${choosing || (this.choosing.has(key) && !relation.variable)\n ? html`\n <select aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-source')}`} .value=${live(selectedSource)} ?disabled=${this.locked || uniform}\n @change=${(e: Event) => {\n const target = (e.target as HTMLSelectElement).value\n const possible = target === '@figure' ? AXES : followableAxes(asset, target)\n const targetAxis = possible.includes(source?.axis ?? axis) ? (source?.axis ?? axis) : possible[0]!\n this.configure(axis, target === '@figure' ? { of: 'instance', axis: targetAxis } : { of: 'part', part: target, axis: targetAxis }, currentMode)\n }}>\n ${!source ? html`<option value=\"@custom\" disabled>${i18next.t(relation.variable ? 'figure.label.size-existing-rule' : 'figure.label.size-pick-source')}</option>` : nothing}\n <option value=\"@figure\" ?selected=${selectedSource === '@figure'}>${i18next.t('figure.label.size-figure')}</option>\n ${targets.map(p => html`<option value=${p} ?selected=${selectedSource === p}>${p}</option>`)}\n </select>\n <select aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-source-axis')}`} .value=${live(source?.axis ?? axis)} ?disabled=${this.locked || uniform || !source}\n @change=${(e: Event) => source && this.configure(axis, { ...source, axis: (e.target as HTMLSelectElement).value as Axis }, currentMode)}>\n ${sourceAxes.map(a => html`<option value=${a} ?selected=${a === (source?.axis ?? axis)}>${a.toUpperCase()}</option>`)}\n </select>`\n : relation.variable && source\n ? html`<div class=\"source\">\n <span>${this.sourceWords(source)}</span>\n <button quiet ?disabled=${this.locked || uniform} @click=${() => this.choose(key, true)}>${i18next.t('figure.button.size-other-source')}</button>\n </div>`\n : html`<span></span><span></span>`}\n </div>\n ${relation.variable\n ? html`<div class=\"modes\" choice-row>\n ${(['ratio', 'difference'] as const).map(\n m => html`<label toggle><input type=\"radio\" name=${`mode-${this.partId}-${axis}`} .checked=${live(mode === m)} ?disabled=${this.locked || uniform || !source}\n @change=${() => source && this.configure(axis, source, m)}>${i18next.t(`figure.label.size-${m}`)}</label>`\n )}\n </div>\n ${mode === 'custom'\n ? html`<p hint>${i18next.t('figure.text.size-custom-rule')}</p>`\n : source\n ? html`<p hint class=\"result\">${this.resultWords(revision, source, currentMode, mm)}</p>`\n : nothing}`\n : nothing}\n </div>`\n })}\n ${uniform ? html`<p hint>${i18next.t('figure.text.size-uniform')}</p>` : nothing}\n ${this.error ? html`<p hint role=\"alert\">${this.error}</p>` : nothing}\n `\n }\n}\n"]}
1
+ {"version":3,"file":"figure-size-editor.js","sourceRoot":"","sources":["../../client/modeller/figure-size-editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AAEhG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB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O,CAAC,CAAC,CAAC,IAAI,CAAA,WAAW,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;QAC9E,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA,wBAAwB,IAAI,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO;KACtE,CAAA;IACH,CAAC;;AA7M+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAA0B;AAC7C;IAAX,QAAQ,EAAE;;gDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDAAe;AAC1B;IAAhB,KAAK,EAAE;;+CAAmB;AAEV;IAAhB,KAAK,EAAE;;kDAAqC;AANlC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+M5B","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { live } from 'lit/directives/live.js'\nimport { i18next, localize } from '@operato/i18n'\nimport type { FigureAuthoringAction } from '@hatiolab/figure-model'\nimport { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js'\nimport type { FigureRevision } from './revision.js'\nimport { AXES, followOf, followableAxes, measureNow, type Axis } from './links.js'\nimport { scrubLabel } from './live.js'\nimport {\n measureFactor,\n sameSizeSource,\n sizeAxisWord,\n sizeInputOf,\n sizeRelationOf,\n sizeRelationSteps,\n sourceMeasureOf,\n suggestedSizeSource,\n type SizeMode,\n type SizeSource\n} from './size-response.js'\n\n/**\n * A part's measures and what each follows, one row an axis (ADR-0159 3). Made to follow, a measure takes what the part\n * hangs from, along the axis its own axis lies on as it stands -- the author turns it on, nothing more. Another source\n * is there when asked for, or when there is no such axis (the part lies at an angle) or the measure already follows\n * something else; each way of following says what it will do, in millimetres. A measure of the part's own is a value in\n * hand as on any field (user 2026-09-24): drawn while it is typed or its label is dragged, written once on the release.\n */\n@customElement('figure-size-editor')\nexport class FigureSizeEditor extends localize(i18next)(LitElement) {\n @property({ attribute: false }) revision?: FigureRevision\n @property() partId = ''\n @property({ type: Boolean }) locked = false\n @state() private error = ''\n /* Rows whose source the author asked to choose: `<part>:<axis>`. */\n @state() private choosing = new Set<string>()\n private equivalentModes = new Map<string, 'ratio' | 'difference'>()\n static styles = [SidePanelStyles, css`\n :host { display: block; min-width: 0; }\n .heading, .fields {\n display: grid;\n grid-template-columns: var(--axis-column, 24px) minmax(55px, .85fr) 32px minmax(65px, 1fr) 42px;\n gap: 6px;\n align-items: center;\n }\n /* A round body's rows name its diameter (「X·Z · 지름」): every row's first column widens alike, so the rows still line up. */\n :host([named-axes]) { --axis-column: 76px; }\n .fields > span:first-child { white-space: nowrap; }\n .heading { color: var(--md-sys-color-on-surface-variant); padding-bottom: 6px; }\n .dimension { padding: 3px 0; }\n .variable { display: flex; align-items: center; justify-content: center; min-height: var(--figure-control-height); }\n .source { grid-column: 4 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; }\n .source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .modes { margin: 4px 0 2px 30px; }\n .result { margin: 0 0 6px 30px; }\n [role=alert] { color: var(--md-sys-color-error); }\n `]\n private tell(name: 'size-input' | 'size-typing' | 'size-let-go', detail?: object) {\n this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }))\n }\n private apply(steps: FigureAuthoringAction[]) {\n if (this.locked) return\n this.error = ''\n this.dispatchEvent(new CustomEvent('size-recipe', { detail: { steps }, bubbles: true, composed: true }))\n this.requestUpdate()\n }\n private configure(axis: Axis, source: SizeSource, mode: 'ratio' | 'difference', mm?: number) {\n if (this.locked || this.revision?.asset.sizing === 'uniform') return\n try {\n this.apply(sizeRelationSteps(this.revision!, this.partId, axis, source, mode, mm))\n this.equivalentModes.set(`${this.partId}:${axis}`, mode)\n } catch (e) {\n this.error = i18next.t((e as Error).message === 'SIZE_VALUE' ? 'figure.text.size-invalid' : 'figure.text.size-unavailable-source')\n this.requestUpdate()\n }\n }\n private choose(key: string, on: boolean) {\n const next = new Set(this.choosing)\n if (on) next.add(key)\n else next.delete(key)\n this.choosing = next\n }\n /** What a source is called on the panel: the figure, or the part, with the axis it is measured along. */\n private sourceWords(source: SizeSource) {\n return `${source.of === 'instance' ? i18next.t('figure.label.size-figure') : source.part} ${source.axis.toUpperCase()}`\n }\n /** What following this way does, in millimetres: the share it is of its source, or the difference it keeps. */\n private resultWords(revision: FigureRevision, source: SizeSource, mode: 'ratio' | 'difference', mm: number | undefined) {\n const theirs = sourceMeasureOf(revision, source)\n if (mm === undefined || theirs === undefined || !(theirs > 0)) return nothing\n const words = { source: this.sourceWords(source), size: Number(theirs.toFixed(1)) }\n if (mode === 'ratio') return i18next.t('figure.text.size-ratio-result', { ...words, pct: Number(((mm / theirs) * 100).toFixed(1)) })\n const gap = Number((theirs - mm).toFixed(1))\n if (Math.abs(gap) < 0.05) return i18next.t('figure.text.size-difference-same', words)\n return i18next.t(gap > 0 ? 'figure.text.size-difference-less' : 'figure.text.size-difference-more', { ...words, gap: Math.abs(gap) })\n }\n render() {\n const revision = this.revision\n if (!revision) return nothing\n const asset = revision.asset\n const axes = followableAxes(asset, this.partId)\n const targets = asset.appearance.map(a => a.target).filter(p => p !== this.partId && followableAxes(asset, p).length)\n const uniform = asset.sizing === 'uniform'\n this.toggleAttribute('named-axes', axes.some(axis => measureFactor(asset, this.partId, axis) === 2))\n return html`\n <div class=\"heading\" aria-hidden=\"true\">\n <span>${i18next.t('figure.label.size-axis')}</span><span>${i18next.t('figure.label.size-measure')}</span><span>${i18next.t('figure.label.size-follows')}</span><span>${i18next.t('figure.label.size-source')}</span><span></span>\n </div>\n ${axes.map(axis => {\n const key = `${this.partId}:${axis}`\n const mm = measureNow(revision, this.partId, axis)\n const relation = sizeRelationOf(revision, this.partId, axis)\n const f = followOf(asset, this.partId, axis)\n const source = relation.source\n const suggested = suggestedSizeSource(asset, this.partId, axis)\n let mode: SizeMode = relation.mode\n if (source && (f.of === 'instance' || f.of === 'part') && !f.plus) {\n const same = (source.of === 'part' ? measureFactor(asset, source.part, source.axis) : 1) / measureFactor(asset, this.partId, axis)\n if (Math.abs((f.times ?? 1) - same) < 1e-6) mode = this.equivalentModes.get(key) ?? mode\n }\n const currentMode = mode === 'custom' ? 'ratio' : mode\n const input = sizeInputOf(asset, this.partId, axis)\n const label = sizeAxisWord(asset, this.partId, axis, i18next.t('figure.label.size-diameter'))\n /* The selects show when asked for, or when what it follows is not what its fastening gives -- or nothing is. */\n const choosing = relation.variable && (this.choosing.has(key) || !sameSizeSource(source, suggested))\n const selectedSource = source ? (source.of === 'instance' ? '@figure' : source.part) : '@custom'\n const sourceAxes = source?.of === 'part' ? followableAxes(asset, source.part) : AXES\n const factor = measureFactor(asset, this.partId, axis)\n /* Its own measure, no rule over it: in hand while typed or scrubbed, as the input it is (a diameter, its radius). */\n const own = !relation.variable && !!input && !this.locked\n const typingSize = (e: Event) => {\n const value = (e.target as HTMLInputElement).valueAsNumber\n if (own && Number.isFinite(value) && value > 0) this.tell('size-typing', { input, value: value / factor })\n }\n const scrubSize = (down: PointerEvent) => {\n if (!own || mm === undefined) return\n const field = (down.currentTarget as HTMLElement).closest('.fields')?.querySelector<HTMLInputElement>('input[type=number]')\n if (!field) return\n scrubLabel(down, { value: mm, unit: 'mm' }, {\n move: value => {\n field.value = String(value)\n if (value > 0) this.tell('size-typing', { input, value: value / factor })\n },\n release: value => {\n if (!(value > 0)) {\n field.value = String(mm)\n this.tell('size-let-go')\n return\n }\n this.error = ''\n this.tell('size-input', { input, value: value / factor, part: this.partId })\n this.requestUpdate()\n },\n cancel: () => {\n field.value = String(mm)\n this.tell('size-let-go')\n }\n })\n }\n const changeSize = (e: Event) => {\n const value = (e.target as HTMLInputElement).valueAsNumber\n if (!(Number.isFinite(value) && value > 0)) {\n this.error = i18next.t('figure.text.size-invalid')\n this.requestUpdate()\n return\n }\n if (relation.variable && source && mode !== 'custom') this.configure(axis, source, mode, value)\n else if (!relation.variable && input) {\n this.error = ''\n this.tell('size-input', { input, value: value / factor, part: this.partId })\n this.requestUpdate()\n }\n }\n const follows = (e: Event) => {\n if ((e.target as HTMLInputElement).checked) {\n if (suggested) this.configure(axis, suggested, 'ratio')\n else {\n /* At an angle to what it hangs from: which of its measures it follows is the author's to pick. */\n this.choose(key, true)\n this.error = i18next.t('figure.text.size-unpaired')\n }\n } else if (mm !== undefined) {\n this.choose(key, false)\n this.apply([{ kind: 'unlink-dimension', part: this.partId, axis, mm: mm / measureFactor(asset, this.partId, axis) }])\n }\n }\n return html`<div class=\"dimension\" data-axis=${axis}>\n <div class=\"fields\">\n <span ?scrub=${own} @pointerdown=${scrubSize}>${label}</span>\n <input type=\"number\" step=\"any\" min=\"0\" aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-measure')}`} .value=${live(mm === undefined ? '' : String(Number(mm.toFixed(6))))}\n ?disabled=${this.locked} ?readonly=${relation.variable ? mode === 'custom' || uniform : !input} @input=${typingSize} @change=${changeSize}>\n <label class=\"variable\"><input type=\"checkbox\" aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-follows')}`} .checked=${live(relation.variable || this.choosing.has(key))} ?disabled=${this.locked || uniform}\n @change=${follows}></label>\n ${choosing || (this.choosing.has(key) && !relation.variable)\n ? html`\n <select aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-source')}`} .value=${live(selectedSource)} ?disabled=${this.locked || uniform}\n @change=${(e: Event) => {\n const target = (e.target as HTMLSelectElement).value\n const possible = target === '@figure' ? AXES : followableAxes(asset, target)\n const targetAxis = possible.includes(source?.axis ?? axis) ? (source?.axis ?? axis) : possible[0]!\n this.configure(axis, target === '@figure' ? { of: 'instance', axis: targetAxis } : { of: 'part', part: target, axis: targetAxis }, currentMode)\n }}>\n ${!source ? html`<option value=\"@custom\" disabled>${i18next.t(relation.variable ? 'figure.label.size-existing-rule' : 'figure.label.size-pick-source')}</option>` : nothing}\n <option value=\"@figure\" ?selected=${selectedSource === '@figure'}>${i18next.t('figure.label.size-figure')}</option>\n ${targets.map(p => html`<option value=${p} ?selected=${selectedSource === p}>${p}</option>`)}\n </select>\n <select aria-label=${`${this.partId} ${label} ${i18next.t('figure.label.size-source-axis')}`} .value=${live(source?.axis ?? axis)} ?disabled=${this.locked || uniform || !source}\n @change=${(e: Event) => source && this.configure(axis, { ...source, axis: (e.target as HTMLSelectElement).value as Axis }, currentMode)}>\n ${sourceAxes.map(a => html`<option value=${a} ?selected=${a === (source?.axis ?? axis)}>${a.toUpperCase()}</option>`)}\n </select>`\n : relation.variable && source\n ? html`<div class=\"source\">\n <span>${this.sourceWords(source)}</span>\n <button quiet ?disabled=${this.locked || uniform} @click=${() => this.choose(key, true)}>${i18next.t('figure.button.size-other-source')}</button>\n </div>`\n : html`<span></span><span></span>`}\n </div>\n ${relation.variable\n ? html`<div class=\"modes\" choice-row>\n ${(['ratio', 'difference'] as const).map(\n m => html`<label toggle><input type=\"radio\" name=${`mode-${this.partId}-${axis}`} .checked=${live(mode === m)} ?disabled=${this.locked || uniform || !source}\n @change=${() => source && this.configure(axis, source, m)}>${i18next.t(`figure.label.size-${m}`)}</label>`\n )}\n </div>\n ${mode === 'custom'\n ? html`<p hint>${i18next.t('figure.text.size-custom-rule')}</p>`\n : source\n ? html`<p hint class=\"result\">${this.resultWords(revision, source, currentMode, mm)}</p>`\n : nothing}`\n : nothing}\n </div>`\n })}\n ${uniform ? html`<p hint>${i18next.t('figure.text.size-uniform')}</p>` : nothing}\n ${this.error ? html`<p hint role=\"alert\">${this.error}</p>` : nothing}\n `\n }\n}\n"]}
@@ -1,5 +1,10 @@
1
1
  /** A type as typed, made into the shape a type has: lower-case letters and digits joined by single hyphens. */
2
2
  export declare function typeOf(raw: string): string;
3
+ /**
4
+ * The identifier as it is being typed: `typeOf`, but the hyphen just typed at the end stays, so the next word can follow
5
+ * it (tutorial 2026-11-11: `fork-agv` typed key by key came out `forkagv`). The save takes `typeOf` of it.
6
+ */
7
+ export declare function typingTypeOf(raw: string): string;
3
8
  /**
4
9
  * Whether this name could be released, by the format's own rules (`type-not-identifier`, `type-is-placeholder`).
5
10
  * Saving under it is not blocked -- it can still change before release -- but the author hears it now.
@@ -8,6 +8,13 @@ import { isPlaceholderType, TYPE_LENGTH, TYPE_PATTERN } from '@hatiolab/figure-m
8
8
  export function typeOf(raw) {
9
9
  return raw.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
10
10
  }
11
+ /**
12
+ * The identifier as it is being typed: `typeOf`, but the hyphen just typed at the end stays, so the next word can follow
13
+ * it (tutorial 2026-11-11: `fork-agv` typed key by key came out `forkagv`). The save takes `typeOf` of it.
14
+ */
15
+ export function typingTypeOf(raw) {
16
+ return raw.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+/, '');
17
+ }
11
18
  /**
12
19
  * Whether this name could be released, by the format's own rules (`type-not-identifier`, `type-is-placeholder`).
13
20
  * Saving under it is not blocked -- it can still change before release -- but the author hears it now.
@@ -1 +1 @@
1
- {"version":3,"file":"first-save.js","sourceRoot":"","sources":["../../client/modeller/first-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErF;;;;GAIG;AAEH,+GAA+G;AAC/G,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AACrF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,GAAG,IAAI,IAAI,C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AK,EAAE,MAAM,CAAC,CAAA;QAC/C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;IACxC,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAA;AAClE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,KAAwB;IACvE,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAA;IAC1D,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,qCAAqC,EAAE,IAAI,EAAE,CAAA;IACrF,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { isPlaceholderType, TYPE_LENGTH, TYPE_PATTERN } from '@hatiolab/figure-model'\n\n/*\n * The first save of a new figure asks for its type and name. The type is the name a board places\n * the figure by; it freezes when the figure is released (ADR-0063 decision 4). The modeller once saved a new figure\n * under a temporary machine name and asked nothing -- the author had to find the field afterwards (user, 2026-09-25).\n */\n\n/** A type as typed, made into the shape a type has: lower-case letters and digits joined by single hyphens. */\nexport function typeOf(raw: string): string {\n return raw.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')\n}\n\n/**\n * Whether this name could be released, by the format's own rules (`type-not-identifier`, `type-is-placeholder`).\n * Saving under it is not blocked -- it can still change before release -- but the author hears it now.\n */\nexport function releasableType(type: string): boolean {\n return !isPlaceholderType(type) && TYPE_PATTERN.test(type) && type.length >= TYPE_LENGTH.min && type.length <= TYPE_LENGTH.max\n}\n\n/**\n * An identifier offered for a new figure, so the first save asks for a name and has a valid identifier ready (designer\n * 2026-09-27, Q-D3). A name in plain letters is used as it is when it makes a free, releasable identifier; any other\n * name -- Korean, say -- gets a valid prefix and a random part: no transliteration is guessed. Never the temporary\n * shape (`figure-` and eight), which the release gate refuses; never one this domain already uses.\n */\nexport function suggestTypeOf(name: string, taken: readonly string[], random: () => number = Math.random): string {\n const fromName = /^[A-Za-z][A-Za-z0-9 _-]*$/.test(name.trim()) ? typeOf(name) : ''\n if (fromName && releasableType(fromName) && !taken.includes(fromName)) return fromName\n const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'\n for (;;) {\n const made = `fig-${Array.from({ length: 6 }, () => alphabet[Math.floor(random() * alphabet.length)]).join('')}`\n if (releasableType(made) && !taken.includes(made)) return made\n }\n}\n\n/** The shape of an identifier the modeller offers (`suggestTypeOf`'s random form). */\nconst OFFERED = /^fig-[0-9a-z]{6}$/\n\n/**\n * The identifier the first save's question shows, given the one it opens on (Q-D3). The identifier is not the name:\n * renaming does not change it, and a retried first save opens on the one answered before. A new one is offered only when\n * there is none, or when an offered one is found taken -- told by the server, or in the list; one the author typed is\n * kept as typed, and its refusal said. `suggested` is the identifier now on offer, absent when that is unchanged.\n */\nexport function offeredTypeOf(\n type: string,\n name: string,\n taken: readonly string[],\n random: () => number = Math.random\n): { type: string; suggested?: string } {\n const offeredAndTaken = OFFERED.test(type) && taken.includes(type)\n if (!type || offeredAndTaken) {\n const made = suggestTypeOf(name, taken, random)\n return { type: made, suggested: made }\n }\n return OFFERED.test(type) ? { type, suggested: type } : { type }\n}\n\n/** Why the first save cannot go on with this type, as an i18n key, or null when it can. */\nexport function firstSaveRefusalOf(type: string, taken: readonly string[]): { key: string; type?: string } | null {\n if (!type) return { key: 'figure.text.enter-a-type-name' }\n if (taken.includes(type)) return { key: 'figure.text.type-name-already-taken', type }\n return null\n}\n\n/** What the first save asks for. */\nexport interface FirstSave {\n type: string\n name: string\n /** The domain's namespace to create it under, when the domain has several; its default when absent. */\n namespace?: string\n}\n"]}
1
+ {"version":3,"file":"first-save.js","sourceRoot":"","sources":["../../client/modeller/first-save.ts"],"names":[],"mappings":"AAAA,OAAO,E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","sourcesContent":["import { isPlaceholderType, TYPE_LENGTH, TYPE_PATTERN } from '@hatiolab/figure-model'\n\n/*\n * The first save of a new figure asks for its type and name. The type is the name a board places\n * the figure by; it freezes when the figure is released (ADR-0063 decision 4). The modeller once saved a new figure\n * under a temporary machine name and asked nothing -- the author had to find the field afterwards (user, 2026-09-25).\n */\n\n/** A type as typed, made into the shape a type has: lower-case letters and digits joined by single hyphens. */\nexport function typeOf(raw: string): string {\n return raw.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')\n}\n\n/**\n * The identifier as it is being typed: `typeOf`, but the hyphen just typed at the end stays, so the next word can follow\n * it (tutorial 2026-11-11: `fork-agv` typed key by key came out `forkagv`). The save takes `typeOf` of it.\n */\nexport function typingTypeOf(raw: string): string {\n return raw.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+/, '')\n}\n\n/**\n * Whether this name could be released, by the format's own rules (`type-not-identifier`, `type-is-placeholder`).\n * Saving under it is not blocked -- it can still change before release -- but the author hears it now.\n */\nexport function releasableType(type: string): boolean {\n return !isPlaceholderType(type) && TYPE_PATTERN.test(type) && type.length >= TYPE_LENGTH.min && type.length <= TYPE_LENGTH.max\n}\n\n/**\n * An identifier offered for a new figure, so the first save asks for a name and has a valid identifier ready (designer\n * 2026-09-27, Q-D3). A name in plain letters is used as it is when it makes a free, releasable identifier; any other\n * name -- Korean, say -- gets a valid prefix and a random part: no transliteration is guessed. Never the temporary\n * shape (`figure-` and eight), which the release gate refuses; never one this domain already uses.\n */\nexport function suggestTypeOf(name: string, taken: readonly string[], random: () => number = Math.random): string {\n const fromName = /^[A-Za-z][A-Za-z0-9 _-]*$/.test(name.trim()) ? typeOf(name) : ''\n if (fromName && releasableType(fromName) && !taken.includes(fromName)) return fromName\n const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'\n for (;;) {\n const made = `fig-${Array.from({ length: 6 }, () => alphabet[Math.floor(random() * alphabet.length)]).join('')}`\n if (releasableType(made) && !taken.includes(made)) return made\n }\n}\n\n/** The shape of an identifier the modeller offers (`suggestTypeOf`'s random form). */\nconst OFFERED = /^fig-[0-9a-z]{6}$/\n\n/**\n * The identifier the first save's question shows, given the one it opens on (Q-D3). The identifier is not the name:\n * renaming does not change it, and a retried first save opens on the one answered before. A new one is offered only when\n * there is none, or when an offered one is found taken -- told by the server, or in the list; one the author typed is\n * kept as typed, and its refusal said. `suggested` is the identifier now on offer, absent when that is unchanged.\n */\nexport function offeredTypeOf(\n type: string,\n name: string,\n taken: readonly string[],\n random: () => number = Math.random\n): { type: string; suggested?: string } {\n const offeredAndTaken = OFFERED.test(type) && taken.includes(type)\n if (!type || offeredAndTaken) {\n const made = suggestTypeOf(name, taken, random)\n return { type: made, suggested: made }\n }\n return OFFERED.test(type) ? { type, suggested: type } : { type }\n}\n\n/** Why the first save cannot go on with this type, as an i18n key, or null when it can. */\nexport function firstSaveRefusalOf(type: string, taken: readonly string[]): { key: string; type?: string } | null {\n if (!type) return { key: 'figure.text.enter-a-type-name' }\n if (taken.includes(type)) return { key: 'figure.text.type-name-already-taken', type }\n return null\n}\n\n/** What the first save asks for. */\nexport interface FirstSave {\n type: string\n name: string\n /** The domain's namespace to create it under, when the domain has several; its default when absent. */\n namespace?: string\n}\n"]}
@@ -0,0 +1,2 @@
1
+ /** A field opened by a press takes the keys at once, its value selected to be typed over. */
2
+ export declare const focusOnRender: () => import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/ref").RefDirective>;
@@ -0,0 +1,4 @@
1
+ import { ref } from 'lit/directives/ref.js';
2
+ /** A field opened by a press takes the keys at once, its value selected to be typed over. */
3
+ export const focusOnRender = () => ref(el => el && requestAnimationFrame(() => el.select()));
4
+ //# sourceMappingURL=focus-on-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-on-render.js","sourceRoot":"","sources":["../../client/modeller/focus-on-render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,qBAAqB,CAAC,GAAG,EAAE,CAAE,EAAuB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA","sourcesContent":["import { ref } from 'lit/directives/ref.js'\n\n/** A field opened by a press takes the keys at once, its value selected to be typed over. */\nexport const focusOnRender = () => ref(el => el && requestAnimationFrame(() => (el as HTMLInputElement).select()))\n"]}