@asor-studio/asor-cli 1.0.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 +24 -0
- package/README.md +293 -0
- package/cli-command/generate-atom.js +2 -0
- package/cli-command/generate-molecule.js +2 -0
- package/cli-command/generate-organism.js +2 -0
- package/cli-command/generate-page.js +2 -0
- package/cli-command/setup-asor-core.js +2 -0
- package/cli.js +2 -0
- package/gen-template/generate-atom/atom.html.template +26 -0
- package/gen-template/generate-atom/atom.ts.template +69 -0
- package/gen-template/generate-molecule/molecule.html.template +41 -0
- package/gen-template/generate-molecule/molecule.ts.template +69 -0
- package/gen-template/generate-organism/organism.html.template +41 -0
- package/gen-template/generate-organism/organism.ts.template +69 -0
- package/gen-template/generate-page/page.component.html.template +63 -0
- package/gen-template/generate-page/page.component.ts.template +56 -0
- package/gen-template/setup-asor-core/src/app/app.config.ts.template +46 -0
- package/gen-template/setup-asor-core/src/app/app.routes.ts.template +40 -0
- package/gen-template/setup-asor-core/src/app/config/app-asor.config.ts.template +64 -0
- package/gen-template/setup-asor-core/src/app/config/app-cache.config.ts.template +26 -0
- package/gen-template/setup-asor-core/src/app/config/app-state.config.ts.template +26 -0
- package/gen-template/setup-asor-core/src/app/config/app.config.ts.template +62 -0
- package/gen-template/setup-asor-core/src/app/config/interfaces/app-state.interfaces.ts.template +5 -0
- package/gen-template/setup-asor-core/src/app/molecules/molecule-sample-widget/sample-widget.molecule.html.template +84 -0
- package/gen-template/setup-asor-core/src/app/molecules/molecule-sample-widget/sample-widget.molecule.ts.template +56 -0
- package/gen-template/setup-asor-core/src/app/pages/page-home/asor-logo.ts.template +1 -0
- package/gen-template/setup-asor-core/src/app/pages/page-home/home.component.html.template +521 -0
- package/gen-template/setup-asor-core/src/app/pages/page-home/home.component.ts.template +99 -0
- package/gen-template/setup-asor-core/src/assets/i18n/app/molecule-sample-widget/en.json.template +7 -0
- package/gen-template/setup-asor-core/src/assets/i18n/app/molecule-sample-widget/it.json.template +7 -0
- package/gen-template/setup-asor-core/src/assets/i18n/app/page-home/en.json.template +19 -0
- package/gen-template/setup-asor-core/src/assets/i18n/app/page-home/it.json.template +19 -0
- package/package.json +31 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { BaseStorageComponent, TranslatePipe, ConsoleLogsUtility } from '@asor-studio/asor-core';
|
|
4
|
+
import { IAppSystemStatus } from '../../config/interfaces/app-state.interfaces';
|
|
5
|
+
import { SampleWidgetMolecule } from '../../molecules/molecule-sample-widget/sample-widget.molecule';
|
|
6
|
+
import { ASOR_CORE_LOGO_BASE64 } from './asor-logo';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Page Component: PageHomeComponent
|
|
10
|
+
*
|
|
11
|
+
* ATOMIC DESIGN ROLE:
|
|
12
|
+
* A Page is the highest level of the atomic design hierarchy. It orchestrates atoms, molecules, and organisms
|
|
13
|
+
* to form a complete functional view or screen of the application.
|
|
14
|
+
*
|
|
15
|
+
* I18N / TRANSLATIONS:
|
|
16
|
+
* Translations for this page can be found (or added) in:
|
|
17
|
+
* `assets/i18n/<prefix>/page-home/<lang>.json`
|
|
18
|
+
*
|
|
19
|
+
* ROUTE CONFIGURATION:
|
|
20
|
+
* This page is directly mapped to a route in `src/app/app.routes.ts`.
|
|
21
|
+
* Configuration for its components (Atoms, Molecules, Organisms) is managed via the `data` property of the route.
|
|
22
|
+
*/
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'app-home-page',
|
|
25
|
+
standalone: true,
|
|
26
|
+
imports: [CommonModule, TranslatePipe, SampleWidgetMolecule],
|
|
27
|
+
templateUrl: './home.component.html',
|
|
28
|
+
})
|
|
29
|
+
export class PageHomeComponent extends BaseStorageComponent<IAppSystemStatus> {
|
|
30
|
+
/**
|
|
31
|
+
* Unique identifier for the component class.
|
|
32
|
+
* CRITICAL for asor-core: used by the framework to identify this component
|
|
33
|
+
* within route metadata and correctly resolve its configuration/i18n paths.
|
|
34
|
+
*/
|
|
35
|
+
public static override readonly className: string = 'PageHomeComponent';
|
|
36
|
+
public asorLogo = ASOR_CORE_LOGO_BASE64;
|
|
37
|
+
public isStateSectionHighlighted: boolean = false;
|
|
38
|
+
public widgetHighlightToken: number = 0;
|
|
39
|
+
private stateHighlightTimeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
40
|
+
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public toggleMenu(): void {
|
|
46
|
+
this.props.isMenuOpen = !this.props.isMenuOpen;
|
|
47
|
+
this.triggerInteractiveHighlight();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public changeUser(): void {
|
|
51
|
+
this.props.currentUser = this.props.currentUser === 'Admin' ? 'Guest' : 'Admin';
|
|
52
|
+
this.triggerInteractiveHighlight();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private triggerInteractiveHighlight(): void {
|
|
56
|
+
this.widgetHighlightToken += 1;
|
|
57
|
+
this.isStateSectionHighlighted = false;
|
|
58
|
+
|
|
59
|
+
if (this.stateHighlightTimeoutId) {
|
|
60
|
+
clearTimeout(this.stateHighlightTimeoutId);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
this.isStateSectionHighlighted = true;
|
|
65
|
+
|
|
66
|
+
this.stateHighlightTimeoutId = setTimeout(() => {
|
|
67
|
+
this.isStateSectionHighlighted = false;
|
|
68
|
+
this.stateHighlightTimeoutId = null;
|
|
69
|
+
}, 820);
|
|
70
|
+
}, 0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Lifecycle hook invoked when the storage-backed state changes.
|
|
75
|
+
* Useful for observing app-state mutations propagated by the shared storage layer.
|
|
76
|
+
*/
|
|
77
|
+
override storageHandlerDataChanges(prev: IAppSystemStatus, curr: IAppSystemStatus): void {
|
|
78
|
+
ConsoleLogsUtility.info(this, 'Mutable App State:', prev, '->', curr);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Lifecycle hook called when the component view is about to enter at a generic level.
|
|
83
|
+
* Used for system-wide initialization logic common to all asor components.
|
|
84
|
+
*/
|
|
85
|
+
override baseCompViewEnter(): void {
|
|
86
|
+
super.baseCompViewEnter();
|
|
87
|
+
ConsoleLogsUtility.info(this, 'Homepage loaded and registered to StateService!');
|
|
88
|
+
|
|
89
|
+
if (typeof window !== 'undefined') {
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
const asorStudioSection = document.getElementById('home-asor-studio');
|
|
92
|
+
asorStudioSection?.scrollIntoView({
|
|
93
|
+
behavior: 'smooth',
|
|
94
|
+
block: 'start',
|
|
95
|
+
});
|
|
96
|
+
}, 150);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"HOME.GLOBAL_APP_STATE": "Global App State",
|
|
3
|
+
"HOME.VERSION": "Version",
|
|
4
|
+
"HOME.MENU": "Menu",
|
|
5
|
+
"HOME.OPEN": "Open",
|
|
6
|
+
"HOME.CLOSED": "Closed",
|
|
7
|
+
"HOME.USER": "User",
|
|
8
|
+
"HOME.UNDEFINED": "Undefined",
|
|
9
|
+
"HOME.SIMULATE_AUTH": "Simulate Auth Interaction",
|
|
10
|
+
"HOME.CLOSE_MENU": "Close Menu",
|
|
11
|
+
"HOME.OPEN_MENU": "Open Menu",
|
|
12
|
+
"HOME.DASHBOARD": "Dashboard",
|
|
13
|
+
"HOME.SETTINGS": "Settings",
|
|
14
|
+
"HOME.LOGOUT": "Logout",
|
|
15
|
+
"HOME.WELCOME_MESSAGE": "Welcome to your first ASOR page",
|
|
16
|
+
"HOME.WELCOME_ROBROSC": "Welcome to Asor-Core create by robrosc",
|
|
17
|
+
"HOME.CONGRATULATIONS": "Congratulations! Your state-managed app is running.",
|
|
18
|
+
"HOME.OBSERVING_REACTIVE_PROXY": "This layout is observing the reactive Proxy DataSet"
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"HOME.GLOBAL_APP_STATE": "Stato Globale dell'App",
|
|
3
|
+
"HOME.VERSION": "Versione",
|
|
4
|
+
"HOME.MENU": "Menu",
|
|
5
|
+
"HOME.OPEN": "Aperto",
|
|
6
|
+
"HOME.CLOSED": "Chiuso",
|
|
7
|
+
"HOME.USER": "Utente",
|
|
8
|
+
"HOME.UNDEFINED": "Non definito",
|
|
9
|
+
"HOME.SIMULATE_AUTH": "Simula Interazione Auth",
|
|
10
|
+
"HOME.CLOSE_MENU": "Chiudi Menu",
|
|
11
|
+
"HOME.OPEN_MENU": "Apri Menu",
|
|
12
|
+
"HOME.DASHBOARD": "Bacheca",
|
|
13
|
+
"HOME.SETTINGS": "Impostazioni",
|
|
14
|
+
"HOME.LOGOUT": "Esci",
|
|
15
|
+
"HOME.WELCOME_MESSAGE": "Benvenuto nella tua prima pagina ASOR",
|
|
16
|
+
"HOME.WELCOME_ROBROSC": "Benvenuto in Asor-Core creato da robrosc",
|
|
17
|
+
"HOME.CONGRATULATIONS": "Congratulazioni! La tua app gestita a stati e in esecuzione.",
|
|
18
|
+
"HOME.OBSERVING_REACTIVE_PROXY": "Questo layout sta osservando il Proxy DataSet reattivo"
|
|
19
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@asor-studio/asor-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool to initialize Angular projects with @asor-studio/asor-core",
|
|
5
|
+
"main": "./cli-command/setup-asor-core.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"asor": "./cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node --test ./test/*.test.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"cli.js",
|
|
14
|
+
"cli-command/",
|
|
15
|
+
"gen-template/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"asor",
|
|
21
|
+
"asor-core",
|
|
22
|
+
"angular",
|
|
23
|
+
"cli",
|
|
24
|
+
"scaffold"
|
|
25
|
+
],
|
|
26
|
+
"author": "robrosc",
|
|
27
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|