@sincpro/mobile 0.1.0 → 0.2.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 +29 -12
- package/dist/adapters/repositories/domain_event.repository.js +2 -1
- package/dist/adapters/repositories/domain_event_dead_letter.repository.js +2 -1
- package/dist/adapters/repositories/setting.repository.js +4 -3
- package/dist/domain/settings.d.ts +1 -1
- package/dist/domain/settings.js +4 -1
- package/dist/entrypoints/db/migrations.d.ts +1 -1
- package/dist/entrypoints/db/migrations.js +26 -18
- package/dist/entrypoints/queue/printImage.subscriber.js +3 -3
- package/dist/entrypoints/ui/AppShell.d.ts +7 -0
- package/dist/entrypoints/ui/AppShell.js +25 -9
- package/dist/entrypoints/ui/common_provider.d.ts +6 -1
- package/dist/entrypoints/ui/common_provider.js +45 -1
- package/dist/entrypoints/ui/domain_switcher.js +5 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/infrastructure/logger.d.ts +2 -2
- package/dist/infrastructure/logger.js +51 -33
- package/dist/infrastructure/ui/ToastHost.d.ts +6 -1
- package/dist/infrastructure/ui/ToastHost.js +18 -9
- package/dist/services/printer.service.d.ts +6 -0
- package/dist/services/printer.service.js +40 -6
- package/dist/ui/components/atoms/DebugBanner.js +4 -8
- package/dist/ui/components/atoms/PrinterIcon.d.ts +4 -0
- package/dist/ui/components/atoms/PrinterIcon.js +4 -0
- package/dist/ui/components/atoms/index.d.ts +1 -0
- package/dist/ui/components/atoms/index.js +1 -0
- package/dist/ui/components/molecules/BluetoothDeviceSelectorModal.js +16 -10
- package/dist/ui/components/molecules/DeadLetterErrorBlock.js +3 -2
- package/dist/ui/components/molecules/EventTimelineItem.js +31 -33
- package/dist/ui/components/molecules/GeoPermissionCard.d.ts +8 -0
- package/dist/ui/components/molecules/GeoPermissionCard.js +21 -0
- package/dist/ui/components/molecules/ProcessToast.d.ts +7 -4
- package/dist/ui/components/molecules/ProcessToast.js +45 -44
- package/dist/ui/components/molecules/ProcessToastProvider.js +1 -1
- package/dist/ui/components/molecules/TimeZoneSelector.d.ts +7 -0
- package/dist/ui/components/molecules/TimeZoneSelector.js +19 -0
- package/dist/ui/components/molecules/TimeZoneSelectorModal.d.ts +9 -0
- package/dist/ui/components/molecules/TimeZoneSelectorModal.js +61 -0
- package/dist/ui/components/molecules/index.d.ts +4 -0
- package/dist/ui/components/molecules/index.js +3 -0
- package/dist/ui/components/molecules/timezone.d.ts +4 -0
- package/dist/ui/components/molecules/timezone.js +1 -0
- package/dist/ui/components/organisms/BluetoothPrinterSelector.d.ts +3 -1
- package/dist/ui/components/organisms/BluetoothPrinterSelector.js +29 -9
- package/dist/ui/components/organisms/DatabaseInfoRow.js +1 -1
- package/dist/ui/components/organisms/DeadLetterQueueRow.js +3 -3
- package/dist/ui/components/organisms/EventRow.js +15 -15
- package/dist/ui/components/organisms/InjectableWebView.js +20 -10
- package/dist/ui/components/organisms/TableInfoInfoRow.js +1 -1
- package/dist/ui/screens/database/database.json_detail.js +3 -2
- package/dist/ui/screens/database/database.list.js +4 -4
- package/dist/ui/screens/database/database.table_rows.js +1 -1
- package/dist/ui/screens/dead_letter_queue/dead_letter_queue.list.js +4 -4
- package/dist/ui/screens/events/events.list.js +4 -4
- package/package.json +9 -5
- package/dist/ui/layouts/router_layouts.d.ts +0 -17
- package/dist/ui/layouts/router_layouts.js +0 -20
|
@@ -5,6 +5,6 @@ import { ListViewV2 } from "@sincpro/mobile-ui/views/ListViewV2";
|
|
|
5
5
|
import { useDatabase } from "./database.context";
|
|
6
6
|
function TableRowsView() {
|
|
7
7
|
const { isLoading, filteredData, selectedTable, goBackFromRows, selectRowJson, setSearchQuery, } = useDatabase();
|
|
8
|
-
return (_jsxs(ListViewV2.Root, { isLoading: isLoading, items: filteredData, name: `Datos - ${selectedTable}`, onBack: goBackFromRows, onPressItem: (item) => selectRowJson(safeJsonStringify(item), item.index), onSearch: setSearchQuery, children: [_jsx(ListViewV2.Header, { variant: "
|
|
8
|
+
return (_jsxs(ListViewV2.Root, { isLoading: isLoading, items: filteredData, name: `Datos - ${selectedTable}`, onBack: goBackFromRows, onPressItem: (item) => selectRowJson(safeJsonStringify(item), item.index), onSearch: setSearchQuery, children: [_jsx(ListViewV2.Header, { variant: "default", children: _jsx(ListViewV2.Header.Search, {}) }), _jsx(ListViewV2.Content, { children: (item) => (_jsx(TableInfoRow, { item: { data: safeJsonStringify(item) }, onPress: () => selectRowJson(safeJsonStringify(item), item.index) })) })] }));
|
|
9
9
|
}
|
|
10
10
|
export default TableRowsView;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import { useNavigation } from "@react-navigation/native";
|
|
2
3
|
import DeadLetterQueueRow from "../../../ui/components/organisms/DeadLetterQueueRow";
|
|
3
4
|
import { ListViewV2 } from "@sincpro/mobile-ui/views/ListViewV2";
|
|
4
5
|
import { useEffect } from "react";
|
|
5
|
-
import { useNavigate } from "react-router-native";
|
|
6
6
|
import { DeadLetterQueueProvider, useDeadLetterQueue } from "./dead_letter_queue.context";
|
|
7
7
|
function DeadLetterQueueScreenComponent() {
|
|
8
|
-
const
|
|
8
|
+
const navigation = useNavigation();
|
|
9
9
|
const { enrichedEvents, isLoading, loadEvents, retryEvent } = useDeadLetterQueue();
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
loadEvents();
|
|
12
12
|
}, [loadEvents]);
|
|
13
|
-
const onBack = () =>
|
|
14
|
-
return (_jsxs(ListViewV2.Root, { description: "Eventos que no pudieron ser procesados", isLoading: isLoading, items: enrichedEvents, name: "Eventos fallidos", onBack: onBack, onRefresh: loadEvents, children: [_jsx(ListViewV2.Header, { variant: "
|
|
13
|
+
const onBack = () => navigation.goBack();
|
|
14
|
+
return (_jsxs(ListViewV2.Root, { description: "Eventos que no pudieron ser procesados", isLoading: isLoading, items: enrichedEvents, name: "Eventos fallidos", onBack: onBack, onRefresh: loadEvents, children: [_jsx(ListViewV2.Header, { variant: "default" }), _jsx(ListViewV2.Content, { children: (event) => (_jsx(DeadLetterQueueRow, { item: event, onRetry: async (evt) => {
|
|
15
15
|
await retryEvent(evt);
|
|
16
16
|
setTimeout(() => {
|
|
17
17
|
void loadEvents();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import { useNavigation } from "@react-navigation/native";
|
|
2
3
|
import EventRow from "../../../ui/components/organisms/EventRow";
|
|
3
4
|
import { ListViewV2 } from "@sincpro/mobile-ui/views/ListViewV2";
|
|
4
5
|
import { useEffect } from "react";
|
|
5
|
-
import { useNavigate } from "react-router-native";
|
|
6
6
|
import { EventsProvider, useEvents } from "./events.context";
|
|
7
7
|
const FILTER_OPTIONS = [
|
|
8
8
|
{ label: "Todos", value: "ALL" },
|
|
@@ -11,13 +11,13 @@ const FILTER_OPTIONS = [
|
|
|
11
11
|
{ label: "Pendientes", value: "PENDING" },
|
|
12
12
|
];
|
|
13
13
|
function EventsScreenComponent() {
|
|
14
|
-
const
|
|
14
|
+
const navigation = useNavigation();
|
|
15
15
|
const { pagedEvents, isLoading, loadEvents, retryEvent, filter, setFilter } = useEvents();
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
void loadEvents();
|
|
18
18
|
}, [loadEvents]);
|
|
19
|
-
const onBack = () =>
|
|
20
|
-
return (_jsxs(ListViewV2.Root, { description: "Eventos registrados", isLoading: isLoading, items: pagedEvents, name: "Eventos", onBack: onBack, onRefresh: loadEvents, children: [_jsx(ListViewV2.Header, { variant: "
|
|
19
|
+
const onBack = () => navigation.goBack();
|
|
20
|
+
return (_jsxs(ListViewV2.Root, { description: "Eventos registrados", isLoading: isLoading, items: pagedEvents, name: "Eventos", onBack: onBack, onRefresh: loadEvents, children: [_jsx(ListViewV2.Header, { variant: "default", children: _jsx(ListViewV2.Header.Filters, { children: _jsx(ListViewV2.Header.Filters.Chips, { children: FILTER_OPTIONS.map((option) => (_jsx(ListViewV2.Header.Filters.Chip, { active: filter === option.value, label: option.label, onPress: () => setFilter(option.value) }, option.value))) }) }) }), _jsx(ListViewV2.Content, { children: (event) => (_jsx(EventRow, { item: event, onRetry: async (evt) => {
|
|
21
21
|
await retryEvent(evt);
|
|
22
22
|
} })) })] }));
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/mobile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Sincpro Mobile framework core: offline-first infra (DB, queue/events, cron), DDD patterns, adapters, AppShell and module-driven composition for React Native",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -58,8 +58,10 @@
|
|
|
58
58
|
"react-native-toast-message": "*",
|
|
59
59
|
"react-native-view-shot": "*",
|
|
60
60
|
"react-native-webview": "*",
|
|
61
|
-
"react-
|
|
62
|
-
"@
|
|
61
|
+
"@react-navigation/native": ">=7",
|
|
62
|
+
"@react-navigation/native-stack": ">=7",
|
|
63
|
+
"react-native-screens": "*",
|
|
64
|
+
"@sincpro/mobile-ui": "^0.7.0"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
67
|
"@types/big.js": "^6.2.2",
|
|
@@ -96,10 +98,12 @@
|
|
|
96
98
|
"react-native-toast-message": "^2.3.3",
|
|
97
99
|
"react-native-view-shot": "^4.0.3",
|
|
98
100
|
"react-native-webview": "13.15.0",
|
|
99
|
-
"react-
|
|
101
|
+
"@react-navigation/native": "^7.0.0",
|
|
102
|
+
"@react-navigation/native-stack": "^7.0.0",
|
|
103
|
+
"react-native-screens": "~4.25.2",
|
|
100
104
|
"tsc-alias": "^1.8.17",
|
|
101
105
|
"typescript": "~5.9.2",
|
|
102
|
-
"@sincpro/mobile-ui": "^0.
|
|
106
|
+
"@sincpro/mobile-ui": "^0.7.0"
|
|
103
107
|
},
|
|
104
108
|
"exports": {
|
|
105
109
|
".": "./dist/index.js",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import UITabNavigatorLayout from "@sincpro/mobile-ui/layouts/TabNavigatorLayout";
|
|
2
|
-
import type { ComponentProps, ReactElement } from "react";
|
|
3
|
-
type UITabProps = ComponentProps<typeof UITabNavigatorLayout>;
|
|
4
|
-
/**
|
|
5
|
-
* Layouts conectados a react-router. El design system (@sincpro/mobile-ui) trae
|
|
6
|
-
* las versiones presentacionales (sin router); aquí el core —que sí posee el
|
|
7
|
-
* router— les inyecta location/navigate/Outlet para usarse como layout routes.
|
|
8
|
-
*/
|
|
9
|
-
declare function TabNavigatorLayout(props: Omit<UITabProps, "content" | "currentPath" | "onTabPress">): ReactElement;
|
|
10
|
-
declare namespace TabNavigatorLayout {
|
|
11
|
-
var Tabs: ({ children: tabsChildren }: {
|
|
12
|
-
children?: import("react").ReactNode;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
var Tab: (_props: import("@sincpro/mobile-ui/layouts/TabNavigatorLayout").TabProps) => null;
|
|
15
|
-
}
|
|
16
|
-
declare function PlainLayout(): ReactElement;
|
|
17
|
-
export { PlainLayout, TabNavigatorLayout };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import UIPlainLayout from "@sincpro/mobile-ui/layouts/PlainLayout";
|
|
3
|
-
import UITabNavigatorLayout from "@sincpro/mobile-ui/layouts/TabNavigatorLayout";
|
|
4
|
-
import { Outlet, useLocation, useNavigate } from "react-router-native";
|
|
5
|
-
/**
|
|
6
|
-
* Layouts conectados a react-router. El design system (@sincpro/mobile-ui) trae
|
|
7
|
-
* las versiones presentacionales (sin router); aquí el core —que sí posee el
|
|
8
|
-
* router— les inyecta location/navigate/Outlet para usarse como layout routes.
|
|
9
|
-
*/
|
|
10
|
-
function TabNavigatorLayout(props) {
|
|
11
|
-
const location = useLocation();
|
|
12
|
-
const navigate = useNavigate();
|
|
13
|
-
return (_jsx(UITabNavigatorLayout, { ...props, content: _jsx(Outlet, {}), currentPath: location.pathname, onTabPress: (path) => navigate(path) }));
|
|
14
|
-
}
|
|
15
|
-
TabNavigatorLayout.Tabs = UITabNavigatorLayout.Tabs;
|
|
16
|
-
TabNavigatorLayout.Tab = UITabNavigatorLayout.Tab;
|
|
17
|
-
function PlainLayout() {
|
|
18
|
-
return (_jsx(UIPlainLayout, { children: _jsx(Outlet, {}) }));
|
|
19
|
-
}
|
|
20
|
-
export { PlainLayout, TabNavigatorLayout };
|