@things-factory/figure-ui 10.1.82 → 10.1.84

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 (83) hide show
  1. package/client/modeller/command-preview.ts +4 -2
  2. package/client/modeller/drawn-shapes.ts +29 -0
  3. package/client/modeller/editor.ts +11 -29
  4. package/client/modeller/figure-links.ts +47 -101
  5. package/client/modeller/figure-material-panel.ts +2 -3
  6. package/client/modeller/figure-parts.ts +9 -11
  7. package/client/modeller/figure-section-panel.ts +175 -0
  8. package/client/modeller/gizmo.ts +26 -16
  9. package/client/modeller/joint-fan.ts +4 -3
  10. package/client/modeller/links.ts +24 -24
  11. package/client/modeller/maturity.ts +12 -6
  12. package/client/modeller/motion-ends.ts +2 -1
  13. package/client/modeller/refusals.ts +20 -0
  14. package/client/modeller/renderer.ts +3 -2
  15. package/client/modeller/section-controls.ts +34 -0
  16. package/client/modeller/starting-shape.ts +34 -0
  17. package/dist-client/modeller/clips.d.ts +1 -1
  18. package/dist-client/modeller/command-preview.js +4 -2
  19. package/dist-client/modeller/command-preview.js.map +1 -1
  20. package/dist-client/modeller/drawn-shapes.d.ts +44 -0
  21. package/dist-client/modeller/drawn-shapes.js +12 -0
  22. package/dist-client/modeller/drawn-shapes.js.map +1 -0
  23. package/dist-client/modeller/editor.d.ts +1 -6
  24. package/dist-client/modeller/editor.js +10 -29
  25. package/dist-client/modeller/editor.js.map +1 -1
  26. package/dist-client/modeller/figure-links.d.ts +2 -2
  27. package/dist-client/modeller/figure-links.js +45 -96
  28. package/dist-client/modeller/figure-links.js.map +1 -1
  29. package/dist-client/modeller/figure-material-panel.js +2 -3
  30. package/dist-client/modeller/figure-material-panel.js.map +1 -1
  31. package/dist-client/modeller/figure-parts.d.ts +3 -2
  32. package/dist-client/modeller/figure-parts.js +6 -9
  33. package/dist-client/modeller/figure-parts.js.map +1 -1
  34. package/dist-client/modeller/figure-section-panel.d.ts +28 -0
  35. package/dist-client/modeller/figure-section-panel.js +172 -0
  36. package/dist-client/modeller/figure-section-panel.js.map +1 -0
  37. package/dist-client/modeller/gizmo.d.ts +3 -3
  38. package/dist-client/modeller/gizmo.js +24 -11
  39. package/dist-client/modeller/gizmo.js.map +1 -1
  40. package/dist-client/modeller/joint-fan.js +4 -3
  41. package/dist-client/modeller/joint-fan.js.map +1 -1
  42. package/dist-client/modeller/links.d.ts +4 -1
  43. package/dist-client/modeller/links.js +23 -25
  44. package/dist-client/modeller/links.js.map +1 -1
  45. package/dist-client/modeller/maturity.d.ts +3 -2
  46. package/dist-client/modeller/maturity.js +9 -6
  47. package/dist-client/modeller/maturity.js.map +1 -1
  48. package/dist-client/modeller/motion-ends.js +2 -1
  49. package/dist-client/modeller/motion-ends.js.map +1 -1
  50. package/dist-client/modeller/refusals.d.ts +0 -5
  51. package/dist-client/modeller/refusals.js +25 -0
  52. package/dist-client/modeller/refusals.js.map +1 -1
  53. package/dist-client/modeller/renderer.d.ts +3 -4
  54. package/dist-client/modeller/renderer.js +3 -2
  55. package/dist-client/modeller/renderer.js.map +1 -1
  56. package/dist-client/modeller/section-controls.d.ts +11 -0
  57. package/dist-client/modeller/section-controls.js +27 -0
  58. package/dist-client/modeller/section-controls.js.map +1 -0
  59. package/dist-client/modeller/starting-shape.d.ts +32 -0
  60. package/dist-client/modeller/starting-shape.js +37 -0
  61. package/dist-client/modeller/starting-shape.js.map +1 -0
  62. package/dist-client/route.d.ts +1 -1
  63. package/dist-client/tsconfig.tsbuildinfo +1 -1
  64. package/dist-server/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +5 -5
  66. package/test/browser/acceptance-page.js +8 -0
  67. package/test/command-preview.test.ts +3 -2
  68. package/test/fixtures/joint-column.json +110 -15
  69. package/test/fixtures/joint-roller.json +66 -9
  70. package/test/fixtures/robot-arm-6dof.json +203 -27
  71. package/test/joint-fan.test.ts +10 -7
  72. package/test/links.test.ts +6 -5
  73. package/test/material.test.ts +7 -2
  74. package/test/renderer.test.ts +2 -1
  75. package/test/resize-with-placement.test.ts +15 -14
  76. package/test/scene-canvas.test.ts +2 -1
  77. package/test/section-panel.test.ts +93 -0
  78. package/translations/en.json +21 -2
  79. package/translations/ja.json +20 -1
  80. package/translations/ko.json +22 -3
  81. package/translations/ms.json +20 -1
  82. package/translations/zh.json +20 -1
  83. package/dist-client/tsconfig.localkernel.tsbuildinfo +0 -1
