pukaad-ui-lib 1.465.0 → 1.466.0

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 (46) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/card/card-blog.d.vue.ts +2 -0
  3. package/dist/runtime/components/card/card-blog.vue +2 -7
  4. package/dist/runtime/components/card/card-blog.vue.d.ts +2 -0
  5. package/dist/runtime/components/card/card-user/card-user-item.d.vue.ts +23 -3
  6. package/dist/runtime/components/card/card-user/card-user-item.vue +35 -7
  7. package/dist/runtime/components/card/card-user/card-user-item.vue.d.ts +23 -3
  8. package/dist/runtime/components/display/display-video.d.vue.ts +4 -4
  9. package/dist/runtime/components/display/display-video.vue.d.ts +4 -4
  10. package/dist/runtime/components/drawer/drawer-profile-network.d.vue.ts +1 -1
  11. package/dist/runtime/components/drawer/drawer-profile-network.vue.d.ts +1 -1
  12. package/dist/runtime/components/input/input-address.d.vue.ts +1 -1
  13. package/dist/runtime/components/input/input-address.vue.d.ts +1 -1
  14. package/dist/runtime/components/input/input-autocomplete.d.vue.ts +2 -2
  15. package/dist/runtime/components/input/input-autocomplete.vue.d.ts +2 -2
  16. package/dist/runtime/components/input/input-chat.d.vue.ts +1 -1
  17. package/dist/runtime/components/input/input-chat.vue.d.ts +1 -1
  18. package/dist/runtime/components/input/input-combobox.d.vue.ts +1 -1
  19. package/dist/runtime/components/input/input-combobox.vue.d.ts +1 -1
  20. package/dist/runtime/components/input/input-comment.d.vue.ts +1 -1
  21. package/dist/runtime/components/input/input-comment.vue.d.ts +1 -1
  22. package/dist/runtime/components/input/input-file.d.vue.ts +1 -1
  23. package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
  24. package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
  25. package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
  26. package/dist/runtime/components/input/input-password.d.vue.ts +1 -1
  27. package/dist/runtime/components/input/input-password.vue.d.ts +1 -1
  28. package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
  29. package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
  30. package/dist/runtime/components/input/input-tag-modal.d.vue.ts +1 -1
  31. package/dist/runtime/components/input/input-tag-modal.vue.d.ts +1 -1
  32. package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
  33. package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
  34. package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
  35. package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
  36. package/dist/runtime/components/modal/modal-report.vue +24 -1
  37. package/dist/runtime/components/preview/preview-blog.d.vue.ts +39 -0
  38. package/dist/runtime/components/preview/preview-blog.vue +203 -0
  39. package/dist/runtime/components/preview/preview-blog.vue.d.ts +39 -0
  40. package/dist/runtime/components/ui/chart/ChartTooltipContent.d.vue.ts +1 -1
  41. package/dist/runtime/components/ui/chart/ChartTooltipContent.vue.d.ts +1 -1
  42. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.d.vue.ts +2 -2
  43. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +2 -2
  44. package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +2 -2
  45. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +2 -2
  46. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.465.0",
4
+ "version": "1.466.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -26,12 +26,14 @@ type __VLS_Props = {
26
26
  disabledMenu?: boolean;
27
27
  };
28
28
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
+ click: (id: string) => any;
29
30
  "blog-edit": () => any;
30
31
  "blog-pinned": (id: string) => any;
31
32
  "blog-unpinned": (id: string) => any;
32
33
  "blog-updated": (id: string, data: any) => any;
33
34
  "blog-deleted": (id: string) => any;
34
35
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
+ onClick?: ((id: string) => any) | undefined;
35
37
  "onBlog-edit"?: (() => any) | undefined;
36
38
  "onBlog-pinned"?: ((id: string) => any) | undefined;
37
39
  "onBlog-unpinned"?: ((id: string) => any) | undefined;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex gap-[16px] cursor-pointer items-start" @click="onClick">
2
+ <div class="flex gap-[16px] cursor-pointer items-start" @click="$emit('click', props.item.id)">
3
3
  <Image v-if="displayImage" :src="displayImage" :width="227" :height="128" class="rounded-[4px]"
4
4
  fit="cover" />
5
5
  <div class="flex flex-col gap-[4px] w-full">
@@ -52,10 +52,8 @@
52
52
 
53
53
  <script setup>
54
54
  import { useConvert } from "#pukaad-ui/runtime/composables/useConvert";
55
- import { useRouter } from "vue-router";
56
55
  import { computed, ref, watch, onMounted, onBeforeUnmount } from "vue";
57
56
  const { convertNumber, convertDateToRelativeText } = useConvert();
