ezfw-core 1.0.97 → 1.0.98

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.
@@ -1,9 +1,18 @@
1
1
  /**
2
2
  * Icon utilities
3
- * Imports icons from the app configuration
3
+ * Uses a registry pattern - icons are registered by the project's icons.config
4
4
  */
5
5
 
6
- import { ICONS } from '../../../app/config/icons.config.js';
6
+ // Icon registry - populated by registerIcons()
7
+ let ICONS: Record<string, string> = {};
8
+
9
+ /**
10
+ * Register icons from project's icons.config.ts
11
+ * Called automatically by the framework entry point
12
+ */
13
+ export function registerIcons(icons: Record<string, string>): void {
14
+ ICONS = { ...ICONS, ...icons };
15
+ }
7
16
 
8
17
  /**
9
18
  * Get icon SVG content by name
@@ -38,11 +38,15 @@ function generateIndexCode(config, mode) {
38
38
  ? `import './ez/core/ez.js';
39
39
  import './ez-base.css';
40
40
  import './ez/themes/ez-theme.scss';
41
- import './ez/themes/ez-theme-slate.scss';`
41
+ import './ez/themes/ez-theme-slate.scss';
42
+ import { registerIcons } from './ez/components/icon/icons.js';
43
+ import { ICONS } from './app/config/icons.config.js';`
42
44
  : `import 'ezfw-core';
43
45
  import 'ezfw-core/ez-base.css';
44
46
  import 'ezfw-core/themes/ez-theme.scss';
45
- import 'ezfw-core/themes/ez-theme-slate.scss';`;
47
+ import 'ezfw-core/themes/ez-theme-slate.scss';
48
+ import { registerIcons } from 'ezfw-core/components/icon/icons.js';
49
+ import { ICONS } from './app/config/icons.config.js';`;
46
50
 
47
51
  // Framework module globs differ based on mode
48
52
  const fwModulesGlob = mode === 'local'
@@ -87,6 +91,7 @@ ${i18nCode}
87
91
 
88
92
  // Framework internals
89
93
  ez.defineStyles(stylesConfig);
94
+ registerIcons(ICONS);
90
95
 
91
96
  ${fwModulesGlob}
92
97
 
@@ -151,11 +156,15 @@ function generateHydrateCode(config, mode) {
151
156
  ? `import './ez/core/ez.js';
152
157
  import './ez-base.css';
153
158
  import './ez/themes/ez-theme.scss';
154
- import './ez/themes/ez-theme-slate.scss';`
159
+ import './ez/themes/ez-theme-slate.scss';
160
+ import { registerIcons } from './ez/components/icon/icons.js';
161
+ import { ICONS } from './app/config/icons.config.js';`
155
162
  : `import 'ezfw-core';
156
163
  import 'ezfw-core/ez-base.css';
157
164
  import 'ezfw-core/themes/ez-theme.scss';
158
- import 'ezfw-core/themes/ez-theme-slate.scss';`;
165
+ import 'ezfw-core/themes/ez-theme-slate.scss';
166
+ import { registerIcons } from 'ezfw-core/components/icon/icons.js';
167
+ import { ICONS } from './app/config/icons.config.js';`;
159
168
 
160
169
  // Framework module globs differ based on mode
161
170
  const fwModulesGlob = mode === 'local'
@@ -200,6 +209,7 @@ ${i18nCode}
200
209
 
201
210
  // Framework internals
202
211
  ez.defineStyles(stylesConfig);
212
+ registerIcons(ICONS);
203
213
 
204
214
  ${fwModulesGlob}
205
215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezfw-core",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Ez Framework - A declarative component framework for building modern web applications",
5
5
  "type": "module",
6
6
  "main": "./core/ez.ts",