slicejs-cli 2.0.6 → 2.0.7

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.
Files changed (128) hide show
  1. package/commands/init/init.js +15 -14
  2. package/package.json +1 -1
  3. package/ProjectTemplate/api/index.js +0 -97
  4. package/ProjectTemplate/src/App/index.html +0 -22
  5. package/ProjectTemplate/src/App/index.js +0 -63
  6. package/ProjectTemplate/src/App/style.css +0 -40
  7. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
  8. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
  9. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
  10. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
  11. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
  12. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
  13. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
  14. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
  15. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
  16. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +0 -14
  17. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +0 -3
  18. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +0 -45
  19. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
  20. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +0 -30
  21. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +0 -75
  22. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
  23. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
  24. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -241
  25. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
  26. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
  27. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
  28. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
  29. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
  30. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
  31. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
  32. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
  33. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
  34. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
  35. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
  36. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
  37. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
  38. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
  39. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
  40. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
  41. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
  42. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
  43. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +0 -12
  44. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
  45. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +0 -126
  46. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
  47. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
  48. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
  49. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
  50. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
  51. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
  52. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -23
  53. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -6
  54. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -129
  55. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
  56. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -7
  57. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -15
  58. package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +0 -133
  59. package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +0 -141
  60. package/ProjectTemplate/src/Components/Service/Link/Link.js +0 -26
  61. package/ProjectTemplate/src/Components/Visual/Button/Button.css +0 -47
  62. package/ProjectTemplate/src/Components/Visual/Button/Button.html +0 -5
  63. package/ProjectTemplate/src/Components/Visual/Button/Button.js +0 -70
  64. package/ProjectTemplate/src/Components/Visual/Card/Card.css +0 -68
  65. package/ProjectTemplate/src/Components/Visual/Card/Card.html +0 -7
  66. package/ProjectTemplate/src/Components/Visual/Card/Card.js +0 -107
  67. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +0 -87
  68. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +0 -8
  69. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +0 -86
  70. package/ProjectTemplate/src/Components/Visual/Details/Details.css +0 -70
  71. package/ProjectTemplate/src/Components/Visual/Details/Details.html +0 -9
  72. package/ProjectTemplate/src/Components/Visual/Details/Details.js +0 -76
  73. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +0 -60
  74. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +0 -5
  75. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +0 -63
  76. package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +0 -7
  77. package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +0 -1
  78. package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +0 -57
  79. package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +0 -510
  80. package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +0 -1
  81. package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +0 -89
  82. package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
  83. package/ProjectTemplate/src/Components/Visual/Icon/slc.json +0 -555
  84. package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +0 -507
  85. package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +0 -1485
  86. package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +0 -1059
  87. package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
  88. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
  89. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
  90. package/ProjectTemplate/src/Components/Visual/Input/Input.css +0 -91
  91. package/ProjectTemplate/src/Components/Visual/Input/Input.html +0 -4
  92. package/ProjectTemplate/src/Components/Visual/Input/Input.js +0 -215
  93. package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
  94. package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
  95. package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +0 -49
  96. package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +0 -56
  97. package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +0 -83
  98. package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +0 -38
  99. package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +0 -93
  100. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +0 -115
  101. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +0 -44
  102. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +0 -141
  103. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +0 -117
  104. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +0 -24
  105. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +0 -16
  106. package/ProjectTemplate/src/Components/Visual/Route/Route.js +0 -93
  107. package/ProjectTemplate/src/Components/Visual/Select/Select.css +0 -84
  108. package/ProjectTemplate/src/Components/Visual/Select/Select.html +0 -8
  109. package/ProjectTemplate/src/Components/Visual/Select/Select.js +0 -195
  110. package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +0 -76
  111. package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +0 -8
  112. package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +0 -102
  113. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +0 -36
  114. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +0 -1
  115. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +0 -126
  116. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +0 -8
  117. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +0 -1
  118. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +0 -48
  119. package/ProjectTemplate/src/Components/components.js +0 -42
  120. package/ProjectTemplate/src/Styles/sliceStyles.css +0 -34
  121. package/ProjectTemplate/src/Themes/Dark.css +0 -42
  122. package/ProjectTemplate/src/Themes/Light.css +0 -31
  123. package/ProjectTemplate/src/Themes/Slice.css +0 -47
  124. package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
  125. package/ProjectTemplate/src/images/favicon.ico +0 -0
  126. package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
  127. package/ProjectTemplate/src/routes.js +0 -36
  128. package/ProjectTemplate/src/sliceConfig.json +0 -58
