@designcrowd/fe-shared-lib 1.2.0-ml-jj-6 → 1.2.0-ml-jj-8

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,8 +19,7 @@ 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
- export { default as useSellDomainNameListSearchResultContent } from './src/experiences/components/SellDomainNameSearchResult/UseSellDomainNameListSearchResultContent';
22
+ export { default as useSellDomainContent } from './src/experiences/components/SellDomainNameSearch/useSellDomainContent';
24
23
 
25
24
  export { default as Button } from './src/atoms/components/Button/Button.vue';
26
25
  export { default as ButtonGroup } from './src/atoms/components/ButtonGroup/ButtonGroup.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-6",
3
+ "version": "1.2.0-ml-jj-8",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -7,7 +7,7 @@ export default {
7
7
  component: PublishBrandPageModal,
8
8
  };
9
9
 
10
- const locale = 'en-test';
10
+ const locale = 'en-US';
11
11
 
12
12
  const localePublishBrandPageModalContent = {
13
13
  'en-US': {
@@ -32,28 +32,6 @@ const localePublishBrandPageModalContent = {
32
32
  hasAlreadyPurchasedDomainCloseButtonLabel: 'No thanks, maybe later',
33
33
  },
34
34
  },
35
- 'en-test': {
36
- searchButtonLabel: '++Search',
37
- publishBrandPageModalContent: {
38
- firstTimePublishHeaderLabel: `++Set the URL for your Website`,
39
- sitePublishedLabel: `++Site published!`,
40
- publishSuccessLabel: `++Your Website is live! Start using your link:`,
41
- freePublishCardTitleLabel: `++Free Address`,
42
- freePublishCardDescriptionLabel: `++Choose a free address to publish now. You can always edit the URL later`,
43
- slugInputPlaceholderYourNameLabel: '++your-name',
44
- slugInputPlaceholderYourBusinessNameLabel: '++your-business-name',
45
- freeDomainLabel: `++Free domain`,
46
- purchasedDomainLabel: `++Purchased domain`,
47
- setUrlLabel: '++Set URL',
48
- publishLabel: '++Publish',
49
- viewMoreDomainLabel: '++VIEW MORE DOMAINS',
50
- viewMyWebsiteLabel: '++View Website',
51
- copyLabel: '++Copy',
52
- copySuccessLabel: '++Copied!',
53
- publishedSuccessDescriptionLabel: '++Buy matching domain name for your brand',
54
- hasAlreadyPurchasedDomainCloseButtonLabel: '++No thanks, maybe later',
55
- },
56
- },
57
35
  };
58
36
 
