@dashadmin/dash-constants 0.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashadmin/dash-constants",
3
- "version": "0.0.0",
3
+ "version": "1.3.16",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
@@ -23,13 +23,27 @@
23
23
  "ts-jest": "latest",
24
24
  "ts-loader": "latest",
25
25
  "tsconfig-paths": "latest",
26
- "typescript": "latest"
26
+ "typescript": "latest",
27
+ "vite": "^5.2.0",
28
+ "rollup": "^4.0.0"
27
29
  },
28
30
  "dependencies": {
29
31
  "@mui/material": "^7.3.10"
30
32
  },
31
33
  "publishConfig": {
32
34
  "name": "@dashadmin/dash-constants",
33
- "access": "public"
34
- }
35
- }
35
+ "access": "public",
36
+ "main": "dist/index.js",
37
+ "exports": {
38
+ ".": {
39
+ "import": "./dist/index.js"
40
+ }
41
+ }
42
+ },
43
+ "scripts": {
44
+ "build": "vite build"
45
+ },
46
+ "files": [
47
+ "dist"
48
+ ]
49
+ }
package/.editorconfig DELETED
@@ -1,12 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.ts]
12
- quote_type = single
package/.eslintignore DELETED
File without changes
package/.eslintrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": ["eslint-config"],
4
- "parserOptions": {
5
- "project": ["./dash-constants/tsconfig.eslint.json"]
6
- }
7
- }
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- **/.git
2
- **/coverage
3
- **/node_modules
4
- **/.next
5
- **/.gitlab-ci.yml
package/.prettierrc.cjs DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- ...require('@dashadmin/dash-prettier'),
3
- };
@@ -1,40 +0,0 @@
1
- module.exports = {
2
- extends: ["@commitlint/config-conventional"],
3
- rules: {
4
- "body-leading-blank": [1, "always"],
5
- "body-max-line-length": [2, "always", 100],
6
- "footer-leading-blank": [1, "always"],
7
- "footer-max-line-length": [2, "always", 100],
8
- "header-max-length": [2, "always", 100],
9
- "scope-case": [2, "always", "lower-case"],
10
- "subject-case": [
11
- 2,
12
- "never",
13
- ["sentence-case", "start-case", "pascal-case", "upper-case"],
14
- ],
15
- "subject-empty": [2, "never"],
16
- "subject-full-stop": [2, "never", "."],
17
- "type-case": [2, "always", "lower-case"],
18
- "type-empty": [2, "never"],
19
- "type-enum": [
20
- 2,
21
- "always",
22
- [
23
- "build",
24
- "chore",
25
- "ci",
26
- "docs",
27
- "feat",
28
- "fix",
29
- "perf",
30
- "refactor",
31
- "revert",
32
- "style",
33
- "test",
34
- "translation",
35
- "security",
36
- "changeset",
37
- ],
38
- ],
39
- },
40
- }
package/dist/README.md DELETED
@@ -1 +0,0 @@
1
- # INSTRUCTIONS
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- // Auto-generated permissive types for @dashadmin/dash-constants.
2
- // Full typings can be regenerated with a tolerant tsc emit.
3
- export {};
package/dist/package.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "name": "@dashadmin/dash-constants",
3
- "version": "1.0.0",
4
- "description": "dash-constants — DASH framework package",
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
- }
16
- },
17
- "files": [
18
- "**/*"
19
- ],
20
- "sideEffects": false,
21
- "dependencies": {
22
- "@mui/material": "^7.3.10"
23
- },
24
- "publishConfig": {
25
- "access": "public"
26
- },
27
- "engines": {
28
- "node": ">=18"
29
- }
30
- }
@@ -1,183 +0,0 @@
1
- /* eslint-disable turbo/no-undeclared-env-vars */
2
- /**
3
- * @author Francisco Aranda - @farandal - http://www.linkedin.com/in/farandal
4
- * Francisco.aranda@dash.cl.
5
- * created Date 2022-07-14 15:00:00.
6
- */
7
-
8
- const getEnvironmentVariable = (environmentVariable: string): string => {
9
- /* @ts-ignore Expected access to process */
10
- const unvalidatedEnvironmentVariable = process.env[environmentVariable];
11
- /*if (!unvalidatedEnvironmentVariable) {
12
- throw new Error(
13
- `Couldn't find environment variable: ${environmentVariable}`,
14
- );
15
- } else {
16
- return unvalidatedEnvironmentVariable;
17
- }*/
18
- return unvalidatedEnvironmentVariable || null;
19
- };
20
-
21
-
22
- export const getEnv = (key: string) => {
23
-
24
- // @ts-ignore Expected access to process
25
- const PREFIX = process.env.ENV_PREFIX || process.env.NEXT_PUBLIC_ENV_PREFIX || process.env.VITE_ENV_PREFIX || process.env.REACT_ENV_PREFIX || 'VITE_';
26
- //console.log('GET ENV', PREFIX, key);
27
-
28
- if (PREFIX === 'NEXT_PUBLIC_') {
29
- return getEnvironmentVariable(PREFIX + key);
30
- }
31
- // @ts-ignore Expected access to process
32
- return process.env[PREFIX + key] || null;
33
-
34
- };
35
-
36
- const system = {
37
- FRONTEND_URL: getEnv('APP_FRONTEND_URL') || 'http://localhost:3006',
38
- API_URL: getEnv('APP_BACKEND_URL') || 'http://localhost:8000',
39
- SOCKET_URL: (getEnv('APP_SOCKETS_HOST') || (typeof window !== 'undefined' ? window.location.hostname : 'localhost')) + (getEnv('APP_SOCKETS_PORT') ? ':' + getEnv('APP_SOCKETS_PORT') : ''),
40
- SOCKETS_ENABLED: JSON.parse(getEnv('APP_SOCKETS_ENABLED')) || false,
41
- SOCKETS_BROADCASTER: getEnv('APP_SOCKETS_BROADCASTER') || 'pusher',
42
- SOCKETS_KEY: getEnv('APP_SOCKETS_KEY') || 'dash',
43
- ADMIN_API_URL: getEnv('APP_ADMIN_API_URL'),
44
- DEBUG: true, // String(getEnv("APP_DEBUG")) === 'true' ? true : false,
45
- SHOW_GLOBAL_TOAST_ERROR: false,
46
- SHOW_GLOBAL_DIALOG_ERROR: true,
47
- DASH_SYSTEM_ROLE: getEnv('DASH_SYSTEM_ROLE') || 'System',
48
- DASH_ADMIN_ROLE: getEnv('DASH_ADMIN_ROLE') || 'Administrator',
49
- HAS_ADMINISTRATOR_ID_ROLE: 'HasAdministratorId',
50
- ENABLE_TENANT_LOGIC: getEnv('ENABLE_TENANT_LOGIC') || true,
51
- ENABLE_TENANT_IMPERSONATION: getEnv('ENABLE_TENANT_LOGIC') || true,
52
- ENABLE_LOGS_AND_NOTIFICATIONS: getEnv('ENABLE_LOGS_AND_NOTIFICATIONS') || false,
53
- DEFAULT_PER_PAGE: Number(getEnv('DEFAULT_PER_PAGE')) || null,
54
- //URL_PREFIX: getEnv('DASH_ADMIN_URL_PREFIX') || '#/',
55
- URL_PREFIX: getEnv('DASH_ADMIN_URL_PREFIX') || '/',
56
- //PAGE_TRANSITIONS: JSON.parse(getEnv('PAGE_TRANSITIONS')) || false,
57
- PAGE_TRANSITIONS: false,
58
-
59
- GOOGLE_SIGNUP: JSON.parse(getEnv('APP_GOOGLE_SIGNUP')) || false,
60
- GOOGLE_CLIENT_ID: getEnv('APP_GOOGLE_CLIENT_ID') || '',
61
- RECAPTCHA_ENABLED: JSON.parse(getEnv('APP_RECAPTCHA_ENABLED')) || false,
62
- RECAPTCHA_TOKEN: getEnv('APP_RECAPTCHA_TOKEN') || 'UNSET',
63
-
64
- APP_VERSION: getEnv('APP_VERSION') || '1.0.0',
65
- BUILD_TIME: getEnv('BUILD_TIME') || new Date().toISOString(),
66
- IS_ELECTRON: JSON.parse(getEnv('IS_ELECTRON')) || false,
67
- PLATFORM: getEnv('PLATFORM') || "unknown",
68
- IS_WINDOWS: JSON.parse(getEnv('IS_WINDOWS')) || false,
69
- IS_MAC: JSON.parse(getEnv('IS_MAC')) || false,
70
- IS_LINUX: JSON.parse(getEnv('IS_LINUX')) || false,
71
- PLATFORM_TYPE: getEnv('PLATFORM_TYPE') || "browser",
72
- };
73
-
74
- const panel = {
75
- SIDEBAR_WIDTH: getEnv('SIDEBAR_WIDH') || 256,
76
- SIDEBAR_COLLAPSED_WIDTH: getEnv('SIDEBAR_COLLAPSED_WIDH') || 63,
77
- TAB_SIZE: 992,
78
- MOBILE_SIZE: 575,
79
- THEME_TYPE: 'THEME_TYPE',
80
- THEME_TYPE_LIGHT: 'light',
81
- THEME_TYPE_DARK: 'dark',
82
- THEME_TYPE_DASH_DEFAULT: 'light',
83
- THEME_TYPE_SEMI_DARK: 'THEME_TYPE_SEMI_DARK',
84
- THEME_COLOR: 'THEME_COLOR',
85
- UPDATE_RTL_STATUS: 'UPDATE_RTL_STATUS',
86
- LAYOUT_TYPE: 'LAYOUT_TYPE',
87
- LAYOUT_TYPE_FRAMED: 'framed-layout',
88
- LAYOUT_TYPE_BOXED: 'boxed-layout',
89
- LAYOUT_TYPE_FULL: 'full-layout',
90
- NAV_STYLE: 'NAV_STYLE',
91
- NAV_STYLE_FIXED: 'NAV_STYLE_FIXED',
92
- NAV_STYLE_MINI_SIDEBAR: 'NAV_STYLE_MINI_SIDEBAR',
93
- NAV_STYLE_DRAWER: 'NAV_STYLE_DRAWER',
94
- NAV_STYLE_NO_HEADER_MINI_SIDEBAR: 'NAV_STYLE_NO_HEADER_MINI_SIDEBAR',
95
- NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR: 'NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR',
96
- NAV_STYLE_DEFAULT_HORIZONTAL: 'NAV_STYLE_DEFAULT_HORIZONTAL',
97
- NAV_STYLE_DARK_HORIZONTAL: 'NAV_STYLE_DARK_HORIZONTAL',
98
- NAV_STYLE_INSIDE_HEADER_HORIZONTAL: 'NAV_STYLE_INSIDE_HEADER_HORIZONTAL',
99
- NAV_STYLE_BELOW_HEADER: 'NAV_STYLE_BELOW_HEADER',
100
- NAV_STYLE_ABOVE_HEADER: 'NAV_STYLE_ABOVE_HEADER',
101
- NAV_STYLE_COLLAPSABLE: 'NAV_STYLE_COLLAPSABLE',
102
- LIGHT_PURPLE: 'light_purple',
103
- LIGHT_PURPLE_SEC: '#00B378',
104
- LIGHT_PURPLE_DARK_TEXT_COLOR: '#9799AC',
105
- RED: 'red',
106
- RED_SEC: '#00D9C9',
107
- RED_DARK_TEXT_COLOR: '#878BAB',
108
- BLUE: 'blue',
109
- BLUE_SEC: '#FCB53B',
110
- BLUE_DARK_TEXT_COLOR: '#AAA59A',
111
- DARK_BLUE: 'dark_blue',
112
- DARK_BLUE_SEC: '#17BDE5',
113
- DARK_BLUE_DARK_TEXT_COLOR: '#9DDAE9',
114
- ORANGE: 'orange',
115
- ORANGE_SEC: '#F1D065',
116
- ORANGE_DARK_TEXT_COLOR: '#ABA895',
117
- LIGHT_BLUE: 'light_blue',
118
- LIGHT_BLUE_SEC: '#59DCFF',
119
- LIGHT_BLUE_DARK_TEXT_COLOR: '#92A2C8',
120
- DEEP_ORANGE: 'deep_orange',
121
- DEEP_ORANGE_SEC: '#70A288',
122
- DEEP_ORANGE_DARK_TEXT_COLOR: '#97B8C7',
123
- LIGHT_PURPLE_1: 'light_purple_1',
124
- LIGHT_PURPLE_1_SEC: '#E14594',
125
- LIGHT_PURPLE_1_DARK_TEXT_COLOR: '#8288B4',
126
- LIGHT_PURPLE_2: 'light_purple_2',
127
- LIGHT_PURPLE_2_SEC: '#64D7D6',
128
- LIGHT_PURPLE_2_DARK_TEXT_COLOR: '#5782BB',
129
- ACTIVE_COLOR_OPTION: '#ffffff'
130
- };
131
-
132
- const dict = {
133
- SYSTEM_FORM_DEFAULT_SELECT_OPTION: 'Seleccione una opción',
134
- NO_AVAILABLE_NOTIFICATIONS: 'No hay notificaciones nuevas',
135
- ALL_NOTIFICATIONS: 'Todas las notificaciones',
136
- NOTIFICATIONS_WIDGET_TITLE: 'Notificaciones',
137
- type: 'Tipo',
138
- date: 'Fecha',
139
- name: 'Nombre',
140
- filepath: 'Archivo',
141
- json: 'Data',
142
- clientName: 'Cliente',
143
- withdrawsToday: 'Retiros Hoy',
144
- withdrawsYesterday: 'Retiros Ayer',
145
- withdrawsLastWeek: 'Retiros Última Semana',
146
- volumeCp: 'Volúmen',
147
- 'validation.recaptcha': 'Recaptcha inválido',
148
- };
149
-
150
- const replacements = {
151
- profile: 'perfil',
152
- };
153
-
154
- const helpers = {
155
- };
156
-
157
- /*class constants {
158
- static system = system;
159
- static panel = panel;
160
- static dict = dict;
161
- static helpers = helpers;
162
- //static pushSystem(resources) { DASHStorageClass.resources = resources }
163
- }*/
164
-
165
- const DASHAdminSystemConstants: IDASHAdminSystemConstants = {
166
- system: system,
167
- panel: panel,
168
- dict: dict,
169
- helpers: helpers,
170
- replacements: replacements,
171
- //static pushSystem(resources) { DASHStorageClass.resources = resources }
172
- };
173
-
174
- //import APP_SETTINGS from "@app/dash-settings";
175
- export interface IDASHAdminSystemConstants {
176
- system: typeof system;
177
- panel: typeof panel;
178
- dict: typeof dict;
179
- helpers: typeof helpers;
180
- replacements: typeof replacements;
181
- }
182
-
183
- export default DASHAdminSystemConstants;
@@ -1,80 +0,0 @@
1
- import getEnv from "./utils/getEnv";
2
-
3
- /**
4
- * Defines the constants and configuration for the application.
5
- * This includes system roles, default settings, and various dictionary values used throughout the application.
6
- */
7
- const DASHAppConstants = {
8
- system: {
9
- GUEST_ROLE: {
10
- id: 99,
11
- level: 99,
12
- name: 'Guest',
13
- },
14
- URL_PREFIX: getEnv('DASH_URL_PREFIX') || '#/', // When using drawer
15
- SYSTEM_ROLE: getEnv('DASH_SYSTEM_ROLE') || 'System',
16
- TENANT_ROLE: getEnv('DASH_TENANT_ROLE') || 'Tenant',
17
- USER_ROLE: getEnv('DASH_USER_ROLE') || 'User',
18
- /* APP ROLES */
19
- CREATOR_ROLE: getEnv('APP_CREATOR_ROLE') || 'Creador',
20
- CLOSING_ROLE: getEnv('APP_CLOSING_ROLE') || 'Cerrador',
21
- GUNNER_ROLE: getEnv('APP_GUNNER_ROLE') || 'Pistolero',
22
- DRIVER_ROLE: getEnv('APP_DRIVER_ROLE') || 'Conductor',
23
- /* OTHERS */
24
- //PAGE_TRANSITIONS: JSON.parse(getEnv('PAGE_TRANSITIONS')) || false,
25
- //PAGE_TRANSITIONS: false,
26
- LOGIN_SOUNDS: JSON.parse(getEnv('LOGIN_SOUNDS')) || false,
27
- UI_SOUNDS: JSON.parse(getEnv('UI_SOUNDS')) || false,
28
- RECAPTCHA_ENABLED: JSON.parse(getEnv('APP_RECAPTCHA_ENABLED')) || false,
29
- RECAPTCHA_TOKEN: getEnv('APP_RECAPTCHA_TOKEN') || 'UNSET',
30
- DEFAULT_ROWS_PER_PAGE: getEnv('APP_DEFAULT_ROWS_PER_PAGE') || 50,
31
-
32
- },
33
-
34
- days: [
35
- { index: 0, name: 'Domingo' },
36
- { index: 1, name: 'Lunes' },
37
- { index: 2, name: 'Martes' },
38
- { index: 3, name: 'Miércoles' },
39
- { index: 4, name: 'Jueves' },
40
- { index: 5, name: 'Viernes' },
41
- { index: 6, name: 'Sábado' },
42
- ],
43
- dict: {
44
- SYSTEM_FORM_DEFAULT_SELECT_OPTION: 'Seleccione una opción',
45
- NO_AVAILABLE_NOTIFICATIONS: 'No hay notificaciones nuevas',
46
- ALL_NOTIFICATIONS: 'Todas las notificaciones',
47
- NOTIFICATIONS_WIDGET_TITLE: 'Notificaciones',
48
- type: 'Tipo',
49
- date: 'Fecha',
50
- name: 'Nombre',
51
- filepath: 'Archivo',
52
- json: 'Data',
53
- clientName: 'Cliente',
54
- withdrawsToday: 'Retiros Hoy',
55
- withdrawsYesterday: 'Retiros Ayer',
56
- withdrawsLastWeek: 'Retiros Última Semana',
57
- volumeCp: 'Volúmen',
58
- 'validation.recaptcha': 'Recaptcha inválido',
59
- PACKAGE_NOT_FOUND_TITLE:'Número de paquete no encontrado',
60
- PACKAGE_NOT_FOUND: 'Tú paquete no se ha encontrado. Si tienes problemas contáctanos a ayuda@dash.cl',
61
- },
62
- replacements: {
63
- 'validation.recaptcha': 'Recaptcha inválido',
64
- 'confirm password' : 'Confirmar contraseña',
65
- 'password' : 'Contraseña',
66
- 'client.name': 'Nombre del cliente',
67
- 'public id': 'Rut',
68
- 'name': 'Nombre',
69
- 'lastname': 'Apellido',
70
- 'client id': 'ID Cliente',
71
- 'logistic center id': 'Centro Logístico',
72
- 'delivery commune id': 'Comuna',
73
- 'contact name': 'Nombre del contacto',
74
- 'delivery address': 'Dirección de Envío',
75
- },
76
- custom: {}
77
- };
78
-
79
- export type IDASHAppConstants = typeof DASHAppConstants;
80
- export default DASHAppConstants;
@@ -1,21 +0,0 @@
1
- import getEnvironmentVariable from "./getEnvironmentVariable";
2
-
3
- /**
4
- * Retrieves the value of an environment variable, with support for various environment variable prefixes.
5
- *
6
- * @param {string} key - The name of the environment variable to retrieve.
7
- * @returns {string | null} The value of the environment variable, or `null` if the variable is not found.
8
- */
9
- const getEnv = (key: string) => {
10
- /* @ts-ignore Expected access to process */
11
- const PREFIX = process.env.ENV_PREFIX || process.env.NEXT_PUBLIC_ENV_PREFIX || process.env.VITE_ENV_PREFIX || process.env.REACT_ENV_PREFIX || '';
12
- //console.log('GET ENV',PREFIX, key);
13
-
14
- if (PREFIX === 'NEXT_PUBLIC_') {
15
- return getEnvironmentVariable(PREFIX + key);
16
- }
17
- /* @ts-ignore Expected access to process */
18
- return process.env[PREFIX + key] || null;
19
- };
20
-
21
- export default getEnv;
@@ -1,21 +0,0 @@
1
-
2
- /**
3
- * Retrieves the value of an environment variable, with support for various environment variable prefixes.
4
- *
5
- * @param {string} environmentVariable - The name of the environment variable to retrieve.
6
- * @returns {string | null} The value of the environment variable, or `null` if the variable is not found.
7
- */
8
- const getEnvironmentVariable = (environmentVariable: string): string => {
9
- /* @ts-ignore Expected warning to access to process */
10
- const unvalidatedEnvironmentVariable = process.env[environmentVariable];
11
- /*if (!unvalidatedEnvironmentVariable) {
12
- throw new Error(
13
- `Couldn't find environment variable: ${environmentVariable}`,
14
- );
15
- } else {
16
- return unvalidatedEnvironmentVariable;
17
- }*/
18
- return unvalidatedEnvironmentVariable || null;
19
- };
20
-
21
- export default getEnvironmentVariable;
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": [
4
- // 👇️ add all the directories and files
5
- // that you want to lint here
6
- "src",
7
- "./tsconfig.eslint.json",
8
- // add all files in which you see
9
- // the "parserOptions.project" error
10
- ".eslintrc.json"
11
- ]
12
- }
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "extends": "../../packages/dash-tsconfig/base.json",
3
- "compilerOptions": {
4
- //"types": ["@types/jest", "@types/node"],
5
- "jsx": "preserve",
6
- "incremental": true
7
- },
8
- "include": [
9
- "src/**/*.ts",
10
- "src/**/*.tsx",
11
- "src/**/*.ts",
12
- "src/**/*.tsx",
13
- "src/**/*.css",
14
- "src/**/*.ttf",
15
- "src/**/*.otf",
16
- "src/**/*.less"
17
- ],
18
- "paths": {
19
- "@/*": ["./src/*"]
20
- },
21
- "exclude": ["node_modules"]
22
- }
package/vite.config.mts DELETED
@@ -1,7 +0,0 @@
1
- import { fileURLToPath } from "node:url";
2
- import path from "node:path";
3
- import { createLibConfig } from "../dash-build/lib.mjs";
4
-
5
- const dirname = path.dirname(fileURLToPath(import.meta.url));
6
-
7
- export default createLibConfig({ dirname });