@things-factory/figure-ui 10.1.175 → 10.1.177

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 (41) hide show
  1. package/client/modeller/editor-styles.ts +4 -6
  2. package/client/modeller/editor.ts +41 -39
  3. package/client/modeller/figure-links.ts +41 -12
  4. package/client/modeller/figure-parts.ts +31 -14
  5. package/client/modeller/figure-properties.ts +2 -2
  6. package/client/pages/figure-modeller-page.ts +34 -11
  7. package/dist-client/modeller/editor-styles.js +4 -6
  8. package/dist-client/modeller/editor-styles.js.map +1 -1
  9. package/dist-client/modeller/editor.d.ts +6 -10
  10. package/dist-client/modeller/editor.js +34 -37
  11. package/dist-client/modeller/editor.js.map +1 -1
  12. package/dist-client/modeller/figure-links.d.ts +7 -2
  13. package/dist-client/modeller/figure-links.js +45 -11
  14. package/dist-client/modeller/figure-links.js.map +1 -1
  15. package/dist-client/modeller/figure-parts.js +31 -14
  16. package/dist-client/modeller/figure-parts.js.map +1 -1
  17. package/dist-client/modeller/figure-properties.js +2 -2
  18. package/dist-client/modeller/figure-properties.js.map +1 -1
  19. package/dist-client/pages/figure-modeller-page.js +34 -11
  20. package/dist-client/pages/figure-modeller-page.js.map +1 -1
  21. package/dist-client/route.d.ts +1 -1
  22. package/dist-client/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +6 -6
  24. package/test/browser/acceptance-page.js +2 -1
  25. package/test/browser/build.mjs +9 -1
  26. package/test/browser/editing-page.js +2 -1
  27. package/test/browser/links.check.mjs +24 -9
  28. package/test/browser/modeller.check.mjs +6 -0
  29. package/test/browser/parts.check.mjs +3 -12
  30. package/test/browser/places-mesh.check.mjs +4 -9
  31. package/test/browser/props.check.mjs +67 -12
  32. package/test/browser/row-preview.check.mjs +4 -0
  33. package/test/browser/screen.check.mjs +49 -19
  34. package/test/browser/serve-acceptance.mjs +2 -1
  35. package/test/place-words.test.ts +31 -0
  36. package/translations/en.json +6 -3
  37. package/translations/es.json +3 -0
  38. package/translations/ja.json +3 -0
  39. package/translations/ko.json +6 -3
  40. package/translations/ms.json +3 -0
  41. package/translations/zh.json +3 -0
