@things-factory/figure-ui 10.1.55 → 10.1.57

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.
@@ -20,11 +20,13 @@ import {
20
20
  positionIsShare,
21
21
  choiceOf,
22
22
  fastenedTo,
23
+ heldBy,
23
24
  followOf,
24
25
  hasInstanceSize,
25
26
  holdsThings,
26
27
  leadersFor,
27
28
  motionOf,
29
+ motionFormOf,
28
30
  motionJoint,
29
31
  placeFacesOf,
30
32
  placeIdFor,
@@ -115,6 +117,8 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
115
117
  @state() private motion: MotionForm = freshMotion()
116
118
  @state() private place = freshPlace()
117
119
  @state() private row = freshRow()
120
+ /** The motion form is open over the part's own motion, to change it where it is. */
121
+ @state() private editingMotion = false
118
122
 
119
123
  /*
120
124
  The forms describe the next command for the selected part, so another part starts from the defaults: carrying the
@@ -126,6 +130,7 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
126
130
  this.motion = freshMotion()
127
131
  this.place = freshPlace()
128
132
  this.row = freshRow()
133
+ this.editingMotion = false
129
134
  }
130
135
  }
131
136
 
@@ -320,7 +325,7 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
320
325
  }
321
326
 
322
327
  private renderFastening(asset: V3Asset) {
323
- const to = fastenedTo(asset, this.partId)
328
+ const held = heldBy(asset, this.partId)
324
329
  const f = this.fasten
325
330
  const targets = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFasten(asset, one))
326
331
  /* The faces are the ones each shape declares: a part is fastened by one of its outer faces, to any face of the target. */
@@ -331,9 +336,9 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
331
336
  const aim = f.toPlane ? ('plane' as const) : { part: f.target, face: targetFace }
332
337
  const align = f.target || f.toPlane ? alignOf(asset, this.partId, aim, f.align, f.alignMm, !!f.twist) : undefined
333
338
  return html`
334
- ${to
339
+ ${held
335
340
  ? html`<div pair>
336
- <span>${i18next.t('figure.label.fastened-to')}: <b bound>${to}</b></span>
341
+ <span>${i18next.t('figure.label.fastened-to')}: <b bound>${'plane' in held ? i18next.t('figure.label.mounting-plane') : held.part}</b></span>
337
342
  <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>
338
343
  <md-icon>link_off</md-icon>${i18next.t('figure.button.detach')}
339
344
  </button>
@@ -387,7 +392,7 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
387
392
  ...(f.gap ? { gap: f.gap } : {}),
388
393
  twist: f.twist,
389
394
  ...(align ? { align } : {}),
390
- replace: !!to
395
+ replace: !!held
391
396
  } as V3AuthoringAction)}
392
397
  >
393
398
  <md-icon>link</md-icon>${i18next.t('figure.button.fasten')}
@@ -469,7 +474,7 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
469
474
  private renderMotion(asset: V3Asset) {
470
475
  const now = motionOf(asset, this.partId)
471
476
  const joint = asset.joints?.find(j => j.body1.part === this.partId)
472
- if (now) {
477
+ if (now && !(this.editingMotion && joint)) {
473
478
  return html`<div pair>
474
479
  <span>
475
480
  ${i18next.t('figure.label.motion-' + now.kind)} · ${String(now.axis).toUpperCase()}
@@ -489,6 +494,17 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
489
494
  >
490
495
  <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}
491
496
  </button>
497
+ <button
498
+ act
499
+ ?disabled=${this.locked || !joint}
500
+ @click=${() => {
501
+ if (!joint) return
502
+ this.motion = motionFormOf(joint)
503
+ this.editingMotion = true
504
+ }}
505
+ >
506
+ <md-icon>edit</md-icon>${i18next.t('figure.button.change-motion')}
507
+ </button>
492
508
  </div>`
493
509
  }
494
510
  /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */
@@ -554,10 +570,16 @@ export class FigureV3Links extends localize(i18next)(LitElement) {
554
570
  act
555
571
  ?disabled=${this.locked || (follow ? !(Number.isFinite(m.multiplier) && m.multiplier !== 0) : m.kind !== 'continuous' && !(m.kind === 'slide' && m.travel) && !(m.max > m.min && m.min <= 0 && 0 <= m.max))}
556
572
  title=${!follow && m.kind !== 'continuous' && !(m.min <= 0 && 0 <= m.max) ? i18next.t('figure.text.joint-range-holds-zero') : ''}
557
- @click=${() => this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })}
573
+ @click=${() => {
574
+ this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })
575
+ this.editingMotion = false
576
+ }}
558
577
  >
559
- <md-icon>animation</md-icon>${i18next.t('figure.button.add-motion')}
578
+ <md-icon>animation</md-icon>${i18next.t(this.editingMotion ? 'figure.button.apply-motion-change' : 'figure.button.add-motion')}
560
579
  </button>
580
+ ${this.editingMotion
581
+ ? html`<button act @click=${() => (this.editingMotion = false)}><md-icon>undo</md-icon>${i18next.t('figure.button.cancel-motion-change')}</button>`
582
+ : nothing}
561
583
  `
562
584
  }
563
585
 
@@ -99,6 +99,18 @@ export function fastenedTo(asset: V3Asset, part: string): string | null {
99
99
  return v3AttachmentsOf(asset)[part] ?? null
100
100
  }
101
101
 
102
+ /**
103
+ * What holds a part: the part it is fastened to, the plane the figure is mounted on, or nothing. The joint record says
104
+ * it; a part standing on the plane had read as fastened to nothing, so the form offered no way to move it and sent
105
+ * no replace -- the fastening was refused as already made (the door's post, 2026-09-25).
106
+ */
107
+ export function heldBy(asset: V3Asset, part: string): { part: string } | { plane: true } | null {
108
+ const record = asset.joints?.find(j => j.body1.part === part)
109
+ if (record) return 'plane' in record.body0 ? { plane: true } : { part: record.body0.part }
110
+ const to = fastenedTo(asset, part)
111
+ return to ? { part: to } : null
112
+ }
113
+
102
114
  /** Whether a dimension of this part can follow something — box-shaped, whose three sizes are X, Y and Z. */
103
115
  export function canFollow(asset: V3Asset, part: string): boolean {
104
116
  return followableAxes(asset, part).length > 0
@@ -292,6 +304,28 @@ export interface MotionForm {
292
304
  travelPlus?: number
293
305
  }
294
306
 
307
+ /**
308
+ * The motion form filled from a joint as it is, so a motion can be changed where it is -- its range, the length it
309
+ * travels by, what it follows -- rather than taken away and made again. Taking it away is refused while another joint
310
+ * follows it, which left a leader's stroke fixed for good (the telescopic conveyor, 2026-09-25).
311
+ */
312
+ export function motionFormOf(joint: V3Joint): MotionForm {
313
+ const kind: MotionForm['kind'] = joint.type === 'prismatic' ? 'slide' : joint.lowerLimit === undefined && joint.upperLimit === undefined && !joint.mimic ? 'continuous' : 'turn'
314
+ const travel = joint.travel?.source && 'part' in joint.travel.source ? `${joint.travel.source.part}:${joint.travel.source.axis}` : ''
315
+ return {
316
+ kind,
317
+ axis: (joint.axis ?? 'X').toLowerCase() as Axis,
318
+ id: joint.state?.id ?? '',
319
+ min: travel ? 0 : (joint.lowerLimit ?? (kind === 'slide' ? 0 : -90)),
320
+ max: travel ? 500 : (joint.upperLimit ?? (kind === 'slide' ? 500 : 90)),
321
+ follow: joint.mimic?.joint ?? '',
322
+ multiplier: joint.mimic?.multiplier ?? 1,
323
+ offset: joint.mimic?.offset ?? 0,
324
+ travel,
325
+ travelPlus: joint.travel?.plus ?? 0
326
+ }
327
+ }
328
+
295
329
  /**
296
330
  * 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
297
331
  * turn a turn — and has a control of its own, since a follower follows the joint that is driven.
@@ -31,6 +31,8 @@ export declare class FigureV3Links extends FigureV3Links_base {
31
31
  private motion;
32
32
  private place;
33
33
  private row;
34
+ /** The motion form is open over the part's own motion, to change it where it is. */
35
+ private editingMotion;
34
36
  willUpdate(changed: Map<string, unknown>): void;
35
37
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
36
38
  /** Where things are held on this part: a seat things rest on, or a grip things are held in (parity row ⑤). */
@@ -4,7 +4,7 @@ import { css, html, LitElement, nothing } from 'lit';
4
4
  import { customElement, property, state } from 'lit/decorators.js';
5
5
  import { i18next, localize } from '@operato/i18n';
6
6
  import { V3_FACES } from '@hatiolab/figure-model';
7
- import { acceptsOf, alignAxesOf, alignOf, AXES, canFasten, facesOf, canFollow, dimensionNow, followableAxes, positionIsShare, choiceOf, fastenedTo, followOf, hasInstanceSize, holdsThings, leadersFor, motionOf, motionJoint, placeFacesOf, placeIdFor, placesOn, rowAxesOf, positionsWorkedOut } from './v3-links.js';
7
+ import { acceptsOf, alignAxesOf, alignOf, AXES, canFasten, facesOf, canFollow, dimensionNow, followableAxes, positionIsShare, choiceOf, heldBy, followOf, hasInstanceSize, holdsThings, leadersFor, motionOf, motionFormOf, motionJoint, placeFacesOf, placeIdFor, placesOn, rowAxesOf, positionsWorkedOut } from './v3-links.js';
8
8
  import { SidePanelStyles } from './side-panel-styles.js';
9
9
  import { HelpToggles } from './v3-help.js';
10
10
  const FACES = Object.keys(V3_FACES);
@@ -48,6 +48,8 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
48
48
  this.motion = freshMotion();
49
49
  this.place = freshPlace();
50
50
  this.row = freshRow();
51
+ /** The motion form is open over the part's own motion, to change it where it is. */
52
+ this.editingMotion = false;
51
53
  }
52
54
  static { this.styles = [SidePanelStyles, css `
