@djangocfg/ui-nextjs 2.1.67 → 2.1.69

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.67",
3
+ "version": "2.1.69",
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.67",
62
- "@djangocfg/ui-core": "^2.1.67",
61
+ "@djangocfg/api": "^2.1.69",
62
+ "@djangocfg/ui-core": "^2.1.69",
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.67",
113
+ "@djangocfg/typescript-config": "^2.1.69",
114
114
  "@types/node": "^24.7.2",
115
115
  "eslint": "^9.37.0",
116
116
  "tailwindcss-animate": "1.0.7",
package/src/index.ts CHANGED
@@ -21,4 +21,7 @@ export * from './lib';
21
21
  export * from './tools';
22
22
 
23
23
  // Re-export theme
24
- export * from './theme';
24
+ export * from './theme';
25
+
26
+ // Re-export stores
27
+ export * from './stores';
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { create } from 'zustand';
4
4
  import { persist, devtools } from 'zustand/middleware';
5
+ import { useShallow } from 'zustand/react/shallow';
5
6
 
6
7
  // Types
7
8
  interface BlobUrlEntry {
@@ -373,47 +374,56 @@ export const useMediaCacheStore = create<MediaCacheStore>()(
373
374
 
374
375
  /**
375
376
  * Hook for image-related cache operations
377
+ * Uses useShallow to prevent infinite re-renders
376
378
  */
377
379
  export const useImageCache = () =>
378
- useMediaCacheStore((state) => ({
379
- getOrCreateBlobUrl: state.getOrCreateBlobUrl,
380
- releaseBlobUrl: state.releaseBlobUrl,
381
- hasBlobUrl: state.hasBlobUrl,
382
- cacheDimensions: state.cacheDimensions,
383
- getDimensions: state.getDimensions,
384
- }));
380
+ useMediaCacheStore(
381
+ useShallow((state) => ({
382
+ getOrCreateBlobUrl: state.getOrCreateBlobUrl,
383
+ releaseBlobUrl: state.releaseBlobUrl,
384
+ hasBlobUrl: state.hasBlobUrl,
385
+ cacheDimensions: state.cacheDimensions,
386
+ getDimensions: state.getDimensions,
387
+ }))
388
+ );
385
389
 
386
390
  /**
387
391
  * Hook for audio-related cache operations
392
+ * Uses useShallow to prevent infinite re-renders
388
393
  */
389
394
  export const useAudioCache = () =>
390
- useMediaCacheStore((state) => ({
391
- getOrCreateBlobUrl: state.getOrCreateBlobUrl,
392
- releaseBlobUrl: state.releaseBlobUrl,
393
- hasBlobUrl: state.hasBlobUrl,
394
- saveAudioPosition: state.saveAudioPosition,
395
- getAudioPosition: state.getAudioPosition,
396
- getEffectConfig: state.getEffectConfig,
397
- cacheEffectConfig: state.cacheEffectConfig,
398
- }));
395
+ useMediaCacheStore(
396
+ useShallow((state) => ({
397
+ getOrCreateBlobUrl: state.getOrCreateBlobUrl,
398
+ releaseBlobUrl: state.releaseBlobUrl,
399
+ hasBlobUrl: state.hasBlobUrl,
400
+ saveAudioPosition: state.saveAudioPosition,
401
+ getAudioPosition: state.getAudioPosition,
402
+ getEffectConfig: state.getEffectConfig,
403
+ cacheEffectConfig: state.cacheEffectConfig,
404
+ }))
405
+ );
399
406
 
400
407
  /**
401
408
  * Hook for video-related cache operations
409
+ * Uses useShallow to prevent infinite re-renders
402
410
  */
403
411
  export const useVideoCache = () =>
404
- useMediaCacheStore((state) => ({
405
- getOrCreateBlobUrl: state.getOrCreateBlobUrl,
406
- releaseBlobUrl: state.releaseBlobUrl,
407
- hasBlobUrl: state.hasBlobUrl,
408
- getOrCreateStreamUrl: state.getOrCreateStreamUrl,
409
- getPosterUrl: state.getPosterUrl,
410
- cachePosterUrl: state.cachePosterUrl,
411
- saveVideoPosition: state.saveVideoPosition,
412
- getVideoPosition: state.getVideoPosition,
413
- cacheVideoMetadata: state.cacheVideoMetadata,
414
- getVideoMetadata: state.getVideoMetadata,
415
- invalidateSession: state.invalidateSession,
416
- }));
412
+ useMediaCacheStore(
413
+ useShallow((state) => ({
414
+ getOrCreateBlobUrl: state.getOrCreateBlobUrl,
415
+ releaseBlobUrl: state.releaseBlobUrl,
416
+ hasBlobUrl: state.hasBlobUrl,
417
+ getOrCreateStreamUrl: state.getOrCreateStreamUrl,
418
+ getPosterUrl: state.getPosterUrl,
419
+ cachePosterUrl: state.cachePosterUrl,
420
+ saveVideoPosition: state.saveVideoPosition,
421
+ getVideoPosition: state.getVideoPosition,
422
+ cacheVideoMetadata: state.cacheVideoMetadata,
423
+ getVideoMetadata: state.getVideoMetadata,
424
+ invalidateSession: state.invalidateSession,
425
+ }))
426
+ );
417
427
 
418
428
  /**
419
429
  * Hook for blob URL cleanup on unmount