slicejs-web-framework 2.3.5 → 2.4.1
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/LICENSE +21 -21
- package/README.md +24 -5
- package/Slice/Components/Structural/Controller/Controller.js +156 -154
- package/Slice/Components/Structural/Debugger/Debugger.css +619 -619
- package/Slice/Components/Structural/Debugger/Debugger.html +72 -72
- package/Slice/Components/Structural/Logger/Log.js +10 -10
- package/Slice/Components/Structural/StylesManager/StylesManager.js +6 -3
- package/Slice/Slice.js +118 -51
- package/api/index.js +261 -233
- package/api/middleware/securityMiddleware.js +252 -252
- package/package.json +37 -37
- package/sliceConfig.schema.json +4 -0
- package/src/App/index.html +22 -22
- package/src/App/index.js +23 -23
- package/src/App/style.css +40 -40
- package/src/Components/AppComponents/HomePage/HomePage.css +204 -204
- package/src/Components/AppComponents/HomePage/HomePage.html +48 -48
- package/src/Components/AppComponents/HomePage/HomePage.js +195 -195
- package/src/Components/AppComponents/Playground/Playground.css +11 -11
- package/src/Components/AppComponents/Playground/Playground.js +111 -111
- package/src/Components/Service/FetchManager/FetchManager.js +133 -133
- package/src/Components/Service/IndexedDbManager/IndexedDbManager.js +141 -141
- package/src/Components/Service/LocalStorageManager/LocalStorageManager.js +45 -45
- package/src/Components/Visual/Button/Button.css +47 -47
- package/src/Components/Visual/Button/Button.html +5 -5
- package/src/Components/Visual/Button/Button.js +92 -92
- package/src/Components/Visual/Card/Card.css +68 -68
- package/src/Components/Visual/Card/Card.html +7 -7
- package/src/Components/Visual/Card/Card.js +107 -107
- package/src/Components/Visual/Checkbox/Checkbox.css +87 -87
- package/src/Components/Visual/Checkbox/Checkbox.html +8 -8
- package/src/Components/Visual/Checkbox/Checkbox.js +86 -86
- package/src/Components/Visual/CodeVisualizer/CodeVisualizer.css +129 -129
- package/src/Components/Visual/CodeVisualizer/CodeVisualizer.html +3 -3
- package/src/Components/Visual/CodeVisualizer/CodeVisualizer.js +259 -259
- package/src/Components/Visual/Details/Details.css +70 -70
- package/src/Components/Visual/Details/Details.html +9 -9
- package/src/Components/Visual/Details/Details.js +76 -76
- package/src/Components/Visual/DropDown/DropDown.css +60 -60
- package/src/Components/Visual/DropDown/DropDown.html +5 -5
- package/src/Components/Visual/DropDown/DropDown.js +63 -63
- package/src/Components/Visual/Grid/Grid.css +7 -7
- package/src/Components/Visual/Grid/Grid.html +1 -1
- package/src/Components/Visual/Grid/Grid.js +57 -57
- package/src/Components/Visual/Icon/Icon.css +510 -510
- package/src/Components/Visual/Icon/Icon.js +89 -89
- package/src/Components/Visual/Icon/slc.json +554 -554
- package/src/Components/Visual/Icon/slc.styl +507 -507
- package/src/Components/Visual/Icon/slc.svg +1485 -1485
- package/src/Components/Visual/Icon/slc.symbol.svg +1058 -1058
- package/src/Components/Visual/Input/Input.css +91 -91
- package/src/Components/Visual/Input/Input.html +4 -4
- package/src/Components/Visual/Input/Input.js +215 -215
- package/src/Components/Visual/Layout/Layout.js +49 -49
- package/src/Components/Visual/Loading/Loading.css +56 -56
- package/src/Components/Visual/Loading/Loading.html +83 -83
- package/src/Components/Visual/Loading/Loading.js +38 -38
- package/src/Components/Visual/MultiRoute/MultiRoute.js +93 -93
- package/src/Components/Visual/Navbar/Navbar.css +115 -115
- package/src/Components/Visual/Navbar/Navbar.html +44 -44
- package/src/Components/Visual/Navbar/Navbar.js +141 -141
- package/src/Components/Visual/NotFound/NotFound.css +116 -116
- package/src/Components/Visual/NotFound/NotFound.html +23 -23
- package/src/Components/Visual/NotFound/NotFound.js +16 -16
- package/src/Components/Visual/Route/Route.js +93 -93
- package/src/Components/Visual/Select/Select.css +84 -84
- package/src/Components/Visual/Select/Select.html +8 -8
- package/src/Components/Visual/Select/Select.js +195 -195
- package/src/Components/Visual/Switch/Switch.css +76 -76
- package/src/Components/Visual/Switch/Switch.html +8 -8
- package/src/Components/Visual/Switch/Switch.js +102 -102
- package/src/Components/Visual/TreeItem/TreeItem.css +36 -36
- package/src/Components/Visual/TreeItem/TreeItem.html +1 -1
- package/src/Components/Visual/TreeItem/TreeItem.js +126 -126
- package/src/Components/Visual/TreeView/TreeView.css +8 -8
- package/src/Components/Visual/TreeView/TreeView.html +1 -1
- package/src/Components/Visual/TreeView/TreeView.js +48 -48
- package/src/Styles/sliceStyles.css +34 -34
- package/src/Themes/Dark.css +42 -42
- package/src/Themes/Light.css +31 -31
- package/src/Themes/Slice.css +47 -47
- package/src/routes.js +15 -15
- package/src/sliceConfig.json +8 -3
- package/src/testing.js +887 -887
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
<div id="debugger-container">
|
|
2
|
-
<div class="debugger-header">
|
|
3
|
-
<div class="header-content">
|
|
4
|
-
<div class="component-info">
|
|
5
|
-
<div class="component-icon">🔍</div>
|
|
6
|
-
<div class="component-details">
|
|
7
|
-
<div class="component-name">Component Inspector</div>
|
|
8
|
-
<div class="component-id">Ready to debug</div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="header-actions">
|
|
12
|
-
<button class="minimize-btn" title="Minimize">−</button>
|
|
13
|
-
<button id="close-debugger" title="Close">×</button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="debugger-content">
|
|
19
|
-
<div class="tabs-container">
|
|
20
|
-
<div class="tab-nav">
|
|
21
|
-
<button class="tab-btn active" data-tab="props">📋 Props</button>
|
|
22
|
-
<button class="tab-btn" data-tab="info">ℹ️ Info</button>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<div class="tab-content">
|
|
27
|
-
<div class="tab-pane active" id="props-tab">
|
|
28
|
-
<div class="props-container"></div>
|
|
29
|
-
<div class="props-actions">
|
|
30
|
-
<div class="action-buttons">
|
|
31
|
-
<button class="action-btn primary" id="apply-changes">✅ Apply Changes</button>
|
|
32
|
-
<button class="action-btn secondary" id="reset-values">🔄 Reset Values</button>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="actions-note">
|
|
35
|
-
<small>💡 Press Enter on any input to apply changes automatically</small>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div class="tab-pane" id="info-tab">
|
|
41
|
-
<div class="info-container">
|
|
42
|
-
<div class="info-list"></div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<!-- Modal para editar objetos/funciones -->
|
|
49
|
-
<div class="editor-modal" id="editor-modal">
|
|
50
|
-
<div class="modal-content">
|
|
51
|
-
<div class="modal-header">
|
|
52
|
-
<h3 id="modal-title">Edit Property</h3>
|
|
53
|
-
<button class="modal-close" id="modal-close">×</button>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="modal-body">
|
|
56
|
-
<div class="editor-type-selector">
|
|
57
|
-
<button class="type-btn active" data-type="json">📋 JSON</button>
|
|
58
|
-
<button class="type-btn" data-type="function">⚡ Function</button>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="editor-container">
|
|
61
|
-
<textarea id="property-editor" spellcheck="false"></textarea>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="editor-footer">
|
|
64
|
-
<div class="validation-message"></div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
<div class="modal-actions">
|
|
68
|
-
<button class="modal-btn cancel" id="modal-cancel">Cancel</button>
|
|
69
|
-
<button class="modal-btn save" id="modal-save">Save Changes</button>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
1
|
+
<div id="debugger-container">
|
|
2
|
+
<div class="debugger-header">
|
|
3
|
+
<div class="header-content">
|
|
4
|
+
<div class="component-info">
|
|
5
|
+
<div class="component-icon">🔍</div>
|
|
6
|
+
<div class="component-details">
|
|
7
|
+
<div class="component-name">Component Inspector</div>
|
|
8
|
+
<div class="component-id">Ready to debug</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="header-actions">
|
|
12
|
+
<button class="minimize-btn" title="Minimize">−</button>
|
|
13
|
+
<button id="close-debugger" title="Close">×</button>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="debugger-content">
|
|
19
|
+
<div class="tabs-container">
|
|
20
|
+
<div class="tab-nav">
|
|
21
|
+
<button class="tab-btn active" data-tab="props">📋 Props</button>
|
|
22
|
+
<button class="tab-btn" data-tab="info">ℹ️ Info</button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="tab-content">
|
|
27
|
+
<div class="tab-pane active" id="props-tab">
|
|
28
|
+
<div class="props-container"></div>
|
|
29
|
+
<div class="props-actions">
|
|
30
|
+
<div class="action-buttons">
|
|
31
|
+
<button class="action-btn primary" id="apply-changes">✅ Apply Changes</button>
|
|
32
|
+
<button class="action-btn secondary" id="reset-values">🔄 Reset Values</button>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="actions-note">
|
|
35
|
+
<small>💡 Press Enter on any input to apply changes automatically</small>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="tab-pane" id="info-tab">
|
|
41
|
+
<div class="info-container">
|
|
42
|
+
<div class="info-list"></div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<!-- Modal para editar objetos/funciones -->
|
|
49
|
+
<div class="editor-modal" id="editor-modal">
|
|
50
|
+
<div class="modal-content">
|
|
51
|
+
<div class="modal-header">
|
|
52
|
+
<h3 id="modal-title">Edit Property</h3>
|
|
53
|
+
<button class="modal-close" id="modal-close">×</button>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="modal-body">
|
|
56
|
+
<div class="editor-type-selector">
|
|
57
|
+
<button class="type-btn active" data-type="json">📋 JSON</button>
|
|
58
|
+
<button class="type-btn" data-type="function">⚡ Function</button>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="editor-container">
|
|
61
|
+
<textarea id="property-editor" spellcheck="false"></textarea>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="editor-footer">
|
|
64
|
+
<div class="validation-message"></div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="modal-actions">
|
|
68
|
+
<button class="modal-btn cancel" id="modal-cancel">Cancel</button>
|
|
69
|
+
<button class="modal-btn save" id="modal-save">Save Changes</button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
73
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export default class Log {
|
|
2
|
-
constructor(logType, componentCategory, componentSliceId, message, error = null) {
|
|
3
|
-
this.logType = logType;
|
|
4
|
-
this.componentCategory = componentCategory;
|
|
5
|
-
this.componentSliceId = componentSliceId;
|
|
6
|
-
this.message = message;
|
|
7
|
-
this.error = error;
|
|
8
|
-
this.timestamp = new Date();
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
export default class Log {
|
|
2
|
+
constructor(logType, componentCategory, componentSliceId, message, error = null) {
|
|
3
|
+
this.logType = logType;
|
|
4
|
+
this.componentCategory = componentCategory;
|
|
5
|
+
this.componentSliceId = componentSliceId;
|
|
6
|
+
this.message = message;
|
|
7
|
+
this.error = error;
|
|
8
|
+
this.timestamp = new Date();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -18,10 +18,13 @@ export default class StylesManager {
|
|
|
18
18
|
slice.logger.logInfo('StylesManager', `${slice.stylesConfig.requestedStyles[i]} styles loaded`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (slice.themeConfig.enabled) {
|
|
22
|
+
const ThemeManagerClass = slice.frameworkClasses?.ThemeManager;
|
|
23
|
+
if (!ThemeManagerClass) {
|
|
24
|
+
throw new Error('ThemeManager not available');
|
|
25
|
+
}
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
this.themeManager = new ThemeManagerClass();
|
|
25
28
|
let theme;
|
|
26
29
|
|
|
27
30
|
if (slice.themeConfig.saveThemeLocally) {
|
package/Slice/Slice.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Controller from './Components/Structural/Controller/Controller.js';
|
|
2
|
-
import StylesManager from './Components/Structural/StylesManager/StylesManager.js';
|
|
3
1
|
|
|
4
2
|
/**
|
|
5
3
|
* Main Slice.js runtime.
|
|
@@ -8,9 +6,13 @@ export default class Slice {
|
|
|
8
6
|
/**
|
|
9
7
|
* @param {Object} sliceConfig
|
|
10
8
|
*/
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
9
|
+
constructor(sliceConfig, frameworkClasses = null) {
|
|
10
|
+
this.frameworkClasses = frameworkClasses;
|
|
11
|
+
const ControllerClass = frameworkClasses?.Controller;
|
|
12
|
+
const StylesManagerClass = frameworkClasses?.StylesManager;
|
|
13
|
+
|
|
14
|
+
this.controller = ControllerClass ? new ControllerClass() : null;
|
|
15
|
+
this.stylesManager = StylesManagerClass ? new StylesManagerClass() : null;
|
|
14
16
|
this.paths = sliceConfig.paths;
|
|
15
17
|
this.themeConfig = sliceConfig.themeManager;
|
|
16
18
|
this.stylesConfig = sliceConfig.stylesManager;
|
|
@@ -234,13 +236,93 @@ async function init() {
|
|
|
234
236
|
return;
|
|
235
237
|
}
|
|
236
238
|
|
|
237
|
-
|
|
239
|
+
let frameworkClasses = null;
|
|
240
|
+
let bundleConfigJson = null;
|
|
241
|
+
try {
|
|
242
|
+
const response = await fetch('/bundles/bundle.config.json', { cache: 'no-store' });
|
|
243
|
+
if (response.ok) {
|
|
244
|
+
bundleConfigJson = await response.json();
|
|
245
|
+
}
|
|
246
|
+
} catch (error) {
|
|
247
|
+
// ignore
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
if (bundleConfigJson?.production) {
|
|
252
|
+
await import('/bundles/slice-bundle.framework.js');
|
|
253
|
+
frameworkClasses = window.SLICE_FRAMEWORK_CLASSES || null;
|
|
254
|
+
}
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.warn('Framework bundle not available, falling back to dynamic imports');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!frameworkClasses) {
|
|
260
|
+
const imports = await Promise.all([
|
|
261
|
+
import('./Components/Structural/Controller/Controller.js'),
|
|
262
|
+
import('./Components/Structural/StylesManager/StylesManager.js')
|
|
263
|
+
]);
|
|
264
|
+
frameworkClasses = {
|
|
265
|
+
Controller: imports[0].default,
|
|
266
|
+
StylesManager: imports[1].default
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
window.slice = new Slice(sliceConfig, frameworkClasses);
|
|
271
|
+
|
|
272
|
+
// Initialize bundles before building components
|
|
273
|
+
try {
|
|
274
|
+
const configResponse = await fetch('/bundles/bundle.config.json', { cache: 'no-store' });
|
|
275
|
+
if (configResponse.ok) {
|
|
276
|
+
const config = await configResponse.json();
|
|
277
|
+
window.slice.controller.bundleConfig = config;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (window.slice.controller.bundleConfig) {
|
|
281
|
+
const config = window.slice.controller.bundleConfig;
|
|
282
|
+
|
|
283
|
+
const criticalFile = config?.bundles?.critical?.file;
|
|
284
|
+
if (criticalFile) {
|
|
285
|
+
const criticalModule = await import(`/bundles/${criticalFile}`);
|
|
286
|
+
if (criticalModule.SLICE_BUNDLE) {
|
|
287
|
+
window.slice.controller.registerBundle(criticalModule.SLICE_BUNDLE);
|
|
288
|
+
window.slice.controller.loadedBundles.add('critical');
|
|
289
|
+
window.slice.controller.criticalBundleLoaded = true;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const routeBundles = config?.routeBundles || {};
|
|
294
|
+
const initialPath = window.location.pathname || '/';
|
|
295
|
+
const bundlesForRoute = routeBundles[initialPath] || [];
|
|
296
|
+
|
|
297
|
+
const loadRouteBundles = async () => {
|
|
298
|
+
for (const bundleName of bundlesForRoute) {
|
|
299
|
+
if (bundleName === 'critical') continue;
|
|
300
|
+
const bundleInfo = config?.bundles?.routes?.[bundleName];
|
|
301
|
+
if (!bundleInfo?.file) continue;
|
|
302
|
+
const routeModule = await import(`/bundles/${bundleInfo.file}`);
|
|
303
|
+
if (routeModule.SLICE_BUNDLE) {
|
|
304
|
+
window.slice.controller.registerBundle(routeModule.SLICE_BUNDLE);
|
|
305
|
+
window.slice.controller.loadedBundles.add(bundleName);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
if (typeof requestIdleCallback === 'function') {
|
|
311
|
+
requestIdleCallback(() => loadRouteBundles());
|
|
312
|
+
} else {
|
|
313
|
+
setTimeout(() => loadRouteBundles(), 0);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
} catch (error) {
|
|
317
|
+
console.log('📄 Using individual component loading (no bundles found)');
|
|
318
|
+
}
|
|
238
319
|
|
|
239
320
|
slice.paths.structuralComponentFolderPath = '/Slice/Components/Structural';
|
|
240
321
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
322
|
+
if (sliceConfig.logger.enabled) {
|
|
323
|
+
const LoggerModule = window.slice.frameworkClasses?.Logger
|
|
324
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Logger/Logger.js`);
|
|
325
|
+
window.slice.logger = new LoggerModule();
|
|
244
326
|
} else {
|
|
245
327
|
window.slice.logger = {
|
|
246
328
|
logError: () => {},
|
|
@@ -249,42 +331,37 @@ async function init() {
|
|
|
249
331
|
};
|
|
250
332
|
}
|
|
251
333
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
window.slice.debugger = new DebuggerModule();
|
|
334
|
+
if (sliceConfig.debugger.enabled) {
|
|
335
|
+
const DebuggerModule = window.slice.frameworkClasses?.Debugger
|
|
336
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Debugger/Debugger.js`);
|
|
337
|
+
window.slice.debugger = new DebuggerModule();
|
|
257
338
|
await window.slice.debugger.enableDebugMode();
|
|
258
339
|
document.body.appendChild(window.slice.debugger);
|
|
259
340
|
}
|
|
260
341
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
window.slice.eventsDebugger = new EventsDebuggerModule();
|
|
342
|
+
if (sliceConfig.events?.ui?.enabled) {
|
|
343
|
+
const EventsDebuggerModule = window.slice.frameworkClasses?.EventManagerDebugger
|
|
344
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/EventManager/EventManagerDebugger.js`);
|
|
345
|
+
window.slice.eventsDebugger = new EventsDebuggerModule();
|
|
266
346
|
await window.slice.eventsDebugger.init();
|
|
267
347
|
document.body.appendChild(window.slice.eventsDebugger);
|
|
268
348
|
}
|
|
269
349
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
window.slice.contextDebugger = new ContextDebuggerModule();
|
|
350
|
+
if (sliceConfig.context?.ui?.enabled) {
|
|
351
|
+
const ContextDebuggerModule = window.slice.frameworkClasses?.ContextManagerDebugger
|
|
352
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/ContextManager/ContextManagerDebugger.js`);
|
|
353
|
+
window.slice.contextDebugger = new ContextDebuggerModule();
|
|
275
354
|
await window.slice.contextDebugger.init();
|
|
276
355
|
document.body.appendChild(window.slice.contextDebugger);
|
|
277
356
|
}
|
|
278
357
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
);
|
|
358
|
+
if (sliceConfig.events?.enabled) {
|
|
359
|
+
const EventManagerModule = window.slice.frameworkClasses?.EventManager
|
|
360
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/EventManager/EventManager.js`);
|
|
283
361
|
window.slice.events = new EventManagerModule();
|
|
284
362
|
if (typeof window.slice.events.init === 'function') {
|
|
285
363
|
await window.slice.events.init();
|
|
286
364
|
}
|
|
287
|
-
window.slice.logger.logError('Slice', 'EventManager enabled');
|
|
288
365
|
} else {
|
|
289
366
|
window.slice.events = {
|
|
290
367
|
subscribe: () => null,
|
|
@@ -304,15 +381,13 @@ async function init() {
|
|
|
304
381
|
window.slice.logger.logError('Slice', 'EventManager disabled');
|
|
305
382
|
}
|
|
306
383
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
);
|
|
384
|
+
if (sliceConfig.context?.enabled) {
|
|
385
|
+
const ContextManagerModule = window.slice.frameworkClasses?.ContextManager
|
|
386
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/ContextManager/ContextManager.js`);
|
|
311
387
|
window.slice.context = new ContextManagerModule();
|
|
312
388
|
if (typeof window.slice.context.init === 'function') {
|
|
313
389
|
await window.slice.context.init();
|
|
314
390
|
}
|
|
315
|
-
window.slice.logger.logError('Slice', 'ContextManager enabled');
|
|
316
391
|
} else {
|
|
317
392
|
window.slice.context = {
|
|
318
393
|
create: () => false,
|
|
@@ -326,10 +401,13 @@ async function init() {
|
|
|
326
401
|
window.slice.logger.logError('Slice', 'ContextManager disabled');
|
|
327
402
|
}
|
|
328
403
|
|
|
329
|
-
|
|
404
|
+
if (sliceConfig.loading.enabled) {
|
|
330
405
|
const loading = await window.slice.build('Loading', {});
|
|
331
406
|
window.slice.loading = loading;
|
|
332
|
-
|
|
407
|
+
if (typeof loading?.start === 'function') {
|
|
408
|
+
loading.start();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
333
411
|
|
|
334
412
|
await window.slice.stylesManager.init();
|
|
335
413
|
|
|
@@ -363,21 +441,10 @@ async function init() {
|
|
|
363
441
|
|
|
364
442
|
const routesModule = await import(slice.paths.routesFile);
|
|
365
443
|
const routes = routesModule.default;
|
|
366
|
-
|
|
367
|
-
|
|
444
|
+
const RouterModule = window.slice.frameworkClasses?.Router
|
|
445
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Router/Router.js`);
|
|
446
|
+
window.slice.router = new RouterModule(routes);
|
|
368
447
|
await window.slice.router.init();
|
|
369
448
|
}
|
|
370
449
|
|
|
371
|
-
await init();
|
|
372
|
-
|
|
373
|
-
// Initialize bundles if available
|
|
374
|
-
try {
|
|
375
|
-
const { initializeBundles } = await import('/bundles/bundle.config.js');
|
|
376
|
-
if (initializeBundles) {
|
|
377
|
-
await initializeBundles(window.slice);
|
|
378
|
-
console.log('📦 Bundles initialized automatically');
|
|
379
|
-
}
|
|
380
|
-
} catch (error) {
|
|
381
|
-
// Bundles not available, continue with individual component loading
|
|
382
|
-
console.log('📄 Using individual component loading (no bundles found)');
|
|
383
|
-
}
|
|
450
|
+
await init();
|