@internetarchive/ia-item-navigator 0.0.0-a8 → 0.0.2-a1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +29 -19
- package/demo/app-root.ts +50 -50
- package/demo/index.html +1 -0
- package/dist/demo/app-root.d.ts +19 -15
- package/dist/demo/app-root.js +36 -39
- package/dist/demo/app-root.js.map +1 -1
- package/dist/src/interfaces/custom-theater-interface.d.ts +20 -0
- package/dist/src/interfaces/custom-theater-interface.js +2 -0
- package/dist/src/interfaces/custom-theater-interface.js.map +1 -0
- package/dist/src/interfaces/event-interfaces.d.ts +11 -11
- package/dist/src/interfaces/event-interfaces.js.map +1 -1
- package/dist/src/interfaces/menu-interfaces.d.ts +6 -7
- package/dist/src/interfaces/menu-interfaces.js.map +1 -1
- package/dist/src/interfaces/nav-controller-interface.d.ts +11 -6
- package/dist/src/interfaces/nav-controller-interface.js.map +1 -1
- package/dist/src/item-inspector/item-inspector.d.ts +0 -47
- package/dist/src/item-inspector/item-inspector.js +253 -270
- package/dist/src/item-inspector/item-inspector.js.map +1 -1
- package/dist/src/item-navigator.d.ts +45 -28
- package/dist/src/item-navigator.js +122 -115
- package/dist/src/item-navigator.js.map +1 -1
- package/dist/src/loader.d.ts +5 -0
- package/dist/src/loader.js +8 -2
- package/dist/src/loader.js.map +1 -1
- package/dist/src/no-theater-available.d.ts +9 -0
- package/dist/src/no-theater-available.js +79 -0
- package/dist/src/no-theater-available.js.map +1 -0
- package/dist/test/book-nav-stub.d.ts +22 -0
- package/dist/test/book-nav-stub.js +49 -0
- package/dist/test/book-nav-stub.js.map +1 -0
- package/dist/test/ia-item-navigator.test.d.ts +2 -0
- package/dist/test/ia-item-navigator.test.js +317 -0
- package/dist/test/ia-item-navigator.test.js.map +1 -0
- package/dist/test/ia-stub-goody.d.ts +210 -0
- package/dist/test/ia-stub-goody.js +276 -0
- package/dist/test/ia-stub-goody.js.map +1 -0
- package/dist/test/ia-stub.d.ts +22 -0
- package/dist/test/ia-stub.js +35 -0
- package/dist/test/ia-stub.js.map +1 -0
- package/dist/test/no-theater-available.test.d.ts +1 -0
- package/dist/test/no-theater-available.test.js +27 -0
- package/dist/test/no-theater-available.test.js.map +1 -0
- package/package.json +4 -3
- package/src/interfaces/custom-theater-interface.ts +28 -0
- package/src/interfaces/event-interfaces.ts +15 -11
- package/src/interfaces/menu-interfaces.ts +9 -10
- package/src/item-navigator.ts +165 -145
- package/src/loader.ts +9 -2
- package/src/no-theater-available.ts +85 -0
- package/test/book-nav-stub.ts +47 -0
- package/test/ia-item-navigator.test.ts +438 -0
- package/test/ia-stub.ts +79 -0
- package/test/no-theater-available.test.ts +32 -0
- package/demo/demo-book-manifest.json +0 -1163
- package/src/interfaces/nav-controller-interface.ts +0 -18
- package/src/item-inspector/files-by-type/files-by-type-provider.ts +0 -43
- package/src/item-inspector/files-by-type/ia-files-by-type.ts +0 -100
- package/src/item-inspector/item-inspector.ts +0 -295
- package/src/item-inspector/share-provider.ts +0 -51
- package/src/item-inspector/visual-mod-provider.ts +0 -65
- package/src/item-navigator-js.js +0 -372
- package/test/your-webcomponent.test.ts +0 -40
@@ -1,12 +1,17 @@
|
|
1
1
|
import { LitElement } from 'lit-element';
|
2
2
|
import { MetadataResponse } from '@internetarchive/search-service';
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
import { ModalManager } from '@internetarchive/modal-manager';
|
4
|
+
import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
|
5
|
+
import { IntMenuProvider, IntMenuShortcut } from './menu-interfaces';
|
6
|
+
export interface CustomTheaterInterface extends LitElement {
|
7
|
+
baseHost?: string;
|
8
|
+
itemMD?: MetadataResponse;
|
9
|
+
menuProviders?: IntMenuProvider[];
|
10
|
+
menuShortcuts?: IntMenuShortcut[];
|
9
11
|
sideMenuOpen: boolean;
|
12
|
+
signedIn?: boolean | null;
|
13
|
+
sharedObserver?: SharedResizeObserver;
|
14
|
+
modal?: ModalManager;
|
10
15
|
emitLoadingStatusUpdate: (loaded: boolean) => void;
|
11
16
|
addMenuShortcut: (menuId: string) => void;
|
12
17
|
removeMenuShortcut: (menuId: string) => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nav-controller-interface.js","sourceRoot":"","sources":["../../../src/interfaces/nav-controller-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { LitElement } from 'lit-element';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport { IntMenuShortcut } from './menu-interfaces';\n\nexport interface
|
1
|
+
{"version":3,"file":"nav-controller-interface.js","sourceRoot":"","sources":["../../../src/interfaces/nav-controller-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { LitElement } from 'lit-element';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { IntMenuProvider, IntMenuShortcut } from './menu-interfaces';\n\nexport interface CustomTheaterInterface extends LitElement {\n baseHost?: string;\n itemMD?: MetadataResponse;\n menuProviders?: IntMenuProvider[];\n menuShortcuts?: IntMenuShortcut[];\n sideMenuOpen: boolean;\n\n signedIn?: boolean | null;\n\n sharedObserver?: SharedResizeObserver;\n modal?: ModalManager;\n\n emitLoadingStatusUpdate: (loaded: boolean) => void;\n\n addMenuShortcut: (menuId: string) => void;\n removeMenuShortcut: (menuId: string) => void;\n sortMenuShortcuts: () => void;\n emitMenuShortcutsUpdated: () => void;\n}\n"]}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit-element';
|
2
|
-
import { MetadataResponse } from '@internetarchive/search-service';
|
3
|
-
import { ModalManagerInterface } from '@internetarchive/modal-manager';
|
4
|
-
import { SharedResizeObserverInterface } from '@internetarchive/shared-resize-observer';
|
5
|
-
import { IntNavController } from '../interfaces/nav-controller-interface';
|
6
|
-
import { IntMenuProvider, IntMenuShortcut } from '../interfaces/menu-interfaces';
|
7
|
-
interface menuProvidersInt {
|
8
|
-
[menuId: string]: IntMenuProvider;
|
9
|
-
}
|
10
|
-
export declare class IaItemInspector extends LitElement implements IntNavController {
|
11
|
-
itemMD: MetadataResponse;
|
12
|
-
baseHost: string;
|
13
|
-
menuProviders: menuProvidersInt;
|
14
|
-
menuShortcuts: IntMenuShortcut[];
|
15
|
-
sideMenuOpen: boolean;
|
16
|
-
fullscreenState: boolean;
|
17
|
-
modal: ModalManagerInterface;
|
18
|
-
sharedRO: SharedResizeObserverInterface;
|
19
|
-
fileCount: number;
|
20
|
-
loaded: boolean;
|
21
|
-
private shortcutOrder;
|
22
|
-
firstUpdated(): void;
|
23
|
-
updated(changed: any): void;
|
24
|
-
modalClosedCallback(): void;
|
25
|
-
openModal(): void;
|
26
|
-
render(): import("lit-element").TemplateResult;
|
27
|
-
addMenuShortcut(menuId: keyof menuProvidersInt): void;
|
28
|
-
/**
|
29
|
-
* Removes a provider object from the menuShortcuts array and emits a
|
30
|
-
* menuShortcutsUpdated event.
|
31
|
-
*/
|
32
|
-
removeMenuShortcut(menuId: string): void;
|
33
|
-
/**
|
34
|
-
* Sorts the menuShortcuts property by comparing each provider's id to
|
35
|
-
* the id in each iteration over the shortcutOrder array.
|
36
|
-
*/
|
37
|
-
sortMenuShortcuts(): void;
|
38
|
-
emitMenuShortcutsUpdated(): void;
|
39
|
-
setMenu(): void;
|
40
|
-
updateFullscreenState(): void;
|
41
|
-
updateMenuContents(): void;
|
42
|
-
emitLoadingStatusUpdate(loaded: boolean): void;
|
43
|
-
parseItemInfo(): void;
|
44
|
-
get imageUrl(): string;
|
45
|
-
static get styles(): import("lit-element").CSSResult[];
|
46
|
-
}
|
47
|
-
export {};
|
@@ -1,271 +1,254 @@
|
|
1
|
-
|
2
|
-
/* eslint-disable no-console */
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
//
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
]
|
252
|
-
|
253
|
-
|
254
|
-
], IaItemInspector.prototype, "modal", void 0);
|
255
|
-
__decorate([
|
256
|
-
property({ attribute: false })
|
257
|
-
], IaItemInspector.prototype, "sharedRO", void 0);
|
258
|
-
__decorate([
|
259
|
-
state()
|
260
|
-
], IaItemInspector.prototype, "fileCount", void 0);
|
261
|
-
__decorate([
|
262
|
-
state()
|
263
|
-
], IaItemInspector.prototype, "loaded", void 0);
|
264
|
-
__decorate([
|
265
|
-
state()
|
266
|
-
], IaItemInspector.prototype, "shortcutOrder", void 0);
|
267
|
-
IaItemInspector = __decorate([
|
268
|
-
customElement('ia-item-inspector')
|
269
|
-
], IaItemInspector);
|
270
|
-
export { IaItemInspector };
|
1
|
+
"use strict";
|
2
|
+
// /* eslint-disable no-console */
|
3
|
+
// import {
|
4
|
+
// css,
|
5
|
+
// html,
|
6
|
+
// LitElement,
|
7
|
+
// customElement,
|
8
|
+
// property,
|
9
|
+
// state,
|
10
|
+
// } from 'lit-element';
|
11
|
+
// import { MetadataResponse } from '@internetarchive/search-service';
|
12
|
+
// import {
|
13
|
+
// ModalManagerInterface,
|
14
|
+
// ModalConfig,
|
15
|
+
// } from '@internetarchive/modal-manager';
|
16
|
+
// import { SharedResizeObserverInterface } from '@internetarchive/shared-resize-observer';
|
17
|
+
// import { IntNavController } from '../interfaces/nav-controller-interface';
|
18
|
+
// import {
|
19
|
+
// IntMenuProvider,
|
20
|
+
// IntMenuShortcut,
|
21
|
+
// } from '../interfaces/menu-interfaces';
|
22
|
+
// import { IntManageFullscreenEvent } from '../interfaces/event-interfaces';
|
23
|
+
// import { ShareProvider } from './share-provider';
|
24
|
+
// import { FilesByTypeProvider } from './files-by-type/files-by-type-provider';
|
25
|
+
// import { VisualModsProvider } from './visual-mod-provider';
|
26
|
+
// // eslint-disable-next-line no-shadow
|
27
|
+
// enum ItemInspectorEvents {
|
28
|
+
// menuUpdated = 'menuUpdated',
|
29
|
+
// updateSideMenu = 'updateSideMenu',
|
30
|
+
// PostInit = 'PostInit',
|
31
|
+
// ViewportInFullScreen = 'ViewportInFullScreen',
|
32
|
+
// }
|
33
|
+
// interface menuProvidersInt {
|
34
|
+
// [menuId: string]: IntMenuProvider;
|
35
|
+
// }
|
36
|
+
// @customElement('ia-item-inspector')
|
37
|
+
// export class IaItemInspector extends LitElement implements IntNavController {
|
38
|
+
// @property({ type: Object }) itemMD: MetadataResponse = {
|
39
|
+
// metadata: {},
|
40
|
+
// } as MetadataResponse;
|
41
|
+
// @property({ type: String }) baseHost = 'https://archive.org';
|
42
|
+
// @property({ type: Object }) menuProviders: menuProvidersInt = {};
|
43
|
+
// @property({ type: Array }) menuShortcuts: IntMenuShortcut[] = [];
|
44
|
+
// @property({ type: Boolean }) sideMenuOpen = false;
|
45
|
+
// @property({ type: Boolean }) fullscreenState = false;
|
46
|
+
// @property({ attribute: false }) modal!: ModalManagerInterface;
|
47
|
+
// @property({ attribute: false }) sharedRO!: SharedResizeObserverInterface;
|
48
|
+
// @state() fileCount: number = 0;
|
49
|
+
// @state() loaded: boolean = false;
|
50
|
+
// @state() private shortcutOrder = ['visualMods'];
|
51
|
+
// firstUpdated() {
|
52
|
+
// this.loaded = true;
|
53
|
+
// console.log('modal', this.modal);
|
54
|
+
// }
|
55
|
+
// updated(changed: any) {
|
56
|
+
// if (changed.has('loaded')) {
|
57
|
+
// setTimeout(() => this.emitLoadingStatusUpdate(this.loaded), 1000);
|
58
|
+
// }
|
59
|
+
// if (changed.has('itemMD') && this.itemMD) {
|
60
|
+
// this.parseItemInfo();
|
61
|
+
// this.setMenu();
|
62
|
+
// }
|
63
|
+
// if (changed.has('menuProviders') || changed.has('menuShortcuts')) {
|
64
|
+
// this.updateMenuContents();
|
65
|
+
// }
|
66
|
+
// }
|
67
|
+
// modalClosedCallback() {
|
68
|
+
// console.log('item-inspector, modal closed');
|
69
|
+
// }
|
70
|
+
// openModal() {
|
71
|
+
// const config = new ModalConfig();
|
72
|
+
// const customModalContent = html`
|
73
|
+
// Can contain any markup, including web components. Event listeners also
|
74
|
+
// work. Try clicking on the picture.
|
75
|
+
// <div style="text-align: center">
|
76
|
+
// <a href="https://fillmurray.com" style="display: block">Fill Murray</a>
|
77
|
+
// <img src="100x100.jpg" alt="foo" />
|
78
|
+
// </div>
|
79
|
+
// `;
|
80
|
+
// this.modal.showModal({
|
81
|
+
// config,
|
82
|
+
// customModalContent,
|
83
|
+
// userClosedModalCallback: this.modalClosedCallback,
|
84
|
+
// });
|
85
|
+
// }
|
86
|
+
// render() {
|
87
|
+
// const { identifier = '' } = this.itemMD?.metadata;
|
88
|
+
// return html`
|
89
|
+
// <section>
|
90
|
+
// <div>
|
91
|
+
// <h2>${identifier}</h2>
|
92
|
+
// </div>
|
93
|
+
// <img src=${this.imageUrl} alt=${`${identifier} thumbnail`} />
|
94
|
+
// <button @click=${() => this.openModal()}>open modal</button>
|
95
|
+
// <p style="font-size: 20px;">
|
96
|
+
// Bacon ipsum dolor amet flank chicken leberkas sausage, meatball pork
|
97
|
+
// belly jowl. Chislic bacon salami frankfurter shankle drumstick
|
98
|
+
// andouille ball tip alcatra. Fatback beef ribs chicken, jerky ground
|
99
|
+
// round hamburger pork chop biltong. Shoulder short loin rump jerky
|
100
|
+
// kielbasa pork porchetta fatback ribeye pork belly sirloin chislic
|
101
|
+
// turducken corned beef tri-tip. Chuck pancetta meatball tail, spare
|
102
|
+
// ribs ham hock capicola pig. Ham hock hamburger chicken tri-tip venison
|
103
|
+
// swine burgdoggen boudin meatloaf pastrami chuck. Tri-tip spare ribs
|
104
|
+
// drumstick, tail rump hamburger burgdoggen swine t-bone tongue
|
105
|
+
// andouille chislic alcatra. Pork loin jowl frankfurter, doner meatball
|
106
|
+
// short loin ham hock filet mignon hamburger rump turkey bresaola
|
107
|
+
// shoulder sirloin flank. Ribeye sausage pig t-bone bacon frankfurter
|
108
|
+
// cupim capicola fatback pastrami ball tip pork belly. Picanha pancetta
|
109
|
+
// andouille flank shankle venison tri-tip tail, kevin turkey turducken
|
110
|
+
// chicken. Bacon picanha swine frankfurter, prosciutto chislic doner
|
111
|
+
// alcatra pork loin corned beef jowl biltong meatball chuck. Bacon
|
112
|
+
// burgdoggen pig fatback cupim t-bone. Cow pork loin bresaola brisket
|
113
|
+
// shoulder filet mignon chicken. Sirloin bresaola porchetta beef
|
114
|
+
// capicola meatloaf brisket shankle jerky turkey pork tri-tip swine
|
115
|
+
// kevin salami. Meatball t-bone doner venison. Pig tri-tip chuck, shank
|
116
|
+
// chicken pork chop landjaeger spare ribs jerky swine ham hock buffalo
|
117
|
+
// sirloin. Leberkas pancetta tenderloin, meatloaf buffalo rump pastrami
|
118
|
+
// chuck. Jerky cupim porchetta, tenderloin chuck andouille venison pork
|
119
|
+
// salami. Chuck strip steak cupim, turducken ham hock kielbasa shoulder
|
120
|
+
// porchetta chislic short loin tri-tip biltong cow corned beef.
|
121
|
+
// </p>
|
122
|
+
// </section>
|
123
|
+
// `;
|
124
|
+
// }
|
125
|
+
// addMenuShortcut(menuId: keyof menuProvidersInt) {
|
126
|
+
// if (this.menuShortcuts.find(m => m.id === menuId)) {
|
127
|
+
// return;
|
128
|
+
// }
|
129
|
+
// const shortcut = this.menuProviders[menuId];
|
130
|
+
// this.menuShortcuts.push(shortcut);
|
131
|
+
// this.sortMenuShortcuts();
|
132
|
+
// this.emitMenuShortcutsUpdated();
|
133
|
+
// }
|
134
|
+
// /**
|
135
|
+
// * Removes a provider object from the menuShortcuts array and emits a
|
136
|
+
// * menuShortcutsUpdated event.
|
137
|
+
// */
|
138
|
+
// removeMenuShortcut(menuId: string) {
|
139
|
+
// this.menuShortcuts = this.menuShortcuts.filter(m => m.id !== menuId);
|
140
|
+
// this.emitMenuShortcutsUpdated();
|
141
|
+
// }
|
142
|
+
// /**
|
143
|
+
// * Sorts the menuShortcuts property by comparing each provider's id to
|
144
|
+
// * the id in each iteration over the shortcutOrder array.
|
145
|
+
// */
|
146
|
+
// sortMenuShortcuts() {
|
147
|
+
// this.menuShortcuts = this.shortcutOrder.reduce(
|
148
|
+
// (shortcuts: IntMenuShortcut[], id) => {
|
149
|
+
// const menu = this.menuShortcuts.find(m => m.id === id);
|
150
|
+
// // eslint-disable-next-line no-param-reassign
|
151
|
+
// if (menu) {
|
152
|
+
// const newShortcuts = [...shortcuts, menu];
|
153
|
+
// // eslint-disable-next-line no-param-reassign
|
154
|
+
// shortcuts = newShortcuts;
|
155
|
+
// }
|
156
|
+
// return shortcuts;
|
157
|
+
// },
|
158
|
+
// []
|
159
|
+
// );
|
160
|
+
// }
|
161
|
+
// emitMenuShortcutsUpdated() {
|
162
|
+
// const event = new CustomEvent('menuShortcutsUpdated', {
|
163
|
+
// detail: this.menuShortcuts,
|
164
|
+
// });
|
165
|
+
// this.dispatchEvent(event);
|
166
|
+
// }
|
167
|
+
// setMenu() {
|
168
|
+
// const menuProviders = {
|
169
|
+
// share: new ShareProvider({
|
170
|
+
// item: this.itemMD,
|
171
|
+
// baseHost: this.baseHost,
|
172
|
+
// subPrefix: '',
|
173
|
+
// }),
|
174
|
+
// filesByType: new FilesByTypeProvider({
|
175
|
+
// item: this.itemMD,
|
176
|
+
// baseHost: this.baseHost,
|
177
|
+
// subPrefix: '',
|
178
|
+
// }),
|
179
|
+
// visualMods: new VisualModsProvider({
|
180
|
+
// updated: (modType: string) => {
|
181
|
+
// if (modType === 'toggleFullscreen') {
|
182
|
+
// this.updateFullscreenState();
|
183
|
+
// }
|
184
|
+
// },
|
185
|
+
// item: this.itemMD,
|
186
|
+
// baseHost: this.baseHost,
|
187
|
+
// subPrefix: '',
|
188
|
+
// // maybe DOM root for class configs?
|
189
|
+
// }),
|
190
|
+
// };
|
191
|
+
// this.menuProviders = menuProviders;
|
192
|
+
// this.addMenuShortcut('visualMods');
|
193
|
+
// }
|
194
|
+
// updateFullscreenState() {
|
195
|
+
// const isFullScreen = !this.fullscreenState;
|
196
|
+
// this.fullscreenState = isFullScreen;
|
197
|
+
// const event = new CustomEvent('ViewportInFullScreen', {
|
198
|
+
// detail: { isFullScreen },
|
199
|
+
// } as IntManageFullscreenEvent);
|
200
|
+
// this.dispatchEvent(event);
|
201
|
+
// }
|
202
|
+
// updateMenuContents() {
|
203
|
+
// const { share, filesByType, visualMods } = this.menuProviders;
|
204
|
+
// const availableMenus = [filesByType, share, visualMods].filter(
|
205
|
+
// menu => !!menu
|
206
|
+
// );
|
207
|
+
// const event = new CustomEvent(ItemInspectorEvents.menuUpdated, {
|
208
|
+
// detail: availableMenus,
|
209
|
+
// });
|
210
|
+
// this.dispatchEvent(event);
|
211
|
+
// }
|
212
|
+
// emitLoadingStatusUpdate(loaded: boolean) {
|
213
|
+
// const event = new CustomEvent('loadingStateUpdated', {
|
214
|
+
// detail: { loaded },
|
215
|
+
// });
|
216
|
+
// this.dispatchEvent(event);
|
217
|
+
// }
|
218
|
+
// parseItemInfo() {
|
219
|
+
// this.fileCount = this.itemMD?.files?.length || 0;
|
220
|
+
// }
|
221
|
+
// get imageUrl() {
|
222
|
+
// const { metadata = {} } = this.itemMD;
|
223
|
+
// const url = `${this.baseHost}/download/${metadata?.identifier}/__ia_thumb.jpg`;
|
224
|
+
// return url;
|
225
|
+
// }
|
226
|
+
// static get styles() {
|
227
|
+
// const main = css`
|
228
|
+
// :host {
|
229
|
+
// display: block;
|
230
|
+
// width: 100%;
|
231
|
+
// margin: 0 auto;
|
232
|
+
// position: relative;
|
233
|
+
// overflow: auto;
|
234
|
+
// background-color: black;
|
235
|
+
// color: var(--primaryTextColor, #fff);
|
236
|
+
// }
|
237
|
+
// :host,
|
238
|
+
// section {
|
239
|
+
// min-height: inherit;
|
240
|
+
// height: inherit;
|
241
|
+
// }
|
242
|
+
// section {
|
243
|
+
// margin: auto;
|
244
|
+
// width: 100%;
|
245
|
+
// text-align: center;
|
246
|
+
// }
|
247
|
+
// img {
|
248
|
+
// border: 1px solid var(--primaryTextColor, #fff);
|
249
|
+
// }
|
250
|
+
// `;
|
251
|
+
// return [main];
|
252
|
+
// }
|
253
|
+
// }
|
271
254
|
//# sourceMappingURL=item-inspector.js.map
|