@operato/scene-integration 10.0.0-beta.2 → 10.0.0-beta.30

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.
Files changed (38) hide show
  1. package/README.md +12 -94
  2. package/dist/connection-control.d.ts +37 -37
  3. package/dist/connection-control.js.map +1 -1
  4. package/dist/connection-state-subscription.d.ts +73 -73
  5. package/dist/connection-state-subscription.js.map +1 -1
  6. package/dist/data-subscription.d.ts +73 -73
  7. package/dist/data-subscription.js.map +1 -1
  8. package/dist/scenario-control.d.ts +73 -73
  9. package/dist/scenario-control.js.map +1 -1
  10. package/dist/scenario-instance-subscription.d.ts +73 -73
  11. package/dist/scenario-instance-subscription.js.map +1 -1
  12. package/dist/scenario-queue-subscription.d.ts +73 -73
  13. package/dist/scenario-queue-subscription.js.map +1 -1
  14. package/dist/scenario-run.d.ts +73 -73
  15. package/dist/scenario-run.js.map +1 -1
  16. package/dist/scenario-start.d.ts +73 -73
  17. package/dist/scenario-start.js.map +1 -1
  18. package/dist/scenario-stop.d.ts +73 -73
  19. package/dist/scenario-stop.js.map +1 -1
  20. package/dist/templates/connection-control.js +1 -1
  21. package/dist/templates/connection-control.js.map +1 -1
  22. package/dist/templates/connection-state-subscription.js +1 -1
  23. package/dist/templates/connection-state-subscription.js.map +1 -1
  24. package/dist/templates/data-subscription.js +1 -1
  25. package/dist/templates/data-subscription.js.map +1 -1
  26. package/dist/templates/scenario-control.js +1 -1
  27. package/dist/templates/scenario-control.js.map +1 -1
  28. package/dist/templates/scenario-instance-subscription.js +1 -1
  29. package/dist/templates/scenario-instance-subscription.js.map +1 -1
  30. package/dist/templates/scenario-queue-subscription.js +1 -1
  31. package/dist/templates/scenario-queue-subscription.js.map +1 -1
  32. package/dist/templates/scenario-run.js +1 -1
  33. package/dist/templates/scenario-run.js.map +1 -1
  34. package/dist/templates/scenario-start.js +1 -1
  35. package/dist/templates/scenario-start.js.map +1 -1
  36. package/dist/templates/scenario-stop.js +1 -1
  37. package/dist/templates/scenario-stop.js.map +1 -1
  38. package/package.json +2 -2
package/README.md CHANGED
@@ -1,105 +1,23 @@
1
- ## data-subscription
1
+ # @operato/scene-integration
2
2
 
3
- - 서버에서 publish 데이타를 subscribe 하는 컴포넌트
4
- - 속성에서 설정된 tag를 가진 publish 데이타를 받아와서 data 속성을 변화시킨다.
5
- - properties
6
- - tag: subscribe 할 데이타의 태그를 지정함
7
- - data scheme
8
- - publish 된 데이타의 형태를 그대로 유지한다.
3
+ > Things factory integration component for things-scene
9
4
 
10
- ## connection-state-subscription
5
+ <!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
11
6
 
12
- - connection 상태를 subscribe 하는 컴포넌트
13
- - connection 의 현재 상태를 가져와서 data 속성을 변화시킨다.
14
- - properties
15
- - connection name : 커넥션의 이름을 설정함
16
- - data scheme
7
+ ## Install
17
8
 
9
+ ```bash
10
+ yarn add @operato/scene-integration
18
11
  ```
