@internetarchive/ia-item-navigator 0.0.0-a10 → 0.0.0-a12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/demo/app-root.ts +6 -4
  2. package/dist/demo/app-root.d.ts +0 -1
  3. package/dist/demo/app-root.js +1 -3
  4. package/dist/demo/app-root.js.map +1 -1
  5. package/dist/src/interfaces/nav-controller-interface.d.ts +9 -0
  6. package/dist/src/interfaces/nav-controller-interface.js.map +1 -1
  7. package/dist/src/item-inspector/item-inspector.d.ts +0 -47
  8. package/dist/src/item-inspector/item-inspector.js +253 -271
  9. package/dist/src/item-inspector/item-inspector.js.map +1 -1
  10. package/dist/src/item-navigator.d.ts +14 -7
  11. package/dist/src/item-navigator.js +60 -30
  12. package/dist/src/item-navigator.js.map +1 -1
  13. package/dist/src/no-theater-available.d.ts +9 -0
  14. package/dist/src/no-theater-available.js +79 -0
  15. package/dist/src/no-theater-available.js.map +1 -0
  16. package/dist/test/book-nav-stub.d.ts +17 -0
  17. package/dist/test/book-nav-stub.js +42 -0
  18. package/dist/test/book-nav-stub.js.map +1 -0
  19. package/dist/test/ia-item-navigator.test.d.ts +1 -0
  20. package/dist/test/ia-item-navigator.test.js +146 -114
  21. package/dist/test/ia-item-navigator.test.js.map +1 -1
  22. package/dist/test/ia-stub.d.ts +22 -0
  23. package/dist/test/ia-stub.js +34 -3
  24. package/dist/test/ia-stub.js.map +1 -1
  25. package/dist/test/no-theater-available.test.d.ts +1 -0
  26. package/dist/test/no-theater-available.test.js +27 -0
  27. package/dist/test/no-theater-available.test.js.map +1 -0
  28. package/package.json +3 -2
  29. package/src/interfaces/nav-controller-interface.ts +13 -0
  30. package/src/item-navigator.ts +69 -36
  31. package/src/no-theater-available.ts +87 -0
  32. package/test/book-nav-stub.ts +35 -0
  33. package/test/ia-item-navigator.test.ts +191 -143
  34. package/test/ia-stub.ts +78 -2
  35. package/test/no-theater-available.test.ts +32 -0
  36. package/src/item-inspector/item-inspector.ts +0 -296
package/demo/app-root.ts CHANGED
@@ -8,7 +8,6 @@ import {
8
8
  query,
9
9
  TemplateResult,
10
10
  } from 'lit-element';
