@fctc/interface-logic 1.9.8 → 1.9.9
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/hooks.js +10 -8
- package/dist/hooks.mjs +10 -8
- package/dist/provider.js +1 -0
- package/dist/provider.mjs +1 -0
- package/package.json +4 -1
package/dist/hooks.js
CHANGED
|
@@ -4870,22 +4870,23 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
|
4870
4870
|
var import_react4 = require("react");
|
|
4871
4871
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4872
4872
|
var EnvContext = (0, import_react4.createContext)(null);
|
|
4873
|
+
function useEnv() {
|
|
4874
|
+
const context = (0, import_react4.useContext)(EnvContext);
|
|
4875
|
+
console.log("useEnv context:", context, new Error().stack);
|
|
4876
|
+
if (!context) {
|
|
4877
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
4878
|
+
}
|
|
4879
|
+
return context;
|
|
4880
|
+
}
|
|
4873
4881
|
|
|
4874
4882
|
// src/provider/env-share.tsx
|
|
4875
4883
|
var import_react5 = require("react");
|
|
4876
4884
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4877
4885
|
var EnvShareContext = (0, import_react5.createContext)(null);
|
|
4878
|
-
function useSharedEnv() {
|
|
4879
|
-
const env2 = (0, import_react5.useContext)(EnvShareContext);
|
|
4880
|
-
if (!env2) {
|
|
4881
|
-
throw new Error("useSharedEnv must be used within an EnvShareProvider");
|
|
4882
|
-
}
|
|
4883
|
-
return env2;
|
|
4884
|
-
}
|
|
4885
4886
|
|
|
4886
4887
|
// src/services/auth-service/backup.ts
|
|
4887
4888
|
function useAuthService() {
|
|
4888
|
-
const env2 =
|
|
4889
|
+
const { env: env2 } = useEnv();
|
|
4889
4890
|
const login = (0, import_react6.useCallback)(
|
|
4890
4891
|
async (body) => {
|
|
4891
4892
|
const payload = Object.fromEntries(
|
|
@@ -5103,6 +5104,7 @@ function useAuthService() {
|
|
|
5103
5104
|
|
|
5104
5105
|
// src/hooks/auth/use-login-credential.tsx
|
|
5105
5106
|
var useLoginCredential = () => {
|
|
5107
|
+
console.log("useLoginCredential called", new Error().stack);
|
|
5106
5108
|
const { login } = useAuthService();
|
|
5107
5109
|
return (0, import_react_query7.useMutation)({
|
|
5108
5110
|
mutationFn: (data) => {
|
package/dist/hooks.mjs
CHANGED
|
@@ -4766,22 +4766,23 @@ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
|
|
|
4766
4766
|
import { createContext, useContext, useState as useState3, useCallback as useCallback2 } from "react";
|
|
4767
4767
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
4768
4768
|
var EnvContext = createContext(null);
|
|
4769
|
+
function useEnv() {
|
|
4770
|
+
const context = useContext(EnvContext);
|
|
4771
|
+
console.log("useEnv context:", context, new Error().stack);
|
|
4772
|
+
if (!context) {
|
|
4773
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
4774
|
+
}
|
|
4775
|
+
return context;
|
|
4776
|
+
}
|
|
4769
4777
|
|
|
4770
4778
|
// src/provider/env-share.tsx
|
|
4771
4779
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
4772
4780
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
4773
4781
|
var EnvShareContext = createContext2(null);
|
|
4774
|
-
function useSharedEnv() {
|
|
4775
|
-
const env2 = useContext2(EnvShareContext);
|
|
4776
|
-
if (!env2) {
|
|
4777
|
-
throw new Error("useSharedEnv must be used within an EnvShareProvider");
|
|
4778
|
-
}
|
|
4779
|
-
return env2;
|
|
4780
|
-
}
|
|
4781
4782
|
|
|
4782
4783
|
// src/services/auth-service/backup.ts
|
|
4783
4784
|
function useAuthService() {
|
|
4784
|
-
const env2 =
|
|
4785
|
+
const { env: env2 } = useEnv();
|
|
4785
4786
|
const login = useCallback3(
|
|
4786
4787
|
async (body) => {
|
|
4787
4788
|
const payload = Object.fromEntries(
|
|
@@ -4999,6 +5000,7 @@ function useAuthService() {
|
|
|
4999
5000
|
|
|
5000
5001
|
// src/hooks/auth/use-login-credential.tsx
|
|
5001
5002
|
var useLoginCredential = () => {
|
|
5003
|
+
console.log("useLoginCredential called", new Error().stack);
|
|
5002
5004
|
const { login } = useAuthService();
|
|
5003
5005
|
return useMutation5({
|
|
5004
5006
|
mutationFn: (data) => {
|
package/dist/provider.js
CHANGED
|
@@ -3447,6 +3447,7 @@ function EnvProvider({
|
|
|
3447
3447
|
}
|
|
3448
3448
|
function useEnv() {
|
|
3449
3449
|
const context = (0, import_react4.useContext)(EnvContext);
|
|
3450
|
+
console.log("useEnv context:", context, new Error().stack);
|
|
3450
3451
|
if (!context) {
|
|
3451
3452
|
throw new Error("useEnv must be used within an EnvProvider");
|
|
3452
3453
|
}
|
package/dist/provider.mjs
CHANGED
|
@@ -3405,6 +3405,7 @@ function EnvProvider({
|
|
|
3405
3405
|
}
|
|
3406
3406
|
function useEnv() {
|
|
3407
3407
|
const context = useContext(EnvContext);
|
|
3408
|
+
console.log("useEnv context:", context, new Error().stack);
|
|
3408
3409
|
if (!context) {
|
|
3409
3410
|
throw new Error("useEnv must be used within an EnvProvider");
|
|
3410
3411
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fctc/interface-logic",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
"build": "tsup",
|
|
64
64
|
"test": "jest"
|
|
65
65
|
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@tanstack/react-query": "^5.83.0"
|
|
68
|
+
},
|
|
66
69
|
"dependencies": {
|
|
67
70
|
"@reduxjs/toolkit": "^2.8.2",
|
|
68
71
|
"@tanstack/react-query": "^5.83.0",
|