@things-factory/figure-viewer 10.1.247 → 10.1.258
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/data-connection.ts +82 -0
- package/client/data-words.ts +31 -0
- package/client/figure-asset-viewer.ts +124 -10
- package/client/figure-data-list.ts +87 -0
- package/client/figure-data-report.ts +142 -0
- package/client/index.ts +5 -0
- package/client/unit-words.ts +11 -0
- package/dist-client/data-connection.d.ts +32 -0
- package/dist-client/data-connection.js +49 -0
- package/dist-client/data-connection.js.map +1 -0
- package/dist-client/data-words.d.ts +9 -0
- package/dist-client/data-words.js +25 -0
- package/dist-client/data-words.js.map +1 -0
- package/dist-client/figure-asset-viewer.d.ts +13 -3
- package/dist-client/figure-asset-viewer.js +115 -7
- package/dist-client/figure-asset-viewer.js.map +1 -1
- package/dist-client/figure-data-list.d.ts +25 -0
- package/dist-client/figure-data-list.js +88 -0
- package/dist-client/figure-data-list.js.map +1 -0
- package/dist-client/figure-data-report.d.ts +59 -0
- package/dist-client/figure-data-report.js +96 -0
- package/dist-client/figure-data-report.js.map +1 -0
- package/dist-client/index.d.ts +5 -0
- package/dist-client/index.js +5 -0
- package/dist-client/index.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/unit-words.d.ts +5 -0
- package/dist-client/unit-words.js +12 -0
- package/dist-client/unit-words.js.map +1 -0
- package/package.json +4 -4
- package/test/data-connection.test.ts +35 -0
- package/test/detail-motion.test.ts +3 -1
- package/test/figure-data-report.test.ts +88 -0
- package/translations/en.json +67 -1
- package/translations/es.json +67 -1
- package/translations/ja.json +67 -1
- package/translations/ko.json +67 -1
- package/translations/ms.json +67 -1
- package/translations/zh.json +67 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { figureDataRows } from '@hatiolab/figure-model';
|
|
2
|
+
export const methodOf = (b) => (b.rule === 'table' ? (b.lookup === 'code' ? 'code' : 'ranges') : b.rule);
|
|
3
|
+
export function dataMoveOf(asset, move) {
|
|
4
|
+
const groupLabel = (id) => (asset.motionGroups ?? []).find(g => g.id === id)?.label ?? id;
|
|
5
|
+
const inputLabel = (id) => asset.stateInputs?.[id]?.label ?? id;
|
|
6
|
+
switch (move.kind) {
|
|
7
|
+
case 'table':
|
|
8
|
+
return {
|
|
9
|
+
kind: 'table',
|
|
10
|
+
name: [...(move.targets.parts ?? []), ...(move.targets.inputs ?? []).map(inputLabel), ...(move.targets.group ? [groupLabel(move.targets.group)] : [])].join(', ')
|
|
11
|
+
};
|
|
12
|
+
case 'state':
|
|
13
|
+
return { kind: move.kind, name: inputLabel(move.input) };
|
|
14
|
+
case 'palette':
|
|
15
|
+
return { kind: move.kind, name: move.token };
|
|
16
|
+
case 'pose':
|
|
17
|
+
return { kind: move.kind, name: move.axis };
|
|
18
|
+
case 'items':
|
|
19
|
+
return { kind: move.kind, name: move.slot ?? asset.document.capabilities.slotLayout?.label ?? 'items' };
|
|
20
|
+
default:
|
|
21
|
+
return { kind: move.kind, name: groupLabel(move.group) };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const ITEM_FIELDS = ['id', 'type', 'place', 'stack', 'status'];
|
|
25
|
+
export function dataConnectionsOf(asset) {
|
|
26
|
+
const di = asset.dataInterface;
|
|
27
|
+
if (!di)
|
|
28
|
+
return [];
|
|
29
|
+
const nodes = new Map(figureDataRows(di).map(r => [r.path, r.node]));
|
|
30
|
+
return di.bindings.map((b) => {
|
|
31
|
+
const node = nodes.get(b.accessor.replace(/\[\d+\]/g, '[]'));
|
|
32
|
+
const out = {
|
|
33
|
+
id: b.id,
|
|
34
|
+
field: b.label ?? b.accessor,
|
|
35
|
+
accessor: b.accessor,
|
|
36
|
+
...(node ? { node } : {}),
|
|
37
|
+
method: methodOf(b),
|
|
38
|
+
move: dataMoveOf(asset, b.rule === 'table' ? { kind: 'table', targets: b.targets } : b.behavior)
|
|
39
|
+
};
|
|
40
|
+
if (b.rule !== 'table' && b.behavior.kind === 'items') {
|
|
41
|
+
const behavior = b.behavior;
|
|
42
|
+
const fields = Object.fromEntries(ITEM_FIELDS.flatMap(f => (behavior[f] ? [[f, behavior[f]]] : [])));
|
|
43
|
+
if (Object.keys(fields).length)
|
|
44
|
+
out.itemFields = fields;
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=data-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-connection.js","sourceRoot":"","sources":["../client/data-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkH,MAAM,wBAAwB,CAAA;AAUvK,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAoB,EAAc,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAWvI,MAAM,UAAU,UAAU,CAAC,KAAkB,EAAE,IAAwE;IACrH,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE,CAAA;IACjG,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE,CAAA;IACvE,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE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CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;YACrG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;gBAAE,GAAG,CAAC,UAAU,GAAG,MAAM,CAAA;QACzD,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { figureDataRows, type FigureAsset, type FigureDataBehavior, type FigureDataBinding, type FigureDataNode, type FigureDataTargets } from '@hatiolab/figure-model'\n\n/*\n * A figure's connections as a person reads them (ADR-0051 §8, ADR-0166): for each, the data field, what it moves and how\n * -- the line the modeller's 「연결」 heads each connection with, the preview's 「데이터」 tab lists, and the board's\n * 「피규어 데이터」 says beside a field. Words are the screens'; this reads the asset only, so it is tested without one.\n */\n\n/** How a value becomes what it moves: as it is, scaled, or a table by code or by interval. */\nexport type DataMethod = 'value' | 'scale' | 'code' | 'ranges'\nexport const methodOf = (b: FigureDataBinding): DataMethod => (b.rule === 'table' ? (b.lookup === 'code' ? 'code' : 'ranges') : b.rule)\n\n/**\n * What a connection moves and the name a person knows it by: a control's label, a colour token, a motion group's label,\n * an axis, the places the items go into; a table's targets, joined.\n */\nexport interface DataMove {\n kind: FigureDataBehavior['kind'] | 'table'\n name: string\n}\n\nexport function dataMoveOf(asset: FigureAsset, move: FigureDataBehavior | { kind: 'table'; targets: FigureDataTargets }): DataMove {\n const groupLabel = (id: string) => (asset.motionGroups ?? []).find(g => g.id === id)?.label ?? id\n const inputLabel = (id: string) => asset.stateInputs?.[id]?.label ?? id\n switch (move.kind) {\n case 'table':\n return {\n kind: 'table',\n name: [...(move.targets.parts ?? []), ...(move.targets.inputs ?? []).map(inputLabel), ...(move.targets.group ? [groupLabel(move.targets.group)] : [])].join(', ')\n }\n case 'state':\n return { kind: move.kind, name: inputLabel(move.input) }\n case 'palette':\n return { kind: move.kind, name: move.token }\n case 'pose':\n return { kind: move.kind, name: move.axis }\n case 'items':\n return { kind: move.kind, name: move.slot ?? asset.document.capabilities.slotLayout?.label ?? 'items' }\n default:\n return { kind: move.kind, name: groupLabel(move.group) }\n }\n}\n\n/** What a field of an items list's element says of the item (FigureDataBehavior `items`). */\nexport type FigureItemField = 'id' | 'type' | 'place' | 'stack' | 'status'\nexport const ITEM_FIELDS: readonly FigureItemField[] = ['id', 'type', 'place', 'stack', 'status']\n\nexport interface DataConnection {\n id: string\n /** The connection's label, else its accessor. */\n field: string\n accessor: string\n /** What the data has at the accessor; absent when the shape does not reach it. */\n node?: FigureDataNode\n method: DataMethod\n move: DataMove\n /** An items connection: the element's field that says each part of an item. */\n itemFields?: Partial<Record<FigureItemField, string>>\n}\n\nexport function dataConnectionsOf(asset: FigureAsset): DataConnection[] {\n const di = asset.dataInterface\n if (!di) return []\n const nodes = new Map(figureDataRows(di).map(r => [r.path, r.node] as const))\n return di.bindings.map((b): DataConnection => {\n const node = nodes.get(b.accessor.replace(/\\[\\d+\\]/g, '[]'))\n const out: DataConnection = {\n id: b.id,\n field: b.label ?? b.accessor,\n accessor: b.accessor,\n ...(node ? { node } : {}),\n method: methodOf(b),\n move: dataMoveOf(asset, b.rule === 'table' ? { kind: 'table', targets: b.targets } : b.behavior)\n }\n if (b.rule !== 'table' && b.behavior.kind === 'items') {\n const behavior = b.behavior\n const fields = Object.fromEntries(ITEM_FIELDS.flatMap(f => (behavior[f] ? [[f, behavior[f]!]] : [])))\n if (Object.keys(fields).length) out.itemFields = fields\n }\n return out\n })\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FigureDataNode } from '@hatiolab/figure-model';
|
|
2
|
+
import type { DataMethod, DataMove, FigureItemField } from './data-connection.js';
|
|
3
|
+
/** What a connection moves: 「조작값 리프트」, 「몸체 색」, 「이동 클립」; a table's targets as they are. */
|
|
4
|
+
export declare const moveWords: (m: DataMove) => string;
|
|
5
|
+
export declare const methodWords: (m: DataMethod) => string;
|
|
6
|
+
/** A field's kind, with a number's unit and range, a closed text's values and a list's element kind. */
|
|
7
|
+
export declare function kindWords(node: FigureDataNode): string;
|
|
8
|
+
/** The part of an item a list element's field says: 「아이템 ID」, 「놓일 자리」. */
|
|
9
|
+
export declare const itemFieldWords: (f: FigureItemField) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { i18next } from '@operato/i18n';
|
|
2
|
+
import { unitWord } from './unit-words.js';
|
|
3
|
+
/*
|
|
4
|
+
* The words a figure's data is said in, one set for every screen: the modeller's 「연결」, the preview's 「데이터」 and the
|
|
5
|
+
* board's 「피규어 데이터」.
|
|
6
|
+
*/
|
|
7
|
+
/** What a connection moves: 「조작값 리프트」, 「몸체 색」, 「이동 클립」; a table's targets as they are. */
|
|
8
|
+
export const moveWords = (m) => m.kind === 'table' ? m.name : i18next.t('figure.label.data-behavior-' + m.kind, { name: m.kind === 'pose' ? i18next.t('figure.label.data-axis-' + m.name) : m.name });
|
|
9
|
+
export const methodWords = (m) => i18next.t('figure.label.data-method-' + m);
|
|
10
|
+
/** A field's kind, with a number's unit and range, a closed text's values and a list's element kind. */
|
|
11
|
+
export function kindWords(node) {
|
|
12
|
+
const kind = i18next.t('figure.label.data-kind-' + node.kind);
|
|
13
|
+
if (node.kind === 'number') {
|
|
14
|
+
const range = node.min !== undefined || node.max !== undefined ? ` ${node.min ?? ''}~${node.max ?? ''}` : '';
|
|
15
|
+
return `${kind}${node.unit ? ` ${unitWord(node.unit)}` : ''}${range}`;
|
|
16
|
+
}
|
|
17
|
+
if (node.kind === 'text' && node.values)
|
|
18
|
+
return `${kind} (${node.values.join(', ')})`;
|
|
19
|
+
if (node.kind === 'list')
|
|
20
|
+
return `${kind} · ${i18next.t('figure.label.data-kind-' + node.item.kind)}`;
|
|
21
|
+
return kind;
|
|
22
|
+
}
|
|
23
|
+
/** The part of an item a list element's field says: 「아이템 ID」, 「놓일 자리」. */
|
|
24
|
+
export const itemFieldWords = (f) => i18next.t('figure.label.data-item-' + f);
|
|
25
|
+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,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAA;IACvE,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;IACrF,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,yBAAyB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;IACrG,OAAO,IAAI,CAAA;AACb,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAkB,EAAU,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,GAAG,CAAC,CAAC,CAAA","sourcesContent":["import { i18next } from '@operato/i18n'\nimport type { FigureDataNode } from '@hatiolab/figure-model'\n\nimport type { DataMethod, DataMove, FigureItemField } from './data-connection.js'\nimport { unitWord } from './unit-words.js'\n\n/*\n * The words a figure's data is said in, one set for every screen: the modeller's 「연결」, the preview's 「데이터」 and the\n * board's 「피규어 데이터」.\n */\n\n/** What a connection moves: 「조작값 리프트」, 「몸체 색」, 「이동 클립」; a table's targets as they are. */\nexport const moveWords = (m: DataMove): string =>\n m.kind === 'table' ? m.name : i18next.t('figure.label.data-behavior-' + m.kind, { name: m.kind === 'pose' ? i18next.t('figure.label.data-axis-' + m.name) : m.name })\n\nexport const methodWords = (m: DataMethod): string => i18next.t('figure.label.data-method-' + m)\n\n/** A field's kind, with a number's unit and range, a closed text's values and a list's element kind. */\nexport function kindWords(node: FigureDataNode): string {\n const kind = i18next.t('figure.label.data-kind-' + node.kind)\n if (node.kind === 'number') {\n const range = node.min !== undefined || node.max !== undefined ? ` ${node.min ?? ''}~${node.max ?? ''}` : ''\n return `${kind}${node.unit ? ` ${unitWord(node.unit)}` : ''}${range}`\n }\n if (node.kind === 'text' && node.values) return `${kind} (${node.values.join(', ')})`\n if (node.kind === 'list') return `${kind} · ${i18next.t('figure.label.data-kind-' + node.item.kind)}`\n return kind\n}\n\n/** The part of an item a list element's field says: 「아이템 ID」, 「놓일 자리」. */\nexport const itemFieldWords = (f: FigureItemField): string => i18next.t('figure.label.data-item-' + f)\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { LitElement, type PropertyValues } from 'lit';
|
|
3
3
|
import { type FigureAsset } from '@hatiolab/figure-model';
|
|
4
|
-
/** What the view's tabs show under it: the figure's facts, its size, its motion. */
|
|
5
|
-
export type FigureViewerTab = 'info' | 'size' | 'motion';
|
|
4
|
+
/** What the view's tabs show under it: the figure's facts, its size, its motion, the data it takes. */
|
|
5
|
+
export type FigureViewerTab = 'info' | 'size' | 'motion' | 'data';
|
|
6
6
|
export declare const FIGURE_VIEWER_TABS: readonly FigureViewerTab[];
|
|
7
7
|
declare const FigureAssetViewer_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
8
8
|
/**
|
|
@@ -27,11 +27,14 @@ export declare class FigureAssetViewer extends FigureAssetViewer_base {
|
|
|
27
27
|
private values;
|
|
28
28
|
private playing;
|
|
29
29
|
private error;
|
|
30
|
+
private copied;
|
|
30
31
|
private scene?;
|
|
31
32
|
private registered?;
|
|
32
33
|
private observer?;
|
|
33
34
|
private needsScene;
|
|
34
35
|
private played;
|
|
36
|
+
/** The board component's properties, read from the instance standing here as the board's panel reads them. */
|
|
37
|
+
private exposed;
|
|
35
38
|
/** The board the instance stands on, set when the scene is built; its centre is the grid's origin. */
|
|
36
39
|
private board;
|
|
37
40
|
connectedCallback(): void;
|
|
@@ -39,12 +42,19 @@ export declare class FigureAssetViewer extends FigureAssetViewer_base {
|
|
|
39
42
|
firstUpdated(): void;
|
|
40
43
|
disconnectedCallback(): void;
|
|
41
44
|
render(): import("lit-html").TemplateResult<1>;
|
|
42
|
-
/** The tab strip: the facts, the size, the motion. Arrow keys move along it, as the suite's tabs do. */
|
|
45
|
+
/** The tab strip: the facts, the size, the motion, the data. Arrow keys move along it, as the suite's tabs do. */
|
|
43
46
|
private renderTabs;
|
|
44
47
|
private choose;
|
|
45
48
|
private stepTab;
|
|
46
49
|
private renderSize;
|
|
50
|
+
/** The panel's word for a property and the key a board sets and binds it by. */
|
|
51
|
+
private boardName;
|
|
52
|
+
private renderDesign;
|
|
47
53
|
private renderMotion;
|
|
54
|
+
/** A clip on its own row, played by the mark at its end. */
|
|
55
|
+
private clipRow;
|
|
56
|
+
private renderData;
|
|
57
|
+
private copyExample;
|
|
48
58
|
/**
|
|
49
59
|
* The view as it stands -- turned, zoomed and sized by the person -- as the card's picture, at the size and in the
|
|
50
60
|
* format the modeller's own picture uses (`thumbnail.ts`). Nothing is taken when the view cannot be drawn.
|
|
@@ -5,14 +5,21 @@ import { customElement, property, query, state } from 'lit/decorators.js';
|
|
|
5
5
|
import { i18next, localize } from '@operato/i18n';
|
|
6
6
|
import { ScrollbarStyles } from '@operato/styles';
|
|
7
7
|
import { SurfaceStyles } from '@things-factory/styles';
|
|
8
|
-
import { compileFigureAsset } from '@hatiolab/figure-model';
|
|
8
|
+
import { compileFigureAsset, figureDataExample } from '@hatiolab/figure-model';
|
|
9
9
|
import { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene';
|
|
10
10
|
import { authoredSizeOf, bodyAtSize, previewOneInstance, sizeSpanOf, sizeWithinRange } from './preview-model.js';
|
|
11
11
|
import { controlsOf } from './controls.js';
|
|
12
12
|
import { DEFAULT_VIEW, previewBoardDepth, sceneLook } from './figure-view.js';
|
|
13
13
|
import { SidePanelStyles } from './side-panel-styles.js';
|
|
14
14
|
import { clipPlayOf, clipsDriving, parametersForClip, playSettingsOf } from './detail-motion.js';
|
|
15
|
-
|
|
15
|
+
import { dataConnectionsOf, ITEM_FIELDS } from './data-connection.js';
|
|
16
|
+
import { itemFieldWords, kindWords, methodWords, moveWords } from './data-words.js';
|
|
17
|
+
export const FIGURE_VIEWER_TABS = ['info', 'size', 'motion', 'data'];
|
|
18
|
+
/*
|
|
19
|
+
Where the preview shows each: what a board sets once when placing it under the size, its motion under the motion. The
|
|
20
|
+
data's are the data tab's own, from the connections.
|
|
21
|
+
*/
|
|
22
|
+
const DESIGN_KEYS = ['designInputs', 'slotLayout'];
|
|
16
23
|
/**
|
|
17
24
|
* A single board instance. Sizes and poses are transient, and never change the asset or call a mutation.
|
|
18
25
|
*
|
|
@@ -32,8 +39,11 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
32
39
|
this.values = {};
|
|
33
40
|
this.playing = '';
|
|
34
41
|
this.error = '';
|
|
42
|
+
this.copied = false;
|
|
35
43
|
this.needsScene = false;
|
|
36
44
|
this.played = new Set();
|
|
45
|
+
/** The board component's properties, read from the instance standing here as the board's panel reads them. */
|
|
46
|
+
this.exposed = [];
|
|
37
47
|
/** The board the instance stands on, set when the scene is built; its centre is the grid's origin. */
|
|
38
48
|
this.board = { x: 0, z: 0 };
|
|
39
49
|
}
|
|
@@ -66,6 +76,12 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
66
76
|
section + section { border-top: 1px solid var(--md-sys-color-outline-variant); }
|
|
67
77
|
section:last-child { border-bottom: none; }
|
|
68
78
|
h3 { justify-content: space-between; margin: 0 0 2px; }
|
|
79
|
+
/* The key a board sets and binds, beside the panel's word for it: 「상태값 parameters」. */
|
|
80
|
+
h3 code[key] { margin-right: auto; margin-left: 6px; font-family: var(--ui-mono, ui-monospace, monospace); font-weight: normal; color: var(--md-sys-color-on-surface-variant); }
|
|
81
|
+
h4 { margin: 4px 0 0; font: inherit; color: var(--md-sys-color-on-surface-variant); }
|
|
82
|
+
/* A published design input: its board name and unit, its range, its default. */
|
|
83
|
+
div[entry] { display: grid; grid-template-columns: 1fr auto; gap: 8px; min-height: 22px; align-items: center; }
|
|
84
|
+
div[entry] > span:last-child { color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; }
|
|
69
85
|
/*
|
|
70
86
|
A slider row: its name, the line to drag, and the number. The name column is wide enough for a joint's name and
|
|
71
87
|
unit (「j2-shoulder · deg」) and wraps rather than cutting it; a row grows with its name. A clip's row is its name
|
|
@@ -87,6 +103,12 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
87
103
|
button[icon] md-icon { --md-icon-size: 16px; }
|
|
88
104
|
button[icon][aria-pressed='true'] { color: var(--md-sys-color-primary); }
|
|
89
105
|
p[hint] { margin: 0; }
|
|
106
|
+
/* A connection: its field, what it moves and how on one line; under it, where the data has it and of what kind. */
|
|
107
|
+
div[connection] { display: grid; gap: 1px; padding: 3px 0; }
|
|
108
|
+
div[connection] [method] { color: var(--md-sys-color-on-surface-variant); margin-left: 6px; }
|
|
109
|
+
div[connection] [where] { color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; }
|
|
110
|
+
pre[example] { margin: 0; padding: 6px 8px; border-radius: 4px; background: var(--md-sys-color-surface-container); font-family: var(--ui-mono, ui-monospace, monospace);
|
|
111
|
+
font-size: var(--ui-t-micro, 10.5px); white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
90
112
|
p[error] { margin: 0; padding: 8px 16px; color: var(--md-sys-color-error); }
|
|
91
113
|
`]; }
|
|
92
114
|
connectedCallback() {
|
|
@@ -136,9 +158,10 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
136
158
|
${this.tab === 'info' ? html `<slot name="facts"></slot>` : nothing}
|
|
137
159
|
${asset && this.tab === 'size' ? this.renderSize(asset) : nothing}
|
|
138
160
|
${asset && this.tab === 'motion' ? this.renderMotion(asset, controls, clips) : nothing}
|
|
161
|
+
${asset && this.tab === 'data' ? this.renderData(asset) : nothing}
|
|
139
162
|
</div>`;
|
|
140
163
|
}
|
|
141
|
-
/** The tab strip: the facts, the size, the motion. Arrow keys move along it, as the suite's tabs do. */
|
|
164
|
+
/** The tab strip: the facts, the size, the motion, the data. Arrow keys move along it, as the suite's tabs do. */
|
|
142
165
|
renderTabs() {
|
|
143
166
|
return html `<nav class="ui-tabs" role="tablist" @keydown=${(e) => this.stepTab(e)}>
|
|
144
167
|
${FIGURE_VIEWER_TABS.map(tab => {
|
|
@@ -182,7 +205,25 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
182
205
|
<span></span>
|
|
183
206
|
</div>`;
|
|
184
207
|
})}
|
|
185
|
-
</section
|
|
208
|
+
</section>
|
|
209
|
+
${DESIGN_KEYS.flatMap(key => this.exposed.filter(p => p.name === key)).map(p => this.renderDesign(p, asset))}`;
|
|
210
|
+
}
|
|
211
|
+
/** The panel's word for a property and the key a board sets and binds it by. */
|
|
212
|
+
boardName(property) {
|
|
213
|
+
return html `${i18next.t('label.' + property.label)}<code key>${property.name}</code>`;
|
|
214
|
+
}
|
|
215
|
+
/*
|
|
216
|
+
What a board sets once when it places the figure, under its size (user 2026-11-05): the design inputs the author
|
|
217
|
+
published -- each by its board name, with its range and default -- and the slot layout a placement may override.
|
|
218
|
+
*/
|
|
219
|
+
renderDesign(p, asset) {
|
|
220
|
+
const entries = p.property?.entries ?? [];
|
|
221
|
+
return html `<section>
|
|
222
|
+
<h3>${this.boardName(p)}</h3>
|
|
223
|
+
${entries.map(x => html `<div entry><span>${x.label ?? x.key}${x.unit ? ` · ${x.unit}` : ''}</span>
|
|
224
|
+
<span>${x.min ?? ''}~${x.max ?? ''}${x.default !== undefined ? ` · ${x.default}` : ''}</span></div>`)}
|
|
225
|
+
${p.name === 'slotLayout' ? html `<p hint>${asset.document.capabilities.slotLayout?.label ?? ''}</p>` : nothing}
|
|
226
|
+
</section>`;
|
|
186
227
|
}
|
|
187
228
|
/*
|
|
188
229
|
The inputs, then the clips. A clip can move many inputs -- the robot dog's walk moves all eight leg joints -- so it
|
|
@@ -191,7 +232,15 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
191
232
|
is not shown until it is dragged.
|
|
192
233
|
*/
|
|
193
234
|
renderMotion(asset, controls, clips) {
|
|
235
|
+
/* Each part under the board's word for it and the key a board sets and binds (user 2026-11-05). */
|
|
236
|
+
const heading = (name) => {
|
|
237
|
+
const p = this.exposed.find(x => x.name === name);
|
|
238
|
+
return p ? html `<h3>${this.boardName(p)}</h3>` : nothing;
|
|
239
|
+
};
|
|
240
|
+
const groups = asset.motionGroups ?? [];
|
|
241
|
+
const free = clips.filter(clip => !groups.some(g => g.clips.includes(clip)));
|
|
194
242
|
return html `<section>
|
|
243
|
+
${controls.length ? heading('parameters') : nothing}
|
|
195
244
|
${controls.map(c => {
|
|
196
245
|
const driving = clipsDriving(asset, c.id);
|
|
197
246
|
const moving = driving.includes(this.playing);
|
|
@@ -203,9 +252,58 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
203
252
|
})}
|
|
204
253
|
${!controls.length && !clips.length ? html `<p hint>${i18next.t('figure.text.detail-no-motion')}</p>` : nothing}
|
|
205
254
|
</section>
|
|
206
|
-
${
|
|
207
|
-
|
|
208
|
-
|
|
255
|
+
${free.length ? html `<section>${heading('clips')}${free.map(name => this.clipRow(name))}</section>` : nothing}
|
|
256
|
+
${groups.some(g => g.clips.some(c => clips.includes(c)))
|
|
257
|
+
? html `<section>
|
|
258
|
+
${heading('motion')}
|
|
259
|
+
${groups.map(g => html `<h4>${g.label}</h4>${g.clips.filter(c => clips.includes(c)).map(name => this.clipRow(name))}`)}
|
|
260
|
+
</section>`
|
|
261
|
+
: nothing}`;
|
|
262
|
+
}
|
|
263
|
+
/** A clip on its own row, played by the mark at its end. */
|
|
264
|
+
clipRow(name) {
|
|
265
|
+
return html `<div slide clip><span title=${name}>${name}</span>${this.playButton(name)}</div>`;
|
|
266
|
+
}
|
|
267
|
+
/*
|
|
268
|
+
The connections the author declared (the modeller's 「연결」): for each, the data field, what it moves and how, then
|
|
269
|
+
where the data has it and of what kind -- an items list's fields by the part of an item each says. Under them, data
|
|
270
|
+
with every field, to copy (user 2026-11-05: what a board or a connector binds to, seen before placing the figure).
|
|
271
|
+
*/
|
|
272
|
+
renderData(asset) {
|
|
273
|
+
const connections = dataConnectionsOf(asset);
|
|
274
|
+
if (!connections.length)
|
|
275
|
+
return html `<section><p hint>${i18next.t('figure.text.detail-no-data')}</p></section>`;
|
|
276
|
+
const example = JSON.stringify(figureDataExample(asset.dataInterface), null, 2);
|
|
277
|
+
const copyLabel = i18next.t(this.copied ? 'figure.button.board-data-copied' : 'figure.button.board-data-copy-example');
|
|
278
|
+
return html `<section>
|
|
279
|
+
<h3>${i18next.t('figure.label.data-bindings')}</h3>
|
|
280
|
+
${connections.map(c => {
|
|
281
|
+
const where = [
|
|
282
|
+
...(c.field !== c.accessor ? [c.accessor] : []),
|
|
283
|
+
...(c.node ? [kindWords(c.node)] : []),
|
|
284
|
+
...ITEM_FIELDS.flatMap(part => (c.itemFields?.[part] ? [`${itemFieldWords(part)} ${c.itemFields[part]}`] : []))
|
|
285
|
+
];
|
|
286
|
+
return html `<div connection>
|
|
287
|
+
<div><strong>${c.field}</strong> → ${moveWords(c.move)}<span method>${methodWords(c.method)}</span></div>
|
|
288
|
+
${where.length ? html `<div where>${where.join(' · ')}</div>` : nothing}
|
|
289
|
+
</div>`;
|
|
290
|
+
})}
|
|
291
|
+
</section>
|
|
292
|
+
<section>
|
|
293
|
+
<h3>${i18next.t('figure.label.detail-example')}
|
|
294
|
+
<button icon copy aria-label=${copyLabel} title=${copyLabel} @click=${() => this.copyExample(example)}><md-icon>${this.copied ? 'check' : 'content_copy'}</md-icon></button></h3>
|
|
295
|
+
<pre example>${example}</pre>
|
|
296
|
+
</section>`;
|
|
297
|
+
}
|
|
298
|
+
async copyExample(text) {
|
|
299
|
+
try {
|
|
300
|
+
await navigator.clipboard.writeText(text);
|
|
301
|
+
this.copied = true;
|
|
302
|
+
setTimeout(() => (this.copied = false), 1500);
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
/* No clipboard here (an insecure page): the mark stays as it was. */
|
|
306
|
+
}
|
|
209
307
|
}
|
|
210
308
|
/**
|
|
211
309
|
* The view as it stands -- turned, zoomed and sized by the person -- as the card's picture, at the size and in the
|
|
@@ -307,6 +405,7 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
307
405
|
if (!asset)
|
|
308
406
|
return;
|
|
309
407
|
this.values = {};
|
|
408
|
+
this.exposed = [];
|
|
310
409
|
this.playing = '';
|
|
311
410
|
this.shot = '';
|
|
312
411
|
this.played.clear();
|
|
@@ -332,6 +431,7 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
|
|
|
332
431
|
this.centre();
|
|
333
432
|
this.scene.resize?.();
|
|
334
433
|
this.fit();
|
|
434
|
+
this.exposed = this.scene.root?.components?.[0]?.nature?.properties ?? [];
|
|
335
435
|
}
|
|
336
436
|
catch (error) {
|
|
337
437
|
this.error = error.message;
|
|
@@ -382,6 +482,14 @@ __decorate([
|
|
|
382
482
|
state(),
|
|
383
483
|
__metadata("design:type", Object)
|
|
384
484
|
], FigureAssetViewer.prototype, "error", void 0);
|
|
485
|
+
__decorate([
|
|
486
|
+
state(),
|
|
487
|
+
__metadata("design:type", Object)
|
|
488
|
+
], FigureAssetViewer.prototype, "copied", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
state(),
|
|
491
|
+
__metadata("design:type", Array)
|
|
492
|
+
], FigureAssetViewer.prototype, "exposed", void 0);
|
|
385
493
|
FigureAssetViewer = __decorate([
|
|
386
494
|
customElement('figure-asset-viewer')
|
|
387
495
|
], FigureAssetViewer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-asset-viewer.js","sourceRoot":"","sources":["../client/figure-asset-viewer.ts"],"names":[],"mappings":";AAAA,O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CAAC;GACxB,iBAAiB,CA6T7B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, nothing, type PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { SurfaceStyles } from '@things-factory/styles'\nimport { compileFigureAsset, type FigureAsset } from '@hatiolab/figure-model'\nimport { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene'\nimport { authoredSizeOf, bodyAtSize, previewOneInstance, sizeSpanOf, sizeWithinRange } from './preview-model.js'\nimport { controlsOf } from './controls.js'\nimport { DEFAULT_VIEW, previewBoardDepth, sceneLook } from './figure-view.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { clipPlayOf, clipsDriving, parametersForClip, playSettingsOf } from './detail-motion.js'\n\ntype Axis = 'x' | 'y' | 'z'\n/** What the view's tabs show under it: the figure's facts, its size, its motion. */\nexport type FigureViewerTab = 'info' | 'size' | 'motion'\nexport const FIGURE_VIEWER_TABS: readonly FigureViewerTab[] = ['info', 'size', 'motion']\ninterface Scene {\n dispose?(): void\n resize?(): void\n fit?(type?: string): void\n root?: {\n fitCameraToModel?(): void\n snapshot3d?(width?: number, height?: number, type?: string, quality?: number): Promise<string | undefined>\n\n components?: Array<{ model?: { width?: number; height?: number }; set(props: string | Record<string, unknown>, value?: unknown): void }>\n }\n}\n\n/**\n * A single board instance. Sizes and poses are transient, and never change the asset or call a mutation.\n *\n * The canvas stands at the top and never scrolls away; under it, tabs show the facts, the size or the motion one at a\n * time, and only that body scrolls (user 2026-10-15: the motion sat so far down that playing a clip scrolled the\n * figure out of view). Given a bounded height, the element fills it; without one, it is as tall as what it shows.\n * `tab` is the one shown; choosing another fires `tab-change` (detail `{ tab }`), so a screen showing two can keep them\n * on the same tab.\n */\n@customElement('figure-asset-viewer')\nexport class FigureAssetViewer extends localize(i18next)(LitElement) {\n /*\n The modeller's side panel look (SidePanelStyles), the suite's tab strip (SurfaceStyles' .ui-tabs) and its scrollbar\n for the tab body (ScrollbarStyles); only the viewport, the tab body and the slider rows are this element's.\n */\n static styles = [SidePanelStyles, SurfaceStyles, ScrollbarStyles, css`\n :host { display: flex; flex-direction: column; min-width: 0; min-height: 0; }\n /*\n The card's own 4:3, so the picture taken is what is seen. A screen that shows the facts beside the view caps it\n (--figure-asset-viewer-canvas-max, a share of the element's height): a wide column's 4:3 is taller than the\n element and pushes the tabs out of sight (user 2026-10-22, the library's release popup).\n */\n [viewport] { flex: none; aspect-ratio: 4 / 3; max-height: var(--figure-asset-viewer-canvas-max, none); position: relative; background: #858585; }\n nav.ui-tabs { flex: none; padding: 0 16px; }\n [tab-body] { flex: 1; min-height: 0; overflow: auto; }\n [stage] { position: absolute; inset: 0; width: 100%; height: 100%; }\n /*\n The view's own marks in its corner, not buttons beside it: fit the whole figure in view (the modeller's fit, the\n same icon and words), and taking the picture when the screen keeps one.\n */\n div[marks] { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }\n div[marks] button { display: inline-grid; place-items: center; width: 28px; height: 28px;\n padding: 0; border: none; border-radius: 50%; background: rgb(0 0 0 / 22%); color: rgb(255 255 255 / 85%); cursor: pointer; }\n div[marks] button:hover:not(:disabled) { background: rgb(0 0 0 / 45%); color: #fff; }\n div[marks] button:disabled { cursor: default; }\n div[marks] md-icon { --md-icon-size: 16px; }\n section { gap: 4px; padding: 10px 16px; }\n section + section { border-top: 1px solid var(--md-sys-color-outline-variant); }\n section:last-child { border-bottom: none; }\n h3 { justify-content: space-between; margin: 0 0 2px; }\n /*\n A slider row: its name, the line to drag, and the number. The name column is wide enough for a joint's name and\n unit (「j2-shoulder · deg」) and wraps rather than cutting it; a row grows with its name. A clip's row is its name\n and its play mark.\n */\n div[slide] { display: grid; grid-template-columns: 120px minmax(64px, 1fr) 52px 22px; align-items: center; gap: 8px; min-height: 22px; }\n div[slide] > span { color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; line-height: 1.3; }\n div[slide][clip] > span { grid-column: 1 / 4; }\n div[slide] input[type='number'] { min-height: 0; height: 20px; padding: 0 2px; border: none; border-bottom: 1px solid transparent; border-radius: 0;\n background: none; text-align: right; font-family: var(--ui-mono, ui-monospace, monospace); -moz-appearance: textfield; }\n div[slide] input[type='number']::-webkit-inner-spin-button, div[slide] input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n div[slide] input[type='number']:hover:not(:disabled) { border-bottom-color: var(--md-sys-color-outline-variant); }\n div[slide] input[type='number']:focus { outline: none; border-bottom-color: var(--md-sys-color-primary); }\n div[slide] input:disabled { opacity: 0.45; }\n div[slide] output { text-align: right; color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; }\n button[icon] { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: none; border-radius: 4px;\n background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; }\n button[icon]:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }\n button[icon] md-icon { --md-icon-size: 16px; }\n button[icon][aria-pressed='true'] { color: var(--md-sys-color-primary); }\n p[hint] { margin: 0; }\n p[error] { margin: 0; padding: 8px 16px; color: var(--md-sys-color-error); }\n `]\n @property({ attribute: false }) asset?: FigureAsset\n /** Keeps a picture of the view as the figure's thumbnail. Without it there is no picture to take. */\n @property({ attribute: false }) keepShot?: (dataUrl: string) => Promise<unknown>\n /** The tab shown under the view. */\n @property({ reflect: true }) tab: FigureViewerTab = 'info'\n @query('[stage]') private stage!: HTMLElement\n @state() private shot: '' | 'saving' | 'saved' | 'failed' = ''\n @state() private sizes: Record<Axis, number> = { x: 1, y: 1, z: 1 }\n @state() private values: Record<string, number> = {}\n @state() private playing = ''\n @state() private error = ''\n private scene?: Scene\n private registered?: string\n private observer?: ResizeObserver\n private needsScene = false\n private played = new Set<string>()\n /** The board the instance stands on, set when the scene is built; its centre is the grid's origin. */\n private board = { x: 0, z: 0 }\n\n connectedCallback() {\n super.connectedCallback()\n this.needsScene = true\n if (this.hasUpdated) this.observer?.observe(this.stage)\n this.requestUpdate()\n }\n\n protected updated(changed: PropertyValues) {\n // Reconnection and a new asset can arrive in the same update. Build exactly once.\n if (changed.has('asset') || this.needsScene) {\n this.needsScene = false\n this.standUp()\n }\n }\n firstUpdated() {\n this.observer = new ResizeObserver(() => this.scene?.resize?.())\n this.observer.observe(this.stage)\n }\n disconnectedCallback() {\n super.disconnectedCallback()\n this.observer?.disconnect()\n this.teardown()\n }\n\n render() {\n const asset = this.asset\n const clips = asset ? [...new Set((asset.drivers ?? []).map(d => d.clip))] : []\n const controls = asset ? controlsOf(asset, this.values) : []\n const shotLabel = this.shot === 'saved' ? i18next.t('figure.text.detail-thumbnail-saved') : i18next.t('figure.button.detail-save-thumbnail')\n const fitLabel = i18next.t('button.fit-view')\n return html`<div viewport><div stage></div>\n ${this.asset && !this.error\n ? html`<div marks>\n <button fit aria-label=${fitLabel} title=${fitLabel} @click=${() => this.fit()}><md-icon>fit_screen</md-icon></button>\n ${this.keepShot\n ? html`<button shoot aria-label=${shotLabel} title=${shotLabel} ?disabled=${this.shot === 'saving'}\n @click=${() => this.takeShot()}><md-icon>${this.shot === 'saved' ? 'check' : 'photo_camera'}</md-icon></button>`\n : nothing}\n </div>`\n : nothing}\n </div>\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n ${this.shot === 'failed' ? html`<p error role=\"alert\">${i18next.t('figure.text.detail-thumbnail-failed')}</p>` : nothing}\n ${this.renderTabs()}\n <div tab-body role=\"tabpanel\" aria-labelledby=${`tab-${this.tab}`}>\n ${this.tab === 'info' ? html`<slot name=\"facts\"></slot>` : nothing}\n ${asset && this.tab === 'size' ? this.renderSize(asset) : nothing}\n ${asset && this.tab === 'motion' ? this.renderMotion(asset, controls, clips) : nothing}\n </div>`\n }\n\n /** The tab strip: the facts, the size, the motion. Arrow keys move along it, as the suite's tabs do. */\n private renderTabs() {\n return html`<nav class=\"ui-tabs\" role=\"tablist\" @keydown=${(e: KeyboardEvent) => this.stepTab(e)}>\n ${FIGURE_VIEWER_TABS.map(tab => {\n const on = this.tab === tab\n return html`<button role=\"tab\" id=${`tab-${tab}`} data-tab=${tab} ?data-selected=${on} aria-selected=${String(on)}\n tabindex=${on ? 0 : -1} @click=${() => this.choose(tab)}>${i18next.t(`figure.label.detail-tab-${tab}`)}</button>`\n })}\n </nav>`\n }\n private choose(tab: FigureViewerTab) {\n if (tab === this.tab) return\n this.tab = tab\n this.dispatchEvent(new CustomEvent('tab-change', { detail: { tab }, bubbles: true, composed: true }))\n }\n private stepTab(e: KeyboardEvent) {\n const step = e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0\n if (!step) return\n e.preventDefault()\n const at = FIGURE_VIEWER_TABS.indexOf(this.tab)\n const next = FIGURE_VIEWER_TABS[(at + step + FIGURE_VIEWER_TABS.length) % FIGURE_VIEWER_TABS.length]\n this.choose(next)\n this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>(`button[data-tab=\"${next}\"]`)?.focus())\n }\n\n private renderSize(asset: FigureAsset) {\n return html`<section>\n <h3>${i18next.t('figure.label.detail-size')} · mm\n <button icon reset aria-label=${i18next.t('figure.button.detail-reset')} title=${i18next.t('figure.button.detail-reset')}\n @click=${() => this.reset()}><md-icon>restart_alt</md-icon></button></h3>\n ${(['x', 'y', 'z'] as const).map(axis => {\n const span = sizeSpanOf(asset, axis)\n const fixed = !span\n return html`<div slide><span>${axis.toUpperCase()}</span>\n <input type=\"range\" aria-label=${`${axis.toUpperCase()} mm`} min=${span?.min ?? this.sizes[axis]} max=${span?.max ?? this.sizes[axis]} step=\"any\"\n .value=${String(this.sizes[axis])} ?disabled=${fixed}\n @input=${(e: Event) => this.resize(axis, (e.target as HTMLInputElement).valueAsNumber)}>\n <input type=\"number\" aria-label=${`${axis.toUpperCase()} mm value`} min=${span?.min ?? this.sizes[axis]} max=${span?.max ?? this.sizes[axis]} step=\"any\"\n .value=${String(this.sizes[axis])} ?disabled=${fixed}\n @change=${(e: Event) => this.resize(axis, (e.target as HTMLInputElement).valueAsNumber)}>\n <span></span>\n </div>`\n })}\n </section>`\n }\n\n /*\n The inputs, then the clips. A clip can move many inputs -- the robot dog's walk moves all eight leg joints -- so it\n plays on its own row (user 2026-10-15: a play mark on fl-thigh played the walk and every leg moved). An input the\n clip playing moves cannot be dragged; one a clip played and let go of stands where the clip left it, so its number\n is not shown until it is dragged.\n */\n private renderMotion(asset: FigureAsset, controls: ReturnType<typeof controlsOf>, clips: string[]) {\n return html`<section>\n ${controls.map(c => {\n const driving = clipsDriving(asset, c.id)\n const moving = driving.includes(this.playing)\n const held = moving || (driving.some(clip => this.played.has(clip)) && !(c.id in this.values))\n return html`<div slide><span title=${`${c.label} · ${c.unit}`}>${c.label} · ${c.unit}</span>\n <input type=\"range\" aria-label=${c.label} min=${c.min} max=${c.max} step=${c.step || 'any'} .value=${String(c.value)} ?disabled=${moving}\n @input=${(e: Event) => this.pose(c.id, (e.target as HTMLInputElement).valueAsNumber)}>\n <output>${held ? '' : Math.round(c.value * 100) / 100}</output><span></span></div>`\n })}\n ${!controls.length && !clips.length ? html`<p hint>${i18next.t('figure.text.detail-no-motion')}</p>` : nothing}\n </section>\n ${clips.length ? html`<section>\n ${clips.map(name => html`<div slide clip><span title=${name}>${name}</span>${this.playButton(name)}</div>`)}\n </section>` : nothing}`\n }\n\n /**\n * The view as it stands -- turned, zoomed and sized by the person -- as the card's picture, at the size and in the\n * format the modeller's own picture uses (`thumbnail.ts`). Nothing is taken when the view cannot be drawn.\n */\n private async takeShot() {\n const layer = this.scene?.root\n if (!this.keepShot || !layer?.snapshot3d) return\n this.shot = 'saving'\n try {\n const url = await layer.snapshot3d(480, 360, 'image/webp', 0.85)\n if (typeof url !== 'string' || !url.startsWith('data:')) throw Error('no picture')\n await this.keepShot(url)\n this.shot = 'saved'\n setTimeout(() => this.shot === 'saved' && (this.shot = ''), 1500)\n } catch {\n this.shot = 'failed'\n }\n }\n /** The whole figure in view: the board's fit, then the 3D camera's own (as the modeller canvas fits). */\n fit() {\n this.scene?.fit?.('ratio')\n this.scene?.root?.fitCameraToModel?.()\n }\n /** Play or pause a clip, at the end of the line it moves. */\n private playButton(clip: string) {\n const on = this.playing === clip\n /* A clip the figure's data never turns into cannot be chosen here; it says so instead of pressing to no effect. */\n const unreachable = !!this.asset && clipPlayOf(this.asset, clip).kind === 'unreachable'\n const title = unreachable ? i18next.t('figure.text.detail-clip-by-data', { clip }) : clip\n return html`<button icon play aria-pressed=${String(on)} aria-label=${clip} title=${title} ?disabled=${unreachable} @click=${() => this.play(clip)}>\n <md-icon>${on ? 'pause' : 'play_arrow'}</md-icon></button>`\n }\n private tell(key: string, value: unknown) {\n this.scene?.root?.components?.[0]?.set(key, value)\n }\n private resize(axis: Axis, value: number) {\n const used = this.asset ? sizeWithinRange(this.asset, axis, value) : undefined\n if (used === undefined) { this.requestUpdate(); return }\n this.sizes = { ...this.sizes, [axis]: used }\n /*\n The model grows about its own centre, which stays on the board's centre -- the origin of the ground grid. A\n board instance is placed by its corner, so the corner moves with the size. The camera stays where the person\n turned it: refitting on every step slid the grid under the model as if the axes had moved.\n */\n /* The instance's box is the body at these sizes, not the sizes (bodyAtSize). */\n const box = bodyAtSize(this.asset!, this.sizes) ?? this.sizes\n this.scene?.root?.components?.[0]?.set({ width: box.x, depth: box.y, height: box.z })\n this.centre()\n }\n /**\n * The instance's box on the board's centre. The figure fits its box to the room it declares (its motion included),\n * which can be wider than the size asked, so the box is read back rather than computed here.\n */\n private centre() {\n const instance = this.scene?.root?.components?.[0]\n if (!instance?.model) return\n const { width = 0, height = 0 } = instance.model\n instance.set({ left: this.board.x / 2 - width / 2, top: this.board.z / 2 - height / 2 })\n }\n private pose(id: string, value: number) {\n if (!Number.isFinite(value)) return\n this.values = { ...this.values, [id]: value }\n this.tell('parameters', this.values)\n }\n private play(name: string) {\n this.playing = this.playing === name ? '' : name\n if (this.playing && this.asset) {\n this.played.add(name)\n this.values = parametersForClip(this.asset, this.values, name)\n this.tell('parameters', this.values)\n }\n if (!this.asset) return\n /* A clip of a motion group is the group's to choose -- through the data when the data chooses it (detail-motion). */\n const { clips, motion, figureValues } = playSettingsOf(this.asset, this.playing)\n this.tell('clips', clips)\n this.tell('motion', motion)\n this.tell('figureValues', figureValues)\n }\n private reset() {\n if (!this.asset) return\n // A new instance also resets driver clocks. Clearing speeds alone freezes the last pose.\n this.standUp()\n }\n private standUp() {\n this.teardown()\n this.error = ''\n const asset = this.asset\n if (!asset) return\n this.values = {}\n this.playing = ''\n this.shot = ''\n this.played.clear()\n try {\n compileFigureAsset(asset)\n if (!asset.appearance.length) throw Error(i18next.t('figure.text.preview-needs-a-part'))\n this.sizes = authoredSizeOf(asset)\n const type = `figure-detail-${crypto.randomUUID()}`\n registerFigure(type, asset)\n this.registered = type\n const size = bodyAtSize(asset, this.sizes) ?? this.sizes\n const { board, components } = previewOneInstance(type, size)\n this.board = { x: board.width, z: board.height }\n this.scene = create({ target: this.stage, mode: 0, model: {\n type: 'model-layer', width: board.width, height: board.height,\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, DEFAULT_VIEW.ceilingHeight, 1),\n threed: true, sky: 'color', ...sceneLook(DEFAULT_VIEW),\n placement: DEFAULT_VIEW.placement, heights: { floor: 0, ceiling: DEFAULT_VIEW.ceilingHeight },\n pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),\n components\n } }) as Scene\n this.centre()\n this.scene.resize?.()\n this.fit()\n } catch (error) {\n this.error = (error as Error).message\n this.teardown()\n }\n }\n private teardown() {\n this.scene?.dispose?.()\n this.scene = undefined\n if (this.registered) unregisterFigure(this.registered)\n this.registered = undefined\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"figure-asset-viewer.js","sourceRoot":"","sources":["../client/figure-asset-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EA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CAAC;8BAAiB,WAAW;gDAAA;AAC5B;IAAhB,KAAK,EAAE;;+CAAsD;AAC7C;IAAhB,KAAK,EAAE;;gDAA2D;AAClD;IAAhB,KAAK,EAAE;;iDAA4C;AACnC;IAAhB,KAAK,EAAE;;kDAAqB;AACZ;IAAhB,KAAK,EAAE;;gDAAmB;AACV;IAAhB,KAAK,EAAE;;iDAAuB;AAOd;IAAhB,KAAK,EAAE;;kDAAsC;AAnFnC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8Z7B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, nothing, type PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { SurfaceStyles } from '@things-factory/styles'\nimport { compileFigureAsset, figureDataExample, type FigureAsset } from '@hatiolab/figure-model'\nimport { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene'\nimport { authoredSizeOf, bodyAtSize, previewOneInstance, sizeSpanOf, sizeWithinRange } from './preview-model.js'\nimport { controlsOf } from './controls.js'\nimport { DEFAULT_VIEW, previewBoardDepth, sceneLook } from './figure-view.js'\nimport { SidePanelStyles } from './side-panel-styles.js'\nimport { clipPlayOf, clipsDriving, parametersForClip, playSettingsOf } from './detail-motion.js'\nimport { dataConnectionsOf, ITEM_FIELDS } from './data-connection.js'\nimport { itemFieldWords, kindWords, methodWords, moveWords } from './data-words.js'\n\ntype Axis = 'x' | 'y' | 'z'\n/** What the view's tabs show under it: the figure's facts, its size, its motion, the data it takes. */\nexport type FigureViewerTab = 'info' | 'size' | 'motion' | 'data'\nexport const FIGURE_VIEWER_TABS: readonly FigureViewerTab[] = ['info', 'size', 'motion', 'data']\n/**\n * A property of the figure's board component, as the board's and fmsim's property panels show it (things-scene's\n * \\`nature.properties\\`): its label word, the state key a board sets and binds, and for a map its entries.\n */\ninterface BoardProperty {\n type: string\n label: string\n name: string\n property?: { entries?: Array<{ key: string; label?: string; unit?: string; min?: number; max?: number; default?: unknown }> }\n}\n/*\n Where the preview shows each: what a board sets once when placing it under the size, its motion under the motion. The\n data's are the data tab's own, from the connections.\n*/\nconst DESIGN_KEYS = ['designInputs', 'slotLayout']\ninterface Scene {\n dispose?(): void\n resize?(): void\n fit?(type?: string): void\n root?: {\n fitCameraToModel?(): void\n snapshot3d?(width?: number, height?: number, type?: string, quality?: number): Promise<string | undefined>\n\n components?: Array<{ model?: { width?: number; height?: number }; nature?: { properties?: BoardProperty[] }; set(props: string | Record<string, unknown>, value?: unknown): void }>\n }\n}\n\n/**\n * A single board instance. Sizes and poses are transient, and never change the asset or call a mutation.\n *\n * The canvas stands at the top and never scrolls away; under it, tabs show the facts, the size or the motion one at a\n * time, and only that body scrolls (user 2026-10-15: the motion sat so far down that playing a clip scrolled the\n * figure out of view). Given a bounded height, the element fills it; without one, it is as tall as what it shows.\n * `tab` is the one shown; choosing another fires `tab-change` (detail `{ tab }`), so a screen showing two can keep them\n * on the same tab.\n */\n@customElement('figure-asset-viewer')\nexport class FigureAssetViewer extends localize(i18next)(LitElement) {\n /*\n The modeller's side panel look (SidePanelStyles), the suite's tab strip (SurfaceStyles' .ui-tabs) and its scrollbar\n for the tab body (ScrollbarStyles); only the viewport, the tab body and the slider rows are this element's.\n */\n static styles = [SidePanelStyles, SurfaceStyles, ScrollbarStyles, css`\n :host { display: flex; flex-direction: column; min-width: 0; min-height: 0; }\n /*\n The card's own 4:3, so the picture taken is what is seen. A screen that shows the facts beside the view caps it\n (--figure-asset-viewer-canvas-max, a share of the element's height): a wide column's 4:3 is taller than the\n element and pushes the tabs out of sight (user 2026-10-22, the library's release popup).\n */\n [viewport] { flex: none; aspect-ratio: 4 / 3; max-height: var(--figure-asset-viewer-canvas-max, none); position: relative; background: #858585; }\n nav.ui-tabs { flex: none; padding: 0 16px; }\n [tab-body] { flex: 1; min-height: 0; overflow: auto; }\n [stage] { position: absolute; inset: 0; width: 100%; height: 100%; }\n /*\n The view's own marks in its corner, not buttons beside it: fit the whole figure in view (the modeller's fit, the\n same icon and words), and taking the picture when the screen keeps one.\n */\n div[marks] { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }\n div[marks] button { display: inline-grid; place-items: center; width: 28px; height: 28px;\n padding: 0; border: none; border-radius: 50%; background: rgb(0 0 0 / 22%); color: rgb(255 255 255 / 85%); cursor: pointer; }\n div[marks] button:hover:not(:disabled) { background: rgb(0 0 0 / 45%); color: #fff; }\n div[marks] button:disabled { cursor: default; }\n div[marks] md-icon { --md-icon-size: 16px; }\n section { gap: 4px; padding: 10px 16px; }\n section + section { border-top: 1px solid var(--md-sys-color-outline-variant); }\n section:last-child { border-bottom: none; }\n h3 { justify-content: space-between; margin: 0 0 2px; }\n /* The key a board sets and binds, beside the panel's word for it: 「상태값 parameters」. */\n h3 code[key] { margin-right: auto; margin-left: 6px; font-family: var(--ui-mono, ui-monospace, monospace); font-weight: normal; color: var(--md-sys-color-on-surface-variant); }\n h4 { margin: 4px 0 0; font: inherit; color: var(--md-sys-color-on-surface-variant); }\n /* A published design input: its board name and unit, its range, its default. */\n div[entry] { display: grid; grid-template-columns: 1fr auto; gap: 8px; min-height: 22px; align-items: center; }\n div[entry] > span:last-child { color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; }\n /*\n A slider row: its name, the line to drag, and the number. The name column is wide enough for a joint's name and\n unit (「j2-shoulder · deg」) and wraps rather than cutting it; a row grows with its name. A clip's row is its name\n and its play mark.\n */\n div[slide] { display: grid; grid-template-columns: 120px minmax(64px, 1fr) 52px 22px; align-items: center; gap: 8px; min-height: 22px; }\n div[slide] > span { color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; line-height: 1.3; }\n div[slide][clip] > span { grid-column: 1 / 4; }\n div[slide] input[type='number'] { min-height: 0; height: 20px; padding: 0 2px; border: none; border-bottom: 1px solid transparent; border-radius: 0;\n background: none; text-align: right; font-family: var(--ui-mono, ui-monospace, monospace); -moz-appearance: textfield; }\n div[slide] input[type='number']::-webkit-inner-spin-button, div[slide] input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n div[slide] input[type='number']:hover:not(:disabled) { border-bottom-color: var(--md-sys-color-outline-variant); }\n div[slide] input[type='number']:focus { outline: none; border-bottom-color: var(--md-sys-color-primary); }\n div[slide] input:disabled { opacity: 0.45; }\n div[slide] output { text-align: right; color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; }\n button[icon] { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: none; border-radius: 4px;\n background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; }\n button[icon]:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }\n button[icon] md-icon { --md-icon-size: 16px; }\n button[icon][aria-pressed='true'] { color: var(--md-sys-color-primary); }\n p[hint] { margin: 0; }\n /* A connection: its field, what it moves and how on one line; under it, where the data has it and of what kind. */\n div[connection] { display: grid; gap: 1px; padding: 3px 0; }\n div[connection] [method] { color: var(--md-sys-color-on-surface-variant); margin-left: 6px; }\n div[connection] [where] { color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; }\n pre[example] { margin: 0; padding: 6px 8px; border-radius: 4px; background: var(--md-sys-color-surface-container); font-family: var(--ui-mono, ui-monospace, monospace);\n font-size: var(--ui-t-micro, 10.5px); white-space: pre-wrap; overflow-wrap: anywhere; }\n p[error] { margin: 0; padding: 8px 16px; color: var(--md-sys-color-error); }\n `]\n @property({ attribute: false }) asset?: FigureAsset\n /** Keeps a picture of the view as the figure's thumbnail. Without it there is no picture to take. */\n @property({ attribute: false }) keepShot?: (dataUrl: string) => Promise<unknown>\n /** The tab shown under the view. */\n @property({ reflect: true }) tab: FigureViewerTab = 'info'\n @query('[stage]') private stage!: HTMLElement\n @state() private shot: '' | 'saving' | 'saved' | 'failed' = ''\n @state() private sizes: Record<Axis, number> = { x: 1, y: 1, z: 1 }\n @state() private values: Record<string, number> = {}\n @state() private playing = ''\n @state() private error = ''\n @state() private copied = false\n private scene?: Scene\n private registered?: string\n private observer?: ResizeObserver\n private needsScene = false\n private played = new Set<string>()\n /** The board component's properties, read from the instance standing here as the board's panel reads them. */\n @state() private exposed: BoardProperty[] = []\n /** The board the instance stands on, set when the scene is built; its centre is the grid's origin. */\n private board = { x: 0, z: 0 }\n\n connectedCallback() {\n super.connectedCallback()\n this.needsScene = true\n if (this.hasUpdated) this.observer?.observe(this.stage)\n this.requestUpdate()\n }\n\n protected updated(changed: PropertyValues) {\n // Reconnection and a new asset can arrive in the same update. Build exactly once.\n if (changed.has('asset') || this.needsScene) {\n this.needsScene = false\n this.standUp()\n }\n }\n firstUpdated() {\n this.observer = new ResizeObserver(() => this.scene?.resize?.())\n this.observer.observe(this.stage)\n }\n disconnectedCallback() {\n super.disconnectedCallback()\n this.observer?.disconnect()\n this.teardown()\n }\n\n render() {\n const asset = this.asset\n const clips = asset ? [...new Set((asset.drivers ?? []).map(d => d.clip))] : []\n const controls = asset ? controlsOf(asset, this.values) : []\n const shotLabel = this.shot === 'saved' ? i18next.t('figure.text.detail-thumbnail-saved') : i18next.t('figure.button.detail-save-thumbnail')\n const fitLabel = i18next.t('button.fit-view')\n return html`<div viewport><div stage></div>\n ${this.asset && !this.error\n ? html`<div marks>\n <button fit aria-label=${fitLabel} title=${fitLabel} @click=${() => this.fit()}><md-icon>fit_screen</md-icon></button>\n ${this.keepShot\n ? html`<button shoot aria-label=${shotLabel} title=${shotLabel} ?disabled=${this.shot === 'saving'}\n @click=${() => this.takeShot()}><md-icon>${this.shot === 'saved' ? 'check' : 'photo_camera'}</md-icon></button>`\n : nothing}\n </div>`\n : nothing}\n </div>\n ${this.error ? html`<p error role=\"alert\">${this.error}</p>` : nothing}\n ${this.shot === 'failed' ? html`<p error role=\"alert\">${i18next.t('figure.text.detail-thumbnail-failed')}</p>` : nothing}\n ${this.renderTabs()}\n <div tab-body role=\"tabpanel\" aria-labelledby=${`tab-${this.tab}`}>\n ${this.tab === 'info' ? html`<slot name=\"facts\"></slot>` : nothing}\n ${asset && this.tab === 'size' ? this.renderSize(asset) : nothing}\n ${asset && this.tab === 'motion' ? this.renderMotion(asset, controls, clips) : nothing}\n ${asset && this.tab === 'data' ? this.renderData(asset) : nothing}\n </div>`\n }\n\n /** The tab strip: the facts, the size, the motion, the data. Arrow keys move along it, as the suite's tabs do. */\n private renderTabs() {\n return html`<nav class=\"ui-tabs\" role=\"tablist\" @keydown=${(e: KeyboardEvent) => this.stepTab(e)}>\n ${FIGURE_VIEWER_TABS.map(tab => {\n const on = this.tab === tab\n return html`<button role=\"tab\" id=${`tab-${tab}`} data-tab=${tab} ?data-selected=${on} aria-selected=${String(on)}\n tabindex=${on ? 0 : -1} @click=${() => this.choose(tab)}>${i18next.t(`figure.label.detail-tab-${tab}`)}</button>`\n })}\n </nav>`\n }\n private choose(tab: FigureViewerTab) {\n if (tab === this.tab) return\n this.tab = tab\n this.dispatchEvent(new CustomEvent('tab-change', { detail: { tab }, bubbles: true, composed: true }))\n }\n private stepTab(e: KeyboardEvent) {\n const step = e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0\n if (!step) return\n e.preventDefault()\n const at = FIGURE_VIEWER_TABS.indexOf(this.tab)\n const next = FIGURE_VIEWER_TABS[(at + step + FIGURE_VIEWER_TABS.length) % FIGURE_VIEWER_TABS.length]\n this.choose(next)\n this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>(`button[data-tab=\"${next}\"]`)?.focus())\n }\n\n private renderSize(asset: FigureAsset) {\n return html`<section>\n <h3>${i18next.t('figure.label.detail-size')} · mm\n <button icon reset aria-label=${i18next.t('figure.button.detail-reset')} title=${i18next.t('figure.button.detail-reset')}\n @click=${() => this.reset()}><md-icon>restart_alt</md-icon></button></h3>\n ${(['x', 'y', 'z'] as const).map(axis => {\n const span = sizeSpanOf(asset, axis)\n const fixed = !span\n return html`<div slide><span>${axis.toUpperCase()}</span>\n <input type=\"range\" aria-label=${`${axis.toUpperCase()} mm`} min=${span?.min ?? this.sizes[axis]} max=${span?.max ?? this.sizes[axis]} step=\"any\"\n .value=${String(this.sizes[axis])} ?disabled=${fixed}\n @input=${(e: Event) => this.resize(axis, (e.target as HTMLInputElement).valueAsNumber)}>\n <input type=\"number\" aria-label=${`${axis.toUpperCase()} mm value`} min=${span?.min ?? this.sizes[axis]} max=${span?.max ?? this.sizes[axis]} step=\"any\"\n .value=${String(this.sizes[axis])} ?disabled=${fixed}\n @change=${(e: Event) => this.resize(axis, (e.target as HTMLInputElement).valueAsNumber)}>\n <span></span>\n </div>`\n })}\n </section>\n ${DESIGN_KEYS.flatMap(key => this.exposed.filter(p => p.name === key)).map(p => this.renderDesign(p, asset))}`\n }\n\n /** The panel's word for a property and the key a board sets and binds it by. */\n private boardName(property: BoardProperty) {\n return html`${i18next.t('label.' + property.label)}<code key>${property.name}</code>`\n }\n\n /*\n What a board sets once when it places the figure, under its size (user 2026-11-05): the design inputs the author\n published -- each by its board name, with its range and default -- and the slot layout a placement may override.\n */\n private renderDesign(p: BoardProperty, asset: FigureAsset) {\n const entries = p.property?.entries ?? []\n return html`<section>\n <h3>${this.boardName(p)}</h3>\n ${entries.map(\n x => html`<div entry><span>${x.label ?? x.key}${x.unit ? ` · ${x.unit}` : ''}</span>\n <span>${x.min ?? ''}~${x.max ?? ''}${x.default !== undefined ? ` · ${x.default}` : ''}</span></div>`\n )}\n ${p.name === 'slotLayout' ? html`<p hint>${asset.document.capabilities.slotLayout?.label ?? ''}</p>` : nothing}\n </section>`\n }\n\n /*\n The inputs, then the clips. A clip can move many inputs -- the robot dog's walk moves all eight leg joints -- so it\n plays on its own row (user 2026-10-15: a play mark on fl-thigh played the walk and every leg moved). An input the\n clip playing moves cannot be dragged; one a clip played and let go of stands where the clip left it, so its number\n is not shown until it is dragged.\n */\n private renderMotion(asset: FigureAsset, controls: ReturnType<typeof controlsOf>, clips: string[]) {\n /* Each part under the board's word for it and the key a board sets and binds (user 2026-11-05). */\n const heading = (name: string) => {\n const p = this.exposed.find(x => x.name === name)\n return p ? html`<h3>${this.boardName(p)}</h3>` : nothing\n }\n const groups = asset.motionGroups ?? []\n const free = clips.filter(clip => !groups.some(g => g.clips.includes(clip)))\n return html`<section>\n ${controls.length ? heading('parameters') : nothing}\n ${controls.map(c => {\n const driving = clipsDriving(asset, c.id)\n const moving = driving.includes(this.playing)\n const held = moving || (driving.some(clip => this.played.has(clip)) && !(c.id in this.values))\n return html`<div slide><span title=${`${c.label} · ${c.unit}`}>${c.label} · ${c.unit}</span>\n <input type=\"range\" aria-label=${c.label} min=${c.min} max=${c.max} step=${c.step || 'any'} .value=${String(c.value)} ?disabled=${moving}\n @input=${(e: Event) => this.pose(c.id, (e.target as HTMLInputElement).valueAsNumber)}>\n <output>${held ? '' : Math.round(c.value * 100) / 100}</output><span></span></div>`\n })}\n ${!controls.length && !clips.length ? html`<p hint>${i18next.t('figure.text.detail-no-motion')}</p>` : nothing}\n </section>\n ${free.length ? html`<section>${heading('clips')}${free.map(name => this.clipRow(name))}</section>` : nothing}\n ${groups.some(g => g.clips.some(c => clips.includes(c)))\n ? html`<section>\n ${heading('motion')}\n ${groups.map(g => html`<h4>${g.label}</h4>${g.clips.filter(c => clips.includes(c)).map(name => this.clipRow(name))}`)}\n </section>`\n : nothing}`\n }\n\n /** A clip on its own row, played by the mark at its end. */\n private clipRow(name: string) {\n return html`<div slide clip><span title=${name}>${name}</span>${this.playButton(name)}</div>`\n }\n\n /*\n The connections the author declared (the modeller's 「연결」): for each, the data field, what it moves and how, then\n where the data has it and of what kind -- an items list's fields by the part of an item each says. Under them, data\n with every field, to copy (user 2026-11-05: what a board or a connector binds to, seen before placing the figure).\n */\n private renderData(asset: FigureAsset) {\n const connections = dataConnectionsOf(asset)\n if (!connections.length) return html`<section><p hint>${i18next.t('figure.text.detail-no-data')}</p></section>`\n const example = JSON.stringify(figureDataExample(asset.dataInterface!), null, 2)\n const copyLabel = i18next.t(this.copied ? 'figure.button.board-data-copied' : 'figure.button.board-data-copy-example')\n return html`<section>\n <h3>${i18next.t('figure.label.data-bindings')}</h3>\n ${connections.map(c => {\n const where = [\n ...(c.field !== c.accessor ? [c.accessor] : []),\n ...(c.node ? [kindWords(c.node)] : []),\n ...ITEM_FIELDS.flatMap(part => (c.itemFields?.[part] ? [`${itemFieldWords(part)} ${c.itemFields[part]}`] : []))\n ]\n return html`<div connection>\n <div><strong>${c.field}</strong> → ${moveWords(c.move)}<span method>${methodWords(c.method)}</span></div>\n ${where.length ? html`<div where>${where.join(' · ')}</div>` : nothing}\n </div>`\n })}\n </section>\n <section>\n <h3>${i18next.t('figure.label.detail-example')}\n <button icon copy aria-label=${copyLabel} title=${copyLabel} @click=${() => this.copyExample(example)}><md-icon>${this.copied ? 'check' : 'content_copy'}</md-icon></button></h3>\n <pre example>${example}</pre>\n </section>`\n }\n private async copyExample(text: string) {\n try {\n await navigator.clipboard.writeText(text)\n this.copied = true\n setTimeout(() => (this.copied = false), 1500)\n } catch {\n /* No clipboard here (an insecure page): the mark stays as it was. */\n }\n }\n\n /**\n * The view as it stands -- turned, zoomed and sized by the person -- as the card's picture, at the size and in the\n * format the modeller's own picture uses (`thumbnail.ts`). Nothing is taken when the view cannot be drawn.\n */\n private async takeShot() {\n const layer = this.scene?.root\n if (!this.keepShot || !layer?.snapshot3d) return\n this.shot = 'saving'\n try {\n const url = await layer.snapshot3d(480, 360, 'image/webp', 0.85)\n if (typeof url !== 'string' || !url.startsWith('data:')) throw Error('no picture')\n await this.keepShot(url)\n this.shot = 'saved'\n setTimeout(() => this.shot === 'saved' && (this.shot = ''), 1500)\n } catch {\n this.shot = 'failed'\n }\n }\n /** The whole figure in view: the board's fit, then the 3D camera's own (as the modeller canvas fits). */\n fit() {\n this.scene?.fit?.('ratio')\n this.scene?.root?.fitCameraToModel?.()\n }\n /** Play or pause a clip, at the end of the line it moves. */\n private playButton(clip: string) {\n const on = this.playing === clip\n /* A clip the figure's data never turns into cannot be chosen here; it says so instead of pressing to no effect. */\n const unreachable = !!this.asset && clipPlayOf(this.asset, clip).kind === 'unreachable'\n const title = unreachable ? i18next.t('figure.text.detail-clip-by-data', { clip }) : clip\n return html`<button icon play aria-pressed=${String(on)} aria-label=${clip} title=${title} ?disabled=${unreachable} @click=${() => this.play(clip)}>\n <md-icon>${on ? 'pause' : 'play_arrow'}</md-icon></button>`\n }\n private tell(key: string, value: unknown) {\n this.scene?.root?.components?.[0]?.set(key, value)\n }\n private resize(axis: Axis, value: number) {\n const used = this.asset ? sizeWithinRange(this.asset, axis, value) : undefined\n if (used === undefined) { this.requestUpdate(); return }\n this.sizes = { ...this.sizes, [axis]: used }\n /*\n The model grows about its own centre, which stays on the board's centre -- the origin of the ground grid. A\n board instance is placed by its corner, so the corner moves with the size. The camera stays where the person\n turned it: refitting on every step slid the grid under the model as if the axes had moved.\n */\n /* The instance's box is the body at these sizes, not the sizes (bodyAtSize). */\n const box = bodyAtSize(this.asset!, this.sizes) ?? this.sizes\n this.scene?.root?.components?.[0]?.set({ width: box.x, depth: box.y, height: box.z })\n this.centre()\n }\n /**\n * The instance's box on the board's centre. The figure fits its box to the room it declares (its motion included),\n * which can be wider than the size asked, so the box is read back rather than computed here.\n */\n private centre() {\n const instance = this.scene?.root?.components?.[0]\n if (!instance?.model) return\n const { width = 0, height = 0 } = instance.model\n instance.set({ left: this.board.x / 2 - width / 2, top: this.board.z / 2 - height / 2 })\n }\n private pose(id: string, value: number) {\n if (!Number.isFinite(value)) return\n this.values = { ...this.values, [id]: value }\n this.tell('parameters', this.values)\n }\n private play(name: string) {\n this.playing = this.playing === name ? '' : name\n if (this.playing && this.asset) {\n this.played.add(name)\n this.values = parametersForClip(this.asset, this.values, name)\n this.tell('parameters', this.values)\n }\n if (!this.asset) return\n /* A clip of a motion group is the group's to choose -- through the data when the data chooses it (detail-motion). */\n const { clips, motion, figureValues } = playSettingsOf(this.asset, this.playing)\n this.tell('clips', clips)\n this.tell('motion', motion)\n this.tell('figureValues', figureValues)\n }\n private reset() {\n if (!this.asset) return\n // A new instance also resets driver clocks. Clearing speeds alone freezes the last pose.\n this.standUp()\n }\n private standUp() {\n this.teardown()\n this.error = ''\n const asset = this.asset\n if (!asset) return\n this.values = {}\n this.exposed = []\n this.playing = ''\n this.shot = ''\n this.played.clear()\n try {\n compileFigureAsset(asset)\n if (!asset.appearance.length) throw Error(i18next.t('figure.text.preview-needs-a-part'))\n this.sizes = authoredSizeOf(asset)\n const type = `figure-detail-${crypto.randomUUID()}`\n registerFigure(type, asset)\n this.registered = type\n const size = bodyAtSize(asset, this.sizes) ?? this.sizes\n const { board, components } = previewOneInstance(type, size)\n this.board = { x: board.width, z: board.height }\n this.scene = create({ target: this.stage, mode: 0, model: {\n type: 'model-layer', width: board.width, height: board.height,\n depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, DEFAULT_VIEW.ceilingHeight, 1),\n threed: true, sky: 'color', ...sceneLook(DEFAULT_VIEW),\n placement: DEFAULT_VIEW.placement, heights: { floor: 0, ceiling: DEFAULT_VIEW.ceilingHeight },\n pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),\n components\n } }) as Scene\n this.centre()\n this.scene.resize?.()\n this.fit()\n this.exposed = this.scene.root?.components?.[0]?.nature?.properties ?? []\n } catch (error) {\n this.error = (error as Error).message\n this.teardown()\n }\n }\n private teardown() {\n this.scene?.dispose?.()\n this.scene = undefined\n if (this.registered) unregisterFigure(this.registered)\n this.registered = undefined\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import { LitElement, nothing } from 'lit';
|
|
3
|
+
import type { FigureDataReport } from './figure-data-report.js';
|
|
4
|
+
declare const FigureDataList_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* A figure's data as a person reads it (data binding design, decision 3): the shape as a tree, each value now and where
|
|
7
|
+
* it came from when there is one, what each field moves, a control the board's own state values hold, why data was
|
|
8
|
+
* refused, the fields the data has that the shape does not name, and an example to copy. The board's 「피규어 데이터」
|
|
9
|
+
* section shows a placed figure's; the preview's 「데이터」 tab shows a release's, with no data given, so each field
|
|
10
|
+
* says its kind (user 2026-11-05: what a board or a connector binds to, seen before placing it).
|
|
11
|
+
*/
|
|
12
|
+
export declare class FigureDataList extends FigureDataList_base {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
report?: FigureDataReport;
|
|
15
|
+
private copied;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
17
|
+
private renderRow;
|
|
18
|
+
private copy;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'figure-data-list': FigureDataList;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {};
|