@uniweb/core 1.5.0 → 1.5.2
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 +2 -2
- package/src/icon-corpus.js +41 -0
- package/src/page.js +4 -2
- package/src/uniweb.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vitest": "^4.1.7"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@uniweb/semantic-parser": "~1.13.
|
|
56
|
+
"@uniweb/semantic-parser": "~1.13.1",
|
|
57
57
|
"@uniweb/theming": "~1.2.1"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
package/src/icon-corpus.js
CHANGED
|
@@ -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/page.js
CHANGED
|
@@ -218,8 +218,10 @@ export default class Page {
|
|
|
218
218
|
alternates: website?.getPageAlternates?.(this) ?? [],
|
|
219
219
|
og: {
|
|
220
220
|
// Page content wins; site-level seo only fills gaps. Image is the
|
|
221
|
-
// exception authors most want cascaded (the shared social card).
|
|
222
|
-
title
|
|
221
|
+
// exception authors most want cascaded (the shared social card). And
|
|
222
|
+
// the home page's title, which is its name in the menu, so "Home" was
|
|
223
|
+
// what the whole site shared as; there the site's own title is the one.
|
|
224
|
+
title: this.seo.ogTitle || (this.isIndex && site.ogTitle) || resolvedTitle || site.ogTitle,
|
|
223
225
|
description: this.seo.ogDescription || own || site.ogDescription || home,
|
|
224
226
|
image: image ? absoluteUrl(address, image) || image : null,
|
|
225
227
|
url: canonical,
|
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
|
|
79
|
-
//
|
|
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
|