@crownpeak/dqm-react-component 1.1.0 → 1.2.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 +16 -0
- package/README.md +52 -24
- package/dist/DQMSidebar.d.ts.map +1 -1
- package/dist/ErrorBoundary.d.ts.map +1 -1
- package/dist/__tests__/setup.d.ts +1 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/utils.d.ts +145 -0
- package/dist/__tests__/utils.d.ts.map +1 -0
- package/dist/auth-ui/assets/index-YKFZYENy.js +158 -0
- package/dist/auth-ui/index.html +1 -1
- package/dist/components/auth/DQMLogin.d.ts.map +1 -1
- package/dist/components/auth/index.d.ts +0 -1
- package/dist/components/auth/index.d.ts.map +1 -1
- package/dist/components/cards/AISummaryCard.d.ts +2 -0
- package/dist/components/cards/AISummaryCard.d.ts.map +1 -0
- package/dist/components/cards/index.d.ts +1 -0
- package/dist/components/cards/index.d.ts.map +1 -1
- package/dist/components/common/LanguageSwitch.d.ts +5 -0
- package/dist/components/common/LanguageSwitch.d.ts.map +1 -0
- package/dist/components/common/LanguageSwitchBase.d.ts +16 -0
- package/dist/components/common/LanguageSwitchBase.d.ts.map +1 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/index.d.ts.map +1 -1
- package/dist/components/modals/AISettingsDialog.d.ts +61 -0
- package/dist/components/modals/AISettingsDialog.d.ts.map +1 -0
- package/dist/components/modals/HighlightModal.d.ts +45 -0
- package/dist/components/modals/HighlightModal.d.ts.map +1 -0
- package/dist/components/modals/LoginOverlay.d.ts +22 -0
- package/dist/components/modals/LoginOverlay.d.ts.map +1 -0
- package/dist/components/modals/index.d.ts +9 -0
- package/dist/components/modals/index.d.ts.map +1 -0
- package/dist/components/renderers/BrowserViewRenderer.d.ts.map +1 -1
- package/dist/components/renderers/ShadowDOMRenderer.d.ts.map +1 -1
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/context/ai/AIContext.d.ts +13 -0
- package/dist/context/ai/AIContext.d.ts.map +1 -0
- package/dist/context/ai/index.d.ts +12 -0
- package/dist/context/ai/index.d.ts.map +1 -0
- package/dist/context/ai/types.d.ts +161 -0
- package/dist/context/ai/types.d.ts.map +1 -0
- package/dist/context/ai/useAIEngine.d.ts +10 -0
- package/dist/context/ai/useAIEngine.d.ts.map +1 -0
- package/dist/context/ai/useAISummary.d.ts +10 -0
- package/dist/context/ai/useAISummary.d.ts.map +1 -0
- package/dist/context/ai/useAITranslation.d.ts +10 -0
- package/dist/context/ai/useAITranslation.d.ts.map +1 -0
- package/dist/context/ai/useTranslationCache.d.ts +9 -0
- package/dist/context/ai/useTranslationCache.d.ts.map +1 -0
- package/dist/dqm-widget.esm.js +394 -264
- package/dist/dqm-widget.iife.js +76 -25
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useAnalysis.d.ts +43 -0
- package/dist/hooks/useAnalysis.d.ts.map +1 -0
- package/dist/hooks/useAuthentication.d.ts +49 -0
- package/dist/hooks/useAuthentication.d.ts.map +1 -0
- package/dist/hooks/useHighlightActions.d.ts +37 -0
- package/dist/hooks/useHighlightActions.d.ts.map +1 -0
- package/dist/hooks/useHighlights.d.ts +72 -0
- package/dist/hooks/useHighlights.d.ts.map +1 -0
- package/dist/html-pages/DQMWidget.d.ts.map +1 -1
- package/dist/html-pages/index.d.ts.map +1 -1
- package/dist/i18n/auth/de.d.ts +25 -0
- package/dist/i18n/auth/de.d.ts.map +1 -0
- package/dist/i18n/auth/en.d.ts +26 -0
- package/dist/i18n/auth/en.d.ts.map +1 -0
- package/dist/i18n/auth/es.d.ts +25 -0
- package/dist/i18n/auth/es.d.ts.map +1 -0
- package/dist/i18n/auth/index.d.ts +8 -0
- package/dist/i18n/auth/index.d.ts.map +1 -0
- package/dist/i18n/common/de.d.ts +18 -0
- package/dist/i18n/common/de.d.ts.map +1 -0
- package/dist/i18n/common/en.d.ts +19 -0
- package/dist/i18n/common/en.d.ts.map +1 -0
- package/dist/i18n/common/es.d.ts +18 -0
- package/dist/i18n/common/es.d.ts.map +1 -0
- package/dist/i18n/common/index.d.ts +8 -0
- package/dist/i18n/common/index.d.ts.map +1 -0
- package/dist/i18n/demo/de.d.ts +104 -0
- package/dist/i18n/demo/de.d.ts.map +1 -0
- package/dist/i18n/demo/en.d.ts +105 -0
- package/dist/i18n/demo/en.d.ts.map +1 -0
- package/dist/i18n/demo/es.d.ts +104 -0
- package/dist/i18n/demo/es.d.ts.map +1 -0
- package/dist/i18n/demo/index.d.ts +8 -0
- package/dist/i18n/demo/index.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +673 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/sidebar/de.d.ts +89 -0
- package/dist/i18n/sidebar/de.d.ts.map +1 -0
- package/dist/i18n/sidebar/en.d.ts +90 -0
- package/dist/i18n/sidebar/en.d.ts.map +1 -0
- package/dist/i18n/sidebar/es.d.ts +89 -0
- package/dist/i18n/sidebar/es.d.ts.map +1 -0
- package/dist/i18n/sidebar/index.d.ts +8 -0
- package/dist/i18n/sidebar/index.d.ts.map +1 -0
- package/dist/i18n.d.ts +8 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.cjs +61 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.html +3 -3
- package/dist/index.js +17795 -7252
- package/dist/index.js.map +1 -1
- package/dist/locale.d.ts +25 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/mocks/browser.d.ts +23 -0
- package/dist/mocks/browser.d.ts.map +1 -0
- package/dist/mocks/handlers.d.ts +32 -0
- package/dist/mocks/handlers.d.ts.map +1 -0
- package/dist/mocks/index.d.ts +7 -0
- package/dist/mocks/index.d.ts.map +1 -0
- package/dist/mocks/server.d.ts +24 -0
- package/dist/mocks/server.d.ts.map +1 -0
- package/dist/server/routes/auth.js +0 -10
- package/dist/server/routes/auth.js.map +1 -1
- package/dist/store/api/dqmApi.d.ts +1793 -0
- package/dist/store/api/dqmApi.d.ts.map +1 -0
- package/dist/store/api/index.d.ts +6 -0
- package/dist/store/api/index.d.ts.map +1 -0
- package/dist/store/index.d.ts +57 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/localeSlice.d.ts +6 -0
- package/dist/store/localeSlice.d.ts.map +1 -0
- package/dist/store/slices/aiSlice.d.ts +134 -0
- package/dist/store/slices/aiSlice.d.ts.map +1 -0
- package/dist/store/slices/analysisSlice.d.ts +54 -0
- package/dist/store/slices/analysisSlice.d.ts.map +1 -0
- package/dist/store/slices/authSlice.d.ts +170 -0
- package/dist/store/slices/authSlice.d.ts.map +1 -0
- package/dist/store/slices/highlightSlice.d.ts +188 -0
- package/dist/store/slices/highlightSlice.d.ts.map +1 -0
- package/dist/store/slices/index.d.ts +12 -0
- package/dist/store/slices/index.d.ts.map +1 -0
- package/dist/types.d.ts +27 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/aiJsonClient.d.ts +23 -0
- package/dist/utils/aiJsonClient.d.ts.map +1 -0
- package/dist/utils/colors/GenerateCategoryColors.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +107 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/openaiJsonClient.d.ts +8 -0
- package/dist/utils/openaiJsonClient.d.ts.map +1 -0
- package/dist/utils/sanitizeHtmlDocument.d.ts +4 -0
- package/dist/utils/sanitizeHtmlDocument.d.ts.map +1 -0
- package/dist/utils/secureStorage.d.ts +95 -0
- package/dist/utils/secureStorage.d.ts.map +1 -0
- package/dist/utils/storage.d.ts.map +1 -1
- package/dist/utils/translationCache.d.ts +45 -0
- package/dist/utils/translationCache.d.ts.map +1 -0
- package/dist/utils/translationUtils.d.ts +52 -0
- package/dist/utils/translationUtils.d.ts.map +1 -0
- package/package.json +48 -10
- package/AUTHENTICATION.md +0 -281
- package/BACKEND-API.md +0 -1829
- package/DEVELOPMENT.md +0 -374
- package/EXAMPLES.md +0 -381
- package/QUICKSTART.md +0 -207
- package/dist/auth-ui/assets/index-CczTRrba.js +0 -158
- package/dist/components/auth/OAuth2CallbackHandler.d.ts +0 -15
- package/dist/components/auth/OAuth2CallbackHandler.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2026-01-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Internationalization (i18n)**: Full multi-language support using i18next
|
|
12
|
+
- Supported languages: English (default), German, Spanish
|
|
13
|
+
- Language switcher component in sidebar footer
|
|
14
|
+
- URL parameter override (`?dqmUiLang=de`)
|
|
15
|
+
- Browser language auto-detection
|
|
16
|
+
- LocalStorage persistence of user preference (`dqm_locale`)
|
|
17
|
+
- Regional variant fallbacks (e.g., `de-AT` → `de` → `en`)
|
|
18
|
+
- **New Exports**:
|
|
19
|
+
- `i18n`, `resolveLanguage` from `./i18n`
|
|
20
|
+
- `SUPPORTED_LOCALES`, `DEFAULT_LOCALE`, `normalizeLocale` from `./locale`
|
|
21
|
+
- Types: `SupportedLocale`, `AvailableLanguage`
|
|
22
|
+
- **Comprehensive i18n documentation** in `I18N.md`
|
|
23
|
+
|
|
8
24
|
## [1.1.0] - 2025-12-17
|
|
9
25
|
|
|
10
26
|
### Added
|
package/README.md
CHANGED
|
@@ -11,13 +11,15 @@ highlighting capabilities.
|
|
|
11
11
|
|
|
12
12
|
## 🌟 Features
|
|
13
13
|
|
|
14
|
+
- **🤖 AI-Powered Translation & Summary** - Automatically translate analysis results into your language and generate intelligent summaries using OpenAI
|
|
14
15
|
- **📊 Quality Analysis** - Comprehensive quality metrics and scores
|
|
15
16
|
- **♿ Accessibility Checks** - WCAG compliance validation
|
|
16
17
|
- **🎯 Error Highlighting** - Visual highlighting of issues in HTML
|
|
17
18
|
- **🎨 Material-UI Design** - Beautiful, responsive sidebar interface
|
|
18
|
-
- **🔐
|
|
19
|
+
- **🔐 Secure Authentication** - Backend session management with secure credential storage
|
|
19
20
|
- **⚡ Real-time Analysis** - Live quality assessment as you edit
|
|
20
21
|
- **📱 Responsive** - Works on desktop, tablet, and mobile
|
|
22
|
+
- **🌍 Internationalization** - Supports English, German, and Spanish
|
|
21
23
|
- **🔧 TypeScript Support** - Full type definitions included
|
|
22
24
|
|
|
23
25
|
## 📦 Installation
|
|
@@ -63,19 +65,54 @@ function App() {
|
|
|
63
65
|
export default App;
|
|
64
66
|
```
|
|
65
67
|
|
|
68
|
+
### AI-Powered Translation & Summary (Quick Example)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import {DQMSidebar} from '@crownpeak/dqm-react-component';
|
|
72
|
+
|
|
73
|
+
<DQMSidebar
|
|
74
|
+
open={isOpen}
|
|
75
|
+
onClose={() => setIsOpen(false)}
|
|
76
|
+
onOpen={() => setIsOpen(true)}
|
|
77
|
+
config={{
|
|
78
|
+
websiteId: 'your-website-id',
|
|
79
|
+
apiKey: 'your-api-key',
|
|
80
|
+
// Enable AI Translation (API key via localStorage: dqm_openai_apiKey)
|
|
81
|
+
translation: {
|
|
82
|
+
enabledByDefault: true,
|
|
83
|
+
computeBudgetMs: 15000, // 15s timeout for 'fast' mode
|
|
84
|
+
},
|
|
85
|
+
// Enable AI Summary (uses same OpenAI API key)
|
|
86
|
+
summary: {
|
|
87
|
+
timeoutMs: 30000, // 30s timeout
|
|
88
|
+
}
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See **[AI Features Guide](./docs/AI-FEATURES.md)** for complete documentation including caching strategies and performance tuning.
|
|
94
|
+
|
|
66
95
|
## 📖 Documentation
|
|
67
96
|
|
|
68
|
-
|
|
69
|
-
- **[
|
|
70
|
-
- **[
|
|
71
|
-
- **[
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
97
|
+
### Core Documentation
|
|
98
|
+
- **[Quick Start Guide](./docs/QUICKSTART.md)** - Get up and running in 5 minutes
|
|
99
|
+
- **[Examples](./docs/EXAMPLES.md)** - Integration examples for React, Next.js, TypeScript
|
|
100
|
+
- **[Authentication Guide](./docs/AUTHENTICATION.md)** - Setup and configuration
|
|
101
|
+
|
|
102
|
+
### AI Features
|
|
103
|
+
- **[AI Features Guide](./docs/AI-FEATURES.md)** - Translation & Summary with OpenAI
|
|
104
|
+
- **[API Reference](./docs/API-REFERENCE.md)** - Full TypeScript API documentation
|
|
105
|
+
- **[Migration Guide](./docs/MIGRATION-GUIDE.md)** - Upgrade from v1.1 to v1.2
|
|
106
|
+
|
|
107
|
+
### Advanced
|
|
108
|
+
- **[Widget Guide](./docs/WIDGET-GUIDE.md)** - Standalone IIFE/ESM bundle usage
|
|
109
|
+
- **[Backend API](./docs/BACKEND-API.md)** - Backend server endpoints and usage
|
|
110
|
+
- **[Development Guide](./docs/DEVELOPMENT.md)** - Contributing and local development
|
|
111
|
+
- **[Troubleshooting](./docs/TROUBLESHOOTING.md)** - Common issues and solutions
|
|
75
112
|
|
|
76
113
|
## 🔑 Authentication Setup
|
|
77
114
|
|
|
78
|
-
The component requires authentication with Crownpeak DQM.
|
|
115
|
+
The component requires authentication with Crownpeak DQM. Two options are available:
|
|
79
116
|
|
|
80
117
|
```tsx
|
|
81
118
|
import {DQMSidebar} from '@crownpeak/dqm-react-component';
|
|
@@ -83,22 +120,13 @@ import {DQMSidebar} from '@crownpeak/dqm-react-component';
|
|
|
83
120
|
<DQMSidebar
|
|
84
121
|
{/* ... */}
|
|
85
122
|
config={{
|
|
86
|
-
//
|
|
123
|
+
// Option 1: Direct API Key and Website ID (not recommended for production)
|
|
87
124
|
// websiteId: 'your-website-id',
|
|
88
125
|
// apiKey: 'your-api-key',
|
|
89
126
|
|
|
90
|
-
//
|
|
91
|
-
authBackendUrl: '
|
|
127
|
+
// Option 2: Auth Backend for API Key management (recommended)
|
|
128
|
+
authBackendUrl: '', // Dev: empty (same origin) | Prod: 'https://your-backend.com'
|
|
92
129
|
useLocalStorage: true,
|
|
93
|
-
|
|
94
|
-
// -- Oauth2: backend not yet implemented ...
|
|
95
|
-
// oauth2Config: {
|
|
96
|
-
// authUrl: 'https://dqm.crownpeak.com/oauth2/authorize',
|
|
97
|
-
// clientId: 'crownpeak-dqm-react-component',
|
|
98
|
-
// scope: 'dqm_api',
|
|
99
|
-
// redirectUri: 'http://localhost:5173/',
|
|
100
|
-
// tokenUrl: 'https://dqm.crownpeak.com/oauth2/token',
|
|
101
|
-
// }
|
|
102
130
|
}}
|
|
103
131
|
```
|
|
104
132
|
|
|
@@ -123,10 +151,10 @@ npm run dev
|
|
|
123
151
|
|
|
124
152
|
This starts:
|
|
125
153
|
|
|
126
|
-
- Frontend on `http://localhost:5173`
|
|
127
|
-
- Backend
|
|
154
|
+
- Frontend + Backend on `http://localhost:5173` (Vite dev server with integrated backend)
|
|
155
|
+
- Backend routes (`/auth/*`, `/dqm/*`) handled by Vite plugin
|
|
128
156
|
|
|
129
|
-
###
|
|
157
|
+
### Standalone Server (Optional)
|
|
130
158
|
|
|
131
159
|
If using the included backend server:
|
|
132
160
|
|
package/dist/DQMSidebar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DQMSidebar.d.ts","sourceRoot":"","sources":["../src/DQMSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"DQMSidebar.d.ts","sourceRoot":"","sources":["../src/DQMSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AA4CtE,OAAO,KAAK,EAA8B,eAAe,EAAc,MAAM,SAAS,CAAC;AA0jFvF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAahD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD;;;;;GAKG;AAEH,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACxF,KAAK,EAAE,kBAAkB,CAMvB;IAEF,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI1E,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAO1D,kBAAkB,CAAC,SAAS,EAAE,kBAAkB;IAShD,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,mBAAmB,CAEzB;IAEF,MAAM;CAiEP;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,KAAK,CAAC,SAAS,EAAE,YAAY,OAAO,EAAE,4CAEjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
|
+
declare const rootReducer: import('redux').Reducer<{
|
|
4
|
+
locale: import('../store/localeSlice').LocaleState;
|
|
5
|
+
analysis: import('../store').AnalysisSliceState;
|
|
6
|
+
highlight: import('../store').HighlightSliceState;
|
|
7
|
+
auth: import('immer').WritableDraft<import('../store').AuthSliceState>;
|
|
8
|
+
ai: import('../store').AISliceState;
|
|
9
|
+
dqmApi: import('@reduxjs/toolkit/query').CombinedState<{
|
|
10
|
+
createAsset: import('@reduxjs/toolkit/query').MutationDefinition<import('../store').CreateAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').CreateAssetResponse, "dqmApi", unknown>;
|
|
11
|
+
getAsset: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store/api/dqmApi').TransformedAnalysisData, "dqmApi", unknown>;
|
|
12
|
+
getHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
13
|
+
getAllHighlights: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAllHighlightsRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
14
|
+
getCheckpointHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest & {
|
|
15
|
+
highlightSource?: boolean;
|
|
16
|
+
}, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", string, "dqmApi", unknown>;
|
|
17
|
+
}, "Highlight" | "Asset", "dqmApi">;
|
|
18
|
+
}, import('redux').UnknownAction, Partial<{
|
|
19
|
+
locale: import('../store/localeSlice').LocaleState;
|
|
20
|
+
analysis: import('../store').AnalysisSliceState;
|
|
21
|
+
highlight: import('../store').HighlightSliceState;
|
|
22
|
+
auth: import('immer').WritableDraft<import('../store').AuthSliceState>;
|
|
23
|
+
ai: import('../store').AISliceState;
|
|
24
|
+
dqmApi: import('@reduxjs/toolkit/query').CombinedState<{
|
|
25
|
+
createAsset: import('@reduxjs/toolkit/query').MutationDefinition<import('../store').CreateAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').CreateAssetResponse, "dqmApi", unknown>;
|
|
26
|
+
getAsset: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store/api/dqmApi').TransformedAnalysisData, "dqmApi", unknown>;
|
|
27
|
+
getHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
28
|
+
getAllHighlights: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAllHighlightsRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
29
|
+
getCheckpointHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest & {
|
|
30
|
+
highlightSource?: boolean;
|
|
31
|
+
}, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", string, "dqmApi", unknown>;
|
|
32
|
+
}, "Highlight" | "Asset", "dqmApi">;
|
|
33
|
+
}>>;
|
|
34
|
+
export type TestRootState = ReturnType<typeof rootReducer>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a test store with optional preloaded state.
|
|
37
|
+
* Uses same configuration as the main store.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createTestStore(preloadedState?: Partial<TestRootState>): import('@reduxjs/toolkit').EnhancedStore<{
|
|
40
|
+
locale: import('../store/localeSlice').LocaleState;
|
|
41
|
+
analysis: import('../store').AnalysisSliceState;
|
|
42
|
+
highlight: import('../store').HighlightSliceState;
|
|
43
|
+
auth: import('immer').WritableDraft<import('../store').AuthSliceState>;
|
|
44
|
+
ai: import('../store').AISliceState;
|
|
45
|
+
dqmApi: import('@reduxjs/toolkit/query').CombinedState<{
|
|
46
|
+
createAsset: import('@reduxjs/toolkit/query').MutationDefinition<import('../store').CreateAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').CreateAssetResponse, "dqmApi", unknown>;
|
|
47
|
+
getAsset: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store/api/dqmApi').TransformedAnalysisData, "dqmApi", unknown>;
|
|
48
|
+
getHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
49
|
+
getAllHighlights: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAllHighlightsRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
50
|
+
getCheckpointHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest & {
|
|
51
|
+
highlightSource?: boolean;
|
|
52
|
+
}, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", string, "dqmApi", unknown>;
|
|
53
|
+
}, "Highlight" | "Asset", "dqmApi">;
|
|
54
|
+
}, import('redux').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
|
|
55
|
+
dispatch: import('redux-thunk').ThunkDispatch<{
|
|
56
|
+
locale: import('../store/localeSlice').LocaleState;
|
|
57
|
+
analysis: import('../store').AnalysisSliceState;
|
|
58
|
+
highlight: import('../store').HighlightSliceState;
|
|
59
|
+
auth: import('immer').WritableDraft<import('../store').AuthSliceState>;
|
|
60
|
+
ai: import('../store').AISliceState;
|
|
61
|
+
dqmApi: import('@reduxjs/toolkit/query').CombinedState<{
|
|
62
|
+
createAsset: import('@reduxjs/toolkit/query').MutationDefinition<import('../store').CreateAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').CreateAssetResponse, "dqmApi", unknown>;
|
|
63
|
+
getAsset: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAssetRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store/api/dqmApi').TransformedAnalysisData, "dqmApi", unknown>;
|
|
64
|
+
getHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
65
|
+
getAllHighlights: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetAllHighlightsRequest, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", import('../store').HighlightResponse, "dqmApi", unknown>;
|
|
66
|
+
getCheckpointHighlight: import('@reduxjs/toolkit/query').QueryDefinition<import('../store').GetHighlightRequest & {
|
|
67
|
+
highlightSource?: boolean;
|
|
68
|
+
}, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, "Highlight" | "Asset", string, "dqmApi", unknown>;
|
|
69
|
+
}, "Highlight" | "Asset", "dqmApi">;
|
|
70
|
+
}, undefined, import('redux').UnknownAction>;
|
|
71
|
+
}>, import('redux').StoreEnhancer]>>;
|
|
72
|
+
export type AppStore = ReturnType<typeof createTestStore>;
|
|
73
|
+
/**
|
|
74
|
+
* Custom render that includes all providers
|
|
75
|
+
*/
|
|
76
|
+
interface CustomRenderOptions extends Omit<RenderOptions, 'wrapper'> {
|
|
77
|
+
preloadedState?: Partial<TestRootState>;
|
|
78
|
+
store?: ReturnType<typeof createTestStore>;
|
|
79
|
+
}
|
|
80
|
+
export declare function renderWithProviders(ui: ReactElement, { preloadedState, store, ...renderOptions }?: CustomRenderOptions): RenderResult & {
|
|
81
|
+
store: ReturnType<typeof createTestStore>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Create mock credentials for testing
|
|
85
|
+
*/
|
|
86
|
+
export declare function createMockCredentials(overrides?: Partial<{
|
|
87
|
+
apiKey: string;
|
|
88
|
+
websiteId: string;
|
|
89
|
+
}>): {
|
|
90
|
+
apiKey: string;
|
|
91
|
+
websiteId: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Create mock analysis data for testing
|
|
95
|
+
*/
|
|
96
|
+
export declare function createMockAnalysisData(overrides?: Partial<TestRootState['analysis']>): {
|
|
97
|
+
state: import('..').AnalysisState;
|
|
98
|
+
assetId: string | null;
|
|
99
|
+
data: import('..').AnalysisData | null;
|
|
100
|
+
error: string | null;
|
|
101
|
+
isAnalyzing: boolean;
|
|
102
|
+
startedAt: number | null;
|
|
103
|
+
completedAt: number | null;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Create mock checkpoint for testing
|
|
107
|
+
*/
|
|
108
|
+
export declare function createMockCheckpoint(overrides?: Partial<import('../types').Checkpoint>): {
|
|
109
|
+
colors: {
|
|
110
|
+
bg: string;
|
|
111
|
+
text: string;
|
|
112
|
+
};
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
reference: string;
|
|
117
|
+
number: number;
|
|
118
|
+
categoryNumber: number;
|
|
119
|
+
category: string;
|
|
120
|
+
priority: boolean;
|
|
121
|
+
failed: boolean;
|
|
122
|
+
topics: string[];
|
|
123
|
+
canHighlight: {
|
|
124
|
+
page: boolean;
|
|
125
|
+
source: boolean;
|
|
126
|
+
};
|
|
127
|
+
restricted: boolean;
|
|
128
|
+
checkpointType: {
|
|
129
|
+
name: string;
|
|
130
|
+
modifiedBy: string;
|
|
131
|
+
modified: string;
|
|
132
|
+
};
|
|
133
|
+
created: string;
|
|
134
|
+
modified: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Wait for a condition to be true
|
|
138
|
+
*/
|
|
139
|
+
export declare function waitFor(condition: () => boolean, { timeout, interval }?: {
|
|
140
|
+
timeout?: number;
|
|
141
|
+
interval?: number;
|
|
142
|
+
}): Promise<void>;
|
|
143
|
+
export * from '@testing-library/react';
|
|
144
|
+
export { default as userEvent } from '@testing-library/user-event';
|
|
145
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/__tests__/utils.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAc,EAAE,KAAK,YAAY,EAA0B,MAAM,OAAO,CAAC;AACzE,OAAO,EAAU,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAqBvF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOf,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAUtE;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAsB1D;;GAEG;AACH,UAAU,mBAAoB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IAClE,cAAc,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;CAC5C;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,YAAY,EAChB,EACE,cAAc,EACd,KAAuC,EACvC,GAAG,aAAa,EACjB,GAAE,mBAAwB,GAC1B,YAAY,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;CAAE,CAM9D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;YAA5B,MAAM;eAAa,MAAM;EAM5F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;;;;;;;;EAWpF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBtF;AAED;;GAEG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,MAAM,OAAO,EACxB,EAAE,OAAc,EAAE,QAAc,EAAE;;;CAAK,GACtC,OAAO,CAAC,IAAI,CAAC,CAQf;AAGD,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAC"}
|