@things-factory/figure-ui 10.1.147 → 10.1.150
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/bootstrap.ts +10 -2
- package/client/graphql/index.ts +20 -0
- package/client/modeller/canvas.ts +6 -2
- package/client/modeller/carrier-declaration.ts +63 -0
- package/client/modeller/editor.ts +62 -27
- package/client/modeller/figure-carrier.ts +117 -0
- package/client/modeller/figure-cavity-drawing.ts +3 -9
- package/client/modeller/figure-first-save.ts +4 -7
- package/client/modeller/figure-history-panel.ts +2 -3
- package/client/modeller/figure-links.ts +46 -60
- package/client/modeller/figure-material-panel.ts +4 -14
- package/client/modeller/figure-mesh-choice.ts +68 -0
- package/client/modeller/figure-parts.ts +23 -1
- package/client/modeller/figure-preview.ts +2 -2
- package/client/modeller/figure-properties.ts +5 -3
- package/client/modeller/figure-section-editor.ts +12 -33
- package/client/modeller/figure-section-panel.ts +6 -7
- package/client/modeller/figure-slot-layout-panel.ts +208 -0
- package/client/modeller/figure-verdict.ts +21 -31
- package/client/modeller/first-save.ts +23 -0
- package/client/modeller/links.ts +52 -1
- package/client/modeller/material-edit.ts +38 -0
- package/client/modeller/maturity.ts +28 -0
- package/client/modeller/mesh-import.ts +77 -0
- package/client/modeller/modeller-route.ts +9 -0
- package/client/modeller/mounting-part.ts +15 -0
- package/client/modeller/newest-answer.ts +21 -0
- package/client/modeller/preview-model.ts +5 -0
- package/client/modeller/refusals.ts +168 -82
- package/client/modeller/section-controls.ts +25 -1
- package/client/modeller/section-drawing.ts +43 -1
- package/client/modeller/slot-layout-host.ts +140 -0
- package/client/pages/figure-modeller-page.ts +6 -5
- package/client/viewparts/detail-route.ts +7 -0
- package/client/viewparts/figure-detail-dock.ts +1 -3
- package/dist-client/bootstrap.d.ts +1 -1
- package/dist-client/bootstrap.js +9 -2
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/graphql/index.d.ts +5 -0
- package/dist-client/graphql/index.js +19 -0
- package/dist-client/graphql/index.js.map +1 -1
- package/dist-client/modeller/canvas.d.ts +2 -0
- package/dist-client/modeller/canvas.js +10 -2
- package/dist-client/modeller/canvas.js.map +1 -1
- package/dist-client/modeller/carrier-declaration.d.ts +31 -0
- package/dist-client/modeller/carrier-declaration.js +53 -0
- package/dist-client/modeller/carrier-declaration.js.map +1 -0
- package/dist-client/modeller/editor.d.ts +13 -0
- package/dist-client/modeller/editor.js +62 -27
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/figure-carrier.d.ts +26 -0
- package/dist-client/modeller/figure-carrier.js +123 -0
- package/dist-client/modeller/figure-carrier.js.map +1 -0
- package/dist-client/modeller/figure-cavity-drawing.js +3 -11
- package/dist-client/modeller/figure-cavity-drawing.js.map +1 -1
- package/dist-client/modeller/figure-first-save.d.ts +4 -0
- package/dist-client/modeller/figure-first-save.js +5 -8
- package/dist-client/modeller/figure-first-save.js.map +1 -1
- package/dist-client/modeller/figure-history-panel.js +2 -4
- package/dist-client/modeller/figure-history-panel.js.map +1 -1
- package/dist-client/modeller/figure-links.d.ts +4 -1
- package/dist-client/modeller/figure-links.js +47 -57
- package/dist-client/modeller/figure-links.js.map +1 -1
- package/dist-client/modeller/figure-material-panel.d.ts +0 -1
- package/dist-client/modeller/figure-material-panel.js +4 -14
- package/dist-client/modeller/figure-material-panel.js.map +1 -1
- package/dist-client/modeller/figure-mesh-choice.d.ts +16 -0
- package/dist-client/modeller/figure-mesh-choice.js +75 -0
- package/dist-client/modeller/figure-mesh-choice.js.map +1 -0
- package/dist-client/modeller/figure-parts.d.ts +1 -1
- package/dist-client/modeller/figure-parts.js +22 -0
- package/dist-client/modeller/figure-parts.js.map +1 -1
- package/dist-client/modeller/figure-preview.js +2 -2
- package/dist-client/modeller/figure-preview.js.map +1 -1
- package/dist-client/modeller/figure-properties.d.ts +2 -1
- package/dist-client/modeller/figure-properties.js +5 -3
- package/dist-client/modeller/figure-properties.js.map +1 -1
- package/dist-client/modeller/figure-section-editor.d.ts +2 -2
- package/dist-client/modeller/figure-section-editor.js +12 -33
- package/dist-client/modeller/figure-section-editor.js.map +1 -1
- package/dist-client/modeller/figure-section-panel.js +6 -7
- package/dist-client/modeller/figure-section-panel.js.map +1 -1
- package/dist-client/modeller/figure-slot-layout-panel.d.ts +36 -0
- package/dist-client/modeller/figure-slot-layout-panel.js +198 -0
- package/dist-client/modeller/figure-slot-layout-panel.js.map +1 -0
- package/dist-client/modeller/figure-verdict.d.ts +1 -1
- package/dist-client/modeller/figure-verdict.js +19 -37
- package/dist-client/modeller/figure-verdict.js.map +1 -1
- package/dist-client/modeller/first-save.d.ts +10 -0
- package/dist-client/modeller/first-save.js +16 -0
- package/dist-client/modeller/first-save.js.map +1 -1
- package/dist-client/modeller/links.d.ts +26 -1
- package/dist-client/modeller/links.js +43 -0
- package/dist-client/modeller/links.js.map +1 -1
- package/dist-client/modeller/material-edit.d.ts +11 -0
- package/dist-client/modeller/material-edit.js +28 -0
- package/dist-client/modeller/material-edit.js.map +1 -0
- package/dist-client/modeller/maturity.d.ts +15 -0
- package/dist-client/modeller/maturity.js +23 -0
- package/dist-client/modeller/maturity.js.map +1 -1
- package/dist-client/modeller/mesh-import.d.ts +47 -0
- package/dist-client/modeller/mesh-import.js +47 -0
- package/dist-client/modeller/mesh-import.js.map +1 -0
- package/dist-client/modeller/modeller-route.d.ts +5 -0
- package/dist-client/modeller/modeller-route.js +9 -0
- package/dist-client/modeller/modeller-route.js.map +1 -1
- package/dist-client/modeller/mounting-part.d.ts +14 -0
- package/dist-client/modeller/mounting-part.js +10 -0
- package/dist-client/modeller/mounting-part.js.map +1 -0
- package/dist-client/modeller/newest-answer.d.ts +12 -0
- package/dist-client/modeller/newest-answer.js +21 -0
- package/dist-client/modeller/newest-answer.js.map +1 -0
- package/dist-client/modeller/preview-model.d.ts +2 -0
- package/dist-client/modeller/preview-model.js +4 -0
- package/dist-client/modeller/preview-model.js.map +1 -1
- package/dist-client/modeller/refusals.d.ts +26 -5
- package/dist-client/modeller/refusals.js +184 -86
- package/dist-client/modeller/refusals.js.map +1 -1
- package/dist-client/modeller/section-controls.d.ts +17 -1
- package/dist-client/modeller/section-controls.js +18 -0
- package/dist-client/modeller/section-controls.js.map +1 -1
- package/dist-client/modeller/section-drawing.d.ts +24 -1
- package/dist-client/modeller/section-drawing.js +42 -0
- package/dist-client/modeller/section-drawing.js.map +1 -1
- package/dist-client/modeller/slot-layout-host.d.ts +81 -0
- package/dist-client/modeller/slot-layout-host.js +105 -0
- package/dist-client/modeller/slot-layout-host.js.map +1 -0
- package/dist-client/pages/figure-modeller-page.js +5 -4
- package/dist-client/pages/figure-modeller-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/detail-route.d.ts +5 -0
- package/dist-client/viewparts/detail-route.js +8 -0
- package/dist-client/viewparts/detail-route.js.map +1 -0
- package/dist-client/viewparts/figure-detail-dock.d.ts +0 -1
- package/dist-client/viewparts/figure-detail-dock.js +1 -3
- package/dist-client/viewparts/figure-detail-dock.js.map +1 -1
- package/package.json +9 -8
- package/test/align.test.ts +0 -9
- package/test/browser/assistant-stand-in.js +32 -0
- package/test/browser/build.check.mjs +77 -0
- package/test/browser/build.mjs +31 -6
- package/test/browser/editing-page.js +224 -0
- package/test/browser/editing.check.mjs +550 -0
- package/test/browser/links-page.js +113 -0
- package/test/browser/links.check.mjs +568 -0
- package/test/browser/modeller.check.mjs +21 -0
- package/test/browser/parts-page.js +120 -0
- package/test/browser/parts.check.mjs +328 -0
- package/test/browser/places-mesh-page.js +36 -0
- package/test/browser/places-mesh.check.mjs +239 -0
- package/test/browser/product-page.check.mjs +682 -0
- package/test/browser/product-page.js +276 -0
- package/test/browser/screen-page.js +112 -0
- package/test/browser/screen-product-page.js +62 -0
- package/test/browser/screen.check.mjs +1003 -0
- package/test/browser/section-page.js +256 -0
- package/test/browser/section.check.mjs +719 -0
- package/test/browser/serve.mjs +20 -12
- package/test/carrier-declaration.test.ts +69 -0
- package/test/cavity-drawing.test.ts +2 -18
- package/test/clip-ai-proposal.test.ts +1 -5
- package/test/clip-consent.test.ts +0 -5
- package/test/clips.test.ts +0 -7
- package/test/command-preview.test.ts +0 -68
- package/test/controls.test.ts +0 -9
- package/test/detail-dock.test.ts +6 -25
- package/test/face-mapping.test.ts +1 -20
- package/test/fasten-drawing.test.ts +0 -23
- package/test/fields.test.ts +6 -33
- package/test/figure-assistant-surface.test.ts +32 -38
- package/test/first-minute.test.ts +3 -55
- package/test/first-save-suggest.test.ts +11 -8
- package/test/first-save.test.ts +4 -26
- package/test/gizmo.test.ts +0 -25
- package/test/joint-fan.test.ts +0 -10
- package/test/keys.test.ts +0 -7
- package/test/layout.test.ts +4 -73
- package/test/links.test.ts +48 -67
- package/test/live.test.ts +0 -34
- package/test/material.test.ts +17 -26
- package/test/maturity.test.ts +13 -16
- package/test/mesh-import.test.ts +76 -0
- package/test/modeller-route.test.ts +3 -19
- package/test/package-download.test.ts +6 -7
- package/test/parts-wiring.test.ts +9 -51
- package/test/preview.test.ts +5 -46
- package/test/properties.test.ts +11 -26
- package/test/proposal-record.test.ts +2 -19
- package/test/recipes.test.ts +0 -15
- package/test/refusals.test.ts +257 -151
- package/test/release-entry.test.ts +1 -9
- package/test/release-panel.test.ts +1 -22
- package/test/resize-with-placement.test.ts +0 -32
- package/test/revert-choice.test.ts +1 -22
- package/test/revert-keeping.test.ts +1 -12
- package/test/save-landed.test.ts +16 -14
- package/test/scene-canvas.test.ts +2 -13
- package/test/section-editor.test.ts +30 -83
- package/test/section-panel.test.ts +22 -17
- package/test/slot-layout-host.test.ts +117 -0
- package/test/theme.test.ts +5 -9
- package/test/verdict.test.ts +44 -41
- package/test/view.test.ts +5 -12
- package/translations/en.json +61 -1
- package/translations/es.json +61 -1
- package/translations/ja.json +61 -1
- package/translations/ko.json +61 -1
- package/translations/ms.json +61 -1
- package/translations/zh.json +61 -1
- package/test/thumbnail.test.ts +0 -29
|
@@ -3,7 +3,7 @@ import { __decorate, __metadata } from "tslib";
|
|
|
3
3
|
import { LitElement, html, css, nothing } from 'lit';
|
|
4
4
|
import { i18next } from '@operato/i18n';
|
|
5
5
|
import '@operato/layout';
|
|
6
|
-
import { notify } from '@operato/layout';
|
|
6
|
+
import { notify, openPopup } 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';
|
|
@@ -32,11 +32,16 @@ import { SidePanelStyles } from './side-panel-styles.js';
|
|
|
32
32
|
import { ScrollbarStyles } from '@operato/styles';
|
|
33
33
|
import { alignChanges, canMirror, mirrorChanges } from './align.js';
|
|
34
34
|
import { paletteRecipe } from './palette.js';
|
|
35
|
+
import { meshChoicesOf, meshPartIdOf, meshPartOf } from './mesh-import.js';
|
|
36
|
+
import './figure-mesh-choice.js';
|
|
37
|
+
import { uploadFigureMesh } from '../graphql/index.js';
|
|
38
|
+
import { slotMarksOf } from './slot-layout-host.js';
|
|
39
|
+
const NO_MARKS = [];
|
|
35
40
|
import { apexOver, drawnOf } from './section-drawing.js';
|
|
36
41
|
import { END_FACE } from './section-controls.js';
|
|
37
42
|
import { nudgeOf, placementOf } from './stage-model.js';
|
|
38
43
|
import { roomRefitRowsOf } from './occupancy.js';
|
|
39
|
-
import { editRefusalOf, inDeclaredRoom,
|
|
44
|
+
import { editRefusalOf, inDeclaredRoom, narrowingRetryOf, partNameRefusalOf, partRefusalOf, placedRefusalOf, recipeRefusalOf, removalNoticeOf } from './refusals.js';
|
|
40
45
|
import { endPlaceKeyOf, fieldWordsOf, followOf, measureNow, partSummaryOf, instanceRangeOf, instanceRangeToDeclare, proportionToFollow, rangeDiffers, rangeWith, turnsAboutAJoint, valueNow } from './links.js';
|
|
41
46
|
import { jointFanOf } from './joint-fan.js';
|
|
42
47
|
import { derivedHeld, derivedOf } from './revision.js';
|
|
@@ -694,8 +699,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
694
699
|
catch (error) {
|
|
695
700
|
if (this.askClipLoss(error, () => this.run(action)))
|
|
696
701
|
return;
|
|
697
|
-
|
|
698
|
-
this.error = sizeRangeRefusalOf(error, say) ?? inputRangeRefusalOf(error, say) ?? this.said(error);
|
|
702
|
+
this.error = this.said(error);
|
|
699
703
|
}
|
|
700
704
|
finally {
|
|
701
705
|
/* Committed or refused, the value in hand is gone: the figure as it stands is drawn again. */
|
|
@@ -799,6 +803,41 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
799
803
|
this.selected = part.id;
|
|
800
804
|
});
|
|
801
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* A GLB made into a mesh part (ADR-0129): the server reads and keeps it, the author picks the whole file or one node
|
|
808
|
+
* of it, and the part is added as one step of the history, standing where it stood in the file. A file the server
|
|
809
|
+
* refuses is said in its words; nothing is added.
|
|
810
|
+
*/
|
|
811
|
+
async importMesh(file) {
|
|
812
|
+
if (!this.session)
|
|
813
|
+
return;
|
|
814
|
+
let upload;
|
|
815
|
+
try {
|
|
816
|
+
upload = await uploadFigureMesh(file);
|
|
817
|
+
}
|
|
818
|
+
catch (error) {
|
|
819
|
+
this.error = this.said(error);
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
const choices = meshChoicesOf(upload);
|
|
823
|
+
/* Only the whole file and the one node that is all of it: there is nothing to choose between. */
|
|
824
|
+
const choice = choices.length <= 2
|
|
825
|
+
? {}
|
|
826
|
+
: await openPopup(html `<figure-mesh-choice .choices=${choices}></figure-mesh-choice>`, {
|
|
827
|
+
backdrop: true,
|
|
828
|
+
size: 'small',
|
|
829
|
+
title: i18next.t('figure.title.choose-mesh-part')
|
|
830
|
+
}).result;
|
|
831
|
+
if (!choice)
|
|
832
|
+
return;
|
|
833
|
+
const node = upload.summary.nodes.find(n => n.index === choice.node);
|
|
834
|
+
this.run(() => {
|
|
835
|
+
const taken = new Set(this.session.read().geometry.map(g => g.id));
|
|
836
|
+
const id = meshPartIdOf(node?.name ?? file.name.replace(/\.glb$/i, ''), taken);
|
|
837
|
+
this.session.add(meshPartOf(upload, choice, id));
|
|
838
|
+
this.selected = id;
|
|
839
|
+
});
|
|
840
|
+
}
|
|
802
841
|
/**
|
|
803
842
|
* The list's own operations, as part edits — each one step of the session's history. The copy and the moved
|
|
804
843
|
* part stay selected.
|
|
@@ -990,12 +1029,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
990
1029
|
this.changed();
|
|
991
1030
|
}
|
|
992
1031
|
catch (error) {
|
|
993
|
-
|
|
994
|
-
this.error = /carried by a joint/.test(message)
|
|
995
|
-
? i18next.t('figure.text.gizmo-joint-places', { part: partLabelOf(id) })
|
|
996
|
-
: /is fastened to/.test(message)
|
|
997
|
-
? i18next.t('figure.text.gizmo-fastening-places', { part: partLabelOf(id) })
|
|
998
|
-
: this.said(error);
|
|
1032
|
+
this.error = placedRefusalOf(error, partLabelOf(id), (key, params) => i18next.t(key, params)) ?? this.said(error);
|
|
999
1033
|
this.requestUpdate();
|
|
1000
1034
|
}
|
|
1001
1035
|
}
|
|
@@ -1119,13 +1153,8 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
1119
1153
|
}
|
|
1120
1154
|
catch (error) {
|
|
1121
1155
|
input.value = from;
|
|
1122
|
-
|
|
1123
|
-
this.error =
|
|
1124
|
-
code === 'PART_ID'
|
|
1125
|
-
? i18next.t(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? 'figure.text.part-name-taken' : 'figure.text.part-name-invalid', { name })
|
|
1126
|
-
: error instanceof Error
|
|
1127
|
-
? error.message
|
|
1128
|
-
: String(error);
|
|
1156
|
+
/* Whether a name is a name is the kernel's rule, said from its refusal (ADR-0127), not checked again here. */
|
|
1157
|
+
this.error = partNameRefusalOf(error, (key, params) => i18next.t(key, params)) ?? this.said(error);
|
|
1129
1158
|
}
|
|
1130
1159
|
}
|
|
1131
1160
|
previewWordsNow() {
|
|
@@ -1255,9 +1284,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
1255
1284
|
? i18next.t('figure.text.follow-would-loop')
|
|
1256
1285
|
: code === 'FASTEN_CYCLE' || code === 'ATTACH_CYCLE'
|
|
1257
1286
|
? i18next.t('figure.text.fasten-would-loop')
|
|
1258
|
-
:
|
|
1259
|
-
placementRefusalOf(error, (key, params) => i18next.t(key, params)) ??
|
|
1260
|
-
this.said(error);
|
|
1287
|
+
: this.said(error);
|
|
1261
1288
|
return false;
|
|
1262
1289
|
}
|
|
1263
1290
|
}
|
|
@@ -1620,13 +1647,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
1620
1647
|
}
|
|
1621
1648
|
catch (error) {
|
|
1622
1649
|
input.value = String(field.value);
|
|
1623
|
-
|
|
1624
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1625
|
-
const found = /\((\d[\d.]*) mm\) a pitch under ([\d.]+) mm makes more than (\d+)/.exec(message);
|
|
1626
|
-
this.error =
|
|
1627
|
-
code === 'INPUT_RANGE' && found
|
|
1628
|
-
? i18next.t('figure.text.repeat-pitch-too-small', { length: Number(found[1]).toLocaleString(), min: found[2], limit: found[3] })
|
|
1629
|
-
: this.said(error);
|
|
1650
|
+
this.error = this.said(error);
|
|
1630
1651
|
}
|
|
1631
1652
|
}
|
|
1632
1653
|
/** Choose a part, from the list, the canvas or a place row. A figure-level tab gives way to the part's properties. */
|
|
@@ -1828,6 +1849,18 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
1828
1849
|
const trying = this.middle === 'preview' ? this.renderRoot.querySelector('figure-preview')?.tried?.() : undefined;
|
|
1829
1850
|
return { ...(this.selected ? { part: this.selected } : {}), ...(trying ? { trying } : {}) };
|
|
1830
1851
|
}
|
|
1852
|
+
/**
|
|
1853
|
+
* The slots the figure's slot layout unfolds to, where they fall now (ADR-0118): drawn while the places are being
|
|
1854
|
+
* edited. Made again only when the evaluation is new, so the canvas is not stood up again for nothing.
|
|
1855
|
+
*/
|
|
1856
|
+
slotMarks(view, asset) {
|
|
1857
|
+
const places = view.bindings ?? [];
|
|
1858
|
+
if (this.slotMarksDrawn?.of !== places) {
|
|
1859
|
+
const layout = asset?.document?.capabilities?.slotLayout?.layout;
|
|
1860
|
+
this.slotMarksDrawn = { of: places, marks: slotMarksOf(places, layout) };
|
|
1861
|
+
}
|
|
1862
|
+
return this.slotMarksDrawn.marks;
|
|
1863
|
+
}
|
|
1831
1864
|
choose(id) {
|
|
1832
1865
|
/* A copy on the canvas selects its repeat: the part the author made. */
|
|
1833
1866
|
this.selected = id ? ownerOf(id) : id;
|
|
@@ -2092,6 +2125,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
2092
2125
|
@show-model-settings=${() => this.showModelSettings()}
|
|
2093
2126
|
?locked=${unavailable}
|
|
2094
2127
|
@add-part=${(e) => this.add(e.detail.kind)}
|
|
2128
|
+
@import-mesh=${(e) => this.importMesh(e.detail.file)}
|
|
2095
2129
|
.recipeCount=${this.templates.length}
|
|
2096
2130
|
@open-recipe-catalog=${() => ((this.catalogOpen = true), (this.recipeError = ''))}
|
|
2097
2131
|
@select-part=${(e) => this.choose(e.detail.id)}
|
|
@@ -2130,6 +2164,7 @@ let FigureEditor = class FigureEditor extends LitElement {
|
|
|
2130
2164
|
.fan=${this.fanOf(shown, live)}
|
|
2131
2165
|
.ghost=${this.previewShown().ghost}
|
|
2132
2166
|
.highlight=${this.previewShown().highlight}
|
|
2167
|
+
.marks=${this.tab === 'capability' ? this.slotMarks(view, asset) : NO_MARKS}
|
|
2133
2168
|
.palette=${view.palette ?? {}}
|
|
2134
2169
|
.context=${view.context ?? ''}
|
|
2135
2170
|
.selected=${this.selected}
|