pytech-ui 1.0.14 → 1.0.15
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/build/contexts/alert/components/Alert/index.js +2 -2
- package/build/contexts/alert/components/Button/index.js +2 -2
- package/build/contexts/alert/context/provider.js +1 -1
- package/build/contexts/app/context.js +3 -3
- package/build/contexts/app/index.d.ts +2 -2
- package/build/contexts/app/index.js +2 -2
- package/build/contexts/app/src/Wrapper/index.js +2 -2
- package/build/contexts/app/types.d.ts +1 -1
- package/build/contexts/router/index.js +1 -1
- package/package.json +3 -2
- package/build/contexts/app/src/components/Head/index.d.ts +0 -3
- package/build/contexts/app/src/components/Head/index.js +0 -3
- package/build/contexts/app/src/components/Head/index.web.d.ts +0 -3
- package/build/contexts/app/src/components/Head/index.web.js +0 -29
- package/build/contexts/app/src/components/Head/types.d.ts +0 -24
- package/build/contexts/app/src/components/Head/types.js +0 -2
- package/build/contexts/app/src/components/Loading.d.ts +0 -4
- package/build/contexts/app/src/components/Loading.js +0 -4
- package/build/contexts/app/src/components/Wrapper/index.d.ts +0 -4
- package/build/contexts/app/src/components/Wrapper/index.js +0 -68
- package/build/contexts/app/src/components/Wrapper/types.d.ts +0 -20
- package/build/contexts/app/src/components/Wrapper/types.js +0 -2
- package/build/contexts/app/src/index.d.ts +0 -10
- package/build/contexts/app/src/index.js +0 -12
- package/build/universal/Host/index.android.d.ts +0 -3
- package/build/universal/Host/index.android.js +0 -7
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
|
-
const app_1 = require("
|
|
9
|
-
const colors_json_1 = __importDefault(require("
|
|
8
|
+
const app_1 = require("../../../app");
|
|
9
|
+
const colors_json_1 = __importDefault(require("../../../../constants/colors.json"));
|
|
10
10
|
const provider_1 = require("../../context/provider");
|
|
11
11
|
const Button_1 = __importDefault(require("../Button"));
|
|
12
12
|
exports.default = (0, react_1.memo)(({ title, message, buttons = [{ text: 'Aceptar', isPreferred: true }] }) => {
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
|
-
const app_1 = require("
|
|
9
|
-
const colors_json_1 = __importDefault(require("
|
|
8
|
+
const app_1 = require("../../../app");
|
|
9
|
+
const colors_json_1 = __importDefault(require("../../../../constants/colors.json"));
|
|
10
10
|
const provider_1 = require("../../context/provider");
|
|
11
11
|
exports.default = (0, react_1.memo)(({ text, onPress, isPreferred, style, }) => {
|
|
12
12
|
const { showAlert } = (0, provider_1.useAlert)();
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useAlert = exports.Provider = void 0;
|
|
5
|
-
const constants_1 = require("
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
6
|
_a = (0, constants_1.createCtx)(), exports.Provider = _a[0], exports.useAlert = _a[1];
|
|
@@ -9,9 +9,9 @@ const react_1 = require("react");
|
|
|
9
9
|
const react_native_1 = require("react-native");
|
|
10
10
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
11
11
|
const expo_router_1 = require("expo-router");
|
|
12
|
-
const constants_1 = require("
|
|
13
|
-
const router_1 = __importDefault(require("
|
|
14
|
-
const pathname_1 = __importDefault(require("
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
const router_1 = __importDefault(require("../router"));
|
|
14
|
+
const pathname_1 = __importDefault(require("../pathname"));
|
|
15
15
|
const Wrapper_1 = __importDefault(require("./src/Wrapper"));
|
|
16
16
|
require("./src/styles.css");
|
|
17
17
|
_a = (0, constants_1.createCtx)(), exports.Provider = _a[0], exports.useApp = _a[1];
|
|
@@ -2,8 +2,8 @@ import Provider from './context';
|
|
|
2
2
|
import Head from './src/Head';
|
|
3
3
|
import Loading from './src/Loading';
|
|
4
4
|
export { useApp } from './context';
|
|
5
|
-
export { useRouter } from '
|
|
6
|
-
export { useAlert } from '
|
|
5
|
+
export { useRouter } from '../router';
|
|
6
|
+
export { useAlert } from '../alert';
|
|
7
7
|
export { WrapperProps as AppProps } from './src/Wrapper';
|
|
8
8
|
export type { AppContext } from './types';
|
|
9
9
|
type Component = typeof Provider & {
|
|
@@ -9,9 +9,9 @@ const Head_1 = __importDefault(require("./src/Head"));
|
|
|
9
9
|
const Loading_1 = __importDefault(require("./src/Loading"));
|
|
10
10
|
var context_2 = require("./context");
|
|
11
11
|
Object.defineProperty(exports, "useApp", { enumerable: true, get: function () { return context_2.useApp; } });
|
|
12
|
-
var router_1 = require("
|
|
12
|
+
var router_1 = require("../router");
|
|
13
13
|
Object.defineProperty(exports, "useRouter", { enumerable: true, get: function () { return router_1.useRouter; } });
|
|
14
|
-
var alert_1 = require("
|
|
14
|
+
var alert_1 = require("../alert");
|
|
15
15
|
Object.defineProperty(exports, "useAlert", { enumerable: true, get: function () { return alert_1.useAlert; } });
|
|
16
16
|
const App = context_1.default;
|
|
17
17
|
App.Head = Head_1.default;
|
|
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
|
-
const universal_1 = require("
|
|
41
|
-
const constants_1 = require("
|
|
40
|
+
const universal_1 = require("../../../../universal");
|
|
41
|
+
const constants_1 = require("../../../../constants");
|
|
42
42
|
const Loading_1 = __importDefault(require("../Loading"));
|
|
43
43
|
exports.default = (0, react_1.memo)(({ children, getSession, onLoadingRealsed }) => {
|
|
44
44
|
const getSlots = (0, react_1.useCallback)(() => {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.useRouter = exports.Provider = void 0;
|
|
5
5
|
const expo_router_1 = require("expo-router");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const constants_1 = require("
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
8
|
const pathname_1 = require("../pathname");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
_a = (0, constants_1.createCtx)(), exports.Provider = _a[0], exports.useRouter = _a[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pytech-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Librería de componentes de UI para Pytech",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"README.md"
|
|
55
55
|
],
|
|
56
56
|
"scripts": {
|
|
57
|
-
"build": "
|
|
57
|
+
"build": "node scripts/build.js",
|
|
58
58
|
"clean": "node -e \"require('fs').rmSync('build',{recursive:true,force:true})\"",
|
|
59
59
|
"typecheck": "tsc --noEmit",
|
|
60
60
|
"prepublishOnly": "npm run build",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"react": "19.2.3",
|
|
76
76
|
"react-dom": "19.2.3",
|
|
77
77
|
"react-native": "0.86.3",
|
|
78
|
+
"tsc-alias": "^1.9.4",
|
|
78
79
|
"typescript": "^5.9.2"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const head_1 = __importDefault(require("expo-router/head"));
|
|
7
|
-
const expo_router_1 = require("expo-router");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_native_1 = require("react-native");
|
|
10
|
-
exports.default = ({ title = 'Application', description, ogDescription, siteUrl, ogImage }) => {
|
|
11
|
-
const pathname = (0, expo_router_1.usePathname)();
|
|
12
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
13
|
-
if (react_native_1.Platform.OS === 'web')
|
|
14
|
-
document.title = title;
|
|
15
|
-
}, [pathname, title]);
|
|
16
|
-
return (<head_1.default>
|
|
17
|
-
<title>{title}</title>
|
|
18
|
-
<meta name="description" content={description}/>
|
|
19
|
-
<meta property="og:type" content="website"/>
|
|
20
|
-
<meta property="og:title" content={title}/>
|
|
21
|
-
<meta property="og:description" content={ogDescription}/>
|
|
22
|
-
<meta property="og:url" content={siteUrl}/>
|
|
23
|
-
<meta property="og:image" content={ogImage}/>
|
|
24
|
-
<meta name="twitter:card" content="summary_large_image"/>
|
|
25
|
-
<meta name="twitter:title" content={title}/>
|
|
26
|
-
<meta name="twitter:description" content={ogDescription}/>
|
|
27
|
-
<meta name="twitter:image" content={ogImage}/>
|
|
28
|
-
</head_1.default>);
|
|
29
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
Title of the page.
|
|
4
|
-
@default 'Application'
|
|
5
|
-
*/
|
|
6
|
-
title?: string;
|
|
7
|
-
/**
|
|
8
|
-
Description of the page.
|
|
9
|
-
*/
|
|
10
|
-
description?: string;
|
|
11
|
-
/**
|
|
12
|
-
Description of the page for the Open Graph protocol.
|
|
13
|
-
*/
|
|
14
|
-
ogDescription?: string;
|
|
15
|
-
/**
|
|
16
|
-
URL of the site.
|
|
17
|
-
*/
|
|
18
|
-
siteUrl?: string;
|
|
19
|
-
/**
|
|
20
|
-
Image of the page for the Open Graph protocol.
|
|
21
|
-
*/
|
|
22
|
-
ogImage?: string;
|
|
23
|
-
};
|
|
24
|
-
export default Props;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ children, getSession, onLoadingRealsed }: Props) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | React.JSX.Element>;
|
|
4
|
-
export default _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const react_1 = __importStar(require("react"));
|
|
40
|
-
const universal_1 = require("@/universal");
|
|
41
|
-
const constants_1 = require("@/constants");
|
|
42
|
-
const Loading_1 = __importDefault(require("../Loading"));
|
|
43
|
-
exports.default = (0, react_1.memo)(({ children, getSession, onLoadingRealsed }) => {
|
|
44
|
-
const getSlots = (0, react_1.useCallback)(() => {
|
|
45
|
-
const slots = {};
|
|
46
|
-
react_1.default.Children.map(children, (child) => {
|
|
47
|
-
if (!react_1.default.isValidElement(child))
|
|
48
|
-
return;
|
|
49
|
-
if (child.type === Loading_1.default)
|
|
50
|
-
slots.loading = child;
|
|
51
|
-
});
|
|
52
|
-
return slots;
|
|
53
|
-
}, [children]);
|
|
54
|
-
const { loading } = getSlots();
|
|
55
|
-
const [isLoading, setIsLoading] = (0, react_1.useState)(getSession ? true : false);
|
|
56
|
-
const hasSessionRef = (0, react_1.useRef)(isLoading);
|
|
57
|
-
(0, react_1.useEffect)(() => {
|
|
58
|
-
if (!isLoading)
|
|
59
|
-
onLoadingRealsed?.({ hasSession: hasSessionRef.current });
|
|
60
|
-
}, [isLoading]);
|
|
61
|
-
(0, constants_1.useAsyncEffect)(async () => {
|
|
62
|
-
hasSessionRef.current = (await getSession?.()) ?? true;
|
|
63
|
-
setIsLoading(false);
|
|
64
|
-
}, []);
|
|
65
|
-
if (isLoading)
|
|
66
|
-
return loading ?? <universal_1.Host />;
|
|
67
|
-
return children;
|
|
68
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
Stack from expo-router.
|
|
4
|
-
*/
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
Function to get the current session.
|
|
8
|
-
This will active the loading page until the session is obtained.
|
|
9
|
-
@default true
|
|
10
|
-
*/
|
|
11
|
-
getSession?: () => Promise<boolean> | boolean;
|
|
12
|
-
/**
|
|
13
|
-
Function to execute when the loading state is changed to false.
|
|
14
|
-
This will be used to redirect to the home page.
|
|
15
|
-
*/
|
|
16
|
-
onLoadingRealsed?: ({ hasSession }: {
|
|
17
|
-
hasSession: boolean;
|
|
18
|
-
}) => Promise<void> | void;
|
|
19
|
-
};
|
|
20
|
-
export default Props;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Wrapper from './components/Wrapper';
|
|
2
|
-
import Head from './components/Head';
|
|
3
|
-
import Loading from './components/Loading';
|
|
4
|
-
export { default as AppProps } from './components/Wrapper/types';
|
|
5
|
-
type Component = typeof Wrapper & {
|
|
6
|
-
Head: typeof Head;
|
|
7
|
-
Loading: typeof Loading;
|
|
8
|
-
};
|
|
9
|
-
declare const App: Component;
|
|
10
|
-
export default App;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const Wrapper_1 = __importDefault(require("./components/Wrapper"));
|
|
7
|
-
const Head_1 = __importDefault(require("./components/Head"));
|
|
8
|
-
const Loading_1 = __importDefault(require("./components/Loading"));
|
|
9
|
-
const App = Wrapper_1.default;
|
|
10
|
-
App.Head = Head_1.default;
|
|
11
|
-
App.Loading = Loading_1.default;
|
|
12
|
-
exports.default = App;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_1 = require("react");
|
|
4
|
-
const jetpack_compose_1 = require("@expo/ui/jetpack-compose");
|
|
5
|
-
exports.default = (0, react_1.memo)(({ children }) => (<jetpack_compose_1.Host style={{ flex: 1 }}>
|
|
6
|
-
{children}
|
|
7
|
-
</jetpack_compose_1.Host>));
|