@revenexx/cover 0.1.11 → 0.1.12

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/app/app.config.ts CHANGED
@@ -24,6 +24,12 @@ export default defineAppConfig({
24
24
  orderService: "mock",
25
25
  inventoryService: "mock",
26
26
  themeService: "mock",
27
+ // Search UX defaults the layer's components read — apps may override,
28
+ // but the layer must ship working values (a missing `search` object
29
+ // crashed SearchInput with "Cannot read … 'autocompleteMinChars'").
30
+ search: {
31
+ autocompleteMinChars: 2,
32
+ },
27
33
  ui: {
28
34
  icons: nuxtUiIcons(DEFAULT_ICON_WEIGHT),
29
35
  },
@@ -16,7 +16,10 @@ interface Suggestion {
16
16
  }
17
17
 
18
18
  const { t } = useI18n();
19
- const { search: searchConfig } = useAppConfig();
19
+ // The layer ships a `search` default, but a consumer that overrides
20
+ // app.config without it must not crash the header — fall back locally.
21
+ const appConfig = useAppConfig();
22
+ const autocompleteMinChars = computed(() => appConfig.search?.autocompleteMinChars ?? 2);
20
23
 
21
24
  const query = ref<string>("");
22
25
  const emit = defineEmits<{ search: [query: string] }>();
@@ -59,7 +62,7 @@ const debouncedFetch = useDebounceFn(fetchSuggestions, 250);
59
62
 
60
63
  watch(query, (val) => {
61
64
  activeIndex.value = -1;
62
- if (!val.trim() || val.trim().length < searchConfig.autocompleteMinChars) {
65
+ if (!val.trim() || val.trim().length < autocompleteMinChars.value) {
63
66
  suggestions.value = [];
64
67
  return;
65
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",