@djangocfg/ui-nextjs 2.1.80 → 2.1.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/ui-nextjs",
3
- "version": "2.1.80",
3
+ "version": "2.1.81",
4
4
  "description": "Next.js UI component library with Radix UI primitives, Tailwind CSS styling, charts, and form components",
5
5
  "keywords": [
6
6
  "ui-components",
@@ -58,8 +58,8 @@
58
58
  "check": "tsc --noEmit"
59
59
  },
60
60
  "peerDependencies": {
61
- "@djangocfg/api": "^2.1.80",
62
- "@djangocfg/ui-core": "^2.1.80",
61
+ "@djangocfg/api": "^2.1.81",
62
+ "@djangocfg/ui-core": "^2.1.81",
63
63
  "@types/react": "^19.1.0",
64
64
  "@types/react-dom": "^19.1.0",
65
65
  "consola": "^3.4.2",
@@ -110,7 +110,7 @@
110
110
  "wavesurfer.js": "^7.12.1"
111
111
  },
112
112
  "devDependencies": {
113
- "@djangocfg/typescript-config": "^2.1.80",
113
+ "@djangocfg/typescript-config": "^2.1.81",
114
114
  "@types/node": "^24.7.2",
115
115
  "eslint": "^9.37.0",
116
116
  "tailwindcss-animate": "1.0.7",
@@ -58,15 +58,30 @@ export function useAudioSource(source: AudioSource): UseAudioSourceResult {
58
58
 
59
59
  const response = await fetch(source.uri, {
60
60
  signal: abortController.signal,
61
+ headers: {
62
+ // Request full file - some servers require Range header
63
+ 'Range': 'bytes=0-',
64
+ },
61
65
  });
62
66
 
67
+ // Accept 200 OK or 206 Partial Content (response.ok covers both)
63
68
  if (!response.ok) {
64
69
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
65
70
  }
66
71
 
67
72
  // Get content length for progress tracking
68
- const contentLength = response.headers.get('Content-Length');
69
- const totalBytes = contentLength ? parseInt(contentLength, 10) : 0;
73
+ // For Range requests, use Content-Range header (format: "bytes 0-1234/5678")
74
+ let totalBytes = 0;
75
+ const contentRange = response.headers.get('Content-Range');
76
+ if (contentRange) {
77
+ const match = contentRange.match(/\/(\d+)$/);
78
+ if (match) {
79
+ totalBytes = parseInt(match[1], 10);
80
+ }
81
+ } else {
82
+ const contentLength = response.headers.get('Content-Length');
83
+ totalBytes = contentLength ? parseInt(contentLength, 10) : 0;
84
+ }
70
85
 
71
86
  if (!response.body) {
72
87
  // Fallback for browsers without ReadableStream