slicejs-web-framework 1.0.17 → 1.0.20
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/Slice/Components/Structural/Debugger/Debugger.js +3 -3
- package/Slice/Slice.js +2 -1
- package/package.json +1 -1
- package/src/Components/AppComponents/HomePage/HomePage.css +203 -0
- package/src/Components/AppComponents/HomePage/HomePage.html +49 -0
- package/src/Components/AppComponents/HomePage/HomePage.js +196 -0
- package/src/Components/AppComponents/Playground/Playground.js +0 -19
- package/src/Themes/Slice.css +35 -35
- package/src/routes.js +2 -88
- package/src/sliceConfig.json +0 -3
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
- package/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +0 -130
- package/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +0 -4
- package/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +0 -263
- package/src/Components/AppComponents/Documentation/Documentation.css +0 -0
- package/src/Components/AppComponents/Documentation/Documentation.html +0 -30
- package/src/Components/AppComponents/Documentation/Documentation.js +0 -75
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -283
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
- package/src/Components/AppComponents/Installation/Installation.css +0 -185
- package/src/Components/AppComponents/Installation/Installation.html +0 -102
- package/src/Components/AppComponents/Installation/Installation.js +0 -61
- package/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
- package/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
- package/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
- package/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
- package/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
- package/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
- package/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
- package/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
- package/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
- package/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
- package/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
- package/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
- package/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.css +0 -89
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.html +0 -108
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.js +0 -177
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.css +0 -82
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.html +0 -74
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.js +0 -416
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.css +0 -56
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.html +0 -28
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.js +0 -134
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.css +0 -72
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.html +0 -98
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.js +0 -219
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.css +0 -122
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.html +0 -70
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.js +0 -86
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -23
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -6
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -129
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.css +0 -61
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.html +0 -80
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.js +0 -149
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.css +0 -70
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.html +0 -67
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.js +0 -193
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -475
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -389
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -95
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
export default class SwitchDocumentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
await this.createSwitch(this.querySelector('.mySwitch'), {}, `{}`);
|
|
12
|
-
await this.createSwitch(
|
|
13
|
-
this.querySelector('.colorSwitch'),
|
|
14
|
-
{ customColor: 'gold' },
|
|
15
|
-
`{
|
|
16
|
-
customColor: "gold"
|
|
17
|
-
}`
|
|
18
|
-
);
|
|
19
|
-
await this.createSwitch(
|
|
20
|
-
this.querySelector('.label'),
|
|
21
|
-
{
|
|
22
|
-
label: 'Switch',
|
|
23
|
-
},
|
|
24
|
-
`{
|
|
25
|
-
label: "Switch",
|
|
26
|
-
}`
|
|
27
|
-
);
|
|
28
|
-
await this.createSwitch(
|
|
29
|
-
this.querySelector('.labelLeft'),
|
|
30
|
-
{
|
|
31
|
-
label: 'Left',
|
|
32
|
-
labelPlacement: 'left',
|
|
33
|
-
},
|
|
34
|
-
`{
|
|
35
|
-
label: "Left",
|
|
36
|
-
labelPlacement: "left",
|
|
37
|
-
}`
|
|
38
|
-
);
|
|
39
|
-
await this.createSwitch(
|
|
40
|
-
this.querySelector('.labelTop'),
|
|
41
|
-
{
|
|
42
|
-
label: 'Top',
|
|
43
|
-
labelPlacement: 'top',
|
|
44
|
-
},
|
|
45
|
-
`{
|
|
46
|
-
label: "Top",
|
|
47
|
-
labelPlacement: "top",
|
|
48
|
-
}`
|
|
49
|
-
);
|
|
50
|
-
await this.createSwitch(
|
|
51
|
-
this.querySelector('.labelRight'),
|
|
52
|
-
{
|
|
53
|
-
label: 'Right',
|
|
54
|
-
labelPlacement: 'right',
|
|
55
|
-
},
|
|
56
|
-
`{
|
|
57
|
-
label: "Right",
|
|
58
|
-
labelPlacement: "right",
|
|
59
|
-
}`
|
|
60
|
-
);
|
|
61
|
-
await this.createSwitch(
|
|
62
|
-
this.querySelector('.labelBottom'),
|
|
63
|
-
{
|
|
64
|
-
label: 'Bottom',
|
|
65
|
-
labelPlacement: 'bottom',
|
|
66
|
-
},
|
|
67
|
-
`{
|
|
68
|
-
label: "Bottom",
|
|
69
|
-
labelPlacement: "bottom",
|
|
70
|
-
}`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async createSwitch(appendTo, switchProps, codeProps) {
|
|
75
|
-
if (!codeProps) {
|
|
76
|
-
codeProps = '{}';
|
|
77
|
-
}
|
|
78
|
-
const mySwitch = await slice.build('Switch', switchProps);
|
|
79
|
-
|
|
80
|
-
const componentCode = await slice.build('CodeVisualizer', {
|
|
81
|
-
value: `const mySwitch = await slice.build("Switch", ${codeProps});
|
|
82
|
-
|
|
83
|
-
`,
|
|
84
|
-
language: 'javascript',
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const div = document.createElement('div');
|
|
88
|
-
const switchDiv = document.createElement('div');
|
|
89
|
-
switchDiv.classList.add('switchs');
|
|
90
|
-
switchDiv.appendChild(mySwitch);
|
|
91
|
-
div.classList.add('switchs_container');
|
|
92
|
-
div.appendChild(switchDiv);
|
|
93
|
-
div.appendChild(componentCode);
|
|
94
|
-
|
|
95
|
-
if (appendTo) {
|
|
96
|
-
appendTo.appendChild(div);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return div;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
customElements.define('slice-switchdocumentation', SwitchDocumentation);
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
slice-the-build-method {
|
|
2
|
-
font-family: var(--font-family);
|
|
3
|
-
color: var(--font-primary-color);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
slice-the-build-method .build-method-container {
|
|
7
|
-
max-width: 90%;
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding: 20px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
slice-the-build-method h1 {
|
|
13
|
-
font-size: 2.2rem;
|
|
14
|
-
margin-bottom: 1.5rem;
|
|
15
|
-
color: var(--primary-color);
|
|
16
|
-
border-bottom: 2px solid var(--secondary-background-color);
|
|
17
|
-
padding-bottom: 0.5rem;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
slice-the-build-method h2 {
|
|
21
|
-
font-size: 1.8rem;
|
|
22
|
-
margin-top: 2rem;
|
|
23
|
-
margin-bottom: 1rem;
|
|
24
|
-
color: var(--primary-color);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
slice-the-build-method h3 {
|
|
28
|
-
font-size: 1.5rem;
|
|
29
|
-
margin-top: 1.5rem;
|
|
30
|
-
margin-bottom: 0.75rem;
|
|
31
|
-
color: var(--font-primary-color);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
slice-the-build-method p {
|
|
35
|
-
margin-bottom: 1rem;
|
|
36
|
-
line-height: 1.6;
|
|
37
|
-
text-align: justify;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
slice-the-build-method code {
|
|
41
|
-
font-family: monospace;
|
|
42
|
-
background-color: var(--secondary-background-color);
|
|
43
|
-
padding: 2px 5px;
|
|
44
|
-
border-radius: 4px;
|
|
45
|
-
font-size: 0.9em;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
slice-the-build-method .syntax-box {
|
|
49
|
-
background-color: var(--secondary-background-color);
|
|
50
|
-
padding: 15px;
|
|
51
|
-
border-radius: var(--border-radius-slice);
|
|
52
|
-
margin: 20px 0;
|
|
53
|
-
overflow-x: auto;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
slice-the-build-method .syntax-box code {
|
|
57
|
-
font-size: 1.1em;
|
|
58
|
-
background: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
slice-the-build-method .parameters-list,
|
|
62
|
-
slice-the-build-method .best-practices-list,
|
|
63
|
-
slice-the-build-method .lifecycle-steps {
|
|
64
|
-
margin-left: 20px;
|
|
65
|
-
margin-bottom: 1.5rem;
|
|
66
|
-
line-height: 1.6;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
slice-the-build-method .parameters-list li,
|
|
70
|
-
slice-the-build-method .best-practices-list li,
|
|
71
|
-
slice-the-build-method .lifecycle-steps li {
|
|
72
|
-
margin-bottom: 0.75rem;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
slice-the-build-method .lifecycle-steps li {
|
|
77
|
-
counter-increment: step-counter;
|
|
78
|
-
position: relative;
|
|
79
|
-
padding-left: 10px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
slice-the-build-method .lifecycle-steps li::before {
|
|
83
|
-
font-weight: bold;
|
|
84
|
-
margin-right: 8px;
|
|
85
|
-
color: var(--primary-color);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
slice-the-build-method .method-examples div[class$="-container"] {
|
|
89
|
-
margin-bottom: 2rem;
|
|
90
|
-
border-radius: var(--border-radius-slice);
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
slice-the-build-method .method-syntax,
|
|
95
|
-
slice-the-build-method .method-examples,
|
|
96
|
-
slice-the-build-method .method-lifecycle,
|
|
97
|
-
slice-the-build-method .method-best-practices {
|
|
98
|
-
margin-bottom: 3rem;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
slice-the-build-method section {
|
|
102
|
-
padding-top: 10px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@media only screen and (max-width: 770px) {
|
|
106
|
-
slice-the-build-method .build-method-container {
|
|
107
|
-
max-width: 100%;
|
|
108
|
-
padding: 10px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
slice-the-build-method h1 {
|
|
112
|
-
font-size: 1.8rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
slice-the-build-method h2 {
|
|
116
|
-
font-size: 1.5rem;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
slice-the-build-method h3 {
|
|
120
|
-
font-size: 1.3rem;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<div class="build-method-container">
|
|
2
|
-
<h1 id="build-method">The Build Method</h1>
|
|
3
|
-
|
|
4
|
-
<section class="method-introduction">
|
|
5
|
-
<p>
|
|
6
|
-
The <code>build</code> method is the cornerstone of Slice.js component creation. It's an asynchronous method that instantiates and configures components, handling all of the necessary resource loading, template attachment, and initialization.
|
|
7
|
-
</p>
|
|
8
|
-
</section>
|
|
9
|
-
|
|
10
|
-
<section class="method-syntax">
|
|
11
|
-
<h2 id="syntax">Syntax</h2>
|
|
12
|
-
<div class="syntax-box">
|
|
13
|
-
<code>await slice.build(componentName, props);</code>
|
|
14
|
-
</div>
|
|
15
|
-
<h3>Parameters</h3>
|
|
16
|
-
<ul class="parameters-list">
|
|
17
|
-
<li><strong>componentName</strong>: <em>string</em> - The name of the component to build as registered in components.js</li>
|
|
18
|
-
<li><strong>props</strong>: <em>object</em> - (Optional) An object containing properties to set on the component</li>
|
|
19
|
-
</ul>
|
|
20
|
-
<h3>Return Value</h3>
|
|
21
|
-
<p>A Promise that resolves to the constructed component instance, or null if construction fails.</p>
|
|
22
|
-
</section>
|
|
23
|
-
|
|
24
|
-
<section class="method-examples">
|
|
25
|
-
<h2 id="examples">Examples</h2>
|
|
26
|
-
|
|
27
|
-
<h3 id="basic-usage">Basic Usage</h3>
|
|
28
|
-
<p>Creating a simple button component and adding it to the DOM:</p>
|
|
29
|
-
<div class="basic-example-container"></div>
|
|
30
|
-
|
|
31
|
-
<h3 id="advanced-props">Advanced Properties</h3>
|
|
32
|
-
<p>Building a component with more complex properties:</p>
|
|
33
|
-
<div class="advanced-example-container"></div>
|
|
34
|
-
|
|
35
|
-
<h3 id="nested-components">Building Nested Components</h3>
|
|
36
|
-
<p>Creating a structure of components that contain other components:</p>
|
|
37
|
-
<div class="nested-components-container"></div>
|
|
38
|
-
|
|
39
|
-
<h3 id="error-handling">Error Handling</h3>
|
|
40
|
-
<p>Proper error handling when building components:</p>
|
|
41
|
-
<div class="error-handling-container"></div>
|
|
42
|
-
</section>
|
|
43
|
-
|
|
44
|
-
<section class="method-lifecycle">
|
|
45
|
-
<h2 id="build-lifecycle">Build Lifecycle</h2>
|
|
46
|
-
<p>When <code>slice.build()</code> is called, the following steps occur:</p>
|
|
47
|
-
<ol class="lifecycle-steps">
|
|
48
|
-
<li>Verify that the component exists in the component registry</li>
|
|
49
|
-
<li>Load the component's template (HTML) if not already cached</li>
|
|
50
|
-
<li>Load the component's class (JS) if not already cached</li>
|
|
51
|
-
<li>Load the component's styles (CSS) if not already cached</li>
|
|
52
|
-
<li>Create an instance of the component with the provided properties</li>
|
|
53
|
-
<li>Call the component's <code>init()</code> method if it exists</li>
|
|
54
|
-
<li>Attach debug mode if enabled in configuration</li>
|
|
55
|
-
<li>Register the component in the controller's active components registry</li>
|
|
56
|
-
<li>Return the fully initialized component instance</li>
|
|
57
|
-
</ol>
|
|
58
|
-
</section>
|
|
59
|
-
|
|
60
|
-
<section class="method-best-practices">
|
|
61
|
-
<h2 id="best-practices">Best Practices</h2>
|
|
62
|
-
<ul class="best-practices-list">
|
|
63
|
-
<li>Always use <code>await</code> with <code>slice.build()</code> since it returns a Promise</li>
|
|
64
|
-
<li>Provide a unique <code>sliceId</code> for components that need to be referenced later</li>
|
|
65
|
-
<li>Implement proper error handling around component building</li>
|
|
66
|
-
<li>Use the component's <code>init()</code> method for additional setup rather than the constructor</li>
|
|
67
|
-
<li>Remember that component properties are set after construction but before initialization</li>
|
|
68
|
-
</ul>
|
|
69
|
-
</section>
|
|
70
|
-
</div>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export default class TheBuildMethod extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
// Crear ejemplos de código para la documentación
|
|
12
|
-
const basicBuildExample = await slice.build('CodeVisualizer', {
|
|
13
|
-
value: `// Construir un componente básico
|
|
14
|
-
const myButton = await slice.build("Button", {
|
|
15
|
-
value: "Click me!"
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Añadir el componente al DOM
|
|
19
|
-
document.querySelector("#container").appendChild(myButton);`,
|
|
20
|
-
language: 'javascript'
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const advancedBuildExample = await slice.build('CodeVisualizer', {
|
|
24
|
-
value: `// Componente con propiedades más avanzadas
|
|
25
|
-
const customCard = await slice.build("Card", {
|
|
26
|
-
title: "Custom Card",
|
|
27
|
-
text: "This is a custom card with specific styling",
|
|
28
|
-
icon: {
|
|
29
|
-
name: "github",
|
|
30
|
-
iconStyle: "filled"
|
|
31
|
-
},
|
|
32
|
-
customColor: {
|
|
33
|
-
card: "#3a0ca3",
|
|
34
|
-
icon: "#f72585"
|
|
35
|
-
},
|
|
36
|
-
sliceId: "my-custom-card" // ID personalizado para referencia futura
|
|
37
|
-
});`,
|
|
38
|
-
language: 'javascript'
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const nestedComponentsExample = await slice.build('CodeVisualizer', {
|
|
42
|
-
value: `// Construcción de componentes anidados
|
|
43
|
-
const grid = await slice.build("Grid", {
|
|
44
|
-
columns: 2,
|
|
45
|
-
rows: 1
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Construir componentes hijos
|
|
49
|
-
const card1 = await slice.build("Card", {
|
|
50
|
-
title: "First Card"
|
|
51
|
-
});
|
|
52
|
-
const card2 = await slice.build("Card", {
|
|
53
|
-
title: "Second Card"
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Añadir componentes hijos al grid
|
|
57
|
-
await grid.setItem(card1);
|
|
58
|
-
await grid.setItem(card2);
|
|
59
|
-
|
|
60
|
-
// Añadir el grid al DOM
|
|
61
|
-
document.body.appendChild(grid);`,
|
|
62
|
-
language: 'javascript'
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const errorHandlingExample = await slice.build('CodeVisualizer', {
|
|
66
|
-
value: `// Manejo de errores al construir componentes
|
|
67
|
-
try {
|
|
68
|
-
const component = await slice.build("NonExistentComponent", {});
|
|
69
|
-
if (!component) {
|
|
70
|
-
console.error("Component could not be built");
|
|
71
|
-
}
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.error("Error building component:", error);
|
|
74
|
-
}`,
|
|
75
|
-
language: 'javascript'
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// Añadir los ejemplos al DOM
|
|
79
|
-
this.querySelector('.basic-example-container').appendChild(basicBuildExample);
|
|
80
|
-
this.querySelector('.advanced-example-container').appendChild(advancedBuildExample);
|
|
81
|
-
this.querySelector('.nested-components-container').appendChild(nestedComponentsExample);
|
|
82
|
-
this.querySelector('.error-handling-container').appendChild(errorHandlingExample);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
customElements.define('slice-the-build-method', TheBuildMethod);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.slice_team {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 2rem;
|
|
6
|
-
margin-top: 80px; /* Ajusta este valor según la altura de tu navbar */
|
|
7
|
-
width: 100%;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.slice_team_title {
|
|
11
|
-
font-size: 2rem;
|
|
12
|
-
color: var(--font-primary-color);
|
|
13
|
-
margin-bottom: 1rem;
|
|
14
|
-
text-align: center;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.slice_team_container {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column; /* Cambiado para que estén en columna */
|
|
20
|
-
align-items: center; /* Centrar las tarjetas */
|
|
21
|
-
gap: 1.5rem;
|
|
22
|
-
width: 100%;
|
|
23
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
export default class TheSliceTeam extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
this.$container = this.querySelector('.slice_team_container');
|
|
7
|
-
this.$title = this.querySelector('.slice_team_title');
|
|
8
|
-
|
|
9
|
-
slice.controller.setComponentProps(this, props);
|
|
10
|
-
this.debuggerProps = ['members'];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async init() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const navBar = await slice.build('Navbar', {
|
|
18
|
-
position: 'fixed',
|
|
19
|
-
logo: {
|
|
20
|
-
src: '/images/Slice.js-logo.png',
|
|
21
|
-
path: '/',
|
|
22
|
-
},
|
|
23
|
-
items: [
|
|
24
|
-
{
|
|
25
|
-
text: 'Home',
|
|
26
|
-
path: '/',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
text: 'Documentation',
|
|
30
|
-
path: '/Documentation',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
text: 'Playground',
|
|
34
|
-
path: '/Playground',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
text: 'Our Team',
|
|
38
|
-
path: '/Team',
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
buttons: [
|
|
43
|
-
{
|
|
44
|
-
value: 'Change Theme',
|
|
45
|
-
// color:
|
|
46
|
-
onClickCallback: async () => {
|
|
47
|
-
|
|
48
|
-
let theme = slice.stylesManager.themeManager.currentTheme;
|
|
49
|
-
if (theme === 'Slice') {
|
|
50
|
-
await slice.setTheme('Light');
|
|
51
|
-
//theme = 'Light';
|
|
52
|
-
} else if (theme === 'Light') {
|
|
53
|
-
await slice.setTheme('Dark');
|
|
54
|
-
//theme = 'Dark';
|
|
55
|
-
} else if (theme === 'Dark') {
|
|
56
|
-
await slice.setTheme('Slice');
|
|
57
|
-
//theme = 'Slice';
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.appendChild(navBar);
|
|
66
|
-
|
|
67
|
-
const Victor = {
|
|
68
|
-
name: "Victor Kneider",
|
|
69
|
-
role: "Founder. Lead Developer. Software Architect.",
|
|
70
|
-
image:"https://avatars.githubusercontent.com/u/103617388?v=4",
|
|
71
|
-
description: "Computer Engineer passionate and ethusiast about technology and Component-Based Development. He is the creator of Slice.js and the main developer of the project.",
|
|
72
|
-
links: [
|
|
73
|
-
{label: "Github", href: "https://github.com/VKneider" },
|
|
74
|
-
{label: "Linkedin", href:"https://www.linkedin.com/in/vkneider/"}
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const Julio = {
|
|
84
|
-
name: "Julio Graterol",
|
|
85
|
-
role: "Frontend Developer. Visual Components Library Creator and Designer",
|
|
86
|
-
image:"https://avatars.githubusercontent.com/u/99130732?v=4",
|
|
87
|
-
//julio is a frontend developer and designer, he is the creator of the visual components library and the designer of the Slice.js logo and website.
|
|
88
|
-
description: "Frontend Developer and Designer. He is the creator of the Visual Components Library and the designer of the Slice.js logo and website.",
|
|
89
|
-
links: [
|
|
90
|
-
{label: "Github", href: "https://github.com/juliograterol"},
|
|
91
|
-
{label: "Linkedin", href:"https://www.linkedin.com/in/julio-graterol-187589289/"}
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const members = [Victor, Julio];
|
|
98
|
-
|
|
99
|
-
await this.addMembers(members);
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async addMembers(members) {
|
|
104
|
-
for (let i = 0; i < members.length; i++) {
|
|
105
|
-
await this.addMember(members[i]);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
async addMember(member) {
|
|
110
|
-
const card = await slice.build('SliceTeamCard', {
|
|
111
|
-
name: member.name,
|
|
112
|
-
role: member.role,
|
|
113
|
-
image: member.image,
|
|
114
|
-
description: member.description,
|
|
115
|
-
links: member.links
|
|
116
|
-
});
|
|
117
|
-
this.$container.appendChild(card);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
get members() {
|
|
121
|
-
return this._members;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
set members(values) {
|
|
125
|
-
this._members = values;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
window.customElements.define('slice-team', TheSliceTeam);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
slice-themesdocumentation {
|
|
2
|
-
color: var(--font-primary-color);
|
|
3
|
-
font-family: var(--font-family);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
slice-themesdocumentation .theme-samples {
|
|
7
|
-
margin: 20px 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
slice-themesdocumentation .theme-sample {
|
|
11
|
-
padding: 20px;
|
|
12
|
-
margin: 10px;
|
|
13
|
-
border-radius: var(--border-radius-slice);
|
|
14
|
-
border: 2px solid;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
20
|
-
transition: transform 0.3s ease;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
slice-themesdocumentation .theme-sample:hover {
|
|
24
|
-
transform: translateY(-5px);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
slice-themesdocumentation .theme-sample h3 {
|
|
28
|
-
margin-top: 0;
|
|
29
|
-
margin-bottom: 15px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
slice-themesdocumentation code {
|
|
33
|
-
background-color: var(--secondary-background-color);
|
|
34
|
-
padding: 2px 5px;
|
|
35
|
-
border-radius: 3px;
|
|
36
|
-
font-family: monospace;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
slice-themesdocumentation .theme-config-example,
|
|
40
|
-
slice-themesdocumentation .theme-apply-example,
|
|
41
|
-
slice-themesdocumentation .css-vars-example,
|
|
42
|
-
slice-themesdocumentation .custom-theme-example {
|
|
43
|
-
margin: 20px 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
slice-themesdocumentation ul li {
|
|
47
|
-
margin-bottom: 10px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
slice-themesdocumentation h2 {
|
|
51
|
-
margin-top: 30px;
|
|
52
|
-
border-bottom: 1px solid var(--primary-color-shade);
|
|
53
|
-
padding-bottom: 8px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
slice-themesdocumentation .theme-transition-example {
|
|
57
|
-
background-color: var(--secondary-background-color);
|
|
58
|
-
padding: 15px;
|
|
59
|
-
border-radius: var(--border-radius-slice);
|
|
60
|
-
margin: 20px 0;
|
|
61
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<h1 id="themes">Themes in Slice.js</h1>
|
|
2
|
-
<p>
|
|
3
|
-
Slice.js includes a powerful theming system that allows you to easily customize the appearance of your entire application.
|
|
4
|
-
Slice.js themes are based on CSS variables that control colors, fonts, borders, and other visual styles.
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<h2 id="theme-system">How the Theme System Works</h2>
|
|
8
|
-
<p>
|
|
9
|
-
The Slice.js theme system uses the ThemeManager, a structural component that manages the application
|
|
10
|
-
and runtime theme switching. Themes are defined as separate CSS files located in the
|
|
11
|
-
<code>/src/Themes/</code> folder.
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<h2 id="default-themes">Default Themes</h2>
|
|
15
|
-
<p>
|
|
16
|
-
Slice.js comes with three built-in themes:
|
|
17
|
-
</p>
|
|
18
|
-
<ul>
|
|
19
|
-
<li><strong>Light</strong>: A light theme with blue as the primary color.</li>
|
|
20
|
-
<li><strong>Dark</strong>: A dark theme that reduces eye strain.</li>
|
|
21
|
-
<li><strong>Slice</strong>: The default Slice.js theme.</li>
|
|
22
|
-
</ul>
|
|
23
|
-
|
|
24
|
-
<div class="theme-samples"></div>
|
|
25
|
-
|
|
26
|
-
<h2 id="theme-configuration">Theme Configuration</h2>
|
|
27
|
-
<p>
|
|
28
|
-
You can configure the theme behavior in the <code>sliceConfig.json</code> file:
|
|
29
|
-
</p>
|
|
30
|
-
<div class="theme-config-example"></div>
|
|
31
|
-
|
|
32
|
-
<p>The configuration options are:</p>
|
|
33
|
-
<ul>
|
|
34
|
-
<li><strong>enabled</strong>: Enables or disables the theme system.</li>
|
|
35
|
-
<li><strong>defaultTheme</strong>: Sets the default theme to be applied when the application starts.</li>
|
|
36
|
-
<li><strong>saveThemeLocally</strong>: If enabled, saves the user's theme preference in localStorage.</li>
|
|
37
|
-
<li><strong>useBrowserTheme</strong>: If enabled, uses the user's system preference (light/dark).</li>
|
|
38
|
-
</ul>
|
|
39
|
-
|
|
40
|
-
<h2 id="using-themes">Changing Themes at Runtime</h2>
|
|
41
|
-
<p>
|
|
42
|
-
Slice.js allows you to change themes dynamically at runtime through its API:
|
|
43
|
-
</p>
|
|
44
|
-
<div class="theme-apply-example"></div>
|
|
45
|
-
|
|
46
|
-
<h2 id="theme-variables">CSS Variables Used in Themes</h2>
|
|
47
|
-
<p>
|
|
48
|
-
Slice.js themes use a consistent set of CSS variables to control appearance.
|
|
49
|
-
These are some of the main variables:
|
|
50
|
-
</p>
|
|
51
|
-
<div class="css-vars-example"></div>
|
|
52
|
-
|
|
53
|
-
<h2 id="custom-themes">Creating Custom Themes</h2>
|
|
54
|
-
<p>
|
|
55
|
-
To create your own custom theme, simply create a new CSS file in the <code>/src/Themes/</code> folder
|
|
56
|
-
and define the necessary CSS variables. For example:
|
|
57
|
-
</p>
|
|
58
|
-
<div class="custom-theme-example"></div>
|
|
59
|
-
|
|
60
|
-
<h2 id="theme-best-practices">Best Practices for Using Themes</h2>
|
|
61
|
-
<p>
|
|
62
|
-
When developing components for Slice.js, follow these practices to ensure they work correctly with the theme system:
|
|
63
|
-
</p>
|
|
64
|
-
<ul>
|
|
65
|
-
<li>Always use the CSS variables defined in the themes instead of hardcoded colors.</li>
|
|
66
|
-
<li>For elements with different states (hover, active, etc.), create CSS rules that respect the theme's color scheme.</li>
|
|
67
|
-
<li>Test your components with different themes to ensure they look good in all of them.</li>
|
|
68
|
-
<li>If your component needs specific styles based on the current theme, you can add classes based on the current theme.</li>
|
|
69
|
-
</ul>
|
|
70
|
-
|
|
71
|
-
<h2 id="theme-transitions">Theme Transitions</h2>
|
|
72
|
-
<p>
|
|
73
|
-
When changing from one theme to another, styles are updated immediately. If you want to add smooth transitions
|
|
74
|
-
when changing themes, you can add CSS transition rules to your elements:
|
|
75
|
-
</p>
|
|
76
|
-
<div class="theme-transition-example">
|
|
77
|
-
<pre><code class="language-css">* {
|
|
78
|
-
transition: background-color 0.3s ease, color 0.3s ease;
|
|
79
|
-
}</code></pre>
|
|
80
|
-
</div>
|