@things-factory/figure-ui 10.1.159 → 10.1.161
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.
- package/client/graphql/index.ts +38 -0
- package/client/index.ts +1 -0
- package/client/modeller/figure-links.ts +21 -6
- package/client/modeller/links.ts +13 -0
- package/client/pages/figure-list-page.ts +5 -72
- package/client/setting-let/figure-namespace-setting-let.ts +85 -0
- package/client/viewparts/figure-thumb.ts +10 -37
- package/dist-client/graphql/index.d.ts +13 -0
- package/dist-client/graphql/index.js +24 -0
- package/dist-client/graphql/index.js.map +1 -1
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +1 -0
- package/dist-client/index.js.map +1 -1
- package/dist-client/modeller/figure-links.js +21 -7
- package/dist-client/modeller/figure-links.js.map +1 -1
- package/dist-client/modeller/links.d.ts +13 -0
- package/dist-client/modeller/links.js +11 -0
- package/dist-client/modeller/links.js.map +1 -1
- package/dist-client/pages/figure-list-page.js +5 -72
- package/dist-client/pages/figure-list-page.js.map +1 -1
- package/dist-client/setting-let/figure-namespace-setting-let.d.ts +18 -0
- package/dist-client/setting-let/figure-namespace-setting-let.js +94 -0
- package/dist-client/setting-let/figure-namespace-setting-let.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/figure-thumb.d.ts +3 -1
- package/dist-client/viewparts/figure-thumb.js +10 -37
- package/dist-client/viewparts/figure-thumb.js.map +1 -1
- package/package.json +5 -4
- package/test/links.test.ts +29 -0
- package/translations/en.json +8 -1
- package/translations/es.json +8 -1
- package/translations/ja.json +8 -1
- package/translations/ko.json +8 -1
- package/translations/ms.json +8 -1
- package/translations/zh.json +8 -1
|
@@ -6,7 +6,7 @@ import './figure-slot-layout-panel.js';
|
|
|
6
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { FIGURE_FACES, figureFaceOverhangOf } from '@hatiolab/figure-model';
|
|
9
|
-
import { acceptsOf, alignOf, AXES, canFasten, facesOf, canFollow, followCommandOf, followableAxes, positionIsShare, choiceOf, heldBy, followOf, hangsFrom, shownWhenOf, visibilityControlsOf, placeKeptOf, fasteningOf, hasInstanceSize, holdsThings, leadersFor, motionOf, motionFormOf, motionFormRefusalOf, endPlaceKeyOf, motionJoint, placeFacesOf, placeIdFor, placesOn, rowAxesOf, rowBlockOf, fixedJointOf, rowOf, positionsWorkedOut, fieldWordsOf, measureNow, ownFacesOf, alignRowsOf } from './links.js';
|
|
9
|
+
import { acceptsOf, alignOf, AXES, canFasten, facesOf, canFollow, followCommandOf, followableAxes, positionIsShare, choiceOf, heldBy, followOf, hangsFrom, shownWhenOf, visibilityControlsOf, placeKeptOf, fasteningOf, fastenGapOf, hasInstanceSize, holdsThings, leadersFor, motionOf, motionFormOf, motionFormRefusalOf, endPlaceKeyOf, motionJoint, placeFacesOf, placeIdFor, placesOn, rowAxesOf, rowBlockOf, fixedJointOf, rowOf, positionsWorkedOut, fieldWordsOf, measureNow, ownFacesOf, alignRowsOf } from './links.js';
|
|
10
10
|
import { SidePanelStyles } from '@things-factory/figure-viewer/dist-client/side-panel-styles.js';
|
|
11
11
|
import './figure-fasten-drawing.js';
|
|
12
12
|
import { faceViewOf, insideAlignmentOf, modeOf, myFaceFor, turnsInPlace } from './fasten-geometry.js';
|
|
@@ -23,6 +23,7 @@ const freshFasten = () => ({
|
|
|
23
23
|
targetFace: 'top',
|
|
24
24
|
facing: 'meet',
|
|
25
25
|
gap: 0,
|
|
26
|
+
gapKept: undefined,
|
|
26
27
|
twist: 0,
|
|
27
28
|
align: {},
|
|
28
29
|
alignMm: {},
|
|
@@ -397,11 +398,14 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
|
|
|
397
398
|
heldWords(asset) {
|
|
398
399
|
const joint = (asset.joints ?? []).find(j => j.body1.part === this.partId);
|
|
399
400
|
const face = joint ? i18next.t(endPlaceKeyOf(joint.body1)) : '';
|
|
400
|
-
const gap =
|
|
401
|
+
const gap = joint?.origin?.gap ?? 0;
|
|
402
|
+
const place = i18next.t(`figure.label.resize-place-${asset.placement ?? 'floor'}`);
|
|
401
403
|
const where = !joint
|
|
402
404
|
? i18next.t('figure.text.held-by-rule')
|
|
403
405
|
: 'plane' in joint.body0
|
|
404
|
-
?
|
|
406
|
+
? typeof gap === 'number'
|
|
407
|
+
? i18next.t('figure.text.held-on-plane', { face, place, gap: String(gap) })
|
|
408
|
+
: i18next.t('figure.text.held-on-plane-worked-out', { face, place })
|
|
405
409
|
: i18next.t('figure.text.held-on-part', { face, other: joint.body0.part, otherFace: i18next.t(endPlaceKeyOf(joint.body0)) });
|
|
406
410
|
return where;
|
|
407
411
|
}
|
|
@@ -483,7 +487,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
|
|
|
483
487
|
face: myFace,
|
|
484
488
|
to: f.toPlane ? { plane: 'mounting-plane' } : { part: f.target, face: targetFace },
|
|
485
489
|
...(f.toPlane ? {} : { facing: f.facing }),
|
|
486
|
-
...(f
|
|
490
|
+
...fastenGapOf(f),
|
|
487
491
|
twist: f.twist,
|
|
488
492
|
...(align ? { align } : {}),
|
|
489
493
|
replace: !!held
|
|
@@ -497,7 +501,11 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
|
|
|
497
501
|
for the default.
|
|
498
502
|
*/
|
|
499
503
|
const detail = [
|
|
500
|
-
...(f.
|
|
504
|
+
...(f.gapKept !== undefined
|
|
505
|
+
? [i18next.t('figure.text.fasten-summary-gap-worked-out')]
|
|
506
|
+
: f.gap
|
|
507
|
+
? [i18next.t('figure.text.fasten-summary-gap', { mm: String(f.gap) })]
|
|
508
|
+
: []),
|
|
501
509
|
...(f.twist ? [i18next.t('figure.text.fasten-summary-twist', { degrees: String(f.twist) })] : [])
|
|
502
510
|
];
|
|
503
511
|
/* Across the face, a row only where the drawing cannot set it: no drawing of the face, or a share or a field to follow. */
|
|
@@ -582,7 +590,13 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
|
|
|
582
590
|
${alignRows.length ? this.renderAlignment(alignRows, settle) : nothing}
|
|
583
591
|
<div form>
|
|
584
592
|
<span>${i18next.t('figure.label.gap')}</span>
|
|
585
|
-
<input
|
|
593
|
+
<input
|
|
594
|
+
type="number"
|
|
595
|
+
step="any"
|
|
596
|
+
.value=${f.gapKept !== undefined ? '' : String(f.gap)}
|
|
597
|
+
placeholder=${f.gapKept !== undefined ? i18next.t('figure.label.follows-expression') : ''}
|
|
598
|
+
@change=${(e) => ((this.fasten = { ...f, gap: Number(e.target.value) || 0, gapKept: undefined }), settle())}
|
|
599
|
+
/>
|
|
586
600
|
<span>${i18next.t('figure.label.twist')}</span>
|
|
587
601
|
<input type="number" step="any" .value=${String(f.twist)} @change=${(e) => ((this.fasten = { ...f, twist: Number(e.target.value) || 0 }), settle())} />
|
|
588
602
|
</div>
|
|
@@ -607,7 +621,7 @@ let FigureLinks = class FigureLinks extends localize(i18next)(LitElement) {
|
|
|
607
621
|
else if ('mode' in c)
|
|
608
622
|
this.fasten = { ...f, face: c.mode === 'centre' ? 'centre' : f.face === 'centre' ? 'bottom' : f.face, facing: c.mode === 'flush' ? 'flush' : 'meet' };
|
|
609
623
|
else if ('gap' in c)
|
|
610
|
-
this.fasten = { ...f, gap: c.gap };
|
|
624
|
+
this.fasten = { ...f, gap: c.gap, gapKept: undefined };
|
|
611
625
|
else
|
|
612
626
|
this.fasten = {
|
|
613
627
|
...f,
|