@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,55 +1,48 @@
1
- import { TemplateResult } from 'lit-html';
2
- import { ModalConfig } from '@internetarchive/modal-manager';
3
- import { IntMenuProvider, IntMenuShortcut } from './menu-interfaces';
1
+ import {
2
+ MenuProviderInterface,
3
+ MenuShortcutInterface,
4
+ MenuId,
5
+ } from './menu-interfaces';
4
6
 
5
7
  /** Toggles Menu && Sets open panel */
6
- export interface IntManageSideMenuEvent extends CustomEvent {
8
+ export interface ToggleSideMenuOpenEvent extends CustomEvent {
7
9
  type: 'updateSideMenu';
8
10
  detail: {
9
- menuId: string | undefined | '';
11
+ menuId: MenuId | undefined | '';
10
12
  action: 'open' | 'toggle' | '';
11
13
  };
12
14
  }
13
15
 
14
16
  /** Sets open panel */
15
- export interface IntSetOpenMenuEvent extends CustomEvent {
17
+ export interface ToggleSidePanelOpenEvent extends CustomEvent {
16
18
  type: 'menuTypeSelected';
17
19
  detail: {
18
- id: string /** name of menu to open */;
20
+ id: MenuId | '';
19
21
  };
20
22
  }
21
23
 
22
24
  /** Sets menu order that is displayed */
23
- export interface IntSetMenuContentsEvent extends CustomEvent {
25
+ export interface SetSideMenuContentsEvent extends CustomEvent {
24
26
  type: 'menuUpdated';
25
- detail: IntMenuProvider[];
27
+ detail: MenuProviderInterface[];
26
28
  }
27
29
 
28
- /** list of shortcut configs that displays in minimized menu */
29
- export interface IntSetMenuShortcuts extends CustomEvent {
30
- type: 'menuShortcutsUpdated';
31
- detail: IntMenuShortcut[];
30
+ /** Sets menu shortcuts that is displayed */
31
+ export interface SetSideMenuShortcutsEvent extends CustomEvent {
32
+ type: 'menuUpdated';
33
+ detail: MenuShortcutInterface[];
32
34
  }
33
35
 
34
36
  /** Toggles fullscreen mode */
35
- export interface IntManageFullscreenEvent extends CustomEvent {
37
+ export interface ManageFullscreenEvent extends CustomEvent {
36
38
  type: 'ViewportInFullScreen';
37
39
  detail: {
38
40
  isFullScreen: boolean;
39
41
  };
40
42
  }
41
43
 
42
- /** Toggles modal & sets contents */
43
- export interface IntOpenModalEvent extends CustomEvent {
44
- type: 'showItemNavigatorModal';
45
- detail: {
46
- config: ModalConfig;
47
- customModalContent: TemplateResult;
48
- };
49
- }
50
-
51
44
  /** Toggles loading view */
52
- export interface IntLoadingStateUpdatedEvent extends CustomEvent {
45
+ export interface loadingStateUpdatedEvent extends CustomEvent {
53
46
  type: 'loadingStateUpdated';
54
47
  detail: {
55
48
  loaded: boolean;
@@ -1,14 +1,13 @@
1
1
  import { TemplateResult } from 'lit-html';
2
2
  import { MetadataResponse } from '@internetarchive/search-service';
3
3
 
4
- export interface IntMenuShortcut {
4
+ export type MenuId = string;
5
+ export interface MenuShortcutInterface {
5
6
  icon: TemplateResult;
6
- id: string;
7
+ id: MenuId;
7
8
  }
8
9
 
9
- export interface IntMenuIconAndDetails extends IntMenuShortcut {
10
- icon: TemplateResult;
11
- id: string;
10
+ export interface MenuDetailsInterface extends MenuShortcutInterface {
12
11
  label: string;
13
12
  menuDetails?: TemplateResult;
14
13
  selected?: boolean;
@@ -16,11 +15,13 @@ export interface IntMenuIconAndDetails extends IntMenuShortcut {
16
15
  href?: string;
17
16
  }
18
17
 
19
- export interface IntProviderArgs {
18
+ export interface MenuProviderBaseConfigInterface {
20
19
  item: MetadataResponse;
21
20
  baseHost: string;
22
21
  subPrefix: string;
22
+ updated?: any;
23
23
  }
24
- export interface IntMenuProvider
25
- extends IntProviderArgs,
26
- IntMenuIconAndDetails {}
24
+ export interface MenuProviderInterface
25
+ extends MenuProviderBaseConfigInterface,
26
+ MenuDetailsInterface,
27
+ MenuShortcutInterface {}