@internetarchive/ia-item-navigator 2.0.0-alpha6 → 2.0.0-alpha7

Sign up to get free protection for your applications and to get access to all the features.
package/demo/app-root.ts CHANGED
@@ -20,20 +20,21 @@ import { viewableFilesIcon } from '../src/menus/iaux-viewable-files';
20
20
 
21
21
  const fileList = [
22
22
  {
23
- file_origin: "",
24
- file_source: "beyonce-cosmo-article.pdf",
25
- file_subprefix: "beyonce-cosmo-article",
23
+ file_origin: '',
24
+ file_source: 'beyonce-cosmo-article.pdf',
25
+ file_subprefix: 'beyonce-cosmo-article',
26
26
  orig_sort: 0,
27
- title: "beyonce-cosmo-article.pdf",
28
- url_path: "/details/pdf_only_item/beyonce-cosmo-article.pdf",
27
+ title: 'beyonce-cosmo-article.pdf',
28
+ url_path: '/details/pdf_only_item/beyonce-cosmo-article.pdf',
29
29
  },
30
30
  {
31
- file_origin: "",
32
- file_source: "onestrandriverpdf.pdf",
33
- file_subprefix: "onestrandriverpdf",
31
+ file_origin: '',
32
+ file_source: 'onestrandriverpdf.pdf',
33
+ file_subprefix: 'onestrandriverpdf',
34
34
  orig_sort: 1,
35
- title: "Very cool title that is extra long so it wraps for three rows and close to the right side of the pane",
36
- url_path: "/details/pdf_only_item/onestrandriverpdf.pdf",
35
+ title:
36
+ 'Very cool title that is extra long so it wraps for three rows and close to the right side of the pane',
37
+ url_path: '/details/pdf_only_item/onestrandriverpdf.pdf',
37
38
  },
38
39
  {
39
40
  url_path: '/details/masterbookofamericanfolksong00shep',
@@ -11,20 +11,20 @@ import { iauxShareIcon } from '../src/menus/iaux-sharing-options';
11
11
  import { viewableFilesIcon } from '../src/menus/iaux-viewable-files';
12
12
  const fileList = [
13
13
  {
14
- file_origin: "",
15
- file_source: "beyonce-cosmo-article.pdf",
16
- file_subprefix: "beyonce-cosmo-article",
14
+ file_origin: '',
15
+ file_source: 'beyonce-cosmo-article.pdf',
16
+ file_subprefix: 'beyonce-cosmo-article',
17
17
  orig_sort: 0,
18
- title: "beyonce-cosmo-article.pdf",
19
- url_path: "/details/pdf_only_item/beyonce-cosmo-article.pdf",
18
+ title: 'beyonce-cosmo-article.pdf',
19
+ url_path: '/details/pdf_only_item/beyonce-cosmo-article.pdf',
20
20
  },
21
21
  {
22
- file_origin: "",
23
- file_source: "onestrandriverpdf.pdf",
24
- file_subprefix: "onestrandriverpdf",
22
+ file_origin: '',
23
+ file_source: 'onestrandriverpdf.pdf',
24
+ file_subprefix: 'onestrandriverpdf',
25
25
  orig_sort: 1,
26
- title: "Very cool title that is extra long so it wraps for three rows and close to the right side of the pane",
27
- url_path: "/details/pdf_only_item/onestrandriverpdf.pdf",
26
+ title: 'Very cool title that is extra long so it wraps for three rows and close to the right side of the pane',
27
+ url_path: '/details/pdf_only_item/onestrandriverpdf.pdf',
28
28
  },
29
29
  {
30
30
  url_path: '/details/masterbookofamericanfolksong00shep',
@@ -1 +1 @@
1
- {"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../demo/app-root.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEL,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,gCAAgC,CAAC;AAExC,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAK3C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,QAAQ,GAAG;IACf;QACE,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,2BAA2B;QACxC,cAAc,EAAE,uBAAuB;QACvC,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,2BAA2B;QAClC,QAAQ,EAAE,kDAAkD;K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AQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CACD;AAG3C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACA;AAEiB;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAE5C;AAGhB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDACrB;AAEZ;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAqC;AAEzB;IAArC,KAAK,CAAC,qBAAqB,CAAC;wCAAiC;AAEtC;IAAvB,KAAK,CAAC,eAAe,CAAC;yCAAyB;AAvCrC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA6XnB","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport { html, css, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport {\n MetadataResponse,\n SearchService,\n} from '@internetarchive/search-service';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport '@internetarchive/modal-manager';\nimport type { ItemNavigator } from '../src/iaux-item-navigator';\nimport '../src/iaux-item-navigator';\nimport '../src/menus/iaux-sharing-options';\nimport {\n MenuShortcutInterface,\n MenuProviderInterface,\n} from '../src/interfaces/menu-interfaces';\nimport { iauxShareIcon } from '../src/menus/iaux-sharing-options';\nimport { viewableFilesIcon } from '../src/menus/iaux-viewable-files';\n\nconst fileList = [\n {\n file_origin: \"\",\n file_source: \"beyonce-cosmo-article.pdf\",\n file_subprefix: \"beyonce-cosmo-article\",\n orig_sort: 0,\n title: \"beyonce-cosmo-article.pdf\",\n url_path: \"/details/pdf_only_item/beyonce-cosmo-article.pdf\",\n },\n {\n file_origin: \"\",\n file_source: \"onestrandriverpdf.pdf\",\n file_subprefix: \"onestrandriverpdf\",\n orig_sort: 1,\n title: \"Very cool title that is extra long so it wraps for three rows and close to the right side of the pane\",\n url_path: \"/details/pdf_only_item/onestrandriverpdf.pdf\",\n },\n {\n url_path: '/details/masterbookofamericanfolksong00shep',\n file_subprefix: '01-The Master Book of American Folk Song',\n title: 'The Master Book of American Folk Song',\n file_source: '/01-The Master Book of American Folk Song_jp2.zip',\n orig_sort: 0,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/02-Encyclopedia%20of%20the%20Traditional%20Music%20and%20Folk%20Songs%20of%20the%20United%20States%20Index%20A%20through%20M',\n file_subprefix:\n '02-Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M',\n title:\n 'Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M',\n file_source:\n '/02-Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M_jp2.zip',\n orig_sort: 1,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/03-Encyclopedia%20of%20the%20Traditional%20Music%20and%20Folk%20Songs%20of%20the%20United%20States%20Index%20N%20through%20Z',\n file_subprefix:\n '03-Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z',\n title:\n 'Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z',\n file_source:\n '/03-Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z_jp2.zip',\n orig_sort: 2,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/04-Letters%20to%20Riley%20Shepard',\n file_subprefix: '04-Letters to Riley Shepard',\n title: 'Letters to Riley Shepard',\n file_source: '/04-Letters to Riley Shepard_jp2.zip',\n orig_sort: 3,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%201',\n file_subprefix: 'Master Book of American Folk Song Vol. 1',\n title: 'Master Book of American Folk Song Vol. 1.pdf',\n file_source: '/Master Book of American Folk Song Vol. 1_jp2.zip',\n orig_sort: 4,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%202',\n file_subprefix: 'Master Book of American Folk Song Vol. 2',\n title: 'Master Book of American Folk Song Vol. 2.pdf',\n file_source: '/Master Book of American Folk Song Vol. 2_jp2.zip',\n orig_sort: 5,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%203',\n file_subprefix: 'Master Book of American Folk Song Vol. 3',\n title: 'Master Book of American Folk Song Vol. 3.pdf',\n file_source: '/Master Book of American Folk Song Vol. 3_jp2.zip',\n orig_sort: 6,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%204',\n file_subprefix: 'Master Book of American Folk Song Vol. 4',\n title: 'Master Book of American Folk Song Vol. 4.pdf',\n file_source: '/Master Book of American Folk Song Vol. 4_jp2.zip',\n orig_sort: 7,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%205',\n file_subprefix: 'Master Book of American Folk Song Vol. 5',\n title: 'Master Book of American Folk Song Vol. 5',\n file_source: '/Master Book of American Folk Song Vol. 5_jp2.zip',\n orig_sort: 8,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%206',\n file_subprefix: 'Master Book of American Folk Song Vol. 6',\n title: 'Master Book of American Folk Song Vol. 6.pdf',\n file_source: '/Master Book of American Folk Song Vol. 6_jp2.zip',\n orig_sort: 9,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%207',\n file_subprefix: 'Master Book of American Folk Song Vol. 7',\n title: 'Master Book of American Folk Song Vol. 7.pdf',\n file_source: '/Master Book of American Folk Song Vol. 7_jp2.zip',\n orig_sort: 10,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%208',\n file_subprefix: 'Master Book of American Folk Song Vol. 8',\n title: 'Master Book of American Folk Song Vol. 8.pdf',\n file_source: '/Master Book of American Folk Song Vol. 8_jp2.zip',\n orig_sort: 11,\n },\n];\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n /**\n * Example controller to connect to `<iaux-item-navigator>`\n */\n @property({ type: Object }) itemMD?: MetadataResponse;\n\n @property({ type: String }) encodedManifest = '';\n\n @property({ attribute: false }) sharedObserver = new SharedResizeObserver();\n\n @property({ type: Array, attribute: false })\n menuContents: MenuProviderInterface[] = [];\n\n @property({ type: Array, attribute: false })\n menuShortcuts: MenuShortcutInterface[] = [];\n\n @property({ reflect: true, attribute: true, type: Boolean }) fullscreen:\n | boolean\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) headerOn:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) loaded:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) showPlaceholder:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean })\n showTheaterExample: true | null = null;\n\n @property({ type: Array }) fileListToDisplay: any[] = fileList;\n\n @query('iaux-item-navigator') private itemNav!: ItemNavigator;\n\n @query('modal-manager') modalMgr!: ModalManager;\n\n firstUpdated() {\n this.fetchItemMD();\n console.log(\n '<app-root> component has loaded',\n this.modalMgr,\n this.sharedObserver,\n );\n\n this.itemNav.viewAvailable = false;\n }\n\n updated(changed: any) {\n console.log('changed', changed);\n if (changed.has('itemMD')) {\n this.fullscreenCheck();\n }\n\n if (changed.has('fileList')) {\n this.drawMenus();\n }\n }\n\n async fetchItemMD() {\n const searchService = SearchService.default;\n\n // masterbookofamericanfolksong00shep => multiple files\n // ux-team-books => item\n const mdResponse = await searchService.fetchMetadata(\n 'masterbookofamericanfolksong00shep',\n );\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 this.toggleTheaterExample();\n }\n\n get theaterReady(): boolean {\n return this.modalMgr && this.sharedObserver && !!this.itemMD;\n }\n\n get urlParams(): URLSearchParams {\n return new URLSearchParams(location.search.slice(1));\n }\n\n /** Fullscreen */\n get showFullscreen(): boolean {\n return this.urlParams.get('view') === 'theater';\n }\n\n /** sets url query param `view=theater` to toggle fullscreen */\n toggleFS(): void {\n if (this.urlParams.get('view')) {\n location.search = '';\n } else {\n location.search = 'view=theater';\n }\n }\n\n /** toggles attr: `<iaux-item-navigator viewportinfullscreen>` */\n fullscreenCheck(): void {\n if (this.showFullscreen && this.itemNav) {\n this.fullscreen = true;\n }\n }\n /** End fullscreen */\n\n toggleHeader() {\n this.headerOn = this.headerOn ? null : true;\n }\n\n toggleLoader() {\n const nextState = this.loaded === true ? null : true;\n this.loaded = nextState;\n }\n\n togglePlaceholder() {\n this.toggleLoader();\n const show = this.showPlaceholder ? null : true;\n this.showPlaceholder = show;\n }\n\n toggleImmersion() {\n const nextState = this.fullscreen ? null : true;\n if (!nextState) {\n this.menuShortcuts = [];\n return;\n }\n this.menuShortcuts = [\n {\n icon: html`<button\n @click=${() => {\n this.fullscreen = null;\n this.menuContents = [];\n this.menuShortcuts = [];\n }}\n >\n Exit\n </button>`,\n id: 'exit',\n },\n ];\n this.menuContents = [\n {\n icon: html`<button\n @click=${() => {\n this.fullscreen = null;\n }}\n >\n Exit\n </button>`,\n id: 'exit',\n label: 'Exit',\n selected: false,\n },\n ] as any as MenuProviderInterface[];\n\n this.fullscreen = nextState;\n }\n\n toggleTheaterExample() {\n if (this.showTheaterExample) {\n // turn on placeholder\n this.showPlaceholder = true;\n // turn off example\n this.showTheaterExample = null;\n\n this.menuContents = [];\n this.menuShortcuts = [];\n return;\n }\n\n // turn off placeholder\n this.showPlaceholder = null;\n this.showTheaterExample = true;\n this.drawMenus();\n }\n\n drawMenus() {\n const shareMenu = {\n icon: iauxShareIcon,\n label: 'Share this item',\n id: 'share',\n component: html`<iaux-sharing-options\n .identifier=${this.itemMD?.metadata.identifier || 'ux-team-books'}\n .type=${`book`}\n .creator=${`UX Team`}\n .description=${'list of test books'}\n .baseHost=${'archive.org'}\n .fileSubPrefix=${''}\n ></iaux-sharing-options>`,\n } as unknown as MenuProviderInterface;\n\n const filesNewArr = [...fileList];\n const viewableFilesMenu = {\n id: 'viewable-files',\n icon: viewableFilesIcon,\n label: `Viewable Files (${fileList.length})`,\n baseHost: 'archive.org',\n item: this.itemMD as MetadataResponse,\n subPrefix: '',\n // sorter\n actionButton: html`<iaux-sort-viewable-files\n @fileListSorted=${(e: CustomEvent) => this.sortFilesCallback(e)}\n .fileListRaw=${fileList}\n ></iaux-sort-viewable-files>`,\n component: html`<iaux-viewable-files\n .fileList=${filesNewArr}\n ></iaux-viewable-files> `,\n };\n\n this.menuContents = [viewableFilesMenu, shareMenu];\n this.menuShortcuts = [viewableFilesMenu, shareMenu];\n }\n\n async sortFilesCallback(e: CustomEvent) {\n const { sortType, sortedFiles } = e.detail;\n this.fileListToDisplay = sortedFiles;\n console.log('fileListSorted', { sortType, sortedFiles });\n await this.updateComplete;\n console.log('fileListSortedasyncd', { sortType, sortedFiles });\n this.drawMenus();\n // debugger;\n }\n\n /** Views */\n get theaterExample(): TemplateResult {\n return html`\n <div slot=\"main\">\n <div class=\"theater-example\">\n <img\n alt=\"cat theater\"\n src=\"https://archive.org/download/masterbookofamericanfolksong00shep/__ia_thumb.jpg\"\n />\n <h3>Welcome to Cat Theater</h3>\n </div>\n </div>\n `;\n }\n\n get headerExample(): TemplateResult {\n return html`\n <div slot=\"header\">\n <div class=\"embed-link\">\n <img\n src=\"https://archive.org/images/glogo-jw.png\"\n alt=\"glowing ia logo\"\n />\n <a href=\"/details/goody\">\n The history of Little Goody Two-Shoes : otherwise called Mrs.\n Margery Two-Shoes ... [1766 edition]\n </a>\n </div>\n </div>\n `;\n }\n\n get isViewAvailable(): boolean {\n if (this.showTheaterExample) {\n return true;\n }\n return false;\n }\n\n render(): TemplateResult {\n const {\n isViewAvailable,\n loaded,\n showPlaceholder,\n headerOn,\n fullscreen,\n menuContents,\n menuShortcuts,\n showTheaterExample,\n } = this;\n console.log('&&&& item nav properties', {\n loaded,\n headerOn,\n isViewAvailable,\n showTheaterExample,\n showPlaceholder,\n fullscreen,\n menuContents,\n menuShortcuts,\n });\n return html`\n <h1>theater, in page</h1>\n <section>\n <iaux-item-navigator\n baseHost=\"https://archive.org\"\n .item=${this.itemMD}\n .modal=${this.modalMgr}\n .sharedObserver=${this.sharedObserver}\n .loaded=${this.loaded}\n ?viewAvailable=${!!this.showTheaterExample}\n .menuContents=${this.menuContents}\n .menuShortcuts=${this.menuShortcuts}\n .viewportInFullscreen=${this.fullscreen}\n >\n ${this.headerOn ? this.headerExample : ''}\n ${this.showTheaterExample ? this.theaterExample : ''}\n </iaux-item-navigator>\n </section>\n <div>\n <button @click=${this.toggleHeader}>toggle header</button>\n <button @click=${this.toggleLoader}>toggle loader</button>\n <button @click=${this.togglePlaceholder}>toggle placeholder</button>\n <button @click=${this.toggleTheaterExample}>toggle new theater</button>\n <button @click=${this.toggleImmersion}>toggle immersion</button>\n </div>\n <modal-manager></modal-manager>\n `;\n }\n\n static styles = css`\n :host([fullscreen]),\n :host([fullscreen]) section {\n height: 100vh;\n width: 100vw;\n }\n\n :host([fullscreen]) h1 {\n display: none;\n }\n\n h1 {\n color: black;\n }\n\n section {\n border: 1px solid pink;\n color: #222;\n height: calc(100vh - 200px);\n }\n\n :host,\n iaux-item-navigator {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .embed-link {\n height: 55px;\n border: 1px solid yellow;\n }\n\n .theater-example {\n color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n margin: 10px;\n border: 5px dotted yellow;\n flex: 1;\n }\n\n div[slot='main'] {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n div[slot='main'] > * {\n flex: 1;\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,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEL,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,gCAAgC,CAAC;AAExC,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAK3C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,QAAQ,GAAG;IACf;QACE,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,2BAA2B;QACxC,cAAc,EAAE,uBAAuB;QACvC,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,2BAA2B;QAClC,QAAQ,EAAE,kDAAkD;KAC7D;IACD;QACE,WAAW,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AAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CACD;AAG3C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACA;AAEiB;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAE5C;AAE6C;IAA5D,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAE5C;AAGhB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDACrB;AAEZ;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAqC;AAEzB;IAArC,KAAK,CAAC,qBAAqB,CAAC;wCAAiC;AAEtC;IAAvB,KAAK,CAAC,eAAe,CAAC;yCAAyB;AAvCrC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA6XnB","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport { html, css, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport {\n MetadataResponse,\n SearchService,\n} from '@internetarchive/search-service';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport '@internetarchive/modal-manager';\nimport type { ItemNavigator } from '../src/iaux-item-navigator';\nimport '../src/iaux-item-navigator';\nimport '../src/menus/iaux-sharing-options';\nimport {\n MenuShortcutInterface,\n MenuProviderInterface,\n} from '../src/interfaces/menu-interfaces';\nimport { iauxShareIcon } from '../src/menus/iaux-sharing-options';\nimport { viewableFilesIcon } from '../src/menus/iaux-viewable-files';\n\nconst fileList = [\n {\n file_origin: '',\n file_source: 'beyonce-cosmo-article.pdf',\n file_subprefix: 'beyonce-cosmo-article',\n orig_sort: 0,\n title: 'beyonce-cosmo-article.pdf',\n url_path: '/details/pdf_only_item/beyonce-cosmo-article.pdf',\n },\n {\n file_origin: '',\n file_source: 'onestrandriverpdf.pdf',\n file_subprefix: 'onestrandriverpdf',\n orig_sort: 1,\n title:\n 'Very cool title that is extra long so it wraps for three rows and close to the right side of the pane',\n url_path: '/details/pdf_only_item/onestrandriverpdf.pdf',\n },\n {\n url_path: '/details/masterbookofamericanfolksong00shep',\n file_subprefix: '01-The Master Book of American Folk Song',\n title: 'The Master Book of American Folk Song',\n file_source: '/01-The Master Book of American Folk Song_jp2.zip',\n orig_sort: 0,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/02-Encyclopedia%20of%20the%20Traditional%20Music%20and%20Folk%20Songs%20of%20the%20United%20States%20Index%20A%20through%20M',\n file_subprefix:\n '02-Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M',\n title:\n 'Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M',\n file_source:\n '/02-Encyclopedia of the Traditional Music and Folk Songs of the United States Index A through M_jp2.zip',\n orig_sort: 1,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/03-Encyclopedia%20of%20the%20Traditional%20Music%20and%20Folk%20Songs%20of%20the%20United%20States%20Index%20N%20through%20Z',\n file_subprefix:\n '03-Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z',\n title:\n 'Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z',\n file_source:\n '/03-Encyclopedia of the Traditional Music and Folk Songs of the United States Index N through Z_jp2.zip',\n orig_sort: 2,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/04-Letters%20to%20Riley%20Shepard',\n file_subprefix: '04-Letters to Riley Shepard',\n title: 'Letters to Riley Shepard',\n file_source: '/04-Letters to Riley Shepard_jp2.zip',\n orig_sort: 3,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%201',\n file_subprefix: 'Master Book of American Folk Song Vol. 1',\n title: 'Master Book of American Folk Song Vol. 1.pdf',\n file_source: '/Master Book of American Folk Song Vol. 1_jp2.zip',\n orig_sort: 4,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%202',\n file_subprefix: 'Master Book of American Folk Song Vol. 2',\n title: 'Master Book of American Folk Song Vol. 2.pdf',\n file_source: '/Master Book of American Folk Song Vol. 2_jp2.zip',\n orig_sort: 5,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%203',\n file_subprefix: 'Master Book of American Folk Song Vol. 3',\n title: 'Master Book of American Folk Song Vol. 3.pdf',\n file_source: '/Master Book of American Folk Song Vol. 3_jp2.zip',\n orig_sort: 6,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%204',\n file_subprefix: 'Master Book of American Folk Song Vol. 4',\n title: 'Master Book of American Folk Song Vol. 4.pdf',\n file_source: '/Master Book of American Folk Song Vol. 4_jp2.zip',\n orig_sort: 7,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%205',\n file_subprefix: 'Master Book of American Folk Song Vol. 5',\n title: 'Master Book of American Folk Song Vol. 5',\n file_source: '/Master Book of American Folk Song Vol. 5_jp2.zip',\n orig_sort: 8,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%206',\n file_subprefix: 'Master Book of American Folk Song Vol. 6',\n title: 'Master Book of American Folk Song Vol. 6.pdf',\n file_source: '/Master Book of American Folk Song Vol. 6_jp2.zip',\n orig_sort: 9,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%207',\n file_subprefix: 'Master Book of American Folk Song Vol. 7',\n title: 'Master Book of American Folk Song Vol. 7.pdf',\n file_source: '/Master Book of American Folk Song Vol. 7_jp2.zip',\n orig_sort: 10,\n },\n {\n url_path:\n '/details/masterbookofamericanfolksong00shep/Master%20Book%20of%20American%20Folk%20Song%20Vol.%208',\n file_subprefix: 'Master Book of American Folk Song Vol. 8',\n title: 'Master Book of American Folk Song Vol. 8.pdf',\n file_source: '/Master Book of American Folk Song Vol. 8_jp2.zip',\n orig_sort: 11,\n },\n];\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n /**\n * Example controller to connect to `<iaux-item-navigator>`\n */\n @property({ type: Object }) itemMD?: MetadataResponse;\n\n @property({ type: String }) encodedManifest = '';\n\n @property({ attribute: false }) sharedObserver = new SharedResizeObserver();\n\n @property({ type: Array, attribute: false })\n menuContents: MenuProviderInterface[] = [];\n\n @property({ type: Array, attribute: false })\n menuShortcuts: MenuShortcutInterface[] = [];\n\n @property({ reflect: true, attribute: true, type: Boolean }) fullscreen:\n | boolean\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) headerOn:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) loaded:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean }) showPlaceholder:\n | true\n | null = null;\n\n @property({ reflect: true, attribute: true, type: Boolean })\n showTheaterExample: true | null = null;\n\n @property({ type: Array }) fileListToDisplay: any[] = fileList;\n\n @query('iaux-item-navigator') private itemNav!: ItemNavigator;\n\n @query('modal-manager') modalMgr!: ModalManager;\n\n firstUpdated() {\n this.fetchItemMD();\n console.log(\n '<app-root> component has loaded',\n this.modalMgr,\n this.sharedObserver,\n );\n\n this.itemNav.viewAvailable = false;\n }\n\n updated(changed: any) {\n console.log('changed', changed);\n if (changed.has('itemMD')) {\n this.fullscreenCheck();\n }\n\n if (changed.has('fileList')) {\n this.drawMenus();\n }\n }\n\n async fetchItemMD() {\n const searchService = SearchService.default;\n\n // masterbookofamericanfolksong00shep => multiple files\n // ux-team-books => item\n const mdResponse = await searchService.fetchMetadata(\n 'masterbookofamericanfolksong00shep',\n );\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 this.toggleTheaterExample();\n }\n\n get theaterReady(): boolean {\n return this.modalMgr && this.sharedObserver && !!this.itemMD;\n }\n\n get urlParams(): URLSearchParams {\n return new URLSearchParams(location.search.slice(1));\n }\n\n /** Fullscreen */\n get showFullscreen(): boolean {\n return this.urlParams.get('view') === 'theater';\n }\n\n /** sets url query param `view=theater` to toggle fullscreen */\n toggleFS(): void {\n if (this.urlParams.get('view')) {\n location.search = '';\n } else {\n location.search = 'view=theater';\n }\n }\n\n /** toggles attr: `<iaux-item-navigator viewportinfullscreen>` */\n fullscreenCheck(): void {\n if (this.showFullscreen && this.itemNav) {\n this.fullscreen = true;\n }\n }\n /** End fullscreen */\n\n toggleHeader() {\n this.headerOn = this.headerOn ? null : true;\n }\n\n toggleLoader() {\n const nextState = this.loaded === true ? null : true;\n this.loaded = nextState;\n }\n\n togglePlaceholder() {\n this.toggleLoader();\n const show = this.showPlaceholder ? null : true;\n this.showPlaceholder = show;\n }\n\n toggleImmersion() {\n const nextState = this.fullscreen ? null : true;\n if (!nextState) {\n this.menuShortcuts = [];\n return;\n }\n this.menuShortcuts = [\n {\n icon: html`<button\n @click=${() => {\n this.fullscreen = null;\n this.menuContents = [];\n this.menuShortcuts = [];\n }}\n >\n Exit\n </button>`,\n id: 'exit',\n },\n ];\n this.menuContents = [\n {\n icon: html`<button\n @click=${() => {\n this.fullscreen = null;\n }}\n >\n Exit\n </button>`,\n id: 'exit',\n label: 'Exit',\n selected: false,\n },\n ] as any as MenuProviderInterface[];\n\n this.fullscreen = nextState;\n }\n\n toggleTheaterExample() {\n if (this.showTheaterExample) {\n // turn on placeholder\n this.showPlaceholder = true;\n // turn off example\n this.showTheaterExample = null;\n\n this.menuContents = [];\n this.menuShortcuts = [];\n return;\n }\n\n // turn off placeholder\n this.showPlaceholder = null;\n this.showTheaterExample = true;\n this.drawMenus();\n }\n\n drawMenus() {\n const shareMenu = {\n icon: iauxShareIcon,\n label: 'Share this item',\n id: 'share',\n component: html`<iaux-sharing-options\n .identifier=${this.itemMD?.metadata.identifier || 'ux-team-books'}\n .type=${`book`}\n .creator=${`UX Team`}\n .description=${'list of test books'}\n .baseHost=${'archive.org'}\n .fileSubPrefix=${''}\n ></iaux-sharing-options>`,\n } as unknown as MenuProviderInterface;\n\n const filesNewArr = [...fileList];\n const viewableFilesMenu = {\n id: 'viewable-files',\n icon: viewableFilesIcon,\n label: `Viewable Files (${fileList.length})`,\n baseHost: 'archive.org',\n item: this.itemMD as MetadataResponse,\n subPrefix: '',\n // sorter\n actionButton: html`<iaux-sort-viewable-files\n @fileListSorted=${(e: CustomEvent) => this.sortFilesCallback(e)}\n .fileListRaw=${fileList}\n ></iaux-sort-viewable-files>`,\n component: html`<iaux-viewable-files\n .fileList=${filesNewArr}\n ></iaux-viewable-files> `,\n };\n\n this.menuContents = [viewableFilesMenu, shareMenu];\n this.menuShortcuts = [viewableFilesMenu, shareMenu];\n }\n\n async sortFilesCallback(e: CustomEvent) {\n const { sortType, sortedFiles } = e.detail;\n this.fileListToDisplay = sortedFiles;\n console.log('fileListSorted', { sortType, sortedFiles });\n await this.updateComplete;\n console.log('fileListSortedasyncd', { sortType, sortedFiles });\n this.drawMenus();\n // debugger;\n }\n\n /** Views */\n get theaterExample(): TemplateResult {\n return html`\n <div slot=\"main\">\n <div class=\"theater-example\">\n <img\n alt=\"cat theater\"\n src=\"https://archive.org/download/masterbookofamericanfolksong00shep/__ia_thumb.jpg\"\n />\n <h3>Welcome to Cat Theater</h3>\n </div>\n </div>\n `;\n }\n\n get headerExample(): TemplateResult {\n return html`\n <div slot=\"header\">\n <div class=\"embed-link\">\n <img\n src=\"https://archive.org/images/glogo-jw.png\"\n alt=\"glowing ia logo\"\n />\n <a href=\"/details/goody\">\n The history of Little Goody Two-Shoes : otherwise called Mrs.\n Margery Two-Shoes ... [1766 edition]\n </a>\n </div>\n </div>\n `;\n }\n\n get isViewAvailable(): boolean {\n if (this.showTheaterExample) {\n return true;\n }\n return false;\n }\n\n render(): TemplateResult {\n const {\n isViewAvailable,\n loaded,\n showPlaceholder,\n headerOn,\n fullscreen,\n menuContents,\n menuShortcuts,\n showTheaterExample,\n } = this;\n console.log('&&&& item nav properties', {\n loaded,\n headerOn,\n isViewAvailable,\n showTheaterExample,\n showPlaceholder,\n fullscreen,\n menuContents,\n menuShortcuts,\n });\n return html`\n <h1>theater, in page</h1>\n <section>\n <iaux-item-navigator\n baseHost=\"https://archive.org\"\n .item=${this.itemMD}\n .modal=${this.modalMgr}\n .sharedObserver=${this.sharedObserver}\n .loaded=${this.loaded}\n ?viewAvailable=${!!this.showTheaterExample}\n .menuContents=${this.menuContents}\n .menuShortcuts=${this.menuShortcuts}\n .viewportInFullscreen=${this.fullscreen}\n >\n ${this.headerOn ? this.headerExample : ''}\n ${this.showTheaterExample ? this.theaterExample : ''}\n </iaux-item-navigator>\n </section>\n <div>\n <button @click=${this.toggleHeader}>toggle header</button>\n <button @click=${this.toggleLoader}>toggle loader</button>\n <button @click=${this.togglePlaceholder}>toggle placeholder</button>\n <button @click=${this.toggleTheaterExample}>toggle new theater</button>\n <button @click=${this.toggleImmersion}>toggle immersion</button>\n </div>\n <modal-manager></modal-manager>\n `;\n }\n\n static styles = css`\n :host([fullscreen]),\n :host([fullscreen]) section {\n height: 100vh;\n width: 100vw;\n }\n\n :host([fullscreen]) h1 {\n display: none;\n }\n\n h1 {\n color: black;\n }\n\n section {\n border: 1px solid pink;\n color: #222;\n height: calc(100vh - 200px);\n }\n\n :host,\n iaux-item-navigator {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .embed-link {\n height: 55px;\n border: 1px solid yellow;\n }\n\n .theater-example {\n color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n margin: 10px;\n border: 5px dotted yellow;\n flex: 1;\n }\n\n div[slot='main'] {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n div[slot='main'] > * {\n flex: 1;\n }\n\n modal-manager[mode='closed'] {\n display: none;\n }\n `;\n}\n"]}
@@ -20,7 +20,7 @@ export declare class ItemNavigator extends LitElement implements SharedResizeObs
20
20
  openMenu?: MenuId;
21
21
  modal?: ModalManager;
22
22
  sharedObserver?: SharedResizeObserver;
23
- loaded: true | null;
23
+ loaded: boolean;
24
24
  openMenuState: 'overlay' | 'shift';
25
25
  private frame;
26
26
  private headerSlot;
@@ -16,7 +16,7 @@ let ItemNavigator = class ItemNavigator extends LitElement {
16
16
  this.menuShortcuts = [];
17
17
  this.viewportInFullscreen = null;
18
18
  this.menuOpened = false;
19
- this.loaded = null;
19
+ this.loaded = false;
20
20
  this.openMenuState = 'shift';
21
21
  }
22
22
  disconnectedCallback() {
@@ -129,7 +129,7 @@ let ItemNavigator = class ItemNavigator extends LitElement {
129
129
  }
130
130
  loadingStateUpdated(e) {
131
131
  const { loaded } = e.detail;
132
- this.loaded = loaded || null;
132
+ this.loaded = loaded !== null && loaded !== void 0 ? loaded : false;
133
133
  }
134
134
  /** Fullscreen Management */
135
135
  manageViewportFullscreen(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"iaux-item-navigator.js","sourceRoot":"","sources":["../../src/iaux-item-navigator.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EAIV,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K,EAAE,CAAC;4CAAsB;AAErB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDAAuC;AAET;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;6CAE5C;AAEP;IAAR,KAAK,EAAE;oDAA8C;AAE7B;IAAxB,KAAK,CAAC,QAAQ,CAAC;4CAAgC;AAEV;IAArC,KAAK,CAAC,qBAAqB,CAAC;iDAAsC;AAE/B;IAAnC,KAAK,CAAC,mBAAmB,CAAC;+CAAoC;AA9CpD,aAAa;IADzB,aAAa,CAAC,qBAAqB,CAAC;GACxB,aAAa,CA6dzB","sourcesContent":["import {\n css,\n html,\n LitElement,\n PropertyValues,\n CSSResult,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport {\n SharedResizeObserver,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport '@internetarchive/icon-ellipses/icon-ellipses';\n\nimport './menu-slider/ia-menu-slider';\nimport './loader';\n\nimport {\n ToggleSideMenuOpenEvent,\n ToggleSidePanelOpenEvent,\n SetSideMenuContentsEvent,\n SetSideMenuShortcutsEvent,\n loadingStateUpdatedEvent,\n ManageFullscreenEvent,\n} from './interfaces/event-interfaces';\n\nimport {\n MenuProviderInterface,\n MenuShortcutInterface,\n MenuId,\n} from './interfaces/menu-interfaces';\nimport './no-theater-available';\n\n@customElement('iaux-item-navigator')\nexport class ItemNavigator\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({\n type: Object,\n converter: (value: string | MetadataResponse | null): MetadataResponse => {\n if (value && typeof value === 'string') {\n return new MetadataResponse(JSON.parse(atob(value)));\n }\n return value as MetadataResponse;\n },\n })\n item?: MetadataResponse;\n\n @property({ type: Boolean, reflect: true }) viewAvailable: Boolean = true;\n\n @property({ type: String }) baseHost = 'archive.org';\n\n @property({ type: Boolean }) signedIn = false;\n\n @property({ type: Array }) menuContents: MenuProviderInterface[] = [];\n\n @property({ type: Array }) menuShortcuts: MenuShortcutInterface[] = [];\n\n @property({ type: Boolean, reflect: true, attribute: true })\n viewportInFullscreen: boolean | null = null;\n\n @property({ type: Boolean, reflect: true }) menuOpened = false;\n\n @property({ type: String, reflect: true }) openMenu?: MenuId;\n\n @property({ attribute: false }) modal?: ModalManager;\n\n @property({ attribute: false }) sharedObserver?: SharedResizeObserver;\n\n @property({ type: Boolean, reflect: true, attribute: true }) loaded:\n | true\n | null = null;\n\n @state() openMenuState: 'overlay' | 'shift' = 'shift';\n\n @query('#frame') private frame!: HTMLDivElement;\n\n @query('slot[name=\"header\"]') private headerSlot!: HTMLSlotElement;\n\n @query('slot[name=\"main\"]') private mainSlot!: HTMLSlotElement;\n\n disconnectedCallback() {\n this.removeResizeObserver();\n }\n\n updated(changed: PropertyValues) {\n if (changed.has('sharedObserver')) {\n const oldObserver = changed.get('sharedObserver') as SharedResizeObserver;\n oldObserver?.removeObserver(this.resizeObserverConfig);\n this.setResizeObserver();\n }\n }\n\n /** Shared observer */\n handleResize(entry: ResizeObserverEntry): void {\n const { width } = entry.contentRect;\n if (width <= 600) {\n this.openMenuState = 'overlay';\n return;\n }\n this.openMenuState = 'shift';\n }\n\n private setResizeObserver(): void {\n this.sharedObserver?.addObserver(this.resizeObserverConfig);\n this.sharedObserver?.addObserver({\n target: this.headerSlot,\n handler: {\n handleResize: ({ contentRect }) => {\n if (contentRect.height) {\n this.requestUpdate();\n }\n },\n },\n });\n }\n\n private removeResizeObserver(): void {\n this.sharedObserver?.removeObserver(this.resizeObserverConfig);\n }\n\n get resizeObserverConfig(): {\n handler: SharedResizeObserverResizeHandlerInterface;\n target: Element;\n } {\n return {\n handler: this,\n target: this.frame,\n };\n }\n /** End shared observer */\n\n get loaderTitle() {\n return this.viewportInFullscreen ? 'Internet Archive' : '';\n }\n\n get loadingArea() {\n return html`\n <div class=\"loading-area\">\n <div class=\"loading-view\">\n <ia-itemnav-loader\n .loaderMessage=${this.loaderTitle}\n ></ia-itemnav-loader>\n </div>\n </div>\n `;\n }\n\n slotChange(e: Event, type: 'header' | 'main'): void {\n const slottedContent = (\n e.target as HTMLSlotElement\n ).assignedNodes()?.[0] as HTMLElement;\n\n this.dispatchEvent(\n new CustomEvent('slotChange', {\n detail: { slot: slottedContent, type },\n }),\n );\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const displayReaderClass = this.loaded ? '' : 'hidden';\n const headerHeight =\n (this.headerSlot?.assignedNodes()[0] as HTMLElement)?.offsetHeight || 0;\n return html`\n <div id=\"frame\" class=${this.menuClass}>\n <slot\n name=\"header\"\n style=${`height: ${headerHeight}px`}\n @slotchange=${(e: Event) => this.slotChange(e, 'header')}\n ></slot>\n <div class=\"menu-and-reader\">\n ${this.shouldRenderMenu ? this.renderSideMenu : nothing}\n <div id=\"reader\" class=${displayReaderClass}>\n ${this.renderViewport}\n </div>\n ${!this.loaded ? this.loadingArea : nothing}\n </div>\n </div>\n `;\n }\n\n get noTheaterView() {\n return html`<ia-no-theater-available\n .identifier=${this.item?.metadata?.identifier}\n @loadingStateUpdated=${this.loadingStateUpdated}\n ></ia-no-theater-available>`;\n }\n\n get renderViewport(): TemplateResult | typeof nothing {\n if (!this.viewAvailable) {\n return this.noTheaterView;\n }\n\n const slotVisibility = !this.loaded ? 'opacity: 0;' : 'opacity: 1;';\n return html`\n <div slot=\"main\" style=${slotVisibility}>\n <slot\n name=\"main\"\n @slotchange=${(e: Event) => this.slotChange(e, 'main')}\n ></slot>\n </div>\n `;\n }\n\n loadingStateUpdated(e: loadingStateUpdatedEvent): void {\n const { loaded } = e.detail;\n this.loaded = loaded || null;\n }\n\n /** Fullscreen Management */\n manageViewportFullscreen(e: ManageFullscreenEvent): void {\n const fullscreenStatus = !!e.detail.isFullScreen;\n this.viewportInFullscreen = !fullscreenStatus ? null : fullscreenStatus;\n\n const event = new CustomEvent('fullscreenToggled', {\n detail: e.detail,\n }) as ManageFullscreenEvent;\n\n this.dispatchEvent(event);\n }\n /** End Fullscreen Management */\n\n /** Side menu */\n get shouldRenderMenu(): boolean {\n return !!this.menuContents?.length;\n }\n\n toggleMenu(): void {\n this.menuOpened = !this.menuOpened;\n }\n\n closeMenu(): void {\n this.menuOpened = false;\n }\n\n setOpenMenu(e: ToggleSidePanelOpenEvent): void {\n const { id } = e.detail;\n this.openMenu = id !== this.openMenu ? id : undefined;\n }\n\n setMenuContents(e: SetSideMenuContentsEvent): void {\n const updatedContents = [...e.detail];\n this.menuContents = updatedContents;\n }\n\n setMenuShortcuts(e: SetSideMenuShortcutsEvent) {\n this.menuShortcuts = [...e.detail];\n }\n\n /** Toggles Side Menu & Sets viewable subpanel */\n manageSideMenuEvents(e: ToggleSideMenuOpenEvent): void {\n const { menuId, action } = e.detail;\n if (!menuId) {\n return;\n }\n\n if (action === 'open') {\n this.openShortcut(menuId);\n } else if (action === 'toggle') {\n this.openMenu = menuId;\n this.toggleMenu();\n }\n }\n\n get menuToggleButton() {\n return html`\n <button\n class=\"toggle-menu\"\n @click=${this.toggleMenu}\n title=\"Toggle theater side panels\"\n >\n <div>\n <ia-icon-ellipses\n style=\"width: var(--iconWidth); height: var(--iconHeight);\"\n ></ia-icon-ellipses>\n </div>\n </button>\n `;\n }\n\n get selectedMenuId(): MenuId | '' {\n return this.openMenu || '';\n }\n\n get renderSideMenu(): TemplateResult {\n const drawerState = this.menuOpened ? '' : 'hidden';\n return html`\n <nav>\n <div class=\"minimized\">${this.shortcuts} ${this.menuToggleButton}</div>\n <div id=\"menu\" class=${drawerState}>\n <ia-menu-slider\n .menus=${this.menuContents}\n .selectedMenu=${this.selectedMenuId}\n @menuTypeSelected=${this.setOpenMenu}\n @menuSliderClosed=${this.closeMenu}\n manuallyHandleClose\n open\n ></ia-menu-slider>\n </div>\n </nav>\n `;\n }\n /** End Side menu */\n\n /** Menu Shortcuts */\n openShortcut(selectedMenuId: MenuId = ''): void {\n this.openMenu = selectedMenuId;\n this.menuOpened = true;\n }\n\n get shortcuts(): TemplateResult {\n const shortcuts = this.menuShortcuts.map(({ icon, id }) => {\n if (id === 'fullscreen') {\n return html`${icon}`;\n }\n\n return html`\n <button class=\"shortcut ${id}\" @click=\"${() => this.openShortcut(id)}\">\n ${icon}\n </button>\n `;\n });\n return html`<div class=\"shortcuts\">${shortcuts}</div>`;\n }\n /** End Menu Shortcuts */\n\n /** Misc Render */\n get menuClass(): string {\n const hasMenuOrShortcuts =\n this.menuContents?.length || this.menuShortcuts?.length;\n const drawerState = this.menuOpened && hasMenuOrShortcuts ? 'open' : '';\n const fullscreenState = this.viewportInFullscreen ? 'fullscreen' : '';\n return `${drawerState} ${fullscreenState} ${this.openMenuState}`;\n }\n\n static get styles(): CSSResult {\n const subnavWidth = css`var(--menuWidth, 320px)`;\n const transitionTiming = css`var(--animationTiming, 200ms)`;\n const transitionEffect = css`transform ${transitionTiming} ease-out`;\n const menuMargin = css`var(--theaterMenuMargin, 42px)`;\n const theaterBg = css`var(--theaterBgColor, #000)`;\n\n return css`\n :host,\n #frame,\n .menu-and-reader {\n position: relative;\n overflow: hidden;\n display: block;\n }\n\n :host,\n #frame,\n .loading-area,\n .loading-view {\n min-height: inherit;\n height: inherit;\n }\n\n slot {\n display: block;\n width: 100%;\n }\n\n slot * {\n display: block;\n height: inherit;\n }\n\n #frame {\n background-color: ${theaterBg};\n color-scheme: dark;\n display: flex;\n flex-direction: column;\n }\n\n #frame.fullscreen {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 9;\n }\n\n .loading-view {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .loading-area {\n width: 100%;\n }\n\n ia-itemnav-loader {\n display: block;\n width: 100%;\n }\n\n .hidden {\n display: none !important;\n }\n\n button {\n cursor: pointer;\n padding: 0;\n border: 0;\n }\n\n button:focus,\n button:active {\n outline: none;\n }\n\n .menu-and-reader {\n position: relative;\n display: flex;\n flex: 1;\n }\n\n nav button {\n background: none;\n }\n\n nav .minimized {\n background: rgba(0, 0, 0, 0.7);\n padding-top: 6px;\n position: absolute;\n width: ${menuMargin};\n z-index: 2;\n left: 0;\n border-bottom-right-radius: 5%;\n }\n\n nav .minimized button {\n width: var(--iconWidth);\n height: var(--iconHeight);\n margin-bottom: 0.2rem;\n margin: auto;\n display: inline-flex;\n vertical-align: middle;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: center;\n justify-content: center;\n width: ${menuMargin};\n height: ${menuMargin};\n }\n\n nav .minimized button.toggle-menu > * {\n border: 2px solid var(--iconStrokeColor);\n border-radius: var(--iconWidth);\n width: var(--iconWidth);\n height: var(--iconHeight);\n margin: auto;\n }\n\n ia-icon-ellipses {\n width: var(--iconWidth);\n height: var(--iconHeight);\n }\n\n #menu {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 3;\n overflow: hidden;\n transform: translateX(-${subnavWidth});\n width: ${subnavWidth};\n transform: translateX(calc(${subnavWidth} * -1));\n transition: ${transitionEffect};\n }\n\n #reader {\n position: relative;\n z-index: 1;\n transform: translateX(0);\n width: 100%;\n display: flex;\n }\n\n #reader > * {\n width: 100%;\n display: flex;\n flex: 1;\n }\n\n .open.overlay #reader {\n transition: none;\n }\n\n .open #menu {\n width: ${subnavWidth};\n transform: translateX(0);\n transition: ${transitionEffect};\n }\n\n .open.shift #reader {\n width: calc(100% - ${subnavWidth});\n margin-left: ${subnavWidth};\n transition: ${transitionEffect};\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"iaux-item-navigator.js","sourceRoot":"","sources":["../../src/iaux-item-navigator.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EAIV,OAAO,GACR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,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S,EAAE,KAAK,EAAE,CAAC;qDAAuC;AAET;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;6CAAyB;AAE5E;IAAR,KAAK,EAAE;oDAA8C;AAE7B;IAAxB,KAAK,CAAC,QAAQ,CAAC;4CAAgC;AAEV;IAArC,KAAK,CAAC,qBAAqB,CAAC;iDAAsC;AAE/B;IAAnC,KAAK,CAAC,mBAAmB,CAAC;+CAAoC;AA5CpD,aAAa;IADzB,aAAa,CAAC,qBAAqB,CAAC;GACxB,aAAa,CA2dzB","sourcesContent":["import {\n css,\n html,\n LitElement,\n PropertyValues,\n CSSResult,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport {\n SharedResizeObserver,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport '@internetarchive/icon-ellipses/icon-ellipses';\n\nimport './menu-slider/ia-menu-slider';\nimport './loader';\n\nimport {\n ToggleSideMenuOpenEvent,\n ToggleSidePanelOpenEvent,\n SetSideMenuContentsEvent,\n SetSideMenuShortcutsEvent,\n loadingStateUpdatedEvent,\n ManageFullscreenEvent,\n} from './interfaces/event-interfaces';\n\nimport {\n MenuProviderInterface,\n MenuShortcutInterface,\n MenuId,\n} from './interfaces/menu-interfaces';\nimport './no-theater-available';\n\n@customElement('iaux-item-navigator')\nexport class ItemNavigator\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({\n type: Object,\n converter: (value: string | MetadataResponse | null): MetadataResponse => {\n if (value && typeof value === 'string') {\n return new MetadataResponse(JSON.parse(atob(value)));\n }\n return value as MetadataResponse;\n },\n })\n item?: MetadataResponse;\n\n @property({ type: Boolean, reflect: true }) viewAvailable: Boolean = true;\n\n @property({ type: String }) baseHost = 'archive.org';\n\n @property({ type: Boolean }) signedIn = false;\n\n @property({ type: Array }) menuContents: MenuProviderInterface[] = [];\n\n @property({ type: Array }) menuShortcuts: MenuShortcutInterface[] = [];\n\n @property({ type: Boolean, reflect: true, attribute: true })\n viewportInFullscreen: boolean | null = null;\n\n @property({ type: Boolean, reflect: true }) menuOpened = false;\n\n @property({ type: String, reflect: true }) openMenu?: MenuId;\n\n @property({ attribute: false }) modal?: ModalManager;\n\n @property({ attribute: false }) sharedObserver?: SharedResizeObserver;\n\n @property({ type: Boolean, reflect: true, attribute: true }) loaded: boolean = false;\n\n @state() openMenuState: 'overlay' | 'shift' = 'shift';\n\n @query('#frame') private frame!: HTMLDivElement;\n\n @query('slot[name=\"header\"]') private headerSlot!: HTMLSlotElement;\n\n @query('slot[name=\"main\"]') private mainSlot!: HTMLSlotElement;\n\n disconnectedCallback() {\n this.removeResizeObserver();\n }\n\n updated(changed: PropertyValues) {\n if (changed.has('sharedObserver')) {\n const oldObserver = changed.get('sharedObserver') as SharedResizeObserver;\n oldObserver?.removeObserver(this.resizeObserverConfig);\n this.setResizeObserver();\n }\n }\n\n /** Shared observer */\n handleResize(entry: ResizeObserverEntry): void {\n const { width } = entry.contentRect;\n if (width <= 600) {\n this.openMenuState = 'overlay';\n return;\n }\n this.openMenuState = 'shift';\n }\n\n private setResizeObserver(): void {\n this.sharedObserver?.addObserver(this.resizeObserverConfig);\n this.sharedObserver?.addObserver({\n target: this.headerSlot,\n handler: {\n handleResize: ({ contentRect }) => {\n if (contentRect.height) {\n this.requestUpdate();\n }\n },\n },\n });\n }\n\n private removeResizeObserver(): void {\n this.sharedObserver?.removeObserver(this.resizeObserverConfig);\n }\n\n get resizeObserverConfig(): {\n handler: SharedResizeObserverResizeHandlerInterface;\n target: Element;\n } {\n return {\n handler: this,\n target: this.frame,\n };\n }\n /** End shared observer */\n\n get loaderTitle() {\n return this.viewportInFullscreen ? 'Internet Archive' : '';\n }\n\n get loadingArea() {\n return html`\n <div class=\"loading-area\">\n <div class=\"loading-view\">\n <ia-itemnav-loader\n .loaderMessage=${this.loaderTitle}\n ></ia-itemnav-loader>\n </div>\n </div>\n `;\n }\n\n slotChange(e: Event, type: 'header' | 'main'): void {\n const slottedContent = (\n e.target as HTMLSlotElement\n ).assignedNodes()?.[0] as HTMLElement;\n\n this.dispatchEvent(\n new CustomEvent('slotChange', {\n detail: { slot: slottedContent, type },\n }),\n );\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const displayReaderClass = this.loaded ? '' : 'hidden';\n const headerHeight =\n (this.headerSlot?.assignedNodes()[0] as HTMLElement)?.offsetHeight || 0;\n return html`\n <div id=\"frame\" class=${this.menuClass}>\n <slot\n name=\"header\"\n style=${`height: ${headerHeight}px`}\n @slotchange=${(e: Event) => this.slotChange(e, 'header')}\n ></slot>\n <div class=\"menu-and-reader\">\n ${this.shouldRenderMenu ? this.renderSideMenu : nothing}\n <div id=\"reader\" class=${displayReaderClass}>\n ${this.renderViewport}\n </div>\n ${!this.loaded ? this.loadingArea : nothing}\n </div>\n </div>\n `;\n }\n\n get noTheaterView() {\n return html`<ia-no-theater-available\n .identifier=${this.item?.metadata?.identifier}\n @loadingStateUpdated=${this.loadingStateUpdated}\n ></ia-no-theater-available>`;\n }\n\n get renderViewport(): TemplateResult | typeof nothing {\n if (!this.viewAvailable) {\n return this.noTheaterView;\n }\n\n const slotVisibility = !this.loaded ? 'opacity: 0;' : 'opacity: 1;';\n return html`\n <div slot=\"main\" style=${slotVisibility}>\n <slot\n name=\"main\"\n @slotchange=${(e: Event) => this.slotChange(e, 'main')}\n ></slot>\n </div>\n `;\n }\n\n loadingStateUpdated(e: loadingStateUpdatedEvent): void {\n const { loaded } = e.detail;\n this.loaded = loaded ?? false;\n }\n\n /** Fullscreen Management */\n manageViewportFullscreen(e: ManageFullscreenEvent): void {\n const fullscreenStatus = !!e.detail.isFullScreen;\n this.viewportInFullscreen = !fullscreenStatus ? null : fullscreenStatus;\n\n const event = new CustomEvent('fullscreenToggled', {\n detail: e.detail,\n }) as ManageFullscreenEvent;\n\n this.dispatchEvent(event);\n }\n /** End Fullscreen Management */\n\n /** Side menu */\n get shouldRenderMenu(): boolean {\n return !!this.menuContents?.length;\n }\n\n toggleMenu(): void {\n this.menuOpened = !this.menuOpened;\n }\n\n closeMenu(): void {\n this.menuOpened = false;\n }\n\n setOpenMenu(e: ToggleSidePanelOpenEvent): void {\n const { id } = e.detail;\n this.openMenu = id !== this.openMenu ? id : undefined;\n }\n\n setMenuContents(e: SetSideMenuContentsEvent): void {\n const updatedContents = [...e.detail];\n this.menuContents = updatedContents;\n }\n\n setMenuShortcuts(e: SetSideMenuShortcutsEvent) {\n this.menuShortcuts = [...e.detail];\n }\n\n /** Toggles Side Menu & Sets viewable subpanel */\n manageSideMenuEvents(e: ToggleSideMenuOpenEvent): void {\n const { menuId, action } = e.detail;\n if (!menuId) {\n return;\n }\n\n if (action === 'open') {\n this.openShortcut(menuId);\n } else if (action === 'toggle') {\n this.openMenu = menuId;\n this.toggleMenu();\n }\n }\n\n get menuToggleButton() {\n return html`\n <button\n class=\"toggle-menu\"\n @click=${this.toggleMenu}\n title=\"Toggle theater side panels\"\n >\n <div>\n <ia-icon-ellipses\n style=\"width: var(--iconWidth); height: var(--iconHeight);\"\n ></ia-icon-ellipses>\n </div>\n </button>\n `;\n }\n\n get selectedMenuId(): MenuId | '' {\n return this.openMenu || '';\n }\n\n get renderSideMenu(): TemplateResult {\n const drawerState = this.menuOpened ? '' : 'hidden';\n return html`\n <nav>\n <div class=\"minimized\">${this.shortcuts} ${this.menuToggleButton}</div>\n <div id=\"menu\" class=${drawerState}>\n <ia-menu-slider\n .menus=${this.menuContents}\n .selectedMenu=${this.selectedMenuId}\n @menuTypeSelected=${this.setOpenMenu}\n @menuSliderClosed=${this.closeMenu}\n manuallyHandleClose\n open\n ></ia-menu-slider>\n </div>\n </nav>\n `;\n }\n /** End Side menu */\n\n /** Menu Shortcuts */\n openShortcut(selectedMenuId: MenuId = ''): void {\n this.openMenu = selectedMenuId;\n this.menuOpened = true;\n }\n\n get shortcuts(): TemplateResult {\n const shortcuts = this.menuShortcuts.map(({ icon, id }) => {\n if (id === 'fullscreen') {\n return html`${icon}`;\n }\n\n return html`\n <button class=\"shortcut ${id}\" @click=\"${() => this.openShortcut(id)}\">\n ${icon}\n </button>\n `;\n });\n return html`<div class=\"shortcuts\">${shortcuts}</div>`;\n }\n /** End Menu Shortcuts */\n\n /** Misc Render */\n get menuClass(): string {\n const hasMenuOrShortcuts =\n this.menuContents?.length || this.menuShortcuts?.length;\n const drawerState = this.menuOpened && hasMenuOrShortcuts ? 'open' : '';\n const fullscreenState = this.viewportInFullscreen ? 'fullscreen' : '';\n return `${drawerState} ${fullscreenState} ${this.openMenuState}`;\n }\n\n static get styles(): CSSResult {\n const subnavWidth = css`var(--menuWidth, 320px)`;\n const transitionTiming = css`var(--animationTiming, 200ms)`;\n const transitionEffect = css`transform ${transitionTiming} ease-out`;\n const menuMargin = css`var(--theaterMenuMargin, 42px)`;\n const theaterBg = css`var(--theaterBgColor, #000)`;\n\n return css`\n :host,\n #frame,\n .menu-and-reader {\n position: relative;\n overflow: hidden;\n display: block;\n }\n\n :host,\n #frame,\n .loading-area,\n .loading-view {\n min-height: inherit;\n height: inherit;\n }\n\n slot {\n display: block;\n width: 100%;\n }\n\n slot * {\n display: block;\n height: inherit;\n }\n\n #frame {\n background-color: ${theaterBg};\n color-scheme: dark;\n display: flex;\n flex-direction: column;\n }\n\n #frame.fullscreen {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 9;\n }\n\n .loading-view {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .loading-area {\n width: 100%;\n }\n\n ia-itemnav-loader {\n display: block;\n width: 100%;\n }\n\n .hidden {\n display: none !important;\n }\n\n button {\n cursor: pointer;\n padding: 0;\n border: 0;\n }\n\n button:focus,\n button:active {\n outline: none;\n }\n\n .menu-and-reader {\n position: relative;\n display: flex;\n flex: 1;\n }\n\n nav button {\n background: none;\n }\n\n nav .minimized {\n background: rgba(0, 0, 0, 0.7);\n padding-top: 6px;\n position: absolute;\n width: ${menuMargin};\n z-index: 2;\n left: 0;\n border-bottom-right-radius: 5%;\n }\n\n nav .minimized button {\n width: var(--iconWidth);\n height: var(--iconHeight);\n margin-bottom: 0.2rem;\n margin: auto;\n display: inline-flex;\n vertical-align: middle;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: center;\n justify-content: center;\n width: ${menuMargin};\n height: ${menuMargin};\n }\n\n nav .minimized button.toggle-menu > * {\n border: 2px solid var(--iconStrokeColor);\n border-radius: var(--iconWidth);\n width: var(--iconWidth);\n height: var(--iconHeight);\n margin: auto;\n }\n\n ia-icon-ellipses {\n width: var(--iconWidth);\n height: var(--iconHeight);\n }\n\n #menu {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 3;\n overflow: hidden;\n transform: translateX(-${subnavWidth});\n width: ${subnavWidth};\n transform: translateX(calc(${subnavWidth} * -1));\n transition: ${transitionEffect};\n }\n\n #reader {\n position: relative;\n z-index: 1;\n transform: translateX(0);\n width: 100%;\n display: flex;\n }\n\n #reader > * {\n width: 100%;\n display: flex;\n flex: 1;\n }\n\n .open.overlay #reader {\n transition: none;\n }\n\n .open #menu {\n width: ${subnavWidth};\n transform: translateX(0);\n transition: ${transitionEffect};\n }\n\n .open.shift #reader {\n width: calc(100% - ${subnavWidth});\n margin-left: ${subnavWidth};\n transition: ${transitionEffect};\n }\n `;\n }\n}\n"]}
@@ -185,7 +185,7 @@ __decorate([
185
185
  property({ type: Array })
186
186
  ], IauxSortFilesButton.prototype, "fileListSorted", void 0);
187
187
  __decorate([
188
- property({ type: String })
188
+ property({ type: String, reflect: true })
189
189
  ], IauxSortFilesButton.prototype, "sortOrderBy", void 0);
190
190
  IauxSortFilesButton = __decorate([
191
191
  customElement('iaux-sort-viewable-files')
@@ -1 +1 @@
1
- {"version":3,"file":"iaux-viewable-files.js","sour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EAAE,MAAM,EAAE,CAAC;mDAAkC;AAEjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAGE;AAED;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAwB;AAExB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAsB;AAEJ;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAsB;AAZtD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAuM7B","sourcesContent":["/* eslint-disable max-classes-per-file */\n/* eslint-disable lit-a11y/list */\nimport { css, html, LitElement, nothing, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\n\n// sort icons\nconst sortAscIcon = html`\n <svg\n name=\"sort-asc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n transform=\"matrix(1 0 0 -1 0 18.692308)\"\n />\n </g>\n </svg>\n`;\nconst sortDescIcon = html`\n <svg\n name=\"sort-desc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n />\n </g>\n </svg>\n`;\nconst sortNeutralIcon = html`\n <svg\n name=\"sort-neutral\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"#fff\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill-rule=\"nonzero\"\n />\n <circle cx=\"13\" cy=\"9\" r=\"2\" />\n </g>\n </svg>\n`;\n\ntype sortOptions = 'title_asc' | 'title_desc' | 'default';\n\ntype ItemInfo = {\n url_path: string;\n image: string;\n title: string;\n author: string;\n file_subprefix: string;\n file_source: string;\n file_origin?: string;\n};\n\n/* icon for menu shortcut & menu icon */\nexport const viewableFilesIcon = html`\n <svg\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"volumesTitleID volumesDescID\"\n >\n <title id=\"volumesTitleID\">Viewable Files</title>\n <g fill=\"#ffffff\">\n <path\n fill=\"#ffffff\"\n d=\"m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z\"\n />\n </g>\n </svg>\n`;\n\n/* <iaux-sort-viewable-files> side panel header button */\n@customElement('iaux-sort-viewable-files')\nexport class IauxSortFilesButton extends LitElement {\n @property({ type: Array }) fileListRaw: any[] = [];\n\n @property({ type: Array }) fileListSorted: any[] = [];\n\n @property({ type: String }) sortOrderBy: sortOptions = 'default';\n\n render() {\n return html`<div class=\"sort-multi-file-list\">${this.sortButton}</div>`;\n }\n\n get sortButton() {\n const sortIcons = {\n default: html`\n <button\n class=\"sort-by neutral-icon\"\n aria-label=\"Sort volumes in initial order\"\n @click=${() => this.sortVolumes('title_asc')}\n >\n ${sortNeutralIcon}\n </button>\n `,\n title_asc: html`\n <button\n class=\"sort-by asc-icon\"\n aria-label=\"Sort volumes in ascending order\"\n @click=${() => this.sortVolumes('title_desc')}\n >\n ${sortAscIcon}\n </button>\n `,\n title_desc: html`\n <button\n class=\"sort-by desc-icon\"\n aria-label=\"Sort volumes in descending order\"\n @click=${() => this.sortVolumes('default')}\n >\n ${sortDescIcon}\n </button>\n `,\n };\n\n return sortIcons[this.sortOrderBy];\n }\n\n sortVolumes(sortType: sortOptions) {\n this.sortOrderBy = sortType;\n let sortedFiles = [];\n\n sortedFiles = this.fileListRaw.sort((a, b) => {\n if (sortType === 'title_asc') return a.title.localeCompare(b.title);\n if (sortType === 'title_desc') return b.title.localeCompare(a.title);\n return a.orig_sort - b.orig_sort;\n });\n\n this.dispatchEvent(\n new CustomEvent('fileListSorted', {\n detail: {\n sortType,\n sortedFiles,\n },\n bubbles: true,\n composed: true,\n }),\n );\n this.fileListSorted = sortedFiles;\n }\n\n static get styles() {\n return css`\n button.sort-by {\n padding: 0px;\n background-color: transparent;\n border: 0px;\n --iconWidth: var(--menuSliderHeaderIconWidth);\n --iconHeight: var(--menuSliderHeaderIconHeight);\n }\n `;\n }\n}\n\n/* <iaux-viewable-files> side panel menu */\n@customElement('iaux-viewable-files')\nexport class IauxViewableFiles extends LitElement {\n @property({ type: String }) baseHost: string = 'archive.org';\n\n @property({ type: String }) sortOrderBy:\n | 'default'\n | 'title_asc'\n | 'title_desc' = 'default';\n\n @property({ type: String }) subPrefix: string = '';\n\n @property({ type: Array }) fileList: any[] = [];\n\n @property({ type: Boolean, reflect: true }) addSortToUrl = false;\n\n firstUpdated() {\n const activeFile = this.shadowRoot!.querySelector('.content.active') as any;\n // allow for css animations to run before scrolling to active file\n setTimeout(() => {\n // scroll active file into view if needed\n // note: `scrollIntoViewIfNeeded` handles auto-scroll gracefully for Chrome, Safari\n // Firefox does not have this capability yet as it does not support `scrollIntoViewIfNeeded`\n activeFile?.scrollIntoViewIfNeeded(true);\n\n // Todo: support `scrollIntoView` or `parentContainer.crollTop = x` for FF & \"IE 11\"\n // currently, the hard `position: absolutes` misaligns subpanel when `scrollIntoView` is applied :(\n }, 350);\n }\n\n volumeItemWithImageTitle(item: ItemInfo) {\n const hrefUrl = this.fileUrl(item);\n\n return html`\n <li class=\"content active\">\n <div class=\"separator\"></div>\n <a class=\"container\" href=\"${hrefUrl}\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"preview\" />\n </div>\n <div class=\"text\">\n <p class=\"item-title\">${item.title}</p>\n <small>by: ${item.author}</small>\n </div>\n </a>\n </li>\n `;\n }\n\n fileUrl(item: ItemInfo) {\n const baseUrl = `//${this.baseHost}${item.url_path}`;\n let hrefUrl = baseUrl;\n if (this.addSortToUrl) {\n hrefUrl =\n this.sortOrderBy === 'default'\n ? `${baseUrl}${item.url_path}`\n : `${baseUrl}${item.url_path}?sort=${this.sortOrderBy}`;\n }\n return hrefUrl;\n }\n\n fileLi(item: ItemInfo) {\n const activeClass = this.subPrefix === item.file_subprefix ? ' active' : '';\n const hrefUrl = this.fileUrl(item);\n const isPdf = (item.file_source ?? '').match(/^[^+]+\\.pdf$/i);\n\n return html`\n <li>\n <div class=\"separator\"></div>\n <div class=\"content${activeClass}\">\n <a href=${hrefUrl}>\n <p class=\"item-title\">${item.title}</p>\n ${isPdf\n ? html`<p class=\"pdf-label\"><span>PDF</span></p>\n <p></p>`\n : nothing}\n </a>\n </div>\n </li>\n `;\n }\n\n get fileListTemplate(): TemplateResult {\n const filesDisplay = repeat(\n this.fileList,\n file => file?.file_prefix,\n this.fileLi.bind(this),\n );\n return html`\n <ul>\n ${filesDisplay}\n <div class=\"separator\"></div>\n </ul>\n `;\n }\n\n render() {\n return html` ${this.fileList.length ? this.fileListTemplate : nothing} `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-top: 14px;\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n a {\n color: #ffffff;\n text-decoration: none;\n }\n\n img {\n width: 35px;\n height: 45px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n\n ul > li:first-child .separator {\n display: none;\n }\n\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: 0.2rem 0 0.4rem 0.2rem;\n }\n\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n small {\n font-style: italic;\n white-space: initial;\n }\n\n .container {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .item-title {\n margin-block-start: 0em;\n margin-block-end: 0em;\n font-size: 14px;\n font-weight: bold;\n word-wrap: break-word;\n padding-left: 5px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n .text {\n padding-left: 10px;\n }\n\n .icon {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: 0.7rem;\n border: 1px solid var(--primaryTextColor);\n border-radius: 2px;\n background: var(--activeButtonBg) 50% 50% no-repeat;\n }\n\n .pdf-label {\n margin: 5px 5px 5px 0;\n text-align: right;\n }\n\n .pdf-label span {\n border: 1px solid;\n padding: 5px 10px;\n border-radius: 20px;\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"iaux-viewable-files.js","sourceRoot":"","sources":["../../../src/menus/iaux-viewable-files.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,kCAAkC;AAClC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,IAAI,EAAE,MAAM,EAAE,CAAC;sDAGE;AAED;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAwB;AAExB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAsB;AAEJ;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAsB;AAZtD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAuM7B","sourcesContent":["/* eslint-disable max-classes-per-file */\n/* eslint-disable lit-a11y/list */\nimport { css, html, LitElement, nothing, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\n\n// sort icons\nconst sortAscIcon = html`\n <svg\n name=\"sort-asc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n transform=\"matrix(1 0 0 -1 0 18.692308)\"\n />\n </g>\n </svg>\n`;\nconst sortDescIcon = html`\n <svg\n name=\"sort-desc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n />\n </g>\n </svg>\n`;\nconst sortNeutralIcon = html`\n <svg\n name=\"sort-neutral\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"#fff\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill-rule=\"nonzero\"\n />\n <circle cx=\"13\" cy=\"9\" r=\"2\" />\n </g>\n </svg>\n`;\n\ntype sortOptions = 'title_asc' | 'title_desc' | 'default';\n\ntype ItemInfo = {\n url_path: string;\n image: string;\n title: string;\n author: string;\n file_subprefix: string;\n file_source: string;\n file_origin?: string;\n};\n\n/* icon for menu shortcut & menu icon */\nexport const viewableFilesIcon = html`\n <svg\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"volumesTitleID volumesDescID\"\n >\n <title id=\"volumesTitleID\">Viewable Files</title>\n <g fill=\"#ffffff\">\n <path\n fill=\"#ffffff\"\n d=\"m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z\"\n />\n </g>\n </svg>\n`;\n\n/* <iaux-sort-viewable-files> side panel header button */\n@customElement('iaux-sort-viewable-files')\nexport class IauxSortFilesButton extends LitElement {\n @property({ type: Array }) fileListRaw: any[] = [];\n\n @property({ type: Array }) fileListSorted: any[] = [];\n\n @property({ type: String, reflect: true }) sortOrderBy: sortOptions = 'default';\n\n render() {\n return html`<div class=\"sort-multi-file-list\">${this.sortButton}</div>`;\n }\n\n get sortButton() {\n const sortIcons = {\n default: html`\n <button\n class=\"sort-by neutral-icon\"\n aria-label=\"Sort volumes in initial order\"\n @click=${() => this.sortVolumes('title_asc')}\n >\n ${sortNeutralIcon}\n </button>\n `,\n title_asc: html`\n <button\n class=\"sort-by asc-icon\"\n aria-label=\"Sort volumes in ascending order\"\n @click=${() => this.sortVolumes('title_desc')}\n >\n ${sortAscIcon}\n </button>\n `,\n title_desc: html`\n <button\n class=\"sort-by desc-icon\"\n aria-label=\"Sort volumes in descending order\"\n @click=${() => this.sortVolumes('default')}\n >\n ${sortDescIcon}\n </button>\n `,\n };\n\n return sortIcons[this.sortOrderBy];\n }\n\n sortVolumes(sortType: sortOptions) {\n this.sortOrderBy = sortType;\n let sortedFiles = [];\n\n sortedFiles = this.fileListRaw.sort((a, b) => {\n if (sortType === 'title_asc') return a.title.localeCompare(b.title);\n if (sortType === 'title_desc') return b.title.localeCompare(a.title);\n return a.orig_sort - b.orig_sort;\n });\n\n this.dispatchEvent(\n new CustomEvent('fileListSorted', {\n detail: {\n sortType,\n sortedFiles,\n },\n bubbles: true,\n composed: true,\n }),\n );\n this.fileListSorted = sortedFiles;\n }\n\n static get styles() {\n return css`\n button.sort-by {\n padding: 0px;\n background-color: transparent;\n border: 0px;\n --iconWidth: var(--menuSliderHeaderIconWidth);\n --iconHeight: var(--menuSliderHeaderIconHeight);\n }\n `;\n }\n}\n\n/* <iaux-viewable-files> side panel menu */\n@customElement('iaux-viewable-files')\nexport class IauxViewableFiles extends LitElement {\n @property({ type: String }) baseHost: string = 'archive.org';\n\n @property({ type: String }) sortOrderBy:\n | 'default'\n | 'title_asc'\n | 'title_desc' = 'default';\n\n @property({ type: String }) subPrefix: string = '';\n\n @property({ type: Array }) fileList: any[] = [];\n\n @property({ type: Boolean, reflect: true }) addSortToUrl = false;\n\n firstUpdated() {\n const activeFile = this.shadowRoot!.querySelector('.content.active') as any;\n // allow for css animations to run before scrolling to active file\n setTimeout(() => {\n // scroll active file into view if needed\n // note: `scrollIntoViewIfNeeded` handles auto-scroll gracefully for Chrome, Safari\n // Firefox does not have this capability yet as it does not support `scrollIntoViewIfNeeded`\n activeFile?.scrollIntoViewIfNeeded(true);\n\n // Todo: support `scrollIntoView` or `parentContainer.crollTop = x` for FF & \"IE 11\"\n // currently, the hard `position: absolutes` misaligns subpanel when `scrollIntoView` is applied :(\n }, 350);\n }\n\n volumeItemWithImageTitle(item: ItemInfo) {\n const hrefUrl = this.fileUrl(item);\n\n return html`\n <li class=\"content active\">\n <div class=\"separator\"></div>\n <a class=\"container\" href=\"${hrefUrl}\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"preview\" />\n </div>\n <div class=\"text\">\n <p class=\"item-title\">${item.title}</p>\n <small>by: ${item.author}</small>\n </div>\n </a>\n </li>\n `;\n }\n\n fileUrl(item: ItemInfo) {\n const baseUrl = `//${this.baseHost}${item.url_path}`;\n let hrefUrl = baseUrl;\n if (this.addSortToUrl) {\n hrefUrl =\n this.sortOrderBy === 'default'\n ? `${baseUrl}${item.url_path}`\n : `${baseUrl}${item.url_path}?sort=${this.sortOrderBy}`;\n }\n return hrefUrl;\n }\n\n fileLi(item: ItemInfo) {\n const activeClass = this.subPrefix === item.file_subprefix ? ' active' : '';\n const hrefUrl = this.fileUrl(item);\n const isPdf = (item.file_source ?? '').match(/^[^+]+\\.pdf$/i);\n\n return html`\n <li>\n <div class=\"separator\"></div>\n <div class=\"content${activeClass}\">\n <a href=${hrefUrl}>\n <p class=\"item-title\">${item.title}</p>\n ${isPdf\n ? html`<p class=\"pdf-label\"><span>PDF</span></p>\n <p></p>`\n : nothing}\n </a>\n </div>\n </li>\n `;\n }\n\n get fileListTemplate(): TemplateResult {\n const filesDisplay = repeat(\n this.fileList,\n file => file?.file_prefix,\n this.fileLi.bind(this),\n );\n return html`\n <ul>\n ${filesDisplay}\n <div class=\"separator\"></div>\n </ul>\n `;\n }\n\n render() {\n return html` ${this.fileList.length ? this.fileListTemplate : nothing} `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-top: 14px;\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n a {\n color: #ffffff;\n text-decoration: none;\n }\n\n img {\n width: 35px;\n height: 45px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n\n ul > li:first-child .separator {\n display: none;\n }\n\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: 0.2rem 0 0.4rem 0.2rem;\n }\n\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n small {\n font-style: italic;\n white-space: initial;\n }\n\n .container {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .item-title {\n margin-block-start: 0em;\n margin-block-end: 0em;\n font-size: 14px;\n font-weight: bold;\n word-wrap: break-word;\n padding-left: 5px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n .text {\n padding-left: 10px;\n }\n\n .icon {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: 0.7rem;\n border: 1px solid var(--primaryTextColor);\n border-radius: 2px;\n background: var(--activeButtonBg) 50% 50% no-repeat;\n }\n\n .pdf-label {\n margin: 5px 5px 5px 0;\n text-align: right;\n }\n\n .pdf-label span {\n border: 1px solid;\n padding: 5px 10px;\n border-radius: 20px;\n }\n `;\n }\n}\n"]}
@@ -62,7 +62,7 @@ describe('ItemNavigator', () => {
62
62
  await el.updateComplete;
63
63
  const spy = Sinon.spy();
64
64
  el.loadingStateUpdated = spy;
65
- el.loaded = null;
65
+ el.loaded = false;
66
66
  el.viewAvailable = false;
67
67
  await el.updateComplete;
68
68
  // check base properties
@@ -1 +1 @@
1
- {"version":3,"file":"iaux-item-navigator.test.js","sourceRoot":"","sources":["../../test/iaux-item-navigator.test.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAS7D,SAAS,CAAC,GAAG,EAAE;IACb,KAAK,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;;YACvD,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA;kBACM,IAAI,QAAQ,EAAE;gCACA,CACzB,CAAC;YACF,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;YACzB,MAAM,EAAE,CAAC,cAAc,CAAC;YACxB,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACrC,MAAM,CAAC,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;;YAC1C,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA;kBACM,IAAI,QAAQ,EAAE;gCACA,CACzB,CAAC;YAEF,MAAM,CAA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AI,CAAC;YAEjC,EAAE,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable camelcase */\nimport { html, fixture, expect } from '@open-wc/testing';\nimport Sinon from 'sinon';\n\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport { ItemNavigator } from '../src/iaux-item-navigator';\nimport '../src/iaux-item-navigator';\n\nimport { ItemStub, menuProvider, shortcut } from './ia-stub';\nimport {\n ManageFullscreenEvent,\n ToggleSideMenuOpenEvent,\n SetSideMenuContentsEvent,\n SetSideMenuShortcutsEvent,\n ToggleSidePanelOpenEvent,\n} from '../src/interfaces/event-interfaces';\n\nafterEach(() => {\n Sinon.restore();\n});\n\ndescribe('ItemNavigator', () => {\n describe('Theaters', () => {\n it('shows <ia-no-theater-available> if told', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n el.viewAvailable = false;\n await el.updateComplete;\n expect(el.viewAvailable).to.be.false;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.exist;\n });\n it('opens main slot by default', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n expect(el.viewAvailable).to.be.true;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.be\n .null;\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n });\n describe('`el.loaded`', () => {\n it('toggles the spinning loader', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.loaded).to.be.null; // initial load\n expect(el.shadowRoot?.querySelector('ia-itemnav-loader')).to.exist;\n });\n it('hides reader section if `!loaded`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(\n el.shadowRoot?.querySelector('#reader')?.getAttribute('class'),\n ).to.contain('hidden');\n });\n it('shows reader when `loaded` ', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.loaded = true;\n await el.updateComplete;\n const mainTheaterSection = el.shadowRoot?.querySelector('#reader');\n expect(mainTheaterSection?.classList.contains('hide')).to.be.false;\n expect(el.loaded).to.be.true;\n // `loaded` property is reflected as DOM attribute\n expect(el.hasAttribute('loaded')).to.equal(true);\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n it('listens to `@loadingStateUpdated` to update `loaded` for <no-theater-available>', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n await el.updateComplete;\n const spy = Sinon.spy();\n el.loadingStateUpdated = spy;\n el.loaded = null;\n el.viewAvailable = false;\n await el.updateComplete;\n // check base properties\n expect(el.loaded).to.equal(null);\n expect(el.item).to.be.undefined;\n\n // spy fires\n expect(spy.called).to.equal(true);\n expect(spy.callCount).to.equal(1);\n });\n });\n\n describe('`el.sharedObserver`', () => {\n it('uses one', async () => {\n const sharedObserver = new SharedResizeObserver();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(el.sharedObserver).to.equal(sharedObserver);\n expect(typeof el.handleResize).to.equal('function');\n });\n it('freshly registers handlers', async () => {\n const sharedObserver = new SharedResizeObserver();\n const addObserverSpy = Sinon.spy(sharedObserver, 'addObserver');\n\n await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(addObserverSpy.callCount).to.equal(2);\n });\n it('removes handler when component disconnects', async () => {\n const sharedObserver = new SharedResizeObserver();\n const removeObserverSpy = Sinon.spy(sharedObserver, 'removeObserver');\n\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n el.disconnectedCallback();\n await el.updateComplete;\n\n expect(removeObserverSpy.callCount).to.equal(1);\n });\n it('sets menu to overlay if container width is <= 600px', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(el.openMenuState).to.equal('shift'); // as starting point\n\n const overlaySize = {\n contentRect: { width: 600 },\n } as ResizeObserverEntry;\n el.handleResize(overlaySize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('overlay'); // changes open menu display to an overlay\n\n const shiftSize = {\n contentRect: { width: 601 },\n } as ResizeObserverEntry;\n el.handleResize(shiftSize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('shift');\n });\n });\n\n describe('`el.modal`', () => {\n it('uses one', async () => {\n const modal = new ModalManager();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator .modal=${modal}></iaux-item-navigator>`,\n );\n expect(el.modal).to.equal(modal);\n });\n });\n\n describe('full browser window immersion \"fullscreen\"', () => {\n it('creates reflected attribute `viewportinfullscreen`', async () => {\n /** to help with external styling adjustmnents */\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.getAttribute('viewportinfullscreen')).to.be.null;\n\n el.viewportInFullscreen = true;\n await el.updateComplete;\n\n expect(el.getAttribute('viewportinfullscreen')).to.exist;\n });\n it('@ViewportInFullScreen', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.viewportInFullscreen).to.be.null;\n\n const yesFullscreenEvent = {\n detail: {\n isFullScreen: true,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(yesFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.true;\n\n const noFullscreenEvent = {\n detail: {\n isFullScreen: false,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(noFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.null;\n });\n });\n\n /* Side menu & shortcuts tests */\n describe('el.menuOpened', () => {\n it('toggles side menu open', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n expect(nav?.querySelector('#menu')).to.exist;\n // side menu starts closed\n expect(el.menuOpened).to.be.false;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.contain(\n 'hidden',\n );\n\n // let's open menu\n el.toggleMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.not.contain(\n 'hidden',\n );\n });\n\n it('opens menu shortcut with `@manageSideMenuEvents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n const detail = {\n menuId: 'fullscreen',\n action: 'open',\n };\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n const frame = el.shadowRoot?.querySelector('#frame');\n // default menu open behavior is to side menu open, not overlay\n expect(frame?.getAttribute('class')).to.contain('shift');\n\n expect(el.menuOpened).to.be.false;\n expect(el.openMenu).to.be.undefined;\n expect(frame?.getAttribute('class')).to.not.contain('open');\n\n const event = new CustomEvent('updateSideMenu', {\n detail,\n }) as ToggleSideMenuOpenEvent;\n el.manageSideMenuEvents(event);\n await el.updateComplete;\n\n expect(el.shouldRenderMenu).to.be.true;\n expect(el.menuOpened).to.be.true;\n expect(el.openMenu).to.equal(detail.menuId);\n\n expect(frame?.getAttribute('class')).to.contain('open');\n\n // no menu provided\n const openShortcutSpy = Sinon.spy(el, 'openShortcut');\n const toggleMenuSpy = Sinon.spy(el, 'toggleMenu');\n\n const noMenuProvidedEvent = new CustomEvent('updateSideMenu', {\n detail: {},\n }) as any;\n el.manageSideMenuEvents(noMenuProvidedEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.called).to.be.false;\n expect(toggleMenuSpy.called).to.be.false;\n\n // toggle menu\n const toggleMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'toggle', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(toggleMenuEvent);\n await el.updateComplete;\n\n expect(toggleMenuSpy.callCount).to.equal(1);\n\n // open menu\n const openMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'open', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(openMenuEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.callCount).to.equal(1);\n });\n });\n\n describe('el.menuContents', () => {\n it('draws side menu when populated', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n expect(el.menuContents.length).to.exist;\n expect(el.shouldRenderMenu).to.be.true;\n\n const nav = el.shadowRoot?.querySelector('nav');\n expect(nav).to.exist;\n\n const menuSlider = nav?.querySelector('ia-menu-slider');\n expect(menuSlider).to.exist;\n expect(menuSlider?.getAttribute('manuallyhandleclose')).to.exist;\n expect(menuSlider?.getAttribute('open')).to.exist;\n });\n });\n\n describe('`el.menuShortcuts`', () => {\n it('displays shortcut & toggle side menu button', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n const anotherShortcut = {\n id: 'foo',\n icon: html`<i class=\"foo-shortcut\"></i>`,\n };\n el.menuContents = [menuProvider];\n el.menuShortcuts = [shortcut, anotherShortcut];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n const shortcutsContainer = nav?.querySelector('.shortcuts');\n expect(el.menuShortcuts.length).to.exist;\n expect(nav).to.exist;\n expect(shortcutsContainer).to.exist;\n expect(shortcutsContainer?.querySelector('i.fullscreen-test')).to.exist;\n expect(shortcutsContainer?.querySelector('button.shortcut.foo')).to.exist;\n expect(nav?.querySelector('.toggle-menu')).to.exist;\n });\n });\n\n describe('Menu events', () => {\n it('`el.setMenuShortcuts`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuShortcuts.length).to.equal(0);\n\n const menuShortcuts = [shortcut];\n\n el.setMenuShortcuts({\n detail: menuShortcuts,\n } as SetSideMenuShortcutsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setMenuContents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuContents.length).to.equal(0);\n\n el.setMenuShortcuts({\n detail: [menuProvider],\n } as SetSideMenuContentsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setOpenMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.equal('foo');\n expect(el.selectedMenuId).to.equal('foo');\n\n // toggles it off\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.be.undefined;\n expect(el.selectedMenuId).to.equal('');\n });\n it('`el.closeMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuOpened = true;\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n\n el.closeMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.false;\n });\n });\n});\n"]}
1
+ {"version":3,"file":"iaux-item-navigator.test.js","sourceRoot":"","sources":["../../test/iaux-item-navigator.test.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAS7D,SAAS,CAAC,GAAG,EAAE;IACb,KAAK,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;;YACvD,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA;kBACM,IAAI,QAAQ,EAAE;gCACA,CACzB,CAAC;YACF,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;YACzB,MAAM,EAAE,CAAC,cAAc,CAAC;YACxB,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACrC,MAAM,CAAC,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;;YAC1C,MAAM,EAAE,G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,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAEjC,EAAE,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable camelcase */\nimport { html, fixture, expect } from '@open-wc/testing';\nimport Sinon from 'sinon';\n\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport { ItemNavigator } from '../src/iaux-item-navigator';\nimport '../src/iaux-item-navigator';\n\nimport { ItemStub, menuProvider, shortcut } from './ia-stub';\nimport {\n ManageFullscreenEvent,\n ToggleSideMenuOpenEvent,\n SetSideMenuContentsEvent,\n SetSideMenuShortcutsEvent,\n ToggleSidePanelOpenEvent,\n} from '../src/interfaces/event-interfaces';\n\nafterEach(() => {\n Sinon.restore();\n});\n\ndescribe('ItemNavigator', () => {\n describe('Theaters', () => {\n it('shows <ia-no-theater-available> if told', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n el.viewAvailable = false;\n await el.updateComplete;\n expect(el.viewAvailable).to.be.false;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.exist;\n });\n it('opens main slot by default', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n expect(el.viewAvailable).to.be.true;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.be\n .null;\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n });\n describe('`el.loaded`', () => {\n it('toggles the spinning loader', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.loaded).to.be.null; // initial load\n expect(el.shadowRoot?.querySelector('ia-itemnav-loader')).to.exist;\n });\n it('hides reader section if `!loaded`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(\n el.shadowRoot?.querySelector('#reader')?.getAttribute('class'),\n ).to.contain('hidden');\n });\n it('shows reader when `loaded` ', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.loaded = true;\n await el.updateComplete;\n const mainTheaterSection = el.shadowRoot?.querySelector('#reader');\n expect(mainTheaterSection?.classList.contains('hide')).to.be.false;\n expect(el.loaded).to.be.true;\n // `loaded` property is reflected as DOM attribute\n expect(el.hasAttribute('loaded')).to.equal(true);\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n it('listens to `@loadingStateUpdated` to update `loaded` for <no-theater-available>', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n await el.updateComplete;\n const spy = Sinon.spy();\n el.loadingStateUpdated = spy;\n el.loaded = false;\n el.viewAvailable = false;\n await el.updateComplete;\n // check base properties\n expect(el.loaded).to.equal(null);\n expect(el.item).to.be.undefined;\n\n // spy fires\n expect(spy.called).to.equal(true);\n expect(spy.callCount).to.equal(1);\n });\n });\n\n describe('`el.sharedObserver`', () => {\n it('uses one', async () => {\n const sharedObserver = new SharedResizeObserver();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(el.sharedObserver).to.equal(sharedObserver);\n expect(typeof el.handleResize).to.equal('function');\n });\n it('freshly registers handlers', async () => {\n const sharedObserver = new SharedResizeObserver();\n const addObserverSpy = Sinon.spy(sharedObserver, 'addObserver');\n\n await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(addObserverSpy.callCount).to.equal(2);\n });\n it('removes handler when component disconnects', async () => {\n const sharedObserver = new SharedResizeObserver();\n const removeObserverSpy = Sinon.spy(sharedObserver, 'removeObserver');\n\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n el.disconnectedCallback();\n await el.updateComplete;\n\n expect(removeObserverSpy.callCount).to.equal(1);\n });\n it('sets menu to overlay if container width is <= 600px', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(el.openMenuState).to.equal('shift'); // as starting point\n\n const overlaySize = {\n contentRect: { width: 600 },\n } as ResizeObserverEntry;\n el.handleResize(overlaySize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('overlay'); // changes open menu display to an overlay\n\n const shiftSize = {\n contentRect: { width: 601 },\n } as ResizeObserverEntry;\n el.handleResize(shiftSize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('shift');\n });\n });\n\n describe('`el.modal`', () => {\n it('uses one', async () => {\n const modal = new ModalManager();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator .modal=${modal}></iaux-item-navigator>`,\n );\n expect(el.modal).to.equal(modal);\n });\n });\n\n describe('full browser window immersion \"fullscreen\"', () => {\n it('creates reflected attribute `viewportinfullscreen`', async () => {\n /** to help with external styling adjustmnents */\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.getAttribute('viewportinfullscreen')).to.be.null;\n\n el.viewportInFullscreen = true;\n await el.updateComplete;\n\n expect(el.getAttribute('viewportinfullscreen')).to.exist;\n });\n it('@ViewportInFullScreen', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.viewportInFullscreen).to.be.null;\n\n const yesFullscreenEvent = {\n detail: {\n isFullScreen: true,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(yesFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.true;\n\n const noFullscreenEvent = {\n detail: {\n isFullScreen: false,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(noFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.null;\n });\n });\n\n /* Side menu & shortcuts tests */\n describe('el.menuOpened', () => {\n it('toggles side menu open', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n expect(nav?.querySelector('#menu')).to.exist;\n // side menu starts closed\n expect(el.menuOpened).to.be.false;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.contain(\n 'hidden',\n );\n\n // let's open menu\n el.toggleMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.not.contain(\n 'hidden',\n );\n });\n\n it('opens menu shortcut with `@manageSideMenuEvents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n const detail = {\n menuId: 'fullscreen',\n action: 'open',\n };\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n const frame = el.shadowRoot?.querySelector('#frame');\n // default menu open behavior is to side menu open, not overlay\n expect(frame?.getAttribute('class')).to.contain('shift');\n\n expect(el.menuOpened).to.be.false;\n expect(el.openMenu).to.be.undefined;\n expect(frame?.getAttribute('class')).to.not.contain('open');\n\n const event = new CustomEvent('updateSideMenu', {\n detail,\n }) as ToggleSideMenuOpenEvent;\n el.manageSideMenuEvents(event);\n await el.updateComplete;\n\n expect(el.shouldRenderMenu).to.be.true;\n expect(el.menuOpened).to.be.true;\n expect(el.openMenu).to.equal(detail.menuId);\n\n expect(frame?.getAttribute('class')).to.contain('open');\n\n // no menu provided\n const openShortcutSpy = Sinon.spy(el, 'openShortcut');\n const toggleMenuSpy = Sinon.spy(el, 'toggleMenu');\n\n const noMenuProvidedEvent = new CustomEvent('updateSideMenu', {\n detail: {},\n }) as any;\n el.manageSideMenuEvents(noMenuProvidedEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.called).to.be.false;\n expect(toggleMenuSpy.called).to.be.false;\n\n // toggle menu\n const toggleMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'toggle', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(toggleMenuEvent);\n await el.updateComplete;\n\n expect(toggleMenuSpy.callCount).to.equal(1);\n\n // open menu\n const openMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'open', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(openMenuEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.callCount).to.equal(1);\n });\n });\n\n describe('el.menuContents', () => {\n it('draws side menu when populated', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n expect(el.menuContents.length).to.exist;\n expect(el.shouldRenderMenu).to.be.true;\n\n const nav = el.shadowRoot?.querySelector('nav');\n expect(nav).to.exist;\n\n const menuSlider = nav?.querySelector('ia-menu-slider');\n expect(menuSlider).to.exist;\n expect(menuSlider?.getAttribute('manuallyhandleclose')).to.exist;\n expect(menuSlider?.getAttribute('open')).to.exist;\n });\n });\n\n describe('`el.menuShortcuts`', () => {\n it('displays shortcut & toggle side menu button', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n const anotherShortcut = {\n id: 'foo',\n icon: html`<i class=\"foo-shortcut\"></i>`,\n };\n el.menuContents = [menuProvider];\n el.menuShortcuts = [shortcut, anotherShortcut];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n const shortcutsContainer = nav?.querySelector('.shortcuts');\n expect(el.menuShortcuts.length).to.exist;\n expect(nav).to.exist;\n expect(shortcutsContainer).to.exist;\n expect(shortcutsContainer?.querySelector('i.fullscreen-test')).to.exist;\n expect(shortcutsContainer?.querySelector('button.shortcut.foo')).to.exist;\n expect(nav?.querySelector('.toggle-menu')).to.exist;\n });\n });\n\n describe('Menu events', () => {\n it('`el.setMenuShortcuts`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuShortcuts.length).to.equal(0);\n\n const menuShortcuts = [shortcut];\n\n el.setMenuShortcuts({\n detail: menuShortcuts,\n } as SetSideMenuShortcutsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setMenuContents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuContents.length).to.equal(0);\n\n el.setMenuShortcuts({\n detail: [menuProvider],\n } as SetSideMenuContentsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setOpenMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.equal('foo');\n expect(el.selectedMenuId).to.equal('foo');\n\n // toggles it off\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.be.undefined;\n expect(el.selectedMenuId).to.equal('');\n });\n it('`el.closeMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuOpened = true;\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n\n el.closeMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.false;\n });\n });\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-item-navigator",
3
- "version": "v2.0.0-alpha6",
3
+ "version": "v2.0.0-alpha7",
4
4
  "description": "Internet Archive's Item Navigator, visually explore an item's contents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -72,9 +72,7 @@ export class ItemNavigator
72
72
 
73
73
  @property({ attribute: false }) sharedObserver?: SharedResizeObserver;
74
74
 
75
- @property({ type: Boolean, reflect: true, attribute: true }) loaded:
76
- | true
77
- | null = null;
75
+ @property({ type: Boolean, reflect: true, attribute: true }) loaded: boolean = false;
78
76
 
79
77
  @state() openMenuState: 'overlay' | 'shift' = 'shift';
80
78
 
@@ -211,7 +209,7 @@ export class ItemNavigator
211
209
 
212
210
  loadingStateUpdated(e: loadingStateUpdatedEvent): void {
213
211
  const { loaded } = e.detail;
214
- this.loaded = loaded || null;
212
+ this.loaded = loaded ?? false;
215
213
  }
216
214
 
217
215
  /** Fullscreen Management */
@@ -124,7 +124,7 @@ export class IauxSortFilesButton extends LitElement {
124
124
 
125
125
  @property({ type: Array }) fileListSorted: any[] = [];
126
126
 
127
- @property({ type: String }) sortOrderBy: sortOptions = 'default';
127
+ @property({ type: String, reflect: true }) sortOrderBy: sortOptions = 'default';
128
128
 
129
129
  render() {
130
130
  return html`<div class="sort-multi-file-list">${this.sortButton}</div>`;
@@ -87,7 +87,7 @@ describe('ItemNavigator', () => {
87
87
  await el.updateComplete;
88
88
  const spy = Sinon.spy();
89
89
  el.loadingStateUpdated = spy;
90
- el.loaded = null;
90
+ el.loaded = false;
91
91
  el.viewAvailable = false;
92
92
  await el.updateComplete;
93
93
  // check base properties