@@ -28,7 +28,12 @@ export declare class FigureLinks extends FigureLinks_base {
28
28
  partId: string;
29
29
  locked: boolean;
30
30
  /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */
31
- section: 'shape' | 'places' | 'motion';
31
+ section: 'shape' | 'response' | 'places' | 'motion';
32
+ /**
33
+ * Its tab is the one shown. Two sections speak of what a command would draw -- the properties' fastening and the
34
+ * response's row -- and only the one in sight may: the hidden one's silence would clear what the shown one draws.
35
+ */
36
+ active: boolean;
32
37
  /** What the fastening command would do, in words (the editor works it out: `command-preview.ts`). */
33
38
  previewWords: string[];
34
39
  /** Where the selected part's motion takes it, at both ends of its range (the editor draws them on the canvas). */
@@ -69,7 +74,7 @@ export declare class FigureLinks extends FigureLinks_base {
69
74
  willUpdate(changed: Map<string, unknown>): void;
70
75
  updated(): void;
71
76
  disconnectedCallback(): void;
72
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
77
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
73
78
  /** Where things are held on this part: a seat things rest on, or a grip things are held in. */
74
79
  private renderPlaces;
75
80
  /** The figure holds things: `Capacity` and `Holdable`, the ladder's middle rung. One part edit, one undo step. */
@@ -55,6 +55,11 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
55
55
  this.locked = false;
56
56
  /** Which ties this shows: the part's shape (size and placement, in 속성), its places (자리·능력) or its motion (움직임). */
57
57
  this.section = 'shape';
58
+ /**
59
+ * Its tab is the one shown. Two sections speak of what a command would draw -- the properties' fastening and the
60
+ * response's row -- and only the one in sight may: the hidden one's silence would clear what the shown one draws.
61
+ */
62
+ this.active = true;
58
63
  /** What the fastening command would do, in words (the editor works it out: `command-preview.ts`). */
59
64
  this.previewWords = [];
60
65
  /** Where the selected part's motion takes it, at both ends of its range (the editor draws them on the canvas). */
@@ -102,8 +107,10 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
102
107
  flex: 1;
103
108
  margin: 0;
104
109
  }
105
- div[fastened-summary] > button[quiet] {
106
- margin-left: 0;
110
+ /* Opening the form is an action: the primary colour, at the line's end. */
111
+ div[fastened-summary] > button[act] {
112
+ flex: none;
113
+ margin: 0 -6px 0 0;
107
114
  }
108
115
  /* The measure's name, then its rule: X, or a cylinder's 반지름 · 길이, on one line. */
109
116
  div[row] > b {
@@ -157,6 +164,9 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
157
164
  return this.revision?.asset;
158
165
  }
159
166
  willUpdate(changed) {
167
+ /* Its tab shown again: what it would draw is said again, over whatever the other tab left. */
168
+ if (changed.has('active') && this.active && changed.get('active') === false)
169
+ this.told = '';
160
170
  /* What 고치기 said is about the figure as it was: another step or another part, and it no longer holds. */
161
171
  if (changed.has('asset') || changed.has('partId'))
162
172
  this.fixNote = '';
@@ -174,9 +184,10 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
174
184
  }
175
185
  }
176
186
  updated() {
177
- /* Only the section that holds the fastening form speaks of it: the panel has one of these per section, and the
178
- others' silence cleared what it showed (2026-09-27, :3391). */
179
- if (this.section !== 'shape' && !this.told)
187
+ /* Only the sections that hold a form speak of what it would do, and only while their tab is shown: the panel has
188
+ one of these per section, and the others' silence cleared what it showed (2026-09-27, :3391). */
189
+ const speaks = this.active && (this.section === 'shape' || this.section === 'response');
190
+ if (!speaks)
180
191
  return;
181
192
  const said = JSON.stringify(this.candidate ?? null);
182
193
  if (said === this.told)
@@ -229,12 +240,33 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
229
240
  */
230
241
  /* Fastened, by a face or by an origin: either can be taken off, from the place group's 「⋯」. */
231
242
  const held = !!heldBy(asset, this.partId) || !!(this.revision && fasteningOf(this.revision, this.partId)?.atOrigin);
243
+ if (this.section === 'response') {
244
+ /*
245
+ How the part answers a size it is placed at (user 2026-10-17, the 「반응형」 tab): its own measures, where it
246
+ stands, and the row it may make -- what Build Once, Fit Anywhere is authored with, in one place.
247
+ */
248
+ const positions = positionsWorkedOut(asset, this.partId);
249
+ const response = html `
250
+ <section size-response>
251
+ <h3>${i18next.t('figure.label.group-size')}</h3>
252
+ <p group-question>${i18next.t('figure.label.resize-intent')}</p>
253
+ ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html `<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}
254
+ </section>
255
+ ${positions.length
256
+ ? html `<section position-response>
257
+ <h3>${i18next.t('figure.label.group-position-response')}</h3>
258
+ ${this.renderPositions(asset)}
259
+ </section>`
260
+ : nothing}
261
+ ${rowOf(asset, this.partId) ? html `<slot name="row"></slot>` : this.renderRow(asset)}
262
+ `;
263
+ this.candidate = this.working === 'row' && this.rowCandidate ? { action: this.rowCandidate } : undefined;
264
+ return response;
265
+ }
232
266
  const shown = html `
233
267
  <section size>
234
268
  <h3>${i18next.t('figure.label.group-size')}</h3>
235
269
  <slot name="size"></slot>
236
- <p group-question>${i18next.t('figure.label.resize-intent')}</p>
237
- ${canFollow(asset, this.partId) ? this.renderDimensions(asset) : html `<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}
238
270
  </section>
239
271
  <section fastening ?spotlit=${this.spotlit} @focusin=${() => (this.working = 'fasten')}>
240
272
  <h3>
@@ -242,12 +274,10 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
242
274
  ${groupMenu([{ label: i18next.t('figure.button.detach'), icon: 'link_off', disabled: this.locked || !held, run: () => this.command({ kind: 'detach', part: this.partId }) }])}
243
275
  </h3>${this.help.hint('figure.text.fastening-explained')}
244
276
  <slot name="place"></slot>
245
- ${this.renderPositions(asset)}
246
277
  ${canFasten(asset, this.partId) ? this.renderFastening(asset) : html `<p hint>${i18next.t('figure.text.links-need-a-box')}</p>`}
247
278
  </section>
248
- ${rowOf(asset, this.partId) ? html `<slot name="row"></slot>` : this.renderRow(asset)}
249
279
  `;
250
- this.candidate = this.working === 'row' && this.rowCandidate ? { action: this.rowCandidate } : this.fastenCandidate;
280
+ this.candidate = this.fastenCandidate;
251
281
  return shown;
252
282
  }
253
283
  /** Where things are held on this part: a seat things rest on, or a grip things are held in. */
@@ -576,7 +606,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
576
606
  ${overhang}
577
607
  <div fastened-summary>
578
608
  <p fasten-sentence>${this.sentenceOf(myFace, f.toPlane ? planeWord : `${f.target}의 ${i18next.t('figure.label.face-' + targetFace)}`, mode)}</p>
579
- <button quiet change-fastening ?disabled=${this.locked} @click=${() => (this.changingFastening = true)}>${i18next.t('figure.button.change-fastening')}</button>
609
+ <button act change-fastening ?disabled=${this.locked} @click=${() => (this.changingFastening = true)}>${i18next.t('figure.button.change-fastening')}</button>
580
610
  </div>
581
611
  ${this.renderDetachWords()}
582
612
  `;
@@ -1003,6 +1033,10 @@ __decorate([
1003
1033
  property(),
1004
1034
  __metadata("design:type", String)
1005
1035
  ], FigureLinks.prototype, "section", void 0);
1036
+ __decorate([
1037
+ property({ type: Boolean }),
1038
+ __metadata("design:type", Object)
1039
+ ], FigureLinks.prototype, "active", void 0);
1006
1040
  __decorate([
1007
1041
  property({ attribute: false }),
1008
1042
  __metadata("design:type", Array)