@onpe/ui 1.0.48 → 1.0.49
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 +82 -40
- package/dist/cli.js +82 -40
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -5865,20 +5865,20 @@ 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,
|
|
5868
|
+
var isIcon, componentPath, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, iconType, 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
|
-
|
|
5874
|
-
folderName = "onpe-ui";
|
|
5873
|
+
componentName.toLowerCase().startsWith("modal");
|
|
5875
5874
|
if (isIcon) {
|
|
5876
|
-
|
|
5875
|
+
// Los iconos van en src/icons/
|
|
5876
|
+
componentPath = require$$1.join(process.cwd(), "src", "icons");
|
|
5877
5877
|
}
|
|
5878
|
-
else
|
|
5879
|
-
|
|
5878
|
+
else {
|
|
5879
|
+
// Los componentes van en src/components/
|
|
5880
|
+
componentPath = require$$1.join(process.cwd(), "src", "components");
|
|
5880
5881
|
}
|
|
5881
|
-
componentPath = require$$1.join(process.cwd(), "src", "components", folderName);
|
|
5882
5882
|
// Crear directorio si no existe
|
|
5883
5883
|
return [4 /*yield*/, lib.ensureDir(componentPath)];
|
|
5884
5884
|
case 1:
|
|
@@ -5977,7 +5977,27 @@ function addComponent(componentName) {
|
|
|
5977
5977
|
console.log("\n📋 Próximos pasos:");
|
|
5978
5978
|
console.log("1. Importa el ".concat(isIcon ? "icono" : "componente", ":"));
|
|
5979
5979
|
componentNamePascal = convertToPascalCase(componentName);
|
|
5980
|
-
importPath =
|
|
5980
|
+
importPath = void 0;
|
|
5981
|
+
if (isIcon) {
|
|
5982
|
+
iconType = componentName.toLowerCase().includes("chrome") || componentName.toLowerCase().includes("safari") || componentName.toLowerCase().includes("mozilla") || componentName.toLowerCase().includes("edge")
|
|
5983
|
+
? "Browsers"
|
|
5984
|
+
: componentName.toLowerCase().includes("android") || componentName.toLowerCase().includes("apple") || componentName.toLowerCase().includes("window")
|
|
5985
|
+
? "OperatingSystems"
|
|
5986
|
+
: "Actions";
|
|
5987
|
+
importPath = "./icons/".concat(iconType, "/").concat(componentNamePascal);
|
|
5988
|
+
}
|
|
5989
|
+
else {
|
|
5990
|
+
// Para componentes, determinar la subcarpeta correcta
|
|
5991
|
+
if (componentName.toLowerCase().includes("modal-confirm") || componentName.toLowerCase().includes("modal-loading")) {
|
|
5992
|
+
importPath = "./components/Feedback/".concat(componentNamePascal);
|
|
5993
|
+
}
|
|
5994
|
+
else if (componentName.toLowerCase().includes("modal-browser") || componentName.toLowerCase().includes("modal-system")) {
|
|
5995
|
+
importPath = "./components/ErrorHandling/".concat(componentNamePascal);
|
|
5996
|
+
}
|
|
5997
|
+
else {
|
|
5998
|
+
importPath = "./components/".concat(componentNamePascal);
|
|
5999
|
+
}
|
|
6000
|
+
}
|
|
5981
6001
|
console.log(" import { ".concat(componentNamePascal, " } from '").concat(importPath, "'"));
|
|
5982
6002
|
// Mostrar dependencias si las hay
|
|
5983
6003
|
if (!isIcon && componentDependencies[componentName.toLowerCase()]) {
|
|
@@ -5985,8 +6005,30 @@ function addComponent(componentName) {
|
|
|
5985
6005
|
console.log("2. Tambi\u00E9n se instalaron las dependencias:");
|
|
5986
6006
|
dependencies.forEach(function (dep) {
|
|
5987
6007
|
var depPascal = convertToPascalCase(dep);
|
|
5988
|
-
var
|
|
5989
|
-
|
|
6008
|
+
var depPath;
|
|
6009
|
+
if (dep.startsWith("icon-")) {
|
|
6010
|
+
var iconType = dep.includes("chrome") || dep.includes("safari") || dep.includes("mozilla") || dep.includes("edge")
|
|
6011
|
+
? "Browsers"
|
|
6012
|
+
: dep.includes("android") || dep.includes("apple") || dep.includes("window")
|
|
6013
|
+
? "OperatingSystems"
|
|
6014
|
+
: "Actions";
|
|
6015
|
+
depPath = "./icons/".concat(iconType, "/").concat(depPascal);
|
|
6016
|
+
}
|
|
6017
|
+
else if (dep.startsWith("modal")) {
|
|
6018
|
+
if (dep.includes("confirm") || dep.includes("loading")) {
|
|
6019
|
+
depPath = "./components/Feedback/".concat(depPascal);
|
|
6020
|
+
}
|
|
6021
|
+
else if (dep.includes("browser") || dep.includes("system")) {
|
|
6022
|
+
depPath = "./components/ErrorHandling/".concat(depPascal);
|
|
6023
|
+
}
|
|
6024
|
+
else {
|
|
6025
|
+
depPath = "./components/".concat(depPascal);
|
|
6026
|
+
}
|
|
6027
|
+
}
|
|
6028
|
+
else {
|
|
6029
|
+
depPath = "./components/".concat(depPascal);
|
|
6030
|
+
}
|
|
6031
|
+
console.log(" import { ".concat(depPascal, " } from '").concat(depPath, "'"));
|
|
5990
6032
|
});
|
|
5991
6033
|
console.log("3. Usa el ".concat(isIcon ? "icono" : "componente", ":"));
|
|
5992
6034
|
}
|
|
@@ -6013,37 +6055,37 @@ function convertToPascalCase(name) {
|
|
|
6013
6055
|
}
|
|
6014
6056
|
function personalizeComponent(code, componentName) {
|
|
6015
6057
|
var componentNamePascal = convertToPascalCase(componentName);
|
|
6016
|
-
// Mapeo de componentes y sus
|
|
6058
|
+
// Mapeo de componentes y sus ubicaciones reales
|
|
6017
6059
|
var componentPaths = {
|
|
6018
|
-
// Componentes básicos
|
|
6019
|
-
Button: "./components/
|
|
6020
|
-
Overlay: "./components/
|
|
6021
|
-
Portal: "./components/
|
|
6022
|
-
Show: "./components/
|
|
6023
|
-
// Modales
|
|
6024
|
-
Modal: "./components/
|
|
6025
|
-
ModalConfirm: "./components/
|
|
6026
|
-
ModalLoading: "./components/
|
|
6027
|
-
ModalBrowserIncompatible: "./components/
|
|
6028
|
-
ModalSystemIncompatible: "./components/
|
|
6029
|
-
// Iconos
|
|
6030
|
-
IconCheck: "./
|
|
6031
|
-
IconClose: "./
|
|
6032
|
-
IconWarning: "./
|
|
6033
|
-
IconSpinnerDesktop: "./
|
|
6034
|
-
IconSpinnerMobile: "./
|
|
6035
|
-
IconHome: "./
|
|
6036
|
-
IconChrome: "./
|
|
6037
|
-
IconChromeColor: "./
|
|
6038
|
-
IconEdge: "./
|
|
6039
|
-
IconEdgeColor: "./
|
|
6040
|
-
IconMozilla: "./
|
|
6041
|
-
IconMozillaColor: "./
|
|
6042
|
-
IconSafari: "./
|
|
6043
|
-
IconSafariColor: "./
|
|
6044
|
-
IconAndroid: "./
|
|
6045
|
-
IconApple: "./
|
|
6046
|
-
IconWindow: "./
|
|
6060
|
+
// Componentes básicos
|
|
6061
|
+
Button: "./components/Button",
|
|
6062
|
+
Overlay: "./components/Overlay",
|
|
6063
|
+
Portal: "./components/Portal",
|
|
6064
|
+
Show: "./components/Show",
|
|
6065
|
+
// Modales
|
|
6066
|
+
Modal: "./components/Modal",
|
|
6067
|
+
ModalConfirm: "./components/Feedback/ModalConfirm",
|
|
6068
|
+
ModalLoading: "./components/Feedback/ModalLoading",
|
|
6069
|
+
ModalBrowserIncompatible: "./components/ErrorHandling/ModalBrowserIncompatible",
|
|
6070
|
+
ModalSystemIncompatible: "./components/ErrorHandling/ModalSystemIncompatible",
|
|
6071
|
+
// Iconos
|
|
6072
|
+
IconCheck: "./icons/Actions/IconCheck",
|
|
6073
|
+
IconClose: "./icons/Actions/IconClose",
|
|
6074
|
+
IconWarning: "./icons/Actions/IconWarning",
|
|
6075
|
+
IconSpinnerDesktop: "./icons/Actions/IconSpinnerDesktop",
|
|
6076
|
+
IconSpinnerMobile: "./icons/Actions/IconSpinnerMobile",
|
|
6077
|
+
IconHome: "./icons/Actions/IconHome",
|
|
6078
|
+
IconChrome: "./icons/Browsers/IconChrome",
|
|
6079
|
+
IconChromeColor: "./icons/Browsers/IconChromeColor",
|
|
6080
|
+
IconEdge: "./icons/Browsers/IconEdge",
|
|
6081
|
+
IconEdgeColor: "./icons/Browsers/IconEdgeColor",
|
|
6082
|
+
IconMozilla: "./icons/Browsers/IconMozilla",
|
|
6083
|
+
IconMozillaColor: "./icons/Browsers/IconMozillaColor",
|
|
6084
|
+
IconSafari: "./icons/Browsers/IconSafari",
|
|
6085
|
+
IconSafariColor: "./icons/Browsers/IconSafariColor",
|
|
6086
|
+
IconAndroid: "./icons/OperatingSystems/IconAndroid",
|
|
6087
|
+
IconApple: "./icons/OperatingSystems/IconApple",
|
|
6088
|
+
IconWindow: "./icons/OperatingSystems/IconWindow",
|
|
6047
6089
|
};
|
|
6048
6090
|
// Reemplazar las rutas de importación
|
|
6049
6091
|
var personalizedCode = code;
|
package/dist/cli.js
CHANGED
|
@@ -5865,20 +5865,20 @@ 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,
|
|
5868
|
+
var isIcon, componentPath, componentDependencies, availableComponents, availableIcons, componentFile, availableItems, dependencies, _i, dependencies_1, dependency, depError_1, downloadUrl, response, componentCode, personalizedCode, fileName, filePath, componentNamePascal, importPath, iconType, 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
|
-
|
|
5874
|
-
folderName = "onpe-ui";
|
|
5873
|
+
componentName.toLowerCase().startsWith("modal");
|
|
5875
5874
|
if (isIcon) {
|
|
5876
|
-
|
|
5875
|
+
// Los iconos van en src/icons/
|
|
5876
|
+
componentPath = require$$1.join(process.cwd(), "src", "icons");
|
|
5877
5877
|
}
|
|
5878
|
-
else
|
|
5879
|
-
|
|
5878
|
+
else {
|
|
5879
|
+
// Los componentes van en src/components/
|
|
5880
|
+
componentPath = require$$1.join(process.cwd(), "src", "components");
|
|
5880
5881
|
}
|
|
5881
|
-
componentPath = require$$1.join(process.cwd(), "src", "components", folderName);
|
|
5882
5882
|
// Crear directorio si no existe
|
|
5883
5883
|
return [4 /*yield*/, lib.ensureDir(componentPath)];
|
|
5884
5884
|
case 1:
|
|
@@ -5977,7 +5977,27 @@ function addComponent(componentName) {
|
|
|
5977
5977
|
console.log("\n📋 Próximos pasos:");
|
|
5978
5978
|
console.log("1. Importa el ".concat(isIcon ? "icono" : "componente", ":"));
|
|
5979
5979
|
componentNamePascal = convertToPascalCase(componentName);
|
|
5980
|
-
importPath =
|
|
5980
|
+
importPath = void 0;
|
|
5981
|
+
if (isIcon) {
|
|
5982
|
+
iconType = componentName.toLowerCase().includes("chrome") || componentName.toLowerCase().includes("safari") || componentName.toLowerCase().includes("mozilla") || componentName.toLowerCase().includes("edge")
|
|
5983
|
+
? "Browsers"
|
|
5984
|
+
: componentName.toLowerCase().includes("android") || componentName.toLowerCase().includes("apple") || componentName.toLowerCase().includes("window")
|
|
5985
|
+
? "OperatingSystems"
|
|
5986
|
+
: "Actions";
|
|
5987
|
+
importPath = "./icons/".concat(iconType, "/").concat(componentNamePascal);
|
|
5988
|
+
}
|
|
5989
|
+
else {
|
|
5990
|
+
// Para componentes, determinar la subcarpeta correcta
|
|
5991
|
+
if (componentName.toLowerCase().includes("modal-confirm") || componentName.toLowerCase().includes("modal-loading")) {
|
|
5992
|
+
importPath = "./components/Feedback/".concat(componentNamePascal);
|
|
5993
|
+
}
|
|
5994
|
+
else if (componentName.toLowerCase().includes("modal-browser") || componentName.toLowerCase().includes("modal-system")) {
|
|
5995
|
+
importPath = "./components/ErrorHandling/".concat(componentNamePascal);
|
|
5996
|
+
}
|
|
5997
|
+
else {
|
|
5998
|
+
importPath = "./components/".concat(componentNamePascal);
|
|
5999
|
+
}
|
|
6000
|
+
}
|
|
5981
6001
|
console.log(" import { ".concat(componentNamePascal, " } from '").concat(importPath, "'"));
|
|
5982
6002
|
// Mostrar dependencias si las hay
|
|
5983
6003
|
if (!isIcon && componentDependencies[componentName.toLowerCase()]) {
|
|
@@ -5985,8 +6005,30 @@ function addComponent(componentName) {
|
|
|
5985
6005
|
console.log("2. Tambi\u00E9n se instalaron las dependencias:");
|
|
5986
6006
|
dependencies.forEach(function (dep) {
|
|
5987
6007
|
var depPascal = convertToPascalCase(dep);
|
|
5988
|
-
var
|
|
5989
|
-
|
|
6008
|
+
var depPath;
|
|
6009
|
+
if (dep.startsWith("icon-")) {
|
|
6010
|
+
var iconType = dep.includes("chrome") || dep.includes("safari") || dep.includes("mozilla") || dep.includes("edge")
|
|
6011
|
+
? "Browsers"
|
|
6012
|
+
: dep.includes("android") || dep.includes("apple") || dep.includes("window")
|
|
6013
|
+
? "OperatingSystems"
|
|
6014
|
+
: "Actions";
|
|
6015
|
+
depPath = "./icons/".concat(iconType, "/").concat(depPascal);
|
|
6016
|
+
}
|
|
6017
|
+
else if (dep.startsWith("modal")) {
|
|
6018
|
+
if (dep.includes("confirm") || dep.includes("loading")) {
|
|
6019
|
+
depPath = "./components/Feedback/".concat(depPascal);
|
|
6020
|
+
}
|
|
6021
|
+
else if (dep.includes("browser") || dep.includes("system")) {
|
|
6022
|
+
depPath = "./components/ErrorHandling/".concat(depPascal);
|
|
6023
|
+
}
|
|
6024
|
+
else {
|
|
6025
|
+
depPath = "./components/".concat(depPascal);
|
|
6026
|
+
}
|
|
6027
|
+
}
|
|
6028
|
+
else {
|
|
6029
|
+
depPath = "./components/".concat(depPascal);
|
|
6030
|
+
}
|
|
6031
|
+
console.log(" import { ".concat(depPascal, " } from '").concat(depPath, "'"));
|
|
5990
6032
|
});
|
|
5991
6033
|
console.log("3. Usa el ".concat(isIcon ? "icono" : "componente", ":"));
|
|
5992
6034
|
}
|
|
@@ -6013,37 +6055,37 @@ function convertToPascalCase(name) {
|
|
|
6013
6055
|
}
|
|
6014
6056
|
function personalizeComponent(code, componentName) {
|
|
6015
6057
|
var componentNamePascal = convertToPascalCase(componentName);
|
|
6016
|
-
// Mapeo de componentes y sus
|
|
6058
|
+
// Mapeo de componentes y sus ubicaciones reales
|
|
6017
6059
|
var componentPaths = {
|
|
6018
|
-
// Componentes básicos
|
|
6019
|
-
Button: "./components/
|
|
6020
|
-
Overlay: "./components/
|
|
6021
|
-
Portal: "./components/
|
|
6022
|
-
Show: "./components/
|
|
6023
|
-
// Modales
|
|
6024
|
-
Modal: "./components/
|
|
6025
|
-
ModalConfirm: "./components/
|
|
6026
|
-
ModalLoading: "./components/
|
|
6027
|
-
ModalBrowserIncompatible: "./components/
|
|
6028
|
-
ModalSystemIncompatible: "./components/
|
|
6029
|
-
// Iconos
|
|
6030
|
-
IconCheck: "./
|
|
6031
|
-
IconClose: "./
|
|
6032
|
-
IconWarning: "./
|
|
6033
|
-
IconSpinnerDesktop: "./
|
|
6034
|
-
IconSpinnerMobile: "./
|
|
6035
|
-
IconHome: "./
|
|
6036
|
-
IconChrome: "./
|
|
6037
|
-
IconChromeColor: "./
|
|
6038
|
-
IconEdge: "./
|
|
6039
|
-
IconEdgeColor: "./
|
|
6040
|
-
IconMozilla: "./
|
|
6041
|
-
IconMozillaColor: "./
|
|
6042
|
-
IconSafari: "./
|
|
6043
|
-
IconSafariColor: "./
|
|
6044
|
-
IconAndroid: "./
|
|
6045
|
-
IconApple: "./
|
|
6046
|
-
IconWindow: "./
|
|
6060
|
+
// Componentes básicos
|
|
6061
|
+
Button: "./components/Button",
|
|
6062
|
+
Overlay: "./components/Overlay",
|
|
6063
|
+
Portal: "./components/Portal",
|
|
6064
|
+
Show: "./components/Show",
|
|
6065
|
+
// Modales
|
|
6066
|
+
Modal: "./components/Modal",
|
|
6067
|
+
ModalConfirm: "./components/Feedback/ModalConfirm",
|
|
6068
|
+
ModalLoading: "./components/Feedback/ModalLoading",
|
|
6069
|
+
ModalBrowserIncompatible: "./components/ErrorHandling/ModalBrowserIncompatible",
|
|
6070
|
+
ModalSystemIncompatible: "./components/ErrorHandling/ModalSystemIncompatible",
|
|
6071
|
+
// Iconos
|
|
6072
|
+
IconCheck: "./icons/Actions/IconCheck",
|
|
6073
|
+
IconClose: "./icons/Actions/IconClose",
|
|
6074
|
+
IconWarning: "./icons/Actions/IconWarning",
|
|
6075
|
+
IconSpinnerDesktop: "./icons/Actions/IconSpinnerDesktop",
|
|
6076
|
+
IconSpinnerMobile: "./icons/Actions/IconSpinnerMobile",
|
|
6077
|
+
IconHome: "./icons/Actions/IconHome",
|
|
6078
|
+
IconChrome: "./icons/Browsers/IconChrome",
|
|
6079
|
+
IconChromeColor: "./icons/Browsers/IconChromeColor",
|
|
6080
|
+
IconEdge: "./icons/Browsers/IconEdge",
|
|
6081
|
+
IconEdgeColor: "./icons/Browsers/IconEdgeColor",
|
|
6082
|
+
IconMozilla: "./icons/Browsers/IconMozilla",
|
|
6083
|
+
IconMozillaColor: "./icons/Browsers/IconMozillaColor",
|
|
6084
|
+
IconSafari: "./icons/Browsers/IconSafari",
|
|
6085
|
+
IconSafariColor: "./icons/Browsers/IconSafariColor",
|
|
6086
|
+
IconAndroid: "./icons/OperatingSystems/IconAndroid",
|
|
6087
|
+
IconApple: "./icons/OperatingSystems/IconApple",
|
|
6088
|
+
IconWindow: "./icons/OperatingSystems/IconWindow",
|
|
6047
6089
|
};
|
|
6048
6090
|
// Reemplazar las rutas de importación
|
|
6049
6091
|
var personalizedCode = code;
|