@things-factory/board-ui 6.1.23 → 6.1.28

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 (59) hide show
  1. package/client/{board-provider.js → board-provider.ts} +5 -5
  2. package/client/data-grist/{board-editor.js → board-editor.ts} +31 -34
  3. package/client/data-grist/{board-renderer.js → board-renderer.ts} +10 -13
  4. package/client/pages/{board-modeller-page.js → board-modeller-page.ts} +44 -57
  5. package/client/pages/{board-player-page.js → board-player-page.ts} +51 -57
  6. package/client/pages/{board-viewer-page.js → board-viewer-page.ts} +50 -58
  7. package/client/pages/{printable-board-viewer-page.js → printable-board-viewer-page.ts} +2 -2
  8. package/client/pages/share/share-importer.ts +97 -0
  9. package/client/pages/share/share-list-page.ts +358 -0
  10. package/client/setting-let/{board-view-setting-let.js → board-view-setting-let.ts} +15 -21
  11. package/client/things-scene-import.d.ts +4 -0
  12. package/dist-client/board-provider.d.ts +3 -0
  13. package/dist-client/board-provider.js +77 -0
  14. package/dist-client/board-provider.js.map +1 -0
  15. package/dist-client/bootstrap.d.ts +2 -0
  16. package/dist-client/bootstrap.js +13 -0
  17. package/dist-client/bootstrap.js.map +1 -0
  18. package/dist-client/data-grist/board-editor.d.ts +14 -0
  19. package/dist-client/data-grist/board-editor.js +108 -0
  20. package/dist-client/data-grist/board-editor.js.map +1 -0
  21. package/dist-client/data-grist/board-renderer.d.ts +2 -0
  22. package/dist-client/data-grist/board-renderer.js +133 -0
  23. package/dist-client/data-grist/board-renderer.js.map +1 -0
  24. package/dist-client/index.d.ts +5 -0
  25. package/dist-client/index.js +6 -0
  26. package/dist-client/index.js.map +1 -0
  27. package/dist-client/pages/board-modeller-page.d.ts +48 -0
  28. package/dist-client/pages/board-modeller-page.js +284 -0
  29. package/dist-client/pages/board-modeller-page.js.map +1 -0
  30. package/dist-client/pages/board-player-page.d.ts +43 -0
  31. package/dist-client/pages/board-player-page.js +225 -0
  32. package/dist-client/pages/board-player-page.js.map +1 -0
  33. package/dist-client/pages/board-viewer-page.d.ts +39 -0
  34. package/dist-client/pages/board-viewer-page.js +224 -0
  35. package/dist-client/pages/board-viewer-page.js.map +1 -0
  36. package/dist-client/pages/printable-board-viewer-page.d.ts +11 -0
  37. package/dist-client/pages/printable-board-viewer-page.js +43 -0
  38. package/dist-client/pages/printable-board-viewer-page.js.map +1 -0
  39. package/dist-client/pages/share/share-importer.d.ts +22 -0
  40. package/dist-client/pages/share/share-importer.js +100 -0
  41. package/dist-client/pages/share/share-importer.js.map +1 -0
  42. package/dist-client/pages/share/share-list-page.d.ts +62 -0
  43. package/dist-client/pages/share/share-list-page.js +341 -0
  44. package/dist-client/pages/share/share-list-page.js.map +1 -0
  45. package/dist-client/pages/things-scene-components-with-tools.import +0 -0
  46. package/dist-client/pages/things-scene-components.import +0 -0
  47. package/dist-client/route.d.ts +1 -0
  48. package/dist-client/route.js +17 -0
  49. package/dist-client/route.js.map +1 -0
  50. package/dist-client/setting-let/board-view-setting-let.d.ts +14 -0
  51. package/dist-client/setting-let/board-view-setting-let.js +70 -0
  52. package/dist-client/setting-let/board-view-setting-let.js.map +1 -0
  53. package/dist-client/themes/board-theme.css +107 -0
  54. package/dist-client/tsconfig.tsbuildinfo +1 -0
  55. package/dist-server/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +12 -8
  57. /package/client/{bootstrap.js → bootstrap.ts} +0 -0
  58. /package/client/{index.js → index.ts} +0 -0
  59. /package/client/{route.js → route.ts} +0 -0
@@ -1,12 +1,12 @@
1
1
  import gql from 'graphql-tag'
2
2
 
3
- import { create, error, ReferenceMap } from '@hatiolab/things-scene'
3
+ import { create, error, ReferenceMap, Scene } from '@hatiolab/things-scene'
4
4
  import { DataStorage } from '@operato/board'
