@things-factory/figure-ui 10.1.81 → 10.1.83

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 (148) hide show
  1. package/client/figure-assistant.ts +2 -2
  2. package/client/graphql/index.ts +99 -10
  3. package/client/graphql/reached.ts +25 -0
  4. package/client/graphql/store.ts +27 -4
  5. package/client/modeller/ai-proposal.ts +74 -9
  6. package/client/modeller/align.ts +2 -3
  7. package/client/modeller/canvas.ts +18 -5
  8. package/client/modeller/command-preview.ts +113 -0
  9. package/client/modeller/editor.ts +800 -53
  10. package/client/modeller/fields.ts +12 -4
  11. package/client/modeller/figure-facts.ts +2 -2
  12. package/client/modeller/figure-first-save.ts +36 -14
  13. package/client/modeller/figure-history-panel.ts +133 -14
  14. package/client/modeller/figure-links.ts +357 -94
  15. package/client/modeller/figure-parts.ts +56 -2
  16. package/client/modeller/figure-preview.ts +19 -1
  17. package/client/modeller/figure-properties.ts +3 -3
  18. package/client/modeller/figure-revert-choice.ts +49 -0
  19. package/client/modeller/first-save.ts +16 -0
  20. package/client/modeller/gizmo.ts +0 -16
  21. package/client/modeller/links.ts +142 -15
  22. package/client/modeller/motion-ends.ts +83 -0
  23. package/client/modeller/occupancy.ts +28 -2
  24. package/client/modeller/product-session.ts +154 -18
  25. package/client/modeller/refusals.ts +15 -0
  26. package/client/modeller/revert-request.ts +26 -0
  27. package/client/modeller/side-panel-styles.ts +12 -0
  28. package/client/modeller/stage-model.ts +25 -3
  29. package/client/pages/figure-modeller-page.ts +68 -29
  30. package/dist-client/figure-assistant.js +2 -2
  31. package/dist-client/figure-assistant.js.map +1 -1
  32. package/dist-client/graphql/index.d.ts +39 -2
  33. package/dist-client/graphql/index.js +63 -9
  34. package/dist-client/graphql/index.js.map +1 -1
  35. package/dist-client/graphql/reached.d.ts +10 -0
  36. package/dist-client/graphql/reached.js +28 -0
  37. package/dist-client/graphql/reached.js.map +1 -0
  38. package/dist-client/graphql/store.js +27 -4
  39. package/dist-client/graphql/store.js.map +1 -1
  40. package/dist-client/modeller/ai-proposal.d.ts +31 -2
  41. package/dist-client/modeller/ai-proposal.js +65 -6
  42. package/dist-client/modeller/ai-proposal.js.map +1 -1
  43. package/dist-client/modeller/align.d.ts +1 -1
  44. package/dist-client/modeller/align.js +0 -2
  45. package/dist-client/modeller/align.js.map +1 -1
  46. package/dist-client/modeller/canvas.d.ts +11 -0
  47. package/dist-client/modeller/canvas.js +33 -4
  48. package/dist-client/modeller/canvas.js.map +1 -1
  49. package/dist-client/modeller/command-preview.d.ts +35 -0
  50. package/dist-client/modeller/command-preview.js +95 -0
  51. package/dist-client/modeller/command-preview.js.map +1 -0
  52. package/dist-client/modeller/editor.d.ts +107 -1
  53. package/dist-client/modeller/editor.js +823 -49
  54. package/dist-client/modeller/editor.js.map +1 -1
  55. package/dist-client/modeller/fields.d.ts +3 -2
  56. package/dist-client/modeller/fields.js +10 -3
  57. package/dist-client/modeller/fields.js.map +1 -1
  58. package/dist-client/modeller/figure-capability-panel.d.ts +1 -1
  59. package/dist-client/modeller/figure-clips.d.ts +1 -1
  60. package/dist-client/modeller/figure-controls.d.ts +1 -1
  61. package/dist-client/modeller/figure-facts.js +2 -2
  62. package/dist-client/modeller/figure-facts.js.map +1 -1
  63. package/dist-client/modeller/figure-first-save.d.ts +3 -4
  64. package/dist-client/modeller/figure-first-save.js +41 -14
  65. package/dist-client/modeller/figure-first-save.js.map +1 -1
  66. package/dist-client/modeller/figure-history-panel.d.ts +31 -0
  67. package/dist-client/modeller/figure-history-panel.js +130 -14
  68. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  69. package/dist-client/modeller/figure-links.d.ts +52 -2
  70. package/dist-client/modeller/figure-links.js +366 -97
  71. package/dist-client/modeller/figure-links.js.map +1 -1
  72. package/dist-client/modeller/figure-material-panel.d.ts +1 -1
  73. package/dist-client/modeller/figure-parts.d.ts +7 -0
  74. package/dist-client/modeller/figure-parts.js +55 -2
  75. package/dist-client/modeller/figure-parts.js.map +1 -1
  76. package/dist-client/modeller/figure-preview.d.ts +6 -0
  77. package/dist-client/modeller/figure-preview.js +22 -1
  78. package/dist-client/modeller/figure-preview.js.map +1 -1
  79. package/dist-client/modeller/figure-properties.d.ts +1 -1
  80. package/dist-client/modeller/figure-properties.js +3 -3
  81. package/dist-client/modeller/figure-properties.js.map +1 -1
  82. package/dist-client/modeller/figure-revert-choice.d.ts +17 -0
  83. package/dist-client/modeller/figure-revert-choice.js +59 -0
  84. package/dist-client/modeller/figure-revert-choice.js.map +1 -0
  85. package/dist-client/modeller/first-save.d.ts +7 -0
  86. package/dist-client/modeller/first-save.js +17 -0
  87. package/dist-client/modeller/first-save.js.map +1 -1
  88. package/dist-client/modeller/gizmo.d.ts +0 -6
  89. package/dist-client/modeller/gizmo.js +0 -18
  90. package/dist-client/modeller/gizmo.js.map +1 -1
  91. package/dist-client/modeller/links.d.ts +49 -4
  92. package/dist-client/modeller/links.js +141 -15
  93. package/dist-client/modeller/links.js.map +1 -1
  94. package/dist-client/modeller/motion-ends.d.ts +12 -0
  95. package/dist-client/modeller/motion-ends.js +65 -0
  96. package/dist-client/modeller/motion-ends.js.map +1 -0
  97. package/dist-client/modeller/occupancy.d.ts +14 -1
  98. package/dist-client/modeller/occupancy.js +14 -1
  99. package/dist-client/modeller/occupancy.js.map +1 -1
  100. package/dist-client/modeller/product-session.d.ts +43 -2
  101. package/dist-client/modeller/product-session.js +146 -12
  102. package/dist-client/modeller/product-session.js.map +1 -1
  103. package/dist-client/modeller/refusals.d.ts +13 -0
  104. package/dist-client/modeller/refusals.js +16 -0
  105. package/dist-client/modeller/refusals.js.map +1 -1
  106. package/dist-client/modeller/revert-request.d.ts +16 -0
  107. package/dist-client/modeller/revert-request.js +11 -0
  108. package/dist-client/modeller/revert-request.js.map +1 -0
  109. package/dist-client/modeller/side-panel-styles.js +12 -0
  110. package/dist-client/modeller/side-panel-styles.js.map +1 -1
  111. package/dist-client/modeller/stage-model.d.ts +18 -2
  112. package/dist-client/modeller/stage-model.js +21 -3
  113. package/dist-client/modeller/stage-model.js.map +1 -1
  114. package/dist-client/pages/figure-modeller-page.d.ts +8 -1
  115. package/dist-client/pages/figure-modeller-page.js +72 -34
  116. package/dist-client/pages/figure-modeller-page.js.map +1 -1
  117. package/dist-client/tsconfig.tsbuildinfo +1 -1
  118. package/package.json +5 -5
  119. package/test/ai-proposal.test.ts +2 -2
  120. package/test/align.test.ts +50 -5
  121. package/test/browser/acceptance-page.js +187 -0
  122. package/test/browser/build.mjs +5 -1
  123. package/test/browser/revert-page.js +47 -0
  124. package/test/browser/serve-acceptance.mjs +85 -0
  125. package/test/browser/serve-revert.mjs +119 -0
  126. package/test/clip-ai-proposal.test.ts +104 -0
  127. package/test/clip-consent.test.ts +88 -0
  128. package/test/command-preview.test.ts +288 -0
  129. package/test/fields.test.ts +4 -3
  130. package/test/figure-assistant-surface.test.ts +4 -1
  131. package/test/first-minute.test.ts +96 -0
  132. package/test/first-save-suggest.test.ts +42 -0
  133. package/test/gizmo.test.ts +20 -16
  134. package/test/joint-fan.test.ts +2 -1
  135. package/test/layout.test.ts +9 -2
  136. package/test/links.test.ts +9 -5
  137. package/test/proposal-record.test.ts +126 -0
  138. package/test/release-entry.test.ts +28 -0
  139. package/test/release-panel.test.ts +3 -2
  140. package/test/resize-with-placement.test.ts +226 -0
  141. package/test/revert-choice.test.ts +39 -0
  142. package/test/revert-keeping.test.ts +102 -0
  143. package/test/save-landed.test.ts +198 -0
  144. package/translations/en.json +229 -11
  145. package/translations/ja.json +229 -11
  146. package/translations/ko.json +230 -12
  147. package/translations/ms.json +228 -10
  148. package/translations/zh.json +229 -11
