favesalon-embed 1.0.1 → 1.0.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.
Files changed (156) hide show
  1. package/dist/custom-elements/index.d.ts +12 -0
  2. package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -6
  3. package/dist/{cjs/global-9073d10e.js → favesalon-embed/app-globals-15861a7f.js} +15 -8
  4. package/dist/{esm/global-e1089ffd.js → favesalon-embed/app-globals-270fe240.js} +16 -7
  5. package/dist/favesalon-embed/app-globals-437cc3f3.js +712 -0
  6. package/dist/favesalon-embed/app-globals-b8b0fc7a.js +712 -0
  7. package/dist/favesalon-embed/chat-button.entry.js +56 -0
  8. package/dist/favesalon-embed/chat-form.entry.js +39 -0
  9. package/dist/favesalon-embed/chat-messages.entry.js +51 -0
  10. package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
  11. package/dist/favesalon-embed/dom-64053c71.js +73 -0
  12. package/dist/favesalon-embed/favesalon-embed.css +2433 -4
  13. package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
  14. package/dist/{collection/components/google-map/index.js → favesalon-embed/google-map.entry.js} +12 -54
  15. package/dist/{esm/index-80523fec.js → favesalon-embed/index-00b83e1c.js} +425 -15
  16. package/dist/favesalon-embed/index-888e99e3.js +3371 -0
  17. package/dist/favesalon-embed/index-9ad82b12.js +3371 -0
  18. package/dist/favesalon-embed/index-aa906326.js +3371 -0
  19. package/dist/favesalon-embed/index-b97af793.js +3371 -0
  20. package/dist/favesalon-embed/index.esm.js +1 -0
  21. package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
  22. package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
  23. package/dist/{esm → favesalon-embed}/salon-booking.entry.js +3 -3
  24. package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
  25. package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +3 -3
  26. package/dist/favesalon-embed/salon-info.entry.js +29 -0
  27. package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +4 -4
  28. package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +14 -99
  29. package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
  30. package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +3 -3
  31. package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
  32. package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +3 -3
  33. package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
  34. package/dist/{esm → favesalon-embed}/salon-services.entry.js +3 -3
  35. package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
  36. package/dist/{esm/services-40a3e622.js → favesalon-embed/services-7cb8f2a6.js} +2469 -100
  37. package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
  38. package/dist/{esm → favesalon-embed}/style-detail.entry.js +4 -4
  39. package/dist/{esm → favesalon-embed}/user-avatar.entry.js +2 -1
  40. package/dist/{esm/utils-e97485e0.js → favesalon-embed/utils-7de9628a.js} +3 -0
  41. package/dist/types/components/chat-button/index.d.ts +0 -8
  42. package/dist/types/components/chat-form/index.d.ts +6 -0
  43. package/dist/types/components/chat-messages/index.d.ts +14 -0
  44. package/dist/types/components.d.ts +40 -0
  45. package/package.json +1 -1
  46. package/dist/cjs/chat-button.cjs.entry.js +0 -118
  47. package/dist/cjs/colors-38421769.js +0 -69
  48. package/dist/cjs/favesalon-embed.cjs.js +0 -24
  49. package/dist/cjs/google-map_5.cjs.entry.js +0 -310
  50. package/dist/cjs/index-47c2a5f6.js +0 -1533
  51. package/dist/cjs/index-7f190886.js +0 -4396
  52. package/dist/cjs/index.cjs.js +0 -2
  53. package/dist/cjs/loader.cjs.js +0 -23
  54. package/dist/cjs/relativeTime-3721080d.js +0 -9
  55. package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
  56. package/dist/cjs/salon-booking.cjs.entry.js +0 -51
  57. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
  58. package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
  59. package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
  60. package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
  61. package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
  62. package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
  63. package/dist/cjs/salon-services.cjs.entry.js +0 -81
  64. package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
  65. package/dist/cjs/services-125c82d8.js +0 -21492
  66. package/dist/cjs/style-detail.cjs.entry.js +0 -312
  67. package/dist/cjs/user-avatar.cjs.entry.js +0 -45
  68. package/dist/cjs/utils-c5a33b3c.js +0 -23
  69. package/dist/collection/collection-manifest.json +0 -29
  70. package/dist/collection/components/chat-button/index.css +0 -122
  71. package/dist/collection/components/chat-button/index.js +0 -218
  72. package/dist/collection/components/chat-conversation/index.js +0 -103
  73. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  74. package/dist/collection/components/google-map/index.css +0 -5
  75. package/dist/collection/components/salon-booking/index.css +0 -30
  76. package/dist/collection/components/salon-booking/index.js +0 -126
  77. package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
  78. package/dist/collection/components/salon-gift-card/index.css +0 -30
  79. package/dist/collection/components/salon-gift-card/index.js +0 -126
  80. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
  81. package/dist/collection/components/salon-info/index.css +0 -1
  82. package/dist/collection/components/salon-info/index.js +0 -77
  83. package/dist/collection/components/salon-latest-reviews/index.css +0 -11
  84. package/dist/collection/components/salon-latest-reviews/index.js +0 -163
  85. package/dist/collection/components/salon-latest-styles/index.css +0 -12
  86. package/dist/collection/components/salon-locations/index.css +0 -24
  87. package/dist/collection/components/salon-lookbook/index.css +0 -15
  88. package/dist/collection/components/salon-lookbook/index.js +0 -368
  89. package/dist/collection/components/salon-ranking/index.css +0 -3
  90. package/dist/collection/components/salon-ranking/index.js +0 -117
  91. package/dist/collection/components/salon-reviews/index.css +0 -18
  92. package/dist/collection/components/salon-reviews/index.js +0 -249
  93. package/dist/collection/components/salon-schedules/index.css +0 -18
  94. package/dist/collection/components/salon-services/index.css +0 -1
  95. package/dist/collection/components/salon-services/index.js +0 -146
  96. package/dist/collection/components/salon-stylists/index.css +0 -43
  97. package/dist/collection/components/salon-stylists/index.js +0 -184
  98. package/dist/collection/components/style-detail/index.css +0 -76
  99. package/dist/collection/components/style-detail/index.js +0 -386
  100. package/dist/collection/components/user-avatar/index.css +0 -0
  101. package/dist/collection/components/user-avatar/index.js +0 -134
  102. package/dist/collection/constants/colors.js +0 -65
  103. package/dist/collection/global/global.js +0 -8
  104. package/dist/collection/index.js +0 -1
  105. package/dist/collection/mocks/users.js +0 -10
  106. package/dist/collection/services/services.js +0 -295
  107. package/dist/collection/types/chat.js +0 -23
  108. package/dist/collection/types/common.js +0 -11
  109. package/dist/collection/types/review.js +0 -39
  110. package/dist/collection/types/salon.js +0 -58
  111. package/dist/collection/types/service.js +0 -24
  112. package/dist/collection/types/style.js +0 -128
  113. package/dist/collection/types/stylist.js +0 -30
  114. package/dist/collection/types/user.js +0 -10
  115. package/dist/collection/utils/utils.js +0 -20
  116. package/dist/custom-elements/index.js +0 -28340
  117. package/dist/esm/_commonjsHelpers-098d5b27.js +0 -32
  118. package/dist/esm/chat-button.entry.js +0 -114
  119. package/dist/esm/favesalon-embed.js +0 -19
  120. package/dist/esm/google-map_5.entry.js +0 -302
  121. package/dist/esm/index-3fae868e.js +0 -1506
  122. package/dist/esm/index.js +0 -1
  123. package/dist/esm/loader.js +0 -19
  124. package/dist/esm/polyfills/core-js.js +0 -11
  125. package/dist/esm/polyfills/css-shim.js +0 -1
  126. package/dist/esm/polyfills/dom.js +0 -79
  127. package/dist/esm/polyfills/es5-html-element.js +0 -1
  128. package/dist/esm/polyfills/index.js +0 -34
  129. package/dist/esm/polyfills/system.js +0 -6
  130. package/dist/esm/relativeTime-cd452e6d.js +0 -7
  131. package/dist/favesalon-embed/p-019c5ccd.entry.js +0 -1
  132. package/dist/favesalon-embed/p-083a8821.entry.js +0 -1
  133. package/dist/favesalon-embed/p-0d0ed9ea.entry.js +0 -1
  134. package/dist/favesalon-embed/p-119db8de.entry.js +0 -1
  135. package/dist/favesalon-embed/p-1432c51b.entry.js +0 -1
  136. package/dist/favesalon-embed/p-22093506.entry.js +0 -1
  137. package/dist/favesalon-embed/p-32b314e9.js +0 -2
  138. package/dist/favesalon-embed/p-47e646f8.js +0 -1
  139. package/dist/favesalon-embed/p-4a5eca9a.js +0 -6
  140. package/dist/favesalon-embed/p-58d2e9be.js +0 -1
  141. package/dist/favesalon-embed/p-71404b6a.entry.js +0 -1
  142. package/dist/favesalon-embed/p-857c3a61.entry.js +0 -1
  143. package/dist/favesalon-embed/p-99ec77f7.entry.js +0 -1
  144. package/dist/favesalon-embed/p-a33331cc.js +0 -1
  145. package/dist/favesalon-embed/p-b0c3673a.entry.js +0 -1
  146. package/dist/favesalon-embed/p-b287b1ea.entry.js +0 -1
  147. package/dist/favesalon-embed/p-b3af7842.entry.js +0 -1
  148. package/dist/favesalon-embed/p-b630ae68.js +0 -1580
  149. package/dist/favesalon-embed/p-ce2c1c9a.entry.js +0 -1
  150. package/dist/favesalon-embed/p-d6083940.js +0 -1
  151. package/dist/favesalon-embed/p-d9b7ad58.entry.js +0 -1
  152. package/dist/favesalon-embed/p-fc9a5551.js +0 -6
  153. package/dist/index.cjs.js +0 -1
  154. package/dist/index.js +0 -1
  155. package/dist/types/components/chat-conversation/index.d.ts +0 -0
  156. /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