@@ -1,103 +0,0 @@
1
- export default class CheckboxDocumentation 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.createCheckbox(this.querySelector('.myCheckbox'), {}, `{}`);
12
- await this.createCheckbox(
13
- this.querySelector('.colorCheckbox'),
14
- { customColor: 'gold' },
15
- `{
16
- customColor: "gold"
17
- }`
18
- );
19
- await this.createCheckbox(
20
- this.querySelector('.label'),
21
- {
22
- label: 'Checkbox',
23
- },
24
- `{
25
- label: "Checkbox",
26
- }`
27
- );
28
- await this.createCheckbox(
29
- this.querySelector('.labelLeft'),
30
- {
31
- label: 'Left',
32
- labelPlacement: 'left',
33
- },
34
- `{
35
- label: "Left",
36
- labelPlacement: "left",
37
- }`
38
- );
39
- await this.createCheckbox(
40
- this.querySelector('.labelTop'),
41
- {
42
- label: 'Top',
43
- labelPlacement: 'top',
44
- },
45
- `{
46
- label: "Top",
47
- labelPlacement: "top",
48
- }`
49
- );
50
- await this.createCheckbox(
51
- this.querySelector('.labelRight'),
52
- {
53
- label: 'Right',
54
- labelPlacement: 'right',
55
- },
56
- `{
57
- label: "Right",
58
- labelPlacement: "right",
59
- }`
60
- );
61
- await this.createCheckbox(
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 createCheckbox(appendTo, checkboxProps, codeProps) {
75
- if (!codeProps) {
76
- codeProps = '{}';
77
- }
78
- const myCheckbox = await slice.build('Checkbox', checkboxProps);
79
-
80
- const componentCode = await slice.build('CodeVisualizer', {
81
- value: `const myCheckbox = await slice.build("Checkbox", ${codeProps});
82
-
83
- `,
84
- language: 'javascript',
85
- });
86
-
87
- const div = document.createElement('div');
88
- const checkboxDiv = document.createElement('div');
89
- checkboxDiv.classList.add('checkboxs');
90
- checkboxDiv.appendChild(myCheckbox);
91
- div.classList.add('checkboxs_container');
92
- div.appendChild(checkboxDiv);
93
- div.appendChild(componentCode);
94
-
95
- if (appendTo) {
96
- appendTo.appendChild(div);
97
- }
98
-
99
- return div;
100
- }
101
- }
102
-
103
- customElements.define('slice-checkboxdocumentation', CheckboxDocumentation);
@@ -1,14 +0,0 @@
1
- .codevisualizer_container {
2
- font-size: smaller;
3
- max-width: 100%;
4
- background-color: var(--primary-background-color);
5
- border: 1px solid var(--primary-color);
6
- padding: 10px;
7
- border-radius: 10px;
8
- overflow-x: scroll;
9
- }
10
-
11
- .codevisualizer pre code[class*='language-'],
12
- .codevisualizer pre pre[class*='language-'] {
13
- color: var(--font-primary-color);
14
- }
@@ -1,3 +0,0 @@
1
- <div class="codevisualizer_container">
2
- <pre class="codevisualizer"><code></code></pre>
3
- </div>
@@ -1,45 +0,0 @@
1
- export default class CodeVisualizer extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
-
6
- this.$container = this.querySelector('.codevisualizer_container');
7
- this.$code = this.querySelector('.codevisualizer');
8
-
9
- slice.controller.setComponentProps(this, props);
10
- this.debuggerProps = ['language', 'value'];
11
- this.editor = null;
12
- }
13
-
14
- set value(value) {
15
- this._value = value;
16
- }
17
-
18
- get value() {
19
- return this._value;
20
- }
21
-
22
- set language(value) {
23
- this._language = value;
24
- }
25
-
26
- get language() {
27
- return this._language;
28
- }
29
-
30
- init() {
31
- this.visualizeCode();
32
- }
33
-
34
- visualizeCode() {
35
- if (this._value && this._language) {
36
- this.$code.innerHTML = `<pre><code class="language-${this._language}">${Prism.highlight(
37
- this._value,
38
- Prism.languages[this._language],
39
- this._language
40
- )}</code></pre>`;
41
- }
42
- }
43
- }
44
-
45
- customElements.define('slice-codevisualizer', CodeVisualizer);
@@ -1,30 +0,0 @@
1
- <h1>Slice Documentation</h1>
2
- <p>
3
- The Slice Framework is a modular system based on components, designed to simplify web client development. Its architecture allows functionality to be divided into reusable modules, making maintenance and expansion easier.
4
- </p>
5
- <p>
6
- Components are classified into three main categories: <span>Visual</span>, <span>Structural</span>, and <span>Services</span>. Visual components build the user interface, structural components manage the framework’s core infrastructure, and service components handle business logic and integrations.
7
- </p>
8
-
9
- <div class="visualComponents">
10
- <h2>Visual Components</h2>
11
- <p>
12
- These components define the web client interface using custom HTML tags powered by the Web Components API. They encapsulate logic for dynamic styling, UI interactions, and backend communication via HTTP requests.
13
- </p>
14
- </div>
15
-
16
- <div class="structuralComponents">
17
- <h2>Structural Components</h2>
18
- <p>
19
- Structural components provide the core framework infrastructure, managing instances, tracking activities, and optimizing performance. They ensure seamless control over application behavior and debugging.
20
- </p>
21
- </div>
22
-
23
- <div class="serviceComponents">
24
- <h2>Service Components</h2>
25
- <p>
26
- Services encapsulate business logic and facilitate integrations with technologies like HTTP requests, local storage, and IndexedDB. They promote code reusability and simplify application development.
27
- </p>
28
- </div>
29
-
30
- <div class="qna"></div>
@@ -1,75 +0,0 @@
1
- export default class Documentation 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
- const htmlCard = await slice.build('Card', {
12
- title: 'HTML',
13
- text: 'HyperText Markup Language is the most basic building block of the Web. It defines the meaning and structure of web content.',
14
- icon: {
15
- name: 'html',
16
- iconStyle: 'filled',
17
- },
18
- customColor: {
19
- card: '#E36A2F',
20
- icon: 'white',
21
- },
22
- });
23
- const jsCard = await slice.build('Card', {
24
- title: 'JS',
25
- text: 'JavaScript is a lightweight interpreted (or just-in-time compiled) programming language with first-class functions.',
26
- icon: {
27
- name: 'javascript',
28
- iconStyle: 'filled',
29
- },
30
- customColor: {
31
- card: 'gold',
32
- icon: 'white',
33
- },
34
- });
35
- const cssCard = await slice.build('Card', {
36
- title: 'CSS',
37
- text: 'Cascading Style Sheets is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS describes how elements should be rendered on screen, on paper, in speech, or on other media.',
38
- icon: {
39
- name: 'css',
40
- iconStyle: 'filled',
41
- },
42
- customColor: {
43
- card: '#519ABA',
44
- icon: 'white',
45
- },
46
- });
47
- const grid = await slice.build('Grid', {
48
- columns: 3,
49
- rows: 1,
50
- items: [htmlCard, jsCard, cssCard],
51
- });
52
-
53
- if (window.screen.width <= 770) {
54
- grid.columns = 1;
55
- }
56
-
57
- this.querySelector('.visualComponents').appendChild(grid);
58
-
59
- //Q & A
60
- const buildQuestion = await slice.build('Details', {
61
- title: 'How can i build a component?',
62
- text: "To build a component you need to call the slice.build method with it's required props.",
63
- });
64
- const buildExample = await slice.build('CodeVisualizer', {
65
- value: `const mySliceComponent = await slice.build("MySliceComponentName", props)`,
66
- language: 'javascript',
67
- });
68
-
69
- buildQuestion.addDetail(buildExample);
70
-
71
- this.querySelector('.qna').appendChild(buildQuestion);
72
- }
73
- }
74
-
75
- customElements.define('slice-documentation', Documentation);
@@ -1,62 +0,0 @@
1
- .visualComponents p span {
2
- color: var(--primary-color);
3
- }
4
- :root {
5
- --docs-width: 64%;
6
- }
7
- slice-documentation-page slice-route,
8
- slice-documentation-page slice-multi-route {
9
- display: flex;
10
- justify-content: center;
11
- }
12
-
13
- slice-mainmenu{
14
- position: fixed;
15
- top: 0;
16
- left: 0;
17
- font-family: var(--font-family);
18
- background-color: var(--primary-background-color);
19
- border-right: 1px solid var(--primary-color-shade);
20
- /* box-shadow: 10px 0 10px 0px #00000020; */
21
- display: flex;
22
- align-items: center;
23
- height: 100%;
24
- width: 17%;
25
- transition: transform 0.3s ease, width 0.3s ease;
26
- overflow-x: hidden;
27
- }
28
-
29
- p {
30
- text-align: justify;
31
- }
32
- h1 {
33
- padding-top: 10px;
34
- padding-bottom: 10px;
35
- border-bottom: 1px solid var(--secondary-background-color);
36
- }
37
- h2 {
38
- padding-top: 10px;
39
- }
40
- .grid-container {
41
- overflow-x: auto;
42
- }
43
- @media only screen and (max-width: 770px) {
44
- :root {
45
- --docs-width: 100%;
46
- }
47
- }
48
- * {
49
- font-family: var(--font-family);
50
- }
51
-
52
- slice-multi-route > :first-child {
53
- margin-top: 60px;
54
- color: var(--font-primary-color);
55
- margin-top: 60px;
56
- overflow-y: scroll;
57
- overflow-x: hidden;
58
- width: var(--docs-width);
59
- padding-left: 10px;
60
- padding-right: 10px;
61
- padding-bottom: 25px;
62
- }
@@ -1,241 +0,0 @@
1
- export default class DocumentationPage extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
-
6
- slice.controller.setComponentProps(this, props);
7
- this.debuggerProps = [];
8
-
9
- this.components = ['Button', 'Card', 'Checkbox', 'Input', 'Switch'];
10
- }
11
-
12
- async init() {
13
- await import('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js');
14
- await import('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js');
15
- const css = await fetch('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css');
16
- const cssText = await css.text();
17
- const style = document.createElement('style');
18
- style.innerHTML = cssText;
19
- document.head.appendChild(style);
20
-
21
- const navBar = await slice.build('Navbar', {
22
- position: 'fixed',
23
- logo: {
24
- src: '../../images/Slice.js-logo.png',
25
- path: '/',
26
- },
27
- items: [
28
- {
29
- text: 'Home',
30
- path: '/',
31
- },
32
- {
33
- text: 'Documentation',
34
- path: '/Documentation',
35
- },
36
- {
37
- text: 'Playground',
38
- path: '/Playground',
39
- },
40
- {
41
- text: 'Our Team',
42
- path: '/Team',
43
- }
44
-
45
- ],
46
- buttons: [
47
- {
48
- value: 'Change Theme',
49
- // color:
50
- onClickCallback: async () => {
51
- if (theme === 'Slice') {
52
- await slice.setTheme('Light');
53
- theme = 'Light';
54
- } else if (theme === 'Light') {
55
- await slice.setTheme('Dark');
56
- theme = 'Dark';
57
- } else if (theme === 'Dark') {
58
- await slice.setTheme('Slice');
59
- theme = 'Slice';
60
- }
61
- },
62
- },
63
- ],
64
- });
65
-
66
- const components = {
67
- Button: 'Visual',
68
- Card: 'Visual',
69
- Checkbox: 'Visual',
70
- Input: 'Visual',
71
- Switch: 'Visual',
72
- };
73
-
74
- let documentationRoutes = {
75
- value: 'Visual',
76
- items: [],
77
- };
78
-
79
- for (const name in components) {
80
- const component = {
81
- value: name,
82
- path: `/Documentation/${name}`,
83
- component: `${name}Documentation`,
84
- };
85
- if (components[name] === 'Visual') {
86
- documentationRoutes.items.push(component);
87
- }
88
- }
89
-
90
- const treeview = await slice.build('TreeView', {
91
- items: [
92
- {
93
- value: 'Introduction',
94
- items: [
95
- {
96
- value: 'What is Slice.js?',
97
- path: '/Documentation/What-is-Slice.js',
98
- component: 'WhatIsSlice',
99
- },
100
- {
101
- value: 'Installation',
102
- path: '/Documentation/Installation',
103
- component: 'Installation',
104
- },
105
- ],
106
- },
107
- {
108
- value: 'Getting Started',
109
- items: [
110
- {
111
- value: 'Components',
112
- items: [
113
- {
114
- value: 'The build method',
115
- path: '/Documentation/The-build-method',
116
- component: 'TheBuildMethod',
117
- },
118
- {
119
- value: 'Visual',
120
- path: '/Documentation/Visual',
121
- component: 'VisualDocumentation',
122
- },
123
- {
124
- value: 'Structural',
125
- path: '/Documentation/Structural',
126
- component: 'StructuralDocumentation',
127
- },
128
- {
129
- value: 'Services',
130
- path: '/Documentation/Services',
131
- component: 'ServicesDocumentation',
132
- },
133
- {
134
- value: `Lifecycle methods`,
135
- path: '/Documentation/Lifecycle-methods',
136
- component: 'LifecycleMethods',
137
- },
138
- ],
139
- },
140
- {
141
- value: 'Routing',
142
- path: '/Documentation/Routing',
143
- component: 'RoutingDocumentation',
144
- },
145
- {
146
- value: 'Themes',
147
- path: '/Documentation/Themes',
148
- component: 'ThemesDocumentation',
149
- },
150
- {
151
- value: 'Slice Styles',
152
- path: '/Documentation/Slice-Styles',
153
- component: 'SliceStylesDocumentation',
154
- },
155
- ],
156
- },
157
- {
158
- value: 'Components Library',
159
- items: [
160
- {
161
- value: 'Services',
162
- items: [
163
- {
164
- value: 'FetchManager',
165
- path: '/Documentation/SliceComponents/FetchManager',
166
- },
167
- ],
168
- },
169
- documentationRoutes,
170
- ],
171
- },
172
- ],
173
- onClickCallback: async (item) => {
174
- if (item.path) {
175
- //myRouteContainer.path = item.path;
176
- //myRouteContainer.component = item.component;
177
- await slice.router.navigate(item.path);
178
- myNavigation.page = VisualComponentsMultiRoute;
179
- }
180
- },
181
- });
182
-
183
- const extraRoute = {
184
- path: '/Documentation',
185
- component: 'Documentation',
186
- };
187
-
188
- //add extra route to the routes
189
- documentationRoutes.items.push(extraRoute);
190
-
191
- function getRoutes(array) {
192
- for (let i = 0; i < array.length; i++) {
193
- if (array[i].items) {
194
- getRoutes(array[i].items);
195
- } else {
196
- const exists = documentationRoutes.items.some(route => route.path === array[i].path);
197
- if (!exists) {
198
- documentationRoutes.items.push(array[i]);
199
- }
200
- }
201
- }
202
- }
203
-
204
-
205
-
206
- const VisualComponentsMultiRoute = await slice.build('MultiRoute', {
207
- routes: documentationRoutes.items,
208
- });
209
-
210
-
211
-
212
- const mainMenu = await slice.build('MainMenu', {});
213
- mainMenu.add(treeview);
214
-
215
- const myNavigation = await slice.build('MyNavigation', {
216
- page: VisualComponentsMultiRoute,
217
- });
218
-
219
- const layOut = await slice.build('Layout', {
220
- // layout: div,
221
- view: VisualComponentsMultiRoute,
222
- });
223
-
224
- layOut.onLayOut(mainMenu);
225
- layOut.onLayOut(navBar);
226
- layOut.onLayOut(myNavigation);
227
-
228
- let theme = slice.stylesManager.themeManager.currentTheme;
229
-
230
- if (window.location.pathname === '/Documentation') {
231
- await VisualComponentsMultiRoute.renderIfCurrentRoute();
232
- }
233
- this.appendChild(layOut);
234
-
235
- //if route is domain/Documentation
236
-
237
- }
238
-
239
- }
240
-
241
- customElements.define('slice-documentation-page', DocumentationPage);
@@ -1,41 +0,0 @@
1
- .inputs {
2
- display: flex;
3
- justify-content: center;
4
- width: 100%;
5
- }
6
- .typeText,
7
- .typeNumber {
8
- width: 100%;
9
- }
10
- .inputGrid {
11
- display: grid;
12
- grid-template-columns: repeat(2, 1fr);
13
- grid-template-rows: repeat(1, 1fr);
14
- gap: 10px;
15
- }
16
- ul li::marker,
17
- ul span {
18
- color: var(--primary-color);
19
- }
20
- .validateConditions {
21
- width: 100%;
22
- display: flex;
23
- flex-direction: row;
24
- justify-content: center;
25
- align-items: center;
26
- }
27
- .inputButtons {
28
- display: flex;
29
- justify-content: center;
30
- slice-button {
31
- width: 100%;
32
- }
33
- }
34
- @media only screen and (max-width: 770px) {
35
- .inputs {
36
- width: 100%;
37
- }
38
- .inputGrid {
39
- display: block;
40
- }
41
- }