19
- {
20
- name: 'mqtt1', /* connection name */
21
- state: 'CONNECTED', /* 'CONNECTED' | 'DISCONNECTED' */
22
- timestamp: 4273809748
23
- }
24
- ```
25
-
26
- ## scenario-instance-subscription
27
12
 
28
- - 시나리오 인스턴스 상태를 subscribe 하는 컴포넌트
29
- - 시나리오 인스턴스의 현재 상태를 가져와서 data 속성을 변화시킨다.
30
- - properties
31
- - instance name : (선택값) 이 이름으로 존재하는 시나리오 인스턴스를 종료시킨다. 이 값을 설정하지 않으면, scenario name 속성값을 사용한다.
32
- - scenario name : (선택값) 이 값을 설정하지 않으면, scenario name 속성 값을 시나리오 인스턴스 이름으로 한다.
33
- - data scheme
13
+ ## Build
34
14
 
15
+ ```bash
16
+ yarn build
35
17
  ```
36
- {
37
- variables: {
38
- ... /* 인스턴스 실행시 전달받은 파라미터들 */
39
- },
40
- data: {
41
- [each step name]: { /* step result */ }
42
- },
43
- state: 'STARTED' | 'STOPPED' | 'HALTED', /* 시나리오의 상태 */
44
- timestamp: 4273809748
45
- }
46
- ```
47
-
48
- ## scenario-start
49
-
50
- - 시나리오를 주어진 variables 로 시작시킨다.
51
- - 현재 실행중인 동일한 이름(instance name)의 시나리오 인스턴스가 없는 경우에만 새로운 시나리오를 시작한다.
52
- - variables(value 속성) 로 주어진 값이 시나리오 시작 시에 variables 변수로 주어진다. 이 값이 변화되거나, intent sensitive 가 설정된 경우에, 이 컴포넌트가 동작한다.
53
- - properties
54
- - instance name : (선택값) 이 이름으로 새로 시작되는 시나리오 인스턴스의 이름을 주어진 instance name 값으로 유지한다.
55
- scenario-stop 시에 이 이름을 instance name으로 제공하면, 해당 시나리오 인스턴스를 종료시킨다.
56
- 이 값을 설정하지 않으면, scenario name 속성값을 시나리오 인스턴스 이름으로 한다.
57
- 만약, 동일한 instance name을 갖는 시나리오 인스턴스가 이미 존재하면, 새로운 시나리오 인스턴스가 시작되지 않는다.
58
- - scenario-name : (필수값) 시나리오 이름을 제공한다. instance name이 특별히 설정되지 않으면, scenario name이 instance name이 된다.
59
- - variables : 시나리오에 전달된 variables 값. 시나리오에 제공되는 파라미터 값이다. 이 컴포넌트의 value 에 연결된 속성이다.
60
- - data
61
- - scenario-start 로 실행된 scenario instance 의 상태값 : 'STARTED' | 'STOPPED' | 'HALTED'
62
-
63
- ## scenario-stop
64
18
 
65
- - 시나리오를 주어진 variables 종료시킨다.
66
- - 현재 실행중인 동일한 이름(instance name)의 시나리오 인스턴스를 찾아서 종료한다. 주어진 이름의 인스턴스가 없으면, 아무런 동작이 일어나지 않는다.
67
- - value : 아무런 값이 주어져도 되며, 이 값이 변화되거나, intent sensitive 가 설정된 경우에, 이 컴포넌트가 동작한다.
68
- - properties
69
- - instance name : (선택값) 이 이름으로 존재하는 시나리오 인스턴스를 종료시킨다. 이 값을 설정하지 않으면, scenario name 속성값을 사용한다. 이 값을 설정하지 않으면, scenario name 속성 값을 시나리오 인스턴스 이름으로 한다.
70
- - scenario name : (선택값) instance name 과 scenario name 둘 중 하나는 입력되어야 한다.
71
- - data
72
- - scenario-stop 으로 종료된 scenario instance 의 상태값 : 'STOPPED' | 'HALTED'
73
-
74
- ## scenario-run (scenario-start와 구별하여 사용해야 함.)
75
-
76
- - 시나리오를 주어진 variables 로 시작시키고, 종료된 후에 결과값을 가져온다.
77
- (scenario-start는 시나리오를 시작시키고 바로 리턴된다.)
78
- - scenario-run 은 단기간에 종료가 보장되는 시나리오만을 대상으로 한다.
79
- - scenario-run 으로 실행되는 시나리오 인스턴스는 그 이름으로 관리되지 않는다.
80
- (scenario-start로 실행되는 시나리오 인스턴스는 instance 이름으로 관리되며, 모니터링될 수 있다.)
81
- - variables(value 속성) 로 주어진 값이 시나리오 시작 시에 variables 변수로 주어진다. 이 값이 변화되거나, intent sensitive 가 설정된 경우에, 이 컴포넌트가 동작한다.
82
- - properties
83
- - instance name : (선택값) deprecated 이 속성은 사용되지 않을 예정임.
84
- - scenario-name : (필수값) 실행될 시나리오 이름.
85
- - variables : 시나리오에 전달된 variables 값. 시나리오에 제공되는 파라미터 값이다. 이 컴포넌트의 value 에 연결된 속성이다.
86
- - data scheme
87
- - 실행 완료 후 시나리오의 최종 context를 제공받게 된다.
88
-
89
- ```
90
- {
91
- variables: {
92
- ... /* 인스턴스 실행시 전달받은 파라미터들 */
93
- },
94
- data: {
95
- [each step name]: { /* step result */ }
96
- },
97
- state: 'STOPPED' | 'HALTED', /* 시나리오의 최종 상태 */
98
- timestamp: 4273809748
99
- }
100
- ```
19
+ Output: ESM module at `dist/index.js` (single bundle, no UMD/IE legacy).
101
20
 
