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
package/lib/view/misc/web_app.js
CHANGED
|
@@ -1,50 +1,34 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
|
|
9
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
8
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
-
|
|
15
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
-
|
|
17
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
-
|
|
21
|
-
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); } }
|
|
22
|
-
|
|
12
|
+
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); } }
|
|
23
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
24
|
-
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
25
16
|
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); }
|
|
26
|
-
|
|
27
17
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
|
-
|
|
29
18
|
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); }; }
|
|
30
|
-
|
|
31
19
|
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); }
|
|
32
|
-
|
|
33
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
34
|
-
|
|
35
21
|
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; } }
|
|
36
|
-
|
|
37
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
38
|
-
|
|
39
23
|
/**
|
|
40
24
|
* Web app meta tags.
|
|
41
25
|
* @module view/misc/web_app
|
|
42
26
|
*/
|
|
43
27
|
var _require = require('inferno'),
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
Component = _require.Component;
|
|
46
29
|
var _require2 = require('../../util/cache'),
|
|
47
|
-
|
|
30
|
+
cacheComponent = _require2.cacheComponent;
|
|
31
|
+
|
|
48
32
|
/**
|
|
49
33
|
* Web app meta tags.
|
|
50
34
|
*
|
|
@@ -59,36 +43,27 @@ var _require2 = require('../../util/cache'),
|
|
|
59
43
|
* { src: '/path/to/image', sizes: '512x512' },
|
|
60
44
|
* ]} />
|
|
61
45
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
46
|
var WebApp = /*#__PURE__*/function (_Component) {
|
|
65
47
|
_inherits(WebApp, _Component);
|
|
66
|
-
|
|
67
48
|
var _super = _createSuper(WebApp);
|
|
68
|
-
|
|
69
49
|
function WebApp() {
|
|
70
50
|
_classCallCheck(this, WebApp);
|
|
71
|
-
|
|
72
51
|
return _super.apply(this, arguments);
|
|
73
52
|
}
|
|
74
|
-
|
|
75
53
|
_createClass(WebApp, [{
|
|
76
54
|
key: "render",
|
|
77
55
|
value: function render() {
|
|
78
56
|
var _this$props = this.props,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
57
|
+
name = _this$props.name,
|
|
58
|
+
manifest = _this$props.manifest,
|
|
59
|
+
tileIcon = _this$props.tileIcon,
|
|
60
|
+
themeColor = _this$props.themeColor;
|
|
83
61
|
var icons = [];
|
|
84
|
-
|
|
85
62
|
if (Array.isArray(this.props.icons)) {
|
|
86
63
|
var _ref;
|
|
87
|
-
|
|
88
64
|
icons = this.props.icons.map(function (icon) {
|
|
89
65
|
var sizes = icon.sizes,
|
|
90
|
-
|
|
91
|
-
|
|
66
|
+
src = icon.src;
|
|
92
67
|
if (src && sizes) {
|
|
93
68
|
return icon.sizes.split(/\s+/).map(function (size) {
|
|
94
69
|
return {
|
|
@@ -97,13 +72,11 @@ var WebApp = /*#__PURE__*/function (_Component) {
|
|
|
97
72
|
};
|
|
98
73
|
});
|
|
99
74
|
}
|
|
100
|
-
|
|
101
75
|
return null;
|
|
102
76
|
});
|
|
103
77
|
icons = icons.filter(Boolean);
|
|
104
78
|
icons = (_ref = []).concat.apply(_ref, _toConsumableArray(icons));
|
|
105
79
|
}
|
|
106
|
-
|
|
107
80
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "link", null, null, 1, {
|
|
108
81
|
"rel": "manifest",
|
|
109
82
|
"href": manifest
|
|
@@ -137,7 +110,6 @@ var WebApp = /*#__PURE__*/function (_Component) {
|
|
|
137
110
|
})], 0);
|
|
138
111
|
}
|
|
139
112
|
}]);
|
|
140
|
-
|
|
141
113
|
return WebApp;
|
|
142
114
|
}(Component);
|
|
143
115
|
/**
|
|
@@ -158,32 +130,26 @@ var WebApp = /*#__PURE__*/function (_Component) {
|
|
|
158
130
|
* ]}
|
|
159
131
|
* helper={{ url_for: function() {...} }} />
|
|
160
132
|
*/
|
|
161
|
-
|
|
162
|
-
|
|
163
133
|
WebApp.Cacheable = cacheComponent(WebApp, 'misc.webapp', function (props) {
|
|
164
134
|
var name = props.name,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
135
|
+
themeColor = props.themeColor,
|
|
136
|
+
favicon = props.favicon,
|
|
137
|
+
icons = props.icons,
|
|
138
|
+
helper = props.helper;
|
|
169
139
|
var tileIcon = null;
|
|
170
|
-
|
|
171
140
|
if (Array.isArray(icons)) {
|
|
172
141
|
tileIcon = icons.find(function (icon) {
|
|
173
142
|
return icon.sizes.toLowerCase().indexOf('144x144') > -1;
|
|
174
143
|
});
|
|
175
|
-
|
|
176
144
|
if (tileIcon) {
|
|
177
145
|
tileIcon = tileIcon.src;
|
|
178
146
|
} else if (icons.length) {
|
|
179
147
|
tileIcon = icons[0].src;
|
|
180
148
|
}
|
|
181
149
|
}
|
|
182
|
-
|
|
183
150
|
if (!tileIcon) {
|
|
184
151
|
tileIcon = favicon;
|
|
185
152
|
}
|
|
186
|
-
|
|
187
153
|
return {
|
|
188
154
|
name: name,
|
|
189
155
|
icons: icons,
|
|
@@ -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
|
* Baidu Analytics plugin JSX component.
|
|
29
19
|
* @module view/plugin/baidu_analytics
|
|
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
|
* Baidu Analytics plugin JSX component.
|
|
38
28
|
*
|
|
@@ -40,19 +30,13 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <BaiduAnalytics trackingId="******" />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var BaiduAnalytics = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(BaiduAnalytics, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(BaiduAnalytics);
|
|
49
|
-
|
|
50
36
|
function BaiduAnalytics() {
|
|
51
37
|
_classCallCheck(this, BaiduAnalytics);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(BaiduAnalytics, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
@@ -65,7 +49,6 @@ var BaiduAnalytics = /*#__PURE__*/function (_Component) {
|
|
|
65
49
|
});
|
|
66
50
|
}
|
|
67
51
|
}]);
|
|
68
|
-
|
|
69
52
|
return BaiduAnalytics;
|
|
70
53
|
}(Component);
|
|
71
54
|
/**
|
|
@@ -80,16 +63,12 @@ var BaiduAnalytics = /*#__PURE__*/function (_Component) {
|
|
|
80
63
|
* head={true}
|
|
81
64
|
* plugin={{ tracking_id: '*******' }} />
|
|
82
65
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
66
|
BaiduAnalytics.Cacheable = cacheComponent(BaiduAnalytics, 'plugin.baiduanalytics', function (props) {
|
|
86
67
|
var head = props.head,
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
plugin = props.plugin;
|
|
89
69
|
if (!head || !plugin.tracking_id) {
|
|
90
70
|
return null;
|
|
91
71
|
}
|
|
92
|
-
|
|
93
72
|
return {
|
|
94
73
|
trackingId: plugin.tracking_id
|
|
95
74
|
};
|
|
@@ -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
|
* Bing Webmaster Tools plugin JSX component.
|
|
29
19
|
* @module view/plugin/bing_webmaster
|
|
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
|
* Bing Webmaster Tools plugin JSX component.
|
|
38
28
|
*
|
|
@@ -40,19 +30,13 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <BingWebmaster trackingId="******" />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var BingWebmaster = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(BingWebmaster, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(BingWebmaster);
|
|
49
|
-
|
|
50
36
|
function BingWebmaster() {
|
|
51
37
|
_classCallCheck(this, BingWebmaster);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(BingWebmaster, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
@@ -63,7 +47,6 @@ var BingWebmaster = /*#__PURE__*/function (_Component) {
|
|
|
63
47
|
});
|
|
64
48
|
}
|
|
65
49
|
}]);
|
|
66
|
-
|
|
67
50
|
return BingWebmaster;
|
|
68
51
|
}(Component);
|
|
69
52
|
/**
|
|
@@ -78,16 +61,12 @@ var BingWebmaster = /*#__PURE__*/function (_Component) {
|
|
|
78
61
|
* head={true}
|
|
79
62
|
* plugin={{ tracking_id: '*******' }} />
|
|
80
63
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
64
|
BingWebmaster.Cacheable = cacheComponent(BingWebmaster, 'plugin.bingwebmaster', function (props) {
|
|
84
65
|
var head = props.head,
|
|
85
|
-
|
|
86
|
-
|
|
66
|
+
plugin = props.plugin;
|
|
87
67
|
if (!head || !plugin.tracking_id) {
|
|
88
68
|
return null;
|
|
89
69
|
}
|
|
90
|
-
|
|
91
70
|
return {
|
|
92
71
|
trackingId: plugin.tracking_id
|
|
93
72
|
};
|
|
@@ -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
|
* Busuanzi visitor counter plugin JSX component.
|
|
29
19
|
* @module view/plugin/baidu_analytics
|
|
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
|
* Busuanzi visitor counter plugin JSX component.
|
|
38
28
|
*
|
|
@@ -40,19 +30,13 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <Busuanzi />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var Busuanzi = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(Busuanzi, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(Busuanzi);
|
|
49
|
-
|
|
50
36
|
function Busuanzi() {
|
|
51
37
|
_classCallCheck(this, Busuanzi);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(Busuanzi, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
@@ -62,7 +46,6 @@ var Busuanzi = /*#__PURE__*/function (_Component) {
|
|
|
62
46
|
});
|
|
63
47
|
}
|
|
64
48
|
}]);
|
|
65
|
-
|
|
66
49
|
return Busuanzi;
|
|
67
50
|
}(Component);
|
|
68
51
|
/**
|
|
@@ -75,13 +58,10 @@ var Busuanzi = /*#__PURE__*/function (_Component) {
|
|
|
75
58
|
* @example
|
|
76
59
|
* <Busuanzi.Cacheable head={true} />
|
|
77
60
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
61
|
Busuanzi.Cacheable = cacheComponent(Busuanzi, 'plugin.busuanzi', function (props) {
|
|
81
62
|
if (!props.head) {
|
|
82
63
|
return null;
|
|
83
64
|
}
|
|
84
|
-
|
|
85
65
|
return {};
|
|
86
66
|
});
|
|
87
67
|
module.exports = Busuanzi;
|
package/lib/view/plugin/cnzz.js
CHANGED
|
@@ -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
|
* CNZZ statistics plugin JSX component.
|
|
29
19
|
* @module view/plugin/cnzz
|
|
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
|
* CNZZ statistics plugin JSX component.
|
|
38
28
|
*
|
|
@@ -40,32 +30,25 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <Cnzz id="******" webId="******" />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var Cnzz = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(Cnzz, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(Cnzz);
|
|
49
|
-
|
|
50
36
|
function Cnzz() {
|
|
51
37
|
_classCallCheck(this, Cnzz);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(Cnzz, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
59
43
|
var _this$props = this.props,
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
id = _this$props.id,
|
|
45
|
+
webId = _this$props.webId;
|
|
62
46
|
return (0, _inferno.createVNode)(1, "script", null, null, 1, {
|
|
63
47
|
"src": "https://s9.cnzz.com/z_stat.php?id=".concat(id, "&web_id=").concat(webId),
|
|
64
48
|
"async": true
|
|
65
49
|
});
|
|
66
50
|
}
|
|
67
51
|
}]);
|
|
68
|
-
|
|
69
52
|
return Cnzz;
|
|
70
53
|
}(Component);
|
|
71
54
|
/**
|
|
@@ -80,16 +63,12 @@ var Cnzz = /*#__PURE__*/function (_Component) {
|
|
|
80
63
|
* head={false}
|
|
81
64
|
* plugin={{ id: '******', web_id: '******' }} />
|
|
82
65
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
66
|
Cnzz.Cacheable = cacheComponent(Cnzz, 'plugin.cnzz', function (props) {
|
|
86
67
|
var head = props.head,
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
plugin = props.plugin;
|
|
89
69
|
if (head || !plugin.id || !plugin.web_id) {
|
|
90
70
|
return null;
|
|
91
71
|
}
|
|
92
|
-
|
|
93
72
|
return {
|
|
94
73
|
id: plugin.id,
|
|
95
74
|
webId: plugin.web_id
|