@dudgy/podcast-widget 0.1.1 → 0.3.0
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 +31 -5
- package/dist/index.cjs +207 -105
- package/dist/index.d.cts +34 -5
- package/dist/index.d.ts +34 -5
- package/dist/index.js +176 -74
- package/dist/podcast-player.css +170 -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,9 +127,26 @@
|
|
|
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 {
|
|
@@ -173,14 +227,62 @@
|
|
|
173
227
|
transform: scale(0.98);
|
|
174
228
|
}
|
|
175
229
|
|
|
176
|
-
/*
|
|
230
|
+
/* Mini play/pause — filled, but flatter than the full player's */
|
|
231
|
+
.pw-mini .pw-btn--play {
|
|
232
|
+
width: 36px;
|
|
233
|
+
height: 36px;
|
|
234
|
+
box-shadow: none;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.pw-mini .pw-btn--play svg {
|
|
238
|
+
width: 20px;
|
|
239
|
+
height: 20px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.pw-mini .pw-btn--play:hover,
|
|
243
|
+
.pw-mini .pw-btn--play:active {
|
|
244
|
+
box-shadow: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Skip buttons — arrow icon with the seconds as text centred in the ring.
|
|
248
|
+
The ring's centre sits slightly below the icon's centre, hence padding-top. */
|
|
177
249
|
.pw-btn--skip {
|
|
250
|
+
width: 48px;
|
|
251
|
+
height: 48px;
|
|
178
252
|
color: var(--md-primary);
|
|
179
253
|
}
|
|
180
254
|
|
|
181
255
|
.pw-btn--skip svg {
|
|
182
|
-
width:
|
|
183
|
-
height:
|
|
256
|
+
width: 40px;
|
|
257
|
+
height: 40px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.pw-skip-label {
|
|
261
|
+
position: absolute;
|
|
262
|
+
inset: 0;
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
padding-top: 3px;
|
|
267
|
+
font-size: 12px;
|
|
268
|
+
font-weight: 700;
|
|
269
|
+
line-height: 1;
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
271
|
+
pointer-events: none;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.pw-btn--mini.pw-btn--skip {
|
|
275
|
+
width: 40px;
|
|
276
|
+
height: 40px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.pw-btn--mini.pw-btn--skip svg {
|
|
280
|
+
width: 34px;
|
|
281
|
+
height: 34px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.pw-btn--mini .pw-skip-label {
|
|
285
|
+
font-size: 10px;
|
|
184
286
|
}
|
|
185
287
|
|
|
186
288
|
/* Expand button */
|
|
@@ -318,7 +420,6 @@
|
|
|
318
420
|
width: 60px;
|
|
319
421
|
height: 60px;
|
|
320
422
|
border-radius: 8px;
|
|
321
|
-
object-fit: cover;
|
|
322
423
|
box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
|
|
323
424
|
flex-shrink: 0;
|
|
324
425
|
}
|
|
@@ -372,7 +473,6 @@
|
|
|
372
473
|
border-radius: 2px;
|
|
373
474
|
position: relative;
|
|
374
475
|
cursor: pointer;
|
|
375
|
-
overflow: hidden;
|
|
376
476
|
transition: height 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
377
477
|
}
|
|
378
478
|
|
|
@@ -406,6 +506,30 @@
|
|
|
406
506
|
opacity: 1;
|
|
407
507
|
}
|
|
408
508
|
|
|
509
|
+
/* Hover time tooltip — sits above the bar, clear of the cursor. The mini's bar
|
|
510
|
+
is on the player's top edge, so its container must not clip overflow. */
|
|
511
|
+
.pw-seek-tooltip {
|
|
512
|
+
position: absolute;
|
|
513
|
+
bottom: calc(100% + 8px);
|
|
514
|
+
left: 0;
|
|
515
|
+
transform: translateX(-50%);
|
|
516
|
+
padding: 3px 6px;
|
|
517
|
+
border-radius: 4px;
|
|
518
|
+
background: var(--player-on-surface);
|
|
519
|
+
color: var(--player-surface);
|
|
520
|
+
font-size: 11px;
|
|
521
|
+
font-weight: 500;
|
|
522
|
+
line-height: 1.2;
|
|
523
|
+
font-variant-numeric: tabular-nums;
|
|
524
|
+
white-space: nowrap;
|
|
525
|
+
pointer-events: none;
|
|
526
|
+
z-index: 5;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.pw-seek-tooltip[hidden] {
|
|
530
|
+
display: none;
|
|
531
|
+
}
|
|
532
|
+
|
|
409
533
|
/* Secondary controls (volume + speed) */
|
|
410
534
|
.pw-secondary-controls {
|
|
411
535
|
display: flex;
|
|
@@ -578,29 +702,6 @@
|
|
|
578
702
|
color: var(--md-on-primary);
|
|
579
703
|
}
|
|
580
704
|
|
|
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
705
|
.pw-playlist-item.pw-loading,
|
|
605
706
|
.pw-playlist-item.pw-empty {
|
|
606
707
|
justify-content: center;
|
|
@@ -613,7 +714,6 @@
|
|
|
613
714
|
width: 48px;
|
|
614
715
|
height: 48px;
|
|
615
716
|
border-radius: 4px;
|
|
616
|
-
object-fit: cover;
|
|
617
717
|
flex-shrink: 0;
|
|
618
718
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
|
619
719
|
}
|
|
@@ -707,6 +807,40 @@
|
|
|
707
807
|
background: rgba(var(--player-on-surface-rgb), 0.08);
|
|
708
808
|
}
|
|
709
809
|
|
|
810
|
+
.pw-download-btn {
|
|
811
|
+
display: flex;
|
|
812
|
+
align-items: center;
|
|
813
|
+
justify-content: center;
|
|
814
|
+
width: 24px;
|
|
815
|
+
height: 24px;
|
|
816
|
+
border-radius: 50%;
|
|
817
|
+
color: var(--player-on-surface-variant);
|
|
818
|
+
opacity: 0.5;
|
|
819
|
+
transition: all 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
820
|
+
text-decoration: none;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.pw-download-btn svg {
|
|
824
|
+
width: 16px;
|
|
825
|
+
height: 16px;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.pw-download-btn:hover {
|
|
829
|
+
opacity: 1;
|
|
830
|
+
color: var(--md-primary);
|
|
831
|
+
background: rgba(var(--player-on-surface-rgb), 0.08);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.pw-btn--download {
|
|
835
|
+
width: 32px;
|
|
836
|
+
height: 32px;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.pw-btn--download svg {
|
|
840
|
+
width: 18px;
|
|
841
|
+
height: 18px;
|
|
842
|
+
}
|
|
843
|
+
|
|
710
844
|
/* ================================================================
|
|
711
845
|
RESPONSIVE
|
|
712
846
|
================================================================ */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudgy/podcast-widget",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|