5
5
  import { client, gqlContext, subscribe } from '@operato/graphql'
6
6
 
7
7
  export function createBoardProvider() {
8
- var _provider = new ReferenceMap(
9
- async (boardId, resolve, reject) => {
8
+ var _provider = new ReferenceMap<Scene>(
9
+ async (boardId, resolve, reject): Promise<any> => {
10
10
  try {
11
11
  const response = await client.query({
12
12
  query: gql`
@@ -29,7 +29,7 @@ export function createBoardProvider() {
29
29
 
30
30
  var model = JSON.parse(board.model)
31
31
 
32
- var scene
32
+ var scene: Scene
33
33
 
34
34
  try {
35
35
  scene = await provider.get(boardId)
@@ -38,7 +38,7 @@ export function createBoardProvider() {
38
38
  scene = create({
39
39
  model,
40
40
  mode: 0,
41
- refProvider: provider,
41
+ refProvider: provider as any,
42
42
  dataStorage: new DataStorage(boardId),
43
43
  dataSubscriptionProvider: {
44
44
  subscribe: async (tag, component) => {
@@ -2,49 +2,48 @@ import '@operato/board/ox-board-selector.js'
2
2
  import './board-renderer'
3
3
 
4
4
  import { css, html, LitElement } from 'lit'
5
+ import { customElement, property, query } from 'lit/decorators.js'
5
6
 
7
+ import { OxGristEditor } from '@operato/data-grist'
6
8
  import { i18next } from '@operato/i18n'
7
9
  import { openPopup } from '@operato/layout'
8
10
 
9
- export class BoardEditor extends LitElement {
10
- static get properties() {
11
- return {
12
- value: Object,
13
- column: Object,
14
- record: Object,
15
- row: Number
16
- }
17
- }
11
+ @customElement('board-editor')
12
+ export class BoardEditor extends OxGristEditor {
13
+ static styles = css`
14
+ :host {
15
+ display: flex;
16
+ flex-flow: row nowrap;
17
+ align-items: center;
18
18
 
19
- static get styles() {
20
- return css`
21
- :host {
22
- display: flex;
23
- flex-flow: row nowrap;
24
- align-items: center;
19
+ box-sizing: border-box;
25
20
 
26
- box-sizing: border-box;
21
+ width: 100%;
22
+ height: 100%;
27
23
 
28
- width: 100%;
29
- height: 100%;
24
+ border: 0;
25
+ background-color: transparent;
30
26
 
31
- border: 0;
32
- background-color: transparent;
27
+ font: var(--grist-object-editor-font);
28
+ color: var(--grist-object-editor-color);
29
+
30
+ justify-content: inherit;
31
+ }
33
32
 
34
- font: var(--grist-object-editor-font);
35
- color: var(--grist-object-editor-color);
33
+ board-renderer {
34
+ display: flex;
35
+ flex: auto;
36
36
 
37
- justify-content: inherit;
38
- }
37
+ justify-content: inherit;
38
+ }
39
+ `
39
40
 
40
- board-renderer {
41
- display: flex;
42
- flex: auto;
41
+ @property({ type: Object }) value: any
42
+ @property({ type: Object }) column: any
43
+ @property({ type: Object }) record: any
44
+ @property({ type: Number }) row?: number
43
45
 
44
- justify-content: inherit;
45
- }
46
- `
47
- }
46
+ popup
48
47
 
49
48
  render() {
50
49
  var { boardViewerPage } = this.column.record.options || {}
@@ -56,7 +55,7 @@ export class BoardEditor extends LitElement {
56
55
 
57
56
  await this.updateComplete
58
57
 
59
- this.shadowRoot.addEventListener('click', e => {
58
+ this.renderRoot.addEventListener('click', e => {
60
59
  e.stopPropagation()
61
60
 
62
61
  this.openSelector()
@@ -110,5 +109,3 @@ export class BoardEditor extends LitElement {
110
109
  })
111
110
  }
112
111
  }
113
-
114
- customElements.define('board-editor', BoardEditor)
@@ -2,8 +2,10 @@ import '@material/mwc-icon'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html, LitElement } from 'lit'
5
+ import { customElement, property, query } from 'lit/decorators.js'
5
6
 
6
- import { client, gqlContext, navigate } from '@things-factory/shell'
7
+ import { navigate } from '@operato/shell'
8
+ import { client, gqlContext } from '@operato/graphql'
7
9
 
8
10
  const FETCH_BOARD_GQL = id => {
9
11
  return gql`
@@ -18,9 +20,10 @@ const FETCH_BOARD_GQL = id => {
18
20
  `
19
21
  }
20
22
 
23
+ @customElement('board-renderer')
21
24
  class BoardRendererElement extends LitElement {
22
- static get styles() {
23
- return css`
25
+ static styles = [
26
+ css`
24
27
  :host {
25
28
  display: block;
26
29
  position: relative;
@@ -68,15 +71,11 @@ class BoardRendererElement extends LitElement {
68
71
  background-color: var(--board-renderer-icon-view-background-color);
69
72
  }
70
73
  `
71
- }
74
+ ]
72
75
 
73
- static get properties() {
74
- return {
75
- value: Object,
76
- boardViewerPage: String,
77
- _value: Object
78
- }
79
- }
76
+ @property({ type: Object }) value: any
77
+ @property({ type: String }) boardViewerPage?: string
78
+ @property({ type: Object }) _value: any
80
79
 
81
80
  async updated(changes) {
82
81
  if (changes.has('value')) {
@@ -128,8 +127,6 @@ class BoardRendererElement extends LitElement {
128
127
  }
129
128
  }
130
129
 
131
- customElements.define('board-renderer', BoardRendererElement)
132
-
133
130
  export const BoardRenderer = (value, column, record) => {
134
131
  var { boardViewerPage = '' } = column.record.options || {}
135
132
 
@@ -3,17 +3,20 @@ import '@operato/board/ox-board-modeller.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
+ import { customElement, property, query } from 'lit/decorators.js'
6
7
  import { connect } from 'pwa-helpers/connect-mixin.js'
7
8
 
8
9
  import { BoardModeller } from '@operato/board/ox-board-modeller.js'
9
10
  import { OxPropertyEditor } from '@operato/property-editor'
10
- import { client, gqlContext, PageView, store } from '@things-factory/shell'
11
+ import { PageView, store } from '@operato/shell'
12
+ import { client, gqlContext } from '@operato/graphql'
11
13
 
12
14
  import { provider } from '../board-provider'
13
15
  import components from './things-scene-components-with-tools.import'
14
16
 
15
17
  const NOOP = () => {}
16
18
 
19
+ @customElement('board-modeller-page')
17
20
  export class BoardModellerPage extends connect(store)(PageView) {
18
21
  constructor() {
19
22
  super()
@@ -51,49 +54,46 @@ export class BoardModellerPage extends connect(store)(PageView) {
51
54
  this.componentGroupList = BoardModeller.groups
52
55
  }
53
56
 
54
- static get properties() {
55
- return {
56
- boardId: String,
57
- boardName: String,
58
- model: Object,
59
- baseUrl: String,
60
- selected: Array,
61
- mode: Number,
62
- hideProperty: Boolean,
63
- overlay: String,
64
- scene: Object,
65
- componentGroupList: Array,
66
- fonts: Array,
67
- propertyEditor: Array,
68
- preparing: Boolean
69
- }
70
- }
57
+ static styles = [
58
+ css`
59
+ :host {
60
+ display: flex;
61
+ flex-direction: column;
71
62
 
72
- static get styles() {
73
- return [
74
- css`
75
- :host {
76
- display: flex;
77
- flex-direction: column;
78
-
79
- overflow: hidden;
80
- position: relative;
81
- }
82
-
83
- board-modeller {
84
- flex: 1;
85
- }
86
-
87
- oops-note {
88
- display: block;
89
- position: absolute;
90
- left: 50%;
91
- top: 50%;
92
- transform: translate(-50%, -50%);
93
- }
94
- `
95
- ]
96
- }
63
+ overflow: hidden;
64
+ position: relative;
65
+ }
66
+
67
+ board-modeller {
68
+ flex: 1;
69
+ }
70
+
71
+ oops-note {
72
+ display: block;
73
+ position: absolute;
74
+ left: 50%;
75
+ top: 50%;
76
+ transform: translate(-50%, -50%);
77
+ }
78
+ `
79
+ ]
80
+
81
+ @property({ type: String }) boardId?: string | null
82
+ @property({ type: String }) boardName?: string
83
+ @property({ type: Object }) model: any
84
+ @property({ type: String }) baseUrl?: string
85
+ @property({ type: Array }) selected: any
86
+ @property({ type: Number }) mode?: number
87
+ @property({ type: Boolean }) hideProperty?: boolean
88
+ @property({ type: String }) overlay?: string | null
89
+ @property({ type: Object }) scene: any
90
+ @property({ type: Array }) componentGroupList?: any
91
+ @property({ type: Array }) fonts: any
92
+ @property({ type: Array }) propertyEditor: any
93
+ @property({ type: Boolean }) preparing?: boolean
94
+
95
+ board: any
96
+ @query('ox-board-modeller') modeller?: BoardModeller
97
97
 
98
98
  get context() {
99
99
  return {
@@ -111,10 +111,6 @@ export class BoardModellerPage extends connect(store)(PageView) {
111
111
  }
112
112
  }
113
113
 
114
- get modeller() {
115
- return this.renderRoot.querySelector('ox-board-modeller')
116
- }
117
-
118
114
  async refresh() {
119
115
  if (!this.boardId) {
120
116
  this.board = null
@@ -197,14 +193,7 @@ export class BoardModellerPage extends connect(store)(PageView) {
197
193
  var oops = !this.preparing && !this.model && this.oopsNote
198
194
 
199
195
  return oops
200
- ? html`
201
- <oops-note
202
- icon=${oops.icon}
203
- title=${oops.title}
204
- description=${oops.description}
205
- @click=${oops.click || NOOP}
206
- ></oops-note>
207
- `
196
+ ? html` <oops-note icon=${oops.icon} title=${oops.title} description=${oops.description}></oops-note> `
208
197
  : html`
209
198
  <ox-board-modeller
210
199
  .mode=${this.mode}
@@ -285,5 +274,3 @@ export class BoardModellerPage extends connect(store)(PageView) {
285
274
  await this.updateBoard()
286
275
  }
287
276
  }
288
-
289
- customElements.define('board-modeller-page', BoardModellerPage)
@@ -3,65 +3,68 @@ import '@operato/board/ox-board-player.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
+ import { customElement, property, query } from 'lit/decorators.js'
6
7
  import { connect } from 'pwa-helpers/connect-mixin.js'
7
8
 
8
9
  import { createBoardProvider } from '../board-provider'
9
10
  import { store, PageView } from '@operato/shell'
10
11
  import { clientSettingStore } from '@operato/shell/object-store.js'
11
12
  import { client, subscribe } from '@operato/graphql'
13
+ import { ReferenceMap } from '@hatiolab/things-scene'
14
+ import { BoardPlayer } from '@operato/board/ox-board-player.js'
12
15
 
13
16
  const NOOP = () => {}
14
17
 
18
+ @customElement('board-player-page')
15
19
  export class BoardPlayerPage extends connect(store)(PageView) {
16
- static get properties() {
17
- return {
18
- _playGroup: Object,
19
- _playGroupId: String,
20
- _boards: Array,
21
- _baseUrl: String,
22
- _showSpinner: Boolean
23
- }
24
- }
20
+ static styles = [
21
+ css`
22
+ :host {
23
+ display: flex;
24
+ flex-direction: column;
25
+ width: 100%;
26
+ height: 100%;
27
+
28
+ overflow: hidden;
29
+ position: relative;
30
+ }
25
31
 
26
- static get styles() {
27
- return [
28
- css`
29
- :host {
30
- display: flex;
31
- flex-direction: column;
32
- width: 100%;
33
- height: 100%;
34
-
35
- overflow: hidden;
36
- position: relative;
37
- }
32
+ ox-board-player {
33
+ flex: 1;
34
+ }
38
35
 
39
- ox-board-player {
40
- flex: 1;
41
- }
36
+ oops-spinner {
37
+ display: none;
38
+ position: absolute;
39
+ left: 50%;
40
+ top: 50%;
41
+ transform: translate(-50%, -50%);
42
+ }
42
43
 
43
- oops-spinner {
44
- display: none;
45
- position: absolute;
46
- left: 50%;
47
- top: 50%;
48
- transform: translate(-50%, -50%);
49
- }
44
+ oops-spinner[show] {
45
+ display: block;
46
+ }
50
47
 
51
- oops-spinner[show] {
52
- display: block;
53
- }
48
+ oops-note {
49
+ display: block;
50
+ position: absolute;
51
+ left: 50%;
52
+ top: 50%;
53
+ transform: translate(-50%, -50%);
54
+ }
55
+ `
56
+ ]
54
57
 
55
- oops-note {
56
- display: block;
57
- position: absolute;
58
- left: 50%;
59
- top: 50%;
60
- transform: translate(-50%, -50%);
61
- }
62
- `
63
- ]
64
- }
58
+ @property({ type: Object }) _playGroup: any
59
+ @property({ type: String }) _playGroupId?: string | null
60
+ @property({ type: Array }) _boards: any
61
+ @property({ type: String }) _baseUrl?: string
62
+ @property({ type: Boolean }) _showSpinner?: boolean
63
+
64
+ provider?: ReferenceMap<unknown> & { dispose?: () => void }
65
+ subscriptionForAutoRefresh
66
+
67
+ @query('ox-board-player') boardPlayer?: BoardPlayer
65
68
 
66
69
  connectedCallback() {
67
70
  super.connectedCallback()
@@ -72,7 +75,7 @@ export class BoardPlayerPage extends connect(store)(PageView) {
72
75
  disconnectedCallback() {
73
76
  super.disconnectedCallback()
74
77
 
75
- this.provider.despose()
78
+ this.provider!.dispose!()
76
79
  delete this.provider
77
80
  }
78
81
 
@@ -145,7 +148,7 @@ export class BoardPlayerPage extends connect(store)(PageView) {
145
148
 
146
149
  updated(changes) {
147
150
  if (changes.has('_playGroupId')) {
148
- this.shadowRoot.querySelector('ox-board-player').stop()
151
+ this.boardPlayer!.stop()
149
152
  this.refresh()
150
153
  }
151
154
  }
@@ -176,14 +179,7 @@ export class BoardPlayerPage extends connect(store)(PageView) {
176
179
  var oops = !this._showSpinner && !this._playGroup && this.oopsNote
177
180
 
178
181
  return oops
179
- ? html`
180
- <oops-note
181
- icon=${oops.icon}
182
- title=${oops.title}
183
- description=${oops.description}
184
- @click=${oops.click || NOOP}
185
- ></oops-note>
186
- `
182
+ ? html` <oops-note icon=${oops.icon} title=${oops.title} description=${oops.description}></oops-note> `
187
183
  : html`
188
184
  <ox-board-player .boards=${this._boards} .provider=${this.provider}></ox-board-player>
189
185
  <oops-spinner ?show=${this._showSpinner}></oops-spinner>
@@ -199,7 +195,7 @@ export class BoardPlayerPage extends connect(store)(PageView) {
199
195
  this.stopSubscribing()
200
196
 
201
197
  this._playGroupId = null
202
- this.shadowRoot.querySelector('ox-board-player').stop()
198
+ this.boardPlayer!.stop()
203
199
  }
204
200
  }
205
201
 
@@ -240,5 +236,3 @@ export class BoardPlayerPage extends connect(store)(PageView) {
240
236
  delete this.subscriptionForAutoRefresh
241
237
  }
242
238
  }
243
-
244
- customElements.define('board-player-page', BoardPlayerPage)
@@ -3,9 +3,11 @@ import '@operato/board/ox-board-viewer.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
+ import { customElement, property, query } from 'lit/decorators.js'
6
7
  import { connect } from 'pwa-helpers/connect-mixin.js'
7
8
 
8
9
  import { buildLabelPrintCommand } from '@operato/barcode'
10
+ import { BoardViewer } from '@operato/board'
9
11
  import { store, PageView } from '@operato/shell'
10
12
  import { client, gqlContext, subscribe } from '@operato/graphql'
11
13
  import { clientSettingStore } from '@operato/shell/object-store.js'
@@ -14,57 +16,56 @@ import { provider } from '../board-provider'
14
16
 
15
17
  const NOOP = () => {}
16
18
 
19
+ @customElement('board-viewer-page')
17
20
  export class BoardViewerPage extends connect(store)(PageView) {
18
- static get properties() {
19
- return {
20
- _board: Object,
21
- _boardId: String,
22
- _baseUrl: String,
23
- _interactive: Boolean,
24
- _showSpinner: Boolean
25
- }
26
- }
21
+ static styles = [
22
+ css`
23
+ :host {
24
+ display: flex;
25
+ flex-direction: column;
27
26
 
28
- static get styles() {
29
- return [
30
- css`
31
- :host {
32
- display: flex;
33
- flex-direction: column;
27
+ width: 100%; /* 전체화면보기를 위해서 필요함. */
28
+ height: 100%;
34
29
 
35
- width: 100%; /* 전체화면보기를 위해서 필요함. */
36
- height: 100%;
30
+ overflow: hidden;
31
+ position: relative;
32
+ }
37
33
 
38
- overflow: hidden;
39
- position: relative;
40
- }
34
+ ox-board-viewer {
35
+ flex: 1;
36
+ }
41
37
 
42
- ox-board-viewer {
43
- flex: 1;
44
- }
38
+ oops-spinner {
39
+ display: none;
40
+ position: absolute;
41
+ left: 50%;
42
+ top: 50%;
43
+ transform: translate(-50%, -50%);
44
+ }
45
45
 
46
- oops-spinner {
47
- display: none;
48
- position: absolute;
49
- left: 50%;
50
- top: 50%;
51
- transform: translate(-50%, -50%);
52
- }
46
+ oops-spinner[show] {
47
+ display: block;
48
+ }
53
49
 
54
- oops-spinner[show] {
55
- display: block;
56
- }
50
+ oops-note {
51
+ display: block;
52
+ position: absolute;
53
+ left: 50%;
54
+ top: 50%;
55
+ transform: translate(-50%, -50%);
56
+ }
57
+ `
58
+ ]
57
59
 
58
- oops-note {
59
- display: block;
60
- position: absolute;
61
- left: 50%;
62
- top: 50%;
63
- transform: translate(-50%, -50%);
64
- }
65
- `
66
- ]
67
- }
60
+ @property({ type: Object }) _board: any
61
+ @property({ type: String }) _boardId?: string
62
+ @property({ type: String }) _baseUrl?: string
63
+ @property({ type: Boolean }) _interactive?: boolean
64
+ @property({ type: Boolean }) _showSpinner?: boolean
65
+
66
+ subscriptionForAutoRefresh
67
+
68
+ @query('ox-board-viewer') boardViewer!: BoardViewer
68
69
 
69
70
  get oopsNote() {
70
71
  return {
@@ -87,14 +88,7 @@ export class BoardViewerPage extends connect(store)(PageView) {
87
88
  var oops = !this._showSpinner && !this._board && this.oopsNote
88
89
 
89
90
  return oops
90
- ? html`
91
- <oops-note
92
- icon=${oops.icon}
93
- title=${oops.title}
94
- description=${oops.description}
95
- @click=${oops.click || NOOP}
96
- ></oops-note>
97
- `
91
+ ? html` <oops-note icon=${oops.icon} title=${oops.title} description=${oops.description}></oops-note> `
98
92
  : html`
99
93
  <ox-board-viewer
100
94
  .board=${this._board}
@@ -125,7 +119,7 @@ export class BoardViewerPage extends connect(store)(PageView) {
125
119
  this.stopSubscribing()
126
120
 
127
121
  if (this._boardId) {
128
- let boardViewer = this.shadowRoot.querySelector('ox-board-viewer')
122
+ let boardViewer = this.boardViewer
129
123
  boardViewer && boardViewer.closeScene()
130
124
  }
131
125
 
@@ -231,17 +225,15 @@ export class BoardViewerPage extends connect(store)(PageView) {
231
225
  async getGrf() {
232
226
  var { labelRotation } = this._board.model
233
227
 
234
- var { width, height, data } = (await this.shadowRoot.querySelector('ox-board-viewer').getSceneImageData()) || {}
235
- if (!width) {
228
+ var { width, height, data } = (await this.boardViewer.getSceneImageData()) || {}
229
+ if (!width || !data) {
236
230
  throw 'Cannot get SceneImageData...'
237
231
  }
238
232
 
239
- return buildLabelPrintCommand(data, width, height, labelRotation)
233
+ return buildLabelPrintCommand(data as Uint8ClampedArray, width, height, labelRotation, false, false)
240
234
  }
241
235
 
242
236
  async printTrick(image) {
243
- await this.renderRoot.querySelector('ox-board-viewer').printTrick(image)
237
+ await this.boardViewer.printTrick(image)
244
238
  }
245
239
  }
246
-
247
- customElements.define('board-viewer-page', BoardViewerPage)
@@ -1,7 +1,7 @@
1
1
  import { BoardViewerPage } from './board-viewer-page'
2
2
 
3
3
  function serialize(obj) {
4
- var str = []
4
+ var str = [] as string[]
5
5
  for (var p in obj)
6
6
  if (obj.hasOwnProperty(p)) {
7
7
  str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]))
@@ -32,7 +32,7 @@ export class PrintableBoardViewerPage extends BoardViewerPage {
32
32
  const image = await this.fetchImage()
33
33
  await this.printTrick(image)
34
34
 
35
- return this
35
+ return this as any
36
36
  }
37
37
  }
38
38
  }