hexo-component-inferno 2.0.0 → 2.0.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/lib/core/migrate.js +10 -28
- package/lib/core/migrate.test.js +10 -12
- package/lib/core/schema.js +33 -109
- package/lib/core/schema.test.js +2 -6
- package/lib/core/view.js +3 -10
- package/lib/core/view.test.js +0 -7
- package/lib/hexo/filter/locals.js +3 -18
- package/lib/hexo/filter/locals.test.js +2 -19
- package/lib/hexo/generator/assets.js +2 -8
- package/lib/hexo/generator/assets.test.js +0 -4
- package/lib/hexo/generator/categories.test.js +0 -3
- package/lib/hexo/generator/category.js +1 -6
- package/lib/hexo/generator/category.test.js +0 -5
- package/lib/hexo/generator/insight.js +1 -9
- package/lib/hexo/generator/insight.test.js +0 -3
- package/lib/hexo/generator/manifest.js +0 -3
- package/lib/hexo/generator/manifest.test.js +0 -3
- package/lib/hexo/generator/tags.test.js +0 -3
- package/lib/hexo/helper/cdn.js +6 -19
- package/lib/hexo/helper/cdn.test.js +0 -3
- package/lib/hexo/helper/page.test.js +0 -3
- package/lib/hexo/tag/message.js +0 -8
- package/lib/hexo/tag/message.test.js +0 -7
- package/lib/hexo/tag/tabs.js +17 -48
- package/lib/hexo/tag/tabs.test.js +0 -8
- package/lib/util/cache.js +0 -11
- package/lib/util/cache.test.js +0 -4
- package/lib/util/classname.js +0 -3
- package/lib/util/classname.test.js +0 -1
- package/lib/util/yaml.js +2 -7
- package/lib/util/yaml.test.js +0 -4
- package/lib/view/comment/changyan.js +12 -31
- package/lib/view/comment/disqus.js +11 -32
- package/lib/view/comment/disqusjs.js +22 -43
- package/lib/view/comment/facebook.js +9 -28
- package/lib/view/comment/gitalk.js +28 -49
- package/lib/view/comment/gitment.js +15 -37
- package/lib/view/comment/isso.js +6 -27
- package/lib/view/comment/livere.js +6 -27
- package/lib/view/comment/twikoo.js +14 -33
- package/lib/view/comment/utterances.js +17 -45
- package/lib/view/comment/valine.js +39 -60
- package/lib/view/comment/waline.js +45 -66
- package/lib/view/common/article_media.js +11 -28
- package/lib/view/donate/afdian.js +9 -30
- package/lib/view/donate/alipay.js +9 -30
- package/lib/view/donate/buymeacoffee.js +9 -30
- package/lib/view/donate/patreon.js +9 -30
- package/lib/view/donate/paypal.js +10 -31
- package/lib/view/donate/wechat.js +9 -30
- package/lib/view/misc/article_licensing.js +21 -43
- package/lib/view/misc/meta.js +7 -34
- package/lib/view/misc/open_graph.js +25 -67
- package/lib/view/misc/paginator.js +12 -36
- package/lib/view/misc/structured_data.js +16 -43
- package/lib/view/misc/web_app.js +15 -49
- package/lib/view/plugin/baidu_analytics.js +7 -28
- package/lib/view/plugin/bing_webmaster.js +7 -28
- package/lib/view/plugin/busuanzi.js +6 -26
- package/lib/view/plugin/cnzz.js +9 -30
- package/lib/view/plugin/cookie_consent.js +28 -49
- package/lib/view/plugin/gallery.js +10 -31
- package/lib/view/plugin/google_analytics.js +7 -28
- package/lib/view/plugin/hotjar.js +7 -28
- package/lib/view/plugin/katex.js +11 -32
- package/lib/view/plugin/mathjax.js +7 -28
- package/lib/view/plugin/outdated_browser.js +10 -31
- package/lib/view/plugin/progressbar.js +7 -28
- package/lib/view/plugin/statcounter.js +10 -31
- package/lib/view/plugin/twitter_conversion_tracking.js +7 -28
- package/lib/view/search/algolia.js +14 -35
- package/lib/view/search/baidu.js +9 -28
- package/lib/view/search/google_cse.js +10 -30
- package/lib/view/search/insight.js +9 -28
- package/lib/view/share/addthis.js +6 -27
- package/lib/view/share/addtoany.js +6 -25
- package/lib/view/share/bdshare.js +6 -25
- package/lib/view/share/sharejs.js +8 -27
- package/lib/view/share/sharethis.js +6 -27
- package/lib/view/widget/adsense.js +11 -32
- package/lib/view/widget/archives.js +24 -51
- package/lib/view/widget/categories.js +23 -57
- package/lib/view/widget/followit.js +12 -31
- package/lib/view/widget/links.js +10 -32
- package/lib/view/widget/recent_posts.js +14 -36
- package/lib/view/widget/subscribe_email.js +12 -31
- package/lib/view/widget/tags.js +16 -39
- package/lib/view/widget/toc.js +26 -66
- package/package.json +1 -1
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* LiveRe comment JSX component.
|
|
29
19
|
* @module view/comment/livere
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* LiveRe comment JSX component.
|
|
38
28
|
*
|
|
@@ -40,28 +30,20 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <LiveRe uid="******" />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var LiveRe = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(LiveRe, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(LiveRe);
|
|
49
|
-
|
|
50
36
|
function LiveRe() {
|
|
51
37
|
_classCallCheck(this, LiveRe);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(LiveRe, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
59
43
|
var uid = this.props.uid;
|
|
60
|
-
|
|
61
44
|
if (!uid) {
|
|
62
45
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "uid", 16), (0, _inferno.createTextVNode)(" for LiveRe. Please set it in"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
63
46
|
}
|
|
64
|
-
|
|
65
47
|
var js = "(function(d, s) {\n var j, e = d.getElementsByTagName(s)[0];\n\n if (typeof LivereTower === 'function') { return; }\n\n j = d.createElement(s);\n j.src = 'https://cdn-city.livere.com/js/embed.dist.js';\n j.async = true;\n\n e.parentNode.insertBefore(j, e);\n })(document, 'script');";
|
|
66
48
|
return (0, _inferno.createVNode)(1, "div", null, [(0, _inferno.createVNode)(1, "script", null, null, 1, {
|
|
67
49
|
"dangerouslySetInnerHTML": {
|
|
@@ -74,7 +56,6 @@ var LiveRe = /*#__PURE__*/function (_Component) {
|
|
|
74
56
|
});
|
|
75
57
|
}
|
|
76
58
|
}]);
|
|
77
|
-
|
|
78
59
|
return LiveRe;
|
|
79
60
|
}(Component);
|
|
80
61
|
/**
|
|
@@ -87,8 +68,6 @@ var LiveRe = /*#__PURE__*/function (_Component) {
|
|
|
87
68
|
* @example
|
|
88
69
|
* <LiveRe.Cacheable comment={{ uid: '******' }} />
|
|
89
70
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
71
|
LiveRe.Cacheable = cacheComponent(LiveRe, 'comment.livere', function (props) {
|
|
93
72
|
var comment = props.comment;
|
|
94
73
|
return {
|
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Twikoo comment JSX component.
|
|
29
19
|
* @module view/comment/twikoo
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
Component = _require.Component,
|
|
23
|
+
Fragment = _require.Fragment;
|
|
35
24
|
var _require2 = require('../../util/cache'),
|
|
36
|
-
|
|
25
|
+
cacheComponent = _require2.cacheComponent;
|
|
26
|
+
|
|
37
27
|
/**
|
|
38
28
|
* Twikoo comment JSX component.
|
|
39
29
|
*
|
|
@@ -45,27 +35,21 @@ var _require2 = require('../../util/cache'),
|
|
|
45
35
|
* lang="zh-CN"
|
|
46
36
|
* jsUrl="/path/to/Twikoo.js" />
|
|
47
37
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
38
|
var Twikoo = /*#__PURE__*/function (_Component) {
|
|
51
39
|
_inherits(Twikoo, _Component);
|
|
52
|
-
|
|
53
40
|
var _super = _createSuper(Twikoo);
|
|
54
|
-
|
|
55
41
|
function Twikoo() {
|
|
56
42
|
_classCallCheck(this, Twikoo);
|
|
57
|
-
|
|
58
43
|
return _super.apply(this, arguments);
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
_createClass(Twikoo, [{
|
|
62
46
|
key: "render",
|
|
63
47
|
value: function render() {
|
|
64
48
|
var _this$props = this.props,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
envId = _this$props.envId,
|
|
50
|
+
region = _this$props.region,
|
|
51
|
+
lang = _this$props.lang,
|
|
52
|
+
jsUrl = _this$props.jsUrl;
|
|
69
53
|
var js = "twikoo.init({\n envId: '".concat(envId, "',\n ").concat(region ? "region: ".concat(JSON.stringify(region), ",") : '', "\n ").concat(lang ? "lang: ".concat(JSON.stringify(lang), ",") : '', "\n });");
|
|
70
54
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", "content twikoo", null, 1, {
|
|
71
55
|
"id": "twikoo"
|
|
@@ -78,7 +62,6 @@ var Twikoo = /*#__PURE__*/function (_Component) {
|
|
|
78
62
|
})], 4);
|
|
79
63
|
}
|
|
80
64
|
}]);
|
|
81
|
-
|
|
82
65
|
return Twikoo;
|
|
83
66
|
}(Component);
|
|
84
67
|
/**
|
|
@@ -96,13 +79,11 @@ var Twikoo = /*#__PURE__*/function (_Component) {
|
|
|
96
79
|
* lang: "zh-CN",
|
|
97
80
|
* }} />
|
|
98
81
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
82
|
Twikoo.Cacheable = cacheComponent(Twikoo, 'comment.twikoo', function (props) {
|
|
102
83
|
var comment = props.comment,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
helper = props.helper,
|
|
85
|
+
page = props.page,
|
|
86
|
+
config = props.config;
|
|
106
87
|
return {
|
|
107
88
|
envId: comment.env_id,
|
|
108
89
|
region: comment.region,
|
|
@@ -1,44 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
-
|
|
9
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
|
|
11
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
|
|
15
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
16
|
-
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
-
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
20
|
-
|
|
21
14
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
-
|
|
23
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
24
|
-
|
|
25
16
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
26
|
-
|
|
27
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
-
|
|
29
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
-
|
|
31
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
|
|
33
20
|
/**
|
|
34
21
|
* Utterances comment JSX component.
|
|
35
22
|
* @module view/comment/utterances
|
|
36
23
|
*/
|
|
37
24
|
var _require = require('inferno'),
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
Component = _require.Component;
|
|
40
26
|
var _require2 = require('../../util/cache'),
|
|
41
|
-
|
|
27
|
+
cacheComponent = _require2.cacheComponent;
|
|
28
|
+
|
|
42
29
|
/**
|
|
43
30
|
* Utterances comment JSX component.
|
|
44
31
|
*
|
|
@@ -51,51 +38,39 @@ var _require2 = require('../../util/cache'),
|
|
|
51
38
|
* label="******"
|
|
52
39
|
* theme="******" />
|
|
53
40
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
41
|
var Utterances = /*#__PURE__*/function (_Component) {
|
|
57
42
|
_inherits(Utterances, _Component);
|
|
58
|
-
|
|
59
43
|
var _super = _createSuper(Utterances);
|
|
60
|
-
|
|
61
44
|
function Utterances() {
|
|
62
45
|
_classCallCheck(this, Utterances);
|
|
63
|
-
|
|
64
46
|
return _super.apply(this, arguments);
|
|
65
47
|
}
|
|
66
|
-
|
|
67
48
|
_createClass(Utterances, [{
|
|
68
49
|
key: "render",
|
|
69
50
|
value: function render() {
|
|
70
51
|
var _this$props = this.props,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
repo = _this$props.repo,
|
|
53
|
+
issueTerm = _this$props.issueTerm,
|
|
54
|
+
issueNumber = _this$props.issueNumber,
|
|
55
|
+
label = _this$props.label,
|
|
56
|
+
theme = _this$props.theme;
|
|
77
57
|
if (!repo || !issueTerm && !issueNumber) {
|
|
78
58
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "repo", 16), (0, _inferno.createTextVNode)(", "), (0, _inferno.createVNode)(1, "code", null, "issue_term", 16), (0, _inferno.createTextVNode)(", or"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "issue_number", 16), (0, _inferno.createTextVNode)(" for Utterances. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
79
59
|
}
|
|
80
|
-
|
|
81
60
|
var config = {
|
|
82
61
|
repo: repo
|
|
83
62
|
};
|
|
84
|
-
|
|
85
63
|
if (issueTerm) {
|
|
86
64
|
config['issue-term'] = issueTerm;
|
|
87
65
|
} else {
|
|
88
66
|
config['issue-number'] = issueNumber;
|
|
89
67
|
}
|
|
90
|
-
|
|
91
68
|
if (label) {
|
|
92
69
|
config.label = label;
|
|
93
70
|
}
|
|
94
|
-
|
|
95
71
|
if (theme) {
|
|
96
72
|
config.theme = theme;
|
|
97
73
|
}
|
|
98
|
-
|
|
99
74
|
return (0, _inferno.normalizeProps)((0, _inferno.createVNode)(1, "script", null, null, 1, _objectSpread(_objectSpread({
|
|
100
75
|
"src": "https://utteranc.es/client.js"
|
|
101
76
|
}, config), {}, {
|
|
@@ -104,7 +79,6 @@ var Utterances = /*#__PURE__*/function (_Component) {
|
|
|
104
79
|
})));
|
|
105
80
|
}
|
|
106
81
|
}]);
|
|
107
|
-
|
|
108
82
|
return Utterances;
|
|
109
83
|
}(Component);
|
|
110
84
|
/**
|
|
@@ -124,15 +98,13 @@ var Utterances = /*#__PURE__*/function (_Component) {
|
|
|
124
98
|
* theme: "******"
|
|
125
99
|
* }} />
|
|
126
100
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
101
|
Utterances.Cacheable = cacheComponent(Utterances, 'comment.utterances', function (props) {
|
|
130
102
|
var _props$comment = props.comment,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
103
|
+
repo = _props$comment.repo,
|
|
104
|
+
issue_term = _props$comment.issue_term,
|
|
105
|
+
issue_number = _props$comment.issue_number,
|
|
106
|
+
label = _props$comment.label,
|
|
107
|
+
theme = _props$comment.theme;
|
|
136
108
|
return {
|
|
137
109
|
repo: repo,
|
|
138
110
|
issueTerm: issue_term,
|
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Valine comment JSX component.
|
|
29
19
|
* @module view/comment/valine
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* Valine comment JSX component.
|
|
38
28
|
*
|
|
@@ -57,58 +47,50 @@ var _require2 = require('../../util/cache'),
|
|
|
57
47
|
* requiredFields={[]}
|
|
58
48
|
* jsUrl="/path/to/Valine.js" />
|
|
59
49
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
50
|
var Valine = /*#__PURE__*/function (_Component) {
|
|
63
51
|
_inherits(Valine, _Component);
|
|
64
|
-
|
|
65
52
|
var _super = _createSuper(Valine);
|
|
66
|
-
|
|
67
53
|
function Valine() {
|
|
68
54
|
_classCallCheck(this, Valine);
|
|
69
|
-
|
|
70
55
|
return _super.apply(this, arguments);
|
|
71
56
|
}
|
|
72
|
-
|
|
73
57
|
_createClass(Valine, [{
|
|
74
58
|
key: "render",
|
|
75
59
|
value: function render() {
|
|
76
60
|
var _this$props = this.props,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
61
|
+
appId = _this$props.appId,
|
|
62
|
+
appKey = _this$props.appKey,
|
|
63
|
+
placeholder = _this$props.placeholder,
|
|
64
|
+
_this$props$avatar = _this$props.avatar,
|
|
65
|
+
avatar = _this$props$avatar === void 0 ? 'mm' : _this$props$avatar,
|
|
66
|
+
_this$props$avatarFor = _this$props.avatarForce,
|
|
67
|
+
avatarForce = _this$props$avatarFor === void 0 ? false : _this$props$avatarFor,
|
|
68
|
+
_this$props$meta = _this$props.meta,
|
|
69
|
+
meta = _this$props$meta === void 0 ? ['nick', 'mail', 'link'] : _this$props$meta,
|
|
70
|
+
_this$props$pageSize = _this$props.pageSize,
|
|
71
|
+
pageSize = _this$props$pageSize === void 0 ? 10 : _this$props$pageSize,
|
|
72
|
+
_this$props$lang = _this$props.lang,
|
|
73
|
+
lang = _this$props$lang === void 0 ? 'zh-CN' : _this$props$lang,
|
|
74
|
+
_this$props$visitor = _this$props.visitor,
|
|
75
|
+
visitor = _this$props$visitor === void 0 ? false : _this$props$visitor,
|
|
76
|
+
_this$props$highlight = _this$props.highlight,
|
|
77
|
+
highlight = _this$props$highlight === void 0 ? true : _this$props$highlight,
|
|
78
|
+
_this$props$recordIP = _this$props.recordIP,
|
|
79
|
+
recordIP = _this$props$recordIP === void 0 ? false : _this$props$recordIP,
|
|
80
|
+
_this$props$serverURL = _this$props.serverURLs,
|
|
81
|
+
serverURLs = _this$props$serverURL === void 0 ? '' : _this$props$serverURL,
|
|
82
|
+
_this$props$emojiCDN = _this$props.emojiCDN,
|
|
83
|
+
emojiCDN = _this$props$emojiCDN === void 0 ? '' : _this$props$emojiCDN,
|
|
84
|
+
_this$props$emojiMaps = _this$props.emojiMaps,
|
|
85
|
+
emojiMaps = _this$props$emojiMaps === void 0 ? null : _this$props$emojiMaps,
|
|
86
|
+
_this$props$enableQQ = _this$props.enableQQ,
|
|
87
|
+
enableQQ = _this$props$enableQQ === void 0 ? false : _this$props$enableQQ,
|
|
88
|
+
_this$props$requiredF = _this$props.requiredFields,
|
|
89
|
+
fields = _this$props$requiredF === void 0 ? [] : _this$props$requiredF,
|
|
90
|
+
jsUrl = _this$props.jsUrl;
|
|
108
91
|
if (!appId || !appKey) {
|
|
109
92
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "app_id", 16), (0, _inferno.createTextVNode)(" or "), (0, _inferno.createVNode)(1, "code", null, "app_key", 16), (0, _inferno.createTextVNode)(" for Valine. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 4);
|
|
110
93
|
}
|
|
111
|
-
|
|
112
94
|
var js = "new Valine({\n el: '#valine-thread',\n appId: ".concat(JSON.stringify(appId), ",\n appKey: ").concat(JSON.stringify(appKey), ",\n ").concat(placeholder ? "placeholder: ".concat(JSON.stringify(placeholder), ",") : '', "\n ").concat(avatar ? "avatar: ".concat(JSON.stringify(avatar), ",") : '', "\n ", "avatarForce: ".concat(JSON.stringify(avatarForce), ","), "\n ").concat(meta ? "meta: ".concat(JSON.stringify(meta), ",") : '', "\n ").concat(pageSize ? "pageSize: ".concat(JSON.stringify(pageSize), ",") : '', "\n ").concat(lang ? "lang: ".concat(JSON.stringify(lang), ",") : '', "\n ", "visitor: ".concat(JSON.stringify(visitor), ","), "\n ", "highlight: ".concat(JSON.stringify(highlight), ","), "\n ", "recordIP: ".concat(JSON.stringify(recordIP), ","), "\n ").concat(serverURLs ? "serverURLs: ".concat(JSON.stringify(serverURLs), ",") : '', "\n ").concat(emojiCDN ? "emojiCDN: ".concat(JSON.stringify(emojiCDN), ",") : '', "\n ").concat(emojiMaps ? "emojiMaps: ".concat(JSON.stringify(emojiMaps), ",") : '', "\n ", "enableQQ: ".concat(JSON.stringify(enableQQ), ","), "\n ").concat(Array.isArray(fields) ? "requiredFields: ".concat(JSON.stringify(fields), ",") : '', "\n });");
|
|
113
95
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", "content", null, 1, {
|
|
114
96
|
"id": "valine-thread"
|
|
@@ -123,7 +105,6 @@ var Valine = /*#__PURE__*/function (_Component) {
|
|
|
123
105
|
})], 4);
|
|
124
106
|
}
|
|
125
107
|
}]);
|
|
126
|
-
|
|
127
108
|
return Valine;
|
|
128
109
|
}(Component);
|
|
129
110
|
/**
|
|
@@ -155,13 +136,11 @@ var Valine = /*#__PURE__*/function (_Component) {
|
|
|
155
136
|
* }}
|
|
156
137
|
* helper={{ cdn: function() {...} }} />
|
|
157
138
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
139
|
Valine.Cacheable = cacheComponent(Valine, 'comment.valine', function (props) {
|
|
161
140
|
var comment = props.comment,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
141
|
+
helper = props.helper,
|
|
142
|
+
page = props.page,
|
|
143
|
+
config = props.config;
|
|
165
144
|
return {
|
|
166
145
|
appId: comment.app_id,
|
|
167
146
|
appKey: comment.app_key,
|