@akinon/projectzero 2.0.109-beta.0 → 2.0.109
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,6 +1,10 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
-
## 2.0.109
|
|
3
|
+
## 2.0.109
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 55ab88c: ZERO-5083: Keep the theme editor's Language dropdown in sync from pz-theme, so brands whose header no longer renders the template LanguageSelect show their real languages and follow the editor's language switch
|
|
4
8
|
|
|
5
9
|
## 2.0.108
|
|
6
10
|
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 2.0.109
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- @akinon/
|
|
9
|
-
- @akinon/
|
|
10
|
-
- @akinon/pz-
|
|
11
|
-
- @akinon/pz-
|
|
12
|
-
- @akinon/pz-
|
|
13
|
-
- @akinon/pz-
|
|
14
|
-
- @akinon/pz-
|
|
15
|
-
- @akinon/pz-
|
|
16
|
-
- @akinon/pz-
|
|
17
|
-
- @akinon/pz-
|
|
18
|
-
- @akinon/pz-
|
|
19
|
-
- @akinon/pz-
|
|
20
|
-
- @akinon/pz-
|
|
21
|
-
- @akinon/pz-
|
|
22
|
-
- @akinon/pz-
|
|
23
|
-
- @akinon/pz-
|
|
24
|
-
- @akinon/pz-
|
|
25
|
-
- @akinon/pz-masterpass@2.0.109
|
|
26
|
-
- @akinon/pz-
|
|
27
|
-
- @akinon/pz-
|
|
28
|
-
- @akinon/pz-
|
|
29
|
-
- @akinon/pz-
|
|
30
|
-
- @akinon/pz-
|
|
31
|
-
- @akinon/pz-
|
|
32
|
-
- @akinon/pz-
|
|
33
|
-
- @akinon/pz-
|
|
34
|
-
- @akinon/pz-
|
|
3
|
+
## 2.0.109
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [55ab88c]
|
|
8
|
+
- @akinon/pz-theme@2.0.109
|
|
9
|
+
- @akinon/next@2.0.109
|
|
10
|
+
- @akinon/pz-akifast@2.0.109
|
|
11
|
+
- @akinon/pz-apple-pay@2.0.109
|
|
12
|
+
- @akinon/pz-b2b@2.0.109
|
|
13
|
+
- @akinon/pz-basket-gift-pack@2.0.109
|
|
14
|
+
- @akinon/pz-bkm@2.0.109
|
|
15
|
+
- @akinon/pz-checkout-gift-pack@2.0.109
|
|
16
|
+
- @akinon/pz-click-collect@2.0.109
|
|
17
|
+
- @akinon/pz-credit-payment@2.0.109
|
|
18
|
+
- @akinon/pz-cybersource-uc@2.0.109
|
|
19
|
+
- @akinon/pz-flow-payment@2.0.109
|
|
20
|
+
- @akinon/pz-google-pay@2.0.109
|
|
21
|
+
- @akinon/pz-gpay@2.0.109
|
|
22
|
+
- @akinon/pz-haso@2.0.109
|
|
23
|
+
- @akinon/pz-hepsipay@2.0.109
|
|
24
|
+
- @akinon/pz-masterpass@2.0.109
|
|
25
|
+
- @akinon/pz-masterpass-rest@2.0.109
|
|
26
|
+
- @akinon/pz-multi-basket@2.0.109
|
|
27
|
+
- @akinon/pz-one-click-checkout@2.0.109
|
|
28
|
+
- @akinon/pz-otp@2.0.109
|
|
29
|
+
- @akinon/pz-pay-on-delivery@2.0.109
|
|
30
|
+
- @akinon/pz-saved-card@2.0.109
|
|
31
|
+
- @akinon/pz-similar-products@2.0.109
|
|
32
|
+
- @akinon/pz-tabby-extension@2.0.109
|
|
33
|
+
- @akinon/pz-tamara-extension@2.0.109
|
|
34
|
+
- @akinon/pz-virtual-try-on@2.0.109
|
|
35
35
|
|
|
36
36
|
## 2.0.108
|
|
37
37
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "2.0.109
|
|
3
|
+
"version": "2.0.109",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "2.0.109
|
|
28
|
-
"@akinon/pz-akifast": "2.0.109
|
|
29
|
-
"@akinon/pz-apple-pay": "2.0.109
|
|
30
|
-
"@akinon/pz-b2b": "2.0.109
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "2.0.109
|
|
32
|
-
"@akinon/pz-bkm": "2.0.109
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "2.0.109
|
|
34
|
-
"@akinon/pz-click-collect": "2.0.109
|
|
35
|
-
"@akinon/pz-credit-payment": "2.0.109
|
|
36
|
-
"@akinon/pz-cybersource-uc": "2.0.109
|
|
37
|
-
"@akinon/pz-flow-payment": "2.0.109
|
|
38
|
-
"@akinon/pz-google-pay": "2.0.109
|
|
39
|
-
"@akinon/pz-gpay": "2.0.109
|
|
40
|
-
"@akinon/pz-haso": "2.0.109
|
|
41
|
-
"@akinon/pz-hepsipay": "2.0.109
|
|
42
|
-
"@akinon/pz-masterpass": "2.0.109
|
|
43
|
-
"@akinon/pz-masterpass-rest": "2.0.109
|
|
44
|
-
"@akinon/pz-multi-basket": "2.0.109
|
|
45
|
-
"@akinon/pz-one-click-checkout": "2.0.109
|
|
46
|
-
"@akinon/pz-otp": "2.0.109
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "2.0.109
|
|
48
|
-
"@akinon/pz-saved-card": "2.0.109
|
|
49
|
-
"@akinon/pz-similar-products": "2.0.109
|
|
50
|
-
"@akinon/pz-tabby-extension": "2.0.109
|
|
51
|
-
"@akinon/pz-tamara-extension": "2.0.109
|
|
52
|
-
"@akinon/pz-theme": "2.0.109
|
|
53
|
-
"@akinon/pz-virtual-try-on": "2.0.109
|
|
27
|
+
"@akinon/next": "2.0.109",
|
|
28
|
+
"@akinon/pz-akifast": "2.0.109",
|
|
29
|
+
"@akinon/pz-apple-pay": "2.0.109",
|
|
30
|
+
"@akinon/pz-b2b": "2.0.109",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "2.0.109",
|
|
32
|
+
"@akinon/pz-bkm": "2.0.109",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "2.0.109",
|
|
34
|
+
"@akinon/pz-click-collect": "2.0.109",
|
|
35
|
+
"@akinon/pz-credit-payment": "2.0.109",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "2.0.109",
|
|
37
|
+
"@akinon/pz-flow-payment": "2.0.109",
|
|
38
|
+
"@akinon/pz-google-pay": "2.0.109",
|
|
39
|
+
"@akinon/pz-gpay": "2.0.109",
|
|
40
|
+
"@akinon/pz-haso": "2.0.109",
|
|
41
|
+
"@akinon/pz-hepsipay": "2.0.109",
|
|
42
|
+
"@akinon/pz-masterpass": "2.0.109",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "2.0.109",
|
|
44
|
+
"@akinon/pz-multi-basket": "2.0.109",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "2.0.109",
|
|
46
|
+
"@akinon/pz-otp": "2.0.109",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "2.0.109",
|
|
48
|
+
"@akinon/pz-saved-card": "2.0.109",
|
|
49
|
+
"@akinon/pz-similar-products": "2.0.109",
|
|
50
|
+
"@akinon/pz-tabby-extension": "2.0.109",
|
|
51
|
+
"@akinon/pz-tamara-extension": "2.0.109",
|
|
52
|
+
"@akinon/pz-theme": "2.0.109",
|
|
53
|
+
"@akinon/pz-virtual-try-on": "2.0.109",
|
|
54
54
|
"@hookform/resolvers": "2.9.0",
|
|
55
55
|
"@next/third-parties": "16.2.6",
|
|
56
56
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"yup": "0.32.11"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@akinon/eslint-plugin-projectzero": "2.0.109
|
|
77
|
+
"@akinon/eslint-plugin-projectzero": "2.0.109",
|
|
78
78
|
"@semantic-release/changelog": "6.0.2",
|
|
79
79
|
"@semantic-release/exec": "6.0.3",
|
|
80
80
|
"@semantic-release/git": "10.0.1",
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useLocalization } from '@akinon/next/hooks';
|
|
4
|
-
import { useEffect, useRef } from 'react';
|
|
5
4
|
import { Select } from './select';
|
|
6
5
|
|
|
7
|
-
import {
|
|
8
|
-
isTrustedEditorEvent,
|
|
9
|
-
postToEditor
|
|
10
|
-
} from '@akinon/pz-theme/src/editor-bridge';
|
|
11
6
|
interface LanguageSelectProps {
|
|
12
7
|
className?: string;
|
|
13
8
|
showIcon?: boolean;
|
|
@@ -18,62 +13,15 @@ interface LanguageSelectProps {
|
|
|
18
13
|
labelFormat?: 'full' | 'short' | 'code';
|
|
19
14
|
}
|
|
20
15
|
|
|
16
|
+
// The theme editor's Language dropdown is kept in sync by @akinon/pz-theme
|
|
17
|
+
// (src/editor-locale-bridge.tsx), which every theme placeholder mounts. This
|
|
18
|
+
// component is only the storefront's own switcher: the header renders it more
|
|
19
|
+
// than once, so it must not talk to the editor itself.
|
|
21
20
|
export const LanguageSelect = (props: LanguageSelectProps) => {
|
|
22
21
|
const { locale, locales, setLocale } = useLocalization();
|
|
23
|
-
const isUpdatingFromParent = useRef(false);
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
postToEditor({
|
|
28
|
-
type: 'LOCALE_UPDATE',
|
|
29
|
-
data: {
|
|
30
|
-
locale,
|
|
31
|
-
locales: locales.map((lang) => ({
|
|
32
|
-
value: lang.value,
|
|
33
|
-
label: lang.label
|
|
34
|
-
}))
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}, [locale, locales]);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const handleMessage = (event: MessageEvent) => {
|
|
42
|
-
if (!isTrustedEditorEvent(event)) return;
|
|
43
|
-
if (event.data?.type === 'LOCALE_UPDATE') {
|
|
44
|
-
const { locale: newLocale } = event.data.data;
|
|
45
|
-
|
|
46
|
-
if (newLocale && newLocale !== locale) {
|
|
47
|
-
isUpdatingFromParent.current = true;
|
|
48
|
-
setLocale(newLocale);
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
isUpdatingFromParent.current = false;
|
|
51
|
-
}, 100);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
window.addEventListener('message', handleMessage);
|
|
57
|
-
return () => window.removeEventListener('message', handleMessage);
|
|
58
|
-
}, [locale, setLocale]);
|
|
59
|
-
|
|
60
|
-
const handleChange = async (e) => {
|
|
61
|
-
const selectedLanguage = e.currentTarget.value;
|
|
62
|
-
|
|
63
|
-
setLocale(selectedLanguage);
|
|
64
|
-
|
|
65
|
-
if (window.parent !== window) {
|
|
66
|
-
postToEditor({
|
|
67
|
-
type: 'LOCALE_UPDATE',
|
|
68
|
-
data: {
|
|
69
|
-
locale: selectedLanguage,
|
|
70
|
-
locales: locales.map((lang) => ({
|
|
71
|
-
value: lang.value,
|
|
72
|
-
label: lang.label
|
|
73
|
-
}))
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
23
|
+
const handleChange = (e) => {
|
|
24
|
+
setLocale(e.currentTarget.value);
|
|
77
25
|
};
|
|
78
26
|
|
|
79
27
|
// Format label based on labelFormat prop
|