artalk 2.3.1 → 2.3.2

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/src/lib/ui.ts CHANGED
@@ -2,7 +2,8 @@ import * as Utils from './utils'
2
2
 
3
3
  /** 显示加载 */
4
4
  export function showLoading(parentElem: HTMLElement, conf?: { transparentBg?: boolean }) {
5
- let $loading = parentElem.querySelector<HTMLElement>('.atk-loading')
5
+ // Use :scope https://developer.mozilla.org/en-US/docs/Web/CSS/:scope
6
+ let $loading = parentElem.querySelector<HTMLElement>(':scope > .atk-loading')
6
7
  if (!$loading) {
7
8
  $loading = Utils.createElement(
8
9
  `<div class="atk-loading atk-fade-in" style="display: none;">
@@ -27,7 +28,7 @@ export function showLoading(parentElem: HTMLElement, conf?: { transparentBg?: bo
27
28
 
28
29
  /** 隐藏加载 */
29
30
  export function hideLoading(parentElem: HTMLElement) {
30
- const $loading = parentElem.querySelector<HTMLElement>('.atk-loading')
31
+ const $loading = parentElem.querySelector<HTMLElement>(':scope > .atk-loading')
31
32
  if ($loading) $loading.style.display = 'none'
32
33
  }
33
34
 
@@ -98,7 +98,7 @@ export default interface ArtalkConfig {
98
98
  imgUpload: boolean
99
99
 
100
100
  /** 图片上传器 */
101
- imgUploader?: (file: File) => Promise<{ img_url: string }>
101
+ imgUploader?: (file: File) => Promise<string>
102
102
 
103
103
  /** 版本检测 */
104
104
  versionCheck: boolean