@things-factory/figure-library 10.1.250 → 10.1.254
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/editors/ox-property-editor-figure-data.d.ts +1 -3
- package/dist-client/editors/ox-property-editor-figure-data.js +10 -98
- package/dist-client/editors/ox-property-editor-figure-data.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/translations/en.json +1 -35
- package/translations/es.json +1 -35
- package/translations/ja.json +1 -35
- package/translations/ko.json +1 -35
- package/translations/ms.json +1 -35
- package/translations/zh.json +1 -35
- package/dist-client/figure-data-report.d.ts +0 -53
- package/dist-client/figure-data-report.js +0 -93
- package/dist-client/figure-data-report.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-library",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.254",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test": "node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hatiolab/figure-model": "^0.12.
|
|
31
|
-
"@hatiolab/things-scene": "^10.1.
|
|
30
|
+
"@hatiolab/figure-model": "^0.12.3",
|
|
31
|
+
"@hatiolab/things-scene": "^10.1.110",
|
|
32
32
|
"@material/web": "^2.0.0",
|
|
33
33
|
"@operato/data-grist": "^10.0.0",
|
|
34
34
|
"@operato/graphql": "^10.29.36",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@operato/slot-layout-editor": "^10.29.58",
|
|
41
41
|
"@operato/styles": "^10.29.23",
|
|
42
42
|
"@operato/utils": "^10.0.0",
|
|
43
|
-
"@things-factory/attachment-base": "^10.1.
|
|
44
|
-
"@things-factory/auth-base": "^10.1.
|
|
45
|
-
"@things-factory/board-service": "^10.1.
|
|
43
|
+
"@things-factory/attachment-base": "^10.1.254",
|
|
44
|
+
"@things-factory/auth-base": "^10.1.254",
|
|
45
|
+
"@things-factory/board-service": "^10.1.254",
|
|
46
46
|
"@things-factory/env": "^10.1.149",
|
|
47
|
-
"@things-factory/figure-viewer": "^10.1.
|
|
48
|
-
"@things-factory/shell": "^10.1.
|
|
47
|
+
"@things-factory/figure-viewer": "^10.1.253",
|
|
48
|
+
"@things-factory/shell": "^10.1.254",
|
|
49
49
|
"graphql-scalars": "^1.22.4",
|
|
50
50
|
"graphql-tag": "^2.12.6",
|
|
51
51
|
"graphql-upload": "^15.0.2",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"koa-router": "^7.4.0",
|
|
54
54
|
"lit": "^3.1.2"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "793e2fd617db5bb917ec892e64956fb690f7e7b0"
|
|
57
57
|
}
|
package/translations/en.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "not latest",
|
|
86
86
|
"figure-library.label.release-shown": "release shown",
|
|
87
87
|
"label.figure-data": "figure data",
|
|
88
|
-
"label.slot-layout": "Slot layout",
|
|
89
|
-
"figure.text.board-data-none": "This figure has no data shape, or more than one is selected.",
|
|
90
|
-
"figure.label.board-data-source-live": "data",
|
|
91
|
-
"figure.label.board-data-source-manual": "saved",
|
|
92
|
-
"figure.label.board-data-source-default": "default",
|
|
93
|
-
"figure.label.board-data-source-absent": "none",
|
|
94
|
-
"figure.label.board-data-true": "true",
|
|
95
|
-
"figure.label.board-data-false": "false",
|
|
96
|
-
"figure.label.board-data-count": "{count}",
|
|
97
|
-
"figure.label.board-data-kind-number": "number",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "true/false",
|
|
99
|
-
"figure.label.board-data-kind-text": "text",
|
|
100
|
-
"figure.label.board-data-kind-object": "object",
|
|
101
|
-
"figure.label.board-data-kind-list": "list",
|
|
102
|
-
"figure.label.board-data-behavior-state": "control {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "colour {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "{name} clip",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "{name} speed",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} paused",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "position {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "items {name}",
|
|
109
|
-
"figure.text.board-data-held": "The board's state values set {controls}, so this data does not move it.",
|
|
110
|
-
"figure.text.board-data-refused": "Something given was refused: {reason}",
|
|
111
|
-
"figure.text.board-data-unused": "Not in the data shape, so not used: {fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "copy an example",
|
|
113
|
-
"figure.button.board-data-copied": "copied",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}: not an object.",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}: not a list.",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}: the value is of the wrong kind.",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}: outside its range.",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}: not one of its values.",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}: the JSON text cannot be read.",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}: the item has no id.",
|
|
121
88
|
"error.figure-archived": "archived in this domain.",
|
|
122
89
|
"error.figure-in-use": "{name} is on {count} board(s): {boards}. Take it off them first.",
|
|
123
90
|
"figure-library.label.archived": "Include archived",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key} is not a range.",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "The legend has no row for the value {value}.",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "The row {key} cannot be read ({value}).",
|
|
185
|
-
"figure.text.legend-note-not-taken": "The {column} {value} of row {key} was not taken."
|
|
186
|
-
"figure.label.board-data-behavior-table": "table {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "The {column} {value} of row {key} was not taken."
|
|
187
153
|
}
|
package/translations/es.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "no es la última",
|
|
86
86
|
"figure-library.label.release-shown": "publicación mostrada",
|
|
87
87
|
"label.figure-data": "datos de la figura",
|
|
88
|
-
"label.slot-layout": "Disposición de posiciones",
|
|
89
|
-
"figure.text.board-data-none": "Esta figura no tiene forma de datos, o hay más de una seleccionada.",
|
|
90
|
-
"figure.label.board-data-source-live": "datos",
|
|
91
|
-
"figure.label.board-data-source-manual": "guardado",
|
|
92
|
-
"figure.label.board-data-source-default": "predeterminado",
|
|
93
|
-
"figure.label.board-data-source-absent": "ninguno",
|
|
94
|
-
"figure.label.board-data-true": "verdadero",
|
|
95
|
-
"figure.label.board-data-false": "falso",
|
|
96
|
-
"figure.label.board-data-count": "{count}",
|
|
97
|
-
"figure.label.board-data-kind-number": "número",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "verdadero/falso",
|
|
99
|
-
"figure.label.board-data-kind-text": "texto",
|
|
100
|
-
"figure.label.board-data-kind-object": "objeto",
|
|
101
|
-
"figure.label.board-data-kind-list": "lista",
|
|
102
|
-
"figure.label.board-data-behavior-state": "control {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "color {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "clip de {name}",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "velocidad de {name}",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} en pausa",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "posición {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "artículos {name}",
|
|
109
|
-
"figure.text.board-data-held": "Los valores de estado del tablero fijan {controls}, así que estos datos no lo mueven.",
|
|
110
|
-
"figure.text.board-data-refused": "Algo se rechazó: {reason}",
|
|
111
|
-
"figure.text.board-data-unused": "No están en la forma de datos, así que no se usan: {fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "copiar un ejemplo",
|
|
113
|
-
"figure.button.board-data-copied": "copiado",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}: no es un objeto.",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}: no es una lista.",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}: el valor es de otro tipo.",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}: fuera de su rango.",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}: no es uno de sus valores.",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}: no se puede leer el texto JSON.",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}: el artículo no tiene id.",
|
|
121
88
|
"error.figure-archived": "archivada en este dominio.",
|
|
122
89
|
"error.figure-in-use": "{name} está en {count} tablero(s): {boards}. Quítela de ellos primero.",
|
|
123
90
|
"figure-library.label.archived": "Incluir archivadas",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key} no es un rango.",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "La leyenda no tiene fila para el valor {value}.",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "No se puede leer la fila {key} ({value}).",
|
|
185
|
-
"figure.text.legend-note-not-taken": "No se tomó {column} {value} de la fila {key}."
|
|
186
|
-
"figure.label.board-data-behavior-table": "tabla {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "No se tomó {column} {value} de la fila {key}."
|
|
187
153
|
}
|
package/translations/ja.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "最新でない",
|
|
86
86
|
"figure-library.label.release-shown": "表示するバージョン",
|
|
87
87
|
"label.figure-data": "Figureデータ",
|
|
88
|
-
"label.slot-layout": "位置の配置",
|
|
89
|
-
"figure.text.board-data-none": "このFigureにはデータ形式がありません。1つだけ選ぶと表示されます。",
|
|
90
|
-
"figure.label.board-data-source-live": "データ",
|
|
91
|
-
"figure.label.board-data-source-manual": "保存値",
|
|
92
|
-
"figure.label.board-data-source-default": "既定値",
|
|
93
|
-
"figure.label.board-data-source-absent": "なし",
|
|
94
|
-
"figure.label.board-data-true": "真",
|
|
95
|
-
"figure.label.board-data-false": "偽",
|
|
96
|
-
"figure.label.board-data-count": "{count}件",
|
|
97
|
-
"figure.label.board-data-kind-number": "数値",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "真/偽",
|
|
99
|
-
"figure.label.board-data-kind-text": "文字",
|
|
100
|
-
"figure.label.board-data-kind-object": "オブジェクト",
|
|
101
|
-
"figure.label.board-data-kind-list": "リスト",
|
|
102
|
-
"figure.label.board-data-behavior-state": "操作値 {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "色 {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "{name} クリップ",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "{name} 倍速",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} 一時停止",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "位置 {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "アイテム {name}",
|
|
109
|
-
"figure.text.board-data-held": "ボードの状態値が {controls} を決めているため、このデータでは動きません。",
|
|
110
|
-
"figure.text.board-data-refused": "受け取らなかった値があります: {reason}",
|
|
111
|
-
"figure.text.board-data-unused": "データ形式にないフィールドのため使いません: {fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "例をコピー",
|
|
113
|
-
"figure.button.board-data-copied": "コピーしました",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}: オブジェクトではありません。",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}: リストではありません。",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}: 値の種類が合いません。",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}: 範囲外です。",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}: 値の一覧にない値です。",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}: JSON文字列を読めません。",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}: アイテムIDがありません。",
|
|
121
88
|
"error.figure-archived": "このドメインでアーカイブされています。",
|
|
122
89
|
"error.figure-in-use": "{name} は {count} 個のボードに置かれています: {boards}。先にボードから外してください。",
|
|
123
90
|
"figure-library.label.archived": "アーカイブを含める",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key} は区間ではありません。",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "値 {value} に合う行が凡例にありません。",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "{key} の行を読めません({value})。",
|
|
185
|
-
"figure.text.legend-note-not-taken": "{key} 行の {column} {value} は受け付けませんでした。"
|
|
186
|
-
"figure.label.board-data-behavior-table": "表 {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "{key} 行の {column} {value} は受け付けませんでした。"
|
|
187
153
|
}
|
package/translations/ko.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "최신 아님",
|
|
86
86
|
"figure-library.label.release-shown": "보이는 버전",
|
|
87
87
|
"label.figure-data": "피규어 데이터",
|
|
88
|
-
"label.slot-layout": "자리 배치",
|
|
89
|
-
"figure.text.board-data-none": "이 피규어는 데이터 형식이 없습니다. 하나만 고르면 보입니다.",
|
|
90
|
-
"figure.label.board-data-source-live": "데이터",
|
|
91
|
-
"figure.label.board-data-source-manual": "저장값",
|
|
92
|
-
"figure.label.board-data-source-default": "기본값",
|
|
93
|
-
"figure.label.board-data-source-absent": "없음",
|
|
94
|
-
"figure.label.board-data-true": "참",
|
|
95
|
-
"figure.label.board-data-false": "거짓",
|
|
96
|
-
"figure.label.board-data-count": "{count}개",
|
|
97
|
-
"figure.label.board-data-kind-number": "숫자",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "참/거짓",
|
|
99
|
-
"figure.label.board-data-kind-text": "글자",
|
|
100
|
-
"figure.label.board-data-kind-object": "객체",
|
|
101
|
-
"figure.label.board-data-kind-list": "목록",
|
|
102
|
-
"figure.label.board-data-behavior-state": "조작값 {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "색 {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "{name} 클립",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "{name} 배속",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} 멈춤",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "위치 {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "아이템 {name}",
|
|
109
|
-
"figure.text.board-data-held": "보드의 상태값이 {controls}를 정하고 있어 이 데이터로는 움직이지 않습니다.",
|
|
110
|
-
"figure.text.board-data-refused": "받지 않은 값이 있습니다: {reason}",
|
|
111
|
-
"figure.text.board-data-unused": "데이터 형식에 없는 필드라 쓰지 않습니다: {fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "예제 복사",
|
|
113
|
-
"figure.button.board-data-copied": "복사했습니다",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}: 객체가 아닙니다.",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}: 목록이 아닙니다.",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}: 값 종류가 맞지 않습니다.",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}: 범위를 벗어났습니다.",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}: 값 목록에 없는 값입니다.",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}: JSON 글자를 읽을 수 없습니다.",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}: 아이템 ID가 없습니다.",
|
|
121
88
|
"error.figure-archived": "이 도메인에서 아카이브되었습니다.",
|
|
122
89
|
"error.figure-in-use": "{name} 은 보드 {count}개에 놓여 있습니다: {boards}. 보드에서 먼저 빼세요.",
|
|
123
90
|
"figure-library.label.archived": "아카이브 포함",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key}는 구간이 아닙니다.",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "값 {value}에 맞는 줄이 범례에 없습니다.",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "{key} 줄을 읽을 수 없습니다({value}).",
|
|
185
|
-
"figure.text.legend-note-not-taken": "{key} 줄의 {column} {value}을(를) 받지 않았습니다."
|
|
186
|
-
"figure.label.board-data-behavior-table": "표 {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "{key} 줄의 {column} {value}을(를) 받지 않았습니다."
|
|
187
153
|
}
|
package/translations/ms.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "bukan terbaharu",
|
|
86
86
|
"figure-library.label.release-shown": "terbitan ditunjukkan",
|
|
87
87
|
"label.figure-data": "data figure",
|
|
88
|
-
"label.slot-layout": "Susunan kedudukan",
|
|
89
|
-
"figure.text.board-data-none": "Figure ini tiada bentuk data, atau lebih daripada satu dipilih.",
|
|
90
|
-
"figure.label.board-data-source-live": "data",
|
|
91
|
-
"figure.label.board-data-source-manual": "disimpan",
|
|
92
|
-
"figure.label.board-data-source-default": "lalai",
|
|
93
|
-
"figure.label.board-data-source-absent": "tiada",
|
|
94
|
-
"figure.label.board-data-true": "benar",
|
|
95
|
-
"figure.label.board-data-false": "palsu",
|
|
96
|
-
"figure.label.board-data-count": "{count}",
|
|
97
|
-
"figure.label.board-data-kind-number": "nombor",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "benar/palsu",
|
|
99
|
-
"figure.label.board-data-kind-text": "teks",
|
|
100
|
-
"figure.label.board-data-kind-object": "objek",
|
|
101
|
-
"figure.label.board-data-kind-list": "senarai",
|
|
102
|
-
"figure.label.board-data-behavior-state": "kawalan {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "warna {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "klip {name}",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "kelajuan {name}",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} dijeda",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "kedudukan {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "item {name}",
|
|
109
|
-
"figure.text.board-data-held": "Nilai keadaan papan menetapkan {controls}, jadi data ini tidak menggerakkannya.",
|
|
110
|
-
"figure.text.board-data-refused": "Ada yang ditolak: {reason}",
|
|
111
|
-
"figure.text.board-data-unused": "Tiada dalam bentuk data, jadi tidak digunakan: {fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "salin contoh",
|
|
113
|
-
"figure.button.board-data-copied": "disalin",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}: bukan objek.",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}: bukan senarai.",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}: jenis nilai salah.",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}: di luar julat.",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}: bukan salah satu nilainya.",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}: teks JSON tidak boleh dibaca.",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}: item tiada id.",
|
|
121
88
|
"error.figure-archived": "telah diarkibkan dalam domain ini.",
|
|
122
89
|
"error.figure-in-use": "{name} berada pada {count} papan: {boards}. Keluarkan daripadanya dahulu.",
|
|
123
90
|
"figure-library.label.archived": "Sertakan yang diarkibkan",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key} bukan julat.",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "Petunjuk tiada baris bagi nilai {value}.",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "Baris {key} tidak dapat dibaca ({value}).",
|
|
185
|
-
"figure.text.legend-note-not-taken": "{column} {value} pada baris {key} tidak diambil."
|
|
186
|
-
"figure.label.board-data-behavior-table": "jadual {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "{column} {value} pada baris {key} tidak diambil."
|
|
187
153
|
}
|
package/translations/zh.json
CHANGED
|
@@ -85,39 +85,6 @@
|
|
|
85
85
|
"figure-library.text.not-latest": "非最新",
|
|
86
86
|
"figure-library.label.release-shown": "显示的版本",
|
|
87
87
|
"label.figure-data": "Figure 数据",
|
|
88
|
-
"label.slot-layout": "位置布局",
|
|
89
|
-
"figure.text.board-data-none": "此 Figure 没有数据结构;只选择一个时才显示。",
|
|
90
|
-
"figure.label.board-data-source-live": "数据",
|
|
91
|
-
"figure.label.board-data-source-manual": "保存值",
|
|
92
|
-
"figure.label.board-data-source-default": "默认值",
|
|
93
|
-
"figure.label.board-data-source-absent": "无",
|
|
94
|
-
"figure.label.board-data-true": "真",
|
|
95
|
-
"figure.label.board-data-false": "假",
|
|
96
|
-
"figure.label.board-data-count": "{count} 个",
|
|
97
|
-
"figure.label.board-data-kind-number": "数字",
|
|
98
|
-
"figure.label.board-data-kind-boolean": "真/假",
|
|
99
|
-
"figure.label.board-data-kind-text": "文本",
|
|
100
|
-
"figure.label.board-data-kind-object": "对象",
|
|
101
|
-
"figure.label.board-data-kind-list": "列表",
|
|
102
|
-
"figure.label.board-data-behavior-state": "控制值 {name}",
|
|
103
|
-
"figure.label.board-data-behavior-palette": "颜色 {name}",
|
|
104
|
-
"figure.label.board-data-behavior-motion-clip": "{name} 片段",
|
|
105
|
-
"figure.label.board-data-behavior-motion-speed": "{name} 倍速",
|
|
106
|
-
"figure.label.board-data-behavior-motion-paused": "{name} 暂停",
|
|
107
|
-
"figure.label.board-data-behavior-pose": "位置 {name}",
|
|
108
|
-
"figure.label.board-data-behavior-items": "物品 {name}",
|
|
109
|
-
"figure.text.board-data-held": "看板的状态值正在设定 {controls},因此此数据不会驱动它。",
|
|
110
|
-
"figure.text.board-data-refused": "有未接受的值:{reason}",
|
|
111
|
-
"figure.text.board-data-unused": "不在数据结构中,因此不使用:{fields}",
|
|
112
|
-
"figure.button.board-data-copy-example": "复制示例",
|
|
113
|
-
"figure.button.board-data-copied": "已复制",
|
|
114
|
-
"figure.text.board-data-value-not-a-record": "{path}:不是对象。",
|
|
115
|
-
"figure.text.board-data-value-not-a-list": "{path}:不是列表。",
|
|
116
|
-
"figure.text.board-data-value-type-mismatch": "{path}:值的类型不符。",
|
|
117
|
-
"figure.text.board-data-value-out-of-range": "{path}:超出范围。",
|
|
118
|
-
"figure.text.board-data-value-value-unknown": "{path}:不在取值列表中。",
|
|
119
|
-
"figure.text.board-data-value-json-unreadable": "{path}:无法读取 JSON 文本。",
|
|
120
|
-
"figure.text.board-data-value-item-id-missing": "{path}:物品没有 ID。",
|
|
121
88
|
"error.figure-archived": "已在此域中归档。",
|
|
122
89
|
"error.figure-in-use": "{name} 位于 {count} 个看板上: {boards}。请先从看板中移除。",
|
|
123
90
|
"figure-library.label.archived": "包含已归档",
|
|
@@ -182,6 +149,5 @@
|
|
|
182
149
|
"figure.text.legend-note-not-an-interval": "{key} 不是区间。",
|
|
183
150
|
"figure.text.legend-note-code-unmatched": "图例中没有与值 {value} 对应的行。",
|
|
184
151
|
"figure.text.legend-note-not-a-look": "无法读取 {key} 行({value})。",
|
|
185
|
-
"figure.text.legend-note-not-taken": "{key} 行的 {column} {value} 未被采用。"
|
|
186
|
-
"figure.label.board-data-behavior-table": "表 {name}"
|
|
152
|
+
"figure.text.legend-note-not-taken": "{key} 行的 {column} {value} 未被采用。"
|
|
187
153
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { FigureAsset, FigureDataBehavior, FigureDataNode, FigureDataTargets, FigureDataValue, FigureDataValueIssue } from '@hatiolab/figure-model';
|
|
2
|
-
/** Where a value came from, as things-scene's figure inputs say. */
|
|
3
|
-
export type FigureDataSource = 'live' | 'manual' | 'default' | 'absent';
|
|
4
|
-
/** A placed figure as the section reads it: its asset, its state, and what its figure inputs worked out. */
|
|
5
|
-
export interface FigureDataSnapshot {
|
|
6
|
-
asset: FigureAsset;
|
|
7
|
-
/** The component's data, as the board's data source or a mapping gave it. */
|
|
8
|
-
data: unknown;
|
|
9
|
-
/** The board's own state values (`parameters`), by control. */
|
|
10
|
-
parameters?: Record<string, unknown> | null;
|
|
11
|
-
/** Each binding's value now and its source, by binding id (figure inputs' `dataValues`). */
|
|
12
|
-
values: Readonly<Record<string, {
|
|
13
|
-
value: FigureDataValue | undefined;
|
|
14
|
-
source: FigureDataSource;
|
|
15
|
-
}>>;
|
|
16
|
-
/** Why the last things given were refused (figure inputs' `diagnostics()`). */
|
|
17
|
-
refused: ReadonlyArray<{
|
|
18
|
-
source: string;
|
|
19
|
-
reason: string;
|
|
20
|
-
issues?: FigureDataValueIssue[];
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
export interface FigureDataReportRow {
|
|
24
|
-
path: string;
|
|
25
|
-
depth: number;
|
|
26
|
-
name: string;
|
|
27
|
-
label?: string;
|
|
28
|
-
node: FigureDataNode;
|
|
29
|
-
/** A value field's value now; a list's element count in the data. */
|
|
30
|
-
value?: FigureDataValue;
|
|
31
|
-
count?: number;
|
|
32
|
-
source?: FigureDataSource;
|
|
33
|
-
/** What the bindings reading it move: a behavior each, or a table and its targets. */
|
|
34
|
-
behaviors: FigureDataMove[];
|
|
35
|
-
/** Controls it moves that the board's state values hold instead. */
|
|
36
|
-
heldByBoard: string[];
|
|
37
|
-
}
|
|
38
|
-
/** What one binding moves: a value binding's behavior, or a table's targets (ADR-0166 3). */
|
|
39
|
-
export type FigureDataMove = FigureDataBehavior | {
|
|
40
|
-
kind: 'table';
|
|
41
|
-
targets: FigureDataTargets;
|
|
42
|
-
};
|
|
43
|
-
export interface FigureDataReport {
|
|
44
|
-
rows: FigureDataReportRow[];
|
|
45
|
-
/** Fields the data has that the shape does not name, as paths (`[]` for a list's elements). */
|
|
46
|
-
unused: string[];
|
|
47
|
-
refused: FigureDataSnapshot['refused'];
|
|
48
|
-
/** Data with every field of the shape, to copy. */
|
|
49
|
-
example: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
export declare function figureDataReportOf(s: FigureDataSnapshot): FigureDataReport | null;
|
|
52
|
-
/** The things a binding moves, as one line: the control, the colour token, the group, the axis, the place; a table's targets. */
|
|
53
|
-
export declare const behaviorTargetOf: (b: FigureDataMove) => string;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* What the board's 「Figure 데이터」 section shows of a placed figure (data binding design, decision 3): the figure's data
|
|
3
|
-
* shape as a tree, each value now and where it came from -- the component's data, a value saved on the board, the
|
|
4
|
-
* shape's default, or none -- what it moves, a control the board's own state values hold over the data, why data was
|
|
5
|
-
* refused, the fields the data has that the shape does not name, and an example to copy.
|
|
6
|
-
*
|
|
7
|
-
* Nothing here reads data: the values and their sources are things-scene's figure inputs', given in. Kept apart from the
|
|
8
|
-
* element so it is tested without a board.
|
|
9
|
-
*/
|
|
10
|
-
import { figureDataExample, figureDataRows } from '@hatiolab/figure-model';
|
|
11
|
-
const isRecord = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
12
|
-
/** The value at a path with no list in it (`A.B`), or undefined. */
|
|
13
|
-
function valueAt(data, path) {
|
|
14
|
-
let at = data;
|
|
15
|
-
for (const name of path.split('.')) {
|
|
16
|
-
if (!isRecord(at))
|
|
17
|
-
return undefined;
|
|
18
|
-
at = at[name];
|
|
19
|
-
}
|
|
20
|
-
return at;
|
|
21
|
-
}
|
|
22
|
-
/** Every field path the data has that the shape does not name. A JSON text in place of an object or a list is not looked into. */
|
|
23
|
-
function unusedOf(data, fields, at, out) {
|
|
24
|
-
if (!isRecord(data))
|
|
25
|
-
return;
|
|
26
|
-
for (const [key, value] of Object.entries(data)) {
|
|
27
|
-
const path = at ? `${at}.${key}` : key;
|
|
28
|
-
const field = fields.find(f => f.name === key);
|
|
29
|
-
if (!field) {
|
|
30
|
-
out.add(path);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
let node = field;
|
|
34
|
-
let value_ = value;
|
|
35
|
-
let p = path;
|
|
36
|
-
while (node.kind === 'list' && Array.isArray(value_)) {
|
|
37
|
-
const item = node.item;
|
|
38
|
-
p = `${p}[]`;
|
|
39
|
-
for (const element of value_)
|
|
40
|
-
if (item.kind === 'object')
|
|
41
|
-
unusedOf(element, item.fields, p, out);
|
|
42
|
-
value_ = undefined;
|
|
43
|
-
node = item;
|
|
44
|
-
}
|
|
45
|
-
if (node.kind === 'object' && isRecord(value_))
|
|
46
|
-
unusedOf(value_, node.fields, p, out);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export function figureDataReportOf(s) {
|
|
50
|
-
const di = s.asset.dataInterface;
|
|
51
|
-
if (!di)
|
|
52
|
-
return null;
|
|
53
|
-
const bindings = new Map(di.bindings.map(b => [b.id, b]));
|
|
54
|
-
const held = new Set(Object.keys(s.parameters ?? {}));
|
|
55
|
-
const rows = figureDataRows(di).map((row) => {
|
|
56
|
-
const reading = row.bindings.map(id => bindings.get(id)).filter(b => !!b);
|
|
57
|
-
const behaviors = reading.map((b) => (b.rule === 'table' ? { kind: 'table', targets: b.targets } : b.behavior));
|
|
58
|
-
const heldByBoard = behaviors.flatMap(b => (b.kind === 'state' ? [b.input] : b.kind === 'table' ? (b.targets.inputs ?? []) : []).filter(input => held.has(input)));
|
|
59
|
-
const out = { path: row.path, depth: row.depth, name: row.name, ...(row.label ? { label: row.label } : {}), node: row.node, behaviors, heldByBoard };
|
|
60
|
-
if (row.node.kind === 'list') {
|
|
61
|
-
const list = row.path.includes('[]') ? undefined : valueAt(s.data, row.path);
|
|
62
|
-
if (Array.isArray(list))
|
|
63
|
-
out.count = list.length;
|
|
64
|
-
}
|
|
65
|
-
else if (row.node.kind !== 'object') {
|
|
66
|
-
/* The value a binding read: the first that reads this place and is not an items binding (items read the list). */
|
|
67
|
-
const read = reading.find(b => (b.rule === 'table' || b.behavior.kind !== 'items') && s.values[b.id]);
|
|
68
|
-
if (read) {
|
|
69
|
-
const { value, source } = s.values[read.id];
|
|
70
|
-
out.source = source;
|
|
71
|
-
if (value !== undefined)
|
|
72
|
-
out.value = value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return out;
|
|
76
|
-
});
|
|
77
|
-
const unused = new Set();
|
|
78
|
-
unusedOf(s.data, di.schema, '', unused);
|
|
79
|
-
return { rows, unused: [...unused], refused: s.refused, example: figureDataExample(di) };
|
|
80
|
-
}
|
|
81
|
-
/** The things a binding moves, as one line: the control, the colour token, the group, the axis, the place; a table's targets. */
|
|
82
|
-
export const behaviorTargetOf = (b) => b.kind === 'table'
|
|
83
|
-
? [...(b.targets.parts ?? []), ...(b.targets.inputs ?? []), ...(b.targets.group ? [b.targets.group] : [])].join(', ')
|
|
84
|
-
: b.kind === 'state'
|
|
85
|
-
? b.input
|
|
86
|
-
: b.kind === 'palette'
|
|
87
|
-
? b.token
|
|
88
|
-
: b.kind === 'pose'
|
|
89
|
-
? b.axis
|
|
90
|
-
: b.kind === 'items'
|
|
91
|
-
? (b.slot ?? '')
|
|
92
|
-
: b.group;
|
|
93
|
-
//# sourceMappingURL=figure-data-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-data-report.js","sourceRoot":"","sources":["../client/figure-data-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AA+C1E,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAgC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAA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CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACrH,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO;QAClB,CAAC,CAAC,CAAC,CAAC,KAAK;QACT,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS;YACpB,CAAC,CAAC,CAAC,CAAC,KAAK;YACT,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM;gBACjB,CAAC,CAAC,CAAC,CAAC,IAAI;gBACR,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO;oBAClB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;oBAChB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA","sourcesContent":["/*\n * What the board's 「Figure 데이터」 section shows of a placed figure (data binding design, decision 3): the figure's data\n * shape as a tree, each value now and where it came from -- the component's data, a value saved on the board, the\n * shape's default, or none -- what it moves, a control the board's own state values hold over the data, why data was\n * refused, the fields the data has that the shape does not name, and an example to copy.\n *\n * Nothing here reads data: the values and their sources are things-scene's figure inputs', given in. Kept apart from the\n * element so it is tested without a board.\n */\nimport { figureDataExample, figureDataRows } from '@hatiolab/figure-model'\nimport type { FigureAsset, FigureDataBehavior, FigureDataNode, FigureDataTargets, FigureDataValue, FigureDataValueIssue } from '@hatiolab/figure-model'\n\n/** Where a value came from, as things-scene's figure inputs say. */\nexport type FigureDataSource = 'live' | 'manual' | 'default' | 'absent'\n\n/** A placed figure as the section reads it: its asset, its state, and what its figure inputs worked out. */\nexport interface FigureDataSnapshot {\n asset: FigureAsset\n /** The component's data, as the board's data source or a mapping gave it. */\n data: unknown\n /** The board's own state values (`parameters`), by control. */\n parameters?: Record<string, unknown> | null\n /** Each binding's value now and its source, by binding id (figure inputs' `dataValues`). */\n values: Readonly<Record<string, { value: FigureDataValue | undefined; source: FigureDataSource }>>\n /** Why the last things given were refused (figure inputs' `diagnostics()`). */\n refused: ReadonlyArray<{ source: string; reason: string; issues?: FigureDataValueIssue[] }>\n}\n\nexport interface FigureDataReportRow {\n path: string\n depth: number\n name: string\n label?: string\n node: FigureDataNode\n /** A value field's value now; a list's element count in the data. */\n value?: FigureDataValue\n count?: number\n source?: FigureDataSource\n /** What the bindings reading it move: a behavior each, or a table and its targets. */\n behaviors: FigureDataMove[]\n /** Controls it moves that the board's state values hold instead. */\n heldByBoard: string[]\n}\n\n/** What one binding moves: a value binding's behavior, or a table's targets (ADR-0166 3). */\nexport type FigureDataMove = FigureDataBehavior | { kind: 'table'; targets: FigureDataTargets }\n\nexport interface FigureDataReport {\n rows: FigureDataReportRow[]\n /** Fields the data has that the shape does not name, as paths (`[]` for a list's elements). */\n unused: string[]\n refused: FigureDataSnapshot['refused']\n /** Data with every field of the shape, to copy. */\n example: Record<string, unknown>\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v)\n\n/** The value at a path with no list in it (`A.B`), or undefined. */\nfunction valueAt(data: unknown, path: string): unknown {\n let at: unknown = data\n for (const name of path.split('.')) {\n if (!isRecord(at)) return undefined\n at = at[name]\n }\n return at\n}\n\n/** Every field path the data has that the shape does not name. A JSON text in place of an object or a list is not looked into. */\nfunction unusedOf(data: unknown, fields: ReadonlyArray<{ name: string } & FigureDataNode>, at: string, out: Set<string>): void {\n if (!isRecord(data)) return\n for (const [key, value] of Object.entries(data)) {\n const path = at ? `${at}.${key}` : key\n const field = fields.find(f => f.name === key)\n if (!field) {\n out.add(path)\n continue\n }\n let node: FigureDataNode = field\n let value_: unknown = value\n let p = path\n while (node.kind === 'list' && Array.isArray(value_)) {\n const item: FigureDataNode = node.item\n p = `${p}[]`\n for (const element of value_) if (item.kind === 'object') unusedOf(element, item.fields, p, out)\n value_ = undefined\n node = item\n }\n if (node.kind === 'object' && isRecord(value_)) unusedOf(value_, node.fields, p, out)\n }\n}\n\nexport function figureDataReportOf(s: FigureDataSnapshot): FigureDataReport | null {\n const di = s.asset.dataInterface\n if (!di) return null\n const bindings = new Map(di.bindings.map(b => [b.id, b] as const))\n const held = new Set(Object.keys(s.parameters ?? {}))\n const rows = figureDataRows(di).map((row): FigureDataReportRow => {\n const reading = row.bindings.map(id => bindings.get(id)).filter(b => !!b)\n const behaviors = reading.map((b): FigureDataMove => (b.rule === 'table' ? { kind: 'table', targets: b.targets } : b.behavior))\n const heldByBoard = behaviors.flatMap(b => (b.kind === 'state' ? [b.input] : b.kind === 'table' ? (b.targets.inputs ?? []) : []).filter(input => held.has(input)))\n const out: FigureDataReportRow = { path: row.path, depth: row.depth, name: row.name, ...(row.label ? { label: row.label } : {}), node: row.node, behaviors, heldByBoard }\n if (row.node.kind === 'list') {\n const list = row.path.includes('[]') ? undefined : valueAt(s.data, row.path)\n if (Array.isArray(list)) out.count = list.length\n } else if (row.node.kind !== 'object') {\n /* The value a binding read: the first that reads this place and is not an items binding (items read the list). */\n const read = reading.find(b => (b.rule === 'table' || b.behavior.kind !== 'items') && s.values[b.id])\n if (read) {\n const { value, source } = s.values[read.id]!\n out.source = source\n if (value !== undefined) out.value = value\n }\n }\n return out\n })\n const unused = new Set<string>()\n unusedOf(s.data, di.schema, '', unused)\n return { rows, unused: [...unused], refused: s.refused, example: figureDataExample(di) }\n}\n\n/** The things a binding moves, as one line: the control, the colour token, the group, the axis, the place; a table's targets. */\nexport const behaviorTargetOf = (b: FigureDataMove): string =>\n b.kind === 'table'\n ? [...(b.targets.parts ?? []), ...(b.targets.inputs ?? []), ...(b.targets.group ? [b.targets.group] : [])].join(', ')\n : b.kind === 'state'\n ? b.input\n : b.kind === 'palette'\n ? b.token\n : b.kind === 'pose'\n ? b.axis\n : b.kind === 'items'\n ? (b.slot ?? '')\n : b.group\n"]}
|