@@ -7,13 +7,14 @@ import { notify } from '@operato/layout';
7
7
  import { OxPrompt } from '@operato/popup';
8
8
  import { customElement, property, state } from 'lit/decorators.js';
9
9
  import { live } from 'lit/directives/live.js';
10
- import { PART_LIMIT, parseFigureRecipe, resolveFigureRecipe, figurePartCountOf, figureRecipeIdFor, planFigureResize, parseFigureAsset, figureSizeEditChanges, figureScaleAnchorOf, figurePlaneAlignChanges, figurePartFaceOf, figureRowOf, figureFaceOverhangOf, figureRoomOnlyInputsOf, figureRoomRefitOf } from '@hatiolab/figure-model';
10
+ import { PART_LIMIT, parseFigureRecipe, resolveFigureRecipe, figurePartCountOf, figureRecipeIdFor, parseFigureAsset, figureSizeEditChanges, figureScaleAnchorOf, figurePlaneAlignChanges, figurePartFaceOf, figureRowOf, figureFaceOverhangOf, figureRoomOnlyInputsOf, figureRoomRefitOf } from '@hatiolab/figure-model';
11
11
  import './figure-recipe-catalog.js';
12
12
  import { captureFigureThumbnail } from './thumbnail.js';
13
13
  import { drawableFigureParts } from './renderer.js';
14
14
  import './canvas.js';
15
15
  import './figure-parts.js';
16
16
  import './figure-material-panel.js';
17
+ import './figure-section-panel.js';
17
18
  import { faceHighlightOf, ghostPartsOf, previewWordsOf, rowWordsOf } from './command-preview.js';
18
19
  import { motionEndsOf } from './motion-ends.js';
19
20
  import './figure-links.js';
@@ -32,11 +33,12 @@ import { alignChanges, boxOf, canMirror, mirrorChanges } from './align.js';
32
33
  import { paletteRecipe } from './palette.js';
33
34
  import { nudgeOf, placementOf } from './stage-model.js';
34
35
  import { roomRefitRowsOf } from './occupancy.js';
35
- import { editRefusalOf, inDeclaredRoom, inputRangeRefusalOf, narrowingRetryOf, partRefusalOf, placementRefusalOf, recipeRefusalOf, removalNoticeOf, resizeRefusalOf, sizeRangeRefusalOf } from './refusals.js';
36
+ import { editRefusalOf, inDeclaredRoom, inputRangeRefusalOf, narrowingRetryOf, partRefusalOf, placementRefusalOf, recipeRefusalOf, removalNoticeOf, sizeRangeRefusalOf } from './refusals.js';
36
37
  import { fieldWordsOf, followOf, measureNow, partSummaryOf, instanceRangeOf, instanceRangeToDeclare, proportionToFollow, rangeDiffers, rangeWith, turnsAboutAJoint, valueNow } from './links.js';
37
38
  import { jointFanOf } from './joint-fan.js';
38
39
  import { jointDragOf } from './joint-drag.js';
39
40
  import { liveOverSession, NOTHING_LIVE, scrubbed, scrubStep } from './live.js';
