@things-factory/figure-ui 10.1.129 → 10.1.141
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/modeller/align.ts +24 -18
- package/client/modeller/editor.ts +165 -253
- package/client/modeller/fasten-geometry.ts +12 -9
- package/client/modeller/figure-facts.ts +12 -14
- package/client/modeller/figure-links.ts +16 -12
- package/client/modeller/figure-preview.ts +13 -4
- package/client/modeller/figure-properties.ts +6 -5
- package/client/modeller/figure-verdict.ts +14 -8
- package/client/modeller/joint-fan.ts +15 -17
- package/client/modeller/links.ts +17 -23
- package/client/modeller/live.ts +6 -3
- package/client/modeller/motion-ends.ts +6 -7
- package/client/modeller/occupancy.ts +2 -3
- package/client/modeller/product-session.ts +15 -0
- package/client/modeller/revision.ts +66 -0
- package/client/pages/figure-modeller-page.ts +5 -18
- package/dist-client/modeller/align.d.ts +12 -7
- package/dist-client/modeller/align.js +21 -17
- package/dist-client/modeller/align.js.map +1 -1
- package/dist-client/modeller/editor.d.ts +8 -34
- package/dist-client/modeller/editor.js +175 -250
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/fasten-geometry.d.ts +3 -2
- package/dist-client/modeller/fasten-geometry.js +11 -9
- package/dist-client/modeller/fasten-geometry.js.map +1 -1
- package/dist-client/modeller/figure-facts.d.ts +9 -1
- package/dist-client/modeller/figure-facts.js +11 -15
- package/dist-client/modeller/figure-facts.js.map +1 -1
- package/dist-client/modeller/figure-links.d.ts +4 -5
- package/dist-client/modeller/figure-links.js +14 -13
- package/dist-client/modeller/figure-links.js.map +1 -1
- package/dist-client/modeller/figure-preview.d.ts +5 -2
- package/dist-client/modeller/figure-preview.js +13 -4
- package/dist-client/modeller/figure-preview.js.map +1 -1
- package/dist-client/modeller/figure-properties.d.ts +3 -2
- package/dist-client/modeller/figure-properties.js +6 -6
- package/dist-client/modeller/figure-properties.js.map +1 -1
- package/dist-client/modeller/figure-verdict.d.ts +4 -2
- package/dist-client/modeller/figure-verdict.js +12 -9
- package/dist-client/modeller/figure-verdict.js.map +1 -1
- package/dist-client/modeller/joint-fan.d.ts +8 -4
- package/dist-client/modeller/joint-fan.js +15 -16
- package/dist-client/modeller/joint-fan.js.map +1 -1
- package/dist-client/modeller/links.d.ts +6 -5
- package/dist-client/modeller/links.js +17 -24
- package/dist-client/modeller/links.js.map +1 -1
- package/dist-client/modeller/live.d.ts +3 -2
- package/dist-client/modeller/live.js +7 -3
- package/dist-client/modeller/live.js.map +1 -1
- package/dist-client/modeller/motion-ends.d.ts +2 -2
- package/dist-client/modeller/motion-ends.js +5 -6
- package/dist-client/modeller/motion-ends.js.map +1 -1
- package/dist-client/modeller/occupancy.d.ts +2 -2
- package/dist-client/modeller/occupancy.js +2 -3
- package/dist-client/modeller/occupancy.js.map +1 -1
- package/dist-client/modeller/product-session.d.ts +44 -39
- package/dist-client/modeller/product-session.js +17 -0
- package/dist-client/modeller/product-session.js.map +1 -1
- package/dist-client/modeller/revision.d.ts +37 -0
- package/dist-client/modeller/revision.js +39 -0
- package/dist-client/modeller/revision.js.map +1 -0
- package/dist-client/pages/figure-modeller-page.d.ts +0 -6
- package/dist-client/pages/figure-modeller-page.js +6 -14
- package/dist-client/pages/figure-modeller-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/test/align.test.ts +14 -12
- package/test/browser/modeller-page.js +52 -4
- package/test/browser/modeller-revision.check.mjs +144 -0
- package/test/command-preview.test.ts +9 -8
- package/test/fasten-drawing.test.ts +1 -1
- package/test/fasten-geometry.test.ts +10 -9
- package/test/fields.test.ts +1 -1
- package/test/first-minute.test.ts +1 -1
- package/test/gizmo.test.ts +1 -1
- package/test/joint-fan.test.ts +30 -14
- package/test/joint-frames.test.ts +9 -8
- package/test/links.test.ts +13 -12
- package/test/live.test.ts +3 -3
- package/test/parts-wiring.test.ts +1 -1
- package/test/properties.test.ts +6 -5
- package/test/release-panel.test.ts +3 -3
- package/test/resize-with-placement.test.ts +8 -6
- package/test/revision-of.ts +22 -0
- package/test/revision.test.ts +172 -0
- package/test/section-editor.test.ts +4 -3
- package/test/section-panel.test.ts +5 -4
- package/test/verdict.test.ts +1 -1
- package/client/modeller/evaluated.ts +0 -47
- package/dist-client/modeller/evaluated.d.ts +0 -12
- package/dist-client/modeller/evaluated.js +0 -42
- package/dist-client/modeller/evaluated.js.map +0 -1
- package/dist-client/tsconfig.scratch.tsbuildinfo +0 -1
- package/test/evaluated.test.ts +0 -40
- package/test/mode-switch.test.ts +0 -43
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { compileFigureAsset } from '@hatiolab/figure-model'
|
|
2
|
-
import type { FigureAsset } from '@hatiolab/figure-model'
|
|
3
|
-
|
|
4
|
-
type Geometry = ReturnType<ReturnType<typeof compileFigureAsset>['evaluate']>['geometry']
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A figure evaluated, held by the asset object it was asked of and the values it was asked under. One selection asks
|
|
8
|
-
* several questions of the same figure as it stands (a part's box, the grid, where a fastening keeps it, the fan of a
|
|
9
|
-
* joint), and each of them evaluated the whole figure again. Another asset object, or other values, is asked afresh.
|
|
10
|
-
* The geometry is read, never changed.
|
|
11
|
-
*/
|
|
12
|
-
const held = new WeakMap<object, Map<string, Geometry>>()
|
|
13
|
-
|
|
14
|
-
/** The values in hand that belong to a record's keys (design inputs, or state defaults). */
|
|
15
|
-
const pick = (values: Record<string, number>, of: Record<string, number>) => Object.fromEntries(Object.entries(values).filter(([id]) => id in of))
|
|
16
|
-
|
|
17
|
-
/** The values the asset reads, in one order: the same inputs are one question however they were listed. */
|
|
18
|
-
const keyOf = (own: Record<string, number>, state: Record<string, number>) =>
|
|
19
|
-
JSON.stringify([Object.entries(own).sort(([a], [b]) => (a < b ? -1 : 1)), Object.entries(state).sort(([a], [b]) => (a < b ? -1 : 1))])
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Tells the questions asked of this asset the answer already in hand -- the geometry the session evaluated for this
|
|
23
|
-
* figure under these values -- so the screen does not evaluate what the workspace has just evaluated. The caller says it
|
|
24
|
-
* is the same figure: the asset is the session's text at that version, the values its inputs. Nothing is checked here.
|
|
25
|
-
*/
|
|
26
|
-
export function seedEvaluatedGeometry(asset: FigureAsset, values: Record<string, number>, geometry: Geometry): void {
|
|
27
|
-
let mine = held.get(asset)
|
|
28
|
-
if (!mine) held.set(asset, (mine = new Map()))
|
|
29
|
-
mine.set(keyOf(pick(values, asset.designInputs), pick(values, asset.stateDefaults)), geometry)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** `values` left out evaluates the asset as it is; given, they replace the design inputs and state defaults they name. */
|
|
33
|
-
export function evaluatedGeometryOf(asset: FigureAsset, values?: Record<string, number>): Geometry {
|
|
34
|
-
const own = values ? pick(values, asset.designInputs) : undefined
|
|
35
|
-
const state = values ? pick(values, asset.stateDefaults) : undefined
|
|
36
|
-
const key = values ? keyOf(own!, state!) : ''
|
|
37
|
-
let mine = held.get(asset)
|
|
38
|
-
if (!mine) held.set(asset, (mine = new Map()))
|
|
39
|
-
let geometry = mine.get(key)
|
|
40
|
-
if (!geometry) {
|
|
41
|
-
if (mine.size >= 8) mine.clear()
|
|
42
|
-
const source = values ? { ...asset, designInputs: { ...asset.designInputs, ...own }, stateDefaults: { ...asset.stateDefaults, ...state } } : asset
|
|
43
|
-
geometry = compileFigureAsset(source).evaluate().geometry
|
|
44
|
-
mine.set(key, geometry)
|
|
45
|
-
}
|
|
46
|
-
return geometry
|
|
47
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { compileFigureAsset } from '@hatiolab/figure-model';
|
|
2
|
-
import type { FigureAsset } from '@hatiolab/figure-model';
|
|
3
|
-
type Geometry = ReturnType<ReturnType<typeof compileFigureAsset>['evaluate']>['geometry'];
|
|
4
|
-
/**
|
|
5
|
-
* Tells the questions asked of this asset the answer already in hand -- the geometry the session evaluated for this
|
|
6
|
-
* figure under these values -- so the screen does not evaluate what the workspace has just evaluated. The caller says it
|
|
7
|
-
* is the same figure: the asset is the session's text at that version, the values its inputs. Nothing is checked here.
|
|
8
|
-
*/
|
|
9
|
-
export declare function seedEvaluatedGeometry(asset: FigureAsset, values: Record<string, number>, geometry: Geometry): void;
|
|
10
|
-
/** `values` left out evaluates the asset as it is; given, they replace the design inputs and state defaults they name. */
|
|
11
|
-
export declare function evaluatedGeometryOf(asset: FigureAsset, values?: Record<string, number>): Geometry;
|
|
12
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { compileFigureAsset } from '@hatiolab/figure-model';
|
|
2
|
-
/**
|
|
3
|
-
* A figure evaluated, held by the asset object it was asked of and the values it was asked under. One selection asks
|
|
4
|
-
* several questions of the same figure as it stands (a part's box, the grid, where a fastening keeps it, the fan of a
|
|
5
|
-
* joint), and each of them evaluated the whole figure again. Another asset object, or other values, is asked afresh.
|
|
6
|
-
* The geometry is read, never changed.
|
|
7
|
-
*/
|
|
8
|
-
const held = new WeakMap();
|
|
9
|
-
/** The values in hand that belong to a record's keys (design inputs, or state defaults). */
|
|
10
|
-
const pick = (values, of) => Object.fromEntries(Object.entries(values).filter(([id]) => id in of));
|
|
11
|
-
/** The values the asset reads, in one order: the same inputs are one question however they were listed. */
|
|
12
|
-
const keyOf = (own, state) => JSON.stringify([Object.entries(own).sort(([a], [b]) => (a < b ? -1 : 1)), Object.entries(state).sort(([a], [b]) => (a < b ? -1 : 1))]);
|
|
13
|
-
/**
|
|
14
|
-
* Tells the questions asked of this asset the answer already in hand -- the geometry the session evaluated for this
|
|
15
|
-
* figure under these values -- so the screen does not evaluate what the workspace has just evaluated. The caller says it
|
|
16
|
-
* is the same figure: the asset is the session's text at that version, the values its inputs. Nothing is checked here.
|
|
17
|
-
*/
|
|
18
|
-
export function seedEvaluatedGeometry(asset, values, geometry) {
|
|
19
|
-
let mine = held.get(asset);
|
|
20
|
-
if (!mine)
|
|
21
|
-
held.set(asset, (mine = new Map()));
|
|
22
|
-
mine.set(keyOf(pick(values, asset.designInputs), pick(values, asset.stateDefaults)), geometry);
|
|
23
|
-
}
|
|
24
|
-
/** `values` left out evaluates the asset as it is; given, they replace the design inputs and state defaults they name. */
|
|
25
|
-
export function evaluatedGeometryOf(asset, values) {
|
|
26
|
-
const own = values ? pick(values, asset.designInputs) : undefined;
|
|
27
|
-
const state = values ? pick(values, asset.stateDefaults) : undefined;
|
|
28
|
-
const key = values ? keyOf(own, state) : '';
|
|
29
|
-
let mine = held.get(asset);
|
|
30
|
-
if (!mine)
|
|
31
|
-
held.set(asset, (mine = new Map()));
|
|
32
|
-
let geometry = mine.get(key);
|
|
33
|
-
if (!geometry) {
|
|
34
|
-
if (mine.size >= 8)
|
|
35
|
-
mine.clear();
|
|
36
|
-
const source = values ? { ...asset, designInputs: { ...asset.designInputs, ...own }, stateDefaults: { ...asset.stateDefaults, ...state } } : asset;
|
|
37
|
-
geometry = compileFigureAsset(source).evaluate().geometry;
|
|
38
|
-
mine.set(key, geometry);
|
|
39
|
-
}
|
|
40
|
-
return geometry;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=evaluated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evaluated.js","sourceRoot":"","sources":["../../client/modeller/evaluated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAK3D;;;;;GAKG;AACH,MAAM,IAAI,GAAG,IAAI,OAAO,EAAiC,CAAA;AAEzD,4FAA4F;AAC5F,MAAM,IAAI,GAAG,CAAC,MAA8B,EAAE,EAA0B,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAElJ,2GAA2G;AAC3G,MAAM,KAAK,GAAG,CAAC,GAA2B,EAAE,KAA6B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aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACpE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAI,EAAE,KAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,IAAI,CAAC,IAAI;QAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAA;IAC9C,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,EAAE,GAAG,KAAK,CAAC,YAAY,EAAE,GAAG,GAAG,EAAE,EAAE,aAAa,EAAE,EAAE,GAAG,KAAK,CAAC,aAAa,EAAE,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;QAClJ,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAA;QACzD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACzB,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC","sourcesContent":["import { compileFigureAsset } from '@hatiolab/figure-model'\nimport type { FigureAsset } from '@hatiolab/figure-model'\n\ntype Geometry = ReturnType<ReturnType<typeof compileFigureAsset>['evaluate']>['geometry']\n\n/**\n * A figure evaluated, held by the asset object it was asked of and the values it was asked under. One selection asks\n * several questions of the same figure as it stands (a part's box, the grid, where a fastening keeps it, the fan of a\n * joint), and each of them evaluated the whole figure again. Another asset object, or other values, is asked afresh.\n * The geometry is read, never changed.\n */\nconst held = new WeakMap<object, Map<string, Geometry>>()\n\n/** The values in hand that belong to a record's keys (design inputs, or state defaults). */\nconst pick = (values: Record<string, number>, of: Record<string, number>) => Object.fromEntries(Object.entries(values).filter(([id]) => id in of))\n\n/** The values the asset reads, in one order: the same inputs are one question however they were listed. */\nconst keyOf = (own: Record<string, number>, state: Record<string, number>) =>\n JSON.stringify([Object.entries(own).sort(([a], [b]) => (a < b ? -1 : 1)), Object.entries(state).sort(([a], [b]) => (a < b ? -1 : 1))])\n\n/**\n * Tells the questions asked of this asset the answer already in hand -- the geometry the session evaluated for this\n * figure under these values -- so the screen does not evaluate what the workspace has just evaluated. The caller says it\n * is the same figure: the asset is the session's text at that version, the values its inputs. Nothing is checked here.\n */\nexport function seedEvaluatedGeometry(asset: FigureAsset, values: Record<string, number>, geometry: Geometry): void {\n let mine = held.get(asset)\n if (!mine) held.set(asset, (mine = new Map()))\n mine.set(keyOf(pick(values, asset.designInputs), pick(values, asset.stateDefaults)), geometry)\n}\n\n/** `values` left out evaluates the asset as it is; given, they replace the design inputs and state defaults they name. */\nexport function evaluatedGeometryOf(asset: FigureAsset, values?: Record<string, number>): Geometry {\n const own = values ? pick(values, asset.designInputs) : undefined\n const state = values ? pick(values, asset.stateDefaults) : undefined\n const key = values ? keyOf(own!, state!) : ''\n let mine = held.get(asset)\n if (!mine) held.set(asset, (mine = new Map()))\n let geometry = mine.get(key)\n if (!geometry) {\n if (mine.size >= 8) mine.clear()\n const source = values ? { ...asset, designInputs: { ...asset.designInputs, ...own }, stateDefaults: { ...asset.stateDefaults, ...state } } : asset\n geometry = compileFigureAsset(source).evaluate().geometry\n mine.set(key, geometry)\n }\n return geometry\n}\n"]}
|