@controleonline/ui-common 1.2.70
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/.github/agents/developer.agent.md +30 -0
- package/.github/agents/devops.agent.md +30 -0
- package/.github/agents/qa.agent.md +30 -0
- package/.github/agents/security.agent.md +30 -0
- package/.github/workflows/npmjs.yml +35 -0
- package/.github/workflows/pull-request-checks.yml +19 -0
- package/.scrutinizer.yml +24 -0
- package/FUNDING.yml +1 -0
- package/package.json +28 -0
- package/src/api/fetch.js +74 -0
- package/src/api/index.js +155 -0
- package/src/api/localDB.js +131 -0
- package/src/api/queue.js +66 -0
- package/src/react/assets/tap.mp3 +0 -0
- package/src/react/components/AddImportModal.js +157 -0
- package/src/react/components/AddImportModal.styles.js +81 -0
- package/src/react/components/BackgroundRuntimeBridge.js +219 -0
- package/src/react/components/BottomNavigationBar.config.js +238 -0
- package/src/react/components/BottomNavigationBar.js +120 -0
- package/src/react/components/BottomNavigationBar.styles.js +110 -0
- package/src/react/components/CategoryForm.js +572 -0
- package/src/react/components/CategoryForm.styles.js +334 -0
- package/src/react/components/ConfirmModal.js +24 -0
- package/src/react/components/ConfirmModal.styles.js +43 -0
- package/src/react/components/ContextHelpButton.js +69 -0
- package/src/react/components/ContextHelpButton.styles.js +62 -0
- package/src/react/components/DefaultProvider.native.js +848 -0
- package/src/react/components/DefaultProvider.styles.js +21 -0
- package/src/react/components/DefaultProvider.web.js +909 -0
- package/src/react/components/DeliveryPushBridge.native.js +314 -0
- package/src/react/components/DeliveryPushBridge.web.js +5 -0
- package/src/react/components/DeviceAlertSoundService.js +499 -0
- package/src/react/components/EntityLogContent.js +909 -0
- package/src/react/components/EntityLogContent.styles.js +400 -0
- package/src/react/components/EventBus.js +12 -0
- package/src/react/components/KioskModeBridge.js +65 -0
- package/src/react/components/LauncherModeBridge.js +47 -0
- package/src/react/components/LinkedOrderProductsTab.js +388 -0
- package/src/react/components/LinkedOrderProductsTab.styles.js +180 -0
- package/src/react/components/ManagerPushBridge.native.js +345 -0
- package/src/react/components/MessageService.js +314 -0
- package/src/react/components/Paywall/Google.js +89 -0
- package/src/react/components/PrintService.js +778 -0
- package/src/react/components/ProductCatalogCacheService.js +45 -0
- package/src/react/components/RemoteCheckoutService.js +292 -0
- package/src/react/components/RuntimeBottomNavigationBar.js +151 -0
- package/src/react/components/RuntimeInfoFooter.js +214 -0
- package/src/react/components/RuntimeInfoFooter.styles.js +56 -0
- package/src/react/components/SystemErrorToast.js +29 -0
- package/src/react/components/SystemErrorToast.styles.js +38 -0
- package/src/react/components/TouchFeedbackProvider.js +65 -0
- package/src/react/components/UnifiedPaymentBar.js +155 -0
- package/src/react/components/UnifiedPaymentBar.styles.js +174 -0
- package/src/react/components/WebsocketListener.native.js +487 -0
- package/src/react/components/WebsocketListener.web.js +102 -0
- package/src/react/components/inputs/IdInput.js +49 -0
- package/src/react/components/inputs/IdInput.styles.js +26 -0
- package/src/react/components/inputs/InvoiceDueDateFilterInput.js +74 -0
- package/src/react/components/inputs/InvoiceDueDateFilterInput.styles.js +34 -0
- package/src/react/components/inputs/InvoiceDueDateRangeFilterInput.js +115 -0
- package/src/react/components/inputs/InvoiceDueDateRangeFilterInput.styles.js +39 -0
- package/src/react/components/lists/CategoriesList.js +56 -0
- package/src/react/components/lists/PaymentTypeList.js +55 -0
- package/src/react/components/lists/ReceiverList.js +56 -0
- package/src/react/components/lists/SelectList.styles.js +18 -0
- package/src/react/components/lists/StatusList.js +55 -0
- package/src/react/components/lists/WalletList.js +54 -0
- package/src/react/components/radio/Spotify.js +144 -0
- package/src/react/components/radio/Spotify.styles.js +32 -0
- package/src/react/components/radio/YouTube.js +82 -0
- package/src/react/components/radio/YouTube.styles.js +16 -0
- package/src/react/components/toastConfig.js +16 -0
- package/src/react/config/deviceConfigBootstrap.js +571 -0
- package/src/react/index.js +4 -0
- package/src/react/localStorage.js +30 -0
- package/src/react/pages/EntityLogPage.js +124 -0
- package/src/react/pages/EntityLogPage.styles.js +17 -0
- package/src/react/pages/GenericLogPage.js +760 -0
- package/src/react/pages/GenericLogPage.styles.js +401 -0
- package/src/react/pages/Imports.js +361 -0
- package/src/react/pages/Imports.styles.js +223 -0
- package/src/react/pages/SettingsPage/PaymentTypesByWalletTab.js +462 -0
- package/src/react/pages/SettingsPage/index.js +1171 -0
- package/src/react/pages/SettingsPage/index.styles.js +122 -0
- package/src/react/print/jobs.js +147 -0
- package/src/react/print/providers/local.js +53 -0
- package/src/react/print/providers/remote.js +81 -0
- package/src/react/print/selection.js +296 -0
- package/src/react/print/usePrintButtonController.js +474 -0
- package/src/react/router/routes.js +42 -0
- package/src/react/services/NetworkPrinterService.native.js +391 -0
- package/src/react/services/NetworkPrinterService.web.js +15 -0
- package/src/react/stores/index.js +128 -0
- package/src/react/stores/storeErrorBridge.js +36 -0
- package/src/react/utils/backgroundRuntimeRegistration.js +69 -0
- package/src/react/utils/cashPayment.js +87 -0
- package/src/react/utils/commercialDocumentOrders.js +269 -0
- package/src/react/utils/dateRangeFilter.js +264 -0
- package/src/react/utils/deviceRuntime.js +193 -0
- package/src/react/utils/entityDisplay.js +231 -0
- package/src/react/utils/entityLog.js +649 -0
- package/src/react/utils/fileUrl.js +102 -0
- package/src/react/utils/frontendDebugLog.js +45 -0
- package/src/react/utils/googleMapsConfig.js +49 -0
- package/src/react/utils/importStatus.js +100 -0
- package/src/react/utils/invoiceDueDateMessages.js +14 -0
- package/src/react/utils/invoicePresentation.js +46 -0
- package/src/react/utils/logSettings.js +143 -0
- package/src/react/utils/maintenanceSettings.js +53 -0
- package/src/react/utils/managerOrderNotifications.js +523 -0
- package/src/react/utils/mapNavigation.js +76 -0
- package/src/react/utils/menuCatalogConfig.js +8 -0
- package/src/react/utils/menuCatalogDownload.js +157 -0
- package/src/react/utils/networkCameraDevices.js +175 -0
- package/src/react/utils/networkDeviceProfiles.js +135 -0
- package/src/react/utils/normalizedCatalogDownload.js +157 -0
- package/src/react/utils/notificationNavigation.js +94 -0
- package/src/react/utils/notificationSound.js +42 -0
- package/src/react/utils/paymentDevices.js +397 -0
- package/src/react/utils/paymentGatewayExecution.js +91 -0
- package/src/react/utils/paymentOptions.js +88 -0
- package/src/react/utils/peopleDisplay.js +39 -0
- package/src/react/utils/printerDevices.js +465 -0
- package/src/react/utils/remotePayment.js +61 -0
- package/src/react/utils/runtimeFooter.js +475 -0
- package/src/react/utils/runtimeLanguage.js +50 -0
- package/src/react/utils/runtimeMenu.js +224 -0
- package/src/react/utils/screenMetrics.js +30 -0
- package/src/react/utils/shopConfig.js +294 -0
- package/src/react/utils/shopFranchises.js +114 -0
- package/src/react/utils/socketRuntimePipeline.js +454 -0
- package/src/react/utils/spoolAckTracker.js +77 -0
- package/src/react/utils/storeColumns.js +427 -0
- package/src/react/utils/systemErrorChannel.js +109 -0
- package/src/react/utils/systemErrorMessage.js +67 -0
- package/src/react/utils/toastPresentation.js +53 -0
- package/src/react/utils/websocketSharedRuntime.js +826 -0
- package/src/store/acl/getters.js +4 -0
- package/src/store/acl/index.js +19 -0
- package/src/store/acl/mutation_types.js +4 -0
- package/src/store/acl/mutations.js +17 -0
- package/src/store/address/city.js +22 -0
- package/src/store/categories/category_file/index.js +25 -0
- package/src/store/categories/index.js +93 -0
- package/src/store/configs/customActions.js +131 -0
- package/src/store/configs/index.js +25 -0
- package/src/store/connections/customActions.js +26 -0
- package/src/store/connections/index.js +124 -0
- package/src/store/device/index.js +22 -0
- package/src/store/device_config/customActions.js +190 -0
- package/src/store/device_config/index.js +28 -0
- package/src/store/entity_log/customActions.js +63 -0
- package/src/store/entity_log/index.js +25 -0
- package/src/store/extra/data.js +85 -0
- package/src/store/extra/fields.js +88 -0
- package/src/store/file/actions.js +27 -0
- package/src/store/file/index.js +24 -0
- package/src/store/imports/index.js +88 -0
- package/src/store/print/customActions.js +251 -0
- package/src/store/print/index.js +28 -0
- package/src/store/printer/customActions.js +54 -0
- package/src/store/printer/index.js +26 -0
- package/src/store/runtime_debug/customActions.js +71 -0
- package/src/store/runtime_debug/index.js +30 -0
- package/src/store/status/index.js +65 -0
- package/src/store/timezones/index.js +43 -0
- package/src/store/websocket/customActions.js +24 -0
- package/src/store/websocket/index.js +28 -0
- package/src/tests/react/components/LauncherModeBridge.test.js +93 -0
- package/src/tests/react/config/deviceConfigBootstrap.test.js +337 -0
- package/src/tests/react/print/localPrintProvider.test.js +45 -0
- package/src/tests/react/utils/backgroundRuntimeRegistration.test.js +123 -0
- package/src/tests/react/utils/cashPayment.test.js +41 -0
- package/src/tests/react/utils/dateRangeFilter.test.mjs +29 -0
- package/src/tests/react/utils/entityDisplay.test.js +18 -0
- package/src/tests/react/utils/googleMapsConfig.test.js +32 -0
- package/src/tests/react/utils/importStatus.test.js +85 -0
- package/src/tests/react/utils/invoicePresentation.test.mjs +40 -0
- package/src/tests/react/utils/managerOrderNotifications.test.js +127 -0
- package/src/tests/react/utils/mapNavigation.test.js +58 -0
- package/src/tests/react/utils/notificationNavigation.test.js +39 -0
- package/src/tests/react/utils/notificationSound.test.js +27 -0
- package/src/tests/react/utils/paymentDevices.test.js +88 -0
- package/src/tests/react/utils/runtimeFooter.test.js +429 -0
- package/src/tests/react/utils/runtimeLanguage.test.js +80 -0
- package/src/tests/react/utils/runtimeMenu.test.js +174 -0
- package/src/tests/react/utils/shopFranchises.test.js +82 -0
- package/src/tests/react/utils/socketRuntimePipeline.test.js +124 -0
- package/src/tests/react/utils/spoolAckTracker.test.js +40 -0
- package/src/tests/react/utils/storeErrorBridge.test.js +66 -0
- package/src/tests/react/utils/systemErrorChannel.test.js +58 -0
- package/src/tests/react/utils/systemErrorMessage.test.js +59 -0
- package/src/tests/react/utils/toastPresentation.test.js +75 -0
- package/src/tests/react/utils/translate.test.mjs +396 -0
- package/src/tests/react/utils/websocketSharedRuntime.test.js +245 -0
- package/src/utils/apiEntryPoint.js +31 -0
- package/src/utils/appDomain.js +50 -0
- package/src/utils/config.js +14 -0
- package/src/utils/formatter.js +419 -0
- package/src/utils/integrationConfigs.js +79 -0
- package/src/utils/methods.js +23 -0
- package/src/utils/oauth.js +42 -0
- package/src/utils/translate.js +620 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const withAlpha = (hexColor, alphaHex) => {
|
|
4
|
+
const normalized = String(hexColor || '').trim();
|
|
5
|
+
if (!/^#([A-Fa-f0-9]{6})$/.test(normalized)) {
|
|
6
|
+
return hexColor;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return `${normalized}${alphaHex}`;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const createStyles = palette => {
|
|
13
|
+
const accent = palette?.accent;
|
|
14
|
+
|
|
15
|
+
return StyleSheet.create({
|
|
16
|
+
modalSheetRoot: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
justifyContent: 'flex-end',
|
|
19
|
+
backgroundColor: 'transparent',
|
|
20
|
+
},
|
|
21
|
+
modalSheetBackdrop: {
|
|
22
|
+
...StyleSheet.absoluteFillObject,
|
|
23
|
+
backgroundColor: 'rgba(15, 23, 42, 0.46)',
|
|
24
|
+
},
|
|
25
|
+
modalSheetWrap: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
justifyContent: 'flex-end',
|
|
28
|
+
},
|
|
29
|
+
modalCard: {
|
|
30
|
+
width: '100%',
|
|
31
|
+
maxHeight: '86%',
|
|
32
|
+
minHeight: 320,
|
|
33
|
+
borderTopLeftRadius: 24,
|
|
34
|
+
borderTopRightRadius: 24,
|
|
35
|
+
borderWidth: 1,
|
|
36
|
+
borderColor: palette.border,
|
|
37
|
+
backgroundColor: palette.surface,
|
|
38
|
+
paddingHorizontal: 18,
|
|
39
|
+
paddingTop: 16,
|
|
40
|
+
paddingBottom: 14,
|
|
41
|
+
},
|
|
42
|
+
header: {
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
alignItems: 'flex-start',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
gap: 12,
|
|
47
|
+
marginBottom: 14,
|
|
48
|
+
},
|
|
49
|
+
eyebrow: {
|
|
50
|
+
color: accent,
|
|
51
|
+
fontSize: 11,
|
|
52
|
+
fontWeight: '800',
|
|
53
|
+
textTransform: 'uppercase',
|
|
54
|
+
marginBottom: 4,
|
|
55
|
+
},
|
|
56
|
+
title: {
|
|
57
|
+
color: palette.textPrimary,
|
|
58
|
+
fontSize: 24,
|
|
59
|
+
fontWeight: '900',
|
|
60
|
+
},
|
|
61
|
+
subtitle: {
|
|
62
|
+
color: palette.textSecondary,
|
|
63
|
+
fontSize: 13,
|
|
64
|
+
fontWeight: '600',
|
|
65
|
+
marginTop: 4,
|
|
66
|
+
},
|
|
67
|
+
closeButton: {
|
|
68
|
+
width: 34,
|
|
69
|
+
height: 34,
|
|
70
|
+
borderRadius: 17,
|
|
71
|
+
borderWidth: 1,
|
|
72
|
+
borderColor: palette.border,
|
|
73
|
+
backgroundColor: palette.surfaceSoft,
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
},
|
|
77
|
+
scroll: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
},
|
|
80
|
+
scrollContent: {
|
|
81
|
+
gap: 12,
|
|
82
|
+
paddingBottom: 20,
|
|
83
|
+
},
|
|
84
|
+
stateBox: {
|
|
85
|
+
minHeight: 120,
|
|
86
|
+
borderRadius: 14,
|
|
87
|
+
borderWidth: 1,
|
|
88
|
+
borderColor: palette.border,
|
|
89
|
+
backgroundColor: palette.surfaceSoft,
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
gap: 10,
|
|
93
|
+
paddingHorizontal: 16,
|
|
94
|
+
paddingVertical: 18,
|
|
95
|
+
},
|
|
96
|
+
stateTitle: {
|
|
97
|
+
color: palette.textPrimary,
|
|
98
|
+
fontSize: 16,
|
|
99
|
+
fontWeight: '800',
|
|
100
|
+
textAlign: 'center',
|
|
101
|
+
},
|
|
102
|
+
stateText: {
|
|
103
|
+
color: palette.textSecondary,
|
|
104
|
+
fontSize: 13,
|
|
105
|
+
fontWeight: '600',
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
lineHeight: 19,
|
|
108
|
+
},
|
|
109
|
+
branchCard: {
|
|
110
|
+
borderRadius: 16,
|
|
111
|
+
borderWidth: 1,
|
|
112
|
+
borderColor: palette.border,
|
|
113
|
+
backgroundColor: palette.surfaceSoft,
|
|
114
|
+
overflow: 'hidden',
|
|
115
|
+
},
|
|
116
|
+
branchHeader: {
|
|
117
|
+
paddingHorizontal: 14,
|
|
118
|
+
paddingVertical: 12,
|
|
119
|
+
borderBottomWidth: 1,
|
|
120
|
+
borderBottomColor: palette.border,
|
|
121
|
+
backgroundColor: withAlpha(accent, '10'),
|
|
122
|
+
},
|
|
123
|
+
branchHeaderRow: {
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'space-between',
|
|
127
|
+
gap: 10,
|
|
128
|
+
},
|
|
129
|
+
branchTitleWrap: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
},
|
|
132
|
+
branchTitle: {
|
|
133
|
+
color: palette.textPrimary,
|
|
134
|
+
fontSize: 16,
|
|
135
|
+
fontWeight: '800',
|
|
136
|
+
},
|
|
137
|
+
branchMeta: {
|
|
138
|
+
color: palette.textSecondary,
|
|
139
|
+
fontSize: 12,
|
|
140
|
+
fontWeight: '600',
|
|
141
|
+
marginTop: 3,
|
|
142
|
+
},
|
|
143
|
+
branchBody: {
|
|
144
|
+
paddingHorizontal: 12,
|
|
145
|
+
paddingVertical: 12,
|
|
146
|
+
gap: 12,
|
|
147
|
+
},
|
|
148
|
+
entityStateCard: {
|
|
149
|
+
borderRadius: 14,
|
|
150
|
+
borderWidth: 1,
|
|
151
|
+
borderColor: palette.border,
|
|
152
|
+
backgroundColor: '#FFFFFF',
|
|
153
|
+
paddingHorizontal: 14,
|
|
154
|
+
paddingVertical: 14,
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
gap: 10,
|
|
158
|
+
},
|
|
159
|
+
entityStateText: {
|
|
160
|
+
color: palette.textSecondary,
|
|
161
|
+
fontSize: 12,
|
|
162
|
+
fontWeight: '700',
|
|
163
|
+
},
|
|
164
|
+
entitySummaryCard: {
|
|
165
|
+
borderRadius: 14,
|
|
166
|
+
borderWidth: 1,
|
|
167
|
+
borderColor: palette.border,
|
|
168
|
+
backgroundColor: '#FFFFFF',
|
|
169
|
+
paddingHorizontal: 14,
|
|
170
|
+
paddingVertical: 14,
|
|
171
|
+
gap: 12,
|
|
172
|
+
},
|
|
173
|
+
entitySummaryHeader: {
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
justifyContent: 'space-between',
|
|
177
|
+
gap: 8,
|
|
178
|
+
},
|
|
179
|
+
entitySummaryBody: {
|
|
180
|
+
flexDirection: 'row',
|
|
181
|
+
alignItems: 'flex-start',
|
|
182
|
+
gap: 12,
|
|
183
|
+
flexWrap: 'wrap',
|
|
184
|
+
},
|
|
185
|
+
entityPreviewImage: {
|
|
186
|
+
width: 88,
|
|
187
|
+
height: 88,
|
|
188
|
+
borderRadius: 14,
|
|
189
|
+
backgroundColor: palette.surfaceSoft,
|
|
190
|
+
},
|
|
191
|
+
entitySummaryGrid: {
|
|
192
|
+
flex: 1,
|
|
193
|
+
minWidth: 180,
|
|
194
|
+
gap: 8,
|
|
195
|
+
},
|
|
196
|
+
entitySummaryField: {
|
|
197
|
+
borderRadius: 12,
|
|
198
|
+
borderWidth: 1,
|
|
199
|
+
borderColor: palette.border,
|
|
200
|
+
backgroundColor: palette.surfaceSoft,
|
|
201
|
+
paddingHorizontal: 10,
|
|
202
|
+
paddingVertical: 9,
|
|
203
|
+
gap: 4,
|
|
204
|
+
},
|
|
205
|
+
entitySummaryLabel: {
|
|
206
|
+
color: palette.textSecondary,
|
|
207
|
+
fontSize: 10,
|
|
208
|
+
fontWeight: '800',
|
|
209
|
+
textTransform: 'uppercase',
|
|
210
|
+
},
|
|
211
|
+
entitySummaryValue: {
|
|
212
|
+
color: palette.textPrimary,
|
|
213
|
+
fontSize: 13,
|
|
214
|
+
fontWeight: '700',
|
|
215
|
+
lineHeight: 18,
|
|
216
|
+
},
|
|
217
|
+
entityStateErrorText: {
|
|
218
|
+
color: '#DC2626',
|
|
219
|
+
fontSize: 12,
|
|
220
|
+
fontWeight: '700',
|
|
221
|
+
lineHeight: 18,
|
|
222
|
+
},
|
|
223
|
+
relationSection: {
|
|
224
|
+
gap: 8,
|
|
225
|
+
},
|
|
226
|
+
sectionTitle: {
|
|
227
|
+
color: accent,
|
|
228
|
+
fontSize: 12,
|
|
229
|
+
fontWeight: '800',
|
|
230
|
+
textTransform: 'uppercase',
|
|
231
|
+
},
|
|
232
|
+
relationButton: {
|
|
233
|
+
borderRadius: 12,
|
|
234
|
+
borderWidth: 1,
|
|
235
|
+
borderColor: palette.border,
|
|
236
|
+
backgroundColor: '#FFFFFF',
|
|
237
|
+
paddingHorizontal: 12,
|
|
238
|
+
paddingVertical: 11,
|
|
239
|
+
gap: 2,
|
|
240
|
+
},
|
|
241
|
+
relationButtonHeader: {
|
|
242
|
+
flexDirection: 'row',
|
|
243
|
+
alignItems: 'center',
|
|
244
|
+
justifyContent: 'space-between',
|
|
245
|
+
gap: 8,
|
|
246
|
+
},
|
|
247
|
+
relationButtonLabel: {
|
|
248
|
+
color: palette.textPrimary,
|
|
249
|
+
fontSize: 14,
|
|
250
|
+
fontWeight: '700',
|
|
251
|
+
flex: 1,
|
|
252
|
+
},
|
|
253
|
+
relationButtonMeta: {
|
|
254
|
+
color: palette.textSecondary,
|
|
255
|
+
fontSize: 12,
|
|
256
|
+
fontWeight: '600',
|
|
257
|
+
lineHeight: 18,
|
|
258
|
+
},
|
|
259
|
+
relationCollectionWrap: {
|
|
260
|
+
gap: 8,
|
|
261
|
+
},
|
|
262
|
+
nestedWrap: {
|
|
263
|
+
borderLeftWidth: 2,
|
|
264
|
+
borderLeftColor: withAlpha(accent, '33'),
|
|
265
|
+
marginLeft: 8,
|
|
266
|
+
paddingLeft: 12,
|
|
267
|
+
gap: 10,
|
|
268
|
+
},
|
|
269
|
+
logList: {
|
|
270
|
+
gap: 10,
|
|
271
|
+
},
|
|
272
|
+
logCard: {
|
|
273
|
+
borderRadius: 14,
|
|
274
|
+
borderWidth: 1,
|
|
275
|
+
borderColor: palette.border,
|
|
276
|
+
backgroundColor: '#FFFFFF',
|
|
277
|
+
paddingHorizontal: 12,
|
|
278
|
+
paddingVertical: 12,
|
|
279
|
+
gap: 10,
|
|
280
|
+
},
|
|
281
|
+
logMetaRow: {
|
|
282
|
+
flexDirection: 'row',
|
|
283
|
+
alignItems: 'center',
|
|
284
|
+
justifyContent: 'space-between',
|
|
285
|
+
gap: 10,
|
|
286
|
+
flexWrap: 'wrap',
|
|
287
|
+
},
|
|
288
|
+
logMetaLeft: {
|
|
289
|
+
flexDirection: 'row',
|
|
290
|
+
alignItems: 'center',
|
|
291
|
+
gap: 8,
|
|
292
|
+
flexWrap: 'wrap',
|
|
293
|
+
flex: 1,
|
|
294
|
+
},
|
|
295
|
+
actionBadge: {
|
|
296
|
+
flexDirection: 'row',
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
gap: 6,
|
|
299
|
+
borderRadius: 999,
|
|
300
|
+
paddingHorizontal: 10,
|
|
301
|
+
paddingVertical: 5,
|
|
302
|
+
borderWidth: 1,
|
|
303
|
+
},
|
|
304
|
+
actionText: {
|
|
305
|
+
fontSize: 12,
|
|
306
|
+
fontWeight: '800',
|
|
307
|
+
},
|
|
308
|
+
logDate: {
|
|
309
|
+
color: palette.textPrimary,
|
|
310
|
+
fontSize: 12,
|
|
311
|
+
fontWeight: '700',
|
|
312
|
+
},
|
|
313
|
+
logUser: {
|
|
314
|
+
color: palette.textSecondary,
|
|
315
|
+
fontSize: 12,
|
|
316
|
+
fontWeight: '600',
|
|
317
|
+
},
|
|
318
|
+
logChannel: {
|
|
319
|
+
color: palette.textSecondary,
|
|
320
|
+
fontSize: 12,
|
|
321
|
+
fontWeight: '700',
|
|
322
|
+
textTransform: 'uppercase',
|
|
323
|
+
letterSpacing: 0.4,
|
|
324
|
+
},
|
|
325
|
+
genericMessageBox: {
|
|
326
|
+
borderRadius: 12,
|
|
327
|
+
borderWidth: 1,
|
|
328
|
+
borderColor: palette.border,
|
|
329
|
+
backgroundColor: palette.surfaceSoft,
|
|
330
|
+
paddingHorizontal: 12,
|
|
331
|
+
paddingVertical: 10,
|
|
332
|
+
},
|
|
333
|
+
genericMessage: {
|
|
334
|
+
color: palette.textPrimary,
|
|
335
|
+
fontSize: 14,
|
|
336
|
+
fontWeight: '700',
|
|
337
|
+
lineHeight: 20,
|
|
338
|
+
},
|
|
339
|
+
contextSection: {
|
|
340
|
+
gap: 8,
|
|
341
|
+
},
|
|
342
|
+
changeRow: {
|
|
343
|
+
gap: 6,
|
|
344
|
+
},
|
|
345
|
+
changeLabel: {
|
|
346
|
+
color: accent,
|
|
347
|
+
fontSize: 11,
|
|
348
|
+
fontWeight: '800',
|
|
349
|
+
textTransform: 'uppercase',
|
|
350
|
+
},
|
|
351
|
+
changeValuesRow: {
|
|
352
|
+
flexDirection: 'row',
|
|
353
|
+
alignItems: 'center',
|
|
354
|
+
gap: 8,
|
|
355
|
+
},
|
|
356
|
+
changeValueBox: {
|
|
357
|
+
flex: 1,
|
|
358
|
+
borderRadius: 12,
|
|
359
|
+
backgroundColor: palette.surfaceSoft,
|
|
360
|
+
paddingHorizontal: 10,
|
|
361
|
+
paddingVertical: 9,
|
|
362
|
+
borderWidth: 1,
|
|
363
|
+
borderColor: palette.border,
|
|
364
|
+
},
|
|
365
|
+
changeValueTitle: {
|
|
366
|
+
color: palette.textSecondary,
|
|
367
|
+
fontSize: 10,
|
|
368
|
+
fontWeight: '700',
|
|
369
|
+
textTransform: 'uppercase',
|
|
370
|
+
marginBottom: 4,
|
|
371
|
+
},
|
|
372
|
+
changeValueText: {
|
|
373
|
+
color: palette.textPrimary,
|
|
374
|
+
fontSize: 13,
|
|
375
|
+
fontWeight: '600',
|
|
376
|
+
lineHeight: 18,
|
|
377
|
+
},
|
|
378
|
+
arrowWrap: {
|
|
379
|
+
width: 22,
|
|
380
|
+
alignItems: 'center',
|
|
381
|
+
justifyContent: 'center',
|
|
382
|
+
},
|
|
383
|
+
emptyInlineText: {
|
|
384
|
+
color: palette.textSecondary,
|
|
385
|
+
fontSize: 13,
|
|
386
|
+
fontWeight: '600',
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
export const buildEntityLogPalette = theme => ({
|
|
392
|
+
accent: theme?.accentInfo || theme?.primary || '#2563EB',
|
|
393
|
+
border: theme?.border || '#D8E0EA',
|
|
394
|
+
surface: theme?.modalBg || '#FFFFFF',
|
|
395
|
+
surfaceSoft: theme?.cardBgSoft || '#F8FAFC',
|
|
396
|
+
textPrimary: theme?.textPrimary || '#0F172A',
|
|
397
|
+
textSecondary: theme?.textSecondary || '#64748B',
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
export default createStyles;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, {useEffect, useMemo, useRef} from 'react';
|
|
2
|
+
import {AppState, BackHandler, NativeModules, Platform} from 'react-native';
|
|
3
|
+
import {env as APP_ENV} from '@env';
|
|
4
|
+
import {useStore} from '@store';
|
|
5
|
+
import {shouldEnableAndroidKioskMode} from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
|
|
6
|
+
|
|
7
|
+
const kioskModeModule = NativeModules?.KioskMode;
|
|
8
|
+
|
|
9
|
+
const KioskModeBridge = ({appState = AppState.currentState || 'active'}) => {
|
|
10
|
+
const deviceConfigStore = useStore('device_config');
|
|
11
|
+
const {item: runtimeDeviceConfig} = deviceConfigStore.getters;
|
|
12
|
+
const lastRequestedStateRef = useRef(null);
|
|
13
|
+
const lastActiveAppStateRef = useRef(appState);
|
|
14
|
+
const appType = String(APP_ENV.APP_TYPE || '').trim().toUpperCase();
|
|
15
|
+
const kioskEnabled = useMemo(
|
|
16
|
+
() =>
|
|
17
|
+
shouldEnableAndroidKioskMode({
|
|
18
|
+
appType,
|
|
19
|
+
configs: runtimeDeviceConfig?.configs,
|
|
20
|
+
platform: Platform.OS,
|
|
21
|
+
}),
|
|
22
|
+
[appType, runtimeDeviceConfig?.configs],
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const wasActive = lastActiveAppStateRef.current === 'active';
|
|
27
|
+
const requestedStateChanged = lastRequestedStateRef.current !== kioskEnabled;
|
|
28
|
+
|
|
29
|
+
lastActiveAppStateRef.current = appState;
|
|
30
|
+
|
|
31
|
+
if (!kioskModeModule) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (requestedStateChanged) {
|
|
36
|
+
lastRequestedStateRef.current = kioskEnabled;
|
|
37
|
+
kioskModeModule.setKioskMode(kioskEnabled).catch(() => {});
|
|
38
|
+
} else if (kioskEnabled && appState === 'active' && !wasActive) {
|
|
39
|
+
kioskModeModule.setKioskMode(true).catch(() => {});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!kioskEnabled || appState !== 'active') {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}, [appState, kioskEnabled]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!kioskEnabled) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const subscription = BackHandler.addEventListener(
|
|
53
|
+
'hardwareBackPress',
|
|
54
|
+
() => true,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return () => {
|
|
58
|
+
subscription?.remove?.();
|
|
59
|
+
};
|
|
60
|
+
}, [kioskEnabled]);
|
|
61
|
+
|
|
62
|
+
return null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default KioskModeBridge;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, {useEffect, useMemo, useRef} from 'react';
|
|
2
|
+
import {AppState, NativeModules, Platform} from 'react-native';
|
|
3
|
+
import {env as APP_ENV} from '@env';
|
|
4
|
+
import {useStore} from '@store';
|
|
5
|
+
import {shouldEnableAndroidLauncherMode} from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
|
|
6
|
+
|
|
7
|
+
const launcherModeModule = NativeModules?.LauncherMode;
|
|
8
|
+
|
|
9
|
+
const LauncherModeBridge = ({appState = AppState.currentState || 'active'}) => {
|
|
10
|
+
const deviceConfigStore = useStore('device_config');
|
|
11
|
+
const {item: runtimeDeviceConfig} = deviceConfigStore.getters;
|
|
12
|
+
const lastRequestedStateRef = useRef(null);
|
|
13
|
+
const lastActiveAppStateRef = useRef(appState);
|
|
14
|
+
const appType = String(APP_ENV.APP_TYPE || '').trim().toUpperCase();
|
|
15
|
+
const launcherEnabled = useMemo(
|
|
16
|
+
() =>
|
|
17
|
+
shouldEnableAndroidLauncherMode({
|
|
18
|
+
appType,
|
|
19
|
+
configs: runtimeDeviceConfig?.configs,
|
|
20
|
+
platform: Platform.OS,
|
|
21
|
+
}),
|
|
22
|
+
[appType, runtimeDeviceConfig?.configs],
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const wasActive = lastActiveAppStateRef.current === 'active';
|
|
27
|
+
const requestedStateChanged =
|
|
28
|
+
lastRequestedStateRef.current !== launcherEnabled;
|
|
29
|
+
|
|
30
|
+
lastActiveAppStateRef.current = appState;
|
|
31
|
+
|
|
32
|
+
if (!launcherModeModule) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (requestedStateChanged) {
|
|
37
|
+
lastRequestedStateRef.current = launcherEnabled;
|
|
38
|
+
launcherModeModule.setLauncherMode(launcherEnabled).catch(() => {});
|
|
39
|
+
} else if (launcherEnabled && appState === 'active' && !wasActive) {
|
|
40
|
+
launcherModeModule.setLauncherMode(true).catch(() => {});
|
|
41
|
+
}
|
|
42
|
+
}, [appState, launcherEnabled]);
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default LauncherModeBridge;
|