@akinon/pz-theme 2.0.89-beta.0 → 2.0.89
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 +4 -4
- package/package.json +4 -4
- package/src/chrome/page-context.ts +7 -1
- package/src/utils/analytics.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @akinon/pz-theme
|
|
2
2
|
|
|
3
|
-
## 2.0.89
|
|
3
|
+
## 2.0.89
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- @akinon/next@2.0.89
|
|
9
|
-
- @akinon/theme-contract@2.0.89
|
|
7
|
+
- ec08898c: ZERO-4900: Enhance product attribute handling by adding label support in analytics and page context
|
|
8
|
+
- @akinon/next@2.0.89
|
|
9
|
+
- @akinon/theme-contract@2.0.89
|
|
10
10
|
|
|
11
11
|
## 2.0.88
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/pz-theme",
|
|
3
3
|
"description": "Theme package for Project Zero Next — ThemePlaceholder system and theme editor infrastructure",
|
|
4
|
-
"version": "2.0.89
|
|
4
|
+
"version": "2.0.89",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "jest"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@akinon/next": "2.0.89
|
|
11
|
+
"@akinon/next": "2.0.89",
|
|
12
12
|
"react": "^18.0.0 || ^19.0.0",
|
|
13
13
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@akinon/theme-contract": "2.0.89
|
|
16
|
+
"@akinon/theme-contract": "2.0.89",
|
|
17
17
|
"clsx": "2.1.1",
|
|
18
18
|
"lottie-web": "^5.13.0",
|
|
19
19
|
"tailwind-merge": "^2.5.4",
|
|
20
20
|
"zod": "4.4.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@akinon/next": "2.0.89
|
|
23
|
+
"@akinon/next": "2.0.89",
|
|
24
24
|
"@testing-library/jest-dom": "5.16.4",
|
|
25
25
|
"@testing-library/react": "16.3.2",
|
|
26
26
|
"@testing-library/user-event": "14.1.1",
|
|
@@ -156,8 +156,14 @@ const buildKeyedAttributes = (
|
|
|
156
156
|
const kwargs = product.attributes_kwargs;
|
|
157
157
|
if (kwargs && typeof kwargs === 'object' && !Array.isArray(kwargs)) {
|
|
158
158
|
for (const [key, entry] of Object.entries(kwargs as UnknownRecord)) {
|
|
159
|
-
const
|
|
159
|
+
const record = toRecord(entry);
|
|
160
|
+
const text = toStringValue(record.value);
|
|
160
161
|
if (text) keyed[key] = text;
|
|
162
|
+
// The human-readable side of a kwargs attribute ('Giyim' next to '001').
|
|
163
|
+
// Brand analytics report the LABEL while matching on the value, so both
|
|
164
|
+
// travel — the label under a reserved `_label` suffix.
|
|
165
|
+
const label = toStringValue(record.label);
|
|
166
|
+
if (label) keyed[`${key}_label`] = label;
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
169
|
|
package/src/utils/analytics.ts
CHANGED
|
@@ -110,8 +110,13 @@ const readItemAttributes = (
|
|
|
110
110
|
for (const [key, entry] of Object.entries(
|
|
111
111
|
kwargs as Record<string, unknown>
|
|
112
112
|
)) {
|
|
113
|
-
const
|
|
113
|
+
const record = entry as Record<string, unknown>;
|
|
114
|
+
const value = toText(record?.value);
|
|
114
115
|
if (value) keyed[key] = value;
|
|
116
|
+
// The label ('Giyim' beside the '001' value): brand bridges report it,
|
|
117
|
+
// so it rides along under the reserved `_label` suffix.
|
|
118
|
+
const label = toText(record?.label);
|
|
119
|
+
if (label) keyed[`${key}_label`] = label;
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
|