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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +29 -19
  2. package/demo/app-root.ts +37 -31
  3. package/demo/index.html +1 -0
  4. package/dist/demo/app-root.d.ts +11 -15
  5. package/dist/demo/app-root.js +26 -26
  6. package/dist/demo/app-root.js.map +1 -1
  7. package/dist/src/interfaces/custom-theater-interface.d.ts +20 -0
  8. package/dist/src/interfaces/custom-theater-interface.js +2 -0
  9. package/dist/src/interfaces/custom-theater-interface.js.map +1 -0
  10. package/dist/src/interfaces/event-interfaces.d.ts +11 -11
  11. package/dist/src/interfaces/event-interfaces.js.map +1 -1
  12. package/dist/src/interfaces/menu-interfaces.d.ts +6 -7
  13. package/dist/src/interfaces/menu-interfaces.js.map +1 -1
  14. package/dist/src/interfaces/nav-controller-interface.d.ts +11 -6
  15. package/dist/src/interfaces/nav-controller-interface.js.map +1 -1
  16. package/dist/src/item-inspector/item-inspector.d.ts +0 -47
  17. package/dist/src/item-inspector/item-inspector.js +253 -271
  18. package/dist/src/item-inspector/item-inspector.js.map +1 -1
  19. package/dist/src/item-navigator.d.ts +41 -27
  20. package/dist/src/item-navigator.js +87 -84
  21. package/dist/src/item-navigator.js.map +1 -1
  22. package/dist/src/no-theater-available.d.ts +9 -0
  23. package/dist/src/no-theater-available.js +79 -0
  24. package/dist/src/no-theater-available.js.map +1 -0
  25. package/dist/test/book-nav-stub.d.ts +22 -0
  26. package/dist/test/book-nav-stub.js +49 -0
  27. package/dist/test/book-nav-stub.js.map +1 -0
  28. package/dist/test/ia-item-navigator.test.d.ts +1 -0
  29. package/dist/test/ia-item-navigator.test.js +279 -131
  30. package/dist/test/ia-item-navigator.test.js.map +1 -1
  31. package/dist/test/ia-stub.d.ts +22 -0
  32. package/dist/test/ia-stub.js +34 -3
  33. package/dist/test/ia-stub.js.map +1 -1
  34. package/dist/test/no-theater-available.test.d.ts +1 -0
  35. package/dist/test/no-theater-available.test.js +27 -0
  36. package/dist/test/no-theater-available.test.js.map +1 -0
  37. package/package.json +4 -3
  38. package/src/interfaces/custom-theater-interface.ts +28 -0
  39. package/src/interfaces/event-interfaces.ts +15 -11
  40. package/src/interfaces/menu-interfaces.ts +9 -10
  41. package/src/item-navigator.ts +124 -114
  42. package/src/no-theater-available.ts +85 -0
  43. package/test/book-nav-stub.ts +47 -0
  44. package/test/ia-item-navigator.test.ts +365 -156
  45. package/test/ia-stub.ts +78 -2
  46. package/test/no-theater-available.test.ts +32 -0
  47. package/demo/demo-book-manifest.json +0 -1163
  48. package/src/interfaces/nav-controller-interface.ts +0 -18
  49. package/src/item-inspector/files-by-type/files-by-type-provider.ts +0 -43
  50. package/src/item-inspector/files-by-type/ia-files-by-type.ts +0 -100
  51. package/src/item-inspector/item-inspector.ts +0 -296
  52. package/src/item-inspector/share-provider.ts +0 -51
  53. package/src/item-inspector/visual-mod-provider.ts +0 -65
  54. package/src/item-navigator-js.js +0 -372
