hazo_auth 10.22.1 → 10.22.2
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/components/layouts/shared/components/sidebar_locale_switcher.d.ts +2 -0
- package/dist/components/layouts/shared/components/sidebar_locale_switcher.d.ts.map +1 -0
- package/dist/components/layouts/shared/components/sidebar_locale_switcher.js +30 -0
- package/dist/components/layouts/shared/components/sidebar_translate_nav.d.ts +2 -0
- package/dist/components/layouts/shared/components/sidebar_translate_nav.d.ts.map +1 -0
- package/dist/components/layouts/shared/components/sidebar_translate_nav.js +16 -0
- package/package.json +4 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar_locale_switcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/sidebar_locale_switcher.tsx"],"names":[],"mappings":"AAUA,wBAAgB,qBAAqB,uCA6BpC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
export function SidebarLocaleSwitcher() {
|
|
5
|
+
const [Switcher, setSwitcher] = useState(null);
|
|
6
|
+
const [locales, setLocales] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
import("hazo_i18n/ui")
|
|
9
|
+
.then((m) => {
|
|
10
|
+
setSwitcher(() => m.LocaleSwitcher);
|
|
11
|
+
fetch("/api/hazo_auth/i18n?action=locales")
|
|
12
|
+
.then((r) => r.json())
|
|
13
|
+
.then((body) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const defs = (_b = (_a = body === null || body === void 0 ? void 0 : body.data) === null || _a === void 0 ? void 0 : _a.locales) !== null && _b !== void 0 ? _b : [];
|
|
16
|
+
setLocales(defs
|
|
17
|
+
.filter((d) => d.enabled !== false)
|
|
18
|
+
.map((d) => ({
|
|
19
|
+
code: d.code,
|
|
20
|
+
label: d.native_name || d.english_name || d.code,
|
|
21
|
+
})));
|
|
22
|
+
})
|
|
23
|
+
.catch(() => { });
|
|
24
|
+
})
|
|
25
|
+
.catch(() => { });
|
|
26
|
+
}, []);
|
|
27
|
+
if (!Switcher || locales.length === 0)
|
|
28
|
+
return null;
|
|
29
|
+
return _jsx(Switcher, { locales: locales, display: "code", variant: "sidebar" });
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar_translate_nav.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/sidebar_translate_nav.tsx"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,uCAkBlC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { usePathname } from "next/navigation";
|
|
5
|
+
export function SidebarTranslateNav() {
|
|
6
|
+
const [NavItem, setNavItem] = useState(null);
|
|
7
|
+
const pathname = usePathname();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
import("hazo_i18n/ui")
|
|
10
|
+
.then((m) => setNavItem(() => m.TranslateNavItem))
|
|
11
|
+
.catch(() => { });
|
|
12
|
+
}, []);
|
|
13
|
+
if (!NavItem)
|
|
14
|
+
return null;
|
|
15
|
+
return (_jsx(NavItem, { href: "/hazo_auth/translations", active: pathname === "/hazo_auth/translations" }));
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "10.22.
|
|
3
|
+
"version": "10.22.2",
|
|
4
4
|
"description": "Zero-config authentication UI components for Next.js with RBAC, OAuth, scope-based multi-tenancy, and invitations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -192,8 +192,6 @@
|
|
|
192
192
|
"!dist/components/layouts/test_scenarios/**/*",
|
|
193
193
|
"!dist/components/layouts/legal_docs_test/**/*",
|
|
194
194
|
"!dist/components/layouts/legal_register_test/**/*",
|
|
195
|
-
"!dist/components/layouts/shared/components/sidebar_locale_switcher.*",
|
|
196
|
-
"!dist/components/layouts/shared/components/sidebar_translate_nav.*",
|
|
197
195
|
"!dist/lib/auto_test/**/*",
|
|
198
196
|
"bin/**/*",
|
|
199
197
|
"cli-src/**/*",
|
|
@@ -280,12 +278,12 @@
|
|
|
280
278
|
"hazo_config": "^2.6.0",
|
|
281
279
|
"hazo_connect": "^4.3.0",
|
|
282
280
|
"hazo_core": "^2.4.0",
|
|
283
|
-
"hazo_i18n": "^0.5.
|
|
281
|
+
"hazo_i18n": "^0.5.9",
|
|
284
282
|
"hazo_logs": "^2.3.0",
|
|
285
283
|
"hazo_notify": "^6.5.0",
|
|
286
284
|
"hazo_secure": "^1.8.1",
|
|
287
285
|
"hazo_theme": "^1.4.0",
|
|
288
|
-
"hazo_ui": "^6.12.
|
|
286
|
+
"hazo_ui": "^6.12.1",
|
|
289
287
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
290
288
|
"next-auth": "^4.24.0",
|
|
291
289
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -370,7 +368,7 @@
|
|
|
370
368
|
"hazo_logs": "^2.3.0",
|
|
371
369
|
"hazo_notify": "^6.5.0",
|
|
372
370
|
"hazo_theme": "^1.4.0",
|
|
373
|
-
"hazo_ui": "^6.12.
|
|
371
|
+
"hazo_ui": "^6.12.1",
|
|
374
372
|
"input-otp": "^1.4.0",
|
|
375
373
|
"jest": "^30.2.0",
|
|
376
374
|
"jest-environment-jsdom": "^30.0.0",
|