@things-factory/figure-viewer 10.1.291 → 10.1.302

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.
@@ -15,11 +15,25 @@ export interface Control {
15
15
  sweep: number;
16
16
  /** A slider step: one degree for an angle, else a hundredth of the range. */
17
17
  step: number;
18
+ /**
19
+ * The hold whose starting pose solves this control (ADR-0217), when one does: its start is worked out from the others,
20
+ * never written by hand, so keeping a pose leaves it out and the hold solves it again for the pose kept.
21
+ */
22
+ heldBy?: string;
18
23
  }
24
+ /** The controls a starting-pose hold solves, each with the hold that solves it. */
25
+ export declare function heldAtStartOf(asset: FigureAsset): Map<string, string>;
19
26
  export declare function controlsOf(asset: FigureAsset, values?: Record<string, number>): Control[];
20
- /** Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. */
27
+ /**
28
+ * Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. A control a hold
29
+ * solves is not the person's to keep.
30
+ */
21
31
  export declare const poseDiffers: (controls: readonly Control[]) => boolean;
22
- /** The current pose as the defaults: one `set-state-defaults` edit. */
32
+ /**
33
+ * The current pose as the defaults: one `set-state-defaults` edit. The controls a starting-pose hold solves are left
34
+ * out: the kernel refuses them (HOLD_OWNED), and solves them again for the pose kept (2026-11-21: on a figure with such
35
+ * a hold no pose could be kept).
36
+ */
23
37
  export declare const poseAsDefault: (controls: readonly Control[]) => {
24
38
  kind: "set-state-defaults";
25
39
  values: {
@@ -1,4 +1,9 @@
1
+ /** The controls a starting-pose hold solves, each with the hold that solves it. */
2
+ export function heldAtStartOf(asset) {
3
+ return new Map((asset.holds ?? []).filter(h => h.clip === undefined).flatMap(h => h.by.map(state => [state, h.id])));
4
+ }
1
5
  export function controlsOf(asset, values = {}) {
6
+ const held = heldAtStartOf(asset);
2
7
  return asset.document.model.inputs
3
8
  .filter(input => input.role === 'state')
4
9
  .map(input => {
@@ -14,15 +19,23 @@ export function controlsOf(asset, values = {}) {
14
19
  value: values[input.id] ?? start,
15
20
  start,
16
21
  sweep: policy?.sweep ?? 0,
17
- step: input.unit === 'deg' ? 1 : (input.max - input.min) / 100
22
+ step: input.unit === 'deg' ? 1 : (input.max - input.min) / 100,
23
+ ...(held.has(input.id) ? { heldBy: held.get(input.id) } : {})
18
24
  };
19
25
  });
20
26
  }
21
- /** Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. */
22
- export const poseDiffers = (controls) => controls.some(c => c.value !== c.start);
23
- /** The current pose as the defaults: one `set-state-defaults` edit. */
27
+ /**
28
+ * Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. A control a hold
29
+ * solves is not the person's to keep.
30
+ */
31
+ export const poseDiffers = (controls) => controls.some(c => !c.heldBy && c.value !== c.start);
32
+ /**
33
+ * The current pose as the defaults: one `set-state-defaults` edit. The controls a starting-pose hold solves are left
34
+ * out: the kernel refuses them (HOLD_OWNED), and solves them again for the pose kept (2026-11-21: on a figure with such
35
+ * a hold no pose could be kept).
36
+ */
24
37
  export const poseAsDefault = (controls) => ({
25
38
  kind: 'set-state-defaults',
26
- values: Object.fromEntries(controls.map(c => [c.id, c.value]))
39
+ values: Object.fromEntries(controls.filter(c => !c.heldBy).map(c => [c.id, c.value]))
27
40
  });
28
41
  //# sourceMappingURL=controls.js.map
@@ -13,7 +13,7 @@ export declare class FigureDataList extends FigureDataList_base {
13
13
  static styles: import("lit").CSSResult[];
14
14
  report?: FigureDataReport;
15
15
  private copied;
16
- render(): typeof nothing | import("lit-html").TemplateResult<1>;
16
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
17
17
  private renderRow;
18
18
  private copy;
19
19
  }
@@ -12,6 +12,6 @@ export declare class FigureFactsList extends FigureFactsList_base {
12
12
  static styles: import("lit").CSSResult;
13
13
  asset?: FigureAsset;
14
14
  row?: DetailFactsRow;
15
- render(): typeof nothing | import("lit-html").TemplateResult<1>;
15
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
16
16
  }
17
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-viewer",
3
- "version": "10.1.291",
3
+ "version": "10.1.302",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "files": [
@@ -49,5 +49,5 @@
49
49
  "@things-factory/styles": "^10.1.281",
50
50
  "lit": "^3.1.2"
51
51
  },
52
- "gitHead": "994bc91b2d71513039c204560bb0571baa92ca0b"
52
+ "gitHead": "2e754aaeafcd39f5c6f4b7c8847a6c60ffe0789c"
53
53
  }
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "design values",
80
80
  "label.state-values": "state values",
81
81
  "label.clip-speeds": "clip speeds",
82
+ "label.clip-travel": "clip travel",
82
83
  "label.motion-groups": "motion groups",
83
84
  "label.slot-layout": "Slot layout",
84
85
  "figure.label.data-item-id": "item id",
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "valores de diseño",
80
80
  "label.state-values": "valores de estado",
81
81
  "label.clip-speeds": "velocidades de los clips",
82
+ "label.clip-travel": "desplazamiento de los clips",
82
83
  "label.motion-groups": "grupos de movimiento",
83
84
  "label.slot-layout": "Disposición de posiciones",
84
85
  "figure.label.data-item-id": "id del artículo",
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "設計値",
80
80
  "label.state-values": "状態値",
81
81
  "label.clip-speeds": "クリップ速度",
82
+ "label.clip-travel": "クリップの移動",
82
83
  "label.motion-groups": "モーショングループ",
83
84
  "label.slot-layout": "位置の配置",
84
85
  "figure.label.data-item-id": "アイテムID",
@@ -30,13 +30,13 @@
30
30
  "figure.label.tags": "태그",
31
31
  "figure.label.what-this-does": "기능",
32
32
  "figure.text.detail-no-motion": "등록된 움직임이 없습니다.",
33
- "figure.text.detail-clip-by-data": "{clip} 클립은 이 피규어의 데이터가 고르는데, 그 클립이 되는 데이터 값이 없어 여기서 재생할 수 없습니다.",
33
+ "figure.text.detail-clip-by-data": "{clip} 클립은 이 피규어의 데이터가 선택하는데, 그 클립이 되는 데이터 값이 없어 여기서 재생할 수 없습니다.",
34
34
  "figure.text.detail-thumbnail-failed": "썸네일을 저장하지 못했습니다. 다시 시도하세요.",
35
35
  "figure.text.detail-thumbnail-saved": "썸네일로 저장했습니다",
36
36
  "figure.text.not-measured-yet": "미측정",
37
37
  "figure.text.place-accepts": "받는 것 {accepts}",
38
38
  "figure.text.place-accepts-any": "받는 것 모든 아이템",
39
- "figure.text.board-data-none": "이 피규어는 데이터 형식이 없습니다. 하나만 고르면 보입니다.",
39
+ "figure.text.board-data-none": "이 피규어는 데이터 형식이 없습니다. 하나만 선택하면 보입니다.",
40
40
  "figure.label.board-data-source-live": "데이터",
41
41
  "figure.label.board-data-source-manual": "저장값",
42
42
  "figure.label.board-data-source-default": "기본값",
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "설계값",
80
80
  "label.state-values": "상태값",
81
81
  "label.clip-speeds": "애니메이션 속도",
82
+ "label.clip-travel": "달리는 클립의 이동",
82
83
  "label.motion-groups": "동작 그룹",
83
84
  "label.slot-layout": "자리 배치",
84
85
  "figure.label.data-item-id": "아이템 ID",
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "nilai reka bentuk",
80
80
  "label.state-values": "nilai keadaan",
81
81
  "label.clip-speeds": "kelajuan klip",
82
+ "label.clip-travel": "gerakan klip",
82
83
  "label.motion-groups": "kumpulan gerakan",
83
84
  "label.slot-layout": "Susunan kedudukan",
84
85
  "figure.label.data-item-id": "id item",
@@ -79,6 +79,7 @@
79
79
  "label.design-inputs": "设计值",
80
80
  "label.state-values": "状态值",
81
81
  "label.clip-speeds": "动画速度",
82
+ "label.clip-travel": "片段位移",
82
83
  "label.motion-groups": "动作组",
83
84
  "label.slot-layout": "位置布局",
84
85
  "figure.label.data-item-id": "物品 ID",