@djangocfg/layouts 2.1.652 → 2.1.655
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -12
- package/src/layouts/AppLayout/BaseApp.tsx +2 -0
- package/src/layouts/PrivateLayout/PrivateLayout.tsx +1 -1
- package/src/layouts/SettingsLayout/i18n/locales/ar.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/da.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/de.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/en.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/es.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/fr.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/it.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/ja.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/ko.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/nl.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/no.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/pl.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/ptBR.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/ru.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/sv.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/tr.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/locales/zh.ts +8 -0
- package/src/layouts/SettingsLayout/i18n/types.ts +8 -0
- package/src/layouts/SettingsLayout/sections/DebugSection.test.tsx +65 -0
- package/src/layouts/SettingsLayout/sections/DebugSection.tsx +58 -0
- package/src/layouts/SettingsLayout/sections/builtins.tsx +15 -2
- package/src/layouts/SettingsLayout/types.ts +5 -0
- package/src/layouts/types/layout.types.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.655",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"test": "vitest run"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@djangocfg/analytics": "^2.1.
|
|
95
|
-
"@djangocfg/api": "^2.1.
|
|
96
|
-
"@djangocfg/devtools": "^2.1.
|
|
97
|
-
"@djangocfg/i18n": "^2.1.
|
|
98
|
-
"@djangocfg/ui-core": "^2.1.
|
|
94
|
+
"@djangocfg/analytics": "^2.1.655",
|
|
95
|
+
"@djangocfg/api": "^2.1.655",
|
|
96
|
+
"@djangocfg/devtools": "^2.1.655",
|
|
97
|
+
"@djangocfg/i18n": "^2.1.655",
|
|
98
|
+
"@djangocfg/ui-core": "^2.1.655",
|
|
99
99
|
"@hookform/resolvers": "^5.2.2 || ^7.0.2",
|
|
100
100
|
"consola": "^3.4.2",
|
|
101
101
|
"lucide-react": "^1.68.0",
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
"qrcode.react": "^4.2.0"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
|
-
"@djangocfg/analytics": "^2.1.
|
|
127
|
-
"@djangocfg/api": "^2.1.
|
|
128
|
-
"@djangocfg/devtools": "^2.1.
|
|
129
|
-
"@djangocfg/i18n": "^2.1.
|
|
130
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
131
|
-
"@djangocfg/ui-core": "^2.1.
|
|
126
|
+
"@djangocfg/analytics": "^2.1.655",
|
|
127
|
+
"@djangocfg/api": "^2.1.655",
|
|
128
|
+
"@djangocfg/devtools": "^2.1.655",
|
|
129
|
+
"@djangocfg/i18n": "^2.1.655",
|
|
130
|
+
"@djangocfg/typescript-config": "^2.1.655",
|
|
131
|
+
"@djangocfg/ui-core": "^2.1.655",
|
|
132
132
|
"@storybook/react-vite": "^10.6.5",
|
|
133
133
|
"@types/node": "^25.9.5",
|
|
134
134
|
"@types/react": "19.3.0",
|
|
@@ -110,6 +110,7 @@ export function BaseApp({
|
|
|
110
110
|
i18n,
|
|
111
111
|
pwaMeta = true,
|
|
112
112
|
progressBar = true,
|
|
113
|
+
debug,
|
|
113
114
|
}: BaseAppProps) {
|
|
114
115
|
// auth=false disables AuthProvider entirely (public apps with no login)
|
|
115
116
|
const authEnabled = auth !== false;
|
|
@@ -153,6 +154,7 @@ export function BaseApp({
|
|
|
153
154
|
top — one catch in the tree. errorBoundary={false} fully disables it
|
|
154
155
|
when the host opts out. */}
|
|
155
156
|
<UiProviders
|
|
157
|
+
debug={debug}
|
|
156
158
|
errorBoundary={enableErrorBoundary ? undefined : false}
|
|
157
159
|
onError={errorBoundary?.onError}
|
|
158
160
|
errorFallback={
|
|
@@ -126,7 +126,7 @@ export function PrivateLayout({
|
|
|
126
126
|
defaultOpen={defaultOpen}
|
|
127
127
|
style={{ ...providerStyle, ...sidebarWidth.style }}
|
|
128
128
|
className={cn(SHELL_CLASS, providerClassName)}
|
|
129
|
-
// Named for `
|
|
129
|
+
// Named for `syncViewport` (ui-core): the clipped shell is put back at scroll 0.
|
|
130
130
|
data-app-shell=""
|
|
131
131
|
data-sidebar-resizing={sidebarWidth.dragging || undefined}
|
|
132
132
|
>
|
|
@@ -8,6 +8,7 @@ export const ar: SettingsCopy = {
|
|
|
8
8
|
preferences: "التفضيلات",
|
|
9
9
|
apiKeys: "مفاتيح API",
|
|
10
10
|
apiKeysDescription: "أنشئ المفاتيح وأدرها للوصول البرمجي.",
|
|
11
|
+
debug: "تصحيح الأخطاء",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "عام",
|
|
@@ -21,6 +22,13 @@ export const ar: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "احذف حسابك وجميع البيانات المرتبطة به نهائيًا.",
|
|
22
23
|
changeAvatar: "تغيير الصورة الرمزية",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "تشخيص منطقة العرض لتتبع تطبيق منزاح.",
|
|
27
|
+
hud: "طبقة منطقة العرض",
|
|
28
|
+
hudHint: "تعرض قيم التمرير ومنطقة العرض مباشرة فوق التطبيق كله.",
|
|
29
|
+
remeasureNow: "أعد القياس الآن",
|
|
30
|
+
readout: "القيم المباشرة",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "مسح البحث",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const da: SettingsCopy = {
|
|
|
8
8
|
preferences: "Indstillinger",
|
|
9
9
|
apiKeys: "API-nøgler",
|
|
10
10
|
apiKeysDescription: "Opret og administrer nøgler til programmatisk adgang.",
|
|
11
|
+
debug: "Fejlfinding",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Generelt",
|
|
@@ -21,6 +22,13 @@ export const da: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Slet din konto og alle tilknyttede data permanent.",
|
|
22
23
|
changeAvatar: "Skift avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport-diagnostik til at spore en forskudt app.",
|
|
27
|
+
hud: "Viewport-overlay",
|
|
28
|
+
hudHint: "Viser scroll- og viewportværdier live over hele appen.",
|
|
29
|
+
remeasureNow: "Mål igen nu",
|
|
30
|
+
readout: "Live-værdier",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Ryd søgning",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const de: SettingsCopy = {
|
|
|
8
8
|
preferences: "Einstellungen",
|
|
9
9
|
apiKeys: "API-Schlüssel",
|
|
10
10
|
apiKeysDescription: "Schlüssel für den programmatischen Zugriff erstellen und verwalten.",
|
|
11
|
+
debug: "Debug",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Allgemein",
|
|
@@ -21,6 +22,13 @@ export const de: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Konto und alle zugehörigen Daten dauerhaft löschen.",
|
|
22
23
|
changeAvatar: "Avatar ändern",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport-Diagnose, um eine verschobene App aufzuspüren.",
|
|
27
|
+
hud: "Viewport-Overlay",
|
|
28
|
+
hudHint: "Zeigt Scroll- und Viewport-Werte live über der ganzen App.",
|
|
29
|
+
remeasureNow: "Jetzt neu messen",
|
|
30
|
+
readout: "Live-Werte",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Suche löschen",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const en: SettingsCopy = {
|
|
|
8
8
|
preferences: "Preferences",
|
|
9
9
|
apiKeys: "API keys",
|
|
10
10
|
apiKeysDescription: "Create and manage keys for programmatic access.",
|
|
11
|
+
debug: "Debug",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "General",
|
|
@@ -21,6 +22,13 @@ export const en: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Permanently remove your account and all associated data.",
|
|
22
23
|
changeAvatar: "Change avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport diagnostics for chasing a displaced app.",
|
|
27
|
+
hud: "Viewport overlay",
|
|
28
|
+
hudHint: "Shows live scroll and viewport values over the whole app.",
|
|
29
|
+
remeasureNow: "Re-measure now",
|
|
30
|
+
readout: "Live values",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Clear search",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const es: SettingsCopy = {
|
|
|
8
8
|
preferences: "Preferencias",
|
|
9
9
|
apiKeys: "Claves API",
|
|
10
10
|
apiKeysDescription: "Crea y gestiona claves para el acceso programático.",
|
|
11
|
+
debug: "Depuración",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "General",
|
|
@@ -21,6 +22,13 @@ export const es: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Elimina de forma permanente tu cuenta y todos los datos asociados.",
|
|
22
23
|
changeAvatar: "Cambiar avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Diagnóstico del viewport para rastrear una app desplazada.",
|
|
27
|
+
hud: "Superposición del viewport",
|
|
28
|
+
hudHint: "Muestra en vivo los valores de scroll y viewport sobre toda la app.",
|
|
29
|
+
remeasureNow: "Volver a medir ahora",
|
|
30
|
+
readout: "Valores en vivo",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Borrar búsqueda",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const fr: SettingsCopy = {
|
|
|
8
8
|
preferences: "Préférences",
|
|
9
9
|
apiKeys: "Clés API",
|
|
10
10
|
apiKeysDescription: "Créez et gérez des clés pour l'accès programmatique.",
|
|
11
|
+
debug: "Débogage",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Général",
|
|
@@ -21,6 +22,13 @@ export const fr: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Supprimer définitivement votre compte et toutes les données associées.",
|
|
22
23
|
changeAvatar: "Changer d'avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Diagnostic du viewport pour traquer une app décalée.",
|
|
27
|
+
hud: "Surcouche viewport",
|
|
28
|
+
hudHint: "Affiche en direct les valeurs de défilement et de viewport sur toute l'app.",
|
|
29
|
+
remeasureNow: "Mesurer à nouveau",
|
|
30
|
+
readout: "Valeurs en direct",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Effacer la recherche",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const it: SettingsCopy = {
|
|
|
8
8
|
preferences: "Preferenze",
|
|
9
9
|
apiKeys: "Chiavi API",
|
|
10
10
|
apiKeysDescription: "Crea e gestisci le chiavi per l'accesso programmatico.",
|
|
11
|
+
debug: "Debug",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Generali",
|
|
@@ -21,6 +22,13 @@ export const it: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Elimina definitivamente il tuo account e tutti i dati associati.",
|
|
22
23
|
changeAvatar: "Cambia avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Diagnostica del viewport per rintracciare un'app spostata.",
|
|
27
|
+
hud: "Overlay viewport",
|
|
28
|
+
hudHint: "Mostra in tempo reale i valori di scorrimento e viewport sull'intera app.",
|
|
29
|
+
remeasureNow: "Misura di nuovo",
|
|
30
|
+
readout: "Valori in tempo reale",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Cancella ricerca",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const ja: SettingsCopy = {
|
|
|
8
8
|
preferences: "設定",
|
|
9
9
|
apiKeys: "APIキー",
|
|
10
10
|
apiKeysDescription: "プログラムからアクセスするためのキーを作成・管理します。",
|
|
11
|
+
debug: "デバッグ",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "一般",
|
|
@@ -21,6 +22,13 @@ export const ja: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "アカウントと関連するすべてのデータを完全に削除します。",
|
|
22
23
|
changeAvatar: "アバターを変更",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "画面のずれを調べるためのビューポート診断。",
|
|
27
|
+
hud: "ビューポートオーバーレイ",
|
|
28
|
+
hudHint: "スクロールとビューポートの値をアプリ全体に重ねて表示します。",
|
|
29
|
+
remeasureNow: "今すぐ再計測",
|
|
30
|
+
readout: "現在の値",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "検索をクリア",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const ko: SettingsCopy = {
|
|
|
8
8
|
preferences: "환경설정",
|
|
9
9
|
apiKeys: "API 키",
|
|
10
10
|
apiKeysDescription: "프로그래밍 방식 접근을 위한 키를 만들고 관리하세요.",
|
|
11
|
+
debug: "디버그",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "일반",
|
|
@@ -21,6 +22,13 @@ export const ko: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "계정과 관련된 모든 데이터를 영구적으로 삭제합니다.",
|
|
22
23
|
changeAvatar: "아바타 변경",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "화면이 밀리는 문제를 추적하는 뷰포트 진단.",
|
|
27
|
+
hud: "뷰포트 오버레이",
|
|
28
|
+
hudHint: "앱 전체 위에 스크롤과 뷰포트 값을 실시간으로 표시합니다.",
|
|
29
|
+
remeasureNow: "지금 다시 측정",
|
|
30
|
+
readout: "실시간 값",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "검색어 지우기",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const nl: SettingsCopy = {
|
|
|
8
8
|
preferences: "Voorkeuren",
|
|
9
9
|
apiKeys: "API-sleutels",
|
|
10
10
|
apiKeysDescription: "Maak en beheer sleutels voor programmatische toegang.",
|
|
11
|
+
debug: "Debug",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Algemeen",
|
|
@@ -21,6 +22,13 @@ export const nl: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Verwijder je account en alle bijbehorende gegevens definitief.",
|
|
22
23
|
changeAvatar: "Avatar wijzigen",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport-diagnose om een verschoven app op te sporen.",
|
|
27
|
+
hud: "Viewport-overlay",
|
|
28
|
+
hudHint: "Toont live scroll- en viewportwaarden over de hele app.",
|
|
29
|
+
remeasureNow: "Nu opnieuw meten",
|
|
30
|
+
readout: "Live waarden",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Zoekopdracht wissen",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const no: SettingsCopy = {
|
|
|
8
8
|
preferences: "Innstillinger",
|
|
9
9
|
apiKeys: "API-nøkler",
|
|
10
10
|
apiKeysDescription: "Opprett og administrer nøkler for programmatisk tilgang.",
|
|
11
|
+
debug: "Feilsøking",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Generelt",
|
|
@@ -21,6 +22,13 @@ export const no: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Slett kontoen din og alle tilknyttede data permanent.",
|
|
22
23
|
changeAvatar: "Bytt avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport-diagnostikk for å spore en forskjøvet app.",
|
|
27
|
+
hud: "Viewport-overlegg",
|
|
28
|
+
hudHint: "Viser scroll- og viewportverdier live over hele appen.",
|
|
29
|
+
remeasureNow: "Mål på nytt nå",
|
|
30
|
+
readout: "Live-verdier",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Tøm søk",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const pl: SettingsCopy = {
|
|
|
8
8
|
preferences: "Preferencje",
|
|
9
9
|
apiKeys: "Klucze API",
|
|
10
10
|
apiKeysDescription: "Twórz klucze dostępu programistycznego i zarządzaj nimi.",
|
|
11
|
+
debug: "Debugowanie",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Ogólne",
|
|
@@ -21,6 +22,13 @@ export const pl: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Trwale usuń konto i wszystkie powiązane dane.",
|
|
22
23
|
changeAvatar: "Zmień awatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Diagnostyka viewportu do śledzenia przesuniętej aplikacji.",
|
|
27
|
+
hud: "Nakładka viewportu",
|
|
28
|
+
hudHint: "Pokazuje na żywo wartości przewijania i viewportu nad całą aplikacją.",
|
|
29
|
+
remeasureNow: "Zmierz ponownie",
|
|
30
|
+
readout: "Wartości na żywo",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Wyczyść wyszukiwanie",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const ptBR: SettingsCopy = {
|
|
|
8
8
|
preferences: "Preferências",
|
|
9
9
|
apiKeys: "Chaves de API",
|
|
10
10
|
apiKeysDescription: "Crie e gerencie chaves para acesso programático.",
|
|
11
|
+
debug: "Depuração",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Geral",
|
|
@@ -21,6 +22,13 @@ export const ptBR: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Exclua permanentemente sua conta e todos os dados associados.",
|
|
22
23
|
changeAvatar: "Alterar avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Diagnóstico do viewport para rastrear um app deslocado.",
|
|
27
|
+
hud: "Sobreposição do viewport",
|
|
28
|
+
hudHint: "Mostra ao vivo os valores de rolagem e viewport sobre todo o app.",
|
|
29
|
+
remeasureNow: "Medir novamente agora",
|
|
30
|
+
readout: "Valores ao vivo",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Limpar pesquisa",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const ru: SettingsCopy = {
|
|
|
8
8
|
preferences: "Параметры",
|
|
9
9
|
apiKeys: "API-ключи",
|
|
10
10
|
apiKeysDescription: "Создавайте ключи и управляйте ими для программного доступа.",
|
|
11
|
+
debug: "Отладка",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Общие",
|
|
@@ -21,6 +22,13 @@ export const ru: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Безвозвратно удалить аккаунт и все связанные данные.",
|
|
22
23
|
changeAvatar: "Сменить аватар",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Диагностика вьюпорта для поиска смещённого экрана.",
|
|
27
|
+
hud: "Оверлей вьюпорта",
|
|
28
|
+
hudHint: "Показывает значения прокрутки и вьюпорта поверх всего приложения.",
|
|
29
|
+
remeasureNow: "Перемерить сейчас",
|
|
30
|
+
readout: "Текущие значения",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Очистить поиск",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const sv: SettingsCopy = {
|
|
|
8
8
|
preferences: "Inställningar",
|
|
9
9
|
apiKeys: "API-nycklar",
|
|
10
10
|
apiKeysDescription: "Skapa och hantera nycklar för programmatisk åtkomst.",
|
|
11
|
+
debug: "Felsökning",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Allmänt",
|
|
@@ -21,6 +22,13 @@ export const sv: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Radera ditt konto och all tillhörande data permanent.",
|
|
22
23
|
changeAvatar: "Byt avatar",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Viewport-diagnostik för att spåra en förskjuten app.",
|
|
27
|
+
hud: "Viewport-överlägg",
|
|
28
|
+
hudHint: "Visar scroll- och viewportvärden live över hela appen.",
|
|
29
|
+
remeasureNow: "Mät om nu",
|
|
30
|
+
readout: "Live-värden",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Rensa sökning",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const tr: SettingsCopy = {
|
|
|
8
8
|
preferences: "Tercihler",
|
|
9
9
|
apiKeys: "API anahtarları",
|
|
10
10
|
apiKeysDescription: "Programatik erişim için anahtarlar oluşturun ve yönetin.",
|
|
11
|
+
debug: "Hata ayıklama",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "Genel",
|
|
@@ -21,6 +22,13 @@ export const tr: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "Hesabınızı ve ilişkili tüm verileri kalıcı olarak silin.",
|
|
22
23
|
changeAvatar: "Avatarı değiştir",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "Kayan bir uygulamayı izlemek için görünüm alanı tanılaması.",
|
|
27
|
+
hud: "Görünüm alanı katmanı",
|
|
28
|
+
hudHint: "Kaydırma ve görünüm alanı değerlerini tüm uygulamanın üzerinde canlı gösterir.",
|
|
29
|
+
remeasureNow: "Şimdi yeniden ölç",
|
|
30
|
+
readout: "Canlı değerler",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "Aramayı temizle",
|
|
26
34
|
},
|
|
@@ -8,6 +8,7 @@ export const zh: SettingsCopy = {
|
|
|
8
8
|
preferences: "偏好设置",
|
|
9
9
|
apiKeys: "API 密钥",
|
|
10
10
|
apiKeysDescription: "创建并管理用于程序化访问的密钥。",
|
|
11
|
+
debug: "调试",
|
|
11
12
|
},
|
|
12
13
|
prefs: {
|
|
13
14
|
general: "常规",
|
|
@@ -21,6 +22,13 @@ export const zh: SettingsCopy = {
|
|
|
21
22
|
deleteAccountDescription: "永久删除您的账户及所有相关数据。",
|
|
22
23
|
changeAvatar: "更换头像",
|
|
23
24
|
},
|
|
25
|
+
debug: {
|
|
26
|
+
description: "用于排查应用错位的视口诊断。",
|
|
27
|
+
hud: "视口悬浮层",
|
|
28
|
+
hudHint: "在整个应用上实时显示滚动和视口数值。",
|
|
29
|
+
remeasureNow: "立即重新测量",
|
|
30
|
+
readout: "实时数值",
|
|
31
|
+
},
|
|
24
32
|
search: {
|
|
25
33
|
clear: "清除搜索",
|
|
26
34
|
},
|
|
@@ -7,6 +7,14 @@ export interface SettingsCopy {
|
|
|
7
7
|
preferences: string;
|
|
8
8
|
apiKeys: string;
|
|
9
9
|
apiKeysDescription: string;
|
|
10
|
+
debug: string;
|
|
11
|
+
};
|
|
12
|
+
debug: {
|
|
13
|
+
description: string;
|
|
14
|
+
hud: string;
|
|
15
|
+
hudHint: string;
|
|
16
|
+
remeasureNow: string;
|
|
17
|
+
readout: string;
|
|
10
18
|
};
|
|
11
19
|
prefs: {
|
|
12
20
|
general: string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import React, { act } from 'react';
|
|
3
|
+
import { createRoot, type Root } from 'react-dom/client';
|
|
4
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
6
|
+
import { en } from '../i18n/locales/en';
|
|
7
|
+
import { buildBuiltinSections } from './builtins';
|
|
8
|
+
import { DebugSection } from './DebugSection';
|
|
9
|
+
|
|
10
|
+
vi.mock('@djangocfg/api/auth', () => ({ useTimezone: () => ({}), useAuth: () => ({}) }));
|
|
11
|
+
|
|
12
|
+
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
13
|
+
|
|
14
|
+
let host: HTMLElement | null = null;
|
|
15
|
+
let root: Root | null = null;
|
|
16
|
+
|
|
17
|
+
beforeAll(() => {
|
|
18
|
+
window.matchMedia = ((q: string) => ({ matches: false, media: q, addEventListener() {}, removeEventListener() {}, addListener() {}, removeListener() {}, dispatchEvent: () => false })) as typeof window.matchMedia;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
act(() => root?.unmount());
|
|
23
|
+
host?.remove();
|
|
24
|
+
host = root = null;
|
|
25
|
+
localStorage.clear();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('builtins.debug', () => {
|
|
29
|
+
const ids = (debug?: boolean) =>
|
|
30
|
+
buildBuiltinSections({ builtins: debug === undefined ? {} : { debug }, enableDeleteAccount: true, copy: en }).map((s) => s.id);
|
|
31
|
+
|
|
32
|
+
it('is off by default, in development and production alike, and on only for an explicit true', () => {
|
|
33
|
+
for (const nodeEnv of ['development', 'production']) {
|
|
34
|
+
vi.stubEnv('NODE_ENV', nodeEnv);
|
|
35
|
+
expect(ids()).not.toContain('debug');
|
|
36
|
+
expect(ids(false)).not.toContain('debug');
|
|
37
|
+
expect(ids(true)).toContain('debug');
|
|
38
|
+
}
|
|
39
|
+
vi.unstubAllEnvs();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('DebugSection', () => {
|
|
44
|
+
it('shows the live readout, flips the HUD switch (persisted) and resets the scroll on demand', async () => {
|
|
45
|
+
host = document.createElement('div');
|
|
46
|
+
document.body.appendChild(host);
|
|
47
|
+
root = createRoot(host);
|
|
48
|
+
await act(async () => root!.render(<DebugSection />));
|
|
49
|
+
|
|
50
|
+
const readout = host.querySelector('[data-testid=viewport-readout]')!;
|
|
51
|
+
expect(readout.textContent).toContain('innerHeight');
|
|
52
|
+
expect(readout.textContent).toContain('--app-height');
|
|
53
|
+
|
|
54
|
+
const toggle = host.querySelector<HTMLElement>('[role=switch]')!;
|
|
55
|
+
expect(toggle.getAttribute('aria-checked')).toBe('false');
|
|
56
|
+
await act(async () => toggle.click());
|
|
57
|
+
expect(localStorage.getItem('viewportdebug')).toBe('small');
|
|
58
|
+
expect(document.querySelector('[data-viewport-debug]')).toBeNull(); // drawn by UiProviders, not by the dialog
|
|
59
|
+
expect(host.querySelector('[role=switch]')!.getAttribute('aria-checked')).toBe('true');
|
|
60
|
+
|
|
61
|
+
const reset = [...host.querySelectorAll('button')].find((b) => b.textContent === en.debug.remeasureNow)!;
|
|
62
|
+
expect(reset).toBeTruthy();
|
|
63
|
+
await act(async () => reset.click());
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { Button, SettingRow, SettingsBlock } from '@djangocfg/ui-core/components';
|
|
6
|
+
import {
|
|
7
|
+
getViewportHud,
|
|
8
|
+
remeasureViewport,
|
|
9
|
+
setViewportHud,
|
|
10
|
+
subscribeViewportHud,
|
|
11
|
+
viewportSnapshot,
|
|
12
|
+
} from '@djangocfg/ui-core/hooks';
|
|
13
|
+
|
|
14
|
+
import { useSettingsCopy } from '../i18n';
|
|
15
|
+
|
|
16
|
+
/** Re-reads `viewportSnapshot()` twice a second while the section is open. */
|
|
17
|
+
function useSnapshot(): string {
|
|
18
|
+
const [text, setText] = React.useState('');
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const read = () => setText(viewportSnapshot());
|
|
21
|
+
read();
|
|
22
|
+
const id = window.setInterval(read, 500);
|
|
23
|
+
return () => window.clearInterval(id);
|
|
24
|
+
}, []);
|
|
25
|
+
return text;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Built-in "Debug" section (`builtins.debug`). The switch turns the on-screen viewport HUD on or off (kept in
|
|
30
|
+
* localStorage); the HUD itself is drawn by `UiProviders` over the whole app, so it stays when this dialog closes.
|
|
31
|
+
*/
|
|
32
|
+
export const DebugSection: React.FC = () => {
|
|
33
|
+
const copy = useSettingsCopy();
|
|
34
|
+
const on = React.useSyncExternalStore(subscribeViewportHud, () => getViewportHud() !== 'off', () => false);
|
|
35
|
+
const snapshot = useSnapshot();
|
|
36
|
+
const [, bump] = React.useReducer((n: number) => n + 1, 0);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="space-y-8">
|
|
40
|
+
<SettingsBlock>
|
|
41
|
+
<SettingRow
|
|
42
|
+
label={copy.debug.hud}
|
|
43
|
+
description={copy.debug.hudHint}
|
|
44
|
+
toggle
|
|
45
|
+
checked={on}
|
|
46
|
+
onToggle={(next) => setViewportHud(next ? 'small' : 'off')}
|
|
47
|
+
/>
|
|
48
|
+
<SettingRow
|
|
49
|
+
label={copy.debug.remeasureNow}
|
|
50
|
+
action={<Button variant="outline" size="sm" onClick={() => { remeasureViewport(); bump(); }}>{copy.debug.remeasureNow}</Button>}
|
|
51
|
+
/>
|
|
52
|
+
</SettingsBlock>
|
|
53
|
+
<SettingsBlock title={copy.debug.readout}>
|
|
54
|
+
<pre data-testid="viewport-readout" className="whitespace-pre-wrap break-all font-mono text-xs">{snapshot}</pre>
|
|
55
|
+
</SettingsBlock>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { KeyRound, Settings as SettingsIcon, UserRound } from 'lucide-react';
|
|
5
|
+
import { Bug, KeyRound, Settings as SettingsIcon, UserRound } from 'lucide-react';
|
|
6
6
|
|
|
7
7
|
import type { SettingsBuiltins, SettingsGroup, SettingsSection } from '../types';
|
|
8
8
|
import { AccountSection } from './AccountSection';
|
|
9
9
|
import { GeneralSection } from './GeneralSection';
|
|
10
10
|
import { ApiKeysSection } from './ApiKeysSection';
|
|
11
|
+
import { DebugSection } from './DebugSection';
|
|
11
12
|
import type { SettingsCopy } from '../i18n';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -40,7 +41,7 @@ export function buildBuiltinSections({
|
|
|
40
41
|
generalRows,
|
|
41
42
|
copy,
|
|
42
43
|
}: BuildBuiltinArgs): SettingsSection[] {
|
|
43
|
-
const { general = true, account = true, security = true, apiKeys = true } = builtins;
|
|
44
|
+
const { general = true, account = true, security = true, apiKeys = true, debug = false } = builtins;
|
|
44
45
|
const sections: SettingsSection[] = [];
|
|
45
46
|
|
|
46
47
|
if (account) {
|
|
@@ -80,6 +81,18 @@ export function buildBuiltinSections({
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
if (debug) {
|
|
85
|
+
sections.push({
|
|
86
|
+
id: 'debug',
|
|
87
|
+
label: copy.nav.debug,
|
|
88
|
+
icon: Bug,
|
|
89
|
+
group: PLATFORM_GROUP.id,
|
|
90
|
+
title: copy.nav.debug,
|
|
91
|
+
description: copy.debug.description,
|
|
92
|
+
keywords: ['viewport', 'scroll', 'hud', 'diagnostics'],
|
|
93
|
+
content: <DebugSection />,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
83
96
|
|
|
84
97
|
return sections;
|
|
85
98
|
}
|
|
@@ -73,6 +73,11 @@ export interface SettingsBuiltins {
|
|
|
73
73
|
security?: boolean;
|
|
74
74
|
/** API keys. Default: true. */
|
|
75
75
|
apiKeys?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Debug: a switch for the on-screen viewport HUD, a live readout of scroll/viewport values and a "Reset scroll now"
|
|
78
|
+
* button, for chasing a displaced installed app. Default: false, in development too: shown only when the host passes `true`.
|
|
79
|
+
*/
|
|
80
|
+
debug?: boolean;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
/** Shared configuration consumed by both the dialog and the inline form. */
|
|
@@ -102,6 +102,11 @@ export interface BaseLayoutProps {
|
|
|
102
102
|
* `useNavigationBehavior({ progress: false, scroll: false })`.
|
|
103
103
|
*/
|
|
104
104
|
progressBar?: boolean | RouteProgressOptions;
|
|
105
|
+
/**
|
|
106
|
+
* Show the viewport diagnostic dot (a 24px dot in a corner; tap it to open the HUD) even where there is no Settings dialog,
|
|
107
|
+
* e.g. a video-call page. Default false. The HUD state is per origin (`localStorage`).
|
|
108
|
+
*/
|
|
109
|
+
debug?: boolean;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
/** Devtools config for BaseApp — the `<Devtools>` props minus children. */
|