@uniweb/core 1.5.0 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -52,6 +52,47 @@
52
52
  */
53
53
  export const DEFAULT_ICON_BASE = 'https://uniweb.github.io/icons'
54
54
 
55
+ /**
56
+ * The family code for each name a library goes by, friendly or short: what an address is built from.
57
+ * A library that is not here has no address, and its icon resolves to nothing.
58
+ */
59
+ export const ICON_FAMILY_MAP = {
60
+ lucide: 'lu',
61
+ heroicons: 'hi',
62
+ heroicons2: 'hi2',
63
+ phosphor: 'pi',
64
+ tabler: 'tb',
65
+ feather: 'fi',
66
+ fa: 'fa',
67
+ fa6: 'fa6',
68
+ bootstrap: 'bs',
69
+ 'material-design': 'md',
70
+ 'ant-design': 'ai',
71
+ remix: 'ri',
72
+ 'simple-icons': 'si',
73
+ ionicons: 'io5',
74
+ boxicons: 'bi',
75
+ vscode: 'vsc',
76
+ weather: 'wi',
77
+ game: 'gi',
78
+ lu: 'lu',
79
+ hi: 'hi',
80
+ hi2: 'hi2',
81
+ pi: 'pi',
82
+ tb: 'tb',
83
+ fi: 'fi',
84
+ bs: 'bs',
85
+ md: 'md',
86
+ ai: 'ai',
87
+ ri: 'ri',
88
+ io5: 'io5',
89
+ bi: 'bi',
90
+ si: 'si',
91
+ vsc: 'vsc',
92
+ wi: 'wi',
93
+ gi: 'gi',
94
+ }
95
+
55
96
  /**
56
97
  * Families whose own sites spell a digit off by a hyphen (Lucide's `building-2` and `grid-2x2`,
57
98
  * Heroicons' `bars-3`, Feather's `bar-chart-2`), where the corpus, named after react-icons, does
package/src/uniweb.js CHANGED
@@ -75,8 +75,8 @@ export default class Uniweb {
75
75
  // Set by the runtime from site config.
76
76
  this.iconResolver = null
77
77
 
78
- // Pre-populated icon cache for SSR: Map<"family:name", svgString>
79
- // Populated by prerender before rendering, read synchronously by Icon.
78
+ // Pre-populated icon cache: Map<"library:name", svgString>. Filled before a render by a static
79
+ // build or a host's data step, and in the browser from the page. Read synchronously by Icon.
80
80
  this.iconCache = new Map()
81
81
 
82
82
  // Site tracking — one event stream. The runtime installs it in L2