favesalon-embed 1.0.2 → 1.0.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.
Files changed (37) hide show
  1. package/dist/custom-elements/index.d.ts +12 -0
  2. package/dist/favesalon-embed/_commonjsHelpers-9bc404fc.js +44 -0
  3. package/dist/favesalon-embed/{app-globals-15861a7f.js → app-globals-60769a2c.js} +1 -1
  4. package/dist/favesalon-embed/chat-box.entry.js +54 -0
  5. package/dist/favesalon-embed/chat-button.entry.js +3 -8
  6. package/dist/favesalon-embed/chat-form.entry.js +2 -2
  7. package/dist/favesalon-embed/chat-messages.entry.js +6 -4
  8. package/dist/favesalon-embed/chat-rooms.entry.js +17279 -0
  9. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -1
  10. package/dist/favesalon-embed/{index-aa906326.js → index-04c09911.js} +1 -1
  11. package/dist/favesalon-embed/index-ac52896a.js +4803 -0
  12. package/dist/favesalon-embed/isObject-13b86c17.js +203 -0
  13. package/dist/favesalon-embed/relativeTime-15477f02.js +7 -0
  14. package/dist/favesalon-embed/salon-info.entry.js +1 -1
  15. package/dist/favesalon-embed/salon-latest-reviews.entry.js +2 -2
  16. package/dist/favesalon-embed/salon-latest-styles.entry.js +1 -1
  17. package/dist/favesalon-embed/salon-locations.entry.js +2 -2
  18. package/dist/favesalon-embed/salon-lookbook.entry.js +1 -1
  19. package/dist/favesalon-embed/salon-reviews.entry.js +1 -1
  20. package/dist/favesalon-embed/salon-schedules.entry.js +1 -1
  21. package/dist/favesalon-embed/salon-services.entry.js +1 -1
  22. package/dist/favesalon-embed/salon-stylists.entry.js +1 -1
  23. package/dist/favesalon-embed/services-55a87166.js +23655 -0
  24. package/dist/favesalon-embed/services-7c46a2fd.js +23854 -0
  25. package/dist/favesalon-embed/style-detail.entry.js +1 -1
  26. package/dist/favesalon-embed/user-avatar.entry.js +11 -3
  27. package/dist/favesalon-embed/{utils-7de9628a.js → utils-2c19db45.js} +3 -0
  28. package/dist/types/components/chat-box/index.d.ts +12 -0
  29. package/dist/types/components/chat-rooms/index.d.ts +12 -0
  30. package/dist/types/components/user-avatar/index.d.ts +2 -1
  31. package/dist/types/components.d.ts +45 -2
  32. package/dist/types/utils/utils.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/dist/favesalon-embed/app-globals-270fe240.js +0 -712
  35. package/dist/favesalon-embed/app-globals-b8b0fc7a.js +0 -712
  36. package/dist/favesalon-embed/index-9ad82b12.js +0 -3371
  37. package/dist/favesalon-embed/index-b97af793.js +0 -3371
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-888e99e3.js';
2
- import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-7cb8f2a6.js';
2
+ import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-7c46a2fd.js';
3
3
  import { r as relativeTime } from './relativeTime-268e64b0.js';
4
4
  import { C as Colors } from './colors-ea36347a.js';
5
5
  import './_commonjsHelpers-a4f66ccd.js';
@@ -8,12 +8,14 @@ const UserAvatar = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.size = 24;
10
10
  this.name = undefined;
11
+ this.description = undefined;
11
12
  this.nameStyle = undefined;
12
13
  this.shortName = undefined;
13
14
  this.avatar = undefined;
14
15
  }
