@passkeyme/react-auth 1.2.0 → 2.0.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/CHANGELOG.md +1 -1
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/components/DevToolsDashboard.d.ts +1 -1
- package/dist/components/NotificationProvider.d.ts +1 -1
- package/dist/components/PasskeymeAuthPanel.d.ts +1 -1
- package/dist/components/PasskeymeButton.d.ts +1 -1
- package/dist/components/PasskeymeCallbackHandler.d.ts +1 -1
- package/dist/components/PasskeymeErrorDisplay.d.ts +1 -1
- package/dist/components/PasskeymeOAuthButton.d.ts +1 -1
- package/dist/components/PasskeymeProtectedRoute.d.ts +1 -1
- package/dist/components/PasskeymeUserProfile.d.ts +1 -1
- package/dist/hooks/usePerformanceMonitor.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +75 -38
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +75 -38
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/utils/analytics.d.ts +1 -1
- package/dist/utils/debug.d.ts +1 -1
- package/dist/utils/devUtils.d.ts +1 -1
- package/dist/utils/importOptimizer.d.ts +1 -1
- package/dist/utils/loadingStates.d.ts +1 -1
- package/dist/utils/performanceProfiler.d.ts +1 -1
- package/dist/utils/storageOptimization.d.ts +1 -1
- package/dist/utils/testingUtils.d.ts +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
16
|
|
|
17
17
|
### 🎉 First Stable Release
|
|
18
18
|
|
|
19
|
-
This marks the first stable release of the
|
|
19
|
+
This marks the first stable release of the Passkeyme React Authentication SDK, featuring enterprise-grade quality and seamless React integration.
|
|
20
20
|
|
|
21
21
|
### Added
|
|
22
22
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @passkeyme/react-auth
|
|
2
2
|
|
|
3
|
-
React integration for
|
|
3
|
+
React integration for Passkeyme Authentication SDK. Build secure authentication into your React apps with hooks and components.
|
|
4
4
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
@@ -111,7 +111,7 @@ export interface PasskeymeAuthPanelProps {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Passkeyme Authentication Panel Component
|
|
115
115
|
*
|
|
116
116
|
* A fully customizable authentication panel that handles passkey and OAuth authentication
|
|
117
117
|
* with extensive theming and configuration options.
|
|
@@ -8,7 +8,7 @@ export interface CallbackState {
|
|
|
8
8
|
authenticatedUser: any | null;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Built-in OAuth callback handler component for
|
|
11
|
+
* Built-in OAuth callback handler component for Passkeyme authentication.
|
|
12
12
|
*
|
|
13
13
|
* This component automatically handles the OAuth callback flow including:
|
|
14
14
|
* - Token extraction from URL parameters
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Passkeyme OAuth Login Button Component with Enhanced Accessibility and Performance
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
5
|
import type { PasskeymeOAuthButtonProps } from "../types";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Passkeyme React Authentication SDK
|
|
3
3
|
*
|
|
4
|
-
* React integration for
|
|
4
|
+
* React integration for Passkeyme Authentication with hooks and components.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
package/dist/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ export { ErrorHandler, PasskeymeError, PasskeymeErrorCode } from '@passkeyme/aut
|
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* React Context Provider for
|
|
8
|
+
* React Context Provider for Passkeyme Authentication (Core)
|
|
9
9
|
* This is the shared provider for React and React Native
|
|
10
10
|
*/
|
|
11
11
|
const PasskeymeContext = createContext(null);
|
|
@@ -112,7 +112,7 @@ const PasskeymeProvider$1 = ({ config, children, loadingComponent = null, errorC
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
* Core React hooks for
|
|
115
|
+
* Core React hooks for Passkeyme Authentication
|
|
116
116
|
* Shared between React and React Native
|
|
117
117
|
*/
|
|
118
118
|
// Simple debug function for core package
|
|
@@ -124,7 +124,7 @@ function debugLog$1(config, ...args) {
|
|
|
124
124
|
const usePasskeyme = () => {
|
|
125
125
|
const { auth, user, loading, error, isAuthenticated, authLoading, setAuthLoading, config, } = usePasskeymeContext();
|
|
126
126
|
if (!auth) {
|
|
127
|
-
throw new Error("
|
|
127
|
+
throw new Error("Passkeyme auth instance not available");
|
|
128
128
|
}
|
|
129
129
|
const redirectToLogin = useCallback((options) => {
|
|
130
130
|
return auth.redirectToLogin(options);
|
|
@@ -642,7 +642,7 @@ const PasskeymeProvider = ({ children, config, enableNotifications = true, ...co
|
|
|
642
642
|
};
|
|
643
643
|
|
|
644
644
|
/**
|
|
645
|
-
* Enhanced Loading States for
|
|
645
|
+
* Enhanced Loading States for Passkeyme SDK
|
|
646
646
|
* Provides granular loading feedback for better user experience
|
|
647
647
|
*/
|
|
648
648
|
const LOADING_STATE_INFO = {
|
|
@@ -1777,7 +1777,7 @@ const importLogger = {
|
|
|
1777
1777
|
};
|
|
1778
1778
|
|
|
1779
1779
|
/**
|
|
1780
|
-
* Debug utilities for
|
|
1780
|
+
* Debug utilities for Passkeyme React SDK
|
|
1781
1781
|
*/
|
|
1782
1782
|
/**
|
|
1783
1783
|
* Debug utility to conditionally log messages
|
|
@@ -1786,7 +1786,7 @@ function debugLog(config, component, ...args) {
|
|
|
1786
1786
|
if (config.debug) {
|
|
1787
1787
|
// Use both professional logger and console.log to ensure visibility
|
|
1788
1788
|
const timestamp = new Date().toISOString();
|
|
1789
|
-
console.log(`[${timestamp}] [
|
|
1789
|
+
console.log(`[${timestamp}] [Passkeyme:${component}]`, ...args);
|
|
1790
1790
|
debugLogger.debug(`[${component}]`, ...args);
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
@@ -2234,7 +2234,7 @@ const defaultTheme = {
|
|
|
2234
2234
|
},
|
|
2235
2235
|
};
|
|
2236
2236
|
/**
|
|
2237
|
-
*
|
|
2237
|
+
* Passkeyme Authentication Panel Component
|
|
2238
2238
|
*
|
|
2239
2239
|
* A fully customizable authentication panel that handles passkey and OAuth authentication
|
|
2240
2240
|
* with extensive theming and configuration options.
|
|
@@ -2562,6 +2562,27 @@ const isPlainObject = (val) => {
|
|
|
2562
2562
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
2563
2563
|
};
|
|
2564
2564
|
|
|
2565
|
+
/**
|
|
2566
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
2567
|
+
*
|
|
2568
|
+
* @param {*} val The value to test
|
|
2569
|
+
*
|
|
2570
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
2571
|
+
*/
|
|
2572
|
+
const isEmptyObject = (val) => {
|
|
2573
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
2574
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
2575
|
+
return false;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
try {
|
|
2579
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
2580
|
+
} catch (e) {
|
|
2581
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
2582
|
+
return false;
|
|
2583
|
+
}
|
|
2584
|
+
};
|
|
2585
|
+
|
|
2565
2586
|
/**
|
|
2566
2587
|
* Determine if a value is a Date
|
|
2567
2588
|
*
|
|
@@ -2684,6 +2705,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
2684
2705
|
fn.call(null, obj[i], i, obj);
|
|
2685
2706
|
}
|
|
2686
2707
|
} else {
|
|
2708
|
+
// Buffer check
|
|
2709
|
+
if (isBuffer(obj)) {
|
|
2710
|
+
return;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2687
2713
|
// Iterate over object keys
|
|
2688
2714
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
2689
2715
|
const len = keys.length;
|
|
@@ -2697,6 +2723,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
2697
2723
|
}
|
|
2698
2724
|
|
|
2699
2725
|
function findKey(obj, key) {
|
|
2726
|
+
if (isBuffer(obj)){
|
|
2727
|
+
return null;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2700
2730
|
key = key.toLowerCase();
|
|
2701
2731
|
const keys = Object.keys(obj);
|
|
2702
2732
|
let i = keys.length;
|
|
@@ -3050,6 +3080,11 @@ const toJSONObject = (obj) => {
|
|
|
3050
3080
|
return;
|
|
3051
3081
|
}
|
|
3052
3082
|
|
|
3083
|
+
//Buffer check
|
|
3084
|
+
if (isBuffer(source)) {
|
|
3085
|
+
return source;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3053
3088
|
if(!('toJSON' in source)) {
|
|
3054
3089
|
stack[i] = source;
|
|
3055
3090
|
const target = isArray(source) ? [] : {};
|
|
@@ -3121,6 +3156,7 @@ var utils$1 = {
|
|
|
3121
3156
|
isBoolean,
|
|
3122
3157
|
isObject,
|
|
3123
3158
|
isPlainObject,
|
|
3159
|
+
isEmptyObject,
|
|
3124
3160
|
isReadableStream,
|
|
3125
3161
|
isRequest,
|
|
3126
3162
|
isResponse,
|
|
@@ -3752,7 +3788,7 @@ var platform = {
|
|
|
3752
3788
|
};
|
|
3753
3789
|
|
|
3754
3790
|
function toURLEncodedForm(data, options) {
|
|
3755
|
-
return toFormData(data, new platform.classes.URLSearchParams(),
|
|
3791
|
+
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
3756
3792
|
visitor: function(value, key, path, helpers) {
|
|
3757
3793
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
3758
3794
|
this.append(key, value.toString('base64'));
|
|
@@ -3760,8 +3796,9 @@ function toURLEncodedForm(data, options) {
|
|
|
3760
3796
|
}
|
|
3761
3797
|
|
|
3762
3798
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
3763
|
-
}
|
|
3764
|
-
|
|
3799
|
+
},
|
|
3800
|
+
...options
|
|
3801
|
+
});
|
|
3765
3802
|
}
|
|
3766
3803
|
|
|
3767
3804
|
/**
|
|
@@ -4514,7 +4551,7 @@ function throttle(fn, freq) {
|
|
|
4514
4551
|
clearTimeout(timer);
|
|
4515
4552
|
timer = null;
|
|
4516
4553
|
}
|
|
4517
|
-
fn
|
|
4554
|
+
fn(...args);
|
|
4518
4555
|
};
|
|
4519
4556
|
|
|
4520
4557
|
const throttled = (...args) => {
|
|
@@ -4770,7 +4807,7 @@ function mergeConfig(config1, config2) {
|
|
|
4770
4807
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
4771
4808
|
};
|
|
4772
4809
|
|
|
4773
|
-
utils$1.forEach(Object.keys(
|
|
4810
|
+
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
4774
4811
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
4775
4812
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
4776
4813
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
@@ -5511,7 +5548,7 @@ function dispatchRequest(config) {
|
|
|
5511
5548
|
});
|
|
5512
5549
|
}
|
|
5513
5550
|
|
|
5514
|
-
const VERSION = "1.
|
|
5551
|
+
const VERSION = "1.11.0";
|
|
5515
5552
|
|
|
5516
5553
|
const validators$1 = {};
|
|
5517
5554
|
|
|
@@ -5750,8 +5787,8 @@ class Axios {
|
|
|
5750
5787
|
|
|
5751
5788
|
if (!synchronousRequestInterceptors) {
|
|
5752
5789
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
5753
|
-
chain.unshift
|
|
5754
|
-
chain.push
|
|
5790
|
+
chain.unshift(...requestInterceptorChain);
|
|
5791
|
+
chain.push(...responseInterceptorChain);
|
|
5755
5792
|
len = chain.length;
|
|
5756
5793
|
|
|
5757
5794
|
promise = Promise.resolve(config);
|
|
@@ -6239,7 +6276,7 @@ const DefaultPasskeyPrompt = ({ user, onRegister, onSkip, loading, }) => (jsxs("
|
|
|
6239
6276
|
textAlign: "center",
|
|
6240
6277
|
}, children: "You can always set this up later in your account settings" })] }));
|
|
6241
6278
|
/**
|
|
6242
|
-
* Built-in OAuth callback handler component for
|
|
6279
|
+
* Built-in OAuth callback handler component for Passkeyme authentication.
|
|
6243
6280
|
*
|
|
6244
6281
|
* This component automatically handles the OAuth callback flow including:
|
|
6245
6282
|
* - Token extraction from URL parameters
|
|
@@ -6391,7 +6428,7 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
|
|
|
6391
6428
|
return;
|
|
6392
6429
|
try {
|
|
6393
6430
|
updateState({ passkeyRegistering: true });
|
|
6394
|
-
// Create axios instance for
|
|
6431
|
+
// Create axios instance for Passkeyme API
|
|
6395
6432
|
const axiosInstance = axios$1.create({
|
|
6396
6433
|
baseURL: `${getBaseUrl()}/webauthn/${config.appId}`,
|
|
6397
6434
|
headers: {
|
|
@@ -7025,7 +7062,7 @@ const withAuth = (Component, options) => {
|
|
|
7025
7062
|
};
|
|
7026
7063
|
|
|
7027
7064
|
/**
|
|
7028
|
-
* Performance monitoring utilities for
|
|
7065
|
+
* Performance monitoring utilities for Passkeyme React SDK
|
|
7029
7066
|
*/
|
|
7030
7067
|
/**
|
|
7031
7068
|
* Hook to monitor component performance
|
|
@@ -7142,7 +7179,7 @@ const useMemoryMonitor = (enabled = process.env.NODE_ENV === "development") => {
|
|
|
7142
7179
|
*/
|
|
7143
7180
|
const devWarn = (condition, message, ...args) => {
|
|
7144
7181
|
if (process.env.NODE_ENV === "development" && condition) {
|
|
7145
|
-
console.warn(`[
|
|
7182
|
+
console.warn(`[Passkeyme Dev Warning] ${message}`, ...args);
|
|
7146
7183
|
}
|
|
7147
7184
|
};
|
|
7148
7185
|
/**
|
|
@@ -7150,7 +7187,7 @@ const devWarn = (condition, message, ...args) => {
|
|
|
7150
7187
|
*/
|
|
7151
7188
|
const devError = (condition, message, ...args) => {
|
|
7152
7189
|
if (process.env.NODE_ENV === "development" && condition) {
|
|
7153
|
-
console.error(`[
|
|
7190
|
+
console.error(`[Passkeyme Dev Error] ${message}`, ...args);
|
|
7154
7191
|
}
|
|
7155
7192
|
};
|
|
7156
7193
|
/**
|
|
@@ -7181,14 +7218,14 @@ const initDevTools = () => {
|
|
|
7181
7218
|
resetAuth: () => {
|
|
7182
7219
|
localStorage.removeItem("passkeyme_auth_token");
|
|
7183
7220
|
localStorage.removeItem("passkeyme_user_data");
|
|
7184
|
-
console.log("[
|
|
7221
|
+
console.log("[Passkeyme Dev] Authentication state reset");
|
|
7185
7222
|
window.location.reload();
|
|
7186
7223
|
},
|
|
7187
7224
|
// Show current state
|
|
7188
7225
|
showState: () => {
|
|
7189
7226
|
const token = localStorage.getItem("passkeyme_auth_token");
|
|
7190
7227
|
const user = localStorage.getItem("passkeyme_user_data");
|
|
7191
|
-
console.log("[
|
|
7228
|
+
console.log("[Passkeyme Dev] Current State:", {
|
|
7192
7229
|
hasToken: !!token,
|
|
7193
7230
|
token: token ? "Present" : "None",
|
|
7194
7231
|
user: user ? JSON.parse(user) : null,
|
|
@@ -7197,17 +7234,17 @@ const initDevTools = () => {
|
|
|
7197
7234
|
// Enable debug mode
|
|
7198
7235
|
enableDebug: () => {
|
|
7199
7236
|
localStorage.setItem("passkeyme_debug", "true");
|
|
7200
|
-
console.log("[
|
|
7237
|
+
console.log("[Passkeyme Dev] Debug mode enabled");
|
|
7201
7238
|
window.location.reload();
|
|
7202
7239
|
},
|
|
7203
7240
|
// Disable debug mode
|
|
7204
7241
|
disableDebug: () => {
|
|
7205
7242
|
localStorage.removeItem("passkeyme_debug");
|
|
7206
|
-
console.log("[
|
|
7243
|
+
console.log("[Passkeyme Dev] Debug mode disabled");
|
|
7207
7244
|
window.location.reload();
|
|
7208
7245
|
},
|
|
7209
7246
|
};
|
|
7210
|
-
console.log("[
|
|
7247
|
+
console.log("[Passkeyme Dev] Development tools loaded. Use window.__PASSKEYME_DEV__ for utilities.");
|
|
7211
7248
|
}
|
|
7212
7249
|
};
|
|
7213
7250
|
/**
|
|
@@ -7222,7 +7259,7 @@ const withDevTools = (Component, displayName) => {
|
|
|
7222
7259
|
// Log renders in development
|
|
7223
7260
|
React.useEffect(() => {
|
|
7224
7261
|
if (localStorage.getItem("passkeyme_debug") === "true") {
|
|
7225
|
-
console.log(`[
|
|
7262
|
+
console.log(`[Passkeyme Dev] ${componentName} rendered with props:`, props);
|
|
7226
7263
|
}
|
|
7227
7264
|
});
|
|
7228
7265
|
// Validate required props
|
|
@@ -7279,7 +7316,7 @@ const DebugPanel = ({ data, position = "bottom-right", }) => {
|
|
|
7279
7316
|
overflow: "auto",
|
|
7280
7317
|
zIndex: 9999,
|
|
7281
7318
|
border: "1px solid #333",
|
|
7282
|
-
}, children: [jsx("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\uD83D\uDC1B
|
|
7319
|
+
}, children: [jsx("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\uD83D\uDC1B Passkeyme Debug Panel" }), jsx("pre", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: JSON.stringify(data, null, 2) })] }));
|
|
7283
7320
|
};
|
|
7284
7321
|
/**
|
|
7285
7322
|
* Component performance profiler for development
|
|
@@ -7344,7 +7381,7 @@ const createLazyComponent = (importFn, fallback) => {
|
|
|
7344
7381
|
};
|
|
7345
7382
|
|
|
7346
7383
|
/**
|
|
7347
|
-
* Optimized localStorage utilities for
|
|
7384
|
+
* Optimized localStorage utilities for Passkeyme React SDK
|
|
7348
7385
|
* Provides caching, compression, and performance optimizations
|
|
7349
7386
|
*/
|
|
7350
7387
|
/**
|
|
@@ -7930,7 +7967,7 @@ const PerformanceIndicator = ({ threshold = 100, position = "top-right", }) => {
|
|
|
7930
7967
|
};
|
|
7931
7968
|
|
|
7932
7969
|
/**
|
|
7933
|
-
* Import optimization utility for
|
|
7970
|
+
* Import optimization utility for Passkeyme React SDK
|
|
7934
7971
|
* Analyzes and optimizes bundle imports to reduce bundle size
|
|
7935
7972
|
*
|
|
7936
7973
|
* Note: This utility is intended for build-time analysis in Node.js environments only.
|
|
@@ -8378,7 +8415,7 @@ class PasskeymeErrorBoundary extends Component {
|
|
|
8378
8415
|
onError === null || onError === void 0 ? void 0 : onError(error, errorInfo);
|
|
8379
8416
|
// Log to console in development
|
|
8380
8417
|
if (process.env.NODE_ENV === "development") {
|
|
8381
|
-
console.error("
|
|
8418
|
+
console.error("Passkeyme Error Boundary caught an error:", error, errorInfo);
|
|
8382
8419
|
}
|
|
8383
8420
|
}
|
|
8384
8421
|
render() {
|
|
@@ -8500,7 +8537,7 @@ const createPerformanceTracker = () => {
|
|
|
8500
8537
|
};
|
|
8501
8538
|
|
|
8502
8539
|
/**
|
|
8503
|
-
* Mock provider for testing components that use
|
|
8540
|
+
* Mock provider for testing components that use Passkeyme
|
|
8504
8541
|
*/
|
|
8505
8542
|
const MockPasskeymeProvider = ({ children, config = {}, initialUser = null, initialLoading = false, initialError = null, }) => {
|
|
8506
8543
|
const mockConfig = {
|
|
@@ -8511,7 +8548,7 @@ const MockPasskeymeProvider = ({ children, config = {}, initialUser = null, init
|
|
|
8511
8548
|
return jsx(PasskeymeProvider$1, { config: mockConfig, children: children });
|
|
8512
8549
|
};
|
|
8513
8550
|
/**
|
|
8514
|
-
* Custom render function with
|
|
8551
|
+
* Custom render function with Passkeyme provider
|
|
8515
8552
|
* Note: Requires @testing-library/react render function to be passed in
|
|
8516
8553
|
*/
|
|
8517
8554
|
const createRenderWithPasskeymeProvider = (renderFunction) => (ui, options = {}) => {
|
|
@@ -8781,21 +8818,21 @@ const DevToolsDashboard = ({ show = process.env.NODE_ENV === "development", posi
|
|
|
8781
8818
|
console.log = (...args) => {
|
|
8782
8819
|
var _a;
|
|
8783
8820
|
originalConsole.log(...args);
|
|
8784
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[
|
|
8821
|
+
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[Passkeyme")) {
|
|
8785
8822
|
addLog("info", args.join(" "), args.slice(1));
|
|
8786
8823
|
}
|
|
8787
8824
|
};
|
|
8788
8825
|
console.warn = (...args) => {
|
|
8789
8826
|
var _a;
|
|
8790
8827
|
originalConsole.warn(...args);
|
|
8791
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[
|
|
8828
|
+
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[Passkeyme")) {
|
|
8792
8829
|
addLog("warn", args.join(" "), args.slice(1));
|
|
8793
8830
|
}
|
|
8794
8831
|
};
|
|
8795
8832
|
console.error = (...args) => {
|
|
8796
8833
|
var _a;
|
|
8797
8834
|
originalConsole.error(...args);
|
|
8798
|
-
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[
|
|
8835
|
+
if ((_a = args[0]) === null || _a === void 0 ? void 0 : _a.toString().includes("[Passkeyme")) {
|
|
8799
8836
|
addLog("error", args.join(" "), args.slice(1));
|
|
8800
8837
|
}
|
|
8801
8838
|
};
|
|
@@ -8861,7 +8898,7 @@ const DevToolsDashboard = ({ show = process.env.NODE_ENV === "development", posi
|
|
|
8861
8898
|
};
|
|
8862
8899
|
const testError = () => {
|
|
8863
8900
|
const error = new PasskeymeError("DEV_TEST_ERROR");
|
|
8864
|
-
console.error("[
|
|
8901
|
+
console.error("[Passkeyme Dev] Test error:", error);
|
|
8865
8902
|
addLog("error", "Test error triggered", error);
|
|
8866
8903
|
};
|
|
8867
8904
|
const exportState = () => {
|
|
@@ -8878,7 +8915,7 @@ const DevToolsDashboard = ({ show = process.env.NODE_ENV === "development", posi
|
|
|
8878
8915
|
debug: localStorage.getItem("passkeyme_debug"),
|
|
8879
8916
|
},
|
|
8880
8917
|
};
|
|
8881
|
-
console.log("[
|
|
8918
|
+
console.log("[Passkeyme Dev] Current state:", state);
|
|
8882
8919
|
(_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(JSON.stringify(state, null, 2));
|
|
8883
8920
|
addLog("info", "State exported to clipboard");
|
|
8884
8921
|
};
|
|
@@ -8932,7 +8969,7 @@ const DevToolsDashboard = ({ show = process.env.NODE_ENV === "development", posi
|
|
|
8932
8969
|
cursor: "pointer",
|
|
8933
8970
|
marginRight: "4px",
|
|
8934
8971
|
});
|
|
8935
|
-
return (jsxs("div", { style: baseStyles, children: [jsxs("div", { style: headerStyles, onClick: () => setIsCollapsed(!isCollapsed), children: [jsx("span", { children: "\uD83D\uDEE0\uFE0F
|
|
8972
|
+
return (jsxs("div", { style: baseStyles, children: [jsxs("div", { style: headerStyles, onClick: () => setIsCollapsed(!isCollapsed), children: [jsx("span", { children: "\uD83D\uDEE0\uFE0F Passkeyme DevTools" }), jsx("span", { children: isCollapsed ? "▲" : "▼" })] }), !isCollapsed && (jsxs("div", { style: contentStyles, children: [jsxs("div", { style: { marginBottom: "12px" }, children: [jsx("button", { onClick: () => setActiveTab("state"), style: tabStyle(activeTab === "state"), children: "State" }), jsx("button", { onClick: () => setActiveTab("logs"), style: tabStyle(activeTab === "logs"), children: "Logs" })] }), activeTab === "state" && renderStateTab(), activeTab === "logs" && renderLogsTab()] }))] }));
|
|
8936
8973
|
};
|
|
8937
8974
|
// Auto-initialize dev tools
|
|
8938
8975
|
if (process.env.NODE_ENV === "development" && typeof window !== "undefined") {
|