@ahzoo/sus 2.0.3 → 2.1.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/t/index.d.ts CHANGED
@@ -1,115 +1,10 @@
1
- import {DefineComponent} from 'vue';
2
- export interface TopCommentItem {
3
- userName: string;
4
- userWebsite: string;
5
- userAvatar: string;
6
- content: string;
7
- replyName?: string;
8
- }
9
- export interface CommentItem {
10
- readonly id: string;
11
- userName: string;
12
- userWebsite: string;
13
- userAvatar: string;
14
- content: string;
15
- contentExtends?: string;
16
- parentId?: string;
17
- replyName?: string;
18
- createdDate: string;
19
- area?: string;
20
- userAgent?: string;
21
- tagName?: string;
22
- showMore?: boolean;
23
- showEdit?: boolean;
24
- showDelete?: boolean;
25
- privacy: boolean;
26
- band?: string;
27
- child: CommentItem[];
28
- }
29
- export interface Comment {
30
- articleId: string;
31
- userName: string;
32
- userEmail: string;
33
- userWebsite: string;
34
- userAvatar: string;
35
- content: string;
36
- contentText: string;
37
- replyName?: string;
38
- parentId?: string;
39
- notify: number;
40
- privacy: boolean;
41
- }
42
- export interface EmojiItem {
43
- readonly length: number;
44
- name: string;
45
- emoji: string;
46
- shortcodes: string[];
47
- tags: string[];
48
- group: string;
49
- fallbackImage: string;
50
- }
51
- export interface Emoji {
52
- emojis: EmojiItem[];
53
- showPanel: boolean;
54
- }
55
- export interface ToolBar {
56
- emoji: {
57
- show: boolean;
58
- emojis: EmojiItem[];
59
- };
60
- image: true;
61
- notify: true;
62
- privacy: {
63
- show: boolean;
64
- disable: boolean;
65
- };
66
- bubbleMenu: {
67
- show: boolean;
68
- };
69
- }
70
- export interface InfoBar {
71
- enable: boolean;
72
- name: {
73
- show: boolean;
74
- placeholder: string;
75
- };
76
- website: {
77
- show: boolean;
78
- placeholder: string;
79
- tips: string;
80
- };
81
- email: {
82
- show: boolean;
83
- placeholder: string;
84
- tips: string;
85
- };
86
- }
87
- export const SuSSimpleTop: DefineComponent<{ comment: TopCommentItem; }>;
88
- export const SuSTop: DefineComponent<{
89
- comment: TopCommentItem;
90
- }, { (event: 'go-local'): void; }>;
91
- export const SuSComment: DefineComponent<{
92
- reply: CommentItem;
93
- toolBar: ToolBar;
94
- infoBar: InfoBar;
95
- placeholder?: string;
96
- comment?: Comment;
97
- }, {
98
- updateImage: (files: any) => void;
99
- updatePreviewImage: (value: any) => void;
100
- }, {
101
- 'on-save': (comment: Comment, uploadImage: any) => void;
102
- 'on-cancel': () => void;
103
- 'add-image': (imgRef: any, uploadImage: any) => void;
104
- 'update-avatar': (comment: Comment) => void;
105
- }>;
106
- export const SuSList: DefineComponent<{
107
- comment: CommentItem;
108
- lineHeight?: number;
109
- showFooter?: boolean;
110
- }, {
111
- 'on-reply': (comment: CommentItem) => void;
112
- 'on-edit': (comment: CommentItem) => void;
113
- 'on-remove': (comment: CommentItem) => void;
114
- }>;
115
- export default {SuSTop, SuSSimpleTop, SuSComment, SuSList};
1
+ export * from './types/comment';
2
+ import SuSComment from './types/comment';
3
+ export {SuSComment};
4
+ export * from './types/top';
5
+ import SuSTop from './types/top';
6
+ import SuSSimpleTop from './types/top';
7
+ export {SuSTop, SuSSimpleTop}
8
+ export * from './types/list';
9
+ import SuSList from './types/list';
10
+ export {SuSList}
package/dist/t/index.js CHANGED
@@ -19198,8 +19198,6 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19198
19198
  onClick: s,
