@scayle/storefront-nuxt 8.45.1 → 8.46.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 +58 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.46.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
- Updated dependency to @scayle/unstorage-compression-driver@1.2.1
|
|
10
|
+
|
|
11
|
+
**@scayle/storefront-core v8.46.0**
|
|
12
|
+
|
|
13
|
+
- Minor
|
|
14
|
+
|
|
15
|
+
- Added `getAttributeValuesByGroupId` function to the `attributeHelpers` helper for retrieving attribute values by their numeric attribute group ID.
|
|
16
|
+
|
|
17
|
+
This function allows you to retrieve attribute values filtered by a specific attribute group ID, providing a more targeted approach when working with grouped product attributes.
|
|
18
|
+
The existing `getAttributeValues` function has been renamed to `getAttributeValuesByName` to better differentiate between the two lookup methods.
|
|
19
|
+
|
|
20
|
+
### Usage Examples
|
|
21
|
+
|
|
22
|
+
Both functions return an array of values for consistency, making them safe to use in iterations. For single-select attributes, the value is wrapped in an array. For multi-select attributes, the array is returned directly.
|
|
23
|
+
|
|
24
|
+
#### Looking up by name (existing, now renamed):
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { getAttributeValuesByName } from '@scayle/storefront-core'
|
|
28
|
+
|
|
29
|
+
// Single-select attribute
|
|
30
|
+
const sizes = getAttributeValuesByName(product.attributes, 'size')
|
|
31
|
+
// Returns: [{ id: 1, label: 'M', value: 'medium' }]
|
|
32
|
+
|
|
33
|
+
// Multi-select attribute
|
|
34
|
+
const colors = getAttributeValuesByName(product.attributes, 'color')
|
|
35
|
+
// Returns: [{ id: 1, label: 'Red' }, { id: 2, label: 'Blue' }]
|
|
36
|
+
|
|
37
|
+
// Non-existent attribute
|
|
38
|
+
const missing = getAttributeValuesByName(product.attributes, 'doesNotExist')
|
|
39
|
+
// Returns: []
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Looking up by group ID (new):
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { getAttributeValuesByGroupId } from '@scayle/storefront-core'
|
|
46
|
+
|
|
47
|
+
// Look up attribute by its numeric ID from the SCAYLE API
|
|
48
|
+
const promotionValues = getAttributeValuesByGroupId(product.attributes, 42)
|
|
49
|
+
// Returns: [{ id: 123, label: 'Summer Sale', value: 'summer-2024' }]
|
|
50
|
+
|
|
51
|
+
// Non-existent attribute group
|
|
52
|
+
const missing = getAttributeValuesByGroupId(product.attributes, 9999)
|
|
53
|
+
// Returns: []
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### When to Use Each Function
|
|
57
|
+
|
|
58
|
+
- **`getAttributeValuesByName`**: Use when you know the attribute name key (e.g., 'color', 'size'). This is the most common use case in application code.
|
|
59
|
+
- **`getAttributeValuesByGroupId`**: Use when you have the numeric attribute group ID from the SCAYLE API, such as when processing API configurations, handling dynamic attribute mappings, or working with attribute group references.
|
|
60
|
+
|
|
3
61
|
## 8.45.1
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.46.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"utility-types": "^3.11.0",
|
|
91
91
|
"vue-router": "^4.4.0",
|
|
92
92
|
"zod": "^4.0.0",
|
|
93
|
-
"@scayle/storefront-core": "8.
|
|
93
|
+
"@scayle/storefront-core": "8.46.0",
|
|
94
94
|
"@scayle/unstorage-compression-driver": "1.2.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
@@ -102,23 +102,23 @@
|
|
|
102
102
|
"@nuxt/module-builder": "1.0.2",
|
|
103
103
|
"@nuxt/schema": "3.19.3",
|
|
104
104
|
"@nuxt/test-utils": "3.19.2",
|
|
105
|
-
"@types/node": "22.18.
|
|
105
|
+
"@types/node": "22.18.12",
|
|
106
106
|
"@vitest/coverage-v8": "3.2.4",
|
|
107
107
|
"dprint": "0.50.2",
|
|
108
108
|
"eslint-formatter-gitlab": "6.0.1",
|
|
109
|
-
"eslint": "9.
|
|
109
|
+
"eslint": "9.38.0",
|
|
110
110
|
"fishery": "2.3.1",
|
|
111
111
|
"h3": "1.15.4",
|
|
112
112
|
"nitro-test-utils": "0.9.4",
|
|
113
113
|
"nitropack": "2.12.7",
|
|
114
114
|
"node-mocks-http": "1.17.2",
|
|
115
115
|
"nuxt": "3.19.3",
|
|
116
|
-
"publint": "0.3.
|
|
116
|
+
"publint": "0.3.15",
|
|
117
117
|
"typescript": "5.9.3",
|
|
118
118
|
"unbuild": "3.6.1",
|
|
119
119
|
"vitest": "3.2.4",
|
|
120
120
|
"vue-tsc": "3.1.1",
|
|
121
|
-
"happy-dom": "20.0.
|
|
121
|
+
"happy-dom": "20.0.8",
|
|
122
122
|
"@scayle/eslint-config-storefront": "4.7.10",
|
|
123
123
|
"@scayle/eslint-plugin-vue-composable": "0.2.1",
|
|
124
124
|
"@scayle/vitest-config-storefront": "1.0.0",
|