@things-factory/figure-ui 10.1.49 → 10.1.51

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 (97) hide show
  1. package/client/graphql/v3-store.ts +2 -1
  2. package/client/modeller/figure-history-panel.ts +9 -1
  3. package/client/modeller/figure-v3-first-save.ts +98 -0
  4. package/client/modeller/figure-v3-links.ts +177 -31
  5. package/client/modeller/figure-v3-parts.ts +1 -0
  6. package/client/modeller/figure-v3-properties.ts +2 -1
  7. package/client/modeller/v3-canvas.ts +61 -7
  8. package/client/modeller/v3-editor.ts +96 -21
  9. package/client/modeller/v3-first-save.ts +34 -0
  10. package/client/modeller/v3-gizmo.ts +52 -3
  11. package/client/modeller/v3-joint-drag.ts +116 -0
  12. package/client/modeller/v3-joint-fan.ts +24 -11
  13. package/client/modeller/v3-keys.ts +12 -1
  14. package/client/modeller/v3-links.ts +119 -8
  15. package/client/modeller/v3-live.ts +11 -0
  16. package/client/modeller/v3-product-session.ts +4 -2
  17. package/client/modeller/v3-refusals.ts +21 -0
  18. package/client/pages/figure-v3-modeller-page.ts +57 -8
  19. package/dist-client/graphql/v3-store.js +2 -1
  20. package/dist-client/graphql/v3-store.js.map +1 -1
  21. package/dist-client/modeller/figure-history-panel.js +9 -1
  22. package/dist-client/modeller/figure-history-panel.js.map +1 -1
  23. package/dist-client/modeller/figure-v3-capability.d.ts +1 -1
  24. package/dist-client/modeller/figure-v3-clips.d.ts +1 -1
  25. package/dist-client/modeller/figure-v3-controls.d.ts +1 -1
  26. package/dist-client/modeller/figure-v3-first-save.d.ts +20 -0
  27. package/dist-client/modeller/figure-v3-first-save.js +118 -0
  28. package/dist-client/modeller/figure-v3-first-save.js.map +1 -0
  29. package/dist-client/modeller/figure-v3-links.d.ts +14 -1
  30. package/dist-client/modeller/figure-v3-links.js +169 -28
  31. package/dist-client/modeller/figure-v3-links.js.map +1 -1
  32. package/dist-client/modeller/figure-v3-material.d.ts +1 -1
  33. package/dist-client/modeller/figure-v3-parts.js +1 -0
  34. package/dist-client/modeller/figure-v3-parts.js.map +1 -1
  35. package/dist-client/modeller/figure-v3-properties.d.ts +1 -1
  36. package/dist-client/modeller/figure-v3-properties.js +2 -1
  37. package/dist-client/modeller/figure-v3-properties.js.map +1 -1
  38. package/dist-client/modeller/v3-canvas.d.ts +11 -0
  39. package/dist-client/modeller/v3-canvas.js +61 -7
  40. package/dist-client/modeller/v3-canvas.js.map +1 -1
  41. package/dist-client/modeller/v3-clips.d.ts +1 -1
  42. package/dist-client/modeller/v3-editor.d.ts +13 -1
  43. package/dist-client/modeller/v3-editor.js +96 -21
  44. package/dist-client/modeller/v3-editor.js.map +1 -1
  45. package/dist-client/modeller/v3-first-save.d.ts +17 -0
  46. package/dist-client/modeller/v3-first-save.js +27 -0
  47. package/dist-client/modeller/v3-first-save.js.map +1 -0
  48. package/dist-client/modeller/v3-gizmo.d.ts +18 -0
  49. package/dist-client/modeller/v3-gizmo.js +45 -2
  50. package/dist-client/modeller/v3-gizmo.js.map +1 -1
  51. package/dist-client/modeller/v3-joint-drag.d.ts +19 -0
  52. package/dist-client/modeller/v3-joint-drag.js +97 -0
  53. package/dist-client/modeller/v3-joint-drag.js.map +1 -0
  54. package/dist-client/modeller/v3-joint-fan.js +24 -11
  55. package/dist-client/modeller/v3-joint-fan.js.map +1 -1
  56. package/dist-client/modeller/v3-keys.d.ts +9 -1
  57. package/dist-client/modeller/v3-keys.js +3 -0
  58. package/dist-client/modeller/v3-keys.js.map +1 -1
  59. package/dist-client/modeller/v3-links.d.ts +72 -3
  60. package/dist-client/modeller/v3-links.js +89 -6
  61. package/dist-client/modeller/v3-links.js.map +1 -1
  62. package/dist-client/modeller/v3-live.d.ts +6 -0
  63. package/dist-client/modeller/v3-live.js +10 -0
  64. package/dist-client/modeller/v3-live.js.map +1 -1
  65. package/dist-client/modeller/v3-product-session.d.ts +4 -1
  66. package/dist-client/modeller/v3-product-session.js +2 -2
  67. package/dist-client/modeller/v3-product-session.js.map +1 -1
  68. package/dist-client/modeller/v3-refusals.d.ts +4 -0
  69. package/dist-client/modeller/v3-refusals.js +21 -0
  70. package/dist-client/modeller/v3-refusals.js.map +1 -0
  71. package/dist-client/pages/figure-v3-modeller-page.d.ts +4 -0
  72. package/dist-client/pages/figure-v3-modeller-page.js +56 -8
  73. package/dist-client/pages/figure-v3-modeller-page.js.map +1 -1
  74. package/dist-client/tsconfig.tsbuildinfo +1 -1
  75. package/package.json +7 -5
  76. package/test/browser/build.mjs +62 -0
  77. package/test/browser/modeller-page.js +198 -0
  78. package/test/browser/modeller.check.mjs +358 -0
  79. package/test/browser/serve.mjs +43 -0
  80. package/test/joints.ts +33 -0
  81. package/test/v3-clips.test.ts +3 -2
  82. package/test/v3-controls.test.ts +3 -2
  83. package/test/v3-fields.test.ts +3 -2
  84. package/test/v3-first-save.test.ts +84 -0
  85. package/test/v3-gizmo.test.ts +38 -5
  86. package/test/v3-joint-drag.test.ts +93 -0
  87. package/test/v3-joint-fan.test.ts +16 -6
  88. package/test/v3-keys.test.ts +15 -2
  89. package/test/v3-links.test.ts +114 -14
  90. package/test/v3-live.test.ts +23 -4
  91. package/test/v3-maturity.test.ts +2 -6
  92. package/test/v3-refusals.test.ts +28 -0
  93. package/translations/en.json +40 -5
  94. package/translations/ja.json +39 -4
  95. package/translations/ko.json +39 -4
  96. package/translations/ms.json +39 -4
  97. package/translations/zh.json +39 -4
@@ -1,6 +1,6 @@
1
- import { compileV3Graph, defaultInstanceSizeRange, foldInstanceSizeRange, v3AttachmentsOf, v3BindingsOf, v3InstanceSizeLimitsOf } from '@hatiolab/figure-model'
1
+ import { V3_FACES, v3ShapeFaces, compileV3Graph, defaultInstanceSizeRange, foldInstanceSizeRange, v3AttachmentsOf, v3BindingsOf, v3InstanceSizeLimitsOf } from '@hatiolab/figure-model'
2
2
  import type { V3SizeRange } from '@hatiolab/figure-model'
3
- import type { V3Asset, V3BindingPlace, V3Face } from '@hatiolab/figure-model'
3
+ import type { V3Asset, V3BindingPlace, V3Face, V3Joint } from '@hatiolab/figure-model'
4
4
 
