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