handzon-core 0.14.0 → 0.14.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": "handzon-core",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Core framework for Handzon — layouts, components, content + AI libs, and server runtime (handlers, DB, auth, migration runner) consumed by Handzon scaffolds.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -344,6 +344,12 @@ const defaultCover = getDefaultCoverMeta({
|
|
|
344
344
|
.fallback-keywords span:nth-child(3) {
|
|
345
345
|
margin-left: 0.55rem;
|
|
346
346
|
}
|
|
347
|
+
.fallback-keywords span {
|
|
348
|
+
max-width: 100%;
|
|
349
|
+
overflow: hidden;
|
|
350
|
+
text-overflow: clip;
|
|
351
|
+
white-space: nowrap;
|
|
352
|
+
}
|
|
347
353
|
.variant-1 .fallback-keywords {
|
|
348
354
|
inset: 2.9rem 1rem auto auto;
|
|
349
355
|
justify-items: end;
|
package/src/lib/defaultCover.ts
CHANGED
|
@@ -83,13 +83,16 @@ function stableIndex(value: string, modulo: number): number {
|
|
|
83
83
|
return hash % modulo;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function
|
|
87
|
-
return value
|
|
86
|
+
function normalizeKeywords(value: string): string[] {
|
|
87
|
+
return value
|
|
88
|
+
.split(/[^a-z0-9]+/i)
|
|
89
|
+
.map((word) => word.toUpperCase())
|
|
90
|
+
.filter(Boolean);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
function getKeywords(input: DefaultCoverInput): string[] {
|
|
91
94
|
const words = [...input.tags, ...input.title.split(/\s+/)]
|
|
92
|
-
.
|
|
95
|
+
.flatMap(normalizeKeywords)
|
|
93
96
|
.filter((word) => word.length >= 2 && !KEYWORD_STOPWORDS.has(word));
|
|
94
97
|
|
|
95
98
|
return Array.from(new Set(words)).slice(0, 3);
|