@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-beta.0
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-beta.0
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [cbbbfd757]
8
- - @akinon/next@2.0.109-beta.0
9
- - @akinon/pz-theme@2.0.109-beta.0
10
- - @akinon/pz-virtual-try-on@2.0.109-beta.0
11
- - @akinon/pz-akifast@2.0.109-beta.0
12
- - @akinon/pz-apple-pay@2.0.109-beta.0
13
- - @akinon/pz-b2b@2.0.109-beta.0
14
- - @akinon/pz-basket-gift-pack@2.0.109-beta.0
15
- - @akinon/pz-bkm@2.0.109-beta.0
16
- - @akinon/pz-checkout-gift-pack@2.0.109-beta.0
17
- - @akinon/pz-click-collect@2.0.109-beta.0
18
- - @akinon/pz-credit-payment@2.0.109-beta.0
19
- - @akinon/pz-cybersource-uc@2.0.109-beta.0
20
- - @akinon/pz-flow-payment@2.0.109-beta.0
21
- - @akinon/pz-google-pay@2.0.109-beta.0
22
- - @akinon/pz-gpay@2.0.109-beta.0
23
- - @akinon/pz-haso@2.0.109-beta.0
24
- - @akinon/pz-hepsipay@2.0.109-beta.0
25
- - @akinon/pz-masterpass@2.0.109-beta.0
26
- - @akinon/pz-masterpass-rest@2.0.109-beta.0
27
- - @akinon/pz-multi-basket@2.0.109-beta.0
28
- - @akinon/pz-one-click-checkout@2.0.109-beta.0
29
- - @akinon/pz-otp@2.0.109-beta.0
30
- - @akinon/pz-pay-on-delivery@2.0.109-beta.0
31
- - @akinon/pz-saved-card@2.0.109-beta.0
32
- - @akinon/pz-similar-products@2.0.109-beta.0
33
- - @akinon/pz-tabby-extension@2.0.109-beta.0
34
- - @akinon/pz-tamara-extension@2.0.109-beta.0
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-beta.0",
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-beta.0",
28
- "@akinon/pz-akifast": "2.0.109-beta.0",
29
- "@akinon/pz-apple-pay": "2.0.109-beta.0",
30
- "@akinon/pz-b2b": "2.0.109-beta.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.109-beta.0",
32
- "@akinon/pz-bkm": "2.0.109-beta.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.109-beta.0",
34
- "@akinon/pz-click-collect": "2.0.109-beta.0",
35
- "@akinon/pz-credit-payment": "2.0.109-beta.0",
36
- "@akinon/pz-cybersource-uc": "2.0.109-beta.0",
37
- "@akinon/pz-flow-payment": "2.0.109-beta.0",
38
- "@akinon/pz-google-pay": "2.0.109-beta.0",
39
- "@akinon/pz-gpay": "2.0.109-beta.0",
40
- "@akinon/pz-haso": "2.0.109-beta.0",
41
- "@akinon/pz-hepsipay": "2.0.109-beta.0",
42
- "@akinon/pz-masterpass": "2.0.109-beta.0",
43
- "@akinon/pz-masterpass-rest": "2.0.109-beta.0",
44
- "@akinon/pz-multi-basket": "2.0.109-beta.0",
45
- "@akinon/pz-one-click-checkout": "2.0.109-beta.0",
46
- "@akinon/pz-otp": "2.0.109-beta.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.109-beta.0",
48
- "@akinon/pz-saved-card": "2.0.109-beta.0",
49
- "@akinon/pz-similar-products": "2.0.109-beta.0",
50
- "@akinon/pz-tabby-extension": "2.0.109-beta.0",
51
- "@akinon/pz-tamara-extension": "2.0.109-beta.0",
52
- "@akinon/pz-theme": "2.0.109-beta.0",
53
- "@akinon/pz-virtual-try-on": "2.0.109-beta.0",
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-beta.0",
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
- useEffect(() => {
26
- if (window.parent !== window && !isUpdatingFromParent.current) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.109-beta.0",
3
+ "version": "2.0.109",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {