@dumiflex/wp-kit 0.14.0 → 0.15.0
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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/PostCard.vue +31 -2
- package/src/WildcardPreview.vue +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.15.0](https://github.com/DumiFlex/wp-kit/compare/v0.14.0...v0.15.0) (2026-11-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **post-card:** show a few sample values from the pack ([#111](https://github.com/DumiFlex/wp-kit/issues/111)) ([c01cdc2](https://github.com/DumiFlex/wp-kit/commit/c01cdc27db3c33c33c7ff59aa96b38473ac6e57e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **preview:** weight multiplier wraps under the chance on narrow cards ([#110](https://github.com/DumiFlex/wp-kit/issues/110)) ([3ad37b8](https://github.com/DumiFlex/wp-kit/commit/3ad37b80c6f2cc724025b86d407ac9e383817767))
|
|
14
|
+
|
|
3
15
|
## [0.14.0](https://github.com/DumiFlex/wp-kit/compare/v0.13.0...v0.14.0) (2026-11-03)
|
|
4
16
|
|
|
5
17
|
|
package/package.json
CHANGED
package/src/PostCard.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
3
|
* A community post as a card: type chip, NSFW / Featured / recommended
|
|
4
|
-
* badges, version, `owner/name` slug, bundle contents,
|
|
5
|
-
* four tags, then stars, downloads and when it was updated. A coloured stripe
|
|
4
|
+
* badges, version, `owner/name` slug, bundle contents, a few sample values
|
|
5
|
+
* from the pack, description, up to four tags, then stars, downloads and when it was updated. A coloured stripe
|
|
6
6
|
* on top says the type; a featured card is tinted, a deleted one faded.
|
|
7
7
|
*
|
|
8
8
|
* The whole card is one link. It renders an `<a>` by default; pass the app's
|
|
@@ -38,6 +38,8 @@ export interface PostCardData {
|
|
|
38
38
|
deleted?: boolean | undefined;
|
|
39
39
|
version?: number | null | undefined;
|
|
40
40
|
bundleModules?: { count: number; names: string[] } | null | undefined;
|
|
41
|
+
/** A few values the pack rolls (its options), shown as "what it makes". */
|
|
42
|
+
samples?: string[] | undefined;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
const props = withDefaults(defineProps<{
|
|
@@ -52,6 +54,7 @@ const type = computed(() => itemType(props.post.kind, props.post.subtype));
|
|
|
52
54
|
const owner = computed(() => props.post.slug.split("/")[0]);
|
|
53
55
|
const name = computed(() => props.post.slug.split("/").slice(1).join("/"));
|
|
54
56
|
const tags = computed(() => props.post.tags ?? []);
|
|
57
|
+
const samples = computed(() => (props.post.samples ?? []).filter((v) => v.trim()).slice(0, 4));
|
|
55
58
|
</script>
|
|
56
59
|
|
|
57
60
|
<template>
|
|
@@ -83,6 +86,10 @@ const tags = computed(() => props.post.tags ?? []);
|
|
|
83
86
|
:names="post.bundleModules.names"
|
|
84
87
|
/>
|
|
85
88
|
|
|
89
|
+
<ul v-if="samples.length" class="wp-post-card__samples" aria-label="Sample values">
|
|
90
|
+
<li v-for="(v, i) in samples" :key="i" class="wp-post-card__sample">{{ v }}</li>
|
|
91
|
+
</ul>
|
|
92
|
+
|
|
86
93
|
<p v-if="post.description" class="wp-post-card__desc">{{ post.description }}</p>
|
|
87
94
|
|
|
88
95
|
<div v-if="tags.length" class="wp-post-card__tags">
|
|
@@ -185,6 +192,28 @@ const tags = computed(() => props.post.tags ?? []);
|
|
|
185
192
|
-webkit-line-clamp: 3;
|
|
186
193
|
-webkit-box-orient: vertical;
|
|
187
194
|
}
|
|
195
|
+
.wp-post-card__samples {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-wrap: wrap;
|
|
198
|
+
gap: 5px;
|
|
199
|
+
margin: 0;
|
|
200
|
+
padding: 0;
|
|
201
|
+
list-style: none;
|
|
202
|
+
}
|
|
203
|
+
.wp-post-card__sample {
|
|
204
|
+
max-width: 100%;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
padding: 3px 9px;
|
|
207
|
+
font-family: var(--wp-font-mono);
|
|
208
|
+
font-size: 12px;
|
|
209
|
+
line-height: 1.4;
|
|
210
|
+
color: var(--wp-text);
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
text-overflow: ellipsis;
|
|
213
|
+
background: color-mix(in oklab, var(--post-card-c) 12%, var(--wp-bg-2));
|
|
214
|
+
border: 1px solid color-mix(in oklab, var(--post-card-c) 28%, var(--wp-border));
|
|
215
|
+
border-radius: min(6px, var(--wp-radius-cap, 999px));
|
|
216
|
+
}
|
|
188
217
|
.wp-post-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
189
218
|
.wp-post-card__tags .wp-chip { padding: 2px 8px; font-size: 11px; }
|
|
190
219
|
.wp-post-card__foot {
|
package/src/WildcardPreview.vue
CHANGED
|
@@ -405,7 +405,10 @@ function isLong(o: WildcardOption): boolean {
|
|
|
405
405
|
>{{ expanded.has(`${g.name}|${oidx}`) ? "Show less" : "Show all" }}</Button>
|
|
406
406
|
</td>
|
|
407
407
|
<td class="wp-wc__chance">
|
|
408
|
-
<span>{{ totalWeight ? pct(Math.max(0, o.weight)) : "—" }}<
|
|
408
|
+
<span>{{ totalWeight ? pct(Math.max(0, o.weight)) : "—" }}<span
|
|
409
|
+
v-if="o.weight !== 1"
|
|
410
|
+
class="wp-wc__mult"
|
|
411
|
+
><span class="wp-wc__sep"> · </span>×{{ fmt(o.weight) }}</span></span>
|
|
409
412
|
<span
|
|
410
413
|
v-if="o.fallback"
|
|
411
414
|
class="wp-pv-fbtag"
|
|
@@ -549,6 +552,13 @@ function isLong(o: WildcardOption): boolean {
|
|
|
549
552
|
.wp-wc__col-chance {
|
|
550
553
|
width: 56px;
|
|
551
554
|
}
|
|
555
|
+
/* "29% · ×2" doesn't fit 56px: the weight goes on its own line. */
|
|
556
|
+
.wp-wc__mult {
|
|
557
|
+
display: block;
|
|
558
|
+
}
|
|
559
|
+
.wp-wc__sep {
|
|
560
|
+
display: none;
|
|
561
|
+
}
|
|
552
562
|
.wp-wc__bar {
|
|
553
563
|
display: none;
|
|
554
564
|
}
|