@things-factory/figure-viewer 10.1.266 → 10.1.279
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/dist-client/data-words.d.ts +5 -0
- package/dist-client/data-words.js +13 -3
- package/package.json +17 -3
- package/translations/en.json +1 -1
- package/translations/es.json +1 -1
- package/translations/ja.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -1
- package/translations/zh.json +1 -1
- package/client/capability-rung.ts +0 -22
- package/client/controls.ts +0 -54
- package/client/data-connection.ts +0 -82
- package/client/data-words.ts +0 -31
- package/client/detail-facts.ts +0 -86
- package/client/detail-motion.ts +0 -61
- package/client/figure-asset-viewer.ts +0 -472
- package/client/figure-data-list.ts +0 -87
- package/client/figure-data-report.ts +0 -142
- package/client/figure-facts-list.ts +0 -59
- package/client/figure-thumb-mark.ts +0 -34
- package/client/figure-view.ts +0 -151
- package/client/index.ts +0 -19
- package/client/preview-model.ts +0 -162
- package/client/side-panel-styles.ts +0 -480
- package/client/tsconfig.json +0 -19
- package/client/unit-words.ts +0 -11
- package/dist-client/capability-rung.js.map +0 -1
- package/dist-client/controls.js.map +0 -1
- package/dist-client/data-connection.js.map +0 -1
- package/dist-client/data-words.js.map +0 -1
- package/dist-client/detail-facts.js.map +0 -1
- package/dist-client/detail-motion.js.map +0 -1
- package/dist-client/figure-asset-viewer.js.map +0 -1
- package/dist-client/figure-data-list.js.map +0 -1
- package/dist-client/figure-data-report.js.map +0 -1
- package/dist-client/figure-facts-list.js.map +0 -1
- package/dist-client/figure-thumb-mark.js.map +0 -1
- package/dist-client/figure-view.js.map +0 -1
- package/dist-client/index.js.map +0 -1
- package/dist-client/preview-model.js.map +0 -1
- package/dist-client/side-panel-styles.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/unit-words.js.map +0 -1
- package/dist-server/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
- package/server/index.ts +0 -4
- package/server/tsconfig.json +0 -10
- package/test/controls.test.ts +0 -51
- package/test/data-connection.test.ts +0 -35
- package/test/detail-facts.test.ts +0 -89
- package/test/detail-motion.test.ts +0 -110
- package/test/figure-data-report.test.ts +0 -88
- package/test/joints.ts +0 -30
- package/test/preview.test.ts +0 -101
- package/test/resolve-ts-siblings.mjs +0 -85
- package/test/view.test.ts +0 -13
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The side panel's one look, for every element that draws in the modeller's side.
|
|
5
|
-
*
|
|
6
|
-
* The side is drawn by several elements (the type field, the figure's properties, a part's values, fastening, places,
|
|
7
|
-
* motion, material, controls, clips, the environment) and each had styled its own fields: three label styles and
|
|
8
|
-
* three field heights in one column (user, 2026-09-24: "why are the styles and layout all different?"). They share
|
|
9
|
-
* this sheet now and keep only what is theirs.
|
|
10
|
-
*
|
|
11
|
-
* The vocabulary:
|
|
12
|
-
* section one titled group; the side is a stack of them
|
|
13
|
-
* h3 a group's title
|
|
14
|
-
*
|
|
15
|
-
* Three sizes and two weights (user 2026-10-01, the panel checked for balance: eight sizes, and titles smaller than
|
|
16
|
-
* what they titled): a title at the body token and semibold, everything else at the small token, and a hint at the
|
|
17
|
-
* micro one. Sections are 16 px above their title and 12 px below their last line.
|
|
18
|
-
* div[inline-field] a short label and its one field on one line
|
|
19
|
-
* div[field] a label and its field on one line; what else the field holds stands under the field
|
|
20
|
-
* div[form] short labels beside their fields, the fields starting on one line
|
|
21
|
-
* div[vector-row] a title, then X · Y · Z in one row of cells with the axis inside (`div[triple]` of
|
|
22
|
-
* `div[cell]`) -- three values read together, as vector tools lay them out
|
|
23
|
-
* div[pair] two controls side by side
|
|
24
|
-
* label[toggle] a checkbox and its words
|
|
25
|
-
* p[hint] · small the quiet line under a field
|
|
26
|
-
* button[act] an action under the fields it acts on
|
|
27
|
-
* [scrub] a label dragged sideways to scrub its field
|
|
28
|
-
*/
|
|
29
|
-
export const SidePanelStyles = css`
|
|
30
|
-
:host {
|
|
31
|
-
/*
|
|
32
|
-
* A field's measure (user 2026-10-17: 「공간 낭비가 심하다 … 둔한 라운드와 여백」): 26px high, a 4px corner, and the
|
|
33
|
-
* label's column. Labels and fields share a line, so a group reads as a list to scan, not a form to fill.
|
|
34
|
-
*/
|
|
35
|
-
--figure-control-height: 26px;
|
|
36
|
-
--figure-control-radius: 4px;
|
|
37
|
-
--figure-label-width: 72px;
|
|
38
|
-
font-size: var(--ui-t-small, 11.5px);
|
|
39
|
-
color: var(--md-sys-color-on-surface);
|
|
40
|
-
}
|
|
41
|
-
/* The side is a stack of sections, each a titled group. */
|
|
42
|
-
/*
|
|
43
|
-
* Tight inside a group, loose between groups: rows 6px apart, so a group reads as one thing; groups parted by their
|
|
44
|
-
* line and 16px, so the eye knows where the next one starts (user 2026-10-17: no tension and release).
|
|
45
|
-
*/
|
|
46
|
-
section {
|
|
47
|
-
display: grid;
|
|
48
|
-
gap: 6px;
|
|
49
|
-
padding: 16px 12px;
|
|
50
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant, #c4c7c5);
|
|
51
|
-
}
|
|
52
|
-
section > h3 {
|
|
53
|
-
margin: 0 0 4px;
|
|
54
|
-
}
|
|
55
|
-
section div[field] + div[field],
|
|
56
|
-
section div[inline-field] + div[inline-field],
|
|
57
|
-
section div[vector-row] + div[vector-row] {
|
|
58
|
-
margin-top: 0;
|
|
59
|
-
}
|
|
60
|
-
h3 {
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: 4px;
|
|
64
|
-
margin: 14px 0 6px;
|
|
65
|
-
font-size: var(--ui-t-body, 13px);
|
|
66
|
-
font-weight: 600;
|
|
67
|
-
color: var(--md-sys-color-on-surface);
|
|
68
|
-
}
|
|
69
|
-
h3:first-child {
|
|
70
|
-
margin-top: 0;
|
|
71
|
-
}
|
|
72
|
-
/* Two weights only: a bold word in a line is the title's weight, not the browser's heavier one. */
|
|
73
|
-
b,
|
|
74
|
-
strong {
|
|
75
|
-
font-weight: 600;
|
|
76
|
-
}
|
|
77
|
-
label,
|
|
78
|
-
div[form] > span {
|
|
79
|
-
font-size: inherit;
|
|
80
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
81
|
-
}
|
|
82
|
-
/* The label on the left, its field on the right; a hint or a second row under the field, in the field's column. */
|
|
83
|
-
div[field] {
|
|
84
|
-
display: grid;
|
|
85
|
-
grid-template-columns: var(--figure-label-width) minmax(0, 1fr);
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 4px 8px;
|
|
88
|
-
}
|
|
89
|
-
div[field] > * {
|
|
90
|
-
grid-column: 2;
|
|
91
|
-
}
|
|
92
|
-
div[field] > label {
|
|
93
|
-
grid-column: 1;
|
|
94
|
-
overflow-wrap: anywhere;
|
|
95
|
-
}
|
|
96
|
-
/* A field with no label -- an action and its note -- and a checkbox with its words take the whole line. */
|
|
97
|
-
div[field]:not(:has(> label:not([toggle]))) > *,
|
|
98
|
-
div[field] > label[toggle] {
|
|
99
|
-
grid-column: 1 / -1;
|
|
100
|
-
}
|
|
101
|
-
div[field] + div[field],
|
|
102
|
-
div[field] + div[form],
|
|
103
|
-
div[form] + div[field],
|
|
104
|
-
div[vector-row] + div[vector-row],
|
|
105
|
-
div[vector-row] + div[field],
|
|
106
|
-
div[field] + div[vector-row] {
|
|
107
|
-
margin-top: 6px;
|
|
108
|
-
}
|
|
109
|
-
div[form],
|
|
110
|
-
div[inline-field],
|
|
111
|
-
div[vector-row] {
|
|
112
|
-
display: grid;
|
|
113
|
-
grid-template-columns: var(--figure-label-width) minmax(0, 1fr);
|
|
114
|
-
align-items: center;
|
|
115
|
-
gap: 6px 8px;
|
|
116
|
-
}
|
|
117
|
-
div[form] > span,
|
|
118
|
-
div[inline-field] > label,
|
|
119
|
-
div[vector-row] > label {
|
|
120
|
-
overflow-wrap: anywhere;
|
|
121
|
-
white-space: normal;
|
|
122
|
-
}
|
|
123
|
-
/* A value read, not edited, beside its label: the field's size and colour, not the page's. */
|
|
124
|
-
div[inline-field] > span[value] {
|
|
125
|
-
font-size: inherit;
|
|
126
|
-
color: var(--md-sys-color-on-surface);
|
|
127
|
-
}
|
|
128
|
-
/*
|
|
129
|
-
* The unit is part of its label and reads in its colour. The outline grey (a line's colour) left 11.5px words at
|
|
130
|
-
* 4.4:1 on the panel, under the 4.5:1 small text needs (2026-10-16).
|
|
131
|
-
*/
|
|
132
|
-
label span[unit] {
|
|
133
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
134
|
-
}
|
|
135
|
-
div[inline-field] + div[inline-field],
|
|
136
|
-
div[inline-field] + div[vector-row],
|
|
137
|
-
div[vector-row] + div[inline-field] {
|
|
138
|
-
margin-top: 5px;
|
|
139
|
-
}
|
|
140
|
-
/* A row of worded tools (align, snap; mirror copies). */
|
|
141
|
-
div[tools] {
|
|
142
|
-
display: flex;
|
|
143
|
-
flex-wrap: wrap;
|
|
144
|
-
gap: 4px;
|
|
145
|
-
}
|
|
146
|
-
/* Words, no box: a row of tools reads as a row of words, each lit under the hand. */
|
|
147
|
-
div[tools] button {
|
|
148
|
-
height: var(--figure-control-height);
|
|
149
|
-
padding: 0 6px;
|
|
150
|
-
font: inherit;
|
|
151
|
-
color: var(--md-sys-color-on-surface);
|
|
152
|
-
background: none;
|
|
153
|
-
border: none;
|
|
154
|
-
border-radius: var(--figure-control-radius);
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
}
|
|
157
|
-
div[tools] button:hover:not(:disabled) {
|
|
158
|
-
background: var(--md-sys-color-surface-container);
|
|
159
|
-
}
|
|
160
|
-
div[tools] button:disabled {
|
|
161
|
-
opacity: 0.45;
|
|
162
|
-
cursor: default;
|
|
163
|
-
}
|
|
164
|
-
div[pair] {
|
|
165
|
-
display: flex;
|
|
166
|
-
gap: 4px;
|
|
167
|
-
}
|
|
168
|
-
div[pair] > * {
|
|
169
|
-
flex: 1;
|
|
170
|
-
min-width: 0;
|
|
171
|
-
}
|
|
172
|
-
div[triple] {
|
|
173
|
-
display: grid;
|
|
174
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
175
|
-
gap: 4px;
|
|
176
|
-
}
|
|
177
|
-
/*
|
|
178
|
-
* A field is a line, not a box: its value over one thin rule, the rule darkening under the hand and turning the
|
|
179
|
-
* primary colour, twice as thick, with the focus. Boxed fields made the panel a stack of boxes (user 2026-10-17:
|
|
180
|
-
* 「박스형 input … 난립을 완화하라 … 언더라인형의 도입」); a faint fill was tried first and still read as grey blocks.
|
|
181
|
-
*/
|
|
182
|
-
input,
|
|
183
|
-
select {
|
|
184
|
-
width: 100%;
|
|
185
|
-
min-width: 0;
|
|
186
|
-
min-height: var(--figure-control-height);
|
|
187
|
-
box-sizing: border-box;
|
|
188
|
-
padding: 2px 2px;
|
|
189
|
-
font: inherit;
|
|
190
|
-
color: var(--md-sys-color-on-surface);
|
|
191
|
-
background: transparent;
|
|
192
|
-
border: 0;
|
|
193
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant, #c4c7c5);
|
|
194
|
-
border-radius: 0;
|
|
195
|
-
}
|
|
196
|
-
input:hover:not(:disabled):not(:focus),
|
|
197
|
-
select:hover:not(:disabled):not(:focus) {
|
|
198
|
-
border-bottom-color: var(--md-sys-color-on-surface-variant);
|
|
199
|
-
}
|
|
200
|
-
/* The browser's own box and dot, in the panel's colour. */
|
|
201
|
-
input[type='checkbox'],
|
|
202
|
-
input[type='radio'] {
|
|
203
|
-
width: auto;
|
|
204
|
-
min-height: 0;
|
|
205
|
-
margin: 0;
|
|
206
|
-
accent-color: var(--md-sys-color-primary);
|
|
207
|
-
}
|
|
208
|
-
/* A fold: the panel's chevron, not the browser's triangle. */
|
|
209
|
-
summary {
|
|
210
|
-
display: flex;
|
|
211
|
-
align-items: center;
|
|
212
|
-
gap: 6px;
|
|
213
|
-
padding: 6px 0;
|
|
214
|
-
list-style: none;
|
|
215
|
-
cursor: pointer;
|
|
216
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
217
|
-
}
|
|
218
|
-
summary::-webkit-details-marker {
|
|
219
|
-
display: none;
|
|
220
|
-
}
|
|
221
|
-
summary::before {
|
|
222
|
-
content: '';
|
|
223
|
-
flex: none;
|
|
224
|
-
width: 6px;
|
|
225
|
-
height: 6px;
|
|
226
|
-
margin: 0 2px;
|
|
227
|
-
border-right: 1.5px solid currentColor;
|
|
228
|
-
border-bottom: 1.5px solid currentColor;
|
|
229
|
-
transform: rotate(-45deg);
|
|
230
|
-
transition: transform 0.15s;
|
|
231
|
-
}
|
|
232
|
-
details[open] > summary::before {
|
|
233
|
-
transform: rotate(45deg);
|
|
234
|
-
}
|
|
235
|
-
/* A thin track and a small thumb: a slider is a line to drag along, not a block (user, 2026-09-24). */
|
|
236
|
-
input[type='range'] {
|
|
237
|
-
-webkit-appearance: none;
|
|
238
|
-
appearance: none;
|
|
239
|
-
min-height: 16px;
|
|
240
|
-
height: 16px;
|
|
241
|
-
padding: 0;
|
|
242
|
-
border: none;
|
|
243
|
-
background: transparent;
|
|
244
|
-
cursor: pointer;
|
|
245
|
-
}
|
|
246
|
-
input[type='range']::-webkit-slider-runnable-track {
|
|
247
|
-
height: 3px;
|
|
248
|
-
border-radius: 2px;
|
|
249
|
-
background: var(--md-sys-color-outline-variant);
|
|
250
|
-
}
|
|
251
|
-
input[type='range']::-webkit-slider-thumb {
|
|
252
|
-
-webkit-appearance: none;
|
|
253
|
-
width: 12px;
|
|
254
|
-
height: 12px;
|
|
255
|
-
margin-top: -4.5px;
|
|
256
|
-
border: none;
|
|
257
|
-
border-radius: 50%;
|
|
258
|
-
background: var(--md-sys-color-primary);
|
|
259
|
-
}
|
|
260
|
-
input[type='range']::-moz-range-track {
|
|
261
|
-
height: 3px;
|
|
262
|
-
border-radius: 2px;
|
|
263
|
-
background: var(--md-sys-color-outline-variant);
|
|
264
|
-
}
|
|
265
|
-
input[type='range']::-moz-range-thumb {
|
|
266
|
-
width: 12px;
|
|
267
|
-
height: 12px;
|
|
268
|
-
border: none;
|
|
269
|
-
border-radius: 50%;
|
|
270
|
-
background: var(--md-sys-color-primary);
|
|
271
|
-
}
|
|
272
|
-
input[type='range']:focus {
|
|
273
|
-
outline: none;
|
|
274
|
-
}
|
|
275
|
-
input[type='range']:focus-visible::-webkit-slider-thumb {
|
|
276
|
-
outline: 2px solid var(--md-sys-color-primary);
|
|
277
|
-
outline-offset: 2px;
|
|
278
|
-
}
|
|
279
|
-
input[type='color'] {
|
|
280
|
-
padding: 2px;
|
|
281
|
-
width: 40px;
|
|
282
|
-
}
|
|
283
|
-
/*
|
|
284
|
-
* A button or a fold reached by the keyboard is ringed in the primary colour, as the canvas bar's tools are; the
|
|
285
|
-
* browser's own ring (orange on this theme) stood beside it (modeller sweep 2026-10-27 U27).
|
|
286
|
-
*/
|
|
287
|
-
button:focus-visible,
|
|
288
|
-
summary:focus-visible {
|
|
289
|
-
outline: 2px solid var(--md-sys-color-primary);
|
|
290
|
-
outline-offset: 1px;
|
|
291
|
-
}
|
|
292
|
-
input:focus,
|
|
293
|
-
select:focus {
|
|
294
|
-
outline: none;
|
|
295
|
-
border-bottom-color: var(--md-sys-color-primary);
|
|
296
|
-
box-shadow: inset 0 -1px 0 var(--md-sys-color-primary);
|
|
297
|
-
}
|
|
298
|
-
input:disabled,
|
|
299
|
-
select:disabled {
|
|
300
|
-
opacity: 0.6;
|
|
301
|
-
}
|
|
302
|
-
/* A number with its axis inside the cell, on the left. */
|
|
303
|
-
div[cell] {
|
|
304
|
-
display: flex;
|
|
305
|
-
box-sizing: border-box;
|
|
306
|
-
height: var(--figure-control-height);
|
|
307
|
-
align-items: center;
|
|
308
|
-
gap: 2px;
|
|
309
|
-
padding-left: 2px;
|
|
310
|
-
/* The same line as every field, the axis letter at its start. */
|
|
311
|
-
background: transparent;
|
|
312
|
-
border: 0;
|
|
313
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant, #c4c7c5);
|
|
314
|
-
border-radius: 0;
|
|
315
|
-
}
|
|
316
|
-
div[cell]:hover:not(:focus-within) {
|
|
317
|
-
border-bottom-color: var(--md-sys-color-on-surface-variant);
|
|
318
|
-
}
|
|
319
|
-
div[cell]:focus-within {
|
|
320
|
-
border-bottom-color: var(--md-sys-color-primary);
|
|
321
|
-
box-shadow: inset 0 -1px 0 var(--md-sys-color-primary);
|
|
322
|
-
}
|
|
323
|
-
/* A label that scrubs its field when dragged sideways (vector tools' way). */
|
|
324
|
-
[scrub] {
|
|
325
|
-
cursor: ew-resize;
|
|
326
|
-
user-select: none;
|
|
327
|
-
touch-action: none;
|
|
328
|
-
}
|
|
329
|
-
div[cell] span[axis] {
|
|
330
|
-
flex: none;
|
|
331
|
-
font-size: var(--ui-t-micro, 11px);
|
|
332
|
-
letter-spacing: 0.02em;
|
|
333
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
334
|
-
}
|
|
335
|
-
div[cell] input {
|
|
336
|
-
min-height: 0;
|
|
337
|
-
height: calc(var(--figure-control-height) - 2px);
|
|
338
|
-
padding: 2px 2px 2px 2px;
|
|
339
|
-
font-family: var(--ui-mono, ui-monospace, monospace);
|
|
340
|
-
text-align: right;
|
|
341
|
-
background: none;
|
|
342
|
-
border: none;
|
|
343
|
-
border-radius: 0;
|
|
344
|
-
}
|
|
345
|
-
div[cell] input:focus {
|
|
346
|
-
outline: none;
|
|
347
|
-
}
|
|
348
|
-
/* An axis a rule sets: its number, read-only, on a quieter ground (ADR-0097). */
|
|
349
|
-
/* A number a rule sets: its line dotted and its value in grey -- read, not edited. */
|
|
350
|
-
div[cell][held] {
|
|
351
|
-
border-bottom-style: dotted;
|
|
352
|
-
}
|
|
353
|
-
div[cell][held] input {
|
|
354
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
355
|
-
font-style: italic;
|
|
356
|
-
}
|
|
357
|
-
p[held-axes] {
|
|
358
|
-
margin: 2px 0 6px;
|
|
359
|
-
}
|
|
360
|
-
label[toggle] {
|
|
361
|
-
display: flex;
|
|
362
|
-
align-items: center;
|
|
363
|
-
gap: 6px;
|
|
364
|
-
color: var(--md-sys-color-on-surface);
|
|
365
|
-
}
|
|
366
|
-
/* Related choices and section state use the same type, spacing and colours in every panel. */
|
|
367
|
-
[choice-row] {
|
|
368
|
-
display: flex;
|
|
369
|
-
flex-wrap: wrap;
|
|
370
|
-
align-items: center;
|
|
371
|
-
gap: 6px 14px;
|
|
372
|
-
min-height: var(--figure-control-height);
|
|
373
|
-
}
|
|
374
|
-
h3 > [section-state] {
|
|
375
|
-
margin-left: auto;
|
|
376
|
-
font-size: var(--ui-t-micro, 11px);
|
|
377
|
-
font-weight: 400;
|
|
378
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
379
|
-
white-space: nowrap;
|
|
380
|
-
}
|
|
381
|
-
h3 > [section-state][active] {
|
|
382
|
-
color: var(--md-sys-color-primary);
|
|
383
|
-
}
|
|
384
|
-
/* The 「?」 beside a title: no border, it says there is more rather than asking to be pressed. */
|
|
385
|
-
button[help] {
|
|
386
|
-
display: inline-flex;
|
|
387
|
-
align-items: center;
|
|
388
|
-
padding: 0;
|
|
389
|
-
margin: 0;
|
|
390
|
-
/* The quiet marks beside a title -- 「?」 and the group's 「⋯」 -- in one colour. */
|
|
391
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
392
|
-
background: none;
|
|
393
|
-
border: none;
|
|
394
|
-
cursor: pointer;
|
|
395
|
-
}
|
|
396
|
-
/* Beside a title at the size every icon beside words takes (16), the group's 「⋯」 too. */
|
|
397
|
-
button[help] md-icon {
|
|
398
|
-
font-size: 16px;
|
|
399
|
-
width: 16px;
|
|
400
|
-
height: 16px;
|
|
401
|
-
}
|
|
402
|
-
button[help]:hover,
|
|
403
|
-
button[help][aria-expanded='true'] {
|
|
404
|
-
color: var(--md-sys-color-primary);
|
|
405
|
-
}
|
|
406
|
-
p[hint],
|
|
407
|
-
small {
|
|
408
|
-
display: block;
|
|
409
|
-
margin: 2px 0 4px;
|
|
410
|
-
font-size: var(--ui-t-micro, 11px);
|
|
411
|
-
line-height: 1.5;
|
|
412
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
413
|
-
}
|
|
414
|
-
/*
|
|
415
|
-
* An action under its fields: its icon and words in the primary colour, no box (user 2026-10-17: 「박스형 버튼의
|
|
416
|
-
* 난립」). It was a band across the panel once (2026-10-01), then an outlined box; the icon and the colour say it is
|
|
417
|
-
* pressed, and the hover lights its ground.
|
|
418
|
-
*/
|
|
419
|
-
button[act] {
|
|
420
|
-
display: inline-flex;
|
|
421
|
-
align-items: center;
|
|
422
|
-
justify-content: center;
|
|
423
|
-
justify-self: start;
|
|
424
|
-
gap: 6px;
|
|
425
|
-
width: auto;
|
|
426
|
-
max-width: 100%;
|
|
427
|
-
margin: 0 0 0 -6px;
|
|
428
|
-
padding: 0 6px;
|
|
429
|
-
min-height: var(--figure-control-height);
|
|
430
|
-
font: inherit;
|
|
431
|
-
color: var(--md-sys-color-primary);
|
|
432
|
-
background: none;
|
|
433
|
-
border: none;
|
|
434
|
-
border-radius: var(--figure-control-radius);
|
|
435
|
-
cursor: pointer;
|
|
436
|
-
}
|
|
437
|
-
/*
|
|
438
|
-
* Taking something back -- detach, clear, back to fixed, remove a row -- in one look: words in the label grey, no box,
|
|
439
|
-
* a step quieter than the group's action in the primary colour (user 2026-10-16, 2026-10-17).
|
|
440
|
-
*/
|
|
441
|
-
button[quiet] {
|
|
442
|
-
display: inline-flex;
|
|
443
|
-
align-items: center;
|
|
444
|
-
justify-self: start;
|
|
445
|
-
gap: 4px;
|
|
446
|
-
height: var(--figure-control-height);
|
|
447
|
-
padding: 0 6px;
|
|
448
|
-
margin-left: -6px;
|
|
449
|
-
font: inherit;
|
|
450
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
451
|
-
background: none;
|
|
452
|
-
border: none;
|
|
453
|
-
border-radius: var(--figure-control-radius);
|
|
454
|
-
cursor: pointer;
|
|
455
|
-
}
|
|
456
|
-
button[quiet]:hover:not(:disabled) {
|
|
457
|
-
background-color: var(--md-sys-color-surface-container);
|
|
458
|
-
}
|
|
459
|
-
button[quiet]:disabled {
|
|
460
|
-
opacity: 0.5;
|
|
461
|
-
cursor: default;
|
|
462
|
-
}
|
|
463
|
-
button[quiet] md-icon {
|
|
464
|
-
font-size: 16px;
|
|
465
|
-
width: 16px;
|
|
466
|
-
height: 16px;
|
|
467
|
-
}
|
|
468
|
-
button[act]:hover:not(:disabled) {
|
|
469
|
-
background-color: var(--md-sys-color-surface-container);
|
|
470
|
-
}
|
|
471
|
-
button[act]:disabled {
|
|
472
|
-
opacity: 0.5;
|
|
473
|
-
cursor: default;
|
|
474
|
-
}
|
|
475
|
-
button[act] md-icon {
|
|
476
|
-
font-size: 16px;
|
|
477
|
-
width: 16px;
|
|
478
|
-
height: 16px;
|
|
479
|
-
}
|
|
480
|
-
`
|
package/client/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig-base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"experimentalDecorators": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"baseUrl": "./",
|
|
9
|
-
"module": "esnext",
|
|
10
|
-
"outDir": "../dist-client"
|
|
11
|
-
},
|
|
12
|
-
"include": [
|
|
13
|
-
"./**/*"
|
|
14
|
-
],
|
|
15
|
-
"exclude": [
|
|
16
|
-
"**/*.test.ts",
|
|
17
|
-
"**/*.spec.ts"
|
|
18
|
-
]
|
|
19
|
-
}
|
package/client/unit-words.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { i18next } from '@operato/i18n'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A unit as the screen names it: the graph's codes (deg, percent, count …) are not words a person reads, and a unit
|
|
5
|
-
* typed by the author (rpm) stays as typed (sweep 2026-10-27 U9).
|
|
6
|
-
*/
|
|
7
|
-
export function unitWord(unit: string | undefined): string {
|
|
8
|
-
if (!unit) return ''
|
|
9
|
-
const key = `figure.label.unit-${unit}`
|
|
10
|
-
return i18next.exists(key) ? i18next.t(key) : unit
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability-rung.js","sourceRoot":"","sources":["../client/capability-rung.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,KAAK,GAAwD,MAAM,CAAC,MAAM,CAAC;IACtF,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAA;AAEF,mKAAmK;AACnK,MAAM,UAAU,MAAM,CAAC,KAAoC;IACzD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACtE,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,MAAM,CAAA;IACjC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAA0C;QACzF,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;IACpF,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import type { FigureCapability } from '@hatiolab/figure-model'\n\n/*\n One rung per set of the format's capability names. Typed as the format's names, so a misspelt rung does not pass\n (ADR-0051 ④).\n*/\nexport type Rung = 'none' | 'hold' | 'flow'\nexport const RUNGS: Readonly<Record<Rung, readonly FigureCapability[]>> = Object.freeze({\n none: [],\n hold: ['Capacity', 'Holdable'],\n flow: ['FlowNode']\n})\n\n/** Which rung a set of names is, or null when it is none of them -- not invented. A product's capability (`<namespace>.<Name>`, ADR-0167) is beside the ladder. */\nexport function rungOf(names: readonly string[] | undefined): Rung | null {\n const has = new Set((names ?? []).filter(name => !name.includes('.')))\n if (has.size === 0) return 'none'\n for (const [rung, wanted] of Object.entries(RUNGS) as [Rung, readonly FigureCapability[]][])\n if (wanted.length === has.size && wanted.every(name => has.has(name))) return rung\n return null\n}\n\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","sourceRoot":"","sources":["../client/controls.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,UAAU,CAAC,KAAkB,EAAE,SAAiC,EAAE;IAChF,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM;SAC/B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;SACvC,GAAG,CAAC,KAAK,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAA;QACxD,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,KAAK,CAAC,EAAE;YAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK;YACtB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK;YAChC,KAAK;YACL,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;YACzB,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG;SAC/D,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC;AAED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA4B,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAA;AAEpG,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA4B,EAAE,EAAE,CAAC,CAAC;IAC9D,IAAI,EAAE,oBAA6B;IACnC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC/D,CAAC,CAAA","sourcesContent":["import type { FigureAsset } from '@hatiolab/figure-model'\n\n/*\n * The figure's controls -- its state inputs: the values a board or a connector sets to pose\n * the figure (a lift height, a joint angle, a gripper opening). Kept apart from the element so the reading is tested\n * without a browser.\n */\nexport interface Control {\n id: string\n /** The name a person reads, or the id when none is given. */\n label: string\n named: boolean\n unit: string\n min: number\n max: number\n /** Where it stands in the editor now -- the pose being looked at, not yet the default. */\n value: number\n /** Where it starts when the figure is placed: the default pose. */\n start: number\n /** Seconds to travel the whole range, 0 when it moves at once. */\n sweep: number\n /** A slider step: one degree for an angle, else a hundredth of the range. */\n step: number\n}\n\nexport function controlsOf(asset: FigureAsset, values: Record<string, number> = {}): Control[] {\n return asset.document.model.inputs\n .filter(input => input.role === 'state')\n .map(input => {\n const policy = asset.stateInputs?.[input.id]\n const start = asset.stateDefaults[input.id] ?? input.min\n return {\n id: input.id,\n label: policy?.label ?? input.id,\n named: !!policy?.label,\n unit: input.unit,\n min: input.min,\n max: input.max,\n value: values[input.id] ?? start,\n start,\n sweep: policy?.sweep ?? 0,\n step: input.unit === 'deg' ? 1 : (input.max - input.min) / 100\n }\n })\n}\n\n/** Whether the pose being looked at differs from the default pose -- only then is there a pose to keep. */\nexport const poseDiffers = (controls: readonly Control[]) => controls.some(c => c.value !== c.start)\n\n/** The current pose as the defaults: one `set-state-defaults` edit. */\nexport const poseAsDefault = (controls: readonly Control[]) => ({\n kind: 'set-state-defaults' as const,\n values: Object.fromEntries(controls.map(c => [c.id, c.value]))\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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,C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C,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-words.js","sourceRoot":"","sources":["../client/data-words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C;;;GAGG;AAEH,0FAA0F;AAC1F,MAAM,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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: FigureItem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import { rungOf } from './capability-rung.js'\nimport { authoredSizeOf, sizeRangeOf } from './preview-model.js'\n\ntype Say = (key: string, params?: Record<string, unknown>) => string\n\n/**\n * What the facts read off a figure's row besides its asset. figure-ui's catalogue row and figure-library's release both\n * give it. `score` absent means the caller does not keep one (no line); null means not measured yet.\n */\nexport interface DetailFactsRow {\n category?: string | null\n tags?: string[] | null\n score?: number | null\n updatedAt?: string | Date | null\n updater?: { name?: string | null } | null\n}\n\n/**\n * A place in words, as every screen that lists places says it: its role (파지 · 안착), what it accepts and how many it\n * holds -- 「파지 · 받는 것 BOX, WORKPIECE · 최대 1」, or 「받는 것 모든 아이템」 for a place that names no type.\n */\nexport function placeTerms(place: { role: string; accepts?: readonly string[]; capacity: number }, say: Say): string {\n return [\n say(`figure.label.role-${place.role}`),\n place.accepts?.length ? say('figure.text.place-accepts', { accepts: place.accepts.join(', ') }) : say('figure.text.place-accepts-any'),\n say('figure.label.place-holds', { count: place.capacity })\n ].join(' · ')\n}\n\n/** One line of what the preview tells about a figure: its label, its value, and for places one line each. */\nexport interface DetailFact {\n key: string\n label: string\n value: string\n lines?: string[]\n}\n\nconst number = (n: number) => Math.round(n).toLocaleString()\n\n/**\n * What a figure is, read off its asset and its row, in the words the modeller's properties already use. Nothing is\n * defaulted: what the figure does not say reads as a dash, and a score not yet measured is said so, not 0.\n */\nexport function detailFactsOf(asset: FigureAsset, row: DetailFactsRow, say: Say): DetailFact[] {\n const facts: DetailFact[] = []\n const dash = '—'\n\n facts.push({ key: 'category', label: say('figure.label.category'), value: row.category || dash })\n facts.push({ key: 'tags', label: say('figure.label.tags'), value: row.tags?.length ? row.tags.join(', ') : dash })\n facts.push({ key: 'placement', label: say('figure.label.figure-placement'), value: asset.placement ? say(`figure.label.placement-${asset.placement}`) : dash })\n\n /* The sizes a board may give it: a range on an axis that opens one, the authored size on one that is fixed. */\n const base = authoredSizeOf(asset)\n const axes = (['x', 'y', 'z'] as const).map(axis => {\n const range = sizeRangeOf(asset, axis)\n return `${axis.toUpperCase()} ${range ? `${number(range.min)}–${Number.isFinite(range.max) ? number(range.max) : '∞'}` : number(base[axis])}`\n })\n facts.push({ key: 'size', label: say('figure.label.instance-range'), value: `${axes.join(' · ')} mm` })\n if (asset.sizing === 'uniform') facts.push({ key: 'sizing', label: say('figure.label.sizing-rule'), value: say('figure.label.sizing-uniform') })\n\n const names = asset.document.capabilities.names ?? []\n const rung = rungOf(names)\n facts.push({ key: 'does', label: say('figure.label.what-this-does'), value: rung ? say(`figure.label.rung-${rung}`) : names.join(' · ') })\n\n const places = figureBindingsOf(asset)\n facts.push({\n key: 'places',\n label: say('figure.label.places'),\n value: places.length ? String(places.length) : dash,\n lines: places.map(place => `${place.label} · ${placeTerms(place, say)}`)\n })\n\n facts.push({ key: 'joints', label: say('figure.label.joint'), value: String(figureJointsOf(asset).joints.length) })\n const extensions = Object.keys((asset as { extensions?: Record<string, unknown> }).extensions ?? {})\n if (extensions.length) facts.push({ key: 'extensions', label: say('figure.label.extensions'), value: extensions.join(', ') })\n\n if ('score' in row)\n facts.push({ key: 'maturity', label: say('figure.label.maturity'), value: row.score == null ? say('figure.text.not-measured-yet') : String(Math.round(row.score)) })\n if (row.updatedAt) {\n const at = new Date(row.updatedAt).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })\n facts.push({ key: 'updated', label: say('field.updated_at'), value: row.updater?.name ? `${at} · ${row.updater.name}` : at })\n }\n return facts\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detail-motion.js","sourceRoot":"","sources":["../client/detail-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAA0C,MAAM,wBAAwB,CAAA;AAE3G,4FAA4F;AAC5F,MAAM,UAAU,iBAAiB,CAAC,KAAkB,EAAE,MAA8B,EAAE,IAAY;IAChG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAA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,CAAC,CAAC,IAAI,CAAA;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACxM,MAAM,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9I,MAAM,YAAY,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACjF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import { compileFigureDataInterface, type FigureAsset, type FigureDataValue } from '@hatiolab/figure-model'\n\n/** External values win over drivers; release only the controls owned by the chosen clip. */\nexport function parametersForClip(asset: FigureAsset, values: Record<string, number>, clip: string) {\n const driven = new Set((asset.drivers ?? []).filter(d => d.clip === clip).map(d => d.state))\n return Object.fromEntries(Object.entries(values).filter(([id]) => !driven.has(id)))\n}\n\n/** The clips that move an input. A clip can move many inputs, so it plays on its own row, never on an input's. */\nexport function clipsDriving(asset: FigureAsset, id: string) {\n return [...new Set((asset.drivers ?? []).filter(d => d.state === id).map(d => d.clip))]\n}\n\n/**\n * How the detail view plays a clip (ADR-0051 §3.2, §8). A clip in no motion group plays at its own speed (the board's\n * `clips`). A clip of a group is the group's selection (the board's `motion`); and when the figure's data chooses that\n * group's clip, the data wins -- its default too -- so the clip is chosen through a data value the figure's own binding\n * turns into it, given as a saved value (`figureValues`), the way a board would: the value itself, or the code of a\n * table whose look names the clip (ADR-0166). A clip no data value turns into (an interval, a scale, or only another\n * value's fallback of an open field) cannot be chosen here.\n */\nexport type ClipPlay =\n | { kind: 'free' }\n | { kind: 'group'; group: string }\n | { kind: 'data'; group: string; accessor: string; value: FigureDataValue }\n | { kind: 'unreachable'; group: string }\n\nexport function clipPlayOf(asset: FigureAsset, clip: string): ClipPlay {\n const group = (asset.motionGroups ?? []).find(g => g.clips.includes(clip))\n if (!group) return { kind: 'free' }\n const plan = asset.dataInterface ? compileFigureDataInterface(asset) : null\n const ready = plan?.bindings.find(({ binding: b }) =>\n b.rule === 'table' ? b.targets.group === group.id && Object.values(b.table).some(look => look.clip !== undefined) : b.behavior.kind === 'motion-clip' && b.behavior.group === group.id\n )\n if (!ready) return { kind: 'group', group: group.id }\n const { binding, node } = ready\n const reached = (value: FigureDataValue): ClipPlay => ({ kind: 'data', group: group.id, accessor: binding.accessor, value })\n const unreachable: ClipPlay = { kind: 'unreachable', group: group.id }\n const closed = node.kind === 'boolean' ? ['false', 'true'] : node.kind === 'text' && node.values ? node.values : null\n const typed = (key: string): FigureDataValue => (node.kind === 'boolean' ? key === 'true' : node.kind === 'number' ? Number(key) : key)\n if (binding.rule === 'value') return node.kind === 'text' && (!closed || closed.includes(clip)) ? reached(clip) : unreachable\n if (binding.rule !== 'table' || binding.lookup !== 'code') return unreachable\n const table = binding.table\n const key = Object.keys(table).find(k => k !== 'default' && table[k].clip === clip)\n if (key !== undefined) return reached(typed(key))\n /* Only the default turns into it: a value of a closed field the table does not name. */\n const spare = table.default?.clip === clip ? closed?.find(v => !Object.hasOwn(table, v)) : undefined\n return spare !== undefined ? reached(typed(spare)) : unreachable\n}\n\n/**\n * What the board is told for the clip playing (none: ''): the free clips' speeds, the group's selection, and the saved\n * data value that chooses it. Every key is written whole, so the clip played before is let go.\n */\nexport function playSettingsOf(asset: FigureAsset, playing: string) {\n const play = playing ? clipPlayOf(asset, playing) : null\n const clips = Object.fromEntries([...new Set((asset.drivers ?? []).filter(d => !(asset.motionGroups ?? []).some(g => g.clips.includes(d.clip))).map(d => d.clip))].map(c => [c, c === playing ? 1 : 0]))\n const motion = play && play.kind !== 'free' && play.kind !== 'unreachable' ? { [play.group]: { clip: playing, speed: 1, paused: false } } : {}\n const figureValues = play?.kind === 'data' ? { [play.accessor]: play.value } : {}\n return { clips, motion, figureValues }\n}\n"]}
|