@happyvertical/smrt-products 0.31.1 → 0.32.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.
Files changed (38) hide show
  1. package/dist/lib/chunks/{ProductAssetCollection-DFPXN43q.js → ProductAssetCollection-B93HdSlX.js} +3 -3
  2. package/dist/lib/chunks/{ProductAssetCollection-DFPXN43q.js.map → ProductAssetCollection-B93HdSlX.js.map} +1 -1
  3. package/dist/lib/chunks/{ProductForm-DHeb2L24.js → ProductForm-p4-xbubZ.js} +27 -1
  4. package/dist/lib/chunks/ProductForm-p4-xbubZ.js.map +1 -0
  5. package/dist/lib/chunks/{Sku-DUKtbYWT.js → Sku-sl6xf1PR.js} +2 -19
  6. package/dist/lib/chunks/Sku-sl6xf1PR.js.map +1 -0
  7. package/dist/lib/chunks/{SkuCollection-C0tdkEdL.js → SkuCollection-f_a3k93c.js} +2 -2
  8. package/dist/lib/chunks/{SkuCollection-C0tdkEdL.js.map → SkuCollection-f_a3k93c.js.map} +1 -1
  9. package/dist/lib/collections.js +2 -2
  10. package/dist/lib/components.js +1 -1
  11. package/dist/lib/index.js +5 -5
  12. package/dist/lib/lib/components/ProductCard.svelte +1 -1
  13. package/dist/lib/lib/components/ProductForm.svelte +3 -3
  14. package/dist/lib/lib/components/auto-generated/AutoForm.svelte +7 -6
  15. package/dist/lib/lib/components/auto-generated/AutoForm.svelte.d.ts.map +1 -1
  16. package/dist/lib/lib/components/auto-generated/FieldRenderer.svelte +8 -8
  17. package/dist/lib/lib/features/ProductCatalog.svelte +30 -20
  18. package/dist/lib/lib/features/ProductCatalog.svelte.d.ts.map +1 -1
  19. package/dist/lib/lib/mock-smrt-client.d.ts +2 -20
  20. package/dist/lib/lib/mock-smrt-client.d.ts.map +1 -1
  21. package/dist/lib/lib/mock-smrt-client.js +10 -8
  22. package/dist/lib/lib/mock-smrt-client.js.map +1 -1
  23. package/dist/lib/lib/models/Category.d.ts +0 -4
  24. package/dist/lib/lib/models/Category.d.ts.map +1 -1
  25. package/dist/lib/lib/models/Product.d.ts +0 -2
  26. package/dist/lib/lib/models/Product.d.ts.map +1 -1
  27. package/dist/lib/lib/stores/product-store.svelte.d.ts +1 -1
  28. package/dist/lib/lib/stores/product-store.svelte.d.ts.map +1 -1
  29. package/dist/lib/lib/utils/index.d.ts.map +1 -1
  30. package/dist/lib/manifest.json +2 -90
  31. package/dist/lib/models.js +1 -1
  32. package/dist/lib/smrt-knowledge.json +5 -13
  33. package/dist/lib/smrt-products.css +3 -3
  34. package/dist/lib/utils.js +1 -1
  35. package/dist/lib/utils.js.map +1 -1
  36. package/package.json +7 -7
  37. package/dist/lib/chunks/ProductForm-DHeb2L24.js.map +0 -1
  38. package/dist/lib/chunks/Sku-DUKtbYWT.js.map +0 -1
@@ -1,8 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
3
  import { onMount } from 'svelte';
4
- import { productStore } from '../stores/product-store.svelte';
4
+ import ProductCard from '../components/ProductCard.svelte';
5
+ import ProductForm from '../components/ProductForm.svelte';
5
6
  import { M } from '../i18n.js';
7
+ import { productStore } from '../stores/product-store.svelte';
6
8
  import type { ProductData } from '../types';
7
9
 
8
10
  const { t } = useI18n();
