@nocios/crudify-ui 4.4.74 → 4.4.78
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/dist/{CrudiaMarkdownField-Bs940oF4.d.ts → CrudiaMarkdownField-C30enyF9.d.ts} +2 -2
- package/dist/{CrudiaMarkdownField-CKPdr2JL.d.mts → CrudiaMarkdownField-D-VooBtq.d.mts} +2 -2
- package/dist/{api-Djqihi4n.d.mts → api-RK-xY1Ah.d.mts} +22 -2
- package/dist/{api-Djqihi4n.d.ts → api-RK-xY1Ah.d.ts} +22 -2
- package/dist/chunk-34FAL7YW.js +1 -0
- package/dist/chunk-3NGJBTRH.mjs +1 -0
- package/dist/chunk-AKTAAP5I.js +1 -0
- package/dist/{chunk-YLCEL2HE.js → chunk-ARGPCO6I.js} +1 -1
- package/dist/{chunk-7X3OJMPH.mjs → chunk-EHDTUR6X.mjs} +1 -1
- package/dist/{chunk-2RQAIPFB.mjs → chunk-FRHTVRUM.mjs} +1 -1
- package/dist/chunk-FRLGHMXE.js +1 -0
- package/dist/chunk-G5OBPMIH.mjs +1 -0
- package/dist/{chunk-N6OQJOCM.js → chunk-QCGDLS4D.js} +1 -1
- package/dist/chunk-SUWV767V.mjs +1 -0
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/components.mjs +1 -1
- package/dist/{errorTranslation-BuEEtVg4.d.mts → errorTranslation-B4wcHzD3.d.mts} +1 -1
- package/dist/{errorTranslation-BIyBYuGF.d.ts → errorTranslation-CCC5IWoN.d.ts} +1 -1
- package/dist/hooks.d.mts +4 -3
- package/dist/hooks.d.ts +4 -3
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/{index-CQnAzvOE.d.mts → index-DEnlzdtV.d.mts} +90 -16
- package/dist/{index-BVT7flO5.d.ts → index-pQmuVg3q.d.ts} +90 -16
- package/dist/index.d.mts +12 -72
- package/dist/index.d.ts +12 -72
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +3 -3
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/configResolver.ts.html +0 -499
- package/coverage/coverage-final.json +0 -2
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -116
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/dist/chunk-4Z2XAMJA.js +0 -1
- package/dist/chunk-EXXKBYWY.js +0 -1
- package/dist/chunk-ML7JNB3X.mjs +0 -1
- package/dist/chunk-NXXCVAVE.js +0 -1
- package/dist/chunk-PK2UX3UH.mjs +0 -1
- package/dist/chunk-RPYFDF5Q.mjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import crudify__default from '@nocios/crudify-browser';
|
|
2
2
|
export * from '@nocios/crudify-browser';
|
|
3
3
|
export { default as crudify } from '@nocios/crudify-browser';
|
|
4
|
-
import { d as CrudifyLoginConfig } from './CrudiaMarkdownField-
|
|
5
|
-
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, l as POLICY_ACTIONS, m as PREFERRED_POLICY_ORDER, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-
|
|
4
|
+
import { d as CrudifyLoginConfig } from './CrudiaMarkdownField-C30enyF9.js';
|
|
5
|
+
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, l as POLICY_ACTIONS, m as PREFERRED_POLICY_ORDER, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-C30enyF9.js';
|
|
6
6
|
import React, { ReactNode } from 'react';
|
|
7
|
-
export { A as ApiError, C as CrudifyApiResponse, a as CrudifyTransactionResponse, F as ForgotPasswordRequest, J as JwtPayload, b as LoginRequest, L as LoginResponse, R as ResetPasswordRequest, T as TransactionResponseData, U as UserProfile, V as ValidateCodeRequest, c as ValidationError } from './api-
|
|
8
|
-
|
|
9
|
-
export { F as FileItem, q as FileStatus, a as SessionConfig, S as SessionManager, d as SessionState, c as StorageType, b as TokenStorage, j as UseAuthReturn, l as UseDataReturn, o as UseFileUploadOptions, p as UseFileUploadReturn, g as UseUserDataOptions, f as UseUserDataReturn, h as UserData, i as useAuth, r as useCrudifyWithNotifications, k as useData, n as useFileUpload, u as useSession, e as useUserData, m as useUserProfile } from './index-BVT7flO5.js';
|
|
7
|
+
export { A as ApiError, C as CrudifyApiResponse, a as CrudifyTransactionResponse, F as ForgotPasswordRequest, J as JwtPayload, b as LoginRequest, L as LoginResponse, R as ResetPasswordRequest, T as TransactionResponseData, U as UserProfile, V as ValidateCodeRequest, c as ValidationError } from './api-RK-xY1Ah.js';
|
|
8
|
+
export { F as FileItem, v as FileStatus, L as LoginResult, N as NotificationOptions, a as SessionConfig, g as SessionDebugInfo, S as SessionManager, e as SessionProvider, h as SessionProviderProps, d as SessionState, c as StorageType, b as TokenData, T as TokenStorage, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, f as useSessionContext, i as useUserData, q as useUserProfile } from './index-pQmuVg3q.js';
|
|
10
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
10
|
import { ThemeOptions } from '@mui/material';
|
|
12
11
|
export { A as AutoGenerateConfig, G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.js';
|
|
13
|
-
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-
|
|
12
|
+
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-CCC5IWoN.js';
|
|
14
13
|
import { ApiResponse, IModule, ModuleCreateInput, ModuleEditInput, ActionListFilters, IAction, ActionCreateInput, ActionEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin';
|
|
15
14
|
export { ActionCreateInput, ActionEditInput, ActionListFilters, ApiResponse, IAction, IModule, ModuleCreateInput, ModuleEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin';
|
|
16
15
|
|
|
@@ -31,67 +30,6 @@ interface CrudifyProviderProps {
|
|
|
31
30
|
declare const CrudifyProvider: React.FC<CrudifyProviderProps>;
|
|
32
31
|
declare const useCrudify: () => CrudifyContextValue;
|
|
33
32
|
|
|
34
|
-
type SessionData = {
|
|
35
|
-
_id: string;
|
|
36
|
-
email: string;
|
|
37
|
-
subscriberKey: string;
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
} | null;
|
|
40
|
-
type CrudifyConfig = {
|
|
41
|
-
publicApiKey?: string;
|
|
42
|
-
env?: "dev" | "stg" | "api" | "prod";
|
|
43
|
-
appName?: string;
|
|
44
|
-
loginActions?: string[];
|
|
45
|
-
logo?: string;
|
|
46
|
-
};
|
|
47
|
-
type SessionContextType = {
|
|
48
|
-
isAuthenticated: boolean;
|
|
49
|
-
isLoading: boolean;
|
|
50
|
-
isInitialized: boolean;
|
|
51
|
-
tokens: TokenData | null;
|
|
52
|
-
error: string | null;
|
|
53
|
-
sessionData: SessionData;
|
|
54
|
-
config: CrudifyConfig;
|
|
55
|
-
login: (email: string, password: string) => Promise<LoginResult>;
|
|
56
|
-
logout: () => Promise<void>;
|
|
57
|
-
refreshTokens: () => Promise<boolean>;
|
|
58
|
-
clearError: () => void;
|
|
59
|
-
getTokenInfo: () => any;
|
|
60
|
-
isExpiringSoon: boolean;
|
|
61
|
-
expiresIn: number;
|
|
62
|
-
refreshExpiresIn: number;
|
|
63
|
-
};
|
|
64
|
-
type NotificationOptions = {
|
|
65
|
-
enabled?: boolean;
|
|
66
|
-
maxNotifications?: number;
|
|
67
|
-
defaultAutoHideDuration?: number;
|
|
68
|
-
position?: {
|
|
69
|
-
vertical: "top" | "bottom";
|
|
70
|
-
horizontal: "left" | "center" | "right";
|
|
71
|
-
};
|
|
72
|
-
allowHtml?: boolean;
|
|
73
|
-
};
|
|
74
|
-
type SessionProviderProps = {
|
|
75
|
-
children: ReactNode;
|
|
76
|
-
options?: UseSessionOptions;
|
|
77
|
-
config?: CrudifyConfig;
|
|
78
|
-
showNotifications?: boolean;
|
|
79
|
-
notificationOptions?: NotificationOptions;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Main session provider to wrap the application.
|
|
83
|
-
* Auto-initializes internal CrudifyProvider if config.publicApiKey is provided.
|
|
84
|
-
*/
|
|
85
|
-
declare function SessionProvider(props: SessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
86
|
-
/**
|
|
87
|
-
* Hook para usar el contexto de sesión
|
|
88
|
-
*/
|
|
89
|
-
declare function useSessionContext(): SessionContextType;
|
|
90
|
-
/**
|
|
91
|
-
* Componente para mostrar información de la sesión (debug)
|
|
92
|
-
*/
|
|
93
|
-
declare function SessionDebugInfo(): react_jsx_runtime.JSX.Element;
|
|
94
|
-
|
|
95
33
|
type CrudifyThemeProviderProps = {
|
|
96
34
|
children: ReactNode;
|
|
97
35
|
defaultTheme?: ThemeOptions;
|
|
@@ -147,7 +85,7 @@ declare function CrudifyThemeProvider({ children, defaultTheme, disableCssBaseli
|
|
|
147
85
|
*/
|
|
148
86
|
type LogLevel = "error" | "warn" | "info" | "debug";
|
|
149
87
|
interface LogContext {
|
|
150
|
-
[key: string]:
|
|
88
|
+
[key: string]: unknown;
|
|
151
89
|
}
|
|
152
90
|
declare class Logger {
|
|
153
91
|
private explicitEnv;
|
|
@@ -169,7 +107,7 @@ declare class Logger {
|
|
|
169
107
|
/**
|
|
170
108
|
* Check if a log level should be displayed based on environment
|
|
171
109
|
* - dev/stg: show all logs
|
|
172
|
-
* - prod: show only errors
|
|
110
|
+
* - prod: show only errors (unless CRUDIFY_DEBUG_MODE is enabled)
|
|
173
111
|
*/
|
|
174
112
|
private shouldLog;
|
|
175
113
|
/**
|
|
@@ -576,12 +514,14 @@ interface TranslationsProviderProps {
|
|
|
576
514
|
enableDebug?: boolean;
|
|
577
515
|
skipAutoInit?: boolean;
|
|
578
516
|
autoSyncI18n?: boolean;
|
|
579
|
-
i18nInstance?:
|
|
517
|
+
i18nInstance?: {
|
|
518
|
+
addResourceBundle: (lang: string, ns: string, resources: Record<string, string>, deep?: boolean, overwrite?: boolean) => void;
|
|
519
|
+
};
|
|
580
520
|
loadingFallback?: React.ReactNode;
|
|
581
521
|
waitForInitialLoad?: boolean;
|
|
582
522
|
}
|
|
583
523
|
interface TranslationsContextValue {
|
|
584
|
-
t: (key: string, variables?: Record<string,
|
|
524
|
+
t: (key: string, variables?: Record<string, string | number>) => string;
|
|
585
525
|
language: string;
|
|
586
526
|
availableLanguages: string[];
|
|
587
527
|
translations: Record<string, Record<string, string>>;
|
|
@@ -1038,4 +978,4 @@ declare const crudifyAdmin: {
|
|
|
1038
978
|
updateActionsProfiles: (data: UpdateActionsProfilesInput) => Promise<ApiResponse<UpdateActionsProfilesResponse>>;
|
|
1039
979
|
};
|
|
1040
980
|
|
|
1041
|
-
export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, type CriticalTranslationKey, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, type FetchTranslationsOptions, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel,
|
|
981
|
+
export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, type CriticalTranslationKey, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, type FetchTranslationsOptions, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel, ProtectedRoute, type ProtectedRouteProps, SessionLoadingScreen, type SessionLoadingScreenProps, type SupportedLanguage, type TranslationResponse, TranslationService, type TranslationsContextValue, TranslationsProvider, type TranslationsProviderProps, crudifyAdmin, crudifyInitManager, extractSafeRedirectFromUrl, getCriticalLanguages, getCriticalTranslations, logger, translationService, useCrudify, useCrudifyInitializer, useTranslations, validateInternalRedirect };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkQCGDLS4Djs = require('./chunk-QCGDLS4D.js');var _chunkFRLGHMXEjs = require('./chunk-FRLGHMXE.js');var _chunkAKTAAP5Ijs = require('./chunk-AKTAAP5I.js');var _chunkARGPCO6Ijs = require('./chunk-ARGPCO6I.js');var _chunkYIIUEOXCjs = require('./chunk-YIIUEOXC.js');var _chunk34FAL7YWjs = require('./chunk-34FAL7YW.js');var _crudifybrowser = require('@nocios/crudify-browser'); var _crudifybrowser2 = _interopRequireDefault(_crudifybrowser); _createStarExport(_crudifybrowser);var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');var Ke=(e={})=>{try{let r=_chunk34FAL7YWjs.b.call(void 0, "theme");if(r){let o=JSON.parse(decodeURIComponent(r));return{...e,...o}}}catch(r){_chunk34FAL7YWjs.a.warn("Error parsing theme from cookie",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function Ve({children:e,defaultTheme:r={},disableCssBaseline:o=!1}){let t=_react.useMemo.call(void 0, ()=>{let s=Ke(r);return _material.createTheme.call(void 0, s)},[r]);return _jsxruntime.jsxs.call(void 0, _material.ThemeProvider,{theme:t,children:[!o&&_jsxruntime.jsx.call(void 0, _material.CssBaseline,{}),e]})}var _reactrouterdom = require('react-router-dom');var He={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},qe=()=>_jsxruntime.jsx.call(void 0, "style",{children:`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
0% { transform: rotate(0deg); }
|
|
4
4
|
100% { transform: rotate(360deg); }
|
|
5
5
|
}
|
|
6
|
-
`});function T({stage:e="loading",message:r}){let t=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, qe,{}),_jsxruntime.jsxs.call(void 0, "div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[_jsxruntime.jsx.call(void 0, "div",{style:He}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:t})]})]})}var Je=/^[a-zA-Z0-9\-_./\?=&%#]+$/,$e=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],h= exports.validateInternalRedirect =(e,r="/")=>{if(!e||typeof e!="string")return r;let o=e.trim();if(!o)return r;if(!o.startsWith("/"))return _chunkNXXCVAVEjs.a.warn("Open redirect blocked (relative path)",{path:e}),r;if(!Je.test(o))return _chunkNXXCVAVEjs.a.warn("Open redirect blocked (invalid characters)",{path:e}),r;let t=o.toLowerCase();for(let p of $e)if(p.test(t))return _chunkNXXCVAVEjs.a.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let a=o.split("?")[0].split("/").filter(Boolean);if(a.length===0)return o;for(let p of a)if(p===".."||p.includes(":")||p.length>100)return _chunkNXXCVAVEjs.a.warn("Open redirect blocked (suspicious path part)",{part:p}),r;return o},E= exports.extractSafeRedirectFromUrl =(e,r="/")=>{try{let t=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!t)return r;let a=decodeURIComponent(t);return h(a,r)}catch(o){return _chunkNXXCVAVEjs.a.warn("Error parsing redirect parameter",o instanceof Error?{errorMessage:o.message}:{message:String(o)}),r}};function w({children:e,loadingComponent:r,loginPath:o="/login"}){let{isAuthenticated:t,isLoading:a,isInitialized:p,tokens:d,error:y}=_chunk4Z2XAMJAjs.j.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!p||a)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, T,{stage:"validating-session"})});let l=t&&_optionalChain([d, 'optionalAccess', _2 => _2.accessToken])&&d.accessToken.length>0;if(y||!t||!l){d&&(!d.accessToken||d.accessToken.length===0)&&localStorage.removeItem("crudify_tokens");let A=u.pathname+u.search,x=h(A),C=encodeURIComponent(x);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${o}?redirect=${C}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}function F({children:e,redirectTo:r="/"}){let{isAuthenticated:o}=_chunk4Z2XAMJAjs.j.call(void 0, ),t=_reactrouterdom.useLocation.call(void 0, );if(o){let a=new URLSearchParams(t.search),p=E(a,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:p,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var D=_react.createContext.call(void 0, void 0),tr= exports.CrudifyInitializer =({config:e,children:r,fallback:o=null,onInitialized:t,onError:a})=>{let[p,d]=_react.useState.call(void 0, !1),[y,u]=_react.useState.call(void 0, !1),[l,A]=_react.useState.call(void 0, null),x=_react.useRef.call(void 0, !1),C=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{x.current||(_chunk4Z2XAMJAjs.o.registerHighPriorityInitializer(),x.current=!0),C.current||(C.current=!0,(async()=>{u(!0),A(null);try{let c=_chunkNXXCVAVEjs.c.call(void 0, {publicApiKey:_optionalChain([e, 'optionalAccess', _3 => _3.publicApiKey]),env:_optionalChain([e, 'optionalAccess', _4 => _4.env]),enableDebug:_optionalChain([e, 'optionalAccess', _5 => _5.enableLogging])});if(!c.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let P=c.env||"prod";_chunkNXXCVAVEjs.a.setEnvironment(P),await _chunk4Z2XAMJAjs.o.initialize({priority:"HIGH",publicApiKey:c.publicApiKey,env:c.env||"prod",enableLogging:_optionalChain([e, 'optionalAccess', _6 => _6.enableLogging]),requestedBy:"CrudifyInitializer"}),d(!0),u(!1),t&&t()}catch(c){let P=c instanceof Error?c:new Error(String(c));A(P),u(!1),a&&a(P)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),t,a]);let K={isInitialized:p,isInitializing:y,error:l};return y&&o?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o}):(l&&_chunkNXXCVAVEjs.a.error("[CrudifyInitializer] Initialization failed",l),_jsxruntime.jsx.call(void 0, D.Provider,{value:K,children:r}))},ir= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, D);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};var _crudifyadmin = require('@nocios/crudify-admin'); var _crudifyadmin2 = _interopRequireDefault(_crudifyadmin);var G=!1,g=null;async function sr(){let r=_chunk4Z2XAMJAjs.e.getInstance().getTokenInfo(),o=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),t=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return o&&t?{apiUrl:o,apiKey:t}:_chunk4Z2XAMJAjs.a.waitForCredentials()}async function ar(){if(!G)return g||(g=(async()=>{try{let e=_chunk4Z2XAMJAjs.e.getInstance(),{apiUrl:r,apiKey:o}=await sr();_crudifyadmin2.default.init({url:r,apiKey:o,getAdditionalHeaders:()=>{let t=e.getTokenInfo();return _optionalChain([t, 'optionalAccess', _12 => _12.crudifyTokens, 'optionalAccess', _13 => _13.accessToken])?{Authorization:`Bearer ${t.crudifyTokens.accessToken}`}:{}}}),G=!0}catch(e){throw g=null,_chunkNXXCVAVEjs.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),g)}async function n(e){try{await ar();let r=await e();return!r.success&&_optionalChain([r, 'access', _14 => _14.errors, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("401")])?await _chunk4Z2XAMJAjs.e.getInstance().refreshTokens()?await e():(_chunkNXXCVAVEjs.a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),r):r}catch(r){return _chunkNXXCVAVEjs.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var pr={listModules:()=>n(()=>_crudifyadmin2.default.listModules()),getModule:e=>n(()=>_crudifyadmin2.default.getModule(e)),createModule:e=>n(()=>_crudifyadmin2.default.createModule(e)),editModule:(e,r)=>n(()=>_crudifyadmin2.default.editModule(e,r)),deleteModule:e=>n(()=>_crudifyadmin2.default.deleteModule(e)),activateModule:e=>n(()=>_crudifyadmin2.default.activateModule(e)),deactivateModule:e=>n(()=>_crudifyadmin2.default.deactivateModule(e)),getModuleVersions:e=>n(()=>_crudifyadmin2.default.getModuleVersions(e)),listActions:e=>n(()=>_crudifyadmin2.default.listActions(e)),getAction:e=>n(()=>_crudifyadmin2.default.getAction(e)),createAction:e=>n(()=>_crudifyadmin2.default.createAction(e)),editAction:(e,r)=>n(()=>_crudifyadmin2.default.editAction(e,r)),deleteAction:e=>n(()=>_crudifyadmin2.default.deleteAction(e)),activateAction:e=>n(()=>_crudifyadmin2.default.activateAction(e)),deactivateAction:e=>n(()=>_crudifyadmin2.default.deactivateAction(e)),getActionVersions:e=>n(()=>_crudifyadmin2.default.getActionVersions(e)),getActionsByProfile:e=>n(()=>_crudifyadmin2.default.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>_crudifyadmin2.default.updateActionsProfiles(e))};exports.AuthRoute = F; exports.CRITICAL_TRANSLATIONS = _chunkN6OQJOCMjs.a; exports.CrudiaAutoGenerate = _chunkN6OQJOCMjs.o; exports.CrudiaFileField = _chunkN6OQJOCMjs.p; exports.CrudiaMarkdownField = _chunkN6OQJOCMjs.q; exports.CrudifyInitializationManager = _chunk4Z2XAMJAjs.n; exports.CrudifyInitializer = tr; exports.CrudifyLogin = _chunkN6OQJOCMjs.h; exports.CrudifyProvider = _chunk4Z2XAMJAjs.b; exports.CrudifyThemeProvider = Ve; exports.ERROR_CODES = _chunkYIIUEOXCjs.a; exports.ERROR_SEVERITY_MAP = _chunkYIIUEOXCjs.b; exports.GlobalNotificationProvider = _chunk4Z2XAMJAjs.g; exports.LoginComponent = _chunkN6OQJOCMjs.m; exports.POLICY_ACTIONS = _chunkN6OQJOCMjs.j; exports.PREFERRED_POLICY_ORDER = _chunkN6OQJOCMjs.k; exports.Policies = _chunkN6OQJOCMjs.l; exports.ProtectedRoute = w; exports.SessionDebugInfo = _chunk4Z2XAMJAjs.k; exports.SessionLoadingScreen = T; exports.SessionManager = _chunk4Z2XAMJAjs.e; exports.SessionProvider = _chunk4Z2XAMJAjs.i; exports.SessionStatus = _chunkN6OQJOCMjs.n; exports.TokenStorage = _chunk4Z2XAMJAjs.d; exports.TranslationService = _chunkN6OQJOCMjs.d; exports.TranslationsProvider = _chunkN6OQJOCMjs.f; exports.UserProfileDisplay = _chunkN6OQJOCMjs.i; exports.createErrorTranslator = _chunkNXXCVAVEjs.h; exports.crudify = _crudifybrowser2.default; exports.crudifyAdmin = pr; exports.crudifyInitManager = _chunk4Z2XAMJAjs.o; exports.decodeJwtSafely = _chunkNXXCVAVEjs.k; exports.extractSafeRedirectFromUrl = E; exports.getCookie = _chunkNXXCVAVEjs.b; exports.getCriticalLanguages = _chunkN6OQJOCMjs.b; exports.getCriticalTranslations = _chunkN6OQJOCMjs.c; exports.getCurrentUserEmail = _chunkNXXCVAVEjs.l; exports.getErrorMessage = _chunkYIIUEOXCjs.e; exports.handleCrudifyError = _chunkYIIUEOXCjs.g; exports.isTokenExpired = _chunkNXXCVAVEjs.m; exports.logger = _chunkNXXCVAVEjs.a; exports.parseApiError = _chunkYIIUEOXCjs.c; exports.parseJavaScriptError = _chunkYIIUEOXCjs.f; exports.parseTransactionError = _chunkYIIUEOXCjs.d; exports.secureLocalStorage = _chunkYLCEL2HEjs.b; exports.secureSessionStorage = _chunkYLCEL2HEjs.a; exports.translateError = _chunkNXXCVAVEjs.g; exports.translateErrorCode = _chunkNXXCVAVEjs.e; exports.translateErrorCodes = _chunkNXXCVAVEjs.f; exports.translationService = _chunkN6OQJOCMjs.e; exports.useAuth = _chunkEXXKBYWYjs.b; exports.useAutoGenerate = _chunk4Z2XAMJAjs.m; exports.useCrudify = _chunk4Z2XAMJAjs.c; exports.useCrudifyInitializer = ir; exports.useCrudifyWithNotifications = _chunkEXXKBYWYjs.d; exports.useData = _chunkEXXKBYWYjs.c; exports.useFileUpload = _chunk4Z2XAMJAjs.p; exports.useGlobalNotification = _chunk4Z2XAMJAjs.h; exports.useSession = _chunk4Z2XAMJAjs.f; exports.useSessionContext = _chunk4Z2XAMJAjs.j; exports.useTranslations = _chunkN6OQJOCMjs.g; exports.useUserData = _chunkEXXKBYWYjs.a; exports.useUserProfile = _chunk4Z2XAMJAjs.l; exports.validateInternalRedirect = h;
|
|
6
|
+
`});function T({stage:e="loading",message:r}){let t=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, qe,{}),_jsxruntime.jsxs.call(void 0, "div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[_jsxruntime.jsx.call(void 0, "div",{style:He}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:t})]})]})}var Je=/^[a-zA-Z0-9\-_./\?=&%#]+$/,$e=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],h= exports.validateInternalRedirect =(e,r="/")=>{if(!e||typeof e!="string")return r;let o=e.trim();if(!o)return r;if(!o.startsWith("/"))return _chunk34FAL7YWjs.a.warn("Open redirect blocked (relative path)",{path:e}),r;if(!Je.test(o))return _chunk34FAL7YWjs.a.warn("Open redirect blocked (invalid characters)",{path:e}),r;let t=o.toLowerCase();for(let p of $e)if(p.test(t))return _chunk34FAL7YWjs.a.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let s=o.split("?")[0].split("/").filter(Boolean);if(s.length===0)return o;for(let p of s)if(p===".."||p.includes(":")||p.length>100)return _chunk34FAL7YWjs.a.warn("Open redirect blocked (suspicious path part)",{part:p}),r;return o},E= exports.extractSafeRedirectFromUrl =(e,r="/")=>{try{let t=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!t)return r;let s=decodeURIComponent(t);return h(s,r)}catch(o){return _chunk34FAL7YWjs.a.warn("Error parsing redirect parameter",o instanceof Error?{errorMessage:o.message}:{message:String(o)}),r}};function w({children:e,loadingComponent:r,loginPath:o="/login"}){let{isAuthenticated:t,isLoading:s,isInitialized:p,tokens:d,error:y}=_chunkAKTAAP5Ijs.j.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!p||s)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, T,{stage:"validating-session"})});let l=t&&_optionalChain([d, 'optionalAccess', _2 => _2.accessToken])&&d.accessToken.length>0;if(y||!t||!l){d&&(!d.accessToken||d.accessToken.length===0)&&localStorage.removeItem("crudify_tokens");let A=u.pathname+u.search,x=h(A),C=encodeURIComponent(x);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${o}?redirect=${C}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}function F({children:e,redirectTo:r="/"}){let{isAuthenticated:o}=_chunkAKTAAP5Ijs.j.call(void 0, ),t=_reactrouterdom.useLocation.call(void 0, );if(o){let s=new URLSearchParams(t.search),p=E(s,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:p,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var D=_react.createContext.call(void 0, void 0),tr= exports.CrudifyInitializer =({config:e,children:r,fallback:o=null,onInitialized:t,onError:s})=>{let[p,d]=_react.useState.call(void 0, !1),[y,u]=_react.useState.call(void 0, !1),[l,A]=_react.useState.call(void 0, null),x=_react.useRef.call(void 0, !1),C=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{x.current||(_chunkAKTAAP5Ijs.o.registerHighPriorityInitializer(),x.current=!0),C.current||(C.current=!0,(async()=>{u(!0),A(null);try{let c=_chunk34FAL7YWjs.c.call(void 0, {publicApiKey:_optionalChain([e, 'optionalAccess', _3 => _3.publicApiKey]),env:_optionalChain([e, 'optionalAccess', _4 => _4.env]),enableDebug:_optionalChain([e, 'optionalAccess', _5 => _5.enableLogging])});if(!c.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let P=c.env||"prod";_chunk34FAL7YWjs.a.setEnvironment(P),await _chunkAKTAAP5Ijs.o.initialize({priority:"HIGH",publicApiKey:c.publicApiKey,env:c.env||"prod",enableLogging:_optionalChain([e, 'optionalAccess', _6 => _6.enableLogging]),requestedBy:"CrudifyInitializer"}),d(!0),u(!1),t&&t()}catch(c){let P=c instanceof Error?c:new Error(String(c));A(P),u(!1),s&&s(P)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),t,s]);let K={isInitialized:p,isInitializing:y,error:l};return y&&o?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o}):(l&&_chunk34FAL7YWjs.a.error("[CrudifyInitializer] Initialization failed",l),_jsxruntime.jsx.call(void 0, D.Provider,{value:K,children:r}))},ir= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, D);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};var _crudifyadmin = require('@nocios/crudify-admin'); var _crudifyadmin2 = _interopRequireDefault(_crudifyadmin);var G=!1,g=null;async function sr(){let r=_chunkAKTAAP5Ijs.e.getInstance().getTokenInfo(),o=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),t=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return o&&t?{apiUrl:o,apiKey:t}:_chunkAKTAAP5Ijs.a.waitForCredentials()}async function ar(){if(!G)return g||(g=(async()=>{try{let e=_chunkAKTAAP5Ijs.e.getInstance(),{apiUrl:r,apiKey:o}=await sr();_crudifyadmin2.default.init({url:r,apiKey:o,getAdditionalHeaders:()=>{let t=e.getTokenInfo();return _optionalChain([t, 'optionalAccess', _12 => _12.crudifyTokens, 'optionalAccess', _13 => _13.accessToken])?{Authorization:`Bearer ${t.crudifyTokens.accessToken}`}:{}}}),G=!0}catch(e){throw g=null,_chunk34FAL7YWjs.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),g)}async function n(e){try{await ar();let r=await e(),o=r.errors&&(typeof r.errors=="string"&&r.errors.includes("401")||Array.isArray(r.errors)&&r.errors.some(t=>typeof t=="string"&&t.includes("401")));return!r.success&&o?await _chunkAKTAAP5Ijs.e.getInstance().refreshTokens()?await e():(_chunk34FAL7YWjs.a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),r):r}catch(r){return _chunk34FAL7YWjs.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var pr={listModules:()=>n(()=>_crudifyadmin2.default.listModules()),getModule:e=>n(()=>_crudifyadmin2.default.getModule(e)),createModule:e=>n(()=>_crudifyadmin2.default.createModule(e)),editModule:(e,r)=>n(()=>_crudifyadmin2.default.editModule(e,r)),deleteModule:e=>n(()=>_crudifyadmin2.default.deleteModule(e)),activateModule:e=>n(()=>_crudifyadmin2.default.activateModule(e)),deactivateModule:e=>n(()=>_crudifyadmin2.default.deactivateModule(e)),getModuleVersions:e=>n(()=>_crudifyadmin2.default.getModuleVersions(e)),listActions:e=>n(()=>_crudifyadmin2.default.listActions(e)),getAction:e=>n(()=>_crudifyadmin2.default.getAction(e)),createAction:e=>n(()=>_crudifyadmin2.default.createAction(e)),editAction:(e,r)=>n(()=>_crudifyadmin2.default.editAction(e,r)),deleteAction:e=>n(()=>_crudifyadmin2.default.deleteAction(e)),activateAction:e=>n(()=>_crudifyadmin2.default.activateAction(e)),deactivateAction:e=>n(()=>_crudifyadmin2.default.deactivateAction(e)),getActionVersions:e=>n(()=>_crudifyadmin2.default.getActionVersions(e)),getActionsByProfile:e=>n(()=>_crudifyadmin2.default.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>_crudifyadmin2.default.updateActionsProfiles(e))};exports.AuthRoute = F; exports.CRITICAL_TRANSLATIONS = _chunkQCGDLS4Djs.a; exports.CrudiaAutoGenerate = _chunkQCGDLS4Djs.o; exports.CrudiaFileField = _chunkQCGDLS4Djs.p; exports.CrudiaMarkdownField = _chunkQCGDLS4Djs.q; exports.CrudifyInitializationManager = _chunkAKTAAP5Ijs.n; exports.CrudifyInitializer = tr; exports.CrudifyLogin = _chunkQCGDLS4Djs.h; exports.CrudifyProvider = _chunkAKTAAP5Ijs.b; exports.CrudifyThemeProvider = Ve; exports.ERROR_CODES = _chunkYIIUEOXCjs.a; exports.ERROR_SEVERITY_MAP = _chunkYIIUEOXCjs.b; exports.GlobalNotificationProvider = _chunkAKTAAP5Ijs.g; exports.LoginComponent = _chunkQCGDLS4Djs.m; exports.POLICY_ACTIONS = _chunkQCGDLS4Djs.j; exports.PREFERRED_POLICY_ORDER = _chunkQCGDLS4Djs.k; exports.Policies = _chunkQCGDLS4Djs.l; exports.ProtectedRoute = w; exports.SessionDebugInfo = _chunkAKTAAP5Ijs.k; exports.SessionLoadingScreen = T; exports.SessionManager = _chunkAKTAAP5Ijs.e; exports.SessionProvider = _chunkAKTAAP5Ijs.i; exports.SessionStatus = _chunkQCGDLS4Djs.n; exports.TokenStorage = _chunkAKTAAP5Ijs.d; exports.TranslationService = _chunkQCGDLS4Djs.d; exports.TranslationsProvider = _chunkQCGDLS4Djs.f; exports.UserProfileDisplay = _chunkQCGDLS4Djs.i; exports.createErrorTranslator = _chunk34FAL7YWjs.h; exports.crudify = _crudifybrowser2.default; exports.crudifyAdmin = pr; exports.crudifyInitManager = _chunkAKTAAP5Ijs.o; exports.decodeJwtSafely = _chunk34FAL7YWjs.k; exports.extractSafeRedirectFromUrl = E; exports.getCookie = _chunk34FAL7YWjs.b; exports.getCriticalLanguages = _chunkQCGDLS4Djs.b; exports.getCriticalTranslations = _chunkQCGDLS4Djs.c; exports.getCurrentUserEmail = _chunk34FAL7YWjs.l; exports.getErrorMessage = _chunkYIIUEOXCjs.e; exports.handleCrudifyError = _chunkYIIUEOXCjs.g; exports.isTokenExpired = _chunk34FAL7YWjs.m; exports.logger = _chunk34FAL7YWjs.a; exports.parseApiError = _chunkYIIUEOXCjs.c; exports.parseJavaScriptError = _chunkYIIUEOXCjs.f; exports.parseTransactionError = _chunkYIIUEOXCjs.d; exports.secureLocalStorage = _chunkARGPCO6Ijs.b; exports.secureSessionStorage = _chunkARGPCO6Ijs.a; exports.translateError = _chunk34FAL7YWjs.g; exports.translateErrorCode = _chunk34FAL7YWjs.e; exports.translateErrorCodes = _chunk34FAL7YWjs.f; exports.translationService = _chunkQCGDLS4Djs.e; exports.useAuth = _chunkFRLGHMXEjs.b; exports.useAutoGenerate = _chunkAKTAAP5Ijs.m; exports.useCrudify = _chunkAKTAAP5Ijs.c; exports.useCrudifyInitializer = ir; exports.useCrudifyWithNotifications = _chunkFRLGHMXEjs.d; exports.useData = _chunkFRLGHMXEjs.c; exports.useFileUpload = _chunkAKTAAP5Ijs.p; exports.useGlobalNotification = _chunkAKTAAP5Ijs.h; exports.useSession = _chunkAKTAAP5Ijs.f; exports.useSessionContext = _chunkAKTAAP5Ijs.j; exports.useTranslations = _chunkQCGDLS4Djs.g; exports.useUserData = _chunkFRLGHMXEjs.a; exports.useUserProfile = _chunkAKTAAP5Ijs.l; exports.validateInternalRedirect = h;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as V,b as _,c as B,d as H,e as q,f as W,g as J,h as ye,i as xe,j as Ce,k as Pe,l as Re,m as Ie,n as he,o as ve,p as Me,q as ze}from"./chunk-
|
|
1
|
+
import{a as V,b as _,c as B,d as H,e as q,f as W,g as J,h as ye,i as xe,j as Ce,k as Pe,l as Re,m as Ie,n as he,o as ve,p as Me,q as ze}from"./chunk-EHDTUR6X.mjs";import{a as ke,b as Le,c as be,d as Fe}from"./chunk-3NGJBTRH.mjs";import{a as k,b as $,c as Y,d as Z,e as f,f as re,g as ne,h as se,i as ae,j as m,k as pe,l as Ae,m as Se,n as Te,o as R,p as Ee}from"./chunk-G5OBPMIH.mjs";import{a as we,b as Ue}from"./chunk-FRHTVRUM.mjs";import{a as ce,b as de,c as ue,d as le,e as fe,f as me,g as ge}from"./chunk-BJ6PIVZR.mjs";import{a,b as v,c as z,e as Q,f as X,g as j,h as ee,k as oe,l as te,m as ie}from"./chunk-SUWV767V.mjs";import{default as Zr}from"@nocios/crudify-browser";export*from"@nocios/crudify-browser";import{useMemo as Oe}from"react";import{ThemeProvider as Ne,createTheme as De,CssBaseline as Ge}from"@mui/material";import{jsx as _e,jsxs as Be}from"react/jsx-runtime";var Ke=(e={})=>{try{let r=v("theme");if(r){let o=JSON.parse(decodeURIComponent(r));return{...e,...o}}}catch(r){a.warn("Error parsing theme from cookie",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function Ve({children:e,defaultTheme:r={},disableCssBaseline:o=!1}){let t=Oe(()=>{let s=Ke(r);return De(s)},[r]);return Be(Ne,{theme:t,children:[!o&&_e(Ge,{}),e]})}import{Navigate as Ye,useLocation as Ze}from"react-router-dom";import{Fragment as We,jsx as I,jsxs as L}from"react/jsx-runtime";var He={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},qe=()=>I("style",{children:`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
0% { transform: rotate(0deg); }
|
|
4
4
|
100% { transform: rotate(360deg); }
|
|
5
5
|
}
|
|
6
|
-
`});function T({stage:e="loading",message:r}){let t=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return L(We,{children:[I(qe,{}),L("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[I("div",{style:He}),I("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:t})]})]})}var Je=/^[a-zA-Z0-9\-_./\?=&%#]+$/,$e=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],h=(e,r="/")=>{if(!e||typeof e!="string")return r;let o=e.trim();if(!o)return r;if(!o.startsWith("/"))return
|
|
6
|
+
`});function T({stage:e="loading",message:r}){let t=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return L(We,{children:[I(qe,{}),L("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[I("div",{style:He}),I("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:t})]})]})}var Je=/^[a-zA-Z0-9\-_./\?=&%#]+$/,$e=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],h=(e,r="/")=>{if(!e||typeof e!="string")return r;let o=e.trim();if(!o)return r;if(!o.startsWith("/"))return a.warn("Open redirect blocked (relative path)",{path:e}),r;if(!Je.test(o))return a.warn("Open redirect blocked (invalid characters)",{path:e}),r;let t=o.toLowerCase();for(let p of $e)if(p.test(t))return a.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let s=o.split("?")[0].split("/").filter(Boolean);if(s.length===0)return o;for(let p of s)if(p===".."||p.includes(":")||p.length>100)return a.warn("Open redirect blocked (suspicious path part)",{part:p}),r;return o},E=(e,r="/")=>{try{let t=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!t)return r;let s=decodeURIComponent(t);return h(s,r)}catch(o){return a.warn("Error parsing redirect parameter",o instanceof Error?{errorMessage:o.message}:{message:String(o)}),r}};import{Fragment as b,jsx as S}from"react/jsx-runtime";function w({children:e,loadingComponent:r,loginPath:o="/login"}){let{isAuthenticated:t,isLoading:s,isInitialized:p,tokens:d,error:y}=m(),u=Ze();if(!p||s)return S(b,{children:r||S(T,{stage:"validating-session"})});let l=t&&d?.accessToken&&d.accessToken.length>0;if(y||!t||!l){d&&(!d.accessToken||d.accessToken.length===0)&&localStorage.removeItem("crudify_tokens");let A=u.pathname+u.search,x=h(A),C=encodeURIComponent(x);return S(Ye,{to:`${o}?redirect=${C}`,replace:!0})}return S(b,{children:e})}import{Navigate as Qe,useLocation as Xe}from"react-router-dom";import{Fragment as je,jsx as U}from"react/jsx-runtime";function F({children:e,redirectTo:r="/"}){let{isAuthenticated:o}=m(),t=Xe();if(o){let s=new URLSearchParams(t.search),p=E(s,r);return U(Qe,{to:p,replace:!0})}return U(je,{children:e})}import{createContext as er,useContext as rr,useEffect as or,useRef as O,useState as M}from"react";import{Fragment as nr,jsx as N}from"react/jsx-runtime";var D=er(void 0),tr=({config:e,children:r,fallback:o=null,onInitialized:t,onError:s})=>{let[p,d]=M(!1),[y,u]=M(!1),[l,A]=M(null),x=O(!1),C=O(!1);or(()=>{x.current||(R.registerHighPriorityInitializer(),x.current=!0),C.current||(C.current=!0,(async()=>{u(!0),A(null);try{let c=z({publicApiKey:e?.publicApiKey,env:e?.env,enableDebug:e?.enableLogging});if(!c.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let P=c.env||"prod";a.setEnvironment(P),await R.initialize({priority:"HIGH",publicApiKey:c.publicApiKey,env:c.env||"prod",enableLogging:e?.enableLogging,requestedBy:"CrudifyInitializer"}),d(!0),u(!1),t&&t()}catch(c){let P=c instanceof Error?c:new Error(String(c));A(P),u(!1),s&&s(P)}})())},[e?.publicApiKey,e?.env,e?.enableLogging,t,s]);let K={isInitialized:p,isInitializing:y,error:l};return y&&o?N(nr,{children:o}):(l&&a.error("[CrudifyInitializer] Initialization failed",l),N(D.Provider,{value:K,children:r}))},ir=()=>{let e=rr(D);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};import i from"@nocios/crudify-admin";var G=!1,g=null;async function sr(){let r=f.getInstance().getTokenInfo(),o=r?.apiEndpointAdmin,t=r?.apiKeyEndpointAdmin;return o&&t?{apiUrl:o,apiKey:t}:k.waitForCredentials()}async function ar(){if(!G)return g||(g=(async()=>{try{let e=f.getInstance(),{apiUrl:r,apiKey:o}=await sr();i.init({url:r,apiKey:o,getAdditionalHeaders:()=>{let t=e.getTokenInfo();return t?.crudifyTokens?.accessToken?{Authorization:`Bearer ${t.crudifyTokens.accessToken}`}:{}}}),G=!0}catch(e){throw g=null,a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),g)}async function n(e){try{await ar();let r=await e(),o=r.errors&&(typeof r.errors=="string"&&r.errors.includes("401")||Array.isArray(r.errors)&&r.errors.some(t=>typeof t=="string"&&t.includes("401")));return!r.success&&o?await f.getInstance().refreshTokens()?await e():(a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),r):r}catch(r){return a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var pr={listModules:()=>n(()=>i.listModules()),getModule:e=>n(()=>i.getModule(e)),createModule:e=>n(()=>i.createModule(e)),editModule:(e,r)=>n(()=>i.editModule(e,r)),deleteModule:e=>n(()=>i.deleteModule(e)),activateModule:e=>n(()=>i.activateModule(e)),deactivateModule:e=>n(()=>i.deactivateModule(e)),getModuleVersions:e=>n(()=>i.getModuleVersions(e)),listActions:e=>n(()=>i.listActions(e)),getAction:e=>n(()=>i.getAction(e)),createAction:e=>n(()=>i.createAction(e)),editAction:(e,r)=>n(()=>i.editAction(e,r)),deleteAction:e=>n(()=>i.deleteAction(e)),activateAction:e=>n(()=>i.activateAction(e)),deactivateAction:e=>n(()=>i.deactivateAction(e)),getActionVersions:e=>n(()=>i.getActionVersions(e)),getActionsByProfile:e=>n(()=>i.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>i.updateActionsProfiles(e))};export{F as AuthRoute,V as CRITICAL_TRANSLATIONS,ve as CrudiaAutoGenerate,Me as CrudiaFileField,ze as CrudiaMarkdownField,Te as CrudifyInitializationManager,tr as CrudifyInitializer,ye as CrudifyLogin,$ as CrudifyProvider,Ve as CrudifyThemeProvider,ce as ERROR_CODES,de as ERROR_SEVERITY_MAP,ne as GlobalNotificationProvider,Ie as LoginComponent,Ce as POLICY_ACTIONS,Pe as PREFERRED_POLICY_ORDER,Re as Policies,w as ProtectedRoute,pe as SessionDebugInfo,T as SessionLoadingScreen,f as SessionManager,ae as SessionProvider,he as SessionStatus,Z as TokenStorage,H as TranslationService,W as TranslationsProvider,xe as UserProfileDisplay,ee as createErrorTranslator,Zr as crudify,pr as crudifyAdmin,R as crudifyInitManager,oe as decodeJwtSafely,E as extractSafeRedirectFromUrl,v as getCookie,_ as getCriticalLanguages,B as getCriticalTranslations,te as getCurrentUserEmail,fe as getErrorMessage,ge as handleCrudifyError,ie as isTokenExpired,a as logger,ue as parseApiError,me as parseJavaScriptError,le as parseTransactionError,Ue as secureLocalStorage,we as secureSessionStorage,j as translateError,Q as translateErrorCode,X as translateErrorCodes,q as translationService,Le as useAuth,Se as useAutoGenerate,Y as useCrudify,ir as useCrudifyInitializer,Fe as useCrudifyWithNotifications,be as useData,Ee as useFileUpload,se as useGlobalNotification,re as useSession,m as useSessionContext,J as useTranslations,ke as useUserData,Ae as useUserProfile,h as validateInternalRedirect};
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-
|
|
2
|
-
import './api-
|
|
1
|
+
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-B4wcHzD3.mjs';
|
|
2
|
+
import './api-RK-xY1Ah.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Sistema centralizado de resolución de configuración para npm-crudify-ui
|
|
@@ -59,7 +59,7 @@ declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedCon
|
|
|
59
59
|
type AuthEventType = "SESSION_EXPIRED" | "TOKEN_REFRESH_FAILED" | "UNAUTHORIZED" | "TOKEN_EXPIRED";
|
|
60
60
|
type AuthEventDetails = {
|
|
61
61
|
message?: string;
|
|
62
|
-
error?:
|
|
62
|
+
error?: unknown;
|
|
63
63
|
source?: string;
|
|
64
64
|
};
|
|
65
65
|
type AuthEvent = {
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-
|
|
2
|
-
import './api-
|
|
1
|
+
export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-CCC5IWoN.js';
|
|
2
|
+
import './api-RK-xY1Ah.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Sistema centralizado de resolución de configuración para npm-crudify-ui
|
|
@@ -59,7 +59,7 @@ declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedCon
|
|
|
59
59
|
type AuthEventType = "SESSION_EXPIRED" | "TOKEN_REFRESH_FAILED" | "UNAUTHORIZED" | "TOKEN_EXPIRED";
|
|
60
60
|
type AuthEventDetails = {
|
|
61
61
|
message?: string;
|
|
62
|
-
error?:
|
|
62
|
+
error?: unknown;
|
|
63
63
|
source?: string;
|
|
64
64
|
};
|
|
65
65
|
type AuthEvent = {
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkARGPCO6Ijs = require('./chunk-ARGPCO6I.js');var _chunkYIIUEOXCjs = require('./chunk-YIIUEOXC.js');var _chunk34FAL7YWjs = require('./chunk-34FAL7YW.js');exports.ERROR_CODES = _chunkYIIUEOXCjs.a; exports.ERROR_SEVERITY_MAP = _chunkYIIUEOXCjs.b; exports.NavigationTracker = _chunk34FAL7YWjs.j; exports.authEventBus = _chunk34FAL7YWjs.i; exports.createErrorTranslator = _chunk34FAL7YWjs.h; exports.decodeJwtSafely = _chunk34FAL7YWjs.k; exports.getCookie = _chunk34FAL7YWjs.b; exports.getCurrentUserEmail = _chunk34FAL7YWjs.l; exports.getErrorMessage = _chunkYIIUEOXCjs.e; exports.handleCrudifyError = _chunkYIIUEOXCjs.g; exports.isTokenExpired = _chunk34FAL7YWjs.m; exports.parseApiError = _chunkYIIUEOXCjs.c; exports.parseJavaScriptError = _chunkYIIUEOXCjs.f; exports.parseTransactionError = _chunkYIIUEOXCjs.d; exports.resolveConfig = _chunk34FAL7YWjs.c; exports.secureLocalStorage = _chunkARGPCO6Ijs.b; exports.secureSessionStorage = _chunkARGPCO6Ijs.a; exports.translateError = _chunk34FAL7YWjs.g; exports.translateErrorCode = _chunk34FAL7YWjs.e; exports.translateErrorCodes = _chunk34FAL7YWjs.f; exports.useResolvedConfig = _chunk34FAL7YWjs.d;
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as c}from"./chunk-
|
|
1
|
+
import{a as R,b as c}from"./chunk-FRHTVRUM.mjs";import{a as m,b as v,c as d,d as g,e as u,f as x,g as C}from"./chunk-BJ6PIVZR.mjs";import{b as r,c as e,d as o,e as t,f as a,g as n,h as s,i as E,j as i,k as p,l as f,m as l}from"./chunk-SUWV767V.mjs";export{m as ERROR_CODES,v as ERROR_SEVERITY_MAP,i as NavigationTracker,E as authEventBus,s as createErrorTranslator,p as decodeJwtSafely,r as getCookie,f as getCurrentUserEmail,u as getErrorMessage,C as handleCrudifyError,l as isTokenExpired,d as parseApiError,x as parseJavaScriptError,g as parseTransactionError,e as resolveConfig,c as secureLocalStorage,R as secureSessionStorage,n as translateError,t as translateErrorCode,a as translateErrorCodes,o as useResolvedConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocios/crudify-ui",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.78",
|
|
4
4
|
"description": "Biblioteca de componentes UI para Crudify",
|
|
5
5
|
"author": "Nocios",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@mdxeditor/editor": "^3.52.0",
|
|
43
|
-
"@nocios/crudify-admin": "^2.2.
|
|
44
|
-
"@nocios/crudify-browser": "^4.1.
|
|
43
|
+
"@nocios/crudify-admin": "^2.2.4",
|
|
44
|
+
"@nocios/crudify-browser": "^4.1.26",
|
|
45
45
|
"crypto-js": "^4.2.0",
|
|
46
46
|
"dompurify": "^3.2.7",
|
|
47
47
|
"uuid": "^13.0.0"
|
package/coverage/base.css
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
body, html {
|
|
2
|
-
margin:0; padding: 0;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
body {
|
|
6
|
-
font-family: Helvetica Neue, Helvetica, Arial;
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
color:#333;
|
|
9
|
-
}
|
|
10
|
-
.small { font-size: 12px; }
|
|
11
|
-
*, *:after, *:before {
|
|
12
|
-
-webkit-box-sizing:border-box;
|
|
13
|
-
-moz-box-sizing:border-box;
|
|
14
|
-
box-sizing:border-box;
|
|
15
|
-
}
|
|
16
|
-
h1 { font-size: 20px; margin: 0;}
|
|
17
|
-
h2 { font-size: 14px; }
|
|
18
|
-
pre {
|
|
19
|
-
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
20
|
-
margin: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
-moz-tab-size: 2;
|
|
23
|
-
-o-tab-size: 2;
|
|
24
|
-
tab-size: 2;
|
|
25
|
-
}
|
|
26
|
-
a { color:#0074D9; text-decoration:none; }
|
|
27
|
-
a:hover { text-decoration:underline; }
|
|
28
|
-
.strong { font-weight: bold; }
|
|
29
|
-
.space-top1 { padding: 10px 0 0 0; }
|
|
30
|
-
.pad2y { padding: 20px 0; }
|
|
31
|
-
.pad1y { padding: 10px 0; }
|
|
32
|
-
.pad2x { padding: 0 20px; }
|
|
33
|
-
.pad2 { padding: 20px; }
|
|
34
|
-
.pad1 { padding: 10px; }
|
|
35
|
-
.space-left2 { padding-left:55px; }
|
|
36
|
-
.space-right2 { padding-right:20px; }
|
|
37
|
-
.center { text-align:center; }
|
|
38
|
-
.clearfix { display:block; }
|
|
39
|
-
.clearfix:after {
|
|
40
|
-
content:'';
|
|
41
|
-
display:block;
|
|
42
|
-
height:0;
|
|
43
|
-
clear:both;
|
|
44
|
-
visibility:hidden;
|
|
45
|
-
}
|
|
46
|
-
.fl { float: left; }
|
|
47
|
-
@media only screen and (max-width:640px) {
|
|
48
|
-
.col3 { width:100%; max-width:100%; }
|
|
49
|
-
.hide-mobile { display:none!important; }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.quiet {
|
|
53
|
-
color: #7f7f7f;
|
|
54
|
-
color: rgba(0,0,0,0.5);
|
|
55
|
-
}
|
|
56
|
-
.quiet a { opacity: 0.7; }
|
|
57
|
-
|
|
58
|
-
.fraction {
|
|
59
|
-
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
60
|
-
font-size: 10px;
|
|
61
|
-
color: #555;
|
|
62
|
-
background: #E8E8E8;
|
|
63
|
-
padding: 4px 5px;
|
|
64
|
-
border-radius: 3px;
|
|
65
|
-
vertical-align: middle;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
div.path a:link, div.path a:visited { color: #333; }
|
|
69
|
-
table.coverage {
|
|
70
|
-
border-collapse: collapse;
|
|
71
|
-
margin: 10px 0 0 0;
|
|
72
|
-
padding: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
table.coverage td {
|
|
76
|
-
margin: 0;
|
|
77
|
-
padding: 0;
|
|
78
|
-
vertical-align: top;
|
|
79
|
-
}
|
|
80
|
-
table.coverage td.line-count {
|
|
81
|
-
text-align: right;
|
|
82
|
-
padding: 0 5px 0 20px;
|
|
83
|
-
}
|
|
84
|
-
table.coverage td.line-coverage {
|
|
85
|
-
text-align: right;
|
|
86
|
-
padding-right: 10px;
|
|
87
|
-
min-width:20px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
table.coverage td span.cline-any {
|
|
91
|
-
display: inline-block;
|
|
92
|
-
padding: 0 5px;
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
.missing-if-branch {
|
|
96
|
-
display: inline-block;
|
|
97
|
-
margin-right: 5px;
|
|
98
|
-
border-radius: 3px;
|
|
99
|
-
position: relative;
|
|
100
|
-
padding: 0 4px;
|
|
101
|
-
background: #333;
|
|
102
|
-
color: yellow;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.skip-if-branch {
|
|
106
|
-
display: none;
|
|
107
|
-
margin-right: 10px;
|
|
108
|
-
position: relative;
|
|
109
|
-
padding: 0 4px;
|
|
110
|
-
background: #ccc;
|
|
111
|
-
color: white;
|
|
112
|
-
}
|
|
113
|
-
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
114
|
-
color: inherit !important;
|
|
115
|
-
}
|
|
116
|
-
.coverage-summary {
|
|
117
|
-
border-collapse: collapse;
|
|
118
|
-
width: 100%;
|
|
119
|
-
}
|
|
120
|
-
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
121
|
-
.keyline-all { border: 1px solid #ddd; }
|
|
122
|
-
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
123
|
-
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
124
|
-
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
125
|
-
.coverage-summary td:last-child { border-right: none; }
|
|
126
|
-
.coverage-summary th {
|
|
127
|
-
text-align: left;
|
|
128
|
-
font-weight: normal;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
}
|
|
131
|
-
.coverage-summary th.file { border-right: none !important; }
|
|
132
|
-
.coverage-summary th.pct { }
|
|
133
|
-
.coverage-summary th.pic,
|
|
134
|
-
.coverage-summary th.abs,
|
|
135
|
-
.coverage-summary td.pct,
|
|
136
|
-
.coverage-summary td.abs { text-align: right; }
|
|
137
|
-
.coverage-summary td.file { white-space: nowrap; }
|
|
138
|
-
.coverage-summary td.pic { min-width: 120px !important; }
|
|
139
|
-
.coverage-summary tfoot td { }
|
|
140
|
-
|
|
141
|
-
.coverage-summary .sorter {
|
|
142
|
-
height: 10px;
|
|
143
|
-
width: 7px;
|
|
144
|
-
display: inline-block;
|
|
145
|
-
margin-left: 0.5em;
|
|
146
|
-
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
147
|
-
}
|
|
148
|
-
.coverage-summary .sorted .sorter {
|
|
149
|
-
background-position: 0 -20px;
|
|
150
|
-
}
|
|
151
|
-
.coverage-summary .sorted-desc .sorter {
|
|
152
|
-
background-position: 0 -10px;
|
|
153
|
-
}
|
|
154
|
-
.status-line { height: 10px; }
|
|
155
|
-
/* yellow */
|
|
156
|
-
.cbranch-no { background: yellow !important; color: #111; }
|
|
157
|
-
/* dark red */
|
|
158
|
-
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
159
|
-
.low .chart { border:1px solid #C21F39 }
|
|
160
|
-
.highlighted,
|
|
161
|
-
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
|
|
162
|
-
background: #C21F39 !important;
|
|
163
|
-
}
|
|
164
|
-
/* medium red */
|
|
165
|
-
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
166
|
-
/* light red */
|
|
167
|
-
.low, .cline-no { background:#FCE1E5 }
|
|
168
|
-
/* light green */
|
|
169
|
-
.high, .cline-yes { background:rgb(230,245,208) }
|
|
170
|
-
/* medium green */
|
|
171
|
-
.cstat-yes { background:rgb(161,215,106) }
|
|
172
|
-
/* dark green */
|
|
173
|
-
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
174
|
-
.high .chart { border:1px solid rgb(77,146,33) }
|
|
175
|
-
/* dark yellow (gold) */
|
|
176
|
-
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
|
177
|
-
.medium .chart { border:1px solid #f9cd0b; }
|
|
178
|
-
/* light yellow */
|
|
179
|
-
.medium { background: #fff4c2; }
|
|
180
|
-
|
|
181
|
-
.cstat-skip { background: #ddd; color: #111; }
|
|
182
|
-
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
183
|
-
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
184
|
-
|
|
185
|
-
span.cline-neutral { background: #eaeaea; }
|
|
186
|
-
|
|
187
|
-
.coverage-summary td.empty {
|
|
188
|
-
opacity: .5;
|
|
189
|
-
padding-top: 4px;
|
|
190
|
-
padding-bottom: 4px;
|
|
191
|
-
line-height: 1;
|
|
192
|
-
color: #888;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.cover-fill, .cover-empty {
|
|
196
|
-
display:inline-block;
|
|
197
|
-
height: 12px;
|
|
198
|
-
}
|
|
199
|
-
.chart {
|
|
200
|
-
line-height: 0;
|
|
201
|
-
}
|
|
202
|
-
.cover-empty {
|
|
203
|
-
background: white;
|
|
204
|
-
}
|
|
205
|
-
.cover-full {
|
|
206
|
-
border-right: none !important;
|
|
207
|
-
}
|
|
208
|
-
pre.prettyprint {
|
|
209
|
-
border: none !important;
|
|
210
|
-
padding: 0 !important;
|
|
211
|
-
margin: 0 !important;
|
|
212
|
-
}
|
|
213
|
-
.com { color: #999 !important; }
|
|
214
|
-
.ignore-none { color: #999; font-weight: normal; }
|
|
215
|
-
|
|
216
|
-
.wrapper {
|
|
217
|
-
min-height: 100%;
|
|
218
|
-
height: auto !important;
|
|
219
|
-
height: 100%;
|
|
220
|
-
margin: 0 auto -48px;
|
|
221
|
-
}
|
|
222
|
-
.footer, .push {
|
|
223
|
-
height: 48px;
|
|
224
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
var jumpToCode = (function init() {
|
|
3
|
-
// Classes of code we would like to highlight in the file view
|
|
4
|
-
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
|
5
|
-
|
|
6
|
-
// Elements to highlight in the file listing view
|
|
7
|
-
var fileListingElements = ['td.pct.low'];
|
|
8
|
-
|
|
9
|
-
// We don't want to select elements that are direct descendants of another match
|
|
10
|
-
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
|
-
|
|
12
|
-
// Selector that finds elements on the page to which we can jump
|
|
13
|
-
var selector =
|
|
14
|
-
fileListingElements.join(', ') +
|
|
15
|
-
', ' +
|
|
16
|
-
notSelector +
|
|
17
|
-
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
|
18
|
-
|
|
19
|
-
// The NodeList of matching elements
|
|
20
|
-
var missingCoverageElements = document.querySelectorAll(selector);
|
|
21
|
-
|
|
22
|
-
var currentIndex;
|
|
23
|
-
|
|
24
|
-
function toggleClass(index) {
|
|
25
|
-
missingCoverageElements
|
|
26
|
-
.item(currentIndex)
|
|
27
|
-
.classList.remove('highlighted');
|
|
28
|
-
missingCoverageElements.item(index).classList.add('highlighted');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function makeCurrent(index) {
|
|
32
|
-
toggleClass(index);
|
|
33
|
-
currentIndex = index;
|
|
34
|
-
missingCoverageElements.item(index).scrollIntoView({
|
|
35
|
-
behavior: 'smooth',
|
|
36
|
-
block: 'center',
|
|
37
|
-
inline: 'center'
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function goToPrevious() {
|
|
42
|
-
var nextIndex = 0;
|
|
43
|
-
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
|
44
|
-
nextIndex = missingCoverageElements.length - 1;
|
|
45
|
-
} else if (missingCoverageElements.length > 1) {
|
|
46
|
-
nextIndex = currentIndex - 1;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
makeCurrent(nextIndex);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function goToNext() {
|
|
53
|
-
var nextIndex = 0;
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
typeof currentIndex === 'number' &&
|
|
57
|
-
currentIndex < missingCoverageElements.length - 1
|
|
58
|
-
) {
|
|
59
|
-
nextIndex = currentIndex + 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
makeCurrent(nextIndex);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return function jump(event) {
|
|
66
|
-
if (
|
|
67
|
-
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
-
document.activeElement != null
|
|
69
|
-
) {
|
|
70
|
-
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
switch (event.which) {
|
|
75
|
-
case 78: // n
|
|
76
|
-
case 74: // j
|
|
77
|
-
goToNext();
|
|
78
|
-
break;
|
|
79
|
-
case 66: // b
|
|
80
|
-
case 75: // k
|
|
81
|
-
case 80: // p
|
|
82
|
-
goToPrevious();
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
})();
|
|
87
|
-
window.addEventListener('keydown', jumpToCode);
|