@dudgy/podcast-widget 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -3
- package/dist/index.cjs +189 -103
- package/dist/index.d.cts +31 -5
- package/dist/index.d.ts +31 -5
- package/dist/index.js +158 -72
- package/dist/podcast-player.css +138 -36
- package/package.json +5 -2
package/dist/podcast-player.css
CHANGED
|
@@ -30,6 +30,42 @@
|
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* Artwork slot — placeholder note icon, with the image layered on top.
|
|
34
|
+
A missing or broken image is hidden, revealing the placeholder. */
|
|
35
|
+
.pw-art {
|
|
36
|
+
position: relative;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
background: rgba(var(--player-on-surface-rgb, 128, 128, 128), 0.12);
|
|
43
|
+
color: var(--player-on-surface-variant);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pw-art > svg {
|
|
47
|
+
width: 45%;
|
|
48
|
+
height: 45%;
|
|
49
|
+
opacity: 0.6;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pw-art > img {
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: 0;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
object-fit: cover;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pw-art > img[hidden] {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Don't show the placeholder through transparent artwork */
|
|
65
|
+
.pw-art > img:not([hidden]) + svg {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
33
69
|
/* ================================================================
|
|
34
70
|
MINI PLAYER
|
|
35
71
|
================================================================ */
|
|
@@ -41,16 +77,17 @@
|
|
|
41
77
|
padding: 0 12px;
|
|
42
78
|
flex: 1;
|
|
43
79
|
min-width: 0;
|
|
80
|
+
/* Fill the container's height so content centres vertically. min-height, not
|
|
81
|
+
height: a percentage height can't resolve in a container with only a
|
|
82
|
+
min-height, and would also stop a flex container stretching this row. */
|
|
83
|
+
min-height: 100%;
|
|
44
84
|
position: relative;
|
|
45
85
|
}
|
|
46
86
|
|
|
47
87
|
.pw-mini-artwork {
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
50
|
-
border-radius:
|
|
51
|
-
object-fit: cover;
|
|
52
|
-
flex-shrink: 0;
|
|
53
|
-
box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
|
|
88
|
+
width: 44px;
|
|
89
|
+
height: 44px;
|
|
90
|
+
border-radius: 6px;
|
|
54
91
|
}
|
|
55
92
|
|
|
56
93
|
.pw-mini-info {
|
|
@@ -90,12 +127,30 @@
|
|
|
90
127
|
top: 0;
|
|
91
128
|
left: 0;
|
|
92
129
|
right: 0;
|
|
93
|
-
height:
|
|
130
|
+
height: 2px;
|
|
94
131
|
background: var(--player-outline-variant);
|
|
95
132
|
cursor: pointer;
|
|
133
|
+
transition: height 120ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Invisible hit area so the thin line is easy to click. It extends downward
|
|
137
|
+
only: the line sits on the player's top edge, and reaching above it would
|
|
138
|
+
capture clicks on whatever is above the player. */
|
|
139
|
+
.pw-mini-progress::before {
|
|
140
|
+
content: '';
|
|
141
|
+
position: absolute;
|
|
142
|
+
left: 0;
|
|
143
|
+
right: 0;
|
|
144
|
+
top: 0;
|
|
145
|
+
bottom: -8px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.pw-mini-progress:hover {
|
|
149
|
+
height: 4px;
|
|
96
150
|
}
|
|
97
151
|
|
|
98
152
|
.pw-mini-progress-bar {
|
|
153
|
+
width: 0;
|
|
99
154
|
height: 100%;
|
|
100
155
|
background: var(--md-primary);
|
|
101
156
|
transition: width 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
@@ -173,14 +228,62 @@
|
|
|
173
228
|
transform: scale(0.98);
|
|
174
229
|
}
|
|
175
230
|
|
|
176
|
-
/*
|
|
231
|
+
/* Mini play/pause — filled, but flatter than the full player's */
|
|
232
|
+
.pw-mini .pw-btn--play {
|
|
233
|
+
width: 36px;
|
|
234
|
+
height: 36px;
|
|
235
|
+
box-shadow: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.pw-mini .pw-btn--play svg {
|
|
239
|
+
width: 20px;
|
|
240
|
+
height: 20px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.pw-mini .pw-btn--play:hover,
|
|
244
|
+
.pw-mini .pw-btn--play:active {
|
|
245
|
+
box-shadow: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Skip buttons — arrow icon with the seconds as text centred in the ring.
|
|
249
|
+
The ring's centre sits slightly below the icon's centre, hence padding-top. */
|
|
177
250
|
.pw-btn--skip {
|
|
251
|
+
width: 48px;
|
|
252
|
+
height: 48px;
|
|
178
253
|
color: var(--md-primary);
|
|
179
254
|
}
|
|
180
255
|
|
|
181
256
|
.pw-btn--skip svg {
|
|
182
|
-
width:
|
|
183
|
-
height:
|
|
257
|
+
width: 40px;
|
|
258
|
+
height: 40px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.pw-skip-label {
|
|
262
|
+
position: absolute;
|
|
263
|
+
inset: 0;
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
padding-top: 3px;
|
|
268
|
+
font-size: 12px;
|
|
269
|
+
font-weight: 700;
|
|
270
|
+
line-height: 1;
|
|
271
|
+
font-variant-numeric: tabular-nums;
|
|
272
|
+
pointer-events: none;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.pw-btn--mini.pw-btn--skip {
|
|
276
|
+
width: 40px;
|
|
277
|
+
height: 40px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.pw-btn--mini.pw-btn--skip svg {
|
|
281
|
+
width: 34px;
|
|
282
|
+
height: 34px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.pw-btn--mini .pw-skip-label {
|
|
286
|
+
font-size: 10px;
|
|
184
287
|
}
|
|
185
288
|
|
|
186
289
|
/* Expand button */
|
|
@@ -318,7 +421,6 @@
|
|
|
318
421
|
width: 60px;
|
|
319
422
|
height: 60px;
|
|
320
423
|
border-radius: 8px;
|
|
321
|
-
object-fit: cover;
|
|
322
424
|
box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
|
|
323
425
|
flex-shrink: 0;
|
|
324
426
|
}
|
|
@@ -372,7 +474,6 @@
|
|
|
372
474
|
border-radius: 2px;
|
|
373
475
|
position: relative;
|
|
374
476
|
cursor: pointer;
|
|
375
|
-
overflow: hidden;
|
|
376
477
|
transition: height 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
377
478
|
}
|
|
378
479
|
|
|
@@ -381,6 +482,7 @@
|
|
|
381
482
|
}
|
|
382
483
|
|
|
383
484
|
.pw-progress-bar {
|
|
485
|
+
width: 0;
|
|
384
486
|
height: 100%;
|
|
385
487
|
background: var(--md-primary);
|
|
386
488
|
border-radius: 2px;
|
|
@@ -406,6 +508,30 @@
|
|
|
406
508
|
opacity: 1;
|
|
407
509
|
}
|
|
408
510
|
|
|
511
|
+
/* Hover time tooltip — sits above the bar, clear of the cursor. The mini's bar
|
|
512
|
+
is on the player's top edge, so its container must not clip overflow. */
|
|
513
|
+
.pw-seek-tooltip {
|
|
514
|
+
position: absolute;
|
|
515
|
+
bottom: calc(100% + 8px);
|
|
516
|
+
left: 0;
|
|
517
|
+
transform: translateX(-50%);
|
|
518
|
+
padding: 3px 6px;
|
|
519
|
+
border-radius: 4px;
|
|
520
|
+
background: var(--player-on-surface);
|
|
521
|
+
color: var(--player-surface);
|
|
522
|
+
font-size: 11px;
|
|
523
|
+
font-weight: 500;
|
|
524
|
+
line-height: 1.2;
|
|
525
|
+
font-variant-numeric: tabular-nums;
|
|
526
|
+
white-space: nowrap;
|
|
527
|
+
pointer-events: none;
|
|
528
|
+
z-index: 5;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.pw-seek-tooltip[hidden] {
|
|
532
|
+
display: none;
|
|
533
|
+
}
|
|
534
|
+
|
|
409
535
|
/* Secondary controls (volume + speed) */
|
|
410
536
|
.pw-secondary-controls {
|
|
411
537
|
display: flex;
|
|
@@ -578,29 +704,6 @@
|
|
|
578
704
|
color: var(--md-on-primary);
|
|
579
705
|
}
|
|
580
706
|
|
|
581
|
-
.pw-playlist-item.pw-playing::before {
|
|
582
|
-
content: '';
|
|
583
|
-
position: absolute;
|
|
584
|
-
left: 0;
|
|
585
|
-
top: 50%;
|
|
586
|
-
transform: translateY(-50%);
|
|
587
|
-
width: 3px;
|
|
588
|
-
height: 60%;
|
|
589
|
-
background: var(--md-on-primary);
|
|
590
|
-
border-radius: 0 2px 2px 0;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
.pw-playlist-item.pw-has-saved::after {
|
|
594
|
-
content: '';
|
|
595
|
-
position: absolute;
|
|
596
|
-
left: 8px;
|
|
597
|
-
top: 8px;
|
|
598
|
-
width: 4px;
|
|
599
|
-
height: 4px;
|
|
600
|
-
background: var(--md-secondary);
|
|
601
|
-
border-radius: 50%;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
707
|
.pw-playlist-item.pw-loading,
|
|
605
708
|
.pw-playlist-item.pw-empty {
|
|
606
709
|
justify-content: center;
|
|
@@ -613,7 +716,6 @@
|
|
|
613
716
|
width: 48px;
|
|
614
717
|
height: 48px;
|
|
615
718
|
border-radius: 4px;
|
|
616
|
-
object-fit: cover;
|
|
617
719
|
flex-shrink: 0;
|
|
618
720
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
|
619
721
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudgy/podcast-widget",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Framework-agnostic podcast player widget with configurable player modes, theming via CSS custom properties, and optional PodcastIndex API client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsup",
|
|
31
31
|
"dev": "tsup --watch",
|
|
32
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.server.json",
|
|
32
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.server.json && tsc --noEmit -p tsconfig.e2e.json",
|
|
33
33
|
"test": "vitest run",
|
|
34
34
|
"test:watch": "vitest",
|
|
35
35
|
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"test:e2e": "npm run build && playwright test",
|
|
37
|
+
"demo": "npm run build && node demo/server.js",
|
|
36
38
|
"prepublishOnly": "npm run build && npm test"
|
|
37
39
|
},
|
|
38
40
|
"keywords": [
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
],
|
|
45
47
|
"license": "MIT",
|
|
46
48
|
"devDependencies": {
|
|
49
|
+
"@playwright/test": "1.64.1",
|
|
47
50
|
"@types/node": "^25.2.3",
|
|
48
51
|
"@vitest/coverage-v8": "^4.0.18",
|
|
49
52
|
"jsdom": "^28.0.0",
|