59
37
  export const NotPublishedWithPurchasedDomains = () => {
@@ -241,6 +241,7 @@
241
241
  :domain-name-items="domainNameItems"
242
242
  :previous-search-text="previousSearchText"
243
243
  :visible="isModalVisible"
244
+ :search-button-label="content.searchButtonLabel"
244
245
  :domain-search-location="sitePublishedModal"
245
246
  @close-modal="onSellDomainNameListCloseModal"
246
247
  @search="searchDomainName(true)"
@@ -424,8 +425,7 @@ export default {
424
425
  publishSuccessLabel: this.content.publishBrandPageModalContent.publishSuccessLabel,
425
426
  freePublishCardTitleLabel: this.content.publishBrandPageModalContent.freePublishCardTitleLabel,
426
427
  freePublishCardDescriptionLabel: this.content.publishBrandPageModalContent.freePublishCardDescriptionLabel,
427
- slugInputPlaceholderYourNameLabel:
428
- this.content.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
428
+ slugInputPlaceholderYourNameLabel: this.content.publishBrandPageModalContent.slugInputPlaceholderYourNameLabel,
429
429
  slugInputPlaceholderYourBusinessNameLabel:
430
430
  this.content.publishBrandPageModalContent.slugInputPlaceholderYourBusinessNameLabel,
431
431
  freeDomainLabel: this.content.publishBrandPageModalContent.freeDomainLabel,
@@ -22,7 +22,7 @@
22
22
  {{ item.domainName }}
23
23
  </div>
24
24
  <div v-if="item.costPrice" class="tw-text-xs tw-text-grayscale-600 tw-flex tw-items-center">
25
- <span class="tw-mr-2"> Cost Price: </span>
25
+ <span class="tw-mr-2"> {{ costPriceLabel }} </span>
26
26
  <Price
27
27
  class="tw-font-bold"
28
28
  :amount="getCostPrice(item)"
@@ -30,7 +30,7 @@
30
30
  :currency="currency"
31
31
  fraction="2"
32
32
  :show-abbreviation="false"
33
- suffix="/yr"
33
+ :suffix="pricePerYearLabel"
34
34
  />
35
35
  </div>
36
36
  <div v-if="!isFree(item) || item.costPrice" class="tw-px-0 tw-mt-4 sm:tw-px-4 sm:tw-mt-0">
@@ -41,7 +41,7 @@
41
41
  :currency="currency"
42
42
  fraction="2"
43
43
  :show-abbreviation="false"
44
- suffix="/yr"
44
+ :suffix="pricePerYearLabel"
45
45
  />
46
46
  </div>
47
47
  </div>
@@ -63,9 +63,10 @@
63
63
  </div>
64
64
  </template>
65
65
  <script>
66
- import Button from '../../../../src/atoms/components/Button/Button.vue';
67
- import Price from '../../../../src/atoms/components/Price/Price.vue';
68
-
66
+ import { computed } from 'vue';
67
+ import Button from '../../../atoms/components/Button/Button.vue';
68
+ import Price from '../../../atoms/components/Price/Price.vue';
69
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
69
70
  import Events from '../../constants/event-constants';
70
71
 
71
72
  export default {
@@ -108,6 +109,16 @@ export default {
108
109
  },
109
110
  },
110
111
  emits: ['load-more-domains'],
112
+ setup() {
113
+ const contentProvider = useSellDomainContent();
114
+ const content = contentProvider.getContent();
115
+ return {
116
+ freeDomainButtonLabel: computed(() => content.value.freeDomainButtonLabel),
117
+ buyNowButtonLabel: computed(() => content.value.buyNowButtonLabel),
118
+ pricePerYearLabel: computed(() => content.value.pricePerYearLabel),
119
+ costPriceLabel: computed(() => content.value.costPriceLabel),
120
+ };
121
+ },
111
122
  methods: {
112
123
  onBuyNowClick(domain) {
113
124
  const request = domain;
@@ -133,7 +144,7 @@ export default {
133
144
  return parseFloat(domain.price) === 0;
134
145
  },
135
146
  getPurchaseLabel(domain) {
136
- return this.isFree(domain) ? 'Free Domain' : 'Buy Now';
147
+ return this.isFree(domain) ? this.freeDomainButtonLabel : this.buyNowButtonLabel;
137
148
  },
138
149
  },
139
150
  };
@@ -1,5 +1,6 @@
1
1
  import { domainNamesFixture } from '../SellDomainNameList/SellDomainNameList.fixtures';
2
2
  import SellDomainNameListModal from './SellDomainNameListModal.vue';
3
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
3
4
 
4
5
  export default {
5
6
  title: 'Components/SellDomainNameListModal',
@@ -11,6 +12,20 @@ export const Sample = () => {
11
12
  components: {
12
13
  SellDomainNameListModal,
13
14
  },
15
+ setup() {
16
+ const contentProvider = useSellDomainContent();
17
+
18
+ setTimeout(() => {
19
+ console.log('SETTE');
20
+ contentProvider.setGlobalContentHandler(() => {
21
+ return {
22
+ domainSearchHeaderTitle: '++++Search a domain name',
23
+ };
24
+ });
25
+ }, 7000);
26
+
27
+ return {};
28
+ },
14
29
  data() {
15
30
  return {
16
31
  domainNamesFixture,
@@ -13,9 +13,10 @@
13
13
  <SellDomainNameSearch
14
14
  v-if="visible"
15
15
  :is-design-com="isDesignCom"
16
- :header-title="headerTitle"
17
- :header-subtitle="headerSubtitle"
16
+ :header-title="headerTitle || domainSearchHeaderTitle"
17
+ :header-subtitle="headerSubtitle || domainSearchHeaderSubtitle"
18
18
  :initial-search-term="modelValue"
19
+ :search-button-label="searchButtonLabel"
19
20
  @onSearch="onSearch"
20
21
  @onSearchTextInputChange="onSearchTextInputChange"
21
22
  />
@@ -38,9 +39,8 @@ import Modal from '../../../atoms/components/Modal/Modal.vue';
38
39
 
39
40
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
40
41
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
41
-
42
- const headerSubtitle = 'Buy matching domain name for your brand';
43
- const headerTitle = 'Search a domain name';
42
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
43
+ import { computed } from 'vue';
44
44
 
45
45
  export default {
46
46
  components: {
@@ -60,11 +60,11 @@ export default {
60
60
  },
61
61
  headerSubtitle: {
62
62
  type: String,
63
- default: () => headerSubtitle,
63
+ default: null,
64
64
  },
65
65
  headerTitle: {
66
66
  type: String,
67
- default: () => headerTitle,
67
+ default: null,
68
68
  },
69
69
  isBusy: {
70
70
  type: Boolean,
@@ -92,8 +92,20 @@ export default {
92
92
  type: String,
93
93
  default: undefined,
94
94
  },
95
+ searchButtonLabel: {
96
+ type: String,
97
+ default: 'Search',
98
+ },
95
99
  },
96
100
  emits: ['close-modal', 'input', 'search'],
101
+ setup() {
102
+ const contentProvider = useSellDomainContent();
103
+ const content = contentProvider.getContent();
104
+ return {
105
+ domainSearchHeaderTitle: computed(() => content.value.domainSearchHeaderTitle),
106
+ domainSearchHeaderSubtitle: computed(() => content.value.domainSearchHeaderSubtitle),
107
+ };
108
+ },
97
109
  methods: {
98
110
  onSearch() {
99
111
  this.$emit('search');
@@ -49,8 +49,8 @@
49
49
  <SellDomainNameSearch
50
50
  v-if="visible"
51
51
  :is-design-com="isDesignCom"
52
- :header-title="headerTitle"
53
- :header-subtitle="headerSubtitle"
52
+ :header-title="headerTitle || domainSearchHeaderTitle"
53
+ :header-subtitle="headerSubtitle || domainSearchHeaderSubtitle"
54
54
  :initial-search-term="initialSearchTerm"
55
55
  @onSearch="onSearchDomainName"
56
56
  @onSearchTextInputChange="onSearchTextInputChange"
@@ -71,14 +71,13 @@
71
71
  </template>
72
72
  </template>
73
73
  <script>
74
+ import { computed } from 'vue';
74
75
  import Modal from '../../../atoms/components/Modal/Modal.vue';
75
76
  import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
76
77
  import SellDomainNameSearch from '../SellDomainNameSearch/SellDomainNameSearch.vue';
77
78
  import SellDomainNameSearchResult from '../SellDomainNameSearchResult/SellDomainNameListSearchResult.vue';
78
79
  import Events from '../../constants/event-constants';
79
-
80
- const headerSubtitle = 'Buy matching domain name for your brand';
81
- const headerTitle = 'Search a domain name';
80
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
82
81
 
83
82
  export default {
84
83
  components: {
@@ -89,11 +88,11 @@ export default {
89
88
  props: {
90
89
  headerSubtitle: {
91
90
  type: String,
92
- default: () => headerSubtitle,
91
+ default: null,
93
92
  },
94
93
  headerTitle: {
95
94
  type: String,
96
- default: () => headerTitle,
95
+ default: null,
97
96
  },
98
97
  modelValue: {
99
98
  type: String,
@@ -122,6 +121,14 @@ export default {
122
121
  default: undefined,
123
122
  },
124
123
  },
124
+ setup() {
125
+ const contentProvider = useSellDomainContent();
126
+ const content = contentProvider.getContent();
127
+ return {
128
+ domainSearchHeaderTitle: computed(() => content.value.domainSearchHeaderTitle),
129
+ domainSearchHeaderSubtitle: computed(() => content.value.domainSearchHeaderSubtitle),
130
+ };
131
+ },
125
132
  data: () => ({
126
133
  domainNameItems: [],
127
134
  userCurrency: {},
@@ -41,10 +41,10 @@
41
41
  </div>
42
42
  </template>
43
43
  <script>
44
+ import { computed } from 'vue';
44
45
  import Button from '../../../atoms/components/Button/Button.vue';
45
46
  import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
46
- import useSellDomainNameSearchContent from './UseSellDomainNameSearchContent';
47
-
47
+ import useSellDomainContent from './useSellDomainContent';
48
48
  import { sellDomainNameMinSearchTextLength } from '../../constants/sell-domain-name-constants';
49
49
 
50
50
  export default {
@@ -83,14 +83,14 @@ export default {
83
83
  },
84
84
  emits: ['onSearch', 'onSearchTextInputChange'],
85
85
  setup(props) {
86
- const contentProvider = useSellDomainNameSearchContent(props.contentOverride);
86
+ const contentProvider = useSellDomainContent(props.contentOverride);
87
87
  const content = contentProvider.getContent();
88
88
 
89
89
  return {
90
- searchButtonLabel: content.searchButtonLabel,
91
- searchBarLabel: content.searchBarLabel,
92
- searchBarPlaceholder: content.searchBarPlaceholder,
93
- searchBarPreText: content.searchBarPreText,
90
+ searchButtonLabel: computed(() => content.value.searchButtonLabel),
91
+ searchBarLabel: computed(() => content.value.searchBarLabel),
92
+ searchBarPlaceholder: computed(() => content.value.searchBarPlaceholder),
93
+ searchBarPreText: computed(() => content.value.searchBarPreText),
94
94
  };
95
95
  },
96
96
  data() {
@@ -0,0 +1,46 @@
1
+ import { ref, computed } from 'vue';
2
+ import {
3
+ sellDomainNameSearchBarLabel,
4
+ sellDomainNameSearchBarPlaceholder,
5
+ sellDomainNameSearchBarPreText,
6
+ } from '../../constants/sell-domain-name-constants';
7
+
8
+ const globalContentProvider = ref(null);
9
+
10
+ const defaultContent = {
11
+ searchButtonLabel: 'Search',
12
+ searchBarLabel: sellDomainNameSearchBarLabel,
13
+ searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
14
+ searchBarPreText: sellDomainNameSearchBarPreText,
15
+ domainSearchEmptyMessage: `Sorry, we couldn't find any domain for "{domainNameSearchTerm}".`,
16
+ searchAnotherDomainMessage: `Try searching with another domain name.`,
17
+
18
+ freeDomainButtonLabel: 'Free Domain',
19
+ buyNowButtonLabel: 'Buy Now',
20
+ pricePerYearLabel: '/yr',
21
+ costPriceLabel: 'Cost Price:',
22
+ domainSearchHeaderTitle: 'Search a domain name',
23
+ domainSearchHeaderSubtitle: 'Buy matching domain name for your brand',
24
+ domainSearchOrConnectHeaderSubtitle: 'Buy matching domain name for your brand or connect your existing domain',
25
+ };
26
+
27
+ const useSellDomainContent = (overrides = {}) => {
28
+ const setGlobalContentHandler = (handler) => {
29
+ globalContentProvider.value = handler;
30
+ };
31
+
32
+ return {
33
+ setGlobalContentHandler,
34
+ getContent: () => {
35
+ return computed(() => {
36
+ return {
37
+ ...defaultContent,
38
+ ...(globalContentProvider.value ? globalContentProvider.value() : {}), // provide global content through global injection
39
+ ...overrides, // can override specific contents on demand
40
+ };
41
+ });
42
+ },
43
+ };
44
+ };
45
+
46
+ export default useSellDomainContent;
@@ -36,12 +36,12 @@
36
36
  </template>
37
37
 
38
38
  <script>
39
+ import { computed } from 'vue';
39
40
  import Loader from '../../../atoms/components/Loader/Loader.vue';
40
41
  import Picture from '../../../atoms/components/Picture/Picture.vue';
41
-
42
42
  import SellDomainNameList from '../SellDomainNameList/SellDomainNameList.vue';
43
43
  import Events from '../../constants/event-constants';
44
- import useSellDomainNameListSearchResultContent from './UseSellDomainNameListSearchResultContent';
44
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
45
45
 
46
46
  export default {
47
47
  components: {
@@ -102,12 +102,12 @@ export default {
102
102
  },
103
103
  },
104
104
  setup(props) {
105
- const contentProvider = useSellDomainNameListSearchResultContent(props.contentOverride);
105
+ const contentProvider = useSellDomainContent(props.contentOverride);
106
106
  const content = contentProvider.getContent();
107
107
 
108
108
  return {
109
- domainSearchEmptyMessage: content.domainSearchEmptyMessage,
110
- searchAnotherDomainMessage: content.searchAnotherDomainMessage,
109
+ domainSearchEmptyMessage: computed(() => content.value.domainSearchEmptyMessage),
110
+ searchAnotherDomainMessage: computed(() => content.value.searchAnotherDomainMessage),
111
111
  };
112
112
  },
113
113
  data() {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- Buy matching domain name for your brand or connect your existing domain
3
+ {{ domainSearchOrConnectHeaderSubtitle }}
4
4
  <div class="tw-flex tw-flex-col md:tw-flex-row tw-mt-4 tw-mb-4">
5
5
  <TextInput
6
6
  v-model="searchText"
@@ -18,7 +18,7 @@
18
18
  <Button
19
19
  classes="tw-w-full tw-mt-2 md:tw-rounded-l-none md:tw-mt-0"
20
20
  variant="primary"
21
- label="Search"
21
+ :label="searchButtonLabel"
22
22
  :disabled="false"
23
23
  @on-click="onSearchBarClick"
24
24
  />
@@ -31,23 +31,21 @@
31
31
  :domain-name-items="domainNameItems"
32
32
  :previous-search-text="previousSearchText"
33
33
  :visible="isSearchDomainListModalVisible"
34
+ :search-button-label="searchButtonLabel"
34
35
  @close-modal="onSellDomainNameListCloseModal"
35
36
  @search="onSearchDomainName(true)"
36
37
  />
37
38
  </div>
38
39
  </template>
39
40
  <script>
40
- import Button from '../../../../src/atoms/components/Button/Button.vue';
41
- import TextInput from '../../../../src/atoms/components/TextInput/TextInput.vue';
42
-
41
+ import { computed } from 'vue';
42
+ import Button from '../../../atoms/components/Button/Button.vue';
43
+ import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
43
44
  import SellDomainNameListModal from '../SellDomainNameListModal/SellDomainNameListModal.vue';
44
- import {
45
- sellDomainNameMinSearchTextLength,
46
- sellDomainNameSearchBarLabel,
47
- sellDomainNameSearchBarPlaceholder,
48
- } from '../../constants/sell-domain-name-constants';
45
+ import { sellDomainNameMinSearchTextLength } from '../../constants/sell-domain-name-constants';
49
46
  import Events from '../../constants/event-constants';
50
47
  import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
48
+ import useSellDomainContent from '../SellDomainNameSearch/useSellDomainContent';
51
49
 
52
50
  export default {
53
51
  components: {
@@ -76,13 +74,21 @@ export default {
76
74
  default: false,
77
75
  },
78
76
  },
77
+ setup() {
78
+ const contentProvider = useSellDomainContent();
79
+ const content = contentProvider.getContent();
80
+ return {
81
+ searchButtonLabel: computed(() => content.value.searchButtonLabel),
82
+ searchBarLabel: computed(() => content.value.searchBarLabel),
83
+ searchBarPlaceholder: computed(() => content.value.searchBarPlaceholder),
84
+ domainSearchOrConnectHeaderSubtitle: computed(() => content.value.domainSearchOrConnectHeaderSubtitle),
85
+ };
86
+ },
79
87
  data: () => ({
80
88
  domainNameItems: undefined,
81
89
  userCurrency: undefined,
82
90
  isBusy: false,
83
91
  isSearchDomainListModalVisible: false,
84
- searchBarLabel: sellDomainNameSearchBarLabel,
85
- searchBarPlaceholder: sellDomainNameSearchBarPlaceholder,
86
92
  searchText: '',
87
93
  previousSearchText: '',
88
94
  }),
@@ -1,33 +0,0 @@
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;
@@ -1,25 +0,0 @@
1
- let globalContentProvider = null;
2
-
3
- const defaultContent = {
4
- domainSearchEmptyMessage: `Sorry, we couldn't find any domain for "{domainNameSearchTerm}".`,
5
- searchAnotherDomainMessage: `Try searching with another domain name.`,
6
- };
7
-
8
- const useSellDomainNameListSearchResultContent = (overrides = {}) => {
9
- const setGlobalContentHandler = (handler) => {
10
- globalContentProvider = handler;
11
- };
12
-
13
- return {
14
- setGlobalContentHandler,
15
- getContent: () => {
16
- return {
17
- ...defaultContent,
18
- ...(globalContentProvider ? globalContentProvider() : {}), // provide global content through global injection
19
- ...overrides, // can override specific contents on demand
20
- };
21
- },
22
- };
23
- };
24
-
25
- export default useSellDomainNameListSearchResultContent;