slicejs-web-framework 1.0.16 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-web-framework",
3
- "version": "1.0.16",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -15,7 +15,7 @@ export default class DocumentationPage extends HTMLElement {
15
15
  items: [
16
16
  {
17
17
  title: 'What is Slice.js?',
18
- path: '/Documentation/What-is-Slice.js',
18
+ path: '/Documentation/Slice',
19
19
  component: 'WhatIsSlice'
20
20
  },
21
21
  {
@@ -0,0 +1,185 @@
1
+ slice-installation {
2
+ font-family: var(--font-family);
3
+ color: var(--font-primary-color);
4
+ }
5
+
6
+ slice-installation .installation-container {
7
+ width: 100%;
8
+ max-width: 800px;
9
+ margin: 0 auto;
10
+ padding: 20px;
11
+ }
12
+
13
+ slice-installation h1 {
14
+ color: var(--primary-color);
15
+ margin-bottom: 30px;
16
+ }
17
+
18
+ slice-installation h2 {
19
+ color: var(--primary-color);
20
+ margin: 30px 0 15px 0;
21
+ padding-bottom: 8px;
22
+ border-bottom: 1px solid var(--secondary-background-color);
23
+ }
24
+
25
+ slice-installation .installation-intro {
26
+ font-size: 1.1em;
27
+ line-height: 1.6;
28
+ margin-bottom: 30px;
29
+ }
30
+
31
+ slice-installation .installation-step {
32
+ margin-bottom: 40px;
33
+ padding: 20px;
34
+ background-color: var(--secondary-background-color);
35
+ border-radius: var(--border-radius-slice);
36
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
37
+ }
38
+
39
+ slice-installation .installation-step-code {
40
+ position: relative;
41
+ margin: 15px 0;
42
+ background-color: var(--primary-background-color);
43
+ border-radius: var(--border-radius-slice);
44
+ border: 1px solid var(--primary-color-shade);
45
+ overflow: hidden;
46
+ }
47
+
48
+ slice-installation pre {
49
+ margin: 0;
50
+ padding: 15px;
51
+ overflow-x: auto;
52
+ }
53
+
54
+ slice-installation code {
55
+ font-family: 'Courier New', monospace;
56
+ color: var(--font-primary-color);
57
+ }
58
+
59
+ slice-installation .copy-button {
60
+ position: absolute;
61
+ top: 5px;
62
+ right: 5px;
63
+ background-color: var(--primary-color);
64
+ color: var(--primary-color-contrast);
65
+ border: none;
66
+ border-radius: var(--border-radius-slice);
67
+ padding: 5px 10px;
68
+ cursor: pointer;
69
+ font-size: 0.8em;
70
+ transition: all 0.3s ease;
71
+ }
72
+
73
+ slice-installation .copy-button:hover {
74
+ background-color: var(--secondary-color);
75
+ }
76
+
77
+ slice-installation .terminal {
78
+ background-color: #1e1e1e;
79
+ border-radius: var(--border-radius-slice);
80
+ margin: 15px 0;
81
+ overflow: hidden;
82
+ }
83
+
84
+ slice-installation .terminal-header {
85
+ background-color: #323232;
86
+ padding: 8px 15px;
87
+ display: flex;
88
+ align-items: center;
89
+ }
90
+
91
+ slice-installation .terminal-dot {
92
+ height: 12px;
93
+ width: 12px;
94
+ border-radius: 50%;
95
+ margin-right: 6px;
96
+ }
97
+
98
+ slice-installation .red {
99
+ background-color: #ff5f56;
100
+ }
101
+
102
+ slice-installation .yellow {
103
+ background-color: #ffbd2e;
104
+ }
105
+
106
+ slice-installation .green {
107
+ background-color: #27c93f;
108
+ }
109
+
110
+ slice-installation .terminal-title {
111
+ color: #cccccc;
112
+ margin-left: 10px;
113
+ font-size: 0.9em;
114
+ }
115
+
116
+ slice-installation .terminal-content {
117
+ padding: 15px;
118
+ color: #f8f8f2;
119
+ font-family: 'Courier New', monospace;
120
+ font-size: 0.9em;
121
+ line-height: 1.5;
122
+ min-height: 60px;
123
+ }
124
+
125
+ slice-installation .terminal-output {
126
+ white-space: pre-wrap;
127
+ }
128
+
129
+ slice-installation .note {
130
+ font-size: 0.9em;
131
+ font-style: italic;
132
+ color: var(--font-secondary-color);
133
+ margin-top: 10px;
134
+ }
135
+
136
+ slice-installation .installation-next-steps {
137
+ margin-top: 40px;
138
+ padding: 20px;
139
+ background-color: var(--primary-background-color);
140
+ border: 1px solid var(--primary-color);
141
+ border-radius: var(--border-radius-slice);
142
+ }
143
+
144
+ slice-installation .installation-next-steps ul {
145
+ list-style-type: none;
146
+ padding-left: 0;
147
+ }
148
+
149
+ slice-installation .installation-next-steps li {
150
+ margin-bottom: 10px;
151
+ padding-left: 24px;
152
+ position: relative;
153
+ }
154
+
155
+ slice-installation .installation-next-steps li:before {
156
+ content: "→";
157
+ position: absolute;
158
+ left: 0;
159
+ color: var(--primary-color);
160
+ }
161
+
162
+ slice-installation .installation-next-steps code {
163
+ background-color: var(--secondary-background-color);
164
+ padding: 2px 6px;
165
+ border-radius: 3px;
166
+ }
167
+
168
+ @media only screen and (max-width: 770px) {
169
+ slice-installation .installation-container {
170
+ padding: 10px;
171
+ }
172
+
173
+ slice-installation .installation-step {
174
+ padding: 15px;
175
+ }
176
+
177
+ slice-installation pre {
178
+ padding: 10px;
179
+ font-size: 0.9em;
180
+ }
181
+
182
+ slice-installation .terminal-content {
183
+ font-size: 0.8em;
184
+ }
185
+ }
@@ -0,0 +1,102 @@
1
+ <div class="installation-container">
2
+ <h1 id="installation-title">Installation Guide</h1>
3
+
4
+ <p class="installation-intro">
5
+ Getting started with Slice.js is easy! Follow these simple steps to create your first Slice.js project:
6
+ </p>
7
+
8
+ <div class="installation-steps">
9
+ <div class="installation-step">
10
+ <h2 id="step1">Step 1: Initialize your project</h2>
11
+ <p>First, create a new directory for your project and initialize it with npm:</p>
12
+ <div class="installation-step-code">
13
+ <pre><code>npm init</code></pre>
14
+ <button class="copy-button">Copy</button>
15
+ </div>
16
+ <div class="terminal">
17
+ <div class="terminal-header">
18
+ <span class="terminal-dot red"></span>
19
+ <span class="terminal-dot yellow"></span>
20
+ <span class="terminal-dot green"></span>
21
+ <span class="terminal-title">Terminal</span>
22
+ </div>
23
+ <div class="terminal-content">
24
+ <div class="terminal-output">Follow the prompts to set up your package.json file. You can press Enter to accept the default values or customize as needed.</div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="installation-step">
30
+ <h2 id="step2">Step 2: Install Slice.js CLI</h2>
31
+ <p>Next, install the Slice.js CLI tool which will help you create components and manage your project:</p>
32
+ <div class="installation-step-code">
33
+ <pre><code>npm i slicejs-cli</code></pre>
34
+ <button class="copy-button">Copy</button>
35
+ </div>
36
+ <div class="terminal">
37
+ <div class="terminal-header">
38
+ <span class="terminal-dot red"></span>
39
+ <span class="terminal-dot yellow"></span>
40
+ <span class="terminal-dot green"></span>
41
+ <span class="terminal-title">Terminal</span>
42
+ </div>
43
+ <div class="terminal-content">
44
+ <div class="terminal-output">added X packages, and audited Y packages in Zs</div>
45
+ </div>
46
+ </div>
47
+ </div>
48
+
49
+ <div class="installation-step">
50
+ <h2 id="step3">Step 3: Initialize Slice.js</h2>
51
+ <p>Initialize the Slice.js folder structure in your project:</p>
52
+ <div class="installation-step-code">
53
+ <pre><code>npm run slice:init</code></pre>
54
+ <button class="copy-button">Copy</button>
55
+ </div>
56
+ <div class="terminal">
57
+ <div class="terminal-header">
58
+ <span class="terminal-dot red"></span>
59
+ <span class="terminal-dot yellow"></span>
60
+ <span class="terminal-dot green"></span>
61
+ <span class="terminal-title">Terminal</span>
62
+ </div>
63
+ <div class="terminal-content">
64
+ <div class="terminal-output">Creating folder structure...
65
+ Slice framework initialized successfully!</div>
66
+ </div>
67
+ </div>
68
+ <p class="note">This command creates the necessary folder structure for your Slice.js project, including directories for components, styles, and themes.</p>
69
+ </div>
70
+
71
+ <div class="installation-step">
72
+ <h2 id="step4">Step 4: Start the Server</h2>
73
+ <p>Finally, start the development server to see your Slice.js application in action:</p>
74
+ <div class="installation-step-code">
75
+ <pre><code>npm run slice:start</code></pre>
76
+ <button class="copy-button">Copy</button>
77
+ </div>
78
+ <div class="terminal">
79
+ <div class="terminal-header">
80
+ <span class="terminal-dot red"></span>
81
+ <span class="terminal-dot yellow"></span>
82
+ <span class="terminal-dot green"></span>
83
+ <span class="terminal-title">Terminal</span>
84
+ </div>
85
+ <div class="terminal-content">
86
+ <div class="terminal-output">Server is running on port 3001, http://localhost:3001</div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+
92
+ <div class="installation-next-steps">
93
+ <h2 id="next-steps">Next Steps</h2>
94
+ <p>Congratulations! You've successfully set up your Slice.js project. Here's what you can do next:</p>
95
+ <ul>
96
+ <li>Explore the documentation to learn about components</li>
97
+ <li>Create your first component with <code>npm run slice:create</code></li>
98
+ <li>Check out the built-in Visual components library</li>
99
+ <li>Build your application by adding routes and services</li>
100
+ </ul>
101
+ </div>
102
+ </div>
@@ -0,0 +1,61 @@
1
+ export default class Installation 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
+ // Add code for installation steps visualization
12
+
13
+ // Get all code blocks with copy buttons
14
+ const codeBlocks = this.querySelectorAll('.installation-step-code');
15
+
16
+ // Add copy functionality to each code block
17
+ codeBlocks.forEach(block => {
18
+ const copyButton = block.querySelector('.copy-button');
19
+ const codeText = block.querySelector('code');
20
+
21
+ copyButton.addEventListener('click', () => {
22
+ navigator.clipboard.writeText(codeText.textContent.trim());
23
+ copyButton.textContent = 'Copied!';
24
+
25
+ setTimeout(() => {
26
+ copyButton.textContent = 'Copy';
27
+ }, 2000);
28
+ });
29
+ });
30
+
31
+ // Add animation for terminal output
32
+ const terminals = this.querySelectorAll('.terminal-output');
33
+ terminals.forEach(terminal => {
34
+ const text = terminal.textContent;
35
+ terminal.textContent = '';
36
+ let i = 0;
37
+
38
+ const typeEffect = () => {
39
+ if (i < text.length) {
40
+ terminal.textContent += text.charAt(i);
41
+ i++;
42
+ setTimeout(typeEffect, 10);
43
+ }
44
+ };
45
+
46
+ // Start the typing effect when element is in view
47
+ const observer = new IntersectionObserver(entries => {
48
+ entries.forEach(entry => {
49
+ if (entry.isIntersecting) {
50
+ typeEffect();
51
+ observer.unobserve(entry.target);
52
+ }
53
+ });
54
+ });
55
+
56
+ observer.observe(terminal);
57
+ });
58
+ }
59
+ }
60
+
61
+ customElements.define('slice-installation', Installation);
@@ -1,6 +1,7 @@
1
1
  slice-the-build-method {
2
2
  font-family: var(--font-family);
3
3
  color: var(--font-primary-color);
4
+ display: block;
4
5
  }
5
6
 
6
7
  slice-the-build-method .build-method-container {
@@ -9,107 +10,266 @@ slice-the-build-method .build-method-container {
9
10
  padding: 20px;
10
11
  }
11
12
 
13
+ slice-the-build-method .build-method-header {
14
+ display: flex;
15
+ align-items: center;
16
+ margin-bottom: 1.5rem;
17
+ }
18
+
12
19
  slice-the-build-method h1 {
13
20
  font-size: 2.2rem;
14
- margin-bottom: 1.5rem;
15
21
  color: var(--primary-color);
16
22
  border-bottom: 2px solid var(--secondary-background-color);
17
23
  padding-bottom: 0.5rem;
24
+ margin-right: 1rem;
25
+ margin-bottom: 0;
26
+ flex-grow: 1;
27
+ }
28
+
29
+ slice-the-build-method .build-method-badge {
30
+ background-color: var(--primary-color);
31
+ color: var(--primary-color-contrast);
32
+ padding: 6px 12px;
33
+ border-radius: 20px;
34
+ font-size: 0.9rem;
35
+ font-weight: bold;
18
36
  }
19
37
 
20
38
  slice-the-build-method h2 {
21
39
  font-size: 1.8rem;
22
- margin-top: 2rem;
23
- margin-bottom: 1rem;
40
+ margin-top: 2.5rem;
41
+ margin-bottom: 1.2rem;
24
42
  color: var(--primary-color);
43
+ position: relative;
44
+ padding-left: 1rem;
45
+ }
46
+
47
+ slice-the-build-method h2:before {
48
+ content: "";
49
+ position: absolute;
50
+ left: 0;
51
+ height: 100%;
52
+ width: 4px;
53
+ background-color: var(--primary-color);
54
+ border-radius: 4px;
25
55
  }
26
56
 
27
57
  slice-the-build-method h3 {
28
58
  font-size: 1.5rem;
29
- margin-top: 1.5rem;
30
- margin-bottom: 0.75rem;
59
+ margin-top: 1.8rem;
60
+ margin-bottom: 1rem;
31
61
  color: var(--font-primary-color);
32
62
  }
33
63
 
34
64
  slice-the-build-method p {
35
- margin-bottom: 1rem;
36
- line-height: 1.6;
65
+ margin-bottom: 1.2rem;
66
+ line-height: 1.7;
37
67
  text-align: justify;
68
+ font-size: 1.05rem;
38
69
  }
39
70
 
40
71
  slice-the-build-method code {
41
72
  font-family: monospace;
42
73
  background-color: var(--secondary-background-color);
43
- padding: 2px 5px;
74
+ padding: 3px 6px;
44
75
  border-radius: 4px;
45
- font-size: 0.9em;
76
+ font-size: 0.95em;
77
+ color: var(--primary-color);
46
78
  }
47
79
 
48
80
  slice-the-build-method .syntax-box {
49
81
  background-color: var(--secondary-background-color);
50
- padding: 15px;
82
+ padding: 20px;
51
83
  border-radius: var(--border-radius-slice);
52
84
  margin: 20px 0;
53
85
  overflow-x: auto;
86
+ border-left: 4px solid var(--primary-color);
87
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
88
+ transition: transform 0.2s ease;
89
+ }
90
+
91
+ slice-the-build-method .syntax-box:hover {
92
+ transform: translateY(-2px);
54
93
  }
55
94
 
56
95
  slice-the-build-method .syntax-box code {
57
- font-size: 1.1em;
96
+ font-size: 1.2em;
58
97
  background: none;
59
98
  }
60
99
 
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;
100
+ slice-the-build-method .parameters-section,
101
+ slice-the-build-method .return-section {
102
+ background-color: var(--primary-background-color);
103
+ padding: 15px 20px;
104
+ border-radius: var(--border-radius-slice);
105
+ margin: 15px 0;
106
+ border: 1px solid var(--secondary-background-color);
67
107
  }
68
108
 
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;
109
+ slice-the-build-method .parameters-list {
110
+ list-style: none;
111
+ margin: 0;
112
+ padding: 0;
73
113
  }
74
114
 
115
+ slice-the-build-method .parameters-list li {
116
+ display: grid;
117
+ grid-template-columns: 1fr 1fr 3fr;
118
+ gap: 15px;
119
+ margin-bottom: 12px;
120
+ padding-bottom: 12px;
121
+ border-bottom: 1px solid var(--secondary-background-color);
122
+ }
75
123
 
76
- slice-the-build-method .lifecycle-steps li {
77
- counter-increment: step-counter;
78
- position: relative;
79
- padding-left: 10px;
124
+ slice-the-build-method .parameters-list li:last-child {
125
+ border-bottom: none;
126
+ margin-bottom: 0;
127
+ padding-bottom: 0;
80
128
  }
81
129
 
82
- slice-the-build-method .lifecycle-steps li::before {
130
+ slice-the-build-method .param-name {
83
131
  font-weight: bold;
84
- margin-right: 8px;
132
+ color: var(--primary-color);
133
+ }
134
+
135
+ slice-the-build-method .param-type {
136
+ font-style: italic;
137
+ color: var(--font-secondary-color);
138
+ }
139
+
140
+ slice-the-build-method .example-card {
141
+ background-color: var(--primary-background-color);
142
+ border-radius: var(--border-radius-slice);
143
+ padding: 20px;
144
+ margin-bottom: 30px;
145
+ border: 1px solid var(--secondary-background-color);
146
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
147
+ transition: box-shadow 0.3s ease;
148
+ }
149
+
150
+ slice-the-build-method .example-card:hover {
151
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
152
+ }
153
+
154
+ slice-the-build-method .example-card h3 {
155
+ margin-top: 0;
85
156
  color: var(--primary-color);
86
157
  }
87
158
 
88
159
  slice-the-build-method .method-examples div[class$="-container"] {
89
- margin-bottom: 2rem;
160
+ margin-top: 1rem;
90
161
  border-radius: var(--border-radius-slice);
91
162
  overflow: hidden;
92
163
  }
93
164
 
165
+ slice-the-build-method .lifecycle-diagram {
166
+ background-color: var(--primary-background-color);
167
+ border-radius: var(--border-radius-slice);
168
+ padding: 20px;
169
+ border: 1px solid var(--secondary-background-color);
170
+ }
171
+
172
+ slice-the-build-method .lifecycle-steps {
173
+ list-style: none;
174
+ margin: 0;
175
+ padding: 0;
176
+ }
177
+
178
+ slice-the-build-method .lifecycle-steps li {
179
+ display: flex;
180
+ align-items: center;
181
+ margin-bottom: 15px;
182
+ padding-bottom: 15px;
183
+ border-bottom: 1px dashed var(--secondary-background-color);
184
+ }
185
+
186
+ slice-the-build-method .lifecycle-steps li:last-child {
187
+ margin-bottom: 0;
188
+ padding-bottom: 0;
189
+ border-bottom: none;
190
+ }
191
+
192
+ slice-the-build-method .step-number {
193
+ display: flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ width: 30px;
197
+ height: 30px;
198
+ background-color: var(--primary-color);
199
+ color: var(--primary-color-contrast);
200
+ border-radius: 50%;
201
+ margin-right: 15px;
202
+ font-weight: bold;
203
+ flex-shrink: 0;
204
+ }
205
+
206
+ slice-the-build-method .step-content {
207
+ flex-grow: 1;
208
+ line-height: 1.5;
209
+ }
210
+
211
+ slice-the-build-method .best-practices-container {
212
+ background-color: var(--primary-background-color);
213
+ border-radius: var(--border-radius-slice);
214
+ padding: 20px;
215
+ border: 1px solid var(--secondary-background-color);
216
+ }
217
+
218
+ slice-the-build-method .best-practices-list {
219
+ list-style: none;
220
+ margin: 0;
221
+ padding: 0;
222
+ }
223
+
224
+ slice-the-build-method .best-practices-list li {
225
+ display: flex;
226
+ align-items: flex-start;
227
+ margin-bottom: 15px;
228
+ line-height: 1.6;
229
+ }
230
+
231
+ slice-the-build-method .best-practices-list li:last-child {
232
+ margin-bottom: 0;
233
+ }
234
+
235
+ slice-the-build-method .practice-icon {
236
+ display: inline-block;
237
+ margin-right: 10px;
238
+ color: var(--success-color);
239
+ font-weight: bold;
240
+ font-size: 1.2rem;
241
+ }
242
+
243
+ slice-the-build-method .method-introduction,
94
244
  slice-the-build-method .method-syntax,
95
245
  slice-the-build-method .method-examples,
96
246
  slice-the-build-method .method-lifecycle,
97
247
  slice-the-build-method .method-best-practices {
98
- margin-bottom: 3rem;
248
+ margin-bottom: 3.5rem;
99
249
  }
100
250
 
101
251
  slice-the-build-method section {
102
- padding-top: 10px;
252
+ padding-top: 15px;
103
253
  }
104
254
 
105
255
  @media only screen and (max-width: 770px) {
106
256
  slice-the-build-method .build-method-container {
107
257
  max-width: 100%;
108
- padding: 10px;
258
+ padding: 15px;
259
+ }
260
+
261
+ slice-the-build-method .build-method-header {
262
+ flex-direction: column;
263
+ align-items: flex-start;
264
+ }
265
+
266
+ slice-the-build-method .build-method-badge {
267
+ margin-top: 10px;
109
268
  }
110
269
 
111
270
  slice-the-build-method h1 {
112
271
  font-size: 1.8rem;
272
+ margin-right: 0;
113
273
  }
114
274
 
115
275
  slice-the-build-method h2 {
@@ -119,4 +279,18 @@ slice-the-build-method section {
119
279
  slice-the-build-method h3 {
120
280
  font-size: 1.3rem;
121
281
  }
282
+
283
+ slice-the-build-method .parameters-list li {
284
+ grid-template-columns: 1fr;
285
+ gap: 5px;
286
+ }
287
+
288
+ slice-the-build-method .lifecycle-steps li {
289
+ flex-direction: column;
290
+ align-items: flex-start;
291
+ }
292
+
293
+ slice-the-build-method .step-number {
294
+ margin-bottom: 10px;
295
+ }
122
296
  }