11
- import '../src/item-inspector/item-inspector';
12
11
  import {
13
12
  MetadataResponse,
14
13
  SearchService,
@@ -38,7 +37,11 @@ export class AppRoot extends LitElement {
38
37
 
39
38
  firstUpdated() {
40
39
  this.fetchItemMD();
41
- console.log('<app-root> component has loaded', this.modalMgr, this.sharedObserver);
40
+ console.log(
41
+ '<app-root> component has loaded',
42
+ this.modalMgr,
43
+ this.sharedObserver
44
+ );
42
45
  }
43
46
 
44
47
  /**
@@ -66,8 +69,7 @@ export class AppRoot extends LitElement {
66
69
 
67
70
  async fetchItemMD() {
68
71
  const searchService = SearchService.default;
69
- // const mdResponse = await searchService.fetchMetadata('ux-team-books');
70
- const mdResponse = await searchService.fetchMetadata('goody');
72
+ const mdResponse = await searchService.fetchMetadata('ux-team-books');
71
73
 
72
74
  if (mdResponse.error) {
73
75
  console.log('MD Fetch error: ', mdResponse.error);
@@ -1,5 +1,4 @@
1
1
  import { LitElement, TemplateResult } from 'lit-element';
2
- import '../src/item-inspector/item-inspector';
3
2
  import { MetadataResponse } from '@internetarchive/search-service';
4
3
  import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
5
4
  import '../src/item-navigator';
@@ -1,7 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
2
  /* eslint-disable no-restricted-globals */
3
3
  import { html, css, LitElement, customElement, property, query, } from 'lit-element';
4
- import '../src/item-inspector/item-inspector';
5
4
  import { SearchService, } from '@internetarchive/search-service';
6
5
  import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
7
6
  import '../src/item-navigator';
@@ -44,8 +43,7 @@ let AppRoot = class AppRoot extends LitElement {
44
43
  }
45
44
  async fetchItemMD() {
46
45
  const searchService = SearchService.default;
47
- // const mdResponse = await searchService.fetchMetadata('ux-team-books');
48
- const mdResponse = await searchService.fetchMetadata('goody');
46
+ const mdResponse = await searchService.fetchMetadata('ux-team-books');
49
47
  if (mdResponse.error) {
50
48
  console.log('MD Fetch error: ', mdResponse.error);
51
49
  window.confirm('There was an error fetching response, please check dev console');
@@ -1 +1 @@
1
- {"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../demo/app-root.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EACV,aAAa,EACb,QAAQ,EACR,KAAK,GAEN,MAAM,aAAa,CAAC;AACrB,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAEL,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,uBAAuB,CAAC;AAC/B,yDAAyD;AAEzD,OAAO,gCAAgC,CAAC;AAGxC,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IAAvC;;QACE;;WAEG;QACyB,WAAM,GAAiC,SAAS,CAAC;QAEjD,iBAAY,GAAG,EAAE,CAAC;QAElB,oBAAe,GAAG,EAAE,CAAC;QAMjB,mBAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAwH9E,CAAC;IAtHC,YAAY;QACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAY;QAClB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACzB,IAAI,CAAC,eAAe,EAAE,CAAC;SACxB;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,eAAe;QACb,IAAI,IAAI,CAAC,cAAc,IA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O,IAAI,CAAA,iDAAiD,CAAC;IAC/D,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QACzE,OAAO,IAAI,CAAA;;QAEP,OAAO;;KAEV,CAAC;IACJ,CAAC;CA+BF,CAAA;AA7BQ,cAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,CAAC;AAjI0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAkD;AAEjD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAsB;AAErB;IAA3B,KAAK,CAAC,mBAAmB,CAAC;wCAAuB;AAE1B;IAAvB,KAAK,CAAC,eAAe,CAAC;yCAAgB;AAEP;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAA6C;AAdjE,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAsInB;SAtIY,OAAO","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n html,\n css,\n LitElement,\n customElement,\n property,\n query,\n TemplateResult,\n} from 'lit-element';\nimport '../src/item-inspector/item-inspector';\nimport {\n MetadataResponse,\n SearchService,\n} from '@internetarchive/search-service';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport '../src/item-navigator';\n// import { ItemNavigator } from '../src/item-navigator';\n\nimport '@internetarchive/modal-manager';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n /**\n * Example controller to connect to `<ia-item-navigator>`\n */\n @property({ type: Object }) itemMD: MetadataResponse | undefined = undefined;\n\n @property({ type: Object }) bookManifest = {};\n\n @property({ type: String }) encodedManifest = '';\n\n @query('ia-item-navigator') private itemNav!: any;\n\n @query('modal-manager') modalMgr!: any;\n\n @property({ attribute: false }) sharedObserver = new SharedResizeObserver();\n\n firstUpdated() {\n this.fetchItemMD();\n console.log('<app-root> component has loaded', this.modalMgr, this.sharedObserver);\n }\n\n /**\n * @inheritdoc\n */\n updated(changed: any) {\n console.log('changed', changed);\n if (changed.has('itemMD')) {\n this.fullscreenCheck();\n }\n }\n\n get theaterReady(): boolean {\n return this.modalMgr && this.sharedObserver && this.itemMD;\n }\n\n /**\n * toggles attr: `<ia-item-navigator viewportinfullscreen>`\n */\n fullscreenCheck() {\n if (this.showFullscreen && this.itemNav) {\n this.itemNav.viewportInFullscreen = true;\n }\n }\n\n async fetchItemMD() {\n const searchService = SearchService.default;\n // const mdResponse = await searchService.fetchMetadata('ux-team-books');\n const mdResponse = await searchService.fetchMetadata('goody');\n\n if (mdResponse.error) {\n console.log('MD Fetch error: ', mdResponse.error);\n (window as any).confirm(\n 'There was an error fetching response, please check dev console'\n );\n return;\n }\n\n console.log('mdResponse.success', JSON.stringify(mdResponse.success));\n this.itemMD = mdResponse.success;\n }\n\n get urlParams(): URLSearchParams {\n return new URLSearchParams(location.search.slice(1));\n }\n\n get showFullscreen(): boolean {\n return this.urlParams.get('view') === 'theater';\n }\n\n /**\n * sets url query param `view=theater` to toggle fullscreen\n */\n toggleFS(): void {\n if (this.urlParams.get('view')) {\n location.search = '';\n } else {\n location.search = 'view=theater';\n }\n }\n\n get theaterBlock(): TemplateResult {\n return html`\n <ia-item-navigator\n baseHost=\"https://archive.org\"\n .item=${this.itemMD}\n .modal=${this.modalMgr}\n .sharedObserver=${this.sharedObserver}\n @ViewportInFullScreen=${this.toggleFS}\n ></ia-item-navigator>\n `;\n }\n\n get placeholder(): TemplateResult {\n return html`<h2>Please hold as we fetch an item for ya</h2>`;\n }\n\n render(): TemplateResult {\n const theater = this.theaterReady ? this.theaterBlock : this.placeholder;\n return html`\n <h1>theater, in page</h1>\n ${theater}\n <modal-manager></modal-manager>\n `;\n }\n\n static styles = css`\n :host {\n border: 1px solid pink;\n color: #222;\n }\n\n :host,\n ia-item-navigator {\n display: block;\n position: relative;\n width: 100%;\n min-height: 64vh;\n height: 64vh;\n }\n ia-item-navigator {\n height: inherit;\n min-height: inherit;\n }\n div {\n position: relative;\n overflow: hidden;\n height: 100%;\n min-height: inherit;\n }\n\n modal-manager[mode='closed'] {\n display: none;\n }\n `;\n}\n"]}
1
+ {"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../demo/app-root.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EACV,aAAa,EACb,QAAQ,EACR,KAAK,GAEN,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,uBAAuB,CAAC;AAC/B,yDAAyD;AAEzD,OAAO,gCAAgC,CAAC;AAGxC,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IAAvC;;QACE;;WAEG;QACyB,WAAM,GAAiC,SAAS,CAAC;QAEjD,iBAAY,GAAG,EAAE,CAAC;QAElB,oBAAe,GAAG,EAAE,CAAC;QAMjB,mBAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC;IA2H9E,CAAC;IAzHC,YAAY;QACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CACT,iCAAiC,EACjC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAY;QAClB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACzB,IAAI,CAAC,eAAe,EAAE,CAAC;SACxB;IACH,CAAC;IAED,IAAI,YA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I,CAAC,MAAM;iBACV,IAAI,CAAC,QAAQ;0BACJ,IAAI,CAAC,cAAc;gCACb,IAAI,CAAC,QAAQ;;KAExC,CAAC;IACJ,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAA,iDAAiD,CAAC;IAC/D,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QACzE,OAAO,IAAI,CAAA;;QAEP,OAAO;;KAEV,CAAC;IACJ,CAAC;CA+BF,CAAA;AA7BQ,cAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,CAAC;AApI0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAkD;AAEjD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAsB;AAErB;IAA3B,KAAK,CAAC,mBAAmB,CAAC;wCAAuB;AAE1B;IAAvB,KAAK,CAAC,eAAe,CAAC;yCAAgB;AAEP;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAA6C;AAdjE,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAyInB;SAzIY,OAAO","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n html,\n css,\n LitElement,\n customElement,\n property,\n query,\n TemplateResult,\n} from 'lit-element';\nimport {\n MetadataResponse,\n SearchService,\n} from '@internetarchive/search-service';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport '../src/item-navigator';\n// import { ItemNavigator } from '../src/item-navigator';\n\nimport '@internetarchive/modal-manager';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n /**\n * Example controller to connect to `<ia-item-navigator>`\n */\n @property({ type: Object }) itemMD: MetadataResponse | undefined = undefined;\n\n @property({ type: Object }) bookManifest = {};\n\n @property({ type: String }) encodedManifest = '';\n\n @query('ia-item-navigator') private itemNav!: any;\n\n @query('modal-manager') modalMgr!: any;\n\n @property({ attribute: false }) sharedObserver = new SharedResizeObserver();\n\n firstUpdated() {\n this.fetchItemMD();\n console.log(\n '<app-root> component has loaded',\n this.modalMgr,\n this.sharedObserver\n );\n }\n\n /**\n * @inheritdoc\n */\n updated(changed: any) {\n console.log('changed', changed);\n if (changed.has('itemMD')) {\n this.fullscreenCheck();\n }\n }\n\n get theaterReady(): boolean {\n return this.modalMgr && this.sharedObserver && this.itemMD;\n }\n\n /**\n * toggles attr: `<ia-item-navigator viewportinfullscreen>`\n */\n fullscreenCheck() {\n if (this.showFullscreen && this.itemNav) {\n this.itemNav.viewportInFullscreen = true;\n }\n }\n\n async fetchItemMD() {\n const searchService = SearchService.default;\n const mdResponse = await searchService.fetchMetadata('ux-team-books');\n\n if (mdResponse.error) {\n console.log('MD Fetch error: ', mdResponse.error);\n (window as any).confirm(\n 'There was an error fetching response, please check dev console'\n );\n return;\n }\n\n console.log('mdResponse.success', JSON.stringify(mdResponse.success));\n this.itemMD = mdResponse.success;\n }\n\n get urlParams(): URLSearchParams {\n return new URLSearchParams(location.search.slice(1));\n }\n\n get showFullscreen(): boolean {\n return this.urlParams.get('view') === 'theater';\n }\n\n /**\n * sets url query param `view=theater` to toggle fullscreen\n */\n toggleFS(): void {\n if (this.urlParams.get('view')) {\n location.search = '';\n } else {\n location.search = 'view=theater';\n }\n }\n\n get theaterBlock(): TemplateResult {\n return html`\n <ia-item-navigator\n baseHost=\"https://archive.org\"\n .item=${this.itemMD}\n .modal=${this.modalMgr}\n .sharedObserver=${this.sharedObserver}\n @ViewportInFullScreen=${this.toggleFS}\n ></ia-item-navigator>\n `;\n }\n\n get placeholder(): TemplateResult {\n return html`<h2>Please hold as we fetch an item for ya</h2>`;\n }\n\n render(): TemplateResult {\n const theater = this.theaterReady ? this.theaterBlock : this.placeholder;\n return html`\n <h1>theater, in page</h1>\n ${theater}\n <modal-manager></modal-manager>\n `;\n }\n\n static styles = css`\n :host {\n border: 1px solid pink;\n color: #222;\n }\n\n :host,\n ia-item-navigator {\n display: block;\n position: relative;\n width: 100%;\n min-height: 64vh;\n height: 64vh;\n }\n ia-item-navigator {\n height: inherit;\n min-height: inherit;\n }\n div {\n position: relative;\n overflow: hidden;\n height: 100%;\n min-height: inherit;\n }\n\n modal-manager[mode='closed'] {\n display: none;\n }\n `;\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  import { LitElement } from 'lit-element';
2
2
  import { MetadataResponse } from '@internetarchive/search-service';
3
+ import { ModalManager } from '@internetarchive/modal-manager';
4
+ import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
3
5
  import { IntMenuShortcut } from './menu-interfaces';
4
6
  export interface IntNavController extends LitElement {
5
7
  baseHost: string;
@@ -7,9 +9,16 @@ export interface IntNavController extends LitElement {
7
9
  menuProviders: object;
8
10
  menuShortcuts: IntMenuShortcut[];
9
11
  sideMenuOpen: boolean;
12
+ signedIn: boolean;
13
+ sharedObserver: SharedResizeObserver;
14
+ modal: ModalManager;
10
15
  emitLoadingStatusUpdate: (loaded: boolean) => void;
11
16
  addMenuShortcut: (menuId: string) => void;
12
17
  removeMenuShortcut: (menuId: string) => void;
13
18
  sortMenuShortcuts: () => void;
14
19
  emitMenuShortcutsUpdated: () => void;
20
+ book: MetadataResponse;
21
+ }
22
+ export interface BookNavigator extends IntNavController {
23
+ book: MetadataResponse;
15
24
  }
@@ -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 { 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 signedIn: boolean;\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 book: MetadataResponse;\n}\n\nexport interface BookNavigator extends IntNavController {\n book: MetadataResponse;\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 {};