@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
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import '@operato/font';
|
|
3
|
-
import { css, html } from 'lit';
|
|
4
|
-
import { customElement } from 'lit/decorators.js';
|
|
5
|
-
import { PageView } from '@operato/shell';
|
|
6
|
-
let FontListPage = class FontListPage extends PageView {
|
|
7
|
-
get context() {
|
|
8
|
-
return {
|
|
9
|
-
title: 'font list'
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
return html ` <font-selector .creatable=${true}></font-selector> `;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
FontListPage.styles = [
|
|
17
|
-
css `
|
|
18
|
-
:host {
|
|
19
|
-
display: flex;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
font-selector {
|
|
23
|
-
flex: 1;
|
|
24
|
-
}
|
|
25
|
-
`
|
|
26
|
-
];
|
|
27
|
-
FontListPage = __decorate([
|
|
28
|
-
customElement('font-list-page')
|
|
29
|
-
], FontListPage);
|
|
30
|
-
export { FontListPage };
|
|
31
|
-
//# sourceMappingURL=font-list-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"font-list-page.js","sourceRoot":"","sources":["../../client/pages/font-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,eAAe,CAAA;AAEtB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAGlC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,QAAQ;IAaxC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,WAAW;SACnB,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,8BAA8B,IAAI,oBAAoB,CAAA;IACnE,CAAC;;AApBM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;KAQF;CACF,CAAA;AAXU,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAsBxB;SAtBY,YAAY","sourcesContent":["import '@operato/font'\n\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { PageView } from '@operato/shell'\n\n@customElement('font-list-page')\nexport class FontListPage extends PageView {\n static styles = [\n css`\n :host {\n display: flex;\n }\n\n font-selector {\n flex: 1;\n }\n `\n ]\n\n get context() {\n return {\n title: 'font list'\n }\n }\n\n render() {\n return html` <font-selector .creatable=${true}></font-selector> `\n }\n}\n"]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-fab';
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import '../viewparts/play-group-info';
|
|
4
|
-
import '../board-list/board-tile-list';
|
|
5
|
-
import '../board-list/play-group-bar';
|
|
6
|
-
import { PageView } from '@operato/shell';
|
|
7
|
-
declare const PlayListPage_base: (new (...args: any[]) => import("lit").LitElement) & (new (...args: any[]) => {
|
|
8
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
9
|
-
connectedCallback(): void;
|
|
10
|
-
disconnectedCallback(): void;
|
|
11
|
-
stateChanged(_state: unknown): void;
|
|
12
|
-
readonly isConnected: boolean;
|
|
13
|
-
}) & typeof PageView;
|
|
14
|
-
export declare class PlayListPage extends PlayListPage_base {
|
|
15
|
-
static styles: import("lit").CSSResult[];
|
|
16
|
-
groupId?: string;
|
|
17
|
-
groups: any[];
|
|
18
|
-
boards: any[];
|
|
19
|
-
favorites: any[];
|
|
20
|
-
boardTileList: HTMLElement;
|
|
21
|
-
private page?;
|
|
22
|
-
get context(): {
|
|
23
|
-
title: {
|
|
24
|
-
icon: string;
|
|
25
|
-
text: any;
|
|
26
|
-
};
|
|
27
|
-
board_topmenu: boolean;
|
|
28
|
-
};
|
|
29
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
30
|
-
refresh(): Promise<void>;
|
|
31
|
-
refreshBoards(): Promise<void>;
|
|
32
|
-
pageInitialized(): Promise<void>;
|
|
33
|
-
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
34
|
-
stateChanged(state: any): void;
|
|
35
|
-
firstUpdated(): void;
|
|
36
|
-
onInfoBoard(board: any): Promise<void>;
|
|
37
|
-
onInfoPlayGroup(group: any): Promise<void>;
|
|
38
|
-
onCreatePlayGroup(playGroup: any): Promise<void>;
|
|
39
|
-
onUpdatePlayGroup(playGroup: any): Promise<void>;
|
|
40
|
-
onDeletePlayGroup(playGroup: any): Promise<void>;
|
|
41
|
-
onUpdateBoard(board: any): Promise<void>;
|
|
42
|
-
onDeleteBoard(board: any): Promise<void>;
|
|
43
|
-
onJoinPlayGroup({ board, playGroup }: {
|
|
44
|
-
board: any;
|
|
45
|
-
playGroup: any;
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
onLeavePlayGroup({ board, playGroup }: {
|
|
48
|
-
board: any;
|
|
49
|
-
playGroup: any;
|
|
50
|
-
}): Promise<void>;
|
|
51
|
-
onReorder({ boardIds, groupId }: {
|
|
52
|
-
boardIds: any;
|
|
53
|
-
groupId: any;
|
|
54
|
-
}): Promise<void>;
|
|
55
|
-
refreshFavorites(): Promise<void>;
|
|
56
|
-
_notify(level: 'info' | 'warn' | 'error', message: any, ex?: any): void;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/mwc-fab';
|
|
3
|
-
import '@material/mwc-icon';
|
|
4
|
-
import '../viewparts/play-group-info';
|
|
5
|
-
import '../board-list/board-tile-list';
|
|
6
|
-
import '../board-list/play-group-bar';
|
|
7
|
-
import gql from 'graphql-tag';
|
|
8
|
-
import { css, html } from 'lit';
|
|
9
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
10
|
-
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
11
|
-
import { UPDATE_FAVORITES } from '@things-factory/fav-base';
|
|
12
|
-
import { openOverlay } from '@operato/layout';
|
|
13
|
-
import { navigate, PageView, store } from '@operato/shell';
|
|
14
|
-
import { client } from '@operato/graphql';
|
|
15
|
-
import { i18next, localize } from '@operato/i18n';
|
|
16
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
17
|
-
import { pulltorefresh } from '@operato/pull-to-refresh';
|
|
18
|
-
import { swipe, isMobileDevice } from '@things-factory/utils';
|
|
19
|
-
import { createPlayGroup, deletePlayGroup, fetchPlayGroup, fetchPlayGroupList, updateBoard, updatePlayGroup } from '../graphql';
|
|
20
|
-
let PlayListPage = class PlayListPage extends localize(i18next)(connect(store)(PageView)) {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.groups = [];
|
|
24
|
-
this.boards = [];
|
|
25
|
-
this.favorites = [];
|
|
26
|
-
}
|
|
27
|
-
get context() {
|
|
28
|
-
var group = this.groups && this.groups.find(group => group.id === this.groupId);
|
|
29
|
-
return {
|
|
30
|
-
title: {
|
|
31
|
-
icon: 'video_library',
|
|
32
|
-
text: group ? group.name : 'Play List'
|
|
33
|
-
},
|
|
34
|
-
board_topmenu: true
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
return html `
|
|
39
|
-
<play-group-bar
|
|
40
|
-
.groups=${this.groups}
|
|
41
|
-
.groupId=${this.groupId}
|
|
42
|
-
target-page="play-list"
|
|
43
|
-
@info-play-group=${e => this.onInfoPlayGroup(e.detail)}
|
|
44
|
-
></play-group-bar>
|
|
45
|
-
|
|
46
|
-
<board-tile-list
|
|
47
|
-
.favorites=${this.favorites}
|
|
48
|
-
.boards=${this.boards}
|
|
49
|
-
.group=${this.groupId}
|
|
50
|
-
@info-board=${e => this.onInfoBoard(e.detail)}
|
|
51
|
-
@delete-board=${e => this.onDeleteBoard(e.detail)}
|
|
52
|
-
@refresh-favorites=${e => this.refreshFavorites()}
|
|
53
|
-
@reordered=${e => this.onReorder(e.detail)}
|
|
54
|
-
reorderable
|
|
55
|
-
></board-tile-list>
|
|
56
|
-
|
|
57
|
-
<a id="play" .href=${'board-player/' + this.groupId}>
|
|
58
|
-
<mwc-fab icon="play_arrow" title="play"> </mwc-fab>
|
|
59
|
-
</a>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
async refresh() {
|
|
63
|
-
this.groups = (await fetchPlayGroupList()).playGroups.items;
|
|
64
|
-
this.groups && (await this.refreshBoards());
|
|
65
|
-
}
|
|
66
|
-
async refreshBoards() {
|
|
67
|
-
if (!this.groups) {
|
|
68
|
-
await this.refresh();
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (!this.groupId) {
|
|
72
|
-
let groupId = this.groups && this.groups[0] && this.groups[0].id;
|
|
73
|
-
var newURL = new URL(window.location.href);
|
|
74
|
-
newURL.pathname += `/${groupId}`;
|
|
75
|
-
if (groupId) {
|
|
76
|
-
navigate(newURL.href, true);
|
|
77
|
-
}
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (this.groupId) {
|
|
81
|
-
var playGroup = (await fetchPlayGroup(this.groupId)).playGroup;
|
|
82
|
-
this.boards = playGroup ? playGroup.boards : [];
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
this.boards = [];
|
|
86
|
-
}
|
|
87
|
-
this.updateContext();
|
|
88
|
-
var list = this.boardTileList;
|
|
89
|
-
list.style.transition = '';
|
|
90
|
-
list.style.transform = `translate3d(0, 0, 0)`;
|
|
91
|
-
}
|
|
92
|
-
async pageInitialized() {
|
|
93
|
-
this.refresh();
|
|
94
|
-
}
|
|
95
|
-
async pageUpdated(changes, lifecycle) {
|
|
96
|
-
if (this.active) {
|
|
97
|
-
this.page = lifecycle.page;
|
|
98
|
-
this.groupId = lifecycle.resourceId;
|
|
99
|
-
await this.updateComplete;
|
|
100
|
-
this.refreshBoards();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
stateChanged(state) {
|
|
104
|
-
this.favorites = state.favorite.favorites;
|
|
105
|
-
}
|
|
106
|
-
firstUpdated() {
|
|
107
|
-
var list = this.boardTileList;
|
|
108
|
-
pulltorefresh({
|
|
109
|
-
container: this.shadowRoot,
|
|
110
|
-
scrollable: list,
|
|
111
|
-
refresh: () => {
|
|
112
|
-
return this.refresh();
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
if (isMobileDevice()) {
|
|
116
|
-
swipe({
|
|
117
|
-
container: list,
|
|
118
|
-
animates: {
|
|
119
|
-
dragging: async (d, opts) => {
|
|
120
|
-
var groups = this.groups;
|
|
121
|
-
var currentIndex = groups.findIndex(group => group.id == this.groupId);
|
|
122
|
-
if ((d > 0 && currentIndex <= 0) || (d < 0 && currentIndex >= groups.length - 1)) {
|
|
123
|
-
/* TODO blocked gesture */
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
list.style.transform = `translate3d(${d}px, 0, 0)`;
|
|
127
|
-
},
|
|
128
|
-
aborting: async (opts) => {
|
|
129
|
-
list.style.transition = 'transform 0.3s';
|
|
130
|
-
list.style.transform = `translate3d(0, 0, 0)`;
|
|
131
|
-
setTimeout(() => {
|
|
132
|
-
list.style.transition = '';
|
|
133
|
-
}, 300);
|
|
134
|
-
},
|
|
135
|
-
swiping: async (d, opts) => {
|
|
136
|
-
var groups = this.groups;
|
|
137
|
-
var currentIndex = groups.findIndex(group => group.id == this.groupId);
|
|
138
|
-
if ((d > 0 && currentIndex <= 0) || (d < 0 && currentIndex >= groups.length - 1)) {
|
|
139
|
-
list.style.transition = '';
|
|
140
|
-
list.style.transform = `translate3d(0, 0, 0)`;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
list.style.transition = 'transform 0.3s';
|
|
144
|
-
list.style.transform = `translate3d(${d < 0 ? '-100%' : '100%'}, 0, 0)`;
|
|
145
|
-
navigate(`${this.page}/${groups[currentIndex + (d < 0 ? 1 : -1)].id}`);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async onInfoBoard(board) {
|
|
153
|
-
openOverlay('viewpart-info', {
|
|
154
|
-
template: html `
|
|
155
|
-
<board-info
|
|
156
|
-
.board=${board}
|
|
157
|
-
.groupId=${this.groupId}
|
|
158
|
-
@update-board=${e => this.onUpdateBoard(e.detail)}
|
|
159
|
-
@delete-board=${e => this.onDeleteBoard(e.detail)}
|
|
160
|
-
@join-playgroup=${e => this.onJoinPlayGroup(e.detail)}
|
|
161
|
-
@leave-playgroup=${e => this.onLeavePlayGroup(e.detail)}
|
|
162
|
-
></board-info>
|
|
163
|
-
`
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
async onInfoPlayGroup(group) {
|
|
167
|
-
openOverlay('viewpart-info', {
|
|
168
|
-
template: html `
|
|
169
|
-
<play-group-info
|
|
170
|
-
.playGroup=${group}
|
|
171
|
-
@update-play-group=${e => this.onUpdatePlayGroup(e.detail)}
|
|
172
|
-
@delete-play-group=${e => this.onDeletePlayGroup(e.detail)}
|
|
173
|
-
@create-play-group=${e => this.onCreatePlayGroup(e.detail)}
|
|
174
|
-
></play-group-info>
|
|
175
|
-
`
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
async onCreatePlayGroup(playGroup) {
|
|
179
|
-
try {
|
|
180
|
-
await createPlayGroup(playGroup);
|
|
181
|
-
this._notify('info', i18next.t('text.play-group created', { playGroup: playGroup.name }));
|
|
182
|
-
}
|
|
183
|
-
catch (ex) {
|
|
184
|
-
this._notify('error', ex, ex);
|
|
185
|
-
}
|
|
186
|
-
this.refresh();
|
|
187
|
-
}
|
|
188
|
-
async onUpdatePlayGroup(playGroup) {
|
|
189
|
-
try {
|
|
190
|
-
await updatePlayGroup(playGroup);
|
|
191
|
-
this._notify('info', i18next.t('text.play-group updated', { playGroup: playGroup.name }));
|
|
192
|
-
}
|
|
193
|
-
catch (ex) {
|
|
194
|
-
this._notify('error', ex, ex);
|
|
195
|
-
}
|
|
196
|
-
this.refresh();
|
|
197
|
-
}
|
|
198
|
-
async onDeletePlayGroup(playGroup) {
|
|
199
|
-
try {
|
|
200
|
-
await deletePlayGroup(playGroup.id);
|
|
201
|
-
this._notify('info', i18next.t('text.play-group deleted', { playGroup: playGroup.name }));
|
|
202
|
-
}
|
|
203
|
-
catch (ex) {
|
|
204
|
-
this._notify('error', ex, ex);
|
|
205
|
-
}
|
|
206
|
-
this.refresh();
|
|
207
|
-
}
|
|
208
|
-
async onUpdateBoard(board) {
|
|
209
|
-
try {
|
|
210
|
-
await updateBoard(board);
|
|
211
|
-
this._notify('info', i18next.t('text.board updated', { board: board.name }));
|
|
212
|
-
}
|
|
213
|
-
catch (ex) {
|
|
214
|
-
this._notify('error', ex, ex);
|
|
215
|
-
}
|
|
216
|
-
this.refreshBoards();
|
|
217
|
-
}
|
|
218
|
-
async onDeleteBoard(board) {
|
|
219
|
-
const playGroup = this.groups && this.groups.find(group => group.id === this.groupId);
|
|
220
|
-
await this.onLeavePlayGroup({ board, playGroup });
|
|
221
|
-
}
|
|
222
|
-
async onJoinPlayGroup({ board, playGroup }) {
|
|
223
|
-
try {
|
|
224
|
-
await client.mutate({
|
|
225
|
-
mutation: gql `
|
|
226
|
-
mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
|
|
227
|
-
joinPlayGroup(id: $id, boardIds: $boardIds) {
|
|
228
|
-
id
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
`,
|
|
232
|
-
variables: {
|
|
233
|
-
id: playGroup.id,
|
|
234
|
-
boardIds: [board.id]
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
this._notify('info', i18next.t('text.joined into play-group', { board: board.name, playGroup: playGroup.name }));
|
|
238
|
-
}
|
|
239
|
-
catch (ex) {
|
|
240
|
-
this._notify('error', ex, ex);
|
|
241
|
-
}
|
|
242
|
-
this.refresh();
|
|
243
|
-
}
|
|
244
|
-
async onLeavePlayGroup({ board, playGroup }) {
|
|
245
|
-
try {
|
|
246
|
-
await client.mutate({
|
|
247
|
-
mutation: gql `
|
|
248
|
-
mutation ($id: String!, $boardIds: [String!]!) {
|
|
249
|
-
leavePlayGroup(id: $id, boardIds: $boardIds) {
|
|
250
|
-
id
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
`,
|
|
254
|
-
variables: {
|
|
255
|
-
id: playGroup.id,
|
|
256
|
-
boardIds: [board.id]
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
this._notify('info', i18next.t('text.leaved from play-group', { board: board.name, playGroup: playGroup.name }));
|
|
260
|
-
}
|
|
261
|
-
catch (ex) {
|
|
262
|
-
this._notify('error', ex, ex);
|
|
263
|
-
}
|
|
264
|
-
this.refresh();
|
|
265
|
-
}
|
|
266
|
-
async onReorder({ boardIds, groupId }) {
|
|
267
|
-
try {
|
|
268
|
-
const response = await client.mutate({
|
|
269
|
-
mutation: gql `
|
|
270
|
-
mutation ($id: String!, $boardIds: [String!]!) {
|
|
271
|
-
reorderPlayGroup(id: $id, boardIds: $boardIds) {
|
|
272
|
-
id
|
|
273
|
-
name
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
`,
|
|
277
|
-
variables: {
|
|
278
|
-
id: groupId,
|
|
279
|
-
boardIds
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
const playGroup = response.data.reorderPlayGroup;
|
|
283
|
-
this._notify('info', i18next.t('text.reorder play-group', { playGroup: playGroup.name }));
|
|
284
|
-
}
|
|
285
|
-
catch (ex) {
|
|
286
|
-
this._notify('error', ex, ex);
|
|
287
|
-
}
|
|
288
|
-
this.refresh();
|
|
289
|
-
}
|
|
290
|
-
async refreshFavorites() {
|
|
291
|
-
const response = await client.query({
|
|
292
|
-
query: gql `
|
|
293
|
-
query {
|
|
294
|
-
myFavorites {
|
|
295
|
-
id
|
|
296
|
-
routing
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
`
|
|
300
|
-
});
|
|
301
|
-
store.dispatch({
|
|
302
|
-
type: UPDATE_FAVORITES,
|
|
303
|
-
favorites: response.data.myFavorites.map(favorite => favorite.routing)
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
_notify(level, message, ex) {
|
|
307
|
-
document.dispatchEvent(new CustomEvent('notify', {
|
|
308
|
-
detail: {
|
|
309
|
-
level,
|
|
310
|
-
message,
|
|
311
|
-
ex
|
|
312
|
-
}
|
|
313
|
-
}));
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
PlayListPage.styles = [
|
|
317
|
-
ScrollbarStyles,
|
|
318
|
-
css `
|
|
319
|
-
:host {
|
|
320
|
-
display: flex;
|
|
321
|
-
flex-direction: column;
|
|
322
|
-
position: relative;
|
|
323
|
-
|
|
324
|
-
overflow: hidden;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
board-tile-list {
|
|
328
|
-
flex: 1;
|
|
329
|
-
overflow-y: auto;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
#play {
|
|
333
|
-
position: absolute;
|
|
334
|
-
bottom: 15px;
|
|
335
|
-
right: 16px;
|
|
336
|
-
text-decoration: auto;
|
|
337
|
-
}
|
|
338
|
-
`
|
|
339
|
-
];
|
|
340
|
-
__decorate([
|
|
341
|
-
property({ type: String }),
|
|
342
|
-
__metadata("design:type", String)
|
|
343
|
-
], PlayListPage.prototype, "groupId", void 0);
|
|
344
|
-
__decorate([
|
|
345
|
-
property({ type: Array }),
|
|
346
|
-
__metadata("design:type", Array)
|
|
347
|
-
], PlayListPage.prototype, "groups", void 0);
|
|
348
|
-
__decorate([
|
|
349
|
-
property({ type: Array }),
|
|
350
|
-
__metadata("design:type", Array)
|
|
351
|
-
], PlayListPage.prototype, "boards", void 0);
|
|
352
|
-
__decorate([
|
|
353
|
-
property({ type: Array }),
|
|
354
|
-
__metadata("design:type", Array)
|
|
355
|
-
], PlayListPage.prototype, "favorites", void 0);
|
|
356
|
-
__decorate([
|
|
357
|
-
query('board-tile-list'),
|
|
358
|
-
__metadata("design:type", HTMLElement)
|
|
359
|
-
], PlayListPage.prototype, "boardTileList", void 0);
|
|
360
|
-
PlayListPage = __decorate([
|
|
361
|
-
customElement('play-list-page')
|
|
362
|
-
], PlayListPage);
|
|
363
|
-
export { PlayListPage };
|
|
364
|
-
//# sourceMappingURL=play-list-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"play-list-page.js","sourceRoot":"","sources":["../../client/pages/play-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,8BAA8B,CAAA;AACrC,OAAO,+BAA+B,CAAA;AACtC,OAAO,8BAA8B,CAAA;AAErC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAmB,MAAM,mBAAmB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAi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,OAAO,EAAE,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;OAOT;SACF,CAAC,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,OAAO,CAAC,KAAgC,EAAE,OAAY,EAAE,EAAQ;QAC9D,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK;gBACL,OAAO;gBACP,EAAE;aACH;SACF,CAAC,CACH,CAAA;IACH,CAAC;;AA3WM,mBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;4CAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;4CAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;+CAAsB;AAEhD;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAAiB,WAAW;mDAAA;AA/B1C,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CA6WxB;SA7WY,YAAY","sourcesContent":["import '@material/mwc-fab'\nimport '@material/mwc-icon'\nimport '../viewparts/play-group-info'\nimport '../board-list/board-tile-list'\nimport '../board-list/play-group-bar'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAll, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { UPDATE_FAVORITES } from '@things-factory/fav-base'\nimport { openOverlay } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { pulltorefresh } from '@operato/pull-to-refresh'\nimport { swipe, isMobileDevice } from '@things-factory/utils'\n\nimport {\n createPlayGroup,\n deletePlayGroup,\n fetchPlayGroup,\n fetchPlayGroupList,\n leavePlayGroup,\n updateBoard,\n updatePlayGroup\n} from '../graphql'\n\n@customElement('play-list-page')\nexport class PlayListPage extends localize(i18next)(connect(store)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n overflow: hidden;\n }\n\n board-tile-list {\n flex: 1;\n overflow-y: auto;\n }\n\n #play {\n position: absolute;\n bottom: 15px;\n right: 16px;\n text-decoration: auto;\n }\n `\n ]\n\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) boards: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @query('board-tile-list') boardTileList!: HTMLElement\n\n private page?: string\n\n get context() {\n var group = this.groups && this.groups.find(group => group.id === this.groupId)\n\n return {\n title: {\n icon: 'video_library',\n text: group ? group.name : 'Play List'\n },\n board_topmenu: true\n }\n }\n\n render() {\n return html`\n <play-group-bar\n .groups=${this.groups}\n .groupId=${this.groupId}\n target-page=\"play-list\"\n @info-play-group=${e => this.onInfoPlayGroup(e.detail)}\n ></play-group-bar>\n\n <board-tile-list\n .favorites=${this.favorites}\n .boards=${this.boards}\n .group=${this.groupId}\n @info-board=${e => this.onInfoBoard(e.detail)}\n @delete-board=${e => this.onDeleteBoard(e.detail)}\n @refresh-favorites=${e => this.refreshFavorites()}\n @reordered=${e => this.onReorder(e.detail)}\n reorderable\n ></board-tile-list>\n\n <a id=\"play\" .href=${'board-player/' + this.groupId}>\n <mwc-fab icon=\"play_arrow\" title=\"play\"> </mwc-fab>\n </a>\n `\n }\n\n async refresh() {\n this.groups = (await fetchPlayGroupList()).playGroups.items\n\n this.groups && (await this.refreshBoards())\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n if (!this.groupId) {\n let groupId = this.groups && this.groups[0] && this.groups[0].id\n var newURL = new URL(window.location.href)\n\n newURL.pathname += `/${groupId}`\n\n if (groupId) {\n navigate(newURL.href, true)\n }\n return\n }\n\n if (this.groupId) {\n var playGroup = (await fetchPlayGroup(this.groupId)).playGroup\n this.boards = playGroup ? playGroup.boards : []\n } else {\n this.boards = []\n }\n\n this.updateContext()\n\n var list = this.boardTileList\n\n list.style.transition = ''\n list.style.transform = `translate3d(0, 0, 0)`\n }\n\n async pageInitialized() {\n this.refresh()\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n this.page = lifecycle.page\n this.groupId = lifecycle.resourceId\n\n await this.updateComplete\n\n this.refreshBoards()\n }\n }\n\n stateChanged(state) {\n this.favorites = state.favorite.favorites\n }\n\n firstUpdated() {\n var list = this.boardTileList\n\n pulltorefresh({\n container: this.shadowRoot,\n scrollable: list,\n refresh: () => {\n return this.refresh()\n }\n })\n\n if (isMobileDevice()) {\n swipe({\n container: list,\n animates: {\n dragging: async (d, opts) => {\n var groups = this.groups\n var currentIndex = groups.findIndex(group => group.id == this.groupId)\n\n if ((d > 0 && currentIndex <= 0) || (d < 0 && currentIndex >= groups.length - 1)) {\n /* TODO blocked gesture */\n return false\n }\n\n list.style.transform = `translate3d(${d}px, 0, 0)`\n },\n aborting: async opts => {\n list.style.transition = 'transform 0.3s'\n list.style.transform = `translate3d(0, 0, 0)`\n\n setTimeout(() => {\n list.style.transition = ''\n }, 300)\n },\n swiping: async (d, opts) => {\n var groups = this.groups\n var currentIndex = groups.findIndex(group => group.id == this.groupId)\n\n if ((d > 0 && currentIndex <= 0) || (d < 0 && currentIndex >= groups.length - 1)) {\n list.style.transition = ''\n list.style.transform = `translate3d(0, 0, 0)`\n } else {\n list.style.transition = 'transform 0.3s'\n list.style.transform = `translate3d(${d < 0 ? '-100%' : '100%'}, 0, 0)`\n\n navigate(`${this.page}/${groups[currentIndex + (d < 0 ? 1 : -1)].id}`)\n }\n }\n }\n })\n }\n }\n\n async onInfoBoard(board) {\n openOverlay('viewpart-info', {\n template: html`\n <board-info\n .board=${board}\n .groupId=${this.groupId}\n @update-board=${e => this.onUpdateBoard(e.detail)}\n @delete-board=${e => this.onDeleteBoard(e.detail)}\n @join-playgroup=${e => this.onJoinPlayGroup(e.detail)}\n @leave-playgroup=${e => this.onLeavePlayGroup(e.detail)}\n ></board-info>\n `\n })\n }\n\n async onInfoPlayGroup(group) {\n openOverlay('viewpart-info', {\n template: html`\n <play-group-info\n .playGroup=${group}\n @update-play-group=${e => this.onUpdatePlayGroup(e.detail)}\n @delete-play-group=${e => this.onDeletePlayGroup(e.detail)}\n @create-play-group=${e => this.onCreatePlayGroup(e.detail)}\n ></play-group-info>\n `\n })\n }\n\n async onCreatePlayGroup(playGroup) {\n try {\n await createPlayGroup(playGroup)\n this._notify('info', i18next.t('text.play-group created', { playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onUpdatePlayGroup(playGroup) {\n try {\n await updatePlayGroup(playGroup)\n this._notify('info', i18next.t('text.play-group updated', { playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onDeletePlayGroup(playGroup) {\n try {\n await deletePlayGroup(playGroup.id)\n this._notify('info', i18next.t('text.play-group deleted', { playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onUpdateBoard(board) {\n try {\n await updateBoard(board)\n this._notify('info', i18next.t('text.board updated', { board: board.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refreshBoards()\n }\n\n async onDeleteBoard(board) {\n const playGroup = this.groups && this.groups.find(group => group.id === this.groupId)\n await this.onLeavePlayGroup({ board, playGroup })\n }\n\n async onJoinPlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n this._notify('info', i18next.t('text.joined into play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onLeavePlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n this._notify('info', i18next.t('text.leaved from play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onReorder({ boardIds, groupId }) {\n try {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n reorderPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds\n }\n })\n\n const playGroup = response.data.reorderPlayGroup\n\n this._notify('info', i18next.t('text.reorder play-group', { playGroup: playGroup.name }))\n } catch (ex) {\n this._notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async refreshFavorites() {\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 _notify(level: 'info' | 'warn' | 'error', message: any, ex?: any) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BoardViewerPage } from './board-viewer-page';
|
|
2
|
-
export declare class PrintableBoardViewerPage extends BoardViewerPage {
|
|
3
|
-
get context(): {
|
|
4
|
-
printable: {
|
|
5
|
-
accept: string[];
|
|
6
|
-
content: () => Promise<any>;
|
|
7
|
-
};
|
|
8
|
-
title: any;
|
|
9
|
-
};
|
|
10
|
-
fetchImage(): Promise<unknown>;
|
|
11
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { BoardViewerPage } from './board-viewer-page';
|
|
2
|
-
function serialize(obj) {
|
|
3
|
-
var str = [];
|
|
4
|
-
for (var p in obj)
|
|
5
|
-
if (obj.hasOwnProperty(p)) {
|
|
6
|
-
str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]));
|
|
7
|
-
}
|
|
8
|
-
return str.join('&');
|
|
9
|
-
}
|
|
10
|
-
function readFileAsync(file) {
|
|
11
|
-
return new Promise((resolve, reject) => {
|
|
12
|
-
let reader = new FileReader();
|
|
13
|
-
reader.onload = () => {
|
|
14
|
-
resolve(reader.result);
|
|
15
|
-
};
|
|
16
|
-
reader.onerror = reject;
|
|
17
|
-
reader.readAsDataURL(file);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export class PrintableBoardViewerPage extends BoardViewerPage {
|
|
21
|
-
get context() {
|
|
22
|
-
return Object.assign(Object.assign({}, super.context), { printable: {
|
|
23
|
-
accept: ['preview'],
|
|
24
|
-
content: async () => {
|
|
25
|
-
const image = await this.fetchImage();
|
|
26
|
-
await this.printTrick(image);
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
} });
|
|
30
|
-
}
|
|
31
|
-
async fetchImage() {
|
|
32
|
-
const modelId = this._boardId;
|
|
33
|
-
const data = {
|
|
34
|
-
title: this.context.title
|
|
35
|
-
};
|
|
36
|
-
const queryString = serialize(data);
|
|
37
|
-
const url = `${location.origin}/screenshot/${modelId}${queryString ? '?' + queryString : ''}`;
|
|
38
|
-
const response = await fetch(url);
|
|
39
|
-
return await readFileAsync(await response.blob());
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
customElements.define('printable-board-viewer-page', PrintableBoardViewerPage);
|
|
43
|
-
//# sourceMappingURL=printable-board-viewer-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printable-board-viewer-page.js","sourceRoot":"","sources":["../../client/pages/printable-board-viewer-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,SAAS,SAAS,CAAC,GAAG;IACpB,IAAI,GAAG,GAAG,EAAc,CAAA;IACxB,KAAK,IAAI,CAAC,IAAI,GAAG;QACf,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YACzB,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SACnE;IACH,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACtB,CAAC;AAED,SAAS,aAAa,CAAC,IAAI;IACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA;QAE7B,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACxB,CAAC,CAAA;QAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA;QACvB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,OAAO,wBAAyB,SAAQ,eAAe;IAC3D,IAAI,OAAO;QACT,uCACK,KAAK,CAAC,OAAO,KAChB,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,SAAS,CAAC;gBACnB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;oBACrC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;oBAE5B,OAAO,IAAW,CAAA;gBACpB,CAAC;aACF,IACF;IACH,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,MAAM,IAAI,GAAG;YACX,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;SAC1B,CAAA;QACD,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;QACnC,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,eAAe,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QAE7F,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QACjC,OAAO,MAAM,aAAa,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IACnD,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,6BAA6B,EAAE,wBAAwB,CAAC,CAAA","sourcesContent":["import { BoardViewerPage } from './board-viewer-page'\n\nfunction serialize(obj) {\n var str = [] as string[]\n for (var p in obj)\n if (obj.hasOwnProperty(p)) {\n str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]))\n }\n return str.join('&')\n}\n\nfunction readFileAsync(file) {\n return new Promise((resolve, reject) => {\n let reader = new FileReader()\n\n reader.onload = () => {\n resolve(reader.result)\n }\n\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nexport class PrintableBoardViewerPage extends BoardViewerPage {\n get context() {\n return {\n ...super.context,\n printable: {\n accept: ['preview'],\n content: async () => {\n const image = await this.fetchImage()\n await this.printTrick(image)\n\n return this as any\n }\n }\n }\n }\n\n async fetchImage() {\n const modelId = this._boardId\n const data = {\n title: this.context.title\n }\n const queryString = serialize(data)\n const url = `${location.origin}/screenshot/${modelId}${queryString ? '?' + queryString : ''}`\n\n const response = await fetch(url)\n return await readFileAsync(await response.blob())\n }\n}\n\ncustomElements.define('printable-board-viewer-page', PrintableBoardViewerPage)\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function buildThemeValueRecordConfig(): {
|
|
2
|
-
editor: (value: any, column: any, record: any, rowIndex: any, field: any) => import("@operato/data-grist").OxGristEditor;
|
|
3
|
-
renderer: (value: any, column: any, record: any, rowIndex: any, field: any) => string | void | import("lit-html").TemplateResult<2 | 1> | import("@operato/data-grist").OxGristRenderer;
|
|
4
|
-
editable: boolean;
|
|
5
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { getEditor, getRenderer } from '@operato/data-grist';
|
|
2
|
-
export function buildThemeValueRecordConfig() {
|
|
3
|
-
return {
|
|
4
|
-
editor: function (value, column, record, rowIndex, field) {
|
|
5
|
-
return getEditor(record.type || 'text')(value, column, record, rowIndex, field);
|
|
6
|
-
},
|
|
7
|
-
renderer: function (value, column, record, rowIndex, field) {
|
|
8
|
-
return getRenderer(record.type || 'text')(value, column, record, rowIndex, field);
|
|
9
|
-
},
|
|
10
|
-
editable: true
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function getEditorType(themeType) {
|
|
14
|
-
switch (themeType) {
|
|
15
|
-
case 'legend':
|
|
16
|
-
case 'color-map':
|
|
17
|
-
return 'value-map';
|
|
18
|
-
case 'color-ranges':
|
|
19
|
-
return 'value-ranges';
|
|
20
|
-
case 'color':
|
|
21
|
-
return 'color';
|
|
22
|
-
default:
|
|
23
|
-
return 'text';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function getRendererType(themeType) {
|
|
27
|
-
switch (themeType) {
|
|
28
|
-
case 'legend':
|
|
29
|
-
case 'color-map':
|
|
30
|
-
case 'color-ranges':
|
|
31
|
-
return 'json5';
|
|
32
|
-
case 'color':
|
|
33
|
-
return 'color';
|
|
34
|
-
default:
|
|
35
|
-
return 'text';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function getOptions(themeType, name) {
|
|
39
|
-
switch (themeType) {
|
|
40
|
-
case 'color-map':
|
|
41
|
-
case 'color-ranges':
|
|
42
|
-
return {
|
|
43
|
-
name: `${themeType.toUpperCase()} : ${name}`,
|
|
44
|
-
valuetype: 'color'
|
|
45
|
-
};
|
|
46
|
-
case 'color':
|
|
47
|
-
default:
|
|
48
|
-
return {
|
|
49
|
-
name: `${(themeType === null || themeType === void 0 ? void 0 : themeType.toUpperCase()) || ''} : ${name}`
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=theme-editors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-editors.js","sourceRoot":"","sources":["../../../client/pages/theme/theme-editors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE5D,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,MAAM,EAAE,UAAU,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK;YACtD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACjF,CAAC;QACD,QAAQ,EAAE,UAAU,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK;YACxD,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACnF,CAAC;QACD,QAAQ,EAAE,IAAI;KACf,CAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAC,SAAiB;IACtC,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW;YACd,OAAO,WAAW,CAAA;QACpB,KAAK,cAAc;YACjB,OAAO,cAAc,CAAA;QACvB,KAAK,OAAO;YACV,OAAO,OAAO,CAAA;QAChB;YACE,OAAO,MAAM,CAAA;KAChB;AACH,CAAC;AAED,SAAS,eAAe,CAAC,SAAiB;IACxC,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO,OAAO,CAAA;QAChB,KAAK,OAAO;YACV,OAAO,OAAO,CAAA;QAChB;YACE,OAAO,MAAM,CAAA;KAChB;AACH,CAAC;AAED,SAAS,UAAU,CAAC,SAAiB,EAAE,IAAY;IACjD,QAAQ,SAAS,EAAE;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO;gBACL,IAAI,EAAE,GAAG,SAAS,CAAC,WAAW,EAAE,MAAM,IAAI,EAAE;gBAC5C,SAAS,EAAE,OAAO;aACnB,CAAA;QACH,KAAK,OAAO,CAAC;QACb;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,EAAE,KAAI,EAAE,MAAM,IAAI,EAAE;aACpD,CAAA;KACJ;AACH,CAAC","sourcesContent":["import { getEditor, getRenderer } from '@operato/data-grist'\n\nexport function buildThemeValueRecordConfig() {\n return {\n editor: function (value, column, record, rowIndex, field) {\n return getEditor(record.type || 'text')(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n return getRenderer(record.type || 'text')(value, column, record, rowIndex, field)\n },\n editable: true\n }\n}\n\nfunction getEditorType(themeType: string): string {\n switch (themeType) {\n case 'legend':\n case 'color-map':\n return 'value-map'\n case 'color-ranges':\n return 'value-ranges'\n case 'color':\n return 'color'\n default:\n return 'text'\n }\n}\n\nfunction getRendererType(themeType: string): string {\n switch (themeType) {\n case 'legend':\n case 'color-map':\n case 'color-ranges':\n return 'json5'\n case 'color':\n return 'color'\n default:\n return 'text'\n }\n}\n\nfunction getOptions(themeType: string, name: string): any {\n switch (themeType) {\n case 'color-map':\n case 'color-ranges':\n return {\n name: `${themeType.toUpperCase()} : ${name}`,\n valuetype: 'color'\n }\n case 'color':\n default:\n return {\n name: `${themeType?.toUpperCase() || ''} : ${name}`\n }\n }\n}\n"]}
|