hexo-component-inferno 2.0.1 → 2.0.3
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 +16 -50
- 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 +26 -52
- package/lib/view/widget/categories.js +25 -57
- package/lib/view/widget/followit.js +12 -31
- package/lib/view/widget/links.js +27 -39
- package/lib/view/widget/recent_posts.js +15 -36
- package/lib/view/widget/subscribe_email.js +12 -31
- package/lib/view/widget/tags.js +16 -39
- package/lib/view/widget/toc.js +27 -67
- package/package.json +1 -1
package/lib/view/widget/links.js
CHANGED
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _inferno = require("inferno");
|
|
4
|
-
|
|
5
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); }
|
|
6
|
-
|
|
4
|
+
var _inferno = require("inferno");
|
|
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
|
* External links widget JSX component.
|
|
29
19
|
* @module view/widget/links
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('url'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
URL = _require.URL;
|
|
34
23
|
var _require2 = require('inferno'),
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
Component = _require2.Component;
|
|
37
25
|
var _require3 = require('../../util/cache'),
|
|
38
|
-
|
|
26
|
+
cacheComponent = _require3.cacheComponent;
|
|
27
|
+
|
|
39
28
|
/**
|
|
40
29
|
* External links widget JSX component.
|
|
41
30
|
*
|
|
@@ -50,32 +39,36 @@ var _require3 = require('../../util/cache'),
|
|
|
50
39
|
* }
|
|
51
40
|
* }} />
|
|
52
41
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
42
|
var Links = /*#__PURE__*/function (_Component) {
|
|
56
43
|
_inherits(Links, _Component);
|
|
57
|
-
|
|
58
44
|
var _super = _createSuper(Links);
|
|
59
|
-
|
|
60
45
|
function Links() {
|
|
61
46
|
_classCallCheck(this, Links);
|
|
62
|
-
|
|
63
47
|
return _super.apply(this, arguments);
|
|
64
48
|
}
|
|
65
|
-
|
|
66
49
|
_createClass(Links, [{
|
|
67
50
|
key: "render",
|
|
68
51
|
value: function render() {
|
|
69
52
|
var _this$props = this.props,
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
title = _this$props.title,
|
|
54
|
+
links = _this$props.links;
|
|
55
|
+
for (var name in links) {
|
|
56
|
+
var link = links[name];
|
|
57
|
+
if (typeof link === 'string') {
|
|
58
|
+
link = {
|
|
59
|
+
link: link
|
|
60
|
+
};
|
|
61
|
+
links[name] = link;
|
|
62
|
+
}
|
|
63
|
+
if (link.hide_hostname !== true) {
|
|
64
|
+
try {
|
|
65
|
+
link.hostname = new URL(link.link).hostname;
|
|
66
|
+
} catch (e) {}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
72
69
|
return (0, _inferno.createVNode)(1, "div", "card widget", (0, _inferno.createVNode)(1, "div", "card-content", (0, _inferno.createVNode)(1, "div", "menu", [(0, _inferno.createVNode)(1, "h3", "menu-label", title, 0), (0, _inferno.createVNode)(1, "ul", "menu-list", Object.keys(links).map(function (i) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
hostname = new URL(hostname).hostname;
|
|
76
|
-
} catch (e) {}
|
|
77
|
-
return (0, _inferno.createVNode)(1, "li", null, (0, _inferno.createVNode)(1, "a", "level is-mobile", [(0, _inferno.createVNode)(1, "span", "level-left", (0, _inferno.createVNode)(1, "span", "level-item", i, 0), 2), hostname ? (0, _inferno.createVNode)(1, "span", "level-right", (0, _inferno.createVNode)(1, "span", "level-item tag", hostname, 0), 2) : null], 0, {
|
|
78
|
-
"href": links[i],
|
|
70
|
+
return (0, _inferno.createVNode)(1, "li", null, (0, _inferno.createVNode)(1, "a", "level is-mobile", [(0, _inferno.createVNode)(1, "span", "level-left", (0, _inferno.createVNode)(1, "span", "level-item", i, 0), 2), links[i].hostname ? (0, _inferno.createVNode)(1, "span", "level-right", (0, _inferno.createVNode)(1, "span", "level-item tag", links[i].hostname, 0), 2) : null], 0, {
|
|
71
|
+
"href": links[i].link,
|
|
79
72
|
"target": "_blank",
|
|
80
73
|
"rel": "noopener"
|
|
81
74
|
}), 2);
|
|
@@ -84,7 +77,6 @@ var Links = /*#__PURE__*/function (_Component) {
|
|
|
84
77
|
});
|
|
85
78
|
}
|
|
86
79
|
}]);
|
|
87
|
-
|
|
88
80
|
return Links;
|
|
89
81
|
}(Component);
|
|
90
82
|
/**
|
|
@@ -102,16 +94,12 @@ var Links = /*#__PURE__*/function (_Component) {
|
|
|
102
94
|
* }}
|
|
103
95
|
* helper={{ __: function() {...} }} />
|
|
104
96
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
97
|
Links.Cacheable = cacheComponent(Links, 'widget.links', function (props) {
|
|
108
98
|
var helper = props.helper,
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
widget = props.widget;
|
|
111
100
|
if (!Object.keys(widget.links).length) {
|
|
112
101
|
return null;
|
|
113
102
|
}
|
|
114
|
-
|
|
115
103
|
return {
|
|
116
104
|
title: helper.__('widget.links'),
|
|
117
105
|
links: widget.links
|
|
@@ -1,40 +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
|
* Recent posts widget JSX component.
|
|
29
19
|
* @module view/widget/recent_posts
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
37
25
|
var ArticleMedia = require('../common/article_media');
|
|
26
|
+
|
|
38
27
|
/**
|
|
39
28
|
* Recent posts widget JSX component.
|
|
40
29
|
*
|
|
@@ -52,25 +41,19 @@ var ArticleMedia = require('../common/article_media');
|
|
|
52
41
|
* }
|
|
53
42
|
* ]} />
|
|
54
43
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
44
|
var RecentPosts = /*#__PURE__*/function (_Component) {
|
|
58
45
|
_inherits(RecentPosts, _Component);
|
|
59
|
-
|
|
60
46
|
var _super = _createSuper(RecentPosts);
|
|
61
|
-
|
|
62
47
|
function RecentPosts() {
|
|
63
48
|
_classCallCheck(this, RecentPosts);
|
|
64
|
-
|
|
65
49
|
return _super.apply(this, arguments);
|
|
66
50
|
}
|
|
67
|
-
|
|
68
51
|
_createClass(RecentPosts, [{
|
|
69
52
|
key: "render",
|
|
70
53
|
value: function render() {
|
|
71
54
|
var _this$props = this.props,
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
title = _this$props.title,
|
|
56
|
+
posts = _this$props.posts;
|
|
74
57
|
return (0, _inferno.createVNode)(1, "div", "card widget", (0, _inferno.createVNode)(1, "div", "card-content", [(0, _inferno.createVNode)(1, "h3", "menu-label", title, 0), posts.map(function (post) {
|
|
75
58
|
return (0, _inferno.createComponentVNode)(2, ArticleMedia, {
|
|
76
59
|
"thumbnail": post.thumbnail,
|
|
@@ -85,7 +68,6 @@ var RecentPosts = /*#__PURE__*/function (_Component) {
|
|
|
85
68
|
});
|
|
86
69
|
}
|
|
87
70
|
}]);
|
|
88
|
-
|
|
89
71
|
return RecentPosts;
|
|
90
72
|
}(Component);
|
|
91
73
|
/**
|
|
@@ -106,22 +88,19 @@ var RecentPosts = /*#__PURE__*/function (_Component) {
|
|
|
106
88
|
* }}
|
|
107
89
|
* limit={5} />
|
|
108
90
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
91
|
RecentPosts.Cacheable = cacheComponent(RecentPosts, 'widget.recentposts', function (props) {
|
|
112
92
|
var site = props.site,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
93
|
+
helper = props.helper,
|
|
94
|
+
widget = props.widget;
|
|
95
|
+
var _widget$limit = widget.limit,
|
|
96
|
+
limit = _widget$limit === void 0 ? 5 : _widget$limit;
|
|
116
97
|
var url_for = helper.url_for,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
__ = helper.__,
|
|
99
|
+
date_xml = helper.date_xml,
|
|
100
|
+
date = helper.date;
|
|
121
101
|
if (!site.posts.length) {
|
|
122
102
|
return null;
|
|
123
103
|
}
|
|
124
|
-
|
|
125
104
|
var posts = site.posts.sort('date', -1).limit(limit).map(function (post) {
|
|
126
105
|
return {
|
|
127
106
|
url: url_for(post.link || post.path),
|
|
@@ -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
|
* Google FeedBurner widget JSX component.
|
|
29
19
|
* @module view/widget/subscribe_email
|
|
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
|
* Google FeedBurner widget JSX component.
|
|
38
28
|
*
|
|
@@ -44,27 +34,21 @@ var _require2 = require('../../util/cache'),
|
|
|
44
34
|
* feedburnerId="******"
|
|
45
35
|
* buttonTitle="Subscribe now" />
|
|
46
36
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
37
|
var SubscribeEmail = /*#__PURE__*/function (_Component) {
|
|
50
38
|
_inherits(SubscribeEmail, _Component);
|
|
51
|
-
|
|
52
39
|
var _super = _createSuper(SubscribeEmail);
|
|
53
|
-
|
|
54
40
|
function SubscribeEmail() {
|
|
55
41
|
_classCallCheck(this, SubscribeEmail);
|
|
56
|
-
|
|
57
42
|
return _super.apply(this, arguments);
|
|
58
43
|
}
|
|
59
|
-
|
|
60
44
|
_createClass(SubscribeEmail, [{
|
|
61
45
|
key: "render",
|
|
62
46
|
value: function render() {
|
|
63
47
|
var _this$props = this.props,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
48
|
+
title = _this$props.title,
|
|
49
|
+
description = _this$props.description,
|
|
50
|
+
feedburnerId = _this$props.feedburnerId,
|
|
51
|
+
buttonTitle = _this$props.buttonTitle;
|
|
68
52
|
return (0, _inferno.createVNode)(1, "div", "card widget", (0, _inferno.createVNode)(1, "div", "card-content", (0, _inferno.createVNode)(1, "div", "menu", [(0, _inferno.createVNode)(1, "h3", "menu-label", title, 0), (0, _inferno.createVNode)(1, "form", null, [(0, _inferno.createVNode)(64, "input", null, null, 1, {
|
|
69
53
|
"type": "hidden",
|
|
70
54
|
"value": feedburnerId,
|
|
@@ -90,7 +74,6 @@ var SubscribeEmail = /*#__PURE__*/function (_Component) {
|
|
|
90
74
|
});
|
|
91
75
|
}
|
|
92
76
|
}]);
|
|
93
|
-
|
|
94
77
|
return SubscribeEmail;
|
|
95
78
|
}(Component);
|
|
96
79
|
/**
|
|
@@ -108,13 +91,11 @@ var SubscribeEmail = /*#__PURE__*/function (_Component) {
|
|
|
108
91
|
* }}
|
|
109
92
|
* helper={{ __: function() {...} }} />
|
|
110
93
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
94
|
SubscribeEmail.Cacheable = cacheComponent(SubscribeEmail, 'widget.subscribeemail', function (props) {
|
|
114
95
|
var helper = props.helper,
|
|
115
|
-
|
|
96
|
+
widget = props.widget;
|
|
116
97
|
var feedburner_id = widget.feedburner_id,
|
|
117
|
-
|
|
98
|
+
description = widget.description;
|
|
118
99
|
return {
|
|
119
100
|
description: description,
|
|
120
101
|
feedburnerId: feedburner_id,
|
package/lib/view/widget/tags.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
|
* Tags widget JSX component.
|
|
29
19
|
* @module view/widget/tags
|
|
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
|
* Tags widget JSX component.
|
|
38
28
|
*
|
|
@@ -48,26 +38,20 @@ var _require2 = require('../../util/cache'),
|
|
|
48
38
|
* }
|
|
49
39
|
* ]} />
|
|
50
40
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
41
|
var Tags = /*#__PURE__*/function (_Component) {
|
|
54
42
|
_inherits(Tags, _Component);
|
|
55
|
-
|
|
56
43
|
var _super = _createSuper(Tags);
|
|
57
|
-
|
|
58
44
|
function Tags() {
|
|
59
45
|
_classCallCheck(this, Tags);
|
|
60
|
-
|
|
61
46
|
return _super.apply(this, arguments);
|
|
62
47
|
}
|
|
63
|
-
|
|
64
48
|
_createClass(Tags, [{
|
|
65
49
|
key: "render",
|
|
66
50
|
value: function render() {
|
|
67
51
|
var _this$props = this.props,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
tags = _this$props.tags,
|
|
53
|
+
title = _this$props.title,
|
|
54
|
+
showCount = _this$props.showCount;
|
|
71
55
|
return (0, _inferno.createVNode)(1, "div", "card widget", (0, _inferno.createVNode)(1, "div", "card-content", (0, _inferno.createVNode)(1, "div", "menu", [(0, _inferno.createVNode)(1, "h3", "menu-label", title, 0), (0, _inferno.createVNode)(1, "div", "field is-grouped is-grouped-multiline", tags.map(function (tag) {
|
|
72
56
|
return (0, _inferno.createVNode)(1, "div", "control", (0, _inferno.createVNode)(1, "a", "tags has-addons", [(0, _inferno.createVNode)(1, "span", "tag", tag.name, 0), showCount ? (0, _inferno.createVNode)(1, "span", "tag", tag.count, 0) : null], 0, {
|
|
73
57
|
"href": tag.url
|
|
@@ -77,7 +61,6 @@ var Tags = /*#__PURE__*/function (_Component) {
|
|
|
77
61
|
});
|
|
78
62
|
}
|
|
79
63
|
}]);
|
|
80
|
-
|
|
81
64
|
return Tags;
|
|
82
65
|
}(Component);
|
|
83
66
|
/**
|
|
@@ -102,33 +85,27 @@ var Tags = /*#__PURE__*/function (_Component) {
|
|
|
102
85
|
* show_count: true
|
|
103
86
|
* }} />
|
|
104
87
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
88
|
Tags.Cacheable = cacheComponent(Tags, 'widget.tags', function (props) {
|
|
108
89
|
var helper = props.helper,
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
_props$widget = props.widget,
|
|
91
|
+
widget = _props$widget === void 0 ? {} : _props$widget;
|
|
111
92
|
var _widget$order_by = widget.order_by,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
93
|
+
order_by = _widget$order_by === void 0 ? 'name' : _widget$order_by,
|
|
94
|
+
amount = widget.amount,
|
|
95
|
+
_widget$show_count = widget.show_count,
|
|
96
|
+
show_count = _widget$show_count === void 0 ? true : _widget$show_count;
|
|
116
97
|
var tags = props.tags || props.site.tags;
|
|
117
98
|
var url_for = helper.url_for,
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
_p = helper._p;
|
|
120
100
|
if (!tags || !tags.length) {
|
|
121
101
|
return null;
|
|
122
102
|
}
|
|
123
|
-
|
|
124
103
|
tags = tags.sort(order_by).filter(function (tag) {
|
|
125
104
|
return tag.length;
|
|
126
105
|
});
|
|
127
|
-
|
|
128
106
|
if (amount) {
|
|
129
107
|
tags = tags.limit(amount);
|
|
130
108
|
}
|
|
131
|
-
|
|
132
109
|
return {
|
|
133
110
|
showCount: show_count,
|
|
134
111
|
title: _p('common.tag', Infinity),
|