@internetarchive/ia-item-navigator 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/README.md +29 -19
  2. package/demo/app-root.ts +113 -22
  3. package/demo/index.html +12 -4
  4. package/dist/demo/app-root.d.ts +27 -7
  5. package/dist/demo/app-root.js +98 -23
  6. package/dist/demo/app-root.js.map +1 -1
  7. package/dist/src/interfaces/custom-theater-interface.d.ts +20 -0
  8. package/dist/src/interfaces/custom-theater-interface.js +2 -0
  9. package/dist/src/interfaces/custom-theater-interface.js.map +1 -0
  10. package/dist/src/interfaces/event-interfaces.d.ts +13 -23
  11. package/dist/src/interfaces/event-interfaces.js.map +1 -1
  12. package/dist/src/interfaces/menu-interfaces.d.ts +7 -7
  13. package/dist/src/interfaces/menu-interfaces.js.map +1 -1
  14. package/dist/src/interfaces/nav-controller-interface.d.ts +11 -6
  15. package/dist/src/interfaces/nav-controller-interface.js.map +1 -1
  16. package/dist/src/item-inspector/files-by-type/files-by-type-provider.js +5 -3
  17. package/dist/src/item-inspector/files-by-type/files-by-type-provider.js.map +1 -1
  18. package/dist/src/item-inspector/files-by-type/ia-files-by-type.d.ts +1 -0
  19. package/dist/src/item-inspector/files-by-type/ia-files-by-type.js +14 -0
  20. package/dist/src/item-inspector/files-by-type/ia-files-by-type.js.map +1 -1
  21. package/dist/src/item-inspector/item-inspector.d.ts +0 -31
  22. package/dist/src/item-inspector/item-inspector.js +253 -181
  23. package/dist/src/item-inspector/item-inspector.js.map +1 -1
  24. package/dist/src/item-inspector/visual-mod-provider.d.ts +19 -0
  25. package/dist/src/item-inspector/visual-mod-provider.js +46 -0
  26. package/dist/src/item-inspector/visual-mod-provider.js.map +1 -0
  27. package/dist/src/item-navigator.d.ts +50 -28
  28. package/dist/src/item-navigator.js +216 -132
  29. package/dist/src/item-navigator.js.map +1 -1
  30. package/dist/src/loader.d.ts +5 -0
  31. package/dist/src/loader.js +8 -2
  32. package/dist/src/loader.js.map +1 -1
  33. package/dist/src/no-theater-available.d.ts +9 -0
  34. package/dist/src/no-theater-available.js +79 -0
  35. package/dist/src/no-theater-available.js.map +1 -0
  36. package/dist/test/book-nav-stub.d.ts +22 -0
  37. package/dist/test/book-nav-stub.js +49 -0
  38. package/dist/test/book-nav-stub.js.map +1 -0
  39. package/dist/test/ia-item-navigator.test.d.ts +2 -0
  40. package/dist/test/ia-item-navigator.test.js +317 -0
  41. package/dist/test/ia-item-navigator.test.js.map +1 -0
  42. package/dist/test/ia-stub-goody.d.ts +210 -0
  43. package/dist/test/ia-stub-goody.js +276 -0
  44. package/dist/test/ia-stub-goody.js.map +1 -0
  45. package/dist/test/ia-stub.d.ts +22 -0
  46. package/dist/test/ia-stub.js +35 -0
  47. package/dist/test/ia-stub.js.map +1 -0
  48. package/dist/test/no-theater-available.test.d.ts +1 -0
  49. package/dist/test/no-theater-available.test.js +27 -0
  50. package/dist/test/no-theater-available.test.js.map +1 -0
  51. package/package.json +14 -5
  52. package/src/interfaces/custom-theater-interface.ts +28 -0
  53. package/src/interfaces/event-interfaces.ts +17 -24
  54. package/src/interfaces/menu-interfaces.ts +10 -9
  55. package/src/item-navigator.ts +257 -155
  56. package/src/loader.ts +9 -2
  57. package/src/no-theater-available.ts +85 -0
  58. package/test/book-nav-stub.ts +47 -0
  59. package/test/ia-item-navigator.test.ts +438 -0
  60. package/test/ia-stub.ts +79 -0
  61. package/test/no-theater-available.test.ts +32 -0
  62. package/demo/demo-book-manifest.json +0 -1163
  63. package/demo/demo-item-md.json +0 -247
  64. package/src/interfaces/nav-controller-interface.ts +0 -18
  65. package/src/item-inspector/files-by-type/files-by-type-provider.ts +0 -41
  66. package/src/item-inspector/files-by-type/ia-files-by-type.ts +0 -84
  67. package/src/item-inspector/item-inspector.ts +0 -202
  68. package/src/item-inspector/share-provider.ts +0 -51
  69. package/src/item-navigator-js.js +0 -372
  70. package/test/your-webcomponent.test.ts +0 -40
@@ -1,22 +1,22 @@
1
1
  import { TemplateResult } from 'lit-html';
2
2
  import { MetadataResponse } from '@internetarchive/search-service';
