@fylib/adapter-angular 0.2.2 → 0.2.3
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.
|
@@ -10,6 +10,7 @@ function ngAdd(options) {
|
|
|
10
10
|
addFiles(),
|
|
11
11
|
updateAppConfig(),
|
|
12
12
|
updateAppComponent(),
|
|
13
|
+
updateAppHTML(),
|
|
13
14
|
installDependencies(),
|
|
14
15
|
])(tree, context);
|
|
15
16
|
};
|
|
@@ -61,15 +62,129 @@ function updateAppComponent() {
|
|
|
61
62
|
if (content.includes('FyLibService'))
|
|
62
63
|
return tree;
|
|
63
64
|
let updatedContent = `import { inject, OnInit, signal } from '@angular/core';\n` +
|
|
64
|
-
`import { FyLibService, FySSEService, FyThemeVarsDirective } from '@fylib/adapter-angular';\n` +
|
|
65
|
+
`import { FyLibService, FySSEService, FyThemeVarsDirective, FyLayoutComponent, FyCardComponent, FyButtonComponent, FyIconComponent, FyTextComponent } from '@fylib/adapter-angular';\n` +
|
|
65
66
|
`import { themeConfig } from '../fylib/theme.config';\n` +
|
|
66
67
|
content;
|
|
67
|
-
updatedContent = updatedContent.replace(/imports:\s*\[/, `imports: [FyThemeVarsDirective,
|
|
68
|
+
updatedContent = updatedContent.replace(/imports:\s*\[/, `imports: [\n FyThemeVarsDirective, FyLayoutComponent, FyCardComponent, FyButtonComponent, FyIconComponent, FyTextComponent,`);
|
|
68
69
|
updatedContent = updatedContent.replace(/export class (\w+) \{/, `export class $1 implements OnInit {\n private fylib = inject(FyLibService);\n private sse = inject(FySSEService);\n protected readonly mode = signal<'light' | 'dark'>('light');\n\n ngOnInit() {\n this.fylib.setTheme(themeConfig.theme);\n this.fylib.setMode(this.mode());\n }\n`);
|
|
69
70
|
tree.overwrite(targetPath, updatedContent);
|
|
70
71
|
return tree;
|
|
71
72
|
};
|
|
72
73
|
}
|
|
74
|
+
function updateAppHTML() {
|
|
75
|
+
return (tree) => {
|
|
76
|
+
const htmlPath = 'src/app/app.component.html';
|
|
77
|
+
if (!tree.exists(htmlPath))
|
|
78
|
+
return tree;
|
|
79
|
+
const welcomeTemplate = `
|
|
80
|
+
<div fyThemeVars class="fy-app-container">
|
|
81
|
+
<fy-layout name="app-layout" bgEffect="aurora" [bgEffectIntensity]="0.4">
|
|
82
|
+
<div class="welcome-container">
|
|
83
|
+
<fy-card variant="elevated" class="welcome-card">
|
|
84
|
+
<div fy-card-header class="welcome-header">
|
|
85
|
+
<div class="logo-box">
|
|
86
|
+
<fy-icon name="star" size="lg"></fy-icon>
|
|
87
|
+
</div>
|
|
88
|
+
<fy-text text="Bem-vindo ao fyLib" class="welcome-title"></fy-text>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="welcome-content">
|
|
92
|
+
<p class="welcome-desc">
|
|
93
|
+
Sua jornada para criar interfaces incríveis, modulares e temáticas começa aqui.
|
|
94
|
+
O fyLib já está configurado e pronto para uso!
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
<div class="welcome-actions">
|
|
98
|
+
<a href="https://github.com/dfiney/fylib/" target="_blank">
|
|
99
|
+
<fy-button variant="primary" label="GitHub do Projeto" iconName="search"></fy-button>
|
|
100
|
+
</a>
|
|
101
|
+
<a href="https://www.linkedin.com/in/victor-barberino-373797231/" target="_blank">
|
|
102
|
+
<fy-button variant="secondary" label="LinkedIn do Autor" iconName="user"></fy-button>
|
|
103
|
+
</a>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div fy-card-footer class="welcome-footer">
|
|
108
|
+
<fy-text text="© Finey 2026 · Built with Passion"></fy-text>
|
|
109
|
+
</div>
|
|
110
|
+
</fy-card>
|
|
111
|
+
</div>
|
|
112
|
+
</fy-layout>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<style>
|
|
116
|
+
.fy-app-container {
|
|
117
|
+
height: 100vh;
|
|
118
|
+
width: 100%;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
}
|
|
121
|
+
.welcome-container {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
height: 100%;
|
|
126
|
+
padding: 20px;
|
|
127
|
+
}
|
|
128
|
+
.welcome-card {
|
|
129
|
+
max-width: 500px;
|
|
130
|
+
width: 100%;
|
|
131
|
+
animation: fadeInScale 0.6s ease-out;
|
|
132
|
+
}
|
|
133
|
+
.welcome-header {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
align-items: center;
|
|
137
|
+
gap: 16px;
|
|
138
|
+
padding: 32px 0 16px;
|
|
139
|
+
}
|
|
140
|
+
.logo-box {
|
|
141
|
+
background: var(--fy-colors-primary);
|
|
142
|
+
color: white;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
border-radius: 16px;
|
|
145
|
+
box-shadow: 0 8px 16px rgba(var(--fy-colors-primary-rgb), 0.3);
|
|
146
|
+
}
|
|
147
|
+
.welcome-title {
|
|
148
|
+
font-size: 28px;
|
|
149
|
+
font-weight: 800;
|
|
150
|
+
color: var(--fy-colors-text);
|
|
151
|
+
}
|
|
152
|
+
.welcome-content {
|
|
153
|
+
text-align: center;
|
|
154
|
+
padding: 0 24px 24px;
|
|
155
|
+
}
|
|
156
|
+
.welcome-desc {
|
|
157
|
+
color: var(--fy-colors-secondary);
|
|
158
|
+
line-height: 1.6;
|
|
159
|
+
margin-bottom: 32px;
|
|
160
|
+
}
|
|
161
|
+
.welcome-actions {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: 12px;
|
|
165
|
+
}
|
|
166
|
+
.welcome-actions a {
|
|
167
|
+
width: 100%;
|
|
168
|
+
}
|
|
169
|
+
.welcome-actions fy-button {
|
|
170
|
+
width: 100%;
|
|
171
|
+
}
|
|
172
|
+
.welcome-footer {
|
|
173
|
+
opacity: 0.6;
|
|
174
|
+
font-size: 12px;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@keyframes fadeInScale {
|
|
179
|
+
from { opacity: 0; transform: scale(0.95) translateY(10px); }
|
|
180
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
183
|
+
`;
|
|
184
|
+
tree.overwrite(htmlPath, welcomeTemplate);
|
|
185
|
+
return tree;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
73
188
|
function installDependencies() {
|
|
74
189
|
return (_tree, context) => {
|
|
75
190
|
context.addTask(new tasks_1.NodePackageInstallTask({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAgBA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAgBA,sBAUC;AA1BD,2DAYoC;AACpC,+CAAqD;AACrD,4DAA0E;AAE1E,SAAgB,KAAK,CAAC,OAAY;IAChC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,IAAA,kBAAK,EAAC;YACX,QAAQ,EAAE;YACV,eAAe,EAAE;YACjB,kBAAkB,EAAE;YACpB,aAAa,EAAE;YACf,mBAAmB,EAAE;SACtB,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ;IACf,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,oBAAoB,CAAC,EAAE;QAC/B,IAAA,qBAAQ,EAAC;YACP,GAAG,cAAO;SACX,CAAC;QACF,IAAA,iBAAI,EAAC,WAAW,CAAC;QACjB,IAAA,oBAAO,EAAC,CAAC,SAAoB,EAAE,EAAE;YAC/B,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,OAAO;oBACL,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eAAe;gBACf,wBAAwB;aACzB,CAAC,IAAI,CAAC,GAAG,CAAC;SACZ,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fylib/adapter-angular",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"rxjs": "~7.8.0",
|
|
26
26
|
"tslib": "^2.3.0",
|
|
27
27
|
"@fylib/core": "0.2.0",
|
|
28
|
-
"@fylib/theme": "0.2.0",
|
|
29
28
|
"@fylib/animation": "0.2.0",
|
|
30
|
-
"@fylib/
|
|
29
|
+
"@fylib/theme": "0.2.0",
|
|
31
30
|
"@fylib/config": "0.2.0",
|
|
31
|
+
"@fylib/catalog": "0.2.0",
|
|
32
32
|
"@fylib/crypto": "0.2.0",
|
|
33
33
|
"@fylib/logger": "0.2.0"
|
|
34
34
|
},
|