slicejs-web-framework 1.0.14 → 1.0.17

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,9 +1,9 @@
1
1
  {
2
2
  "name": "slicejs-web-framework",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "engines": {
6
- "node": "20.x"
6
+ "node": ">=20"
7
7
  },
8
8
  "scripts": {
9
9
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -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
  {
@@ -78,7 +78,7 @@ export default class DocumentationPage extends HTMLElement {
78
78
  componentsLibrary: {
79
79
  title: 'Components Library',
80
80
  items: [
81
- {
81
+ /* {
82
82
  title: 'Services',
83
83
  items: [
84
84
  {
@@ -86,7 +86,7 @@ export default class DocumentationPage extends HTMLElement {
86
86
  path: '/Documentation/SliceComponents/FetchManager'
87
87
  }
88
88
  ]
89
- },
89
+ },*/
90
90
  {
91
91
  title: 'Visual',
92
92
  path: '/Documentation/Visual',
@@ -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);