3
- export interface IntMenuShortcut {
3
+ export declare type MenuId = string;
4
+ export interface MenuShortcutInterface {
4
5
  icon: TemplateResult;
5
- id: string;
6
+ id: MenuId;
6
7
  }
7
- export interface IntMenuIconAndDetails extends IntMenuShortcut {
8
- icon: TemplateResult;
9
- id: string;
8
+ export interface MenuDetailsInterface extends MenuShortcutInterface {
10
9
  label: string;
11
10
  menuDetails?: TemplateResult;
12
11
  selected?: boolean;
13
12
  followable?: boolean;
14
13
  href?: string;
15
14
  }
16
- export interface IntProviderArgs {
15
+ export interface MenuProviderBaseConfigInterface {
17
16
  item: MetadataResponse;
18
17
  baseHost: string;
19
18
  subPrefix: string;
19
+ updated?: any;
20
20
  }
21
- export interface IntMenuProvider extends IntProviderArgs, IntMenuIconAndDetails {
21
+ export interface MenuProviderInterface extends MenuProviderBaseConfigInterface, MenuDetailsInterface, MenuShortcutInterface {
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menu-interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/menu-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { TemplateResult } from 'lit-html';\nimport { MetadataResponse } from '@internetarchive/search-service';\n\nexport interface IntMenuShortcut {\n icon: TemplateResult;\n id: string;\n}\n\nexport interface IntMenuIconAndDetails extends IntMenuShortcut {\n icon: TemplateResult;\n id: string;\n label: string;\n menuDetails?: TemplateResult;\n selected?: boolean;\n followable?: boolean;\n href?: string;\n}\n\nexport interface IntProviderArgs {\n item: MetadataResponse;\n baseHost: string;\n subPrefix: string;\n}\nexport interface IntMenuProvider\n extends IntProviderArgs,\n IntMenuIconAndDetails {}\n"]}
1
+ {"version":3,"file":"menu-interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/menu-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { TemplateResult } from 'lit-html';\nimport { MetadataResponse } from '@internetarchive/search-service';\n\nexport type MenuId = string;\nexport interface MenuShortcutInterface {\n icon: TemplateResult;\n id: MenuId;\n}\n\nexport interface MenuDetailsInterface extends MenuShortcutInterface {\n label: string;\n menuDetails?: TemplateResult;\n selected?: boolean;\n followable?: boolean;\n href?: string;\n}\n\nexport interface MenuProviderBaseConfigInterface {\n item: MetadataResponse;\n baseHost: string;\n subPrefix: string;\n updated?: any;\n}\nexport interface MenuProviderInterface\n extends MenuProviderBaseConfigInterface,\n MenuDetailsInterface,\n MenuShortcutInterface {}\n"]}
@@ -1,12 +1,17 @@
1
1
  import { LitElement } from 'lit-element';
2
2
  import { MetadataResponse } from '@internetarchive/search-service';
3
- import { IntMenuShortcut } from './menu-interfaces';
4
- export interface IntNavController extends LitElement {
5
- baseHost: string;
6
- itemMD: MetadataResponse;
7
- menuProviders: object;
8
- menuShortcuts: IntMenuShortcut[];
3
+ import { ModalManager } from '@internetarchive/modal-manager';
4
+ import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
5
+ import { IntMenuProvider, IntMenuShortcut } from './menu-interfaces';
6
+ export interface CustomTheaterInterface extends LitElement {
7
+ baseHost?: string;
8
+ itemMD?: MetadataResponse;
9
+ menuProviders?: IntMenuProvider[];
10
+ menuShortcuts?: IntMenuShortcut[];
9
11
  sideMenuOpen: boolean;
12
+ signedIn?: boolean | null;
13
+ sharedObserver?: SharedResizeObserver;
14
+ modal?: ModalManager;
10
15
  emitLoadingStatusUpdate: (loaded: boolean) => void;
11
16
  addMenuShortcut: (menuId: string) => void;
12
17
  removeMenuShortcut: (menuId: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"nav-controller-interface.js","sourceRoot":"","sources":["../../../src/interfaces/nav-controller-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { LitElement } from 'lit-element';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport { IntMenuShortcut } from './menu-interfaces';\n\nexport interface IntNavController extends LitElement {\n baseHost: string;\n itemMD: MetadataResponse;\n menuProviders: object;\n menuShortcuts: IntMenuShortcut[];\n sideMenuOpen: boolean;\n\n emitLoadingStatusUpdate: (loaded: boolean) => void;\n\n addMenuShortcut: (menuId: string) => void;\n removeMenuShortcut: (menuId: string) => void;\n sortMenuShortcuts: () => void;\n emitMenuShortcutsUpdated: () => void;\n}\n"]}
1
+ {"version":3,"file":"nav-controller-interface.js","sourceRoot":"","sources":["../../../src/interfaces/nav-controller-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { LitElement } from 'lit-element';\nimport { MetadataResponse } from '@internetarchive/search-service';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { IntMenuProvider, IntMenuShortcut } from './menu-interfaces';\n\nexport interface CustomTheaterInterface extends LitElement {\n baseHost?: string;\n itemMD?: MetadataResponse;\n menuProviders?: IntMenuProvider[];\n menuShortcuts?: IntMenuShortcut[];\n sideMenuOpen: boolean;\n\n signedIn?: boolean | null;\n\n sharedObserver?: SharedResizeObserver;\n modal?: ModalManager;\n\n emitLoadingStatusUpdate: (loaded: boolean) => void;\n\n addMenuShortcut: (menuId: string) => void;\n removeMenuShortcut: (menuId: string) => void;\n sortMenuShortcuts: () => void;\n emitMenuShortcutsUpdated: () => void;\n}\n"]}
@@ -5,9 +5,11 @@ export class FilesByTypeProvider {
5
5
  constructor(shareArgs) {
6
6
  this.item = null;
7
7
  this.baseHost = 'https://archive.org';
8
- this.icon = html `<ia-icon-share
9
- style="width: var(--iconWidth); height: var(--iconHeight);"
10
- ></ia-icon-share>`;
8
+ this.icon = html `<p
9
+ style="color: #fff; font-size: var(--iconHeight);"
10
+ >
11
+ F
12
+ </p>`;
11
13
  this.id = 'filesByType';
12
14
  this.label = 'Files by type';
13
15
  this.component = null;
@@ -1 +1 @@
1
- {"version":3,"file":"files-by-type-provider.js","sourceRoot":"","sources":["../../../../src/item-inspector/files-by-type/files-by-type-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wCAAwC,CAAC;AAMhD,MAAM,OAAO,mBAAmB;IAiB9B,YAAY,SAA0B;QAhBtC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA;;oBAET,CAAC;QAEnB,OAAE,GAAW,aAAa,CAAC;QAE3B,UAAK,GAAW,eAAe,CAAC;QAEhC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAGrB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QAErC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;cACX,IAAI,CAAC,IAAI;sBACD,KAAK;mBACR,IAAI,CAAC,QAAQ;yBACP,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { html, TemplateResult } from 'lit-element';\n\nimport './ia-files-by-type';\nimport '@internetarchive/icon-share/icon-share';\nimport {\n IntMenuProvider,\n IntProviderArgs,\n} from '../../interfaces/menu-interfaces';\n\nexport class FilesByTypeProvider implements IntMenuProvider {\n item: any = null;\n\n baseHost: string = 'https://archive.org';\n\n icon: TemplateResult = html`<ia-icon-share\n style=\"width: var(--iconWidth); height: var(--iconHeight);\"\n ></ia-icon-share>`;\n\n id: string = 'filesByType';\n\n label: string = 'Files by type';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n constructor(shareArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '' } = shareArgs;\n const { title = '' } = item.metadata;\n\n this.item = item;\n this.baseHost = baseHost;\n this.subPrefix = subPrefix;\n\n this.component = html`<ia-files-by-type\n .item=${this.item}\n .description=\"${title}\"\n .baseHost=\"${this.baseHost}\"\n ></ia-files-by-type>`;\n }\n}\n"]}
1
+ {"version":3,"file":"files-by-type-provider.js","sourceRoot":"","sources":["../../../../src/item-inspector/files-by-type/files-by-type-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wCAAwC,CAAC;AAMhD,MAAM,OAAO,mBAAmB;IAmB9B,YAAY,SAA0B;QAlBtC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA;;;;OAItB,CAAC;QAEN,OAAE,GAAW,aAAa,CAAC;QAE3B,UAAK,GAAW,eAAe,CAAC;QAEhC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAGrB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QAErC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;cACX,IAAI,CAAC,IAAI;sBACD,KAAK;mBACR,IAAI,CAAC,QAAQ;yBACP,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { html, TemplateResult } from 'lit-element';\n\nimport './ia-files-by-type';\nimport '@internetarchive/icon-share/icon-share';\nimport {\n IntMenuProvider,\n IntProviderArgs,\n} from '../../interfaces/menu-interfaces';\n\nexport class FilesByTypeProvider implements IntMenuProvider {\n item: any = null;\n\n baseHost: string = 'https://archive.org';\n\n icon: TemplateResult = html`<p\n style=\"color: #fff; font-size: var(--iconHeight);\"\n >\n F\n </p>`;\n\n id: string = 'filesByType';\n\n label: string = 'Files by type';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n constructor(shareArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '' } = shareArgs;\n const { title = '' } = item.metadata;\n\n this.item = item;\n this.baseHost = baseHost;\n this.subPrefix = subPrefix;\n\n this.component = html`<ia-files-by-type\n .item=${this.item}\n .description=\"${title}\"\n .baseHost=\"${this.baseHost}\"\n ></ia-files-by-type>`;\n }\n}\n"]}
@@ -10,6 +10,7 @@ export default class IaFilesByType extends LitElement {
10
10
  collapsedFiles: CollapsedFileInt[];
11
11
  firstUpdated(): void;
12
12
  render(): import("lit-element").TemplateResult;
13
+ sortByViewer(): boolean;
13
14
  collapseFiles(): void;
14
15
  }
15
16
  export {};
@@ -21,6 +21,20 @@ let IaFilesByType = class IaFilesByType extends LitElement {
21
21
  </div>
22
22
  `;
23
23
  }
24
+ sortByViewer() {
25
+ // const images = [];
26
+ // const books = [];
27
+ // const radio = [];
28
+ // const audio = [];
29
+ // const video = [];
30
+ // const albums = [];
31
+ // const software = [];
32
+ // this.collapsedFiles.forEach((fi) => {
33
+ // // if image
34
+ // // sort by various viewers
35
+ // })
36
+ return true;
37
+ }
24
38
  collapseFiles() {
25
39
  const { files = [] } = this === null || this === void 0 ? void 0 : this.item;
26
40
  const archivalArtifacts = [];
@@ -1 +1 @@
1
- {"version":3,"file":"ia-files-by-type.js","sourceRoot":"","sources":["../../../../src/item-inspector/files-by-type/ia-files-by-type.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQxE,IAAqB,aAAa,GAAlC,MAAqB,aAAc,SAAQ,UAAU;IAArD;;QAC8B,SAAI,GAAqB,EAAsB,CAAC;QAEjD,sBAAiB,GAAW,EAAE,CAAC;QAE/B,mBAAc,GAAuB,EAAE,CAAC;IAqErE,CAAC;IA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M,SAAS,GAAG,QAAQ,IAAI,EAAE,CAAC;gBACjC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;gBAC/B,IAAI,CAAC,SAAS,IAAI,QAAQ,EAAE;oBAC1B,UAAU;oBACV,MAAM,SAAS,GAAG,EAAE,WAAW,EAAE,EAAE,EAAsB,CAAC;oBAC1D,SAAS,GAAG,SAAS,CAAC;oBACtB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAChC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;oBAC/B,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;iBAChC;gBACD,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAC5C,CAAC,QAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CACxC,CAAC;IACJ,CAAC;CACF,CAAA;AAzE6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAiD;AAEjD;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wDAAgC;AAE/B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAyC;AALhD,aAAa;IADjC,aAAa,CAAC,kBAAkB,CAAC;GACb,aAAa,CA0EjC;eA1EoB,aAAa","sourcesContent":["import { MetadataResponse, File } from '@internetarchive/search-service';\nimport { html, customElement, LitElement, property } from 'lit-element';\n\ninterface CollapsedFileInt extends File {\n [menuId: string]: any;\n derivatives: [];\n}\n\n@customElement('ia-files-by-type')\nexport default class IaFilesByType extends LitElement {\n @property({ type: Object }) item: MetadataResponse = {} as MetadataResponse;\n\n @property({ type: Array }) archivalArtifacts: File[] = [];\n\n @property({ type: Array }) collapsedFiles: CollapsedFileInt[] = [];\n\n firstUpdated() {\n this.collapseFiles();\n }\n\n render() {\n return html`\n <div>\n <p>there are ${this.collapsedFiles.length} original files</p>\n\n <p>there are ${this.archivalArtifacts.length} archival artifacts</p>\n\n <p></p>\n </div>\n `;\n }\n\n collapseFiles() {\n const { files = [] } = this?.item as MetadataResponse;\n\n const archivalArtifacts: File[] = [];\n const origDir: any = {};\n\n files.forEach(fi => {\n const { format, source, name, original = '' } = fi as File;\n if (\n format.toLowerCase() === 'metadata' ||\n format.toLowerCase() === 'item tile'\n ) {\n archivalArtifacts.push(fi);\n return;\n }\n\n let origEntry: any = {};\n if (source === 'original') {\n origEntry = origDir[name];\n if (!origEntry) {\n // add new\n origDir[name] = { ...fi, derivatives: [] } as CollapsedFileInt;\n origEntry = origDir[name];\n } else {\n // update\n const merged = { ...origEntry, ...fi };\n origDir[name] = merged;\n }\n return;\n }\n\n if (source === 'derivative') {\n const keyToFile = original || '';\n origEntry = origDir[keyToFile];\n if (!origEntry && original) {\n // add new\n const fileFrame = { derivatives: [] } as CollapsedFileInt;\n origEntry = fileFrame;\n origEntry?.derivatives.push(fi);\n origDir[keyToFile] = origEntry;\n origEntry = origDir[keyToFile];\n }\n origEntry?.derivatives.push(fi);\n }\n });\n\n this.archivalArtifacts = archivalArtifacts;\n this.collapsedFiles = Object.keys(origDir).map(\n (fileName: string) => origDir[fileName]\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ia-files-by-type.js","sourceRoot":"","sources":["../../../../src/item-inspector/files-by-type/ia-files-by-type.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQxE,IAAqB,aAAa,GAAlC,MAAqB,aAAc,SAAQ,UAAU;IAArD;;QAC8B,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C;AAE/B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAyC;AALhD,aAAa;IADjC,aAAa,CAAC,kBAAkB,CAAC;GACb,aAAa,CA0FjC;eA1FoB,aAAa","sourcesContent":["import { MetadataResponse, File } from '@internetarchive/search-service';\nimport { html, customElement, LitElement, property } from 'lit-element';\n\ninterface CollapsedFileInt extends File {\n [menuId: string]: any;\n derivatives: [];\n}\n\n@customElement('ia-files-by-type')\nexport default class IaFilesByType extends LitElement {\n @property({ type: Object }) item: MetadataResponse = {} as MetadataResponse;\n\n @property({ type: Array }) archivalArtifacts: File[] = [];\n\n @property({ type: Array }) collapsedFiles: CollapsedFileInt[] = [];\n\n firstUpdated() {\n this.collapseFiles();\n }\n\n render() {\n return html`\n <div>\n <p>there are ${this.collapsedFiles.length} original files</p>\n\n <p>there are ${this.archivalArtifacts.length} archival artifacts</p>\n\n <p></p>\n </div>\n `;\n }\n\n sortByViewer() {\n // const images = [];\n // const books = [];\n // const radio = [];\n // const audio = [];\n // const video = [];\n // const albums = [];\n // const software = [];\n // this.collapsedFiles.forEach((fi) => {\n // // if image\n // // sort by various viewers\n // })\n\n return true;\n }\n\n collapseFiles() {\n const { files = [] } = this?.item as MetadataResponse;\n\n const archivalArtifacts: File[] = [];\n const origDir: any = {};\n\n files.forEach(fi => {\n const { format, source, name, original = '' } = fi as File;\n if (\n format.toLowerCase() === 'metadata' ||\n format.toLowerCase() === 'item tile'\n ) {\n archivalArtifacts.push(fi);\n return;\n }\n\n let origEntry: any = {};\n if (source === 'original') {\n origEntry = origDir[name];\n if (!origEntry) {\n // add new\n origDir[name] = { ...fi, derivatives: [] } as CollapsedFileInt;\n origEntry = origDir[name];\n } else {\n // update\n const merged = { ...origEntry, ...fi };\n origDir[name] = merged;\n }\n return;\n }\n\n if (source === 'derivative') {\n const keyToFile = original || '';\n origEntry = origDir[keyToFile];\n if (!origEntry && original) {\n // add new\n const fileFrame = { derivatives: [] } as CollapsedFileInt;\n origEntry = fileFrame;\n origEntry?.derivatives.push(fi);\n origDir[keyToFile] = origEntry;\n origEntry = origDir[keyToFile];\n }\n origEntry?.derivatives.push(fi);\n }\n });\n\n this.archivalArtifacts = archivalArtifacts;\n this.collapsedFiles = Object.keys(origDir).map(\n (fileName: string) => origDir[fileName]\n );\n }\n}\n"]}
@@ -1,31 +0,0 @@
1
- import { LitElement } from 'lit-element';
2
- import { MetadataResponse } from '@internetarchive/search-service';
3
- import { IntNavController } from '../interfaces/nav-controller-interface';
4
- import { IntMenuShortcut, IntMenuProvider } from '../interfaces/menu-interfaces';
5
- interface menuProvidersInt {
6
- [menuId: string]: IntMenuProvider;
7
- }
8
- export declare class IaItemInspector extends LitElement implements IntNavController {
9
- itemMD: MetadataResponse;
10
- baseHost: string;
11
- menuProviders: menuProvidersInt;
12
- menuShortcuts: IntMenuShortcut[];
13
- shortcutOrder: string[];
14
- sideMenuOpen: boolean;
15
- fileCount: number;
16
- loaded: boolean;
17
- firstUpdated(): void;
18
- updated(changed: any): void;
19
- render(): import("lit-element").TemplateResult;
20
- setMenu(): void;
21
- addMenuShortcut(menuId: keyof menuProvidersInt): void;
22
- sortMenuShortcuts(): void;
23
- emitMenuShortcutsUpdated(): void;
24
- removeMenuShortcut(menuId: string): void;
25
- updateMenuContents(): void;
26
- emitLoadingStatusUpdate(loaded: boolean): void;
27
- parseItemInfo(): void;
28
- get imageUrl(): string;
29
- static get styles(): import("lit-element").CSSResult[];
30
- }
31
- export {};
@@ -1,182 +1,254 @@
1
- import { __decorate } from "tslib";
2
- /* eslint-disable no-console */
3
- import { css, html, LitElement, customElement, property, state, } from 'lit-element';
4
- import { ShareProvider } from './share-provider';
5
- import { FilesByTypeProvider } from './files-by-type/files-by-type-provider';
6
- // eslint-disable-next-line no-shadow
7
- var ItemInspectorEvents;
8
- (function (ItemInspectorEvents) {
9
- ItemInspectorEvents["menuUpdated"] = "menuUpdated";
10
- ItemInspectorEvents["updateSideMenu"] = "updateSideMenu";
11
- ItemInspectorEvents["PostInit"] = "PostInit";
12
- ItemInspectorEvents["ViewportInFullScreen"] = "ViewportInFullScreen";
13
- })(ItemInspectorEvents || (ItemInspectorEvents = {}));
14
- let IaItemInspector = class IaItemInspector extends LitElement {
15
- constructor() {
16
- super(...arguments);
17
- this.itemMD = {};
18
- this.baseHost = 'https://archive.org';
19
- this.menuProviders = {};
20
- this.menuShortcuts = [];
21
- this.shortcutOrder = ['filesByType'];
22
- this.sideMenuOpen = false;
23
- this.fileCount = 0;
24
- this.loaded = false;
25
- }
26
- firstUpdated() {
27
- this.loaded = true;
28
- }
29
- updated(changed) {
30
- if (changed.has('loaded')) {
31
- this.emitLoadingStatusUpdate(this.loaded);
32
- }
33
- if (changed.has('itemMD') && this.itemMD) {
34
- this.parseItemInfo();
35
- this.setMenu();
36
- }
37
- if (changed.has('menuProviders') || changed.has('menuShortcuts')) {
38
- this.updateMenuContents();
39
- }
40
- }
41
- render() {
42
- var _a;
43
- const { identifier = '' } = ((_a = this.itemMD) === null || _a === void 0 ? void 0 : _a.metadata) || {};
44
- return html `
45
- <section>
46
- <div>
47
- <h2>${identifier}</h2>
48
- </div>
49
- <img src=${this.imageUrl} alt=${`${identifier} thumbnail`} />
50
- </section>
51
- `;
52
- }
53
- setMenu() {
54
- const menuProviders = {
55
- share: new ShareProvider({
56
- item: this.itemMD,
57
- baseHost: this.baseHost,
58
- subPrefix: '',
59
- }),
60
- filesByType: new FilesByTypeProvider({
61
- item: this.itemMD,
62
- baseHost: this.baseHost,
63
- subPrefix: '',
64
- }),
65
- };
66
- this.menuProviders = menuProviders;
67
- this.addMenuShortcut('filesByType');
68
- }
69
- addMenuShortcut(menuId) {
70
- if (this.menuShortcuts.find(m => m.id === menuId)) {
71
- return;
72
- }
73
- const shortcut = this.menuProviders[menuId];
74
- this.menuShortcuts.push(shortcut);
75
- this.sortMenuShortcuts();
76
- this.emitMenuShortcutsUpdated();
77
- }
78
- sortMenuShortcuts() {
79
- const sorted = this.shortcutOrder.reduce((shortcuts, id) => {
80
- const menu = this.menuShortcuts.find(m => m.id === id);
81
- let allShortcuts = [...shortcuts];
82
- if (menu) {
83
- const newShortcut = [menu];
84
- allShortcuts = [...shortcuts, ...newShortcut];
85
- }
86
- return allShortcuts;
87
- }, []);
88
- this.menuShortcuts = sorted;
89
- }
90
- emitMenuShortcutsUpdated() {
91
- const event = new CustomEvent('menuShortcutsUpdated', {
92
- detail: this.menuShortcuts,
93
- });
94
- this.dispatchEvent(event);
95
- }
96
- removeMenuShortcut(menuId) {
97
- this.menuShortcuts = this.menuShortcuts.filter(m => m.id !== menuId);
98
- this.emitMenuShortcutsUpdated();
99
- }
100
- updateMenuContents() {
101
- const { share, filesByType } = this.menuProviders;
102
- const availableMenus = [filesByType, share].filter(menu => !!menu);
103
- const event = new CustomEvent(ItemInspectorEvents.menuUpdated, {
104
- detail: availableMenus,
105
- });
106
- this.dispatchEvent(event);
107
- }
108
- emitLoadingStatusUpdate(loaded) {
109
- const event = new CustomEvent('loadingStateUpdated', {
110
- detail: { loaded },
111
- });
112
- this.dispatchEvent(event);
113
- }
114
- parseItemInfo() {
115
- var _a, _b;
116
- this.fileCount = ((_b = (_a = this.itemMD) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.length) || 0;
117
- }
118
- get imageUrl() {
119
- const { metadata = {} } = this.itemMD;
120
- const url = `${this.baseHost}/download/${metadata === null || metadata === void 0 ? void 0 : metadata.identifier}/__ia_thumb.jpg`;
121
- return url;
122
- }
123
- static get styles() {
124
- const main = css `
125
- :host {
126
- display: block;
127
- width: 100%;
128
- margin: 0 auto;
129
- position: relative;
130
- overflow: hidden;
131
- display: block;
132
- }
133
-
134
- :host,
135
- section {
136
- min-height: inherit;
137
- height: inherit;
138
- }
139
-
140
- section {
141
- margin: auto;
142
- width: 100%;
143
- border: 1px solid;
144
- text-align: center;
145
- }
146
-
147
- img {
148
- border: 1px solid var(--primaryTextColor, #fff);
149
- }
150
- `;
151
- return [main];
152
- }
153
- };
154
- __decorate([
155
- property({ type: Object })
156
- ], IaItemInspector.prototype, "itemMD", void 0);
157
- __decorate([
158
- property({ type: String })
159
- ], IaItemInspector.prototype, "baseHost", void 0);
160
- __decorate([
161
- property({ type: Object })
162
- ], IaItemInspector.prototype, "menuProviders", void 0);
163
- __decorate([
164
- property({ type: Array })
165
- ], IaItemInspector.prototype, "menuShortcuts", void 0);
166
- __decorate([
167
- property({ type: Array })
168
- ], IaItemInspector.prototype, "shortcutOrder", void 0);
169
- __decorate([
170
- property({ type: Boolean })
171
- ], IaItemInspector.prototype, "sideMenuOpen", void 0);
172
- __decorate([
173
- state()
174
- ], IaItemInspector.prototype, "fileCount", void 0);
175
- __decorate([
176
- state()
177
- ], IaItemInspector.prototype, "loaded", void 0);
178
- IaItemInspector = __decorate([
179
- customElement('ia-item-inspector')
180
- ], IaItemInspector);
181
- export { IaItemInspector };
1
+ "use strict";
2
+ // /* eslint-disable no-console */
3
+ // import {
4
+ // css,
5
+ // html,
6
+ // LitElement,
7
+ // customElement,
8
+ // property,
9
+ // state,
10
+ // } from 'lit-element';
11
+ // import { MetadataResponse } from '@internetarchive/search-service';
12
+ // import {
13
+ // ModalManagerInterface,
14
+ // ModalConfig,
15
+ // } from '@internetarchive/modal-manager';
16
+ // import { SharedResizeObserverInterface } from '@internetarchive/shared-resize-observer';
17
+ // import { IntNavController } from '../interfaces/nav-controller-interface';
18
+ // import {
19
+ // IntMenuProvider,
20
+ // IntMenuShortcut,
21
+ // } from '../interfaces/menu-interfaces';
22
+ // import { IntManageFullscreenEvent } from '../interfaces/event-interfaces';
23
+ // import { ShareProvider } from './share-provider';
24
+ // import { FilesByTypeProvider } from './files-by-type/files-by-type-provider';
25
+ // import { VisualModsProvider } from './visual-mod-provider';
26
+ // // eslint-disable-next-line no-shadow
27
+ // enum ItemInspectorEvents {
28
+ // menuUpdated = 'menuUpdated',
29
+ // updateSideMenu = 'updateSideMenu',
30
+ // PostInit = 'PostInit',
31
+ // ViewportInFullScreen = 'ViewportInFullScreen',
32
+ // }
33
+ // interface menuProvidersInt {
34
+ // [menuId: string]: IntMenuProvider;
35
+ // }
36
+ // @customElement('ia-item-inspector')
37
+ // export class IaItemInspector extends LitElement implements IntNavController {
38
+ // @property({ type: Object }) itemMD: MetadataResponse = {
39
+ // metadata: {},
40
+ // } as MetadataResponse;
41
+ // @property({ type: String }) baseHost = 'https://archive.org';
42
+ // @property({ type: Object }) menuProviders: menuProvidersInt = {};
43
+ // @property({ type: Array }) menuShortcuts: IntMenuShortcut[] = [];
44
+ // @property({ type: Boolean }) sideMenuOpen = false;
45
+ // @property({ type: Boolean }) fullscreenState = false;
46
+ // @property({ attribute: false }) modal!: ModalManagerInterface;
47
+ // @property({ attribute: false }) sharedRO!: SharedResizeObserverInterface;
48
+ // @state() fileCount: number = 0;
49
+ // @state() loaded: boolean = false;
50
+ // @state() private shortcutOrder = ['visualMods'];
51
+ // firstUpdated() {
52
+ // this.loaded = true;
53
+ // console.log('modal', this.modal);
54
+ // }
55
+ // updated(changed: any) {
56
+ // if (changed.has('loaded')) {
57
+ // setTimeout(() => this.emitLoadingStatusUpdate(this.loaded), 1000);
58
+ // }
59
+ // if (changed.has('itemMD') && this.itemMD) {
60
+ // this.parseItemInfo();
61
+ // this.setMenu();
62
+ // }
63
+ // if (changed.has('menuProviders') || changed.has('menuShortcuts')) {
64
+ // this.updateMenuContents();
65
+ // }
66
+ // }
67
+ // modalClosedCallback() {
68
+ // console.log('item-inspector, modal closed');
69
+ // }
70
+ // openModal() {
71
+ // const config = new ModalConfig();
72
+ // const customModalContent = html`
73
+ // Can contain any markup, including web components. Event listeners also
74
+ // work. Try clicking on the picture.
75
+ // <div style="text-align: center">
76
+ // <a href="https://fillmurray.com" style="display: block">Fill Murray</a>
77
+ // <img src="100x100.jpg" alt="foo" />
78
+ // </div>
79
+ // `;
80
+ // this.modal.showModal({
81
+ // config,
82
+ // customModalContent,
83
+ // userClosedModalCallback: this.modalClosedCallback,
84
+ // });
85
+ // }
86
+ // render() {
87
+ // const { identifier = '' } = this.itemMD?.metadata;
88
+ // return html`
89
+ // <section>
90
+ // <div>
91
+ // <h2>${identifier}</h2>
92
+ // </div>
93
+ // <img src=${this.imageUrl} alt=${`${identifier} thumbnail`} />
94
+ // <button @click=${() => this.openModal()}>open modal</button>
95
+ // <p style="font-size: 20px;">
96
+ // Bacon ipsum dolor amet flank chicken leberkas sausage, meatball pork
97
+ // belly jowl. Chislic bacon salami frankfurter shankle drumstick
98
+ // andouille ball tip alcatra. Fatback beef ribs chicken, jerky ground
99
+ // round hamburger pork chop biltong. Shoulder short loin rump jerky
100
+ // kielbasa pork porchetta fatback ribeye pork belly sirloin chislic
101
+ // turducken corned beef tri-tip. Chuck pancetta meatball tail, spare
102
+ // ribs ham hock capicola pig. Ham hock hamburger chicken tri-tip venison
103
+ // swine burgdoggen boudin meatloaf pastrami chuck. Tri-tip spare ribs
104
+ // drumstick, tail rump hamburger burgdoggen swine t-bone tongue
105
+ // andouille chislic alcatra. Pork loin jowl frankfurter, doner meatball
106
+ // short loin ham hock filet mignon hamburger rump turkey bresaola
107
+ // shoulder sirloin flank. Ribeye sausage pig t-bone bacon frankfurter
108
+ // cupim capicola fatback pastrami ball tip pork belly. Picanha pancetta
109
+ // andouille flank shankle venison tri-tip tail, kevin turkey turducken
110
+ // chicken. Bacon picanha swine frankfurter, prosciutto chislic doner
111
+ // alcatra pork loin corned beef jowl biltong meatball chuck. Bacon
112
+ // burgdoggen pig fatback cupim t-bone. Cow pork loin bresaola brisket
113
+ // shoulder filet mignon chicken. Sirloin bresaola porchetta beef
114
+ // capicola meatloaf brisket shankle jerky turkey pork tri-tip swine
115
+ // kevin salami. Meatball t-bone doner venison. Pig tri-tip chuck, shank
116
+ // chicken pork chop landjaeger spare ribs jerky swine ham hock buffalo
117
+ // sirloin. Leberkas pancetta tenderloin, meatloaf buffalo rump pastrami
118
+ // chuck. Jerky cupim porchetta, tenderloin chuck andouille venison pork
119
+ // salami. Chuck strip steak cupim, turducken ham hock kielbasa shoulder
120
+ // porchetta chislic short loin tri-tip biltong cow corned beef.
121
+ // </p>
122
+ // </section>
123
+ // `;
124
+ // }
125
+ // addMenuShortcut(menuId: keyof menuProvidersInt) {
126
+ // if (this.menuShortcuts.find(m => m.id === menuId)) {
127
+ // return;
128
+ // }
129
+ // const shortcut = this.menuProviders[menuId];
130
+ // this.menuShortcuts.push(shortcut);
131
+ // this.sortMenuShortcuts();
132
+ // this.emitMenuShortcutsUpdated();
133
+ // }
134
+ // /**
135
+ // * Removes a provider object from the menuShortcuts array and emits a
136
+ // * menuShortcutsUpdated event.
137
+ // */
138
+ // removeMenuShortcut(menuId: string) {
139
+ // this.menuShortcuts = this.menuShortcuts.filter(m => m.id !== menuId);
140
+ // this.emitMenuShortcutsUpdated();
141
+ // }
142
+ // /**
143
+ // * Sorts the menuShortcuts property by comparing each provider's id to
144
+ // * the id in each iteration over the shortcutOrder array.
145
+ // */
146
+ // sortMenuShortcuts() {
147
+ // this.menuShortcuts = this.shortcutOrder.reduce(
148
+ // (shortcuts: IntMenuShortcut[], id) => {
149
+ // const menu = this.menuShortcuts.find(m => m.id === id);
150
+ // // eslint-disable-next-line no-param-reassign
151
+ // if (menu) {
152
+ // const newShortcuts = [...shortcuts, menu];
153
+ // // eslint-disable-next-line no-param-reassign
154
+ // shortcuts = newShortcuts;
155
+ // }
156
+ // return shortcuts;
157
+ // },
158
+ // []
159
+ // );
160
+ // }
161
+ // emitMenuShortcutsUpdated() {
162
+ // const event = new CustomEvent('menuShortcutsUpdated', {
163
+ // detail: this.menuShortcuts,
164
+ // });
165
+ // this.dispatchEvent(event);
166
+ // }
167
+ // setMenu() {
168
+ // const menuProviders = {
169
+ // share: new ShareProvider({
170
+ // item: this.itemMD,
171
+ // baseHost: this.baseHost,
172
+ // subPrefix: '',
173
+ // }),
174
+ // filesByType: new FilesByTypeProvider({
175
+ // item: this.itemMD,
176
+ // baseHost: this.baseHost,
177
+ // subPrefix: '',
178
+ // }),
179
+ // visualMods: new VisualModsProvider({
180
+ // updated: (modType: string) => {
181
+ // if (modType === 'toggleFullscreen') {
182
+ // this.updateFullscreenState();
183
+ // }
184
+ // },
185
+ // item: this.itemMD,
186
+ // baseHost: this.baseHost,
187
+ // subPrefix: '',
188
+ // // maybe DOM root for class configs?
189
+ // }),
190
+ // };
191
+ // this.menuProviders = menuProviders;
192
+ // this.addMenuShortcut('visualMods');
193
+ // }
194
+ // updateFullscreenState() {
195
+ // const isFullScreen = !this.fullscreenState;
196
+ // this.fullscreenState = isFullScreen;
197
+ // const event = new CustomEvent('ViewportInFullScreen', {
198
+ // detail: { isFullScreen },
199
+ // } as IntManageFullscreenEvent);
200
+ // this.dispatchEvent(event);
201
+ // }
202
+ // updateMenuContents() {
203
+ // const { share, filesByType, visualMods } = this.menuProviders;
204
+ // const availableMenus = [filesByType, share, visualMods].filter(
205
+ // menu => !!menu
206
+ // );
207
+ // const event = new CustomEvent(ItemInspectorEvents.menuUpdated, {
208
+ // detail: availableMenus,
209
+ // });
210
+ // this.dispatchEvent(event);
211
+ // }
212
+ // emitLoadingStatusUpdate(loaded: boolean) {
213
+ // const event = new CustomEvent('loadingStateUpdated', {
214
+ // detail: { loaded },
215
+ // });
216
+ // this.dispatchEvent(event);
217
+ // }
218
+ // parseItemInfo() {
219
+ // this.fileCount = this.itemMD?.files?.length || 0;
220
+ // }
221
+ // get imageUrl() {
222
+ // const { metadata = {} } = this.itemMD;
223
+ // const url = `${this.baseHost}/download/${metadata?.identifier}/__ia_thumb.jpg`;
224
+ // return url;
225
+ // }
226
+ // static get styles() {
227
+ // const main = css`
228
+ // :host {
229
+ // display: block;
230
+ // width: 100%;
231
+ // margin: 0 auto;
232
+ // position: relative;
233
+ // overflow: auto;
234
+ // background-color: black;
235
+ // color: var(--primaryTextColor, #fff);
236
+ // }
237
+ // :host,
238
+ // section {
239
+ // min-height: inherit;
240
+ // height: inherit;
241
+ // }
242
+ // section {
243
+ // margin: auto;
244
+ // width: 100%;
245
+ // text-align: center;
246
+ // }
247
+ // img {
248
+ // border: 1px solid var(--primaryTextColor, #fff);
249
+ // }
250
+ // `;
251
+ // return [main];
252
+ // }
253
+ // }
182
254
  //# sourceMappingURL=item-inspector.js.map