@internetarchive/ia-item-navigator 1.1.1 → 2.0.0-alpha2
Sign up to get free protection for your applications and to get access to all the features.
- package/demo/app-root.ts +190 -28
- package/dist/demo/app-root.d.ts +7 -3
- package/dist/demo/app-root.js +158 -22
- package/dist/demo/app-root.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/src/{item-navigator.js → iaux-item-navigator.js} +3 -10
- package/dist/src/iaux-item-navigator.js.map +1 -0
- package/dist/src/menus/iaux-sharing-options.d.ts +28 -0
- package/dist/src/menus/iaux-sharing-options.js +277 -0
- package/dist/src/menus/iaux-sharing-options.js.map +1 -0
- package/dist/src/menus/iaux-viewable-files.d.ts +32 -0
- package/dist/src/menus/iaux-viewable-files.js +367 -0
- package/dist/src/menus/iaux-viewable-files.js.map +1 -0
- package/dist/src/menus/share-providers/email.d.ts +11 -0
- package/dist/src/menus/share-providers/email.js +15 -0
- package/dist/src/menus/share-providers/email.js.map +1 -0
- package/dist/src/menus/share-providers/facebook.d.ts +11 -0
- package/dist/src/menus/share-providers/facebook.js +15 -0
- package/dist/src/menus/share-providers/facebook.js.map +1 -0
- package/dist/src/menus/share-providers/pinterest.d.ts +11 -0
- package/dist/src/menus/share-providers/pinterest.js +15 -0
- package/dist/src/menus/share-providers/pinterest.js.map +1 -0
- package/dist/src/menus/share-providers/provider.d.ts +20 -0
- package/dist/src/menus/share-providers/provider.js +37 -0
- package/dist/src/menus/share-providers/provider.js.map +1 -0
- package/dist/src/menus/share-providers/share-provider-interface.d.ts +13 -0
- package/dist/src/menus/share-providers/share-provider-interface.js +2 -0
- package/dist/src/menus/share-providers/share-provider-interface.js.map +1 -0
- package/dist/src/menus/share-providers/tumblr.d.ts +11 -0
- package/dist/src/menus/share-providers/tumblr.js +15 -0
- package/dist/src/menus/share-providers/tumblr.js.map +1 -0
- package/dist/src/menus/share-providers/twitter.d.ts +11 -0
- package/dist/src/menus/share-providers/twitter.js +15 -0
- package/dist/src/menus/share-providers/twitter.js.map +1 -0
- package/dist/test/iaux-item-navigator.test.d.ts +1 -0
- package/dist/test/{ia-item-navigator.test.js → iaux-item-navigator.test.js} +49 -27
- package/dist/test/iaux-item-navigator.test.js.map +1 -0
- package/dist/test/iaux-sharing-options.test.d.ts +1 -0
- package/dist/test/iaux-sharing-options.test.js +64 -0
- package/dist/test/iaux-sharing-options.test.js.map +1 -0
- package/index.ts +10 -1
- package/package.json +11 -4
- package/src/{item-navigator.ts → iaux-item-navigator.ts} +2 -10
- package/src/menus/foo.json +84 -0
- package/src/menus/iaux-sharing-options.ts +281 -0
- package/src/menus/iaux-viewable-files.ts +377 -0
- package/src/menus/share-providers/email.ts +23 -0
- package/src/menus/share-providers/facebook.ts +23 -0
- package/src/menus/share-providers/pinterest.ts +23 -0
- package/src/menus/share-providers/provider.ts +63 -0
- package/src/menus/share-providers/share-provider-interface.ts +17 -0
- package/src/menus/share-providers/tumblr.ts +23 -0
- package/src/menus/share-providers/twitter.ts +23 -0
- package/test/ia-sharing-options.test.js +78 -0
- package/test/{iaux-item-navigator.test.txt → iaux-item-navigator.test.ts} +46 -24
- package/dist/src/item-navigator.js.map +0 -1
- package/dist/test/ia-item-navigator.test.d.ts +0 -1
- package/dist/test/ia-item-navigator.test.js.map +0 -1
- package/test/ia-item-navigator.test.ts +0 -417
- /package/dist/src/{item-navigator.d.ts → iaux-item-navigator.d.ts} +0 -0
- /package/test/{iaux-sharing-options.test.txt → iaux-sharing-options.test.ts} +0 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
import '@internetarchive/icon-twitter/icon-twitter';
|
2
|
+
import { html } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
export default class TwitterProvider extends Provider {
|
5
|
+
constructor(params) {
|
6
|
+
super(params);
|
7
|
+
this.name = 'Twitter';
|
8
|
+
this.icon = html `<ia-icon-twitter></ia-icon-twitter>`;
|
9
|
+
this.class = 'twitter';
|
10
|
+
}
|
11
|
+
get url() {
|
12
|
+
return `https://twitter.com/intent/tweet?url=https://${this.baseHost}/details/${this.itemPath}&via=internetarchive&text=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=twitter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"twitter.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/twitter.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IAOnD,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA,qCAAqC,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,IAAa,GAAG;QACd,OAAO,gDAAgD,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,QAAQ,6BAA6B,IAAI,CAAC,kBAAkB,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACzM,CAAC;CACF","sourcesContent":["import '@internetarchive/icon-twitter/icon-twitter';\nimport { TemplateResult, html } from 'lit';\nimport Provider from './provider';\nimport { ProviderParams } from './share-provider-interface';\n\nexport default class TwitterProvider extends Provider {\n name: string;\n\n icon: TemplateResult;\n\n class: string;\n\n constructor(params: ProviderParams) {\n super(params);\n this.name = 'Twitter';\n this.icon = html`<ia-icon-twitter></ia-icon-twitter>`;\n this.class = 'twitter';\n }\n\n override get url(): string {\n return `https://twitter.com/intent/tweet?url=https://${this.baseHost}/details/${this.itemPath}&via=internetarchive&text=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '../src/iaux-item-navigator';
|
@@ -3,8 +3,8 @@ import { html, fixture, expect } from '@open-wc/testing';
|
|
3
3
|
import Sinon from 'sinon';
|
4
4
|
import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
|
5
5
|
import { ModalManager } from '@internetarchive/modal-manager';
|
6
|
-
import '../src/item-navigator';
|
7
|
-
import { ItemStub, menuProvider, shortcut } from '
|
6
|
+
import '../src/iaux-item-navigator';
|
7
|
+
import { ItemStub, menuProvider, shortcut } from './ia-stub';
|
8
8
|
afterEach(() => {
|
9
9
|
Sinon.restore();
|
10
10
|
});
|
@@ -12,7 +12,9 @@ describe('ItemNavigator', () => {
|
|
12
12
|
describe('Theaters', () => {
|
13
13
|
it('shows <ia-no-theater-available> if told', async () => {
|
14
14
|
var _a;
|
15
|
-
const el = await fixture(html `<
|
15
|
+
const el = await fixture(html `<iaux-item-navigator
|
16
|
+
.item=${new ItemStub()}
|
17
|
+
></iaux-item-navigator>`);
|
16
18
|
el.viewAvailable = false;
|
17
19
|
await el.updateComplete;
|
18
20
|
expect(el.viewAvailable).to.be.false;
|
@@ -20,7 +22,9 @@ describe('ItemNavigator', () => {
|
|
20
22
|
});
|
21
23
|
it('opens main slot by default', async () => {
|
22
24
|
var _a, _b;
|
23
|
-
const el = await fixture(html `<
|
25
|
+
const el = await fixture(html `<iaux-item-navigator
|
26
|
+
.item=${new ItemStub()}
|
27
|
+
></iaux-item-navigator>`);
|
24
28
|
expect(el.viewAvailable).to.be.true;
|
25
29
|
expect((_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('ia-no-theater-available')).to.be
|
26
30
|
.null;
|
@@ -30,18 +34,20 @@ describe('ItemNavigator', () => {
|
|
30
34
|
describe('`el.loaded`', () => {
|
31
35
|
it('toggles the spinning loader', async () => {
|
32
36
|
var _a;
|
33
|
-
const el = await fixture(html `<
|
37
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
34
38
|
expect(el.loaded).to.be.null; // initial load
|
35
39
|
expect((_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('ia-itemnav-loader')).to.exist;
|
36
40
|
});
|
37
41
|
it('hides reader section if `!loaded`', async () => {
|
38
42
|
var _a, _b;
|
39
|
-
const el = await fixture(html `<
|
43
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
40
44
|
expect((_b = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#reader')) === null || _b === void 0 ? void 0 : _b.getAttribute('class')).to.contain('hidden');
|
41
45
|
});
|
42
46
|
it('shows reader when `loaded` ', async () => {
|
43
47
|
var _a, _b;
|
44
|
-
const el = await fixture(html `<
|
48
|
+
const el = await fixture(html `<iaux-item-navigator
|
49
|
+
.item=${new ItemStub()}
|
50
|
+
></iaux-item-navigator>`);
|
45
51
|
el.loaded = true;
|
46
52
|
await el.updateComplete;
|
47
53
|
const mainTheaterSection = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#reader');
|
@@ -52,7 +58,7 @@ describe('ItemNavigator', () => {
|
|
52
58
|
expect((_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('slot[name="main"]')).to.exist;
|
53
59
|
});
|
54
60
|
it('listens to `@loadingStateUpdated` to update `loaded` for <no-theater-available>', async () => {
|
55
|
-
const el = await fixture(html `<
|
61
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
56
62
|
await el.updateComplete;
|
57
63
|
const spy = Sinon.spy();
|
58
64
|
el.loadingStateUpdated = spy;
|
@@ -70,32 +76,32 @@ describe('ItemNavigator', () => {
|
|
70
76
|
describe('`el.sharedObserver`', () => {
|
71
77
|
it('uses one', async () => {
|
72
78
|
const sharedObserver = new SharedResizeObserver();
|
73
|
-
const el = await fixture(html `<
|
79
|
+
const el = await fixture(html `<iaux-item-navigator
|
74
80
|
.sharedObserver=${sharedObserver}
|
75
|
-
></
|
81
|
+
></iaux-item-navigator>`);
|
76
82
|
expect(el.sharedObserver).to.equal(sharedObserver);
|
77
83
|
expect(typeof el.handleResize).to.equal('function');
|
78
84
|
});
|
79
85
|
it('freshly registers handlers', async () => {
|
80
86
|
const sharedObserver = new SharedResizeObserver();
|
81
87
|
const addObserverSpy = Sinon.spy(sharedObserver, 'addObserver');
|
82
|
-
await fixture(html `<
|
88
|
+
await fixture(html `<iaux-item-navigator
|
83
89
|
.sharedObserver=${sharedObserver}
|
84
|
-
></
|
90
|
+
></iaux-item-navigator>`);
|
85
91
|
expect(addObserverSpy.callCount).to.equal(2);
|
86
92
|
});
|
87
93
|
it('removes handler when component disconnects', async () => {
|
88
94
|
const sharedObserver = new SharedResizeObserver();
|
89
95
|
const removeObserverSpy = Sinon.spy(sharedObserver, 'removeObserver');
|
90
|
-
const el = await fixture(html `<
|
96
|
+
const el = await fixture(html `<iaux-item-navigator
|
91
97
|
.sharedObserver=${sharedObserver}
|
92
|
-
></
|
98
|
+
></iaux-item-navigator>`);
|
93
99
|
el.disconnectedCallback();
|
94
100
|
await el.updateComplete;
|
95
101
|
expect(removeObserverSpy.callCount).to.equal(1);
|
96
102
|
});
|
97
103
|
it('sets menu to overlay if container width is <= 600px', async () => {
|
98
|
-
const el = await fixture(html `<
|
104
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
99
105
|
expect(el.openMenuState).to.equal('shift'); // as starting point
|
100
106
|
const overlaySize = {
|
101
107
|
contentRect: { width: 600 },
|
@@ -114,21 +120,21 @@ describe('ItemNavigator', () => {
|
|
114
120
|
describe('`el.modal`', () => {
|
115
121
|
it('uses one', async () => {
|
116
122
|
const modal = new ModalManager();
|
117
|
-
const el = await fixture(html `<
|
123
|
+
const el = await fixture(html `<iaux-item-navigator .modal=${modal}></iaux-item-navigator>`);
|
118
124
|
expect(el.modal).to.equal(modal);
|
119
125
|
});
|
120
126
|
});
|
121
127
|
describe('full browser window immersion "fullscreen"', () => {
|
122
128
|
it('creates reflected attribute `viewportinfullscreen`', async () => {
|
123
129
|
/** to help with external styling adjustmnents */
|
124
|
-
const el = await fixture(html `<
|
130
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
125
131
|
expect(el.getAttribute('viewportinfullscreen')).to.be.null;
|
126
132
|
el.viewportInFullscreen = true;
|
127
133
|
await el.updateComplete;
|
128
134
|
expect(el.getAttribute('viewportinfullscreen')).to.exist;
|
129
135
|
});
|
130
136
|
it('@ViewportInFullScreen', async () => {
|
131
|
-
const el = await fixture(html `<
|
137
|
+
const el = await fixture(html `<iaux-item-navigator></iaux-item-navigator>`);
|
132
138
|
expect(el.viewportInFullscreen).to.be.null;
|
133
139
|
const yesFullscreenEvent = {
|
134
140
|
detail: {
|
@@ -152,7 +158,9 @@ describe('ItemNavigator', () => {
|
|
152
158
|
describe('el.menuOpened', () => {
|
153
159
|
it('toggles side menu open', async () => {
|
154
160
|
var _a, _b, _c;
|
155
|
-
const el = await fixture(html `<
|
161
|
+
const el = await fixture(html `<iaux-item-navigator
|
162
|
+
.item=${new ItemStub()}
|
163
|
+
></iaux-item-navigator>`);
|
156
164
|
el.menuContents = [menuProvider];
|
157
165
|
await el.updateComplete;
|
158
166
|
const nav = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('nav');
|
@@ -168,7 +176,9 @@ describe('ItemNavigator', () => {
|
|
168
176
|
});
|
169
177
|
it('opens menu shortcut with `@manageSideMenuEvents`', async () => {
|
170
178
|
var _a;
|
171
|
-
const el = await fixture(html `<
|
179
|
+
const el = await fixture(html `<iaux-item-navigator
|
180
|
+
.item=${new ItemStub()}
|
181
|
+
></iaux-item-navigator>`);
|
172
182
|
const detail = {
|
173
183
|
menuId: 'fullscreen',
|
174
184
|
action: 'open',
|
@@ -219,7 +229,9 @@ describe('ItemNavigator', () => {
|
|
219
229
|
describe('el.menuContents', () => {
|
220
230
|
it('draws side menu when populated', async () => {
|
221
231
|
var _a;
|
222
|
-
const el = await fixture(html `<
|
232
|
+
const el = await fixture(html `<iaux-item-navigator
|
233
|
+
.item=${new ItemStub()}
|
234
|
+
></iaux-item-navigator>`);
|
223
235
|
el.menuContents = [menuProvider];
|
224
236
|
await el.updateComplete;
|
225
237
|
expect(el.menuContents.length).to.exist;
|
@@ -235,7 +247,9 @@ describe('ItemNavigator', () => {
|
|
235
247
|
describe('`el.menuShortcuts`', () => {
|
236
248
|
it('displays shortcut & toggle side menu button', async () => {
|
237
249
|
var _a;
|
238
|
-
const el = await fixture(html `<
|
250
|
+
const el = await fixture(html `<iaux-item-navigator
|
251
|
+
.item=${new ItemStub()}
|
252
|
+
></iaux-item-navigator>`);
|
239
253
|
const anotherShortcut = {
|
240
254
|
id: 'foo',
|
241
255
|
icon: html `<i class="foo-shortcut"></i>`,
|
@@ -255,7 +269,9 @@ describe('ItemNavigator', () => {
|
|
255
269
|
});
|
256
270
|
describe('Menu events', () => {
|
257
271
|
it('`el.setMenuShortcuts`', async () => {
|
258
|
-
const el = await fixture(html `<
|
272
|
+
const el = await fixture(html `<iaux-item-navigator
|
273
|
+
.item=${new ItemStub()}
|
274
|
+
></iaux-item-navigator>`);
|
259
275
|
expect(el.menuShortcuts.length).to.equal(0);
|
260
276
|
const menuShortcuts = [shortcut];
|
261
277
|
el.setMenuShortcuts({
|
@@ -265,7 +281,9 @@ describe('ItemNavigator', () => {
|
|
265
281
|
expect(el.menuShortcuts.length).to.equal(1);
|
266
282
|
});
|
267
283
|
it('`el.setMenuContents`', async () => {
|
268
|
-
const el = await fixture(html `<
|
284
|
+
const el = await fixture(html `<iaux-item-navigator
|
285
|
+
.item=${new ItemStub()}
|
286
|
+
></iaux-item-navigator>`);
|
269
287
|
expect(el.menuContents.length).to.equal(0);
|
270
288
|
el.setMenuShortcuts({
|
271
289
|
detail: [menuProvider],
|
@@ -274,7 +292,9 @@ describe('ItemNavigator', () => {
|
|
274
292
|
expect(el.menuShortcuts.length).to.equal(1);
|
275
293
|
});
|
276
294
|
it('`el.setOpenMenu`', async () => {
|
277
|
-
const el = await fixture(html `<
|
295
|
+
const el = await fixture(html `<iaux-item-navigator
|
296
|
+
.item=${new ItemStub()}
|
297
|
+
></iaux-item-navigator>`);
|
278
298
|
el.setOpenMenu({
|
279
299
|
detail: { id: 'foo' },
|
280
300
|
});
|
@@ -290,7 +310,9 @@ describe('ItemNavigator', () => {
|
|
290
310
|
expect(el.selectedMenuId).to.equal('');
|
291
311
|
});
|
292
312
|
it('`el.closeMenu`', async () => {
|
293
|
-
const el = await fixture(html `<
|
313
|
+
const el = await fixture(html `<iaux-item-navigator
|
314
|
+
.item=${new ItemStub()}
|
315
|
+
></iaux-item-navigator>`);
|
294
316
|
el.menuOpened = true;
|
295
317
|
await el.updateComplete;
|
296
318
|
expect(el.menuOpened).to.be.true;
|
@@ -300,4 +322,4 @@ describe('ItemNavigator', () => {
|
|
300
322
|
});
|
301
323
|
});
|
302
324
|
});
|
303
|
-
//# sourceMappingURL=
|
325
|
+
//# sourceMappingURL=iaux-item-navigator.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iaux-item-navigator.test.js","sourceRoot":"","sources":["../../test/iaux-item-navigator.test.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAS7D,SAAS,CAAC,GAAG,EAAE;IACb,KAAK,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,UA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;YACjB,EAAE,CAAC,WAAW,CAAC;gBACb,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE;aACM,CAAC,CAAC;YAC/B,MAAM,EAAE,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;YACpC,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;YAC9B,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA;kBACM,IAAI,QAAQ,EAAE;gCACA,CACzB,CAAC;YAEF,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC;YACrB,MAAM,EAAE,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAEjC,EAAE,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,cAAc,CAAC;YAExB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable camelcase */\nimport { html, fixture, expect } from '@open-wc/testing';\nimport Sinon from 'sinon';\n\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\nimport { ModalManager } from '@internetarchive/modal-manager';\nimport { ItemNavigator } from '../src/iaux-item-navigator';\nimport '../src/iaux-item-navigator';\n\nimport { ItemStub, menuProvider, shortcut } from './ia-stub';\nimport {\n ManageFullscreenEvent,\n ToggleSideMenuOpenEvent,\n SetSideMenuContentsEvent,\n SetSideMenuShortcutsEvent,\n ToggleSidePanelOpenEvent,\n} from '../src/interfaces/event-interfaces';\n\nafterEach(() => {\n Sinon.restore();\n});\n\ndescribe('ItemNavigator', () => {\n describe('Theaters', () => {\n it('shows <ia-no-theater-available> if told', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n el.viewAvailable = false;\n await el.updateComplete;\n expect(el.viewAvailable).to.be.false;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.exist;\n });\n it('opens main slot by default', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n expect(el.viewAvailable).to.be.true;\n expect(el.shadowRoot?.querySelector('ia-no-theater-available')).to.be\n .null;\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n });\n describe('`el.loaded`', () => {\n it('toggles the spinning loader', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.loaded).to.be.null; // initial load\n expect(el.shadowRoot?.querySelector('ia-itemnav-loader')).to.exist;\n });\n it('hides reader section if `!loaded`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(\n el.shadowRoot?.querySelector('#reader')?.getAttribute('class'),\n ).to.contain('hidden');\n });\n it('shows reader when `loaded` ', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.loaded = true;\n await el.updateComplete;\n const mainTheaterSection = el.shadowRoot?.querySelector('#reader');\n expect(mainTheaterSection?.classList.contains('hide')).to.be.false;\n expect(el.loaded).to.be.true;\n // `loaded` property is reflected as DOM attribute\n expect(el.hasAttribute('loaded')).to.equal(true);\n expect(el.shadowRoot?.querySelector('slot[name=\"main\"]')).to.exist;\n });\n it('listens to `@loadingStateUpdated` to update `loaded` for <no-theater-available>', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n await el.updateComplete;\n const spy = Sinon.spy();\n el.loadingStateUpdated = spy;\n el.loaded = null;\n el.viewAvailable = false;\n await el.updateComplete;\n // check base properties\n expect(el.loaded).to.equal(null);\n expect(el.item).to.be.undefined;\n\n // spy fires\n expect(spy.called).to.equal(true);\n expect(spy.callCount).to.equal(1);\n });\n });\n\n describe('`el.sharedObserver`', () => {\n it('uses one', async () => {\n const sharedObserver = new SharedResizeObserver();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(el.sharedObserver).to.equal(sharedObserver);\n expect(typeof el.handleResize).to.equal('function');\n });\n it('freshly registers handlers', async () => {\n const sharedObserver = new SharedResizeObserver();\n const addObserverSpy = Sinon.spy(sharedObserver, 'addObserver');\n\n await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n expect(addObserverSpy.callCount).to.equal(2);\n });\n it('removes handler when component disconnects', async () => {\n const sharedObserver = new SharedResizeObserver();\n const removeObserverSpy = Sinon.spy(sharedObserver, 'removeObserver');\n\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .sharedObserver=${sharedObserver}\n ></iaux-item-navigator>`,\n );\n\n el.disconnectedCallback();\n await el.updateComplete;\n\n expect(removeObserverSpy.callCount).to.equal(1);\n });\n it('sets menu to overlay if container width is <= 600px', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n\n expect(el.openMenuState).to.equal('shift'); // as starting point\n\n const overlaySize = {\n contentRect: { width: 600 },\n } as ResizeObserverEntry;\n el.handleResize(overlaySize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('overlay'); // changes open menu display to an overlay\n\n const shiftSize = {\n contentRect: { width: 601 },\n } as ResizeObserverEntry;\n el.handleResize(shiftSize);\n await el.updateComplete;\n\n expect(el.openMenuState).to.equal('shift');\n });\n });\n\n describe('`el.modal`', () => {\n it('uses one', async () => {\n const modal = new ModalManager();\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator .modal=${modal}></iaux-item-navigator>`,\n );\n expect(el.modal).to.equal(modal);\n });\n });\n\n describe('full browser window immersion \"fullscreen\"', () => {\n it('creates reflected attribute `viewportinfullscreen`', async () => {\n /** to help with external styling adjustmnents */\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.getAttribute('viewportinfullscreen')).to.be.null;\n\n el.viewportInFullscreen = true;\n await el.updateComplete;\n\n expect(el.getAttribute('viewportinfullscreen')).to.exist;\n });\n it('@ViewportInFullScreen', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator></iaux-item-navigator>`,\n );\n expect(el.viewportInFullscreen).to.be.null;\n\n const yesFullscreenEvent = {\n detail: {\n isFullScreen: true,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(yesFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.true;\n\n const noFullscreenEvent = {\n detail: {\n isFullScreen: false,\n },\n } as ManageFullscreenEvent;\n el.manageViewportFullscreen(noFullscreenEvent);\n await el.updateComplete;\n expect(el.viewportInFullscreen).to.be.null;\n });\n });\n\n /* Side menu & shortcuts tests */\n describe('el.menuOpened', () => {\n it('toggles side menu open', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n expect(nav?.querySelector('#menu')).to.exist;\n // side menu starts closed\n expect(el.menuOpened).to.be.false;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.contain(\n 'hidden',\n );\n\n // let's open menu\n el.toggleMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n expect(nav?.querySelector('#menu')?.getAttribute('class')).to.not.contain(\n 'hidden',\n );\n });\n\n it('opens menu shortcut with `@manageSideMenuEvents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n const detail = {\n menuId: 'fullscreen',\n action: 'open',\n };\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n const frame = el.shadowRoot?.querySelector('#frame');\n // default menu open behavior is to side menu open, not overlay\n expect(frame?.getAttribute('class')).to.contain('shift');\n\n expect(el.menuOpened).to.be.false;\n expect(el.openMenu).to.be.undefined;\n expect(frame?.getAttribute('class')).to.not.contain('open');\n\n const event = new CustomEvent('updateSideMenu', {\n detail,\n }) as ToggleSideMenuOpenEvent;\n el.manageSideMenuEvents(event);\n await el.updateComplete;\n\n expect(el.shouldRenderMenu).to.be.true;\n expect(el.menuOpened).to.be.true;\n expect(el.openMenu).to.equal(detail.menuId);\n\n expect(frame?.getAttribute('class')).to.contain('open');\n\n // no menu provided\n const openShortcutSpy = Sinon.spy(el, 'openShortcut');\n const toggleMenuSpy = Sinon.spy(el, 'toggleMenu');\n\n const noMenuProvidedEvent = new CustomEvent('updateSideMenu', {\n detail: {},\n }) as any;\n el.manageSideMenuEvents(noMenuProvidedEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.called).to.be.false;\n expect(toggleMenuSpy.called).to.be.false;\n\n // toggle menu\n const toggleMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'toggle', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(toggleMenuEvent);\n await el.updateComplete;\n\n expect(toggleMenuSpy.callCount).to.equal(1);\n\n // open menu\n const openMenuEvent = new CustomEvent('updateSideMenu', {\n detail: { action: 'open', menuId: 'fullscreen' },\n }) as any;\n el.manageSideMenuEvents(openMenuEvent);\n await el.updateComplete;\n\n expect(openShortcutSpy.callCount).to.equal(1);\n });\n });\n\n describe('el.menuContents', () => {\n it('draws side menu when populated', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuContents = [menuProvider];\n await el.updateComplete;\n expect(el.menuContents.length).to.exist;\n expect(el.shouldRenderMenu).to.be.true;\n\n const nav = el.shadowRoot?.querySelector('nav');\n expect(nav).to.exist;\n\n const menuSlider = nav?.querySelector('ia-menu-slider');\n expect(menuSlider).to.exist;\n expect(menuSlider?.getAttribute('manuallyhandleclose')).to.exist;\n expect(menuSlider?.getAttribute('open')).to.exist;\n });\n });\n\n describe('`el.menuShortcuts`', () => {\n it('displays shortcut & toggle side menu button', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n const anotherShortcut = {\n id: 'foo',\n icon: html`<i class=\"foo-shortcut\"></i>`,\n };\n el.menuContents = [menuProvider];\n el.menuShortcuts = [shortcut, anotherShortcut];\n await el.updateComplete;\n\n const nav = el.shadowRoot?.querySelector('nav');\n\n const shortcutsContainer = nav?.querySelector('.shortcuts');\n expect(el.menuShortcuts.length).to.exist;\n expect(nav).to.exist;\n expect(shortcutsContainer).to.exist;\n expect(shortcutsContainer?.querySelector('i.fullscreen-test')).to.exist;\n expect(shortcutsContainer?.querySelector('button.shortcut.foo')).to.exist;\n expect(nav?.querySelector('.toggle-menu')).to.exist;\n });\n });\n\n describe('Menu events', () => {\n it('`el.setMenuShortcuts`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuShortcuts.length).to.equal(0);\n\n const menuShortcuts = [shortcut];\n\n el.setMenuShortcuts({\n detail: menuShortcuts,\n } as SetSideMenuShortcutsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setMenuContents`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n expect(el.menuContents.length).to.equal(0);\n\n el.setMenuShortcuts({\n detail: [menuProvider],\n } as SetSideMenuContentsEvent);\n await el.updateComplete;\n\n expect(el.menuShortcuts.length).to.equal(1);\n });\n it('`el.setOpenMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.equal('foo');\n expect(el.selectedMenuId).to.equal('foo');\n\n // toggles it off\n el.setOpenMenu({\n detail: { id: 'foo' },\n } as ToggleSidePanelOpenEvent);\n await el.updateComplete;\n\n expect(el.openMenu).to.be.undefined;\n expect(el.selectedMenuId).to.equal('');\n });\n it('`el.closeMenu`', async () => {\n const el = await fixture<ItemNavigator>(\n html`<iaux-item-navigator\n .item=${new ItemStub()}\n ></iaux-item-navigator>`,\n );\n\n el.menuOpened = true;\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.true;\n\n el.closeMenu();\n await el.updateComplete;\n\n expect(el.menuOpened).to.be.false;\n });\n });\n});\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '../src/menus/iaux-sharing-options';
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { html, fixture, expect } from '@open-wc/testing';
|
2
|
+
import sinon from 'sinon';
|
3
|
+
import '../src/menus/iaux-sharing-options';
|
4
|
+
const identifier = 'goody';
|
5
|
+
const itemType = 'book';
|
6
|
+
const creator = 'Welsh, Charles';
|
7
|
+
const description = 'The history of Little Goody Two-Shoes : otherwise called Mrs. Margery Two-Shoes ... [1766 edition]';
|
8
|
+
const container = (optionalFileSubprefix = '') => html `<iaux-sharing-options
|
9
|
+
identifier="${identifier}"
|
10
|
+
type="${itemType}"
|
11
|
+
creator="${creator}"
|
12
|
+
description="${description}"
|
13
|
+
baseHost="archive.org"
|
14
|
+
fileSubPrefix="${optionalFileSubprefix}"
|
15
|
+
></iaux-sharing-options>`;
|
16
|
+
describe('<iaux-sharing-options>', () => {
|
17
|
+
afterEach(() => {
|
18
|
+
sinon.restore();
|
19
|
+
});
|
20
|
+
it('sets default properties', async () => {
|
21
|
+
const el = (await fixture(container()));
|
22
|
+
expect(el.identifier).to.equal(identifier);
|
23
|
+
expect(el.type).to.equal(itemType);
|
24
|
+
expect(el.creator).to.equal(creator);
|
25
|
+
expect(el.description).to.equal(description);
|
26
|
+
});
|
27
|
+
it('renders buttons for each sharing method', async () => {
|
28
|
+
const el = (await fixture(container()));
|
29
|
+
await el.updateComplete;
|
30
|
+
el.sharingOptions.forEach(option => {
|
31
|
+
const button = el.shadowRoot && el.shadowRoot.querySelector(`a.${option.class}`);
|
32
|
+
expect(button).to.exist;
|
33
|
+
expect(button === null || button === void 0 ? void 0 : button.getAttribute('href')).to.equal(option.url);
|
34
|
+
});
|
35
|
+
});
|
36
|
+
it('toggles visibility of embed options', async () => {
|
37
|
+
const el = (await fixture(container()));
|
38
|
+
el.toggleEmbedOptions(new Event('click'));
|
39
|
+
await el.updateComplete;
|
40
|
+
expect(el.embedOptionsVisible).to.equal(true);
|
41
|
+
});
|
42
|
+
it('does not show internal header by default', async () => {
|
43
|
+
var _a;
|
44
|
+
const el = (await fixture(container()));
|
45
|
+
expect((_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('header')).to.be.null;
|
46
|
+
});
|
47
|
+
it('does shows internal header when requested', async () => {
|
48
|
+
var _a;
|
49
|
+
const el = (await fixture(container()));
|
50
|
+
el.renderHeader = true;
|
51
|
+
await el.updateComplete;
|
52
|
+
expect((_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('header')).to.not.be.null;
|
53
|
+
});
|
54
|
+
it('sets file subprefix to end of share URLs if present', async () => {
|
55
|
+
const optionalFileSubprefix = 'foo- bar - 123-';
|
56
|
+
const el = (await fixture(container(optionalFileSubprefix)));
|
57
|
+
el.sharingOptions.forEach(option => {
|
58
|
+
if (option.name !== 'Tumblr') {
|
59
|
+
expect(option.url).to.contain(encodeURIComponent(optionalFileSubprefix));
|
60
|
+
}
|
61
|
+
});
|
62
|
+
});
|
63
|
+
});
|
64
|
+
//# sourceMappingURL=iaux-sharing-options.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iaux-sharing-options.test.js","sourceRoot":"","sources":["../../test/iaux-sharing-options.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mCAAmC,CAAC;AAG3C,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,OAAO,GAAG,gBAAgB,CAAC;AACjC,MAAM,WAAW,GACf,oGAAoG,CAAC;AAEvG,MAAM,SAAS,GAAG,CAAC,qBAAqB,GAAG,EAAE,EAAE,EAAE,CAC/C,IAAI,CAAA;kBACY,UAAU;YAChB,QAAQ;eACL,OAAO;mBACH,WAAW;;qBAET,qBAAqB;2BACf,CAAC;AAE5B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,CAAuB,CAAC;QAE9D,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,EAAE,CAAC,OAAO,C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C,SAAS,EAAE,CAAC,CAAuB,CAAC;QAC9D,MAAM,CAAC,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;;QACzD,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,CAAuB,CAAC;QAC9D,EAAE,CAAC,YAAY,GAAG,IAAI,CAAC;QACvB,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,MAAM,CAAC,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;QAChD,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CACvB,SAAS,CAAC,qBAAqB,CAAC,CACjC,CAAuB,CAAC;QAEzB,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACjC,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC5B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,OAAO,CAC3B,kBAAkB,CAAC,qBAAqB,CAAC,CAC1C,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, fixture, expect } from '@open-wc/testing';\nimport sinon from 'sinon';\nimport '../src/menus/iaux-sharing-options';\nimport type { IauxSharingOptions } from '../src/menus/iaux-sharing-options';\n\nconst identifier = 'goody';\nconst itemType = 'book';\nconst creator = 'Welsh, Charles';\nconst description =\n 'The history of Little Goody Two-Shoes : otherwise called Mrs. Margery Two-Shoes ... [1766 edition]';\n\nconst container = (optionalFileSubprefix = '') =>\n html`<iaux-sharing-options\n identifier=\"${identifier}\"\n type=\"${itemType}\"\n creator=\"${creator}\"\n description=\"${description}\"\n baseHost=\"archive.org\"\n fileSubPrefix=\"${optionalFileSubprefix}\"\n ></iaux-sharing-options>`;\n\ndescribe('<iaux-sharing-options>', () => {\n afterEach(() => {\n sinon.restore();\n });\n\n it('sets default properties', async () => {\n const el = (await fixture(container())) as IauxSharingOptions;\n\n expect(el.identifier).to.equal(identifier);\n expect(el.type).to.equal(itemType);\n expect(el.creator).to.equal(creator);\n expect(el.description).to.equal(description);\n });\n\n it('renders buttons for each sharing method', async () => {\n const el = (await fixture(container())) as IauxSharingOptions;\n\n await el.updateComplete;\n\n el.sharingOptions.forEach(option => {\n const button =\n el.shadowRoot && el.shadowRoot.querySelector(`a.${option.class}`);\n expect(button).to.exist;\n expect(button?.getAttribute('href')).to.equal(option.url);\n });\n });\n\n it('toggles visibility of embed options', async () => {\n const el = (await fixture(container())) as IauxSharingOptions;\n\n el.toggleEmbedOptions(new Event('click'));\n await el.updateComplete;\n\n expect(el.embedOptionsVisible).to.equal(true);\n });\n\n it('does not show internal header by default', async () => {\n const el = (await fixture(container())) as IauxSharingOptions;\n expect(el.shadowRoot?.querySelector('header')).to.be.null;\n });\n\n it('does shows internal header when requested', async () => {\n const el = (await fixture(container())) as IauxSharingOptions;\n el.renderHeader = true;\n await el.updateComplete;\n expect(el.shadowRoot?.querySelector('header')).to.not.be.null;\n });\n\n it('sets file subprefix to end of share URLs if present', async () => {\n const optionalFileSubprefix = 'foo- bar - 123-';\n const el = (await fixture(\n container(optionalFileSubprefix),\n )) as IauxSharingOptions;\n\n el.sharingOptions.forEach(option => {\n if (option.name !== 'Tumblr') {\n expect(option.url).to.contain(\n encodeURIComponent(optionalFileSubprefix),\n );\n }\n });\n });\n});\n"]}
|
package/index.ts
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
-
export { ItemNavigator } from './src/item-navigator';
|
1
|
+
export { ItemNavigator } from './src/iaux-item-navigator';
|
2
2
|
export { MenuButton } from './src/menu-slider/menu-button';
|
3
3
|
export { IaMenuSlider } from './src/menu-slider/ia-menu-slider';
|
4
|
+
|
5
|
+
// side menus
|
6
|
+
export {
|
7
|
+
IauxSharingOptions,
|
8
|
+
iauxShareIcon,
|
9
|
+
} from './src/menus/iaux-sharing-options';
|
10
|
+
export { viewableFilesIcon } from './src/menus/iaux-viewable-files';
|
11
|
+
export { IauxViewableFiles } from './src/menus/iaux-viewable-files';
|
12
|
+
export { IauxSortFilesButton } from './src/menus/iaux-viewable-files';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@internetarchive/ia-item-navigator",
|
3
|
-
"version": "
|
3
|
+
"version": "v2.0.0-alpha2",
|
4
4
|
"description": "Internet Archive's Item Navigator, visually explore an item's contents.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -31,7 +31,13 @@
|
|
31
31
|
"dependencies": {
|
32
32
|
"@internetarchive/icon-collapse-sidebar": "^1.3.4",
|
33
33
|
"@internetarchive/icon-ellipses": "^1.3.4",
|
34
|
+
"@internetarchive/icon-email": "^1.3.4",
|
35
|
+
"@internetarchive/icon-facebook": "^1.3.4",
|
36
|
+
"@internetarchive/icon-link": "^1.3.4",
|
37
|
+
"@internetarchive/icon-pinterest": "^1.3.4",
|
34
38
|
"@internetarchive/icon-share": "^1.3.4",
|
39
|
+
"@internetarchive/icon-tumblr": "^1.3.4",
|
40
|
+
"@internetarchive/icon-twitter": "^1.3.4",
|
35
41
|
"@internetarchive/icon-visual-adjustment": "^1.3.4",
|
36
42
|
"@internetarchive/modal-manager": "^0.2.7",
|
37
43
|
"@internetarchive/search-service": "^0.1.2",
|
@@ -71,14 +77,13 @@
|
|
71
77
|
"eslintConfig": {
|
72
78
|
"parser": "@typescript-eslint/parser",
|
73
79
|
"extends": [
|
74
|
-
"@open-wc
|
75
|
-
"
|
80
|
+
"@open-wc",
|
81
|
+
"prettier"
|
76
82
|
],
|
77
83
|
"plugins": [
|
78
84
|
"@typescript-eslint"
|
79
85
|
],
|
80
86
|
"rules": {
|
81
|
-
"class-methods-use-this": "off",
|
82
87
|
"no-unused-vars": "off",
|
83
88
|
"@typescript-eslint/no-unused-vars": [
|
84
89
|
"error"
|
@@ -87,9 +92,11 @@
|
|
87
92
|
"@typescript-eslint/no-shadow": [
|
88
93
|
"error"
|
89
94
|
],
|
95
|
+
"class-methods-use-this": "off",
|
90
96
|
"import/no-unresolved": "off",
|
91
97
|
"import/extensions": [
|
92
98
|
"off",
|
99
|
+
"ignorePackages",
|
93
100
|
{
|
94
101
|
"js": "never",
|
95
102
|
"ts": "never"
|
@@ -35,7 +35,7 @@ import {
|
|
35
35
|
} from './interfaces/menu-interfaces';
|
36
36
|
import './no-theater-available';
|
37
37
|
|
38
|
-
@customElement('
|
38
|
+
@customElement('iaux-item-navigator')
|
39
39
|
export class ItemNavigator
|
40
40
|
extends LitElement
|
41
41
|
implements SharedResizeObserverResizeHandlerInterface
|
@@ -55,15 +55,7 @@ export class ItemNavigator
|
|
55
55
|
|
56
56
|
@property({ type: String }) baseHost = 'archive.org';
|
57
57
|
|
58
|
-
@property({
|
59
|
-
converter: (arg: string | boolean | null) => {
|
60
|
-
if (typeof arg === 'boolean') {
|
61
|
-
return arg;
|
62
|
-
}
|
63
|
-
return arg === 'true';
|
64
|
-
},
|
65
|
-
})
|
66
|
-
signedIn = false;
|
58
|
+
@property({ type: Boolean }) signedIn = false;
|
67
59
|
|
68
60
|
@property({ type: Array }) menuContents: MenuProviderInterface[] = [];
|
69
61
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
[
|
2
|
+
/* This is a whole user list */
|
3
|
+
{
|
4
|
+
"list_name": "My Great List",
|
5
|
+
"description": "The greatest list of all",
|
6
|
+
"private": true,
|
7
|
+
"date_created": "2020-01-01T01:23:45Z",
|
8
|
+
"date_updated": "2020-01-01T01:23:45Z",
|
9
|
+
"members": [
|
10
|
+
/* This is a member of the user list */
|
11
|
+
{
|
12
|
+
"identifier": "BettyWhiteShow",
|
13
|
+
"date_added": "2020-01-01T01:23:45Z"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"identifier": "masterbookofamericanfolksong00shep",
|
17
|
+
"file": "04-Letters%20to%20Riley%20Shepard",
|
18
|
+
"date_added": "2020-01-01T01:23:45Z"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"identifier": "inlibrary",
|
22
|
+
"search-term": "?not%5B%5D=lending%3A%22available_to_borrow%22",
|
23
|
+
"date_added": "2020-01-01T01:23:45Z"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"type": "search",
|
27
|
+
"search-term": "?query=San+Francisco%2C+ca¬%5B%5D=mediatype%3A%22audio%22",
|
28
|
+
"date_added": "2020-01-01T01:23:45Z"
|
29
|
+
},
|
30
|
+
|
31
|
+
/* More members ... */
|
32
|
+
]
|
33
|
+
},
|
34
|
+
/* More lists ... */
|
35
|
+
]
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
{
|
44
|
+
'foo': {
|
45
|
+
'date-added': datetime,
|
46
|
+
items: [
|
47
|
+
{
|
48
|
+
id: 'goody',
|
49
|
+
subprefix: '/subdi/subdir/tooshoes',
|
50
|
+
date-added: datetime,
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
[
|
58
|
+
{
|
59
|
+
list-name: 'foo-list',
|
60
|
+
date-created: datetime,
|
61
|
+
date-updated: datetime,
|
62
|
+
items: [
|
63
|
+
{
|
64
|
+
id: 'goody',
|
65
|
+
subprefix: '/subdi/subdir/tooshoes',
|
66
|
+
date-added: datetime,
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
{
|
71
|
+
list-name: 'uncategorized',
|
72
|
+
date-created: datetime,
|
73
|
+
date-updated: datetime,
|
74
|
+
items: [
|
75
|
+
{
|
76
|
+
id: 'goody',
|
77
|
+
subprefix: '/subdi/subdir/tooshoes',
|
78
|
+
date-added: datetime,
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
82
|
+
]
|
83
|
+
|
84
|
+
q:items='goody','good'
|