19199
19199
  title: "确定",
19200
19200
  xmlns: "http://www.w3.org/2000/svg",
19201
- width: "24",
19202
- height: "24",
19203
19201
  viewBox: "0 0 24 24"
19204
19202
  }, [...a[4] || (a[4] = [
19205
19203
  T("rect", {
@@ -19269,7 +19267,7 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19269
19267
  }, 8, ["editor"])) : ke("", !0)
19270
19268
  ], 64));
19271
19269
  }
19272
- }), Yw = /* @__PURE__ */ Dn(Gw, [["__scopeId", "data-v-3f87b608"]]), Xw = Ue.create({
19270
+ }), Yw = /* @__PURE__ */ Dn(Gw, [["__scopeId", "data-v-8010a6bf"]]), Xw = Ue.create({
19273
19271
  name: "emoji",
19274
19272
  inline: !0,
19275
19273
  group: "inline",
@@ -19393,11 +19391,11 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19393
19391
  ]
19394
19392
  });
19395
19393
  function b() {
19396
- i.comment && (c.privacy = i.comment.privacy || !1, c.notify = i.comment.notify || 1, c.userName = i.comment.userName || "", c.userEmail = i.comment.userEmail || "", c.userWebsite = i.comment.userWebsite || "", c.userAvatar = i.comment.userAvatar || "", c.content = i.comment.content || "", c.articleId = i.comment.articleId || "");
19394
+ i.comment && (c.privacy = i.comment.privacy === void 0 ? !1 : i.comment.privacy, c.notify = i.comment.notify || 1, c.userName = i.comment.userName || "", c.userEmail = i.comment.userEmail || "", c.userWebsite = i.comment.userWebsite || "", c.userAvatar = i.comment.userAvatar || "", c.content = i.comment.content || "", c.articleId = i.comment.articleId || "");
19397
19395
  }
19398
19396
  async function w() {
19399
19397
  if (!(!g || !g.value)) {
19400
- if (u.value = g.value.getHTML(), c.userWebsite && (c.userWebsite.concat("http://") || c.userWebsite.concat("https://") || (c.userWebsite = "https://" + c.userWebsite)), localStorage.setItem("user", JSON.stringify(c)), localStorage.setItem("comment-content", u.value), i.reply.id != "0") {
19398
+ if (u.value = g.value.getHTML(), c.userWebsite && (c.userWebsite.concat("http://") || c.userWebsite.concat("https://") || (c.userWebsite = "https://" + c.userWebsite)), localStorage.setItem("user", JSON.stringify(c)), localStorage.setItem("comment-content", u.value), i.reply?.id && i.reply?.id != "0") {
19401
19399
  const K = i.reply.parentId;
19402
19400
  c.parentId = K === "0" ? i.reply.id : K, c.replyName = i.reply.userName, a.value = "@" + l + ":";
19403
19401
  }
@@ -19541,7 +19539,7 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19541
19539
  xmlns: "http://www.w3.org/2000/svg",
19542
19540
  viewBox: "0 0 24 24"
19543
19541
  }, [...P[5] || (P[5] = [
19544
- Bs('<g fill="none" data-v-78541ace><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M9 16c.85.63 1.885 1 3 1s2.15-.37 3-1" data-v-78541ace></path><path fill="currentColor" d="M16 10.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5s.448-1.5 1-1.5s1 .672 1 1.5" data-v-78541ace></path><ellipse cx="9" cy="10.5" fill="currentColor" rx="1" ry="1.5" data-v-78541ace></ellipse><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5" data-v-78541ace></path></g>', 1)
19542
+ Bs('<g fill="none" data-v-fdc376d7><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M9 16c.85.63 1.885 1 3 1s2.15-.37 3-1" data-v-fdc376d7></path><path fill="currentColor" d="M16 10.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5s.448-1.5 1-1.5s1 .672 1 1.5" data-v-fdc376d7></path><ellipse cx="9" cy="10.5" fill="currentColor" rx="1" ry="1.5" data-v-fdc376d7></ellipse><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5" data-v-fdc376d7></path></g>', 1)
19545
19543
  ])]))
