@dumiflex/wp-kit 0.7.0 → 0.7.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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.1](https://github.com/DumiFlex/wp-kit/compare/v0.7.0...v0.7.1) (2026-11-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * payload previews load their sheet once; SelectionBar says "1 report selected" ([#75](https://github.com/DumiFlex/wp-kit/issues/75)) ([d2774da](https://github.com/DumiFlex/wp-kit/commit/d2774dae3970f3b093778b0d84c5480a43961f9d))
9
+
3
10
  ## [0.7.0](https://github.com/DumiFlex/wp-kit/compare/v0.6.0...v0.7.0) (2026-11-03)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dumiflex/wp-kit",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Vue 3 component kit shared by the Wildcard Pipeline manager, canvas and community site.",
5
5
  "keywords": [
6
6
  "vue",
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /**
3
5
  * Bundle: what the bundle needs from outside vs what it sets (folded from
4
6
  * its children), then a child list beside the selected child's own full
@@ -195,7 +197,6 @@ const counts = computed(() => {
195
197
  </div>
196
198
  </template>
197
199
 
198
- <style scoped src="./preview.css"></style>
199
200
  <style scoped>
200
201
  .wp-bd-flow {
201
202
  display: grid;
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /** Combine: the template in its own block, its negative under it, and a
3
5
  * list of the variables it reads with where each one is used. */
4
6
  import { computed, ref } from "vue";
@@ -130,7 +132,6 @@ const shown = computed(() => (showAll.value ? inputs.value : inputs.value.slice(
130
132
  </div>
131
133
  </template>
132
134
 
133
- <style scoped src="./preview.css"></style>
134
135
  <style scoped>
135
136
  .wp-cb__out {
136
137
  font-family: var(--wp-font-mono);
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /**
3
5
  * Constraint: counts up top, then the grouped matrix (ConstraintMatrixPreview)
4
6
  * or, for a big matrix, a searchable list of only the cells that do
@@ -226,7 +228,6 @@ function fmtFactor(f: number): string {
226
228
  </div>
227
229
  </template>
228
230
 
229
- <style scoped src="./preview.css"></style>
230
231
  <style scoped>
231
232
  .wp-cn-wrap {
232
233
  padding: 14px 16px 16px;
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /**
3
5
  * Derivation as rule cards: what it reads / writes / sends to negatives,
4
6
  * then per rule IF / ELSE IF / ELSE with nested AND / OR groups and every
@@ -191,7 +193,6 @@ function toggle(i: number): void {
191
193
  </div>
192
194
  </template>
193
195
 
194
- <style scoped src="./preview.css"></style>
195
196
  <style scoped>
196
197
  .wp-dv-io {
197
198
  display: flex;
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /** Fixed values as a searchable variable → value → negative table, paged so
3
5
  * a long list stays short until asked. */
4
6
  import { computed, ref } from "vue";
@@ -181,4 +183,3 @@ function toggle(i: number): void {
181
183
  </div>
182
184
  </template>
183
185
 
184
- <style scoped src="./preview.css"></style>
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /**
3
5
  * Rich, read-only preview of a published module or bundle payload: the
4
6
  * community post page and its embed draw it, and the manager can too.
@@ -146,7 +148,6 @@ const KNOWN = new Set(["wildcard", "fixed_values", "combine", "derivation", "con
146
148
  </p>
147
149
  </template>
148
150
 
149
- <style scoped src="./preview.css"></style>
150
151
  <style scoped>
151
152
  .wp-payload-raw {
152
153
  padding: 18px 24px 22px;
@@ -11,16 +11,20 @@
11
11
  * `#start` sits right after the count (a filter, an option), the default slot
12
12
  * on the right before Clear. `sticky` keeps it at the top of its scroll area
13
13
  * while the list scrolls under it (`--wp-selection-bar-top` moves it below a
14
- * fixed header). `noun` says what is selected ("3 options selected"). Escape
14
+ * fixed header). `noun` says what is selected ("3 options selected");
15
+ * `noun-one` is its singular for a count of 1 ("1 option selected"), by
16
+ * default the noun without its last "s". Escape
15
17
  * inside the bar clears, like Clear; the count is read out as it changes.
16
18
  */
17
- import { onBeforeUnmount, onMounted, ref } from "vue";
19
+ import { computed, onBeforeUnmount, onMounted, ref } from "vue";
18
20
  import Button from "./Button.vue";
19
21
 
20
22
  const props = withDefaults(defineProps<{
21
23
  count: number;
22
24
  /** What a row is, plural ("options"); left out it says "3 selected". */
23
25
  noun?: string | undefined;
26
+ /** The noun for one row ("option"); defaults to `noun` without its last "s". */
27
+ nounOne?: string | undefined;
24
28
  /** Stick to the top of the scroll area. */
25
29
  sticky?: boolean | undefined;
26
30
  /** Hide the Clear button (the host clears another way). */
@@ -28,10 +32,17 @@ const props = withDefaults(defineProps<{
28
32
  clearLabel?: string | undefined;
29
33
  /** The toolbar's accessible name. */
30
34
  label?: string | undefined;
31
- }>(), { noun: undefined, clearLabel: "Clear", label: "Bulk actions" });
35
+ }>(), { noun: undefined, nounOne: undefined, clearLabel: "Clear", label: "Bulk actions" });
32
36
 
33
37
  const emit = defineEmits<{ clear: [] }>();
34
38
 
39
+ /** "3 options selected", "1 option selected", or "3 selected" with no noun. */
40
+ const countText = computed(() => {
41
+ if (!props.noun) return `${props.count} selected`;
42
+ const one = props.nounOne ?? props.noun.replace(/s$/, "");
43
+ return `${props.count} ${props.count === 1 ? one : props.noun} selected`;
44
+ });
45
+
35
46
  function onKeydown(ev: KeyboardEvent): void {
36
47
  if (ev.key !== "Escape" || props.hideClear) return;
37
48
  ev.stopPropagation();
@@ -55,7 +66,7 @@ onBeforeUnmount(() => root.value?.removeEventListener("keydown", onKeydown));
55
66
  :data-sticky="sticky || undefined"
56
67
  data-test="selection-bar"
57
68
  >
58
- <span class="wp-selbar__count" aria-live="polite" data-test="selection-count">{{ count }}{{ noun ? ` ${noun}` : "" }} selected</span>
69
+ <span class="wp-selbar__count" aria-live="polite" data-test="selection-count">{{ countText }}</span>
59
70
  <slot name="start" />
60
71
  <span class="wp-selbar__spacer" />
61
72
  <slot />
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ // The shared preview sheet (wp-pv-* classes), loaded once for every preview.
3
+ import "./preview.css";
2
4
  /**
3
5
  * Wildcard preview built for big pools: a stats strip, search + filters,
4
6
  * tag facets with counts, and options as table rows (chance, tags,
@@ -504,7 +506,6 @@ function isLong(o: WildcardOption): boolean {
504
506
  </div>
505
507
  </template>
506
508
 
507
- <style scoped src="./preview.css"></style>
508
509
  <style scoped>
509
510
  .wp-wc__split[data-facets] {
510
511
  display: grid;
package/src/preview.css CHANGED
@@ -1,7 +1,10 @@
1
1
  /* Shared chrome for the per-type payload previews (stats strip, toolbar,
2
- row tables, section labels). Each preview pulls it in scoped
3
- (`<style scoped src="./preview.css">`), so it styles only that piece's own
4
- markup. Every selector is `.wp-pv-*`. */
2
+ row tables, section labels). Every preview imports it from its script
3
+ (`import "./preview.css"`), so a page carries ONE copy however many
4
+ previews it shows; pulled in scoped, each piece got its own copy (seven in
5
+ the community embed). Every selector is `.wp-pv-*`, so it is safe global.
6
+ Unlayered like button.css and menu.css: in @layer wp-extension a host's
7
+ unlayered reset (Tailwind's preflight) would strip its borders. */
5
8
 
6
9
  .wp-pv {
7
10
  container-type: inline-size;