@djangocfg/layouts 2.1.491 → 2.1.495

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/layouts",
3
- "version": "2.1.491",
3
+ "version": "2.1.495",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -89,12 +89,12 @@
89
89
  "check": "tsc --noEmit"
90
90
  },
91
91
  "peerDependencies": {
92
- "@djangocfg/analytics": "^2.1.491",
93
- "@djangocfg/api": "^2.1.491",
94
- "@djangocfg/centrifugo": "^2.1.491",
95
- "@djangocfg/devtools": "^2.1.491",
96
- "@djangocfg/i18n": "^2.1.491",
97
- "@djangocfg/ui-core": "^2.1.491",
92
+ "@djangocfg/analytics": "^2.1.495",
93
+ "@djangocfg/api": "^2.1.495",
94
+ "@djangocfg/centrifugo": "^2.1.495",
95
+ "@djangocfg/devtools": "^2.1.495",
96
+ "@djangocfg/i18n": "^2.1.495",
97
+ "@djangocfg/ui-core": "^2.1.495",
98
98
  "@hookform/resolvers": "^5.2.2",
99
99
  "consola": "^3.4.2",
100
100
  "lucide-react": "^0.545.0",
@@ -124,14 +124,14 @@
124
124
  "uuid": "^11.1.1"
125
125
  },
126
126
  "devDependencies": {
127
- "@djangocfg/analytics": "^2.1.491",
128
- "@djangocfg/api": "^2.1.491",
129
- "@djangocfg/centrifugo": "^2.1.491",
130
- "@djangocfg/devtools": "^2.1.491",
131
- "@djangocfg/i18n": "^2.1.491",
132
- "@djangocfg/typescript-config": "^2.1.491",
133
- "@djangocfg/ui-core": "^2.1.491",
134
- "@djangocfg/ui-tools": "^2.1.491",
127
+ "@djangocfg/analytics": "^2.1.495",
128
+ "@djangocfg/api": "^2.1.495",
129
+ "@djangocfg/centrifugo": "^2.1.495",
130
+ "@djangocfg/devtools": "^2.1.495",
131
+ "@djangocfg/i18n": "^2.1.495",
132
+ "@djangocfg/typescript-config": "^2.1.495",
133
+ "@djangocfg/ui-core": "^2.1.495",
134
+ "@djangocfg/ui-tools": "^2.1.495",
135
135
  "@types/node": "^25.9.5",
136
136
  "@types/react": "19.2.15",
137
137
  "@types/react-dom": "19.2.3",
@@ -31,6 +31,7 @@ export type {
31
31
  CentrifugoErrorConfig,
32
32
  RuntimeErrorConfig,
33
33
  ErrorTrackingContextValue,
34
+ TrackedErrorType,
34
35
  } from './types';
35
36
 
36
37
  // Event names (for manual event dispatching)
@@ -58,6 +58,7 @@ import type {
58
58
  CentrifugoErrorDetail,
59
59
  RuntimeErrorDetail,
60
60
  ErrorTrackingContextValue,
61
+ TrackedErrorType,
61
62
  } from '../types';
62
63
  const ErrorTrackingContext = createContext<ErrorTrackingContextValue | undefined>(undefined);
63
64
 
@@ -229,7 +230,7 @@ export function ErrorTrackingProvider({
229
230
  /**
230
231
  * Clear errors by type
231
232
  */
232
- const clearErrorsByType = useCallback((type: 'validation' | 'cors' | 'network' | 'centrifugo') => {
233
+ const clearErrorsByType = useCallback((type: TrackedErrorType) => {
233
234
  setErrors((prev) => prev.filter((error) => error.type !== type));
234
235
  }, []);
235
236
 
@@ -80,6 +80,23 @@ export interface CentrifugoErrorDetail extends BaseErrorDetail {
80
80
  data?: any;
81
81
  }
82
82
 
83
+ /**
84
+ * Every error category the tracker stores.
85
+ *
86
+ * Named rather than repeated inline: this union was written out twice — once
87
+ * in `ErrorTrackingContextValue.clearErrorsByType` and once in the provider's
88
+ * implementation of it — and the two drifted. `'runtime'` was added to the
89
+ * interface but not to the implementation, so calling the documented API with
90
+ * the documented argument failed to type-check, and consumers carried a patch
91
+ * to paper over it. One definition means that cannot recur.
92
+ */
93
+ export type TrackedErrorType =
94
+ | 'validation'
95
+ | 'cors'
96
+ | 'network'
97
+ | 'centrifugo'
98
+ | 'runtime';
99
+
83
100
  /**
84
101
  * Runtime/generic error detail (from runtime-error event)
85
102
  * Used for any JS errors that need to be shown to user (e.g., Tour selector errors)
@@ -297,7 +314,7 @@ export interface ErrorTrackingContextValue {
297
314
  clearErrors: () => void;
298
315
 
299
316
  /** Clear errors by type */
300
- clearErrorsByType: (type: 'validation' | 'cors' | 'network' | 'centrifugo' | 'runtime') => void;
317
+ clearErrorsByType: (type: TrackedErrorType) => void;
301
318
 
302
319
  /** Clear specific error by ID */
303
320
  clearError: (id: string) => void;