slicejs-web-framework 2.3.5 → 2.4.0
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 +111 -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,86 @@ async function init() {
|
|
|
234
236
|
return;
|
|
235
237
|
}
|
|
236
238
|
|
|
237
|
-
|
|
239
|
+
let frameworkClasses = null;
|
|
240
|
+
try {
|
|
241
|
+
const bundleConfig = await import('/bundles/bundle.config.js');
|
|
242
|
+
const isProduction = bundleConfig?.SLICE_BUNDLE_CONFIG?.production;
|
|
243
|
+
|
|
244
|
+
if (isProduction) {
|
|
245
|
+
await import('/bundles/slice-bundle.framework.js');
|
|
246
|
+
frameworkClasses = window.SLICE_FRAMEWORK_CLASSES || null;
|
|
247
|
+
}
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.warn('Framework bundle not available, falling back to dynamic imports');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!frameworkClasses) {
|
|
253
|
+
const imports = await Promise.all([
|
|
254
|
+
import('./Components/Structural/Controller/Controller.js'),
|
|
255
|
+
import('./Components/Structural/StylesManager/StylesManager.js')
|
|
256
|
+
]);
|
|
257
|
+
frameworkClasses = {
|
|
258
|
+
Controller: imports[0].default,
|
|
259
|
+
StylesManager: imports[1].default
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
window.slice = new Slice(sliceConfig, frameworkClasses);
|
|
264
|
+
|
|
265
|
+
// Initialize bundles before building components
|
|
266
|
+
try {
|
|
267
|
+
const configResponse = await fetch('/bundles/bundle.config.json', { cache: 'no-store' });
|
|
268
|
+
if (configResponse.ok) {
|
|
269
|
+
const config = await configResponse.json();
|
|
270
|
+
window.slice.controller.bundleConfig = config;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (window.slice.controller.bundleConfig) {
|
|
274
|
+
const config = window.slice.controller.bundleConfig;
|
|
275
|
+
|
|
276
|
+
const criticalFile = config?.bundles?.critical?.file;
|
|
277
|
+
if (criticalFile) {
|
|
278
|
+
const criticalModule = await import(`/bundles/${criticalFile}`);
|
|
279
|
+
if (criticalModule.SLICE_BUNDLE) {
|
|
280
|
+
window.slice.controller.registerBundle(criticalModule.SLICE_BUNDLE);
|
|
281
|
+
window.slice.controller.loadedBundles.add('critical');
|
|
282
|
+
window.slice.controller.criticalBundleLoaded = true;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const routeBundles = config?.routeBundles || {};
|
|
287
|
+
const initialPath = window.location.pathname || '/';
|
|
288
|
+
const bundlesForRoute = routeBundles[initialPath] || [];
|
|
289
|
+
|
|
290
|
+
const loadRouteBundles = async () => {
|
|
291
|
+
for (const bundleName of bundlesForRoute) {
|
|
292
|
+
if (bundleName === 'critical') continue;
|
|
293
|
+
const bundleInfo = config?.bundles?.routes?.[bundleName];
|
|
294
|
+
if (!bundleInfo?.file) continue;
|
|
295
|
+
const routeModule = await import(`/bundles/${bundleInfo.file}`);
|
|
296
|
+
if (routeModule.SLICE_BUNDLE) {
|
|
297
|
+
window.slice.controller.registerBundle(routeModule.SLICE_BUNDLE);
|
|
298
|
+
window.slice.controller.loadedBundles.add(bundleName);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
if (typeof requestIdleCallback === 'function') {
|
|
304
|
+
requestIdleCallback(() => loadRouteBundles());
|
|
305
|
+
} else {
|
|
306
|
+
setTimeout(() => loadRouteBundles(), 0);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
} catch (error) {
|
|
310
|
+
console.log('📄 Using individual component loading (no bundles found)');
|
|
311
|
+
}
|
|
238
312
|
|
|
239
313
|
slice.paths.structuralComponentFolderPath = '/Slice/Components/Structural';
|
|
240
314
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
315
|
+
if (sliceConfig.logger.enabled) {
|
|
316
|
+
const LoggerModule = window.slice.frameworkClasses?.Logger
|
|
317
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Logger/Logger.js`);
|
|
318
|
+
window.slice.logger = new LoggerModule();
|
|
244
319
|
} else {
|
|
245
320
|
window.slice.logger = {
|
|
246
321
|
logError: () => {},
|
|
@@ -249,42 +324,37 @@ async function init() {
|
|
|
249
324
|
};
|
|
250
325
|
}
|
|
251
326
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
window.slice.debugger = new DebuggerModule();
|
|
327
|
+
if (sliceConfig.debugger.enabled) {
|
|
328
|
+
const DebuggerModule = window.slice.frameworkClasses?.Debugger
|
|
329
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Debugger/Debugger.js`);
|
|
330
|
+
window.slice.debugger = new DebuggerModule();
|
|
257
331
|
await window.slice.debugger.enableDebugMode();
|
|
258
332
|
document.body.appendChild(window.slice.debugger);
|
|
259
333
|
}
|
|
260
334
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
window.slice.eventsDebugger = new EventsDebuggerModule();
|
|
335
|
+
if (sliceConfig.events?.ui?.enabled) {
|
|
336
|
+
const EventsDebuggerModule = window.slice.frameworkClasses?.EventManagerDebugger
|
|
337
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/EventManager/EventManagerDebugger.js`);
|
|
338
|
+
window.slice.eventsDebugger = new EventsDebuggerModule();
|
|
266
339
|
await window.slice.eventsDebugger.init();
|
|
267
340
|
document.body.appendChild(window.slice.eventsDebugger);
|
|
268
341
|
}
|
|
269
342
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
window.slice.contextDebugger = new ContextDebuggerModule();
|
|
343
|
+
if (sliceConfig.context?.ui?.enabled) {
|
|
344
|
+
const ContextDebuggerModule = window.slice.frameworkClasses?.ContextManagerDebugger
|
|
345
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/ContextManager/ContextManagerDebugger.js`);
|
|
346
|
+
window.slice.contextDebugger = new ContextDebuggerModule();
|
|
275
347
|
await window.slice.contextDebugger.init();
|
|
276
348
|
document.body.appendChild(window.slice.contextDebugger);
|
|
277
349
|
}
|
|
278
350
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
);
|
|
351
|
+
if (sliceConfig.events?.enabled) {
|
|
352
|
+
const EventManagerModule = window.slice.frameworkClasses?.EventManager
|
|
353
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/EventManager/EventManager.js`);
|
|
283
354
|
window.slice.events = new EventManagerModule();
|
|
284
355
|
if (typeof window.slice.events.init === 'function') {
|
|
285
356
|
await window.slice.events.init();
|
|
286
357
|
}
|
|
287
|
-
window.slice.logger.logError('Slice', 'EventManager enabled');
|
|
288
358
|
} else {
|
|
289
359
|
window.slice.events = {
|
|
290
360
|
subscribe: () => null,
|
|
@@ -304,15 +374,13 @@ async function init() {
|
|
|
304
374
|
window.slice.logger.logError('Slice', 'EventManager disabled');
|
|
305
375
|
}
|
|
306
376
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
);
|
|
377
|
+
if (sliceConfig.context?.enabled) {
|
|
378
|
+
const ContextManagerModule = window.slice.frameworkClasses?.ContextManager
|
|
379
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/ContextManager/ContextManager.js`);
|
|
311
380
|
window.slice.context = new ContextManagerModule();
|
|
312
381
|
if (typeof window.slice.context.init === 'function') {
|
|
313
382
|
await window.slice.context.init();
|
|
314
383
|
}
|
|
315
|
-
window.slice.logger.logError('Slice', 'ContextManager enabled');
|
|
316
384
|
} else {
|
|
317
385
|
window.slice.context = {
|
|
318
386
|
create: () => false,
|
|
@@ -326,10 +394,13 @@ async function init() {
|
|
|
326
394
|
window.slice.logger.logError('Slice', 'ContextManager disabled');
|
|
327
395
|
}
|
|
328
396
|
|
|
329
|
-
|
|
397
|
+
if (sliceConfig.loading.enabled) {
|
|
330
398
|
const loading = await window.slice.build('Loading', {});
|
|
331
399
|
window.slice.loading = loading;
|
|
332
|
-
|
|
400
|
+
if (typeof loading?.start === 'function') {
|
|
401
|
+
loading.start();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
333
404
|
|
|
334
405
|
await window.slice.stylesManager.init();
|
|
335
406
|
|
|
@@ -363,21 +434,10 @@ async function init() {
|
|
|
363
434
|
|
|
364
435
|
const routesModule = await import(slice.paths.routesFile);
|
|
365
436
|
const routes = routesModule.default;
|
|
366
|
-
|
|
367
|
-
|
|
437
|
+
const RouterModule = window.slice.frameworkClasses?.Router
|
|
438
|
+
|| await window.slice.getClass(`${slice.paths.structuralComponentFolderPath}/Router/Router.js`);
|
|
439
|
+
window.slice.router = new RouterModule(routes);
|
|
368
440
|
await window.slice.router.init();
|
|
369
441
|
}
|
|
370
442
|
|
|
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
|
-
}
|
|
443
|
+
await init();
|