slicejs-web-framework 1.0.19 → 1.0.21
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 -15
- package/src/Components/components.js +2 -24
- package/src/routes.js +4 -86
- 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/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 -296
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.html +0 -89
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.js +0 -86
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -208
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -18
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -111
- 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
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.css +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.html +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.js +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
slice-team-card {
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
max-width: 800px;
|
|
5
|
-
margin: 20px auto;
|
|
6
|
-
font-family: var(--font-family);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.slice_team_card {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
padding: 20px;
|
|
13
|
-
background: var(--primary-background-color);
|
|
14
|
-
border: 1px solid var(--medium-color);
|
|
15
|
-
border-radius: 12px;
|
|
16
|
-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
|
17
|
-
transition: transform 0.3s ease-in-out;
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.slice_team_card:hover {
|
|
22
|
-
transform: scale(1.02);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Imagen circular */
|
|
26
|
-
.team_card_image {
|
|
27
|
-
flex: 0 0 120px;
|
|
28
|
-
height: 120px;
|
|
29
|
-
border-radius: 50%;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
margin-right: 20px;
|
|
32
|
-
display: flex;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
align-items: center;
|
|
35
|
-
background: var(--light-gray);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.team_card_image img {
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
object-fit: cover;
|
|
42
|
-
border-radius: 50%;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Contenido de la tarjeta */
|
|
46
|
-
.team_card_content {
|
|
47
|
-
flex: 1;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.team_card_name {
|
|
51
|
-
margin: 0;
|
|
52
|
-
font-size: 1.5rem;
|
|
53
|
-
font-weight: bold;
|
|
54
|
-
color: var(--font-primary-color);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.team_card_role {
|
|
58
|
-
margin: 5px 0;
|
|
59
|
-
font-size: 1rem;
|
|
60
|
-
color: var(--medium-contrast);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.team_card_description {
|
|
64
|
-
font-size: 0.9rem;
|
|
65
|
-
color: var(--medium-contrast);
|
|
66
|
-
margin-top: 5px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Links */
|
|
70
|
-
.team_card_links {
|
|
71
|
-
margin-top: 10px;
|
|
72
|
-
display: flex;
|
|
73
|
-
gap: 10px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.team_card_links a {
|
|
77
|
-
display: inline-flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
justify-content: center;
|
|
80
|
-
padding: 8px 12px;
|
|
81
|
-
background: var(--primary-color);
|
|
82
|
-
color: var(--primary-color-contrast);
|
|
83
|
-
border-radius: 8px;
|
|
84
|
-
text-decoration: none;
|
|
85
|
-
transition: background 0.3s;
|
|
86
|
-
font-weight: bold;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.team_card_links a:hover {
|
|
90
|
-
background: var(--secondary-color);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Responsive */
|
|
94
|
-
@media (max-width: 600px) {
|
|
95
|
-
.slice_team_card {
|
|
96
|
-
flex-direction: column;
|
|
97
|
-
text-align: center;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.team_card_image {
|
|
101
|
-
margin-bottom: 15px;
|
|
102
|
-
margin-right: 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<div class="slice_team_card">
|
|
2
|
-
<div class="team_card_image">
|
|
3
|
-
<img src="" alt="Profile Image">
|
|
4
|
-
</div>
|
|
5
|
-
<div class="team_card_content">
|
|
6
|
-
<h3 class="team_card_name"></h3>
|
|
7
|
-
<p class="team_card_role"></p>
|
|
8
|
-
<p class="team_card_description"></p>
|
|
9
|
-
<div class="team_card_links"></div>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export default class SliceTeamCard extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
this.$imageContainer = this.querySelector('.team_card_image img');
|
|
7
|
-
this.$name = this.querySelector('.team_card_name');
|
|
8
|
-
this.$role = this.querySelector('.team_card_role');
|
|
9
|
-
this.$description = this.querySelector('.team_card_description');
|
|
10
|
-
this.$links = this.querySelector('.team_card_links');
|
|
11
|
-
|
|
12
|
-
slice.controller.setComponentProps(this, props);
|
|
13
|
-
this.debuggerProps = ['name', 'role', 'image', 'description', 'links'];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
get name() {
|
|
17
|
-
return this._name;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
set name(value) {
|
|
21
|
-
this._name = value;
|
|
22
|
-
if (this.$name) this.$name.textContent = value;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
get role() {
|
|
26
|
-
return this._role;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
set role(value) {
|
|
30
|
-
this._role = value;
|
|
31
|
-
if (this.$role) this.$role.textContent = value;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get image() {
|
|
35
|
-
return this._image;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
set image(value) {
|
|
39
|
-
this._image = value;
|
|
40
|
-
if (this.$imageContainer) {
|
|
41
|
-
this.$imageContainer.src = value;
|
|
42
|
-
this.$imageContainer.alt = value ? `${this._name} profile picture` : 'Profile image';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get description() {
|
|
47
|
-
return this._description;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
set description(value) {
|
|
51
|
-
this._description = value;
|
|
52
|
-
if (this.$description) this.$description.textContent = value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
get links() {
|
|
56
|
-
return this._links;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
set links(values) {
|
|
60
|
-
this._links = values;
|
|
61
|
-
if (this.$links) {
|
|
62
|
-
this.$links.innerHTML = ''; // Limpiar enlaces previos
|
|
63
|
-
values.forEach(link => {
|
|
64
|
-
const a = document.createElement('a');
|
|
65
|
-
a.href = link.href;
|
|
66
|
-
a.textContent = link.label;
|
|
67
|
-
a.target = '_blank';
|
|
68
|
-
this.$links.appendChild(a);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
window.customElements.define('slice-team-card', SliceTeamCard);
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
slice-structuraldocumentation {
|
|
2
|
-
color: var(--font-primary-color);
|
|
3
|
-
font-family: var(--font-family);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
slice-structuraldocumentation h1,
|
|
7
|
-
slice-structuraldocumentation h2,
|
|
8
|
-
slice-structuraldocumentation h3 {
|
|
9
|
-
margin-top: 1.5em;
|
|
10
|
-
margin-bottom: 0.5em;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
slice-structuraldocumentation p {
|
|
14
|
-
line-height: 1.6;
|
|
15
|
-
margin: 1em 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
slice-structuraldocumentation ul,
|
|
19
|
-
slice-structuraldocumentation ol {
|
|
20
|
-
margin: 1em 0;
|
|
21
|
-
padding-left: 2em;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
slice-structuraldocumentation li {
|
|
25
|
-
margin-bottom: 0.5em;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
slice-structuraldocumentation code {
|
|
29
|
-
font-family: monospace;
|
|
30
|
-
background-color: var(--secondary-background-color);
|
|
31
|
-
padding: 0.2em 0.4em;
|
|
32
|
-
border-radius: 3px;
|
|
33
|
-
font-size: 0.9em;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
slice-structuraldocumentation .controller-example,
|
|
37
|
-
slice-structuraldocumentation .router-example,
|
|
38
|
-
slice-structuraldocumentation .styles-manager-example,
|
|
39
|
-
slice-structuraldocumentation .logger-example,
|
|
40
|
-
slice-structuraldocumentation .debugger-example {
|
|
41
|
-
margin: 1.5em 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
slice-structuraldocumentation strong {
|
|
45
|
-
color: var(--primary-color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
slice-structuraldocumentation .faq-section {
|
|
49
|
-
margin: 2em 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
slice-structuraldocumentation .faq-section slice-details {
|
|
53
|
-
margin-bottom: 1em;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
slice-structuraldocumentation h2 {
|
|
57
|
-
border-bottom: 1px solid var(--primary-color-shade);
|
|
58
|
-
padding-bottom: 0.3em;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
slice-structuraldocumentation h3 {
|
|
62
|
-
color: var(--primary-color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
slice-structuraldocumentation .structural-component {
|
|
66
|
-
border-left: 3px solid var(--primary-color);
|
|
67
|
-
padding-left: 1em;
|
|
68
|
-
margin: 2em 0;
|
|
69
|
-
background-color: var(--secondary-background-color);
|
|
70
|
-
border-radius: 0 var(--border-radius-slice) var(--border-radius-slice) 0;
|
|
71
|
-
padding: 0.5em 1em;
|
|
72
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<h1 id="structuralComponents">Structural Components</h1>
|
|
2
|
-
|
|
3
|
-
<p>
|
|
4
|
-
Structural components form the backbone of the Slice.js framework. They provide core functionality like component management, routing, styling, logging, and debugging. Unlike Visual or Service components, Structural components are typically pre-initialized by the framework and accessed through the global <code>slice</code> object.
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<h2 id="controllerComponent">Controller</h2>
|
|
8
|
-
<p>
|
|
9
|
-
The Controller manages all component instances, handles component registration, and provides the <code>build()</code> method for creating new components.
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<h3>Key responsibilities:</h3>
|
|
13
|
-
<ul>
|
|
14
|
-
<li>Component registration and lifecycle management</li>
|
|
15
|
-
<li>Template and class loading</li>
|
|
16
|
-
<li>Component construction and property management</li>
|
|
17
|
-
<li>Component caching and referencing</li>
|
|
18
|
-
</ul>
|
|
19
|
-
|
|
20
|
-
<h3>Developer usage:</h3>
|
|
21
|
-
<div class="controller-example"></div>
|
|
22
|
-
|
|
23
|
-
<h2 id="routerComponent">Router</h2>
|
|
24
|
-
<p>
|
|
25
|
-
The Router handles navigation between different views in your application, supporting both history-based navigation and route parameters.
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
|
-
<h3>Key responsibilities:</h3>
|
|
29
|
-
<ul>
|
|
30
|
-
<li>Route registration and matching</li>
|
|
31
|
-
<li>History management and navigation</li>
|
|
32
|
-
<li>Dynamic route parameters</li>
|
|
33
|
-
<li>Integration with Route and MultiRoute components</li>
|
|
34
|
-
</ul>
|
|
35
|
-
|
|
36
|
-
<h3>Developer usage:</h3>
|
|
37
|
-
<div class="router-example"></div>
|
|
38
|
-
|
|
39
|
-
<h2 id="stylesManagerComponent">StylesManager</h2>
|
|
40
|
-
<p>
|
|
41
|
-
The StylesManager handles global styles and themes, allowing for dynamic theme switching and consistent styling across the application.
|
|
42
|
-
</p>
|
|
43
|
-
|
|
44
|
-
<h3>Key responsibilities:</h3>
|
|
45
|
-
<ul>
|
|
46
|
-
<li>Theme loading and application</li>
|
|
47
|
-
<li>Component style registration</li>
|
|
48
|
-
<li>Global style management</li>
|
|
49
|
-
<li>Theme persistence</li>
|
|
50
|
-
</ul>
|
|
51
|
-
|
|
52
|
-
<h3>Developer usage:</h3>
|
|
53
|
-
<div class="styles-manager-example"></div>
|
|
54
|
-
|
|
55
|
-
<h2 id="loggerComponent">Logger</h2>
|
|
56
|
-
<p>
|
|
57
|
-
The Logger provides a consistent way to log information, warnings, and errors throughout your application.
|
|
58
|
-
</p>
|
|
59
|
-
|
|
60
|
-
<h3>Key responsibilities:</h3>
|
|
61
|
-
<ul>
|
|
62
|
-
<li>Error, warning, and info logging</li>
|
|
63
|
-
<li>Log filtering and retrieval</li>
|
|
64
|
-
<li>Structured logging with component context</li>
|
|
65
|
-
<li>Configurable output channels</li>
|
|
66
|
-
</ul>
|
|
67
|
-
|
|
68
|
-
<h3>Developer usage:</h3>
|
|
69
|
-
<div class="logger-example"></div>
|
|
70
|
-
|
|
71
|
-
<h2 id="debuggerComponent">Debugger</h2>
|
|
72
|
-
<p>
|
|
73
|
-
The Debugger provides development tools for inspecting and manipulating components at runtime.
|
|
74
|
-
</p>
|
|
75
|
-
|
|
76
|
-
<h3>Key responsibilities:</h3>
|
|
77
|
-
<ul>
|
|
78
|
-
<li>Component property inspection</li>
|
|
79
|
-
<li>Live property editing</li>
|
|
80
|
-
<li>Debugging interface</li>
|
|
81
|
-
</ul>
|
|
82
|
-
|
|
83
|
-
<h3>Developer usage:</h3>
|
|
84
|
-
<div class="debugger-example"></div>
|
|
85
|
-
|
|
86
|
-
<h2 id="structuralComponentsConfig">Configuration</h2>
|
|
87
|
-
<p>
|
|
88
|
-
Structural components are primarily configured through the <code>sliceConfig.json</code> file at the root of your project. This allows you to:
|
|
89
|
-
</p>
|
|
90
|
-
<ul>
|
|
91
|
-
<li>Enable or disable specific features</li>
|
|
92
|
-
<li>Set default options and behaviors</li>
|
|
93
|
-
<li>Configure paths and resource locations</li>
|
|
94
|
-
<li>Control logging, debugging, and theming behavior</li>
|
|
95
|
-
</ul>
|
|
96
|
-
|
|
97
|
-
<h2 id="structuralComponentsFaq">Frequently Asked Questions</h2>
|
|
98
|
-
<div class="faq-section"></div>
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
export default class StructuralDocumentation 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
|
-
// Controller documentation section
|
|
12
|
-
const controllerExample = await slice.build("CodeVisualizer", {
|
|
13
|
-
value: `// Accessing components through the Controller
|
|
14
|
-
// Get a reference to a component by its sliceId
|
|
15
|
-
const navbar = slice.controller.getComponent("main-navbar");
|
|
16
|
-
|
|
17
|
-
// Check if a component is registered
|
|
18
|
-
if (slice.controller.activeComponents.has("user-profile")) {
|
|
19
|
-
// Component exists
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Get all active components
|
|
23
|
-
const allComponents = slice.controller.activeComponents;
|
|
24
|
-
|
|
25
|
-
// Register a component manually (rarely needed)
|
|
26
|
-
slice.controller.registerComponent(myComponent);
|
|
27
|
-
|
|
28
|
-
// Build a component with Controller
|
|
29
|
-
const myButton = await slice.build("Button", {
|
|
30
|
-
value: "Click Me",
|
|
31
|
-
sliceId: "my-unique-button-id"
|
|
32
|
-
});`,
|
|
33
|
-
language: "javascript"
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
this.querySelector(".controller-example").appendChild(controllerExample);
|
|
37
|
-
|
|
38
|
-
// Router documentation section
|
|
39
|
-
const routerExample = await slice.build("CodeVisualizer", {
|
|
40
|
-
value: `// Declaring routes in routes.js
|
|
41
|
-
const routes = [
|
|
42
|
-
{ path: "/", component: "LandingPage" },
|
|
43
|
-
{ path: "/documentation", component: "DocumentationPage" },
|
|
44
|
-
{
|
|
45
|
-
path: "/user/$id", // Dynamic route parameter
|
|
46
|
-
component: "UserProfile"
|
|
47
|
-
},
|
|
48
|
-
{ path: "/404", component: "NotFound" }
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
export default routes;
|
|
52
|
-
|
|
53
|
-
// Navigating with Router in your components
|
|
54
|
-
// Navigate programmatically
|
|
55
|
-
await slice.router.navigate("/documentation");
|
|
56
|
-
|
|
57
|
-
// Get current route information
|
|
58
|
-
const currentRoute = slice.router.activeRoute;
|
|
59
|
-
|
|
60
|
-
// Create a Route component in your HTML
|
|
61
|
-
const routeComponent = await slice.build("Route", {
|
|
62
|
-
path: "/documentation",
|
|
63
|
-
component: "DocumentationPage"
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// Create a MultiRoute component for multiple routes
|
|
67
|
-
const multiRouteComponent = await slice.build("MultiRoute", {
|
|
68
|
-
routes: [
|
|
69
|
-
{ path: "/docs/visual", component: "VisualDocumentation" },
|
|
70
|
-
{ path: "/docs/service", component: "ServiceDocumentation" }
|
|
71
|
-
]
|
|
72
|
-
});`,
|
|
73
|
-
language: "javascript"
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
this.querySelector(".router-example").appendChild(routerExample);
|
|
77
|
-
|
|
78
|
-
// StylesManager documentation section
|
|
79
|
-
const stylesManagerExample = await slice.build("CodeVisualizer", {
|
|
80
|
-
value: `// Configuring themes in sliceConfig.json
|
|
81
|
-
{
|
|
82
|
-
"themeManager": {
|
|
83
|
-
"enabled": true,
|
|
84
|
-
"defaultTheme": "Light",
|
|
85
|
-
"saveThemeLocally": true,
|
|
86
|
-
"useBrowserTheme": false
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Theme file structure (e.g., Light.css)
|
|
91
|
-
:root {
|
|
92
|
-
--font-primary-color: #000;
|
|
93
|
-
--primary-color: #0066ff;
|
|
94
|
-
--primary-background-color: #fff;
|
|
95
|
-
// ...more theme variables
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Switching themes in your components
|
|
99
|
-
// Change the current theme
|
|
100
|
-
await slice.setTheme("Dark");
|
|
101
|
-
|
|
102
|
-
// Get the current theme
|
|
103
|
-
const currentTheme = slice.theme;
|
|
104
|
-
|
|
105
|
-
// Access StylesManager directly (rarely needed)
|
|
106
|
-
slice.stylesManager.appendComponentStyles(".my-custom-style { color: red; }");`,
|
|
107
|
-
language: "javascript"
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
this.querySelector(".styles-manager-example").appendChild(stylesManagerExample);
|
|
111
|
-
|
|
112
|
-
// Logger documentation section
|
|
113
|
-
const loggerExample = await slice.build("CodeVisualizer", {
|
|
114
|
-
value: `// Configuring logger in sliceConfig.json
|
|
115
|
-
{
|
|
116
|
-
"logger": {
|
|
117
|
-
"enabled": true,
|
|
118
|
-
"showLogs": {
|
|
119
|
-
"console": {
|
|
120
|
-
"error": true,
|
|
121
|
-
"warning": true,
|
|
122
|
-
"info": false
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Using Logger in your components
|
|
129
|
-
// Log an error
|
|
130
|
-
slice.logger.logError("MyComponent", "Failed to load data", error);
|
|
131
|
-
|
|
132
|
-
// Log a warning
|
|
133
|
-
slice.logger.logWarning("MyComponent", "Data partially loaded");
|
|
134
|
-
|
|
135
|
-
// Log information
|
|
136
|
-
slice.logger.logInfo("MyComponent", "Component initialized");
|
|
137
|
-
|
|
138
|
-
// Get all logs
|
|
139
|
-
const allLogs = slice.logger.getLogs();
|
|
140
|
-
|
|
141
|
-
// Get logs by type
|
|
142
|
-
const errorLogs = slice.logger.getLogsByLogType("error");
|
|
143
|
-
|
|
144
|
-
// Get logs for a specific component
|
|
145
|
-
const componentLogs = slice.logger.getLogsByComponent("my-component");
|
|
146
|
-
|
|
147
|
-
// Clear logs
|
|
148
|
-
slice.logger.clearLogs();`,
|
|
149
|
-
language: "javascript"
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
this.querySelector(".logger-example").appendChild(loggerExample);
|
|
153
|
-
|
|
154
|
-
// Debugger documentation section
|
|
155
|
-
const debuggerExample = await slice.build("CodeVisualizer", {
|
|
156
|
-
value: `// Configuring debugger in sliceConfig.json
|
|
157
|
-
{
|
|
158
|
-
"debugger": {
|
|
159
|
-
"enabled": true,
|
|
160
|
-
"click": "right" // "right" for right-click, "left" for left-click
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Defining debug properties in components
|
|
165
|
-
export default class MyComponent extends HTMLElement {
|
|
166
|
-
constructor(props) {
|
|
167
|
-
super();
|
|
168
|
-
slice.attachTemplate(this);
|
|
169
|
-
|
|
170
|
-
slice.controller.setComponentProps(this, props);
|
|
171
|
-
// Specify which properties can be inspected in the debugger
|
|
172
|
-
this.debuggerProps = ["value", "color", "isActive", "items"];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// ...rest of component code
|
|
176
|
-
}`,
|
|
177
|
-
language: "javascript"
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
this.querySelector(".debugger-example").appendChild(debuggerExample);
|
|
181
|
-
|
|
182
|
-
// FAQ section
|
|
183
|
-
const faqQuestions = [
|
|
184
|
-
{
|
|
185
|
-
title: "Can I create my own structural components?",
|
|
186
|
-
text: "No. Structural components are part of the core Slice.js framework and are not meant to be created or modified by users."
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
title: "How do I configure structural components?",
|
|
190
|
-
text: "Most structural components are configured through the sliceConfig.json file in your project root. This file allows you to enable/disable features and set various configuration options for each structural component."
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
title: "How are structural components initialized?",
|
|
194
|
-
text: "Structural components are automatically initialized during the Slice.js bootstrap process in Slice.js. The initialization sequence is controlled by the Slice.js core and ensures components are loaded in the correct order to resolve dependencies."
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
title: "Can I access structural components directly?",
|
|
198
|
-
text: "Yes, most structural components are accessible through the global slice object, such as slice.controller, slice.router, slice.logger, etc. However, direct manipulation should be done carefully and only when necessary."
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
title: "How do I extend the Router for advanced functionality?",
|
|
202
|
-
text: "For advanced routing needs, you can implement route guards or middleware by extending the existing Router through service components. Create a custom RouterService that wraps the structural Router and adds your custom logic for route authorization, data prefetching, or analytics tracking."
|
|
203
|
-
}
|
|
204
|
-
];
|
|
205
|
-
|
|
206
|
-
const faqContainer = this.querySelector(".faq-section");
|
|
207
|
-
|
|
208
|
-
for (const question of faqQuestions) {
|
|
209
|
-
const detailsComponent = await slice.build("Details", {
|
|
210
|
-
title: question.title,
|
|
211
|
-
text: question.text
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
faqContainer.appendChild(detailsComponent);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
customElements.define("slice-structuraldocumentation", StructuralDocumentation);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.switchs {
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
}
|
|
8
|
-
.labelSwitch {
|
|
9
|
-
display: grid;
|
|
10
|
-
align-items: end;
|
|
11
|
-
grid-template-columns: repeat(2, 1fr);
|
|
12
|
-
grid-template-rows: repeat(1, 1fr);
|
|
13
|
-
gap: 10px;
|
|
14
|
-
margin: 0 auto;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@media only screen and (max-width: 770px) {
|
|
18
|
-
.labelSwitch {
|
|
19
|
-
grid-template-columns: repeat(1, 1fr);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<h1 id="sliceSwitch">Slice Switch</h1>
|
|
2
|
-
<div class="mySwitch">
|
|
3
|
-
<p>This is a Slice Switch.</p>
|
|
4
|
-
</div>
|
|
5
|
-
<div class="colorSwitch">
|
|
6
|
-
<h2 id="customColor">Custom color</h2>
|
|
7
|
-
<p>
|
|
8
|
-
You cand customize your Slice Switch by changing it's color with the color
|
|
9
|
-
prop
|
|
10
|
-
</p>
|
|
11
|
-
</div>
|
|
12
|
-
<h1 id="label">Label</h1>
|
|
13
|
-
<div class="label">
|
|
14
|
-
<p>You can set a label to your switch.</p>
|
|
15
|
-
</div>
|
|
16
|
-
<h2 id="labelPlacement">Label Placement</h2>
|
|
17
|
-
<p>You can also set in wich position to put the label to.</p>
|
|
18
|
-
<div class="labelSwitch">
|
|
19
|
-
<div class="labelLeft">
|
|
20
|
-
<h2>Left</h2>
|
|
21
|
-
<p>This label is positioned at left.</p>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="labelTop">
|
|
24
|
-
<h2>Top</h2>
|
|
25
|
-
<p>This label is positioned at top.</p>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="labelRight">
|
|
28
|
-
<h2>Right (default)</h2>
|
|
29
|
-
<p>This label is positioned at right.</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="labelBottom">
|
|
32
|
-
<h2>Bottom</h2>
|
|
33
|
-
<p>This label is positioned at bottom.</p>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|