5
5
  /*
6
6
  * What a V3 part is tied to — the readers behind the parts' size response, fastening and motion sections (parity rows
@@ -115,10 +115,78 @@ export function dimensionNow(asset: V3Asset, part: string, axis: Axis): number |
115
115
  }
116
116
  }
117
117
 
118
- /** Whether `attach` can take this part: a box, or a cylinder (figure-model measures its faces since 0.1.47). */
119
- export function canFasten(asset: V3Asset, part: string): boolean {
118
+ /**
119
+ * The flat faces a part's shape declares, by name -- figure-model's shape definitions are the one place they are
120
+ * written (a portal's opening sides as well as its outer faces). A sphere has none.
121
+ */
122
+ export function facesOf(asset: V3Asset, part: string): string[] {
120
123
  const shape = modelOf(asset).nodes.find(n => n.id === `${part}.shape`)
121
- return canFollow(asset, part) || shape?.op === 'cylinder-shape@1'
124
+ return Object.keys((shape && v3ShapeFaces(shape.op)) ?? {})
125
+ }
126
+
127
+ /** The axis a face of a part faces along, from the same definitions. */
128
+ export function faceAxisOf(asset: V3Asset, part: string, face: string): Axis | undefined {
129
+ const shape = modelOf(asset).nodes.find(n => n.id === `${part}.shape`)
130
+ return (shape && v3ShapeFaces(shape.op)?.[face]?.axis) as Axis | undefined
131
+ }
132
+
133
+ /** Whether `attach` can take this part: any part whose shape has a flat face. */
134
+ export function canFasten(asset: V3Asset, part: string): boolean {
135
+ return facesOf(asset, part).length > 0
136
+ }
137
+
138
+ const OUTER: Record<Axis, [string, string]> = { x: ['left', 'right'], y: ['bottom', 'top'], z: ['back', 'front'] }
139
+
140
+ /**
141
+ * The axes a part can be made a row along (r3 §8, figure-model `make-repeat`): across the face it is fastened by, when
142
+ * it is fastened fixed to another part and holds nothing. None for a part that is loose, moves, stands on the floor or
143
+ * already repeats -- the command would refuse those, so they are not offered.
144
+ */
145
+ export function rowAxesOf(asset: V3Asset, part: string): Axis[] {
146
+ const joints = asset.joints ?? []
147
+ const j = joints.find(o => o.body1.part === part)
148
+ if (!j || j.type !== 'fixed' || j.repeat || !('part' in j.body0)) return []
149
+ if (joints.some(o => 'part' in o.body0 && o.body0.part === part)) return []
150
+ return AXES.filter(axis => axis !== V3_FACES[j.body1.face])
151
+ }
152
+
153
+ /** The row a part is made into, as its fastening's record keeps it. */
154
+ export const rowOf = (asset: V3Asset, part: string) => asset.joints?.find(o => o.body1.part === part)?.repeat
155
+
156
+ /** Where a part sits across the face it is fastened to, on one axis: centred, level with an edge, or a distance off centre. */
157
+ export type Alignment = 'centre' | 'min' | 'max' | 'mm'
158
+
159
+ /**
160
+ * The axes across the face a part is fastened to — the two a fastening does not set by itself. Edges to line up with
161
+ * are offered where both parts have their two outer faces on that axis; the plane the figure is mounted on has none,
162
+ * so on it (X and Z) only centred or a distance is offered.
163
+ */
164
+ export function alignAxesOf(asset: V3Asset, part: string, target: { part: string; face: string } | 'plane', twisted = false): { axis: Axis; edges: boolean }[] {
165
+ if (target === 'plane') return (['x', 'z'] as Axis[]).map(axis => ({ axis, edges: false }))
166
+ const along = faceAxisOf(asset, target.part, target.face)
167
+ if (!along) return []
168
+ const theirs = new Set(facesOf(asset, target.part)),
169
+ mine = new Set(facesOf(asset, part))
170
+ /* A part twisted about the face's normal has no side level with the target's edges. */
171
+ return AXES.filter(axis => axis !== along).map(axis => ({ axis, edges: !twisted && OUTER[axis].every(f => theirs.has(f) && mine.has(f)) }))
172
+ }
173
+
174
+ /** The `align` of an attach command from the form's choices: only the axes across that face, and centred ones left out. */
175
+ export function alignOf(
176
+ asset: V3Asset,
177
+ part: string,
178
+ target: { part: string; face: string } | 'plane',
179
+ how: Partial<Record<Axis, Alignment>>,
180
+ mm: Partial<Record<Axis, number>>,
181
+ twisted = false
182
+ ) {
183
+ const align: Partial<Record<Axis, 'min' | 'max' | { mm: number }>> = {}
184
+ for (const { axis, edges } of alignAxesOf(asset, part, target, twisted)) {
185
+ const one = how[axis] ?? 'centre'
186
+ if (one === 'mm' && mm[axis]) align[axis] = { mm: mm[axis]! }
187
+ else if ((one === 'min' || one === 'max') && edges) align[axis] = one
188
+ }
189
+ return Object.keys(align).length ? align : undefined
122
190
  }
123
191
 
124
192
  /**
@@ -147,16 +215,20 @@ export function positionIsShare(asset: V3Asset, part: string, axis: Axis): boole
147
215
 
148
216
  /** How a part moves, if it does: slide or turn, along which axis, driven by which control. */
149
217
  export interface Motion {
150
- kind: 'slide' | 'turn'
218
+ kind: 'slide' | 'turn' | 'continuous'
151
219
  axis: Axis | '?'
152
220
  control?: { id: string; unit?: string; min?: number; max?: number }
221
+ /** A joint that moves with another (URDF's mimic): the leader's value times `multiplier`, plus `offset`. */
222
+ follows?: { joint: string; multiplier: number; offset?: number }
153
223
  }
154
224
 
155
225
  export function motionOf(asset: V3Asset, part: string): Motion | undefined {
156
226
  const m = modelOf(asset)
157
227
  const node = m.nodes.find(n => n.id === `${part}.motion`)
158
228
  if (!node) return undefined
159
- const kind = node.op === 'axis-turn@1' ? 'turn' : 'slide'
229
+ const record = asset.joints?.find(j => j.body1.part === part)
230
+ const endless = record?.type === 'revolute' && record.lowerLimit === undefined && record.upperLimit === undefined
231
+ const kind = endless ? 'continuous' : node.op === 'axis-turn@1' ? 'turn' : 'slide'
160
232
  const unit = node.args.slice(0, 3).map(ref => m.constants.find(c => c.id === ref)?.value)
161
233
  const axis = AXES[unit.findIndex(v => v !== undefined && v !== 0)] ?? '?'
162
234
  /* The quantity is the fourth argument, a state input directly or through the nodes that scale it. */
@@ -174,7 +246,46 @@ export function motionOf(asset: V3Asset, part: string): Motion | undefined {
174
246
  }
175
247
  return undefined
176
248
  }
177
- return { kind, axis, control: control(quantity) }
249
+ return { kind, axis, control: control(quantity), ...(record?.mimic ? { follows: record.mimic } : {}) }
250
+ }
251
+
252
+ /** What the motion form holds: how the part moves, and either its own control or the joint it moves with. */
253
+ export interface MotionForm {
254
+ kind: 'slide' | 'turn' | 'continuous'
255
+ axis: Axis
256
+ id: string
257
+ min: number
258
+ max: number
259
+ /** The joint this one moves with; empty for a joint with its own control. */
260
+ follow: string
261
+ multiplier: number
262
+ offset: number
263
+ }
264
+
265
+ /**
266
+ * The joints a part's joint can move with (URDF's mimic): a joint that moves the same way — a slide follows a slide, a
267
+ * turn a turn — and has a control of its own, since a follower follows the joint that is driven.
268
+ */
269
+ export function leadersFor(asset: V3Asset, part: string, kind: MotionForm['kind']): V3Joint[] {
270
+ return (asset.joints ?? []).filter(j => j.body1.part !== part && j.type !== 'fixed' && !j.mimic && (j.type === 'prismatic') === (kind === 'slide'))
271
+ }
272
+
273
+ /**
274
+ * The joint record the motion form writes for a part fastened by `joint`. A joint of its own gets its limits (none for
275
+ * a turn without end, as in USD) and a control; a follower gets the leader, the multiplier and the offset, and no
276
+ * control or limits of its own — its range is the leader's times the multiplier.
277
+ */
278
+ export function motionJoint(joint: V3Joint, m: MotionForm, part: string): V3Joint {
279
+ const moving = {
280
+ id: joint.id,
281
+ body0: joint.body0,
282
+ body1: joint.body1,
283
+ ...(joint.origin ? { origin: joint.origin } : {}),
284
+ type: m.kind === 'slide' ? ('prismatic' as const) : ('revolute' as const),
285
+ axis: m.axis.toUpperCase() as 'X' | 'Y' | 'Z'
286
+ }
287
+ if (m.follow) return { ...moving, mimic: { joint: m.follow, multiplier: m.multiplier, ...(m.offset ? { offset: m.offset } : {}) } }
288
+ return { ...moving, ...(m.kind === 'continuous' ? {} : { lowerLimit: m.min, upperLimit: m.max }), state: { id: m.id || `${part}-${m.kind}` } }
178
289
  }
179
290
 
180
291
  /** The select's value for what a dimension follows now. */
@@ -77,3 +77,14 @@ export function scrubbed(start: number, pixels: number, step: number): number {
77
77
  const digits = Math.max(0, -Math.floor(Math.log10(step)))
78
78
  return Number(value.toFixed(digits))
79
79
  }
80
+
81
+ /**
82
+ * The bodies to draw while a value is in hand, over every input as the session holds it now (`current`): the pose the
83
+ * author has already set with the other controls, and the design values. Drawing over the asset's saved defaults put
84
+ * every other joint back to its saved angle while one slider moved (user, 2026-09-24: the arm jumped on release).
85
+ */
86
+ export function liveOverSession(asset: V3Asset, current: Record<string, number>, live: LiveValues): V3RenderPart[] | null {
87
+ if (!isLive(live)) return null
88
+ return livePartsOf(asset, { ...live, values: { ...current, ...live.values } })
89
+ }
90
+
@@ -24,6 +24,8 @@ export interface V3ProductStore {
24
24
  creationId?: string
25
25
  /** The card's picture. Absent when the browser could not draw one; the source is saved either way. */
26
26
  thumbnail?: string
27
+ /** The type name a new figure is created under (the first save asks for it). Not sent for an existing one. */
28
+ type?: string
27
29
  }): Promise<V3ProductRecord>
28
30
  }
29
31
 
