@designcrowd/fe-shared-lib 1.3.3-ML-signin-fixes → 1.3.4-ML-signin-fixes-2

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.
@@ -1,4 +1,41 @@
1
1
  import { withThemeByClassName } from '@storybook/addon-themes';
2
+ import { setSharedLibLocaleAsync } from '../src/useSharedLibTranslate';
3
+
4
+ setSharedLibLocaleAsync('en-US');
5
+
6
+ const LOCALES = {
7
+ 'en-US': '🇺🇸 English (US)',
8
+ 'fr-FR': '🇫🇷 Français (France)',
9
+ 'es-ES': '🇪🇸 Español (Spain)',
10
+ 'pt-PT': '🇵🇹 Português (Portugal)',
11
+ 'de-DE': '🇩🇪 Deutsch (Germany)',
12
+ 'fr-CA': '🇨🇦 Français (Canada)',
13
+ 'pt-BR': '🇧🇷 Português (Brazil)',
14
+ };
15
+
16
+ const globalLocaleLoader = async (context) => {
17
+ const locale = context.globals.locale || 'en-US';
18
+ await setSharedLibLocaleAsync(locale);
19
+ return { locale };
20
+ };
21
+
22
+
23
+ export const globalTypes = {
24
+ locale: {
25
+ name: 'Locale',
26
+ description: 'Internationalization locale',
27
+ defaultValue: 'en-US',
28
+ toolbar: {
29
+ icon: 'globe',
30
+ items: Object.entries(LOCALES).map(([key, value]) => ({
31
+ value: key,
32
+ title: value,
33
+ })),
34
+ showName: true,
35
+ dynamicTitle: true,
36
+ },
37
+ },
38
+ };
2
39
 
3
40
  export const decorators = [
4
41
  withThemeByClassName({
@@ -12,3 +49,5 @@ export const decorators = [
12
49
  defaultTheme: 'brandCrowd',
13
50
  }),
14
51
  ];
52
+
53
+ export const loaders = [globalLocaleLoader];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.3.3-ML-signin-fixes",
3
+ "version": "1.3.4-ML-signin-fixes-2",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -63,7 +63,6 @@
63
63
  <input
64
64
  v-model="aUserName"
65
65
  name="userName"
66
- type="email"
67
66
  data-test-email-input
68
67
  aria-required="true"
69
68
  :aria-invalid="!!userNameError"
@@ -56,3 +56,4 @@ export const SampleSearchbar = () => {
56
56
  `,
57
57
  };
58
58
  };
59
+
@@ -101,7 +101,6 @@ import { uploadYourLogoTr } from '../../../useSharedLibTranslate';
101
101
  const ACCEPTED_MIME_TYPES = ['image/jpeg', 'image/png', 'image/svg+xml', 'application/postscript'];
102
102
 
103
103
  const ACCEPTED_FILE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'svg', 'eps'];
104
- const UNSUPPORTED_FILE_ERROR_MSG = () => uploadYourLogoTr(`wrongUploadType`);
105
104
 
106
105
  export default {
107
106
  components: {
@@ -161,24 +160,19 @@ export default {
161
160
  uploadYourLogoTr,
162
161
  };
163
162
  },
164
- data() {
165
- const self = this;
163
+ computed: {
164
+ options() {
165
+ const self = this;
166
+ const errorMessage = uploadYourLogoTr('wrongUploadType');
166
167
 
167
- return {
168
- options: {
168
+ return {
169
169
  url: '#',
170
170
  autoProcessQueue: false,
171
171
  maxFiles: 1,
172
172
  uploadMultiple: false,
173
173
  acceptedFiles: ACCEPTED_MIME_TYPES.join(','),
174
+ dictInvalidFileType: errorMessage,
174
175
  accept(file) {
175
- const extension = file.name.split('.').pop().toLowerCase();
176
-
177
- if (ACCEPTED_FILE_EXTENSIONS.indexOf(extension) < 0) {
178
- self.displayError(UNSUPPORTED_FILE_ERROR_MSG());
179
- return;
180
- }
181
-
182
176
  const reader = new FileReader();
183
177
  const dropzone = this;
184
178
 
@@ -200,8 +194,11 @@ export default {
200
194
  }
201
195
  });
202
196
  },
203
- },
204
- };
197
+ };
198
+ }
199
+ },
200
+ data() {
201
+ return {};
205
202
  },
206
203
  mounted() {
207
204
  if (window) {