slicejs-cli 2.0.6 → 2.0.8

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 (130) hide show
  1. package/client.js +5 -1
  2. package/commands/Validations.js +1 -2
  3. package/commands/init/init.js +15 -14
  4. package/package.json +1 -1
  5. package/ProjectTemplate/api/index.js +0 -97
  6. package/ProjectTemplate/src/App/index.html +0 -22
  7. package/ProjectTemplate/src/App/index.js +0 -63
  8. package/ProjectTemplate/src/App/style.css +0 -40
  9. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
  10. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
  11. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
  12. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
  13. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
  14. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
  15. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
  16. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
  17. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
  18. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +0 -14
  19. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +0 -3
  20. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +0 -45
  21. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
  22. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +0 -30
  23. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +0 -75
  24. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
  25. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
  26. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -241
  27. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
  28. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
  29. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
  30. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
  31. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
  32. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
  33. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
  34. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
  35. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
  36. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
  37. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
  38. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
  39. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
  40. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
  41. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
  42. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
  43. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
  44. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
  45. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +0 -12
  46. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
  47. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +0 -126
  48. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
  49. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
  50. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
  51. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
  52. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
  53. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
  54. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -23
  55. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -6
  56. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -129
  57. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
  58. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -7
  59. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -15
  60. package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +0 -133
  61. package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +0 -141
  62. package/ProjectTemplate/src/Components/Service/Link/Link.js +0 -26
  63. package/ProjectTemplate/src/Components/Visual/Button/Button.css +0 -47
  64. package/ProjectTemplate/src/Components/Visual/Button/Button.html +0 -5
  65. package/ProjectTemplate/src/Components/Visual/Button/Button.js +0 -70
  66. package/ProjectTemplate/src/Components/Visual/Card/Card.css +0 -68
  67. package/ProjectTemplate/src/Components/Visual/Card/Card.html +0 -7
  68. package/ProjectTemplate/src/Components/Visual/Card/Card.js +0 -107
  69. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +0 -87
  70. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +0 -8
  71. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +0 -86
  72. package/ProjectTemplate/src/Components/Visual/Details/Details.css +0 -70
  73. package/ProjectTemplate/src/Components/Visual/Details/Details.html +0 -9
  74. package/ProjectTemplate/src/Components/Visual/Details/Details.js +0 -76
  75. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +0 -60
  76. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +0 -5
  77. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +0 -63
  78. package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +0 -7
  79. package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +0 -1
  80. package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +0 -57
  81. package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +0 -510
  82. package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +0 -1
  83. package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +0 -89
  84. package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
  85. package/ProjectTemplate/src/Components/Visual/Icon/slc.json +0 -555
  86. package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +0 -507
  87. package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +0 -1485
  88. package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +0 -1059
  89. package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
  90. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
  91. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
  92. package/ProjectTemplate/src/Components/Visual/Input/Input.css +0 -91
  93. package/ProjectTemplate/src/Components/Visual/Input/Input.html +0 -4
  94. package/ProjectTemplate/src/Components/Visual/Input/Input.js +0 -215
  95. package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
  96. package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
  97. package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +0 -49
  98. package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +0 -56
  99. package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +0 -83
  100. package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +0 -38
  101. package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +0 -93
  102. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +0 -115
  103. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +0 -44
  104. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +0 -141
  105. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +0 -117
  106. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +0 -24
  107. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +0 -16
  108. package/ProjectTemplate/src/Components/Visual/Route/Route.js +0 -93
  109. package/ProjectTemplate/src/Components/Visual/Select/Select.css +0 -84
  110. package/ProjectTemplate/src/Components/Visual/Select/Select.html +0 -8
  111. package/ProjectTemplate/src/Components/Visual/Select/Select.js +0 -195
  112. package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +0 -76
  113. package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +0 -8
  114. package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +0 -102
  115. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +0 -36
  116. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +0 -1
  117. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +0 -126
  118. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +0 -8
  119. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +0 -1
  120. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +0 -48
  121. package/ProjectTemplate/src/Components/components.js +0 -42
  122. package/ProjectTemplate/src/Styles/sliceStyles.css +0 -34
  123. package/ProjectTemplate/src/Themes/Dark.css +0 -42
  124. package/ProjectTemplate/src/Themes/Light.css +0 -31
  125. package/ProjectTemplate/src/Themes/Slice.css +0 -47
  126. package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
  127. package/ProjectTemplate/src/images/favicon.ico +0 -0
  128. package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
  129. package/ProjectTemplate/src/routes.js +0 -36
  130. package/ProjectTemplate/src/sliceConfig.json +0 -58