15
16
  render() {
16
17
  return (h("div", { style: { display: "flex", alignItems: "center" } }, this.avatar && (h("div", { style: {
18
+ border: `1px solid ${Colors.White}`,
17
19
  backgroundImage: `url("${this.avatar}")`,
18
20
  backgroundColor: Colors.Gray01,
19
21
  backgroundPosition: 'center center',
@@ -23,9 +25,8 @@ const UserAvatar = class {
23
25
  width: `${this.size}px`,
24
26
  minWidth: `${this.size}px`,
25
27
  } })), !this.avatar && (h("div", { style: {
28
+ border: `1px solid ${Colors.White}`,
26
29
  backgroundColor: Colors.Gray01,
27
- backgroundPosition: 'center center',
28
- backgroundSize: 'cover',
29
30
  borderRadius: '50%',
30
31
  display: 'flex',
31
32
  alignItems: 'center',
@@ -33,7 +34,14 @@ const UserAvatar = class {
33
34
  height: `${this.size}px`,
34
35
  width: `${this.size}px`,
35
36
  minWidth: `${this.size}px`,
36
- } }, this.shortName)), this.name && (h("div", { style: Object.assign({ flexShrink: '1', flexGrow: '1', marginLeft: '12px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, this.nameStyle) }, this.name))));
37
+ } }, this.shortName)), this.name && (h("div", { style: {
38
+ flexShrink: '1',
39
+ flexGrow: '1',
40
+ marginLeft: '12px',
41
+ overflow: 'hidden',
42
+ whiteSpace: 'nowrap',
43
+ textOverflow: 'ellipsis',
44
+ } }, h("div", { style: Object.assign({}, this.nameStyle) }, this.name), this.description && h("div", { style: { color: '#999999' } }, this.description)))));
37
45
  }
38
46
  };
39
47
  ;
@@ -1,3 +1,6 @@
1
+ function wait(time = 1000) {
2
+ return new Promise(resolve => setTimeout(() => resolve({}), time));
3
+ }
1
4
  function format(first, middle, last) {
2
5
  return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
6
  }
@@ -0,0 +1,12 @@
1
+ import { ChatRoom } from '../../types/chat';
2
+ export declare class ChatBox {
3
+ primaryColor: string;
4
+ accessToken: string;
5
+ senderId: string;
6
+ chatRooms: ChatRoom[];
7
+ activeRoom: ChatRoom;
8
+ componentWillLoad(): void;
9
+ fetchData(): Promise<void>;
10
+ private onClickRoom;
11
+ render(): any;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { ChatRoom } from '../../types/chat';
2
+ export declare class ChatRooms {
3
+ senderId: number;
4
+ chatRooms: ChatRoom[];
5
+ activeRoom: ChatRoom;
6
+ onClickRoom: (chatRoom: ChatRoom) => void;
7
+ keyword: string;
8
+ private clickRoom;
9
+ private onSearchRooms;
10
+ private renderChatRoom;
11
+ render(): any;
12
+ }
@@ -1,6 +1,7 @@
1
1
  export declare class UserAvatar {
2
2
  size: number;
3
- name: string;
3
+ name?: string;
4
+ description?: string;
4
5
  nameStyle?: object;
5
6
  shortName: string;
6
7
  avatar: string;
@@ -6,8 +6,14 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { User } from "./types/user";
9
- import { ChatMessage } from "./types/chat";
9
+ import { ChatMessage, ChatRoom } from "./types/chat";
10
10
  export namespace Components {
11
+ interface ChatBox {
12
+ "accessToken": string;
13
+ "fetchData": () => Promise<void>;
14
+ "primaryColor": string;
15
+ "senderId": string;
16
+ }
11
17
  interface ChatButton {
12
18
  "accessToken": string;
13
19
  "fetchData": () => Promise<void>;
@@ -25,6 +31,12 @@ export namespace Components {
25
31
  "receiver": User;
26
32
  "sender": User;
27
33
  }
34
+ interface ChatRooms {
35
+ "activeRoom": ChatRoom;
36
+ "chatRooms": ChatRoom[];
37
+ "onClickRoom": (chatRoom: ChatRoom) => void;
38
+ "senderId": number;
39
+ }
28
40
  interface GoogleMap {
29
41
  "locationAddress"?: string;
30
42
  "locationName"?: string;
@@ -112,13 +124,20 @@ export namespace Components {
112
124
  }
113
125
  interface UserAvatar {
114
126
  "avatar": string;
115
- "name": string;
127
+ "description"?: string;
128
+ "name"?: string;
116
129
  "nameStyle"?: object;
117
130
  "shortName": string;
118
131
  "size": number;
119
132
  }
120
133
  }
121
134
  declare global {
135
+ interface HTMLChatBoxElement extends Components.ChatBox, HTMLStencilElement {
136
+ }
137
+ var HTMLChatBoxElement: {
138
+ prototype: HTMLChatBoxElement;
139
+ new (): HTMLChatBoxElement;
140
+ };
122
141
  interface HTMLChatButtonElement extends Components.ChatButton, HTMLStencilElement {
123
142
  }
124
143
  var HTMLChatButtonElement: {
@@ -137,6 +156,12 @@ declare global {
137
156
  prototype: HTMLChatMessagesElement;
138
157
  new (): HTMLChatMessagesElement;
139
158
  };
159
+ interface HTMLChatRoomsElement extends Components.ChatRooms, HTMLStencilElement {
160
+ }
161
+ var HTMLChatRoomsElement: {
162
+ prototype: HTMLChatRoomsElement;
163
+ new (): HTMLChatRoomsElement;
164
+ };
140
165
  interface HTMLGoogleMapElement extends Components.GoogleMap, HTMLStencilElement {
141
166
  }
142
167
  var HTMLGoogleMapElement: {
@@ -240,9 +265,11 @@ declare global {
240
265
  new (): HTMLUserAvatarElement;
241
266
  };
242
267
  interface HTMLElementTagNameMap {
268
+ "chat-box": HTMLChatBoxElement;
243
269
  "chat-button": HTMLChatButtonElement;
244
270
  "chat-form": HTMLChatFormElement;
245
271
  "chat-messages": HTMLChatMessagesElement;
272
+ "chat-rooms": HTMLChatRoomsElement;
246
273
  "google-map": HTMLGoogleMapElement;
247
274
  "salon-booking": HTMLSalonBookingElement;
248
275
  "salon-booking-modal": HTMLSalonBookingModalElement;
@@ -263,6 +290,11 @@ declare global {
263
290
  }
264
291
  }
265
292
  declare namespace LocalJSX {
293
+ interface ChatBox {
294
+ "accessToken"?: string;
295
+ "primaryColor"?: string;
296
+ "senderId"?: string;
297
+ }
266
298
  interface ChatButton {
267
299
  "accessToken"?: string;
268
300
  "primaryColor"?: string;
@@ -279,6 +311,12 @@ declare namespace LocalJSX {
279
311
  "receiver"?: User;
280
312
  "sender"?: User;
281
313
  }
314
+ interface ChatRooms {
315
+ "activeRoom"?: ChatRoom;
316
+ "chatRooms"?: ChatRoom[];
317
+ "onClickRoom"?: (chatRoom: ChatRoom) => void;
318
+ "senderId"?: number;
319
+ }
282
320
  interface GoogleMap {
283
321
  "locationAddress"?: string;
284
322
  "locationName"?: string;
@@ -353,15 +391,18 @@ declare namespace LocalJSX {
353
391
  }
354
392
  interface UserAvatar {
355
393
  "avatar"?: string;
394
+ "description"?: string;
356
395
  "name"?: string;
357
396
  "nameStyle"?: object;
358
397
  "shortName"?: string;
359
398
  "size"?: number;
360
399
  }
361
400
  interface IntrinsicElements {
401
+ "chat-box": ChatBox;
362
402
  "chat-button": ChatButton;
363
403
  "chat-form": ChatForm;
364
404
  "chat-messages": ChatMessages;
405
+ "chat-rooms": ChatRooms;
365
406
  "google-map": GoogleMap;
366
407
  "salon-booking": SalonBooking;
367
408
  "salon-booking-modal": SalonBookingModal;
@@ -385,9 +426,11 @@ export { LocalJSX as JSX };
385
426
  declare module "@stencil/core" {
386
427
  export namespace JSX {
387
428
  interface IntrinsicElements {
429
+ "chat-box": LocalJSX.ChatBox & JSXBase.HTMLAttributes<HTMLChatBoxElement>;
388
430
  "chat-button": LocalJSX.ChatButton & JSXBase.HTMLAttributes<HTMLChatButtonElement>;
389
431
  "chat-form": LocalJSX.ChatForm & JSXBase.HTMLAttributes<HTMLChatFormElement>;
390
432
  "chat-messages": LocalJSX.ChatMessages & JSXBase.HTMLAttributes<HTMLChatMessagesElement>;
433
+ "chat-rooms": LocalJSX.ChatRooms & JSXBase.HTMLAttributes<HTMLChatRoomsElement>;
391
434
  "google-map": LocalJSX.GoogleMap & JSXBase.HTMLAttributes<HTMLGoogleMapElement>;
392
435
  "salon-booking": LocalJSX.SalonBooking & JSXBase.HTMLAttributes<HTMLSalonBookingElement>;
393
436
  "salon-booking-modal": LocalJSX.SalonBookingModal & JSXBase.HTMLAttributes<HTMLSalonBookingModalElement>;
@@ -1,4 +1,5 @@
1
1
  import { Salon } from "../types/salon";
2
+ export declare function wait(time?: number): Promise<unknown>;
2
3
  export declare function format(first: string, middle: string, last: string): string;
3
4
  export declare function formatWebsiteUrl(website: string): string;
4
5
  export declare function formatFullAddress(salon: Salon): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favesalon-embed",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Favesalon Embed",
5
5
  "author": "Trung Luu <trung@favesalon.com> (https://favesalon.com)",
6
6
  "main": "dist/index.cjs.js",