nfx-ui 0.26.0 → 0.27.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/dist/apis/authRefresh.js.map +1 -1
- package/dist/apis/clients.js.map +1 -1
- package/dist/apis/ip.d.ts.map +1 -1
- package/dist/apis/ip.js.map +1 -1
- package/dist/apis/repositories/AssetRepository.d.ts.map +1 -1
- package/dist/apis/repositories/AssetRepository.js.map +1 -1
- package/dist/apis/repositories/AuthRepository.d.ts.map +1 -1
- package/dist/apis/repositories/AuthRepository.js.map +1 -1
- package/dist/config/env.js.map +1 -1
- package/dist/constants/key.d.ts.map +1 -1
- package/dist/constants/key.js.map +1 -1
- package/dist/constants/querykeys.js.map +1 -1
- package/dist/enums/auth.d.ts.map +1 -1
- package/dist/enums/auth.js.map +1 -1
- package/dist/enums/dashboard.d.ts.map +1 -1
- package/dist/enums/dashboard.js.map +1 -1
- package/dist/enums/language.d.ts.map +1 -1
- package/dist/enums/language.js.map +1 -1
- package/dist/enums/layout.d.ts.map +1 -1
- package/dist/enums/layout.js.map +1 -1
- package/dist/enums/theme.d.ts.map +1 -1
- package/dist/enums/theme.js.map +1 -1
- package/dist/events/EventEmitter.d.ts.map +1 -1
- package/dist/events/EventEmitter.js.map +1 -1
- package/dist/events/auth.d.ts.map +1 -1
- package/dist/events/auth.js.map +1 -1
- package/dist/events/query.d.ts.map +1 -1
- package/dist/events/query.js.map +1 -1
- package/dist/events/system.d.ts.map +1 -1
- package/dist/events/system.js.map +1 -1
- package/dist/hooks/asset.d.ts.map +1 -1
- package/dist/hooks/asset.js.map +1 -1
- package/dist/hooks/auth.d.ts.map +1 -1
- package/dist/hooks/auth.js.map +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/preference.d.ts.map +1 -1
- package/dist/hooks/preference.js.map +1 -1
- package/dist/languages/hooks/useLanguageLabel.d.ts.map +1 -1
- package/dist/languages/hooks/useLanguageLabel.js.map +1 -1
- package/dist/languages/hooks/useLayoutLabel.d.ts.map +1 -1
- package/dist/languages/hooks/useLayoutLabel.js.map +1 -1
- package/dist/languages/hooks/usePreferenceLabel.d.ts.map +1 -1
- package/dist/languages/hooks/usePreferenceLabel.js.map +1 -1
- package/dist/languages/hooks/useThemeLabel.d.ts.map +1 -1
- package/dist/languages/hooks/useThemeLabel.js.map +1 -1
- package/dist/languages/languages/i18n.d.ts.map +1 -1
- package/dist/languages/languages/i18n.js.map +1 -1
- package/dist/languages/languages/i18nResources.js.map +1 -1
- package/dist/languages/types/components.d.ts.map +1 -1
- package/dist/languages/types/language.d.ts.map +1 -1
- package/dist/languages/utils/getLocalLanguage.d.ts.map +1 -1
- package/dist/languages/utils/getLocalLanguage.js.map +1 -1
- package/dist/languages/utils/languageStorage.d.ts.map +1 -1
- package/dist/languages/utils/languageStorage.js.map +1 -1
- package/dist/navigations/GuestRoute.js.map +1 -1
- package/dist/navigations/ProtectedRoute.js.map +1 -1
- package/dist/providers/DataProvider/index.d.ts.map +1 -1
- package/dist/providers/DataProvider/index.js.map +1 -1
- package/dist/providers/LanguageProvider/index.d.ts.map +1 -1
- package/dist/providers/LanguageProvider/index.js.map +1 -1
- package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
- package/dist/providers/ThemeProvider/index.js.map +1 -1
- package/dist/schemas/profileEditSchema.d.ts.map +1 -1
- package/dist/schemas/profileEditSchema.js.map +1 -1
- package/dist/schemas/signupSchema.js.map +1 -1
- package/dist/stores/auth.d.ts.map +1 -1
- package/dist/stores/auth.js.map +1 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/layout.js.map +1 -1
- package/dist/stores/preference.d.ts.map +1 -1
- package/dist/stores/preference.js.map +1 -1
- package/dist/themes/hooks/index.d.ts.map +1 -1
- package/dist/themes/hooks/useTheme.d.ts.map +1 -1
- package/dist/themes/hooks/useTheme.js.map +1 -1
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/radix/mappings.d.ts.map +1 -1
- package/dist/themes/radix/mappings.js.map +1 -1
- package/dist/themes/types/components.d.ts.map +1 -1
- package/dist/themes/types/context.d.ts.map +1 -1
- package/dist/themes/types/index.d.ts.map +1 -1
- package/dist/themes/types/theme.d.ts.map +1 -1
- package/dist/types/domain/auth/login.d.ts.map +1 -1
- package/dist/types/domain/auth/profile.d.ts.map +1 -1
- package/dist/types/domain/auth/signup.d.ts.map +1 -1
- package/dist/utils/apiError.d.ts.map +1 -1
- package/dist/utils/apiError.js.map +1 -1
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/domain/account.d.ts.map +1 -1
- package/dist/utils/domain/account.js.map +1 -1
- package/dist/utils/domain/buildProfilePatch.d.ts.map +1 -1
- package/dist/utils/domain/buildProfilePatch.js.map +1 -1
- package/dist/utils/domain/images.js.map +1 -1
- package/dist/utils/factory/hooks.d.ts.map +1 -1
- package/dist/utils/factory/hooks.js.map +1 -1
- package/dist/utils/lstorage.d.ts.map +1 -1
- package/dist/utils/lstorage.js.map +1 -1
- package/dist/utils/safe.d.ts.map +1 -1
- package/dist/utils/safe.js.map +1 -1
- package/dist/utils/suspense.d.ts.map +1 -1
- package/dist/utils/suspense.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/authRefresh.ts +4 -4
- package/src/apis/clients.ts +5 -5
- package/src/apis/ip.ts +1 -1
- package/src/apis/repositories/AssetRepository.ts +1 -1
- package/src/apis/repositories/AuthRepository.ts +2 -2
- package/src/config/env.ts +1 -1
- package/src/constants/key.ts +1 -1
- package/src/constants/querykeys.ts +1 -1
- package/src/enums/auth.ts +2 -2
- package/src/enums/dashboard.ts +2 -2
- package/src/enums/language.ts +2 -2
- package/src/enums/layout.ts +2 -2
- package/src/enums/theme.ts +2 -2
- package/src/events/EventEmitter.ts +1 -1
- package/src/events/auth.ts +4 -4
- package/src/events/query.ts +3 -3
- package/src/events/system.ts +3 -3
- package/src/hooks/asset.ts +7 -7
- package/src/hooks/auth.ts +12 -12
- package/src/hooks/index.ts +1 -1
- package/src/hooks/preference.ts +5 -5
- package/src/languages/hooks/useLanguageLabel.ts +1 -1
- package/src/languages/hooks/useLayoutLabel.ts +1 -1
- package/src/languages/hooks/usePreferenceLabel.ts +1 -1
- package/src/languages/hooks/useThemeLabel.ts +1 -1
- package/src/languages/languages/i18n.ts +3 -3
- package/src/languages/languages/i18nResources.ts +1 -1
- package/src/languages/types/components.ts +1 -1
- package/src/languages/types/language.ts +1 -1
- package/src/languages/utils/getLocalLanguage.ts +2 -2
- package/src/languages/utils/languageStorage.ts +3 -3
- package/src/navigations/GuestRoute.tsx +1 -1
- package/src/navigations/ProtectedRoute.tsx +1 -1
- package/src/providers/DataProvider/index.tsx +7 -7
- package/src/providers/LanguageProvider/index.tsx +6 -6
- package/src/providers/ThemeProvider/index.tsx +4 -4
- package/src/schemas/profileEditSchema.ts +4 -4
- package/src/schemas/signupSchema.ts +1 -1
- package/src/stores/auth.ts +3 -3
- package/src/stores/index.ts +1 -1
- package/src/stores/layout.ts +1 -1
- package/src/stores/preference.ts +5 -5
- package/src/themes/hooks/index.ts +1 -1
- package/src/themes/hooks/useTheme.ts +4 -4
- package/src/themes/index.ts +2 -2
- package/src/themes/radix/mappings.ts +2 -2
- package/src/themes/types/components.ts +1 -1
- package/src/themes/types/context.ts +2 -2
- package/src/themes/types/index.ts +1 -1
- package/src/themes/types/theme.ts +1 -1
- package/src/types/domain/auth/login.ts +2 -2
- package/src/types/domain/auth/profile.ts +1 -1
- package/src/types/domain/auth/signup.ts +1 -1
- package/src/utils/apiError.ts +2 -2
- package/src/utils/array.ts +1 -1
- package/src/utils/domain/account.ts +2 -2
- package/src/utils/domain/buildProfilePatch.ts +6 -6
- package/src/utils/domain/images.ts +1 -1
- package/src/utils/factory/hooks.ts +1 -1
- package/src/utils/lstorage.ts +1 -1
- package/src/utils/safe.ts +1 -1
- package/src/utils/suspense.ts +1 -1
package/dist/utils/safe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.js","names":[],"sources":["../../src/utils/safe.ts"],"sourcesContent":["/**\n * Safe 工具:将 Nilable / Emptyable / Array 等规范为 Nullable、Maybe、Zeroable、Stringable、Array,避免到处写 ?? undefined / ?? null / ?? 0 / ?? \"\" / ?? []。\n * Safe utils: normalize Nilable/Emptyable/array to Nullable, Maybe, Zeroable, Stringable, Array.\n */\n\nimport type { Nullable, Maybe, Nilable, Emptyable, Zeroable, Stringable, Array } from \"
|
|
1
|
+
{"version":3,"file":"safe.js","names":[],"sources":["../../src/utils/safe.ts"],"sourcesContent":["/**\n * Safe 工具:将 Nilable / Emptyable / Array 等规范为 Nullable、Maybe、Zeroable、Stringable、Array,避免到处写 ?? undefined / ?? null / ?? 0 / ?? \"\" / ?? []。\n * Safe utils: normalize Nilable/Emptyable/array to Nullable, Maybe, Zeroable, Stringable, Array.\n */\n\nimport type { Nullable, Maybe, Nilable, Emptyable, Zeroable, Stringable, Array } from \"nfx-ui/types\";\n\n/**\n * 将 Nilable 规范为 Nullable:undefined 转为 null,null 与 T 原样返回。返回类型 Nullable<T>。\n * Normalize Nilable to Nullable: convert undefined to null; null and T unchanged. Returns Nullable<T>.\n * @param value - 可能为 null 或 undefined 的值 (value that may be null or undefined)\n * @returns 若为 undefined 则 null,否则原值 (null if undefined, otherwise value)\n * @example safeNullable(apiResponse.data) // undefined → null,便于区分「未设置」与「空」\n */\nexport function safeNullable<T>(value: Nilable<T>): Nullable<T> {\n return (value === undefined ? null : value) as Nullable<T>;\n}\n\n/**\n * 将 Nilable 规范为 Maybe:null 转为 undefined,undefined 与 T 原样返回。返回类型 Maybe<T>。等同 value ?? undefined。\n * Normalize Nilable to Maybe: convert null to undefined; undefined and T unchanged. Returns Maybe<T>. Same as value ?? undefined.\n * @param value - 可能为 null 或 undefined 的值 (value that may be null or undefined)\n * @returns 若为 null 或 undefined 则 undefined,否则原值 (undefined if null/undefined, otherwise value)\n * @example safeMaybe(product.price) // 代替 product.price ?? undefined\n */\nexport function safeMaybe<T>(value: Nilable<T>): Maybe<T> {\n return value ?? undefined;\n}\n\n/**\n * 将 Emptyable 字符串规范为 Nilable:空字符串转为 undefined,null/undefined/非空串原样。返回类型 Nilable<T>。常用于表单、接口字段。\n * Normalize Emptyable string to Nilable: \"\" to undefined; null, undefined, non-empty string unchanged. Returns Nilable<T>. For form/API fields.\n * @param value - 可能为 null、undefined 或空字符串 (value that may be null, undefined or \"\")\n * @returns 若为 \"\" 则 undefined,否则原值 (undefined if \"\", otherwise value)\n * @example safeNilable(product.remark) // \"\" 也视为「无值」\n */\nexport function safeNilable<T extends string>(value: Emptyable<T>): Nilable<T> {\n return (value === \"\" ? undefined : value) as Nilable<T>;\n}\n\n/**\n * 将 Nilable 数组规范为数组:null/undefined 转为 [] 或 defaultValue。返回类型 Array<T>(即 T[])。\n * Normalize Nilable array to array: null/undefined to [] or defaultValue. Returns Array<T> (i.e. T[]).\n * @param value - 可能为 null 或 undefined 的数组 (array that may be null or undefined)\n * @param defaultValue - 可选,当 value 为 null/undefined 时使用;缺省为 [] (optional default when value is null/undefined; default is [])\n * @returns value ?? defaultValue ?? [] (never null/undefined)\n * @example safeArray(product.tags) // product.tags ?? []\n * @example safeArray(product.tags, ['default'])\n *\n * 参数使用 `Array<T>`(即 `T[]`,见 `@/types`)与全库类型别名一致;入参也接受 `readonly T[]`,便于兼容只读数组来源。\n */\nexport function safeArray<T>(value: Nilable<Array<T> | readonly T[]>, defaultValue?: Array<T>): Array<T> {\n const resolved = value ?? defaultValue;\n if (resolved === undefined) {\n return [] as Array<T>;\n }\n return resolved as Array<T>;\n}\n\n/**\n * 将 Nilable 数值规范为 Zeroable:null/undefined 转为 0。返回类型 Zeroable<number>(即 number,0 为兜底)。\n * Normalize Nilable number to Zeroable: null/undefined to 0. Returns Zeroable<number> (number with 0 as fallback).\n * @param value - 可能为 null 或 undefined 的数值 (number that may be null or undefined)\n * @returns value ?? 0 (never null/undefined)\n * @example safeZeroable(product.stock) // 代替 product.stock ?? 0\n */\nexport function safeZeroable(value: Nilable<number>): Zeroable<number> {\n return (value ?? 0) as Zeroable<number>;\n}\n\n/**\n * 将 Emptyable 字符串规范为 Stringable:null/undefined/\"\" 转为 \"\"。返回类型 Stringable<string>(即 string,\"\" 为兜底)。\n * Normalize Emptyable string to Stringable: null/undefined/\"\" to \"\". Returns Stringable<string> (string with \"\" as fallback).\n * @param value - 可能为 null、undefined 或空字符串 (value that may be null, undefined or \"\")\n * @returns 若为 null、undefined 或 \"\" 则 \"\",否则原值 (\"\" if null/undefined/\"\", otherwise value)\n * @example safeStringable(product.name) // 代替 product.name ?? \"\"\n */\nexport function safeStringable<T extends string>(value: Emptyable<T>): Stringable<T> {\n if (value === null || value === undefined || value === \"\") return \"\" as Stringable<T>;\n return value as Stringable<T>;\n}\n\n/**\n * 若值为 null/undefined 则返回默认值,否则返回原值。等同 value ?? defaultValue。\n * Return defaultValue when value is null/undefined, otherwise value. Same as value ?? defaultValue.\n * @param value - 可能为 null 或 undefined 的值 (value that may be null or undefined)\n * @param defaultValue - 默认值 (default value)\n * @returns value ?? defaultValue\n * @example safeOr(product.stock, 0)\n * @example safeOr(product.name, '')\n *\n * 使用两个类型参数时,若第一个实参无法收窄(例如索引访问、宽泛的 Record),`T` 可能被推断为 `unknown`,结果变成 `unknown`。\n * 因此提供**单类型**重载:当 `defaultValue` 与「有值时」的类型一致时,应写 `safeOr(x, fallback)` 且两者同型,返回即为 `T`。\n */\nexport function safeOr<T>(value: Nilable<T>, defaultValue: T): T;\nexport function safeOr<T, D>(value: Nilable<T>, defaultValue: D): T | D;\nexport function safeOr<T, D>(value: Nilable<T>, defaultValue: D): T | D {\n return value ?? defaultValue;\n}\n\n/**\n * 将字符串规范为允许的枚举成员;非法或缺省时回落 defaultValue。\n */\nexport function safeEnum<T extends string>(value: Nilable<string>, allowed: readonly T[], defaultValue: T): T {\n return typeof value === \"string\" && allowed.includes(value as T) ? (value as T) : defaultValue;\n}\n\n/**\n * 安全取数字:null/undefined/NaN 转为 undefined,合法数字原样。返回类型 Maybe<number>。\n * Safe number: null/undefined/NaN to undefined; valid number unchanged. Returns Maybe<number>.\n * @param value - 可能为 null、undefined 或非数字 (value that may be null, undefined or NaN)\n * @returns 若为 null、undefined 或 NaN 则 undefined,否则数字 (undefined if null/undefined/NaN, otherwise number)\n * @example safeNum(product.price) // 用于严格「有值才用」的场景\n */\nexport function safeNum(value: Nilable<number>): Maybe<number> {\n if (value === null || value === undefined) return undefined;\n const n = Number(value);\n return Number.isNaN(n) ? undefined : n;\n}\n"],"mappings":";AAcA,SAAgB,EAAgB,GAAgC;CAC9D,OAAQ,MAAU,KAAA,IAAY,OAAO;AACvC;AASA,SAAgB,EAAa,GAA6B;CACxD,OAAO,KAAS,KAAA;AAClB;AASA,SAAgB,EAA8B,GAAiC;CAC7E,OAAQ,MAAU,KAAK,KAAA,IAAY;AACrC;AAaA,SAAgB,EAAa,GAAyC,GAAmC;CACvG,IAAM,IAAW,KAAS;CAI1B,OAHI,MAAa,KAAA,IACR,CAAC,IAEH;AACT;AASA,SAAgB,EAAa,GAA0C;CACrE,OAAQ,KAAS;AACnB;AASA,SAAgB,EAAiC,GAAoC;CAEnF,OADI,KAAU,QAA+B,MAAU,KAAW,KAC3D;AACT;AAgBA,SAAgB,EAAa,GAAmB,GAAwB;CACtE,OAAO,KAAS;AAClB;AAKA,SAAgB,EAA2B,GAAwB,GAAuB,GAAoB;CAC5G,OAAO,OAAO,KAAU,YAAY,EAAQ,SAAS,CAAU,IAAK,IAAc;AACpF;AASA,SAAgB,EAAQ,GAAuC;CAC7D,IAAI,KAAU,MAA6B;CAC3C,IAAM,IAAI,OAAO,CAAK;CACtB,OAAO,OAAO,MAAM,CAAC,IAAI,KAAA,IAAY;AACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../src/utils/suspense.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../src/utils/suspense.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAKnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.js","names":[],"sources":["../../src/utils/suspense.ts"],"sourcesContent":["import type { Nilable } from \"
|
|
1
|
+
{"version":3,"file":"suspense.js","names":[],"sources":["../../src/utils/suspense.ts"],"sourcesContent":["import type { Nilable } from \"nfx-ui/types\";\n\n/**\n * 若值为 null/undefined 则抛出 Promise 使 React Suspense 挂起,否则返回该值。\n * If value is null/undefined, throw a promise to suspend (React Suspense); otherwise return value.\n * @param value - 待检查的值。Value to check.\n * @param delay - 重试前的延迟(毫秒)。Delay in ms before retry.\n * @returns 非空时的 value。Value when non-null.\n * @example const data = suspenseIfNull(resource); // 在 Suspense 边界内,data 非空时才渲染\n */\nexport function suspenseIfNull<T>(value: Nilable<T>, delay = 100): T {\n if (value == null) {\n throw new Promise<void>((resolve) => setTimeout(resolve, delay));\n }\n return value;\n}\n"],"mappings":";AAUA,SAAgB,EAAkB,GAAmB,IAAQ,KAAQ;CACnE,IAAI,KAAS,MACX,MAAM,IAAI,SAAe,MAAY,WAAW,GAAS,CAAK,CAAC;CAEjE,OAAO;AACT"}
|
package/package.json
CHANGED
package/src/apis/authRefresh.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AxiosError } from "axios";
|
|
2
|
-
import { AuthStore, clearAuth, isRejectedRefreshToken, markRejectedRefreshToken, setTokens } from "
|
|
3
|
-
import { ensureDeviceIdStorage } from "
|
|
4
|
-
import { getApiError } from "
|
|
5
|
-
import { getJwtExpiresAtMs, getJwtIssuedAtMs } from "
|
|
2
|
+
import { AuthStore, clearAuth, isRejectedRefreshToken, markRejectedRefreshToken, setTokens } from "nfx-ui/stores/auth";
|
|
3
|
+
import { ensureDeviceIdStorage } from "nfx-ui/stores/system";
|
|
4
|
+
import { getApiError } from "nfx-ui/utils/apiError";
|
|
5
|
+
import { getJwtExpiresAtMs, getJwtIssuedAtMs } from "nfx-ui/utils/jwt";
|
|
6
6
|
|
|
7
7
|
import { getIdentityRepositories } from "./activeIdentityRepositories";
|
|
8
8
|
|
package/src/apis/clients.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* publicClient: login / refresh. protectedClient: Bearer + 401 → refreshAuthTokens.
|
|
4
4
|
*/
|
|
5
5
|
import type { InternalAxiosRequestConfig } from "axios";
|
|
6
|
-
import type { ApiErrorBody } from "
|
|
6
|
+
import type { ApiErrorBody } from "nfx-ui/types";
|
|
7
7
|
|
|
8
8
|
import axios, { AxiosError } from "axios";
|
|
9
9
|
import applyCaseMiddleware from "axios-case-converter";
|
|
10
|
-
import { authEventEmitter, authEvents } from "
|
|
11
|
-
import { AuthStore, clearAuth, hasSelectedProfile } from "
|
|
12
|
-
import { shouldForceLogoutAfterAuthRetry, shouldImmediateForceLogoutOnApiError } from "
|
|
13
|
-
import { safeOr } from "
|
|
10
|
+
import { authEventEmitter, authEvents } from "nfx-ui/events/auth";
|
|
11
|
+
import { AuthStore, clearAuth, hasSelectedProfile } from "nfx-ui/stores/auth";
|
|
12
|
+
import { shouldForceLogoutAfterAuthRetry, shouldImmediateForceLogoutOnApiError } from "nfx-ui/utils/sessionErrors";
|
|
13
|
+
import { safeOr } from "nfx-ui/utils/safe";
|
|
14
14
|
|
|
15
15
|
import { refreshAuthTokens } from "./authRefresh";
|
|
16
16
|
import { API_ENDPOINTS } from "./ip";
|
package/src/apis/ip.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DataResponse, FullAccountInfoByKind, ListDTOWithTotalNumber, Login, Profile, ProfileItemsByKind, Signup, Tokens } from "
|
|
1
|
+
import type { DataResponse, FullAccountInfoByKind, ListDTOWithTotalNumber, Login, Profile, ProfileItemsByKind, Signup, Tokens } from "nfx-ui/types";
|
|
2
2
|
|
|
3
|
-
import { ProfileKindEnum } from "
|
|
3
|
+
import { ProfileKindEnum } from "nfx-ui/enums";
|
|
4
4
|
|
|
5
5
|
import { protectedClient, publicClient, publicClientWithoutTransform } from "../clients";
|
|
6
6
|
import { dataFromResponse, URL_PATHS } from "../ip";
|
package/src/config/env.ts
CHANGED
package/src/constants/key.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
|
-
* import { createListKey, createItemKey } from "
|
|
7
|
+
* import { createListKey, createItemKey } from "nfx-ui/constants";
|
|
8
8
|
*
|
|
9
9
|
* const CATALOG_CATEGORY_LIST = createListKey("catalog", "category");
|
|
10
10
|
* const CATALOG_CATEGORY = createItemKey("catalog", "category");
|
package/src/enums/auth.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* 角色不在 JWT;能力门控按纯成员判定(hasRole / hasAnyRole)。
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { Nilable } from "
|
|
7
|
+
import type { Nilable } from "nfx-ui/types";
|
|
8
8
|
|
|
9
|
-
import { safeArray, safeEnum } from "
|
|
9
|
+
import { safeArray, safeEnum } from "nfx-ui/utils/safe";
|
|
10
10
|
|
|
11
11
|
export function hasRole<T>(role: T, roles: Nilable<readonly T[]>): boolean {
|
|
12
12
|
return safeArray(roles).includes(role);
|
package/src/enums/dashboard.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Array, Nilable } from "
|
|
1
|
+
import type { Array, Nilable } from "nfx-ui/types";
|
|
2
2
|
|
|
3
|
-
import { safeEnum } from "
|
|
3
|
+
import { safeEnum } from "nfx-ui/utils/safe";
|
|
4
4
|
|
|
5
5
|
/** 仪表盘背景。Dashboard background. */
|
|
6
6
|
export enum DashboardBackgroundEnum {
|
package/src/enums/language.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 语言枚举与常量,不引用任何 JSON,供需要轻量引用的模块使用。
|
|
3
3
|
*/
|
|
4
|
-
import type { Nilable } from "
|
|
4
|
+
import type { Nilable } from "nfx-ui/types";
|
|
5
5
|
|
|
6
|
-
import { safeEnum } from "
|
|
6
|
+
import { safeEnum } from "nfx-ui/utils/safe";
|
|
7
7
|
|
|
8
8
|
export enum LanguageEnum {
|
|
9
9
|
EN = "en",
|
package/src/enums/layout.ts
CHANGED
package/src/enums/theme.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { safeEnum } from "
|
|
1
|
+
import { safeEnum } from "nfx-ui/utils/safe";
|
|
2
2
|
|
|
3
|
-
import type { Nilable } from "
|
|
3
|
+
import type { Nilable } from "nfx-ui/types";
|
|
4
4
|
|
|
5
5
|
/** 基础主题枚举(平台/圆角等,如 iOS 24 / Android|Windows 6 / Linux 4) */
|
|
6
6
|
export enum BaseEnum {
|
package/src/events/auth.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ProfileKindEnum } from "
|
|
2
|
-
import type { EventNamesOf } from "
|
|
1
|
+
import type { ProfileKindEnum } from "nfx-ui/enums";
|
|
2
|
+
import type { EventNamesOf } from "nfx-ui/events/EventEmitter";
|
|
3
3
|
|
|
4
|
-
import { defineEvents, EventEmitter } from "
|
|
5
|
-
import { singleton } from "
|
|
4
|
+
import { defineEvents, EventEmitter } from "nfx-ui/events/EventEmitter";
|
|
5
|
+
import { singleton } from "nfx-ui/utils/singleton";
|
|
6
6
|
|
|
7
7
|
export const authEvents = defineEvents({
|
|
8
8
|
UPDATE_ACCOUNT_SUCCESS: "AUTH:UPDATE_ACCOUNT_SUCCESS",
|
package/src/events/query.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EventNamesOf } from "
|
|
1
|
+
import type { EventNamesOf } from "nfx-ui/events/EventEmitter";
|
|
2
2
|
|
|
3
|
-
import { defineEvents, EventEmitter } from "
|
|
4
|
-
import { singleton } from "
|
|
3
|
+
import { defineEvents, EventEmitter } from "nfx-ui/events/EventEmitter";
|
|
4
|
+
import { singleton } from "nfx-ui/utils/singleton";
|
|
5
5
|
|
|
6
6
|
export const queryEvents = defineEvents({
|
|
7
7
|
RESET_ACTIVE_QUERIES: "QUERY:RESET_ACTIVE_QUERIES",
|
package/src/events/system.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EventNamesOf } from "
|
|
1
|
+
import type { EventNamesOf } from "nfx-ui/events/EventEmitter";
|
|
2
2
|
|
|
3
|
-
import { defineEvents, EventEmitter } from "
|
|
4
|
-
import { singleton } from "
|
|
3
|
+
import { defineEvents, EventEmitter } from "nfx-ui/events/EventEmitter";
|
|
4
|
+
import { singleton } from "nfx-ui/utils/singleton";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Host-agnostic UI feedback. Package emits; WEB ModalProvider listens.
|
package/src/hooks/asset.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Asset upload hooks — 组件勿直接调 apis/asset
|
|
3
3
|
*/
|
|
4
4
|
import type { AxiosError } from "axios";
|
|
5
|
-
import type { Asset } from "
|
|
5
|
+
import type { Asset } from "nfx-ui/types";
|
|
6
6
|
|
|
7
7
|
import { useMutation } from "@tanstack/react-query";
|
|
8
|
-
import { useAssetRepository } from "
|
|
9
|
-
import { authEventEmitter, authEvents } from "
|
|
10
|
-
import { systemEventEmitter } from "
|
|
11
|
-
import { AuthStore } from "
|
|
12
|
-
import { getApiErrorMessage } from "
|
|
13
|
-
import { useUnifiedQuery } from "
|
|
8
|
+
import { useAssetRepository } from "nfx-ui/apis/repositories";
|
|
9
|
+
import { authEventEmitter, authEvents } from "nfx-ui/events/auth";
|
|
10
|
+
import { systemEventEmitter } from "nfx-ui/events/system";
|
|
11
|
+
import { AuthStore } from "nfx-ui/stores/auth";
|
|
12
|
+
import { getApiErrorMessage } from "nfx-ui/utils/apiError";
|
|
13
|
+
import { useUnifiedQuery } from "nfx-ui/utils/factory";
|
|
14
14
|
|
|
15
15
|
export type UseDeleteImageOptions = {
|
|
16
16
|
ifShowError?: boolean;
|
package/src/hooks/auth.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Auth hooks — 组件勿直接调 apis/auth
|
|
3
3
|
*/
|
|
4
4
|
import type { AxiosError } from "axios";
|
|
5
|
-
import type { CurrentProfileResult, Login, Profile, Signup } from "
|
|
5
|
+
import type { CurrentProfileResult, Login, Profile, Signup } from "nfx-ui/types";
|
|
6
6
|
|
|
7
7
|
import { useEffect } from "react";
|
|
8
8
|
import { useMutation } from "@tanstack/react-query";
|
|
9
|
-
import { useAuthRepository } from "
|
|
10
|
-
import { AUTH_EMAILS, AUTH_ME, AUTH_PHONES, AUTH_PROFILES } from "
|
|
11
|
-
import { AuthSignupPlatformEnum, LanguageEnum, ProfileKindEnum } from "
|
|
12
|
-
import { authEventEmitter, authEvents } from "
|
|
13
|
-
import { systemEventEmitter } from "
|
|
9
|
+
import { useAuthRepository } from "nfx-ui/apis/repositories";
|
|
10
|
+
import { AUTH_EMAILS, AUTH_ME, AUTH_PHONES, AUTH_PROFILES } from "nfx-ui/constants";
|
|
11
|
+
import { AuthSignupPlatformEnum, LanguageEnum, ProfileKindEnum } from "nfx-ui/enums";
|
|
12
|
+
import { authEventEmitter, authEvents } from "nfx-ui/events/auth";
|
|
13
|
+
import { systemEventEmitter } from "nfx-ui/events/system";
|
|
14
14
|
import {
|
|
15
15
|
AuthStore,
|
|
16
16
|
clearAuth,
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
setIsAuthValid,
|
|
23
23
|
setTokens,
|
|
24
24
|
useAuthStore,
|
|
25
|
-
} from "
|
|
26
|
-
import { ensureDeviceIdStorage } from "
|
|
27
|
-
import { getApiErrorMessage } from "
|
|
28
|
-
import { pickProfile } from "
|
|
29
|
-
import { useUnifiedQuery } from "
|
|
30
|
-
import { safeOr, safeStringable } from "
|
|
25
|
+
} from "nfx-ui/stores/auth";
|
|
26
|
+
import { ensureDeviceIdStorage } from "nfx-ui/stores/system";
|
|
27
|
+
import { getApiErrorMessage } from "nfx-ui/utils/apiError";
|
|
28
|
+
import { pickProfile } from "nfx-ui/utils/domain/account";
|
|
29
|
+
import { useUnifiedQuery } from "nfx-ui/utils/factory";
|
|
30
|
+
import { safeOr, safeStringable } from "nfx-ui/utils/safe";
|
|
31
31
|
import { useTranslation } from "react-i18next";
|
|
32
32
|
|
|
33
33
|
export function useAuthQueryScope() {
|
package/src/hooks/index.ts
CHANGED
package/src/hooks/preference.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared preference hooks — appearance resolve + host-configured server sync.
|
|
3
3
|
*/
|
|
4
|
-
import type { PreferencePatch, ResolvedPreference } from "
|
|
5
|
-
import type { RadixAppearance } from "
|
|
4
|
+
import type { PreferencePatch, ResolvedPreference } from "nfx-ui/stores/preference";
|
|
5
|
+
import type { RadixAppearance } from "nfx-ui/themes/radix";
|
|
6
6
|
|
|
7
7
|
import { useEffect, useRef, useState } from "react";
|
|
8
8
|
|
|
9
|
-
import { AppearanceEnum } from "
|
|
9
|
+
import { AppearanceEnum } from "nfx-ui/enums/theme";
|
|
10
10
|
import {
|
|
11
11
|
PreferenceStore,
|
|
12
12
|
replacePreference,
|
|
13
13
|
setPreference,
|
|
14
14
|
usePreferenceStore,
|
|
15
|
-
} from "
|
|
16
|
-
import { readSystemRadixAppearance, resolveRadixAppearance } from "
|
|
15
|
+
} from "nfx-ui/stores/preference";
|
|
16
|
+
import { readSystemRadixAppearance, resolveRadixAppearance } from "nfx-ui/themes/radix";
|
|
17
17
|
|
|
18
18
|
/** 将 theme.appearance(含 system)解析为当前生效的 Radix light|dark,并在跟随系统时响应 OS 切换。 */
|
|
19
19
|
export function useResolvedAppearance(): RadixAppearance {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i18n from "i18next";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
|
|
4
|
-
import { BaseEnum } from "
|
|
4
|
+
import { BaseEnum } from "nfx-ui/enums/theme";
|
|
5
5
|
import { LanguageEnum } from "../types";
|
|
6
6
|
|
|
7
7
|
function getLanguageI18nKey(lang: LanguageEnum): string {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 返回 { getLayoutDisplayName },便于扩展;getLayoutDisplayName 可传给 SlideDownSwitcher 的 getDisplayName。
|
|
3
3
|
* Returns { getLayoutDisplayName } for extensibility; pass to SlideDownSwitcher getDisplayName.
|
|
4
4
|
*/
|
|
5
|
-
import type { LayoutModeEnum } from "
|
|
5
|
+
import type { LayoutModeEnum } from "nfx-ui/enums/layout";
|
|
6
6
|
|
|
7
7
|
import { useCallback, useMemo } from "react";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 返回 { getPreferenceDisplayName }(Base 展示名),便于扩展;可传给 SlideDownSwitcher 的 getDisplayName。
|
|
3
3
|
* Returns { getPreferenceDisplayName } for extensibility; pass to SlideDownSwitcher getDisplayName.
|
|
4
4
|
*/
|
|
5
|
-
import type { BaseEnum } from "
|
|
5
|
+
import type { BaseEnum } from "nfx-ui/enums/theme";
|
|
6
6
|
|
|
7
7
|
import { useCallback, useMemo } from "react";
|
|
8
8
|
|
|
@@ -8,9 +8,9 @@ import i18n from "i18next";
|
|
|
8
8
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
9
9
|
import { initReactI18next } from "react-i18next";
|
|
10
10
|
|
|
11
|
-
import { LanguageEnum, LANGUAGE_VALUES } from "
|
|
12
|
-
import { PreferenceStore, setPreference } from "
|
|
13
|
-
import { safeEnum, safeStringable } from "
|
|
11
|
+
import { LanguageEnum, LANGUAGE_VALUES } from "nfx-ui/enums/language";
|
|
12
|
+
import { PreferenceStore, setPreference } from "nfx-ui/stores/preference";
|
|
13
|
+
import { safeEnum, safeStringable } from "nfx-ui/utils/safe";
|
|
14
14
|
|
|
15
15
|
import { getDefaultNfxBundles } from "../resources";
|
|
16
16
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { CreateI18nResourcesResult, LanguageEnum, NameSpacesMap, Resources } from "../types";
|
|
6
6
|
|
|
7
7
|
import i18n from "./i18n";
|
|
8
|
-
import { setPreference } from "
|
|
8
|
+
import { setPreference } from "nfx-ui/stores/preference";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 由调用方传入 resources 和 nameSpacesMap,生成 i18n 所需的 RESOURCES、NAME_SPACES_MAP、NAME_SPACES。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 获取本地语言:PreferenceStore 为唯一真相。
|
|
3
3
|
*/
|
|
4
|
-
import { PreferenceStore } from "
|
|
5
|
-
import { DEFAULT_LANGUAGE, type LanguageEnum } from "
|
|
4
|
+
import { PreferenceStore } from "nfx-ui/stores/preference";
|
|
5
|
+
import { DEFAULT_LANGUAGE, type LanguageEnum } from "nfx-ui/enums/language";
|
|
6
6
|
|
|
7
7
|
export function getLocalLanguage(): LanguageEnum {
|
|
8
8
|
return PreferenceStore.getState().language ?? DEFAULT_LANGUAGE;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Language helpers backed by PreferenceStore (CityPulso: no separate language-storage key).
|
|
3
3
|
*/
|
|
4
|
-
import type { Nilable } from "
|
|
4
|
+
import type { Nilable } from "nfx-ui/types/utils";
|
|
5
5
|
|
|
6
|
-
import { LANGUAGE_VALUES, LanguageEnum } from "
|
|
7
|
-
import { PreferenceStore, setPreference } from "
|
|
6
|
+
import { LANGUAGE_VALUES, LanguageEnum } from "nfx-ui/enums/language";
|
|
7
|
+
import { PreferenceStore, setPreference } from "nfx-ui/stores/preference";
|
|
8
8
|
|
|
9
9
|
export function getLanguageStorage(): Nilable<LanguageEnum> {
|
|
10
10
|
const raw = PreferenceStore.getState().language;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Guest-only outlet — redirects away when session + profile are already selected.
|
|
3
3
|
* Host supplies product home path via `redirectTo`.
|
|
4
4
|
*/
|
|
5
|
-
import { hasSelectedProfile, useAuthStore } from "
|
|
5
|
+
import { hasSelectedProfile, useAuthStore } from "nfx-ui/stores/auth";
|
|
6
6
|
import { Navigate, Outlet } from "react-router";
|
|
7
7
|
|
|
8
8
|
export interface GuestRouteProps {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Auth-gated outlet — redirects to login when session/profile missing.
|
|
3
3
|
* Host supplies product login path via `redirectTo`.
|
|
4
4
|
*/
|
|
5
|
-
import { hasSelectedProfile, useAuthStore } from "
|
|
5
|
+
import { hasSelectedProfile, useAuthStore } from "nfx-ui/stores/auth";
|
|
6
6
|
import { Navigate, Outlet, useLocation } from "react-router";
|
|
7
7
|
|
|
8
8
|
export interface ProtectedRouteProps {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { IdentityRepositories } from "
|
|
1
|
+
import type { IdentityRepositories } from "nfx-ui/apis";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
import { useEffect, useMemo } from "react";
|
|
5
|
-
import { ApiAssetRepository, ApiAuthRepository, IdentityRepositoriesContext, setIdentityRepositories, useAuthRepository } from "
|
|
6
|
-
import { scheduleAccessTokenRefresh } from "
|
|
7
|
-
import { useAuthQueryScope, useCurrentProfile } from "
|
|
8
|
-
import { configurePreferenceSync, useApplyPreferenceOnLoad } from "
|
|
9
|
-
import { AuthStore, hasSelectedProfile, subscribeAuthStorageSync } from "
|
|
10
|
-
import { parseServerPreference, toServerPreference } from "
|
|
5
|
+
import { ApiAssetRepository, ApiAuthRepository, IdentityRepositoriesContext, setIdentityRepositories, useAuthRepository } from "nfx-ui/apis";
|
|
6
|
+
import { scheduleAccessTokenRefresh } from "nfx-ui/apis/authRefresh";
|
|
7
|
+
import { useAuthQueryScope, useCurrentProfile } from "nfx-ui/hooks/auth";
|
|
8
|
+
import { configurePreferenceSync, useApplyPreferenceOnLoad } from "nfx-ui/hooks/preference";
|
|
9
|
+
import { AuthStore, hasSelectedProfile, subscribeAuthStorageSync } from "nfx-ui/stores/auth";
|
|
10
|
+
import { parseServerPreference, toServerPreference } from "nfx-ui/stores/preference";
|
|
11
11
|
|
|
12
12
|
const defaultIdentityRepositories: IdentityRepositories = {
|
|
13
13
|
auth: new ApiAuthRepository(),
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Shared LanguageProvider — host passes product builtin bundles.
|
|
3
3
|
* Identity error/message namespaces load here (PulsoLink LanguageProvider pattern).
|
|
4
4
|
*/
|
|
5
|
-
import type { CreateI18nResourcesResult, ExtraBundleItem, onLoadExtraBundles } from "
|
|
5
|
+
import type { CreateI18nResourcesResult, ExtraBundleItem, onLoadExtraBundles } from "nfx-ui/languages/types";
|
|
6
6
|
import type { ReactNode } from "react";
|
|
7
7
|
|
|
8
8
|
import { useEffect, useRef } from "react";
|
|
9
9
|
|
|
10
|
-
import { getIdentityRepositories } from "
|
|
11
|
-
import { DEFAULT_LANGUAGE, LANGUAGE_VALUES, LanguageEnum } from "
|
|
12
|
-
import i18n, { initI18n, toSupportedLanguage } from "
|
|
13
|
-
import { PreferenceStore } from "
|
|
14
|
-
import { ERRORS_NS_IDENTITY, MESSAGES_NS_IDENTITY } from "
|
|
10
|
+
import { getIdentityRepositories } from "nfx-ui/apis";
|
|
11
|
+
import { DEFAULT_LANGUAGE, LANGUAGE_VALUES, LanguageEnum } from "nfx-ui/enums/language";
|
|
12
|
+
import i18n, { initI18n, toSupportedLanguage } from "nfx-ui/languages/languages/i18n";
|
|
13
|
+
import { PreferenceStore } from "nfx-ui/stores/preference";
|
|
14
|
+
import { ERRORS_NS_IDENTITY, MESSAGES_NS_IDENTITY } from "nfx-ui/utils/apiError";
|
|
15
15
|
|
|
16
16
|
export interface LanguageProviderProps {
|
|
17
17
|
children: ReactNode;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Shared Radix Theme provider — reads unified preference store.
|
|
3
3
|
* Host may pass document side-effects (e.g. favicon) via `onAppearanceChange`.
|
|
4
4
|
*/
|
|
5
|
-
import type { RadixAppearance } from "
|
|
5
|
+
import type { RadixAppearance } from "nfx-ui/themes/radix";
|
|
6
6
|
import type { ReactNode } from "react";
|
|
7
7
|
|
|
8
8
|
import { useEffect } from "react";
|
|
9
9
|
import { Theme } from "@radix-ui/themes";
|
|
10
10
|
|
|
11
|
-
import { useResolvedAppearance } from "
|
|
12
|
-
import { usePreferenceStore } from "
|
|
11
|
+
import { useResolvedAppearance } from "nfx-ui/hooks/preference";
|
|
12
|
+
import { usePreferenceStore } from "nfx-ui/stores/preference";
|
|
13
13
|
|
|
14
|
-
import "
|
|
14
|
+
import "nfx-ui/themes/index.css";
|
|
15
15
|
|
|
16
16
|
export interface ThemeProviderProps {
|
|
17
17
|
children: ReactNode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { TFunction } from "i18next";
|
|
2
|
-
import type { Profile } from "
|
|
2
|
+
import type { Profile } from "nfx-ui/types";
|
|
3
3
|
|
|
4
4
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
5
|
-
import { Language, LanguageEnum } from "
|
|
6
|
-
import { toDateInputValue } from "
|
|
7
|
-
import { safeStringable } from "
|
|
5
|
+
import { Language, LanguageEnum } from "nfx-ui/enums";
|
|
6
|
+
import { toDateInputValue } from "nfx-ui/utils/time";
|
|
7
|
+
import { safeStringable } from "nfx-ui/utils/safe";
|
|
8
8
|
import { useForm } from "react-hook-form";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TFunction } from "i18next";
|
|
2
2
|
|
|
3
3
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
-
import { normalizeVerificationCode, VERIFICATION_CODE_ALPHABET } from "
|
|
4
|
+
import { normalizeVerificationCode, VERIFICATION_CODE_ALPHABET } from "nfx-ui/utils/domain/verificationCode";
|
|
5
5
|
import { useForm } from "react-hook-form";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import { z } from "zod";
|
package/src/stores/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Tokens } from "
|
|
1
|
+
import type { Tokens } from "nfx-ui/types";
|
|
2
2
|
|
|
3
|
-
import { DEFAULT_PROFILE_KIND, ProfileKind, ProfileKindEnum } from "
|
|
4
|
-
import { makeStore } from "
|
|
3
|
+
import { DEFAULT_PROFILE_KIND, ProfileKind, ProfileKindEnum } from "nfx-ui/enums";
|
|
4
|
+
import { makeStore } from "nfx-ui/stores/makeStore";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Auth session: memory is source of truth.
|
package/src/stores/index.ts
CHANGED
|
@@ -3,4 +3,4 @@ export * from "./preference";
|
|
|
3
3
|
export * from "./layout";
|
|
4
4
|
export * from "./auth";
|
|
5
5
|
export * from "./system";
|
|
6
|
-
export { DashboardBackgroundEnum, DEFAULT_DASHBOARD_BACKGROUND, DASHBOARD_BACKGROUND_VALUES } from "
|
|
6
|
+
export { DashboardBackgroundEnum, DEFAULT_DASHBOARD_BACKGROUND, DASHBOARD_BACKGROUND_VALUES } from "nfx-ui/enums/dashboard";
|
package/src/stores/layout.ts
CHANGED