itube-specs 0.0.859 → 0.0.861

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/README.md CHANGED
@@ -66,6 +66,9 @@ npm run patch # npm version patch — бамп версии перед п
66
66
  ```
67
67
 
68
68
  Pre-commit (husky + lint-staged): на закоммиченных файлах прогоняются `eslint --fix` и `stylelint --fix`.
69
+ ⚠️ **Шаблоны `.vue` не типизируются вообще.** Обычный `tsc` их не читает, а `vue-tsc` не подключён (накопился
70
+ бэклог ошибок в шаблонах, подключение — отдельная задача). Значит чистый `tsc` ничего не говорит про выражения
71
+ в шаблоне: арифметика над строковым union, неверный тип пропа, переименованное поле пройдут молча.
69
72
 
70
73
  ---
71
74
 
@@ -10,7 +10,7 @@
10
10
  transparent-backdrop
11
11
  :back="isBackShow"
12
12
  class="auth-popup"
13
- @back="currentStep -= 1"
13
+ @back="goBack"
14
14
  >
15
15
  <template #title>{{ $t('auth.create_new') }}</template>
16
16
  <AuthRegister
@@ -27,12 +27,12 @@
27
27
  transparent-backdrop
28
28
  :back="isBackShow"
29
29
  class="auth-popup"
30
- @back="currentStep -= 1"
30
+ @back="goBack"
31
31
  >
32
32
  <template #title>{{ $t('auth.welcome_back') }}</template>
33
33
  <AuthLogin
34
34
  @forgot="onRecoveryClick"
35
- @create="currentStep -= 1"
35
+ @create="currentStep = AuthSteps.Registration"
36
36
  />
37
37
  </UiPopup>
38
38
  </transition>
@@ -44,7 +44,7 @@
44
44
  transparent-backdrop
45
45
  :back="isBackShow"
46
46
  class="auth-popup"
47
- @back="currentStep -= 1"
47
+ @back="goBack"
48
48
  >
49
49
  <template #title>{{ $t('auth.recovery_title')}}</template>
50
50
  <AuthRecovery @login="onLoginClick"/>
@@ -59,6 +59,20 @@ const { isAuthPopupOpen, currentStep, additionalText } = useAuthPopup();
59
59
 
60
60
  const backShow = ref(false);
61
61
 
62
+ // Куда ведёт «назад» с каждого шага. Registration — начальный, назад с него нет.
63
+ const previousStep: Partial<Record<AuthSteps, AuthSteps>> = {
64
+ [AuthSteps.Login]: AuthSteps.Registration,
65
+ [AuthSteps.Recovery]: AuthSteps.Login,
66
+ };
67
+
68
+ function goBack(): void {
69
+ const previous = previousStep[currentStep.value];
70
+
71
+ if (previous) {
72
+ currentStep.value = previous;
73
+ }
74
+ }
75
+
62
76
  function onLoginClick(): void {
63
77
  currentStep.value = AuthSteps.Login;
64
78
  backShow.value = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.859",
4
+ "version": "0.0.861",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  export const AuthSteps = {
2
- Registration: 1,
3
- Login: 2,
4
- Recovery: 3,
2
+ Registration: 'registration',
3
+ Login: 'login',
4
+ Recovery: 'recovery',
5
5
  } as const;
6
6
 
7
7
  export type AuthSteps = typeof AuthSteps[keyof typeof AuthSteps];
@@ -1,7 +1,7 @@
1
1
  export const PlaylistStep = {
2
- Edit: 1,
3
- Delete: 2,
4
- DeleteVideo: 3,
2
+ Edit: 'edit',
3
+ Delete: 'delete',
4
+ DeleteVideo: 'delete-video',
5
5
  } as const;
6
6
 
7
7
  export type PlaylistStep = typeof PlaylistStep[keyof typeof PlaylistStep];