19546
19544
  ])) : ke("", !0),
19547
19545
  n.toolBar?.image ? (X(), Z("div", hk, [
@@ -19554,7 +19552,7 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19554
19552
  name: "image",
19555
19553
  accept: "image/*"
19556
19554
  }, null, 544),
19557
- P[6] || (P[6] = Bs('<label for="upload-input" data-v-78541ace><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" data-v-78541ace><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5" data-v-78541ace><path d="m2 12.5l1.752-1.533a2.3 2.3 0 0 1 3.14.105l4.29 4.29a2 2 0 0 0 2.564.222l.299-.21a3 3 0 0 1 3.731.225L21 18.5m-6-13h3.5m0 0H22m-3.5 0V9m0-3.5V2" data-v-78541ace></path><path d="M22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12c0-1.128 0-2.122.02-3M12 2C7.286 2 4.929 2 3.464 3.464c-.424.425-.726.925-.94 1.536" data-v-78541ace></path></g></svg></label>', 1))
19555
+ P[6] || (P[6] = Bs('<label for="upload-input" data-v-fdc376d7><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" data-v-fdc376d7><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5" data-v-fdc376d7><path d="m2 12.5l1.752-1.533a2.3 2.3 0 0 1 3.14.105l4.29 4.29a2 2 0 0 0 2.564.222l.299-.21a3 3 0 0 1 3.731.225L21 18.5m-6-13h3.5m0 0H22m-3.5 0V9m0-3.5V2" data-v-fdc376d7></path><path d="M22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12c0-1.128 0-2.122.02-3M12 2C7.286 2 4.929 2 3.464 3.464c-.424.425-.726.925-.94 1.536" data-v-fdc376d7></path></g></svg></label>', 1))
19558
19556
  ])) : ke("", !0),
19559
19557
  n.toolBar?.notify ? (X(), Z("div", {
19560
19558
  key: 2,
@@ -19648,14 +19646,14 @@ const Jw = { class: "sus-bubble-menu" }, Gw = /* @__PURE__ */ et({
19648
19646
  onClick: (Se) => V(te),
19649
19647
  class: "mask"
19650
19648
  }, [...P[10] || (P[10] = [
19651
- Bs('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" data-v-78541ace><g fill="none" stroke="currentColor" stroke-width="1.5" data-v-78541ace><path stroke-linecap="round" d="M20.5 6h-17m6 5l.5 5m4.5-5l-.5 5" data-v-78541ace></path><path d="M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6" data-v-78541ace></path><path stroke-linecap="round" d="M18.374 15.4c-.177 2.654-.266 3.981-1.131 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9m13.666 0l-.2 3" data-v-78541ace></path></g></svg>', 1)
19649
+ Bs('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" data-v-fdc376d7><g fill="none" stroke="currentColor" stroke-width="1.5" data-v-fdc376d7><path stroke-linecap="round" d="M20.5 6h-17m6 5l.5 5m4.5-5l-.5 5" data-v-fdc376d7></path><path d="M6.5 6h.11a2 2 0 0 0 1.83-1.32l.034-.103l.097-.291c.083-.249.125-.373.18-.479a1.5 1.5 0 0 1 1.094-.788C9.962 3 10.093 3 10.355 3h3.29c.262 0 .393 0 .51.019a1.5 1.5 0 0 1 1.094.788c.055.106.097.23.18.479l.097.291A2 2 0 0 0 17.5 6" data-v-fdc376d7></path><path stroke-linecap="round" d="M18.374 15.4c-.177 2.654-.266 3.981-1.131 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9m13.666 0l-.2 3" data-v-fdc376d7></path></g></svg>', 1)
19652
19650
  ])], 8, bk)
19653
19651
  ]))), 128))
