@waline/client 2.0.0-alpha.4 → 2.0.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/component.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/legacy.d.ts +24 -1
- package/dist/legacy.js +1 -1
- package/dist/legacy.js.map +1 -1
- package/dist/pageview.cjs.js +1 -1
- package/dist/pageview.cjs.js.map +1 -1
- package/dist/pageview.d.ts +18 -12
- package/dist/pageview.esm.js +1 -1
- package/dist/pageview.esm.js.map +1 -1
- package/dist/pageview.js +1 -1
- package/dist/pageview.js.map +1 -1
- package/dist/shim.d.ts +62 -15
- package/dist/shim.esm.d.ts +62 -15
- package/dist/shim.esm.js +1 -1
- package/dist/shim.esm.js.map +1 -1
- package/dist/shim.js +1 -1
- package/dist/shim.js.map +1 -1
- package/dist/waline.cjs.d.ts +62 -15
- package/dist/waline.cjs.js +1 -1
- package/dist/waline.cjs.js.map +1 -1
- package/dist/waline.css +1 -1
- package/dist/waline.css.map +1 -1
- package/dist/waline.d.ts +62 -15
- package/dist/waline.esm.d.ts +62 -15
- package/dist/waline.esm.js +1 -1
- package/dist/waline.esm.js.map +1 -1
- package/dist/waline.js +1 -1
- package/dist/waline.js.map +1 -1
- package/package.json +1 -1
- package/src/comment.ts +25 -2
- package/src/compact/convert.ts +1 -1
- package/src/components/Icons.ts +1 -1
- package/src/components/Waline.vue +18 -18
- package/src/entrys/legacy.ts +1 -1
- package/src/init.ts +27 -2
- package/src/pageview.ts +26 -20
- package/src/styles/emoji.scss +1 -1
- package/src/styles/nomalize.scss +2 -0
- package/src/typings/options.ts +3 -0
package/dist/waline.cjs.d.ts
CHANGED
|
@@ -319,6 +319,7 @@ interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
|
319
319
|
*/
|
|
320
320
|
path?: string;
|
|
321
321
|
}
|
|
322
|
+
declare type WalineAbort = (reson: any) => void;
|
|
322
323
|
|
|
323
324
|
declare const getMeta: (meta: WalineMeta[]) => WalineMeta[];
|
|
324
325
|
declare const defaultLang = "zh-CN";
|
|
@@ -328,49 +329,95 @@ declare const defaultTexRenderer: (blockMode: boolean) => string;
|
|
|
328
329
|
declare type Locales = Record<string, WalineLocale>;
|
|
329
330
|
declare const locales: Locales;
|
|
330
331
|
|
|
331
|
-
interface
|
|
332
|
+
interface WalineCommentCountOptions {
|
|
333
|
+
/**
|
|
334
|
+
* Waline 服务端地址
|
|
335
|
+
*
|
|
336
|
+
* Waline server url
|
|
337
|
+
*/
|
|
332
338
|
serverURL: string;
|
|
339
|
+
/**
|
|
340
|
+
* 评论数 CSS 选择器
|
|
341
|
+
*
|
|
342
|
+
* Commment count CSS selector
|
|
343
|
+
*
|
|
344
|
+
* @default '.waline-comment-count'
|
|
345
|
+
*/
|
|
333
346
|
selector?: string;
|
|
347
|
+
/**
|
|
348
|
+
* 需要获取的默认路径
|
|
349
|
+
*
|
|
350
|
+
* Path to be fetched by default
|
|
351
|
+
*
|
|
352
|
+
* @default window.location.pathname
|
|
353
|
+
*/
|
|
334
354
|
path?: string;
|
|
335
355
|
}
|
|
336
|
-
declare const commentCount: ({ serverURL, path, selector, }:
|
|
356
|
+
declare const commentCount: ({ serverURL, path, selector, }: WalineCommentCountOptions) => WalineAbort;
|
|
337
357
|
|
|
338
358
|
interface WalineInstance {
|
|
359
|
+
/**
|
|
360
|
+
* Waline 被挂载到的元素
|
|
361
|
+
*
|
|
362
|
+
* @description 当通过 `el: null` 初始化,值为 `null`
|
|
363
|
+
*
|
|
364
|
+
* Element where Waline is mounted
|
|
365
|
+
*
|
|
366
|
+
* @description when initialized with `el: null`, it will be `null`
|
|
367
|
+
*/
|
|
339
368
|
el: HTMLElement | null;
|
|
340
|
-
|
|
369
|
+
/**
|
|
370
|
+
* 更新 Waline 实例
|
|
371
|
+
*
|
|
372
|
+
* @description 只要不设置`path` 选项,更新时它就会被重置为 `windows.location.pathname`
|
|
373
|
+
*
|
|
374
|
+
* Update Waline instance
|
|
375
|
+
*
|
|
376
|
+
* @description when not setting `path` option, it will be reset to `window.location.pathname`
|
|
377
|
+
*/
|
|
378
|
+
update: (newOptions: Partial<Omit<WalineInitOptions, 'el'>>) => void;
|
|
379
|
+
/**
|
|
380
|
+
* 取消挂载并摧毁 Waline 实例
|
|
381
|
+
*
|
|
382
|
+
* Unmount and destroy Waline instance
|
|
383
|
+
*/
|
|
341
384
|
destroy: () => void;
|
|
342
385
|
}
|
|
343
386
|
declare const init: ({ el, path, comment, pageview, ...initProps }: WalineInitOptions) => WalineInstance | null;
|
|
344
387
|
|
|
345
|
-
interface
|
|
388
|
+
interface WalinePageviewCountOptions {
|
|
346
389
|
/**
|
|
347
|
-
* Waline server url
|
|
348
|
-
*
|
|
349
390
|
* Waline 服务端地址
|
|
391
|
+
*
|
|
392
|
+
* Waline server url
|
|
350
393
|
*/
|
|
351
394
|
serverURL: string;
|
|
352
395
|
/**
|
|
353
|
-
*
|
|
396
|
+
* 浏览量 CSS 选择器
|
|
354
397
|
*
|
|
355
|
-
*
|
|
398
|
+
* Pageview CSS selector
|
|
356
399
|
*
|
|
357
|
-
* @default window.location.pathname
|
|
358
|
-
*/
|
|
359
|
-
path?: string;
|
|
360
|
-
/**
|
|
361
400
|
* @default '.waline-pageview-count'
|
|
362
401
|
*/
|
|
363
402
|
selector?: string;
|
|
364
403
|
/**
|
|
365
|
-
*
|
|
404
|
+
* 需要更新和获取的路径
|
|
366
405
|
*
|
|
406
|
+
* Path to be fetched and updated
|
|
407
|
+
*
|
|
408
|
+
* @default window.location.pathname
|
|
409
|
+
*/
|
|
410
|
+
path?: string;
|
|
411
|
+
/**
|
|
367
412
|
* 是否在查询时更新 path 的浏览量
|
|
368
413
|
*
|
|
414
|
+
* Whether update pageviews when fetching path result
|
|
415
|
+
*
|
|
369
416
|
* @default true
|
|
370
417
|
*/
|
|
371
418
|
update?: boolean;
|
|
372
419
|
}
|
|
373
|
-
declare const pageviewCount: ({ serverURL, path, selector, update, }:
|
|
420
|
+
declare const pageviewCount: ({ serverURL, path, selector, update, }: WalinePageviewCountOptions) => WalineAbort;
|
|
374
421
|
|
|
375
422
|
declare const version: string;
|
|
376
423
|
|
|
@@ -385,4 +432,4 @@ interface RecentCommentsResult {
|
|
|
385
432
|
}
|
|
386
433
|
declare const RecentComments: ({ el, serverURL, count, }: RecentCommentsOptions) => Promise<RecentCommentsResult>;
|
|
387
434
|
|
|
388
|
-
export {
|
|
435
|
+
export { Locales, RecentComments, RecentCommentsOptions, RecentCommentsResult, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineTexRenderer, commentCount, defaultLang, defaultTexRenderer, defaultUploadImage, getMeta, init, locales, pageviewCount, version };
|