@onpe/ui 1.0.52 → 1.0.53
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/dist/cli.esm.js +58 -23
- package/dist/cli.js +58 -23
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -5865,15 +5865,15 @@ var COMPONENTS_URL = "https://raw.githubusercontent.com/ricardosv46/onpe-ui/main
|
|
|
5865
5865
|
var ICONS_URL = "https://raw.githubusercontent.com/ricardosv46/onpe-ui/main/src/icons";
|
|
5866
5866
|
function addComponent(componentName) {
|
|
5867
5867
|
return __awaiter(this, void 0, void 0, function () {
|
|
5868
|
-
var isIcon, isModalComponent, componentPath, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, dependencies, error_1;
|
|
5868
|
+
var isIcon, isModalComponent, componentPath, iconCategory, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, iconCategory, dependencies, error_1;
|
|
5869
5869
|
return __generator(this, function (_a) {
|
|
5870
5870
|
switch (_a.label) {
|
|
5871
5871
|
case 0:
|
|
5872
5872
|
isIcon = componentName.toLowerCase().startsWith("icon-");
|
|
5873
5873
|
isModalComponent = componentName.toLowerCase().startsWith("modal") && componentName !== "modal";
|
|
5874
5874
|
if (isIcon) {
|
|
5875
|
-
|
|
5876
|
-
componentPath = require$$1.join(process.cwd(), "src", "components", "onpe-icons");
|
|
5875
|
+
iconCategory = getIconCategory(componentName);
|
|
5876
|
+
componentPath = require$$1.join(process.cwd(), "src", "components", "onpe-icons-".concat(iconCategory));
|
|
5877
5877
|
}
|
|
5878
5878
|
else if (isModalComponent) {
|
|
5879
5879
|
// Los modales específicos van en src/components/onpe-modals/
|
|
@@ -5983,8 +5983,8 @@ function addComponent(componentName) {
|
|
|
5983
5983
|
componentNamePascal = convertToPascalCase(componentName);
|
|
5984
5984
|
importPath = void 0;
|
|
5985
5985
|
if (isIcon) {
|
|
5986
|
-
|
|
5987
|
-
importPath = "../onpe-icons/".concat(componentNamePascal);
|
|
5986
|
+
iconCategory = getIconCategory(componentName);
|
|
5987
|
+
importPath = "../onpe-icons-".concat(iconCategory, "/").concat(componentNamePascal);
|
|
5988
5988
|
}
|
|
5989
5989
|
else {
|
|
5990
5990
|
// Los componentes van en onpe-modals o onpe-ui
|
|
@@ -6004,7 +6004,8 @@ function addComponent(componentName) {
|
|
|
6004
6004
|
var depPascal = convertToPascalCase(dep);
|
|
6005
6005
|
var depPath;
|
|
6006
6006
|
if (dep.startsWith("icon-")) {
|
|
6007
|
-
|
|
6007
|
+
var iconCategory = getIconCategory(dep);
|
|
6008
|
+
depPath = "../onpe-icons-".concat(iconCategory, "/").concat(depPascal);
|
|
6008
6009
|
}
|
|
6009
6010
|
else if (dep.startsWith("modal") && dep !== "modal") {
|
|
6010
6011
|
depPath = "../onpe-modals/".concat(depPascal);
|
|
@@ -6029,6 +6030,36 @@ function addComponent(componentName) {
|
|
|
6029
6030
|
});
|
|
6030
6031
|
});
|
|
6031
6032
|
}
|
|
6033
|
+
function getIconCategory(iconName) {
|
|
6034
|
+
var icon = iconName.toLowerCase();
|
|
6035
|
+
// Iconos de acciones
|
|
6036
|
+
if (["icon-check", "icon-close", "icon-warning", "icon-spinner-desktop", "icon-spinner-mobile", "icon-home"].includes(icon)) {
|
|
6037
|
+
return "actions";
|
|
6038
|
+
}
|
|
6039
|
+
// Iconos de navegadores
|
|
6040
|
+
if ([
|
|
6041
|
+
"icon-chrome",
|
|
6042
|
+
"icon-chrome-color",
|
|
6043
|
+
"icon-edge",
|
|
6044
|
+
"icon-edge-color",
|
|
6045
|
+
"icon-mozilla",
|
|
6046
|
+
"icon-mozilla-color",
|
|
6047
|
+
"icon-safari",
|
|
6048
|
+
"icon-safari-color",
|
|
6049
|
+
].includes(icon)) {
|
|
6050
|
+
return "browsers";
|
|
6051
|
+
}
|
|
6052
|
+
// Iconos de sistemas operativos
|
|
6053
|
+
if (["icon-android", "icon-apple", "icon-window"].includes(icon)) {
|
|
6054
|
+
return "systems";
|
|
6055
|
+
}
|
|
6056
|
+
// Iconos de ONPE
|
|
6057
|
+
if (["icon-elections", "icon-voto-digital"].includes(icon)) {
|
|
6058
|
+
return "onpe";
|
|
6059
|
+
}
|
|
6060
|
+
// Por defecto, acciones
|
|
6061
|
+
return "actions";
|
|
6062
|
+
}
|
|
6032
6063
|
function convertToPascalCase(name) {
|
|
6033
6064
|
// Convertir kebab-case a PascalCase
|
|
6034
6065
|
// Ejemplo: "icon-android" → "IconAndroid"
|
|
@@ -6053,23 +6084,27 @@ function personalizeComponent(code, componentName) {
|
|
|
6053
6084
|
ModalBrowserIncompatible: "../onpe-modals/ModalBrowserIncompatible",
|
|
6054
6085
|
ModalSystemIncompatible: "../onpe-modals/ModalSystemIncompatible",
|
|
6055
6086
|
// Iconos
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6087
|
+
// Iconos organizados por categorías
|
|
6088
|
+
// Actions
|
|
6089
|
+
IconCheck: "../onpe-icons-actions/IconCheck",
|
|
6090
|
+
IconClose: "../onpe-icons-actions/IconClose",
|
|
6091
|
+
IconWarning: "../onpe-icons-actions/IconWarning",
|
|
6092
|
+
IconSpinnerDesktop: "../onpe-icons-actions/IconSpinnerDesktop",
|
|
6093
|
+
IconSpinnerMobile: "../onpe-icons-actions/IconSpinnerMobile",
|
|
6094
|
+
IconHome: "../onpe-icons-actions/IconHome",
|
|
6095
|
+
// Browsers
|
|
6096
|
+
IconChrome: "../onpe-icons-browsers/IconChrome",
|
|
6097
|
+
IconChromeColor: "../onpe-icons-browsers/IconChromeColor",
|
|
6098
|
+
IconEdge: "../onpe-icons-browsers/IconEdge",
|
|
6099
|
+
IconEdgeColor: "../onpe-icons-browsers/IconEdgeColor",
|
|
6100
|
+
IconMozilla: "../onpe-icons-browsers/IconMozilla",
|
|
6101
|
+
IconMozillaColor: "../onpe-icons-browsers/IconMozillaColor",
|
|
6102
|
+
IconSafari: "../onpe-icons-browsers/IconSafari",
|
|
6103
|
+
IconSafariColor: "../onpe-icons-browsers/IconSafariColor",
|
|
6104
|
+
// Systems
|
|
6105
|
+
IconAndroid: "../onpe-icons-systems/IconAndroid",
|
|
6106
|
+
IconApple: "../onpe-icons-systems/IconApple",
|
|
6107
|
+
IconWindow: "../onpe-icons-systems/IconWindow",
|
|
6073
6108
|
};
|
|
6074
6109
|
// Reemplazar las rutas de importación
|
|
6075
6110
|
var personalizedCode = code;
|
package/dist/cli.js
CHANGED
|
@@ -5865,15 +5865,15 @@ var COMPONENTS_URL = "https://raw.githubusercontent.com/ricardosv46/onpe-ui/main
|
|
|
5865
5865
|
var ICONS_URL = "https://raw.githubusercontent.com/ricardosv46/onpe-ui/main/src/icons";
|
|
5866
5866
|
function addComponent(componentName) {
|
|
5867
5867
|
return __awaiter(this, void 0, void 0, function () {
|
|
5868
|
-
var isIcon, isModalComponent, componentPath, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, dependencies, error_1;
|
|
5868
|
+
var isIcon, isModalComponent, componentPath, iconCategory, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, iconCategory, dependencies, error_1;
|
|
5869
5869
|
return __generator(this, function (_a) {
|
|
5870
5870
|
switch (_a.label) {
|
|
5871
5871
|
case 0:
|
|
5872
5872
|
isIcon = componentName.toLowerCase().startsWith("icon-");
|
|
5873
5873
|
isModalComponent = componentName.toLowerCase().startsWith("modal") && componentName !== "modal";
|
|
5874
5874
|
if (isIcon) {
|
|
5875
|
-
|
|
5876
|
-
componentPath = require$$1.join(process.cwd(), "src", "components", "onpe-icons");
|
|
5875
|
+
iconCategory = getIconCategory(componentName);
|
|
5876
|
+
componentPath = require$$1.join(process.cwd(), "src", "components", "onpe-icons-".concat(iconCategory));
|
|
5877
5877
|
}
|
|
5878
5878
|
else if (isModalComponent) {
|
|
5879
5879
|
// Los modales específicos van en src/components/onpe-modals/
|
|
@@ -5983,8 +5983,8 @@ function addComponent(componentName) {
|
|
|
5983
5983
|
componentNamePascal = convertToPascalCase(componentName);
|
|
5984
5984
|
importPath = void 0;
|
|
5985
5985
|
if (isIcon) {
|
|
5986
|
-
|
|
5987
|
-
importPath = "../onpe-icons/".concat(componentNamePascal);
|
|
5986
|
+
iconCategory = getIconCategory(componentName);
|
|
5987
|
+
importPath = "../onpe-icons-".concat(iconCategory, "/").concat(componentNamePascal);
|
|
5988
5988
|
}
|
|
5989
5989
|
else {
|
|
5990
5990
|
// Los componentes van en onpe-modals o onpe-ui
|
|
@@ -6004,7 +6004,8 @@ function addComponent(componentName) {
|
|
|
6004
6004
|
var depPascal = convertToPascalCase(dep);
|
|
6005
6005
|
var depPath;
|
|
6006
6006
|
if (dep.startsWith("icon-")) {
|
|
6007
|
-
|
|
6007
|
+
var iconCategory = getIconCategory(dep);
|
|
6008
|
+
depPath = "../onpe-icons-".concat(iconCategory, "/").concat(depPascal);
|
|
6008
6009
|
}
|
|
6009
6010
|
else if (dep.startsWith("modal") && dep !== "modal") {
|
|
6010
6011
|
depPath = "../onpe-modals/".concat(depPascal);
|
|
@@ -6029,6 +6030,36 @@ function addComponent(componentName) {
|
|
|
6029
6030
|
});
|
|
6030
6031
|
});
|
|
6031
6032
|
}
|
|
6033
|
+
function getIconCategory(iconName) {
|
|
6034
|
+
var icon = iconName.toLowerCase();
|
|
6035
|
+
// Iconos de acciones
|
|
6036
|
+
if (["icon-check", "icon-close", "icon-warning", "icon-spinner-desktop", "icon-spinner-mobile", "icon-home"].includes(icon)) {
|
|
6037
|
+
return "actions";
|
|
6038
|
+
}
|
|
6039
|
+
// Iconos de navegadores
|
|
6040
|
+
if ([
|
|
6041
|
+
"icon-chrome",
|
|
6042
|
+
"icon-chrome-color",
|
|
6043
|
+
"icon-edge",
|
|
6044
|
+
"icon-edge-color",
|
|
6045
|
+
"icon-mozilla",
|
|
6046
|
+
"icon-mozilla-color",
|
|
6047
|
+
"icon-safari",
|
|
6048
|
+
"icon-safari-color",
|
|
6049
|
+
].includes(icon)) {
|
|
6050
|
+
return "browsers";
|
|
6051
|
+
}
|
|
6052
|
+
// Iconos de sistemas operativos
|
|
6053
|
+
if (["icon-android", "icon-apple", "icon-window"].includes(icon)) {
|
|
6054
|
+
return "systems";
|
|
6055
|
+
}
|
|
6056
|
+
// Iconos de ONPE
|
|
6057
|
+
if (["icon-elections", "icon-voto-digital"].includes(icon)) {
|
|
6058
|
+
return "onpe";
|
|
6059
|
+
}
|
|
6060
|
+
// Por defecto, acciones
|
|
6061
|
+
return "actions";
|
|
6062
|
+
}
|
|
6032
6063
|
function convertToPascalCase(name) {
|
|
6033
6064
|
// Convertir kebab-case a PascalCase
|
|
6034
6065
|
// Ejemplo: "icon-android" → "IconAndroid"
|
|
@@ -6053,23 +6084,27 @@ function personalizeComponent(code, componentName) {
|
|
|
6053
6084
|
ModalBrowserIncompatible: "../onpe-modals/ModalBrowserIncompatible",
|
|
6054
6085
|
ModalSystemIncompatible: "../onpe-modals/ModalSystemIncompatible",
|
|
6055
6086
|
// Iconos
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6087
|
+
// Iconos organizados por categorías
|
|
6088
|
+
// Actions
|
|
6089
|
+
IconCheck: "../onpe-icons-actions/IconCheck",
|
|
6090
|
+
IconClose: "../onpe-icons-actions/IconClose",
|
|
6091
|
+
IconWarning: "../onpe-icons-actions/IconWarning",
|
|
6092
|
+
IconSpinnerDesktop: "../onpe-icons-actions/IconSpinnerDesktop",
|
|
6093
|
+
IconSpinnerMobile: "../onpe-icons-actions/IconSpinnerMobile",
|
|
6094
|
+
IconHome: "../onpe-icons-actions/IconHome",
|
|
6095
|
+
// Browsers
|
|
6096
|
+
IconChrome: "../onpe-icons-browsers/IconChrome",
|
|
6097
|
+
IconChromeColor: "../onpe-icons-browsers/IconChromeColor",
|
|
6098
|
+
IconEdge: "../onpe-icons-browsers/IconEdge",
|
|
6099
|
+
IconEdgeColor: "../onpe-icons-browsers/IconEdgeColor",
|
|
6100
|
+
IconMozilla: "../onpe-icons-browsers/IconMozilla",
|
|
6101
|
+
IconMozillaColor: "../onpe-icons-browsers/IconMozillaColor",
|
|
6102
|
+
IconSafari: "../onpe-icons-browsers/IconSafari",
|
|
6103
|
+
IconSafariColor: "../onpe-icons-browsers/IconSafariColor",
|
|
6104
|
+
// Systems
|
|
6105
|
+
IconAndroid: "../onpe-icons-systems/IconAndroid",
|
|
6106
|
+
IconApple: "../onpe-icons-systems/IconApple",
|
|
6107
|
+
IconWindow: "../onpe-icons-systems/IconWindow",
|
|
6073
6108
|
};
|
|
6074
6109
|
// Reemplazar las rutas de importación
|
|
6075
6110
|
var personalizedCode = code;
|