@@ -8,7 +8,7 @@ export type Axis3 = 'x' | 'y' | 'z';
8
8
  export type FieldGroup = {
9
9
  kind: 'vector';
10
10
  name: 'position' | 'rotation' | 'size';
11
- cells: Record<Axis3, FieldLike>;
11
+ cells: Partial<Record<Axis3, FieldLike>>;
12
12
  } | {
13
13
  kind: 'single';
14
14
  name: string;
@@ -16,7 +16,8 @@ export type FieldGroup = {
16
16
  };
17
17
  /**
18
18
  * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come
19
- * first, each only when all three of its axes are there; the rest follow in the order they are declared.
19
+ * first, each as one row when any of its axes is there -- an axis a rule sets shows as held, not as a stray single
20
+ * further down; the rest follow in the order they are declared.
20
21
  */
21
22
  export declare function groupFields(fields: readonly FieldLike[], part?: string): {
22
23
  vectors: FieldGroup[];
@@ -5,9 +5,14 @@ function nameOf(rest) {
5
5
  }
6
6
  /**
7
7
  * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come
8
- * first, each only when all three of its axes are there; the rest follow in the order they are declared.
8
+ * first, each as one row when any of its axes is there -- an axis a rule sets shows as held, not as a stray single
9
+ * further down; the rest follow in the order they are declared.
9
10
  */
10
11
  export function groupFields(fields, part) {
12
+ /*
13
+ A part is always placed and turned, so its position and turn rows stand even when a rule sets every axis (a
14
+ fastened part): the screen shows the numbers the rule gives. Its size row stands only when it has a field of its own.
15
+ */
11
16
  const prefix = part ? `${part}.` : '';
12
17
  const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\.[xyz]$/.test(f.id)));
13
18
  const byId = new Map(own.map(f => [f.id, f]));
@@ -15,10 +20,12 @@ export function groupFields(fields, part) {
15
20
  const vectors = [];
16
21
  for (const name of ['position', 'rotation', 'size']) {
17
22
  const ids = AXES.map(axis => `${prefix}${name}.${axis}`);
18
- if (!ids.every(id => byId.has(id)))
23
+ if (!ids.some(id => byId.has(id)) && !(part && name !== 'size'))
19
24
  continue;
20
25
  ids.forEach(id => used.add(id));
21
- vectors.push({ kind: 'vector', name, cells: { x: byId.get(ids[0]), y: byId.get(ids[1]), z: byId.get(ids[2]) } });
26
+ const cells = {};
27
+ AXES.forEach((axis, i) => byId.has(ids[i]) && (cells[axis] = byId.get(ids[i])));
28
+ vectors.push({ kind: 'vector', name, cells });
22
29
  }
23
30
  const singles = own.filter(f => !used.has(f.id)).map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }));
