@waline/client 2.14.9 → 2.15.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/api.cjs.map +1 -1
- package/dist/api.d.cts +4 -0
- package/dist/api.d.mts +4 -0
- package/dist/api.d.ts +4 -0
- package/dist/api.mjs.map +1 -1
- package/dist/comment.cjs +1 -1
- package/dist/comment.cjs.map +1 -1
- package/dist/comment.js +1 -1
- package/dist/comment.js.map +1 -1
- package/dist/comment.mjs +1 -1
- package/dist/comment.mjs.map +1 -1
- package/dist/component.mjs +1 -1
- package/dist/component.mjs.map +1 -1
- package/dist/legacy.umd.d.ts +92 -88
- package/dist/legacy.umd.js +1 -1
- package/dist/legacy.umd.js.map +1 -1
- package/dist/pageview.cjs +1 -1
- package/dist/pageview.cjs.map +1 -1
- package/dist/pageview.js +1 -1
- package/dist/pageview.js.map +1 -1
- package/dist/pageview.mjs +1 -1
- package/dist/pageview.mjs.map +1 -1
- package/dist/shim.cjs +1 -1
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +8 -0
- package/dist/shim.d.mts +8 -0
- package/dist/shim.mjs +1 -1
- package/dist/shim.mjs.map +1 -1
- package/dist/waline.cjs +1 -1
- package/dist/waline.cjs.map +1 -1
- package/dist/waline.css.map +1 -1
- package/dist/waline.d.cts +8 -0
- package/dist/waline.d.mts +8 -0
- package/dist/waline.d.ts +8 -0
- package/dist/waline.js +1 -1
- package/dist/waline.js.map +1 -1
- package/dist/waline.mjs +1 -1
- package/dist/waline.mjs.map +1 -1
- package/package.json +18 -27
- package/src/api/articleCounter.ts +1 -2
- package/src/api/comment.ts +10 -3
- package/src/api/commentCount.ts +1 -1
- package/src/api/login.ts +1 -1
- package/src/api/pageview.ts +2 -2
- package/src/api/recentComment.ts +2 -2
- package/src/api/user.ts +6 -3
- package/src/comment.ts +3 -3
- package/src/compact/convert.ts +6 -7
- package/src/compact/v1.ts +5 -5
- package/src/compact/valine.ts +6 -6
- package/src/components/ArticleReaction.vue +3 -4
- package/src/components/CommentBox.vue +56 -43
- package/src/components/CommentCard.vue +8 -7
- package/src/components/Icons.ts +4 -3
- package/src/components/ImageWall.vue +1 -2
- package/src/components/WalineComment.vue +8 -7
- package/src/composables/inputs.ts +1 -2
- package/src/composables/like.ts +1 -2
- package/src/composables/reaction.ts +1 -2
- package/src/composables/recaptchaV3.ts +1 -3
- package/src/composables/turnstile.ts +79 -0
- package/src/composables/userInfo.ts +2 -2
- package/src/config/default.ts +8 -7
- package/src/config/i18n/generate.ts +1 -1
- package/src/config/i18n/index.ts +7 -8
- package/src/entries/legacy.ts +10 -10
- package/src/init.ts +4 -5
- package/src/pageview.ts +3 -4
- package/src/shims-vue.d.ts +2 -1
- package/src/styles/card.scss +3 -3
- package/src/styles/emoji.scss +0 -3
- package/src/styles/index.scss +0 -5
- package/src/typings/comment.ts +5 -0
- package/src/typings/options.ts +1 -1
- package/src/typings/waline.ts +17 -12
- package/src/utils/config.ts +10 -10
- package/src/utils/emoji.ts +3 -3
- package/src/utils/index.ts +12 -11
- package/src/utils/markdown.ts +6 -6
- package/src/utils/markedMathExtension.ts +3 -2
- package/src/utils/userAgent.ts +1 -1
- package/src/utils/wordCount.ts +1 -1
- package/src/widgets/recentComments.ts +4 -5
package/dist/legacy.umd.d.ts
CHANGED
|
@@ -371,6 +371,10 @@ interface WalineProps {
|
|
|
371
371
|
* recaptcha v3 client key
|
|
372
372
|
*/
|
|
373
373
|
recaptchaV3Key?: string;
|
|
374
|
+
/**
|
|
375
|
+
* turnstile client key
|
|
376
|
+
*/
|
|
377
|
+
turnstileKey?: string;
|
|
374
378
|
/**
|
|
375
379
|
* reaction
|
|
376
380
|
*/
|
|
@@ -414,33 +418,93 @@ interface WalineInitOptions extends Omit<WalineProps, 'path'> {
|
|
|
414
418
|
path?: string;
|
|
415
419
|
}
|
|
416
420
|
|
|
417
|
-
interface
|
|
421
|
+
interface DeprecatedWalineOptions {
|
|
418
422
|
/**
|
|
419
|
-
*
|
|
423
|
+
* @deprecated Please use mathjax in server, dropped in V2
|
|
420
424
|
*
|
|
421
|
-
*
|
|
425
|
+
* 是否注入额外的样式添加对 `<math>` 块的兼容
|
|
422
426
|
*
|
|
423
|
-
*
|
|
427
|
+
* Whether injecting additional styles to support math block
|
|
424
428
|
*
|
|
425
|
-
* @
|
|
429
|
+
* @default false
|
|
426
430
|
*/
|
|
427
|
-
|
|
431
|
+
mathTagSupport?: boolean;
|
|
428
432
|
/**
|
|
429
|
-
*
|
|
433
|
+
* @deprecated use `pageview` instead, dropped in V2
|
|
430
434
|
*
|
|
431
|
-
*
|
|
435
|
+
* 文章访问量统计
|
|
432
436
|
*
|
|
433
|
-
*
|
|
437
|
+
* Article reading statistics
|
|
434
438
|
*
|
|
435
|
-
* @
|
|
439
|
+
* @default false
|
|
436
440
|
*/
|
|
437
|
-
|
|
441
|
+
visitor?: boolean;
|
|
438
442
|
/**
|
|
439
|
-
*
|
|
443
|
+
* @deprecated use `highlighter` instead, dropped in V2
|
|
440
444
|
*
|
|
441
|
-
*
|
|
445
|
+
* 代码高亮
|
|
446
|
+
*
|
|
447
|
+
* Code highlighting
|
|
442
448
|
*/
|
|
443
|
-
|
|
449
|
+
highlight?: WalineHighlighter | false;
|
|
450
|
+
/**
|
|
451
|
+
* @deprecated use `imageUploader` instead, dropped in V2
|
|
452
|
+
*
|
|
453
|
+
* 自定义图片上传方法,方便更好的存储图片
|
|
454
|
+
*
|
|
455
|
+
* 方法执行时会将图片对象传入。
|
|
456
|
+
*
|
|
457
|
+
* Custom image upload callback to manage picture by yourself.
|
|
458
|
+
*
|
|
459
|
+
* We will pass a picture file object when execute it.
|
|
460
|
+
*/
|
|
461
|
+
uploadImage?: WalineImageUploader | false;
|
|
462
|
+
/**
|
|
463
|
+
* @deprecated Use `login` instead, dropped in V2
|
|
464
|
+
*
|
|
465
|
+
* 是否允许登录评论
|
|
466
|
+
*
|
|
467
|
+
* 默认情况是两者都支持,设置为 `true` 表示仅支持匿名评论,`false` 表示仅支持登录评论。
|
|
468
|
+
*
|
|
469
|
+
* Whether to allow login comments.
|
|
470
|
+
*
|
|
471
|
+
* Both supported by default, set to `true` means only support anonymous comments, `false` means only support login comments.
|
|
472
|
+
*
|
|
473
|
+
* @default undefined
|
|
474
|
+
*/
|
|
475
|
+
anonymous?: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated Please use `AVATAR_PROXY` in server, dropped in V2
|
|
478
|
+
*
|
|
479
|
+
* 设置 Gravatar 头像 CDN 地址
|
|
480
|
+
*
|
|
481
|
+
* Gravatar CDN baseURL
|
|
482
|
+
*
|
|
483
|
+
* @default 'https://www.gravatar.com/avatar'
|
|
484
|
+
*/
|
|
485
|
+
avatarCDN?: string;
|
|
486
|
+
/**
|
|
487
|
+
* @deprecated Use `texRenderer` instead, dropped in V2
|
|
488
|
+
*
|
|
489
|
+
* 自定义 Tex 处理方法,用于预览。
|
|
490
|
+
*
|
|
491
|
+
* Custom math formula parse callback for preview.
|
|
492
|
+
*/
|
|
493
|
+
previewMath?: WalineTexRenderer | false;
|
|
494
|
+
/**
|
|
495
|
+
* @deprecated use `copyright` instead, dropped in V2
|
|
496
|
+
*
|
|
497
|
+
* 是否在页脚展示版权信息
|
|
498
|
+
*
|
|
499
|
+
* 为了支持 Waline,我们强烈建议你开启它
|
|
500
|
+
*
|
|
501
|
+
* Whether show copyright in footer
|
|
502
|
+
*
|
|
503
|
+
* We strongly recommended you to keep it on to support waline
|
|
504
|
+
*
|
|
505
|
+
* @default true
|
|
506
|
+
*/
|
|
507
|
+
copyRight?: boolean;
|
|
444
508
|
}
|
|
445
509
|
|
|
446
510
|
type DeprecatedAvatar = '' | 'mp' | 'identicon' | 'monsterid' | 'wavatar' | 'retro' | 'robohash' | 'hide';
|
|
@@ -530,93 +594,33 @@ interface DeprecatedValineOptions {
|
|
|
530
594
|
emojiMaps?: DeprecatedEmojiMaps;
|
|
531
595
|
}
|
|
532
596
|
|
|
533
|
-
interface
|
|
534
|
-
/**
|
|
535
|
-
* @deprecated Please use mathjax in server, dropped in V2
|
|
536
|
-
*
|
|
537
|
-
* 是否注入额外的样式添加对 `<math>` 块的兼容
|
|
538
|
-
*
|
|
539
|
-
* Whether injecting additional styles to support math block
|
|
540
|
-
*
|
|
541
|
-
* @default false
|
|
542
|
-
*/
|
|
543
|
-
mathTagSupport?: boolean;
|
|
544
|
-
/**
|
|
545
|
-
* @deprecated use `pageview` instead, dropped in V2
|
|
546
|
-
*
|
|
547
|
-
* 文章访问量统计
|
|
548
|
-
*
|
|
549
|
-
* Article reading statistics
|
|
550
|
-
*
|
|
551
|
-
* @default false
|
|
552
|
-
*/
|
|
553
|
-
visitor?: boolean;
|
|
554
|
-
/**
|
|
555
|
-
* @deprecated use `highlighter` instead, dropped in V2
|
|
556
|
-
*
|
|
557
|
-
* 代码高亮
|
|
558
|
-
*
|
|
559
|
-
* Code highlighting
|
|
560
|
-
*/
|
|
561
|
-
highlight?: WalineHighlighter | false;
|
|
562
|
-
/**
|
|
563
|
-
* @deprecated use `imageUploader` instead, dropped in V2
|
|
564
|
-
*
|
|
565
|
-
* 自定义图片上传方法,方便更好的存储图片
|
|
566
|
-
*
|
|
567
|
-
* 方法执行时会将图片对象传入。
|
|
568
|
-
*
|
|
569
|
-
* Custom image upload callback to manage picture by yourself.
|
|
570
|
-
*
|
|
571
|
-
* We will pass a picture file object when execute it.
|
|
572
|
-
*/
|
|
573
|
-
uploadImage?: WalineImageUploader | false;
|
|
597
|
+
interface WalineInstance {
|
|
574
598
|
/**
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
* 是否允许登录评论
|
|
578
|
-
*
|
|
579
|
-
* 默认情况是两者都支持,设置为 `true` 表示仅支持匿名评论,`false` 表示仅支持登录评论。
|
|
599
|
+
* Waline 被挂载到的元素
|
|
580
600
|
*
|
|
581
|
-
*
|
|
601
|
+
* @description 当通过 `el: null` 初始化,值为 `null`
|
|
582
602
|
*
|
|
583
|
-
*
|
|
603
|
+
* Element where Waline is mounted
|
|
584
604
|
*
|
|
585
|
-
* @
|
|
605
|
+
* @description when initialized with `el: null`, it will be `null`
|
|
586
606
|
*/
|
|
587
|
-
|
|
607
|
+
el: HTMLElement | null;
|
|
588
608
|
/**
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
* 设置 Gravatar 头像 CDN 地址
|
|
592
|
-
*
|
|
593
|
-
* Gravatar CDN baseURL
|
|
609
|
+
* 更新 Waline 实例
|
|
594
610
|
*
|
|
595
|
-
* @
|
|
596
|
-
*/
|
|
597
|
-
avatarCDN?: string;
|
|
598
|
-
/**
|
|
599
|
-
* @deprecated Use `texRenderer` instead, dropped in V2
|
|
611
|
+
* @description 只要不设置`path` 选项,更新时它就会被重置为 `windows.location.pathname`
|
|
600
612
|
*
|
|
601
|
-
*
|
|
613
|
+
* Update Waline instance
|
|
602
614
|
*
|
|
603
|
-
*
|
|
615
|
+
* @description when not setting `path` option, it will be reset to `window.location.pathname`
|
|
604
616
|
*/
|
|
605
|
-
|
|
617
|
+
update: (newOptions?: Partial<Omit<WalineInitOptions, 'el'>>) => void;
|
|
606
618
|
/**
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
* 是否在页脚展示版权信息
|
|
610
|
-
*
|
|
611
|
-
* 为了支持 Waline,我们强烈建议你开启它
|
|
612
|
-
*
|
|
613
|
-
* Whether show copyright in footer
|
|
614
|
-
*
|
|
615
|
-
* We strongly recommended you to keep it on to support waline
|
|
619
|
+
* 取消挂载并摧毁 Waline 实例
|
|
616
620
|
*
|
|
617
|
-
*
|
|
621
|
+
* Unmount and destroy Waline instance
|
|
618
622
|
*/
|
|
619
|
-
|
|
623
|
+
destroy: () => void;
|
|
620
624
|
}
|
|
621
625
|
|
|
622
626
|
declare function legacyWaline(options: WalineInitOptions & DeprecatedValineOptions & DeprecatedWalineOptions): WalineInstance | null;
|