@@ -14,13 +16,13 @@ interface Props {
14
16
 
15
17
  const { readonly = false, showCreateForm = false }: Props = $props();
16
18
 
17
- const searchQuery = $state('');
18
- const selectedCategory = $state('');
19
- let _showForm = $state(false);
19
+ let searchQuery = $state('');
20
+ let selectedCategory = $state('');
21
+ let showForm = $state(false);
20
22
  let editingProduct = $state<ProductData | null>(null);
21
23
 
22
24
  // Reactive filtered products
23
- const _filteredProducts = $derived.by(() => {
25
+ const filteredProducts = $derived.by(() => {
24
26
  let products = productStore.items;
25
27
 
26
28
  if (searchQuery) {
@@ -38,38 +40,45 @@ onMount(() => {
38
40
  productStore.loadProducts();
39
41
  });
40
42
 
41
- function _handleCreateProduct() {
43
+ function handleCreateProduct() {
42
44
  editingProduct = null;
43
- _showForm = true;
45
+ showForm = true;
44
46
  }
45
47
 
46
- function _handleEditProduct(product: ProductData) {
48
+ function handleEditProduct(product: ProductData) {
47
49
  editingProduct = product;
48
- _showForm = true;
50
+ showForm = true;
49
51
  }
50
52
 
51
- async function _handleDeleteProduct(id: string) {
53
+ async function handleDeleteProduct(id: string) {
52
54
  if (confirm('Are you sure you want to delete this product?')) {
53
55
  try {
54
56
  await productStore.deleteProduct(id);
55
- } catch (error) {}
57
+ } catch {
58
+ // deleteProduct already recorded the message on productStore.error;
59
+ // the error-state region below renders it. Swallow the re-thrown
60
+ // rejection so it doesn't become an unhandled promise rejection.
61
+ }
56
62
  }
57
63
  }
58
64
 
59
- async function _handleSubmitProduct(productData: Partial<ProductData>) {
65
+ async function handleSubmitProduct(productData: Partial<ProductData>) {
60
66
  try {
61
67
  if (editingProduct?.id) {
62
68
  await productStore.updateProduct(editingProduct.id, productData);
63
69
  } else {
64
70
  await productStore.createProduct(productData);
65
71
  }
66
- _showForm = false;
72
+ showForm = false;
67
73
  editingProduct = null;
68
- } catch (error) {}
74
+ } catch {
75
+ // Keep the form open on failure; productStore.error holds the message
76
+ // and the error-state region renders it.
77
+ }
69
78
  }
70
79
 
71
- function _handleCancelForm() {
72
- _showForm = false;
80
+ function handleCancelForm() {
81
+ showForm = false;
73
82
  editingProduct = null;
74
83
  }
75
84
  </script>
@@ -97,6 +106,7 @@ function _handleCancelForm() {
97
106
  type="text"
98
107
  bind:value={searchQuery}
99
108
  placeholder={t(M['products.product_catalog.search_placeholder'])}
109
+ aria-label={t(M['products.product_catalog.search_placeholder'])}
100
110
  class="search-input"
101
111
  />
102
112
 
@@ -120,18 +130,18 @@ function _handleCancelForm() {
120
130
  </div>
121
131
 
122
132
  {#if productStore.loading}
123
- <div class="loading-state">
133
+ <div class="loading-state" role="status" aria-live="polite">
124
134
  <p>{t(M['products.product_catalog.loading'])}</p>
125
135
  </div>
126
136
  {:else if productStore.error}
127
- <div class="error-state">
137
+ <div class="error-state" role="alert" aria-live="assertive">
128
138
  <p>Error: {productStore.error}</p>
129
139
  <button type="button" onclick={() => productStore.loadProducts()}>
130
140
  Retry
131
141
  </button>
132
142
  </div>
133
143
  {:else if filteredProducts.length === 0}
134
- <div class="empty-state">
144
+ <div class="empty-state" role="status" aria-live="polite">
135
145
  {#if productStore.items.length === 0}
136
146
  <p>{t(M['products.product_catalog.empty'])}</p>
137
147
  {#if !readonly}
@@ -281,7 +291,7 @@ function _handleCancelForm() {
281
291
  }
282
292
 
283
293
  .form-container {
284
- background: white;
294
+ background: var(--smrt-color-surface, #fff);
285
295
  border-radius: var(--smrt-radius-md, 8px);
286
296
  max-width: 500px;
287
297
  width: 90vw;
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCatalog.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/features/ProductCatalog.svelte"],"names":[],"mappings":"AAUA,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA0JD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ProductCatalog.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/features/ProductCatalog.svelte"],"names":[],"mappings":"AAYA,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAmKD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -1,23 +1,5 @@
1
- /**
2
- * Mock SMRT Client - Temporary implementation for demo purposes
3
- *
4
- * This replaces the missing @smrt/client virtual module with a working implementation
5
- * that demonstrates the intended functionality.
6
- */
7
- export interface ProductData {
8
- id?: string;
9
- name: string;
10
- description?: string;
11
- category: string;
12
- manufacturer?: string;
13
- model?: string;
14
- price?: number;
15
- inStock?: boolean;
16
- specifications?: Record<string, any>;
17
- tags?: string[];
18
- createdAt?: string;
19
- updatedAt?: string;
20
- }
1
+ import { ProductData } from './types';
2
+ export type { ProductData } from './types';
21
3
  export interface ApiResponse<T> {
22
4
  data: T;
23
5
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"mock-smrt-client.d.ts","sourceRoot":"","sources":["../../../src/lib/mock-smrt-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkCD,cAAM,aAAa;IACjB,QAAQ;gBACQ,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;gBAWnC,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;4BAgBzC,OAAO,CAAC,WAAW,CAAC,GAChC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;mBA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 -10,8 +10,8 @@ const mockProducts = [
10
10
  inStock: true,
11
11
  specifications: { weight: "1.2kg", color: "Black" },
12
12
  tags: ["demo", "sample"],
13
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
14
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
13
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
14
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
15
15
  },
16
16
  {
17
17
  id: "2",
@@ -24,8 +24,8 @@ const mockProducts = [
24
24
  inStock: false,
25
25
  specifications: { size: "small" },
26
26
  tags: ["budget", "affordable"],
27
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
28
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
27
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
28
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
29
29
  }
30
30
  ];
31
31
  class MockApiClient {
@@ -63,8 +63,8 @@ class MockApiClient {
63
63
  inStock: productData.inStock ?? true,
64
64
  specifications: productData.specifications || {},
65
65
  tags: productData.tags || [],
66
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
67
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
66
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
67
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
68
68
  };
69
69
  mockProducts.push(newProduct);
70
70
  return {
@@ -82,7 +82,7 @@ class MockApiClient {
82
82
  const updatedProduct = {
83
83
  ...mockProducts[index],
84
84
  ...updates,
85
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
85
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
86
86
  };
87
87
  mockProducts[index] = updatedProduct;
88
88
  return {
@@ -109,7 +109,9 @@ class MockApiClient {
109
109
  async list() {
110
110
  await new Promise((resolve) => setTimeout(resolve, 200));
111
111
  const categories = Array.from(
112
- new Set(mockProducts.map((p) => p.category).filter(Boolean))
112
+ new Set(
113
+ mockProducts.map((p) => p.category).filter((c) => Boolean(c))
114
+ )
113
115
  );
114
116
  return {
115
117
  data: categories,
@@ -1 +1 @@
1
- {"version":3,"file":"mock-smrt-client.js","sources":["../../../src/lib/mock-smrt-client.ts"],"sourcesContent":["/**\n * Mock SMRT Client - Temporary implementation for demo purposes\n *\n * This replaces the missing @smrt/client virtual module with a working implementation\n * that demonstrates the intended functionality.\n */\n\nexport interface ProductData {\n id?: string;\n name: string;\n description?: string;\n category: string;\n manufacturer?: string;\n model?: string;\n price?: number;\n inStock?: boolean;\n specifications?: Record<string, any>;\n tags?: string[];\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface ApiResponse<T> {\n data: T;\n success: boolean;\n message?: string;\n}\n\n// Mock data store\nconst mockProducts: ProductData[] = [\n {\n id: '1',\n name: 'Demo Product',\n description: 'A sample product for demonstration',\n category: 'Electronics',\n manufacturer: 'Demo Corp',\n model: 'DM-100',\n price: 29.99,\n inStock: true,\n specifications: { weight: '1.2kg', color: 'Black' },\n tags: ['demo', 'sample'],\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n },\n {\n id: '2',\n name: 'Budget Item',\n description: 'An affordable option',\n category: 'Accessories',\n manufacturer: 'Budget Inc',\n model: 'BI-200',\n price: 19.99,\n inStock: false,\n specifications: { size: 'small' },\n tags: ['budget', 'affordable'],\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n },\n];\n\nclass MockApiClient {\n products = {\n async list(): Promise<ApiResponse<ProductData[]>> {\n // Simulate API delay\n await new Promise((resolve) => setTimeout(resolve, 500));\n\n return {\n data: [...mockProducts],\n success: true,\n message: 'Products retrieved successfully',\n };\n },\n\n async get(id: string): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const product = mockProducts.find((p) => p.id === id);\n if (!product) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n return {\n data: product,\n success: true,\n message: 'Product retrieved successfully',\n };\n },\n\n async create(\n productData: Partial<ProductData>,\n ): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n const newProduct: ProductData = {\n id: (mockProducts.length + 1).toString(),\n name: productData.name || 'Untitled Product',\n description: productData.description || '',\n category: productData.category || 'Uncategorized',\n manufacturer: productData.manufacturer || '',\n model: productData.model || '',\n price: productData.price || 0,\n inStock: productData.inStock ?? true,\n specifications: productData.specifications || {},\n tags: productData.tags || [],\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n\n mockProducts.push(newProduct);\n\n return {\n data: newProduct,\n success: true,\n message: 'Product created successfully',\n };\n },\n\n async update(\n id: string,\n updates: Partial<ProductData>,\n ): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n const index = mockProducts.findIndex((p) => p.id === id);\n if (index === -1) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n const updatedProduct = {\n ...mockProducts[index],\n ...updates,\n updatedAt: new Date().toISOString(),\n };\n\n mockProducts[index] = updatedProduct;\n\n return {\n data: updatedProduct,\n success: true,\n message: 'Product updated successfully',\n };\n },\n\n async delete(id: string): Promise<ApiResponse<void>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const index = mockProducts.findIndex((p) => p.id === id);\n if (index === -1) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n mockProducts.splice(index, 1);\n\n return {\n data: undefined as any,\n success: true,\n message: 'Product deleted successfully',\n };\n },\n };\n\n categories = {\n async list(): Promise<ApiResponse<string[]>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const categories = Array.from(\n new Set(mockProducts.map((p) => p.category).filter(Boolean)),\n );\n\n return {\n data: categories,\n success: true,\n message: 'Categories retrieved successfully',\n };\n },\n };\n}\n\nexport function createClient(baseUrl = '/api/v1'): MockApiClient {\n return new MockApiClient();\n}\n\nexport default createClient;\n"],"names":[],"mappings":"AA6BA,MAAM,eAA8B;AAAA,EAClC;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa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AI,UAAU,IAAI;AAChB,cAAM,IAAI,MAAM,mBAAmB,EAAE,YAAY;AAAA,MACnD;AAEA,mBAAa,OAAO,OAAO,CAAC;AAE5B,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,EAAA;AAAA,EAGF,aAAa;AAAA,IACX,MAAM,OAAuC;AAC3C,YAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG,CAAC;AAEvD,YAAM,aAAa,MAAM;AAAA,QACvB,IAAI,IAAI,aAAa,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,OAAO,CAAC;AAAA,MAAA;AAG7D,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,EAAA;AAEJ;AAEO,SAAS,aAAa,UAAU,WAA0B;AAC/D,SAAO,IAAI,cAAA;AACb;"}
1
+ {"version":3,"file":"mock-smrt-client.js","sources":["../../../src/lib/mock-smrt-client.ts"],"sourcesContent":["/**\n * Mock SMRT Client - Temporary implementation for demo purposes\n *\n * This replaces the missing @smrt/client virtual module with a working implementation\n * that demonstrates the intended functionality.\n */\n\n// Re-use the canonical UI ProductData shape so the mock client, the stores,\n// and the components all agree on one type. The shape uses snake_case\n// timestamps (`created_at`/`updated_at`) to match the SMRT server payload.\nimport type { ProductData } from './types';\n\nexport type { ProductData } from './types';\n\nexport interface ApiResponse<T> {\n data: T;\n success: boolean;\n message?: string;\n}\n\n// Mock data store\nconst mockProducts: ProductData[] = [\n {\n id: '1',\n name: 'Demo Product',\n description: 'A sample product for demonstration',\n category: 'Electronics',\n manufacturer: 'Demo Corp',\n model: 'DM-100',\n price: 29.99,\n inStock: true,\n specifications: { weight: '1.2kg', color: 'Black' },\n tags: ['demo', 'sample'],\n created_at: new Date().toISOString(),\n updated_at: new Date().toISOString(),\n },\n {\n id: '2',\n name: 'Budget Item',\n description: 'An affordable option',\n category: 'Accessories',\n manufacturer: 'Budget Inc',\n model: 'BI-200',\n price: 19.99,\n inStock: false,\n specifications: { size: 'small' },\n tags: ['budget', 'affordable'],\n created_at: new Date().toISOString(),\n updated_at: new Date().toISOString(),\n },\n];\n\nclass MockApiClient {\n products = {\n async list(): Promise<ApiResponse<ProductData[]>> {\n // Simulate API delay\n await new Promise((resolve) => setTimeout(resolve, 500));\n\n return {\n data: [...mockProducts],\n success: true,\n message: 'Products retrieved successfully',\n };\n },\n\n async get(id: string): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const product = mockProducts.find((p) => p.id === id);\n if (!product) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n return {\n data: product,\n success: true,\n message: 'Product retrieved successfully',\n };\n },\n\n async create(\n productData: Partial<ProductData>,\n ): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n const newProduct: ProductData = {\n id: (mockProducts.length + 1).toString(),\n name: productData.name || 'Untitled Product',\n description: productData.description || '',\n category: productData.category || 'Uncategorized',\n manufacturer: productData.manufacturer || '',\n model: productData.model || '',\n price: productData.price || 0,\n inStock: productData.inStock ?? true,\n specifications: productData.specifications || {},\n tags: productData.tags || [],\n created_at: new Date().toISOString(),\n updated_at: new Date().toISOString(),\n };\n\n mockProducts.push(newProduct);\n\n return {\n data: newProduct,\n success: true,\n message: 'Product created successfully',\n };\n },\n\n async update(\n id: string,\n updates: Partial<ProductData>,\n ): Promise<ApiResponse<ProductData>> {\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n const index = mockProducts.findIndex((p) => p.id === id);\n if (index === -1) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n const updatedProduct = {\n ...mockProducts[index],\n ...updates,\n updated_at: new Date().toISOString(),\n };\n\n mockProducts[index] = updatedProduct;\n\n return {\n data: updatedProduct,\n success: true,\n message: 'Product updated successfully',\n };\n },\n\n async delete(id: string): Promise<ApiResponse<void>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const index = mockProducts.findIndex((p) => p.id === id);\n if (index === -1) {\n throw new Error(`Product with id ${id} not found`);\n }\n\n mockProducts.splice(index, 1);\n\n return {\n data: undefined as any,\n success: true,\n message: 'Product deleted successfully',\n };\n },\n };\n\n categories = {\n async list(): Promise<ApiResponse<string[]>> {\n await new Promise((resolve) => setTimeout(resolve, 200));\n\n const categories = Array.from(\n new Set(\n mockProducts\n .map((p) => p.category)\n .filter((c): c is string => Boolean(c)),\n ),\n );\n\n return {\n data: categories,\n success: true,\n message: 'Categories retrieved successfully',\n };\n },\n };\n}\n\nexport function createClient(baseUrl = '/api/v1'): MockApiClient {\n return new MockApiClient();\n}\n\nexport default createClient;\n"],"names":[],"mappings":"AAqBA,MAAM,eAA8B;AAAA,EAClC;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,gBAAgB,EAAE,QAAQ,SAAS,OAAO,QAAA;AAAA,IAC1C,MAAM,CAAC,QAAQ,QAAQ;AAAA,IACvB,aAAY,oBAAI,KAAA,GAAO,YAAA;AAAA,IACvB,aAAY,oBAAI,KAAA,GAAO,YAAA;AAAA,EAAY;AAAA,EAErC;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,gBAAgB,EAAE,MAAM,QAAA;AAAA,IACxB,MAAM,CAAC,UAAU,YAAY;AAAA,IAC7B,aAAY,oBAAI,KAAA,GAAO,YAAA;AAAA,IACvB,aAAY,oBAAI,KAAA,GAAO,YAAA;AAAA,EAAY;AAEvC;AAEA,MAAM,cAAc;AAAA,EAClB,WAAW;AAAA,IACT,MAAM,OAA4C;AAEhD,YAAM,IAAI,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productCount: number;
31
31
  active: boolean;
32
32
  constructor(options?: CategoryOptions);
33
- getProducts(): Promise<never[]>;
34
- getSubcategories(): Promise<never[]>;
35
- updateProductCount(): Promise<void>;
36
- static getRootCategories(): Promise<Category[]>;
37
33
  }
38
34
  //# sourceMappingURL=Category.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../../src/lib/models/Category.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAGlC;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAkBa,QAAS,SAAQ,UAAU;IACtC;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,IAAI,SAAM;IACV,WAAW,SAAM;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,SAAK;IACV,YAAY,SAAK;IACjB,MAAM,UAAQ;gBAEF,OAAO,GAAE,eAAoB;IAWnC,WAAW;IAKX,gBAAgB;IAKhB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;WAK5B,iBAAiB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAItD"}
1
+ {"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../../src/lib/models/Category.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAGlC;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAkBa,QAAS,SAAQ,UAAU;IACtC;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,IAAI,SAAM;IACV,WAAW,SAAM;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,SAAK;IACV,YAAY,SAAK;IACjB,MAAM,UAAQ;gBAEF,OAAO,GAAE,eAAoB;CAU1C"}
@@ -51,7 +51,5 @@ export declare class Product extends SmrtObject {
51
51
  getAssets(relationship?: string): Promise<Asset[]>;
52
52
  addAsset(asset: Asset, relationship?: string, sortOrder?: number): Promise<void>;
53
53
  removeAsset(assetId: string, relationship?: string): Promise<void>;
54
- static searchByText(_query: string): Promise<Product[]>;
55
- static findByManufacturer(_manufacturer: string): Promise<Product[]>;
56
54
  }
57
55
  //# sourceMappingURL=Product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../../../src/lib/models/Product.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAMxD,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,QAAQ,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IAClB,KAAK,SAAM;IACX,KAAK,SAAK;IACV,OAAO,UAAQ;IACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACzC,IAAI,EAAE,MAAM,EAAE,CAAM;gBAER,OAAO,GAAE,cAAmB;IAwBlC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI3C,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAInD,yBAAyB;IAMjC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAuClD,QAAQ,CACZ,KAAK,EAAE,KAAK,EACZ,YAAY,SAAe,EAC3B,SAAS,SAAI,GACZ,OAAO,CAAC,IAAI,CAAC;IAoBV,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBzE"}
@@ -14,7 +14,7 @@ export declare class ProductStoreClass {
14
14
  get selectedProduct(): ProductData | null;
15
15
  get inStockCount(): number;
16
16
  get totalValue(): number;
17
- get categories(): string[];
17
+ get categories(): (string | undefined)[];
18
18
  loadProducts(): Promise<void>;
19
19
  createProduct(productData: Partial<ProductData>): Promise<import("../mock-smrt-client").ApiResponse<ProductData>>;
20
20
  updateProduct(id: string, updates: Partial<ProductData>): Promise<import("../mock-smrt-client").ApiResponse<ProductData>>;
@@ -1 +1 @@
1
- {"version":3,"file":"product-store.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/stores/product-store.svelte.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASrE,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,IAAI,CAKT;IAEH,OAAO,CAAC,GAAG,CAA2B;IAGtC,IAAI,KAAK,kBAER;I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U;IAKV,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAIjD,aAAa,IAAI,WAAW,EAAE;IAI9B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE;CAS7C;AAGD,eAAO,MAAM,YAAY,mBAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAOtD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5C;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAOtD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ5C;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "timestamp": 1782192584602,
3
+ "timestamp": 1782206292402,
4
4
  "packageName": "@happyvertical/smrt-products",
5
- "packageVersion": "0.31.1",
5
+ "packageVersion": "0.32.1",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-products:CategoryCollection": {
8
8
  "name": "categorycollection",
@@ -1320,38 +1320,6 @@
1320
1320
  "returnType": "Promise<void>",
1321
1321
  "isStatic": false,
1322
1322
  "isPublic": true
1323
- },
1324
- "getProducts": {
1325
- "name": "getProducts",
1326
- "async": true,
1327
- "parameters": [],
1328
- "returnType": "any",
1329
- "isStatic": false,
1330
- "isPublic": true
1331
- },
1332
- "getSubcategories": {
1333
- "name": "getSubcategories",
1334
- "async": true,
1335
- "parameters": [],
1336
- "returnType": "any",
1337
- "isStatic": false,
1338
- "isPublic": true
1339
- },
1340
- "updateProductCount": {
1341
- "name": "updateProductCount",
1342
- "async": true,
1343
- "parameters": [],
1344
- "returnType": "Promise<void>",
1345
- "isStatic": false,
1346
- "isPublic": true
1347
- },
1348
- "getRootCategories": {
1349
- "name": "getRootCategories",
1350
- "async": true,
1351
- "parameters": [],
1352
- "returnType": "Promise<Category[]>",
1353
- "isStatic": true,
1354
- "isPublic": true
1355
1323
  }
1356
1324
  },
1357
1325
  "decoratorConfig": {
@@ -2142,34 +2110,6 @@
2142
2110
  "returnType": "Promise<void>",
2143
2111
  "isStatic": false,
2144
2112
  "isPublic": true
2145
- },
2146
- "searchByText": {
2147
- "name": "searchByText",
2148
- "async": true,
2149
- "parameters": [
2150
- {
2151
- "name": "_query",
2152
- "type": "string",
2153
- "optional": false
2154
- }
2155
- ],
2156
- "returnType": "Promise<Product[]>",
2157
- "isStatic": true,
2158
- "isPublic": true
2159
- },
2160
- "findByManufacturer": {
2161
- "name": "findByManufacturer",
2162
- "async": true,
2163
- "parameters": [
2164
- {
2165
- "name": "_manufacturer",
2166
- "type": "string",
2167
- "optional": false
2168
- }
2169
- ],
2170
- "returnType": "Promise<Product[]>",
2171
- "isStatic": true,
2172
- "isPublic": true
2173
2113
  }
2174
2114
  },
2175
2115
  "decoratorConfig": {
@@ -2948,34 +2888,6 @@
2948
2888
  "returnType": "Promise<void>",
2949
2889
  "isStatic": false,
2950
2890
  "isPublic": true
2951
- },
2952
- "searchByText": {
2953
- "name": "searchByText",
2954
- "async": true,
2955
- "parameters": [
2956
- {
2957
- "name": "_query",
2958
- "type": "string",
2959
- "optional": false
2960
- }
2961
- ],
2962
- "returnType": "Promise<Product[]>",
2963
- "isStatic": true,
2964
- "isPublic": true
2965
- },
2966
- "findByManufacturer": {
2967
- "name": "findByManufacturer",
2968
- "async": true,
2969
- "parameters": [
2970
- {
2971
- "name": "_manufacturer",
2972
- "type": "string",
2973
- "optional": false
2974
- }
2975
- ],
2976
- "returnType": "Promise<Product[]>",
2977
- "isStatic": true,
2978
- "isPublic": true
2979
2891
  }
2980
2892
  },
2981
2893
  "decoratorConfig": {
@@ -1,5 +1,5 @@
1
1
  import "./chunks/__smrt-register__-BIgFaVKn.js";
2
- import { C, M, P, a, b, c, S } from "./chunks/Sku-DUKtbYWT.js";
2
+ import { C, M, P, a, b, c, S } from "./chunks/Sku-sl6xf1PR.js";
3
3
  export {
4
4
  C as Category,
5
5
  M as Material,
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-06-23T05:29:45.086Z",
3
+ "generatedAt": "2026-06-23T09:18:12.970Z",
4
4
  "packageName": "@happyvertical/smrt-products",
5
- "packageVersion": "0.31.1",
5
+ "packageVersion": "0.32.1",
6
6
  "sourceManifestPath": "dist/lib/manifest.json",
7
7
  "agentDocPath": "AGENTS.md",
8
8
  "sourceHashes": {
9
- "manifest": "ba29515ff09e1c9e424a523c58600598aca1bc5b35d2c3e90b14f526124bdd62",
10
- "packageJson": "3989716abda29a51ae0f99495f49848bdbd51e6d211ed3b2d84ffa095de7412a",
9
+ "manifest": "2afcf18c5cd9a3943d916eb737f8c8c4ff989d049e73e2e35284e76d1fc8a8d0",
10
+ "packageJson": "1061b059672a748fe00656fbda8b280b403af0d22d0a1c6e070ca0008a026410",
11
11
  "agents": "4ca8837df73cf8b966b65cea639a058baa8f92ae536f3cd5036546fcbfeb37c8"
12
12
  },
13
13
  "exports": [
@@ -286,12 +286,9 @@
286
286
  "getEmbedding",
287
287
  "getFields",
288
288
  "getId",
289
- "getProducts",
290
289
  "getRelated",
291
- "getRootCategories",
292
290
  "getSavedId",
293
291
  "getSlug",
294
- "getSubcategories",
295
292
  "hasStaleEmbeddings",
296
293
  "initialize",
297
294
  "is",
@@ -312,8 +309,7 @@
312
309
  "summarizeAiUsage",
313
310
  "toJSON",
314
311
  "toPlainObject",
315
- "toPublicJSON",
316
- "updateProductCount"
312
+ "toPublicJSON"
317
313
  ],
318
314
  "surfaces": [
319
315
  {
@@ -510,7 +506,6 @@
510
506
  "destroy",
511
507
  "do",
512
508
  "executeToolCall",
513
- "findByManufacturer",
514
509
  "forget",
515
510
  "forgetScope",
516
511
  "generateEmbeddings",
@@ -542,7 +537,6 @@
542
537
  "removeAsset",
543
538
  "resetAiUsage",
544
539
  "save",
545
- "searchByText",
546
540
  "summarizeAiUsage",
547
541
  "toJSON",
548
542
  "toPlainObject",
@@ -728,7 +722,6 @@
728
722
  "destroy",
729
723
  "do",
730
724
  "executeToolCall",
731
- "findByManufacturer",
732
725
  "forget",
733
726
  "forgetScope",
734
727
  "generateEmbeddings",
@@ -760,7 +753,6 @@
760
753
  "removeAsset",
761
754
  "resetAiUsage",
762
755
  "save",
763
- "searchByText",
764
756
  "summarizeAiUsage",
765
757
  "toJSON",
766
758
  "toPlainObject",
@@ -3,7 +3,7 @@
3
3
  border: 1px solid var(--smrt-color-outline-variant, #e2e8f0);
4
4
  border-radius: var(--smrt-radius-md, 8px);
5
5
  padding: 1rem;
6
- background: white;
6
+ background: var(--smrt-color-surface, #fff);
7
7
  box-shadow: var(--smrt-elevation-1, 0 1px 3px color-mix(in srgb, var(--smrt-color-shadow, #000) 10%, transparent));
8
8
  transition: box-shadow 0.2s;
9
9
  }
@@ -117,7 +117,7 @@
117
117
  .product-form.svelte-1hh5ovx {
118
118
  max-width: 500px;
119
119
  padding: 1.5rem;
120
- background: white;
120
+ background: var(--smrt-color-surface, #fff);
121
121
  border-radius: var(--smrt-radius-md, 8px);
122
122
  border: 1px solid var(--smrt-color-outline-variant, #e2e8f0);
123
123
  }
@@ -208,7 +208,7 @@
208
208
  }
209
209
 
210
210
  .cancel-btn.svelte-1hh5ovx {
211
- background: white;
211
+ background: var(--smrt-color-surface, #fff);
212
212
  border-color: var(--smrt-color-outline-variant, #d1d5db);
213
213
  color: var(--smrt-color-on-surface, #374151);
214
214
  }
package/dist/lib/utils.js CHANGED
@@ -13,7 +13,7 @@ function formatDate(date) {
13
13
  }).format(dateObj);
14
14
  }
15
15
  function slugify(text) {
16
- return text.toLowerCase().replace(/[^\w ]+/g, "").replace(/ +/g, "-");
16
+ return text.normalize("NFKD").replace(/[^\p{L}\p{N} ]+/gu, "").trim().toLowerCase().replace(/ +/g, "-").replace(/^-+|-+$/g, "");
17
17
  }
18
18
  function generateId() {
19
19
  return Math.random().toString(36).substr(2, 9);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/lib/utils/index.ts"],"sourcesContent":["/**\n * SMRT Template Utilities\n *\n * Shared utility functions for product management functionality.\n */\n\nexport function formatPrice(price: number): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(price);\n}\n\nexport function formatDate(date: string | Date): string {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(dateObj);\n}\n\nexport function slugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w ]+/g, '')\n .replace(/ +/g, '-');\n}\n\nexport function generateId(): string {\n return Math.random().toString(36).substr(2, 9);\n}\n"],"names":[],"mappings":"AAMO,SAAS,YAAY,OAAuB;AACjD,SAAO,IAAI,KAAK,aAAa,SAAS;AAAA,IACpC,OAAO;AAAA,IACP,UAAU;AAAA,EAAA,CACX,EAAE,OAAO,KAAK;AACjB;AAEO,SAAS,WAAW,MAA6B;AACtD,QAAM,UAAU,OAAO,SAAS,WAAW,IAAI,KAAK,IAAI,IAAI;AAC5D,SAAO,IAAI,KAAK,eAAe,SAAS;AAAA,IACtC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EAAA,CACN,EAAE,OAAO,OAAO;AACnB;AAEO,SAAS,QAAQ,MAAsB;AAC5C,SAAO,KACJ,cACA,QAAQ,YAAY,EAAE,EACtB,QAAQ,OAAO,GAAG;AACvB;AAEO,SAAS,aAAqB;AACnC,SAAO,KAAK,SAAS,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC;AAC/C;"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/lib/utils/index.ts"],"sourcesContent":["/**\n * SMRT Template Utilities\n *\n * Shared utility functions for product management functionality.\n */\n\nexport function formatPrice(price: number): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(price);\n}\n\nexport function formatDate(date: string | Date): string {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n }).format(dateObj);\n}\n\nexport function slugify(text: string): string {\n return text\n .normalize('NFKD')\n .replace(/[^\\p{L}\\p{N} ]+/gu, '')\n .trim()\n .toLowerCase()\n .replace(/ +/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nexport function generateId(): string {\n return Math.random().toString(36).substr(2, 9);\n}\n"],"names":[],"mappings":"AAMO,SAAS,YAAY,OAAuB;AACjD,SAAO,IAAI,KAAK,aAAa,SAAS;AAAA,IACpC,OAAO;AAAA,IACP,UAAU;AAAA,EAAA,CACX,EAAE,OAAO,KAAK;AACjB;AAEO,SAAS,WAAW,MAA6B;AACtD,QAAM,UAAU,OAAO,SAAS,WAAW,IAAI,KAAK,IAAI,IAAI;AAC5D,SAAO,IAAI,KAAK,eAAe,SAAS;AAAA,IACtC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EAAA,CACN,EAAE,OAAO,OAAO;AACnB;AAEO,SAAS,QAAQ,MAAsB;AAC5C,SAAO,KACJ,UAAU,MAAM,EAChB,QAAQ,qBAAqB,EAAE,EAC/B,KAAA,EACA,YAAA,EACA,QAAQ,OAAO,GAAG,EAClB,QAAQ,YAAY,EAAE;AAC3B;AAEO,SAAS,aAAqB;AACnC,SAAO,KAAK,SAAS,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC;AAC/C;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-products",
3
- "version": "0.31.1",
3
+ "version": "0.32.1",
4
4
  "description": "SMRT products module: triple-purpose microservice template for standalone apps, federated modules, and NPM libraries",
5
5
  "author": "HappyVertical",
6
6
  "type": "module",
@@ -54,11 +54,11 @@
54
54
  "@happyvertical/utils": "^0.74.7",
55
55
  "cors": "^2.8.5",
56
56
  "express": "^5.2.1",
57
- "@happyvertical/smrt-assets": "0.31.1",
58
- "@happyvertical/smrt-core": "0.31.1",
59
- "@happyvertical/smrt-scanner": "0.31.1",
60
- "@happyvertical/smrt-tenancy": "0.31.1",
61
- "@happyvertical/smrt-ui": "0.31.1"
57
+ "@happyvertical/smrt-assets": "0.32.1",
58
+ "@happyvertical/smrt-core": "0.32.1",
59
+ "@happyvertical/smrt-scanner": "0.32.1",
60
+ "@happyvertical/smrt-tenancy": "0.32.1",
61
+ "@happyvertical/smrt-ui": "0.32.1"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "svelte": "^5.46.4"
@@ -81,7 +81,7 @@
81
81
  "typescript": "^5.9.3",
82
82
  "vite": "^7.3.1",
83
83
  "vitest": "^4.0.17",
84
- "@happyvertical/smrt-vitest": "0.31.1"
84
+ "@happyvertical/smrt-vitest": "0.32.1"
85
85
  },
86
86
  "keywords": [
87
87
  "smrt",