@internetarchive/ia-item-navigator 1.1.1 → 2.0.0-alpha1
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 +4 -1
- package/dist/index.js +5 -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 +9 -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,367 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
/* eslint-disable max-classes-per-file */
|
3
|
+
/* eslint-disable lit-a11y/list */
|
4
|
+
import { css, html, LitElement, nothing } from 'lit';
|
5
|
+
import { customElement, property } from 'lit/decorators.js';
|
6
|
+
import { repeat } from 'lit/directives/repeat.js';
|
7
|
+
// sort icons
|
8
|
+
const sortAscIcon = html `
|
9
|
+
<svg
|
10
|
+
name="sort-asc"
|
11
|
+
height="18"
|
12
|
+
viewBox="0 0 18 18"
|
13
|
+
width="18"
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
15
|
+
>
|
16
|
+
<g fill="none" fill-rule="evenodd">
|
17
|
+
<path
|
18
|
+
d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
|
19
|
+
fill="#fff"
|
20
|
+
fill-rule="nonzero"
|
21
|
+
/>
|
22
|
+
<path
|
23
|
+
d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
|
24
|
+
fill="#fff"
|
25
|
+
fill-rule="nonzero"
|
26
|
+
/>
|
27
|
+
<path
|
28
|
+
d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
|
29
|
+
stroke="#fff"
|
30
|
+
stroke-linecap="round"
|
31
|
+
stroke-linejoin="round"
|
32
|
+
stroke-width="1.661538"
|
33
|
+
transform="matrix(1 0 0 -1 0 18.692308)"
|
34
|
+
/>
|
35
|
+
</g>
|
36
|
+
</svg>
|
37
|
+
`;
|
38
|
+
const sortDescIcon = html `
|
39
|
+
<svg
|
40
|
+
name="sort-desc"
|
41
|
+
height="18"
|
42
|
+
viewBox="0 0 18 18"
|
43
|
+
width="18"
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
45
|
+
>
|
46
|
+
<g fill="none" fill-rule="evenodd">
|
47
|
+
<path
|
48
|
+
d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
|
49
|
+
fill="#fff"
|
50
|
+
fill-rule="nonzero"
|
51
|
+
/>
|
52
|
+
<path
|
53
|
+
d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
|
54
|
+
fill="#fff"
|
55
|
+
fill-rule="nonzero"
|
56
|
+
/>
|
57
|
+
<path
|
58
|
+
d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
|
59
|
+
stroke="#fff"
|
60
|
+
stroke-linecap="round"
|
61
|
+
stroke-linejoin="round"
|
62
|
+
stroke-width="1.661538"
|
63
|
+
/>
|
64
|
+
</g>
|
65
|
+
</svg>
|
66
|
+
`;
|
67
|
+
const sortNeutralIcon = html `
|
68
|
+
<svg
|
69
|
+
name="sort-neutral"
|
70
|
+
height="18"
|
71
|
+
viewBox="0 0 18 18"
|
72
|
+
width="18"
|
73
|
+
xmlns="http://www.w3.org/2000/svg"
|
74
|
+
>
|
75
|
+
<g fill="#fff" fill-rule="evenodd">
|
76
|
+
<path
|
77
|
+
d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
|
78
|
+
fill-rule="nonzero"
|
79
|
+
/>
|
80
|
+
<path
|
81
|
+
d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
|
82
|
+
fill-rule="nonzero"
|
83
|
+
/>
|
84
|
+
<circle cx="13" cy="9" r="2" />
|
85
|
+
</g>
|
86
|
+
</svg>
|
87
|
+
`;
|
88
|
+
// extra components
|
89
|
+
export const viewableFilesIcon = html `
|
90
|
+
<svg
|
91
|
+
height="24"
|
92
|
+
viewBox="0 0 24 24"
|
93
|
+
width="24"
|
94
|
+
xmlns="http://www.w3.org/2000/svg"
|
95
|
+
aria-labelledby="volumesTitleID volumesDescID"
|
96
|
+
>
|
97
|
+
<title id="volumesTitleID">Viewable Files</title>
|
98
|
+
<g fill="#ffffff">
|
99
|
+
<path
|
100
|
+
fill="#ffffff"
|
101
|
+
d="m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z"
|
102
|
+
/>
|
103
|
+
</g>
|
104
|
+
</svg>
|
105
|
+
`;
|
106
|
+
let IauxSortFilesButton = class IauxSortFilesButton extends LitElement {
|
107
|
+
constructor() {
|
108
|
+
super(...arguments);
|
109
|
+
this.fileListRaw = [];
|
110
|
+
this.fileListSorted = [];
|
111
|
+
this.sortOrderBy = 'default';
|
112
|
+
}
|
113
|
+
render() {
|
114
|
+
return html `<div class="sort-multi-file-list">${this.sortButton}</div>`;
|
115
|
+
}
|
116
|
+
get sortButton() {
|
117
|
+
const sortIcons = {
|
118
|
+
default: html `
|
119
|
+
<button
|
120
|
+
class="sort-by neutral-icon"
|
121
|
+
aria-label="Sort volumes in initial order"
|
122
|
+
@click=${() => this.sortVolumes('title_asc')}
|
123
|
+
>
|
124
|
+
${sortNeutralIcon}
|
125
|
+
</button>
|
126
|
+
`,
|
127
|
+
title_asc: html `
|
128
|
+
<button
|
129
|
+
class="sort-by asc-icon"
|
130
|
+
aria-label="Sort volumes in ascending order"
|
131
|
+
@click=${() => this.sortVolumes('title_desc')}
|
132
|
+
>
|
133
|
+
${sortAscIcon}
|
134
|
+
</button>
|
135
|
+
`,
|
136
|
+
title_desc: html `
|
137
|
+
<button
|
138
|
+
class="sort-by desc-icon"
|
139
|
+
aria-label="Sort volumes in descending order"
|
140
|
+
@click=${() => this.sortVolumes('default')}
|
141
|
+
>
|
142
|
+
${sortDescIcon}
|
143
|
+
</button>
|
144
|
+
`,
|
145
|
+
};
|
146
|
+
return sortIcons[this.sortOrderBy];
|
147
|
+
}
|
148
|
+
sortVolumes(sortType) {
|
149
|
+
this.sortOrderBy = sortType;
|
150
|
+
let sortedFiles = [];
|
151
|
+
sortedFiles = this.fileListRaw.sort((a, b) => {
|
152
|
+
if (sortType === 'title_asc')
|
153
|
+
return a.title.localeCompare(b.title);
|
154
|
+
if (sortType === 'title_desc')
|
155
|
+
return b.title.localeCompare(a.title);
|
156
|
+
return a.orig_sort - b.orig_sort;
|
157
|
+
});
|
158
|
+
this.dispatchEvent(new CustomEvent('fileListSorted', {
|
159
|
+
detail: {
|
160
|
+
sortType,
|
161
|
+
sortedFiles,
|
162
|
+
},
|
163
|
+
bubbles: true,
|
164
|
+
composed: true,
|
165
|
+
}));
|
166
|
+
this.fileListSorted = sortedFiles;
|
167
|
+
}
|
168
|
+
static get styles() {
|
169
|
+
return css `
|
170
|
+
button.sort-by {
|
171
|
+
padding: 0px;
|
172
|
+
background-color: transparent;
|
173
|
+
border: 0px;
|
174
|
+
--iconWidth: var(--menuSliderHeaderIconWidth);
|
175
|
+
--iconHeight: var(--menuSliderHeaderIconHeight);
|
176
|
+
}
|
177
|
+
`;
|
178
|
+
}
|
179
|
+
};
|
180
|
+
__decorate([
|
181
|
+
property({ type: Array })
|
182
|
+
], IauxSortFilesButton.prototype, "fileListRaw", void 0);
|
183
|
+
__decorate([
|
184
|
+
property({ type: Array })
|
185
|
+
], IauxSortFilesButton.prototype, "fileListSorted", void 0);
|
186
|
+
__decorate([
|
187
|
+
property({ type: String })
|
188
|
+
], IauxSortFilesButton.prototype, "sortOrderBy", void 0);
|
189
|
+
IauxSortFilesButton = __decorate([
|
190
|
+
customElement('iaux-sort-viewable-files')
|
191
|
+
], IauxSortFilesButton);
|
192
|
+
export { IauxSortFilesButton };
|
193
|
+
let IauxViewableFiles = class IauxViewableFiles extends LitElement {
|
194
|
+
constructor() {
|
195
|
+
super(...arguments);
|
196
|
+
this.hostUrl = 'archive.org';
|
197
|
+
this.sortOrderBy = 'default';
|
198
|
+
this.subPrefix = '';
|
199
|
+
this.fileList = [];
|
200
|
+
}
|
201
|
+
firstUpdated() {
|
202
|
+
const activeFile = this.shadowRoot.querySelector('.content.active');
|
203
|
+
// allow for css animations to run before scrolling to active file
|
204
|
+
setTimeout(() => {
|
205
|
+
// scroll active file into view if needed
|
206
|
+
// note: `scrollIntoViewIfNeeded` handles auto-scroll gracefully for Chrome, Safari
|
207
|
+
// Firefox does not have this capability yet as it does not support `scrollIntoViewIfNeeded`
|
208
|
+
activeFile === null || activeFile === void 0 ? void 0 : activeFile.scrollIntoViewIfNeeded(true);
|
209
|
+
// Todo: support `scrollIntoView` or `parentContainer.crollTop = x` for FF & "IE 11"
|
210
|
+
// currently, the hard `position: absolutes` misaligns subpanel when `scrollIntoView` is applied :(
|
211
|
+
}, 350);
|
212
|
+
}
|
213
|
+
volumeItemWithImageTitle(item) {
|
214
|
+
const hrefUrl = this.sortOrderBy === 'default'
|
215
|
+
? `${this.hostUrl}${item.url_path}`
|
216
|
+
: `${this.hostUrl}${item.url_path}?sort=${this.sortOrderBy}`;
|
217
|
+
return html `
|
218
|
+
<li class="content active">
|
219
|
+
<div class="separator"></div>
|
220
|
+
<a class="container" href="${hrefUrl}">
|
221
|
+
<div class="image">
|
222
|
+
<img src="${item.image}" alt="preview" />
|
223
|
+
</div>
|
224
|
+
<div class="text">
|
225
|
+
<p class="item-title">${item.title}</p>
|
226
|
+
<small>by: ${item.author}</small>
|
227
|
+
</div>
|
228
|
+
</a>
|
229
|
+
</li>
|
230
|
+
`;
|
231
|
+
}
|
232
|
+
fileLi(item) {
|
233
|
+
const activeClass = this.subPrefix === item.file_subprefix ? ' active' : '';
|
234
|
+
const hrefUrl = this.sortOrderBy === 'default'
|
235
|
+
? `${this.hostUrl}${item.url_path}`
|
236
|
+
: `${this.hostUrl}${item.url_path}?sort=${this.sortOrderBy}`;
|
237
|
+
return html `
|
238
|
+
<li>
|
239
|
+
<div class="separator"></div>
|
240
|
+
<div class="content${activeClass}">
|
241
|
+
<a href="https://${hrefUrl}">
|
242
|
+
<p class="item-title">${item.title}</p>
|
243
|
+
</a>
|
244
|
+
</div>
|
245
|
+
</li>
|
246
|
+
`;
|
247
|
+
}
|
248
|
+
get fileListTemplate() {
|
249
|
+
const filesDisplay = repeat(this.fileList, file => file === null || file === void 0 ? void 0 : file.file_prefix, this.fileLi.bind(this));
|
250
|
+
return html `
|
251
|
+
<ul>
|
252
|
+
${filesDisplay}
|
253
|
+
<div class="separator"></div>
|
254
|
+
</ul>
|
255
|
+
`;
|
256
|
+
}
|
257
|
+
render() {
|
258
|
+
return html ` ${this.fileList.length ? this.fileListTemplate : nothing} `;
|
259
|
+
}
|
260
|
+
static get styles() {
|
261
|
+
return css `
|
262
|
+
:host {
|
263
|
+
display: block;
|
264
|
+
overflow-y: auto;
|
265
|
+
box-sizing: border-box;
|
266
|
+
color: var(--primaryTextColor);
|
267
|
+
margin-top: 14px;
|
268
|
+
margin-bottom: 2rem;
|
269
|
+
--activeBorderWidth: 2px;
|
270
|
+
}
|
271
|
+
|
272
|
+
a {
|
273
|
+
color: #ffffff;
|
274
|
+
text-decoration: none;
|
275
|
+
}
|
276
|
+
|
277
|
+
img {
|
278
|
+
width: 35px;
|
279
|
+
height: 45px;
|
280
|
+
}
|
281
|
+
|
282
|
+
ul {
|
283
|
+
padding: 0;
|
284
|
+
list-style: none;
|
285
|
+
margin: var(--activeBorderWidth) 0.5rem 1rem 0;
|
286
|
+
}
|
287
|
+
|
288
|
+
ul > li:first-child .separator {
|
289
|
+
display: none;
|
290
|
+
}
|
291
|
+
|
292
|
+
li {
|
293
|
+
cursor: pointer;
|
294
|
+
outline: none;
|
295
|
+
position: relative;
|
296
|
+
}
|
297
|
+
|
298
|
+
li .content {
|
299
|
+
padding: 2px 0 4px 2px;
|
300
|
+
border: var(--activeBorderWidth) solid transparent;
|
301
|
+
padding: 0.2rem 0 0.4rem 0.2rem;
|
302
|
+
}
|
303
|
+
|
304
|
+
li .content.active {
|
305
|
+
border: var(--activeBorderWidth) solid #538bc5;
|
306
|
+
}
|
307
|
+
|
308
|
+
small {
|
309
|
+
font-style: italic;
|
310
|
+
white-space: initial;
|
311
|
+
}
|
312
|
+
|
313
|
+
.container {
|
314
|
+
display: flex;
|
315
|
+
align-items: center;
|
316
|
+
justify-content: center;
|
317
|
+
}
|
318
|
+
|
319
|
+
.item-title {
|
320
|
+
margin-block-start: 0em;
|
321
|
+
margin-block-end: 0em;
|
322
|
+
font-size: 14px;
|
323
|
+
font-weight: bold;
|
324
|
+
word-wrap: break-word;
|
325
|
+
padding-left: 5px;
|
326
|
+
}
|
327
|
+
|
328
|
+
.separator {
|
329
|
+
background-color: var(--secondaryBGColor);
|
330
|
+
width: 98%;
|
331
|
+
margin: 1px auto;
|
332
|
+
height: 1px;
|
333
|
+
}
|
334
|
+
|
335
|
+
.text {
|
336
|
+
padding-left: 10px;
|
337
|
+
}
|
338
|
+
|
339
|
+
.icon {
|
340
|
+
display: inline-block;
|
341
|
+
width: 14px;
|
342
|
+
height: 14px;
|
343
|
+
margin-left: 0.7rem;
|
344
|
+
border: 1px solid var(--primaryTextColor);
|
345
|
+
border-radius: 2px;
|
346
|
+
background: var(--activeButtonBg) 50% 50% no-repeat;
|
347
|
+
}
|
348
|
+
`;
|
349
|
+
}
|
350
|
+
};
|
351
|
+
__decorate([
|
352
|
+
property({ type: String })
|
353
|
+
], IauxViewableFiles.prototype, "hostUrl", void 0);
|
354
|
+
__decorate([
|
355
|
+
property({ type: String })
|
356
|
+
], IauxViewableFiles.prototype, "sortOrderBy", void 0);
|
357
|
+
__decorate([
|
358
|
+
property({ type: String })
|
359
|
+
], IauxViewableFiles.prototype, "subPrefix", void 0);
|
360
|
+
__decorate([
|
361
|
+
property({ type: Array })
|
362
|
+
], IauxViewableFiles.prototype, "fileList", void 0);
|
363
|
+
IauxViewableFiles = __decorate([
|
364
|
+
customElement('iaux-viewable-files')
|
365
|
+
], IauxViewableFiles);
|
366
|
+
export { IauxViewableFiles };
|
367
|
+
//# sourceMappingURL=iaux-viewable-files.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iaux-viewable-files.js","sourceRoot":"","sources":["../../../src/menus/iaux-viewable-files.ts"],"names":[],"mappings":"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","sourcesContent":["/* eslint-disable max-classes-per-file */\n/* eslint-disable lit-a11y/list */\nimport { css, html, LitElement, nothing, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\n\n// sort icons\nconst sortAscIcon = html`\n <svg\n name=\"sort-asc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n transform=\"matrix(1 0 0 -1 0 18.692308)\"\n />\n </g>\n </svg>\n`;\nconst sortDescIcon = html`\n <svg\n name=\"sort-desc\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill=\"#fff\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612\"\n stroke=\"#fff\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.661538\"\n />\n </g>\n </svg>\n`;\nconst sortNeutralIcon = html`\n <svg\n name=\"sort-neutral\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g fill=\"#fff\" fill-rule=\"evenodd\">\n <path\n d=\"m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z\"\n fill-rule=\"nonzero\"\n />\n <path\n d=\"m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z\"\n fill-rule=\"nonzero\"\n />\n <circle cx=\"13\" cy=\"9\" r=\"2\" />\n </g>\n </svg>\n`;\n\n// extra components\nexport const viewableFilesIcon = html`\n <svg\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"volumesTitleID volumesDescID\"\n >\n <title id=\"volumesTitleID\">Viewable Files</title>\n <g fill=\"#ffffff\">\n <path\n fill=\"#ffffff\"\n d=\"m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z\"\n />\n </g>\n </svg>\n`;\n\ntype sortOptions = 'title_asc' | 'title_desc' | 'default';\n\ntype ItemInfo = {\n url_path: string;\n image: string;\n title: string;\n author: string;\n file_subprefix: string;\n};\n\n@customElement('iaux-sort-viewable-files')\nexport class IauxSortFilesButton extends LitElement {\n @property({ type: Array }) fileListRaw: any[] = [];\n\n @property({ type: Array }) fileListSorted: any[] = [];\n\n @property({ type: String }) sortOrderBy: sortOptions = 'default';\n\n render() {\n return html`<div class=\"sort-multi-file-list\">${this.sortButton}</div>`;\n }\n\n get sortButton() {\n const sortIcons = {\n default: html`\n <button\n class=\"sort-by neutral-icon\"\n aria-label=\"Sort volumes in initial order\"\n @click=${() => this.sortVolumes('title_asc')}\n >\n ${sortNeutralIcon}\n </button>\n `,\n title_asc: html`\n <button\n class=\"sort-by asc-icon\"\n aria-label=\"Sort volumes in ascending order\"\n @click=${() => this.sortVolumes('title_desc')}\n >\n ${sortAscIcon}\n </button>\n `,\n title_desc: html`\n <button\n class=\"sort-by desc-icon\"\n aria-label=\"Sort volumes in descending order\"\n @click=${() => this.sortVolumes('default')}\n >\n ${sortDescIcon}\n </button>\n `,\n };\n\n return sortIcons[this.sortOrderBy];\n }\n\n sortVolumes(sortType: sortOptions) {\n this.sortOrderBy = sortType;\n let sortedFiles = [];\n\n sortedFiles = this.fileListRaw.sort((a, b) => {\n if (sortType === 'title_asc') return a.title.localeCompare(b.title);\n if (sortType === 'title_desc') return b.title.localeCompare(a.title);\n return a.orig_sort - b.orig_sort;\n });\n\n this.dispatchEvent(\n new CustomEvent('fileListSorted', {\n detail: {\n sortType,\n sortedFiles,\n },\n bubbles: true,\n composed: true,\n }),\n );\n this.fileListSorted = sortedFiles;\n }\n\n static get styles() {\n return css`\n button.sort-by {\n padding: 0px;\n background-color: transparent;\n border: 0px;\n --iconWidth: var(--menuSliderHeaderIconWidth);\n --iconHeight: var(--menuSliderHeaderIconHeight);\n }\n `;\n }\n}\n\n@customElement('iaux-viewable-files')\nexport class IauxViewableFiles extends LitElement {\n @property({ type: String }) hostUrl: string = 'archive.org';\n\n @property({ type: String }) sortOrderBy:\n | 'default'\n | 'title_asc'\n | 'title_desc' = 'default';\n\n @property({ type: String }) subPrefix: string = '';\n\n @property({ type: Array }) fileList: any[] = [];\n\n firstUpdated() {\n const activeFile = this.shadowRoot!.querySelector('.content.active') as any;\n // allow for css animations to run before scrolling to active file\n setTimeout(() => {\n // scroll active file into view if needed\n // note: `scrollIntoViewIfNeeded` handles auto-scroll gracefully for Chrome, Safari\n // Firefox does not have this capability yet as it does not support `scrollIntoViewIfNeeded`\n activeFile?.scrollIntoViewIfNeeded(true);\n\n // Todo: support `scrollIntoView` or `parentContainer.crollTop = x` for FF & \"IE 11\"\n // currently, the hard `position: absolutes` misaligns subpanel when `scrollIntoView` is applied :(\n }, 350);\n }\n\n volumeItemWithImageTitle(item: ItemInfo) {\n const hrefUrl =\n this.sortOrderBy === 'default'\n ? `${this.hostUrl}${item.url_path}`\n : `${this.hostUrl}${item.url_path}?sort=${this.sortOrderBy}`;\n\n return html`\n <li class=\"content active\">\n <div class=\"separator\"></div>\n <a class=\"container\" href=\"${hrefUrl}\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"preview\" />\n </div>\n <div class=\"text\">\n <p class=\"item-title\">${item.title}</p>\n <small>by: ${item.author}</small>\n </div>\n </a>\n </li>\n `;\n }\n\n fileLi(item: ItemInfo) {\n const activeClass = this.subPrefix === item.file_subprefix ? ' active' : '';\n\n const hrefUrl =\n this.sortOrderBy === 'default'\n ? `${this.hostUrl}${item.url_path}`\n : `${this.hostUrl}${item.url_path}?sort=${this.sortOrderBy}`;\n\n return html`\n <li>\n <div class=\"separator\"></div>\n <div class=\"content${activeClass}\">\n <a href=\"https://${hrefUrl}\">\n <p class=\"item-title\">${item.title}</p>\n </a>\n </div>\n </li>\n `;\n }\n\n get fileListTemplate(): TemplateResult {\n const filesDisplay = repeat(\n this.fileList,\n file => file?.file_prefix,\n this.fileLi.bind(this),\n );\n return html`\n <ul>\n ${filesDisplay}\n <div class=\"separator\"></div>\n </ul>\n `;\n }\n\n render() {\n return html` ${this.fileList.length ? this.fileListTemplate : nothing} `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-top: 14px;\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n a {\n color: #ffffff;\n text-decoration: none;\n }\n\n img {\n width: 35px;\n height: 45px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n\n ul > li:first-child .separator {\n display: none;\n }\n\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: 0.2rem 0 0.4rem 0.2rem;\n }\n\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n small {\n font-style: italic;\n white-space: initial;\n }\n\n .container {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .item-title {\n margin-block-start: 0em;\n margin-block-end: 0em;\n font-size: 14px;\n font-weight: bold;\n word-wrap: break-word;\n padding-left: 5px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n .text {\n padding-left: 10px;\n }\n\n .icon {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: 0.7rem;\n border: 1px solid var(--primaryTextColor);\n border-radius: 2px;\n background: var(--activeButtonBg) 50% 50% no-repeat;\n }\n `;\n }\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@internetarchive/icon-email/icon-email';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
import type { ProviderParams } from './share-provider-interface';
|
5
|
+
export default class extends Provider {
|
6
|
+
name: string;
|
7
|
+
icon: TemplateResult;
|
8
|
+
class: string;
|
9
|
+
constructor(params: ProviderParams);
|
10
|
+
get url(): string;
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import '@internetarchive/icon-email/icon-email';
|
2
|
+
import { html } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
export default class extends Provider {
|
5
|
+
constructor(params) {
|
6
|
+
super(params);
|
7
|
+
this.name = 'Email';
|
8
|
+
this.icon = html `<ia-icon-email></ia-icon-email>`;
|
9
|
+
this.class = 'email';
|
10
|
+
}
|
11
|
+
get url() {
|
12
|
+
return `mailto:?body=https://${this.baseHost}/details/${this.itemPath}&subject=${this.description} : ${this.creator}${this.promoCopy}`;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=email.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/email.ts"],"names":[],"mappings":"AAAA,OAAO,wCAAwC,CAAC;AAChD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,OAAO,MAAO,SAAQ,QAAQ;IAOnC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA,iCAAiC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;IACvB,CAAC;IAED,IAAa,GAAG;QACd,OAAO,wBAAwB,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,WAAW,MAAM,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IACzI,CAAC;CACF","sourcesContent":["import '@internetarchive/icon-email/icon-email';\nimport { TemplateResult, html } from 'lit';\nimport Provider from './provider';\nimport type { ProviderParams } from './share-provider-interface';\n\nexport default class extends Provider {\n name: string;\n\n icon: TemplateResult;\n\n class: string;\n\n constructor(params: ProviderParams) {\n super(params);\n this.name = 'Email';\n this.icon = html`<ia-icon-email></ia-icon-email>`;\n this.class = 'email';\n }\n\n override get url(): string {\n return `mailto:?body=https://${this.baseHost}/details/${this.itemPath}&subject=${this.description} : ${this.creator}${this.promoCopy}`;\n }\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@internetarchive/icon-facebook/icon-facebook';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
import type { ProviderParams } from './share-provider-interface';
|
5
|
+
export default class extends Provider {
|
6
|
+
name: string;
|
7
|
+
icon: TemplateResult;
|
8
|
+
class: string;
|
9
|
+
constructor(params: ProviderParams);
|
10
|
+
get url(): string;
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import '@internetarchive/icon-facebook/icon-facebook';
|
2
|
+
import { html } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
export default class extends Provider {
|
5
|
+
constructor(params) {
|
6
|
+
super(params);
|
7
|
+
this.name = 'Facebook';
|
8
|
+
this.icon = html `<ia-icon-facebook></ia-icon-facebook>`;
|
9
|
+
this.class = 'facebook';
|
10
|
+
}
|
11
|
+
get url() {
|
12
|
+
return `https://www.facebook.com/sharer/sharer.php?u=https://${this.baseHost}/details/${this.itemPath}`;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=facebook.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/facebook.ts"],"names":[],"mappings":"AAAA,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,OAAO,MAAO,SAAQ,QAAQ;IAOnC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA,uCAAuC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;IAC1B,CAAC;IAED,IAAa,GAAG;QACd,OAAO,wDAAwD,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC1G,CAAC;CACF","sourcesContent":["import '@internetarchive/icon-facebook/icon-facebook';\nimport { TemplateResult, html } from 'lit';\nimport Provider from './provider';\nimport type { ProviderParams } from './share-provider-interface';\n\nexport default class extends Provider {\n name: string;\n\n icon: TemplateResult;\n\n class: string;\n\n constructor(params: ProviderParams) {\n super(params);\n this.name = 'Facebook';\n this.icon = html`<ia-icon-facebook></ia-icon-facebook>`;\n this.class = 'facebook';\n }\n\n override get url(): string {\n return `https://www.facebook.com/sharer/sharer.php?u=https://${this.baseHost}/details/${this.itemPath}`;\n }\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@internetarchive/icon-pinterest/icon-pinterest';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
import { ProviderParams } from './share-provider-interface';
|
5
|
+
export default class extends Provider {
|
6
|
+
name: string;
|
7
|
+
icon: TemplateResult;
|
8
|
+
class: string;
|
9
|
+
constructor(params: ProviderParams);
|
10
|
+
get url(): string;
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import '@internetarchive/icon-pinterest/icon-pinterest';
|
2
|
+
import { html } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
export default class extends Provider {
|
5
|
+
constructor(params) {
|
6
|
+
super(params);
|
7
|
+
this.name = 'Pinterest';
|
8
|
+
this.icon = html `<ia-icon-pinterest></ia-icon-pinterest>`;
|
9
|
+
this.class = 'pinterest';
|
10
|
+
}
|
11
|
+
get url() {
|
12
|
+
return `http://www.pinterest.com/pin/create/button/?url=https://${this.baseHost}/details/${this.itemPath}&description=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=pinterest.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pinterest.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,gDAAgD,CAAC;AACxD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,OAAO,MAAO,SAAQ,QAAQ;IAOnC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA,yCAAyC,CAAC;QAC1D,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;IAC3B,CAAC;IAED,IAAa,GAAG;QACd,OAAO,2DAA2D,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,QAAQ,gBAAgB,IAAI,CAAC,kBAAkB,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACvM,CAAC;CACF","sourcesContent":["import '@internetarchive/icon-pinterest/icon-pinterest';\nimport { TemplateResult, html } from 'lit';\nimport Provider from './provider';\nimport { ProviderParams } from './share-provider-interface';\n\nexport default class extends Provider {\n name: string;\n\n icon: TemplateResult;\n\n class: string;\n\n constructor(params: ProviderParams) {\n super(params);\n this.name = 'Pinterest';\n this.icon = html`<ia-icon-pinterest></ia-icon-pinterest>`;\n this.class = 'pinterest';\n }\n\n override get url(): string {\n return `http://www.pinterest.com/pin/create/button/?url=https://${this.baseHost}/details/${this.itemPath}&description=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;\n }\n}\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { TemplateResult } from 'lit';
|
2
|
+
import { ProviderParams } from './share-provider-interface';
|
3
|
+
export default class Provider {
|
4
|
+
promoCopy: string;
|
5
|
+
description: string;
|
6
|
+
creator: string;
|
7
|
+
fileSubPrefix: string;
|
8
|
+
identifier: string;
|
9
|
+
baseHost: string;
|
10
|
+
name: string | undefined;
|
11
|
+
icon: TemplateResult | string | undefined;
|
12
|
+
class: string | undefined;
|
13
|
+
constructor(params: ProviderParams);
|
14
|
+
get encodedDescription(): string;
|
15
|
+
get encodedCreator(): string;
|
16
|
+
get encodedPromoCopy(): string;
|
17
|
+
get itemPath(): string;
|
18
|
+
get url(): string;
|
19
|
+
encodeString(str: string): string;
|
20
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
export default class Provider {
|
2
|
+
constructor(params) {
|
3
|
+
this.promoCopy =
|
4
|
+
' : Free Download, Borrow, and Streaming : Internet Archive';
|
5
|
+
this.description = (params === null || params === void 0 ? void 0 : params.description) || '';
|
6
|
+
this.creator = (params === null || params === void 0 ? void 0 : params.creator) || '';
|
7
|
+
this.fileSubPrefix = (params === null || params === void 0 ? void 0 : params.fileSubPrefix) || '';
|
8
|
+
this.identifier = (params === null || params === void 0 ? void 0 : params.identifier) || '';
|
9
|
+
this.baseHost = (params === null || params === void 0 ? void 0 : params.baseHost) || '';
|
10
|
+
}
|
11
|
+
get encodedDescription() {
|
12
|
+
return this.encodeString(this.description);
|
13
|
+
}
|
14
|
+
get encodedCreator() {
|
15
|
+
return this.encodeString(this.creator);
|
16
|
+
}
|
17
|
+
get encodedPromoCopy() {
|
18
|
+
return this.encodeString(this.promoCopy);
|
19
|
+
}
|
20
|
+
get itemPath() {
|
21
|
+
const encodedFileSubPrefix = this.fileSubPrefix
|
22
|
+
? encodeURIComponent(this.fileSubPrefix)
|
23
|
+
: '';
|
24
|
+
return encodedFileSubPrefix
|
25
|
+
? `${this.identifier}/${encodedFileSubPrefix}`
|
26
|
+
: this.identifier;
|
27
|
+
}
|
28
|
+
get url() {
|
29
|
+
return `https://${this.baseHost}/details/${this.itemPath}`;
|
30
|
+
}
|
31
|
+
encodeString(str) {
|
32
|
+
if (!str)
|
33
|
+
return '';
|
34
|
+
return encodeURIComponent(str.replace(/\s/g, '+')).replace(/%2B/g, '+');
|
35
|
+
}
|
36
|
+
}
|
37
|
+
//# sourceMappingURL=provider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/provider.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,QAAQ;IAmB3B,YAAY,MAAsB;QAChC,IAAI,CAAC,SAAS;YACZ,4DAA4D,CAAC;QAE/D,IAAI,CAAC,WAAW,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,KAAI,EAAE,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,KAAI,EAAE,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,KAAI,EAAE,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,KAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,KAAI,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,QAAQ;QACV,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa;YAC7C,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC;YACxC,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,oBAAoB;YACzB,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,IAAI,oBAAoB,EAAE;YAC9C,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IACtB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,WAAW,IAAI,CAAC,QAAQ,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7D,CAAC;IAED,YAAY,CAAC,GAAW;QACtB,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAC;QACpB,OAAO,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1E,CAAC;CACF","sourcesContent":["import { TemplateResult } from 'lit';\nimport { ProviderParams } from './share-provider-interface';\n\nexport default class Provider {\n promoCopy: string;\n\n description: string;\n\n creator: string;\n\n fileSubPrefix: string;\n\n identifier: string;\n\n baseHost: string;\n\n name: string | undefined;\n\n icon: TemplateResult | string | undefined;\n\n class: string | undefined;\n\n constructor(params: ProviderParams) {\n this.promoCopy =\n ' : Free Download, Borrow, and Streaming : Internet Archive';\n\n this.description = params?.description || '';\n this.creator = params?.creator || '';\n this.fileSubPrefix = params?.fileSubPrefix || '';\n this.identifier = params?.identifier || '';\n this.baseHost = params?.baseHost || '';\n }\n\n get encodedDescription(): string {\n return this.encodeString(this.description);\n }\n\n get encodedCreator(): string {\n return this.encodeString(this.creator);\n }\n\n get encodedPromoCopy(): string {\n return this.encodeString(this.promoCopy);\n }\n\n get itemPath(): string {\n const encodedFileSubPrefix = this.fileSubPrefix\n ? encodeURIComponent(this.fileSubPrefix)\n : '';\n return encodedFileSubPrefix\n ? `${this.identifier}/${encodedFileSubPrefix}`\n : this.identifier;\n }\n\n get url(): string {\n return `https://${this.baseHost}/details/${this.itemPath}`;\n }\n\n encodeString(str: string): string {\n if (!str) return '';\n return encodeURIComponent(str.replace(/\\s/g, '+')).replace(/%2B/g, '+');\n }\n}\n"]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { TemplateResult } from 'lit';
|
2
|
+
export type ProviderParams = {
|
3
|
+
class: string;
|
4
|
+
icon: TemplateResult | string;
|
5
|
+
name: string;
|
6
|
+
promoCopy: string;
|
7
|
+
description: string;
|
8
|
+
creator: string;
|
9
|
+
fileSubPrefix: string;
|
10
|
+
identifier: string;
|
11
|
+
baseHost: string;
|
12
|
+
itemPath: string;
|
13
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"share-provider-interface.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/share-provider-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { TemplateResult } from 'lit';\n\nexport type ProviderParams = {\n class: string;\n icon: TemplateResult | string;\n name: string;\n\n promoCopy: string;\n description: string;\n creator: string;\n\n // ia item\n fileSubPrefix: string;\n identifier: string;\n baseHost: string;\n itemPath: string;\n};\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@internetarchive/icon-tumblr/icon-tumblr';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
import { ProviderParams } from './share-provider-interface';
|
5
|
+
export default class extends Provider {
|
6
|
+
name: string;
|
7
|
+
icon: TemplateResult;
|
8
|
+
class: string;
|
9
|
+
constructor(params: ProviderParams);
|
10
|
+
get url(): string;
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import '@internetarchive/icon-tumblr/icon-tumblr';
|
2
|
+
import { html } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
export default class extends Provider {
|
5
|
+
constructor(params) {
|
6
|
+
super(params);
|
7
|
+
this.name = 'Tumblr';
|
8
|
+
this.icon = html `<ia-icon-tumblr></ia-icon-tumblr>`;
|
9
|
+
this.class = 'tumblr';
|
10
|
+
}
|
11
|
+
get url() {
|
12
|
+
return `https://www.tumblr.com/share/video?embed=%3Ciframe+width%3D%22640%22+height%3D%22480%22+frameborder%3D%220%22+allowfullscreen+src%3D%22https%3A%2F%2F${this.baseHost}%2Fembed%2F%22+webkitallowfullscreen%3D%22true%22+mozallowfullscreen%3D%22true%22%26gt%3B%26lt%3B%2Fiframe%3E&name=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=tumblr.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tumblr.js","sourceRoot":"","sources":["../../../../src/menus/share-providers/tumblr.ts"],"names":[],"mappings":"AAAA,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,OAAO,MAAO,SAAQ,QAAQ;IAOnC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA,mCAAmC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;IAED,IAAa,GAAG;QACd,OAAO,wJAAwJ,IAAI,CAAC,QAAQ,sHAAsH,IAAI,CAAC,kBAAkB,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjX,CAAC;CACF","sourcesContent":["import '@internetarchive/icon-tumblr/icon-tumblr';\nimport { TemplateResult, html } from 'lit';\nimport Provider from './provider';\nimport { ProviderParams } from './share-provider-interface';\n\nexport default class extends Provider {\n name: string;\n\n icon: TemplateResult;\n\n class: string;\n\n constructor(params: ProviderParams) {\n super(params);\n this.name = 'Tumblr';\n this.icon = html`<ia-icon-tumblr></ia-icon-tumblr>`;\n this.class = 'tumblr';\n }\n\n override get url(): string {\n return `https://www.tumblr.com/share/video?embed=%3Ciframe+width%3D%22640%22+height%3D%22480%22+frameborder%3D%220%22+allowfullscreen+src%3D%22https%3A%2F%2F${this.baseHost}%2Fembed%2F%22+webkitallowfullscreen%3D%22true%22+mozallowfullscreen%3D%22true%22%26gt%3B%26lt%3B%2Fiframe%3E&name=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`;\n }\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@internetarchive/icon-twitter/icon-twitter';
|
2
|
+
import { TemplateResult } from 'lit';
|
3
|
+
import Provider from './provider';
|
4
|
+
import { ProviderParams } from './share-provider-interface';
|
5
|
+
export default class TwitterProvider extends Provider {
|
6
|
+
name: string;
|
7
|
+
icon: TemplateResult;
|
8
|
+
class: string;
|
9
|
+
constructor(params: ProviderParams);
|
10
|
+
get url(): string;
|
11
|
+
}
|