@putkoff/abstract-utilities 0.1.243 → 0.1.244

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.
Files changed (95) hide show
  1. package/dist/cjs/index.js +511 -11
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +514 -13
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/functions/auth_utils/imports.js +1 -0
  6. package/dist/functions/auth_utils/index.js +1 -0
  7. package/dist/functions/auth_utils/src/index.js +1 -0
  8. package/dist/functions/auth_utils/src/token_utils.js +104 -0
  9. package/dist/functions/config_utils/imports.js +2 -0
  10. package/dist/functions/config_utils/index.js +1 -0
  11. package/dist/functions/config_utils/src/config_utils.js +16 -0
  12. package/dist/functions/config_utils/src/index.js +1 -0
  13. package/dist/functions/constants_utils/index.js +1 -0
  14. package/dist/functions/constants_utils/src/constants.js +7 -0
  15. package/dist/functions/constants_utils/src/index.js +1 -0
  16. package/dist/functions/env_utils/imports.js +1 -0
  17. package/dist/functions/env_utils/index.js +1 -0
  18. package/dist/functions/env_utils/src/index.js +1 -0
  19. package/dist/functions/env_utils/src/window_utils.js +47 -0
  20. package/dist/functions/fetch_utils/imports.js +2 -0
  21. package/dist/functions/fetch_utils/index.js +1 -0
  22. package/dist/functions/fetch_utils/src/fetch_utils.js +65 -0
  23. package/dist/functions/fetch_utils/src/index.js +3 -0
  24. package/dist/functions/fetch_utils/src/url_utils.js +83 -0
  25. package/dist/functions/fetch_utils/src/utils.js +101 -0
  26. package/dist/functions/index.js +17 -0
  27. package/dist/functions/math_utils/index.js +1 -0
  28. package/dist/functions/math_utils/safe_math.js +26 -0
  29. package/dist/functions/path_utils/imports.js +28 -0
  30. package/dist/functions/path_utils/index.js +1 -0
  31. package/dist/functions/path_utils/src/base_dirs.js +17 -0
  32. package/dist/functions/path_utils/src/function_dirs.js +42 -0
  33. package/dist/functions/path_utils/src/index.js +6 -0
  34. package/dist/functions/path_utils/src/misc_dirs.js +15 -0
  35. package/dist/functions/path_utils/src/path_utils.browser.js +3 -0
  36. package/dist/functions/path_utils/src/path_utils.js +112 -0
  37. package/dist/functions/path_utils/src/path_utils.node.js +3 -0
  38. package/dist/functions/path_utils/src/paths.js +12 -0
  39. package/dist/functions/path_utils/src/src_dirs.js +25 -0
  40. package/dist/functions/read_utils/imports.js +1 -0
  41. package/dist/functions/read_utils/index.js +1 -0
  42. package/dist/functions/read_utils/src/index.js +1 -0
  43. package/dist/functions/read_utils/src/read_utils.browser.js +17 -0
  44. package/dist/functions/read_utils/src/utils.browser.js +32 -0
  45. package/dist/functions/read_utils/src/utils.js +70 -0
  46. package/dist/functions/rndm_utils/imports.js +1 -0
  47. package/dist/functions/rndm_utils/index.js +1 -0
  48. package/dist/functions/rndm_utils/src/index.js +1 -0
  49. package/dist/functions/rndm_utils/src/utils.js +13 -0
  50. package/dist/functions/safe_utils/imports.js +1 -0
  51. package/dist/functions/safe_utils/index.js +1 -0
  52. package/dist/functions/safe_utils/src/index.js +4 -0
  53. package/dist/functions/safe_utils/src/safe_document.js +12 -0
  54. package/dist/functions/safe_utils/src/safe_globals.js +14 -0
  55. package/dist/functions/safe_utils/src/safe_storage.js +52 -0
  56. package/dist/functions/safe_utils/src/safe_window.js +42 -0
  57. package/dist/functions/string_utils/index.js +1 -0
  58. package/dist/functions/string_utils/src/index.js +1 -0
  59. package/dist/functions/string_utils/src/string_utils.js +153 -0
  60. package/dist/functions/type_utils/imports.js +1 -0
  61. package/dist/functions/type_utils/index.js +1 -0
  62. package/dist/functions/type_utils/src/clean_utils.js +38 -0
  63. package/dist/functions/type_utils/src/ensure_utils.js +33 -0
  64. package/dist/functions/type_utils/src/index.js +5 -0
  65. package/dist/functions/type_utils/src/json_utils.js +22 -0
  66. package/dist/functions/type_utils/src/mime_utils.js +311 -0
  67. package/dist/functions/type_utils/src/type_utils.js +39 -0
  68. package/dist/functions/ui_utils/imports.js +5 -0
  69. package/dist/functions/ui_utils/index.js +1 -0
  70. package/dist/functions/ui_utils/src/button.js +22 -0
  71. package/dist/functions/ui_utils/src/checkbox.js +6 -0
  72. package/dist/functions/ui_utils/src/index.js +4 -0
  73. package/dist/functions/ui_utils/src/input.js +6 -0
  74. package/dist/functions/ui_utils/src/spinner.js +4 -0
  75. package/dist/functions/url_utils/index.js +1 -0
  76. package/dist/functions/url_utils/uri_utils.js +69 -0
  77. package/dist/functions/variable_utils/imports.js +1 -0
  78. package/dist/functions/variable_utils/index.js +1 -0
  79. package/dist/functions/variable_utils/src/index.js +1 -0
  80. package/dist/functions/variable_utils/src/variable_utils.js +34 -0
  81. package/dist/functions.json +1727 -0
  82. package/dist/index.js +2 -0
  83. package/dist/types/index.js +1 -0
  84. package/dist/types/src/ChangePassword.js +1 -0
  85. package/dist/types/src/Files.js +1 -0
  86. package/dist/types/src/index.js +5 -0
  87. package/dist/types/src/login.js +1 -0
  88. package/dist/types/src/logout.js +1 -0
  89. package/dist/types/src/utils.js +1 -0
  90. package/dist/utils/imports.js +1 -0
  91. package/dist/utils/index.js +1 -0
  92. package/dist/utils/src/Input.js +2 -0
  93. package/dist/utils/src/config.js +12 -0
  94. package/dist/utils/src/index.js +3 -0
  95. package/package.json +4 -1
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './functions';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ export * from './src';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './Files';
2
+ export * from './ChangePassword';
3
+ export * from './utils';
4
+ export * from './logout';
5
+ export * from './login';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './src';
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const Input = ({ label, type, value, onValueChange, placeholder, disabled, error, directory, multiple, accept, }) => (_jsxs("label", { className: "block", children: [_jsx("span", { className: "text-sm", children: label }), _jsx("input", Object.assign({ type: type, className: `mt-1 w-full border rounded px-2 py-1 ${error ? "border-red-500" : ""}`, value: value, onChange: (e) => onValueChange(e.target.value), placeholder: placeholder, disabled: disabled }, (type === "file" && directory ? { webkitdirectory: "true", directory: "" } : {}), (type === "file" && multiple ? { multiple: true } : {}), (type === "file" && accept ? { accept } : {}))), error && _jsx("p", { className: "text-sm text-red-600", children: error })] }));
@@ -0,0 +1,12 @@
1
+ import { __awaiter } from "tslib";
2
+ export let AppConfig;
3
+ export function loadConfig() {
4
+ return __awaiter(this, void 0, void 0, function* () {
5
+ const base = (process.env.BASE_API_URL || "").replace(/\/+$/, "");
6
+ const url = `${base}/config.json`;
7
+ const res = yield fetch(url);
8
+ if (!res.ok)
9
+ throw new Error(`Failed to load ${url}: ${res.status}`);
10
+ AppConfig = yield res.json();
11
+ });
12
+ }
@@ -0,0 +1,3 @@
1
+ //src/utils/src/index.ts
2
+ export * from "./Input";
3
+ export * from './config';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.243",
3
+ "version": "0.1.244",
4
4
  "description": "Reusable abstract utility functions and components for both Node and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -35,6 +35,9 @@
35
35
  "typescript": "^5.3.3"
36
36
  },
37
37
  "exports": {
38
+ "./functions": "./dist/functions/index.js",
39
+ "./components": "./dist/components/index.js",
40
+ "./constants": "./dist/constants/index.js",
38
41
  ".": {
39
42
  "import": "./dist/esm/index.js",
40
43
  "require": "./dist/cjs/index.js",