53
55
  :host {
@@ -87,6 +89,7 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
87
89
  this.motion = freshMotion();
88
90
  this.place = freshPlace();
89
91
  this.row = freshRow();
92
+ this.editingMotion = false;
90
93
  }
91
94
  }
92
95
  render() {
@@ -267,7 +270,7 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
267
270
  </div>`);
268
271
  }
269
272
  renderFastening(asset) {
270
- const to = fastenedTo(asset, this.partId);
273
+ const held = heldBy(asset, this.partId);
271
274
  const f = this.fasten;
272
275
  const targets = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFasten(asset, one));
273
276
  /* The faces are the ones each shape declares: a part is fastened by one of its outer faces, to any face of the target. */
@@ -278,9 +281,9 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
278
281
  const aim = f.toPlane ? 'plane' : { part: f.target, face: targetFace };
279
282
  const align = f.target || f.toPlane ? alignOf(asset, this.partId, aim, f.align, f.alignMm, !!f.twist) : undefined;
280
283
  return html `
281
- ${to
284
+ ${held
282
285
  ? html `<div pair>
283
- <span>${i18next.t('figure.label.fastened-to')}: <b bound>${to}</b></span>
286
+ <span>${i18next.t('figure.label.fastened-to')}: <b bound>${'plane' in held ? i18next.t('figure.label.mounting-plane') : held.part}</b></span>
284
287
  <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>
285
288
  <md-icon>link_off</md-icon>${i18next.t('figure.button.detach')}
286
289
  </button>
@@ -333,7 +336,7 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
333
336
  ...(f.gap ? { gap: f.gap } : {}),
334
337
  twist: f.twist,
335
338
  ...(align ? { align } : {}),
336
- replace: !!to
339
+ replace: !!held
337
340
  })}
338
341
  >
339
342
  <md-icon>link</md-icon>${i18next.t('figure.button.fasten')}
@@ -413,7 +416,7 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
413
416
  renderMotion(asset) {
414
417
  const now = motionOf(asset, this.partId);
415
418
  const joint = asset.joints?.find(j => j.body1.part === this.partId);
416
- if (now) {
419
+ if (now && !(this.editingMotion && joint)) {
417
420
  return html `<div pair>
418
421
  <span>
419
422
  ${i18next.t('figure.label.motion-' + now.kind)} · ${String(now.axis).toUpperCase()}
@@ -433,6 +436,18 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
433
436
  >
434
437
  <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}
435
438
  </button>
439
+ <button
440
+ act
441
+ ?disabled=${this.locked || !joint}
442
+ @click=${() => {
443
+ if (!joint)
444
+ return;
445
+ this.motion = motionFormOf(joint);
446
+ this.editingMotion = true;
447
+ }}
448
+ >
449
+ <md-icon>edit</md-icon>${i18next.t('figure.button.change-motion')}
450
+ </button>
436
451
  </div>`;
437
452
  }
438
453
  /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */
@@ -499,10 +514,16 @@ let FigureV3Links = class FigureV3Links extends localize(i18next)(LitElement) {
499
514
  act
500
515
  ?disabled=${this.locked || (follow ? !(Number.isFinite(m.multiplier) && m.multiplier !== 0) : m.kind !== 'continuous' && !(m.kind === 'slide' && m.travel) && !(m.max > m.min && m.min <= 0 && 0 <= m.max))}
501
516
  title=${!follow && m.kind !== 'continuous' && !(m.min <= 0 && 0 <= m.max) ? i18next.t('figure.text.joint-range-holds-zero') : ''}
502
- @click=${() => this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })}
517
+ @click=${() => {
518
+ this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) });
519
+ this.editingMotion = false;
520
+ }}
503
521
  >
504
- <md-icon>animation</md-icon>${i18next.t('figure.button.add-motion')}
522
+ <md-icon>animation</md-icon>${i18next.t(this.editingMotion ? 'figure.button.apply-motion-change' : 'figure.button.add-motion')}
505
523
  </button>
524
+ ${this.editingMotion
525
+ ? html `<button act @click=${() => (this.editingMotion = false)}><md-icon>undo</md-icon>${i18next.t('figure.button.cancel-motion-change')}</button>`
526
+ : nothing}
506
527
  `;
507
528
  }
508
529
  setKind(kind) {
@@ -548,6 +569,10 @@ __decorate([
548
569
  state(),
549
570
  __metadata("design:type", Object)
550
571
  ], FigureV3Links.prototype, "row", void 0);
572
+ __decorate([
573
+ state(),
574
+ __metadata("design:type", Object)
575
+ ], FigureV3Links.prototype, "editingMotion", void 0);
551
576
  FigureV3Links = __decorate([
552
577
  customElement('figure-v3-links')
553
578
  ], FigureV3Links);
@@ -1 +1 @@
1
- {"version":3,"file":"figure-v3-links.js","sourceRoot":"","sources":["../../client/modeller/figure-v3-links.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,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E,SAAS,EAAE,KAAK,EAAE,CAAC;;2CAAgC;AAClC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;6CAAe;AAE/B;IAAX,QAAQ,EAAE;;8CAAiD;AAE3C;IAAhB,KAAK,EAAE;;6CAA+B;AACtB;IAAhB,KAAK,EAAE;;6CAA2C;AAClC;IAAhB,KAAK,EAAE;;4CAA6B;AACpB;IAAhB,KAAK,EAAE;;0CAAyB;AA5CtB,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAkfzB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { V3_FACES } from '@hatiolab/figure-model'\nimport type { V3Asset, V3AuthoringAction, V3DimensionSource, V3Face } from '@hatiolab/figure-model'\n\nimport {\n acceptsOf,\n alignAxesOf,\n alignOf,\n AXES,\n canFasten,\n facesOf,\n canFollow,\n dimensionNow,\n followableAxes,\n positionIsShare,\n choiceOf,\n fastenedTo,\n followOf,\n hasInstanceSize,\n holdsThings,\n leadersFor,\n motionOf,\n motionJoint,\n placeFacesOf,\n placeIdFor,\n placesOn,\n rowAxesOf,\n positionsWorkedOut,\n type Alignment,\n type Axis,\n type Follow,\n type MotionForm\n} from './v3-links.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { HelpToggles } from './v3-help.js'\n\nconst FACES = Object.keys(V3_FACES) as V3Face[]\n\nconst freshFasten = () => ({\n face: 'bottom' as V3Face,\n toPlane: false,\n target: '',\n targetFace: 'top' as V3Face,\n facing: 'meet' as 'meet' | 'flush',\n gap: 0,\n twist: 0,\n align: {} as Partial<Record<Axis, Alignment>>,\n alignMm: {} as Partial<Record<Axis, number>>\n})\nconst freshMotion = (): MotionForm => ({ kind: 'slide', axis: 'x', id: '', min: 0, max: 500, follow: '', multiplier: 1, offset: 0, travel: '', travelPlus: 0 })\nconst freshRow = () => ({ axis: '' as Axis | '', pitch: 200, fills: true, count: 5 })\nconst freshPlace = () => ({ role: 'grip' as 'seat' | 'grip', face: 'top' as V3Face, label: '', accepts: '', capacity: 1 })\n\n/**\n * What a part is tied to — its size response, what it is fastened to, how it moves (parity rows ④ ⑤ ⑥).\n *\n * 「Build Once, Fit Anywhere」 lives here: a dimension that follows the instance size or another part is what lets\n * a figure be placed at any size, and a part fastened to the face it rests on is what keeps it there when that\n * happens. The release gate refuses a figure that falls apart when resized, and tells the author to fasten the\n * parts that come away — this is where they do it. Motion is the V2 joint: a slide or a turn driven by a control.\n *\n * The V2 inspector has these as its dimensions, placement and joint sections, in that order; so does this. Every\n * change is one figure-model authoring command, sent as `v3-command` and run by the editor through the session — one\n * step of the undo history. Choices the command would refuse (a round body fastened, a size following an instance\n * size the figure does not declare) are not offered, so the author is not sent into a refusal.\n */\n@customElement('figure-v3-links')\nexport class FigureV3Links extends localize(i18next)(LitElement) {\n private readonly help = new HelpToggles(this)\n static styles = [SidePanelStyles, css`\n :host {\n display: block;\n }\n /* The measure's name, then its rule: X, or a cylinder's 반지름 · 길이, on one line. */\n div[row] > b {\n white-space: nowrap;\n }\n div[row] {\n display: grid;\n grid-template-columns: minmax(24px, max-content) minmax(0, 1fr);\n gap: 6px;\n align-items: center;\n }\n b[bound] {\n font-weight: 600;\n }\n /* The difference a following measure keeps: under its choice, on the same line as its words. */\n label[inline-plus] {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n label[inline-plus] input {\n flex: 1;\n min-width: 0;\n }\n `]\n\n /** The asset being edited. */\n @property({ attribute: false }) asset?: V3Asset\n /** The selected part. */\n @property() partId = ''\n /** The part's own extent along its axes now, in mm — what a dimension is fixed at when it stops following. */\n @property({ attribute: false }) dims?: [number, number, number]\n @property({ type: Boolean }) locked = false\n /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */\n @property() section: 'shape' | 'places' | 'motion' = 'shape'\n\n @state() private fasten = freshFasten()\n @state() private motion: MotionForm = freshMotion()\n @state() private place = freshPlace()\n @state() private row = freshRow()\n\n /*\n The forms describe the next command for the selected part, so another part starts from the defaults: carrying the\n last part's choices over fastened a shutter curtain level with a right edge nobody chose for it (2026-09-25).\n */\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('partId') && changed.get('partId') !== undefined) {\n this.fasten = freshFasten()\n this.motion = freshMotion()\n this.place = freshPlace()\n this.row = freshRow()\n }\n }\n\n render() {\n const asset = this.asset\n if (!asset || !this.partId) return nothing\n if (this.section === 'motion')\n return html`<section><h3>${i18next.t('figure.label.motion')}${this.help.button('figure.text.motion-explained')}</h3>${this.help.hint('figure.text.motion-explained')}\n ${this.renderMotion(asset)}</section>`\n if (this.section === 'places')\n return html`<section><h3>${i18next.t('figure.label.places-on-part', { part: this.partId })}${this.help.button('figure.text.place-explained')}</h3>${this.help.hint('figure.text.place-explained')}\n ${placeFacesOf(asset, this.partId).length ? this.renderPlaces(asset) : html`<p hint>${i18next.t('figure.text.places-need-a-box')}</p>`}</section>`\n return html`\n <section>\n <h3>${i18next.t('figure.label.dimensions')}</h3>\n ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n <section>\n <h3>${i18next.t('figure.label.placement')}${this.help.button('figure.text.fastening-explained')}</h3>${this.help.hint('figure.text.fastening-explained')}\n ${this.renderPositions(asset)}\n ${canFasten(asset, this.partId) ? this.renderFastening(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n ${this.renderRow(asset)}\n `\n }\n\n /** Where things are held on this part: a seat things rest on, or a grip things are held in (parity row ⑤). */\n private renderPlaces(asset: V3Asset) {\n const faces = placeFacesOf(asset, this.partId)\n const p = this.place\n const face = faces.includes(p.face) ? p.face : faces[0]!\n const accepts = acceptsOf(p.accepts)\n const capacityOk = Number.isSafeInteger(p.capacity) && p.capacity >= 1\n const roleName = (role: string) => i18next.t('figure.label.place-' + role)\n return html`\n ${placesOn(asset, this.partId).map(\n one => html`<div pair>\n <span>\n <b bound>${one.label}</b>\n <small>${roleName(one.role)} · ${one.face ? i18next.t('figure.label.face-' + one.face) : ''} · ${one.accepts.join(', ')} · ${i18next.t('figure.label.place-holds', { count: one.capacity })}</small>\n </span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'remove-binding', id: one.id })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-place')}\n </button>\n </div>`\n )}\n ${holdsThings(asset)\n ? nothing\n : html`<p hint>${i18next.t('figure.text.place-needs-holding')}</p>\n <button act ?disabled=${this.locked} @click=${() => this.declareHolding(asset)}>\n <md-icon>inventory_2</md-icon>${i18next.t('figure.button.declare-holding')}\n </button>`}\n <div pair>\n <select @change=${(e: Event) => (this.place = { ...p, role: (e.target as HTMLSelectElement).value as 'seat' | 'grip' })}>\n <option value=\"grip\" ?selected=${p.role === 'grip'}>${roleName('grip')}</option>\n <option value=\"seat\" ?selected=${p.role === 'seat'}>${roleName('seat')}</option>\n </select>\n <select @change=${(e: Event) => (this.place = { ...p, face: (e.target as HTMLSelectElement).value as V3Face })}>\n ${faces.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div form>\n <span>${i18next.t('figure.label.place-name')}</span>\n <input .value=${p.label} placeholder=${roleName(p.role)} @change=${(e: Event) => (this.place = { ...p, label: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-accepts')}</span>\n <input .value=${p.accepts} placeholder=\"BOX, TOTE\" @input=${(e: Event) => (this.place = { ...p, accepts: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-capacity')}</span>\n <input type=\"number\" min=\"1\" step=\"1\" .value=${String(p.capacity)} @change=${(e: Event) => (this.place = { ...p, capacity: (e.target as HTMLInputElement).valueAsNumber })} />\n </div>\n ${accepts.length ? nothing : html`<small>${i18next.t('figure.text.place-accepts-needed')}</small>`}\n <button\n act\n ?disabled=${this.locked || !accepts.length || !capacityOk}\n @click=${() =>\n this.command({\n kind: 'add-binding',\n id: placeIdFor(asset, this.partId, p.role),\n label: p.label.trim() || roleName(p.role),\n role: p.role,\n part: this.partId,\n face,\n accepts,\n capacity: p.capacity\n })}\n >\n <md-icon>back_hand</md-icon>${i18next.t('figure.button.add-place')}\n </button>\n `\n }\n\n /** The figure holds things: `Capacity` and `Holdable`, the ladder's middle rung. One part edit, one undo step. */\n private declareHolding(asset: V3Asset) {\n const names = [...new Set([...(asset.document.capabilities.names ?? []), 'Capacity', 'Holdable'])]\n this.dispatchEvent(new CustomEvent('v3-part-edit', { detail: { edit: { kind: 'set-capabilities', names } }, bubbles: true, composed: true }))\n }\n\n private renderDimensions(asset: V3Asset) {\n const others = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFollow(asset, one))\n const round = followableAxes(asset, this.partId).length === 2\n return followableAxes(asset, this.partId).map(axis => {\n const now = followOf(asset, this.partId, axis)\n const value = choiceOf(now)\n /* A cylinder's two measures are its radius and its length; its X and Y name them. */\n const name = round ? i18next.t(axis === 'x' ? 'figure.label.field-radius' : 'figure.label.field-length') : axis.toUpperCase()\n return html`<div row>\n <b>${name}</b>\n <select ?disabled=${this.locked} @change=${(e: Event) => this.follow(asset, axis, (e.target as HTMLSelectElement).value, now)}>\n <option value=\"own\" ?selected=${value === 'own'}>${i18next.t('figure.label.follows-nothing')}</option>\n ${AXES.filter(one => hasInstanceSize(asset, one)).map(\n one => html`<option value=${`share:${one}`} ?selected=${value === `share:${one}`}>\n ${i18next.t('figure.label.follows-instance-share')} · ${one.toUpperCase()}\n </option>\n <option value=${`instance:${one}`} ?selected=${value === `instance:${one}`}>\n ${i18next.t('figure.label.follows-instance')} · ${one.toUpperCase()}\n </option>`\n )}\n ${others.flatMap(other =>\n AXES.map(\n one => html`<option value=${`part:${other}:${one}`} ?selected=${value === `part:${other}:${one}`}>${other} · ${one.toUpperCase()}</option>`\n )\n )}\n ${now.of === 'expression' || now.of === 'input'\n ? html`<option value=${value} selected>${now.of === 'input' ? now.input : i18next.t('figure.label.follows-expression')}</option>`\n : nothing}\n </select>\n ${now.of === 'instance' || now.of === 'part'\n ? html`<span></span>\n <label inline-plus>\n ${i18next.t('figure.label.follows-plus')}\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.plus ?? 0)}\n @change=${(e: Event) => this.followPlus(axis, now, Number((e.target as HTMLInputElement).value) || 0)}\n />\n </label>`\n : nothing}\n </div>`\n })\n }\n\n /** The same source, the same share, a new difference: a leaf the opening less its gaps (link-dimension's `plus`). */\n private followPlus(axis: Axis, now: Follow, plus: number) {\n if (now.of !== 'instance' && now.of !== 'part') return\n if ((now.plus ?? 0) === plus) return\n const source: V3DimensionSource = now.of === 'instance' ? { of: 'instance', axis: now.axis } : { of: 'part', part: now.part, axis: now.axis }\n const times = now.of === 'instance' ? now.times : (now.times ?? 1)\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, ...(times !== 1 ? { times } : {}), ...(plus ? { plus } : {}), replace: true })\n }\n\n private follow(asset: V3Asset, axis: Axis, choice: string, now: Follow) {\n const following = now.of !== 'own'\n /* The measure as it stands: a dimension stops following at it, and a share is taken of it. */\n const current = dimensionNow(asset, this.partId, axis) ?? this.dims?.[AXES.indexOf(axis)] ?? 100\n if (choice === 'own') {\n if (!following) return\n this.command({ kind: 'unlink-dimension', part: this.partId, axis, mm: Math.max(1, Math.round(current)) })\n return\n }\n const [of, a, b] = choice.split(':')\n if (of === 'share') {\n /* V2's proportional rule: this measure is the share of the instance size it is now, so it grows with the figure. */\n const size = asset.designInputs[`size.${a}`]\n if (!size) return\n const times = Math.round((current / size) * 1e6) / 1e6\n this.command({ kind: 'link-dimension', part: this.partId, axis, source: { of: 'instance', axis: a as Axis }, times, replace: following })\n return\n }\n const source: V3DimensionSource = of === 'instance' ? { of: 'instance', axis: a as Axis } : { of: 'part', part: a!, axis: b as Axis }\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, replace: following })\n }\n\n /**\n * Positions worked out from other values — V2's anchor rules, as the converter wrote them — each with the way to\n * keep it where it is. This is the way out the release gate names when a resize leaves a part in the air.\n */\n private renderPositions(asset: V3Asset) {\n return positionsWorkedOut(asset, this.partId).map(\n axis => html`<div pair>\n <span>${axis.toUpperCase()} · ${i18next.t(positionIsShare(asset, this.partId, axis) ? 'figure.label.position-in-proportion' : 'figure.label.position-worked-out')}</span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'fix-position', part: this.partId, axis })}>\n <md-icon>push_pin</md-icon>${i18next.t('figure.button.fix-position')}\n </button>\n ${hasInstanceSize(asset, axis) && !positionIsShare(asset, this.partId, axis)\n ? html`<button act ?disabled=${this.locked} title=${i18next.t('figure.text.scale-position-explained')} @click=${() => this.command({ kind: 'scale-position', part: this.partId, axis })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.scale-position')}\n </button>`\n : nothing}\n </div>`\n )\n }\n\n private renderFastening(asset: V3Asset) {\n const to = fastenedTo(asset, this.partId)\n const f = this.fasten\n const targets = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFasten(asset, one))\n /* The faces are the ones each shape declares: a part is fastened by one of its outer faces, to any face of the target. */\n const mineFaces = facesOf(asset, this.partId).filter(face => FACES.includes(face as V3Face))\n const myFace = mineFaces.includes(f.face) ? f.face : (mineFaces[0] as V3Face)\n const theirFaces = f.target ? facesOf(asset, f.target) : FACES\n const targetFace = theirFaces.includes(f.targetFace) ? f.targetFace : theirFaces[0]!\n const aim = f.toPlane ? ('plane' as const) : { part: f.target, face: targetFace }\n const align = f.target || f.toPlane ? alignOf(asset, this.partId, aim, f.align, f.alignMm, !!f.twist) : undefined\n return html`\n ${to\n ? html`<div pair>\n <span>${i18next.t('figure.label.fastened-to')}: <b bound>${to}</b></span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>\n <md-icon>link_off</md-icon>${i18next.t('figure.button.detach')}\n </button>\n </div>`\n : nothing}\n <div form>\n <span>${i18next.t('figure.label.my-face')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, face: (e.target as HTMLSelectElement).value as V3Face })}>\n ${mineFaces.map(face => html`<option value=${face} ?selected=${face === myFace}>${i18next.t('figure.label.face-' + face)}</option>`)}\n </select>\n </div>\n <label toggle>\n <input type=\"checkbox\" .checked=${f.toPlane} @change=${(e: Event) => (this.fasten = { ...f, toPlane: (e.target as HTMLInputElement).checked })} />\n ${i18next.t('figure.label.stands-on-plane')}\n </label>\n ${f.toPlane\n ? nothing\n : html`<div form>\n <span>${i18next.t('figure.label.target-part')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, target: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!f.target}>—</option>\n ${targets.map(one => html`<option value=${one} ?selected=${one === f.target}>${one}</option>`)}\n </select>\n <span>${i18next.t('figure.label.target-face')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, targetFace: (e.target as HTMLSelectElement).value as V3Face })}>\n ${theirFaces.map(face => html`<option value=${face} ?selected=${face === targetFace}>${i18next.t('figure.label.face-' + face)}</option>`)}\n </select>\n <span>${i18next.t('figure.label.facing-meet')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, facing: (e.target as HTMLSelectElement).value as 'meet' | 'flush' })}>\n <option value=\"meet\" ?selected=${f.facing === 'meet'}>${i18next.t('figure.label.facing-meet')}</option>\n <option value=\"flush\" ?selected=${f.facing === 'flush'}>${i18next.t('figure.label.facing-flush')}</option>\n </select>\n </div>`}\n ${this.renderAlignment(f.toPlane || f.target ? alignAxesOf(asset, this.partId, aim, !!f.twist) : [])}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input type=\"number\" step=\"any\" .value=${String(f.gap)} @change=${(e: Event) => (this.fasten = { ...f, gap: Number((e.target as HTMLInputElement).value) || 0 })} />\n <span>${i18next.t('figure.label.twist')}</span>\n <input type=\"number\" step=\"any\" .value=${String(f.twist)} @change=${(e: Event) => (this.fasten = { ...f, twist: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>\n <button\n act\n ?disabled=${this.locked || (!f.toPlane && !f.target)}\n @click=${() =>\n this.command({\n kind: 'attach',\n part: this.partId,\n face: myFace,\n to: f.toPlane ? { plane: 'mounting-plane' } : { part: f.target, face: targetFace },\n ...(f.toPlane ? {} : { facing: f.facing }),\n ...(f.gap ? { gap: f.gap } : {}),\n twist: f.twist,\n ...(align ? { align } : {}),\n replace: !!to\n } as V3AuthoringAction)}\n >\n <md-icon>link</md-icon>${i18next.t('figure.button.fasten')}\n </button>\n `\n }\n\n /**\n * Where on the target face the part sits, on the two axes across it: centred, level with the target's edge on\n * either side, or a distance off centre. A door hung level with the frame's front edge turns about that edge.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.fasten\n const set = (axis: Axis, how: Alignment) => (this.fasten = { ...f, align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => (this.fasten = { ...f, alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how = f.align[axis] === 'min' || f.align[axis] === 'max' ? (edges ? f.align[axis]! : 'centre') : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>${i18next.t(`figure.label.align-${axis}-min`)}</option>\n <option value=\"max\" ?selected=${how === 'max'}>${i18next.t(`figure.label.align-${axis}-max`)}</option>`\n : nothing}\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${this.asset && hasInstanceSize(this.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>${i18next.t('figure.label.align-share')}</option>`\n : nothing}\n </select>\n ${how === 'mm' || how === 'share'\n ? html`<span></span><input type=\"number\" step=\"any\" aria-label=${i18next.t('figure.label.align-mm')} .value=${String(f.alignMm[axis] ?? 0)} @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)} />`\n : nothing}`\n })}\n </div>`\n }\n\n /**\n * Making the part a row across what it is fastened to (figure-model `make-repeat`): along one of the axes across its\n * face, copies a pitch apart filling the parent's length, or a count spread over it. Once made, the row's own section\n * (the editor's) shows it and takes it away.\n */\n private renderRow(asset: V3Asset) {\n const axes = rowAxesOf(asset, this.partId)\n if (!axes.length) return nothing\n const r = this.row\n const axis = axes.includes(r.axis as Axis) ? (r.axis as Axis) : axes[0]!\n const ok = r.pitch > 0 && (r.fills || (Number.isSafeInteger(r.count) && r.count >= 1))\n return html`<section>\n <h3>${i18next.t('figure.label.repeat')}</h3>\n <div form>\n <span>${i18next.t('figure.label.repeat-axis')}</span>\n <select @change=${(e: Event) => (this.row = { ...r, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${axes.map(a => html`<option value=${a} ?selected=${a === axis}>${a.toUpperCase()}</option>`)}\n </select>\n <span>${i18next.t('figure.label.repeat-pitch')} (mm)</span>\n <input type=\"number\" step=\"any\" min=\"0\" .value=${String(r.pitch)} @change=${(e: Event) => (this.row = { ...r, pitch: Number((e.target as HTMLInputElement).value) })} />\n </div>\n <label toggle>\n <input type=\"checkbox\" .checked=${r.fills} @change=${(e: Event) => (this.row = { ...r, fills: (e.target as HTMLInputElement).checked })} />\n ${i18next.t('figure.label.repeat-fills')}\n </label>\n ${r.fills\n ? nothing\n : html`<div form>\n <span>${i18next.t('figure.label.repeat-count')}</span>\n <input type=\"number\" step=\"1\" min=\"1\" .value=${String(r.count)} @change=${(e: Event) => (this.row = { ...r, count: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n <button\n act\n ?disabled=${this.locked || !ok}\n @click=${() => this.command({ kind: 'make-repeat', part: this.partId, axis, pitch: r.pitch, ...(r.fills ? {} : { count: r.count }) } as V3AuthoringAction)}\n >\n <md-icon>view_week</md-icon>${i18next.t('figure.button.make-repeat')}\n </button>\n </section>`\n }\n\n private renderMotion(asset: V3Asset) {\n const now = motionOf(asset, this.partId)\n const joint = asset.joints?.find(j => j.body1.part === this.partId)\n if (now) {\n return html`<div pair>\n <span>\n ${i18next.t('figure.label.motion-' + now.kind)} · ${String(now.axis).toUpperCase()}\n ${now.travel\n ? html`<small>${i18next.t('figure.label.motion-travel-is', { part: now.travel.part, axis: now.travel.axis.toUpperCase(), plus: now.travel.plus ?? 0 })}</small>`\n : nothing}\n ${now.follows\n ? html`<small>${i18next.t('figure.label.motion-follows', { joint: now.follows.joint, multiplier: now.follows.multiplier, offset: now.follows.offset ?? 0 })}</small>`\n : now.control\n ? html`<small>${now.control.id} (${now.control.unit}) ${now.control.min} … ${now.control.max}</small>`\n : nothing}\n </span>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => joint && this.command({ kind: 'set-joint', joint: { id: joint.id, type: 'fixed', body0: joint.body0, body1: joint.body1, ...(joint.origin ? { origin: joint.origin } : {}) } })}\n >\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}\n </button>\n </div>`\n }\n /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */\n if (!joint) return html`<p hint>${i18next.t('figure.text.fasten-before-moving')}</p>`\n const m = this.motion\n const unit = m.kind === 'slide' ? 'mm' : 'deg'\n /* A follower follows a joint that moves the same way; a choice the kind no longer allows is dropped. */\n const leaders = leadersFor(asset, this.partId, m.kind)\n const follow = leaders.some(j => j.id === m.follow) ? m.follow : ''\n return html`\n <div pair>\n <select @change=${(e: Event) => this.setKind((e.target as HTMLSelectElement).value as 'slide' | 'turn' | 'continuous')}>\n <option value=\"slide\" ?selected=${m.kind === 'slide'}>${i18next.t('figure.label.motion-slide')}</option>\n <option value=\"turn\" ?selected=${m.kind === 'turn'}>${i18next.t('figure.label.motion-turn')}</option>\n <option value=\"continuous\" ?selected=${m.kind === 'continuous'}>${i18next.t('figure.label.motion-continuous')}</option>\n </select>\n <select @change=${(e: Event) => (this.motion = { ...m, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${AXES.map(a => html`<option value=${a} ?selected=${a === m.axis}>${i18next.t('figure.label.motion-axis')} ${a.toUpperCase()}</option>`)}\n </select>\n </div>\n ${leaders.length\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, follow: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!follow}>${i18next.t('figure.label.motion-own-control')}</option>\n ${leaders.map(j => html`<option value=${j.id} ?selected=${j.id === follow}>${j.body1.part}${j.state ? ` · ${j.state.id}` : ''}</option>`)}\n </select>\n </div>`\n : nothing}\n ${follow\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-multiplier')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.multiplier)} @change=${(e: Event) => (this.motion = { ...m, multiplier: Number((e.target as HTMLInputElement).value) })} />\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : html`<div form>\n ${m.kind === 'slide'\n ? html`<span>${i18next.t('figure.label.motion-travel')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, travel: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!m.travel}>${i18next.t('figure.label.motion-travel-mm')}</option>\n ${asset.appearance\n .map(look => look.target)\n .filter(one => canFollow(asset, one))\n .flatMap(one => AXES.map(a => html`<option value=${`${one}:${a}`} ?selected=${m.travel === `${one}:${a}`}>${one} · ${a.toUpperCase()}</option>`))}\n </select>\n ${m.travel\n ? html`<span>${i18next.t('figure.label.follows-plus')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.travelPlus ?? 0)} @change=${(e: Event) => (this.motion = { ...m, travelPlus: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}`\n : nothing}\n <span>${i18next.t('figure.label.control-id')}</span>\n <input .value=${m.id} placeholder=${`${this.partId}-${m.kind}`} @change=${(e: Event) => (this.motion = { ...m, id: (e.target as HTMLInputElement).value.trim() })} />\n ${m.kind === 'continuous' || (m.kind === 'slide' && m.travel)\n ? nothing\n : html`<span>${i18next.t('figure.label.control-range')} (${unit})</span>\n <div pair>\n <input type=\"number\" step=\"any\" .value=${String(m.min)} @change=${(e: Event) => (this.motion = { ...m, min: Number((e.target as HTMLInputElement).value) })} />\n <input type=\"number\" step=\"any\" .value=${String(m.max)} @change=${(e: Event) => (this.motion = { ...m, max: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n </div>`}\n <button\n act\n ?disabled=${this.locked || (follow ? !(Number.isFinite(m.multiplier) && m.multiplier !== 0) : m.kind !== 'continuous' && !(m.kind === 'slide' && m.travel) && !(m.max > m.min && m.min <= 0 && 0 <= m.max))}\n title=${!follow && m.kind !== 'continuous' && !(m.min <= 0 && 0 <= m.max) ? i18next.t('figure.text.joint-range-holds-zero') : ''}\n @click=${() => this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })}\n >\n <md-icon>animation</md-icon>${i18next.t('figure.button.add-motion')}\n </button>\n `\n }\n\n private setKind(kind: 'slide' | 'turn' | 'continuous') {\n this.motion = kind === 'slide' ? { ...this.motion, kind, min: 0, max: 500 } : { ...this.motion, kind, min: -90, max: 90 }\n }\n\n private command(action: V3AuthoringAction) {\n this.dispatchEvent(new CustomEvent('v3-command', { detail: { action }, bubbles: true, composed: true }))\n }\n}\n\n"]}
1
+ {"version":3,"file":"figure-v3-links.js","sourceRoot":"","sources":["../../client/modeller/figure-v3-links.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa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;AA9C3B,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAsgBzB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { V3_FACES } from '@hatiolab/figure-model'\nimport type { V3Asset, V3AuthoringAction, V3DimensionSource, V3Face } from '@hatiolab/figure-model'\n\nimport {\n acceptsOf,\n alignAxesOf,\n alignOf,\n AXES,\n canFasten,\n facesOf,\n canFollow,\n dimensionNow,\n followableAxes,\n positionIsShare,\n choiceOf,\n fastenedTo,\n heldBy,\n followOf,\n hasInstanceSize,\n holdsThings,\n leadersFor,\n motionOf,\n motionFormOf,\n motionJoint,\n placeFacesOf,\n placeIdFor,\n placesOn,\n rowAxesOf,\n positionsWorkedOut,\n type Alignment,\n type Axis,\n type Follow,\n type MotionForm\n} from './v3-links.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { HelpToggles } from './v3-help.js'\n\nconst FACES = Object.keys(V3_FACES) as V3Face[]\n\nconst freshFasten = () => ({\n face: 'bottom' as V3Face,\n toPlane: false,\n target: '',\n targetFace: 'top' as V3Face,\n facing: 'meet' as 'meet' | 'flush',\n gap: 0,\n twist: 0,\n align: {} as Partial<Record<Axis, Alignment>>,\n alignMm: {} as Partial<Record<Axis, number>>\n})\nconst freshMotion = (): MotionForm => ({ kind: 'slide', axis: 'x', id: '', min: 0, max: 500, follow: '', multiplier: 1, offset: 0, travel: '', travelPlus: 0 })\nconst freshRow = () => ({ axis: '' as Axis | '', pitch: 200, fills: true, count: 5 })\nconst freshPlace = () => ({ role: 'grip' as 'seat' | 'grip', face: 'top' as V3Face, label: '', accepts: '', capacity: 1 })\n\n/**\n * What a part is tied to — its size response, what it is fastened to, how it moves (parity rows ④ ⑤ ⑥).\n *\n * 「Build Once, Fit Anywhere」 lives here: a dimension that follows the instance size or another part is what lets\n * a figure be placed at any size, and a part fastened to the face it rests on is what keeps it there when that\n * happens. The release gate refuses a figure that falls apart when resized, and tells the author to fasten the\n * parts that come away — this is where they do it. Motion is the V2 joint: a slide or a turn driven by a control.\n *\n * The V2 inspector has these as its dimensions, placement and joint sections, in that order; so does this. Every\n * change is one figure-model authoring command, sent as `v3-command` and run by the editor through the session — one\n * step of the undo history. Choices the command would refuse (a round body fastened, a size following an instance\n * size the figure does not declare) are not offered, so the author is not sent into a refusal.\n */\n@customElement('figure-v3-links')\nexport class FigureV3Links extends localize(i18next)(LitElement) {\n private readonly help = new HelpToggles(this)\n static styles = [SidePanelStyles, css`\n :host {\n display: block;\n }\n /* The measure's name, then its rule: X, or a cylinder's 반지름 · 길이, on one line. */\n div[row] > b {\n white-space: nowrap;\n }\n div[row] {\n display: grid;\n grid-template-columns: minmax(24px, max-content) minmax(0, 1fr);\n gap: 6px;\n align-items: center;\n }\n b[bound] {\n font-weight: 600;\n }\n /* The difference a following measure keeps: under its choice, on the same line as its words. */\n label[inline-plus] {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n label[inline-plus] input {\n flex: 1;\n min-width: 0;\n }\n `]\n\n /** The asset being edited. */\n @property({ attribute: false }) asset?: V3Asset\n /** The selected part. */\n @property() partId = ''\n /** The part's own extent along its axes now, in mm — what a dimension is fixed at when it stops following. */\n @property({ attribute: false }) dims?: [number, number, number]\n @property({ type: Boolean }) locked = false\n /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */\n @property() section: 'shape' | 'places' | 'motion' = 'shape'\n\n @state() private fasten = freshFasten()\n @state() private motion: MotionForm = freshMotion()\n @state() private place = freshPlace()\n @state() private row = freshRow()\n /** The motion form is open over the part's own motion, to change it where it is. */\n @state() private editingMotion = false\n\n /*\n The forms describe the next command for the selected part, so another part starts from the defaults: carrying the\n last part's choices over fastened a shutter curtain level with a right edge nobody chose for it (2026-09-25).\n */\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('partId') && changed.get('partId') !== undefined) {\n this.fasten = freshFasten()\n this.motion = freshMotion()\n this.place = freshPlace()\n this.row = freshRow()\n this.editingMotion = false\n }\n }\n\n render() {\n const asset = this.asset\n if (!asset || !this.partId) return nothing\n if (this.section === 'motion')\n return html`<section><h3>${i18next.t('figure.label.motion')}${this.help.button('figure.text.motion-explained')}</h3>${this.help.hint('figure.text.motion-explained')}\n ${this.renderMotion(asset)}</section>`\n if (this.section === 'places')\n return html`<section><h3>${i18next.t('figure.label.places-on-part', { part: this.partId })}${this.help.button('figure.text.place-explained')}</h3>${this.help.hint('figure.text.place-explained')}\n ${placeFacesOf(asset, this.partId).length ? this.renderPlaces(asset) : html`<p hint>${i18next.t('figure.text.places-need-a-box')}</p>`}</section>`\n return html`\n <section>\n <h3>${i18next.t('figure.label.dimensions')}</h3>\n ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n <section>\n <h3>${i18next.t('figure.label.placement')}${this.help.button('figure.text.fastening-explained')}</h3>${this.help.hint('figure.text.fastening-explained')}\n ${this.renderPositions(asset)}\n ${canFasten(asset, this.partId) ? this.renderFastening(asset) : html`<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}\n </section>\n ${this.renderRow(asset)}\n `\n }\n\n /** Where things are held on this part: a seat things rest on, or a grip things are held in (parity row ⑤). */\n private renderPlaces(asset: V3Asset) {\n const faces = placeFacesOf(asset, this.partId)\n const p = this.place\n const face = faces.includes(p.face) ? p.face : faces[0]!\n const accepts = acceptsOf(p.accepts)\n const capacityOk = Number.isSafeInteger(p.capacity) && p.capacity >= 1\n const roleName = (role: string) => i18next.t('figure.label.place-' + role)\n return html`\n ${placesOn(asset, this.partId).map(\n one => html`<div pair>\n <span>\n <b bound>${one.label}</b>\n <small>${roleName(one.role)} · ${one.face ? i18next.t('figure.label.face-' + one.face) : ''} · ${one.accepts.join(', ')} · ${i18next.t('figure.label.place-holds', { count: one.capacity })}</small>\n </span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'remove-binding', id: one.id })}>\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-place')}\n </button>\n </div>`\n )}\n ${holdsThings(asset)\n ? nothing\n : html`<p hint>${i18next.t('figure.text.place-needs-holding')}</p>\n <button act ?disabled=${this.locked} @click=${() => this.declareHolding(asset)}>\n <md-icon>inventory_2</md-icon>${i18next.t('figure.button.declare-holding')}\n </button>`}\n <div pair>\n <select @change=${(e: Event) => (this.place = { ...p, role: (e.target as HTMLSelectElement).value as 'seat' | 'grip' })}>\n <option value=\"grip\" ?selected=${p.role === 'grip'}>${roleName('grip')}</option>\n <option value=\"seat\" ?selected=${p.role === 'seat'}>${roleName('seat')}</option>\n </select>\n <select @change=${(e: Event) => (this.place = { ...p, face: (e.target as HTMLSelectElement).value as V3Face })}>\n ${faces.map(one => html`<option value=${one} ?selected=${one === face}>${i18next.t('figure.label.face-' + one)}</option>`)}\n </select>\n </div>\n <div form>\n <span>${i18next.t('figure.label.place-name')}</span>\n <input .value=${p.label} placeholder=${roleName(p.role)} @change=${(e: Event) => (this.place = { ...p, label: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-accepts')}</span>\n <input .value=${p.accepts} placeholder=\"BOX, TOTE\" @input=${(e: Event) => (this.place = { ...p, accepts: (e.target as HTMLInputElement).value })} />\n <span>${i18next.t('figure.label.place-capacity')}</span>\n <input type=\"number\" min=\"1\" step=\"1\" .value=${String(p.capacity)} @change=${(e: Event) => (this.place = { ...p, capacity: (e.target as HTMLInputElement).valueAsNumber })} />\n </div>\n ${accepts.length ? nothing : html`<small>${i18next.t('figure.text.place-accepts-needed')}</small>`}\n <button\n act\n ?disabled=${this.locked || !accepts.length || !capacityOk}\n @click=${() =>\n this.command({\n kind: 'add-binding',\n id: placeIdFor(asset, this.partId, p.role),\n label: p.label.trim() || roleName(p.role),\n role: p.role,\n part: this.partId,\n face,\n accepts,\n capacity: p.capacity\n })}\n >\n <md-icon>back_hand</md-icon>${i18next.t('figure.button.add-place')}\n </button>\n `\n }\n\n /** The figure holds things: `Capacity` and `Holdable`, the ladder's middle rung. One part edit, one undo step. */\n private declareHolding(asset: V3Asset) {\n const names = [...new Set([...(asset.document.capabilities.names ?? []), 'Capacity', 'Holdable'])]\n this.dispatchEvent(new CustomEvent('v3-part-edit', { detail: { edit: { kind: 'set-capabilities', names } }, bubbles: true, composed: true }))\n }\n\n private renderDimensions(asset: V3Asset) {\n const others = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFollow(asset, one))\n const round = followableAxes(asset, this.partId).length === 2\n return followableAxes(asset, this.partId).map(axis => {\n const now = followOf(asset, this.partId, axis)\n const value = choiceOf(now)\n /* A cylinder's two measures are its radius and its length; its X and Y name them. */\n const name = round ? i18next.t(axis === 'x' ? 'figure.label.field-radius' : 'figure.label.field-length') : axis.toUpperCase()\n return html`<div row>\n <b>${name}</b>\n <select ?disabled=${this.locked} @change=${(e: Event) => this.follow(asset, axis, (e.target as HTMLSelectElement).value, now)}>\n <option value=\"own\" ?selected=${value === 'own'}>${i18next.t('figure.label.follows-nothing')}</option>\n ${AXES.filter(one => hasInstanceSize(asset, one)).map(\n one => html`<option value=${`share:${one}`} ?selected=${value === `share:${one}`}>\n ${i18next.t('figure.label.follows-instance-share')} · ${one.toUpperCase()}\n </option>\n <option value=${`instance:${one}`} ?selected=${value === `instance:${one}`}>\n ${i18next.t('figure.label.follows-instance')} · ${one.toUpperCase()}\n </option>`\n )}\n ${others.flatMap(other =>\n AXES.map(\n one => html`<option value=${`part:${other}:${one}`} ?selected=${value === `part:${other}:${one}`}>${other} · ${one.toUpperCase()}</option>`\n )\n )}\n ${now.of === 'expression' || now.of === 'input'\n ? html`<option value=${value} selected>${now.of === 'input' ? now.input : i18next.t('figure.label.follows-expression')}</option>`\n : nothing}\n </select>\n ${now.of === 'instance' || now.of === 'part'\n ? html`<span></span>\n <label inline-plus>\n ${i18next.t('figure.label.follows-plus')}\n <input\n type=\"number\"\n step=\"any\"\n ?disabled=${this.locked}\n .value=${String(now.plus ?? 0)}\n @change=${(e: Event) => this.followPlus(axis, now, Number((e.target as HTMLInputElement).value) || 0)}\n />\n </label>`\n : nothing}\n </div>`\n })\n }\n\n /** The same source, the same share, a new difference: a leaf the opening less its gaps (link-dimension's `plus`). */\n private followPlus(axis: Axis, now: Follow, plus: number) {\n if (now.of !== 'instance' && now.of !== 'part') return\n if ((now.plus ?? 0) === plus) return\n const source: V3DimensionSource = now.of === 'instance' ? { of: 'instance', axis: now.axis } : { of: 'part', part: now.part, axis: now.axis }\n const times = now.of === 'instance' ? now.times : (now.times ?? 1)\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, ...(times !== 1 ? { times } : {}), ...(plus ? { plus } : {}), replace: true })\n }\n\n private follow(asset: V3Asset, axis: Axis, choice: string, now: Follow) {\n const following = now.of !== 'own'\n /* The measure as it stands: a dimension stops following at it, and a share is taken of it. */\n const current = dimensionNow(asset, this.partId, axis) ?? this.dims?.[AXES.indexOf(axis)] ?? 100\n if (choice === 'own') {\n if (!following) return\n this.command({ kind: 'unlink-dimension', part: this.partId, axis, mm: Math.max(1, Math.round(current)) })\n return\n }\n const [of, a, b] = choice.split(':')\n if (of === 'share') {\n /* V2's proportional rule: this measure is the share of the instance size it is now, so it grows with the figure. */\n const size = asset.designInputs[`size.${a}`]\n if (!size) return\n const times = Math.round((current / size) * 1e6) / 1e6\n this.command({ kind: 'link-dimension', part: this.partId, axis, source: { of: 'instance', axis: a as Axis }, times, replace: following })\n return\n }\n const source: V3DimensionSource = of === 'instance' ? { of: 'instance', axis: a as Axis } : { of: 'part', part: a!, axis: b as Axis }\n this.command({ kind: 'link-dimension', part: this.partId, axis, source, replace: following })\n }\n\n /**\n * Positions worked out from other values — V2's anchor rules, as the converter wrote them — each with the way to\n * keep it where it is. This is the way out the release gate names when a resize leaves a part in the air.\n */\n private renderPositions(asset: V3Asset) {\n return positionsWorkedOut(asset, this.partId).map(\n axis => html`<div pair>\n <span>${axis.toUpperCase()} · ${i18next.t(positionIsShare(asset, this.partId, axis) ? 'figure.label.position-in-proportion' : 'figure.label.position-worked-out')}</span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'fix-position', part: this.partId, axis })}>\n <md-icon>push_pin</md-icon>${i18next.t('figure.button.fix-position')}\n </button>\n ${hasInstanceSize(asset, axis) && !positionIsShare(asset, this.partId, axis)\n ? html`<button act ?disabled=${this.locked} title=${i18next.t('figure.text.scale-position-explained')} @click=${() => this.command({ kind: 'scale-position', part: this.partId, axis })}>\n <md-icon>open_in_full</md-icon>${i18next.t('figure.button.scale-position')}\n </button>`\n : nothing}\n </div>`\n )\n }\n\n private renderFastening(asset: V3Asset) {\n const held = heldBy(asset, this.partId)\n const f = this.fasten\n const targets = asset.appearance.map(look => look.target).filter(one => one !== this.partId && canFasten(asset, one))\n /* The faces are the ones each shape declares: a part is fastened by one of its outer faces, to any face of the target. */\n const mineFaces = facesOf(asset, this.partId).filter(face => FACES.includes(face as V3Face))\n const myFace = mineFaces.includes(f.face) ? f.face : (mineFaces[0] as V3Face)\n const theirFaces = f.target ? facesOf(asset, f.target) : FACES\n const targetFace = theirFaces.includes(f.targetFace) ? f.targetFace : theirFaces[0]!\n const aim = f.toPlane ? ('plane' as const) : { part: f.target, face: targetFace }\n const align = f.target || f.toPlane ? alignOf(asset, this.partId, aim, f.align, f.alignMm, !!f.twist) : undefined\n return html`\n ${held\n ? html`<div pair>\n <span>${i18next.t('figure.label.fastened-to')}: <b bound>${'plane' in held ? i18next.t('figure.label.mounting-plane') : held.part}</b></span>\n <button act ?disabled=${this.locked} @click=${() => this.command({ kind: 'detach', part: this.partId })}>\n <md-icon>link_off</md-icon>${i18next.t('figure.button.detach')}\n </button>\n </div>`\n : nothing}\n <div form>\n <span>${i18next.t('figure.label.my-face')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, face: (e.target as HTMLSelectElement).value as V3Face })}>\n ${mineFaces.map(face => html`<option value=${face} ?selected=${face === myFace}>${i18next.t('figure.label.face-' + face)}</option>`)}\n </select>\n </div>\n <label toggle>\n <input type=\"checkbox\" .checked=${f.toPlane} @change=${(e: Event) => (this.fasten = { ...f, toPlane: (e.target as HTMLInputElement).checked })} />\n ${i18next.t('figure.label.stands-on-plane')}\n </label>\n ${f.toPlane\n ? nothing\n : html`<div form>\n <span>${i18next.t('figure.label.target-part')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, target: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!f.target}>—</option>\n ${targets.map(one => html`<option value=${one} ?selected=${one === f.target}>${one}</option>`)}\n </select>\n <span>${i18next.t('figure.label.target-face')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, targetFace: (e.target as HTMLSelectElement).value as V3Face })}>\n ${theirFaces.map(face => html`<option value=${face} ?selected=${face === targetFace}>${i18next.t('figure.label.face-' + face)}</option>`)}\n </select>\n <span>${i18next.t('figure.label.facing-meet')}</span>\n <select @change=${(e: Event) => (this.fasten = { ...f, facing: (e.target as HTMLSelectElement).value as 'meet' | 'flush' })}>\n <option value=\"meet\" ?selected=${f.facing === 'meet'}>${i18next.t('figure.label.facing-meet')}</option>\n <option value=\"flush\" ?selected=${f.facing === 'flush'}>${i18next.t('figure.label.facing-flush')}</option>\n </select>\n </div>`}\n ${this.renderAlignment(f.toPlane || f.target ? alignAxesOf(asset, this.partId, aim, !!f.twist) : [])}\n <div form>\n <span>${i18next.t('figure.label.gap')}</span>\n <input type=\"number\" step=\"any\" .value=${String(f.gap)} @change=${(e: Event) => (this.fasten = { ...f, gap: Number((e.target as HTMLInputElement).value) || 0 })} />\n <span>${i18next.t('figure.label.twist')}</span>\n <input type=\"number\" step=\"any\" .value=${String(f.twist)} @change=${(e: Event) => (this.fasten = { ...f, twist: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>\n <button\n act\n ?disabled=${this.locked || (!f.toPlane && !f.target)}\n @click=${() =>\n this.command({\n kind: 'attach',\n part: this.partId,\n face: myFace,\n to: f.toPlane ? { plane: 'mounting-plane' } : { part: f.target, face: targetFace },\n ...(f.toPlane ? {} : { facing: f.facing }),\n ...(f.gap ? { gap: f.gap } : {}),\n twist: f.twist,\n ...(align ? { align } : {}),\n replace: !!held\n } as V3AuthoringAction)}\n >\n <md-icon>link</md-icon>${i18next.t('figure.button.fasten')}\n </button>\n `\n }\n\n /**\n * Where on the target face the part sits, on the two axes across it: centred, level with the target's edge on\n * either side, or a distance off centre. A door hung level with the frame's front edge turns about that edge.\n */\n private renderAlignment(axes: { axis: Axis; edges: boolean }[]) {\n const f = this.fasten\n const set = (axis: Axis, how: Alignment) => (this.fasten = { ...f, align: { ...f.align, [axis]: how } })\n const setMm = (axis: Axis, mm: number) => (this.fasten = { ...f, alignMm: { ...f.alignMm, [axis]: mm } })\n return html`<div form>\n ${axes.map(({ axis, edges }) => {\n const how = f.align[axis] === 'min' || f.align[axis] === 'max' ? (edges ? f.align[axis]! : 'centre') : (f.align[axis] ?? 'centre')\n return html`<span>${i18next.t('figure.label.align-' + axis)}</span>\n <select @change=${(e: Event) => set(axis, (e.target as HTMLSelectElement).value as Alignment)}>\n <option value=\"centre\" ?selected=${how === 'centre'}>${i18next.t('figure.label.align-centre')}</option>\n ${edges\n ? html`<option value=\"min\" ?selected=${how === 'min'}>${i18next.t(`figure.label.align-${axis}-min`)}</option>\n <option value=\"max\" ?selected=${how === 'max'}>${i18next.t(`figure.label.align-${axis}-max`)}</option>`\n : nothing}\n <option value=\"mm\" ?selected=${how === 'mm'}>${i18next.t('figure.label.align-mm')}</option>\n ${this.asset && hasInstanceSize(this.asset, axis)\n ? html`<option value=\"share\" ?selected=${how === 'share'}>${i18next.t('figure.label.align-share')}</option>`\n : nothing}\n </select>\n ${how === 'mm' || how === 'share'\n ? html`<span></span><input type=\"number\" step=\"any\" aria-label=${i18next.t('figure.label.align-mm')} .value=${String(f.alignMm[axis] ?? 0)} @change=${(e: Event) => setMm(axis, Number((e.target as HTMLInputElement).value) || 0)} />`\n : nothing}`\n })}\n </div>`\n }\n\n /**\n * Making the part a row across what it is fastened to (figure-model `make-repeat`): along one of the axes across its\n * face, copies a pitch apart filling the parent's length, or a count spread over it. Once made, the row's own section\n * (the editor's) shows it and takes it away.\n */\n private renderRow(asset: V3Asset) {\n const axes = rowAxesOf(asset, this.partId)\n if (!axes.length) return nothing\n const r = this.row\n const axis = axes.includes(r.axis as Axis) ? (r.axis as Axis) : axes[0]!\n const ok = r.pitch > 0 && (r.fills || (Number.isSafeInteger(r.count) && r.count >= 1))\n return html`<section>\n <h3>${i18next.t('figure.label.repeat')}</h3>\n <div form>\n <span>${i18next.t('figure.label.repeat-axis')}</span>\n <select @change=${(e: Event) => (this.row = { ...r, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${axes.map(a => html`<option value=${a} ?selected=${a === axis}>${a.toUpperCase()}</option>`)}\n </select>\n <span>${i18next.t('figure.label.repeat-pitch')} (mm)</span>\n <input type=\"number\" step=\"any\" min=\"0\" .value=${String(r.pitch)} @change=${(e: Event) => (this.row = { ...r, pitch: Number((e.target as HTMLInputElement).value) })} />\n </div>\n <label toggle>\n <input type=\"checkbox\" .checked=${r.fills} @change=${(e: Event) => (this.row = { ...r, fills: (e.target as HTMLInputElement).checked })} />\n ${i18next.t('figure.label.repeat-fills')}\n </label>\n ${r.fills\n ? nothing\n : html`<div form>\n <span>${i18next.t('figure.label.repeat-count')}</span>\n <input type=\"number\" step=\"1\" min=\"1\" .value=${String(r.count)} @change=${(e: Event) => (this.row = { ...r, count: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n <button\n act\n ?disabled=${this.locked || !ok}\n @click=${() => this.command({ kind: 'make-repeat', part: this.partId, axis, pitch: r.pitch, ...(r.fills ? {} : { count: r.count }) } as V3AuthoringAction)}\n >\n <md-icon>view_week</md-icon>${i18next.t('figure.button.make-repeat')}\n </button>\n </section>`\n }\n\n private renderMotion(asset: V3Asset) {\n const now = motionOf(asset, this.partId)\n const joint = asset.joints?.find(j => j.body1.part === this.partId)\n if (now && !(this.editingMotion && joint)) {\n return html`<div pair>\n <span>\n ${i18next.t('figure.label.motion-' + now.kind)} · ${String(now.axis).toUpperCase()}\n ${now.travel\n ? html`<small>${i18next.t('figure.label.motion-travel-is', { part: now.travel.part, axis: now.travel.axis.toUpperCase(), plus: now.travel.plus ?? 0 })}</small>`\n : nothing}\n ${now.follows\n ? html`<small>${i18next.t('figure.label.motion-follows', { joint: now.follows.joint, multiplier: now.follows.multiplier, offset: now.follows.offset ?? 0 })}</small>`\n : now.control\n ? html`<small>${now.control.id} (${now.control.unit}) ${now.control.min} … ${now.control.max}</small>`\n : nothing}\n </span>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => joint && this.command({ kind: 'set-joint', joint: { id: joint.id, type: 'fixed', body0: joint.body0, body1: joint.body1, ...(joint.origin ? { origin: joint.origin } : {}) } })}\n >\n <md-icon>close</md-icon>${i18next.t('figure.button.remove-motion')}\n </button>\n <button\n act\n ?disabled=${this.locked || !joint}\n @click=${() => {\n if (!joint) return\n this.motion = motionFormOf(joint)\n this.editingMotion = true\n }}\n >\n <md-icon>edit</md-icon>${i18next.t('figure.button.change-motion')}\n </button>\n </div>`\n }\n /* A joint needs a parent (URDF): a part fastened to nothing is fastened first. */\n if (!joint) return html`<p hint>${i18next.t('figure.text.fasten-before-moving')}</p>`\n const m = this.motion\n const unit = m.kind === 'slide' ? 'mm' : 'deg'\n /* A follower follows a joint that moves the same way; a choice the kind no longer allows is dropped. */\n const leaders = leadersFor(asset, this.partId, m.kind)\n const follow = leaders.some(j => j.id === m.follow) ? m.follow : ''\n return html`\n <div pair>\n <select @change=${(e: Event) => this.setKind((e.target as HTMLSelectElement).value as 'slide' | 'turn' | 'continuous')}>\n <option value=\"slide\" ?selected=${m.kind === 'slide'}>${i18next.t('figure.label.motion-slide')}</option>\n <option value=\"turn\" ?selected=${m.kind === 'turn'}>${i18next.t('figure.label.motion-turn')}</option>\n <option value=\"continuous\" ?selected=${m.kind === 'continuous'}>${i18next.t('figure.label.motion-continuous')}</option>\n </select>\n <select @change=${(e: Event) => (this.motion = { ...m, axis: (e.target as HTMLSelectElement).value as Axis })}>\n ${AXES.map(a => html`<option value=${a} ?selected=${a === m.axis}>${i18next.t('figure.label.motion-axis')} ${a.toUpperCase()}</option>`)}\n </select>\n </div>\n ${leaders.length\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-follow')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, follow: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!follow}>${i18next.t('figure.label.motion-own-control')}</option>\n ${leaders.map(j => html`<option value=${j.id} ?selected=${j.id === follow}>${j.body1.part}${j.state ? ` · ${j.state.id}` : ''}</option>`)}\n </select>\n </div>`\n : nothing}\n ${follow\n ? html`<div form>\n <span>${i18next.t('figure.label.motion-multiplier')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.multiplier)} @change=${(e: Event) => (this.motion = { ...m, multiplier: Number((e.target as HTMLInputElement).value) })} />\n <span>${i18next.t('figure.label.motion-offset')} (${unit})</span>\n <input type=\"number\" step=\"any\" .value=${String(m.offset)} @change=${(e: Event) => (this.motion = { ...m, offset: Number((e.target as HTMLInputElement).value) || 0 })} />\n </div>`\n : html`<div form>\n ${m.kind === 'slide'\n ? html`<span>${i18next.t('figure.label.motion-travel')}</span>\n <select @change=${(e: Event) => (this.motion = { ...m, travel: (e.target as HTMLSelectElement).value })}>\n <option value=\"\" ?selected=${!m.travel}>${i18next.t('figure.label.motion-travel-mm')}</option>\n ${asset.appearance\n .map(look => look.target)\n .filter(one => canFollow(asset, one))\n .flatMap(one => AXES.map(a => html`<option value=${`${one}:${a}`} ?selected=${m.travel === `${one}:${a}`}>${one} · ${a.toUpperCase()}</option>`))}\n </select>\n ${m.travel\n ? html`<span>${i18next.t('figure.label.follows-plus')}</span>\n <input type=\"number\" step=\"any\" .value=${String(m.travelPlus ?? 0)} @change=${(e: Event) => (this.motion = { ...m, travelPlus: Number((e.target as HTMLInputElement).value) || 0 })} />`\n : nothing}`\n : nothing}\n <span>${i18next.t('figure.label.control-id')}</span>\n <input .value=${m.id} placeholder=${`${this.partId}-${m.kind}`} @change=${(e: Event) => (this.motion = { ...m, id: (e.target as HTMLInputElement).value.trim() })} />\n ${m.kind === 'continuous' || (m.kind === 'slide' && m.travel)\n ? nothing\n : html`<span>${i18next.t('figure.label.control-range')} (${unit})</span>\n <div pair>\n <input type=\"number\" step=\"any\" .value=${String(m.min)} @change=${(e: Event) => (this.motion = { ...m, min: Number((e.target as HTMLInputElement).value) })} />\n <input type=\"number\" step=\"any\" .value=${String(m.max)} @change=${(e: Event) => (this.motion = { ...m, max: Number((e.target as HTMLInputElement).value) })} />\n </div>`}\n </div>`}\n <button\n act\n ?disabled=${this.locked || (follow ? !(Number.isFinite(m.multiplier) && m.multiplier !== 0) : m.kind !== 'continuous' && !(m.kind === 'slide' && m.travel) && !(m.max > m.min && m.min <= 0 && 0 <= m.max))}\n title=${!follow && m.kind !== 'continuous' && !(m.min <= 0 && 0 <= m.max) ? i18next.t('figure.text.joint-range-holds-zero') : ''}\n @click=${() => {\n this.command({ kind: 'set-joint', joint: motionJoint(joint, { ...m, follow }, this.partId) })\n this.editingMotion = false\n }}\n >\n <md-icon>animation</md-icon>${i18next.t(this.editingMotion ? 'figure.button.apply-motion-change' : 'figure.button.add-motion')}\n </button>\n ${this.editingMotion\n ? html`<button act @click=${() => (this.editingMotion = false)}><md-icon>undo</md-icon>${i18next.t('figure.button.cancel-motion-change')}</button>`\n : nothing}\n `\n }\n\n private setKind(kind: 'slide' | 'turn' | 'continuous') {\n this.motion = kind === 'slide' ? { ...this.motion, kind, min: 0, max: 500 } : { ...this.motion, kind, min: -90, max: 90 }\n }\n\n private command(action: V3AuthoringAction) {\n this.dispatchEvent(new CustomEvent('v3-command', { detail: { action }, bubbles: true, composed: true }))\n }\n}\n\n"]}
@@ -36,6 +36,16 @@ export declare function followOf(asset: V3Asset, part: string, axis: Axis): Foll
36
36
  export declare const hasInstanceSize: (asset: V3Asset, axis: Axis) => boolean;
37
37
  /** The part this one is fastened to, or `null`. The mounting plane counts as fastened (the model names no part). */
38
38
  export declare function fastenedTo(asset: V3Asset, part: string): string | null;
39
+ /**
40
+ * What holds a part: the part it is fastened to, the plane the figure is mounted on, or nothing. The joint record says
41
+ * it; a part standing on the plane had read as fastened to nothing, so the form offered no way to move it and sent
42
+ * no replace -- the fastening was refused as already made (the door's post, 2026-09-25).
43
+ */
44
+ export declare function heldBy(asset: V3Asset, part: string): {
45
+ part: string;
46
+ } | {
47
+ plane: true;
48
+ } | null;
39
49
  /** Whether a dimension of this part can follow something — box-shaped, whose three sizes are X, Y and Z. */
40
50
  export declare function canFollow(asset: V3Asset, part: string): boolean;
41
51
  /**
@@ -147,6 +157,12 @@ export interface MotionForm {
147
157
  travel?: string;
148
158
  travelPlus?: number;
149
159
  }
160
+ /**
161
+ * The motion form filled from a joint as it is, so a motion can be changed where it is -- its range, the length it
162
+ * travels by, what it follows -- rather than taken away and made again. Taking it away is refused while another joint
163
+ * follows it, which left a leader's stroke fixed for good (the telescopic conveyor, 2026-09-25).
164
+ */
165
+ export declare function motionFormOf(joint: V3Joint): MotionForm;
150
166
  /**
151
167
  * 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
152
168
  * turn a turn — and has a control of its own, since a follower follows the joint that is driven.