hexo-component-inferno 2.0.1 → 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 +3 -35
- 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
|
* Patreon donation JSX component.
|
|
29
19
|
* @module view/donate/patreon
|
|
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
|
* Patreon donation JSX component.
|
|
38
28
|
*
|
|
@@ -41,30 +31,22 @@ var _require2 = require('../../util/cache'),
|
|
|
41
31
|
* title="******"
|
|
42
32
|
* url="/path/to/patreon/page" />
|
|
43
33
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
34
|
var Patreon = /*#__PURE__*/function (_Component) {
|
|
47
35
|
_inherits(Patreon, _Component);
|
|
48
|
-
|
|
49
36
|
var _super = _createSuper(Patreon);
|
|
50
|
-
|
|
51
37
|
function Patreon() {
|
|
52
38
|
_classCallCheck(this, Patreon);
|
|
53
|
-
|
|
54
39
|
return _super.apply(this, arguments);
|
|
55
40
|
}
|
|
56
|
-
|
|
57
41
|
_createClass(Patreon, [{
|
|
58
42
|
key: "render",
|
|
59
43
|
value: function render() {
|
|
60
44
|
var _this$props = this.props,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
title = _this$props.title,
|
|
46
|
+
url = _this$props.url;
|
|
64
47
|
if (!url) {
|
|
65
48
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "url", 16), (0, _inferno.createTextVNode)(" for Patreon. Please set it in"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
66
49
|
}
|
|
67
|
-
|
|
68
50
|
return (0, _inferno.createVNode)(1, "a", "button donate", [(0, _inferno.createVNode)(1, "span", "icon is-small", (0, _inferno.createVNode)(1, "i", "fab fa-patreon"), 2), (0, _inferno.createVNode)(1, "span", null, title, 0)], 4, {
|
|
69
51
|
"href": url,
|
|
70
52
|
"target": "_blank",
|
|
@@ -73,7 +55,6 @@ var Patreon = /*#__PURE__*/function (_Component) {
|
|
|
73
55
|
});
|
|
74
56
|
}
|
|
75
57
|
}]);
|
|
76
|
-
|
|
77
58
|
return Patreon;
|
|
78
59
|
}(Component);
|
|
79
60
|
/**
|
|
@@ -91,11 +72,9 @@ var Patreon = /*#__PURE__*/function (_Component) {
|
|
|
91
72
|
* url_for: function() {...}
|
|
92
73
|
* }} />
|
|
93
74
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
75
|
Patreon.Cacheable = cacheComponent(Patreon, 'donate.petreon', function (props) {
|
|
97
76
|
var donate = props.donate,
|
|
98
|
-
|
|
77
|
+
helper = props.helper;
|
|
99
78
|
return {
|
|
100
79
|
url: helper.url_for(donate.url),
|
|
101
80
|
title: helper.__('donate.' + donate.type)
|
|
@@ -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
|
* Paypal donation JSX component.
|
|
29
19
|
* @module view/donate/paypal
|
|
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
|
* Paypal donation JSX component.
|
|
38
28
|
*
|
|
@@ -43,31 +33,23 @@ var _require2 = require('../../util/cache'),
|
|
|
43
33
|
* business="******"
|
|
44
34
|
* currencyCode="******" />
|
|
45
35
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
36
|
var Paypal = /*#__PURE__*/function (_Component) {
|
|
49
37
|
_inherits(Paypal, _Component);
|
|
50
|
-
|
|
51
38
|
var _super = _createSuper(Paypal);
|
|
52
|
-
|
|
53
39
|
function Paypal() {
|
|
54
40
|
_classCallCheck(this, Paypal);
|
|
55
|
-
|
|
56
41
|
return _super.apply(this, arguments);
|
|
57
42
|
}
|
|
58
|
-
|
|
59
43
|
_createClass(Paypal, [{
|
|
60
44
|
key: "render",
|
|
61
45
|
value: function render() {
|
|
62
46
|
var _this$props = this.props,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
title = _this$props.title,
|
|
48
|
+
business = _this$props.business,
|
|
49
|
+
currencyCode = _this$props.currencyCode;
|
|
67
50
|
if (!business || !currencyCode) {
|
|
68
51
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "business", 16), (0, _inferno.createTextVNode)(" or "), (0, _inferno.createVNode)(1, "code", null, "currency_code", 16), (0, _inferno.createTextVNode)(" for Paypal. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 4);
|
|
69
52
|
}
|
|
70
|
-
|
|
71
53
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "a", "button donate", [(0, _inferno.createVNode)(1, "span", "icon is-small", (0, _inferno.createVNode)(1, "i", "fab fa-paypal"), 2), (0, _inferno.createVNode)(1, "span", null, title, 0)], 4, {
|
|
72
54
|
"data-type": "paypal",
|
|
73
55
|
"onclick": "document.getElementById('paypal-donate-form').submit()"
|
|
@@ -92,7 +74,6 @@ var Paypal = /*#__PURE__*/function (_Component) {
|
|
|
92
74
|
})], 4);
|
|
93
75
|
}
|
|
94
76
|
}]);
|
|
95
|
-
|
|
96
77
|
return Paypal;
|
|
97
78
|
}(Component);
|
|
98
79
|
/**
|
|
@@ -107,11 +88,9 @@ var Paypal = /*#__PURE__*/function (_Component) {
|
|
|
107
88
|
* donate={{ type: 'paypal', business: '******' currency_code: '******' }}
|
|
108
89
|
* helper={{ __: function() {...} }} />
|
|
109
90
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
91
|
Paypal.Cacheable = cacheComponent(Paypal, 'donate.paypal', function (props) {
|
|
113
92
|
var donate = props.donate,
|
|
114
|
-
|
|
93
|
+
helper = props.helper;
|
|
115
94
|
return {
|
|
116
95
|
business: donate.business,
|
|
117
96
|
currencyCode: donate.currency_code,
|
|
@@ -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
|
* Wechat donation JSX component.
|
|
29
19
|
* @module view/donate/alipay
|
|
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
|
* Wechat donation JSX component.
|
|
38
28
|
*
|
|
@@ -41,30 +31,22 @@ var _require2 = require('../../util/cache'),
|
|
|
41
31
|
* title="******"
|
|
42
32
|
* qrcode="/path/to/qrcode" />
|
|
43
33
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
34
|
var Wechat = /*#__PURE__*/function (_Component) {
|
|
47
35
|
_inherits(Wechat, _Component);
|
|
48
|
-
|
|
49
36
|
var _super = _createSuper(Wechat);
|
|
50
|
-
|
|
51
37
|
function Wechat() {
|
|
52
38
|
_classCallCheck(this, Wechat);
|
|
53
|
-
|
|
54
39
|
return _super.apply(this, arguments);
|
|
55
40
|
}
|
|
56
|
-
|
|
57
41
|
_createClass(Wechat, [{
|
|
58
42
|
key: "render",
|
|
59
43
|
value: function render() {
|
|
60
44
|
var _this$props = this.props,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
title = _this$props.title,
|
|
46
|
+
qrcode = _this$props.qrcode;
|
|
64
47
|
if (!qrcode) {
|
|
65
48
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "qrcode", 16), (0, _inferno.createTextVNode)(" for Wechat. Please set it in"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
66
49
|
}
|
|
67
|
-
|
|
68
50
|
return (0, _inferno.createVNode)(1, "a", "button donate", [(0, _inferno.createVNode)(1, "span", "icon is-small", (0, _inferno.createVNode)(1, "i", "fab fa-weixin"), 2), (0, _inferno.createVNode)(1, "span", null, title, 0), (0, _inferno.createVNode)(1, "span", "qrcode", (0, _inferno.createVNode)(1, "img", null, null, 1, {
|
|
69
51
|
"src": qrcode,
|
|
70
52
|
"alt": title
|
|
@@ -73,7 +55,6 @@ var Wechat = /*#__PURE__*/function (_Component) {
|
|
|
73
55
|
});
|
|
74
56
|
}
|
|
75
57
|
}]);
|
|
76
|
-
|
|
77
58
|
return Wechat;
|
|
78
59
|
}(Component);
|
|
79
60
|
/**
|
|
@@ -91,11 +72,9 @@ var Wechat = /*#__PURE__*/function (_Component) {
|
|
|
91
72
|
* url_for: function() {...}
|
|
92
73
|
* }} />
|
|
93
74
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
75
|
Wechat.Cacheable = cacheComponent(Wechat, 'donate.wechat', function (props) {
|
|
97
76
|
var donate = props.donate,
|
|
98
|
-
|
|
77
|
+
helper = props.helper;
|
|
99
78
|
return {
|
|
100
79
|
qrcode: helper.url_for(donate.qrcode),
|
|
101
80
|
title: helper.__('donate.' + donate.type)
|
|
@@ -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
|
* A JSX component that renders article licensing block.
|
|
29
19
|
* @module view/misc/article_licensing
|
|
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
|
* A JSX component that renders article licensing block.
|
|
38
28
|
*
|
|
@@ -57,37 +47,32 @@ var _require2 = require('../../util/cache'),
|
|
|
57
47
|
* }}
|
|
58
48
|
* licensedTitle="Licensed under" />
|
|
59
49
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
50
|
var ArticleLicensing = /*#__PURE__*/function (_Component) {
|
|
63
51
|
_inherits(ArticleLicensing, _Component);
|
|
64
|
-
|
|
65
52
|
var _super = _createSuper(ArticleLicensing);
|
|
66
|
-
|
|
67
53
|
function ArticleLicensing() {
|
|
68
54
|
_classCallCheck(this, ArticleLicensing);
|
|
69
|
-
|
|
70
55
|
return _super.apply(this, arguments);
|
|
71
56
|
}
|
|
72
|
-
|
|
73
57
|
_createClass(ArticleLicensing, [{
|
|
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
|
-
|
|
61
|
+
title = _this$props.title,
|
|
62
|
+
link = _this$props.link,
|
|
63
|
+
author = _this$props.author,
|
|
64
|
+
authorTitle = _this$props.authorTitle,
|
|
65
|
+
createdAt = _this$props.createdAt,
|
|
66
|
+
createdTitle = _this$props.createdTitle,
|
|
67
|
+
updatedAt = _this$props.updatedAt,
|
|
68
|
+
updatedTitle = _this$props.updatedTitle,
|
|
69
|
+
licenses = _this$props.licenses,
|
|
70
|
+
licensedTitle = _this$props.licensedTitle;
|
|
87
71
|
return (0, _inferno.createVNode)(1, "div", "article-licensing box", [(0, _inferno.createVNode)(1, "div", "licensing-title", [title ? (0, _inferno.createVNode)(1, "p", null, title, 0) : null, (0, _inferno.createVNode)(1, "p", null, (0, _inferno.createVNode)(1, "a", null, link, 0, {
|
|
88
72
|
"href": link
|
|
89
73
|
}), 2)], 0), (0, _inferno.createVNode)(1, "div", "licensing-meta level is-mobile", (0, _inferno.createVNode)(1, "div", "level-left", [author ? (0, _inferno.createVNode)(1, "div", "level-item is-narrow", (0, _inferno.createVNode)(1, "div", null, [(0, _inferno.createVNode)(1, "h6", null, authorTitle, 0), (0, _inferno.createVNode)(1, "p", null, author, 0)], 4), 2) : null, createdAt ? (0, _inferno.createVNode)(1, "div", "level-item is-narrow", (0, _inferno.createVNode)(1, "div", null, [(0, _inferno.createVNode)(1, "h6", null, createdTitle, 0), (0, _inferno.createVNode)(1, "p", null, createdAt, 0)], 4), 2) : null, updatedAt ? (0, _inferno.createVNode)(1, "div", "level-item is-narrow", (0, _inferno.createVNode)(1, "div", null, [(0, _inferno.createVNode)(1, "h6", null, updatedTitle, 0), (0, _inferno.createVNode)(1, "p", null, updatedAt, 0)], 4), 2) : null, licenses && Object.keys(licenses).length ? (0, _inferno.createVNode)(1, "div", "level-item is-narrow", (0, _inferno.createVNode)(1, "div", null, [(0, _inferno.createVNode)(1, "h6", null, licensedTitle, 0), (0, _inferno.createVNode)(1, "p", null, Object.keys(licenses).map(function (name) {
|
|
90
|
-
return (0, _inferno.createVNode)(1, "a", licenses[name].icon ? 'icons' : '', licenses[name].icon ?
|
|
74
|
+
return (0, _inferno.createVNode)(1, "a", licenses[name].icon ? 'icons' : '', licenses[name].icon ?
|
|
75
|
+
// eslint-disable-line no-nested-ternary
|
|
91
76
|
Array.isArray(licenses[name].icon) ? licenses[name].icon.map(function (icon) {
|
|
92
77
|
return (0, _inferno.createVNode)(1, "i", "icon ".concat(icon));
|
|
93
78
|
}) : (0, _inferno.createVNode)(1, "i", "icon ".concat(licenses[name].icon)) : name, 0, {
|
|
@@ -99,7 +84,6 @@ var ArticleLicensing = /*#__PURE__*/function (_Component) {
|
|
|
99
84
|
}), 0)], 4), 2) : null], 0), 2)], 4);
|
|
100
85
|
}
|
|
101
86
|
}]);
|
|
102
|
-
|
|
103
87
|
return ArticleLicensing;
|
|
104
88
|
}(Component);
|
|
105
89
|
/**
|
|
@@ -128,18 +112,13 @@ var ArticleLicensing = /*#__PURE__*/function (_Component) {
|
|
|
128
112
|
* url_for: function() {...}
|
|
129
113
|
* }} />
|
|
130
114
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
115
|
ArticleLicensing.Cacheable = cacheComponent(ArticleLicensing, 'misc.articlelicensing', function (props) {
|
|
134
116
|
var config = props.config,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
117
|
+
page = props.page,
|
|
118
|
+
helper = props.helper;
|
|
138
119
|
var _ref = config.article || {},
|
|
139
|
-
|
|
140
|
-
|
|
120
|
+
licenses = _ref.licenses;
|
|
141
121
|
var links = {};
|
|
142
|
-
|
|
143
122
|
if (licenses) {
|
|
144
123
|
Object.keys(licenses).forEach(function (name) {
|
|
145
124
|
var license = licenses[name];
|
|
@@ -149,7 +128,6 @@ ArticleLicensing.Cacheable = cacheComponent(ArticleLicensing, 'misc.articlelicen
|
|
|
149
128
|
};
|
|
150
129
|
});
|
|
151
130
|
}
|
|
152
|
-
|
|
153
131
|
return {
|
|
154
132
|
title: page.title,
|
|
155
133
|
link: decodeURI(page.permalink),
|
package/lib/view/misc/meta.js
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
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
|
* A JSX component that renders <meta> tags.
|
|
35
22
|
* @module view/misc/meta
|
|
36
23
|
*/
|
|
37
24
|
var _require = require('inferno'),
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
Component = _require.Component;
|
|
40
26
|
function trim(str) {
|
|
41
27
|
return str.trim().replace(/^"(.*)"$/, '$1').replace(/^'(.*)'$/, '$1');
|
|
42
28
|
}
|
|
43
|
-
|
|
44
29
|
function split(str, sep) {
|
|
45
30
|
var result = [];
|
|
46
31
|
var matched = null;
|
|
47
|
-
|
|
48
32
|
while ((matched = sep.exec(str)) !== null) {
|
|
49
33
|
result.push(matched[0]);
|
|
50
34
|
}
|
|
51
|
-
|
|
52
35
|
return result;
|
|
53
36
|
}
|
|
37
|
+
|
|
54
38
|
/**
|
|
55
39
|
* A JSX component that renders <meta> tags.
|
|
56
40
|
*
|
|
@@ -61,39 +45,29 @@ function split(str, sep) {
|
|
|
61
45
|
* 'property="article:author";content="PPOffice"'
|
|
62
46
|
* ]} />
|
|
63
47
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
48
|
module.exports = /*#__PURE__*/function (_Component) {
|
|
67
49
|
_inherits(_class, _Component);
|
|
68
|
-
|
|
69
50
|
var _super = _createSuper(_class);
|
|
70
|
-
|
|
71
51
|
function _class() {
|
|
72
52
|
_classCallCheck(this, _class);
|
|
73
|
-
|
|
74
53
|
return _super.apply(this, arguments);
|
|
75
54
|
}
|
|
76
|
-
|
|
77
55
|
_createClass(_class, [{
|
|
78
56
|
key: "render",
|
|
79
57
|
value: function render() {
|
|
80
58
|
var _this$props$meta = this.props.meta,
|
|
81
|
-
|
|
82
|
-
|
|
59
|
+
meta = _this$props$meta === void 0 ? [] : _this$props$meta;
|
|
83
60
|
if (!Array.isArray(meta)) {
|
|
84
61
|
meta = [meta];
|
|
85
62
|
}
|
|
86
|
-
|
|
87
63
|
var tags = meta.filter(function (entry) {
|
|
88
64
|
return typeof entry === 'string';
|
|
89
65
|
}).map(function (entry) {
|
|
90
66
|
var props = split(entry, /(?:[^\\;]+|\\.)+/g).map(function (property) {
|
|
91
67
|
var entry = split(property, /(?:[^\\=]+|\\.)+/g);
|
|
92
|
-
|
|
93
68
|
if (entry.length < 2) {
|
|
94
69
|
return null;
|
|
95
70
|
}
|
|
96
|
-
|
|
97
71
|
return _defineProperty({}, trim(entry[0]), trim(entry[1]));
|
|
98
72
|
}).filter(function (property) {
|
|
99
73
|
return property !== null;
|
|
@@ -105,6 +79,5 @@ module.exports = /*#__PURE__*/function (_Component) {
|
|
|
105
79
|
return (0, _inferno.createFragment)(tags, 0);
|
|
106
80
|
}
|
|
107
81
|
}]);
|
|
108
|
-
|
|
109
82
|
return _class;
|
|
110
83
|
}(Component);
|