@things-factory/figure-ui 10.1.86 → 10.1.88

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.
@@ -7,7 +7,7 @@ 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, parseFigureAsset, figureSizeEditChanges, figureScaleAnchorOf, figurePlaneAlignChanges, figurePartFaceOf, figureRowOf, figureFaceOverhangOf, figureRoomOnlyInputsOf, figureRoomRefitOf } from '@hatiolab/figure-model';
10
+ import { PART_LIMIT, parseFigureRecipe, resolveFigureRecipe, figurePartCountOf, figureRecipeIdFor, parseFigureAsset, figureSizeEditChanges, figureScaleAnchorOf, figureSectionMeasuresOf, 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';
@@ -1823,10 +1823,16 @@ let FigureEditor = class FigureEditor extends LitElement {
1823
1823
  /** The section editor over the canvas, the figure behind it drawing what the working points make. */
1824
1824
  renderSectionEditor(geometry) {
1825
1825
  const part = geometry.find(g => ownerOf(g.id) === this.selected);
1826
- if (!part?.shape?.extrusion || part.shape.extrusion.section.kind !== 'polygon')
1826
+ /* A door frame's section is its own width, height, jamb and head: its fields edit it, not an outline. */
1827
+ if (!part?.shape?.extrusion || part.shape.dimensions.jamb !== undefined)
1827
1828
  return nothing;
1829
+ const asset = this.asset();
1830
+ const measures = figureSectionMeasuresOf(asset, this.selected);
1831
+ const kept = figureScaleAnchorOf(asset, this.selected)?.[part.shape.extrusion.axis];
1828
1832
  return html `<figure-section-editor
1829
1833
  .body=${{ ...part, id: this.selected }}
1834
+ .measures=${measures}
1835
+ .kept=${kept}
1830
1836
  .revision=${this.session?.read().revision ?? 0}
1831
1837
  @command=${(e) => this.linkCommand(e.detail.action)}
1832
1838
  @command-live=${(e) => this.holdAction(e.detail.action)}