@dashadmin/dash-utils 1.0.0 → 1.3.16

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/package.json CHANGED
@@ -1,31 +1,50 @@
1
1
  {
2
2
  "name": "@dashadmin/dash-utils",
3
- "version": "1.0.0",
4
- "description": "dash-utils — DASH framework package",
3
+ "version": "1.3.16",
4
+ "private": false,
5
5
  "license": "MIT",
6
- "author": "Francisco Aranda <farandal@gmail.com>",
7
- "type": "module",
8
- "main": "index.js",
9
- "module": "index.js",
10
- "types": "index.d.ts",
11
- "exports": {
12
- ".": {
13
- "types": "./index.d.ts",
14
- "import": "./index.js"
15
- }
6
+ "main": "src/index.ts",
7
+ "devDependencies": {
8
+ "@commitlint/cli": "latest",
9
+ "@commitlint/config-conventional": "latest",
10
+ "@types/jest": "latest",
11
+ "@types/node": "latest",
12
+ "@types/react": "latest",
13
+ "@types/react-dom": "latest",
14
+ "@typescript-eslint/eslint-plugin": "latest",
15
+ "@typescript-eslint/parser": "latest",
16
+ "eslint-config-airbnb-typescript": "latest",
17
+ "eslint-config-prettier": "latest",
18
+ "eslint-plugin-html": "latest",
19
+ "eslint-plugin-import": "latest",
20
+ "eslint-plugin-jsdoc": "latest",
21
+ "eslint-plugin-json": "latest",
22
+ "eslint-plugin-prettier": "latest",
23
+ "ts-jest": "latest",
24
+ "ts-loader": "latest",
25
+ "tsconfig-paths": "latest",
26
+ "typescript": "latest",
27
+ "vite": "^5.2.0",
28
+ "rollup": "^4.0.0"
16
29
  },
17
- "files": [
18
- "**/*"
19
- ],
20
- "sideEffects": false,
21
30
  "dependencies": {
22
31
  "@mui/material": "^7.3.10",
23
- "@dashadmin/dash-constants": "^1.0.0"
32
+ "@dashadmin/dash-constants": "workspace:*"
24
33
  },
25
34
  "publishConfig": {
26
- "access": "public"
35
+ "name": "@dashadmin/dash-utils",
36
+ "access": "public",
37
+ "main": "dist/index.js",
38
+ "exports": {
39
+ ".": {
40
+ "import": "./dist/index.js"
41
+ }
42
+ }
27
43
  },
28
- "engines": {
29
- "node": ">=18"
30
- }
44
+ "scripts": {
45
+ "build": "vite build"
46
+ },
47
+ "files": [
48
+ "dist"
49
+ ]
31
50
  }
package/src/index.ts ADDED
@@ -0,0 +1,199 @@
1
+ // Hooks
2
+ export { useWindowSize } from './hooks/useWindowSize';
3
+ export { useCapacitorAppStateRefresh } from './hooks/useCapacitorAppStateRefresh';
4
+ export { useDeviceStorageSync } from './hooks/useDeviceStorageSync';
5
+ export {
6
+ useCapacitorKeyboard,
7
+ isCapacitorKeyboardAvailable,
8
+ getCapacitorKeyboard,
9
+ type KeyboardState,
10
+ type UseCapacitorKeyboardOptions
11
+ } from './hooks/useCapacitorKeyboard';
12
+ export {
13
+ useMobileDetection,
14
+ checkMobileDevice,
15
+ isWebView,
16
+ isAndroid,
17
+ isIOS,
18
+ isWindows,
19
+ isMacOS,
20
+ isLinux,
21
+ type MobileDetectionState,
22
+ type UseMobileDetectionOptions
23
+ } from './hooks/useMobileDetection';
24
+ export {
25
+ useDraggable,
26
+ type DraggablePosition,
27
+ type UseDraggableOptions,
28
+ type UseDraggableReturn
29
+ } from './hooks/useDraggable';
30
+ export {
31
+ useNotifications,
32
+ type ProcessedNotification,
33
+ type ToastNotification,
34
+ type DialogNotification,
35
+ type UseNotificationsOptions,
36
+ type UseNotificationsReturn
37
+ } from './hooks/useNotifications';
38
+ export {
39
+ useQuickSearch,
40
+ type UseQuickSearchReturn
41
+ } from './hooks/useQuickSearch';
42
+ export {
43
+ useMenuStateInit,
44
+ getInitialMenuState,
45
+ getInitialNavSize,
46
+ type UseMenuStateInitOptions
47
+ } from './hooks/useMenuStateInit';
48
+
49
+ // Utils
50
+ export { updateDomCssVariables } from './utils/updateDomCssVariables';
51
+ export { getEnv } from './utils/envUtils';
52
+ export { dashStorage } from './utils/dashDtorage';
53
+ export {
54
+ EMAIL_REGEX,
55
+ PHONE_REGEX,
56
+ URL_REGEX,
57
+ validateEmail,
58
+ validatePhone,
59
+ validateUrl,
60
+ validateRequired,
61
+ validateMinLength,
62
+ validateMaxLength,
63
+ validateRut,
64
+ checkPasswordStrength,
65
+ type PasswordStrength
66
+ } from './utils/validation';
67
+
68
+ // IPC Service for Electron
69
+ export {
70
+ isDashIPCServiceAvailable,
71
+ isElectron,
72
+ getDashIPCService,
73
+ windowControl,
74
+ startWindowDrag,
75
+ executeIPCAction,
76
+ onIPCStdout,
77
+ useDashIPCService,
78
+ type DashIPCServiceType
79
+ } from './utils/dashIPCService';
80
+
81
+ // Stored Theme
82
+ export {
83
+ getStoredTheme,
84
+ setStoredTheme,
85
+ initializeStoredTheme,
86
+ clearStoredTheme
87
+ } from './utils/storedTheme';
88
+
89
+ // Development Environment Detection
90
+ export {
91
+ isDev,
92
+ isProd,
93
+ isTest,
94
+ getEnvironment
95
+ } from './utils/isDev';
96
+
97
+ // Environment Body Classes
98
+ export {
99
+ setupEnvironmentBodyClasses,
100
+ useEnvironmentBodyClasses,
101
+ type EnvironmentVars
102
+ } from './utils/environmentBodyClasses';
103
+
104
+ // Platform Detection
105
+ export {
106
+ isWebView as isWebViewPlatform,
107
+ isAndroid as isAndroidPlatform,
108
+ isIOS as isIOSPlatform,
109
+ isWindows as isWindowsPlatform,
110
+ applyPlatformBodyClasses
111
+ } from './utils/platformDetection';
112
+
113
+ // Electron Store Sync
114
+ export {
115
+ syncElectronStore,
116
+ hasElectronStore
117
+ } from './utils/electronStoreSync';
118
+
119
+ // Notification Permission
120
+ export {
121
+ requestNotificationPermission,
122
+ isNotificationSupported,
123
+ hasNotificationPermission,
124
+ isNotificationDenied,
125
+ getNotificationPermission
126
+ } from './utils/notificationPermission';
127
+
128
+ // Dash Bootstrap App
129
+ export {
130
+ dashInitializeApp,
131
+ dashBootstrapApp,
132
+ type DashInitializeAppConfig
133
+ } from './utils/dashBootstrapApp';
134
+
135
+ // Resource Loader
136
+ export {
137
+ createResourceLoader,
138
+ createSimpleResourceLoader
139
+ } from './utils/resourceLoader';
140
+
141
+ // Auth Provider Utils
142
+ export {
143
+ createLogoutFromStorage,
144
+ isUserAuthenticated,
145
+ getCurrentUser,
146
+ getAuthToken,
147
+ getTenantId,
148
+ getUserRoles,
149
+ setAuthData,
150
+ type LogoutConfig
151
+ } from './utils/authProviderUtils';
152
+
153
+ // Data Provider Utils
154
+ export {
155
+ getResourceConfigManager,
156
+ setResourceConfigs,
157
+ getResourceConfig,
158
+ processPostData,
159
+ processFormData,
160
+ buildQueryString,
161
+ isFormDataResource,
162
+ type IResourceConfig
163
+ } from './utils/dataProviderUtils';
164
+
165
+ // Components
166
+ export {
167
+ MinimalLayout,
168
+ type MinimalLayoutProps
169
+ } from './components/MinimalLayout';
170
+
171
+ export {
172
+ DashRouterComponent,
173
+ RouterComponent, // Backward compatibility alias
174
+ shouldUseHashRouter,
175
+ createRouterComponent,
176
+ type DashRouterComponentProps,
177
+ type RouterComponentProps // Backward compatibility alias
178
+ } from './components/RouterComponent';
179
+
180
+ // IPC Message Broker Context (Electron)
181
+ export {
182
+ IPCMessageBrokerContext,
183
+ IPCMessageBrokerProvider,
184
+ useIPCMessageBroker,
185
+ type LogMessage,
186
+ type SubprocessOutput,
187
+ type IPCMessageBrokerContextType,
188
+ type IPCMessageBrokerConfig
189
+ } from './contexts/IPCMessageBrokerContext';
190
+
191
+ // Lazy App Loader
192
+ export {
193
+ createLazyAppComponent,
194
+ createSimpleLazyApp,
195
+ DefaultLoadFailedComponent,
196
+ type LazyAppLoaderConfig
197
+ } from './components/LazyAppLoader';
198
+
199
+ export { priceFormatter } from "./utils/priceFormatter";
package/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- // Auto-generated permissive types for @dashadmin/dash-utils.
2
- // Full typings can be regenerated with a tolerant tsc emit.
3
- export {};
File without changes