@internetarchive/ia-item-navigator 1.0.4-a1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/demo/app-root.d.ts +47 -47
- package/dist/demo/app-root.js +199 -199
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/src/interfaces/custom-theater-interface.d.ts +20 -20
- package/dist/src/interfaces/custom-theater-interface.js +1 -1
- package/dist/src/interfaces/event-interfaces.d.ts +40 -40
- package/dist/src/interfaces/event-interfaces.js +1 -1
- package/dist/src/interfaces/menu-interfaces.d.ts +22 -22
- package/dist/src/interfaces/menu-interfaces.js +1 -1
- package/dist/src/item-navigator.d.ts +69 -69
- package/dist/src/item-navigator.js +256 -256
- package/dist/src/loader.d.ts +13 -13
- package/dist/src/loader.js +31 -31
- package/dist/src/menu-slider/ia-menu-slider.d.ts +30 -30
- package/dist/src/menu-slider/ia-menu-slider.js +112 -112
- package/dist/src/menu-slider/menu-button.d.ts +19 -19
- package/dist/src/menu-slider/menu-button.js +75 -75
- package/dist/src/menu-slider/styles/menu-button.d.ts +2 -2
- package/dist/src/menu-slider/styles/menu-button.js +2 -2
- package/dist/src/menu-slider/styles/menu-slider.d.ts +2 -2
- package/dist/src/menu-slider/styles/menu-slider.js +9 -20
- package/dist/src/menu-slider/styles/menu-slider.js.map +1 -1
- package/dist/src/no-theater-available.d.ts +9 -9
- package/dist/src/no-theater-available.js +35 -35
- package/dist/test/ia-item-navigator.test.d.ts +1 -1
- package/dist/test/ia-item-navigator.test.js +296 -296
- package/dist/test/ia-stub.d.ts +22 -22
- package/dist/test/ia-stub.js +34 -34
- package/dist/test/no-theater-available.test.d.ts +1 -1
- package/dist/test/no-theater-available.test.js +22 -22
- package/package.json +1 -1
- package/src/menu-slider/styles/menu-slider.ts +4 -15
@@ -1,92 +1,92 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { css, html, LitElement, nothing, } from 'lit';
|
3
|
-
import { customElement, property, state, query } from 'lit/decorators.js';
|
4
|
-
import { MetadataResponse } from '@internetarchive/search-service';
|
5
|
-
import '@internetarchive/icon-ellipses/icon-ellipses';
|
6
|
-
import './menu-slider/ia-menu-slider';
|
7
|
-
import './loader';
|
8
|
-
import './no-theater-available';
|
9
|
-
let ItemNavigator = class ItemNavigator extends LitElement {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.viewAvailable = true;
|
13
|
-
this.baseHost = 'archive.org';
|
14
|
-
this.signedIn = false;
|
15
|
-
this.menuContents = [];
|
16
|
-
this.menuShortcuts = [];
|
17
|
-
this.viewportInFullscreen = null;
|
18
|
-
this.menuOpened = false;
|
19
|
-
this.loaded = null;
|
20
|
-
this.openMenuState = 'shift';
|
21
|
-
}
|
22
|
-
disconnectedCallback() {
|
23
|
-
this.removeResizeObserver();
|
24
|
-
}
|
25
|
-
updated(changed) {
|
26
|
-
if (changed.has('sharedObserver')) {
|
27
|
-
const oldObserver = changed.get('sharedObserver');
|
28
|
-
oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.removeObserver(this.resizeObserverConfig);
|
29
|
-
this.setResizeObserver();
|
30
|
-
}
|
31
|
-
}
|
32
|
-
/** Shared observer */
|
33
|
-
handleResize(entry) {
|
34
|
-
const { width } = entry.contentRect;
|
35
|
-
if (width <= 600) {
|
36
|
-
this.openMenuState = 'overlay';
|
37
|
-
return;
|
38
|
-
}
|
39
|
-
this.openMenuState = 'shift';
|
40
|
-
}
|
41
|
-
setResizeObserver() {
|
42
|
-
var _a, _b;
|
43
|
-
(_a = this.sharedObserver) === null || _a === void 0 ? void 0 : _a.addObserver(this.resizeObserverConfig);
|
44
|
-
(_b = this.sharedObserver) === null || _b === void 0 ? void 0 : _b.addObserver({
|
45
|
-
target: this.headerSlot,
|
46
|
-
handler: {
|
47
|
-
handleResize: ({ contentRect }) => {
|
48
|
-
if (contentRect.height) {
|
49
|
-
this.requestUpdate();
|
50
|
-
}
|
51
|
-
},
|
52
|
-
},
|
53
|
-
});
|
54
|
-
}
|
55
|
-
removeResizeObserver() {
|
56
|
-
var _a;
|
57
|
-
(_a = this.sharedObserver) === null || _a === void 0 ? void 0 : _a.removeObserver(this.resizeObserverConfig);
|
58
|
-
}
|
59
|
-
get resizeObserverConfig() {
|
60
|
-
return {
|
61
|
-
handler: this,
|
62
|
-
target: this.frame,
|
63
|
-
};
|
64
|
-
}
|
65
|
-
/** End shared observer */
|
66
|
-
get loaderTitle() {
|
67
|
-
return this.viewportInFullscreen ? 'Internet Archive' : '';
|
68
|
-
}
|
69
|
-
get loadingArea() {
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { css, html, LitElement, nothing, } from 'lit';
|
3
|
+
import { customElement, property, state, query } from 'lit/decorators.js';
|
4
|
+
import { MetadataResponse } from '@internetarchive/search-service';
|
5
|
+
import '@internetarchive/icon-ellipses/icon-ellipses';
|
6
|
+
import './menu-slider/ia-menu-slider';
|
7
|
+
import './loader';
|
8
|
+
import './no-theater-available';
|
9
|
+
let ItemNavigator = class ItemNavigator extends LitElement {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.viewAvailable = true;
|
13
|
+
this.baseHost = 'archive.org';
|
14
|
+
this.signedIn = false;
|
15
|
+
this.menuContents = [];
|
16
|
+
this.menuShortcuts = [];
|
17
|
+
this.viewportInFullscreen = null;
|
18
|
+
this.menuOpened = false;
|
19
|
+
this.loaded = null;
|
20
|
+
this.openMenuState = 'shift';
|
21
|
+
}
|
22
|
+
disconnectedCallback() {
|
23
|
+
this.removeResizeObserver();
|
24
|
+
}
|
25
|
+
updated(changed) {
|
26
|
+
if (changed.has('sharedObserver')) {
|
27
|
+
const oldObserver = changed.get('sharedObserver');
|
28
|
+
oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.removeObserver(this.resizeObserverConfig);
|
29
|
+
this.setResizeObserver();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
/** Shared observer */
|
33
|
+
handleResize(entry) {
|
34
|
+
const { width } = entry.contentRect;
|
35
|
+
if (width <= 600) {
|
36
|
+
this.openMenuState = 'overlay';
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
this.openMenuState = 'shift';
|
40
|
+
}
|
41
|
+
setResizeObserver() {
|
42
|
+
var _a, _b;
|
43
|
+
(_a = this.sharedObserver) === null || _a === void 0 ? void 0 : _a.addObserver(this.resizeObserverConfig);
|
44
|
+
(_b = this.sharedObserver) === null || _b === void 0 ? void 0 : _b.addObserver({
|
45
|
+
target: this.headerSlot,
|
46
|
+
handler: {
|
47
|
+
handleResize: ({ contentRect }) => {
|
48
|
+
if (contentRect.height) {
|
49
|
+
this.requestUpdate();
|
50
|
+
}
|
51
|
+
},
|
52
|
+
},
|
53
|
+
});
|
54
|
+
}
|
55
|
+
removeResizeObserver() {
|
56
|
+
var _a;
|
57
|
+
(_a = this.sharedObserver) === null || _a === void 0 ? void 0 : _a.removeObserver(this.resizeObserverConfig);
|
58
|
+
}
|
59
|
+
get resizeObserverConfig() {
|
60
|
+
return {
|
61
|
+
handler: this,
|
62
|
+
target: this.frame,
|
63
|
+
};
|
64
|
+
}
|
65
|
+
/** End shared observer */
|
66
|
+
get loaderTitle() {
|
67
|
+
return this.viewportInFullscreen ? 'Internet Archive' : '';
|
68
|
+
}
|
69
|
+
get loadingArea() {
|
70
70
|
return html `
|
71
71
|
<div class="loading-area">
|
72
72
|
<div class="loading-view">
|
73
73
|
<ia-itemnav-loader .title=${this.loaderTitle}></ia-itemnav-loader>
|
74
74
|
</div>
|
75
75
|
</div>
|
76
|
-
`;
|
77
|
-
}
|
78
|
-
slotChange(e, type) {
|
79
|
-
var _a;
|
80
|
-
const slottedContent = (_a = e.target.assignedNodes()) === null || _a === void 0 ? void 0 : _a[0];
|
81
|
-
this.dispatchEvent(new CustomEvent('slotChange', {
|
82
|
-
detail: { slot: slottedContent, type },
|
83
|
-
}));
|
84
|
-
this.requestUpdate();
|
85
|
-
}
|
86
|
-
render() {
|
87
|
-
var _a, _b;
|
88
|
-
const displayReaderClass = this.loaded ? '' : 'hidden';
|
89
|
-
const headerHeight = ((_b = (_a = this.headerSlot) === null || _a === void 0 ? void 0 : _a.assignedNodes()[0]) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
|
76
|
+
`;
|
77
|
+
}
|
78
|
+
slotChange(e, type) {
|
79
|
+
var _a;
|
80
|
+
const slottedContent = (_a = e.target.assignedNodes()) === null || _a === void 0 ? void 0 : _a[0];
|
81
|
+
this.dispatchEvent(new CustomEvent('slotChange', {
|
82
|
+
detail: { slot: slottedContent, type },
|
83
|
+
}));
|
84
|
+
this.requestUpdate();
|
85
|
+
}
|
86
|
+
render() {
|
87
|
+
var _a, _b;
|
88
|
+
const displayReaderClass = this.loaded ? '' : 'hidden';
|
89
|
+
const headerHeight = ((_b = (_a = this.headerSlot) === null || _a === void 0 ? void 0 : _a.assignedNodes()[0]) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
|
90
90
|
return html `
|
91
91
|
<div id="frame" class=${this.menuClass}>
|
92
92
|
<slot
|
@@ -102,20 +102,20 @@ let ItemNavigator = class ItemNavigator extends LitElement {
|
|
102
102
|
${!this.loaded ? this.loadingArea : nothing}
|
103
103
|
</div>
|
104
104
|
</div>
|
105
|
-
`;
|
106
|
-
}
|
107
|
-
get noTheaterView() {
|
108
|
-
var _a, _b;
|
105
|
+
`;
|
106
|
+
}
|
107
|
+
get noTheaterView() {
|
108
|
+
var _a, _b;
|
109
109
|
return html `<ia-no-theater-available
|
110
110
|
.identifier=${(_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.identifier}
|
111
111
|
@loadingStateUpdated=${this.loadingStateUpdated}
|
112
|
-
></ia-no-theater-available>`;
|
113
|
-
}
|
114
|
-
get renderViewport() {
|
115
|
-
if (!this.viewAvailable) {
|
116
|
-
return this.noTheaterView;
|
117
|
-
}
|
118
|
-
const slotVisibility = !this.loaded ? 'opacity: 0;' : 'opacity: 1;';
|
112
|
+
></ia-no-theater-available>`;
|
113
|
+
}
|
114
|
+
get renderViewport() {
|
115
|
+
if (!this.viewAvailable) {
|
116
|
+
return this.noTheaterView;
|
117
|
+
}
|
118
|
+
const slotVisibility = !this.loaded ? 'opacity: 0;' : 'opacity: 1;';
|
119
119
|
return html `
|
120
120
|
<div slot="main" style=${slotVisibility}>
|
121
121
|
<slot
|
@@ -123,59 +123,59 @@ let ItemNavigator = class ItemNavigator extends LitElement {
|
|
123
123
|
@slotchange=${(e) => this.slotChange(e, 'main')}
|
124
124
|
></slot>
|
125
125
|
</div>
|
126
|
-
`;
|
127
|
-
}
|
128
|
-
loadingStateUpdated(e) {
|
129
|
-
const { loaded } = e.detail;
|
130
|
-
this.loaded = loaded || null;
|
131
|
-
}
|
132
|
-
/** Fullscreen Management */
|
133
|
-
manageViewportFullscreen(e) {
|
134
|
-
const fullscreenStatus = !!e.detail.isFullScreen;
|
135
|
-
this.viewportInFullscreen = !fullscreenStatus ? null : fullscreenStatus;
|
136
|
-
const event = new CustomEvent('fullscreenToggled', {
|
137
|
-
detail: e.detail,
|
138
|
-
});
|
139
|
-
this.dispatchEvent(event);
|
140
|
-
}
|
141
|
-
/** End Fullscreen Management */
|
142
|
-
/** Side menu */
|
143
|
-
get shouldRenderMenu() {
|
144
|
-
var _a;
|
145
|
-
return !!((_a = this.menuContents) === null || _a === void 0 ? void 0 : _a.length);
|
146
|
-
}
|
147
|
-
toggleMenu() {
|
148
|
-
this.menuOpened = !this.menuOpened;
|
149
|
-
}
|
150
|
-
closeMenu() {
|
151
|
-
this.menuOpened = false;
|
152
|
-
}
|
153
|
-
setOpenMenu(e) {
|
154
|
-
const { id } = e.detail;
|
155
|
-
this.openMenu = id !== this.openMenu ? id : undefined;
|
156
|
-
}
|
157
|
-
setMenuContents(e) {
|
158
|
-
const updatedContents = [...e.detail];
|
159
|
-
this.menuContents = updatedContents;
|
160
|
-
}
|
161
|
-
setMenuShortcuts(e) {
|
162
|
-
this.menuShortcuts = [...e.detail];
|
163
|
-
}
|
164
|
-
/** Toggles Side Menu & Sets viewable subpanel */
|
165
|
-
manageSideMenuEvents(e) {
|
166
|
-
const { menuId, action } = e.detail;
|
167
|
-
if (!menuId) {
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
if (action === 'open') {
|
171
|
-
this.openShortcut(menuId);
|
172
|
-
}
|
173
|
-
else if (action === 'toggle') {
|
174
|
-
this.openMenu = menuId;
|
175
|
-
this.toggleMenu();
|
176
|
-
}
|
177
|
-
}
|
178
|
-
get menuToggleButton() {
|
126
|
+
`;
|
127
|
+
}
|
128
|
+
loadingStateUpdated(e) {
|
129
|
+
const { loaded } = e.detail;
|
130
|
+
this.loaded = loaded || null;
|
131
|
+
}
|
132
|
+
/** Fullscreen Management */
|
133
|
+
manageViewportFullscreen(e) {
|
134
|
+
const fullscreenStatus = !!e.detail.isFullScreen;
|
135
|
+
this.viewportInFullscreen = !fullscreenStatus ? null : fullscreenStatus;
|
136
|
+
const event = new CustomEvent('fullscreenToggled', {
|
137
|
+
detail: e.detail,
|
138
|
+
});
|
139
|
+
this.dispatchEvent(event);
|
140
|
+
}
|
141
|
+
/** End Fullscreen Management */
|
142
|
+
/** Side menu */
|
143
|
+
get shouldRenderMenu() {
|
144
|
+
var _a;
|
145
|
+
return !!((_a = this.menuContents) === null || _a === void 0 ? void 0 : _a.length);
|
146
|
+
}
|
147
|
+
toggleMenu() {
|
148
|
+
this.menuOpened = !this.menuOpened;
|
149
|
+
}
|
150
|
+
closeMenu() {
|
151
|
+
this.menuOpened = false;
|
152
|
+
}
|
153
|
+
setOpenMenu(e) {
|
154
|
+
const { id } = e.detail;
|
155
|
+
this.openMenu = id !== this.openMenu ? id : undefined;
|
156
|
+
}
|
157
|
+
setMenuContents(e) {
|
158
|
+
const updatedContents = [...e.detail];
|
159
|
+
this.menuContents = updatedContents;
|
160
|
+
}
|
161
|
+
setMenuShortcuts(e) {
|
162
|
+
this.menuShortcuts = [...e.detail];
|
163
|
+
}
|
164
|
+
/** Toggles Side Menu & Sets viewable subpanel */
|
165
|
+
manageSideMenuEvents(e) {
|
166
|
+
const { menuId, action } = e.detail;
|
167
|
+
if (!menuId) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
if (action === 'open') {
|
171
|
+
this.openShortcut(menuId);
|
172
|
+
}
|
173
|
+
else if (action === 'toggle') {
|
174
|
+
this.openMenu = menuId;
|
175
|
+
this.toggleMenu();
|
176
|
+
}
|
177
|
+
}
|
178
|
+
get menuToggleButton() {
|
179
179
|
return html `
|
180
180
|
<button
|
181
181
|
class="toggle-menu"
|
@@ -188,13 +188,13 @@ let ItemNavigator = class ItemNavigator extends LitElement {
|
|
188
188
|
></ia-icon-ellipses>
|
189
189
|
</div>
|
190
190
|
</button>
|
191
|
-
`;
|
192
|
-
}
|
193
|
-
get selectedMenuId() {
|
194
|
-
return this.openMenu || '';
|
195
|
-
}
|
196
|
-
get renderSideMenu() {
|
197
|
-
const drawerState = this.menuOpened ? '' : 'hidden';
|
191
|
+
`;
|
192
|
+
}
|
193
|
+
get selectedMenuId() {
|
194
|
+
return this.openMenu || '';
|
195
|
+
}
|
196
|
+
get renderSideMenu() {
|
197
|
+
const drawerState = this.menuOpened ? '' : 'hidden';
|
198
198
|
return html `
|
199
199
|
<nav>
|
200
200
|
<div class="minimized">${this.shortcuts} ${this.menuToggleButton}</div>
|
@@ -209,42 +209,42 @@ let ItemNavigator = class ItemNavigator extends LitElement {
|
|
209
209
|
></ia-menu-slider>
|
210
210
|
</div>
|
211
211
|
</nav>
|
212
|
-
`;
|
213
|
-
}
|
214
|
-
/** End Side menu */
|
215
|
-
/** Menu Shortcuts */
|
216
|
-
openShortcut(selectedMenuId = '') {
|
217
|
-
this.openMenu = selectedMenuId;
|
218
|
-
this.menuOpened = true;
|
219
|
-
}
|
220
|
-
get shortcuts() {
|
221
|
-
const shortcuts = this.menuShortcuts.map(({ icon, id }) => {
|
222
|
-
if (id === 'fullscreen') {
|
223
|
-
return html `${icon}`;
|
224
|
-
}
|
212
|
+
`;
|
213
|
+
}
|
214
|
+
/** End Side menu */
|
215
|
+
/** Menu Shortcuts */
|
216
|
+
openShortcut(selectedMenuId = '') {
|
217
|
+
this.openMenu = selectedMenuId;
|
218
|
+
this.menuOpened = true;
|
219
|
+
}
|
220
|
+
get shortcuts() {
|
221
|
+
const shortcuts = this.menuShortcuts.map(({ icon, id }) => {
|
222
|
+
if (id === 'fullscreen') {
|
223
|
+
return html `${icon}`;
|
224
|
+
}
|
225
225
|
return html `
|
226
226
|
<button class="shortcut ${id}" @click="${() => this.openShortcut(id)}">
|
227
227
|
${icon}
|
228
228
|
</button>
|
229
|
-
`;
|
230
|
-
});
|
231
|
-
return html `<div class="shortcuts">${shortcuts}</div>`;
|
232
|
-
}
|
233
|
-
/** End Menu Shortcuts */
|
234
|
-
/** Misc Render */
|
235
|
-
get menuClass() {
|
236
|
-
var _a, _b;
|
237
|
-
const hasMenuOrShortcuts = ((_a = this.menuContents) === null || _a === void 0 ? void 0 : _a.length) || ((_b = this.menuShortcuts) === null || _b === void 0 ? void 0 : _b.length);
|
238
|
-
const drawerState = this.menuOpened && hasMenuOrShortcuts ? 'open' : '';
|
239
|
-
const fullscreenState = this.viewportInFullscreen ? 'fullscreen' : '';
|
240
|
-
return `${drawerState} ${fullscreenState} ${this.openMenuState}`;
|
241
|
-
}
|
242
|
-
static get styles() {
|
243
|
-
const subnavWidth = css `var(--menuWidth, 320px)`;
|
244
|
-
const transitionTiming = css `var(--animationTiming, 200ms)`;
|
245
|
-
const transitionEffect = css `transform ${transitionTiming} ease-out`;
|
246
|
-
const menuMargin = css `var(--theaterMenuMargin, 42px)`;
|
247
|
-
const theaterBg = css `var(--theaterBgColor, #000)`;
|
229
|
+
`;
|
230
|
+
});
|
231
|
+
return html `<div class="shortcuts">${shortcuts}</div>`;
|
232
|
+
}
|
233
|
+
/** End Menu Shortcuts */
|
234
|
+
/** Misc Render */
|
235
|
+
get menuClass() {
|
236
|
+
var _a, _b;
|
237
|
+
const hasMenuOrShortcuts = ((_a = this.menuContents) === null || _a === void 0 ? void 0 : _a.length) || ((_b = this.menuShortcuts) === null || _b === void 0 ? void 0 : _b.length);
|
238
|
+
const drawerState = this.menuOpened && hasMenuOrShortcuts ? 'open' : '';
|
239
|
+
const fullscreenState = this.viewportInFullscreen ? 'fullscreen' : '';
|
240
|
+
return `${drawerState} ${fullscreenState} ${this.openMenuState}`;
|
241
|
+
}
|
242
|
+
static get styles() {
|
243
|
+
const subnavWidth = css `var(--menuWidth, 320px)`;
|
244
|
+
const transitionTiming = css `var(--animationTiming, 200ms)`;
|
245
|
+
const transitionEffect = css `transform ${transitionTiming} ease-out`;
|
246
|
+
const menuMargin = css `var(--theaterMenuMargin, 42px)`;
|
247
|
+
const theaterBg = css `var(--theaterBgColor, #000)`;
|
248
248
|
return css `
|
249
249
|
:host,
|
250
250
|
#frame,
|
@@ -409,74 +409,74 @@ let ItemNavigator = class ItemNavigator extends LitElement {
|
|
409
409
|
margin-left: ${subnavWidth};
|
410
410
|
transition: ${transitionEffect};
|
411
411
|
}
|
412
|
-
`;
|
413
|
-
}
|
414
|
-
};
|
415
|
-
__decorate([
|
416
|
-
property({
|
417
|
-
type: Object,
|
418
|
-
converter: (value) => {
|
419
|
-
if (value && typeof value === 'string') {
|
420
|
-
return new MetadataResponse(JSON.parse(atob(value)));
|
421
|
-
}
|
422
|
-
return value;
|
423
|
-
},
|
424
|
-
})
|
425
|
-
], ItemNavigator.prototype, "item", void 0);
|
426
|
-
__decorate([
|
427
|
-
property({ type: Boolean })
|
428
|
-
], ItemNavigator.prototype, "viewAvailable", void 0);
|
429
|
-
__decorate([
|
430
|
-
property({ type: String })
|
431
|
-
], ItemNavigator.prototype, "baseHost", void 0);
|
432
|
-
__decorate([
|
433
|
-
property({
|
434
|
-
converter: (arg) => {
|
435
|
-
if (typeof arg === 'boolean') {
|
436
|
-
return arg;
|
437
|
-
}
|
438
|
-
return arg === 'true';
|
439
|
-
},
|
440
|
-
})
|
441
|
-
], ItemNavigator.prototype, "signedIn", void 0);
|
442
|
-
__decorate([
|
443
|
-
property({ type: Array })
|
444
|
-
], ItemNavigator.prototype, "menuContents", void 0);
|
445
|
-
__decorate([
|
446
|
-
property({ type: Array })
|
447
|
-
], ItemNavigator.prototype, "menuShortcuts", void 0);
|
448
|
-
__decorate([
|
449
|
-
property({ type: Boolean, reflect: true, attribute: true })
|
450
|
-
], ItemNavigator.prototype, "viewportInFullscreen", void 0);
|
451
|
-
__decorate([
|
452
|
-
property({ type: Boolean })
|
453
|
-
], ItemNavigator.prototype, "menuOpened", void 0);
|
454
|
-
__decorate([
|
455
|
-
property({ type: String })
|
456
|
-
], ItemNavigator.prototype, "openMenu", void 0);
|
457
|
-
__decorate([
|
458
|
-
property({ attribute: false })
|
459
|
-
], ItemNavigator.prototype, "modal", void 0);
|
460
|
-
__decorate([
|
461
|
-
property({ attribute: false })
|
462
|
-
], ItemNavigator.prototype, "sharedObserver", void 0);
|
463
|
-
__decorate([
|
464
|
-
property({ type: Boolean, reflect: true, attribute: true })
|
465
|
-
], ItemNavigator.prototype, "loaded", void 0);
|
466
|
-
__decorate([
|
467
|
-
state()
|
468
|
-
], ItemNavigator.prototype, "openMenuState", void 0);
|
469
|
-
__decorate([
|
470
|
-
query('#frame')
|
471
|
-
], ItemNavigator.prototype, "frame", void 0);
|
472
|
-
__decorate([
|
473
|
-
query('slot[name="header"]')
|
474
|
-
], ItemNavigator.prototype, "headerSlot", void 0);
|
475
|
-
__decorate([
|
476
|
-
query('slot[name="main"]')
|
477
|
-
], ItemNavigator.prototype, "mainSlot", void 0);
|
478
|
-
ItemNavigator = __decorate([
|
479
|
-
customElement('ia-item-navigator')
|
480
|
-
], ItemNavigator);
|
481
|
-
export { ItemNavigator };
|
412
|
+
`;
|
413
|
+
}
|
414
|
+
};
|
415
|
+
__decorate([
|
416
|
+
property({
|
417
|
+
type: Object,
|
418
|
+
converter: (value) => {
|
419
|
+
if (value && typeof value === 'string') {
|
420
|
+
return new MetadataResponse(JSON.parse(atob(value)));
|
421
|
+
}
|
422
|
+
return value;
|
423
|
+
},
|
424
|
+
})
|
425
|
+
], ItemNavigator.prototype, "item", void 0);
|
426
|
+
__decorate([
|
427
|
+
property({ type: Boolean })
|
428
|
+
], ItemNavigator.prototype, "viewAvailable", void 0);
|
429
|
+
__decorate([
|
430
|
+
property({ type: String })
|
431
|
+
], ItemNavigator.prototype, "baseHost", void 0);
|
432
|
+
__decorate([
|
433
|
+
property({
|
434
|
+
converter: (arg) => {
|
435
|
+
if (typeof arg === 'boolean') {
|
436
|
+
return arg;
|
437
|
+
}
|
438
|
+
return arg === 'true';
|
439
|
+
},
|
440
|
+
})
|
441
|
+
], ItemNavigator.prototype, "signedIn", void 0);
|
442
|
+
__decorate([
|
443
|
+
property({ type: Array })
|
444
|
+
], ItemNavigator.prototype, "menuContents", void 0);
|
445
|
+
__decorate([
|
446
|
+
property({ type: Array })
|
447
|
+
], ItemNavigator.prototype, "menuShortcuts", void 0);
|
448
|
+
__decorate([
|
449
|
+
property({ type: Boolean, reflect: true, attribute: true })
|
450
|
+
], ItemNavigator.prototype, "viewportInFullscreen", void 0);
|
451
|
+
__decorate([
|
452
|
+
property({ type: Boolean })
|
453
|
+
], ItemNavigator.prototype, "menuOpened", void 0);
|
454
|
+
__decorate([
|
455
|
+
property({ type: String })
|
456
|
+
], ItemNavigator.prototype, "openMenu", void 0);
|
457
|
+
__decorate([
|
458
|
+
property({ attribute: false })
|
459
|
+
], ItemNavigator.prototype, "modal", void 0);
|
460
|
+
__decorate([
|
461
|
+
property({ attribute: false })
|
462
|
+
], ItemNavigator.prototype, "sharedObserver", void 0);
|
463
|
+
__decorate([
|
464
|
+
property({ type: Boolean, reflect: true, attribute: true })
|
465
|
+
], ItemNavigator.prototype, "loaded", void 0);
|
466
|
+
__decorate([
|
467
|
+
state()
|
468
|
+
], ItemNavigator.prototype, "openMenuState", void 0);
|
469
|
+
__decorate([
|
470
|
+
query('#frame')
|
471
|
+
], ItemNavigator.prototype, "frame", void 0);
|
472
|
+
__decorate([
|
473
|
+
query('slot[name="header"]')
|
474
|
+
], ItemNavigator.prototype, "headerSlot", void 0);
|
475
|
+
__decorate([
|
476
|
+
query('slot[name="main"]')
|
477
|
+
], ItemNavigator.prototype, "mainSlot", void 0);
|
478
|
+
ItemNavigator = __decorate([
|
479
|
+
customElement('ia-item-navigator')
|
480
|
+
], ItemNavigator);
|
481
|
+
export { ItemNavigator };
|
482
482
|
//# sourceMappingURL=item-navigator.js.map
|
package/dist/src/loader.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
export declare class IAItemNavLoader extends LitElement {
|
3
|
-
static get properties(): {
|
4
|
-
title: {
|
5
|
-
type: StringConstructor;
|
6
|
-
};
|
7
|
-
};
|
8
|
-
get bookIconSvg(): import("lit-html").TemplateResult<2>;
|
9
|
-
get icon(): import("lit-html").TemplateResult<2>;
|
10
|
-
get loader(): import("lit-html").TemplateResult<2>;
|
11
|
-
render(): import("lit-html").TemplateResult<1>;
|
12
|
-
static get styles(): import("lit").CSSResult;
|
13
|
-
}
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
export declare class IAItemNavLoader extends LitElement {
|
3
|
+
static get properties(): {
|
4
|
+
title: {
|
5
|
+
type: StringConstructor;
|
6
|
+
};
|
7
|
+
};
|
8
|
+
get bookIconSvg(): import("lit-html").TemplateResult<2>;
|
9
|
+
get icon(): import("lit-html").TemplateResult<2>;
|
10
|
+
get loader(): import("lit-html").TemplateResult<2>;
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
12
|
+
static get styles(): import("lit").CSSResult;
|
13
|
+
}
|
package/dist/src/loader.js
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
/* eslint-disable class-methods-use-this */
|
3
|
-
import { css, html, LitElement, svg, nothing } from 'lit';
|
4
|
-
import { customElement } from 'lit/decorators.js';
|
5
|
-
let IAItemNavLoader = class IAItemNavLoader extends LitElement {
|
6
|
-
static get properties() {
|
7
|
-
return {
|
8
|
-
title: { type: String },
|
9
|
-
};
|
10
|
-
}
|
11
|
-
get bookIconSvg() {
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
/* eslint-disable class-methods-use-this */
|
3
|
+
import { css, html, LitElement, svg, nothing } from 'lit';
|
4
|
+
import { customElement } from 'lit/decorators.js';
|
5
|
+
let IAItemNavLoader = class IAItemNavLoader extends LitElement {
|
6
|
+
static get properties() {
|
7
|
+
return {
|
8
|
+
title: { type: String },
|
9
|
+
};
|
10
|
+
}
|
11
|
+
get bookIconSvg() {
|
12
12
|
return svg `
|
13
13
|
<g class="bookIcon" transform="matrix(1 0 0 -1 28 67.362264)">
|
14
14
|
<path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
|
15
15
|
<path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
|
16
16
|
<path d="m17.3354713 33.5957539h-12.8337733v-25.37660316s0-.75283017.49358489-1.14113205c.52867924-.41433961 1.3415094-.42849055 1.3415094-.42849055h10.59905631s2.2075471-.52698112 3.0928301-1.39415091l1.2.00792453v26.74245214c-.8201886.8581132-2.0530188 1.59-3.8932074 1.59"/>
|
17
17
|
</g>
|
18
|
-
`;
|
19
|
-
}
|
20
|
-
get icon() {
|
21
|
-
return this.bookIconSvg;
|
22
|
-
}
|
23
|
-
get loader() {
|
18
|
+
`;
|
19
|
+
}
|
20
|
+
get icon() {
|
21
|
+
return this.bookIconSvg;
|
22
|
+
}
|
23
|
+
get loader() {
|
24
24
|
return svg `
|
25
25
|
<svg
|
26
26
|
height="100"
|
@@ -40,18 +40,18 @@ let IAItemNavLoader = class IAItemNavLoader extends LitElement {
|
|
40
40
|
/>
|
41
41
|
</g>
|
42
42
|
</svg>
|
43
|
-
`;
|
44
|
-
}
|
45
|
-
render() {
|
46
|
-
const title = this.title ? html `<h2>${this.title}</h2>` : nothing;
|
43
|
+
`;
|
44
|
+
}
|
45
|
+
render() {
|
46
|
+
const title = this.title ? html `<h2>${this.title}</h2>` : nothing;
|
47
47
|
return html `
|
48
48
|
<div class="place-holder">
|
49
49
|
${title} ${this.loader}
|
50
50
|
<h3>Loading viewer</h3>
|
51
51
|
</div>
|
52
|
-
`;
|
53
|
-
}
|
54
|
-
static get styles() {
|
52
|
+
`;
|
53
|
+
}
|
54
|
+
static get styles() {
|
55
55
|
return css `
|
56
56
|
.place-holder {
|
57
57
|
width: 30%;
|
@@ -90,11 +90,11 @@ let IAItemNavLoader = class IAItemNavLoader extends LitElement {
|
|
90
90
|
transform: rotate(-360deg);
|
91
91
|
}
|
92
92
|
}
|
93
|
-
`;
|
94
|
-
}
|
95
|
-
};
|
96
|
-
IAItemNavLoader = __decorate([
|
97
|
-
customElement('ia-itemnav-loader')
|
98
|
-
], IAItemNavLoader);
|
99
|
-
export { IAItemNavLoader };
|
93
|
+
`;
|
94
|
+
}
|
95
|
+
};
|
96
|
+
IAItemNavLoader = __decorate([
|
97
|
+
customElement('ia-itemnav-loader')
|
98
|
+
], IAItemNavLoader);
|
99
|
+
export { IAItemNavLoader };
|
100
100
|
//# sourceMappingURL=loader.js.map
|