@@ -136,13 +138,13 @@ export function createV3ProductSession(store: V3ProductStore) {
136
138
  * nothing about drawing. A save with no picture is a save: a tab in the background cannot draw, and the
137
139
  * source matters more than the card (see `v3-thumbnail.ts`).
138
140
  */
139
- async save({ thumbnail }: { thumbnail?: string } = {}) {
141
+ async save({ thumbnail, type }: { thumbnail?: string; type?: string } = {}) {
140
142
  const control = writable(),
141
143
  requestEpoch = epoch
142
144
  const exported = workspace.export(control)
143
145
  saving = true
144
146
  try {
145
- const record = await store.save({ id, source: exported.text, expectedSource: baseline, creationId, thumbnail })
147
+ const record = await store.save({ id, source: exported.text, expectedSource: baseline, creationId, thumbnail, ...(id || !type ? {} : { type }) })
146
148
  if (requestEpoch !== epoch) return read()
147
149
  if (!record.id || (id !== undefined && record.id !== id)) throw Error('저장 응답의 Figure 대상이 다릅니다.')
148
150
  if (serializeV3Asset(parseV3Asset(record.source)) !== exported.text)
@@ -0,0 +1,21 @@
1
+ /*
2
+ * A command refused because the figure could not be drawn at an end of its declared size range, in the author's words
3
+ * with the numbers and where to put it right -- not the kernel's English (user, 2026-09-24: 「what is this warning
4
+ * message means?」). Kept apart from the element so it is tested without a browser.
5
+ */
6
+
7
+ type Say = (key: string, params: Record<string, string>) => string
8
+
9
+ /** The refusal in words, or nothing for any other refusal. */
10
+ export function sizeRangeRefusalOf(error: unknown, say: Say): string | null {
11
+ if ((error as { code?: string })?.code !== 'INSTANCE_SIZE_RANGE') return null
12
+ const message = error instanceof Error ? error.message : String(error)
13
+ const found = /size\.([xyz]):\s*(below|above) ([\d.]+) mm [^(;]*(?:\(([^)]+)\))?;/.exec(message)
14
+ if (!found) return null
15
+ const [, axis, side, mm, part] = found
16
+ return say(side === 'below' ? 'figure.text.size-range-too-small' : 'figure.text.size-range-too-large', {
17
+ axis: axis!.toUpperCase(),
18
+ mm: Number(mm).toLocaleString(undefined, { maximumFractionDigits: 1 }),
19
+ part: part ?? ''
20
+ })
21
+ }
@@ -1,10 +1,11 @@
1
1
  import { html, css } from 'lit'
2
2
  import { customElement, state } from 'lit/decorators.js'
3
- import { PageView } from '@operato/shell'
3
+ import { navigate, PageView } from '@operato/shell'
4
+ import { modellerPathOf } from '../modeller/modeller-route.js'
4
5
  import { createV3ProductSession } from '../modeller/v3-product-session.js'
5
6
  import { v3ProductStore } from '../graphql/v3-store.js'
6
7
  import { i18next } from '@operato/i18n'
7
- import { fetchFigure, updateFigure } from '../graphql/index.js'
8
+ import { fetchFigure, fetchFigureTypeNames, updateFigure } from '../graphql/index.js'
8
9
  import { occupancyFromParts } from '../modeller/v3-occupancy.js'
9
10
  import type { V3AuthoringAction } from '@hatiolab/figure-model'
10
11
  import '../modeller/v3-editor.js'
@@ -13,6 +14,10 @@ import '../modeller/figure-history-panel.js'
13
14
  import '../modeller/figure-v3-verdict.js'
14
15
  import '../modeller/figure-v3-properties.js'
15
16
  import type { V3BudgetLine } from '../modeller/v3-maturity.js'
17
+ import { OxPrompt } from '@operato/popup'
18
+ import { openPopup } from '@operato/layout'
19
+ import '../modeller/figure-v3-first-save.js'
20
+ import type { FirstSave } from '../modeller/v3-first-save.js'
16
21
 
17
22
  /**
18
23
  * The V3 product page has exactly one authoritative workspace for UI and AI input transactions.
@@ -140,6 +145,15 @@ export class FigureV3ModellerPage extends PageView {
140
145
  this.updateContext()
141
146
  }
142
147
  if (!view.saving) this.announce()
148
+ /*
149
+ A new figure's first save gives it an id: the address becomes the figure's own, in place of the history entry.
150
+ Left at the bare modeller address, opening the modeller again from the menu was taken for the same page and kept
151
+ the saved figure -- its type showing where a new figure's was expected (2026-09-25).
152
+ */
153
+ if (view.id && !this.routeId && !view.saving) {
154
+ this.routeId = view.id
155
+ navigate(modellerPathOf({ id: view.id }), true)
156
+ }
143
157
  /* 저장이 끝난 순간 행을 다시 읽는다 — 발행된 도형을 고쳐 저장하면 서버가 초안으로 내린다. */
144
158
  if (this.wasDirty && !view.dirty && !view.saving && view.id) this.readRow(view.id)
145
159
  this.wasDirty = !!view.dirty
@@ -171,7 +185,16 @@ export class FigureV3ModellerPage extends PageView {
171
185
  const id = this.session.read().id
172
186
  const wanted = input.value.trim().replace(/[^A-Za-z0-9_]/g, '_').toUpperCase()
173
187
  input.value = wanted
174
- if (!id || !wanted || wanted === this.row.type) return
188
+ /*
189
+ A figure not saved yet has no row to rename: the type is held here and the first save's question opens with it.
190
+ The field was disabled until the first save, so a type typed there went nowhere and was asked for again
191
+ (2026-09-25).
192
+ */
193
+ if (!id) {
194
+ this.row = { ...this.row, type: wanted || undefined }
195
+ return
196
+ }
197
+ if (!wanted || wanted === this.row.type) return
175
198
  try {
176
199
  const result = await updateFigure(id, { type: wanted })
177
200
  this.typeError = ''
@@ -268,8 +291,17 @@ export class FigureV3ModellerPage extends PageView {
268
291
  const view = this.session.read()
269
292
  if (view.saving) return false
270
293
  if (!view.dirty) return true
271
- // The shell invokes this while the edited model is still visible, before navigating away.
272
- this.discardApproved = window.confirm('저장하지 않은 변경을 버리고 이동하시겠습니까?')
294
+ /*
295
+ The shell asks this while the edited model is still on screen. The app's own prompt, as V2 and every operato
296
+ screen ask -- not the browser's confirm box (user, 2026-09-24).
297
+ */
298
+ this.discardApproved = !!(await OxPrompt.open({
299
+ type: 'warning',
300
+ title: i18next.t('figure.text.unsaved-changes'),
301
+ text: i18next.t('figure.text.leave-without-saving'),
302
+ confirmButton: { text: i18next.t('figure.button.leave-without-saving') },
303
+ cancelButton: { text: i18next.t('figure.button.keep-editing') }
304
+ }))
273
305
  return this.discardApproved
274
306
  }
275
307
  async pageUpdated(changes: Record<string, unknown>, lifecycle: { resourceId?: string }) {
@@ -302,13 +334,31 @@ export class FigureV3ModellerPage extends PageView {
302
334
  this.error = error instanceof Error ? error.message : String(error)
303
335
  }
304
336
  }
337
+ /** The first save's question, over the names this domain already uses (V2 asked the same). */
338
+ private askFirstSave = async (name: string): Promise<FirstSave | undefined> => {
339
+ const taken = await fetchFigureTypeNames().catch(() => [] as string[])
340
+ return openPopup<FirstSave>(html`<figure-v3-first-save .type=${this.row.type ?? ''} .name=${name} .taken=${taken}></figure-v3-first-save>`, {
341
+ backdrop: true,
342
+ size: 'small',
343
+ title: i18next.t('figure.title.save-new-figure')
344
+ }).result
345
+ }
305
346
  get context() {
306
- return { title: this.session.read().name ?? 'Figure', actions: [] }
347
+ return {
348
+ title: this.session.read().name ?? 'Figure',
349
+ actions: [],
350
+ /*
351
+ No heading line: the canvas is what this page is for, and the name is already in the properties' first section
352
+ (and the browser tab). The title stays, not emptied, because the MDI tab reads it too -- the heading is switched
353
+ off where it is drawn (`ox-page-title-bar`). V2's page did this; it was lost when that page was removed.
354
+ */
355
+ heading: false
356
+ }
307
357
  }
308
358
  render() {
309
359
  if (this.error) return html`<p role="alert" class="error">${this.error}</p>`
310
360
  const view = this.session.read()
311
- return html`<figure-v3-editor .session=${this.session} .revision=${this.revision} .instances=${this.instances} .budget=${this.budget} @v3-changed=${this.changed}>
361
+ return html`<figure-v3-editor .session=${this.session} .firstSave=${this.askFirstSave} .revision=${this.revision} .instances=${this.instances} .budget=${this.budget} @v3-changed=${this.changed}>
312
362
  ${this.commandError ? html`<p slot="notice" fit-error role="alert">${this.commandError}</p>` : ''}
313
363
  <figure-v3-properties
314
364
  slot="figure"
@@ -326,7 +376,6 @@ export class FigureV3ModellerPage extends PageView {
326
376
  : html`<input
327
377
  .value=${this.row.type ?? ''}
328
378
  placeholder=${i18next.t('figure.text.figure-type-placeholder')}
329
- ?disabled=${!view.id}
330
379
  @change=${this.renameType}
331
380
  />`}
332
381
  ${this.typeError ? html`<small role="alert">${this.typeError}</small>` : ''}
@@ -12,13 +12,14 @@ export const v3ProductStore = {
12
12
  async save(request) {
13
13
  const response = await client.mutate({
14
14
  mutation: gql `
15
- mutation SaveFigureV3($source: String!, $id: String, $expectedSource: String, $creationId: String, $thumbnail: String) {
15
+ mutation SaveFigureV3($source: String!, $id: String, $expectedSource: String, $creationId: String, $thumbnail: String, $type: String) {
16
16
  saveFigureV3(
17
17
  source: $source
18
18
  id: $id
19
19
  expectedSource: $expectedSource
20
20
  creationId: $creationId
21
21
  thumbnail: $thumbnail
22
+ type: $type
22
23
  ) {
23
24
  id
24
25
  source
@@ -1 +1 @@
1
- {"version":3,"file":"v3-store.js","sourceRoot":"","sources":["../../client/graphql/v3-store.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,gGAAgG;AAChG,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,KAAK,CAAC,IAAI,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,MAAM,EAAE,MAAM;YAAE,MAAM,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACpD,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACjD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;OAaZ;YACD,SAAS,EAAE,OAAO;SACnB,CAAC,CAAA;QACF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACxF,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,YAA2C,CAAA;QACzE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,MAAM,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACxE,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA","sourcesContent":["import gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { fetchFigure } from './index.js'\nimport type { V3ProductStore, V3ProductRecord } from '../modeller/v3-product-session.js'\n\n/** V3 source is sent intact. No conversion into the old parts/base authoring representation. */\nexport const v3ProductStore: V3ProductStore = {\n async load(id) {\n const record = await fetchFigure(id)\n if (!record?.source) throw Error('Figure 정본이 없습니다.')\n return { id: record.id, source: record.source }\n },\n async save(request) {\n const response = await client.mutate({\n mutation: gql`\n mutation SaveFigureV3($source: String!, $id: String, $expectedSource: String, $creationId: String, $thumbnail: String) {\n saveFigureV3(\n source: $source\n id: $id\n expectedSource: $expectedSource\n creationId: $creationId\n thumbnail: $thumbnail\n ) {\n id\n source\n }\n }\n `,\n variables: request\n })\n if (response.errors?.length) throw Error(response.errors.map(e => e.message).join('\\n'))\n const result = response.data?.saveFigureV3 as V3ProductRecord | undefined\n if (!result?.id || !result.source) throw Error('서버가 저장 결과를 돌려주지 않았습니다.')\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"v3-store.js","sourceRoot":"","sources":["../../client/graphql/v3-store.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,gGAAgG;AAChG,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,KAAK,CAAC,IAAI,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,MAAM,EAAE,MAAM;YAAE,MAAM,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACpD,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAA;IACjD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;OAcZ;YACD,SAAS,EAAE,OAAO;SACnB,CAAC,CAAA;QACF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACxF,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,YAA2C,CAAA;QACzE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,MAAM,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACxE,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA","sourcesContent":["import gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { fetchFigure } from './index.js'\nimport type { V3ProductStore, V3ProductRecord } from '../modeller/v3-product-session.js'\n\n/** V3 source is sent intact. No conversion into the old parts/base authoring representation. */\nexport const v3ProductStore: V3ProductStore = {\n async load(id) {\n const record = await fetchFigure(id)\n if (!record?.source) throw Error('Figure 정본이 없습니다.')\n return { id: record.id, source: record.source }\n },\n async save(request) {\n const response = await client.mutate({\n mutation: gql`\n mutation SaveFigureV3($source: String!, $id: String, $expectedSource: String, $creationId: String, $thumbnail: String, $type: String) {\n saveFigureV3(\n source: $source\n id: $id\n expectedSource: $expectedSource\n creationId: $creationId\n thumbnail: $thumbnail\n type: $type\n ) {\n id\n source\n }\n }\n `,\n variables: request\n })\n if (response.errors?.length) throw Error(response.errors.map(e => e.message).join('\\n'))\n const result = response.data?.saveFigureV3 as V3ProductRecord | undefined\n if (!result?.id || !result.source) throw Error('서버가 저장 결과를 돌려주지 않았습니다.')\n return result\n }\n}\n"]}
@@ -6,6 +6,7 @@ import { customElement, property, state } from 'lit/decorators.js';
6
6
  import { i18next, localize } from '@operato/i18n';
7
7
  import { ScrollbarStyles } from '@operato/styles';
8
8
  import { fetchFigureVersions, inspectFigure, releaseFigure, revertFigureVersion } from '../graphql/index.js';
9
+ import { OxPrompt } from '@operato/popup';
9
10
  /**
10
11
  * 이력 — **발행하는 자리이자, 발행된 판들을 보는 자리.**
11
12
  *
@@ -521,7 +522,14 @@ let FigureHistoryPanel = class FigureHistoryPanel extends localize(i18next)(LitE
521
522
  }
522
523
  async revert(version) {
523
524
  /* 되돌아갈 수 없는 조작은 아니지만(판본은 남는다), 지금 화면의 것이 덮인다 — 이름으로 확인한다. */
524
- if (!confirm(i18next.t('figure.text.revert-to-version-confirm', { version }))) {
525
+ const agreed = await OxPrompt.open({
526
+ type: 'warning',
527
+ title: i18next.t('figure.button.revert'),
528
+ text: i18next.t('figure.text.revert-to-version-confirm', { version }),
529
+ confirmButton: { text: i18next.t('figure.button.revert') },
530
+ cancelButton: { text: i18next.t('figure.button.keep-editing') }
531
+ });
532
+ if (!agreed) {
525
533
  return;
526
534
  }
527
535
  this.busy = true;
@@ -1 +1 @@
1
- {"version":3,"file":"figure-history-panel.js","sourceRoot":"","sources":["../../client/modeller/figure-history-panel.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAC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AAC,CAAC,CAAA;YACzG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;YACnB;;;;cAIE;YACF,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;QACtB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,OAAO,GAAI,CAAW,CAAC,OAAO,CAAA;QACrC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;QACnB,CAAC;IACH,CAAC;;AAxU2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDAAkB;AAEhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;iDAAc;AAMd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAA2B;AAM1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoB;AAEf;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAAmD;AAEjE;IAAhB,KAAK,EAAE;;oDAAuC;AAC9B;IAAhB,KAAK,EAAE;;gDAAqB;AACZ;IAAhB,KAAK,EAAE;;mDAAqB;AACZ;IAAhB,KAAK,EAAE;;iEAAsC;AAK7B;IAAhB,KAAK,EAAE;;sDAAsC;AA1PnC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAuiB9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { gateFindingStyles, renderGateFinding } from './gate-findings.js'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { fetchFigureVersions, inspectFigure, releaseFigure, revertFigureVersion } from '../graphql/index.js'\nimport type { FigureGateFinding, FigureGateFix, FigureGateFixPlan, FigureInspection, FigureVersion } from '../types.js'\n\n/**\n * 이력 — **발행하는 자리이자, 발행된 판들을 보는 자리.**\n *\n * ## 왜 저장 옆이 아니라 여기인가\n *\n * 저장은 하루에 수십 번이고 발행은 드물다. 두 단추를 나란히 두면 저장하려다 발행을 누른다.\n * 그리고 발행은 **소비처에게 하는 약속**이라, 무엇을 약속하는지(지금 몇 판인가 · 저장 안 한 것이\n * 있나 · 지난 판이 무엇이었나)를 함께 보여 주는 자리에 있어야 한다.\n *\n * ## 저장하지 않은 것이 있으면 발행하지 않는다\n *\n * 발행은 **저장된 것**을 내보낸다. 화면에 고친 것이 남아 있는 채로 발행하면, 저작자가 보고 있는\n * 것과 약속한 것이 다르다. 그래서 막고, 왜 막혔는지 적는다.\n *\n * ## 되돌리기는 초안으로 돌아온다\n *\n * 옛 판의 정본·속성·그림이 돌아오고 이름·설명은 그대로다. 되살렸다고 그 판이 다시 발행되지는\n * 않는다 — 다시 내보내려면 발행을 한 번 더 하고, 그때 번호는 이미 쓴 다음 번호를 받는다.\n */\n@customElement('figure-history-panel')\nexport class FigureHistoryPanel extends localize(i18next)(LitElement) {\n static styles = [\n gateFindingStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow-y: auto;\n background-color: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n font: var(--label-font, inherit);\n font-size: 0.76rem;\n }\n\n :host([off]) {\n display: none;\n }\n\n section {\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n\n h3 {\n margin: 0 0 6px 0;\n font-size: var(--ui-t-micro, 11px);\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n /* 지금 무엇인가 — 발행을 누르기 전에 읽는 한 줄 */\n div[now] {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 8px;\n }\n\n span[state] {\n padding: 2px 8px;\n border-radius: 10px;\n font-size: 0.7rem;\n font-weight: 700;\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n span[state][released] {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n span[ver] {\n font-family: var(--mono-font, monospace);\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n input,\n button {\n font: var(--input-field-font, inherit);\n font-size: 0.76rem;\n }\n\n input[note] {\n width: 100%;\n box-sizing: border-box;\n padding: 5px 8px;\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-container-lowest);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n }\n\n button[release] {\n width: 100%;\n margin-top: 6px;\n padding: 6px 0;\n font-weight: 700;\n color: var(--ui-on-accent, #fff);\n background-color: var(--md-sys-color-primary);\n border: 0;\n border-radius: 6px;\n cursor: pointer;\n }\n\n button[release][disabled] {\n opacity: 0.45;\n cursor: default;\n }\n\n /* 왜 못 누르는지 — 눌러 보고 알게 하지 않는다 */\n p[why] {\n margin: 6px 0 0 0;\n font-size: 0.7rem;\n line-height: 1.5;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n p[failed] {\n margin: 6px 0 0 0;\n font-size: 0.7rem;\n line-height: 1.5;\n color: var(--md-sys-color-error);\n }\n\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n display: grid;\n grid-template-columns: auto 1fr auto;\n gap: 4px 8px;\n align-items: baseline;\n padding: 7px 0;\n border-bottom: 1px dashed var(--md-sys-color-outline-variant);\n }\n\n li:last-child {\n border-bottom: 0;\n }\n\n li span[no] {\n font-family: var(--mono-font, monospace);\n font-weight: 700;\n }\n\n li span[when] {\n grid-column: 2 / 4;\n font-size: 0.7rem;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n li span[comment] {\n grid-column: 1 / 4;\n line-height: 1.5;\n }\n\n li button[revert] {\n padding: 2px 8px;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n\n li button[revert]:hover {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n\n /*\n 게이트 사유. 막는 것은 색으로도 말하고, 알리는 것은 조용히 둔다 — 둘을 같은 톤으로 두면\n 「이 중 어느 것이 발행을 막았나」를 사람이 다시 세어야 한다.\n */\n\n /* 설명으로 끝내지 않는다. 이 단추는 원본을 바꾸지 않고 모델러에 후보만 연다. */\n li[finding] button[preview-fix] {\n margin-top: 3px;\n padding: 4px 7px;\n font-weight: 700;\n color: var(--md-sys-color-on-primary-container, var(--md-sys-color-on-surface));\n background-color: var(--md-sys-color-primary-container, transparent);\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n }\n\n li[finding] button[preview-fix]:hover {\n filter: brightness(1.08);\n }\n\n li[finding] button[apply-fix] {\n margin-top: 3px;\n padding: 4px 7px;\n font-weight: 700;\n color: var(--ui-on-accent, #fff);\n background-color: var(--md-sys-color-primary);\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n }\n\n div[ratio-choice] {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-top: 4px;\n }\n\n div[ratio-choice] button:not([apply-fix]) {\n padding: 4px 7px;\n color: var(--md-sys-color-on-surface);\n background: transparent;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 5px;\n cursor: pointer;\n }\n\n div[ratio-choice] button[selected] {\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n\n p[quiet] {\n margin: 0;\n line-height: 1.6;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n `\n ]\n\n /** 지금 열려 있는 도형. 없으면(새로 만드는 중) 발행할 것이 없다. */\n @property({ type: String }) figureId?: string\n @property({ type: String }) figureState?: 'draft' | 'released'\n @property({ type: Number }) figureVersion = 0\n /** 저장하지 않은 것이 있나 — 있으면 발행을 막는다. */\n @property({ type: Boolean }) dirty = false\n /**\n * 열린 도형의 형식. 발행 · 판본 · 복원은 figure id 로만 서버를 묻고 서버의 한 문이 두 형식을 다 읽으므로 두 화면이\n * 이 패널을 함께 쓴다. 갈리는 것은 조치 단추 하나다 — 부품을 옮기는 두 조치는 형식마다 다른 편집이라, 받는\n * 화면이 없는 단추를 그리면 눌러도 아무 일이 없다.\n */\n @property({ type: String }) format: 'v2' | 'v3' = 'v2'\n /**\n * 행의 타입. 판정 하나(`type-is-placeholder`)가 이것을 본다 — V3 자산은 타입을 원본에 적지 않아서, 타입을 바꾸면\n * 원본도 dirty 도 그대로다. 그래서 이 값이 바뀌면 판정을 다시 묻는다. 안 그러면 타입을 정한 뒤에도 「임시 타입」\n * 판정이 남아 발행 단추가 잠긴 채다.\n */\n @property({ type: String }) figureType?: string\n /** 직전 발행판의 기준 상자. 외형 변화 안내에서 X·Z 복원 선택지에만 쓴다. */\n @property({ attribute: false }) releasedBase?: { x: number; y: number; z: number }\n\n @state() private versions: FigureVersion[] = []\n @state() private busy = false\n @state() private failure = ''\n @state() private keepChangedAppearance = false\n /**\n * 발행 판정. **저장된 정본에 대한 것**이라 저장할 때마다 다시 묻는다(`figureVersion` 이 아니라\n * `dirty` 가 풀리는 순간이 그때다).\n */\n @state() private inspection?: FigureInspection\n\n updated(changes: Map<string, unknown>) {\n if (changes.has('figureId') || changes.has('figureVersion')) {\n void this.reload()\n }\n\n /*\n 저장이 끝난 순간(dirty 가 풀림) 정본이 바뀌었으니 판정을 다시 묻는다. 저작 중(dirty)에는\n 묻지 않는다 — 서버에 있는 것은 저장 전 정본이라, 그 답은 화면에 있는 것과 다른 것을 말한다.\n */\n if (changes.has('figureId') || changes.has('dirty') || changes.has('figureType')) {\n void this.inspect()\n }\n }\n\n private async inspect() {\n this.keepChangedAppearance = false\n if (!this.figureId || this.dirty) {\n this.inspection = undefined\n return\n }\n\n try {\n this.inspection = await inspectFigure(this.figureId)\n } catch (e) {\n /* 판정을 못 받은 것을 「통과」로 두지 않는다 — 모르는 것이다. 단추는 서버가 막는다. */\n this.inspection = undefined\n this.failure = (e as Error).message\n }\n }\n\n private async reload() {\n if (!this.figureId) {\n this.versions = []\n return\n }\n\n try {\n this.versions = await fetchFigureVersions(this.figureId)\n this.failure = ''\n } catch (e) {\n this.failure = (e as Error).message\n }\n }\n\n render() {\n return html`\n <section>\n <h3>${i18next.t('figure.label.release')}</h3>\n ${this.figureId ? this.renderRelease() : html`<p quiet>${i18next.t('figure.text.save-the-figure-before-releasing')}</p>`}\n </section>\n\n <section>\n <h3>${i18next.t('figure.label.released-versions')}</h3>\n ${this.versions.length\n ? html`<ul>\n ${this.versions.map(version => this.renderVersion(version))}\n </ul>`\n : html`<p quiet>${i18next.t('figure.text.nothing-released-yet')}</p>`}\n </section>\n `\n }\n\n private renderRelease() {\n const released = this.figureState === 'released'\n\n /*\n 게이트가 막는 것과 알리는 것을 함께 낸다. **막는 것은 단추를 잠근다** — 눌러 보고 서버에게\n 거절당하는 것으로 알게 하지 않는다. 알리는 것은 잠그지 않고 그대로 보여 준다.\n */\n const blocking = (this.inspection?.findings ?? []).filter(finding => finding.blocking)\n const advisory = (this.inspection?.findings ?? []).filter(finding => !finding.blocking)\n const appearanceChoiceNeeded = advisory.some(finding => finding.code === 'base-ratio-changed') && !this.keepChangedAppearance\n\n /*\n ── 「발행되나」에 **한 번만** 답한다 ─────────────────────────────────────\n 전에는 막는 목록의 머리가 「이것들이 발행을 막습니다」, 알리는 목록의 머리가 「발행은 되지만\n 확인해 보십시오」였다. 두 줄이 나란히 서서 화면이 「막힌다」와 「된다」를 함께 말했고, 사람이\n 「그래서 되는 건가」를 되물었다.\n\n 답은 이 한 줄이 하고, 아래 목록들은 **이유**일 뿐이다 — 그래서 목록 머리는 문장이 아니라\n 이름씨다(「고쳐야 하는 것」·「막지는 않는 것」).\n */\n const why = this.dirty\n ? i18next.t('figure.text.release-needs-a-save-first')\n : released\n ? i18next.t('figure.text.already-released-edit-to-release-again')\n : appearanceChoiceNeeded\n ? i18next.t('figure.text.choose-appearance-change')\n : blocking.length\n ? i18next.t('figure.text.cannot-release-now')\n : ''\n\n return html`\n <div now>\n <span state ?released=${released}>${i18next.t(released ? 'figure.label.figure-released' : 'figure.label.draft')}</span>\n <span ver>${i18next.t('figure.text.version-number', { version: this.figureVersion ?? 0 })}</span>\n </div>\n\n <input note placeholder=${i18next.t('figure.text.what-changed-in-this-release')} ?disabled=${!!why || this.busy} />\n\n <button release ?disabled=${!!why || this.busy} @click=${() => this.release()}>\n ${this.busy ? i18next.t('figure.text.releasing') : i18next.t('figure.button.release-figure')}\n </button>\n\n ${why ? html`<p why>${why}</p>` : nothing}\n ${blocking.length\n ? html`<ul gate>\n <li head>${i18next.t('figure.text.must-fix-to-release')}</li>\n ${blocking.map(finding => this.renderFinding(finding, true))}\n </ul>`\n : nothing}\n ${advisory.length\n ? html`<ul gate>\n <li head quiet>${i18next.t('figure.text.does-not-block')}</li>\n ${advisory.map(finding => this.renderFinding(finding, false))}\n </ul>`\n : nothing}\n ${this.failure ? html`<p failed>${this.failure}</p>` : nothing}\n `\n }\n\n /**\n * 사유 한 줄 — **잰 것 · 왜 · 어떻게** 셋을 함께 말한다.\n *\n * 잰 것만 보여 줬더니 「1 조각이 2 조각으로 갈라진다」에서 사람이 멈췄다. 왜 나쁜지도, 무엇을\n * 바꾸면 되는지도 알 수 없었다. 그 셋은 형식(`figure-model` 의 gate)이 만들고 여기서는 자리만\n * 준다 — 화면이 문장을 지으면 서버가 거절할 때와 다른 말을 하게 된다.\n */\n private renderFinding(finding: FigureGateFinding, blocking: boolean) {\n return renderGateFinding(finding, blocking, html`\n ${this.offersFit(finding.code)\n ? html`<button fit-base @click=${() => this.fitBase()}>\n ${i18next.t('figure.button.fit-base-to-parts')}\n </button>`\n : nothing}\n ${finding.code === 'parts-off-placement-face' && this.format === 'v2'\n ? html`<button fit-base @click=${() => this.settleOnFloor()}>\n ${i18next.t('figure.button.settle-on-floor')}\n </button>`\n : nothing}\n ${finding.code === 'base-ratio-changed' && this.releasedBase\n ? html`<div ratio-choice>\n <button apply-fix @click=${() => this.restoreReleasedFootprint()}>\n ${i18next.t('figure.button.restore-released-base')}\n </button>\n <button ?selected=${this.keepChangedAppearance} @click=${() => this.keepChangedFootprint()}>\n ${i18next.t('figure.button.keep-changed-appearance')}\n </button>\n </div>\n <span how-line><md-icon>info</md-icon>${i18next.t('figure.text.appearance-choice-explained')}</span>`\n : nothing}\n ${(finding.fixes ?? []).map(fix => html`\n ${fix.safe ? html`\n <button apply-fix @click=${() => this.applyFix(fix)}>\n ${i18next.t('figure.button.apply-fix', { part: fix.part, axis: fix.axis.toUpperCase(), from: fix.from ?? 'auto', to: fix.to })}\n </button>\n ` : nothing}\n <button preview-fix @click=${() => this.previewFix(fix)}>\n ${i18next.t('figure.button.preview-fix', { part: fix.part, axis: fix.axis.toUpperCase(), from: fix.from ?? 'auto', to: fix.to })}\n </button>\n `)}\n ${finding.fixPlan?.safe ? html`\n <span how-line><md-icon>auto_fix_high</md-icon>${i18next.t('figure.text.recommended-fix-explained', { n: finding.fixPlan.fixes.length })}</span>\n <button apply-fix @click=${() => this.applyFixPlan(finding.fixPlan!)}>\n ${i18next.t('figure.button.apply-recommended-fix')}\n </button>\n ` : nothing}\n `)\n }\n\n /**\n * 게이트는 수정을 저장하지 않는다. 부모 모델러가 현재 정본과 이 한 수정안을 나란히 렌더하고,\n * 저작자가 '변경 받기'를 눌렀을 때에만 자기 작업 사본에 적용한다.\n */\n private previewFix(fix: FigureGateFix) {\n this.dispatchEvent(new CustomEvent('preview-sizing-fix', { detail: fix, bubbles: true, composed: true }))\n }\n\n /** 서버가 전수 재검사해 모든 차단 split이 사라진 후보만 작업 사본에 원클릭 적용한다. 저장은 하지 않는다. */\n private applyFix(fix: FigureGateFix) {\n if (!fix.safe) return\n this.dispatchEvent(new CustomEvent('apply-sizing-fix', { detail: fix, bubbles: true, composed: true }))\n }\n\n /** Apply the server-remeasured coordinated repair to the draft only; save remains explicit. */\n private applyFixPlan(plan: FigureGateFixPlan) {\n if (!plan.safe || plan.fixes.length === 0) return\n this.dispatchEvent(new CustomEvent('apply-sizing-fix-plan', { detail: plan, bubbles: true, composed: true }))\n }\n\n /**\n * 넘친 것을 담는 길 하나를 여기서도 내민다 — **같은 동작이 속성 패널에도 있다**(「부품에 맞추기」).\n *\n * 그 단추를 아는 저작자는 거기서 누른다. 발행이 막혔다는 말을 여기서 읽은 사람은 그 단추가 있는\n * 것을 모르고, 문구는 그것을 가리킬 수 없다 — 문장은 형식이 쓰고 형식은 화면의 단추를 모른다.\n * 그래서 화면이 자기 자리에서 같은 동작을 낸다. 누르면 상자만 커지고 부품은 제자리이며, 저장은\n * 여전히 저작자가 따로 한다.\n */\n /**\n * 「부품에 맞추기」를 내미는 판정. V2 는 기준 상자를 부품에 맞추고, V3 는 공간을 부품에서 다시 선언한다\n * (`declare-occupancy`) — 둘 다 부품은 그대로 두고 선언만 바꾼다. V3 에서 공간을 아직 선언하지 않은 도형도\n * 같은 단추로 선언한다: 새로 만든 V3 도형은 전부 그 판정으로 막히고, 화면에 다른 길이 없다.\n *\n * V3 의 장착면이 떠 있는 것은 여기 없다. 부품 하나를 평면에 붙이면 그 부품에 붙지 않은 것은 따라오지 않아\n * V2 의 「바닥에 앉히기」와 뜻이 다르다. 판정의 「어떻게」가 할 일을 말한다.\n */\n private offersFit(code: string): boolean {\n return this.format === 'v3'\n ? code === 'part-outside-occupancy' || code === 'occupancy-undeclared'\n : code === 'part-outside-base'\n }\n\n private fitBase() {\n this.dispatchEvent(new CustomEvent('fit-base-to-parts', { bubbles: true, composed: true }))\n }\n\n /**\n * 떠 있는 것을 앉힌다. 부품 하나를 고르고 「바닥에」를 누르는 길은 전부터 있었으나, 그 길은\n * 고른 것 하나만 옮기고 **여기서는 닿지 않는다.** 막혔다는 말을 읽은 자리에서 조치가 되게 한다.\n */\n private settleOnFloor() {\n this.dispatchEvent(new CustomEvent('settle-parts-on-floor', { bubbles: true, composed: true }))\n }\n\n /** 기준 상자의 X·Z만 직전 발행값으로 되돌린다. Y와 부품 편집은 보존한다. */\n private restoreReleasedFootprint() {\n if (!this.releasedBase) return\n this.dispatchEvent(new CustomEvent('restore-released-footprint', {\n detail: { x: this.releasedBase.x, z: this.releasedBase.z }, bubbles: true, composed: true\n }))\n }\n\n /** 현재 외형으로 발행하겠다는 명시적 선택이다. 저장·발행은 이어서 따로 한다. */\n private keepChangedFootprint() {\n this.keepChangedAppearance = true\n }\n\n private renderVersion(version: FigureVersion) {\n return html`\n <li>\n <span no>${i18next.t('figure.text.version-number', { version: version.version })}</span>\n <span when>\n ${version.updatedAt ? new Date(version.updatedAt).toLocaleString() : ''}\n ${version.updater?.name ? ` · ${version.updater.name}` : ''}\n </span>\n <button revert ?disabled=${this.busy} @click=${() => this.revert(version.version)}>\n ${i18next.t('figure.button.revert')}\n </button>\n ${version.comment ? html`<span comment>${version.comment}</span>` : nothing}\n </li>\n `\n }\n\n private async release() {\n const input = this.renderRoot.querySelector('input[note]') as HTMLInputElement\n const comment = input?.value?.trim()\n\n this.busy = true\n this.failure = ''\n\n try {\n const figure = await releaseFigure(this.figureId!, comment || undefined)\n if (input) input.value = ''\n /* 정본을 든 자리가 갱신한다 — 여기서 페이지 상태를 고쳐 쓰지 않는다. */\n this.dispatchEvent(new CustomEvent('figure-released', { detail: { figure }, bubbles: true, composed: true }))\n await this.reload()\n await this.inspect()\n } catch (e) {\n this.failure = (e as Error).message\n } finally {\n this.busy = false\n }\n }\n\n private async revert(version: number) {\n /* 되돌아갈 수 없는 조작은 아니지만(판본은 남는다), 지금 화면의 것이 덮인다 — 이름으로 확인한다. */\n if (!confirm(i18next.t('figure.text.revert-to-version-confirm', { version }))) {\n return\n }\n\n this.busy = true\n this.failure = ''\n\n try {\n const result = await revertFigureVersion(this.figureId!, version)\n this.dispatchEvent(new CustomEvent('figure-reverted', { detail: result, bubbles: true, composed: true }))\n await this.reload()\n /*\n **되돌리면 정본이 바뀌므로 판정도 바뀐다.** 이것을 안 하면 옛 판의 사유가 새 정본 위에\n 남아 화면이 거짓말한다 — 되돌리기는 `dirty` 도 `figureVersion` 도 건드리지 않으므로\n `updated` 의 감시로는 다시 묻지 않는다.\n */\n await this.inspect()\n } catch (e) {\n this.failure = (e as Error).message\n } finally {\n this.busy = false\n }\n }\n}\n"]}
1
+ {"version":3,"file":"figure-history-panel.js","sourceRoot":"","sources":["../../client/modeller/figure-history-panel.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE5G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA9D;;QAgOuB,kBAAa,GAAG,CAAC,CAAA;QAC7C,mCAAmC;QACN,UAAK,GAAG,KAAK,C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CAAC,OAAO,GAAI,CAAW,CAAC,OAAO,CAAA;QACrC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;QACnB,CAAC;IACH,CAAC;;AA/U2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAkB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDAAkB;AAEhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;iDAAc;AAMd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAA2B;AAM1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAoB;AAEf;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAAmD;AAEjE;IAAhB,KAAK,EAAE;;oDAAuC;AAC9B;IAAhB,KAAK,EAAE;;gDAAqB;AACZ;IAAhB,KAAK,EAAE;;mDAAqB;AACZ;IAAhB,KAAK,EAAE;;iEAAsC;AAK7B;IAAhB,KAAK,EAAE;;sDAAsC;AA1PnC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA8iB9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { gateFindingStyles, renderGateFinding } from './gate-findings.js'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { fetchFigureVersions, inspectFigure, releaseFigure, revertFigureVersion } from '../graphql/index.js'\nimport type { FigureGateFinding, FigureGateFix, FigureGateFixPlan, FigureInspection, FigureVersion } from '../types.js'\nimport { OxPrompt } from '@operato/popup'\n\n/**\n * 이력 — **발행하는 자리이자, 발행된 판들을 보는 자리.**\n *\n * ## 왜 저장 옆이 아니라 여기인가\n *\n * 저장은 하루에 수십 번이고 발행은 드물다. 두 단추를 나란히 두면 저장하려다 발행을 누른다.\n * 그리고 발행은 **소비처에게 하는 약속**이라, 무엇을 약속하는지(지금 몇 판인가 · 저장 안 한 것이\n * 있나 · 지난 판이 무엇이었나)를 함께 보여 주는 자리에 있어야 한다.\n *\n * ## 저장하지 않은 것이 있으면 발행하지 않는다\n *\n * 발행은 **저장된 것**을 내보낸다. 화면에 고친 것이 남아 있는 채로 발행하면, 저작자가 보고 있는\n * 것과 약속한 것이 다르다. 그래서 막고, 왜 막혔는지 적는다.\n *\n * ## 되돌리기는 초안으로 돌아온다\n *\n * 옛 판의 정본·속성·그림이 돌아오고 이름·설명은 그대로다. 되살렸다고 그 판이 다시 발행되지는\n * 않는다 — 다시 내보내려면 발행을 한 번 더 하고, 그때 번호는 이미 쓴 다음 번호를 받는다.\n */\n@customElement('figure-history-panel')\nexport class FigureHistoryPanel extends localize(i18next)(LitElement) {\n static styles = [\n gateFindingStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow-y: auto;\n background-color: var(--md-sys-color-surface-container-lowest);\n color: var(--md-sys-color-on-surface);\n font: var(--label-font, inherit);\n font-size: 0.76rem;\n }\n\n :host([off]) {\n display: none;\n }\n\n section {\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n\n h3 {\n margin: 0 0 6px 0;\n font-size: var(--ui-t-micro, 11px);\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n /* 지금 무엇인가 — 발행을 누르기 전에 읽는 한 줄 */\n div[now] {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 8px;\n }\n\n span[state] {\n padding: 2px 8px;\n border-radius: 10px;\n font-size: 0.7rem;\n font-weight: 700;\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n span[state][released] {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n span[ver] {\n font-family: var(--mono-font, monospace);\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n input,\n button {\n font: var(--input-field-font, inherit);\n font-size: 0.76rem;\n }\n\n input[note] {\n width: 100%;\n box-sizing: border-box;\n padding: 5px 8px;\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-container-lowest);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n }\n\n button[release] {\n width: 100%;\n margin-top: 6px;\n padding: 6px 0;\n font-weight: 700;\n color: var(--ui-on-accent, #fff);\n background-color: var(--md-sys-color-primary);\n border: 0;\n border-radius: 6px;\n cursor: pointer;\n }\n\n button[release][disabled] {\n opacity: 0.45;\n cursor: default;\n }\n\n /* 왜 못 누르는지 — 눌러 보고 알게 하지 않는다 */\n p[why] {\n margin: 6px 0 0 0;\n font-size: 0.7rem;\n line-height: 1.5;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n p[failed] {\n margin: 6px 0 0 0;\n font-size: 0.7rem;\n line-height: 1.5;\n color: var(--md-sys-color-error);\n }\n\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n display: grid;\n grid-template-columns: auto 1fr auto;\n gap: 4px 8px;\n align-items: baseline;\n padding: 7px 0;\n border-bottom: 1px dashed var(--md-sys-color-outline-variant);\n }\n\n li:last-child {\n border-bottom: 0;\n }\n\n li span[no] {\n font-family: var(--mono-font, monospace);\n font-weight: 700;\n }\n\n li span[when] {\n grid-column: 2 / 4;\n font-size: 0.7rem;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n\n li span[comment] {\n grid-column: 1 / 4;\n line-height: 1.5;\n }\n\n li button[revert] {\n padding: 2px 8px;\n color: var(--md-sys-color-on-surface);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n\n li button[revert]:hover {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n\n /*\n 게이트 사유. 막는 것은 색으로도 말하고, 알리는 것은 조용히 둔다 — 둘을 같은 톤으로 두면\n 「이 중 어느 것이 발행을 막았나」를 사람이 다시 세어야 한다.\n */\n\n /* 설명으로 끝내지 않는다. 이 단추는 원본을 바꾸지 않고 모델러에 후보만 연다. */\n li[finding] button[preview-fix] {\n margin-top: 3px;\n padding: 4px 7px;\n font-weight: 700;\n color: var(--md-sys-color-on-primary-container, var(--md-sys-color-on-surface));\n background-color: var(--md-sys-color-primary-container, transparent);\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n }\n\n li[finding] button[preview-fix]:hover {\n filter: brightness(1.08);\n }\n\n li[finding] button[apply-fix] {\n margin-top: 3px;\n padding: 4px 7px;\n font-weight: 700;\n color: var(--ui-on-accent, #fff);\n background-color: var(--md-sys-color-primary);\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n }\n\n div[ratio-choice] {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-top: 4px;\n }\n\n div[ratio-choice] button:not([apply-fix]) {\n padding: 4px 7px;\n color: var(--md-sys-color-on-surface);\n background: transparent;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 5px;\n cursor: pointer;\n }\n\n div[ratio-choice] button[selected] {\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n\n p[quiet] {\n margin: 0;\n line-height: 1.6;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n `\n ]\n\n /** 지금 열려 있는 도형. 없으면(새로 만드는 중) 발행할 것이 없다. */\n @property({ type: String }) figureId?: string\n @property({ type: String }) figureState?: 'draft' | 'released'\n @property({ type: Number }) figureVersion = 0\n /** 저장하지 않은 것이 있나 — 있으면 발행을 막는다. */\n @property({ type: Boolean }) dirty = false\n /**\n * 열린 도형의 형식. 발행 · 판본 · 복원은 figure id 로만 서버를 묻고 서버의 한 문이 두 형식을 다 읽으므로 두 화면이\n * 이 패널을 함께 쓴다. 갈리는 것은 조치 단추 하나다 — 부품을 옮기는 두 조치는 형식마다 다른 편집이라, 받는\n * 화면이 없는 단추를 그리면 눌러도 아무 일이 없다.\n */\n @property({ type: String }) format: 'v2' | 'v3' = 'v2'\n /**\n * 행의 타입. 판정 하나(`type-is-placeholder`)가 이것을 본다 — V3 자산은 타입을 원본에 적지 않아서, 타입을 바꾸면\n * 원본도 dirty 도 그대로다. 그래서 이 값이 바뀌면 판정을 다시 묻는다. 안 그러면 타입을 정한 뒤에도 「임시 타입」\n * 판정이 남아 발행 단추가 잠긴 채다.\n */\n @property({ type: String }) figureType?: string\n /** 직전 발행판의 기준 상자. 외형 변화 안내에서 X·Z 복원 선택지에만 쓴다. */\n @property({ attribute: false }) releasedBase?: { x: number; y: number; z: number }\n\n @state() private versions: FigureVersion[] = []\n @state() private busy = false\n @state() private failure = ''\n @state() private keepChangedAppearance = false\n /**\n * 발행 판정. **저장된 정본에 대한 것**이라 저장할 때마다 다시 묻는다(`figureVersion` 이 아니라\n * `dirty` 가 풀리는 순간이 그때다).\n */\n @state() private inspection?: FigureInspection\n\n updated(changes: Map<string, unknown>) {\n if (changes.has('figureId') || changes.has('figureVersion')) {\n void this.reload()\n }\n\n /*\n 저장이 끝난 순간(dirty 가 풀림) 정본이 바뀌었으니 판정을 다시 묻는다. 저작 중(dirty)에는\n 묻지 않는다 — 서버에 있는 것은 저장 전 정본이라, 그 답은 화면에 있는 것과 다른 것을 말한다.\n */\n if (changes.has('figureId') || changes.has('dirty') || changes.has('figureType')) {\n void this.inspect()\n }\n }\n\n private async inspect() {\n this.keepChangedAppearance = false\n if (!this.figureId || this.dirty) {\n this.inspection = undefined\n return\n }\n\n try {\n this.inspection = await inspectFigure(this.figureId)\n } catch (e) {\n /* 판정을 못 받은 것을 「통과」로 두지 않는다 — 모르는 것이다. 단추는 서버가 막는다. */\n this.inspection = undefined\n this.failure = (e as Error).message\n }\n }\n\n private async reload() {\n if (!this.figureId) {\n this.versions = []\n return\n }\n\n try {\n this.versions = await fetchFigureVersions(this.figureId)\n this.failure = ''\n } catch (e) {\n this.failure = (e as Error).message\n }\n }\n\n render() {\n return html`\n <section>\n <h3>${i18next.t('figure.label.release')}</h3>\n ${this.figureId ? this.renderRelease() : html`<p quiet>${i18next.t('figure.text.save-the-figure-before-releasing')}</p>`}\n </section>\n\n <section>\n <h3>${i18next.t('figure.label.released-versions')}</h3>\n ${this.versions.length\n ? html`<ul>\n ${this.versions.map(version => this.renderVersion(version))}\n </ul>`\n : html`<p quiet>${i18next.t('figure.text.nothing-released-yet')}</p>`}\n </section>\n `\n }\n\n private renderRelease() {\n const released = this.figureState === 'released'\n\n /*\n 게이트가 막는 것과 알리는 것을 함께 낸다. **막는 것은 단추를 잠근다** — 눌러 보고 서버에게\n 거절당하는 것으로 알게 하지 않는다. 알리는 것은 잠그지 않고 그대로 보여 준다.\n */\n const blocking = (this.inspection?.findings ?? []).filter(finding => finding.blocking)\n const advisory = (this.inspection?.findings ?? []).filter(finding => !finding.blocking)\n const appearanceChoiceNeeded = advisory.some(finding => finding.code === 'base-ratio-changed') && !this.keepChangedAppearance\n\n /*\n ── 「발행되나」에 **한 번만** 답한다 ─────────────────────────────────────\n 전에는 막는 목록의 머리가 「이것들이 발행을 막습니다」, 알리는 목록의 머리가 「발행은 되지만\n 확인해 보십시오」였다. 두 줄이 나란히 서서 화면이 「막힌다」와 「된다」를 함께 말했고, 사람이\n 「그래서 되는 건가」를 되물었다.\n\n 답은 이 한 줄이 하고, 아래 목록들은 **이유**일 뿐이다 — 그래서 목록 머리는 문장이 아니라\n 이름씨다(「고쳐야 하는 것」·「막지는 않는 것」).\n */\n const why = this.dirty\n ? i18next.t('figure.text.release-needs-a-save-first')\n : released\n ? i18next.t('figure.text.already-released-edit-to-release-again')\n : appearanceChoiceNeeded\n ? i18next.t('figure.text.choose-appearance-change')\n : blocking.length\n ? i18next.t('figure.text.cannot-release-now')\n : ''\n\n return html`\n <div now>\n <span state ?released=${released}>${i18next.t(released ? 'figure.label.figure-released' : 'figure.label.draft')}</span>\n <span ver>${i18next.t('figure.text.version-number', { version: this.figureVersion ?? 0 })}</span>\n </div>\n\n <input note placeholder=${i18next.t('figure.text.what-changed-in-this-release')} ?disabled=${!!why || this.busy} />\n\n <button release ?disabled=${!!why || this.busy} @click=${() => this.release()}>\n ${this.busy ? i18next.t('figure.text.releasing') : i18next.t('figure.button.release-figure')}\n </button>\n\n ${why ? html`<p why>${why}</p>` : nothing}\n ${blocking.length\n ? html`<ul gate>\n <li head>${i18next.t('figure.text.must-fix-to-release')}</li>\n ${blocking.map(finding => this.renderFinding(finding, true))}\n </ul>`\n : nothing}\n ${advisory.length\n ? html`<ul gate>\n <li head quiet>${i18next.t('figure.text.does-not-block')}</li>\n ${advisory.map(finding => this.renderFinding(finding, false))}\n </ul>`\n : nothing}\n ${this.failure ? html`<p failed>${this.failure}</p>` : nothing}\n `\n }\n\n /**\n * 사유 한 줄 — **잰 것 · 왜 · 어떻게** 셋을 함께 말한다.\n *\n * 잰 것만 보여 줬더니 「1 조각이 2 조각으로 갈라진다」에서 사람이 멈췄다. 왜 나쁜지도, 무엇을\n * 바꾸면 되는지도 알 수 없었다. 그 셋은 형식(`figure-model` 의 gate)이 만들고 여기서는 자리만\n * 준다 — 화면이 문장을 지으면 서버가 거절할 때와 다른 말을 하게 된다.\n */\n private renderFinding(finding: FigureGateFinding, blocking: boolean) {\n return renderGateFinding(finding, blocking, html`\n ${this.offersFit(finding.code)\n ? html`<button fit-base @click=${() => this.fitBase()}>\n ${i18next.t('figure.button.fit-base-to-parts')}\n </button>`\n : nothing}\n ${finding.code === 'parts-off-placement-face' && this.format === 'v2'\n ? html`<button fit-base @click=${() => this.settleOnFloor()}>\n ${i18next.t('figure.button.settle-on-floor')}\n </button>`\n : nothing}\n ${finding.code === 'base-ratio-changed' && this.releasedBase\n ? html`<div ratio-choice>\n <button apply-fix @click=${() => this.restoreReleasedFootprint()}>\n ${i18next.t('figure.button.restore-released-base')}\n </button>\n <button ?selected=${this.keepChangedAppearance} @click=${() => this.keepChangedFootprint()}>\n ${i18next.t('figure.button.keep-changed-appearance')}\n </button>\n </div>\n <span how-line><md-icon>info</md-icon>${i18next.t('figure.text.appearance-choice-explained')}</span>`\n : nothing}\n ${(finding.fixes ?? []).map(fix => html`\n ${fix.safe ? html`\n <button apply-fix @click=${() => this.applyFix(fix)}>\n ${i18next.t('figure.button.apply-fix', { part: fix.part, axis: fix.axis.toUpperCase(), from: fix.from ?? 'auto', to: fix.to })}\n </button>\n ` : nothing}\n <button preview-fix @click=${() => this.previewFix(fix)}>\n ${i18next.t('figure.button.preview-fix', { part: fix.part, axis: fix.axis.toUpperCase(), from: fix.from ?? 'auto', to: fix.to })}\n </button>\n `)}\n ${finding.fixPlan?.safe ? html`\n <span how-line><md-icon>auto_fix_high</md-icon>${i18next.t('figure.text.recommended-fix-explained', { n: finding.fixPlan.fixes.length })}</span>\n <button apply-fix @click=${() => this.applyFixPlan(finding.fixPlan!)}>\n ${i18next.t('figure.button.apply-recommended-fix')}\n </button>\n ` : nothing}\n `)\n }\n\n /**\n * 게이트는 수정을 저장하지 않는다. 부모 모델러가 현재 정본과 이 한 수정안을 나란히 렌더하고,\n * 저작자가 '변경 받기'를 눌렀을 때에만 자기 작업 사본에 적용한다.\n */\n private previewFix(fix: FigureGateFix) {\n this.dispatchEvent(new CustomEvent('preview-sizing-fix', { detail: fix, bubbles: true, composed: true }))\n }\n\n /** 서버가 전수 재검사해 모든 차단 split이 사라진 후보만 작업 사본에 원클릭 적용한다. 저장은 하지 않는다. */\n private applyFix(fix: FigureGateFix) {\n if (!fix.safe) return\n this.dispatchEvent(new CustomEvent('apply-sizing-fix', { detail: fix, bubbles: true, composed: true }))\n }\n\n /** Apply the server-remeasured coordinated repair to the draft only; save remains explicit. */\n private applyFixPlan(plan: FigureGateFixPlan) {\n if (!plan.safe || plan.fixes.length === 0) return\n this.dispatchEvent(new CustomEvent('apply-sizing-fix-plan', { detail: plan, bubbles: true, composed: true }))\n }\n\n /**\n * 넘친 것을 담는 길 하나를 여기서도 내민다 — **같은 동작이 속성 패널에도 있다**(「부품에 맞추기」).\n *\n * 그 단추를 아는 저작자는 거기서 누른다. 발행이 막혔다는 말을 여기서 읽은 사람은 그 단추가 있는\n * 것을 모르고, 문구는 그것을 가리킬 수 없다 — 문장은 형식이 쓰고 형식은 화면의 단추를 모른다.\n * 그래서 화면이 자기 자리에서 같은 동작을 낸다. 누르면 상자만 커지고 부품은 제자리이며, 저장은\n * 여전히 저작자가 따로 한다.\n */\n /**\n * 「부품에 맞추기」를 내미는 판정. V2 는 기준 상자를 부품에 맞추고, V3 는 공간을 부품에서 다시 선언한다\n * (`declare-occupancy`) — 둘 다 부품은 그대로 두고 선언만 바꾼다. V3 에서 공간을 아직 선언하지 않은 도형도\n * 같은 단추로 선언한다: 새로 만든 V3 도형은 전부 그 판정으로 막히고, 화면에 다른 길이 없다.\n *\n * V3 의 장착면이 떠 있는 것은 여기 없다. 부품 하나를 평면에 붙이면 그 부품에 붙지 않은 것은 따라오지 않아\n * V2 의 「바닥에 앉히기」와 뜻이 다르다. 판정의 「어떻게」가 할 일을 말한다.\n */\n private offersFit(code: string): boolean {\n return this.format === 'v3'\n ? code === 'part-outside-occupancy' || code === 'occupancy-undeclared'\n : code === 'part-outside-base'\n }\n\n private fitBase() {\n this.dispatchEvent(new CustomEvent('fit-base-to-parts', { bubbles: true, composed: true }))\n }\n\n /**\n * 떠 있는 것을 앉힌다. 부품 하나를 고르고 「바닥에」를 누르는 길은 전부터 있었으나, 그 길은\n * 고른 것 하나만 옮기고 **여기서는 닿지 않는다.** 막혔다는 말을 읽은 자리에서 조치가 되게 한다.\n */\n private settleOnFloor() {\n this.dispatchEvent(new CustomEvent('settle-parts-on-floor', { bubbles: true, composed: true }))\n }\n\n /** 기준 상자의 X·Z만 직전 발행값으로 되돌린다. Y와 부품 편집은 보존한다. */\n private restoreReleasedFootprint() {\n if (!this.releasedBase) return\n this.dispatchEvent(new CustomEvent('restore-released-footprint', {\n detail: { x: this.releasedBase.x, z: this.releasedBase.z }, bubbles: true, composed: true\n }))\n }\n\n /** 현재 외형으로 발행하겠다는 명시적 선택이다. 저장·발행은 이어서 따로 한다. */\n private keepChangedFootprint() {\n this.keepChangedAppearance = true\n }\n\n private renderVersion(version: FigureVersion) {\n return html`\n <li>\n <span no>${i18next.t('figure.text.version-number', { version: version.version })}</span>\n <span when>\n ${version.updatedAt ? new Date(version.updatedAt).toLocaleString() : ''}\n ${version.updater?.name ? ` · ${version.updater.name}` : ''}\n </span>\n <button revert ?disabled=${this.busy} @click=${() => this.revert(version.version)}>\n ${i18next.t('figure.button.revert')}\n </button>\n ${version.comment ? html`<span comment>${version.comment}</span>` : nothing}\n </li>\n `\n }\n\n private async release() {\n const input = this.renderRoot.querySelector('input[note]') as HTMLInputElement\n const comment = input?.value?.trim()\n\n this.busy = true\n this.failure = ''\n\n try {\n const figure = await releaseFigure(this.figureId!, comment || undefined)\n if (input) input.value = ''\n /* 정본을 든 자리가 갱신한다 — 여기서 페이지 상태를 고쳐 쓰지 않는다. */\n this.dispatchEvent(new CustomEvent('figure-released', { detail: { figure }, bubbles: true, composed: true }))\n await this.reload()\n await this.inspect()\n } catch (e) {\n this.failure = (e as Error).message\n } finally {\n this.busy = false\n }\n }\n\n private async revert(version: number) {\n /* 되돌아갈 수 없는 조작은 아니지만(판본은 남는다), 지금 화면의 것이 덮인다 — 이름으로 확인한다. */\n const agreed = await OxPrompt.open({\n type: 'warning',\n title: i18next.t('figure.button.revert'),\n text: i18next.t('figure.text.revert-to-version-confirm', { version }),\n confirmButton: { text: i18next.t('figure.button.revert') },\n cancelButton: { text: i18next.t('figure.button.keep-editing') }\n })\n if (!agreed) {\n return\n }\n\n this.busy = true\n this.failure = ''\n\n try {\n const result = await revertFigureVersion(this.figureId!, version)\n this.dispatchEvent(new CustomEvent('figure-reverted', { detail: result, bubbles: true, composed: true }))\n await this.reload()\n /*\n **되돌리면 정본이 바뀌므로 판정도 바뀐다.** 이것을 안 하면 옛 판의 사유가 새 정본 위에\n 남아 화면이 거짓말한다 — 되돌리기는 `dirty` 도 `figureVersion` 도 건드리지 않으므로\n `updated` 의 감시로는 다시 묻지 않는다.\n */\n await this.inspect()\n } catch (e) {\n this.failure = (e as Error).message\n } finally {\n this.busy = false\n }\n }\n}\n"]}
@@ -15,7 +15,7 @@ export declare class FigureV3Capability extends FigureV3Capability_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 FigureV3Clips extends FigureV3Clips_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 FigureV3Controls extends FigureV3Controls_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;
@@ -0,0 +1,20 @@
1
+ import { LitElement } from 'lit';
2
+ import '@operato/popup/ox-popup-actions.js';
3
+ import '@material/web/button/filled-button.js';
4
+ import '@material/web/button/text-button.js';
5
+ /**
6
+ * The first save of a new figure: its type and its name, asked once (V2's save dialog, in the suite's popup look).
7
+ * Closes with the answer, or with nothing when cancelled -- then nothing is saved.
8
+ */
9
+ export declare class FigureV3FirstSave extends LitElement {
10
+ static styles: import("lit").CSSResult[];
11
+ /** The type the figure has so far -- empty for a temporary one, which is not offered. */
12
+ type: string;
13
+ name: string;
14
+ /** Type names already used in this domain. */
15
+ taken: string[];
16
+ private refusal;
17
+ render(): import("lit-html").TemplateResult<1>;
18
+ private onKey;
19
+ private confirm;
20
+ }