pukaad-ui-lib 1.466.0 → 1.467.1

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 (97) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +12 -7
  3. package/dist/runtime/assets/css/core.css +1 -1
  4. package/dist/runtime/components/card/card-blog.d.vue.ts +1 -1
  5. package/dist/runtime/components/card/card-blog.vue.d.ts +1 -1
  6. package/dist/runtime/components/card/card-content/card-content-menu.d.vue.ts +0 -2
  7. package/dist/runtime/components/card/card-content/card-content-menu.vue +14 -14
  8. package/dist/runtime/components/card/card-content/card-content-menu.vue.d.ts +0 -2
  9. package/dist/runtime/components/card/card-profile/card-profile-header.d.vue.ts +1 -1
  10. package/dist/runtime/components/card/card-profile/card-profile-header.vue.d.ts +1 -1
  11. package/dist/runtime/components/card/card-reaction.d.vue.ts +1 -1
  12. package/dist/runtime/components/card/card-reaction.vue.d.ts +1 -1
  13. package/dist/runtime/components/card/card-review.d.vue.ts +4 -4
  14. package/dist/runtime/components/card/card-review.vue.d.ts +4 -4
  15. package/dist/runtime/components/chat/chat-conversation-item.d.vue.ts +3 -3
  16. package/dist/runtime/components/chat/chat-conversation-item.vue.d.ts +3 -3
  17. package/dist/runtime/components/display/display-video.d.vue.ts +5 -5
  18. package/dist/runtime/components/display/display-video.vue +2 -1
  19. package/dist/runtime/components/display/display-video.vue.d.ts +5 -5
  20. package/dist/runtime/components/input/input-address.d.vue.ts +1 -1
  21. package/dist/runtime/components/input/input-address.vue.d.ts +1 -1
  22. package/dist/runtime/components/input/input-autocomplete.d.vue.ts +2 -2
  23. package/dist/runtime/components/input/input-autocomplete.vue.d.ts +2 -2
  24. package/dist/runtime/components/input/input-birth-date.d.vue.ts +2 -2
  25. package/dist/runtime/components/input/input-birth-date.vue.d.ts +2 -2
  26. package/dist/runtime/components/input/input-combobox.d.vue.ts +1 -1
  27. package/dist/runtime/components/input/input-combobox.vue.d.ts +1 -1
  28. package/dist/runtime/components/input/input-comment.d.vue.ts +1 -1
  29. package/dist/runtime/components/input/input-comment.vue.d.ts +1 -1
  30. package/dist/runtime/components/input/input-date-picker.d.vue.ts +2 -2
  31. package/dist/runtime/components/input/input-date-picker.vue.d.ts +2 -2
  32. package/dist/runtime/components/input/input-localized-name.d.vue.ts +2 -2
  33. package/dist/runtime/components/input/input-localized-name.vue.d.ts +2 -2
  34. package/dist/runtime/components/input/input-select.vue +1 -1
  35. package/dist/runtime/components/input/input-suggest.d.vue.ts +2 -2
  36. package/dist/runtime/components/input/input-suggest.vue.d.ts +2 -2
  37. package/dist/runtime/components/input/input-tag-modal.d.vue.ts +2 -2
  38. package/dist/runtime/components/input/input-tag-modal.vue.d.ts +2 -2
  39. package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
  40. package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
  41. package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
  42. package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
  43. package/dist/runtime/components/input/input-typed-field.d.vue.ts +1 -1
  44. package/dist/runtime/components/input/input-typed-field.vue.d.ts +1 -1
  45. package/dist/runtime/components/modal/modal-password-confirmed.d.vue.ts +1 -1
  46. package/dist/runtime/components/modal/modal-password-confirmed.vue.d.ts +1 -1
  47. package/dist/runtime/components/modal/modal-password-verify.d.vue.ts +1 -1
  48. package/dist/runtime/components/modal/modal-password-verify.vue.d.ts +1 -1
  49. package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.vue +2 -0
  50. package/dist/runtime/components/preview/preview-content.d.vue.ts +1 -1
  51. package/dist/runtime/components/preview/preview-content.vue +53 -32
  52. package/dist/runtime/components/preview/preview-content.vue.d.ts +1 -1
  53. package/dist/runtime/components/ui/chart/ChartTooltipContent.d.vue.ts +1 -1
  54. package/dist/runtime/components/ui/chart/ChartTooltipContent.vue.d.ts +1 -1
  55. package/dist/runtime/components/ui/select/SelectItem.vue +1 -1
  56. package/dist/runtime/components/ui/select/SelectTrigger.vue +1 -1
  57. package/dist/runtime/components/video.vue +2 -1
  58. package/dist/runtime/composables/store-chat.d.ts +2 -2
  59. package/dist/runtime/composables/store-notification.d.ts +1 -1
  60. package/dist/runtime/composables/useSso.d.ts +1 -0
  61. package/dist/runtime/composables/useSso.js +27 -2
  62. package/package.json +3 -2
  63. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-Bold.ttf +0 -0
  64. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-ExtraLight.ttf +0 -0
  65. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-Light.ttf +0 -0
  66. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-Medium.ttf +0 -0
  67. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-Regular.ttf +0 -0
  68. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-SemiBold.ttf +0 -0
  69. package/dist/runtime/assets/css/fonts/Anuphan/Anuphan-Thin.ttf +0 -0
  70. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Bold.ttf +0 -0
  71. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-BoldItalic.ttf +0 -0
  72. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-ExtraBold.ttf +0 -0
  73. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-ExtraBoldItalic.ttf +0 -0
  74. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-ExtraLight.ttf +0 -0
  75. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-ExtraLightItalic.ttf +0 -0
  76. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Italic.ttf +0 -0
  77. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Light.ttf +0 -0
  78. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-LightItalic.ttf +0 -0
  79. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Medium.ttf +0 -0
  80. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-MediumItalic.ttf +0 -0
  81. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Regular.ttf +0 -0
  82. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-SemiBold.ttf +0 -0
  83. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-SemiBoldItalic.ttf +0 -0
  84. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-Thin.ttf +0 -0
  85. package/dist/runtime/assets/css/fonts/Sarabun/Sarabun-ThinItalic.ttf +0 -0
  86. package/dist/runtime/components/modal/modal-account-disabled-alert.d.vue.ts +0 -21
  87. package/dist/runtime/components/modal/modal-account-disabled-alert.vue +0 -55
  88. package/dist/runtime/components/modal/modal-account-disabled-alert.vue.d.ts +0 -21
  89. package/dist/runtime/components/modal/modal-account-disabled-confirmed.d.vue.ts +0 -21
  90. package/dist/runtime/components/modal/modal-account-disabled-confirmed.vue +0 -58
  91. package/dist/runtime/components/modal/modal-account-disabled-confirmed.vue.d.ts +0 -21
  92. package/dist/runtime/components/modal/modal-account-disabled-reason.d.vue.ts +0 -21
  93. package/dist/runtime/components/modal/modal-account-disabled-reason.vue +0 -92
  94. package/dist/runtime/components/modal/modal-account-disabled-reason.vue.d.ts +0 -21
  95. package/dist/runtime/components/modal/modal-account-disabled.d.vue.ts +0 -13
  96. package/dist/runtime/components/modal/modal-account-disabled.vue +0 -68
  97. package/dist/runtime/components/modal/modal-account-disabled.vue.d.ts +0 -13
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
26
26
  "onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
