@designcrowd/fe-shared-lib 1.2.0-ml-jj-1 → 1.2.0-ml-jj-3

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/index.js CHANGED
@@ -19,6 +19,8 @@ export { default as SellDomainNameWidget } from './src/experiences/components/Se
19
19
  export { default as PublishBrandPageModal } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue';
20
20
  export { default as PublishBrandPageCard } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageCard.vue';
21
21
 
22
+ export { default as useSellDomainNameSearchContent } from './src/experiences/components/SellDomainNameSearch/UseSellDomainNameSearchContent';
23
+
22
24
  export { default as Button } from './src/atoms/components/Button/Button.vue';
23
25
  export { default as ButtonGroup } from './src/atoms/components/ButtonGroup/ButtonGroup.vue';
24
26
  export { default as Dropdown } from './src/atoms/components/Dropdown/Dropdown.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.2.0-ml-jj-1",
3
+ "version": "1.2.0-ml-jj-3",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -11,42 +11,56 @@ const locale = 'en-test';
11
11
 
12
12
  const localePublishBrandPageModalContent = {
13
13
  'en-US': {
14
- firstTimePublishHeaderLabel: `Set the URL for your Website`,
15
- sitePublishedLabel: `Site published!`,
16
- publishSuccessLabel: `Your Website is live! Start using your link:`,
17
- freePublishCardTitleLabel: `Free Address`,
18
- freePublishCardDescriptionLabel: `Choose a free address to publish now. You can always edit the URL later`,
19
- slugInputPlaceholderYourNameLabel: 'your-name',
20
- slugInputPlaceholderYourBusinessNameLabel: 'your-business-name',
21
- freeDomainLabel: `Free domain`,
22
- purchasedDomainLabel: `Purchased domain`,
23
- setUrlLabel: 'Set URL',
24
- publishLabel: 'Publish',
25
- viewMoreDomainLabel: 'VIEW MORE DOMAINS',
26
- viewMyWebsiteLabel: 'View Website',
27
- copyLabel: 'Copy',
28
- copySuccessLabel: 'Copied!',
29
- publishedSuccessDescriptionLabel: 'Buy matching domain name for your brand',
30
- hasAlreadyPurchasedDomainCloseButtonLabel: 'No thanks, maybe later',
14
+ searchButtonLabel: 'Search',
15
+ publishBrandPageModalContent: {
16
+ firstTimePublishHeaderLabel: `Set the URL for your Website`,
17
+ sitePublishedLabel: `Site published!`,
18
+ publishSuccessLabel: `Your Website is live! Start using your link:`,
19
+ freePublishCardTitleLabel: `Free Address`,
20
+ freePublishCardDescriptionLabel: `Choose a free address to publish now. You can always edit the URL later`,
21
+ slugInputPlaceholderYourNameLabel: 'your-name',
22
+ slugInputPlaceholderYourBusinessNameLabel: 'your-business-name',
23
+ freeDomainLabel: `Free domain`,
24
+ purchasedDomainLabel: `Purchased domain`,
25
+ setUrlLabel: 'Set URL',
26
+ publishLabel: 'Publish',
27
+ viewMoreDomainLabel: 'VIEW MORE DOMAINS',
28
+ viewMyWebsiteLabel: 'View Website',
29
+ copyLabel: 'Copy',
30
+ copySuccessLabel: 'Copied!',
31
+ publishedSuccessDescriptionLabel: 'Buy matching domain name for your brand',
32
+ hasAlreadyPurchasedDomainCloseButtonLabel: 'No thanks, maybe later',
33
+ },
34
+ sellDomainNameListSearchResult: {
35
+ domainSearchEmptyMessage: 'Sorry, we couldn\'t find any domain for "{domainNameSearchTerm}".',
36
+ searchAnotherDomainMessage: 'Try searching with another domain name.',
37
+ },
31
38
  },
32
39
  'en-test': {
33
- firstTimePublishHeaderLabel: `++Set the URL for your Website`,
34
- sitePublishedLabel: `++Site published!`,
35
- publishSuccessLabel: `++Your Website is live! Start using your link:`,
36
- freePublishCardTitleLabel: `++Free Address`,
37
- freePublishCardDescriptionLabel: `++Choose a free address to publish now. You can always edit the URL later`,
38
- slugInputPlaceholderYourNameLabel: '++your-name',
39
- slugInputPlaceholderYourBusinessNameLabel: '++your-business-name',
40
- freeDomainLabel: `++Free domain`,
41
- purchasedDomainLabel: `++Purchased domain`,
42
- setUrlLabel: '++Set URL',
43
- publishLabel: '++Publish',
44
- viewMoreDomainLabel: '++VIEW MORE DOMAINS',
45
- viewMyWebsiteLabel: '++View Website',
46
- copyLabel: '++Copy',
47
- copySuccessLabel: '++Copied!',
48
- publishedSuccessDescriptionLabel: '++Buy matching domain name for your brand',
49
- hasAlreadyPurchasedDomainCloseButtonLabel: '++No thanks, maybe later',
40
+ searchButtonLabel: '++Search',
41
+ publishBrandPageModalContent: {
42
+ firstTimePublishHeaderLabel: `++Set the URL for your Website`,
43
+ sitePublishedLabel: `++Site published!`,
44
+ publishSuccessLabel: `++Your Website is live! Start using your link:`,
45
+ freePublishCardTitleLabel: `++Free Address`,
46
+ freePublishCardDescriptionLabel: `++Choose a free address to publish now. You can always edit the URL later`,
47
+ slugInputPlaceholderYourNameLabel: '++your-name',
48
+ slugInputPlaceholderYourBusinessNameLabel: '++your-business-name',
49
+ freeDomainLabel: `++Free domain`,
50
+ purchasedDomainLabel: `++Purchased domain`,
51
+ setUrlLabel: '++Set URL',
52
+ publishLabel: '++Publish',
53
+ viewMoreDomainLabel: '++VIEW MORE DOMAINS',
54
+ viewMyWebsiteLabel: '++View Website',
55
+ copyLabel: '++Copy',
56
+ copySuccessLabel: '++Copied!',
57
+ publishedSuccessDescriptionLabel: '++Buy matching domain name for your brand',
58
+ hasAlreadyPurchasedDomainCloseButtonLabel: '++No thanks, maybe later',
59
+ },
60
+ sellDomainNameListSearchResult: {
61
+ domainSearchEmptyMessage: '++Sorry, we couldn\'t find any domain for "{domainNameSearchTerm}".',
62
+ searchAnotherDomainMessage: '++Try searching with another domain name.',
63
+ },
50
64
  },
51
65
  };
