@things-factory/board-ui 6.2.96 → 6.2.102
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/client/pages/board-modeller-page.ts +1 -1
- package/client/pages/board-player-page.ts +1 -1
- package/client/pages/board-viewer-page.ts +2 -4
- package/client/setting-let/board-view-setting-let.ts +2 -6
- package/package.json +4 -4
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -1
- package/translations/zh.json +5 -4
- package/dist-client/apptools/favorite-tool.d.ts +0 -26
- package/dist-client/apptools/favorite-tool.js +0 -129
- package/dist-client/apptools/favorite-tool.js.map +0 -1
- package/dist-client/board-list/board-importer.d.ts +0 -6
- package/dist-client/board-list/board-importer.js +0 -112
- package/dist-client/board-list/board-importer.js.map +0 -1
- package/dist-client/board-list/board-tile-list.d.ts +0 -22
- package/dist-client/board-list/board-tile-list.js +0 -264
- package/dist-client/board-list/board-tile-list.js.map +0 -1
- package/dist-client/board-list/group-bar.d.ts +0 -14
- package/dist-client/board-list/group-bar.js +0 -145
- package/dist-client/board-list/group-bar.js.map +0 -1
- package/dist-client/board-list/play-group-bar.d.ts +0 -21
- package/dist-client/board-list/play-group-bar.js +0 -142
- package/dist-client/board-list/play-group-bar.js.map +0 -1
- package/dist-client/board-provider.d.ts +0 -3
- package/dist-client/board-provider.js +0 -77
- package/dist-client/board-provider.js.map +0 -1
- package/dist-client/bootstrap.d.ts +0 -2
- package/dist-client/bootstrap.js +0 -30
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/data-grist/board-editor.d.ts +0 -14
- package/dist-client/data-grist/board-editor.js +0 -110
- package/dist-client/data-grist/board-editor.js.map +0 -1
- package/dist-client/data-grist/board-renderer.d.ts +0 -2
- package/dist-client/data-grist/board-renderer.js +0 -134
- package/dist-client/data-grist/board-renderer.js.map +0 -1
- package/dist-client/data-grist/color-map-editor.d.ts +0 -4
- package/dist-client/data-grist/color-map-editor.js +0 -15
- package/dist-client/data-grist/color-map-editor.js.map +0 -1
- package/dist-client/data-grist/color-ranges-editor.d.ts +0 -4
- package/dist-client/data-grist/color-ranges-editor.js +0 -15
- package/dist-client/data-grist/color-ranges-editor.js.map +0 -1
- package/dist-client/graphql/board-template.d.ts +0 -5
- package/dist-client/graphql/board-template.js +0 -128
- package/dist-client/graphql/board-template.js.map +0 -1
- package/dist-client/graphql/board.d.ts +0 -19
- package/dist-client/graphql/board.js +0 -231
- package/dist-client/graphql/board.js.map +0 -1
- package/dist-client/graphql/favorite-board.d.ts +0 -1
- package/dist-client/graphql/favorite-board.js +0 -24
- package/dist-client/graphql/favorite-board.js.map +0 -1
- package/dist-client/graphql/group.d.ts +0 -6
- package/dist-client/graphql/group.js +0 -125
- package/dist-client/graphql/group.js.map +0 -1
- package/dist-client/graphql/index.d.ts +0 -6
- package/dist-client/graphql/index.js +0 -7
- package/dist-client/graphql/index.js.map +0 -1
- package/dist-client/graphql/my-board.d.ts +0 -1
- package/dist-client/graphql/my-board.js +0 -24
- package/dist-client/graphql/my-board.js.map +0 -1
- package/dist-client/graphql/play-group.d.ts +0 -7
- package/dist-client/graphql/play-group.js +0 -173
- package/dist-client/graphql/play-group.js.map +0 -1
- package/dist-client/index.d.ts +0 -8
- package/dist-client/index.js +0 -9
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/attachment-list-page.d.ts +0 -30
- package/dist-client/pages/attachment-list-page.js +0 -128
- package/dist-client/pages/attachment-list-page.js.map +0 -1
- package/dist-client/pages/board-list-page.d.ts +0 -109
- package/dist-client/pages/board-list-page.js +0 -532
- package/dist-client/pages/board-list-page.js.map +0 -1
- package/dist-client/pages/board-modeller-page.d.ts +0 -49
- package/dist-client/pages/board-modeller-page.js +0 -309
- package/dist-client/pages/board-modeller-page.js.map +0 -1
- package/dist-client/pages/board-player-by-name-page.d.ts +0 -4
- package/dist-client/pages/board-player-by-name-page.js +0 -32
- package/dist-client/pages/board-player-by-name-page.js.map +0 -1
- package/dist-client/pages/board-player-page.d.ts +0 -42
- package/dist-client/pages/board-player-page.js +0 -230
- package/dist-client/pages/board-player-page.js.map +0 -1
- package/dist-client/pages/board-template/board-template-list-page.d.ts +0 -37
- package/dist-client/pages/board-template/board-template-list-page.js +0 -226
- package/dist-client/pages/board-template/board-template-list-page.js.map +0 -1
- package/dist-client/pages/board-viewer-by-name-page.d.ts +0 -4
- package/dist-client/pages/board-viewer-by-name-page.js +0 -27
- package/dist-client/pages/board-viewer-by-name-page.js.map +0 -1
- package/dist-client/pages/board-viewer-page.d.ts +0 -41
- package/dist-client/pages/board-viewer-page.js +0 -247
- package/dist-client/pages/board-viewer-page.js.map +0 -1
- package/dist-client/pages/font-list-page.d.ts +0 -9
- package/dist-client/pages/font-list-page.js +0 -31
- package/dist-client/pages/font-list-page.js.map +0 -1
- package/dist-client/pages/play-list-page.d.ts +0 -58
- package/dist-client/pages/play-list-page.js +0 -364
- package/dist-client/pages/play-list-page.js.map +0 -1
- package/dist-client/pages/printable-board-viewer-page.d.ts +0 -11
- package/dist-client/pages/printable-board-viewer-page.js +0 -43
- package/dist-client/pages/printable-board-viewer-page.js.map +0 -1
- package/dist-client/pages/theme/theme-editors.d.ts +0 -5
- package/dist-client/pages/theme/theme-editors.js +0 -53
- package/dist-client/pages/theme/theme-editors.js.map +0 -1
- package/dist-client/pages/theme/theme-list-page.d.ts +0 -49
- package/dist-client/pages/theme/theme-list-page.js +0 -318
- package/dist-client/pages/theme/theme-list-page.js.map +0 -1
- package/dist-client/pages/things-scene-components-with-tools.import +0 -0
- package/dist-client/pages/things-scene-components.import +0 -0
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -41
- package/dist-client/route.js.map +0 -1
- package/dist-client/setting-let/board-view-setting-let.d.ts +0 -14
- package/dist-client/setting-let/board-view-setting-let.js +0 -70
- package/dist-client/setting-let/board-view-setting-let.js.map +0 -1
- package/dist-client/themes/board-theme.css +0 -76
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/board-basic-info.d.ts +0 -47
- package/dist-client/viewparts/board-basic-info.js +0 -641
- package/dist-client/viewparts/board-basic-info.js.map +0 -1
- package/dist-client/viewparts/board-info-link.d.ts +0 -12
- package/dist-client/viewparts/board-info-link.js +0 -59
- package/dist-client/viewparts/board-info-link.js.map +0 -1
- package/dist-client/viewparts/board-info.d.ts +0 -14
- package/dist-client/viewparts/board-info.js +0 -94
- package/dist-client/viewparts/board-info.js.map +0 -1
- package/dist-client/viewparts/board-template-builder.d.ts +0 -16
- package/dist-client/viewparts/board-template-builder.js +0 -145
- package/dist-client/viewparts/board-template-builder.js.map +0 -1
- package/dist-client/viewparts/board-versions.d.ts +0 -12
- package/dist-client/viewparts/board-versions.js +0 -157
- package/dist-client/viewparts/board-versions.js.map +0 -1
- package/dist-client/viewparts/group-info-basic.d.ts +0 -16
- package/dist-client/viewparts/group-info-basic.js +0 -247
- package/dist-client/viewparts/group-info-basic.js.map +0 -1
- package/dist-client/viewparts/group-info-import.d.ts +0 -15
- package/dist-client/viewparts/group-info-import.js +0 -137
- package/dist-client/viewparts/group-info-import.js.map +0 -1
- package/dist-client/viewparts/group-info.d.ts +0 -10
- package/dist-client/viewparts/group-info.js +0 -92
- package/dist-client/viewparts/group-info.js.map +0 -1
- package/dist-client/viewparts/index.d.ts +0 -3
- package/dist-client/viewparts/index.js +0 -4
- package/dist-client/viewparts/index.js.map +0 -1
- package/dist-client/viewparts/link-builder.d.ts +0 -22
- package/dist-client/viewparts/link-builder.js +0 -217
- package/dist-client/viewparts/link-builder.js.map +0 -1
- package/dist-client/viewparts/play-group-info-basic.d.ts +0 -16
- package/dist-client/viewparts/play-group-info-basic.js +0 -249
- package/dist-client/viewparts/play-group-info-basic.js.map +0 -1
- package/dist-client/viewparts/play-group-info-link.d.ts +0 -10
- package/dist-client/viewparts/play-group-info-link.js +0 -48
- package/dist-client/viewparts/play-group-info-link.js.map +0 -1
- package/dist-client/viewparts/play-group-info.d.ts +0 -13
- package/dist-client/viewparts/play-group-info.js +0 -90
- package/dist-client/viewparts/play-group-info.js.map +0 -1
- package/dist-server/index.js +0 -5
- package/dist-server/index.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
|
@@ -145,7 +145,7 @@ export class BoardPlayerPage extends connect(store)(PageView) {
|
|
|
145
145
|
this.showSpinner = false
|
|
146
146
|
this.updateContext()
|
|
147
147
|
|
|
148
|
-
const { autoRefresh =
|
|
148
|
+
const { autoRefresh = true } = (await clientSettingStore.get('board-view'))?.value || {}
|
|
149
149
|
autoRefresh && this.startSubscribingForAutoRefresh()
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -94,9 +94,7 @@ export class BoardViewerPage extends connect(store)(PageView) {
|
|
|
94
94
|
get context() {
|
|
95
95
|
return {
|
|
96
96
|
/* can set the page title with the 'title' parameter. */
|
|
97
|
-
title:
|
|
98
|
-
this.lifecycle.params['title'] ||
|
|
99
|
-
(this._board ? this._board.name : this._showSpinner ? 'Fetching board...' : 'Board Not Found')
|
|
97
|
+
title: this.lifecycle.params['title'] || (this._board ? this._board.name : this._showSpinner ? 'Fetching board...' : 'Board Not Found')
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
|
|
@@ -203,7 +201,7 @@ export class BoardViewerPage extends connect(store)(PageView) {
|
|
|
203
201
|
this._showSpinner = false
|
|
204
202
|
this.updateContext()
|
|
205
203
|
|
|
206
|
-
const { autoRefresh =
|
|
204
|
+
const { autoRefresh = true } = (await clientSettingStore.get('board-view'))?.value || {}
|
|
207
205
|
autoRefresh && this.startSubscribingForAutoRefresh()
|
|
208
206
|
}
|
|
209
207
|
}
|
|
@@ -30,11 +30,7 @@ export class BoardViewSettingLet extends localize(i18next)(LitElement) {
|
|
|
30
30
|
|
|
31
31
|
<div slot="content">
|
|
32
32
|
<mwc-formfield label=${String(i18next.t('label.auto refresh board view'))}>
|
|
33
|
-
<mwc-checkbox
|
|
34
|
-
id="auto-refresh"
|
|
35
|
-
@change=${e => this.onChange(e)}
|
|
36
|
-
?checked=${this.autoRefresh}
|
|
37
|
-
></mwc-checkbox>
|
|
33
|
+
<mwc-checkbox id="auto-refresh" @change=${e => this.onChange(e)} ?checked=${this.autoRefresh}></mwc-checkbox>
|
|
38
34
|
</mwc-formfield>
|
|
39
35
|
</div>
|
|
40
36
|
</setting-let>
|
|
@@ -42,7 +38,7 @@ export class BoardViewSettingLet extends localize(i18next)(LitElement) {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
async firstUpdated() {
|
|
45
|
-
const { autoRefresh =
|
|
41
|
+
const { autoRefresh = true } = (await clientSettingStore.get('board-view'))?.value || {}
|
|
46
42
|
this.autoRefresh = autoRefresh
|
|
47
43
|
}
|
|
48
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/board-ui",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.102",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@operato/shell": "^1.0.0",
|
|
44
44
|
"@operato/styles": "^1.0.0",
|
|
45
45
|
"@operato/utils": "^1.0.0",
|
|
46
|
-
"@things-factory/barcode-base": "^6.2.
|
|
47
|
-
"@things-factory/fav-base": "^6.2.
|
|
46
|
+
"@things-factory/barcode-base": "^6.2.101",
|
|
47
|
+
"@things-factory/fav-base": "^6.2.101",
|
|
48
48
|
"@things-factory/utils": "^6.2.96"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "de7dc909722996bd44373ef2a8ad2e6f5a0b88d6"
|
|
51
51
|
}
|
package/translations/en.json
CHANGED
|
@@ -643,6 +643,7 @@
|
|
|
643
643
|
"text.reorder play-group": "play-group '{playGroup}' is reordered successfully",
|
|
644
644
|
"text.request-role-success": "Role requested and admin will check it at e-mail.",
|
|
645
645
|
"text.required_error": "Value Required.",
|
|
646
|
+
"text.saved": "saved",
|
|
646
647
|
"text.search with type, id or tag": "search with type, id or tag",
|
|
647
648
|
"text.select_file": "Select File",
|
|
648
649
|
"text.Server Processing": "Server Processing ...",
|
package/translations/ja.json
CHANGED
|
@@ -647,6 +647,7 @@
|
|
|
647
647
|
"text.reorder play-group": "プレイグループ''{playGroup}'は正常に並べ替えられました",
|
|
648
648
|
"text.request-role-success": "要請した権限はシステム管理者に要請されました.",
|
|
649
649
|
"text.required_error": "必ず値を入力してください.",
|
|
650
|
+
"text.saved": "保存された",
|
|
650
651
|
"text.search with type, id or tag": "タイプ, IDまたはタグ名で検索",
|
|
651
652
|
"text.select_file": "ファイルを選択してください",
|
|
652
653
|
"text.Server Processing": "処理中です..",
|
package/translations/ko.json
CHANGED
|
@@ -647,6 +647,7 @@
|
|
|
647
647
|
"text.reorder play-group": "플레이그룹 '{playGroup}'이 재정열되었습니다",
|
|
648
648
|
"text.request-role-success": "요청한 권한은 시스템 관리자에게 요청되었습니다.",
|
|
649
649
|
"text.required_error": "반드시 값을 입력해야 합니다.",
|
|
650
|
+
"text.saved": "저장되었습니다",
|
|
650
651
|
"text.search with type, id or tag": "타입, 아이디 또는 태그이름으로 검색",
|
|
651
652
|
"text.select_file": "파일을 선택하세요",
|
|
652
653
|
"text.Server Processing": "처리 중 입니다 ..",
|
package/translations/ms.json
CHANGED
|
@@ -380,7 +380,6 @@
|
|
|
380
380
|
"label.right": "Kanan",
|
|
381
381
|
"label.row": "Baris",
|
|
382
382
|
"label.save_changes": "Simpan Perubahan",
|
|
383
|
-
"label.saved": "Disimpan",
|
|
384
383
|
"label.search": "Cari",
|
|
385
384
|
"label.search_hint": "Petunjuk Carian",
|
|
386
385
|
"label.secondary_color": "Warna Sekunder",
|
|
@@ -527,6 +526,7 @@
|
|
|
527
526
|
"text.reorder play-group": "play-group '{playGroup}' telah berjaya diatur semula",
|
|
528
527
|
"text.register-template": "daftar templat",
|
|
529
528
|
"text.save": "Simpan",
|
|
529
|
+
"text.saved": "Disimpan",
|
|
530
530
|
"text.saving": "Menyimpan...",
|
|
531
531
|
"text.select_option": "Pilih satu pilihan",
|
|
532
532
|
"text.server_error": "Ralat pelayan. Sila cuba lagi kemudian.",
|
package/translations/zh.json
CHANGED
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"label.auth": "权限",
|
|
126
126
|
"label.auth-domain": "验证域",
|
|
127
127
|
"label.authorization": "授权",
|
|
128
|
-
"label.auto
|
|
128
|
+
"label.auto-refresh-board-view": "自动刷新看板视图",
|
|
129
129
|
"label.auto-rotate": "自动旋转",
|
|
130
130
|
"label.autoplay": "自动播放",
|
|
131
131
|
"label.axes": "轴",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"label.cl-border-width": "中间线宽度",
|
|
165
165
|
"label.class": "分组",
|
|
166
166
|
"label.client-id": "客户端ID",
|
|
167
|
-
"label.closable": "
|
|
167
|
+
"label.closable": "可关闭功能",
|
|
168
168
|
"label.color": "颜色",
|
|
169
169
|
"label.color-stops": "色站",
|
|
170
170
|
"label.columns": "列",
|
|
@@ -634,7 +634,7 @@
|
|
|
634
634
|
"text.play-group created": "播放组 '{playGroup}' 创建成功",
|
|
635
635
|
"text.play-group deleted": "播放组 '{playGroup}' 删除成功",
|
|
636
636
|
"text.play-group updated": "播放组 '{playGroup}' 更新成功",
|
|
637
|
-
"text.please_wait": "
|
|
637
|
+
"text.please_wait": "正在处理,请稍候。",
|
|
638
638
|
"text.pls-name-board": "Type board name",
|
|
639
639
|
"text.processing_file": "进行中。。。",
|
|
640
640
|
"text.processing_msg": "请求处理中。",
|
|
@@ -646,7 +646,8 @@
|
|
|
646
646
|
"text.reorder play-group": "播放组 '{playGroup}' 已成功重新排序",
|
|
647
647
|
"text.request-role-success": "角色申请成功。",
|
|
648
648
|
"text.required_error": "必需输入数据。",
|
|
649
|
-
"text.
|
|
649
|
+
"text.saved": "已保存",
|
|
650
|
+
"text.search with type, id or tag": "通过类型、ID或标签名搜索",
|
|
650
651
|
"text.select_file": "选择文件",
|
|
651
652
|
"text.Server Processing": "执行服务中..",
|
|
652
653
|
"text.server_unavailable": "服务器无法链接",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-icon';
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
|
-
declare const FavoriteTool_base: (new (...args: any[]) => {
|
|
4
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
disconnectedCallback(): void;
|
|
7
|
-
stateChanged(_state: unknown): void;
|
|
8
|
-
readonly isConnected: boolean;
|
|
9
|
-
}) & typeof LitElement;
|
|
10
|
-
export declare class FavoriteTool extends FavoriteTool_base {
|
|
11
|
-
static styles: import("lit").CSSResult;
|
|
12
|
-
favorites: any[];
|
|
13
|
-
user: any;
|
|
14
|
-
resourceId?: string;
|
|
15
|
-
favored?: boolean;
|
|
16
|
-
acceptedPages: any[];
|
|
17
|
-
page: any;
|
|
18
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
19
|
-
updated(changes: any): void;
|
|
20
|
-
stateChanged(state: any): void;
|
|
21
|
-
onClick(event: any): void;
|
|
22
|
-
refreshFavorites(): Promise<void>;
|
|
23
|
-
removeFavorite(routing: any): Promise<void>;
|
|
24
|
-
addFavorite(routing: any): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import gql from 'graphql-tag';
|
|
4
|
-
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
-
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
7
|
-
import { store } from '@operato/shell';
|
|
8
|
-
import { client } from '@operato/graphql';
|
|
9
|
-
import { UPDATE_FAVORITES } from '@things-factory/fav-base';
|
|
10
|
-
let FavoriteTool = class FavoriteTool extends connect(store)(LitElement) {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.favorites = [];
|
|
14
|
-
this.acceptedPages = [];
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
var renderable = (this.acceptedPages || []).indexOf(this.page) !== -1;
|
|
18
|
-
return renderable
|
|
19
|
-
? html `
|
|
20
|
-
<mwc-icon @click=${this.onClick.bind(this)} ?favorable=${!this.favored}
|
|
21
|
-
>${this.favored ? 'star' : 'star_border'}</mwc-icon
|
|
22
|
-
>
|
|
23
|
-
`
|
|
24
|
-
: html ``;
|
|
25
|
-
}
|
|
26
|
-
updated(changes) {
|
|
27
|
-
if (changes.has('user')) {
|
|
28
|
-
this.refreshFavorites();
|
|
29
|
-
}
|
|
30
|
-
this.favored = (this.favorites || []).includes(this.resourceId);
|
|
31
|
-
}
|
|
32
|
-
stateChanged(state) {
|
|
33
|
-
this.page = state.route.page;
|
|
34
|
-
this.favorites = state.favorite.favorites;
|
|
35
|
-
this.user = state.auth.user;
|
|
36
|
-
this.resourceId = state.route.resourceId;
|
|
37
|
-
}
|
|
38
|
-
onClick(event) {
|
|
39
|
-
if (!this.resourceId) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (this.favored) {
|
|
43
|
-
this.removeFavorite(this.resourceId);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.addFavorite(this.resourceId);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
async refreshFavorites() {
|
|
50
|
-
if (!this.user || !this.user.email) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const response = await client.query({
|
|
54
|
-
query: gql `
|
|
55
|
-
query {
|
|
56
|
-
myFavorites {
|
|
57
|
-
id
|
|
58
|
-
routing
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
`
|
|
62
|
-
});
|
|
63
|
-
store.dispatch({
|
|
64
|
-
type: UPDATE_FAVORITES,
|
|
65
|
-
favorites: response.data.myFavorites.map(favorite => favorite.routing)
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async removeFavorite(routing) {
|
|
69
|
-
await client.query({
|
|
70
|
-
query: gql `
|
|
71
|
-
mutation {
|
|
72
|
-
deleteFavorite(routing: "${routing}")
|
|
73
|
-
}
|
|
74
|
-
`
|
|
75
|
-
});
|
|
76
|
-
this.refreshFavorites();
|
|
77
|
-
}
|
|
78
|
-
async addFavorite(routing) {
|
|
79
|
-
await client.query({
|
|
80
|
-
query: gql `
|
|
81
|
-
mutation {
|
|
82
|
-
createFavorite(favorite: {
|
|
83
|
-
routing: "${routing}"
|
|
84
|
-
}) {
|
|
85
|
-
id
|
|
86
|
-
routing
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`
|
|
90
|
-
});
|
|
91
|
-
this.refreshFavorites();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
FavoriteTool.styles = css `
|
|
95
|
-
:host {
|
|
96
|
-
display: inline-block;
|
|
97
|
-
vertical-align: middle;
|
|
98
|
-
line-height: 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[favorable] {
|
|
102
|
-
opacity: 0.5;
|
|
103
|
-
}
|
|
104
|
-
`;
|
|
105
|
-
__decorate([
|
|
106
|
-
property({ type: Array }),
|
|
107
|
-
__metadata("design:type", Array)
|
|
108
|
-
], FavoriteTool.prototype, "favorites", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
property({ type: Object }),
|
|
111
|
-
__metadata("design:type", Object)
|
|
112
|
-
], FavoriteTool.prototype, "user", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
property({ type: String }),
|
|
115
|
-
__metadata("design:type", String)
|
|
116
|
-
], FavoriteTool.prototype, "resourceId", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
property({ type: Boolean }),
|
|
119
|
-
__metadata("design:type", Boolean)
|
|
120
|
-
], FavoriteTool.prototype, "favored", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Array }),
|
|
123
|
-
__metadata("design:type", Array)
|
|
124
|
-
], FavoriteTool.prototype, "acceptedPages", void 0);
|
|
125
|
-
FavoriteTool = __decorate([
|
|
126
|
-
customElement('favorite-tool')
|
|
127
|
-
], FavoriteTool);
|
|
128
|
-
export { FavoriteTool };
|
|
129
|
-
//# sourceMappingURL=favorite-tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"favorite-tool.js","sourceRoot":"","sources":["../../client/apptools/favorite-tool.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAGpD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAArD;;QAasB,cAAS,GAAU,EAAE,CAAA;QAIrB,kBAAa,GAAU,EAAE,CAAA;IA6FtD,CAAC;IAzFC,MAAM;QACJ,IAAI,UAAU,GAAG,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;QAErE,OAAO,UAAU;YACf,CAAC,CAAC,IAAI,CAAA;6BACiB,IAAI,CAAC,OAAO,CAAC,IAAI,C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AC,CAAA;QAEF,KAAK,CAAC,QAAQ,CAAC;YACb,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;SACvE,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAO;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,GAAG,CAAA;;qCAEqB,OAAO;;OAErC;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAO;QACvB,MAAM,MAAM,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,GAAG,CAAA;;;wBAGQ,OAAO;;;;;;OAMxB;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACzB,CAAC;;AA5GM,mBAAM,GAAG,GAAG,CAAA;;;;;;;;;;GAUlB,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;+CAAsB;AAChD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAU;AACrC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAoB;AAC/C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;6CAAkB;AAC9C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;mDAA0B;AAjBzC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8GxB;SA9GY,YAAY","sourcesContent":["import '@material/mwc-icon'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { store } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { UPDATE_FAVORITES } from '@things-factory/fav-base'\n\n@customElement('favorite-tool')\nexport class FavoriteTool extends connect(store)(LitElement) {\n static styles = css`\n :host {\n display: inline-block;\n vertical-align: middle;\n line-height: 0;\n }\n\n [favorable] {\n opacity: 0.5;\n }\n `\n\n @property({ type: Array }) favorites: any[] = []\n @property({ type: Object }) user: any\n @property({ type: String }) resourceId?: string\n @property({ type: Boolean }) favored?: boolean\n @property({ type: Array }) acceptedPages: any[] = []\n\n page: any\n\n render() {\n var renderable = (this.acceptedPages || []).indexOf(this.page) !== -1\n\n return renderable\n ? html`\n <mwc-icon @click=${this.onClick.bind(this)} ?favorable=${!this.favored}\n >${this.favored ? 'star' : 'star_border'}</mwc-icon\n >\n `\n : html``\n }\n\n updated(changes) {\n if (changes.has('user')) {\n this.refreshFavorites()\n }\n\n this.favored = (this.favorites || []).includes(this.resourceId)\n }\n\n stateChanged(state) {\n this.page = state.route.page\n this.favorites = state.favorite.favorites\n this.user = state.auth.user\n this.resourceId = state.route.resourceId\n }\n\n onClick(event) {\n if (!this.resourceId) {\n return\n }\n\n if (this.favored) {\n this.removeFavorite(this.resourceId)\n } else {\n this.addFavorite(this.resourceId)\n }\n }\n\n async refreshFavorites() {\n if (!this.user || !this.user.email) {\n return\n }\n\n const response = await client.query({\n query: gql`\n query {\n myFavorites {\n id\n routing\n }\n }\n `\n })\n\n store.dispatch({\n type: UPDATE_FAVORITES,\n favorites: response.data.myFavorites.map(favorite => favorite.routing)\n })\n }\n\n async removeFavorite(routing) {\n await client.query({\n query: gql`\n mutation {\n deleteFavorite(routing: \"${routing}\")\n }\n `\n })\n\n this.refreshFavorites()\n }\n\n async addFavorite(routing) {\n await client.query({\n query: gql`\n mutation {\n createFavorite(favorite: {\n routing: \"${routing}\"\n }) {\n id\n routing\n }\n }\n `\n })\n\n this.refreshFavorites()\n }\n}\n"]}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import '@operato/board/ox-board-viewer.js';
|
|
2
|
-
function setHighlightStyle(dropArea) {
|
|
3
|
-
var style = document.createElement('style');
|
|
4
|
-
style.type = 'text/css';
|
|
5
|
-
style.innerHTML = `.highlight_me {
|
|
6
|
-
background: orange;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
}`;
|
|
9
|
-
dropArea.appendChild(style);
|
|
10
|
-
}
|
|
11
|
-
export default class BoardImporter {
|
|
12
|
-
static import(file, importer) {
|
|
13
|
-
let reader = new FileReader();
|
|
14
|
-
reader.readAsText(file);
|
|
15
|
-
reader.onloadend = () => {
|
|
16
|
-
try {
|
|
17
|
-
let model = JSON.parse(reader.result);
|
|
18
|
-
importer(file.name.replace(/\.[^/.]+$/, ''), model);
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
console.error('board import failed', e);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
static preview(file) {
|
|
26
|
-
let reader = new FileReader();
|
|
27
|
-
reader.readAsText(file);
|
|
28
|
-
reader.onloadend = () => {
|
|
29
|
-
try {
|
|
30
|
-
let previewModel = JSON.parse(reader.result);
|
|
31
|
-
var preview = document.createElement('ox-board-viewer');
|
|
32
|
-
preview.style.width = '100%';
|
|
33
|
-
preview.style.height = '80%';
|
|
34
|
-
preview.style.margin = '0';
|
|
35
|
-
preview.style.padding = '0';
|
|
36
|
-
// TODO how to hand over model to previewer
|
|
37
|
-
// preview.model = previewModel
|
|
38
|
-
// preview.provider = provider;
|
|
39
|
-
var buttons = document.createElement('div');
|
|
40
|
-
buttons.className = 'buttons';
|
|
41
|
-
buttons.innerHTML = `
|
|
42
|
-
<paper-button dialog-dismiss>Cancel</paper-button>
|
|
43
|
-
<paper-button dialog-confirm autofocus>Accept</paper-button>
|
|
44
|
-
`;
|
|
45
|
-
var dialog = document.createElement('paper-dialog');
|
|
46
|
-
dialog.style.width = '100%';
|
|
47
|
-
dialog.style.height = '100%';
|
|
48
|
-
dialog.setAttribute('with-backdrop', 'true');
|
|
49
|
-
dialog.setAttribute('auto-fit-on-attach', 'true');
|
|
50
|
-
dialog.setAttribute('always-on-top', 'true');
|
|
51
|
-
dialog.addEventListener('iron-overlay-closed', () => {
|
|
52
|
-
dialog.parentNode.removeChild(dialog);
|
|
53
|
-
});
|
|
54
|
-
dialog.appendChild(preview);
|
|
55
|
-
dialog.appendChild(buttons);
|
|
56
|
-
document.body.appendChild(dialog);
|
|
57
|
-
requestAnimationFrame(() => {
|
|
58
|
-
;
|
|
59
|
-
dialog.open();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.error('board preview failed', e);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
// let url = 'YOUR URL HERE'
|
|
67
|
-
// let formData = new FormData()
|
|
68
|
-
// formData.append('file', file)
|
|
69
|
-
// fetch(url, {
|
|
70
|
-
// method: 'POST',
|
|
71
|
-
// body: formData
|
|
72
|
-
// })
|
|
73
|
-
// .then(() => { /* Done. Inform the user */ })
|
|
74
|
-
// .catch(() => { /* Error. Inform the user */ })
|
|
75
|
-
}
|
|
76
|
-
static set(dropArea, judge, importer) {
|
|
77
|
-
setHighlightStyle(dropArea);
|
|
78
|
-
var preventDefaults = e => {
|
|
79
|
-
if (!judge || judge()) {
|
|
80
|
-
e.preventDefault();
|
|
81
|
-
e.stopPropagation();
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
var highlight = e => {
|
|
85
|
-
if (!judge || judge()) {
|
|
86
|
-
dropArea.classList.add('highlight_me');
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
var unhighlight = e => {
|
|
90
|
-
if (!judge || judge()) {
|
|
91
|
-
dropArea.classList.remove('highlight_me');
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(event => {
|
|
95
|
-
dropArea.addEventListener(event, preventDefaults, false);
|
|
96
|
-
});
|
|
97
|
-
['dragenter', 'dragover'].forEach(event => {
|
|
98
|
-
dropArea.addEventListener(event, highlight, false);
|
|
99
|
-
});
|
|
100
|
-
['dragleave', 'drop'].forEach(event => {
|
|
101
|
-
dropArea.addEventListener(event, unhighlight, false);
|
|
102
|
-
});
|
|
103
|
-
dropArea.addEventListener('drop', e => {
|
|
104
|
-
if (!judge || judge()) {
|
|
105
|
-
let dt = e.dataTransfer;
|
|
106
|
-
let files = dt.files;
|
|
107
|
-
[...files].forEach(file => BoardImporter.import(file, importer));
|
|
108
|
-
}
|
|
109
|
-
}, false);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=board-importer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"board-importer.js","sourceRoot":"","sources":["../../client/board-list/board-importer.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAA;AAI1C,SAAS,iBAAiB,CAAC,QAAQ;IACjC,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAE3C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAA;IACvB,KAAK,CAAC,SAAS,GAAG;;;IAGhB,CAAA;IAEF,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ;QAC1B,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA;QAC7B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QACvB,MAAM,CAAC,SAAS,GAAG,GAAG,EAAE;YACtB,IAAI;gBACF,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAa,CAAC,CAAA;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;aACpD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,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;aAC1C;QACH,CAAC,CAEA;QAAA,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC9D,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,CAAA;QAC1D,CAAC,CAAC,CACD;QAAA,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;QACpD,CAAC,CAAC,CACD;QAAA,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACrC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,gBAAgB,CACvB,MAAM,EACN,CAAC,CAAC,EAAE;YACF,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,IAAI,EAAE,GAAG,CAAC,CAAC,YAAY,CAAA;gBACvB,IAAI,KAAK,GAAG,EAAE,CAAC,KAAK,CAGnB;gBAAA,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;aAClE;QACH,CAAC,EACD,KAAK,CACN,CAAA;IACH,CAAC;CACF","sourcesContent":["import '@operato/board/ox-board-viewer.js'\n\nimport { BoardViewer } from '@operato/board/ox-board-viewer.js'\n\nfunction setHighlightStyle(dropArea) {\n var style = document.createElement('style')\n\n style.type = 'text/css'\n style.innerHTML = `.highlight_me {\n background: orange;\n cursor: pointer;\n }`\n\n dropArea.appendChild(style)\n}\n\nexport default class BoardImporter {\n static import(file, importer) {\n let reader = new FileReader()\n reader.readAsText(file)\n reader.onloadend = () => {\n try {\n let model = JSON.parse(reader.result as any)\n importer(file.name.replace(/\\.[^/.]+$/, ''), model)\n } catch (e) {\n console.error('board import failed', e)\n }\n }\n }\n\n static preview(file) {\n let reader = new FileReader()\n reader.readAsText(file)\n reader.onloadend = () => {\n try {\n let previewModel = JSON.parse(reader.result as any)\n\n var preview = document.createElement('ox-board-viewer') as BoardViewer\n\n preview.style.width = '100%'\n preview.style.height = '80%'\n preview.style.margin = '0'\n preview.style.padding = '0'\n\n // TODO how to hand over model to previewer\n // preview.model = previewModel\n // preview.provider = provider;\n\n var buttons = document.createElement('div')\n\n buttons.className = 'buttons'\n buttons.innerHTML = `\n <paper-button dialog-dismiss>Cancel</paper-button>\n <paper-button dialog-confirm autofocus>Accept</paper-button>\n `\n\n var dialog = document.createElement('paper-dialog')\n\n dialog.style.width = '100%'\n dialog.style.height = '100%'\n dialog.setAttribute('with-backdrop', 'true')\n dialog.setAttribute('auto-fit-on-attach', 'true')\n dialog.setAttribute('always-on-top', 'true')\n dialog.addEventListener('iron-overlay-closed', () => {\n dialog.parentNode!.removeChild(dialog)\n })\n\n dialog.appendChild(preview)\n dialog.appendChild(buttons)\n document.body.appendChild(dialog)\n\n requestAnimationFrame(() => {\n ;(dialog as any).open()\n })\n } catch (e) {\n console.error('board preview failed', e)\n }\n }\n // let url = 'YOUR URL HERE'\n // let formData = new FormData()\n\n // formData.append('file', file)\n\n // fetch(url, {\n // method: 'POST',\n // body: formData\n // })\n // .then(() => { /* Done. Inform the user */ })\n // .catch(() => { /* Error. Inform the user */ })\n }\n\n static set(dropArea, judge, importer) {\n setHighlightStyle(dropArea)\n\n var preventDefaults = e => {\n if (!judge || judge()) {\n e.preventDefault()\n e.stopPropagation()\n }\n }\n\n var highlight = e => {\n if (!judge || judge()) {\n dropArea.classList.add('highlight_me')\n }\n }\n\n var unhighlight = e => {\n if (!judge || judge()) {\n dropArea.classList.remove('highlight_me')\n }\n }\n\n ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(event => {\n dropArea.addEventListener(event, preventDefaults, false)\n })\n ;['dragenter', 'dragover'].forEach(event => {\n dropArea.addEventListener(event, highlight, false)\n })\n ;['dragleave', 'drop'].forEach(event => {\n dropArea.addEventListener(event, unhighlight, false)\n })\n\n dropArea.addEventListener(\n 'drop',\n e => {\n if (!judge || judge()) {\n let dt = e.dataTransfer\n let files = dt.files\n\n // [...files].forEach((file) => BoardImporter.preview(file))\n ;[...files].forEach(file => BoardImporter.import(file, importer))\n }\n },\n false\n )\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import '@operato/board/ox-board-creation-card.js';
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
-
export declare class BoardTileList extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
boards: any[];
|
|
7
|
-
favorites: any[];
|
|
8
|
-
groups: any[];
|
|
9
|
-
group?: string;
|
|
10
|
-
creatable?: boolean;
|
|
11
|
-
searchText?: string;
|
|
12
|
-
reorderable: boolean;
|
|
13
|
-
private draggedItem;
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
-
updated(changes: PropertyValues<this>): void;
|
|
17
|
-
onCreateBoard(e: any): void;
|
|
18
|
-
infoBoard(board: any): void;
|
|
19
|
-
removeFavorite(boardId: any): Promise<void>;
|
|
20
|
-
addFavorite(boardId: any): Promise<void>;
|
|
21
|
-
refreshFavorites(): Promise<void>;
|
|
22
|
-
}
|