pukaad-ui-lib 1.228.0 → 1.230.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.228.0",
4
+ "version": "1.230.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -21,7 +21,17 @@ type __VLS_Props = {
21
21
  id?: string;
22
22
  state?: string;
23
23
  };
24
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ comment: () => any;
26
+ like: (liked: boolean) => any;
27
+ bookmark: (bookmarked: boolean) => any;
28
+ share: () => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onComment?: (() => any) | undefined;
31
+ onLike?: ((liked: boolean) => any) | undefined;
32
+ onBookmark?: ((bookmarked: boolean) => any) | undefined;
33
+ onShare?: (() => any) | undefined;
34
+ }>, {
25
35
  disabled: boolean;
26
36
  id: string;
27
37
  disabledPadding: boolean;
@@ -35,6 +35,7 @@ import { computed, reactive, ref, watch } from "vue";
35
35
  import { useApi } from "../../composables/useApi";
36
36
  const api = useApi();
37
37
  const isOpenModalShare = ref(false);
38
+ const emit = defineEmits(["like", "bookmark", "comment", "share"]);
38
39
  const props = defineProps({
39
40
  itemCount: { type: Object, required: false, default: () => ({
40
41
  liked: 0,
@@ -89,8 +90,8 @@ const listReaction = computed(() => {
89
90
  const reactions = [
90
91
  {
91
92
  name: "liked",
92
- icon: "fa6-regular:thumbs-up",
93
- iconReacted: "fa6-solid:thumbs-up",
93
+ icon: "pukaad:thumbs-up-regular",
94
+ iconReacted: "pukaad:thumbs-up-solid",
94
95
  action: toggleLike
95
96
  },
96
97
  {
@@ -118,6 +119,7 @@ async function toggleLike() {
118
119
  const previousLiked = reaction.liked;
119
120
  reaction.liked = !previousLiked;
120
121
  counts.liked += reaction.liked ? 1 : -1;
122
+ emit("like", !!reaction.liked);
121
123
  if (props.state === "blog" && props.id) {
122
124
  try {
123
125
  await api(`/blogs/${props.id}/like`, {
@@ -133,11 +135,14 @@ async function toggleLike() {
133
135
  function toggleBookmark() {
134
136
  reaction.bookmarked = !reaction.bookmarked;
135
137
  counts.bookmarked += reaction.bookmarked ? 1 : -1;
138
+ emit("bookmark", !!reaction.bookmarked);
136
139
  }
137
140
  function toggleComment() {
138
141
  console.log("comment ");
142
+ emit("comment");
139
143
  }
140
144
  function toggleShared() {
141
145
  isOpenModalShare.value = !isOpenModalShare.value;
146
+ emit("share");
142
147
  }
143
148
  </script>
@@ -21,7 +21,17 @@ type __VLS_Props = {
21
21
  id?: string;
22
22
  state?: string;
23
23
  };
24
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ comment: () => any;
26
+ like: (liked: boolean) => any;
27
+ bookmark: (bookmarked: boolean) => any;
28
+ share: () => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onComment?: (() => any) | undefined;
31
+ onLike?: ((liked: boolean) => any) | undefined;
32
+ onBookmark?: ((bookmarked: boolean) => any) | undefined;
33
+ onShare?: (() => any) | undefined;
34
+ }>, {
25
35
  disabled: boolean;
26
36
  id: string;
27
37
  disabledPadding: boolean;
@@ -24,8 +24,14 @@ type __VLS_Props = {
24
24
  isMyProfile?: boolean;
25
25
  };
26
26
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
+ comment: () => any;
28
+ like: (liked: boolean) => any;
29
+ share: () => any;
27
30
  "blog-edit": (item: CardUserBlogProps) => any;
28
31
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
+ onComment?: (() => any) | undefined;
33
+ onLike?: ((liked: boolean) => any) | undefined;
34
+ onShare?: (() => any) | undefined;
29
35
  "onBlog-edit"?: ((item: CardUserBlogProps) => any) | undefined;
30
36
  }>, {
31
37
  isMyProfile: boolean;
@@ -70,6 +70,9 @@
70
70
  :itemActive="{
71
71
  liked: props.item.liked
72
72
  }"
73
+ @like="emit('like', $event)"
74
+ @comment="emit('comment')"
75
+ @share="emit('share')"
73
76
  />
74
77
  </div>
75
78
  </template>
@@ -84,7 +87,7 @@ const props = defineProps({
84
87
  isMyProfile: { type: Boolean, required: false, default: false }
85
88
  });
86
89
  const router = useRouter();
87
- const emit = defineEmits(["blog-edit"]);
90
+ const emit = defineEmits(["blog-edit", "like", "comment", "share"]);
88
91
  const isPinned = ref(props.item.ispinned);
89
92
  watch(
90
93
  () => props.item.ispinned,
@@ -93,7 +96,7 @@ watch(
93
96
  }
94
97
  );
95
98
  const onProfileClick = () => {
96
- router.push(`/${props.item.user.path_name}`);
99
+ router.push(`/@${props.item.user.path_name}`);
97
100
  };
98
101
  const onBlogPin = () => {
99
102
  isPinned.value = true;
@@ -106,6 +109,5 @@ const onBlogClick = () => {
106
109
  };
107
110
  const onBlogEdit = () => {
108
111
  emit("blog-edit", props.item);
109
- console.log(props.item);
110
112
  };
111
113
  </script>
@@ -24,8 +24,14 @@ type __VLS_Props = {
24
24
  isMyProfile?: boolean;
25
25
  };
26
26
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
+ comment: () => any;
28
+ like: (liked: boolean) => any;
29
+ share: () => any;
27
30
  "blog-edit": (item: CardUserBlogProps) => any;
28
31
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
+ onComment?: (() => any) | undefined;
33
+ onLike?: ((liked: boolean) => any) | undefined;
34
+ onShare?: (() => any) | undefined;
29
35
  "onBlog-edit"?: ((item: CardUserBlogProps) => any) | undefined;
30
36
  }>, {
31
37
  isMyProfile: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.228.0",
3
+ "version": "1.230.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",