@waline/client 2.15.5 → 2.15.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/client",
3
- "version": "2.15.5",
3
+ "version": "2.15.6",
4
4
  "description": "client for waline comment system",
5
5
  "keywords": [
6
6
  "valine",
@@ -125,18 +125,18 @@
125
125
  "@vueuse/core": "^10.1.2",
126
126
  "autosize": "^6.0.1",
127
127
  "marked": "^4.3.0",
128
- "vue": "^3.3.2"
128
+ "vue": "^3.3.4"
129
129
  },
130
130
  "devDependencies": {
131
- "@babel/core": "7.21.8",
132
- "@babel/preset-env": "7.21.5",
131
+ "@babel/core": "7.22.1",
132
+ "@babel/preset-env": "7.22.2",
133
133
  "@giphy/js-types": "4.4.0",
134
134
  "@types/autosize": "4.0.1",
135
- "@types/marked": "4.3.0",
135
+ "@types/marked": "4.3.1",
136
136
  "@vitejs/plugin-vue": "4.2.3",
137
137
  "recaptcha-v3": "1.10.0",
138
138
  "user-agent-data-types": "0.3.1",
139
- "vite": "4.3.6"
139
+ "vite": "4.3.9"
140
140
  },
141
141
  "engines": {
142
142
  "node": ">=14"
@@ -14,7 +14,7 @@
14
14
  <li
15
15
  v-for="item in sortingMethods"
16
16
  :key="item"
17
- :class="[item === commentSorting ? 'active' : '']"
17
+ :class="[item === commentSortingRef ? 'active' : '']"
18
18
  @click="onSortByChange(item)"
19
19
  >
20
20
  {{ i18n[item] }}
@@ -150,7 +150,7 @@ const totalPages = ref(0);
150
150
  const config = computed(() => getConfig(props as WalineProps));
151
151
 
152
152
  // eslint-disable-next-line vue/no-ref-object-destructure
153
- const commentSorting = ref(config.value.commentSorting);
153
+ const commentSortingRef = ref(config.value.commentSorting);
154
154
 
155
155
  const data = ref<WalineComment[]>([]);
156
156
  const reply = ref<WalineComment | null>(null);
@@ -177,7 +177,7 @@ const getCommentData = (pageNumber: number): void => {
177
177
  lang: config.value.lang,
178
178
  path,
179
179
  pageSize,
180
- sortBy: sortKeyMap[commentSorting.value],
180
+ sortBy: sortKeyMap[commentSortingRef.value],
181
181
  page: pageNumber,
182
182
  signal: controller.signal,
183
183
  token: userInfo.value?.token,
@@ -208,8 +208,8 @@ const refresh = (): void => {
208
208
  };
209
209
 
210
210
  const onSortByChange = (item: WalineCommentSorting): void => {
211
- if (commentSorting.value !== item) {
212
- commentSorting.value = item;
211
+ if (commentSortingRef.value !== item) {
212
+ commentSortingRef.value = item;
213
213
  refresh();
214
214
  }
215
215
  };
@@ -8,6 +8,7 @@ interface TurnstileOptions {
8
8
  }
9
9
  interface TurnstileInstance {
10
10
  ready: (fn: () => void) => void;
11
+ excute: (className: string, options?: TurnstileOptions) => void;
11
12
  render: (className: string, options?: TurnstileOptions) => void;
12
13
  }
13
14
 
@@ -22,31 +23,28 @@ interface Turnstile {
22
23
  }
23
24
 
24
25
  export const useTurnstile = (key: string): Turnstile => {
25
- const execute = (action: string): Promise<string> =>
26
- new Promise((resolve) => {
27
- useScriptTag(
28
- 'https://challenges.cloudflare.com/turnstile/v0/api.js',
29
- () => {
30
- const turnstile = window?.turnstile;
31
-
32
- const options: TurnstileOptions = {
33
- sitekey: key,
34
- action,
35
- size: 'compact',
36
- callback(token: string): void {
37
- resolve(token);
38
- },
39
- };
40
-
41
- turnstile?.ready(() =>
42
- turnstile?.render('.wl-captcha-container', options)
43
- );
44
- },
45
- {
46
- async: false,
47
- }
48
- );
26
+ const execute = async (action: string): Promise<string> => {
27
+ const { load } = useScriptTag(
28
+ 'https://challenges.cloudflare.com/turnstile/v0/api.js',
29
+ undefined,
30
+ { async: false }
31
+ );
32
+
33
+ await load();
34
+
35
+ const turnstile = window?.turnstile;
36
+
37
+ return new Promise((resolve) => {
38
+ turnstile?.ready(() => {
39
+ turnstile?.render('.wl-captcha-container', {
40
+ sitekey: key,
41
+ action,
42
+ size: 'compact',
43
+ callback: resolve,
44
+ });
45
+ });
49
46
  });
47
+ };
50
48
 
51
49
  return { execute };
52
50
  };
@@ -5,7 +5,7 @@
5
5
  position: relative;
6
6
  margin-inline-end: 0.75em;
7
7
 
8
- @media (max-width: 720px) {
8
+ @media (width <= 720px) {
9
9
  --avatar-size: var(--waline-m-avatar-size);
10
10
  }
11
11
 
@@ -49,7 +49,7 @@
49
49
  border: var(--waline-border);
50
50
  border-radius: var(--waline-avatar-radius);
51
51
 
52
- @media (max-width: 720px) {
52
+ @media (width <= 720px) {
53
53
  width: var(--waline-m-avatar-size);
54
54
  height: var(--waline-m-avatar-size);
55
55
  }
@@ -92,7 +92,7 @@
92
92
  border-top-left-radius: 0.75em;
93
93
  border-top-right-radius: 0.75em;
94
94
 
95
- @media (max-width: 580px) {
95
+ @media (width <= 580px) {
96
96
  display: block;
97
97
  }
98
98
 
@@ -125,7 +125,7 @@
125
125
  flex: 1;
126
126
 
127
127
  &:not(:last-child) {
128
- @media (max-width: 580px) {
128
+ @media (width <= 580px) {
129
129
  border-bottom: 2px dashed var(--waline-border-color);
130
130
  }
131
131
  }
@@ -137,7 +137,7 @@
137
137
  .wl-header-2 & {
138
138
  width: 50%;
139
139
 
140
- @media (max-width: 580px) {
140
+ @media (width <= 580px) {
141
141
  flex: 0;
142
142
  width: 100%;
143
143
  }
@@ -146,7 +146,7 @@
146
146
  .wl-header-3 & {
147
147
  width: 33.33%;
148
148
 
149
- @media (max-width: 580px) {
149
+ @media (width <= 580px) {
150
150
  width: 100%;
151
151
  }
152
152
  }
@@ -27,7 +27,7 @@
27
27
 
28
28
  list-style-type: none;
29
29
 
30
- @media (max-width: 580px) {
30
+ @media (width <= 580px) {
31
31
  gap: 12px;
32
32
  }
33
33
 
@@ -54,7 +54,7 @@
54
54
  width: 42px;
55
55
  height: 42px;
56
56
 
57
- @media (max-width: 580px) {
57
+ @media (width <= 580px) {
58
58
  width: 32px;
59
59
  height: 32px;
60
60
  }