@navservice/core 1.42.0 → 1.43.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/README.md +1 -0
- package/build/es/index.browser.js +16 -1
- package/build/es/utils/_hooks.d.ts +5 -0
- package/build/es/utils/index.d.ts +3 -0
- package/build/es/utils.js +18 -2
- package/build/lib/index.browser.cjs +22 -2
- package/build/lib/utils/_hooks.d.ts +5 -0
- package/build/lib/utils/index.d.ts +3 -0
- package/build/lib/utils.cjs +21 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import v4 from "zod/v4";
|
|
2
2
|
import axios from "axios";
|
|
3
|
+
import { useLayoutEffect, useState } from "react";
|
|
3
4
|
class config_env {
|
|
4
5
|
static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
5
6
|
static init(config) {
|
|
@@ -606,6 +607,19 @@ const _sistema = {
|
|
|
606
607
|
}
|
|
607
608
|
};
|
|
608
609
|
const utils_sistema = _sistema;
|
|
610
|
+
class _hooks {
|
|
611
|
+
use_is_mobile() {
|
|
612
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
613
|
+
useLayoutEffect(()=>{
|
|
614
|
+
const updateSize = ()=>setIsMobile(window.innerWidth < 768);
|
|
615
|
+
window.addEventListener("resize", updateSize);
|
|
616
|
+
updateSize();
|
|
617
|
+
return ()=>window.removeEventListener("resize", updateSize);
|
|
618
|
+
}, []);
|
|
619
|
+
return isMobile;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
const utils_hooks = new _hooks;
|
|
609
623
|
const utils = {
|
|
610
624
|
api: utils_api,
|
|
611
625
|
data: utils_data,
|
|
@@ -614,7 +628,8 @@ const utils = {
|
|
|
614
628
|
local_storage: utils_local_storage,
|
|
615
629
|
update_context: utils_update_context,
|
|
616
630
|
session_sorage: utils_session_storage,
|
|
617
|
-
sistema: utils_sistema
|
|
631
|
+
sistema: utils_sistema,
|
|
632
|
+
hooks: utils_hooks
|
|
618
633
|
};
|
|
619
634
|
const src_utils = utils;
|
|
620
635
|
export { types as TypesCore, src_config_env as config_env_core, src_utils as utils };
|
package/build/es/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { useLayoutEffect, useState } from "react";
|
|
2
3
|
class config_env {
|
|
3
4
|
static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
4
5
|
static init(config) {
|
|
@@ -444,6 +445,19 @@ const _sistema = {
|
|
|
444
445
|
}
|
|
445
446
|
};
|
|
446
447
|
const utils_sistema = _sistema;
|
|
448
|
+
class _hooks {
|
|
449
|
+
use_is_mobile() {
|
|
450
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
451
|
+
useLayoutEffect(()=>{
|
|
452
|
+
const updateSize = ()=>setIsMobile(window.innerWidth < 768);
|
|
453
|
+
window.addEventListener("resize", updateSize);
|
|
454
|
+
updateSize();
|
|
455
|
+
return ()=>window.removeEventListener("resize", updateSize);
|
|
456
|
+
}, []);
|
|
457
|
+
return isMobile;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const utils_hooks = new _hooks;
|
|
447
461
|
const utils = {
|
|
448
462
|
api: utils_api,
|
|
449
463
|
data: utils_data,
|
|
@@ -452,7 +466,8 @@ const utils = {
|
|
|
452
466
|
local_storage: utils_local_storage,
|
|
453
467
|
update_context: utils_update_context,
|
|
454
468
|
session_sorage: utils_session_storage,
|
|
455
|
-
sistema: utils_sistema
|
|
469
|
+
sistema: utils_sistema,
|
|
470
|
+
hooks: utils_hooks
|
|
456
471
|
};
|
|
457
472
|
const src_utils = utils;
|
|
458
473
|
const _api_api = class _api {
|
|
@@ -516,7 +531,8 @@ const utils_utils = {
|
|
|
516
531
|
local_storage: utils_local_storage,
|
|
517
532
|
update_context: utils_update_context,
|
|
518
533
|
session_sorage: utils_session_storage,
|
|
519
|
-
sistema: utils_sistema
|
|
534
|
+
sistema: utils_sistema,
|
|
535
|
+
hooks: utils_hooks
|
|
520
536
|
};
|
|
521
537
|
const src_utils_0 = utils_utils;
|
|
522
538
|
export { src_utils_0 as default };
|
|
@@ -616,6 +616,24 @@ const _sistema = {
|
|
|
616
616
|
};
|
|
617
617
|
/* export default */ const utils_sistema = (_sistema);
|
|
618
618
|
|
|
619
|
+
;// CONCATENATED MODULE: external "react"
|
|
620
|
+
const external_react_namespaceObject = require("react");
|
|
621
|
+
;// CONCATENATED MODULE: ./src/utils/_hooks.ts
|
|
622
|
+
|
|
623
|
+
class _hooks {
|
|
624
|
+
use_is_mobile() {
|
|
625
|
+
const [isMobile, setIsMobile] = (0,external_react_namespaceObject.useState)(false);
|
|
626
|
+
(0,external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
627
|
+
const updateSize = ()=>setIsMobile(window.innerWidth < 768);
|
|
628
|
+
window.addEventListener("resize", updateSize);
|
|
629
|
+
updateSize();
|
|
630
|
+
return ()=>window.removeEventListener("resize", updateSize);
|
|
631
|
+
}, []);
|
|
632
|
+
return isMobile;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
/* export default */ const utils_hooks = (new _hooks);
|
|
636
|
+
|
|
619
637
|
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
620
638
|
|
|
621
639
|
|
|
@@ -625,6 +643,7 @@ const _sistema = {
|
|
|
625
643
|
|
|
626
644
|
|
|
627
645
|
|
|
646
|
+
|
|
628
647
|
const utils = {
|
|
629
648
|
api: utils_api,
|
|
630
649
|
data: utils_data,
|
|
@@ -633,7 +652,8 @@ const utils = {
|
|
|
633
652
|
local_storage: utils_local_storage,
|
|
634
653
|
update_context: utils_update_context,
|
|
635
654
|
session_sorage: utils_session_storage,
|
|
636
|
-
sistema: utils_sistema
|
|
655
|
+
sistema: utils_sistema,
|
|
656
|
+
hooks: utils_hooks
|
|
637
657
|
};
|
|
638
658
|
/* export default */ const src_utils = (utils);
|
|
639
659
|
|
|
@@ -838,7 +858,7 @@ var _type_response_TypeControllerResponse;
|
|
|
838
858
|
/* export default */ const types = (types_t);
|
|
839
859
|
var types_t;
|
|
840
860
|
|
|
841
|
-
// EXTERNAL MODULE: ./src/utils/index.ts +
|
|
861
|
+
// EXTERNAL MODULE: ./src/utils/index.ts + 11 modules
|
|
842
862
|
var utils = __webpack_require__("./src/utils/index.ts");
|
|
843
863
|
;// CONCATENATED MODULE: ./src/index.browser.ts
|
|
844
864
|
|
package/build/lib/utils.cjs
CHANGED
|
@@ -681,6 +681,24 @@ const _sistema = {
|
|
|
681
681
|
};
|
|
682
682
|
/* export default */ const utils_sistema = (_sistema);
|
|
683
683
|
|
|
684
|
+
;// CONCATENATED MODULE: external "react"
|
|
685
|
+
const external_react_namespaceObject = require("react");
|
|
686
|
+
;// CONCATENATED MODULE: ./src/utils/_hooks.ts
|
|
687
|
+
|
|
688
|
+
class _hooks {
|
|
689
|
+
use_is_mobile() {
|
|
690
|
+
const [isMobile, setIsMobile] = (0,external_react_namespaceObject.useState)(false);
|
|
691
|
+
(0,external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
692
|
+
const updateSize = ()=>setIsMobile(window.innerWidth < 768);
|
|
693
|
+
window.addEventListener("resize", updateSize);
|
|
694
|
+
updateSize();
|
|
695
|
+
return ()=>window.removeEventListener("resize", updateSize);
|
|
696
|
+
}, []);
|
|
697
|
+
return isMobile;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/* export default */ const utils_hooks = (new _hooks);
|
|
701
|
+
|
|
684
702
|
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
685
703
|
|
|
686
704
|
|
|
@@ -690,6 +708,7 @@ const _sistema = {
|
|
|
690
708
|
|
|
691
709
|
|
|
692
710
|
|
|
711
|
+
|
|
693
712
|
const utils = {
|
|
694
713
|
api: utils_api,
|
|
695
714
|
data: utils_data,
|
|
@@ -698,7 +717,8 @@ const utils = {
|
|
|
698
717
|
local_storage: utils_local_storage,
|
|
699
718
|
update_context: utils_update_context,
|
|
700
719
|
session_sorage: utils_session_storage,
|
|
701
|
-
sistema: utils_sistema
|
|
720
|
+
sistema: utils_sistema,
|
|
721
|
+
hooks: utils_hooks
|
|
702
722
|
};
|
|
703
723
|
/* export default */ const src_utils = (utils);
|
|
704
724
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navservice/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
4
4
|
"description": "Service core de todos os micro serviços",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"axios": "^1.9.0",
|
|
35
35
|
"hono": "^4.9.7",
|
|
36
|
+
"react": "^19.0.0",
|
|
36
37
|
"zod": "^4",
|
|
37
38
|
"zustand": "^5"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@rslib/core": "^0.18.4",
|
|
41
42
|
"@types/node": "^24.10.1",
|
|
43
|
+
"@types/react": "^19.2.7",
|
|
42
44
|
"typescript": "^5"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|