102
- ## scenario-control
21
+ _Version: 10.0.0-beta.2_
103
22
 
104
- - (deprecated) 이 컴포넌트는 사용되지 않을 예정이다.
105
- - scenario-start와 scenario-stop 으로 대체됨.
23
+ <!-- AUTOGEN_END -->
@@ -1,4 +1,4 @@
1
- import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Shape } from '@hatiolab/things-scene';
2
2
  declare const ConnectionControl_base: (new (...args: any[]) => {
3
3
  contains(x: number, y: number): boolean;
4
4
  get path(): {
@@ -49,7 +49,7 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
49
49
  get disposed(): boolean;
50
50
  isLayer(): boolean;
51
51
  isGroup(): boolean;
52
- isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
52
+ isContainer(): this is import("@hatiolab/things-scene").Container;
53
53
  isLine(): boolean;
54
54
  isRoot(): boolean;
55
55
  isRootModel(): boolean;
@@ -65,9 +65,9 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
65
65
  get(property: any): any;
66
66
  set(props: any, propval?: any): any;
67
67
  getState(property: any): any;
68
- setState(props: any, propval?: any): any;
68
+ setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
69
69
  get model(): any;
70
- get state(): any;
70
+ get state(): import("@hatiolab/things-scene").State;
71
71
  get hierarchy(): any;
72
72
  get volatile(): never[];
73
73
  _applyProps(target: any, props: any, options: any): any;
@@ -103,7 +103,7 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
103
103
  draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
104
104
  prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
105
105
  postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
106
- prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
106
+ prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
107
107
  prepareIf(condition: boolean): void;
108
108
  drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
109
109
  drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
@@ -154,16 +154,16 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
154
154
  get started(): boolean;
155
155
  set started(v: boolean): any;
156
156
  get controls(): import("@hatiolab/things-scene").Control[] | undefined;
157
- findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
158
- findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
159
- capture(x: number, y: number, except?: (c: Component) => boolean): any;
157
+ findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
158
+ findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
159
+ capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
160
160
  findAnchor(name: string): any;
161
- isDescendible(container: Component): boolean;
161
+ isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
162
162
  getContext(component?: unknown): any;
163
- get root(): Component;
164
- get rootModel(): Component;
165
- get parent(): Component;
166
- set parent(v: Component): any;
163
+ get root(): import("@hatiolab/things-scene").Component;
164
+ get rootModel(): import("@hatiolab/things-scene").Component;
165
+ get parent(): import("@hatiolab/things-scene").Component;
166
+ set parent(v: import("@hatiolab/things-scene").Component): any;
167
167
  get scalable(): boolean;
168
168
  get stuck(): boolean;
169
169
  get capturable(): boolean;
@@ -188,20 +188,20 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
188
188
  ondropfile(transfered: FileList, files: string[]): void;
189
189
  transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
190
190
  transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
191
- transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
192
- transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
193
- transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
194
- transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
195
- transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
196
- transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
197
- transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
191
+ transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
192
+ transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
193
+ transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
194
+ transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
195
+ transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
196
+ transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
197
+ transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
198
198
  toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
199
199
  fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
200
- toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
201
- fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
202
- toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
203
- toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
204
- toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
200
+ toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
201
+ fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
202
+ toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
203
+ toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
204
+ toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
205
205
  on(name: string | object, callback: Function, context?: any): any;
206
206
  off(name?: string | object, callback?: Function, context?: any): any;
207
207
  once(name: string | object, callback: Function, context?: any): any;
@@ -211,24 +211,24 @@ declare const ConnectionControl_base: (new (...args: any[]) => {
211
211
  onchange(after: Record<string, any>, before: Record<string, any>): void;
212
212
  calculateBounds?(): void;
213
213
  oncreate_element?(element: HTMLElement): void;
214
- removeComponent(component: Component, ghost?: boolean): void;
215
- addComponent(component: Component, ghost?: boolean): void;
216
- insertComponentAt(component: Component, index: number, ghost?: boolean): void;
217
- getOverlay(component: Component): HTMLElement | undefined;
218
- findById(id: string): Component | undefined;
219
- findByRefid(ref: string | number): Component | undefined;
220
- findAllById(id: string): Component[];
214
+ removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
215
+ addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
216
+ insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
217
+ getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
218
+ findById(id: string): import("@hatiolab/things-scene").Component | undefined;
219
+ findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
220
+ findAllById(id: string): import("@hatiolab/things-scene").Component[];
221
221
  resize(): void;
222
222
  fit(type?: string): void;
223
- get components(): Component[] | undefined;
223
+ get components(): import("@hatiolab/things-scene").Component[] | undefined;
224
224
  get layout(): any;
225
225
  get auxOverlay(): HTMLElement | undefined;
226
226
  get isReady(): boolean;
227
227
  get unitScale(): number;
228
- get selected(): Component[];
229
- set selected(_v: Component[]): any;
230
- get focused(): Component | null;
231
- set focused(_v: Component | null): any;
228
+ get selected(): import("@hatiolab/things-scene").Component[];
229
+ set selected(_v: import("@hatiolab/things-scene").Component[]): any;
230
+ get focused(): import("@hatiolab/things-scene").Component | null;
231
+ set focused(_v: import("@hatiolab/things-scene").Component | null): any;
232
232
  get hasSameParentForAllSelected(): boolean;
233
233
  set hasSameParentForAllSelected(_v: boolean): any;
234
234
  get fitMode(): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../src/connection-control.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACpG,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;wBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;wBACpB,OAAO,CAAC,EAAE,CAAC,CAAA;oBACb,CAAC;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gBACnF,CAAC;aACF;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,EAAE;wBACX,KAAK,EAAE,EAAE;qBACV;oBACD;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,OAAO,EAAE,YAAY;wBACrB,KAAK,EAAE,YAAY;qBACpB;iBACF;aACF;SACF;KACF;IACD,gBAAgB,EAAE,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Q,WAAW,EAAE,CAAC;YACpB,KAAK,SAAS,CAAC;YACf,KAAK,IAAI,CAAC;YACV,KAAK,CAAC;gBACJ,WAAW,GAAG,SAAS,CAAA;gBACvB,MAAK;YACP;gBACE,WAAW,GAAG,YAAY,CAAA;QAC9B,CAAC;QAED,IAAI,KAAK,GAAG,EAAE,CAAA;QAEd,KAAK,GAAG;QACJ,WAAW,qBAAqB,cAAc;;;MAGhD,CAAA;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,GAAG,CAAA;YACN,KAAK;SACR;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;QACtB,CAAC;IACH,CAAC;CACF,CAAA;AA/DoB,iBAAiB;IADrC,cAAc,CAAC,oBAAoB,CAAC;GAChB,iBAAiB,CA+DrC;eA/DoB,iBAAiB","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\nimport { client } from '@operato/graphql'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await client.query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'select',\n label: 'control-type',\n name: 'controlType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'connect',\n value: 'connect'\n },\n {\n display: 'disconnect',\n value: 'disconnect'\n }\n ]\n }\n }\n ],\n 'value-property': 'controlType',\n help: 'scene/component/connection-control'\n}\n\n@sceneComponent('connection-control')\nexport default class ConnectionControl extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ConnectionControl._image) {\n ConnectionControl._image = new Image()\n ConnectionControl._image.src = new URL('../icons/symbol-connection-control.png', import.meta.url).href\n }\n return ConnectionControl._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ConnectionControl.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n get controlType() {\n return this.getState('controlType')\n }\n\n set controlType(controlType: string) {\n this.setState('controlType', controlType)\n this.controlConnect()\n }\n\n async controlConnect() {\n let { controlType, connectionName } = this.state\n\n if (!connectionName || !this.app.isViewMode) return\n\n switch (controlType) {\n case 'connect':\n case true:\n case 1:\n controlType = 'connect'\n break\n default:\n controlType = 'disconnect'\n }\n\n var query = ''\n\n query = `mutation{\n ${controlType}Connection(name: \"${connectionName}\") {\n status\n }\n }`\n\n if (client) {\n var response = await client.query({\n query: gql`\n ${query}\n `\n })\n\n this.data = response\n }\n }\n}\n"]}
1
+ {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../src/connection-control.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAmB,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;wBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;wBACpB,OAAO,CAAC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'\nimport { client } from '@operato/graphql'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await client.query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'select',\n label: 'control-type',\n name: 'controlType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'connect',\n value: 'connect'\n },\n {\n display: 'disconnect',\n value: 'disconnect'\n }\n ]\n }\n }\n ],\n 'value-property': 'controlType',\n help: 'scene/component/connection-control'\n}\n\n@sceneComponent('connection-control')\nexport default class ConnectionControl extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ConnectionControl._image) {\n ConnectionControl._image = new Image()\n ConnectionControl._image.src = new URL('../icons/symbol-connection-control.png', import.meta.url).href\n }\n return ConnectionControl._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ConnectionControl.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n get controlType() {\n return this.getState('controlType')\n }\n\n set controlType(controlType: string) {\n this.setState('controlType', controlType)\n this.controlConnect()\n }\n\n async controlConnect() {\n let { controlType, connectionName } = this.state\n\n if (!connectionName || !this.app.isViewMode) return\n\n switch (controlType) {\n case 'connect':\n case true:\n case 1:\n controlType = 'connect'\n break\n default:\n controlType = 'disconnect'\n }\n\n var query = ''\n\n query = `mutation{\n ${controlType}Connection(name: \"${connectionName}\") {\n status\n }\n }`\n\n if (client) {\n var response = await client.query({\n query: gql`\n ${query}\n `\n })\n\n this.data = response\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Shape } from '@hatiolab/things-scene';
2
2
  declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
3
3
  _convertDataFormat(data: any, format: any): any;
4
4
  isDataSource(): boolean;
@@ -32,7 +32,7 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
32
32
  get disposed(): boolean;
33
33
  isLayer(): boolean;
34
34
  isGroup(): boolean;
35
- isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
35
+ isContainer(): this is import("@hatiolab/things-scene").Container;
36
36
  isLine(): boolean;
37
37
  isRoot(): boolean;
38
38
  isRootModel(): boolean;
@@ -48,9 +48,9 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
48
48
  get(property: any): any;
49
49
  set(props: any, propval?: any): any;
50
50
  getState(property: any): any;
51
- setState(props: any, propval?: any): any;
51
+ setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
52
52
  get model(): any;
53
- get state(): any;
53
+ get state(): import("@hatiolab/things-scene").State;
54
54
  get hierarchy(): any;
55
55
  get volatile(): never[];
56
56
  _applyProps(target: any, props: any, options: any): any;
@@ -92,7 +92,7 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
92
92
  prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
93
93
  render(context: import("@hatiolab/things-scene").SceneRenderContext): void;
94
94
  postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
95
- prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
95
+ prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
96
96
  prepareIf(condition: boolean): void;
97
97
  drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
98
98
  drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
@@ -143,16 +143,16 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
143
143
  get started(): boolean;
144
144
  set started(v: boolean): any;
145
145
  get controls(): import("@hatiolab/things-scene").Control[] | undefined;
146
- findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
147
- findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
148
- capture(x: number, y: number, except?: (c: Component) => boolean): any;
146
+ findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
147
+ findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
148
+ capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
149
149
  findAnchor(name: string): any;
150
- isDescendible(container: Component): boolean;
150
+ isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
151
151
  getContext(component?: unknown): any;
152
- get root(): Component;
153
- get rootModel(): Component;
154
- get parent(): Component;
155
- set parent(v: Component): any;
152
+ get root(): import("@hatiolab/things-scene").Component;
153
+ get rootModel(): import("@hatiolab/things-scene").Component;
154
+ get parent(): import("@hatiolab/things-scene").Component;
155
+ set parent(v: import("@hatiolab/things-scene").Component): any;
156
156
  get anchors(): import("@hatiolab/things-scene").Anchor[];
157
157
  get scalable(): boolean;
158
158
  get stuck(): boolean;
@@ -178,20 +178,20 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
178
178
  ondropfile(transfered: FileList, files: string[]): void;
179
179
  transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
180
180
  transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
181
- transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
182
- transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
183
- transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
184
- transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
185
- transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
186
- transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
187
- transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
181
+ transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
182
+ transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
183
+ transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
184
+ transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
185
+ transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
186
+ transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
187
+ transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
188
188
  toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
189
189
  fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
190
- toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
191
- fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
192
- toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
193
- toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
194
- toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
190
+ toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
191
+ fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
192
+ toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
193
+ toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
194
+ toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
195
195
  on(name: string | object, callback: Function, context?: any): any;
196
196
  off(name?: string | object, callback?: Function, context?: any): any;
197
197
  once(name: string | object, callback: Function, context?: any): any;
@@ -201,24 +201,24 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
201
201
  onchange(after: Record<string, any>, before: Record<string, any>): void;
202
202
  calculateBounds?(): void;
203
203
  oncreate_element?(element: HTMLElement): void;
204
- removeComponent(component: Component, ghost?: boolean): void;
205
- addComponent(component: Component, ghost?: boolean): void;
206
- insertComponentAt(component: Component, index: number, ghost?: boolean): void;
207
- getOverlay(component: Component): HTMLElement | undefined;
208
- findById(id: string): Component | undefined;
209
- findByRefid(ref: string | number): Component | undefined;
210
- findAllById(id: string): Component[];
204
+ removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
205
+ addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
206
+ insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
207
+ getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
208
+ findById(id: string): import("@hatiolab/things-scene").Component | undefined;
209
+ findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
210
+ findAllById(id: string): import("@hatiolab/things-scene").Component[];
211
211
  resize(): void;
212
212
  fit(type?: string): void;
213
- get components(): Component[] | undefined;
213
+ get components(): import("@hatiolab/things-scene").Component[] | undefined;
214
214
  get layout(): any;
215
215
  get auxOverlay(): HTMLElement | undefined;
216
216
  get isReady(): boolean;
217
217
  get unitScale(): number;
218
- get selected(): Component[];
219
- set selected(_v: Component[]): any;
220
- get focused(): Component | null;
221
- set focused(_v: Component | null): any;
218
+ get selected(): import("@hatiolab/things-scene").Component[];
219
+ set selected(_v: import("@hatiolab/things-scene").Component[]): any;
220
+ get focused(): import("@hatiolab/things-scene").Component | null;
221
+ set focused(_v: import("@hatiolab/things-scene").Component | null): any;
222
222
  get hasSameParentForAllSelected(): boolean;
223
223
  set hasSameParentForAllSelected(_v: boolean): any;
224
224
  get fitMode(): string | undefined;
@@ -275,7 +275,7 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
275
275
  get disposed(): boolean;
276
276
  isLayer(): boolean;
277
277
  isGroup(): boolean;
278
- isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
278
+ isContainer(): this is import("@hatiolab/things-scene").Container;
279
279
  isLine(): boolean;
280
280
  isRoot(): boolean;
281
281
  isRootModel(): boolean;
@@ -291,9 +291,9 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
291
291
  get(property: any): any;
292
292
  set(props: any, propval?: any): any;
293
293
  getState(property: any): any;
294
- setState(props: any, propval?: any): any;
294
+ setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
295
295
  get model(): any;
296
- get state(): any;
296
+ get state(): import("@hatiolab/things-scene").State;
297
297
  get hierarchy(): any;
298
298
  get volatile(): never[];
299
299
  _applyProps(target: any, props: any, options: any): any;
@@ -329,7 +329,7 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
329
329
  draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
330
330
  prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
331
331
  postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
332
- prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
332
+ prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
333
333
  prepareIf(condition: boolean): void;
334
334
  drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
335
335
  drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
@@ -380,16 +380,16 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
380
380
  get started(): boolean;
381
381
  set started(v: boolean): any;
382
382
  get controls(): import("@hatiolab/things-scene").Control[] | undefined;
383
- findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
384
- findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
385
- capture(x: number, y: number, except?: (c: Component) => boolean): any;
383
+ findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
384
+ findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
385
+ capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
386
386
  findAnchor(name: string): any;
387
- isDescendible(container: Component): boolean;
387
+ isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
388
388
  getContext(component?: unknown): any;
389
- get root(): Component;
390
- get rootModel(): Component;
391
- get parent(): Component;
392
- set parent(v: Component): any;
389
+ get root(): import("@hatiolab/things-scene").Component;
390
+ get rootModel(): import("@hatiolab/things-scene").Component;
391
+ get parent(): import("@hatiolab/things-scene").Component;
392
+ set parent(v: import("@hatiolab/things-scene").Component): any;
393
393
  get scalable(): boolean;
394
394
  get stuck(): boolean;
395
395
  get capturable(): boolean;
@@ -414,20 +414,20 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
414
414
  ondropfile(transfered: FileList, files: string[]): void;
415
415
  transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
416
416
  transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
417
- transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
418
- transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
419
- transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
420
- transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
421
- transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
422
- transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
423
- transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
417
+ transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
418
+ transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
419
+ transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
420
+ transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
421
+ transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
422
+ transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
423
+ transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
424
424
  toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
425
425
  fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
426
- toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
427
- fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
428
- toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
429
- toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
430
- toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
426
+ toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
427
+ fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
428
+ toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
429
+ toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
430
+ toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
431
431
  on(name: string | object, callback: Function, context?: any): any;
432
432
  off(name?: string | object, callback?: Function, context?: any): any;
433
433
  once(name: string | object, callback: Function, context?: any): any;
@@ -437,24 +437,24 @@ declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
437
437
  onchange(after: Record<string, any>, before: Record<string, any>): void;
438
438
  calculateBounds?(): void;
439
439
  oncreate_element?(element: HTMLElement): void;
440
- removeComponent(component: Component, ghost?: boolean): void;
441
- addComponent(component: Component, ghost?: boolean): void;
442
- insertComponentAt(component: Component, index: number, ghost?: boolean): void;
443
- getOverlay(component: Component): HTMLElement | undefined;
444
- findById(id: string): Component | undefined;
445
- findByRefid(ref: string | number): Component | undefined;
446
- findAllById(id: string): Component[];
440
+ removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
441
+ addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
442
+ insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
443
+ getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
444
+ findById(id: string): import("@hatiolab/things-scene").Component | undefined;
445
+ findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
446
+ findAllById(id: string): import("@hatiolab/things-scene").Component[];
447
447
  resize(): void;
448
448
  fit(type?: string): void;
449
- get components(): Component[] | undefined;
449
+ get components(): import("@hatiolab/things-scene").Component[] | undefined;
450
450
  get layout(): any;
451
451
  get auxOverlay(): HTMLElement | undefined;
452
452
  get isReady(): boolean;
453
453
  get unitScale(): number;
454
- get selected(): Component[];
455
- set selected(_v: Component[]): any;
456
- get focused(): Component | null;
457
- set focused(_v: Component | null): any;
454
+ get selected(): import("@hatiolab/things-scene").Component[];
455
+ set selected(_v: import("@hatiolab/things-scene").Component[]): any;
456
+ get focused(): import("@hatiolab/things-scene").Component | null;
457
+ set focused(_v: import("@hatiolab/things-scene").Component | null): any;
458
458
  get hasSameParentForAllSelected(): boolean;
459
459
  set hasSameParentForAllSelected(_v: boolean): any;
460
460
  get fitMode(): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../src/connection-state-subscription.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAA8B,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAChH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;wBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;wBACpB,OAAO,CAAC,EAAE,CAAC,CAAA;oBACb,CAAC;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gBACnF,CAAC;aACF;SACF;KACF;IACD,IAAI,EAAE,+CAA+C;CACtD,CAAA;AAGc,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;;IAClF,MAAM,CAAC,MAAM,CAAkB;IAC/B,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,6B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,GAAG,CAAA;mCACiB,cAAc;;;;;UAKvC;SACH,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE,CAAC;oBACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAA;gBAClC,CAAC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAtEoB,2BAA2B;IAD/C,cAAc,CAAC,+BAA+B,CAAC;GAC3B,2BAA2B,CAsE/C;eAtEoB,2BAA2B","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, DataSource, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\nimport { client, subscribe } from '@operato/graphql'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await client.query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n }\n ],\n help: 'scene/component/connection-state-subscription'\n}\n\n@sceneComponent('connection-state-subscription')\nexport default class ConnectionStateSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!ConnectionStateSubscription._image) {\n ConnectionStateSubscription._image = new Image()\n ConnectionStateSubscription._image.src = new URL(\n '../icons/symbol-connection-state-subscription.png',\n import.meta.url\n ).href\n }\n\n return ConnectionStateSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ConnectionStateSubscription.image, left, top, width, height)\n }\n\n async ready() {\n await super.ready()\n\n if (!this.app.isViewMode) return\n this._initConnectionStateSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initConnectionStateSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { connectionName } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`subscription {\n connectionState(name: \"${connectionName}\") {\n name\n state\n timestamp\n }\n }`\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.connectionState\n }\n }\n }\n )\n }\n}\n"]}
