slicejs-cli 1.0.45 → 1.0.47
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/PROJECT_TEMPLATES/Basic/Slice/Components/Service/FetchManager/FetchManager.js +109 -37
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/Translator/Translator.js +15 -15
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/Translator/messages.json +50 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Controller/Controller.js +81 -83
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.css +47 -10
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.html +7 -3
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.js +114 -41
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Logger/Logger.js +11 -11
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/StylesManager/StylesManager.js +32 -28
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.css +44 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.html +5 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.js +39 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.css +63 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.html +7 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.js +110 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.css +87 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.html +8 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.js +87 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.css +97 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.html +18 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.js +86 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.css +505 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.html +1 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.js +95 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.eot +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.json +550 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.styl +502 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.svg +1470 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.symbol.svg +1035 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.ttf +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.woff +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.woff2 +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.css +87 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.html +4 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.js +210 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.css +56 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.html +83 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.js +39 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.css +30 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.html +6 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.js +39 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.css +91 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.html +8 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.js +210 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.css +76 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.html +8 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.js +109 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.css +34 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.html +7 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.js +33 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.css +34 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.html +43 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.js +39 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.css +110 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.html +12 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.js +65 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.css +163 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.html +15 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.js +48 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.css +56 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.html +6 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.js +119 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/components.js +22 -11
- package/PROJECT_TEMPLATES/Basic/Slice/Slice.js +169 -147
- package/PROJECT_TEMPLATES/Basic/Slice/Styles/sliceStyles.css +10 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Dark.css +33 -9
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Light.css +27 -10
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Slice.css +27 -12
- package/PROJECT_TEMPLATES/Basic/Slice/package.json +12 -0
- package/PROJECT_TEMPLATES/Basic/Slice/sliceConfig.json +9 -1
- package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.html +9 -13
- package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.js +381 -9
- package/commands/createComponent/createComponent.js +4 -1
- package/commands/deleteComponent/deleteComponent.js +7 -1
- package/commands/listComponents/listComponents.js +12 -3
- package/package.json +1 -1
|
@@ -1,23 +1,395 @@
|
|
|
1
|
-
|
|
1
|
+
import sliceConfig from "./Slice/sliceConfig.json" assert { type: "json" };
|
|
2
2
|
|
|
3
|
-
let theme =
|
|
4
|
-
await slice.stylesManager.setTheme("Light");
|
|
5
|
-
boton.innerHTML = "Cambiar al tema Dark";
|
|
3
|
+
let theme = sliceConfig.stylesManager.defaultTheme;
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
async function hola() {
|
|
8
6
|
if (theme === "Slice") {
|
|
9
7
|
await slice.stylesManager.setTheme("Light");
|
|
10
8
|
theme = "Light";
|
|
11
|
-
|
|
9
|
+
changeThemeButton.value = "Cambiar al tema Dark";
|
|
12
10
|
} else if (theme === "Light") {
|
|
13
11
|
await slice.stylesManager.setTheme("Dark");
|
|
14
12
|
theme = "Dark";
|
|
15
|
-
|
|
13
|
+
changeThemeButton.value = "Cambiar al tema Slice";
|
|
16
14
|
} else if (theme === "Dark") {
|
|
17
15
|
await slice.stylesManager.setTheme("Slice");
|
|
18
16
|
theme = "Slice";
|
|
19
|
-
|
|
17
|
+
changeThemeButton.value = "Cambiar al tema Light";
|
|
20
18
|
}
|
|
21
|
-
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let changeThemeButton = await slice.build("Button", {
|
|
22
|
+
value: "Cambiar Tema",
|
|
23
|
+
onClickCallback: hola,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
document.body.insertBefore(changeThemeButton, document.body.firstChild);
|
|
27
|
+
|
|
28
|
+
//append the component to the body first element
|
|
29
|
+
|
|
30
|
+
const tester = await slice.build("Tester", {
|
|
31
|
+
id: "tester",
|
|
32
|
+
sliceId: "tester",
|
|
33
|
+
subject: "Hola",
|
|
34
|
+
description: "Saludo",
|
|
35
|
+
});
|
|
36
|
+
//
|
|
37
|
+
// Form
|
|
38
|
+
//
|
|
39
|
+
const name1 = await slice.build("Input", {
|
|
40
|
+
id: "nombre",
|
|
41
|
+
placeholder: "Name",
|
|
42
|
+
required: true,
|
|
43
|
+
sliceId: "myInput",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const lastname = await slice.build("Input", {
|
|
47
|
+
placeholder: "Last Name",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const password = await slice.build("Input", {
|
|
51
|
+
placeholder: "Password",
|
|
52
|
+
type: "password",
|
|
53
|
+
required: true,
|
|
54
|
+
secret: true,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const confirmPassword = await slice.build("Input", {
|
|
58
|
+
placeholder: "Confirm Password",
|
|
59
|
+
type: "password",
|
|
60
|
+
required: true,
|
|
61
|
+
secret: false,
|
|
62
|
+
disabled: true,
|
|
63
|
+
conditions: {
|
|
64
|
+
// regex: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$",
|
|
65
|
+
minLength: 8,
|
|
66
|
+
maxLength: 10,
|
|
67
|
+
minMinusc: 1,
|
|
68
|
+
maxMinusc: 4,
|
|
69
|
+
minMayusc: 1,
|
|
70
|
+
maxMayusc: 6,
|
|
71
|
+
minNumber: 1,
|
|
72
|
+
maxNumber: 6,
|
|
73
|
+
minSymbol: 1,
|
|
74
|
+
maxSymbol: 10,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function testSliceButton() {
|
|
79
|
+
if (slice.translator.currentLanguage === "es") {
|
|
80
|
+
slice.translator.changeLanguage("en");
|
|
81
|
+
} else {
|
|
82
|
+
slice.translator.changeLanguage("es");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
sliceSwitch.label = slice.translator.currentLanguage;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const dateInput = await slice.build("Input", {
|
|
89
|
+
placeholder: "Birthday",
|
|
90
|
+
type: "date",
|
|
91
|
+
});
|
|
92
|
+
const ageInput = await slice.build("Input", {
|
|
93
|
+
placeholder: "Age",
|
|
94
|
+
type: "number",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const button = await slice.build("Button", {
|
|
98
|
+
value: "Slice",
|
|
99
|
+
sliceId: "gio",
|
|
100
|
+
onClickCallback: () => {
|
|
101
|
+
password.triggerError();
|
|
102
|
+
password.triggerError();
|
|
103
|
+
select.value = [
|
|
104
|
+
{ value: "Hola", id: 0 },
|
|
105
|
+
{ value: "Hello", id: 1 },
|
|
106
|
+
{ value: "Hi", id: 3 },
|
|
107
|
+
];
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const form = document.getElementById("form");
|
|
112
|
+
|
|
113
|
+
form.appendChild(name1);
|
|
114
|
+
form.appendChild(lastname);
|
|
115
|
+
form.appendChild(password);
|
|
116
|
+
form.appendChild(confirmPassword);
|
|
117
|
+
form.appendChild(dateInput);
|
|
118
|
+
form.appendChild(ageInput);
|
|
119
|
+
|
|
120
|
+
const checkbox = await slice.build("Checkbox", {
|
|
121
|
+
label: "Check",
|
|
122
|
+
position: "top",
|
|
123
|
+
customColor: "yellow",
|
|
124
|
+
});
|
|
125
|
+
const checkbox2 = await slice.build("Checkbox", {
|
|
126
|
+
label: "Check",
|
|
127
|
+
position: "left",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const sliceSwitch = await slice.build("Switch", {
|
|
131
|
+
label: slice.translator.currentLanguage,
|
|
132
|
+
customColor: "black",
|
|
133
|
+
toggle: testSliceButton,
|
|
134
|
+
});
|
|
135
|
+
const sliceSwitch2 = await slice.build("Switch", {
|
|
136
|
+
label: "Switch",
|
|
137
|
+
position: "bottom",
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const select = await slice.build("Select", {
|
|
141
|
+
options: [
|
|
142
|
+
{ value: "Hola", id: 0 },
|
|
143
|
+
{ value: "Hello", id: 1 },
|
|
144
|
+
{ value: "Hallo", id: 2 },
|
|
145
|
+
{ value: "Hi", id: 3 },
|
|
146
|
+
{ value: "Hola", id: 4 },
|
|
147
|
+
{ value: "Hello", id: 5 },
|
|
148
|
+
{ value: "Hallo", id: 6 },
|
|
149
|
+
{ value: "Hi", id: 7 },
|
|
150
|
+
],
|
|
151
|
+
visibleProp: "id",
|
|
152
|
+
label: "Elige una opcion",
|
|
153
|
+
multiple: true,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const select2 = await slice.build("Select", {
|
|
157
|
+
options: [
|
|
158
|
+
{ value: "Hola", id: 0 },
|
|
159
|
+
{ value: "Hello", id: 1 },
|
|
160
|
+
{ value: "Hallo", id: 2 },
|
|
161
|
+
{ value: "Hi", id: 3 },
|
|
162
|
+
],
|
|
163
|
+
visibleProp: "id",
|
|
164
|
+
label: "Elige una opcion",
|
|
165
|
+
multiple: false,
|
|
166
|
+
onOptionSelect: function xd() {
|
|
167
|
+
select.value = [select2.value];
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
form.appendChild(checkbox);
|
|
172
|
+
form.appendChild(checkbox2);
|
|
173
|
+
form.appendChild(sliceSwitch);
|
|
174
|
+
form.appendChild(sliceSwitch2);
|
|
175
|
+
form.appendChild(select);
|
|
176
|
+
form.appendChild(select2);
|
|
177
|
+
|
|
178
|
+
form.appendChild(button);
|
|
179
|
+
|
|
180
|
+
const button2 = await slice.build("Button", {
|
|
181
|
+
value: "Cambiar Idioma",
|
|
182
|
+
customColor: "red",
|
|
183
|
+
onClickCallback: () => {
|
|
184
|
+
if (slice.translator.currentLanguage === "es") {
|
|
185
|
+
slice.translator.changeLanguage("en");
|
|
186
|
+
} else {
|
|
187
|
+
slice.translator.changeLanguage("es");
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
sliceId: "buttonLanguage",
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
form.appendChild(button2);
|
|
194
|
+
|
|
195
|
+
const loading = await slice.build("Loading", {});
|
|
196
|
+
/*
|
|
197
|
+
const fetchManager = await slice.build("FetchManager", {
|
|
198
|
+
baseUrl: "https://jsonplaceholder.typicode.com",
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// Definimos una función para manejar el éxito de la solicitud
|
|
202
|
+
const handleSuccess = (data, response) => {
|
|
203
|
+
console.log("Solicitud exitosa:", response);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// Definimos una función para manejar el error de la solicitud
|
|
207
|
+
const handleError = (data, response) => {
|
|
208
|
+
console.error("Error en la solicitud:", response);
|
|
209
|
+
console.error("Datos enviados:", data);
|
|
210
|
+
hola();
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Realizamos una solicitud GET
|
|
214
|
+
fetchManager
|
|
215
|
+
.request("GET", null, "/posts", handleSuccess, handleError)
|
|
216
|
+
.then((responseData) => {
|
|
217
|
+
console.log("Respuesta recibida:", responseData);
|
|
218
|
+
})
|
|
219
|
+
.catch((error) => {
|
|
220
|
+
console.error("Error:", error);
|
|
221
|
+
});
|
|
222
|
+
*/
|
|
223
|
+
const navBar = await slice.build("NavBar", {
|
|
224
|
+
items: [
|
|
225
|
+
{
|
|
226
|
+
text: "Home",
|
|
227
|
+
href: "",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
text: "About Us",
|
|
231
|
+
href: "",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
text: "Contact Us",
|
|
235
|
+
href: "",
|
|
236
|
+
},
|
|
237
|
+
select,
|
|
238
|
+
],
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
document.body.insertBefore(navBar, document.body.firstChild);
|
|
242
|
+
|
|
243
|
+
const cardYoutube = await slice.build("Card", {
|
|
244
|
+
title: "Youtube",
|
|
245
|
+
text: "Plataforma para ver videos",
|
|
246
|
+
icon: {
|
|
247
|
+
name: "youtube",
|
|
248
|
+
iconStyle: "filled",
|
|
249
|
+
},
|
|
250
|
+
customColor: {
|
|
251
|
+
card: "red",
|
|
252
|
+
icon: "white",
|
|
253
|
+
},
|
|
254
|
+
sliceId: "cardYoutube",
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
const cardTwitter = await slice.build("Card", {
|
|
258
|
+
title: "Twitter",
|
|
259
|
+
text: "Plataforma donde nada te nutre",
|
|
260
|
+
icon: {
|
|
261
|
+
name: "twitter",
|
|
262
|
+
iconStyle: "filled",
|
|
263
|
+
},
|
|
264
|
+
customColor: {
|
|
265
|
+
card: "#1DA1F2",
|
|
266
|
+
icon: "white",
|
|
267
|
+
},
|
|
268
|
+
sliceId: "cardTwitter",
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
const cardFacebook = await slice.build("Card", {
|
|
272
|
+
title: "Facebook",
|
|
273
|
+
text: "Plataforma para responder en marketplace y vender 1 vez a la cuaresma",
|
|
274
|
+
icon: {
|
|
275
|
+
name: "facebook",
|
|
276
|
+
iconStyle: "filled",
|
|
277
|
+
},
|
|
278
|
+
customColor: {
|
|
279
|
+
card: "#1877F2",
|
|
280
|
+
icon: "white",
|
|
281
|
+
},
|
|
282
|
+
sliceId: "cardFacebook",
|
|
22
283
|
});
|
|
23
284
|
|
|
285
|
+
const cardLinkedin = await slice.build("Card", {
|
|
286
|
+
title: "Linkedin",
|
|
287
|
+
text: "Plataforma para buscar trabajo",
|
|
288
|
+
icon: {
|
|
289
|
+
name: "linkedin",
|
|
290
|
+
iconStyle: "filled",
|
|
291
|
+
},
|
|
292
|
+
customColor: {
|
|
293
|
+
card: "#0A66C2",
|
|
294
|
+
icon: "white",
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
const cardGoogle = await slice.build("Card", {
|
|
299
|
+
title: "Google",
|
|
300
|
+
text: "Plataforma para buscar cosas",
|
|
301
|
+
icon: {
|
|
302
|
+
name: "google",
|
|
303
|
+
iconStyle: "filled",
|
|
304
|
+
},
|
|
305
|
+
customColor: {
|
|
306
|
+
card: "white",
|
|
307
|
+
icon: "black",
|
|
308
|
+
},
|
|
309
|
+
sliceId: "cardGoogle",
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
const cardApple = await slice.build("Card", {
|
|
313
|
+
title: "Apple",
|
|
314
|
+
text: "Plataforma para comprar cosas caras",
|
|
315
|
+
icon: {
|
|
316
|
+
name: "apple",
|
|
317
|
+
iconStyle: "filled",
|
|
318
|
+
},
|
|
319
|
+
customColor: {
|
|
320
|
+
card: "black",
|
|
321
|
+
icon: "white",
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
const cardStackoverflow = await slice.build("Card", {
|
|
326
|
+
title: "Stackoverflow",
|
|
327
|
+
text: "Plataforma para preguntar cosas",
|
|
328
|
+
icon: {
|
|
329
|
+
name: "stackoverflow",
|
|
330
|
+
iconStyle: "filled",
|
|
331
|
+
},
|
|
332
|
+
customColor: {
|
|
333
|
+
card: "#F48024",
|
|
334
|
+
icon: "white",
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const cardGithub = await slice.build("Card", {
|
|
339
|
+
title: "Github",
|
|
340
|
+
text: "Plataforma para compartir código",
|
|
341
|
+
icon: {
|
|
342
|
+
name: "github",
|
|
343
|
+
iconStyle: "filled",
|
|
344
|
+
},
|
|
345
|
+
customColor: {
|
|
346
|
+
card: "black",
|
|
347
|
+
icon: "white",
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const cardDiscord = await slice.build("Card", {
|
|
352
|
+
title: "Discord",
|
|
353
|
+
text: "Plataforma para hablar con amigos y fumar porro y la tarea de Eli",
|
|
354
|
+
icon: {
|
|
355
|
+
name: "discord",
|
|
356
|
+
iconStyle: "filled",
|
|
357
|
+
},
|
|
358
|
+
customColor: {
|
|
359
|
+
card: "#5865F2",
|
|
360
|
+
icon: "white",
|
|
361
|
+
},
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const cardHTML = await slice.build("Card", {
|
|
365
|
+
title: "HTML",
|
|
366
|
+
text: "Lenguaje de marcado",
|
|
367
|
+
icon: {
|
|
368
|
+
name: "html",
|
|
369
|
+
iconStyle: "filled",
|
|
370
|
+
},
|
|
371
|
+
customColor: {
|
|
372
|
+
card: "orange",
|
|
373
|
+
icon: "white",
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
const gridDiv = document.createElement("div");
|
|
378
|
+
gridDiv.style.display = "grid";
|
|
379
|
+
gridDiv.style.gridTemplateColumns = "repeat(5, 1fr)";
|
|
380
|
+
gridDiv.style.gap = "1rem";
|
|
381
|
+
gridDiv.style.padding = "1rem";
|
|
382
|
+
gridDiv.style.height = "600px";
|
|
383
|
+
|
|
384
|
+
gridDiv.appendChild(cardYoutube);
|
|
385
|
+
gridDiv.appendChild(cardTwitter);
|
|
386
|
+
gridDiv.appendChild(cardFacebook);
|
|
387
|
+
gridDiv.appendChild(cardLinkedin);
|
|
388
|
+
gridDiv.appendChild(cardGithub);
|
|
389
|
+
gridDiv.appendChild(cardGoogle);
|
|
390
|
+
gridDiv.appendChild(cardApple);
|
|
391
|
+
gridDiv.appendChild(cardStackoverflow);
|
|
392
|
+
gridDiv.appendChild(cardDiscord);
|
|
393
|
+
gridDiv.appendChild(cardHTML);
|
|
394
|
+
|
|
395
|
+
document.body.appendChild(gridDiv);
|
|
@@ -33,8 +33,11 @@ function createComponent(componentName, category, properties) {
|
|
|
33
33
|
const fileName = `${className}.js`;
|
|
34
34
|
const template = componentTemplate(className, properties);
|
|
35
35
|
|
|
36
|
+
//RUTA PARA CUANDO SE COLOQUE DE USUARIO
|
|
37
|
+
// ../../../../src/Components
|
|
38
|
+
|
|
36
39
|
// Determinar la ruta del archivo
|
|
37
|
-
let componentDir = path.join(__dirname, '../../../../
|
|
40
|
+
let componentDir = path.join(__dirname, '../../../../src/Components', category, className);
|
|
38
41
|
componentDir=componentDir.slice(1);
|
|
39
42
|
// Asegurarse de que el directorio del componente exista
|
|
40
43
|
fs.ensureDirSync(componentDir);
|
|
@@ -23,8 +23,14 @@ function deleteComponent(componentName, category) {
|
|
|
23
23
|
}
|
|
24
24
|
category = flagCategory.category;
|
|
25
25
|
|
|
26
|
+
// Determinar la ruta del archivo
|
|
27
|
+
//RUTA PARA CUANDO SE COLOQUE DE USUARIO
|
|
28
|
+
// ../../../../src/Components
|
|
29
|
+
//PARA DEVELOPERS
|
|
30
|
+
// ../../../../Slice/Components
|
|
31
|
+
|
|
26
32
|
// Construir la ruta del directorio del componente
|
|
27
|
-
let componentDir = path.join(__dirname, '../../../../
|
|
33
|
+
let componentDir = path.join(__dirname, '../../../../src/Components', category, componentName);
|
|
28
34
|
componentDir = componentDir.slice(1);
|
|
29
35
|
|
|
30
36
|
// Verificar si el directorio del componente existe
|
|
@@ -7,6 +7,8 @@ import Print from '../Print.js';
|
|
|
7
7
|
export default function listComponents() {
|
|
8
8
|
|
|
9
9
|
const SlicePath = path.join(__dirname, '../../../../Slice/Components');
|
|
10
|
+
const userVisualComponents = fs.readdirSync(__dirname,'../../../../src/Components/Visual');
|
|
11
|
+
const userServices = fs.readdirSync(__dirname,'../../../../src/Components/Service');
|
|
10
12
|
|
|
11
13
|
const visualComponents = fs.readdirSync(`${SlicePath}/Visual`);
|
|
12
14
|
const services = fs.readdirSync(`${SlicePath}/Service`);
|
|
@@ -16,17 +18,24 @@ export default function listComponents() {
|
|
|
16
18
|
const componentMap = new Map();
|
|
17
19
|
|
|
18
20
|
visualComponents.forEach(component => {
|
|
19
|
-
componentMap.set(component, "
|
|
21
|
+
componentMap.set(component, "SliceVisual");
|
|
20
22
|
});
|
|
21
23
|
|
|
22
24
|
services.forEach(component => {
|
|
23
|
-
componentMap.set(component, "
|
|
25
|
+
componentMap.set(component, "SliceService");
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
structuralComponents.forEach(component => {
|
|
27
|
-
componentMap.set(component, "
|
|
29
|
+
componentMap.set(component, "SliceStructural");
|
|
28
30
|
});
|
|
29
31
|
|
|
32
|
+
userVisualComponents.forEach(component => {
|
|
33
|
+
componentMap.set(component, "UserVisual");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
userServices.forEach(component => {
|
|
37
|
+
componentMap.set(component, "UserService");
|
|
38
|
+
});
|
|
30
39
|
|
|
31
40
|
const mapAsArray = Array.from(componentMap.entries());
|
|
32
41
|
const mapObject = Object.fromEntries(mapAsArray);
|