52
66
 
@@ -58,7 +72,7 @@ export const NotPublishedWithPurchasedDomains = () => {
58
72
  data() {
59
73
  return {
60
74
  domains,
61
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
75
+ content: localePublishBrandPageModalContent[locale],
62
76
  };
63
77
  },
64
78
  methods: {},
@@ -73,7 +87,7 @@ export const NotPublishedWithPurchasedDomains = () => {
73
87
  brand-page-base-url="https://brand.site/"
74
88
  radio-value="slug"
75
89
  :show-radio-buttons="domains.length > 0"
76
- :publishBrandPageModalContent="publishBrandPageModalContent"
90
+ :content="content"
77
91
  />
78
92
  `,
79
93
  };
@@ -96,7 +110,7 @@ export const PublishWithSelectedDomain = () => {
96
110
  isRegistrationComplete: false,
97
111
  status: 'Active',
98
112
  },
99
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
113
+ content: localePublishBrandPageModalContent[locale],
100
114
  };
101
115
  },
102
116
  methods: {
@@ -115,7 +129,7 @@ export const PublishWithSelectedDomain = () => {
115
129
  brand-page-base-url="https://brand.site/"
116
130
  radio-value="purchased"
117
131
  :show-radio-buttons="domains.length > 0"
118
- :publishBrandPageModalContent="publishBrandPageModalContent"
132
+ :content="content"
119
133
  @radio-button-changed="onRadioButtonChanged"
120
134
  />
121
135
  `,
@@ -130,7 +144,7 @@ export const SetSlug = () => {
130
144
  data() {
131
145
  return {
132
146
  domains,
133
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
147
+ content: localePublishBrandPageModalContent[locale],
134
148
  };
135
149
  },
136
150
  methods: {},
@@ -145,7 +159,7 @@ export const SetSlug = () => {
145
159
  brand-page-base-url="https://brand.site/"
146
160
  brand-page-slug='test-slug'
147
161
  :show-radio-buttons="domains.length > 0"
148
- :publishBrandPageModalContent="publishBrandPageModalContent"
162
+ :content="content"
149
163
  />
150
164
  `,
151
165
  };
@@ -158,7 +172,7 @@ export const Published = () => {
158
172
  data() {
159
173
  return {
160
174
  domains,
161
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
175
+ content: localePublishBrandPageModalContent[locale],
162
176
  };
163
177
  },
164
178
  methods: {},
@@ -172,7 +186,7 @@ export const Published = () => {
172
186
  brand-page-base-url="https://brand.site/"
173
187
  radio-value="slug"
174
188
  brand-page-url="https://brand.site/brandname"
175
- :publishBrandPageModalContent="publishBrandPageModalContent"
189
+ :content="content"
176
190
  />
177
191
  `,
178
192
  };
@@ -185,7 +199,7 @@ export const PublishedNoDomains = () => {
185
199
  data() {
186
200
  return {
187
201
  domains: [],
188
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
202
+ content: localePublishBrandPageModalContent[locale],
189
203
  };
190
204
  },
191
205
  methods: {},
@@ -201,7 +215,7 @@ export const PublishedNoDomains = () => {
201
215
  brand-page-base-url="https://brand.site/"
202
216
  radio-value="slug"
203
217
  brand-page-url="https://brand.site/test-slug"
204
- :publishBrandPageModalContent="publishBrandPageModalContent"
218
+ :content="content"
205
219
  />
206
220
  `,
207
221
  };
@@ -217,7 +231,7 @@ export const Free = () => {
217
231
  domains: [],
218
232
  isSearchDomainListModalVisible: false,
219
233
  isDesignCom: false,
220
- publishBrandPageModalContent: localePublishBrandPageModalContent[locale],
234
+ content: localePublishBrandPageModalContent[locale],
221
235
  };
222
236
  },
223
237
  methods: {
@@ -239,7 +253,7 @@ export const Free = () => {
239
253
  brand-page-url="https://brand.site/brandname"
240
254
  :show-radio-buttons="domains.length > 0"
241
255
  :is-search-domain-list-modal-visible="isSearchDomainListModalVisible"
242
- :publishBrandPageModalContent="publishBrandPageModalContent"
256
+ :content="content"
243
257
  @on-hide-domain-modal="onHideDomainListModal"
244
258
  >
245
259
  <template #recommended>
@@ -195,6 +195,7 @@
195
195
  :currency="userCurrency"
196
196
  :display-result-limit="4"
197
197
  :domain-search-location="sitePublishedModal"
198
+ :content="content"
198
199
  @on-change-search="onSearchTextChanged"
199
200
  />
200
201
  </div>
@@ -401,7 +402,7 @@ export default {
401
402
  required: true,
402
403
  default: '',
403
404
  },
404
- publishBrandPageModalContent: {
405
+ content: {
405
406
  type: Object,
406
407
  required: true,
407
408
  },
@@ -418,26 +419,26 @@ export default {
418
419
  ],
419
420
  data() {
420
421
  return {
421
- firstTimePublishHeaderLabel: this.publishBrandPageModalContent.firstTimePublishHeaderLabel,
422
- sitePublishedLabel: this.publishBrandPageModalContent.sitePublishedLabel,
423
- publishSuccessLabel: this.publishBrandPageModalContent.publishSuccessLabel,
424
- freePublishCardTitleLabel: this.publishBrandPageModalContent.freePublishCardTitleLabel,
425
- freePublishCardDescriptionLabel: this.publishBrandPageModalContent.freePublishCardDescriptionLabel,
426
- slugInputPlaceholderYourNameLabel: this.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
422
+ firstTimePublishHeaderLabel: this.content.publishBrandPageModalContent.firstTimePublishHeaderLabel,
423
+ sitePublishedLabel: this.content.publishBrandPageModalContent.sitePublishedLabel,
424
+ publishSuccessLabel: this.content.publishBrandPageModalContent.publishSuccessLabel,
425
+ freePublishCardTitleLabel: this.content.publishBrandPageModalContent.freePublishCardTitleLabel,
426
+ freePublishCardDescriptionLabel: this.content.publishBrandPageModalContent.freePublishCardDescriptionLabel,
427
+ slugInputPlaceholderYourNameLabel:
428
+ this.content.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
427
429
  slugInputPlaceholderYourBusinessNameLabel:
428
- this.publishBrandPageModalContent.slugInputPlaceholderYourBusinessNameLabel,
429
- freeDomainLabel: this.publishBrandPageModalContent.freeDomainLabel,
430
- purchasedDomainLabel: this.publishBrandPageModalContent.purchasedDomainLabel,
431
- setUrlLabel: this.publishBrandPageModalContent.setUrlLabel,
432
- publishLabel: this.publishBrandPageModalContent.publishLabel,
433
- viewMoreDomainLabel: this.publishBrandPageModalContent.viewMoreDomainLabel,
434
- viewMyWebsiteLabel: this.publishBrandPageModalContent.viewMyWebsiteLabel,
435
- copyLabel: this.publishBrandPageModalContent.copyLabel,
436
- copySuccessLabel: this.publishBrandPageModalContent.copySuccessLabel,
430
+ this.content.publishBrandPageModalContent.slugInputPlaceholderYourBusinessNameLabel,
431
+ freeDomainLabel: this.content.publishBrandPageModalContent.freeDomainLabel,
432
+ purchasedDomainLabel: this.content.publishBrandPageModalContent.purchasedDomainLabel,
433
+ setUrlLabel: this.content.publishBrandPageModalContent.setUrlLabel,
434
+ publishLabel: this.content.publishBrandPageModalContent.publishLabel,
435
+ viewMoreDomainLabel: this.content.publishBrandPageModalContent.viewMoreDomainLabel,
436
+ viewMyWebsiteLabel: this.content.publishBrandPageModalContent.viewMyWebsiteLabel,
437
+ copyLabel: this.content.publishBrandPageModalContent.copyLabel,
438
+ copySuccessLabel: this.content.publishBrandPageModalContent.copySuccessLabel,
437
439
  hasAlreadyPurchasedDomainCloseButtonLabel:
438
- this.publishBrandPageModalContent.hasAlreadyPurchasedDomainCloseButtonLabel,
439
- publishedSuccessDescriptionLabel: this.publishBrandPageModalContent.publishedSuccessDescriptionLabel,
440
-
440
+ this.content.publishBrandPageModalContent.hasAlreadyPurchasedDomainCloseButtonLabel,
441
+ publishedSuccessDescriptionLabel: this.content.publishBrandPageModalContent.publishedSuccessDescriptionLabel,
441
442
  DOMAIN_TYPES,
442
443
  domainTypeValue: this.radioValue,
443
444
  internalSlug: this.brandPageSlug,
@@ -32,7 +32,7 @@
32
32
  <Button
33
33
  :classes="searchButtonClasses"
34
34
  variant="primary"
35
- label="Search"
35
+ :label="searchButtonLabel"
36
36
  :disabled="false"
37
37
  @on-click="onSearchBarClick"
38
38
  />
@@ -41,15 +41,11 @@
41
41
  </div>
42
42
  </template>
43
43
  <script>
44
- import Button from '../../../../src/atoms/components/Button/Button.vue';
45
- import TextInput from '../../../../src/atoms/components/TextInput/TextInput.vue';
44
+ import Button from '../../../atoms/components/Button/Button.vue';
45
+ import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
46
+ import useSellDomainNameSearchContent from './UseSellDomainNameSearchContent';
46
47
 
47
- import {
48
- sellDomainNameMinSearchTextLength,
49
- sellDomainNameSearchBarLabel,
50
- sellDomainNameSearchBarPlaceholder,
51
- sellDomainNameSearchBarPreText,
52
- } from '../../constants/sell-domain-name-constants';
48
+ import { sellDomainNameMinSearchTextLength } from '../../constants/sell-domain-name-constants';
53
49
 
54
50
  export default {
55
51
  components: {
@@ -79,14 +75,27 @@ export default {
79
75
  type: Boolean,
80
76
  required: false,
81
77
  },
78
+ contentOverride: {
79
+ type: Object,
80
+ required: false,
81
+ default: null,
82
+ },
82
83
  },
83
84
  emits: ['onSearch', 'onSearchTextInputChange'],
85
+ setup(props) {
86
+ const contentProvider = useSellDomainNameSearchContent(props.contentOverride);
87
+ const content = contentProvider.getContent();
88
+
89
+ return {
90
+ searchButtonLabel: content.searchButtonLabel,
91
+ searchBarLabel: content.searchBarLabel,
92
+ searchBarPlaceholder: content.searchBarPlaceholder,
93
+ searchBarPreText: content.searchBarPreText,
94
+ };
95
+ },
84
96
  data() {
85
97
  return {
86
- searchBarLabel: sellDomainNameSearchBarLabel,
87
- searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
88
98
  searchText: this.initialSearchTerm ?? '',
89
- searchBarPreText: sellDomainNameSearchBarPreText,
90
99
  };
91
100
  },
92
101
  computed: {
@@ -0,0 +1,33 @@
1
+ import {
2
+ sellDomainNameSearchBarLabel,
3
+ sellDomainNameSearchBarPlaceholder,
4
+ sellDomainNameSearchBarPreText,
5
+ } from '../../constants/sell-domain-name-constants';
6
+
7
+ let globalContentProvider = null;
8
+
9
+ const defaultContent = {
10
+ searchButtonLabel: 'Search---',
11
+ searchBarLabel: sellDomainNameSearchBarLabel,
12
+ searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
13
+ searchBarPreText: sellDomainNameSearchBarPreText,
14
+ };
15
+
16
+ const useSellDomainNameSearchContent = (overrides = {}) => {
17
+ const setGlobalContentHandler = (handler) => {
18
+ globalContentProvider = handler;
19
+ };
20
+
21
+ return {
22
+ setGlobalContentHandler,
23
+ getContent: () => {
24
+ return {
25
+ ...defaultContent,
26
+ ...(globalContentProvider ? globalContentProvider() : {}), // provide global content through global injection
27
+ ...overrides, // can override specific contents on demand
28
+ };
29
+ },
30
+ };
31
+ };
32
+
33
+ export default useSellDomainNameSearchContent;
@@ -27,9 +27,9 @@
27
27
  @load-more-domains="onLoadMoreDomains"
28
28
  />
29
29
  <div v-else-if="shouldShowDomainNameNotFound" class="tw-flex tw-justify-center tw-text-center">
30
- Sorry, we couldn't find any domain for "{{ previousSearchText }}".
30
+ {{ domainSearchEmptyMessageWithUserDomainName }}
31
31
  <br />
32
- Try searching with another domain name.
32
+ {{ searchAnotherDomainMessage }}
33
33
  </div>
34
34
  <div v-else></div>
35
35
  </div>
@@ -99,13 +99,22 @@ export default {
99
99
  type: String,
100
100
  default: undefined,
101
101
  },
102
+ content: {
103
+ type: Object,
104
+ required: true,
105
+ },
102
106
  },
103
107
  data() {
104
108
  return {
109
+ domainSearchEmptyMessage: this.content.sellDomainNameListSearchResult.domainSearchEmptyMessage,
110
+ searchAnotherDomainMessage: this.content.sellDomainNameListSearchResult.searchAnotherDomainMessage,
105
111
  domainNameItemsInView: undefined,
106
112
  };
107
113
  },
108
114
  computed: {
115
+ domainSearchEmptyMessageWithUserDomainName() {
116
+ return this.domainSearchEmptyMessage.replace('{domainNameSearchTerm}', this.previousSearchText);
117
+ },
109
118
  shouldShowDomainNameNotFound() {
110
119
  return (
111
120
  !this.isBusy &&
@@ -4,6 +4,7 @@
4
4
  :is-design-com="isDesignCom"
5
5
  :initial-search-term="initialSearchTerm"
6
6
  :show-white-search-background="showWhiteSearchBackground"
7
+ :search-button-label="content.searchButtonLabel"
7
8
  @onSearch="onSearchDomainName"
8
9
  />
9
10
  <SellDomainNameSearchResult
@@ -20,6 +21,7 @@
20
21
  :domain-name-items-per-page="domainNameItemsPerPage"
21
22
  :load-more-domains-button-text="loadMoreDomainsButtonText"
22
23
  :domain-search-location="domainSearchLocation"
24
+ :content="content"
23
25
  />
24
26
  </div>
25
27
  </template>
@@ -100,6 +102,10 @@ export default {
100
102
  type: Number,
101
103
  default: undefined,
102
104
  },
105
+ content: {
106
+ type: Object,
107
+ required: true,
108
+ },
103
109
  },
104
110
  data: () => ({
105
111
  domainNameItems: undefined,