@internetarchive/ia-item-navigator 0.0.0-a7 → 0.0.1

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