@dumiflex/wp-kit 0.14.0 → 0.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.1](https://github.com/DumiFlex/wp-kit/compare/v0.15.0...v0.15.1) (2026-11-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **PostCard:** show sample values as one line of text ([#115](https://github.com/DumiFlex/wp-kit/issues/115)) ([ced88a1](https://github.com/DumiFlex/wp-kit/commit/ced88a1e4c54ac6c20859b9d858f30f79a4e9edf))
9
+
10
+ ## [0.15.0](https://github.com/DumiFlex/wp-kit/compare/v0.14.0...v0.15.0) (2026-11-09)
11
+
12
+
13
+ ### Features
14
+
15
+ * **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))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **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))
21
+
3
22
  ## [0.14.0](https://github.com/DumiFlex/wp-kit/compare/v0.13.0...v0.14.0) (2026-11-03)
4
23
 
5
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dumiflex/wp-kit",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "Vue 3 component kit shared by the Wildcard Pipeline manager, canvas and community site.",
5
5
  "keywords": [
6
6
  "vue",
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, description, up to
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,14 @@ const tags = computed(() => props.post.tags ?? []);
83
86
  :names="post.bundleModules.names"
84
87
  />
85
88
 
89
+ <p v-if="samples.length" class="wp-post-card__samples" :title="samples.join(' · ')">
90
+ <span class="wp-post-card__samples-k">Rolls</span>
91
+ <template v-for="(v, i) in samples" :key="i">
92
+ <span v-if="i" class="wp-post-card__samples-sep" aria-hidden="true"> · </span>
93
+ <span class="wp-post-card__sample">{{ v }}</span>
94
+ </template>
95
+ </p>
96
+
86
97
  <p v-if="post.description" class="wp-post-card__desc">{{ post.description }}</p>
87
98
 
88
99
  <div v-if="tags.length" class="wp-post-card__tags">
@@ -185,6 +196,23 @@ const tags = computed(() => props.post.tags ?? []);
185
196
  -webkit-line-clamp: 3;
186
197
  -webkit-box-orient: vertical;
187
198
  }
199
+ .wp-post-card__samples {
200
+ margin: 0;
201
+ overflow: hidden;
202
+ font-size: 13px;
203
+ line-height: 1.5;
204
+ color: var(--wp-text);
205
+ white-space: nowrap;
206
+ text-overflow: ellipsis;
207
+ }
208
+ .wp-post-card__samples-k {
209
+ margin-right: 8px;
210
+ font-size: 11px;
211
+ letter-spacing: 0.04em;
212
+ text-transform: uppercase;
213
+ color: var(--wp-text-muted);
214
+ }
215
+ .wp-post-card__samples-sep { color: var(--wp-text-muted); }
188
216
  .wp-post-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
189
217
  .wp-post-card__tags .wp-chip { padding: 2px 8px; font-size: 11px; }
190
218
  .wp-post-card__foot {
@@ -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)) : "—" }}<template v-if="o.weight !== 1"> · ×{{ fmt(o.weight) }}</template></span>
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
  }