27
27
  }>, {
28
28
  name: string;
29
- placeholder: string;
30
29
  state: "user" | "admin";
31
30
  limit: number;
31
+ placeholder: string;
32
32
  profileScope: "personal" | "business";
33
33
  ignore: string[];
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
26
26
  "onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
27
27
  }>, {
28
28
  name: string;
29
- placeholder: string;
30
29
  state: "user" | "admin";
31
30
  limit: number;
31
+ placeholder: string;
32
32
  profileScope: "personal" | "business";
33
33
  ignore: string[];
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  resize: "none" | "both" | "horizontal" | "vertical";
48
48
  fullWidth: boolean;
49
49
  fullHeight: boolean;
50
- rows: number;
51
50
  limit: number;
51
+ rows: number;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
47
47
  resize: "none" | "both" | "horizontal" | "vertical";
48
48
  fullWidth: boolean;
49
49
  fullHeight: boolean;
50
- rows: number;
51
50
  limit: number;
51
+ rows: number;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
22
22
  name: string;
23
23
  required: boolean;
24
24
  options: import("../../../types/components/input/input-select.js").InputSelectItem[];
25
- removable: boolean;
26
25
  limit: number;
26
+ removable: boolean;
27
27
  showCounter: boolean;
28
28
  selectClass: import("vue").HTMLAttributes["class"];
29
29
  resetOnTypeChange: boolean;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
22
22
  name: string;
23
23
  required: boolean;
24
24
  options: import("../../../types/components/input/input-select.js").InputSelectItem[];
25
- removable: boolean;
26
25
  limit: number;
26
+ removable: boolean;
27
27
  showCounter: boolean;
28
28
  selectClass: import("vue").HTMLAttributes["class"];
29
29
  resetOnTypeChange: boolean;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -8,6 +8,7 @@
8
8
  :size="props.size"
9
9
  :icon-size="props.iconSize"
10
10
  :disabled="props.disabled"
11
+ :trigger-class="$attrs.class"
11
12
  />
12
13
 
13
14
  <ModalShare v-model="isOpenModalShare" />
@@ -27,6 +28,7 @@
27
28
  import { computed, ref } from "vue";
28
29
  import { useNuxtApp } from "nuxt/app";
29
30
  import { useApi } from "../../../composables/useApi";
31
+ defineOptions({ inheritAttrs: false });
30
32
  const emit = defineEmits(["profile-edit", "profile-share", "profile-follower-delete", "profile-block", "profile-blocked", "blog-pin", "blog-unpin", "blog-edit", "blog-delete", "report-blog", "report-place", "report-profile", "report-content", "report-spotlight", "report-tag", "report-label", "delete-content", "content-delete", "delete", "report", "report-review", "place-close-duplicate", "review-edit", "review-delete", "review-reply", "reply-edit", "reply-delete", "archive", "profile-name-updated", "report-submit"]);
31
33
  const props = defineProps({
32
34
  state: { type: String, required: false },
@@ -1,5 +1,5 @@
1
1
  import type { CardReferItem } from "#pukaad-ui/runtime/components/card/card-refer.vue";
2
- export type PreviewContentState = "personal" | "office" | "business";
2
+ export type PreviewContentState = "personal" | "business";
3
3
  export interface PreviewContentMedia {
4
4
  id?: string | number;
5
5
  media_type: string;
@@ -15,7 +15,36 @@
15
15
  <!-- Figma: เนื้อหาเริ่มห่างจากแถบ 22px (ช่องว่าง 6 + padding 16) -->
16
16
  <div class="flex justify-center px-[16px] pt-[22px] pb-[16px]">
17
17
  <!-- กว้าง 844 เท่าวิดีโอ — DisplayVideo ยืดตามความกว้างกล่องนี้ ปุ่มเล่นจะได้อยู่กลางวิดีโอ -->
18
- <div class="w-[844px] flex flex-col gap-[16px]">
18
+ <div
19
+ v-if="isLoadingContent"
20
+ class="w-full max-w-[844px] flex flex-col gap-[16px]"
21
+ >
22
+ <Skeleton class="w-full aspect-[844/475] rounded-[4px]" />
23
+ <div class="flex items-center gap-[8px]">
24
+ <Skeleton class="size-[40px] shrink-0 rounded-full" />
25
+ <div class="flex flex-col gap-[8px]">
26
+ <Skeleton class="h-[16px] w-[140px]" />
27
+ <Skeleton class="h-[12px] w-[220px]" />
28
+ </div>
29
+ </div>
30
+ <div class="flex flex-col gap-[8px]">
31
+ <Skeleton
32
+ v-for="i in 3"
33
+ :key="i"
34
+ class="h-[16px]"
35
+ :class="i === 3 ? 'w-2/3' : 'w-full'"
36
+ />
37
+ </div>
38
+ <Skeleton class="h-[40px] w-full" />
39
+ </div>
40
+ <div
41
+ v-else-if="notFound"
42
+ class="flex flex-col items-center gap-[8px] py-[80px] text-gray"
43
+ >
44
+ <Icon name="pukaad:empty-document" size="200" />
45
+ <div class="font-body-large">ไม่พบเนื้อหา</div>
46
+ </div>
47
+ <div v-else class="w-full max-w-[844px] flex flex-col gap-[16px]">
19
48
  <Label v-if="labelItems.length" :items="labelItems" />
20
49
 
21
50
  <!-- Post-it -->
@@ -39,16 +68,20 @@
39
68
  @select="openImage"
40
69
  />
41
70
  <!-- Video -->
42
- <DisplayVideo
71
+ <div
43
72
  v-else-if="contentData.content_type === 'video'"
44
- :src="contentData.media?.[0]?.url"
45
- :poster="contentData.video_poster_url"
46
- play-button
47
- width="844"
48
- height="475"
49
- preload="metadata"
50
- class="bg-black"
51
- />
73
+ class="w-full aspect-[844/475] overflow-hidden"
74
+ >
75
+ <DisplayVideo
76
+ :src="contentData.media?.[0]?.url"
77
+ :poster="contentData.video_poster_url"
78
+ play-button
79
+ full-width
80
+ full-height
81
+ preload="metadata"
82
+ class="bg-black"
83
+ />
84
+ </div>
52
85
 
53
86
  <CardRefer
54
87
  v-if="contentData.mentions?.[0]"
@@ -146,6 +179,7 @@
146
179
  <script setup>
147
180
  import { computed, onMounted, ref, useTemplateRef, watch } from "vue";
148
181
  import { useElementVisibility } from "@vueuse/core";
182
+ import { Skeleton } from "#pukaad-ui/runtime/components/ui/skeleton";
149
183
  import { useApi } from "#pukaad-ui/runtime/composables/useApi";
150
184
  import { useConvert } from "#pukaad-ui/runtime/composables/useConvert";
151
185
  import { mapContentToCard } from "#pukaad-ui/runtime/composables/useContentCard";
@@ -158,8 +192,6 @@ const api = useApi();
158
192
  const { convertNumber } = useConvert();
159
193
  const endpointMap = {
160
194
  personal: "/contents",
161
- // endpoint เดียวกับที่หน้าจัดการป้ายกำกับเนื้อหาของ office ใช้
162
- office: "/office/content-labels/contents",
163
195
  business: "/business/contents"
164
196
  };
165
197
  const endpoint = computed(() => endpointMap[props.state]);
@@ -171,6 +203,8 @@ const commentPage = ref(1);
171
203
  const commentTotalPages = ref(1);
172
204
  const commentPageSize = 20;
173
205
  const isLoadingComments = ref(false);
206
+ const notFound = ref(false);
207
+ const isLoadingContent = ref(true);
174
208
  const hasMoreComments = computed(
175
209
  () => commentPage.value < commentTotalPages.value
176
210
  );
@@ -204,31 +238,18 @@ const authorStats = computed(() => {
204
238
  }
205
239
  return stats;
206
240
  });
207
- const fromOfficeContent = (data) => {
208
- if (!data?.content) return {};
209
- const { profile_name, profile_avatar, ...rest } = data.content;
210
- return {
211
- ...rest,
212
- media: data.media,
213
- author: {
214
- id: "",
215
- name: profile_name ?? "",
216
- avatar: profile_avatar ?? null
217
- }
218
- };
219
- };
220
241
  const fetchContentData = async () => {
221
242
  const url = `${endpoint.value}/${props.contentId}`;
243
+ notFound.value = false;
244
+ isLoadingContent.value = true;
222
245
  try {
223
- if (props.state === "office") {
224
- const res = await api(url);
225
- contentData.value = fromOfficeContent(res.data);
226
- } else {
227
- const res = await api(url);
228
- contentData.value = res.data ?? {};
229
- }
246
+ const res = await api(url);
247
+ contentData.value = res.data ?? {};
230
248
  } catch (err) {
231
249
  console.error(err);
250
+ notFound.value = true;
251
+ } finally {
252
+ isLoadingContent.value = false;
232
253
  }
233
254
  };
234
255
  const fetchRecommendations = async () => {
@@ -1,5 +1,5 @@
1
1
  import type { CardReferItem } from "#pukaad-ui/runtime/components/card/card-refer.vue";
2
- export type PreviewContentState = "personal" | "office" | "business";
2
+ export type PreviewContentState = "personal" | "business";
3
3
  export interface PreviewContentMedia {
4
4
  id?: string | number;
5
5
  media_type: string;
@@ -18,8 +18,8 @@ type __VLS_Slots = {} & {
18
18
  default?: (props: typeof __VLS_1) => any;
19
19
  };
20
20
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
- config: ChartConfig;
22
21
  payload: Record<string, any>;
22
+ config: ChartConfig;
23
23
  indicator: "line" | "dot" | "dashed";
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -18,8 +18,8 @@ type __VLS_Slots = {} & {
18
18
  default?: (props: typeof __VLS_1) => any;
19
19
  };
20
20
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
- config: ChartConfig;
22
21
  payload: Record<string, any>;
22
+ config: ChartConfig;
23
23
  indicator: "line" | "dot" | "dashed";
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -25,7 +25,7 @@ const forwardedProps = useForwardProps(delegatedProps);
25
25
  v-bind="forwardedProps"
26
26
  :class="
27
27
  cn(
28
- 'font-body-medium',
28
+ 'font-body-large',
29
29
  'focus:bg-accent focus:text-accent-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',
30
30
  props.class
31
31
  )
@@ -21,7 +21,7 @@ const forwardedProps = useForwardProps(delegatedProps);
21
21
  v-bind="forwardedProps"
22
22
  :class="
23
23
  cn(
24
- 'font-body-medium',
24
+ 'font-body-large',
25
25
  'border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
26
26
  props.class
27
27
  )
@@ -29,7 +29,8 @@ function onMouseEnter() {
29
29
  if (!props.hoverPlay) return;
30
30
  const el = videoRef.value;
31
31
  if (!el) return;
32
- el.play();
32
+ el.play().catch(() => {
33
+ });
33
34
  }
34
35
  function onMouseLeave() {
35
36
  if (!props.hoverPlay) return;
@@ -148,7 +148,7 @@ export declare const useChatStore: import("pinia").StoreDefinition<"pukaad-chat"
148
148
  startRealtime: () => void;
149
149
  stopRealtime: () => void;
150
150
  resync: (activeConversationId?: string) => Promise<void>;
151
- }, "headers" | "conversations" | "unreadFirst" | "hasMoreConversations" | "hasLoadedConversations" | "isLoadingConversations" | "peerLastRead" | "messages" | "hasOlder" | "isLoadingOlder" | "isConnected" | "unreadChatCount">, Pick<{
151
+ }, "headers" | "isConnected" | "conversations" | "unreadFirst" | "hasMoreConversations" | "hasLoadedConversations" | "isLoadingConversations" | "peerLastRead" | "messages" | "hasOlder" | "isLoadingOlder" | "unreadChatCount">, Pick<{
152
152
  conversations: import("vue").Ref<{
153
153
  id: string;
154
154
  profile: {
@@ -446,4 +446,4 @@ export declare const useChatStore: import("pinia").StoreDefinition<"pukaad-chat"
446
446
  startRealtime: () => void;
447
447
  stopRealtime: () => void;
448
448
  resync: (activeConversationId?: string) => Promise<void>;
449
- }, "reset" | "setUnreadFirst" | "setMyProfileId" | "fetchConversations" | "fetchConversation" | "fetchLatestMessages" | "fetchOlderMessages" | "sendMessage" | "sendMedia" | "sendShare" | "retryMessage" | "markRead" | "isReadByPeer" | "unreadCountOf" | "startUnreadBadge" | "stopUnreadBadge" | "previewOf" | "sendTyping" | "isPeerTyping" | "deleteMessage" | "startRealtime" | "stopRealtime" | "resync">>;
449
+ }, "reset" | "markRead" | "setUnreadFirst" | "setMyProfileId" | "fetchConversations" | "fetchConversation" | "fetchLatestMessages" | "fetchOlderMessages" | "sendMessage" | "sendMedia" | "sendShare" | "retryMessage" | "isReadByPeer" | "unreadCountOf" | "startUnreadBadge" | "stopUnreadBadge" | "previewOf" | "sendTyping" | "isPeerTyping" | "deleteMessage" | "startRealtime" | "stopRealtime" | "resync">>;
@@ -215,4 +215,4 @@ export declare const useNotificationStore: import("pinia").StoreDefinition<"noti
215
215
  openDrawer: () => void;
216
216
  closeDrawer: () => void;
217
217
  toggleDrawer: () => void;
218
- }, "markRead" | "fetchList" | "loadMore" | "prefetch" | "markAllRead" | "fetchUnreadCount" | "initRealtime" | "closeRealtime" | "setUnreadCount" | "openDrawer" | "closeDrawer" | "toggleDrawer">>;
218
+ }, "fetchList" | "loadMore" | "prefetch" | "markRead" | "markAllRead" | "fetchUnreadCount" | "initRealtime" | "closeRealtime" | "setUnreadCount" | "openDrawer" | "closeDrawer" | "toggleDrawer">>;
@@ -12,4 +12,5 @@ export declare function useSso(): {
12
12
  clearSession: () => Promise<boolean>;
13
13
  revokeToken: (secId: string) => Promise<void>;
14
14
  syncSession: (localSecId: string | null | undefined, isValid: (secId: string) => Promise<boolean>) => Promise<SsoSyncResult>;
15
+ watchSession: (onChange: () => void) => (() => void);
15
16
  };
@@ -1,5 +1,5 @@
1
1
  import { useRuntimeConfig } from "#imports";
2
- import { useEventListener, useTimeoutFn } from "@vueuse/core";
2
+ import { tryOnScopeDispose, useEventListener, useTimeoutFn } from "@vueuse/core";
3
3
  const SSO_TIMEOUT_MS = 3e3;
4
4
  const toOrigin = (url) => {
5
5
  try {
@@ -81,5 +81,30 @@ export function useSso() {
81
81
  }
82
82
  return { secId: null, changed: true };
83
83
  };
84
- return { readSession, saveSession, clearSession, revokeToken, syncSession };
84
+ const watchSession = (onChange) => {
85
+ if (typeof window === "undefined" || typeof document === "undefined" || !ssoOrigin) {
86
+ return () => {
87
+ };
88
+ }
89
+ const iframe = document.createElement("iframe");
90
+ iframe.style.display = "none";
91
+ iframe.src = `${ssoBase}/watch`;
92
+ const stopMessage = useEventListener(window, "message", (event) => {
93
+ if (event.origin !== ssoOrigin) return;
94
+ if (event.source !== iframe.contentWindow) return;
95
+ if (event.data?.type === "SSO_CHANGED") onChange();
96
+ });
97
+ const stopLoad = useEventListener(iframe, "load", () => {
98
+ iframe.contentWindow?.postMessage({ type: "SSO_WATCH" }, ssoOrigin);
99
+ });
100
+ document.body.appendChild(iframe);
101
+ const stop = () => {
102
+ stopMessage();
103
+ stopLoad();
104
+ iframe.remove();
105
+ };
106
+ tryOnScopeDispose(stop);
107
+ return stop;
108
+ };
109
+ return { readSession, saveSession, clearSession, revokeToken, syncSession, watchSession };
85
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.466.0",
3
+ "version": "1.467.1",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,8 @@
38
38
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
39
39
  },
40
40
  "dependencies": {
41
- "@nuxt/fonts": "^0.13.0",
41
+ "@fontsource/anuphan": "^5.3.0",
42
+ "@fontsource/sarabun": "^5.3.0",
42
43
  "@nuxt/icon": "^1.10.3",
43
44
  "@nuxt/image": "^1.9.0",
44
45
  "@nuxt/kit": "^4.0.0",
@@ -1,21 +0,0 @@
1
- type __VLS_Props = {
2
- confirmedText?: string;
3
- };
4
- type __VLS_ModelProps = {
5
- modelValue?: boolean;
6
- };
7
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
- } & {
11
- close: () => any;
12
- complete: () => any;
13
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
- onClose?: (() => any) | undefined;
15
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
16
- onComplete?: (() => any) | undefined;
17
- }>, {
18
- confirmedText: string;
19
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- declare const _default: typeof __VLS_export;
21
- export default _default;
@@ -1,55 +0,0 @@
1
- <template>
2
- <Modal
3
- title="ลบบัญชีโดยถาวร"
4
- title-position="left"
5
- width="500"
6
- :loading="isLoading"
7
- @close="onClose"
8
- v-model="modelValue"
9
- >
10
- <div class="flex flex-col gap-[16px]">
11
- <div class="font-body-large">
12
- เมื่อคุณลบบัญชี Pukaad คุณจะไม่สามารถกู้คืนบัญชีข้อมูลหรือเนื้อหา
13
- ทั้งหมดของคุณได้อีกรวมถึง โปรไฟล์หลัก ข้อความส่วนตัวและสิ่งที่คุณเคย
14
- แชร์ในชุมชน
15
- </div>
16
- <div class="flex flex-col gap-[8px] text-error">
17
- <div class="font-body-large-prominent">การลบบัญชี</div>
18
- <div class="font-body-large">
19
- เพื่อป้องกันการลบบัญชีโดยไม่ได้ตั้งใจบัญชีของคุณจะถูกปิดแบบชั่วคราว
20
- ก่อน และจะถูกลบถาวรใน 30 วัน หากคุณไม่เข้าสู่ระบบอีก
21
- </div>
22
- </div>
23
- </div>
24
- <template #footer>
25
- <div class="flex gap-[16px] w-full">
26
- <Button class="w-full" variant="outline" color="black" @click="onClose">
27
- ยกเลิก
28
- </Button>
29
- <Button class="w-full" color="primary" @click="onNext">
30
- {{ props.confirmedText }}
31
- </Button>
32
- </div>
33
- </template>
34
- </Modal>
35
- </template>
36
-
37
- <script setup>
38
- import { ref } from "vue";
39
- const emit = defineEmits(["close", "complete"]);
40
- const props = defineProps({
41
- confirmedText: { type: String, required: false, default: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19" }
42
- });
43
- const isLoading = ref(false);
44
- const modelValue = defineModel({ type: Boolean, ...{
45
- default: false
46
- } });
47
- const onClose = () => {
48
- emit("close");
49
- modelValue.value = false;
50
- };
51
- const onNext = () => {
52
- emit("complete");
53
- modelValue.value = false;
54
- };
55
- </script>
@@ -1,21 +0,0 @@
1
- type __VLS_Props = {
2
- confirmedText?: string;
3
- };
4
- type __VLS_ModelProps = {
5
- modelValue?: boolean;
6
- };
7
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
- } & {
11
- close: () => any;
12
- complete: () => any;
13
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
- onClose?: (() => any) | undefined;
15
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
16
- onComplete?: (() => any) | undefined;
17
- }>, {
18
- confirmedText: string;
19
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- declare const _default: typeof __VLS_export;
21
- export default _default;
@@ -1,21 +0,0 @@
1
- type __VLS_Props = {
2
- confirmedText?: string;
3
- };
4
- type __VLS_ModelProps = {
5
- modelValue?: boolean;
6
- };
7
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
- } & {
11
- close: () => any;
12
- complete: () => any;
13
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
- onClose?: (() => any) | undefined;
15
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
16
- onComplete?: (() => any) | undefined;
17
- }>, {
18
- confirmedText: string;
19
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- declare const _default: typeof __VLS_export;
21
- export default _default;