1
+ {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../src/connection-state-subscription.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAmB,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACrG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;wBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;wBACpB,OAAO,CAAC,EAAE,CAAC,CAAA;oBACb,CAAC;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gBACnF,CAAC;aACF;SACF;KACF;IACD,IAAI,EAAE,+CA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I,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEnC,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;mCACiB,cAAc;;;;;UAKvC;SACH,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE,CAAC;oBACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAA;gBAClC,CAAC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAtEoB,2BAA2B;IAD/C,cAAc,CAAC,+BAA+B,CAAC;GAC3B,2BAA2B,CAsE/C;eAtEoB,2BAA2B","sourcesContent":["import gql from 'graphql-tag'\n\nimport { ComponentNature, DataSource, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\nimport { client, subscribe } from '@operato/graphql'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await client.query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n }\n ],\n help: 'scene/component/connection-state-subscription'\n}\n\n@sceneComponent('connection-state-subscription')\nexport default class ConnectionStateSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!ConnectionStateSubscription._image) {\n ConnectionStateSubscription._image = new Image()\n ConnectionStateSubscription._image.src = new URL(\n '../icons/symbol-connection-state-subscription.png',\n import.meta.url\n ).href\n }\n\n return ConnectionStateSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ConnectionStateSubscription.image, left, top, width, height)\n }\n\n async ready() {\n await super.ready()\n\n if (!this.app.isViewMode) return\n this._initConnectionStateSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initConnectionStateSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { connectionName } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`subscription {\n connectionState(name: \"${connectionName}\") {\n name\n state\n timestamp\n }\n }`\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.connectionState\n }\n }\n }\n )\n }\n}\n"]}