19654
19652
  ])
19655
19653
  ])
19656
19654
  ]));
19657
19655
  }
19658
- }), kk = /* @__PURE__ */ Dn(wk, [["__scopeId", "data-v-78541ace"]]);
19656
+ }), kk = /* @__PURE__ */ Dn(wk, [["__scopeId", "data-v-fdc376d7"]]);
19659
19657
  function xk(n) {
19660
19658
  const e = new Date(n), t = e.getFullYear(), r = e.getMonth() + 1, i = e.getDate(), s = /* @__PURE__ */ new Date(), o = s.getFullYear(), l = s.getMonth() + 1, a = s.getDate();
19661
19659
  if (o === t && l == r) {
@@ -19932,7 +19930,7 @@ const vk = { class: "sus-item__container relative" }, Sk = {
19932
19930
  ])) : ke("", !0)
19933
19931
  ]));
19934
19932
  }
19935
- }), Gk = /* @__PURE__ */ Dn(Jk, [["__scopeId", "data-v-b49dad89"]]), Yk = { class: "sus-top-item flex items-start p-1.5 overflow-hidden" }, Xk = { class: "sus-top-item__info flex flex-col mr-1" }, Qk = { class: "sus-top-item__user whitespace-nowrap" }, Zk = {
19933
+ }), Gk = /* @__PURE__ */ Dn(Jk, [["__scopeId", "data-v-b49dad89"]]), Yk = { class: "sus-top-item flex items-start p-1.5 overflow-hidden" }, Xk = { class: "sus-top-item__info inline-flex mr-1" }, Qk = { class: "sus-top-item__user whitespace-nowrap" }, Zk = {
19936
19934
  key: 0,
19937
19935
  class: "sus-top-item__reply whitespace-nowrap"
19938
19936
  }, ex = ["innerHTML"], tx = /* @__PURE__ */ et({
@@ -19952,7 +19950,7 @@ const vk = { class: "sus-item__container relative" }, Sk = {
19952
19950
  }, null, 8, ex)
19953
19951
  ]));
19954
19952
  }
19955
- }), nx = /* @__PURE__ */ Dn(tx, [["__scopeId", "data-v-7407d86d"]]), rx = { class: "sus-top-item__user flex items-center" }, ix = {
19953
+ }), nx = /* @__PURE__ */ Dn(tx, [["__scopeId", "data-v-29ceeaa9"]]), rx = { class: "sus-top-item__user flex items-center" }, ix = {
19956
19954
  key: 0,
19957
19955
  class: "sus-top-item__user-avatar ml-1 mr-2"
19958
19956
  }, sx = ["src"], ox = { class: "sus-top-item__user-owner" }, lx = { class: "sus-top-item__user-reply ml-3 opacity-70" }, ax = ["innerHTML"], cx = /* @__PURE__ */ et({
@@ -19990,7 +19988,7 @@ const vk = { class: "sus-item__container relative" }, Sk = {
19990
19988
  }, null, 8, ax)
19991
19989
  ]));
19992
19990
  }
19993
- }), ux = /* @__PURE__ */ Dn(cx, [["__scopeId", "data-v-1e2f9488"]]), dx = [kk, Gk, ux, nx], yx = {
19991
+ }), ux = /* @__PURE__ */ Dn(cx, [["__scopeId", "data-v-bd71958e"]]), dx = [kk, Gk, ux, nx], yx = {
19994
19992
  install(n) {
19995
19993
  dx.forEach((e) => {
19996
19994
  n.component(e.name, e);