58
- const router = useRouter();
59
57
  const props = defineProps({
60
58
  item: { type: Object, required: true },
61
59
  isMyProfile: { type: Boolean, required: false, default: false },
@@ -89,7 +87,7 @@ const displayDescription = computed(() => {
89
87
  if (props.item.description) return props.item.description;
90
88
  return extractTextFromDelta(props.item.content);
91
89
  });
92
- const emit = defineEmits(["blog-edit", "blog-pinned", "blog-unpinned", "blog-updated", "blog-deleted"]);
90
+ const emit = defineEmits(["click", "blog-edit", "blog-pinned", "blog-unpinned", "blog-updated", "blog-deleted"]);
93
91
  const isPinned = ref(props.item.is_pinned);
94
92
  watch(
95
93
  () => props.item.is_pinned,
@@ -97,7 +95,4 @@ watch(
97
95
  isPinned.value = !!val;
98
96
  }
99
97
  );
100
- const onClick = () => {
101
- router.push(`/blog/${props.item.id}`);
102
- };
103
98
  </script>
@@ -26,12 +26,14 @@ type __VLS_Props = {
26
26
  disabledMenu?: boolean;
27
27
  };
28
28
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
+ click: (id: string) => any;
29
30
  "blog-edit": () => any;
30
31
  "blog-pinned": (id: string) => any;
31
32
  "blog-unpinned": (id: string) => any;
32
33
  "blog-updated": (id: string, data: any) => any;
33
34
  "blog-deleted": (id: string) => any;
34
35
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
+ onClick?: ((id: string) => any) | undefined;
35
37
  "onBlog-edit"?: (() => any) | undefined;
36
38
  "onBlog-pinned"?: ((id: string) => any) | undefined;
37
39
  "onBlog-unpinned"?: ((id: string) => any) | undefined;
@@ -9,13 +9,33 @@ export interface User {
9
9
  is_my_profile?: boolean;
10
10
  profile_verify?: boolean;
11
11
  }
12
+ type __VLS_Props = {
13
+ /** ไม่พาไปหน้าโปรไฟล์ /@:id ตอนกดการ์ด (แอปที่ไม่มีหน้านี้) */
14
+ disabledLink?: boolean;
15
+ /** ซ่อนปุ่มติดตาม (เช่นรายการผู้ติดตามของ business ที่มีแค่เมนู ⋮) */
16
+ hideFollow?: boolean;
17
+ };
12
18
  type __VLS_ModelProps = {
13
19
  modelValue?: User;
14
20
  };
15
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
22
+ declare var __VLS_19: {};
23
+ type __VLS_Slots = {} & {
24
+ actions?: (props: typeof __VLS_19) => any;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
27
  "update:modelValue": (value: User) => any;
17
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
29
  "onUpdate:modelValue"?: ((value: User) => any) | undefined;
19
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ }>, {
31
+ disabledLink: boolean;
32
+ hideFollow: boolean;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
35
  declare const _default: typeof __VLS_export;
21
36
  export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -1,16 +1,31 @@
1
1
  <template>
2
- <div class="flex gap-[16px] items-center justify-between cursor-pointer transition-colors" @click="onClickCard">
3
- <div class="flex gap-[8px]">
2
+ <div
3
+ class="flex gap-[16px] items-center justify-between cursor-pointer transition-colors"
4
+ @click="onClickCard"
5
+ >
6
+ <div class="flex flex-1 min-w-0 gap-[8px]">
4
7
  <Avatar :src="modelValue?.avatar" :alt="modelValue?.name" :size="40" />
5
- <div class="flex flex-col gap-[4px]">
8
+ <div class="flex flex-col flex-1 min-w-0 gap-[4px]">
6
9
  <div class="font-body-large-prominent flex items-center gap-[4px]">
7
10
  {{ modelValue?.name }}
11
+ <Icon
12
+ v-if="modelValue?.profile_verify"
13
+ name="pukaad-verify"
14
+ :size="16"
15
+ class="shrink-0"
16
+ />
8
17
  </div>
9
18
  <div class="flex flex-col gap-[4px] font-body-small text-gray">
10
19
  <div class="flex items-center gap-[4px]">
11
- <div>ผู้ติดตาม {{ $convert.convertNumber(modelValue?.follower_count || 0) }}</div>
20
+ <div>
21
+ ผู้ติดตาม
22
+ {{ $convert.convertNumber(modelValue?.follower_count || 0) }}
23
+ </div>
12
24
  <div>•</div>
13
- <div>กำลังเผยแพร่ {{ $convert.convertNumber(modelValue?.public_count || 0) }}</div>
25
+ <div>
26
+ กำลังเผยแพร่
27
+ {{ $convert.convertNumber(modelValue?.public_count || 0) }}
28
+ </div>
14
29
  </div>
15
30
  <div v-if="modelValue?.description" class="line-clamp-2">
16
31
  {{ modelValue?.description }}
@@ -18,10 +33,18 @@
18
33
  </div>
19
34
  </div>
20
35
  </div>
21
- <Button v-if="!modelValue?.is_my_profile" :variant="modelValue?.is_following ? 'default' : 'outline'"
22
- :color="modelValue?.is_following ? 'default' : 'primary'" @click.stop="onFollowToggle">
36
+ <Button
37
+ v-if="!modelValue?.is_my_profile && !hideFollow"
38
+ :variant="modelValue?.is_following ? 'default' : 'outline'"
39
+ :color="modelValue?.is_following ? 'default' : 'primary'"
40
+ @click.stop="onFollowToggle"
41
+ >
23
42
  {{ modelValue?.is_following ? "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E41\u0E25\u0E49\u0E27" : "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21" }}
24
43
  </Button>
44
+ <!-- เช่นเมนู ⋮ ของแต่ละแอป — กดแล้วไม่เปิดโปรไฟล์ -->
45
+ <div v-if="$slots.actions" class="shrink-0" @click.stop>
46
+ <slot name="actions" />
47
+ </div>
25
48
  </div>
26
49
  </template>
27
50
 
@@ -29,11 +52,16 @@
29
52
  import { ref } from "vue";
30
53
  import { useRouter } from "vue-router";
31
54
  import { useApi } from "../../../composables/useApi";
55
+ const props = defineProps({
56
+ disabledLink: { type: Boolean, required: false, default: false },
57
+ hideFollow: { type: Boolean, required: false, default: false }
58
+ });
32
59
  const modelValue = defineModel({ type: Object, ...{
33
60
  default: () => ({})
34
61
  } });
35
62
  const router = useRouter();
36
63
  const onClickCard = () => {
64
+ if (props.disabledLink) return;
37
65
  if (modelValue.value?.id) {
38
66
  router.push(`/@${modelValue.value.id}`);
39
67
  }
@@ -9,13 +9,33 @@ export interface User {
9
9
  is_my_profile?: boolean;
10
10
  profile_verify?: boolean;
11
11
  }
12
+ type __VLS_Props = {
13
+ /** ไม่พาไปหน้าโปรไฟล์ /@:id ตอนกดการ์ด (แอปที่ไม่มีหน้านี้) */
14
+ disabledLink?: boolean;
15
+ /** ซ่อนปุ่มติดตาม (เช่นรายการผู้ติดตามของ business ที่มีแค่เมนู ⋮) */
16
+ hideFollow?: boolean;
17
+ };
12
18
  type __VLS_ModelProps = {
13
19
  modelValue?: User;
14
20
  };
15
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
22
+ declare var __VLS_19: {};
23
+ type __VLS_Slots = {} & {
24
+ actions?: (props: typeof __VLS_19) => any;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
27
  "update:modelValue": (value: User) => any;
17
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
29
  "onUpdate:modelValue"?: ((value: User) => any) | undefined;
19
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ }>, {
31
+ disabledLink: boolean;
32
+ hideFollow: boolean;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
35
  declare const _default: typeof __VLS_export;
21
36
  export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -81,16 +81,16 @@ declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
81
81
  toggle: () => void;
82
82
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
83
83
  close: (payload: DisplayVideoAction) => any;
84
- fullscreen: (payload: DisplayVideoAction) => any;
85
- "play-click": (payload: DisplayVideoAction) => any;
86
84
  prev: (payload: DisplayVideoAction) => any;
87
85
  next: (payload: DisplayVideoAction) => any;
86
+ fullscreen: (payload: DisplayVideoAction) => any;
87
+ "play-click": (payload: DisplayVideoAction) => any;
88
88
  }, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
89
89
  onClose?: ((payload: DisplayVideoAction) => any) | undefined;
90
- onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
91
- "onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
92
90
  onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
93
91
  onNext?: ((payload: DisplayVideoAction) => any) | undefined;
92
+ onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
93
+ "onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
94
94
  }>, {
95
95
  src: string;
96
96
  fullWidth: boolean;
@@ -81,16 +81,16 @@ declare const __VLS_base: import("vue").DefineComponent<DisplayVideoProps, {
81
81
  toggle: () => void;
82
82
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
83
83
  close: (payload: DisplayVideoAction) => any;
84
- fullscreen: (payload: DisplayVideoAction) => any;
85
- "play-click": (payload: DisplayVideoAction) => any;
86
84
  prev: (payload: DisplayVideoAction) => any;
87
85
  next: (payload: DisplayVideoAction) => any;
86
+ fullscreen: (payload: DisplayVideoAction) => any;
87
+ "play-click": (payload: DisplayVideoAction) => any;
88
88
  }, string, import("vue").PublicProps, Readonly<DisplayVideoProps> & Readonly<{
89
89
  onClose?: ((payload: DisplayVideoAction) => any) | undefined;
90
- onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
91
- "onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
92
90
  onPrev?: ((payload: DisplayVideoAction) => any) | undefined;
93
91
  onNext?: ((payload: DisplayVideoAction) => any) | undefined;
92
+ onFullscreen?: ((payload: DisplayVideoAction) => any) | undefined;
93
+ "onPlay-click"?: ((payload: DisplayVideoAction) => any) | undefined;
94
94
  }>, {
95
95
  src: string;
96
96
  fullWidth: boolean;
@@ -30,9 +30,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
30
30
  "onExplore-places"?: (() => any) | undefined;
31
31
  "onRequire-auth"?: (() => any) | undefined;
32
32
  }>, {
33
+ isMyProfile: boolean;
33
34
  profileId: string;
34
35
  defaultTab: "followers" | "following" | "favorites";
35
- isMyProfile: boolean;
36
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
37
  declare const _default: typeof __VLS_export;
38
38
  export default _default;
@@ -30,9 +30,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
30
30
  "onExplore-places"?: (() => any) | undefined;
31
31
  "onRequire-auth"?: (() => any) | undefined;
32
32
  }>, {
33
+ isMyProfile: boolean;
33
34
  profileId: string;
34
35
  defaultTab: "followers" | "following" | "favorites";
35
- isMyProfile: boolean;
36
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
37
  declare const _default: typeof __VLS_export;
38
38
  export default _default;
@@ -52,10 +52,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
52
52
  required: boolean;
53
53
  placeholder: string;
54
54
  layout: "vertical" | "horizontal";
55
- gap: number | string;
56
55
  labelDetail: string;
57
56
  placeholderDetail: string;
58
57
  requiredDetail: boolean;
58
+ gap: number | string;
59
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
60
  declare const _default: typeof __VLS_export;
61
61
  export default _default;
@@ -52,10 +52,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
52
52
  required: boolean;
53
53
  placeholder: string;
54
54
  layout: "vertical" | "horizontal";
55
- gap: number | string;
56
55
  labelDetail: string;
57
56
  placeholderDetail: string;
58
57
  requiredDetail: boolean;
58
+ gap: number | string;
59
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
60
  declare const _default: typeof __VLS_export;
61
61
  export default _default;
@@ -69,10 +69,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
69
69
  name: string;
70
70
  required: boolean;
71
71
  description: string;
72
- options: AutocompleteOption[] | string[] | number[];
73
- limit: number;
74
72
  labelKey: string;
75
73
  placeholder: string;
74
+ options: AutocompleteOption[] | string[] | number[];
75
+ limit: number;
76
76
  disabledErrorMessage: boolean;
77
77
  disabledBorder: boolean;
78
78
  showCounter: boolean;
@@ -69,10 +69,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
69
69
  name: string;
70
70
  required: boolean;
71
71
  description: string;
72
- options: AutocompleteOption[] | string[] | number[];
73
- limit: number;
74
72
  labelKey: string;
75
73
  placeholder: string;
74
+ options: AutocompleteOption[] | string[] | number[];
75
+ limit: number;
76
76
  disabledErrorMessage: boolean;
77
77
  disabledBorder: boolean;
78
78
  showCounter: boolean;
@@ -50,8 +50,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  disabled: boolean;
51
51
  name: string;
52
52
  placeholder: string;
53
- maxHeight: number;
54
53
  maxlength: number;
54
+ maxHeight: number;
55
55
  limitImage: number;
56
56
  limitVideo: number;
57
57
  disabledMedia: boolean;
@@ -50,8 +50,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  disabled: boolean;
51
51
  name: string;
52
52
  placeholder: string;
53
- maxHeight: number;
54
53
  maxlength: number;
54
+ maxHeight: number;
55
55
  limitImage: number;
56
56
  limitVideo: number;
57
57
  disabledMedia: boolean;
@@ -60,8 +60,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
60
60
  }>, {
61
61
  pageSize: number;
62
62
  name: string;
63
- limit: number;
64
63
  labelKey: string;
64
+ limit: number;
65
65
  valueKey: string;
66
66
  multiple: boolean;
67
67
  placeholderSearch: string;
@@ -60,8 +60,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
60
60
  }>, {
61
61
  pageSize: number;
62
62
  name: string;
63
- limit: number;
64
63
  labelKey: string;
64
+ limit: number;
65
65
  valueKey: string;
66
66
  multiple: boolean;
67
67
  placeholderSearch: string;
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
46
46
  }>, {
47
47
  loading: boolean;
48
48
  disabled: boolean;
49
- cancelText: string;
50
49
  placeholder: string;
50
+ cancelText: string;
51
51
  autofocus: boolean;
52
52
  disabledAvatar: boolean;
53
53
  submitText: string;
@@ -46,8 +46,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
46
46
  }>, {
47
47
  loading: boolean;
48
48
  disabled: boolean;
49
- cancelText: string;
50
49
  placeholder: string;
50
+ cancelText: string;
51
51
  autofocus: boolean;
52
52
  disabledAvatar: boolean;
53
53
  submitText: string;
@@ -37,8 +37,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
37
37
  fullWidth: boolean;
38
38
  fullHeight: boolean;
39
39
  limit: number;
40
- accept: string;
41
40
  disabledErrorMessage: boolean;
41
+ accept: string;
42
42
  labelIcon: string;
43
43
  disabledDrop: boolean;
44
44
  column: boolean;
@@ -37,8 +37,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
37
37
  fullWidth: boolean;
38
38
  fullHeight: boolean;
39
39
  limit: number;
40
- accept: string;
41
40
  disabledErrorMessage: boolean;
41
+ accept: string;
42
42
  labelIcon: string;
43
43
  disabledDrop: boolean;
44
44
  column: boolean;
@@ -11,10 +11,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
11
11
  label: string;
12
12
  name: string;
13
13
  modelValue: LocalizedNameItem[];
14
+ placeholder: string;
14
15
  options: InputSelectItem[];
15
16
  removable: boolean;
16
17
  limit: number;
17
- placeholder: string;
18
18
  showCounter: boolean;
19
19
  addLabel: string;
20
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -11,10 +11,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
11
11
  label: string;
12
12
  name: string;
13
13
  modelValue: LocalizedNameItem[];
14
+ placeholder: string;
14
15
  options: InputSelectItem[];
15
16
  removable: boolean;
16
17
  limit: number;
17
- placeholder: string;
18
18
  showCounter: boolean;
19
19
  addLabel: string;
20
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
20
20
  name: string;
21
21
  required: boolean;
22
22
  description: string;
23
- limit: number;
24
23
  labelKey: string;
25
24
  placeholder: string;
25
+ limit: number;
26
26
  disabledErrorMessage: boolean;
27
27
  disabledBorder: boolean;
28
28
  showCounter: boolean;
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
20
20
  name: string;
21
21
  required: boolean;
22
22
  description: string;
23
- limit: number;
24
23
  labelKey: string;
25
24
  placeholder: string;
25
+ limit: number;
26
26
  disabledErrorMessage: boolean;
27
27
  disabledBorder: boolean;
28
28
  showCounter: boolean;
@@ -40,9 +40,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
40
40
  id: string;
41
41
  name: string;
42
42
  required: boolean;
43
- options: InputTagModalOption[];
44
43
  labelKey: string;
45
44
  placeholder: string;
45
+ options: InputTagModalOption[];
46
46
  disabledErrorMessage: boolean;
47
47
  valueKey: string;
48
48
  searchPlaceholder: string;
@@ -40,9 +40,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
40
40
  id: string;
41
41
  name: string;
42
42
  required: boolean;
43
- options: InputTagModalOption[];
44
43
  labelKey: string;
45
44
  placeholder: string;
45
+ options: InputTagModalOption[];
46
46
  disabledErrorMessage: boolean;
47
47
  valueKey: string;
48
48
  searchPlaceholder: string;
@@ -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;
29
30
  state: "user" | "admin";
30
31
  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;
29
30
  state: "user" | "admin";
30
31
  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
- limit: number;
51
50
  rows: number;
51
+ limit: 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
- limit: number;
51
50
  rows: number;
51
+ limit: number;
52
52
  disabledErrorMessage: boolean;
53
53
  disabledBorder: boolean;
54
54
  showCounter: boolean;
@@ -82,13 +82,33 @@ const chatOptions = [
82
82
  { label: "\u0E41\u0E2D\u0E1A\u0E2D\u0E49\u0E32\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25\u0E2B\u0E23\u0E37\u0E2D\u0E18\u0E38\u0E23\u0E01\u0E34\u0E08\u0E2D\u0E37\u0E48\u0E19", value: "impersonation" },
83
83
  { label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
84
84
  ];
85
+ const profileOptions = [
86
+ { label: "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E44\u0E21\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07", value: "irrelevant" },
87
+ { label: "\u0E2B\u0E22\u0E32\u0E1A\u0E04\u0E32\u0E22 / \u0E44\u0E21\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E2A\u0E21", value: "inappropriate" },
88
+ { label: "\u0E25\u0E32\u0E21\u0E01\u0E2D\u0E19\u0E32\u0E08\u0E32\u0E23", value: "obscene" },
89
+ { label: "\u0E04\u0E27\u0E32\u0E21\u0E23\u0E38\u0E19\u0E41\u0E23\u0E07", value: "violence" },
90
+ { label: "\u0E02\u0E21\u0E02\u0E39\u0E48 \u0E04\u0E38\u0E01\u0E04\u0E32\u0E21", value: "harassment" },
91
+ { label: "\u0E01\u0E25\u0E31\u0E48\u0E19\u0E41\u0E01\u0E25\u0E49\u0E07", value: "bullying" },
92
+ { label: "\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E04\u0E27\u0E32\u0E21\u0E40\u0E01\u0E25\u0E35\u0E22\u0E14\u0E0A\u0E31\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E02\u0E31\u0E14\u0E41\u0E22\u0E49\u0E07", value: "hate_speech" },
93
+ { label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E0B\u0E49\u0E33\u0E2B\u0E23\u0E37\u0E2D\u0E2A\u0E41\u0E1B\u0E21", value: "spam" },
94
+ { label: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E17\u0E47\u0E08", value: "false_information" },
95
+ { label: "\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E17\u0E23\u0E31\u0E1E\u0E22\u0E4C\u0E2A\u0E34\u0E19\u0E17\u0E32\u0E07\u0E1B\u0E31\u0E0D\u0E0D\u0E32", value: "intellectual_property" },
96
+ { label: "\u0E25\u0E30\u0E40\u0E21\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E15\u0E01\u0E25\u0E07\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19", value: "terms_violation" },
97
+ { label: "\u0E1C\u0E34\u0E14\u0E01\u0E0E\u0E2B\u0E21\u0E32\u0E22", value: "illegal" },
98
+ { label: "\u0E2A\u0E48\u0E07\u0E1C\u0E25\u0E01\u0E23\u0E30\u0E17\u0E1A\u0E15\u0E48\u0E2D\u0E1A\u0E38\u0E04\u0E04\u0E25", value: "personal_impact" },
99
+ { label: "\u0E40\u0E02\u0E49\u0E32\u0E02\u0E48\u0E32\u0E22\u0E2B\u0E25\u0E2D\u0E01\u0E25\u0E27\u0E07", value: "scam" },
100
+ { label: "\u0E2D\u0E37\u0E48\u0E19\u0E46", value: "other" }
101
+ ];
85
102
  const title = computed(() => {
86
103
  if (props.state === "place-edit") return "\u0E41\u0E08\u0E49\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02\u0E2A\u0E16\u0E32\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49";
87
104
  if (props.state === "media") return "\u0E41\u0E08\u0E49\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02\u0E2A\u0E37\u0E48\u0E2D\u0E19\u0E35\u0E49";
88
105
  if (props.state === "chat") return "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E41\u0E0A\u0E17\u0E19\u0E35\u0E49";
106
+ if (props.state === "profile") return "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C\u0E19\u0E35\u0E49";
89
107
  return "";
90
108
  });
91
- const placeholderText = computed(() => "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07");
109
+ const placeholderText = computed(
110
+ () => props.state === "profile" ? "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19" : "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07"
111
+ );
92
112
  const modelValue = defineModel({ type: Boolean, ...{
93
113
  default: false
94
114
  } });
@@ -106,6 +126,9 @@ const currentOptions = computed(() => {
106
126
  if (props.state === "chat") {
107
127
  return chatOptions;
108
128
  }
129
+ if (props.state === "profile") {
130
+ return profileOptions;
131
+ }
109
132
  return [];
110
133
  });
111
134
  const items = computed(() => {
@@ -0,0 +1,39 @@
1
+ export type PreviewBlogState = "personal" | "office" | "business";
2
+ export interface PreviewBlogData {
3
+ id?: string;
4
+ title?: string;
5
+ content?: {
6
+ ops?: {
7
+ insert: unknown;
8
+ attributes?: Record<string, unknown>;
9
+ }[];
10
+ };
11
+ tags?: {
12
+ id: string;
13
+ name: string;
14
+ }[];
15
+ like_count?: number;
16
+ view_count?: number;
17
+ share_count?: number;
18
+ created_at?: string;
19
+ author?: {
20
+ id: string;
21
+ name: string;
22
+ avatar: string | null;
23
+ is_verified?: boolean;
24
+ };
25
+ }
26
+ type __VLS_Props = {
27
+ blogId: string | number;
28
+ /** เลือก endpoint ตามแอปที่เปิดพรีวิว */
29
+ state?: PreviewBlogState;
30
+ };
31
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ exit: () => any;
33
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
34
+ onExit?: (() => any) | undefined;
35
+ }>, {
36
+ state: PreviewBlogState;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
@@ -0,0 +1,203 @@
1
+ <template>
2
+ <!-- Figma: Preview Business Blog (2806:184735) — หน้าตาเดียวกับหน้าบล็อกจริง แต่กดอะไรไม่ได้ -->
3
+ <div class="h-screen w-full overflow-hidden bg-white flex flex-col">
4
+ <!-- Figma: Navbar Preview (new tab) — Property 1=Admin -->
5
+ <div class="shrink-0 w-full bg-cloud">
6
+ <div class="max-w-[1280px] mx-auto flex justify-end p-[16px]">
7
+ <Button variant="outline" class="rounded-[6px]" @click="emit('exit')">
8
+ ออกจากพรีวิว
9
+ </Button>
10
+ </div>
11
+ </div>
12
+
13
+ <!-- เลื่อนในกล่องนี้ ไม่พึ่ง scroll ของหน้า (บางแอปล็อก html/body ไว้) -->
14
+ <div class="flex-1 overflow-y-auto">
15
+ <div class="flex justify-center px-[16px] pt-[16px] pb-[16px]">
16
+ <div class="w-[844px] flex flex-col gap-[16px]">
17
+ <div class="flex flex-col">
18
+ <div class="flex flex-col gap-[16px] p-[16px]">
19
+ <div class="flex items-start gap-[16px]">
20
+ <div class="flex-1 min-w-0 font-display-small-prominent break-words">
21
+ {{ blogData.title }}
22
+ </div>
23
+ <!-- พรีวิว = ดูหน้าตาได้แต่กดไม่ได้ -->
24
+ <Button circle size="icon-sm" class="shrink-0" inert>
25
+ <Icon name="lucide:ellipsis-vertical" />
26
+ </Button>
27
+ </div>
28
+
29
+ <!-- Figma: Profile Detail Announce/Blog (Your_Business, Blog) -->
30
+ <div v-if="blogData.author" class="flex items-center gap-[8px]">
31
+ <Avatar :src="blogData.author.avatar ?? ''" :size="40" />
32
+ <div class="flex items-center gap-[8px] min-w-0 font-body-large">
33
+ <div class="flex items-center gap-[4px] min-w-0">
34
+ <div class="font-body-large-prominent truncate">
35
+ {{ blogData.author.name }}
36
+ </div>
37
+ <Icon
38
+ v-if="blogData.author.is_verified"
39
+ name="pukaad-verify"
40
+ :size="16"
41
+ class="shrink-0"
42
+ />
43
+ </div>
44
+ <template v-if="blogData.created_at">
45
+ <div class="text-gray">•</div>
46
+ <div class="text-gray shrink-0">
47
+ {{ convertDateToRelativeText(blogData.created_at) }}
48
+ </div>
49
+ </template>
50
+ </div>
51
+ </div>
52
+
53
+ <!-- eslint-disable-next-line vue/no-v-html -->
54
+ <div class="[&_img]:max-w-full [&_img]:h-auto" v-html="blogHtml" />
55
+
56
+ <div v-if="blogData.tags?.length" class="flex flex-wrap gap-[8px]">
57
+ <Chip v-for="tag in blogData.tags" :key="tag.id" color="bright">
58
+ {{ tag.name }}
59
+ </Chip>
60
+ </div>
61
+ </div>
62
+
63
+ <!-- Figma: Toolbar - Announce/Blog (Property 1=Blog) — ถูกใจ / ยอดวิว / แชร์ -->
64
+ <CardReaction
65
+ :item-count="{
66
+ liked: blogData.like_count ?? 0,
67
+ viewed: blogData.view_count ?? 0,
68
+ shared: blogData.share_count ?? 0
69
+ }"
70
+ disabled
71
+ />
72
+ </div>
73
+
74
+ <!-- ส่งรายการเข้าไปเอง (ไม่ใช้ fetchFn) เพราะ fetchFn โหลดหน้าถัดไปจาก window scroll -->
75
+ <Comment
76
+ :comments="comments"
77
+ :comment-count="commentTotal"
78
+ :current-user="previewUser"
79
+ readonly
80
+ />
81
+
82
+ <div ref="sentinel" class="h-[1px]" />
83
+ <div v-if="isLoadingComments" class="flex justify-center py-[16px]">
84
+ <Icon
85
+ name="lucide:loader-circle"
86
+ :size="40"
87
+ class="animate-spin text-cloud"
88
+ />
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </template>
95
+
96
+ <script setup>
97
+ import { computed, onMounted, ref, useTemplateRef, watch } from "vue";
98
+ import { useElementVisibility } from "@vueuse/core";
99
+ import { QuillDeltaToHtmlConverter } from "quill-delta-to-html";
100
+ import { useApi } from "#pukaad-ui/runtime/composables/useApi";
101
+ import { useConvert } from "#pukaad-ui/runtime/composables/useConvert";
102
+ const props = defineProps({
103
+ blogId: { type: [String, Number], required: true },
104
+ state: { type: String, required: false, default: "personal" }
105
+ });
106
+ const emit = defineEmits(["exit"]);
107
+ const api = useApi();
108
+ const { convertDateToRelativeText } = useConvert();
109
+ const endpointMap = {
110
+ personal: "/blogs",
111
+ office: "/blogs",
112
+ business: "/blogs"
113
+ };
114
+ const endpoint = computed(() => endpointMap[props.state]);
115
+ const blogData = ref({});
116
+ const comments = ref([]);
117
+ const commentTotal = ref(0);
118
+ const commentPage = ref(1);
119
+ const commentTotalPages = ref(1);
120
+ const commentPageSize = 20;
121
+ const isLoadingComments = ref(false);
122
+ const hasMoreComments = computed(
123
+ () => commentPage.value < commentTotalPages.value
124
+ );
125
+ const previewUser = { id: "", name: "", avatar: "" };
126
+ const blogHtml = computed(() => {
127
+ const ops = blogData.value.content?.ops;
128
+ if (!ops?.length) return "";
129
+ return new QuillDeltaToHtmlConverter(ops, { inlineStyles: true }).convert();
130
+ });
131
+ const fetchBlogData = async () => {
132
+ try {
133
+ const res = await api(
134
+ `${endpoint.value}/${props.blogId}`
135
+ );
136
+ blogData.value = res.data ?? {};
137
+ } catch (err) {
138
+ console.error(err);
139
+ }
140
+ };
141
+ const toCommentUser = (profile) => ({
142
+ id: profile?.profile_path?.path_name ?? "",
143
+ name: profile?.profile_name ?? "\u0E44\u0E21\u0E48\u0E17\u0E23\u0E32\u0E1A\u0E0A\u0E37\u0E48\u0E2D",
144
+ avatar: profile?.profile_image?.image_url ?? ""
145
+ });
146
+ const toCommentItem = (raw) => ({
147
+ id: String(raw.id ?? ""),
148
+ user: toCommentUser(raw.profileData),
149
+ content: raw.content ?? "",
150
+ created_at: raw.created_at ?? "",
151
+ like_count: raw.like_count ?? 0,
152
+ is_liked: raw.is_liked ?? false,
153
+ reply_count: raw.reply_count ?? 0,
154
+ reply: (raw.comment_reply ?? []).map((r) => ({
155
+ id: String(r.id ?? ""),
156
+ user: toCommentUser(r.profileData),
157
+ reply_to: r.reply_to ? toCommentUser(r.reply_to) : void 0,
158
+ content: r.content ?? "",
159
+ created_at: r.created_at ?? "",
160
+ like_count: r.like_count ?? 0,
161
+ is_liked: r.is_liked ?? false
162
+ }))
163
+ });
164
+ let commentRequestId = 0;
165
+ const fetchComments = async (page = 1) => {
166
+ if (page > 1 && isLoadingComments.value) return;
167
+ const requestId = ++commentRequestId;
168
+ isLoadingComments.value = true;
169
+ try {
170
+ const res = await api(`/blogs/${props.blogId}/comments`, {
171
+ query: {
172
+ limit: commentPageSize,
173
+ offset: (page - 1) * commentPageSize
174
+ }
175
+ });
176
+ if (requestId !== commentRequestId) return;
177
+ const items = (res.data ?? []).map(toCommentItem);
178
+ comments.value = page === 1 ? items : [...comments.value, ...items];
179
+ commentTotal.value = res.meta?.total_comments ?? 0;
180
+ commentTotalPages.value = res.meta?.total_pages ?? 1;
181
+ commentPage.value = page;
182
+ } catch (err) {
183
+ console.error(err);
184
+ if (requestId === commentRequestId && page === 1) comments.value = [];
185
+ } finally {
186
+ if (requestId === commentRequestId) isLoadingComments.value = false;
187
+ }
188
+ };
189
+ const loadAll = () => {
190
+ fetchBlogData();
191
+ fetchComments(1);
192
+ };
193
+ const sentinel = useTemplateRef("sentinel");
194
+ const isSentinelVisible = useElementVisibility(sentinel);
195
+ watch(
196
+ [isSentinelVisible, hasMoreComments, isLoadingComments],
197
+ ([visible, more, loading]) => {
198
+ if (visible && more && !loading) fetchComments(commentPage.value + 1);
199
+ }
200
+ );
201
+ watch(() => [props.blogId, props.state], loadAll);
202
+ onMounted(loadAll);
203
+ </script>
@@ -0,0 +1,39 @@
1
+ export type PreviewBlogState = "personal" | "office" | "business";
2
+ export interface PreviewBlogData {
3
+ id?: string;
4
+ title?: string;
5
+ content?: {
6
+ ops?: {
7
+ insert: unknown;
8
+ attributes?: Record<string, unknown>;
9
+ }[];
10
+ };
11
+ tags?: {
12
+ id: string;
13
+ name: string;
14
+ }[];
15
+ like_count?: number;
16
+ view_count?: number;
17
+ share_count?: number;
18
+ created_at?: string;
19
+ author?: {
20
+ id: string;
21
+ name: string;
22
+ avatar: string | null;
23
+ is_verified?: boolean;
24
+ };
25
+ }
26
+ type __VLS_Props = {
27
+ blogId: string | number;
28
+ /** เลือก endpoint ตามแอปที่เปิดพรีวิว */
29
+ state?: PreviewBlogState;
30
+ };
31
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ exit: () => any;
33
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
34
+ onExit?: (() => any) | undefined;
35
+ }>, {
36
+ state: PreviewBlogState;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
@@ -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
- payload: Record<string, any>;
22
21
  config: ChartConfig;
22
+ payload: Record<string, any>;
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
- payload: Record<string, any>;
22
21
  config: ChartConfig;
22
+ payload: Record<string, any>;
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>;
@@ -14,7 +14,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
14
14
  dir?: string | undefined | undefined;
15
15
  draggable?: (boolean | "true" | "false") | undefined;
16
16
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
17
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
17
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
18
18
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
19
19
  id?: string | undefined | undefined;
20
20
  inert?: (boolean | "true" | "false") | undefined;
@@ -208,7 +208,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
208
208
  dir?: string | undefined | undefined;
209
209
  draggable?: (boolean | "true" | "false") | undefined;
210
210
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
211
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
211
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
212
212
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
213
213
  id?: string | undefined | undefined;
214
214
  inert?: (boolean | "true" | "false") | undefined;
@@ -14,7 +14,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
14
14
  dir?: string | undefined | undefined;
15
15
  draggable?: (boolean | "true" | "false") | undefined;
16
16
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
17
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
17
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
18
18
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
19
19
  id?: string | undefined | undefined;
20
20
  inert?: (boolean | "true" | "false") | undefined;
@@ -208,7 +208,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
208
208
  dir?: string | undefined | undefined;
209
209
  draggable?: (boolean | "true" | "false") | undefined;
210
210
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
211
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
211
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
212
212
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
213
213
  id?: string | undefined | undefined;
214
214
  inert?: (boolean | "true" | "false") | undefined;
@@ -16,7 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
16
16
  dir?: string | undefined | undefined;
17
17
  draggable?: (boolean | "true" | "false") | undefined;
18
18
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
19
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
19
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
20
20
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
21
21
  id?: string | undefined | undefined;
22
22
  inert?: (boolean | "true" | "false") | undefined;
@@ -212,7 +212,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
212
212
  dir?: string | undefined | undefined;
213
213
  draggable?: (boolean | "true" | "false") | undefined;
214
214
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
215
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
215
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
216
216
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
217
217
  id?: string | undefined | undefined;
218
218
  inert?: (boolean | "true" | "false") | undefined;
@@ -16,7 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
16
16
  dir?: string | undefined | undefined;
17
17
  draggable?: (boolean | "true" | "false") | undefined;
18
18
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
19
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
19
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
20
20
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
21
21
  id?: string | undefined | undefined;
22
22
  inert?: (boolean | "true" | "false") | undefined;
@@ -212,7 +212,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
212
212
  dir?: string | undefined | undefined;
213
213
  draggable?: (boolean | "true" | "false") | undefined;
214
214
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
215
- enterKeyHint?: "search" | "done" | "send" | "next" | "enter" | "go" | "previous" | undefined;
215
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
216
216
  hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
217
217
  id?: string | undefined | undefined;
218
218
  inert?: (boolean | "true" | "false") | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.465.0",
3
+ "version": "1.466.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",