@@ -1,24 +0,0 @@
1
- export function createService(blob) {
2
- const photos = (blob.photo_link || []).map(photo => {
3
- return {
4
- id: photo.number,
5
- src: photo.src,
6
- caption: photo.caption,
7
- serviceId: photo.service_id,
8
- serviceName: photo.service_name,
9
- stylistId: photo.beautician_id,
10
- stylistName: photo.beautician_name,
11
- };
12
- });
13
- return {
14
- id: blob.id,
15
- name: blob.name,
16
- description: blob.description,
17
- price: Number(blob.price_info),
18
- isPriceUp: Boolean(blob.price_up),
19
- hidePrice: Boolean(blob.hide_price_from_public),
20
- duration: blob.time_info ? Number(blob.time_info) : 0,
21
- hideDuration: Boolean(blob.hide_duration_from_public),
22
- photos,
23
- };
24
- }
@@ -1,128 +0,0 @@
1
- import dayjs from 'dayjs';
2
- import { dateTimeFormat } from './common';
3
- import { createSalon } from './salon';
4
- import { createService } from './service';
5
- import { createStylistFromLookbook } from './stylist';
6
- import { createUser } from './user';
7
- export var MediaType;
8
- (function (MediaType) {
9
- MediaType[MediaType["Photo"] = 0] = "Photo";
10
- MediaType[MediaType["Video"] = 1] = "Video";
11
- })(MediaType || (MediaType = {}));
12
- export class AlbumMedia {
13
- constructor(fields) {
14
- Object.assign(this, fields);
15
- }
16
- }
17
- export function createAlbumMedia(blob) {
18
- const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
19
- const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
20
- const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
21
- const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
22
- const isVideo = blob.media_type === MediaType.Video || blob.full_image_url.indexOf('.mp4') > -1;
23
- return new AlbumMedia({
24
- id: blob.id,
25
- caption: blob.caption,
26
- description: blob.description,
27
- createdDate: createdDateTime,
28
- updatedDate: updatedDateTime,
29
- mediaUrl: blob.full_image_url,
30
- imageThumb: !isVideo ? blob.full_image_url_thumb : null,
31
- imageThumbMedium: !isVideo ? blob.full_image_url_medium : null,
32
- imageWidth: !isVideo ? blob.img_w : 400,
33
- imageHeight: !isVideo ? blob.img_h : 300,
34
- mediaType: isVideo ? MediaType.Video : blob.media_type,
35
- totalLike: blob.total_like,
36
- totalDislike: blob.total_dislike,
37
- totalShare: blob.total_shared,
38
- totalView: blob.view_count,
39
- totalBooking: blob.total_booking,
40
- });
41
- }
42
- export class Album {
43
- constructor(fields) {
44
- Object.assign(this, fields);
45
- }
46
- }
47
- export function createAlbum(blob) {
48
- return new Album({
49
- id: blob.id,
50
- name: blob.name,
51
- caption: blob.caption,
52
- description: blob.description,
53
- tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
54
- salonId: blob.salon_id,
55
- stylistId: blob.stylist_id,
56
- totalMedias: blob.total_medias || 0,
57
- service: blob.service ? createService(blob.service) : null,
58
- isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
59
- });
60
- }
61
- export class FaveStyleComment {
62
- constructor(fields) {
63
- Object.assign(this, fields);
64
- }
65
- }
66
- export function createFaveStyleComment(blob) {
67
- const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
68
- const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
69
- const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
70
- const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
71
- return new FaveStyleComment({
72
- id: blob.id,
73
- type: blob.type,
74
- title: blob.content,
75
- description: blob.description,
76
- createdDate: createdDateTime,
77
- updatedDate: updatedDateTime,
78
- parentCommentId: blob.parentCommentId,
79
- childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComment) : [],
80
- user: createUser(blob.user),
81
- });
82
- }
83
- export class FaveStyle {
84
- constructor(fields) {
85
- Object.assign(this, fields);
86
- }
87
- }
88
- export function createFaveStyle(blob) {
89
- const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
90
- const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
91
- const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
92
- const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
93
- const albumMedias = [createAlbumMedia(blob)].concat(blob.album_medias ? blob.album_medias.map(createAlbumMedia).filter(ap => ap.id !== blob.id) : []);
94
- const { total_booked: totalBooked, total_like: totalLike, total_share: totalShare, total_view: totalView, } = blob.style_activity || {};
95
- return new FaveStyle({
96
- id: blob.id,
97
- caption: blob.caption,
98
- description: blob.description,
99
- createdDate: createdDateTime,
100
- updatedDate: updatedDateTime,
101
- imageUrl: blob.full_image_url,
102
- imageThumb: blob.full_image_url_thumb,
103
- imageThumbMedium: blob.full_image_url_medium,
104
- imageWidth: blob.img_w,
105
- imageHeight: blob.img_h,
106
- mediaType: blob.media_type,
107
- isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
108
- totalBooking: totalBooked || 0,
109
- totalLike: totalLike || 0,
110
- totalDislike: blob.total_dislike || 0,
111
- totalShare: totalShare || 0,
112
- totalView: totalView || 0,
113
- albumMedias,
114
- album: blob.album ? createAlbum(blob.album) : null,
115
- owner: blob.user ? createUser(blob.user) : null,
116
- salonId: blob.salon_id ? Number(blob.salon_id) : null,
117
- salon: blob.salon ? createSalon(blob.salon) : null,
118
- stylistId: blob.stylist_id ? Number(blob.stylist_id) : null,
119
- stylist: blob.stylist ? createStylistFromLookbook(blob.stylist) : null,
120
- isLiked: blob.my_activity && blob.my_activity.liked,
121
- serviceId: blob.service_id ? Number(blob.service_id) : null,
122
- salonServiceId: blob.category_service_id ? Number(blob.category_service_id) : null,
123
- productBrand: blob.product_brand_used || '',
124
- });
125
- }
126
- export function isVideoMedia({ mediaType }) {
127
- return mediaType === MediaType.Video;
128
- }
@@ -1,30 +0,0 @@
1
- export function createStylist(blob) {
2
- const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
3
- const { first_name, last_name, mobile_phone, avatar, full_profile_image, } = blob.user || {};
4
- const userNames = [first_name, last_name].filter(name => !!name);
5
- return {
6
- id: Number(blob.id),
7
- firstName: first_name,
8
- lastName: last_name,
9
- fullName: userNames.length > 0 ? userNames.join(' ') : blob.email,
10
- avatar: avatar || full_profile_image,
11
- phone: mobile_phone,
12
- expertise: Boolean(blob.expertise),
13
- rating: Math.ceil((ratingPercentage * 5) / 100),
14
- };
15
- }
16
- export function createStylistFromLookbook(blob) {
17
- const { user } = blob;
18
- const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
19
- const userNames = [user.first_name, user.last_name].filter(name => !!name);
20
- return {
21
- id: Number(blob.id),
22
- firstName: user.first_name,
23
- lastName: user.last_name,
24
- fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
25
- avatar: user.full_avatar || user.full_profile_image_thumb,
26
- phone: user.mobile_phone,
27
- expertise: Boolean(blob.expertise),
28
- rating: Math.ceil((ratingPercentage * 5) / 100),
29
- };
30
- }
@@ -1,10 +0,0 @@
1
- export function createUser(blob) {
2
- const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
3
- return {
4
- id: blob.id || blob.user_id,
5
- firstName: blob.first_name,
6
- lastName: blob.last_name,
7
- fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
8
- avatar: blob.avatar || blob.full_profile_image_thumb,
9
- };
10
- }
@@ -1,20 +0,0 @@
1
- export function format(first, middle, last) {
2
- return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
- }
4
- export function formatWebsiteUrl(website) {
5
- return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
6
- }
7
- export function formatFullAddress(salon) {
8
- const { businessAddress, city, state, zipcode, } = salon || {};
9
- const stateFields = [state, zipcode].filter(field => !!field);
10
- if (businessAddress) {
11
- return [businessAddress, city]
12
- .filter(field => !!field)
13
- .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
14
- .join(', ');
15
- }
16
- return null;
17
- }
18
- export function getRatingText() {
19
- return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
20
- }