@@ -1,93 +0,0 @@
1
- export default class MultiRoute extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- this.props = props;
5
- this.renderedComponents = new Map(); // Cache para componentes renderizados
6
- }
7
-
8
- init() {
9
- if (!this.props.routes || !Array.isArray(this.props.routes)) {
10
- slice.logger.logError('MultiRoute', 'No valid routes array provided in props.');
11
- return;
12
- }
13
-
14
- /*
15
- this.props.routes.forEach(route => {
16
- if (!route.path || !route.component) {
17
- slice.logger.logError('MultiRoute', 'Route must have a path and a component.');
18
- }
19
-
20
- console.log(route)
21
-
22
- slice.router.verifyDynamicRouteExistence(route)
23
- });
24
-
25
- // verify if the current route is registered in the routes.js file
26
- slice.router.verifyDynamicRouteExistence(this.props.routes)
27
- */
28
- }
29
-
30
- async render() {
31
- const currentPath = window.location.pathname;
32
- const routeMatch = this.props.routes.find((route) => route.path === currentPath);
33
-
34
- if (routeMatch) {
35
- const { component } = routeMatch;
36
-
37
- if (this.renderedComponents.has(component)) {
38
- const cachedComponent = this.renderedComponents.get(component);
39
-
40
- // Aquí nos aseguramos de que el contenido se limpie antes de insertar el componente en caché.
41
- this.innerHTML = '';
42
-
43
- // Si el componente en caché tiene un método update, lo ejecutamos
44
- if (cachedComponent.update) {
45
- await cachedComponent.update();
46
- }
47
-
48
- // Insertamos el componente en caché en el DOM
49
- this.appendChild(cachedComponent);
50
- } else {
51
- if (!slice.controller.componentCategories.has(component)) {
52
- slice.logger.logError(`${this.sliceId}`, `Component ${component} not found`);
53
- return;
54
- }
55
-
56
- // Si el componente no está en caché, lo construimos y lo almacenamos en la caché
57
- const newComponent = await slice.build(component, { sliceId: component });
58
- this.innerHTML = '';
59
- this.appendChild(newComponent);
60
-
61
- // Guardamos el componente recién construido en la caché
62
- this.renderedComponents.set(component, newComponent);
63
- }
64
- } else {
65
- // Limpiamos el contenido si no hay una coincidencia de ruta
66
- this.innerHTML = '';
67
- }
68
- }
69
-
70
- async renderIfCurrentRoute() {
71
- const currentPath = window.location.pathname;
72
- const routeMatch = this.props.routes.find((route) => route.path === currentPath);
73
-
74
- if (routeMatch) {
75
- await this.render(); // Llamamos a render() para manejar el renderizado desde la caché si es necesario
76
- return true;
77
- }
78
- return false;
79
- }
80
-
81
- removeComponent() {
82
- const currentPath = window.location.pathname;
83
- const routeMatch = this.props.routes.find((route) => route.path === currentPath);
84
-
85
- if (routeMatch) {
86
- const { component } = routeMatch;
87
- this.renderedComponents.delete(component);
88
- this.innerHTML = '';
89
- }
90
- }
91
- }
92
-
93
- customElements.define('slice-multi-route', MultiRoute);
@@ -1,115 +0,0 @@
1
- .slice_nav_header {
2
- font-family: var(--font-family);
3
- width: 100%;
4
- z-index: 1;
5
- box-shadow: 0px 0px 10px #00000050;
6
- background-color: var(--primary-color);
7
- display: flex;
8
- justify-content: space-around;
9
- align-items: center;
10
- }
11
- .direction-row-reverse {
12
- flex-direction: row-reverse;
13
- }
14
- .nav_bar_fixed {
15
- z-index: 100;
16
- width: 100%;
17
- left: 0;
18
- top: 0;
19
- position: fixed;
20
- }
21
- .slice_nav_bar {
22
- transition: transform 0.3s ease;
23
- width: 100%;
24
- justify-content: center;
25
- display: flex;
26
- align-items: center;
27
- left: 0;
28
- top: 0;
29
- }
30
- .nav_bar_menu {
31
- width: 100%;
32
- overflow-y: hidden;
33
- overflow-x: scroll;
34
- display: flex;
35
- align-items: center;
36
- justify-content: center;
37
- list-style: none;
38
- }
39
- .slice_nav_header .item {
40
- cursor: pointer;
41
- font-weight: bold;
42
- text-decoration: none;
43
- color: var(--primary-color-contrast);
44
- border-radius: var(--border-radius-slice);
45
- }
46
- .anim-item {
47
- position: absolute;
48
- top: 100%;
49
- left: 50%;
50
- width: 0%;
51
- height: 2.5px;
52
- border-radius: 5px;
53
- background-color: var(--primary-color-contrast);
54
- transition: width 0.3s ease, left 0.3s ease;
55
- }
56
- .slice_nav_header li {
57
- margin: 25px;
58
- display: flex;
59
- justify-content: center;
60
- position: relative;
61
- }
62
-
63
- .slice_nav_header li:hover .anim-item {
64
- width: 100%;
65
- left: 0;
66
- }
67
- .slice_nav_header .logo_container {
68
- padding: 10px;
69
- }
70
- .logo_container img {
71
- pointer-events: none;
72
- user-select: none;
73
- max-height: 50px;
74
- max-width: 200px;
75
- }
76
- .nav_bar_buttons {
77
- justify-content: flex-end;
78
- display: flex;
79
- }
80
-
81
- .mobile_menu_button,
82
- .mobile_close_menu {
83
- visibility: hidden;
84
- position: absolute;
85
- right: 0px;
86
- margin-right: 25px;
87
- }
88
- .mobile_close_menu {
89
- top: 25px;
90
- }
91
- @media only screen and (max-width: 1020px) {
92
- .slice_nav_bar {
93
- z-index: 1;
94
- list-style: none;
95
- width: 100%;
96
- height: 100%;
97
- position: fixed;
98
- top: 0;
99
- left: 0;
100
- display: flex;
101
- justify-content: center;
102
- align-items: center;
103
- flex-direction: column;
104
- background-color: var(--primary-color);
105
- transform: translateX(100%);
106
- }
107
- .nav_bar_menu,
108
- .nav_bar_buttons {
109
- flex-direction: column;
110
- }
111
- .mobile_menu_button,
112
- .mobile_close_menu {
113
- visibility: visible;
114
- }
115
- }
@@ -1,44 +0,0 @@
1
- <header class="slice_nav_header">
2
- <a class="logo_container"></a>
3
- <nav class="slice_nav_bar">
4
- <div class="nav_bar_menu"></div>
5
- <div class="nav_bar_buttons"></div>
6
- <div class="mobile_close_menu">
7
- <svg
8
- class="w-6 h-6 text-gray-800 dark:text-white"
9
- aria-hidden="true"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- fill="none"
14
- viewBox="0 0 24 24"
15
- >
16
- <path
17
- stroke="var(--primary-color-contrast)"
18
- stroke-linecap="round"
19
- stroke-linejoin="round"
20
- stroke-width="2"
21
- d="M6 18 17.94 6M18 18 6.06 6"
22
- />
23
- </svg>
24
- </div>
25
- </nav>
26
- <div class="mobile_menu_button">
27
- <svg
28
- class="w-6 h-6 text-gray-800 dark:text-white"
29
- aria-hidden="true"
30
- xmlns="http://www.w3.org/2000/svg"
31
- width="24"
32
- height="24"
33
- fill="none"
34
- viewBox="0 0 24 24"
35
- >
36
- <path
37
- stroke="var(--primary-color-contrast)"
38
- stroke-linecap="round"
39
- stroke-width="3"
40
- d="M12 6h.01M12 12h.01M12 18h.01"
41
- />
42
- </svg>
43
- </div>
44
- </header>
@@ -1,141 +0,0 @@
1
- export default class Navbar extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
-
6
- this.$header = this.querySelector('.slice_nav_header');
7
- this.$navBar = this.querySelector('.slice_nav_bar');
8
- this.$menu = this.querySelector('.nav_bar_menu');
9
- this.$buttonsContainer = this.querySelector('.nav_bar_buttons');
10
- this.$logoContainer = this.querySelector('.logo_container');
11
- this.$mobileMenu = this.querySelector('.slice_mobile_menu');
12
- this.$mobileButton = this.querySelector('.mobile_menu_button');
13
- this.$closeMenu = this.querySelector('.mobile_close_menu');
14
-
15
- this.$mobileButton.addEventListener('click', () => {
16
- this.$navBar.style.transform = 'translateX(0%)';
17
- });
18
-
19
- this.$closeMenu.addEventListener('click', () => {
20
- this.$navBar.style.transform = 'translateX(100%)';
21
- });
22
-
23
- slice.controller.setComponentProps(this, props);
24
- this.debuggerProps = ['logo', 'items'];
25
- }
26
-
27
- async init() {
28
- if (this.items) {
29
- await this.addItems(this.items);
30
- }
31
- if (this.buttons) {
32
- this.buttons.forEach(async (item) => {
33
- await this.addButton(item, this.$buttonsContainer);
34
- });
35
- }
36
-
37
- if (window.screen.width >= 1020 && this.items && this.logo && this.buttons) {
38
- this.$menu.style.maxWidth = '60%';
39
- }
40
- }
41
-
42
- async addItems(items) {
43
- for (let i = 0; i < items.length; i++) {
44
- await this.addItem(items[i], this.$menu);
45
- }
46
- }
47
-
48
- get position() {
49
- return this._position;
50
- }
51
-
52
- set position(value) {
53
- this._position = value;
54
- if (value === 'fixed') {
55
- this.classList.add('nav_bar_fixed');
56
- }
57
- }
58
-
59
- get logo() {
60
- return this._logo;
61
- }
62
-
63
- set logo(value) {
64
- this._logo = value;
65
- const img = document.createElement('img');
66
- img.src = value.src;
67
- this.$logoContainer.appendChild(img);
68
- this.$logoContainer.href = value.path;
69
- }
70
-
71
- get items() {
72
- return this._items;
73
- }
74
-
75
- set items(values) {
76
- this._items = values;
77
- }
78
-
79
- get buttons() {
80
- return this._buttons;
81
- }
82
-
83
- set buttons(values) {
84
- this._buttons = values;
85
- }
86
-
87
- get direction() {
88
- return this._direction;
89
- }
90
-
91
- set direction(value) {
92
- this._direction = value;
93
- if (value === 'reverse') {
94
- this.$header.classList.add('direction-row-reverse');
95
- }
96
- }
97
-
98
- async addItem(value, addTo) {
99
- const item = document.createElement('li');
100
- const hover = document.createElement('div');
101
- hover.classList.add('anim-item');
102
- if (!value.type) {
103
- value.type = 'text';
104
- }
105
- if (value.type === 'text') {
106
- const link = await slice.build('Link', {
107
- text: value.text,
108
- path: value.path,
109
- classes: 'item',
110
- });
111
- item.appendChild(link);
112
- }
113
- if (value.type === 'dropdown') {
114
- const d = await slice.build('DropDown', {
115
- label: value.text,
116
- options: value.options,
117
- });
118
- d.classList.add('item');
119
- item.appendChild(d);
120
- }
121
- item.appendChild(hover);
122
- addTo.appendChild(item);
123
- }
124
-
125
- async addButton(value, addTo) {
126
- if (!value.color) {
127
- value.color = {
128
- label: 'var(--primary-color-rgb)',
129
- button: 'var(--primary-background-color)',
130
- };
131
- }
132
- const button = await slice.build('Button', {
133
- value: value.value,
134
- customColor: value.color,
135
- icon: value.icon,
136
- onClickCallback: value.onClickCallback,
137
- });
138
- addTo.appendChild(button);
139
- }
140
- }
141
- window.customElements.define('slice-nav-bar', Navbar);
@@ -1,117 +0,0 @@
1
- * {
2
- border: 0;
3
- box-sizing: border-box;
4
- margin: 0;
5
- padding: 0;
6
- }
7
- #app, body {
8
- background: var(--primary-color);
9
- display: flex;
10
- height: 100vh;
11
- }
12
- /* I. Containers */
13
- figure {
14
- font-size: 6px;
15
- margin: auto;
16
- padding: 4em 0;
17
- width: 64em;
18
- }
19
- figcaption {
20
- color: var(--font-color);
21
- display: flex;
22
- align-content: space-between;
23
- flex-wrap: wrap;
24
- height: 17em;
25
- }
26
- figcaption span:before, .sad-mac:before {
27
- content: "";
28
- display: block;
29
- width: 1em;
30
- height: 1em;
31
- transform: translate(-1em,-1em);
32
- }
33
- figcaption span {
34
- display: inline-block;
35
- margin: 0 2em;
36
- width: 4em;
37
- height: 6em;
38
- }
39
- .sr-text {
40
- overflow: hidden;
41
- position: absolute;
42
- width: 0;
43
- height: 0;
44
- }
45
- /* II. Sprites */
46
- /* 1. Sad Mac */
47
- .sad-mac {
48
- background: #fff;
49
- margin: 0 auto 7em auto;
50
- width: 23em;
51
- height: 30em;
52
- }
53
- .sad-mac:before {
54
- box-shadow: 1em 1em, 23em 1em, 4em 3em, 5em 3em, 6em 3em, 7em 3em, 8em 3em, 9em 3em, 10em 3em, 11em 3em, 12em 3em, 13em 3em, 14em 3em, 15em 3em, 16em 3em, 17em 3em, 18em 3em, 19em 3em, 20em 3em, 3em 4em, 21em 4em, 3em 5em, 21em 5em, 3em 6em, 7em 6em, 9em 6em, 15em 6em, 17em 6em, 21em 6em, 3em 7em, 8em 7em, 16em 7em, 21em 7em, 3em 8em, 7em 8em, 9em 8em, 15em 8em, 17em 8em, 21em 8em, 3em 9em, 21em 9em, 3em 10em, 10em 10em, 13em 10em, 21em 10em, 3em 11em, 11em 11em, 12em 11em, 21em 11em, 3em 12em, 21em 12em, 3em 13em, 10em 13em, 11em 13em, 12em 13em, 13em 13em, 14em 13em, 21em 13em, 3em 14em, 9em 14em, 15em 14em, 16em 14em, 21em 14em, 3em 15em, 17em 15em, 21em 15em, 3em 16em, 21em 16em, 4em 17em, 5em 17em, 6em 17em, 7em 17em, 8em 17em, 9em 17em, 10em 17em, 11em 17em, 12em 17em, 13em 17em, 14em 17em, 15em 17em, 16em 17em, 17em 17em, 18em 17em, 19em 17em, 20em 17em, 3em 22em, 4em 22em, 5em 22em, 14em 22em, 15em 22em, 16em 22em, 17em 22em, 18em 22em, 19em 22em, 20em 22em, 1em 27em, 2em 27em, 3em 27em, 4em 27em, 5em 27em, 6em 27em, 7em 27em, 8em 27em, 9em 27em, 10em 27em, 11em 27em, 12em 27em, 13em 27em, 14em 27em, 15em 27em, 16em 27em, 17em 27em, 18em 27em, 19em 27em, 20em 27em, 21em 27em, 22em 27em, 23em 27em, 1em 28em, 23em 28em, 1em 29em, 23em 29em, 1em 30em, 23em 30em;
55
- }
56
- /* 2. Letters */
57
- ._0:before {
58
- box-shadow: 2em 1em, 3em 1em, 1em 2em, 1em 3em, 1em 4em, 1em 5em, 4em 2em, 4em 3em, 4em 4em, 4em 5em, 2em 4em, 3em 3em, 2em 6em, 3em 6em;
59
- }
60
- ._4:before {
61
- box-shadow: 1em 1em, 1em 2em, 1em 3em, 1em 4em, 4em 1em, 4em 2em, 4em 3em, 4em 4em, 2em 4em, 3em 4em, 4em 5em, 4em 6em;
62
- }
63
- .d:before {
64
- box-shadow: 1em 1em, 2em 1em, 3em 1em, 1em 2em, 4em 2em, 1em 3em, 4em 3em, 1em 4em, 4em 4em, 1em 5em, 4em 5em, 1em 6em, 2em 6em, 3em 6em;
65
- }
66
- .e:before {
67
- box-shadow: 1em 1em, 2em 1em, 3em 1em, 4em 1em, 1em 2em, 1em 3em, 2em 3em, 3em 3em, 1em 4em, 1em 5em, 1em 6em, 2em 6em, 3em 6em, 4em 6em;
68
- }
69
- .f:before {
70
- box-shadow: 1em 1em, 2em 1em, 3em 1em, 4em 1em, 1em 2em, 1em 3em, 2em 3em, 3em 3em, 1em 4em, 1em 5em, 1em 6em;
71
- }
72
- .n:before {
73
- box-shadow: 1em 1em, 1em 2em, 1em 3em, 1em 4em, 1em 5em, 1em 6em, 4em 1em, 4em 2em, 4em 3em, 4em 4em, 4em 5em, 4em 6em, 2em 3em, 3em 4em;
74
- }
75
- .o:before {
76
- box-shadow: 2em 1em, 3em 1em, 1em 2em, 1em 3em, 1em 4em, 1em 5em, 4em 2em, 4em 3em, 4em 4em, 4em 5em, 2em 6em, 3em 6em;
77
- }
78
- .r:before {
79
- box-shadow: 1em 1em, 2em 1em, 3em 1em, 4em 2em, 1em 2em, 1em 3em, 1em 4em, 2em 3em, 3em 3em, 1em 5em, 1em 6em, 4em 4em, 4em 5em, 4em 6em;
80
- }
81
- .t:before {
82
- box-shadow: 1em 1em, 2em 1em, 3em 1em, 2em 2em, 2em 3em, 2em 4em, 2em 5em, 2em 6em;
83
- }
84
- .u:before {
85
- box-shadow: 1em 1em, 1em 2em, 1em 3em, 1em 4em, 1em 5em, 4em 1em, 4em 2em, 4em 3em, 4em 4em, 4em 5em, 2em 6em, 3em 6em;
86
- }
87
- /* III. Responsiveness */
88
- /* This cannot be smoothly done using viewport units; sprite pixels will look divided when font size is a floating point. */
89
- @media screen and (min-width: 720px) {
90
- figure {
91
- font-size: 7px;
92
- }
93
- }
94
- @media screen and (min-width: 1440px) {
95
- figure {
96
- font-size: 8px;
97
- }
98
- }
99
- html, body {
100
- height: 100%;
101
- margin: 0;
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- }
106
-
107
- .container {
108
- display: flex;
109
- align-items: center;
110
- justify-content: center;
111
- height: 100%;
112
- width: 100%;
113
- }
114
-
115
- figure {
116
- text-align: center;
117
- }
@@ -1,24 +0,0 @@
1
- <div class="container">
2
- <figure>
3
- <div class="sad-mac"></div>
4
- <figcaption>
5
- <span class="sr-text">Error 404: Not Found</span>
6
- <span class="e"></span>
7
- <span class="r"></span>
8
- <span class="r"></span>
9
- <span class="o"></span>
10
- <span class="r"></span>
11
- <span class="_4"></span>
12
- <span class="_0"></span>
13
- <span class="_4"></span>
14
- <span class="n"></span>
15
- <span class="o"></span>
16
- <span class="t"></span>
17
- <span class="f"></span>
18
- <span class="o"></span>
19
- <span class="u"></span>
20
- <span class="n"></span>
21
- <span class="d"></span>
22
- </figcaption>
23
- </figure>
24
- </div>
@@ -1,16 +0,0 @@
1
- export default class NotFound extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
-
6
- slice.controller.setComponentProps(this, props);
7
- this.debuggerProps = [];
8
- }
9
-
10
- init() {
11
- //change title of the page
12
- document.title = '404 - Not Found';
13
- }
14
- }
15
-
16
- customElements.define('slice-notfound', NotFound);
@@ -1,93 +0,0 @@
1
- export default class Route extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- this.props = props;
5
- this.rendered = false;
6
- }
7
-
8
- init() {
9
- if (!this.props.path) {
10
- this.props.path = ' ';
11
- }
12
-
13
- if (!this.props.component) {
14
- this.props.component = slice.router.pathToRouteMap.get(this.props.path).component || ' ';
15
- }
16
-
17
- //this.props.innerHTML = this.innerHTML;
18
- }
19
-
20
- get path() {
21
- return this.props.path;
22
- }
23
-
24
- set path(value) {
25
- this.props.path = value;
26
- }
27
-
28
- get component() {
29
- return this.props.component;
30
- }
31
-
32
- set component(value) {
33
- this.props.component = value;
34
- }
35
-
36
- async render() {
37
- if (Route.componentCache[this.props.component]) {
38
- const cachedComponent = Route.componentCache[this.props.component];
39
- this.innerHTML = '';
40
-
41
- if (cachedComponent.update) {
42
- await cachedComponent.update();
43
- }
44
-
45
- this.appendChild(cachedComponent);
46
- } else {
47
- if (!this.props.component) {
48
- return;
49
- }
50
-
51
- if (!slice.controller.componentCategories.has(this.props.component)) {
52
- slice.logger.logError(`${this.sliceId}`, `Component ${this.props.component} not found`);
53
- return;
54
- }
55
-
56
- const component = await slice.build(this.props.component, {
57
- sliceId: this.props.component,
58
- });
59
-
60
- this.innerHTML = '';
61
- this.appendChild(component);
62
- Route.componentCache[this.props.component] = component;
63
- }
64
- this.rendered = true;
65
- }
66
-
67
- async renderIfCurrentRoute() {
68
- if (this.props.path === window.location.pathname) {
69
- if (this.rendered) {
70
- if (Route.componentCache[this.props.component]) {
71
- const cachedComponent = Route.componentCache[this.props.component];
72
- if (cachedComponent.update) {
73
- await cachedComponent.update();
74
- }
75
- return true;
76
- }
77
- }
78
- await this.render();
79
- return true;
80
- }
81
- return false;
82
- }
83
-
84
- removeComponent() {
85
- delete Route.componentCache[this.props.component];
86
- this.innerHTML = '';
87
- this.rendered = false;
88
- }
89
- }
90
-
91
- Route.componentCache = {};
92
-
93
- customElements.define('slice-route', Route);