forma-ui 0.0.6 → 0.0.7
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/Interfaces/dictionary.d.ts +25 -0
- package/dist/Interfaces/dictionary.js +8 -0
- package/dist/Interfaces/global.d.ts +21 -0
- package/dist/Interfaces/global.js +1 -0
- package/dist/Interfaces/meta.d.ts +39 -0
- package/dist/Interfaces/meta.js +8 -0
- package/dist/app/[lang]/stores/LangStore.d.ts +22 -0
- package/dist/app/[lang]/stores/LangStore.js +125 -0
- package/dist/components/icon/icon.d.ts +3 -0
- package/dist/components/icon/icon.js +6 -2
- package/dist/components/ui/Accordion.d.ts +1 -0
- package/dist/components/ui/Accordion.js +15 -6
- package/dist/components/ui/Button.d.ts +0 -0
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/CheckBox.d.ts +0 -0
- package/dist/components/ui/CheckBox.js +0 -0
- package/dist/components/ui/Input.d.ts +0 -0
- package/dist/components/ui/Input.js +10 -7
- package/dist/components/ui/Modal.d.ts +9 -9
- package/dist/components/ui/Modal.js +51 -6
- package/dist/components/ui/RadioButton.d.ts +0 -0
- package/dist/components/ui/RadioButton.js +0 -0
- package/dist/components/ui/Table.d.ts +0 -0
- package/dist/components/ui/Table.js +0 -0
- package/dist/components/ui/Tabs.d.ts +0 -0
- package/dist/components/ui/Tabs.js +0 -0
- package/dist/configs/language.d.ts +39 -0
- package/dist/configs/language.js +50 -0
- package/dist/configs/metadata.d.ts +69 -0
- package/dist/configs/metadata.js +143 -0
- package/dist/dictionaries/en.json +0 -0
- package/dist/dictionaries/fa.json +0 -0
- package/dist/dictionaries/index.d.ts +0 -0
- package/dist/dictionaries/index.js +0 -0
- package/dist/hooks/useDevice.d.ts +21 -0
- package/dist/hooks/useDevice.js +49 -0
- package/dist/hooks/useTranslation.d.ts +4 -0
- package/dist/hooks/useTranslation.js +34 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -1
- package/dist/libs/api/axiosClient.d.ts +9 -0
- package/dist/libs/api/axiosClient.js +34 -0
- package/dist/libs/api/cns.d.ts +16 -0
- package/dist/libs/api/cns.js +29 -0
- package/dist/libs/api/usePostFetch.d.ts +23 -0
- package/dist/libs/api/usePostFetch.js +17 -0
- package/dist/libs/cn.d.ts +1 -0
- package/dist/libs/cn.js +12 -0
- package/dist/libs/cookieUtils.d.ts +10 -0
- package/dist/libs/cookieUtils.js +28 -0
- package/dist/libs/detectComponentResponsive.d.ts +10 -0
- package/dist/libs/detectComponentResponsive.js +24 -0
- package/dist/libs/detectDeviceFromUA.d.ts +8 -0
- package/dist/libs/detectDeviceFromUA.js +14 -0
- package/dist/libs/fonts.d.ts +10 -0
- package/dist/libs/fonts.js +94 -0
- package/dist/libs/metadataHelper.d.ts +17 -0
- package/dist/libs/metadataHelper.js +20 -0
- package/dist/libs/modal/Modal.d.ts +9 -0
- package/dist/libs/modal/Modal.js +41 -0
- package/dist/libs/translation.d.ts +5 -0
- package/dist/libs/translation.js +30 -0
- package/dist/{lib → libs}/utils.d.ts +0 -0
- package/dist/{lib → libs}/utils.js +0 -0
- package/dist/locale/about/en.json +3 -0
- package/dist/locale/about/fa.json +3 -0
- package/dist/locale/coin/en.json +4 -0
- package/dist/locale/coin/fa.json +4 -0
- package/dist/locale/en.d.ts +56 -0
- package/dist/locale/en.js +16 -0
- package/dist/locale/fa.d.ts +59 -0
- package/dist/locale/fa.js +16 -0
- package/dist/locale/global/en.json +12 -0
- package/dist/locale/global/fa.json +16 -0
- package/dist/locale/home/en.json +11 -0
- package/dist/locale/home/fa.json +11 -0
- package/dist/locale/index.d.ts +201 -0
- package/dist/locale/index.js +7 -0
- package/dist/locale/meta/about/en.json +10 -0
- package/dist/locale/meta/about/fa.json +5 -0
- package/dist/locale/meta/en.json +15 -0
- package/dist/locale/meta/fa.json +15 -0
- package/dist/locale/meta/home/en.json +10 -0
- package/dist/locale/meta/home/fa.json +5 -0
- package/dist/middleware.d.ts +14 -0
- package/dist/middleware.js +57 -0
- package/dist/store/appStore.d.ts +1 -1
- package/dist/store/appStore.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/nextImageLoader.d.ts +9 -0
- package/dist/utils/nextImageLoader.js +15 -0
- package/package.json +10 -3
- package/README.md +0 -36
- package/dist/components/PostDetailPage.d.ts +0 -7
- package/dist/components/PostDetailPage.js +0 -47
- package/dist/components/PostPage.d.ts +0 -6
- package/dist/components/PostPage.js +0 -48
- package/dist/config/language.d.ts +0 -11
- package/dist/config/language.js +0 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Mohammad Felfelani",
|
|
3
|
+
"description": "AimoonHub",
|
|
4
|
+
"keywords": ["next.js", "react", "multilingual", "website"],
|
|
5
|
+
"openGraph": {
|
|
6
|
+
"title": "My Multilingual Website",
|
|
7
|
+
"description": "Explore our multilingual platform built with Next.js.",
|
|
8
|
+
"image": "/og-en.jpg"
|
|
9
|
+
},
|
|
10
|
+
"twitter": {
|
|
11
|
+
"title": "My Multilingual Website",
|
|
12
|
+
"description": "Welcome to our multilingual website!",
|
|
13
|
+
"image": "/twitter-en.jpg"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "آیمونهاب",
|
|
3
|
+
"description": "به وبسایت چندزبانه من خوش آمدید!",
|
|
4
|
+
"keywords": ["نکست", "ریاکت", "چندزبانه", "وبسایت"],
|
|
5
|
+
"openGraph": {
|
|
6
|
+
"title": "وبسایت چندزبانه من",
|
|
7
|
+
"description": "پلتفرم چندزبانه ما را که با Next.js ساخته شده، کشف کنید.",
|
|
8
|
+
"image": "/og-fa.jpg"
|
|
9
|
+
},
|
|
10
|
+
"twitter": {
|
|
11
|
+
"title": "وبسایت چندزبانه من",
|
|
12
|
+
"description": "به وبسایت چندزبانه ما خوش آمدید!",
|
|
13
|
+
"image": "/twitter-fa.jpg"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-19
|
|
6
|
+
* @Description: Middleware with language and device detection
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { NextResponse } from "next/server";
|
|
10
|
+
import type { NextRequest } from "next/server";
|
|
11
|
+
export declare function middleware(request: NextRequest): NextResponse<unknown>;
|
|
12
|
+
export declare const config: {
|
|
13
|
+
matcher: string[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author: Mohammad Felfelani
|
|
3
|
+
* @Email: mfelfelani72@gmail.com
|
|
4
|
+
* @Team:
|
|
5
|
+
* @Date: 2025-10-19
|
|
6
|
+
* @Description: Middleware with language and device detection
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { NextResponse } from "next/server";
|
|
10
|
+
// Functions
|
|
11
|
+
import { detectDeviceFromUA } from "./libs/detectDeviceFromUA";
|
|
12
|
+
export function middleware(request) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const url = request.nextUrl.clone();
|
|
15
|
+
// ----------------------------
|
|
16
|
+
// Handle language
|
|
17
|
+
// ----------------------------
|
|
18
|
+
const cookieLang = (_a = request.cookies.get("app_lang")) === null || _a === void 0 ? void 0 : _a.value;
|
|
19
|
+
let defaultLang = "en";
|
|
20
|
+
if (cookieLang) {
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(cookieLang);
|
|
23
|
+
if ((_b = parsed.state) === null || _b === void 0 ? void 0 : _b.lang) {
|
|
24
|
+
defaultLang = parsed.state.lang;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
defaultLang = cookieLang;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (url.pathname === "/") {
|
|
32
|
+
url.pathname = `/${defaultLang}/${process.env.NEXT_PUBLIC_BASE_ROUTE}`;
|
|
33
|
+
return NextResponse.redirect(url);
|
|
34
|
+
}
|
|
35
|
+
// ----------------------------
|
|
36
|
+
// Handle device detection
|
|
37
|
+
// ----------------------------
|
|
38
|
+
const ua = request.headers.get("user-agent") || "";
|
|
39
|
+
const device = detectDeviceFromUA(ua);
|
|
40
|
+
const existingDevice = (_c = request.cookies.get("device-type")) === null || _c === void 0 ? void 0 : _c.value;
|
|
41
|
+
if (!existingDevice) {
|
|
42
|
+
const res = NextResponse.next();
|
|
43
|
+
res.cookies.set({
|
|
44
|
+
name: "device-type",
|
|
45
|
+
value: device,
|
|
46
|
+
path: "/",
|
|
47
|
+
maxAge: 60 * 60 * 24 * 365,
|
|
48
|
+
httpOnly: false,
|
|
49
|
+
sameSite: "lax",
|
|
50
|
+
});
|
|
51
|
+
return res;
|
|
52
|
+
}
|
|
53
|
+
return NextResponse.next();
|
|
54
|
+
}
|
|
55
|
+
export const config = {
|
|
56
|
+
matcher: ["/", "/:path*"],
|
|
57
|
+
};
|
package/dist/store/appStore.d.ts
CHANGED
package/dist/store/appStore.js
CHANGED