41
+ import { startingShapeKindOfBody } from './starting-shape.js';
40
42
  /** Product editor surface. The injected session is shared by page persistence and AI commands. */
41
43
  let FigureEditor = class FigureEditor extends LitElement {
42
44
  constructor() {
@@ -1110,7 +1112,6 @@ let FigureEditor = class FigureEditor extends LitElement {
1110
1112
  .motionEnds=${section === 'motion' ? this.motionEnds() : null}
1111
1113
  @go-fasten=${() => this.goFasten()}
1112
1114
  @preview-command=${(e) => this.previewCommand(e.detail)}
1113
- @resize-with-placement=${(e) => this.resizeWithPlacement(e.detail.request)}
1114
1115
  @part-edit=${(e) => this.run(() => this.session.edit(e.detail.edit))}
1115
1116
  ></figure-links>`;
1116
1117
  }
@@ -1161,31 +1162,6 @@ let FigureEditor = class FigureEditor extends LitElement {
1161
1162
  @part-edit=${(e) => this.run(() => this.session.edit(e.detail.edit))}
1162
1163
  ></figure-clips>`;
1163
1164
  }
1164
- /**
1165
- * "Follow the size and keep where the figure is placed" (ADR-0097): figure-model plans it from the figure as it is now,
1166
- * and the whole plan is one step of the history. A refusal with a way on -- move the part onto the plane, replace how
1167
- * its position is worked out -- asks in the app's prompt and plans again with that choice; any other says why.
1168
- */
1169
- resizeWithPlacement(request) {
1170
- this.retry = undefined;
1171
- this.notice = '';
1172
- const plan = planFigureResize(parseFigureAsset(this.session.source()), request);
1173
- const refusal = plan.refusal;
1174
- if (refusal) {
1175
- const choice = refusal.choice;
1176
- /* The gap is chosen on the screen beside the button, with its distance; only replacing a position rule is asked here. */
1177
- this.retry = choice === 'replacePosition' ? { label: i18next.t('figure.button.resize-choice-replace-position'), run: () => this.resizeWithPlacement({ ...request, replacePosition: true }) } : undefined;
1178
- this.error = resizeRefusalOf(plan, request.part, (key, params) => i18next.t(key, params));
1179
- return;
1180
- }
1181
- this.run(() => this.session.applyRecipe(plan.steps));
1182
- /*
1183
- The declared room was measured from the part's old numbers and is not changed: said as a fact, not as a claim that
1184
- the part leaves it -- that is measured where the room is declared again (designer 2026-09-27).
1185
- */
1186
- if (!this.error && plan.roomReads.length)
1187
- this.notice = i18next.t('figure.text.resize-room-unchanged');
1188
- }
1189
1165
  /** One command, one step of the history. A refusal a person can meet here is said in their words. */
1190
1166
  linkCommand(action) {
1191
1167
  this.retry = undefined;
@@ -1394,7 +1370,7 @@ let FigureEditor = class FigureEditor extends LitElement {
1394
1370
  }
1395
1371
  rows.set(id, {
1396
1372
  id,
1397
- provider: g.shape?.provider ?? '',
1373
+ kind: startingShapeKindOfBody(g.shape) ?? '',
1398
1374
  hidden: this.hiddenParts.has(id),
1399
1375
  invisible: g.visible === false,
1400
1376
  ...(id !== g.id ? { copies: 1 } : {}),
@@ -2073,6 +2049,11 @@ let FigureEditor = class FigureEditor extends LitElement {
2073
2049
  ${this.renderGroups(this.withSizeRow(groupFields(partFields, this.selected), held), 'figure.label.group-placement-size', 'figure.label.group-shape', unavailable, this.renderTools(unavailable), held)}
2074
2050
  ${roomFields.length ? this.renderRoomOnly(roomFields, unavailable) : nothing}
2075
2051
  ${this.renderLinks(unavailable, 'shape')}
2052
+ <figure-section-panel
2053
+ .body=${{ ...part, id: this.selected }}
2054
+ ?locked=${unavailable}
2055
+ @command=${(e) => this.linkCommand(e.detail.action)}
2056
+ ></figure-section-panel>
2076
2057
  <figure-material-panel
2077
2058
  .body=${{ ...part, id: this.selected }}
2078
2059
  .palette=${view.palette ?? {}}