@makroz/mobile 1.2.0 → 1.2.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/auth/authExports.test.d.ts +2 -0
- package/dist/auth/authExports.test.d.ts.map +1 -0
- package/dist/auth/authExports.test.js +40 -0
- package/dist/auth/authExports.test.js.map +1 -0
- package/dist/components/MkInfiniteList.d.ts.map +1 -1
- package/dist/components/MkInfiniteList.js +7 -7
- package/dist/components/MkInfiniteList.js.map +1 -1
- package/dist/components/MkSkeleton.d.ts.map +1 -1
- package/dist/components/MkSkeleton.js +10 -7
- package/dist/components/MkSkeleton.js.map +1 -1
- package/dist/components/MkToastRenderer.d.ts.map +1 -1
- package/dist/components/MkToastRenderer.js +9 -7
- package/dist/components/MkToastRenderer.js.map +1 -1
- package/dist/context/MkAuthContext.d.ts +15 -0
- package/dist/context/MkAuthContext.d.ts.map +1 -1
- package/dist/context/MkAuthContext.js +10 -0
- package/dist/context/MkAuthContext.js.map +1 -1
- package/dist/hooks/useApi.d.ts +8 -8
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useApi.js +53 -39
- package/dist/hooks/useApi.js.map +1 -1
- package/dist/hooks/useApi.test.js +76 -3
- package/dist/hooks/useApi.test.js.map +1 -1
- package/dist/hooks/useMkForm.d.ts.map +1 -1
- package/dist/hooks/useMkForm.js +19 -16
- package/dist/hooks/useMkForm.js.map +1 -1
- package/dist/hooks/useMkForm.test.d.ts +2 -0
- package/dist/hooks/useMkForm.test.d.ts.map +1 -0
- package/dist/hooks/useMkForm.test.js +99 -0
- package/dist/hooks/useMkForm.test.js.map +1 -0
- package/dist/hooks/useMkInfiniteList.d.ts +2 -2
- package/dist/hooks/useMkInfiniteList.d.ts.map +1 -1
- package/dist/hooks/useMkInfiniteList.js +20 -4
- package/dist/hooks/useMkInfiniteList.js.map +1 -1
- package/dist/hooks/useMkInfiniteList.test.d.ts +2 -0
- package/dist/hooks/useMkInfiniteList.test.d.ts.map +1 -0
- package/dist/hooks/useMkInfiniteList.test.js +82 -0
- package/dist/hooks/useMkInfiniteList.test.js.map +1 -0
- package/dist/hooks/useMkList.d.ts +28 -10
- package/dist/hooks/useMkList.d.ts.map +1 -1
- package/dist/hooks/useMkList.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/test-setup.d.ts.map +1 -1
- package/dist/test-setup.js +10 -5
- package/dist/test-setup.js.map +1 -1
- package/dist/theme/MkThemeProvider.d.ts.map +1 -1
- package/dist/theme/MkThemeProvider.js +3 -6
- package/dist/theme/MkThemeProvider.js.map +1 -1
- package/dist/theme/MkThemeProvider.test.d.ts +2 -0
- package/dist/theme/MkThemeProvider.test.d.ts.map +1 -0
- package/dist/theme/MkThemeProvider.test.js +34 -0
- package/dist/theme/MkThemeProvider.test.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { rnMocks } from '../test-utils';
|
|
3
|
+
rnMocks();
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
import { renderHook, act } from '@testing-library/react';
|
|
6
|
+
import { MkThemeProvider, useMkTheme } from './MkThemeProvider';
|
|
7
|
+
describe('MkThemeProvider referential stability', () => {
|
|
8
|
+
it('should keep the context value reference stable across renders', () => {
|
|
9
|
+
const wrapper = ({ children }) => (_jsx(MkThemeProvider, { children: children }));
|
|
10
|
+
const { result, rerender } = renderHook(() => useMkTheme(), { wrapper });
|
|
11
|
+
const firstValue = result.current;
|
|
12
|
+
rerender(() => useMkTheme());
|
|
13
|
+
const secondValue = result.current;
|
|
14
|
+
expect(firstValue).toBe(secondValue);
|
|
15
|
+
});
|
|
16
|
+
it('should update the context value reference when isDark changes', () => {
|
|
17
|
+
const wrapper = ({ children }) => (_jsx(MkThemeProvider, { children: children }));
|
|
18
|
+
const { result } = renderHook(() => useMkTheme(), { wrapper });
|
|
19
|
+
const firstValue = result.current;
|
|
20
|
+
act(() => {
|
|
21
|
+
result.current.toggleTheme();
|
|
22
|
+
});
|
|
23
|
+
expect(result.current).not.toBe(firstValue);
|
|
24
|
+
expect(result.current.isDark).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('should keep toggleTheme reference stable across renders', () => {
|
|
27
|
+
const wrapper = ({ children }) => (_jsx(MkThemeProvider, { children: children }));
|
|
28
|
+
const { result, rerender } = renderHook(() => useMkTheme(), { wrapper });
|
|
29
|
+
const firstToggle = result.current.toggleTheme;
|
|
30
|
+
rerender(() => useMkTheme());
|
|
31
|
+
expect(result.current.toggleTheme).toBe(firstToggle);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=MkThemeProvider.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MkThemeProvider.test.js","sourceRoot":"","sources":["../../src/theme/MkThemeProvider.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC;AAEV,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CAC7D,KAAC,eAAe,cAAE,QAAQ,GAAmB,CAChD,CAAC;QAEF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,EAA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AAM,CAAC,OAAO,CAAC,WAAW,CAAC;QAE/C,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QAE7B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makroz/mobile",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "React Native UI components and hooks for MK-Director mobile applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@react-native-async-storage/async-storage": "^3.0.2",
|
|
30
30
|
"@shopify/flash-list": "^2.0.0",
|
|
31
31
|
"react-native-svg": "^15.15.4",
|
|
32
|
-
"@makroz/core": "1.1.
|
|
32
|
+
"@makroz/core": "1.1.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@shopify/flash-list": ">=2.0.0",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"react-native": "0.85.x"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@testing-library/react": "^16.3.2",
|
|
47
48
|
"@testing-library/react-native": "^12.0.0",
|
|
48
49
|
"@types/react": "^19.0.0",
|
|
49
50
|
"@types/react-native": "^0.73.0",
|