@things-factory/station 10.1.247 → 10.1.248
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/package.json +4 -4
- package/dist-client/index.d.ts +0 -11
- package/dist-client/index.js +0 -24
- package/dist-client/index.js.map +0 -1
- package/dist-client/station/scene/index.d.ts +0 -11
- package/dist-client/station/scene/index.js +0 -12
- package/dist-client/station/scene/index.js.map +0 -1
- package/dist-client/station/scene/scene-kit.d.ts +0 -9
- package/dist-client/station/scene/scene-kit.js +0 -10
- package/dist-client/station/scene/scene-kit.js.map +0 -1
- package/dist-client/station/scene/station-context-binding.d.ts +0 -25
- package/dist-client/station/scene/station-context-binding.js +0 -39
- package/dist-client/station/scene/station-context-binding.js.map +0 -1
- package/dist-client/station/scene/station-context-scene.d.ts +0 -17
- package/dist-client/station/scene/station-context-scene.js +0 -127
- package/dist-client/station/scene/station-context-scene.js.map +0 -1
- package/dist-client/station/scene/station-counts-scene.d.ts +0 -6
- package/dist-client/station/scene/station-counts-scene.js +0 -51
- package/dist-client/station/scene/station-counts-scene.js.map +0 -1
- package/dist-client/station/scene/station-field-nature.d.ts +0 -2
- package/dist-client/station/scene/station-field-nature.js +0 -42
- package/dist-client/station/scene/station-field-nature.js.map +0 -1
- package/dist-client/station/scene/station-field-scene.d.ts +0 -26
- package/dist-client/station/scene/station-field-scene.js +0 -73
- package/dist-client/station/scene/station-field-scene.js.map +0 -1
- package/dist-client/station/scene/station-icons.d.ts +0 -82
- package/dist-client/station/scene/station-icons.js +0 -131
- package/dist-client/station/scene/station-icons.js.map +0 -1
- package/dist-client/station/scene/station-numpad-scene.d.ts +0 -9
- package/dist-client/station/scene/station-numpad-scene.js +0 -144
- package/dist-client/station/scene/station-numpad-scene.js.map +0 -1
- package/dist-client/station/scene/station-scene-style.d.ts +0 -51
- package/dist-client/station/scene/station-scene-style.js +0 -108
- package/dist-client/station/scene/station-scene-style.js.map +0 -1
- package/dist-client/station/scene/station-scene.d.ts +0 -294
- package/dist-client/station/scene/station-scene.js +0 -68
- package/dist-client/station/scene/station-scene.js.map +0 -1
- package/dist-client/station/scene/station-who-scene.d.ts +0 -6
- package/dist-client/station/scene/station-who-scene.js +0 -48
- package/dist-client/station/scene/station-who-scene.js.map +0 -1
- package/dist-client/station/scene/station-work-panel-scene.d.ts +0 -28
- package/dist-client/station/scene/station-work-panel-scene.js +0 -37
- package/dist-client/station/scene/station-work-panel-scene.js.map +0 -1
- package/dist-client/station/station-board-binding.d.ts +0 -26
- package/dist-client/station/station-board-binding.js +0 -60
- package/dist-client/station/station-board-binding.js.map +0 -1
- package/dist-client/station/station-context.d.ts +0 -178
- package/dist-client/station/station-context.js +0 -30
- package/dist-client/station/station-context.js.map +0 -1
- package/dist-client/station/station-palette.d.ts +0 -34
- package/dist-client/station/station-palette.js +0 -119
- package/dist-client/station/station-palette.js.map +0 -1
- package/dist-client/station/station-refresh-policy.d.ts +0 -17
- package/dist-client/station/station-refresh-policy.js +0 -18
- package/dist-client/station/station-refresh-policy.js.map +0 -1
- package/dist-client/station/station-runtime.d.ts +0 -47
- package/dist-client/station/station-runtime.js +0 -47
- package/dist-client/station/station-runtime.js.map +0 -1
- package/dist-client/station/station-scene-context.d.ts +0 -68
- package/dist-client/station/station-scene-context.js +0 -62
- package/dist-client/station/station-scene-context.js.map +0 -1
- package/dist-client/station/station-screen-flow.d.ts +0 -16
- package/dist-client/station/station-screen-flow.js +0 -58
- package/dist-client/station/station-screen-flow.js.map +0 -1
- package/dist-client/station/station-tile-registry.d.ts +0 -89
- package/dist-client/station/station-tile-registry.js +0 -86
- package/dist-client/station/station-tile-registry.js.map +0 -1
- package/dist-client/station/station-work-panel-view.d.ts +0 -23
- package/dist-client/station/station-work-panel-view.js +0 -125
- package/dist-client/station/station-work-panel-view.js.map +0 -1
- package/dist-client/station/station-work-runtime.d.ts +0 -47
- package/dist-client/station/station-work-runtime.js +0 -161
- package/dist-client/station/station-work-runtime.js.map +0 -1
- package/dist-client/station/station-work-scenarios.d.ts +0 -41
- package/dist-client/station/station-work-scenarios.js +0 -59
- package/dist-client/station/station-work-scenarios.js.map +0 -1
- package/dist-client/station/task-counts.d.ts +0 -32
- package/dist-client/station/task-counts.js +0 -26
- package/dist-client/station/task-counts.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-server/activities/activity-station-screen-control-withdrawal.d.ts +0 -62
- package/dist-server/activities/activity-station-screen-control-withdrawal.js +0 -143
- package/dist-server/activities/activity-station-screen-control-withdrawal.js.map +0 -1
- package/dist-server/activities/activity-station-screen-release.d.ts +0 -81
- package/dist-server/activities/activity-station-screen-release.js +0 -147
- package/dist-server/activities/activity-station-screen-release.js.map +0 -1
- package/dist-server/activities/index.d.ts +0 -49
- package/dist-server/activities/index.js +0 -21
- package/dist-server/activities/index.js.map +0 -1
- package/dist-server/index.d.ts +0 -3
- package/dist-server/index.js +0 -8
- package/dist-server/index.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -22
- package/dist-server/service/index.js +0 -40
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/station/index.d.ts +0 -13
- package/dist-server/service/station/index.js +0 -25
- package/dist-server/service/station/index.js.map +0 -1
- package/dist-server/service/station/screen-model-digest.d.ts +0 -60
- package/dist-server/service/station/screen-model-digest.js +0 -97
- package/dist-server/service/station/screen-model-digest.js.map +0 -1
- package/dist-server/service/station/staged-material.d.ts +0 -62
- package/dist-server/service/station/staged-material.js +0 -44
- package/dist-server/service/station/staged-material.js.map +0 -1
- package/dist-server/service/station/station-argument-sources.d.ts +0 -31
- package/dist-server/service/station/station-argument-sources.js +0 -66
- package/dist-server/service/station/station-argument-sources.js.map +0 -1
- package/dist-server/service/station/station-assignment-choice.d.ts +0 -81
- package/dist-server/service/station/station-assignment-choice.js +0 -105
- package/dist-server/service/station/station-assignment-choice.js.map +0 -1
- package/dist-server/service/station/station-assignment-resolver.d.ts +0 -104
- package/dist-server/service/station/station-assignment-resolver.js +0 -426
- package/dist-server/service/station/station-assignment-resolver.js.map +0 -1
- package/dist-server/service/station/station-assignment-service.d.ts +0 -33
- package/dist-server/service/station/station-assignment-service.js +0 -64
- package/dist-server/service/station/station-assignment-service.js.map +0 -1
- package/dist-server/service/station/station-axes.d.ts +0 -9
- package/dist-server/service/station/station-axes.js +0 -18
- package/dist-server/service/station/station-axes.js.map +0 -1
- package/dist-server/service/station/station-flow.d.ts +0 -158
- package/dist-server/service/station/station-flow.js +0 -257
- package/dist-server/service/station/station-flow.js.map +0 -1
- package/dist-server/service/station/station-generate.d.ts +0 -83
- package/dist-server/service/station/station-generate.js +0 -181
- package/dist-server/service/station/station-generate.js.map +0 -1
- package/dist-server/service/station/station-product.d.ts +0 -113
- package/dist-server/service/station/station-product.js +0 -124
- package/dist-server/service/station/station-product.js.map +0 -1
- package/dist-server/service/station/station-runtime-binding.d.ts +0 -6
- package/dist-server/service/station/station-runtime-binding.js +0 -46
- package/dist-server/service/station/station-runtime-binding.js.map +0 -1
- package/dist-server/service/station/station-screen-assignment.d.ts +0 -94
- package/dist-server/service/station/station-screen-assignment.js +0 -154
- package/dist-server/service/station/station-screen-assignment.js.map +0 -1
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.d.ts +0 -37
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.js +0 -130
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.js.map +0 -1
- package/dist-server/service/station/station-screen-control-withdrawal.d.ts +0 -104
- package/dist-server/service/station/station-screen-control-withdrawal.js +0 -128
- package/dist-server/service/station/station-screen-control-withdrawal.js.map +0 -1
- package/dist-server/service/station/station-screen-draft-resolver.d.ts +0 -47
- package/dist-server/service/station/station-screen-draft-resolver.js +0 -155
- package/dist-server/service/station/station-screen-draft-resolver.js.map +0 -1
- package/dist-server/service/station/station-screen-layout.d.ts +0 -121
- package/dist-server/service/station/station-screen-layout.js +0 -202
- package/dist-server/service/station/station-screen-layout.js.map +0 -1
- package/dist-server/service/station/station-screen-list-resolver.d.ts +0 -69
- package/dist-server/service/station/station-screen-list-resolver.js +0 -215
- package/dist-server/service/station/station-screen-list-resolver.js.map +0 -1
- package/dist-server/service/station/station-screen-publish-subscriber.d.ts +0 -22
- package/dist-server/service/station/station-screen-publish-subscriber.js +0 -90
- package/dist-server/service/station/station-screen-publish-subscriber.js.map +0 -1
- package/dist-server/service/station/station-screen-release-gate.d.ts +0 -66
- package/dist-server/service/station/station-screen-release-gate.js +0 -67
- package/dist-server/service/station/station-screen-release-gate.js.map +0 -1
- package/dist-server/service/station/station-screen-release-record.d.ts +0 -62
- package/dist-server/service/station/station-screen-release-record.js +0 -139
- package/dist-server/service/station/station-screen-release-record.js.map +0 -1
- package/dist-server/service/station/station-screen-release-signature.d.ts +0 -23
- package/dist-server/service/station/station-screen-release-signature.js +0 -32
- package/dist-server/service/station/station-screen-release-signature.js.map +0 -1
- package/dist-server/service/station/station-screen-scorecard.d.ts +0 -15
- package/dist-server/service/station/station-screen-scorecard.js +0 -35
- package/dist-server/service/station/station-screen-scorecard.js.map +0 -1
- package/dist-server/service/station/station-screen-spec-resolver.d.ts +0 -36
- package/dist-server/service/station/station-screen-spec-resolver.js +0 -202
- package/dist-server/service/station/station-screen-spec-resolver.js.map +0 -1
- package/dist-server/service/station/station-screen-spec.d.ts +0 -104
- package/dist-server/service/station/station-screen-spec.js +0 -114
- package/dist-server/service/station/station-screen-spec.js.map +0 -1
- package/dist-server/service/station/station-screen-thumbnail.d.ts +0 -11
- package/dist-server/service/station/station-screen-thumbnail.js +0 -36
- package/dist-server/service/station/station-screen-thumbnail.js.map +0 -1
- package/dist-server/service/station/station-service-resolver.d.ts +0 -36
- package/dist-server/service/station/station-service-resolver.js +0 -113
- package/dist-server/service/station/station-service-resolver.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/station",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.248",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@things-factory/auth-base": "^10.1.247",
|
|
56
56
|
"@things-factory/board-service": "^10.1.247",
|
|
57
57
|
"@things-factory/fact-change": "^10.1.247",
|
|
58
|
-
"@things-factory/ops-master": "^10.1.
|
|
58
|
+
"@things-factory/ops-master": "^10.1.248",
|
|
59
59
|
"@things-factory/shell": "^10.1.247",
|
|
60
|
-
"@things-factory/worklist": "^10.1.
|
|
60
|
+
"@things-factory/worklist": "^10.1.248",
|
|
61
61
|
"i18next": "^24.2.1"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ca390a4b791d6e8630388167d3da6031034b5a5e"
|
|
64
64
|
}
|
package/dist-client/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './station/station-tile-registry.js';
|
|
2
|
-
export * from './station/station-palette.js';
|
|
3
|
-
export * from './station/station-refresh-policy.js';
|
|
4
|
-
export * from './station/station-board-binding.js';
|
|
5
|
-
export * from './station/station-context.js';
|
|
6
|
-
export * from './station/station-runtime.js';
|
|
7
|
-
export * from './station/station-scene-context.js';
|
|
8
|
-
export * from './station/station-screen-flow.js';
|
|
9
|
-
export * from './station/station-work-runtime.js';
|
|
10
|
-
export * from './station/station-work-scenarios.js';
|
|
11
|
-
export * from './station/task-counts.js';
|
package/dist-client/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from './station/station-tile-registry.js';
|
|
2
|
-
export * from './station/station-palette.js';
|
|
3
|
-
export * from './station/station-refresh-policy.js';
|
|
4
|
-
export * from './station/station-board-binding.js';
|
|
5
|
-
export * from './station/station-context.js';
|
|
6
|
-
export * from './station/station-runtime.js';
|
|
7
|
-
export * from './station/station-scene-context.js';
|
|
8
|
-
export * from './station/station-screen-flow.js';
|
|
9
|
-
export * from './station/station-work-runtime.js';
|
|
10
|
-
export * from './station/station-work-scenarios.js';
|
|
11
|
-
export * from './station/task-counts.js';
|
|
12
|
-
/*
|
|
13
|
-
* ── 씬 등록은 이 입구에 없다 (2026-09-24) ─────────────────────────────────────
|
|
14
|
-
* 여기 `export * from './station/scene/index.js'` 가 있었다. 그러면 도우미 하나(`scenarioById` 같은)를 가져오는
|
|
15
|
-
* 쪽마다 씬 여섯이 **부수효과로 등록되고** `@hatiolab/things-scene` 과 lit 이 통째로 따라왔다. operato-plant 의
|
|
16
|
-
* 순수한 저작 검사가 이 입구를 부르자 그 시험이 things-scene 을 못 싣고 멈춰서 드러났다.
|
|
17
|
-
*
|
|
18
|
-
* 그려지게 하는 것은 **앱이 한 번, 드러나게** 부른다:
|
|
19
|
-
*
|
|
20
|
-
* import '@things-factory/station/dist-client/station/scene/index.js'
|
|
21
|
-
*
|
|
22
|
-
* 입구가 그것을 내보내지 않으므로 R1(정본 지정자) 의 「index 가 내보내지 않을 때만 안쪽 경로」에 맞는다.
|
|
23
|
-
*/
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/dist-client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qCAAqC,CAAA;AACnD,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,0BAA0B,CAAA;AAExC;;;;;;;;;;;GAWG","sourcesContent":["export * from './station/station-tile-registry.js'\nexport * from './station/station-palette.js'\nexport * from './station/station-refresh-policy.js'\nexport * from './station/station-board-binding.js'\nexport * from './station/station-context.js'\nexport * from './station/station-runtime.js'\nexport * from './station/station-scene-context.js'\nexport * from './station/station-screen-flow.js'\nexport * from './station/station-work-runtime.js'\nexport * from './station/station-work-scenarios.js'\nexport * from './station/task-counts.js'\n\n/*\n * ── 씬 등록은 이 입구에 없다 (2026-09-24) ─────────────────────────────────────\n * 여기 `export * from './station/scene/index.js'` 가 있었다. 그러면 도우미 하나(`scenarioById` 같은)를 가져오는\n * 쪽마다 씬 여섯이 **부수효과로 등록되고** `@hatiolab/things-scene` 과 lit 이 통째로 따라왔다. operato-plant 의\n * 순수한 저작 검사가 이 입구를 부르자 그 시험이 things-scene 을 못 싣고 멈춰서 드러났다.\n *\n * 그려지게 하는 것은 **앱이 한 번, 드러나게** 부른다:\n *\n * import '@things-factory/station/dist-client/station/scene/index.js'\n *\n * 입구가 그것을 내보내지 않으므로 R1(정본 지정자) 의 「index 가 내보내지 않을 때만 안쪽 경로」에 맞는다.\n */\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 보드에서 쓸 현장 컴포넌트들 — 여기서 한 번 부르면 보드 저작면에 나온다.
|
|
3
|
-
*
|
|
4
|
-
* 호스트는 이것을 부르기만 하고, 컨텍스트는 `provideStationRuntime` 으로 따로 걸어 준다.
|
|
5
|
-
*/
|
|
6
|
-
import './station-context-scene';
|
|
7
|
-
import './station-counts-scene';
|
|
8
|
-
import './station-field-scene';
|
|
9
|
-
import './station-numpad-scene';
|
|
10
|
-
import './station-who-scene';
|
|
11
|
-
import './station-work-panel-scene';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 보드에서 쓸 현장 컴포넌트들 — 여기서 한 번 부르면 보드 저작면에 나온다.
|
|
3
|
-
*
|
|
4
|
-
* 호스트는 이것을 부르기만 하고, 컨텍스트는 `provideStationRuntime` 으로 따로 걸어 준다.
|
|
5
|
-
*/
|
|
6
|
-
import './station-context-scene';
|
|
7
|
-
import './station-counts-scene';
|
|
8
|
-
import './station-field-scene';
|
|
9
|
-
import './station-numpad-scene';
|
|
10
|
-
import './station-who-scene';
|
|
11
|
-
import './station-work-panel-scene';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/station/scene/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,4BAA4B,CAAA","sourcesContent":["/**\n * 보드에서 쓸 현장 컴포넌트들 — 여기서 한 번 부르면 보드 저작면에 나온다.\n *\n * 호스트는 이것을 부르기만 하고, 컨텍스트는 `provideStationRuntime` 으로 따로 걸어 준다.\n */\n\nimport './station-context-scene'\nimport './station-counts-scene'\nimport './station-field-scene'\nimport './station-numpad-scene'\nimport './station-who-scene'\nimport './station-work-panel-scene'\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What an application needs to draw its own station scenes: the base scene, the drawing style and the icons.
|
|
3
|
-
*
|
|
4
|
-
* Importing this registers no scene. The station's own scenes register through `@things-factory/station/scenes`,
|
|
5
|
-
* which an application imports once, where it means to.
|
|
6
|
-
*/
|
|
7
|
-
export * from './station-scene.js';
|
|
8
|
-
export * from './station-scene-style.js';
|
|
9
|
-
export * from './station-icons.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What an application needs to draw its own station scenes: the base scene, the drawing style and the icons.
|
|
3
|
-
*
|
|
4
|
-
* Importing this registers no scene. The station's own scenes register through `@things-factory/station/scenes`,
|
|
5
|
-
* which an application imports once, where it means to.
|
|
6
|
-
*/
|
|
7
|
-
export * from './station-scene.js';
|
|
8
|
-
export * from './station-scene-style.js';
|
|
9
|
-
export * from './station-icons.js';
|
|
10
|
-
//# sourceMappingURL=scene-kit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scene-kit.js","sourceRoot":"","sources":["../../../client/station/scene/scene-kit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA","sourcesContent":["/**\n * What an application needs to draw its own station scenes: the base scene, the drawing style and the icons.\n *\n * Importing this registers no scene. The station's own scenes register through `@things-factory/station/scenes`,\n * which an application imports once, where it means to.\n */\nexport * from './station-scene.js'\nexport * from './station-scene-style.js'\nexport * from './station-icons.js'\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { StationSceneContext } from '../station-scene-context';
|
|
2
|
-
/**
|
|
3
|
-
* Holding on to the context from inside a component — **shared by two class families.**
|
|
4
|
-
*
|
|
5
|
-
* The drawing components descend from `Shape`, the context component from `ServiceComponent`, so
|
|
6
|
-
* they cannot inherit this from a common parent. It is small enough to hand around instead.
|
|
7
|
-
*
|
|
8
|
-
* ── Looked up late, deliberately ───────────────────────────────────────────
|
|
9
|
-
* The order is fixed and unhelpful: the viewer builds the scene, adding every component, and only
|
|
10
|
-
* then does the page have a scene to register the context on. Bind once when added and every
|
|
11
|
-
* component has looked a moment too early. So this looks on every read — a `Map.get` — and starts
|
|
12
|
-
* the subscription the first time it finds something.
|
|
13
|
-
*/
|
|
14
|
-
export declare class StationContextBinding {
|
|
15
|
-
private owner;
|
|
16
|
-
private onChange;
|
|
17
|
-
private bound?;
|
|
18
|
-
private unsubscribe?;
|
|
19
|
-
/** `onChange` fires when the context reports new numbers — redraw, or push new data. */
|
|
20
|
-
constructor(owner: {
|
|
21
|
-
root?: any;
|
|
22
|
-
}, onChange: () => void);
|
|
23
|
-
get context(): StationSceneContext | undefined;
|
|
24
|
-
release(): void;
|
|
25
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { sceneContextOf } from '../station-scene-context';
|
|
2
|
-
/**
|
|
3
|
-
* Holding on to the context from inside a component — **shared by two class families.**
|
|
4
|
-
*
|
|
5
|
-
* The drawing components descend from `Shape`, the context component from `ServiceComponent`, so
|
|
6
|
-
* they cannot inherit this from a common parent. It is small enough to hand around instead.
|
|
7
|
-
*
|
|
8
|
-
* ── Looked up late, deliberately ───────────────────────────────────────────
|
|
9
|
-
* The order is fixed and unhelpful: the viewer builds the scene, adding every component, and only
|
|
10
|
-
* then does the page have a scene to register the context on. Bind once when added and every
|
|
11
|
-
* component has looked a moment too early. So this looks on every read — a `Map.get` — and starts
|
|
12
|
-
* the subscription the first time it finds something.
|
|
13
|
-
*/
|
|
14
|
-
export class StationContextBinding {
|
|
15
|
-
/** `onChange` fires when the context reports new numbers — redraw, or push new data. */
|
|
16
|
-
constructor(owner, onChange) {
|
|
17
|
-
this.owner = owner;
|
|
18
|
-
this.onChange = onChange;
|
|
19
|
-
}
|
|
20
|
-
get context() {
|
|
21
|
-
const found = sceneContextOf(this.owner);
|
|
22
|
-
if (found !== this.bound) {
|
|
23
|
-
this.unsubscribe?.();
|
|
24
|
-
this.bound = found;
|
|
25
|
-
this.unsubscribe = found?.subscribe(this.onChange);
|
|
26
|
-
if (found) {
|
|
27
|
-
/* Newly attached — the caller has stale nothing on screen until it hears once. */
|
|
28
|
-
this.onChange();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return this.bound;
|
|
32
|
-
}
|
|
33
|
-
release() {
|
|
34
|
-
this.unsubscribe?.();
|
|
35
|
-
this.unsubscribe = undefined;
|
|
36
|
-
this.bound = undefined;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=station-context-binding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-context-binding.js","sourceRoot":"","sources":["../../../client/station/scene/station-context-binding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,qBAAqB;IAIhC,wFAAwF;IACxF,YACU,KAAqB,EACrB,QAAoB;QADpB,UAAK,GAAL,KAAK,CAAgB;QACrB,aAAQ,GAAR,QAAQ,CAAY;IAC3B,CAAC;IAEJ,IAAI,OAAO;QACT,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAExC,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,WAAW,EAAE,EAAE,CAAA;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,CAAC,WAAW,GAAG,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAElD,IAAI,KAAK,EAAE,CAAC;gBACV,kFAAkF;gBAClF,IAAI,CAAC,QAAQ,EAAE,CAAA;YACjB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,EAAE,EAAE,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;IACxB,CAAC;CACF","sourcesContent":["import type { StationSceneContext } from '../station-scene-context'\nimport { sceneContextOf } from '../station-scene-context'\n\n/**\n * Holding on to the context from inside a component — **shared by two class families.**\n *\n * The drawing components descend from `Shape`, the context component from `ServiceComponent`, so\n * they cannot inherit this from a common parent. It is small enough to hand around instead.\n *\n * ── Looked up late, deliberately ───────────────────────────────────────────\n * The order is fixed and unhelpful: the viewer builds the scene, adding every component, and only\n * then does the page have a scene to register the context on. Bind once when added and every\n * component has looked a moment too early. So this looks on every read — a `Map.get` — and starts\n * the subscription the first time it finds something.\n */\nexport class StationContextBinding {\n private bound?: StationSceneContext\n private unsubscribe?: () => void\n\n /** `onChange` fires when the context reports new numbers — redraw, or push new data. */\n constructor(\n private owner: { root?: any },\n private onChange: () => void\n ) {}\n\n get context(): StationSceneContext | undefined {\n const found = sceneContextOf(this.owner)\n\n if (found !== this.bound) {\n this.unsubscribe?.()\n this.bound = found\n this.unsubscribe = found?.subscribe(this.onChange)\n\n if (found) {\n /* Newly attached — the caller has stale nothing on screen until it hears once. */\n this.onChange()\n }\n }\n\n return this.bound\n }\n\n release() {\n this.unsubscribe?.()\n this.unsubscribe = undefined\n this.bound = undefined\n }\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ComponentNature, ServiceComponent } from '@hatiolab/things-scene';
|
|
2
|
-
export default class StationContextScene extends ServiceComponent {
|
|
3
|
-
get serviceName(): string;
|
|
4
|
-
/**
|
|
5
|
-
* ── Why this is not a data source ────────────────────────────────────────
|
|
6
|
-
* It published the whole context for a while, so a board could bind through `#station-context`.
|
|
7
|
-
* That door was **redundant and broken**: redundant because the host already pushes `scene.data`
|
|
8
|
-
* keyed by component id, so naming a component `directive` hands it the directive and the standard
|
|
9
|
-
* mapping editor takes it from there; broken because a `ServiceComponent` draws nothing in view
|
|
10
|
-
* mode, so its `render` never ran, so nothing ever claimed the name or published anything.
|
|
11
|
-
*
|
|
12
|
-
* Two ways to do one thing, and the second one silently did nothing. Removed rather than repaired
|
|
13
|
-
* — the door that works is the framework's own.
|
|
14
|
-
*/
|
|
15
|
-
render(context: CanvasRenderingContext2D): void;
|
|
16
|
-
get nature(): ComponentNature;
|
|
17
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { ServiceComponent, sceneComponent } from '@hatiolab/things-scene';
|
|
3
|
-
import { stationBindingNames } from '../station-board-binding';
|
|
4
|
-
import { STATION_COLOR } from './station-scene-style';
|
|
5
|
-
import { STATION_SERVICE } from '../station-scene-context';
|
|
6
|
-
/**
|
|
7
|
-
* On a board · **the data source the whole screen binds off.**
|
|
8
|
-
*
|
|
9
|
-
* ── What it is for ─────────────────────────────────────────────────────────
|
|
10
|
-
* Values reach any component whose id is a context name, and structured branches reach any component
|
|
11
|
-
* whose id is a branch name (`order`, `directive`, `route`, …). Both work, and both are invisible
|
|
12
|
-
* while a board is being drawn — nothing on the property panel says such an id means anything, so an
|
|
13
|
-
* author has to be told, and there are three dozen names.
|
|
14
|
-
*
|
|
15
|
-
* This lists them on the canvas while editing, and records in the board model that this board is a
|
|
16
|
-
* station screen. It also carries the refresh policy, which the host reads off the model when it
|
|
17
|
-
* opens the board.
|
|
18
|
-
*
|
|
19
|
-
* ── What is not here ───────────────────────────────────────────────────────
|
|
20
|
-
* It is **not** where the context comes from. The page registers that when it opens the board,
|
|
21
|
-
* present or not. Hanging the context off a component would mean a board drawn without one shows a
|
|
22
|
-
* screenful of nothing, silently, and a shop-floor screen is the last place that can happen.
|
|
23
|
-
*
|
|
24
|
-
* ── Times in `data` are raw ────────────────────────────────────────────────
|
|
25
|
-
* The object here is the snapshot, so `task.since` is milliseconds. Words come from the label doors
|
|
26
|
-
* (`station-field`, or an id binding), which run through the app's own time formatting. A board that
|
|
27
|
-
* wants a readable time takes it from there, not by formatting one here.
|
|
28
|
-
*
|
|
29
|
-
* ── Invisible to the operator ──────────────────────────────────────────────
|
|
30
|
-
* `ServiceComponent` draws an icon in edit mode and nothing in view mode. The author sees it, the
|
|
31
|
-
* floor does not.
|
|
32
|
-
*/
|
|
33
|
-
const NATURE = {
|
|
34
|
-
mutable: false,
|
|
35
|
-
resizable: true,
|
|
36
|
-
rotatable: false,
|
|
37
|
-
properties: [
|
|
38
|
-
{
|
|
39
|
-
type: 'checkbox',
|
|
40
|
-
label: 'list the fields while editing',
|
|
41
|
-
name: 'showFields',
|
|
42
|
-
property: 'showFields'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
/*
|
|
46
|
-
* How often to re-read, in seconds. Empty means only when this tablet does something.
|
|
47
|
-
*
|
|
48
|
-
* A policy and not a subscription: the clock belongs to the screen, one for the whole board.
|
|
49
|
-
* Per-component it would be one timer per label, and deleting the wrong box would stop the
|
|
50
|
-
* screen updating with nothing to say so.
|
|
51
|
-
*/
|
|
52
|
-
type: 'number',
|
|
53
|
-
label: 'refresh every (seconds)',
|
|
54
|
-
name: 'refreshSeconds',
|
|
55
|
-
property: 'refreshSeconds'
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
};
|
|
59
|
-
/** What this component registers itself as, so a host can ask whether a board is a station screen. */
|
|
60
|
-
const DECLARATION_SERVICE = `${STATION_SERVICE}-declaration`;
|
|
61
|
-
let StationContextScene = class StationContextScene extends ServiceComponent {
|
|
62
|
-
get serviceName() {
|
|
63
|
-
return DECLARATION_SERVICE;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* ── Why this is not a data source ────────────────────────────────────────
|
|
67
|
-
* It published the whole context for a while, so a board could bind through `#station-context`.
|
|
68
|
-
* That door was **redundant and broken**: redundant because the host already pushes `scene.data`
|
|
69
|
-
* keyed by component id, so naming a component `directive` hands it the directive and the standard
|
|
70
|
-
* mapping editor takes it from there; broken because a `ServiceComponent` draws nothing in view
|
|
71
|
-
* mode, so its `render` never ran, so nothing ever claimed the name or published anything.
|
|
72
|
-
*
|
|
73
|
-
* Two ways to do one thing, and the second one silently did nothing. Removed rather than repaired
|
|
74
|
-
* — the door that works is the framework's own.
|
|
75
|
-
*/
|
|
76
|
-
render(context) {
|
|
77
|
-
/* View mode draws the icon and nothing else — the base already returns early there. */
|
|
78
|
-
super.render(context);
|
|
79
|
-
const state = this.state;
|
|
80
|
-
if (this.app?.isViewMode || !state.showFields) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const { left, top, width, height } = state;
|
|
84
|
-
const names = stationBindingNames();
|
|
85
|
-
context.save();
|
|
86
|
-
context.beginPath();
|
|
87
|
-
context.rect(left, top, width, height);
|
|
88
|
-
context.clip();
|
|
89
|
-
context.fillStyle = STATION_COLOR.paper;
|
|
90
|
-
context.globalAlpha = 0.92;
|
|
91
|
-
context.fill();
|
|
92
|
-
context.globalAlpha = 1;
|
|
93
|
-
context.strokeStyle = STATION_COLOR.action;
|
|
94
|
-
context.stroke();
|
|
95
|
-
context.textBaseline = 'top';
|
|
96
|
-
context.textAlign = 'left';
|
|
97
|
-
context.fillStyle = STATION_COLOR.action;
|
|
98
|
-
context.font = 'bold 11px sans-serif';
|
|
99
|
-
context.fillText('station context — put one of these in a component id', left + 8, top + 8);
|
|
100
|
-
/*
|
|
101
|
-
* Down the columns, as many as fit. Truncating is fine and paging is not worth it — the point is
|
|
102
|
-
* that the names exist and roughly what they look like, not to be a reference card.
|
|
103
|
-
*/
|
|
104
|
-
const lineHeight = 13;
|
|
105
|
-
const rows = Math.max(1, Math.floor((height - 30) / lineHeight));
|
|
106
|
-
const columnWidth = 130;
|
|
107
|
-
context.font = '10px sans-serif';
|
|
108
|
-
context.fillStyle = STATION_COLOR.ink;
|
|
109
|
-
names.forEach((name, index) => {
|
|
110
|
-
const x = left + 8 + Math.floor(index / rows) * columnWidth;
|
|
111
|
-
const y = top + 26 + (index % rows) * lineHeight;
|
|
112
|
-
if (x + columnWidth <= left + width + columnWidth) {
|
|
113
|
-
context.fillText(name, x, y);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
context.textBaseline = 'alphabetic';
|
|
117
|
-
context.restore();
|
|
118
|
-
}
|
|
119
|
-
get nature() {
|
|
120
|
-
return NATURE;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
StationContextScene = __decorate([
|
|
124
|
-
sceneComponent('station-context')
|
|
125
|
-
], StationContextScene);
|
|
126
|
-
export default StationContextScene;
|
|
127
|
-
//# sourceMappingURL=station-context-scene.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-context-scene.js","sourceRoot":"","sources":["../../../client/station/scene/station-context-scene.ts"],"names":[],"mappings":";AAAA,OAAO,EAAmB,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE1F,OAAO,EAAE,mBAAmB,EAAE,M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AAA;YAEhD,IAAI,CAAC,GAAG,WAAW,IAAI,IAAI,GAAG,KAAK,GAAG,WAAW,EAAE,CAAC;gBAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,YAAY,GAAG,YAAY,CAAA;QACnC,OAAO,CAAC,OAAO,EAAE,CAAA;IACnB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AA3EoB,mBAAmB;IADvC,cAAc,CAAC,iBAAiB,CAAC;GACb,mBAAmB,CA2EvC;eA3EoB,mBAAmB","sourcesContent":["import { ComponentNature, ServiceComponent, sceneComponent } from '@hatiolab/things-scene'\n\nimport { stationBindingNames } from '../station-board-binding'\nimport { STATION_COLOR } from './station-scene-style'\nimport { STATION_SERVICE } from '../station-scene-context'\n\n/**\n * On a board · **the data source the whole screen binds off.**\n *\n * ── What it is for ─────────────────────────────────────────────────────────\n * Values reach any component whose id is a context name, and structured branches reach any component\n * whose id is a branch name (`order`, `directive`, `route`, …). Both work, and both are invisible\n * while a board is being drawn — nothing on the property panel says such an id means anything, so an\n * author has to be told, and there are three dozen names.\n *\n * This lists them on the canvas while editing, and records in the board model that this board is a\n * station screen. It also carries the refresh policy, which the host reads off the model when it\n * opens the board.\n *\n * ── What is not here ───────────────────────────────────────────────────────\n * It is **not** where the context comes from. The page registers that when it opens the board,\n * present or not. Hanging the context off a component would mean a board drawn without one shows a\n * screenful of nothing, silently, and a shop-floor screen is the last place that can happen.\n *\n * ── Times in `data` are raw ────────────────────────────────────────────────\n * The object here is the snapshot, so `task.since` is milliseconds. Words come from the label doors\n * (`station-field`, or an id binding), which run through the app's own time formatting. A board that\n * wants a readable time takes it from there, not by formatting one here.\n *\n * ── Invisible to the operator ──────────────────────────────────────────────\n * `ServiceComponent` draws an icon in edit mode and nothing in view mode. The author sees it, the\n * floor does not.\n */\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'checkbox',\n label: 'list the fields while editing',\n name: 'showFields',\n property: 'showFields'\n },\n {\n /*\n * How often to re-read, in seconds. Empty means only when this tablet does something.\n *\n * A policy and not a subscription: the clock belongs to the screen, one for the whole board.\n * Per-component it would be one timer per label, and deleting the wrong box would stop the\n * screen updating with nothing to say so.\n */\n type: 'number',\n label: 'refresh every (seconds)',\n name: 'refreshSeconds',\n property: 'refreshSeconds'\n }\n ]\n}\n\n/** What this component registers itself as, so a host can ask whether a board is a station screen. */\nconst DECLARATION_SERVICE = `${STATION_SERVICE}-declaration`\n\n@sceneComponent('station-context')\nexport default class StationContextScene extends ServiceComponent {\n get serviceName() {\n return DECLARATION_SERVICE\n }\n\n /**\n * ── Why this is not a data source ────────────────────────────────────────\n * It published the whole context for a while, so a board could bind through `#station-context`.\n * That door was **redundant and broken**: redundant because the host already pushes `scene.data`\n * keyed by component id, so naming a component `directive` hands it the directive and the standard\n * mapping editor takes it from there; broken because a `ServiceComponent` draws nothing in view\n * mode, so its `render` never ran, so nothing ever claimed the name or published anything.\n *\n * Two ways to do one thing, and the second one silently did nothing. Removed rather than repaired\n * — the door that works is the framework's own.\n */\n\n render(context: CanvasRenderingContext2D) {\n /* View mode draws the icon and nothing else — the base already returns early there. */\n super.render(context as any)\n\n const state: any = this.state\n\n if ((this as any).app?.isViewMode || !state.showFields) {\n return\n }\n\n const { left, top, width, height } = state\n const names = stationBindingNames()\n\n context.save()\n context.beginPath()\n context.rect(left, top, width, height)\n context.clip()\n\n context.fillStyle = STATION_COLOR.paper\n context.globalAlpha = 0.92\n context.fill()\n context.globalAlpha = 1\n context.strokeStyle = STATION_COLOR.action\n context.stroke()\n\n context.textBaseline = 'top'\n context.textAlign = 'left'\n context.fillStyle = STATION_COLOR.action\n context.font = 'bold 11px sans-serif'\n context.fillText('station context — put one of these in a component id', left + 8, top + 8)\n\n /*\n * Down the columns, as many as fit. Truncating is fine and paging is not worth it — the point is\n * that the names exist and roughly what they look like, not to be a reference card.\n */\n const lineHeight = 13\n const rows = Math.max(1, Math.floor((height - 30) / lineHeight))\n const columnWidth = 130\n\n context.font = '10px sans-serif'\n context.fillStyle = STATION_COLOR.ink\n\n names.forEach((name, index) => {\n const x = left + 8 + Math.floor(index / rows) * columnWidth\n const y = top + 26 + (index % rows) * lineHeight\n\n if (x + columnWidth <= left + width + columnWidth) {\n context.fillText(name, x, y)\n }\n })\n\n context.textBaseline = 'alphabetic'\n context.restore()\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { sceneComponent } from '@hatiolab/things-scene';
|
|
3
|
-
import { STATION_COLOR, drawCard, drawDetached, drawHeading } from './station-scene-style';
|
|
4
|
-
import { StationScene } from './station-scene';
|
|
5
|
-
/**
|
|
6
|
-
* 보드용 · 오늘 얼마나 나왔나.
|
|
7
|
-
*
|
|
8
|
-
* 진척(%)은 그리지 않는다 — 아무도 그 값을 계산하지 않는다(아키텍트 확인, 2026-08-31). 0% 로 그리면
|
|
9
|
-
* 시작도 안 한 작업으로 보인다.
|
|
10
|
-
*/
|
|
11
|
-
const NATURE = {
|
|
12
|
-
mutable: false,
|
|
13
|
-
resizable: true,
|
|
14
|
-
rotatable: false,
|
|
15
|
-
properties: [
|
|
16
|
-
{ type: 'string', label: 'equipment', name: 'equipment', property: 'equipment' },
|
|
17
|
-
{ type: 'string', label: 'label', name: 'label', property: 'label' }
|
|
18
|
-
]
|
|
19
|
-
};
|
|
20
|
-
let StationCountsScene = class StationCountsScene extends StationScene {
|
|
21
|
-
render(context) {
|
|
22
|
-
const state = this.state;
|
|
23
|
-
const { left, top, width, height } = state;
|
|
24
|
-
const snapshot = this.snapshot;
|
|
25
|
-
if (!snapshot) {
|
|
26
|
-
drawDetached(context, 'not connected', left, top, width, height);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const today = snapshot.today;
|
|
30
|
-
drawCard(context, left, top, width, height);
|
|
31
|
-
const y = drawHeading(context, state.label || 'today', left, top, width);
|
|
32
|
-
const half = width / 2;
|
|
33
|
-
context.font = 'bold 28px sans-serif';
|
|
34
|
-
context.fillStyle = STATION_COLOR.good;
|
|
35
|
-
context.fillText(String(today.good), left + 8, y + 4);
|
|
36
|
-
context.fillStyle = STATION_COLOR.scrap;
|
|
37
|
-
context.fillText(String(today.scrap), left + half + 4, y + 4);
|
|
38
|
-
context.font = '10px sans-serif';
|
|
39
|
-
context.fillStyle = STATION_COLOR.quiet;
|
|
40
|
-
context.fillText('good', left + 8, y + 36);
|
|
41
|
-
context.fillText('scrap', left + half + 4, y + 36);
|
|
42
|
-
}
|
|
43
|
-
get nature() {
|
|
44
|
-
return NATURE;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
StationCountsScene = __decorate([
|
|
48
|
-
sceneComponent('station-counts')
|
|
49
|
-
], StationCountsScene);
|
|
50
|
-
export default StationCountsScene;
|
|
51
|
-
//# sourceMappingURL=station-counts-scene.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-counts-scene.js","sourceRoot":"","sources":["../../../client/station/scene/station-counts-scene.ts"],"names":[],"mappings":";AAAA,OAAO,EAAmB,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAExE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE;QA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,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;QAE7D,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAA;QAChC,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC,KAAK,CAAA;QACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;QAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAlCoB,kBAAkB;IADtC,cAAc,CAAC,gBAAgB,CAAC;GACZ,kBAAkB,CAkCtC;eAlCoB,kBAAkB","sourcesContent":["import { ComponentNature, sceneComponent } from '@hatiolab/things-scene'\n\nimport { STATION_COLOR, drawCard, drawDetached, drawHeading } from './station-scene-style'\nimport { StationScene } from './station-scene'\n\n/**\n * 보드용 · 오늘 얼마나 나왔나.\n *\n * 진척(%)은 그리지 않는다 — 아무도 그 값을 계산하지 않는다(아키텍트 확인, 2026-08-31). 0% 로 그리면\n * 시작도 안 한 작업으로 보인다.\n */\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n { type: 'string', label: 'equipment', name: 'equipment', property: 'equipment' },\n { type: 'string', label: 'label', name: 'label', property: 'label' }\n ]\n}\n\n@sceneComponent('station-counts')\nexport default class StationCountsScene extends StationScene {\n render(context: CanvasRenderingContext2D) {\n const state: any = this.state\n const { left, top, width, height } = state\n const snapshot = this.snapshot\n\n if (!snapshot) {\n drawDetached(context, 'not connected', left, top, width, height)\n return\n }\n\n const today = snapshot.today\n\n drawCard(context, left, top, width, height)\n\n const y = drawHeading(context, state.label || 'today', left, top, width)\n const half = width / 2\n\n context.font = 'bold 28px sans-serif'\n context.fillStyle = STATION_COLOR.good\n context.fillText(String(today.good), left + 8, y + 4)\n\n context.fillStyle = STATION_COLOR.scrap\n context.fillText(String(today.scrap), left + half + 4, y + 4)\n\n context.font = '10px sans-serif'\n context.fillStyle = STATION_COLOR.quiet\n context.fillText('good', left + 8, y + 36)\n context.fillText('scrap', left + half + 4, y + 36)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { onStationAxes, stationBindingNames } from '../station-board-binding';
|
|
2
|
-
/**
|
|
3
|
-
* What the board editor shows for `station-field` — **its own file so it can be tested without the scene.**
|
|
4
|
-
*
|
|
5
|
-
* The scene class carries a decorator, and a test run that only strips types cannot load it. The part that
|
|
6
|
-
* matters here — when the field list is read — has no reason to need the canvas.
|
|
7
|
-
*/
|
|
8
|
-
const NATURE = {
|
|
9
|
-
mutable: false,
|
|
10
|
-
resizable: true,
|
|
11
|
-
rotatable: false,
|
|
12
|
-
properties: [
|
|
13
|
-
{
|
|
14
|
-
type: 'select',
|
|
15
|
-
label: 'field',
|
|
16
|
-
name: 'field',
|
|
17
|
-
/* Filled in by `fieldNature` — read when asked, not when this file loads. */
|
|
18
|
-
property: { options: [] }
|
|
19
|
-
},
|
|
20
|
-
{ type: 'string', label: 'label', name: 'label', property: 'label' },
|
|
21
|
-
{ type: 'number', label: 'text size', name: 'valueSize', property: 'valueSize' }
|
|
22
|
-
]
|
|
23
|
-
};
|
|
24
|
-
/*
|
|
25
|
-
* The field list is read **when the editor asks**, and kept until the axes change.
|
|
26
|
-
*
|
|
27
|
-
* Read once when this file loads, it froze before a product registered its axes — the scene module is
|
|
28
|
-
* imported before bootstrap declares the product, and a factory's thirty-two names would be missing
|
|
29
|
-
* from the picker for good, with no error (ruling on moving the axes, 2026-09-24).
|
|
30
|
-
*/
|
|
31
|
-
let natureNow;
|
|
32
|
-
onStationAxes(() => {
|
|
33
|
-
natureNow = undefined;
|
|
34
|
-
});
|
|
35
|
-
export function fieldNature() {
|
|
36
|
-
natureNow ??= {
|
|
37
|
-
...NATURE,
|
|
38
|
-
properties: NATURE.properties.map(one => (one.name === 'field' ? { ...one, property: { options: stationBindingNames() } } : one))
|
|
39
|
-
};
|
|
40
|
-
return natureNow;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=station-field-nature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-field-nature.js","sourceRoot":"","sources":["../../../client/station/scene/station-field-nature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,6EAA6E;YAC7E,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAc,EAAE;SACtC;QACD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;QACpE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE;KACjF;CACF,CAAA;AAED;;;;;;GAMG;AACH,IAAI,SAAsC,CAAA;AAE1C,aAAa,CAAC,GAAG,EAAE;IACjB,SAAS,GAAG,SAAS,CAAA;AACvB,CAAC,CAAC,CAAA;AAEF,MAAM,UAAU,WAAW;IACzB,SAAS,KAAK;QACZ,GAAG,MAAM;QACT,UAAU,EAAE,MAAM,CAAC,UAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnI,CAAA;IAED,OAAO,SAAS,CAAA;AAClB,CAAC","sourcesContent":["import type { ComponentNature } from '@hatiolab/things-scene'\n\nimport { onStationAxes, stationBindingNames } from '../station-board-binding'\n\n/**\n * What the board editor shows for `station-field` — **its own file so it can be tested without the scene.**\n *\n * The scene class carries a decorator, and a test run that only strips types cannot load it. The part that\n * matters here — when the field list is read — has no reason to need the canvas.\n */\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n label: 'field',\n name: 'field',\n /* Filled in by `fieldNature` — read when asked, not when this file loads. */\n property: { options: [] as string[] }\n },\n { type: 'string', label: 'label', name: 'label', property: 'label' },\n { type: 'number', label: 'text size', name: 'valueSize', property: 'valueSize' }\n ]\n}\n\n/*\n * The field list is read **when the editor asks**, and kept until the axes change.\n *\n * Read once when this file loads, it froze before a product registered its axes — the scene module is\n * imported before bootstrap declares the product, and a factory's thirty-two names would be missing\n * from the picker for good, with no error (ruling on moving the axes, 2026-09-24).\n */\nlet natureNow: ComponentNature | undefined\n\nonStationAxes(() => {\n natureNow = undefined\n})\n\nexport function fieldNature(): ComponentNature {\n natureNow ??= {\n ...NATURE,\n properties: NATURE.properties!.map(one => (one.name === 'field' ? { ...one, property: { options: stationBindingNames() } } : one))\n }\n\n return natureNow\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { StationScene } from './station-scene';
|
|
2
|
-
/**
|
|
3
|
-
* On a board · one thing from the context, **chosen from a list.**
|
|
4
|
-
*
|
|
5
|
-
* ── Why this exists at all ─────────────────────────────────────────────────
|
|
6
|
-
* Values already reach any plain text component whose id is a context name — set the id to
|
|
7
|
-
* `order.name` and the job order appears. That works, and it is also magic: nothing on the property
|
|
8
|
-
* panel says that particular id means anything, so an author has to be told, and a typo is
|
|
9
|
-
* indistinguishable from a name that was never offered.
|
|
10
|
-
*
|
|
11
|
-
* This component takes the same names and makes them a **dropdown**. The list comes out of
|
|
12
|
-
* `stationBindingNames()`, so it cannot drift from what is actually pushed. An author drops one of
|
|
13
|
-
* these, opens the field list, and reads what a station can tell them.
|
|
14
|
-
*
|
|
15
|
-
* The magic id still works. It is the shorter path for someone who knows the names, and drawing a
|
|
16
|
-
* whole line map out of these boxes would be tedious. This is the path for someone who does not.
|
|
17
|
-
*
|
|
18
|
-
* ── It shows the name while being drawn ────────────────────────────────────
|
|
19
|
-
* There is no runtime in the board modeller, so in edit mode this draws the field name where the
|
|
20
|
-
* value will be. An empty box during authoring is how a board ends up shipped with a field nobody
|
|
21
|
-
* ever bound.
|
|
22
|
-
*/
|
|
23
|
-
export default class StationFieldScene extends StationScene {
|
|
24
|
-
render(context: CanvasRenderingContext2D): void;
|
|
25
|
-
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
26
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { sceneComponent } from '@hatiolab/things-scene';
|
|
3
|
-
import { fieldNature } from './station-field-nature';
|
|
4
|
-
import { STATION_COLOR, drawDetached, withinBox } from './station-scene-style';
|
|
5
|
-
import { StationScene } from './station-scene';
|
|
6
|
-
/**
|
|
7
|
-
* On a board · one thing from the context, **chosen from a list.**
|
|
8
|
-
*
|
|
9
|
-
* ── Why this exists at all ─────────────────────────────────────────────────
|
|
10
|
-
* Values already reach any plain text component whose id is a context name — set the id to
|
|
11
|
-
* `order.name` and the job order appears. That works, and it is also magic: nothing on the property
|
|
12
|
-
* panel says that particular id means anything, so an author has to be told, and a typo is
|
|
13
|
-
* indistinguishable from a name that was never offered.
|
|
14
|
-
*
|
|
15
|
-
* This component takes the same names and makes them a **dropdown**. The list comes out of
|
|
16
|
-
* `stationBindingNames()`, so it cannot drift from what is actually pushed. An author drops one of
|
|
17
|
-
* these, opens the field list, and reads what a station can tell them.
|
|
18
|
-
*
|
|
19
|
-
* The magic id still works. It is the shorter path for someone who knows the names, and drawing a
|
|
20
|
-
* whole line map out of these boxes would be tedious. This is the path for someone who does not.
|
|
21
|
-
*
|
|
22
|
-
* ── It shows the name while being drawn ────────────────────────────────────
|
|
23
|
-
* There is no runtime in the board modeller, so in edit mode this draws the field name where the
|
|
24
|
-
* value will be. An empty box during authoring is how a board ends up shipped with a field nobody
|
|
25
|
-
* ever bound.
|
|
26
|
-
*/
|
|
27
|
-
let StationFieldScene = class StationFieldScene extends StationScene {
|
|
28
|
-
render(context) {
|
|
29
|
-
const state = this.state;
|
|
30
|
-
const { left, top, width, height } = state;
|
|
31
|
-
const field = String(state.field || '');
|
|
32
|
-
if (!field) {
|
|
33
|
-
/* Nothing chosen yet. Say which box it is, so the author can find it on a busy board. */
|
|
34
|
-
drawDetached(context, 'pick a field', left, top, width, height);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const bound = this.context;
|
|
38
|
-
withinBox(context, left, top, width, height, () => {
|
|
39
|
-
/*
|
|
40
|
-
* The caption. Falls back to the field name rather than to nothing — a bare number on a
|
|
41
|
-
* shop-floor screen is the thing operators most often read as the wrong quantity.
|
|
42
|
-
*/
|
|
43
|
-
context.textBaseline = 'top';
|
|
44
|
-
context.textAlign = 'left';
|
|
45
|
-
context.fillStyle = STATION_COLOR.quiet;
|
|
46
|
-
context.font = 'bold 11px sans-serif';
|
|
47
|
-
context.fillText(String(state.label || field), left + 2, top + 2);
|
|
48
|
-
const size = Number(state.valueSize) > 0 ? Number(state.valueSize) : Math.max(14, Math.min(40, height * 0.45));
|
|
49
|
-
context.font = `bold ${size}px sans-serif`;
|
|
50
|
-
if (!bound) {
|
|
51
|
-
/*
|
|
52
|
-
* No context: the modeller, or a screen that has not attached yet. Draw the name of what
|
|
53
|
-
* will land here, greyed — never a zero, which would read as a real count.
|
|
54
|
-
*/
|
|
55
|
-
context.fillStyle = STATION_COLOR.line;
|
|
56
|
-
context.fillText(field, left + 2, top + 18);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const value = bound.values[field];
|
|
60
|
-
context.fillStyle = STATION_COLOR.ink;
|
|
61
|
-
context.fillText(value === undefined ? '' : String(value), left + 2, top + 18);
|
|
62
|
-
context.textBaseline = 'alphabetic';
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
get nature() {
|
|
66
|
-
return fieldNature();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
StationFieldScene = __decorate([
|
|
70
|
-
sceneComponent('station-field')
|
|
71
|
-
], StationFieldScene);
|
|
72
|
-
export default StationFieldScene;
|
|
73
|
-
//# sourceMappingURL=station-field-scene.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-field-scene.js","sourceRoot":"","sources":["../../../client/station/scene/station-field-scene.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEY,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,YAAY;IACzD,MAAM,CAAC,OAAiC;QACtC,MAAM,KAAK,GAAQ,IAAI,CAAC,KAAK,CAAA;QAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;QAEvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,yFAAyF;YACzF,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;Y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E,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;YAC9E,OAAO,CAAC,YAAY,GAAG,YAAY,CAAA;QACrC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,MAAM;QACR,OAAO,WAAW,EAAE,CAAA;IACtB,CAAC;CACF,CAAA;AAlDoB,iBAAiB;IADrC,cAAc,CAAC,eAAe,CAAC;GACX,iBAAiB,CAkDrC;eAlDoB,iBAAiB","sourcesContent":["import { sceneComponent } from '@hatiolab/things-scene'\n\nimport { fieldNature } from './station-field-nature'\nimport { STATION_COLOR, drawDetached, withinBox } from './station-scene-style'\nimport { StationScene } from './station-scene'\n\n/**\n * On a board · one thing from the context, **chosen from a list.**\n *\n * ── Why this exists at all ─────────────────────────────────────────────────\n * Values already reach any plain text component whose id is a context name — set the id to\n * `order.name` and the job order appears. That works, and it is also magic: nothing on the property\n * panel says that particular id means anything, so an author has to be told, and a typo is\n * indistinguishable from a name that was never offered.\n *\n * This component takes the same names and makes them a **dropdown**. The list comes out of\n * `stationBindingNames()`, so it cannot drift from what is actually pushed. An author drops one of\n * these, opens the field list, and reads what a station can tell them.\n *\n * The magic id still works. It is the shorter path for someone who knows the names, and drawing a\n * whole line map out of these boxes would be tedious. This is the path for someone who does not.\n *\n * ── It shows the name while being drawn ────────────────────────────────────\n * There is no runtime in the board modeller, so in edit mode this draws the field name where the\n * value will be. An empty box during authoring is how a board ends up shipped with a field nobody\n * ever bound.\n */\n@sceneComponent('station-field')\nexport default class StationFieldScene extends StationScene {\n render(context: CanvasRenderingContext2D) {\n const state: any = this.state\n const { left, top, width, height } = state\n const field = String(state.field || '')\n\n if (!field) {\n /* Nothing chosen yet. Say which box it is, so the author can find it on a busy board. */\n drawDetached(context, 'pick a field', left, top, width, height)\n return\n }\n\n const bound = this.context\n\n withinBox(context, left, top, width, height, () => {\n /*\n * The caption. Falls back to the field name rather than to nothing — a bare number on a\n * shop-floor screen is the thing operators most often read as the wrong quantity.\n */\n context.textBaseline = 'top'\n context.textAlign = 'left'\n context.fillStyle = STATION_COLOR.quiet\n context.font = 'bold 11px sans-serif'\n context.fillText(String(state.label || field), left + 2, top + 2)\n\n const size = Number(state.valueSize) > 0 ? Number(state.valueSize) : Math.max(14, Math.min(40, height * 0.45))\n\n context.font = `bold ${size}px sans-serif`\n\n if (!bound) {\n /*\n * No context: the modeller, or a screen that has not attached yet. Draw the name of what\n * will land here, greyed — never a zero, which would read as a real count.\n */\n context.fillStyle = STATION_COLOR.line\n context.fillText(field, left + 2, top + 18)\n return\n }\n\n const value = bound.values[field]\n\n context.fillStyle = STATION_COLOR.ink\n context.fillText(value === undefined ? '' : String(value), left + 2, top + 18)\n context.textBaseline = 'alphabetic'\n })\n }\n\n get nature() {\n return fieldNature()\n }\n}\n"]}
|