24
31
  return { vectors, singles };
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../client/modeller/fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAM9C,+GAA+G;AAC/G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,MAA4B,EAAE,IAAa;IACrE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACpH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,OAAO,GAAiB,EAAE,CAAA;IAChC,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAU,EAAE,CAAC;QAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,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n * as one row of three cells each (X · Y · Z read together), and the shape's own measures one to a line under their\n * own title. Kept apart from the editor so the grouping is tested without a browser.\n */\nexport interface FieldLike {\n id: string\n unit: string\n role?: string\n value: number\n}\n\nexport type Axis3 = 'x' | 'y' | 'z'\nconst AXES: readonly Axis3[] = ['x', 'y', 'z']\n\nexport type FieldGroup =\n | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: Record<Axis3, FieldLike> }\n | { kind: 'single'; name: string; field: FieldLike }\n\n/** The name a single value goes by: its id without the part, `dimension.` and corner numbers read as words. */\nfunction nameOf(rest: string): string {\n return rest.replace(/^dimension\\./, '')\n}\n\n/**\n * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come\n * first, each only when all three of its axes are there; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\n const prefix = part ? `${part}.` : ''\n const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\\.[xyz]$/.test(f.id)))\n const byId = new Map(own.map(f => [f.id, f]))\n const used = new Set<string>()\n const vectors: FieldGroup[] = []\n for (const name of ['position', 'rotation', 'size'] as const) {\n const ids = AXES.map(axis => `${prefix}${name}.${axis}`)\n if (!ids.every(id => byId.has(id))) continue\n ids.forEach(id => used.add(id))\n vectors.push({ kind: 'vector', name, cells: { x: byId.get(ids[0]!)!, y: byId.get(ids[1]!)!, z: byId.get(ids[2]!)! } })\n }\n const singles: FieldGroup[] = own.filter(f => !used.has(f.id)).map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }))\n return { vectors, singles }\n}\n\n/**\n * The part a copy copies: the member at the end of its path. A row repeats its part and what is fastened to it\n * (ADR-0093, 2026-09-26), so the copies of one row are of several parts -- a roller's and the mark on it.\n */\nconst memberOf = (path: unknown[]): string => {\n const last = [...path].reverse().find((step): step is string => typeof step === 'string')!\n return last.replace(/\\.(placed|value)$/, '').replace(/\\.repeat$/, '')\n}\n\n/**\n * The name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.placed\"]`), which the list showed as it was; it reads as the part it copies and its place counted from 1 --\n * `roller 1`, and `mark 1` for the mark the first roller carries. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n const path = pathOf(id)\n if (!path) return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${memberOf(path)} ${places.join('·')}` : id\n}\n\n/**\n * The repeat a body is a copy of: its name, how many copies it makes, and which copy this is (counted from 1). Nothing\n * for a body that is not a copy.\n */\nexport function repeatOf(id: string, geometry: readonly unknown[] | undefined): { name: string; count: number; index: number } | null {\n const path = pathOf(id)\n const paths = (geometry ?? []).map(g => pathOf((g as { id?: string }).id ?? '')).filter((p): p is unknown[] => !!p)\n if (!path) {\n /* The part itself, by its name: how many copies of it the row makes now. */\n const copies = paths.filter(p => memberOf(p) === id).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const name = memberOf(path)\n const count = paths.filter(p => p[0] === path[0] && memberOf(p) === name).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name, count, index: (index ?? 0) + 1 }\n}\n\nfunction pathOf(id: string): unknown[] | null {\n if (!id.startsWith('[')) return null\n try {\n const path = JSON.parse(id)\n return Array.isArray(path) && typeof path[0] === 'string' ? path : null\n } catch {\n return null\n }\n}\n\n/**\n * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The\n * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\nexport function ownerOf(id: string): string {\n const path = pathOf(id)\n return path ? memberOf(path) : id\n}\n\n"]}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../client/modeller/fields.ts"],"names":[],"mappings":"AAaA,MAAM,IAAI,GAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAO9C,+GAA+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;IAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,CAAA;IAChF,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAA;IAC3E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAA;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,EAAU;IACxB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IACvB,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACnC,CAAC","sourcesContent":["/*\n * The values a part or the figure is edited by, grouped: position, rotation and size\n * as one row of three cells each (X · Y · Z read together), and the shape's own measures one to a line under their\n * own title. Kept apart from the editor so the grouping is tested without a browser.\n */\nexport interface FieldLike {\n id: string\n unit: string\n role?: string\n value: number\n}\n\nexport type Axis3 = 'x' | 'y' | 'z'\nconst AXES: readonly Axis3[] = ['x', 'y', 'z']\n\nexport type FieldGroup =\n /* A cell is missing where a rule sets that axis instead of a number: a floor part's height position (ADR-0097). */\n | { kind: 'vector'; name: 'position' | 'rotation' | 'size'; cells: Partial<Record<Axis3, FieldLike>> }\n | { kind: 'single'; name: string; field: FieldLike }\n\n/** The name a single value goes by: its id without the part, `dimension.` and corner numbers read as words. */\nfunction nameOf(rest: string): string {\n return rest.replace(/^dimension\\./, '')\n}\n\n/**\n * The part's own values (`<part>.…`), or with no part the figure's (`size.x` …). Position, rotation and size come\n * first, each as one row when any of its axes is there -- an axis a rule sets shows as held, not as a stray single\n * further down; the rest follow in the order they are declared.\n */\nexport function groupFields(fields: readonly FieldLike[], part?: string): { vectors: FieldGroup[]; singles: FieldGroup[] } {\n /*\n A part is always placed and turned, so its position and turn rows stand even when a rule sets every axis (a\n fastened part): the screen shows the numbers the rule gives. Its size row stands only when it has a field of its own.\n */\n const prefix = part ? `${part}.` : ''\n const own = fields.filter(f => (part ? f.id.startsWith(prefix) : !f.id.includes('.') || /^size\\.[xyz]$/.test(f.id)))\n const byId = new Map(own.map(f => [f.id, f]))\n const used = new Set<string>()\n const vectors: FieldGroup[] = []\n for (const name of ['position', 'rotation', 'size'] as const) {\n const ids = AXES.map(axis => `${prefix}${name}.${axis}`)\n if (!ids.some(id => byId.has(id)) && !(part && name !== 'size')) continue\n ids.forEach(id => used.add(id))\n const cells: Partial<Record<Axis3, FieldLike>> = {}\n AXES.forEach((axis, i) => byId.has(ids[i]!) && (cells[axis] = byId.get(ids[i]!)!))\n vectors.push({ kind: 'vector', name, cells })\n }\n const singles: FieldGroup[] = own.filter(f => !used.has(f.id)).map(field => ({ kind: 'single', name: nameOf(field.id.slice(prefix.length)), field }))\n return { vectors, singles }\n}\n\n/**\n * The part a copy copies: the member at the end of its path. A row repeats its part and what is fastened to it\n * (ADR-0093, 2026-09-26), so the copies of one row are of several parts -- a roller's and the mark on it.\n */\nconst memberOf = (path: unknown[]): string => {\n const last = [...path].reverse().find((step): step is string => typeof step === 'string')!\n return last.replace(/\\.(placed|value)$/, '').replace(/\\.repeat$/, '')\n}\n\n/**\n * The name a person reads for a body. A repeated body's id is its path through the repeats (`[\"roller.repeat\",0,\n * \"roller.placed\"]`), which the list showed as it was; it reads as the part it copies and its place counted from 1 --\n * `roller 1`, and `mark 1` for the mark the first roller carries. Any other id is its own name.\n */\nexport function partLabelOf(id: string): string {\n const path = pathOf(id)\n if (!path) return id\n const places = path.filter((step): step is number => typeof step === 'number').map(n => n + 1)\n return places.length ? `${memberOf(path)} ${places.join('·')}` : id\n}\n\n/**\n * The repeat a body is a copy of: its name, how many copies it makes, and which copy this is (counted from 1). Nothing\n * for a body that is not a copy.\n */\nexport function repeatOf(id: string, geometry: readonly unknown[] | undefined): { name: string; count: number; index: number } | null {\n const path = pathOf(id)\n const paths = (geometry ?? []).map(g => pathOf((g as { id?: string }).id ?? '')).filter((p): p is unknown[] => !!p)\n if (!path) {\n /* The part itself, by its name: how many copies of it the row makes now. */\n const copies = paths.filter(p => memberOf(p) === id).length\n return copies ? { name: id, count: copies, index: 0 } : null\n }\n const name = memberOf(path)\n const count = paths.filter(p => p[0] === path[0] && memberOf(p) === name).length\n const index = path.find((step): step is number => typeof step === 'number')\n return { name, count, index: (index ?? 0) + 1 }\n}\n\nfunction pathOf(id: string): unknown[] | null {\n if (!id.startsWith('[')) return null\n try {\n const path = JSON.parse(id)\n return Array.isArray(path) && typeof path[0] === 'string' ? path : null\n } catch {\n return null\n }\n}\n\n/**\n * The authored part a body belongs to: a repeat's copy belongs to its repeat (`roller`), any other body is its own. The\n * editor selects, lists, hides and names parts by this -- what the author made, not every body the kernel draws\n * (user, 2026-09-24: the conveyor's sixteen rollers were sixteen rows).\n */\nexport function ownerOf(id: string): string {\n const path = pathOf(id)\n return path ? memberOf(path) : id\n}\n\n"]}
@@ -15,7 +15,7 @@ export declare class FigureCapabilityPanel extends FigureCapabilityPanel_base {
15
15
  /** The selected part, whose places are marked. */
16
16
  selected: string;
17
17
  locked: boolean;
18
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
18
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
19
19
  private setRung;
20
20
  private pick;
21
21
  }