@@ -0,0 +1,85 @@
1
+ import {
2
+ LitElement,
3
+ customElement,
4
+ property,
5
+ html,
6
+ TemplateResult,
7
+ PropertyValues,
8
+ CSSResult,
9
+ css,
10
+ } from 'lit-element';
11
+
12
+ @customElement('ia-no-theater-available')
13
+ export class IANoTheaterAvailable extends LitElement {
14
+ @property({ type: String }) identifier?: string = '';
15
+
16
+ emitLoaded(): void {
17
+ this.dispatchEvent(
18
+ new CustomEvent<{ loaded: boolean }>('loadingStateUpdated', {
19
+ detail: { loaded: true },
20
+ })
21
+ );
22
+ }
23
+
24
+ updated(changed: PropertyValues): void {
25
+ if (changed.has('identifier')) {
26
+ this.emitLoaded();
27
+ }
28
+ }
29
+
30
+ get downloadUrl(): string {
31
+ return `/download/${this.identifier}`;
32
+ }
33
+
34
+ render(): TemplateResult {
35
+ return html`
36
+ <section>
37
+ <h2>THERE IS NO PREVIEW AVAILABLE FOR THIS ITEM</h2>
38
+ <p>
39
+ This item does not appear to have any files that can be experienced on
40
+ Archive.org. <br />
41
+ Please download files in this item to interact with them on your
42
+ computer.
43
+ </p>
44
+ <a href=${this.downloadUrl}>Show all files</a>
45
+ </section>
46
+ `;
47
+ }
48
+
49
+ static get styles(): CSSResult {
50
+ return css`
51
+ :host {
52
+ color: var(--primaryTextColor, #fff);
53
+ text-align: center;
54
+ }
55
+ section {
56
+ margin: 10% auto 0;
57
+ padding: 0 5%;
58
+ }
59
+ p {
60
+ font-size: 1.4rem;
61
+ }
62
+ a {
63
+ color: var(--primaryTextColor, #fff);
64
+ background-color: rgb(25, 72, 128);
65
+ min-height: 35px;
66
+ outline: none;
67
+ cursor: pointer;
68
+ line-height: normal;
69
+ border-radius: 0.4rem;
70
+ text-align: center;
71
+ vertical-align: middle;
72
+ font-size: 1.4rem;
73
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
74
+ display: inline-block;
75
+ padding: 0.85rem 1.2rem;
76
+ border: 1px solid rgb(197, 209, 223);
77
+ white-space: nowrap;
78
+ appearance: auto;
79
+ box-sizing: border-box;
80
+ user-select: none;
81
+ text-decoration: none;
82
+ }
83
+ `;
84
+ }
85
+ }
@@ -0,0 +1,47 @@
1
+ import { ModalManager } from '@internetarchive/modal-manager';
2
+ import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
3
+ import { html, customElement, LitElement, property } from 'lit-element';
4
+ import { MetadataResponse } from '@internetarchive/search-service';
5
+ import {
6
+ MenuProviderInterface,
7
+ MenuShortcutInterface,
8
+ } from '../src/interfaces/menu-interfaces';
9
+ import { CustomTheaterInterface } from '../src/interfaces/custom-theater-interface';
10
+ @customElement('book-navigator')
11
+ export class BookNavigator
12
+ extends LitElement
13
+ implements CustomTheaterInterface {
14
+ @property({ attribute: false }) modal?: ModalManager;
15
+
16
+ @property({ type: Object }) itemMD?: MetadataResponse;
17
+
18
+ @property({ type: String }) baseHost?: string;
19
+
20
+ @property({ type: Boolean, reflect: true }) signedIn?: boolean | null = null;
21
+
22
+ @property({ type: Boolean }) sideMenuOpen!: boolean;
23
+
24
+ @property({ attribute: false }) sharedObserver?: SharedResizeObserver;
25
+
26
+ @property({ type: Array }) menuProviders?: MenuProviderInterface[];
27
+
28
+ @property({ type: Array }) menuShortcuts?: MenuShortcutInterface[];
29
+
30
+ emitLoadingStatusUpdate() {}
31
+
32
+ addMenuShortcut(menuId: string) {
33
+ return menuId;
34
+ }
35
+
36
+ removeMenuShortcut(menuId: string) {
37
+ return menuId;
38
+ }
39
+
40
+ sortMenuShortcuts() {}
41
+
42
+ emitMenuShortcutsUpdated() {}
43
+
44
+ render() {
45
+ return html` <p>foo</p> `;
46
+ }
47
+ }