@internetarchive/ia-item-navigator 1.0.3 → 1.0.4-a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/item-navigator.d.ts +1 -1
  5. package/dist/src/item-navigator.js +1 -1
  6. package/dist/src/item-navigator.js.map +1 -1
  7. package/dist/src/menu-slider/ia-menu-slider.d.ts +30 -0
  8. package/dist/src/menu-slider/ia-menu-slider.js +160 -0
  9. package/dist/src/menu-slider/ia-menu-slider.js.map +1 -0
  10. package/dist/src/menu-slider/menu-button.d.ts +19 -0
  11. package/dist/src/menu-slider/menu-button.js +91 -0
  12. package/dist/src/menu-slider/menu-button.js.map +1 -0
  13. package/dist/src/menu-slider/styles/menu-button.d.ts +2 -0
  14. package/dist/src/menu-slider/styles/menu-button.js +79 -0
  15. package/dist/src/menu-slider/styles/menu-button.js.map +1 -0
  16. package/dist/src/menu-slider/styles/menu-slider.d.ts +2 -0
  17. package/dist/src/menu-slider/styles/menu-slider.js +129 -0
  18. package/dist/src/menu-slider/styles/menu-slider.js.map +1 -0
  19. package/index.ts +2 -0
  20. package/package.json +3 -3
  21. package/src/item-navigator.ts +2 -2
  22. package/src/menu-slider/ia-menu-slider.ts +161 -0
  23. package/src/menu-slider/menu-button.ts +80 -0
  24. package/src/menu-slider/styles/menu-button.ts +79 -0
  25. package/src/menu-slider/styles/menu-slider.ts +130 -0
  26. package/test/ia-menu-slider.test.js +273 -0
  27. package/dist/src/event-interfaces.d.ts +0 -37
  28. package/dist/src/event-interfaces.js +0 -2
  29. package/dist/src/event-interfaces.js.map +0 -1
  30. package/dist/src/grouped-files-provider.d.ts +0 -0
  31. package/dist/src/grouped-files-provider.js +0 -2
  32. package/dist/src/grouped-files-provider.js.map +0 -1
  33. package/dist/src/interfaces/nav-controller-interface.d.ts +0 -20
  34. package/dist/src/interfaces/nav-controller-interface.js +0 -2
  35. package/dist/src/interfaces/nav-controller-interface.js.map +0 -1
  36. package/dist/src/item-inspector/files-by-type/files-by-type-provider.d.ts +0 -14
  37. package/dist/src/item-inspector/files-by-type/files-by-type-provider.js +0 -29
  38. package/dist/src/item-inspector/files-by-type/files-by-type-provider.js.map +0 -1
  39. package/dist/src/item-inspector/files-by-type/ia-files-by-type.d.ts +0 -16
  40. package/dist/src/item-inspector/files-by-type/ia-files-by-type.js +0 -95
  41. package/dist/src/item-inspector/files-by-type/ia-files-by-type.js.map +0 -1
  42. package/dist/src/item-inspector/files-by-type/ia-grouped-files-by-type.d.ts +0 -0
  43. package/dist/src/item-inspector/files-by-type/ia-grouped-files-by-type.js +0 -2
  44. package/dist/src/item-inspector/files-by-type/ia-grouped-files-by-type.js.map +0 -1
  45. package/dist/src/item-inspector/grouped-files/files-by-type-provider.d.ts +0 -15
  46. package/dist/src/item-inspector/grouped-files/files-by-type-provider.js +0 -33
  47. package/dist/src/item-inspector/grouped-files/files-by-type-provider.js.map +0 -1
  48. package/dist/src/item-inspector/grouped-files/grouped-files-provider.d.ts +0 -15
  49. package/dist/src/item-inspector/grouped-files/grouped-files-provider.js +0 -33
  50. package/dist/src/item-inspector/grouped-files/grouped-files-provider.js.map +0 -1
  51. package/dist/src/item-inspector/grouped-files/ia-grouped-files-by-type.d.ts +0 -0
  52. package/dist/src/item-inspector/grouped-files/ia-grouped-files-by-type.js +0 -2
  53. package/dist/src/item-inspector/grouped-files/ia-grouped-files-by-type.js.map +0 -1
  54. package/dist/src/item-inspector/grouped-files/ia-grouped-files.d.ts +0 -0
  55. package/dist/src/item-inspector/grouped-files/ia-grouped-files.js +0 -2
  56. package/dist/src/item-inspector/grouped-files/ia-grouped-files.js.map +0 -1
  57. package/dist/src/item-inspector/grouped-files-provider.d.ts +0 -15
  58. package/dist/src/item-inspector/grouped-files-provider.js +0 -33
  59. package/dist/src/item-inspector/grouped-files-provider.js.map +0 -1
  60. package/dist/src/item-inspector/item-inspector.d.ts +0 -0
  61. package/dist/src/item-inspector/item-inspector.js +0 -254
  62. package/dist/src/item-inspector/item-inspector.js.map +0 -1
  63. package/dist/src/item-inspector/share-provider.d.ts +0 -15
  64. package/dist/src/item-inspector/share-provider.js +0 -35
  65. package/dist/src/item-inspector/share-provider.js.map +0 -1
  66. package/dist/src/item-inspector/visual-mod-provider.d.ts +0 -19
  67. package/dist/src/item-inspector/visual-mod-provider.js +0 -46
  68. package/dist/src/item-inspector/visual-mod-provider.js.map +0 -1
  69. package/dist/src/item-inspector.d.ts +0 -24
  70. package/dist/src/item-inspector.js +0 -92
  71. package/dist/src/item-inspector.js.map +0 -1
  72. package/dist/src/menu-interfaces.d.ts +0 -16
  73. package/dist/src/menu-interfaces.js +0 -2
  74. package/dist/src/menu-interfaces.js.map +0 -1
  75. package/dist/src/nav-controller-interface.d.ts +0 -9
  76. package/dist/src/nav-controller-interface.js +0 -2
  77. package/dist/src/nav-controller-interface.js.map +0 -1
  78. package/dist/src/your-webcomponent.d.ts +0 -8
  79. package/dist/src/your-webcomponent.js +0 -37
  80. package/dist/src/your-webcomponent.js.map +0 -1
  81. package/dist/test/book-nav-stub.d.ts +0 -22
  82. package/dist/test/book-nav-stub.js +0 -49
  83. package/dist/test/book-nav-stub.js.map +0 -1
  84. package/dist/test/ia-stub-goody.d.ts +0 -210
  85. package/dist/test/ia-stub-goody.js +0 -276
  86. package/dist/test/ia-stub-goody.js.map +0 -1
  87. package/dist/test/your-webcomponent.test.d.ts +0 -0
  88. package/dist/test/your-webcomponent.test.js +0 -33
  89. package/dist/test/your-webcomponent.test.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"grouped-files-provider.js","sourceRoot":"","sources":["../../../../src/item-inspector/grouped-files/grouped-files-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,wCAAwC,CAAC;AAGhD,MAAM,OAAO,oBAAoB;IAiB/B,YAAY,SAA0B;QAhBtC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA,6FAA6F,CAAC;QAEzH,OAAE,GAAW,OAAO,CAAC;QAErB,UAAK,GAAW,iBAAiB,CAAC;QAElC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAEvB,qBAAgB,GAAW,EAAE,CAAC;QAG5B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1E,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,aAAa,GACjB,SAAS,IAAI,SAAS,KAAK,UAAU;YACnC,CAAC,CAAC,GAAG,UAAU,IAAI,gBAAgB,EAAE;YACrC,CAAC,CAAC,UAAU,CAAC;QAEjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;mBACN,aAAa;;iBAEf,OAAO;qBACH,KAAK;kBACR,IAAI,CAAC,QAAQ;2BACJ,CAAC;IAC1B,CAAC;CACF","sourcesContent":["import { html, TemplateResult } from 'lit-element';\n\nimport '@internetarchive/ia-sharing-options';\nimport '@internetarchive/icon-share/icon-share';\nimport { IntMenuProvider, IntProviderArgs } from '../../interfaces/menu-interfaces';\n\nexport class GroupedFilesProvider implements IntMenuProvider {\n item: any = null;\n\n baseHost: string = 'https://archive.org';\n\n icon: TemplateResult = html`<ia-icon-share style=\"width: var(--iconWidth); height: var(--iconHeight);\"></ia-icon-share>`;\n\n id: string = 'share';\n\n label: string = 'Share this item';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n encodedSubPrefix: string = '';\n\n constructor(shareArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '' } = shareArgs;\n const { identifier = '', creator = '', title = '' } = item.metadata || {};\n const encodedSubPrefix = encodeURIComponent(subPrefix);\n const urlIdentifier =\n subPrefix && subPrefix !== identifier\n ? `${identifier}/${encodedSubPrefix}`\n : identifier;\n\n this.item = item;\n this.baseHost = baseHost;\n this.subPrefix = subPrefix;\n this.encodedSubPrefix = encodedSubPrefix;\n\n this.component = html`<ia-sharing-options\n identifier=${urlIdentifier}\n type=\"item\"\n creator=\"${creator}\"\n description=\"${title}\"\n baseHost=\"${this.baseHost}\"\n ></ia-sharing-options>`;\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=ia-grouped-files-by-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ia-grouped-files-by-type.js","sourceRoot":"","sources":["../../../../src/item-inspector/grouped-files/ia-grouped-files-by-type.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=ia-grouped-files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ia-grouped-files.js","sourceRoot":"","sources":["../../../../src/item-inspector/grouped-files/ia-grouped-files.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,15 +0,0 @@
1
- import { TemplateResult } from 'lit-element';
2
- import '@internetarchive/ia-sharing-options';
3
- import '@internetarchive/icon-share/icon-share';
4
- import { IntMenuProvider, IntProviderArgs } from '../interfaces/menu-interfaces';
5
- export declare class GroupedFilesProvider implements IntMenuProvider {
6
- item: any;
7
- baseHost: string;
8
- icon: TemplateResult;
9
- id: string;
10
- label: string;
11
- component: TemplateResult | null;
12
- subPrefix: string;
13
- encodedSubPrefix: string;
14
- constructor(shareArgs: IntProviderArgs);
15
- }
@@ -1,33 +0,0 @@
1
- import { html } from 'lit-element';
2
- import '@internetarchive/ia-sharing-options';
3
- import '@internetarchive/icon-share/icon-share';
4
- export class GroupedFilesProvider {
5
- constructor(shareArgs) {
6
- this.item = null;
7
- this.baseHost = 'https://archive.org';
8
- this.icon = html `<ia-icon-share style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-share>`;
9
- this.id = 'share';
10
- this.label = 'Share this item';
11
- this.component = null;
12
- this.subPrefix = '';
13
- this.encodedSubPrefix = '';
14
- const { item, baseHost, subPrefix = '' } = shareArgs;
15
- const { identifier = '', creator = '', title = '' } = item.metadata || {};
16
- const encodedSubPrefix = encodeURIComponent(subPrefix);
17
- const urlIdentifier = subPrefix && subPrefix !== identifier
18
- ? `${identifier}/${encodedSubPrefix}`
19
- : identifier;
20
- this.item = item;
21
- this.baseHost = baseHost;
22
- this.subPrefix = subPrefix;
23
- this.encodedSubPrefix = encodedSubPrefix;
24
- this.component = html `<ia-sharing-options
25
- identifier=${urlIdentifier}
26
- type="item"
27
- creator="${creator}"
28
- description="${title}"
29
- baseHost="${this.baseHost}"
30
- ></ia-sharing-options>`;
31
- }
32
- }
33
- //# sourceMappingURL=grouped-files-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grouped-files-provider.js","sourceRoot":"","sources":["../../../src/item-inspector/grouped-files-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,wCAAwC,CAAC;AAGhD,MAAM,OAAO,oBAAoB;IAiB/B,YAAY,SAA0B;QAhBtC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA,6FAA6F,CAAC;QAEzH,OAAE,GAAW,OAAO,CAAC;QAErB,UAAK,GAAW,iBAAiB,CAAC;QAElC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAEvB,qBAAgB,GAAW,EAAE,CAAC;QAG5B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1E,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,aAAa,GACjB,SAAS,IAAI,SAAS,KAAK,UAAU;YACnC,CAAC,CAAC,GAAG,UAAU,IAAI,gBAAgB,EAAE;YACrC,CAAC,CAAC,UAAU,CAAC;QAEjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;mBACN,aAAa;;iBAEf,OAAO;qBACH,KAAK;kBACR,IAAI,CAAC,QAAQ;2BACJ,CAAC;IAC1B,CAAC;CACF","sourcesContent":["import { html, TemplateResult } from 'lit-element';\n\nimport '@internetarchive/ia-sharing-options';\nimport '@internetarchive/icon-share/icon-share';\nimport { IntMenuProvider, IntProviderArgs } from '../interfaces/menu-interfaces';\n\nexport class GroupedFilesProvider implements IntMenuProvider {\n item: any = null;\n\n baseHost: string = 'https://archive.org';\n\n icon: TemplateResult = html`<ia-icon-share style=\"width: var(--iconWidth); height: var(--iconHeight);\"></ia-icon-share>`;\n\n id: string = 'share';\n\n label: string = 'Share this item';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n encodedSubPrefix: string = '';\n\n constructor(shareArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '' } = shareArgs;\n const { identifier = '', creator = '', title = '' } = item.metadata || {};\n const encodedSubPrefix = encodeURIComponent(subPrefix);\n const urlIdentifier =\n subPrefix && subPrefix !== identifier\n ? `${identifier}/${encodedSubPrefix}`\n : identifier;\n\n this.item = item;\n this.baseHost = baseHost;\n this.subPrefix = subPrefix;\n this.encodedSubPrefix = encodedSubPrefix;\n\n this.component = html`<ia-sharing-options\n identifier=${urlIdentifier}\n type=\"item\"\n creator=\"${creator}\"\n description=\"${title}\"\n baseHost=\"${this.baseHost}\"\n ></ia-sharing-options>`;\n }\n}\n"]}
File without changes
@@ -1,254 +0,0 @@
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
- // }
254
- //# sourceMappingURL=item-inspector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item-inspector.js","sourceRoot":"","sources":["../../../src/item-inspector/item-inspector.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,WAAW;AACX,SAAS;AACT,UAAU;AACV,gBAAgB;AAChB,mBAAmB;AACnB,cAAc;AACd,WAAW;AACX,wBAAwB;AACxB,sEAAsE;AAEtE,WAAW;AACX,2BAA2B;AAC3B,iBAAiB;AACjB,2CAA2C;AAC3C,2FAA2F;AAC3F,6EAA6E;AAC7E,WAAW;AACX,qBAAqB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A0C;AAC1C,MAAM;AAEN,8BAA8B;AAC9B,kDAAkD;AAClD,2CAA2C;AAE3C,8DAA8D;AAC9D,kCAAkC;AAClC,sCAAsC;AACtC,iCAAiC;AACjC,MAAM;AAEN,2BAA2B;AAC3B,qEAAqE;AACrE,sEAAsE;AACtE,uBAAuB;AACvB,SAAS;AAET,uEAAuE;AACvE,gCAAgC;AAChC,UAAU;AAEV,iCAAiC;AACjC,MAAM;AAEN,+CAA+C;AAC/C,6DAA6D;AAC7D,4BAA4B;AAC5B,UAAU;AACV,iCAAiC;AACjC,MAAM;AAEN,sBAAsB;AACtB,wDAAwD;AACxD,MAAM;AAEN,qBAAqB;AACrB,6CAA6C;AAC7C,sFAAsF;AACtF,kBAAkB;AAClB,MAAM;AAEN,0BAA0B;AAC1B,wBAAwB;AACxB,gBAAgB;AAChB,0BAA0B;AAC1B,uBAAuB;AACvB,0BAA0B;AAC1B,8BAA8B;AAC9B,0BAA0B;AAC1B,mCAAmC;AACnC,gDAAgD;AAChD,UAAU;AAEV,eAAe;AACf,kBAAkB;AAClB,+BAA+B;AAC/B,2BAA2B;AAC3B,UAAU;AAEV,kBAAkB;AAClB,wBAAwB;AACxB,uBAAuB;AACvB,8BAA8B;AAC9B,UAAU;AAEV,cAAc;AACd,2DAA2D;AAC3D,UAAU;AACV,SAAS;AACT,qBAAqB;AACrB,MAAM;AACN,IAAI","sourcesContent":["// /* eslint-disable no-console */\n// import {\n// css,\n// html,\n// LitElement,\n// customElement,\n// property,\n// state,\n// } from 'lit-element';\n// import { MetadataResponse } from '@internetarchive/search-service';\n\n// import {\n// ModalManagerInterface,\n// ModalConfig,\n// } from '@internetarchive/modal-manager';\n// import { SharedResizeObserverInterface } from '@internetarchive/shared-resize-observer';\n// import { IntNavController } from '../interfaces/nav-controller-interface';\n// import {\n// IntMenuProvider,\n// IntMenuShortcut,\n// } from '../interfaces/menu-interfaces';\n// import { IntManageFullscreenEvent } from '../interfaces/event-interfaces';\n\n// import { ShareProvider } from './share-provider';\n// import { FilesByTypeProvider } from './files-by-type/files-by-type-provider';\n// import { VisualModsProvider } from './visual-mod-provider';\n\n// // eslint-disable-next-line no-shadow\n// enum ItemInspectorEvents {\n// menuUpdated = 'menuUpdated',\n// updateSideMenu = 'updateSideMenu',\n// PostInit = 'PostInit',\n// ViewportInFullScreen = 'ViewportInFullScreen',\n// }\n\n// interface menuProvidersInt {\n// [menuId: string]: IntMenuProvider;\n// }\n\n// @customElement('ia-item-inspector')\n// export class IaItemInspector extends LitElement implements IntNavController {\n// @property({ type: Object }) itemMD: MetadataResponse = {\n// metadata: {},\n// } as MetadataResponse;\n\n// @property({ type: String }) baseHost = 'https://archive.org';\n\n// @property({ type: Object }) menuProviders: menuProvidersInt = {};\n\n// @property({ type: Array }) menuShortcuts: IntMenuShortcut[] = [];\n\n// @property({ type: Boolean }) sideMenuOpen = false;\n\n// @property({ type: Boolean }) fullscreenState = false;\n\n// @property({ attribute: false }) modal!: ModalManagerInterface;\n\n// @property({ attribute: false }) sharedRO!: SharedResizeObserverInterface;\n\n// @state() fileCount: number = 0;\n\n// @state() loaded: boolean = false;\n\n// @state() private shortcutOrder = ['visualMods'];\n\n// firstUpdated() {\n// this.loaded = true;\n// console.log('modal', this.modal);\n// }\n\n// updated(changed: any) {\n// if (changed.has('loaded')) {\n// setTimeout(() => this.emitLoadingStatusUpdate(this.loaded), 1000);\n// }\n\n// if (changed.has('itemMD') && this.itemMD) {\n// this.parseItemInfo();\n// this.setMenu();\n// }\n\n// if (changed.has('menuProviders') || changed.has('menuShortcuts')) {\n// this.updateMenuContents();\n// }\n// }\n\n// modalClosedCallback() {\n// console.log('item-inspector, modal closed');\n// }\n\n// openModal() {\n// const config = new ModalConfig();\n// const customModalContent = html`\n// Can contain any markup, including web components. Event listeners also\n// work. Try clicking on the picture.\n// <div style=\"text-align: center\">\n// <a href=\"https://fillmurray.com\" style=\"display: block\">Fill Murray</a>\n// <img src=\"100x100.jpg\" alt=\"foo\" />\n// </div>\n// `;\n\n// this.modal.showModal({\n// config,\n// customModalContent,\n// userClosedModalCallback: this.modalClosedCallback,\n// });\n// }\n\n// render() {\n// const { identifier = '' } = this.itemMD?.metadata;\n// return html`\n// <section>\n// <div>\n// <h2>${identifier}</h2>\n// </div>\n// <img src=${this.imageUrl} alt=${`${identifier} thumbnail`} />\n// <button @click=${() => this.openModal()}>open modal</button>\n// <p style=\"font-size: 20px;\">\n// Bacon ipsum dolor amet flank chicken leberkas sausage, meatball pork\n// belly jowl. Chislic bacon salami frankfurter shankle drumstick\n// andouille ball tip alcatra. Fatback beef ribs chicken, jerky ground\n// round hamburger pork chop biltong. Shoulder short loin rump jerky\n// kielbasa pork porchetta fatback ribeye pork belly sirloin chislic\n// turducken corned beef tri-tip. Chuck pancetta meatball tail, spare\n// ribs ham hock capicola pig. Ham hock hamburger chicken tri-tip venison\n// swine burgdoggen boudin meatloaf pastrami chuck. Tri-tip spare ribs\n// drumstick, tail rump hamburger burgdoggen swine t-bone tongue\n// andouille chislic alcatra. Pork loin jowl frankfurter, doner meatball\n// short loin ham hock filet mignon hamburger rump turkey bresaola\n// shoulder sirloin flank. Ribeye sausage pig t-bone bacon frankfurter\n// cupim capicola fatback pastrami ball tip pork belly. Picanha pancetta\n// andouille flank shankle venison tri-tip tail, kevin turkey turducken\n// chicken. Bacon picanha swine frankfurter, prosciutto chislic doner\n// alcatra pork loin corned beef jowl biltong meatball chuck. Bacon\n// burgdoggen pig fatback cupim t-bone. Cow pork loin bresaola brisket\n// shoulder filet mignon chicken. Sirloin bresaola porchetta beef\n// capicola meatloaf brisket shankle jerky turkey pork tri-tip swine\n// kevin salami. Meatball t-bone doner venison. Pig tri-tip chuck, shank\n// chicken pork chop landjaeger spare ribs jerky swine ham hock buffalo\n// sirloin. Leberkas pancetta tenderloin, meatloaf buffalo rump pastrami\n// chuck. Jerky cupim porchetta, tenderloin chuck andouille venison pork\n// salami. Chuck strip steak cupim, turducken ham hock kielbasa shoulder\n// porchetta chislic short loin tri-tip biltong cow corned beef.\n// </p>\n// </section>\n// `;\n// }\n\n// addMenuShortcut(menuId: keyof menuProvidersInt) {\n// if (this.menuShortcuts.find(m => m.id === menuId)) {\n// return;\n// }\n\n// const shortcut = this.menuProviders[menuId];\n// this.menuShortcuts.push(shortcut);\n// this.sortMenuShortcuts();\n// this.emitMenuShortcutsUpdated();\n// }\n\n// /**\n// * Removes a provider object from the menuShortcuts array and emits a\n// * menuShortcutsUpdated event.\n// */\n// removeMenuShortcut(menuId: string) {\n// this.menuShortcuts = this.menuShortcuts.filter(m => m.id !== menuId);\n// this.emitMenuShortcutsUpdated();\n// }\n\n// /**\n// * Sorts the menuShortcuts property by comparing each provider's id to\n// * the id in each iteration over the shortcutOrder array.\n// */\n// sortMenuShortcuts() {\n// this.menuShortcuts = this.shortcutOrder.reduce(\n// (shortcuts: IntMenuShortcut[], id) => {\n// const menu = this.menuShortcuts.find(m => m.id === id);\n\n// // eslint-disable-next-line no-param-reassign\n// if (menu) {\n// const newShortcuts = [...shortcuts, menu];\n// // eslint-disable-next-line no-param-reassign\n// shortcuts = newShortcuts;\n// }\n// return shortcuts;\n// },\n// []\n// );\n// }\n\n// emitMenuShortcutsUpdated() {\n// const event = new CustomEvent('menuShortcutsUpdated', {\n// detail: this.menuShortcuts,\n// });\n// this.dispatchEvent(event);\n// }\n\n// setMenu() {\n// const menuProviders = {\n// share: new ShareProvider({\n// item: this.itemMD,\n// baseHost: this.baseHost,\n// subPrefix: '',\n// }),\n// filesByType: new FilesByTypeProvider({\n// item: this.itemMD,\n// baseHost: this.baseHost,\n// subPrefix: '',\n// }),\n// visualMods: new VisualModsProvider({\n// updated: (modType: string) => {\n// if (modType === 'toggleFullscreen') {\n// this.updateFullscreenState();\n// }\n// },\n// item: this.itemMD,\n// baseHost: this.baseHost,\n// subPrefix: '',\n// // maybe DOM root for class configs?\n// }),\n// };\n\n// this.menuProviders = menuProviders;\n// this.addMenuShortcut('visualMods');\n// }\n\n// updateFullscreenState() {\n// const isFullScreen = !this.fullscreenState;\n// this.fullscreenState = isFullScreen;\n\n// const event = new CustomEvent('ViewportInFullScreen', {\n// detail: { isFullScreen },\n// } as IntManageFullscreenEvent);\n// this.dispatchEvent(event);\n// }\n\n// updateMenuContents() {\n// const { share, filesByType, visualMods } = this.menuProviders;\n// const availableMenus = [filesByType, share, visualMods].filter(\n// menu => !!menu\n// );\n\n// const event = new CustomEvent(ItemInspectorEvents.menuUpdated, {\n// detail: availableMenus,\n// });\n\n// this.dispatchEvent(event);\n// }\n\n// emitLoadingStatusUpdate(loaded: boolean) {\n// const event = new CustomEvent('loadingStateUpdated', {\n// detail: { loaded },\n// });\n// this.dispatchEvent(event);\n// }\n\n// parseItemInfo() {\n// this.fileCount = this.itemMD?.files?.length || 0;\n// }\n\n// get imageUrl() {\n// const { metadata = {} } = this.itemMD;\n// const url = `${this.baseHost}/download/${metadata?.identifier}/__ia_thumb.jpg`;\n// return url;\n// }\n\n// static get styles() {\n// const main = css`\n// :host {\n// display: block;\n// width: 100%;\n// margin: 0 auto;\n// position: relative;\n// overflow: auto;\n// background-color: black;\n// color: var(--primaryTextColor, #fff);\n// }\n\n// :host,\n// section {\n// min-height: inherit;\n// height: inherit;\n// }\n\n// section {\n// margin: auto;\n// width: 100%;\n// text-align: center;\n// }\n\n// img {\n// border: 1px solid var(--primaryTextColor, #fff);\n// }\n// `;\n// return [main];\n// }\n// }\n"]}
@@ -1,15 +0,0 @@
1
- import { TemplateResult } from 'lit-element';
2
- import '@internetarchive/ia-sharing-options';
3
- import '@internetarchive/icon-share/icon-share';
4
- import { IntMenuProvider, IntProviderArgs } from '../interfaces/menu-interfaces';
5
- export declare class ShareProvider implements IntMenuProvider {
6
- item: any;
7
- baseHost: string;
8
- icon: TemplateResult;
9
- id: string;
10
- label: string;
11
- component: TemplateResult | null;
12
- subPrefix: string;
13
- encodedSubPrefix: string;
14
- constructor(shareArgs: IntProviderArgs);
15
- }
@@ -1,35 +0,0 @@
1
- import { html } from 'lit-element';
2
- import '@internetarchive/ia-sharing-options';
3
- import '@internetarchive/icon-share/icon-share';
4
- export class ShareProvider {
5
- constructor(shareArgs) {
6
- this.item = null;
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>`;
11
- this.id = 'share';
12
- this.label = 'Share this item';
13
- this.component = null;
14
- this.subPrefix = '';
15
- this.encodedSubPrefix = '';
16
- const { item, baseHost, subPrefix = '' } = shareArgs;
17
- const { identifier = '', creator = '', title = '' } = item.metadata || {};
18
- const encodedSubPrefix = encodeURIComponent(subPrefix);
19
- const urlIdentifier = subPrefix && subPrefix !== identifier
20
- ? `${identifier}/${encodedSubPrefix}`
21
- : identifier;
22
- this.item = item;
23
- this.baseHost = baseHost;
24
- this.subPrefix = subPrefix;
25
- this.encodedSubPrefix = encodedSubPrefix;
26
- this.component = html `<ia-sharing-options
27
- identifier=${urlIdentifier}
28
- type="item"
29
- creator="${creator}"
30
- description="${title}"
31
- baseHost="${this.baseHost}"
32
- ></ia-sharing-options>`;
33
- }
34
- }
35
- //# sourceMappingURL=share-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"share-provider.js","sourceRoot":"","sources":["../../../src/item-inspector/share-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,wCAAwC,CAAC;AAMhD,MAAM,OAAO,aAAa;IAmBxB,YAAY,SAA0B;QAlBtC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA;;oBAET,CAAC;QAEnB,OAAE,GAAW,OAAO,CAAC;QAErB,UAAK,GAAW,iBAAiB,CAAC;QAElC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAEvB,qBAAgB,GAAW,EAAE,CAAC;QAG5B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1E,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,aAAa,GACjB,SAAS,IAAI,SAAS,KAAK,UAAU;YACnC,CAAC,CAAC,GAAG,UAAU,IAAI,gBAAgB,EAAE;YACrC,CAAC,CAAC,UAAU,CAAC;QAEjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;mBACN,aAAa;;iBAEf,OAAO;qBACH,KAAK;kBACR,IAAI,CAAC,QAAQ;2BACJ,CAAC;IAC1B,CAAC;CACF","sourcesContent":["import { html, TemplateResult } from 'lit-element';\n\nimport '@internetarchive/ia-sharing-options';\nimport '@internetarchive/icon-share/icon-share';\nimport {\n IntMenuProvider,\n IntProviderArgs,\n} from '../interfaces/menu-interfaces';\n\nexport class ShareProvider 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 = 'share';\n\n label: string = 'Share this item';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n encodedSubPrefix: string = '';\n\n constructor(shareArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '' } = shareArgs;\n const { identifier = '', creator = '', title = '' } = item.metadata || {};\n const encodedSubPrefix = encodeURIComponent(subPrefix);\n const urlIdentifier =\n subPrefix && subPrefix !== identifier\n ? `${identifier}/${encodedSubPrefix}`\n : identifier;\n\n this.item = item;\n this.baseHost = baseHost;\n this.subPrefix = subPrefix;\n this.encodedSubPrefix = encodedSubPrefix;\n\n this.component = html`<ia-sharing-options\n identifier=${urlIdentifier}\n type=\"item\"\n creator=\"${creator}\"\n description=\"${title}\"\n baseHost=\"${this.baseHost}\"\n ></ia-sharing-options>`;\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { TemplateResult } from 'lit-element';
2
- import '@internetarchive/ia-sharing-options';
3
- import '@internetarchive/icon-visual-adjustment/icon-visual-adjustment';
4
- import { IntMenuProvider, IntProviderArgs } from '../interfaces/menu-interfaces';
5
- export declare class VisualModsProvider implements IntMenuProvider {
6
- item: any;
7
- baseHost: string;
8
- icon: TemplateResult;
9
- id: string;
10
- label: string;
11
- component: TemplateResult | null;
12
- subPrefix: string;
13
- encodedSubPrefix: string;
14
- updated: any;
15
- constructor(providerArgs: IntProviderArgs);
16
- openModal(): void;
17
- closeModal(): void;
18
- toggleFullscreen(): void;
19
- }
@@ -1,46 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
2
- /* eslint-disable max-classes-per-file */
3
- import { __decorate } from "tslib";
4
- import { html, customElement, LitElement } from 'lit-element';
5
- import '@internetarchive/ia-sharing-options';
6
- import '@internetarchive/icon-visual-adjustment/icon-visual-adjustment';
7
- let VisualMods = class VisualMods extends LitElement {
8
- toggleFullscreen() {
9
- this.dispatchEvent(new Event('fullscreenToggle'));
10
- }
11
- render() {
12
- return html `<section>
13
- <button @click=${this.toggleFullscreen}>Toggle Fullscreen</button>
14
- </section>`;
15
- }
16
- };
17
- VisualMods = __decorate([
18
- customElement('ia-visual-mods')
19
- ], VisualMods);
20
- export class VisualModsProvider {
21
- constructor(providerArgs) {
22
- this.item = null;
23
- this.baseHost = 'https://archive.org';
24
- this.icon = html `<ia-icon-visual-adjustment
25
- style="width: var(--iconWidth); height: var(--iconHeight);"
26
- ></ia-icon-visual-adjustment>`;
27
- this.id = 'visualMods';
28
- this.label = 'Visual Modifications';
29
- this.component = null;
30
- this.subPrefix = '';
31
- this.encodedSubPrefix = '';
32
- this.updated = () => { };
33
- const { item, baseHost, subPrefix = '', updated } = providerArgs;
34
- this.updated = updated;
35
- this.component = html `<ia-visual-mods
36
- @fullscreenToggle=${() => this === null || this === void 0 ? void 0 : this.updated('toggleFullscreen')}
37
- @openModa=${this.openModal}
38
- ></ia-visual-mods>`;
39
- }
40
- openModal() { }
41
- closeModal() { }
42
- toggleFullscreen() {
43
- this.updated('toggleFullscreen');
44
- }
45
- }
46
- //# sourceMappingURL=visual-mod-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visual-mod-provider.js","sourceRoot":"","sources":["../../../src/item-inspector/visual-mod-provider.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,yCAAyC;;AAEzC,OAAO,EAAE,IAAI,EAAkB,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,gEAAgE,CAAC;AAOxE,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IACjC,gBAAgB;QACd,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;uBACQ,IAAI,CAAC,gBAAgB;eAC7B,CAAC;IACd,CAAC;CACF,CAAA;AAVK,UAAU;IADf,aAAa,CAAC,gBAAgB,CAAC;GAC1B,UAAU,CAUf;AAED,MAAM,OAAO,kBAAkB;IAqB7B,YAAY,YAA6B;QApBzC,SAAI,GAAQ,IAAI,CAAC;QAEjB,aAAQ,GAAW,qBAAqB,CAAC;QAEzC,SAAI,GAAmB,IAAI,CAAA;;gCAEG,CAAC;QAE/B,OAAE,GAAW,YAAY,CAAC;QAE1B,UAAK,GAAW,sBAAsB,CAAC;QAEvC,cAAS,GAA0B,IAAI,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAEvB,qBAAgB,GAAW,EAAE,CAAC;QAE9B,YAAO,GAAQ,GAAG,EAAE,GAAE,CAAC,CAAC;QAGtB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;QAEjE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;0BACC,GAAG,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC,kBAAkB,CAAC;kBAC/C,IAAI,CAAC,SAAS;uBACT,CAAC;IACtB,CAAC;IAED,SAAS,KAAI,CAAC;IAEd,UAAU,KAAI,CAAC;IAEf,gBAAgB;QACd,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnC,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable max-classes-per-file */\n\nimport { html, TemplateResult, customElement, LitElement } from 'lit-element';\n\nimport '@internetarchive/ia-sharing-options';\nimport '@internetarchive/icon-visual-adjustment/icon-visual-adjustment';\nimport {\n IntMenuProvider,\n IntProviderArgs,\n} from '../interfaces/menu-interfaces';\n\n@customElement('ia-visual-mods')\nclass VisualMods extends LitElement {\n toggleFullscreen() {\n this.dispatchEvent(new Event('fullscreenToggle'));\n }\n\n render() {\n return html`<section>\n <button @click=${this.toggleFullscreen}>Toggle Fullscreen</button>\n </section>`;\n }\n}\n\nexport class VisualModsProvider implements IntMenuProvider {\n item: any = null;\n\n baseHost: string = 'https://archive.org';\n\n icon: TemplateResult = html`<ia-icon-visual-adjustment\n style=\"width: var(--iconWidth); height: var(--iconHeight);\"\n ></ia-icon-visual-adjustment>`;\n\n id: string = 'visualMods';\n\n label: string = 'Visual Modifications';\n\n component: TemplateResult | null = null;\n\n subPrefix: string = '';\n\n encodedSubPrefix: string = '';\n\n updated: any = () => {};\n\n constructor(providerArgs: IntProviderArgs) {\n const { item, baseHost, subPrefix = '', updated } = providerArgs;\n\n this.updated = updated;\n\n this.component = html`<ia-visual-mods\n @fullscreenToggle=${() => this?.updated('toggleFullscreen')}\n @openModa=${this.openModal}\n ></ia-visual-mods>`;\n }\n\n openModal() {}\n\n closeModal() {}\n\n toggleFullscreen() {\n this.updated('toggleFullscreen');\n }\n}\n"]}
@@ -1,24 +0,0 @@
1
- import { LitElement } from 'lit-element';
2
- import { IntNavController } from './interfaces/nav-controller-interface';
3
- import { IntMenuShortcut } from './interfaces/menu-interfaces';
4
- export declare class IaItemInspector extends LitElement implements IntNavController {
5
- itemMD: {
6
- files: never[];
7
- metadata: {
8
- identifier: string;
9
- };
10
- };
11
- baseHost: string;
12
- menuProviders: {};
13
- menuShortcuts: IntMenuShortcut[];
14
- sideMenuOpen: boolean;
15
- fileCount: number;
16
- loaded: boolean;
17
- firstUpdated(): void;
18
- updated(changed: any): void;
19
- emitLoadingStatusUpdate(loaded: boolean): void;
20
- parseItemInfo(): void;
21
- get imageUrl(): string;
22
- render(): import("lit-element").TemplateResult;
23
- static get styles(): import("lit-element").CSSResult[];
24
- }
@@ -1,92 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { css, html, LitElement, customElement, property, state, } from 'lit-element';
3
- let IaItemInspector = class IaItemInspector extends LitElement {
4
- constructor() {
5
- super(...arguments);
6
- this.itemMD = {
7
- files: [],
8
- metadata: { identifier: '' },
9
- };
10
- this.baseHost = 'archive.org';
11
- this.menuProviders = {};
12
- this.menuShortcuts = [];
13
- this.sideMenuOpen = false;
14
- this.fileCount = 0;
15
- this.loaded = false;
16
- }
17
- firstUpdated() {
18
- this.loaded = true;
19
- console.log('firstUpdateed', this.loaded);
20
- }
21
- updated(changed) {
22
- if (changed.has('itemMD')) {
23
- this.parseItemInfo();
24
- }
25
- if (changed.has('loaded')) {
26
- this.emitLoadingStatusUpdate(this.loaded);
27
- }
28
- }
29
- emitLoadingStatusUpdate(loaded) {
30
- const event = new CustomEvent('loadingStateUpdated', { detail: { loaded } });
31
- this.dispatchEvent(event);
32
- }
33
- parseItemInfo() {
34
- var _a, _b;
35
- this.fileCount = ((_b = (_a = this.itemMD) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.length) || 0;
36
- }
37
- get imageUrl() {
38
- const { metadata } = this.itemMD;
39
- return `${this.baseHost}/services/img/${metadata === null || metadata === void 0 ? void 0 : metadata.identifier}`;
40
- }
41
- render() {
42
- return html `
43
- <section>
44
- <img src=${this.imageUrl} alt="default item" />
45
- <div>
46
- <h3>Welcome to item:</h3>
47
- <p>foo</p>
48
- </div>
49
- </section>
50
- `;
51
- }
52
- static get styles() {
53
- const main = css `
54
- :host {
55
- display: block;
56
- width: 100%;
57
- margin: 0 auto;
58
- }
59
-
60
- section {
61
- display: flex;
62
- }
63
- `;
64
- return [main];
65
- }
66
- };
67
- __decorate([
68
- property({ type: Object })
69
- ], IaItemInspector.prototype, "itemMD", void 0);
70
- __decorate([
71
- property({ type: String })
72
- ], IaItemInspector.prototype, "baseHost", void 0);
73
- __decorate([
74
- property({ type: Object })
75
- ], IaItemInspector.prototype, "menuProviders", void 0);
76
- __decorate([
77
- property({ type: Array })
78
- ], IaItemInspector.prototype, "menuShortcuts", void 0);
79
- __decorate([
80
- property({ type: Boolean })
81
- ], IaItemInspector.prototype, "sideMenuOpen", void 0);
82
- __decorate([
83
- state()
84
- ], IaItemInspector.prototype, "fileCount", void 0);
85
- __decorate([
86
- state()
87
- ], IaItemInspector.prototype, "loaded", void 0);
88
- IaItemInspector = __decorate([
89
- customElement('ia-item-inspector')
90
- ], IaItemInspector);
91
- export { IaItemInspector };
92
- //# sourceMappingURL=item-inspector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item-inspector.js","sourceRoot":"","sources":["../../src/item-inspector.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,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ACjC,OAAO,GAAG,IAAI,CAAC,QAAQ,iBAAiB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,EAAE,CAAC;IACjE,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;mBAEI,IAAI,CAAC,QAAQ;;;;;;KAM3B,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;;;;;;KAUf,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF,CAAA;AAvE6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAGzB;AAE0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA0B;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAoB;AAEpB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sDAAuC;AAEpC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDAAsB;AAEzC;IAAR,KAAK,EAAE;kDAAuB;AAEtB;IAAR,KAAK,EAAE;+CAAyB;AAhBtB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAwE3B;SAxEY,eAAe","sourcesContent":["import {\n css,\n html,\n LitElement,\n customElement,\n property,\n state,\n} from 'lit-element';\n// import { nothing, TemplateResult } from 'lit-html';\nimport { IntNavController } from './interfaces/nav-controller-interface';\nimport { IntMenuShortcut } from './interfaces/menu-interfaces';\n@customElement('ia-item-inspector')\nexport class IaItemInspector extends LitElement implements IntNavController {\n @property({ type: Object }) itemMD = {\n files: [],\n metadata: { identifier: '' },\n };\n\n @property({ type: String }) baseHost = 'archive.org';\n\n @property({ type: Object }) menuProviders = {};\n\n @property({ type: Array }) menuShortcuts: IntMenuShortcut[] = [];\n\n @property({ type: Boolean }) sideMenuOpen = false;\n\n @state() fileCount: number = 0;\n\n @state() loaded: boolean = false;\n\n firstUpdated() {\n this.loaded = true;\n console.log('firstUpdateed', this.loaded);\n }\n\n updated(changed: any) {\n if (changed.has('itemMD')) {\n this.parseItemInfo();\n }\n if (changed.has('loaded')) {\n this.emitLoadingStatusUpdate(this.loaded);\n }\n }\n\n emitLoadingStatusUpdate(loaded: boolean) {\n const event = new CustomEvent('loadingStateUpdated', { detail: { loaded }})\n this.dispatchEvent(event);\n }\n\n parseItemInfo() {\n this.fileCount = this.itemMD?.files?.length || 0;\n }\n\n get imageUrl() {\n const { metadata } = this.itemMD;\n return `${this.baseHost}/services/img/${metadata?.identifier}`;\n }\n\n render() {\n return html`\n <section>\n <img src=${this.imageUrl} alt=\"default item\" />\n <div>\n <h3>Welcome to item:</h3>\n <p>foo</p>\n </div>\n </section>\n `;\n }\n\n static get styles() {\n const main = css`\n :host {\n display: block;\n width: 100%;\n margin: 0 auto;\n }\n\n section {\n display: flex;\n }\n `;\n return [main];\n }\n}\n"]}