@@ -18,7 +18,7 @@ export declare class FigureClips extends FigureClips_base {
18
18
  /** Where each clip is scrubbed to, in seconds. */
19
19
  private at;
20
20
  private adding;
21
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
21
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
22
22
  private renderClip;
23
23
  private renderTrack;
24
24
  private renderAdd;
@@ -22,7 +22,7 @@ export declare class FigureControls extends FigureControls_base {
22
22
  private open;
23
23
  /** Values in hand while a slider is dragged: the dial and the number follow them before the release commits. */
24
24
  private live;
25
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
25
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
26
26
  private renderControl;
27
27
  private renderDial;
28
28
  private renderSettings;
@@ -15,13 +15,13 @@ export function figureFigureFacts(source) {
15
15
  name: asset.name,
16
16
  parts,
17
17
  declared: !!asset.occupancy,
18
- placement: asset.occupancy?.placement,
18
+ placement: asset.placement,
19
19
  mounting: found ? { part: found[1], face: found[2] } : undefined,
20
20
  suggested: suggestedMountOf(asset, parts)
21
21
  };
22
22
  }
23
23
  function suggestedMountOf(asset, parts) {
24
- const placement = (asset.occupancy?.placement ?? 'floor');
24
+ const placement = (asset.placement ?? 'floor');
25
25
  if (placement === 'center' || !parts.length)
26
26
  return undefined;
27
27
  let boxes;
@@ -1 +1 @@
1
- {"version":3,"file":"figure-facts.js","sourceRoot":"","sources":["../../client/modeller/figure-facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAwBrH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,K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AE,CAAC;aAChD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CACjC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { compileFigureAsset, parseFigureAsset, figureOccupiedBoxesOf, figureWritersOf } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureFace } from '@hatiolab/figure-model'\n\n/*\n * What the properties tab reads, kept apart from the element so it can be tested without a browser.\n */\n\nexport type Placement = 'floor' | 'ceiling' | 'center' | 'wall'\n\n/** What the properties tab reads off the asset. Absent parts of the asset read as absent, never as a default. */\nexport interface FigureFigureFacts {\n name: string\n parts: string[]\n declared: boolean\n placement?: Placement\n mounting?: { part: string; face: FigureFace }\n /**\n * Where the figure meets its plane, as its parts stand: the part whose bottom is lowest for a floor, whose top is\n * highest for a ceiling, whose back is furthest back for a wall. What the mounting face is offered as before one is\n * chosen -- the first part in the list offered a conveyor's bed, 700 mm up on its legs (walk 1, 2026-09-26).\n */\n suggested?: { part: string; face: FigureFace }\n}\n\n/**\n * The asset's own facts, as the properties tab shows them.\n *\n * The mounting face is read back from the feature `set-mounting-face` writes (`<part>.mount.<face>`): the asset\n * records the face only as that node, so this is where the screen learns which one is chosen. Parts are the placed\n * bodies (`place@1`), in the order the model lists them.\n */\nexport function figureFigureFacts(source: string): FigureFigureFacts {\n const asset = parseFigureAsset(source) as FigureAsset & { document: { model: { nodes: Array<{ id: string; op: string }> } } }\n const parts = asset.document.model.nodes.filter(node => node.op === 'place@1').map(node => node.id)\n const feature = (asset.occupancy?.contact as { surface?: { feature?: string } } | undefined)?.surface?.feature\n const found = feature?.match(/^(.+)\\.mount\\.(left|right|bottom|top|back|front)\\.value$/)\n return {\n name: asset.name,\n parts,\n declared: !!asset.occupancy,\n placement: asset.occupancy?.placement as Placement | undefined,\n mounting: found ? { part: found[1], face: found[2] as FigureFace } : undefined,\n suggested: suggestedMountOf(asset, parts)\n }\n}\n\nfunction suggestedMountOf(asset: FigureAsset, parts: string[]): { part: string; face: FigureFace } | undefined {\n const placement = (asset.occupancy?.placement ?? 'floor') as Placement\n if (placement === 'center' || !parts.length) return undefined\n let boxes\n try {\n boxes = figureOccupiedBoxesOf(compileFigureAsset(asset).evaluate().geometry, figureWritersOf(asset)).filter(b => parts.includes(b.part))\n } catch {\n return undefined\n }\n const [axis, face, sign] = placement === 'wall' ? (['z', 'back', -1] as const) : placement === 'ceiling' ? (['y', 'top', 1] as const) : (['y', 'bottom', -1] as const)\n /* The side of each box that faces the plane; the one furthest toward it, the first in the list among equals. */\n const reach = (b: (typeof boxes)[number]) => sign * (b.centre[axis] + (sign * b.extent[axis]) / 2)\n let best: (typeof boxes)[number] | undefined\n for (const b of boxes) if (!best || reach(b) > reach(best) + 1e-6) best = b\n return best ? { part: best.part, face } : undefined\n}\n\n/**\n * A tag line as a list: split on commas, drop a leading `#`, keep each once. An empty\n * line is an empty list, so an author can clear every tag.\n */\nexport function tagsOf(raw: string): string[] {\n return [\n ...new Set(\n raw\n .split(',')\n .map(one => one.trim().replace(/^#+/, '').trim())\n .filter(one => one.length > 0)\n )\n ]\n}\n"]}
1
+ {"version":3,"file":"figure-facts.js","sourceRoot":"","sources":["../../client/modeller/figure-facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAwBrH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAwF,CAAA;IAC7H,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACnG,MAAM,OAAO,GAAI,KAAK,CAA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C,CAAC,CAAE,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAW,CAAC,CAAC,CAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAW,CAAA;IACtK,gHAAgH;IAChH,MAAM,KAAK,GAAG,CAAC,CAAyB,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAClG,IAAI,IAAwC,CAAA;IAC5C,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAA;IAC3E,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO;QACL,GAAG,IAAI,GAAG,CACR,GAAG;aACA,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;aAChD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CACjC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { compileFigureAsset, parseFigureAsset, figureOccupiedBoxesOf, figureWritersOf } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureFace } from '@hatiolab/figure-model'\n\n/*\n * What the properties tab reads, kept apart from the element so it can be tested without a browser.\n */\n\nexport type Placement = 'floor' | 'ceiling' | 'center' | 'wall'\n\n/** What the properties tab reads off the asset. Absent parts of the asset read as absent, never as a default. */\nexport interface FigureFigureFacts {\n name: string\n parts: string[]\n declared: boolean\n placement?: Placement\n mounting?: { part: string; face: FigureFace }\n /**\n * Where the figure meets its plane, as its parts stand: the part whose bottom is lowest for a floor, whose top is\n * highest for a ceiling, whose back is furthest back for a wall. What the mounting face is offered as before one is\n * chosen -- the first part in the list offered a conveyor's bed, 700 mm up on its legs (walk 1, 2026-09-26).\n */\n suggested?: { part: string; face: FigureFace }\n}\n\n/**\n * The asset's own facts, as the properties tab shows them.\n *\n * The mounting face is read back from the feature `set-mounting-face` writes (`<part>.mount.<face>`): the asset\n * records the face only as that node, so this is where the screen learns which one is chosen. Parts are the placed\n * bodies (`place@1`), in the order the model lists them.\n */\nexport function figureFigureFacts(source: string): FigureFigureFacts {\n const asset = parseFigureAsset(source) as FigureAsset & { document: { model: { nodes: Array<{ id: string; op: string }> } } }\n const parts = asset.document.model.nodes.filter(node => node.op === 'place@1').map(node => node.id)\n const feature = (asset.occupancy?.contact as { surface?: { feature?: string } } | undefined)?.surface?.feature\n const found = feature?.match(/^(.+)\\.mount\\.(left|right|bottom|top|back|front)\\.value$/)\n return {\n name: asset.name,\n parts,\n declared: !!asset.occupancy,\n placement: asset.placement as Placement | undefined,\n mounting: found ? { part: found[1], face: found[2] as FigureFace } : undefined,\n suggested: suggestedMountOf(asset, parts)\n }\n}\n\nfunction suggestedMountOf(asset: FigureAsset, parts: string[]): { part: string; face: FigureFace } | undefined {\n const placement = (asset.placement ?? 'floor') as Placement\n if (placement === 'center' || !parts.length) return undefined\n let boxes\n try {\n boxes = figureOccupiedBoxesOf(compileFigureAsset(asset).evaluate().geometry, figureWritersOf(asset)).filter(b => parts.includes(b.part))\n } catch {\n return undefined\n }\n const [axis, face, sign] = placement === 'wall' ? (['z', 'back', -1] as const) : placement === 'ceiling' ? (['y', 'top', 1] as const) : (['y', 'bottom', -1] as const)\n /* The side of each box that faces the plane; the one furthest toward it, the first in the list among equals. */\n const reach = (b: (typeof boxes)[number]) => sign * (b.centre[axis] + (sign * b.extent[axis]) / 2)\n let best: (typeof boxes)[number] | undefined\n for (const b of boxes) if (!best || reach(b) > reach(best) + 1e-6) best = b\n return best ? { part: best.part, face } : undefined\n}\n\n/**\n * A tag line as a list: split on commas, drop a leading `#`, keep each once. An empty\n * line is an empty list, so an author can clear every tag.\n */\nexport function tagsOf(raw: string): string[] {\n return [\n ...new Set(\n raw\n .split(',')\n .map(one => one.trim().replace(/^#+/, '').trim())\n .filter(one => one.length > 0)\n )\n ]\n}\n"]}
@@ -2,10 +2,6 @@ import { LitElement } from 'lit';
2
2
  import '@operato/popup/ox-popup-actions.js';
3
3
  import '@material/web/button/filled-button.js';
4
4
  import '@material/web/button/text-button.js';
5
- /**
6
- * The first save of a new figure: its type and its name, asked once, in the suite's popup look.
7
- * Closes with the answer, or with nothing when cancelled -- then nothing is saved.
8
- */
9
5
  export declare class FigureFirstSave extends LitElement {
10
6
  static styles: import("lit").CSSResult[];
11
7
  /** The type the figure has so far -- empty for a temporary one, which is not offered. */
@@ -14,6 +10,9 @@ export declare class FigureFirstSave extends LitElement {
14
10
  /** Type names already used in this domain. */
15
11
  taken: string[];
16
12
  private refusal;
13
+ /** The identifier offered, while the author has not changed it. */
14
+ private suggested;
15
+ willUpdate(changed: Map<string, unknown>): void;
17
16
  render(): import("lit-html").TemplateResult<1>;
18
17
  private onKey;
19
18
  private confirm;
@@ -7,11 +7,13 @@ import '@operato/popup/ox-popup-actions.js';
7
7
  import { CommonPopupStyles, FormFieldStyles } from '@operato/styles';
8
8
  import '@material/web/button/filled-button.js';
9
9
  import '@material/web/button/text-button.js';
10
- import { firstSaveRefusalOf, releasableType, typeOf } from './first-save.js';
10
+ import { firstSaveRefusalOf, releasableType, suggestTypeOf, typeOf } from './first-save.js';
11
11
  /**
12
12
  * The first save of a new figure: its type and its name, asked once, in the suite's popup look.
13
13
  * Closes with the answer, or with nothing when cancelled -- then nothing is saved.
14
14
  */
15
+ /** The shape of an identifier the modeller offers (`suggestTypeOf`'s random form). */
16
+ const OFFERED = /^FIG_[0-9A-Z]{6}$/;
15
17
  let FigureFirstSave = class FigureFirstSave extends LitElement {
16
18
  constructor() {
17
19
  super(...arguments);
@@ -21,6 +23,8 @@ let FigureFirstSave = class FigureFirstSave extends LitElement {
21
23
  /** Type names already used in this domain. */
22
24
  this.taken = [];
23
25
  this.refusal = null;
26
+ /** The identifier offered, while the author has not changed it. */
27
+ this.suggested = '';
24
28
  this.onKey = (e) => {
25
29
  if (e.key === 'Enter' && !e.isComposing)
26
30
  this.confirm();
@@ -57,15 +61,40 @@ let FigureFirstSave = class FigureFirstSave extends LitElement {
57
61
  }
58
62
  `
59
63
  ]; }
64
+ /*
65
+ Asked for a name first, with a valid identifier already there to keep or change (Q-D3). The identifier is not the
66
+ name: renaming does not change it, and a retried first save opens on the one answered before (the page keeps it).
67
+ Only an offered one found taken -- told by the server, or in the list -- is offered again; one the author typed is
68
+ kept as typed, and its refusal said.
69
+ */
70
+ willUpdate(changed) {
71
+ if (!(changed.has('type') || changed.has('taken')))
72
+ return;
73
+ const offeredAndTaken = OFFERED.test(this.type) && this.taken.includes(this.type);
74
+ if (!this.type || offeredAndTaken)
75
+ this.type = this.suggested = suggestTypeOf(this.name, this.taken);
76
+ else if (OFFERED.test(this.type))
77
+ this.suggested = this.type;
78
+ }
60
79
  render() {
61
80
  return html `
62
81
  <div class="what">${i18next.t('figure.text.save-new-figure-desc')}</div>
63
82
  <div field>
64
- <label for="type">${i18next.t('figure.label.figure-type')}</label>
83
+ <label for="name">${i18next.t('figure.label.name')}</label>
84
+ <input
85
+ id="name"
86
+ autofocus
87
+ .value=${this.name}
88
+ placeholder=${i18next.t('figure.text.figure-name-example')}
89
+ @input=${(e) => (this.name = e.target.value)}
90
+ @keydown=${this.onKey}
91
+ />
92
+ </div>
93
+ <div field>
94
+ <label for="type">${i18next.t('figure.label.figure-identifier')}</label>
65
95
  <input
66
96
  id="type"
67
97
  type-field
68
- autofocus
69
98
  .value=${this.type}
70
99
  placeholder=${i18next.t('figure.text.figure-type-example')}
71
100
  @input=${(e) => {
@@ -75,17 +104,11 @@ let FigureFirstSave = class FigureFirstSave extends LitElement {
75
104
  }}
76
105
  @keydown=${this.onKey}
77
106
  />
78
- ${this.type && !releasableType(this.type) ? html `<div class="note">${i18next.t('figure.text.type-name-will-not-release')}</div>` : nothing}
79
- </div>
80
- <div field>
81
- <label for="name">${i18next.t('figure.label.name')}</label>
82
- <input
83
- id="name"
84
- .value=${this.name}
85
- placeholder=${i18next.t('figure.text.figure-name-example')}
86
- @input=${(e) => (this.name = e.target.value)}
87
- @keydown=${this.onKey}
88
- />
107
+ ${this.type && !releasableType(this.type)
108
+ ? html `<div class="note">${i18next.t('figure.text.type-name-will-not-release')}</div>`
109
+ : this.suggested && this.type === this.suggested
110
+ ? html `<div class="note">${i18next.t('figure.text.identifier-suggested')}</div>`
111
+ : nothing}
89
112
  </div>
90
113
  ${this.refusal ? html `<div class="failure" role="alert">${i18next.t(this.refusal.key, { type: this.refusal.type })}</div>` : nothing}
91
114
  <ox-popup-actions>
@@ -111,6 +134,10 @@ __decorate([
111
134
  state(),
112
135
  __metadata("design:type", Object)
113
136
  ], FigureFirstSave.prototype, "refusal", void 0);
137
+ __decorate([
138
+ state(),
139
+ __metadata("design:type", Object)
140
+ ], FigureFirstSave.prototype, "suggested", void 0);
114
141
  FigureFirstSave = __decorate([
115
142
  customElement('figure-first-save')
116
143
  ], FigureFirstSave);
@@ -1 +1 @@
1
- {"version":3,"file":"figure-first-save.js","sourceRoot":"","sources":["../../client/modeller/figure-first-save.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,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC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AAC;;KAEpH,CAAA;IACH,CAAC;;AA1CW;IAAX,QAAQ,EAAE;;6CAAU;AACT;IAAX,QAAQ,EAAE;;6CAAU;AAEW;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;8CAAqB;AACnC;IAAhB,KAAK,EAAE;;gDAA8D;AAhC3D,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAiF3B","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles, FormFieldStyles } from '@operato/styles'\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { firstSaveRefusalOf, releasableType, typeOf, type FirstSave } from './first-save.js'\n\n/**\n * The first save of a new figure: its type and its name, asked once, in the suite's popup look.\n * Closes with the answer, or with nothing when cancelled -- then nothing is saved.\n */\n@customElement('figure-first-save')\nexport class FigureFirstSave extends LitElement {\n static styles = [\n FormFieldStyles,\n CommonPopupStyles,\n css`\n /* The popup's height is a share of the window (small is 40%): on a low window the buttons must still be reached. */\n :host {\n overflow-y: auto;\n }\n div[field] {\n display: grid;\n gap: 4px;\n }\n div[field] label {\n font-size: var(--popup-font-size-small);\n color: var(--md-sys-color-on-surface-variant);\n }\n div[field] input {\n box-sizing: border-box;\n width: 100%;\n }\n input[type-field] {\n font-family: var(--mono-font, monospace);\n }\n `\n ]\n\n /** The type the figure has so far -- empty for a temporary one, which is not offered. */\n @property() type = ''\n @property() name = ''\n /** Type names already used in this domain. */\n @property({ attribute: false }) taken: string[] = []\n @state() private refusal: { key: string; type?: string } | null = null\n\n render() {\n return html`\n <div class=\"what\">${i18next.t('figure.text.save-new-figure-desc')}</div>\n <div field>\n <label for=\"type\">${i18next.t('figure.label.figure-type')}</label>\n <input\n id=\"type\"\n type-field\n autofocus\n .value=${this.type}\n placeholder=${i18next.t('figure.text.figure-type-example')}\n @input=${(e: Event) => {\n this.type = typeOf((e.target as HTMLInputElement).value)\n ;(e.target as HTMLInputElement).value = this.type\n this.refusal = null\n }}\n @keydown=${this.onKey}\n />\n ${this.type && !releasableType(this.type) ? html`<div class=\"note\">${i18next.t('figure.text.type-name-will-not-release')}</div>` : nothing}\n </div>\n <div field>\n <label for=\"name\">${i18next.t('figure.label.name')}</label>\n <input\n id=\"name\"\n .value=${this.name}\n placeholder=${i18next.t('figure.text.figure-name-example')}\n @input=${(e: Event) => (this.name = (e.target as HTMLInputElement).value)}\n @keydown=${this.onKey}\n />\n </div>\n ${this.refusal ? html`<div class=\"failure\" role=\"alert\">${i18next.t(this.refusal.key, { type: this.refusal.type })}</div>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => closePopup(this)}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" ?disabled=${!this.type} @click=${this.confirm}>${i18next.t('figure.button.save')}</md-filled-button>\n </ox-popup-actions>\n `\n }\n\n private onKey = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.isComposing) this.confirm()\n }\n\n private confirm = () => {\n this.refusal = firstSaveRefusalOf(this.type, this.taken)\n if (this.refusal) return\n closePopup(this, { type: this.type, name: this.name.trim() || this.type } satisfies FirstSave)\n }\n}\n"]}
1
+ {"version":3,"file":"figure-first-save.js","sourceRoot":"","sources":["../../client/modeller/figure-first-save.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,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,oCAAoC,CAAA;AAC3C,OA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AAA;QACrB,CAAC;qBACU,IAAI,CAAC,KAAK;;UAErB,IAAI,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;YACvC,CAAC,CAAC,IAAI,CAAA,qBAAqB,OAAO,CAAC,CAAC,CAAC,wCAAwC,CAAC,QAAQ;YACtF,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS;gBAC9C,CAAC,CAAC,IAAI,CAAA,qBAAqB,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC,QAAQ;gBAChF,CAAC,CAAC,OAAO;;QAEb,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,qCAAqC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;;+CAE3F,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;qDACrD,CAAC,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;;KAEpH,CAAA;IACH,CAAC;;AA7DW;IAAX,QAAQ,EAAE;;6CAAU;AACT;IAAX,QAAQ,EAAE;;6CAAU;AAEW;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;8CAAqB;AACnC;IAAhB,KAAK,EAAE;;gDAA8D;AAErD;IAAhB,KAAK,EAAE;;kDAAuB;AAlCpB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAoG3B","sourcesContent":["import { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport '@operato/popup/ox-popup-actions.js'\nimport { CommonPopupStyles, FormFieldStyles } from '@operato/styles'\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\n\nimport { firstSaveRefusalOf, releasableType, suggestTypeOf, typeOf, type FirstSave } from './first-save.js'\n\n/**\n * The first save of a new figure: its type and its name, asked once, in the suite's popup look.\n * Closes with the answer, or with nothing when cancelled -- then nothing is saved.\n */\n/** The shape of an identifier the modeller offers (`suggestTypeOf`'s random form). */\nconst OFFERED = /^FIG_[0-9A-Z]{6}$/\n\n@customElement('figure-first-save')\nexport class FigureFirstSave extends LitElement {\n static styles = [\n FormFieldStyles,\n CommonPopupStyles,\n css`\n /* The popup's height is a share of the window (small is 40%): on a low window the buttons must still be reached. */\n :host {\n overflow-y: auto;\n }\n div[field] {\n display: grid;\n gap: 4px;\n }\n div[field] label {\n font-size: var(--popup-font-size-small);\n color: var(--md-sys-color-on-surface-variant);\n }\n div[field] input {\n box-sizing: border-box;\n width: 100%;\n }\n input[type-field] {\n font-family: var(--mono-font, monospace);\n }\n `\n ]\n\n /** The type the figure has so far -- empty for a temporary one, which is not offered. */\n @property() type = ''\n @property() name = ''\n /** Type names already used in this domain. */\n @property({ attribute: false }) taken: string[] = []\n @state() private refusal: { key: string; type?: string } | null = null\n /** The identifier offered, while the author has not changed it. */\n @state() private suggested = ''\n\n /*\n Asked for a name first, with a valid identifier already there to keep or change (Q-D3). The identifier is not the\n name: renaming does not change it, and a retried first save opens on the one answered before (the page keeps it).\n Only an offered one found taken -- told by the server, or in the list -- is offered again; one the author typed is\n kept as typed, and its refusal said.\n */\n willUpdate(changed: Map<string, unknown>) {\n if (!(changed.has('type') || changed.has('taken'))) return\n const offeredAndTaken = OFFERED.test(this.type) && this.taken.includes(this.type)\n if (!this.type || offeredAndTaken) this.type = this.suggested = suggestTypeOf(this.name, this.taken)\n else if (OFFERED.test(this.type)) this.suggested = this.type\n }\n\n render() {\n return html`\n <div class=\"what\">${i18next.t('figure.text.save-new-figure-desc')}</div>\n <div field>\n <label for=\"name\">${i18next.t('figure.label.name')}</label>\n <input\n id=\"name\"\n autofocus\n .value=${this.name}\n placeholder=${i18next.t('figure.text.figure-name-example')}\n @input=${(e: Event) => (this.name = (e.target as HTMLInputElement).value)}\n @keydown=${this.onKey}\n />\n </div>\n <div field>\n <label for=\"type\">${i18next.t('figure.label.figure-identifier')}</label>\n <input\n id=\"type\"\n type-field\n .value=${this.type}\n placeholder=${i18next.t('figure.text.figure-type-example')}\n @input=${(e: Event) => {\n this.type = typeOf((e.target as HTMLInputElement).value)\n ;(e.target as HTMLInputElement).value = this.type\n this.refusal = null\n }}\n @keydown=${this.onKey}\n />\n ${this.type && !releasableType(this.type)\n ? html`<div class=\"note\">${i18next.t('figure.text.type-name-will-not-release')}</div>`\n : this.suggested && this.type === this.suggested\n ? html`<div class=\"note\">${i18next.t('figure.text.identifier-suggested')}</div>`\n : nothing}\n </div>\n ${this.refusal ? html`<div class=\"failure\" role=\"alert\">${i18next.t(this.refusal.key, { type: this.refusal.type })}</div>` : nothing}\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => closePopup(this)}>${i18next.t('figure.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" ?disabled=${!this.type} @click=${this.confirm}>${i18next.t('figure.button.save')}</md-filled-button>\n </ox-popup-actions>\n `\n }\n\n private onKey = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.isComposing) this.confirm()\n }\n\n private confirm = () => {\n this.refusal = firstSaveRefusalOf(this.type, this.taken)\n if (this.refusal) return\n closePopup(this, { type: this.type, name: this.name.trim() || this.type } satisfies FirstSave)\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import './figure-revert-choice.js';
1
2
  import '@material/web/icon/icon.js';
2
3
  import { LitElement } from 'lit';
3
4
  declare const FigureHistoryPanel_base: (new (...args: any[]) => LitElement) & typeof LitElement;
@@ -19,6 +20,10 @@ declare const FigureHistoryPanel_base: (new (...args: any[]) => LitElement) & ty
19
20
  *
20
21
  * 옛 판의 정본·속성·그림이 돌아오고 이름·설명은 그대로다. 되살렸다고 그 판이 다시 발행되지는
21
22
  * 않는다 — 다시 내보내려면 발행을 한 번 더 하고, 그때 번호는 이미 쓴 다음 번호를 받는다.
23
+ *
24
+ * 덮이는 초안은 서버가 같은 트랜잭션에서 보관하고, 「되돌리기 전 초안」에 남는다(ADR-0097 §5.6, 디자이너 2026-09-27).
25
+ * 발행 판과 섞지 않는다. 다시 접속해도 거기서 찾고, 가장 최근 것은 「되돌리기 취소」로 되살린다 — 되돌린 뒤 모델이
26
+ * 바뀌었으면 서버가 거절하고 보관본은 남는다.
22
27
  */
23
28
  export declare class FigureHistoryPanel extends FigureHistoryPanel_base {
24
29
  static styles: import("lit").CSSResult[];
@@ -28,6 +33,13 @@ export declare class FigureHistoryPanel extends FigureHistoryPanel_base {
28
33
  figureVersion: number;
29
34
  /** 저장하지 않은 것이 있나 — 있으면 발행을 막는다. */
30
35
  dirty: boolean;
36
+ /** Saves the edits in hand before reverting; `ok` only when the save is known to have happened. */
37
+ saveFirst?: () => Promise<{
38
+ ok: boolean;
39
+ reason?: string;
40
+ }>;
41
+ /** The source the server is confirmed to hold: a revert goes on only while the server still holds it. */
42
+ serverSource?: () => string | undefined;
31
43
  /**
32
44
  * 행의 타입. 판정 하나(`type-is-placeholder`)가 이것을 본다 — 자산은 타입을 원본에 적지 않아서, 타입을 바꾸면
33
45
  * 원본도 dirty 도 그대로다. 그래서 이 값이 바뀌면 판정을 다시 묻는다. 안 그러면 타입을 정한 뒤에도 「임시 타입」
@@ -35,6 +47,13 @@ export declare class FigureHistoryPanel extends FigureHistoryPanel_base {
35
47
  */
36
48
  figureType?: string;
37
49
  private versions;
50
+ /** Drafts reverts kept, newest first -- apart from the released versions. */
51
+ private kept;
52
+ /**
53
+ * A revert or undo whose answer never came back. Asked again, it goes with the same request id, so the server
54
+ * answers with what it did rather than doing it twice. Any answer -- done or refused -- lets it go.
55
+ */
56
+ private pending?;
38
57
  private busy;
39
58
  private failure;
40
59
  /**
@@ -45,6 +64,8 @@ export declare class FigureHistoryPanel extends FigureHistoryPanel_base {
45
64
  updated(changes: Map<string, unknown>): void;
46
65
  private inspect;
47
66
  private reload;
67
+ /** The release section in view, focus on it: where the top bar's "release" leads (ADR-0097 §5.6, Q-D2). */
68
+ showRelease(): Promise<void>;
48
69
  render(): import("lit-html").TemplateResult<1>;
49
70
  private renderRelease;
50
71
  /**
@@ -72,7 +93,17 @@ export declare class FigureHistoryPanel extends FigureHistoryPanel_base {
72
93
  private offersFit;
73
94
  private fitBase;
74
95
  private renderVersion;
96
+ private renderKept;
75
97
  private release;
98
+ /**
99
+ * Edits not saved yet: saved first, let go, or kept -- asked with the three (designer 2026-09-27, Q-D1). Reverting and
100
+ * taking a revert back both reopen the figure from the server, so edits not saved would go without a word. `true` to
101
+ * go on.
102
+ */
103
+ private settleUnsaved;
76
104
  private revert;
105
+ private undo;
106
+ /** One revert or undo: a new request id, or the one whose answer was lost when the same is asked again. */
107
+ private send;
77
108
  }
78
109
  export {};