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
|
@@ -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 AdSense widget JSX component.
|
|
29
19
|
* @module view/widget/adsense
|
|
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 AdSense widget JSX component.
|
|
38
28
|
*
|
|
@@ -43,31 +33,23 @@ var _require2 = require('../../util/cache'),
|
|
|
43
33
|
* clientId="******"
|
|
44
34
|
* slotId="******" />
|
|
45
35
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
36
|
var AdSense = /*#__PURE__*/function (_Component) {
|
|
49
37
|
_inherits(AdSense, _Component);
|
|
50
|
-
|
|
51
38
|
var _super = _createSuper(AdSense);
|
|
52
|
-
|
|
53
39
|
function AdSense() {
|
|
54
40
|
_classCallCheck(this, AdSense);
|
|
55
|
-
|
|
56
41
|
return _super.apply(this, arguments);
|
|
57
42
|
}
|
|
58
|
-
|
|
59
43
|
_createClass(AdSense, [{
|
|
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
|
+
clientId = _this$props.clientId,
|
|
49
|
+
slotId = _this$props.slotId;
|
|
67
50
|
if (!clientId || !slotId) {
|
|
68
51
|
return (0, _inferno.createVNode)(1, "div", "card widget", (0, _inferno.createVNode)(1, "div", "card-content", (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You need to set "), (0, _inferno.createVNode)(1, "code", null, "client_id", 16), (0, _inferno.createTextVNode)(" and "), (0, _inferno.createVNode)(1, "code", null, "slot_id", 16), (0, _inferno.createTextVNode)(" to show this AD unit. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 4), 2), 2);
|
|
69
52
|
}
|
|
70
|
-
|
|
71
53
|
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, "script", null, null, 1, {
|
|
72
54
|
"async": true,
|
|
73
55
|
"src": "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
|
|
@@ -86,7 +68,6 @@ var AdSense = /*#__PURE__*/function (_Component) {
|
|
|
86
68
|
});
|
|
87
69
|
}
|
|
88
70
|
}]);
|
|
89
|
-
|
|
90
71
|
return AdSense;
|
|
91
72
|
}(Component);
|
|
92
73
|
/**
|
|
@@ -101,13 +82,11 @@ var AdSense = /*#__PURE__*/function (_Component) {
|
|
|
101
82
|
* widget={{ client_id: '******', slot_id: '******' }}
|
|
102
83
|
* helper={{ __: function() {...} }} />
|
|
103
84
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
85
|
AdSense.Cacheable = cacheComponent(AdSense, 'widget.adsense', function (props) {
|
|
107
86
|
var widget = props.widget,
|
|
108
|
-
|
|
87
|
+
helper = props.helper;
|
|
109
88
|
var client_id = widget.client_id,
|
|
110
|
-
|
|
89
|
+
slot_id = widget.slot_id;
|
|
111
90
|
return {
|
|
112
91
|
title: helper.__('widget.adsense'),
|
|
113
92
|
clientId: client_id,
|
|
@@ -1,38 +1,30 @@
|
|
|
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
|
* Archives widget JSX component.
|
|
29
19
|
* @module view/widget/archives
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
22
|
+
Component = _require.Component;
|
|
23
|
+
var _require2 = require('hexo/lib/plugins/helper/date'),
|
|
24
|
+
toMomentLocale = _require2.toMomentLocale;
|
|
25
|
+
var _require3 = require('../../util/cache'),
|
|
26
|
+
cacheComponent = _require3.cacheComponent;
|
|
33
27
|
|
|
34
|
-
var _require2 = require('../../util/cache'),
|
|
35
|
-
cacheComponent = _require2.cacheComponent;
|
|
36
28
|
/**
|
|
37
29
|
* Archives widget JSX component.
|
|
38
30
|
*
|
|
@@ -48,26 +40,20 @@ var _require2 = require('../../util/cache'),
|
|
|
48
40
|
* }
|
|
49
41
|
* ]} />
|
|
50
42
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
43
|
var Archives = /*#__PURE__*/function (_Component) {
|
|
54
44
|
_inherits(Archives, _Component);
|
|
55
|
-
|
|
56
45
|
var _super = _createSuper(Archives);
|
|
57
|
-
|
|
58
46
|
function Archives() {
|
|
59
47
|
_classCallCheck(this, Archives);
|
|
60
|
-
|
|
61
48
|
return _super.apply(this, arguments);
|
|
62
49
|
}
|
|
63
|
-
|
|
64
50
|
_createClass(Archives, [{
|
|
65
51
|
key: "render",
|
|
66
52
|
value: function render() {
|
|
67
53
|
var _this$props = this.props,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
items = _this$props.items,
|
|
55
|
+
title = _this$props.title,
|
|
56
|
+
showCount = _this$props.showCount;
|
|
71
57
|
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", items.map(function (archive) {
|
|
72
58
|
return (0, _inferno.createVNode)(1, "li", null, (0, _inferno.createVNode)(1, "a", "level is-mobile", [(0, _inferno.createVNode)(1, "span", "level-start", (0, _inferno.createVNode)(1, "span", "level-item", archive.name, 0), 2), showCount ? (0, _inferno.createVNode)(1, "span", "level-end", (0, _inferno.createVNode)(1, "span", "level-item tag", archive.count, 0), 2) : null], 0, {
|
|
73
59
|
"href": archive.url
|
|
@@ -77,7 +63,6 @@ var Archives = /*#__PURE__*/function (_Component) {
|
|
|
77
63
|
});
|
|
78
64
|
}
|
|
79
65
|
}]);
|
|
80
|
-
|
|
81
66
|
return Archives;
|
|
82
67
|
}(Component);
|
|
83
68
|
/**
|
|
@@ -109,49 +94,42 @@ var Archives = /*#__PURE__*/function (_Component) {
|
|
|
109
94
|
* showCount={true}
|
|
110
95
|
* format="MMMM YYYY" />
|
|
111
96
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
97
|
Archives.Cacheable = cacheComponent(Archives, 'widget.archives', function (props) {
|
|
115
98
|
var site = props.site,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
99
|
+
config = props.config,
|
|
100
|
+
page = props.page,
|
|
101
|
+
helper = props.helper,
|
|
102
|
+
widget = props.widget;
|
|
103
|
+
var _widget$type = widget.type,
|
|
104
|
+
type = _widget$type === void 0 ? 'monthly' : _widget$type,
|
|
105
|
+
_widget$order = widget.order,
|
|
106
|
+
order = _widget$order === void 0 ? -1 : _widget$order,
|
|
107
|
+
_widget$showCount = widget.showCount,
|
|
108
|
+
showCount = _widget$showCount === void 0 ? true : _widget$showCount,
|
|
109
|
+
_widget$format = widget.format,
|
|
110
|
+
format = _widget$format === void 0 ? null : _widget$format;
|
|
127
111
|
var url_for = helper.url_for,
|
|
128
|
-
|
|
112
|
+
_p = helper._p;
|
|
129
113
|
var posts = site.posts.sort('date', order);
|
|
130
|
-
|
|
131
114
|
if (!posts.length) {
|
|
132
115
|
return null;
|
|
133
116
|
}
|
|
134
|
-
|
|
135
|
-
var language = page.lang || page.language || config.language;
|
|
117
|
+
var language = toMomentLocale(page.lang || page.language || config.language);
|
|
136
118
|
var data = [];
|
|
137
119
|
var length = 0;
|
|
138
120
|
posts.forEach(function (post) {
|
|
139
121
|
// Clone the date object to avoid pollution
|
|
140
122
|
var date = post.date.clone();
|
|
141
|
-
|
|
142
123
|
if (config.timezone) {
|
|
143
124
|
date = date.tz(config.timezone);
|
|
144
125
|
}
|
|
145
|
-
|
|
146
126
|
if (language) {
|
|
147
127
|
date = date.locale(language);
|
|
148
128
|
}
|
|
149
|
-
|
|
150
129
|
var year = date.year();
|
|
151
130
|
var month = date.month() + 1;
|
|
152
|
-
var name = date.format(format || type === 'monthly' ? 'MMMM YYYY' : 'YYYY');
|
|
131
|
+
var name = date.format(format || (type === 'monthly' ? 'MMMM YYYY' : 'YYYY'));
|
|
153
132
|
var lastData = data[length - 1];
|
|
154
|
-
|
|
155
133
|
if (!lastData || lastData.name !== name) {
|
|
156
134
|
length = data.push({
|
|
157
135
|
name: name,
|
|
@@ -163,18 +141,14 @@ Archives.Cacheable = cacheComponent(Archives, 'widget.archives', function (props
|
|
|
163
141
|
lastData.count++;
|
|
164
142
|
}
|
|
165
143
|
});
|
|
166
|
-
|
|
167
144
|
var link = function link(item) {
|
|
168
145
|
var url = "".concat(config.archive_dir, "/").concat(item.year, "/");
|
|
169
|
-
|
|
170
146
|
if (type === 'monthly') {
|
|
171
147
|
if (item.month < 10) url += '0';
|
|
172
148
|
url += "".concat(item.month, "/");
|
|
173
149
|
}
|
|
174
|
-
|
|
175
150
|
return url_for(url);
|
|
176
151
|
};
|
|
177
|
-
|
|
178
152
|
return {
|
|
179
153
|
items: data.map(function (item) {
|
|
180
154
|
return {
|
|
@@ -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
|
* Categories widget JSX component.
|
|
29
19
|
* @module view/widget/categories
|
|
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
|
* Categories widget JSX component.
|
|
38
28
|
*
|
|
@@ -54,24 +44,17 @@ var _require2 = require('../../util/cache'),
|
|
|
54
44
|
* }
|
|
55
45
|
* ]} />
|
|
56
46
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
47
|
var Categories = /*#__PURE__*/function (_Component) {
|
|
60
48
|
_inherits(Categories, _Component);
|
|
61
|
-
|
|
62
49
|
var _super = _createSuper(Categories);
|
|
63
|
-
|
|
64
50
|
function Categories() {
|
|
65
51
|
_classCallCheck(this, Categories);
|
|
66
|
-
|
|
67
52
|
return _super.apply(this, arguments);
|
|
68
53
|
}
|
|
69
|
-
|
|
70
54
|
_createClass(Categories, [{
|
|
71
55
|
key: "renderList",
|
|
72
56
|
value: function renderList(categories, showCount) {
|
|
73
57
|
var _this = this;
|
|
74
|
-
|
|
75
58
|
return categories.map(function (category) {
|
|
76
59
|
return (0, _inferno.createVNode)(1, "li", null, [(0, _inferno.createVNode)(1, "a", 'level is-mobile' + (category.isCurrent ? ' is-active' : ''), [(0, _inferno.createVNode)(1, "span", "level-start", (0, _inferno.createVNode)(1, "span", "level-item", category.name, 0), 2), showCount ? (0, _inferno.createVNode)(1, "span", "level-end", (0, _inferno.createVNode)(1, "span", "level-item tag", category.count, 0), 2) : null], 0, {
|
|
77
60
|
"href": category.url
|
|
@@ -82,15 +65,14 @@ var Categories = /*#__PURE__*/function (_Component) {
|
|
|
82
65
|
key: "render",
|
|
83
66
|
value: function render() {
|
|
84
67
|
var _this$props = this.props,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
title = _this$props.title,
|
|
69
|
+
showCount = _this$props.showCount,
|
|
70
|
+
categories = _this$props.categories;
|
|
88
71
|
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", this.renderList(categories, showCount), 0)], 4), 2), 2, {
|
|
89
72
|
"data-type": "categories"
|
|
90
73
|
});
|
|
91
74
|
}
|
|
92
75
|
}]);
|
|
93
|
-
|
|
94
76
|
return Categories;
|
|
95
77
|
}(Component);
|
|
96
78
|
/**
|
|
@@ -119,37 +101,32 @@ var Categories = /*#__PURE__*/function (_Component) {
|
|
|
119
101
|
* showCount={true}
|
|
120
102
|
* depth={3} />
|
|
121
103
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
104
|
Categories.Cacheable = cacheComponent(Categories, 'widget.categories', function (props) {
|
|
125
105
|
var page = props.page,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
106
|
+
helper = props.helper,
|
|
107
|
+
_props$widget = props.widget,
|
|
108
|
+
widget = _props$widget === void 0 ? {} : _props$widget;
|
|
109
|
+
var _widget$categories = widget.categories,
|
|
110
|
+
categories = _widget$categories === void 0 ? props.site.categories : _widget$categories,
|
|
111
|
+
_widget$orderBy = widget.orderBy,
|
|
112
|
+
orderBy = _widget$orderBy === void 0 ? 'name' : _widget$orderBy,
|
|
113
|
+
_widget$order = widget.order,
|
|
114
|
+
order = _widget$order === void 0 ? 1 : _widget$order,
|
|
115
|
+
_widget$showCurrent = widget.showCurrent,
|
|
116
|
+
showCurrent = _widget$showCurrent === void 0 ? false : _widget$showCurrent,
|
|
117
|
+
_widget$showCount = widget.showCount,
|
|
118
|
+
showCount = _widget$showCount === void 0 ? true : _widget$showCount;
|
|
137
119
|
var url_for = helper.url_for,
|
|
138
|
-
|
|
139
|
-
|
|
120
|
+
_p = helper._p;
|
|
140
121
|
if (!categories || !categories.length) {
|
|
141
122
|
return null;
|
|
142
123
|
}
|
|
143
|
-
|
|
144
124
|
var depth = 0;
|
|
145
|
-
|
|
146
125
|
try {
|
|
147
126
|
depth = parseInt(props.depth, 10);
|
|
148
127
|
} catch (e) {}
|
|
149
|
-
|
|
150
128
|
function prepareQuery(parent) {
|
|
151
129
|
var query = {};
|
|
152
|
-
|
|
153
130
|
if (parent) {
|
|
154
131
|
query.parent = parent;
|
|
155
132
|
} else {
|
|
@@ -157,36 +134,28 @@ Categories.Cacheable = cacheComponent(Categories, 'widget.categories', function
|
|
|
157
134
|
$exists: false
|
|
158
135
|
};
|
|
159
136
|
}
|
|
160
|
-
|
|
161
137
|
return categories.find(query).sort(orderBy, order).filter(function (cat) {
|
|
162
138
|
return cat.length;
|
|
163
139
|
});
|
|
164
140
|
}
|
|
165
|
-
|
|
166
141
|
function hierarchicalList(level, parent) {
|
|
167
142
|
return prepareQuery(parent).map(function (cat, i) {
|
|
168
143
|
var children = [];
|
|
169
|
-
|
|
170
144
|
if (!depth || level + 1 < depth) {
|
|
171
145
|
children = hierarchicalList(level + 1, cat._id);
|
|
172
146
|
}
|
|
173
|
-
|
|
174
147
|
var isCurrent = false;
|
|
175
|
-
|
|
176
148
|
if (showCurrent && page) {
|
|
177
149
|
for (var j = 0; j < cat.length; j++) {
|
|
178
150
|
var post = cat.posts.data[j];
|
|
179
|
-
|
|
180
151
|
if (post && post._id === page._id) {
|
|
181
152
|
isCurrent = true;
|
|
182
153
|
break;
|
|
183
154
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
155
|
+
}
|
|
156
|
+
// special case: category page
|
|
187
157
|
isCurrent = isCurrent || page.base && page.base.startsWith(cat.path);
|
|
188
158
|
}
|
|
189
|
-
|
|
190
159
|
return {
|
|
191
160
|
children: children,
|
|
192
161
|
isCurrent: isCurrent,
|
|
@@ -196,7 +165,6 @@ Categories.Cacheable = cacheComponent(Categories, 'widget.categories', function
|
|
|
196
165
|
};
|
|
197
166
|
});
|
|
198
167
|
}
|
|
199
|
-
|
|
200
168
|
return {
|
|
201
169
|
showCount: showCount,
|
|
202
170
|
categories: hierarchicalList(0),
|
|
@@ -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
|
* follow.it widget JSX component.
|
|
29
19
|
* @module view/widget/followit
|
|
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
|
* follow.it widget JSX component.
|
|
38
28
|
*
|
|
@@ -44,27 +34,21 @@ var _require2 = require('../../util/cache'),
|
|
|
44
34
|
* buttonTitle="Subscribe now"
|
|
45
35
|
* actionUrl="https://api.follow.it/subscription-form/******" />
|
|
46
36
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
37
|
var FollowIt = /*#__PURE__*/function (_Component) {
|
|
50
38
|
_inherits(FollowIt, _Component);
|
|
51
|
-
|
|
52
39
|
var _super = _createSuper(FollowIt);
|
|
53
|
-
|
|
54
40
|
function FollowIt() {
|
|
55
41
|
_classCallCheck(this, FollowIt);
|
|
56
|
-
|
|
57
42
|
return _super.apply(this, arguments);
|
|
58
43
|
}
|
|
59
|
-
|
|
60
44
|
_createClass(FollowIt, [{
|
|
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
|
+
actionUrl = _this$props.actionUrl,
|
|
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)(1, "div", "field has-addons", [(0, _inferno.createVNode)(1, "div", "control has-icons-left is-expanded", [(0, _inferno.createVNode)(64, "input", "input", null, 1, {
|
|
69
53
|
"name": "email",
|
|
70
54
|
"type": "email",
|
|
@@ -81,7 +65,6 @@ var FollowIt = /*#__PURE__*/function (_Component) {
|
|
|
81
65
|
});
|
|
82
66
|
}
|
|
83
67
|
}]);
|
|
84
|
-
|
|
85
68
|
return FollowIt;
|
|
86
69
|
}(Component);
|
|
87
70
|
/**
|
|
@@ -99,13 +82,11 @@ var FollowIt = /*#__PURE__*/function (_Component) {
|
|
|
99
82
|
* }}
|
|
100
83
|
* helper={{ __: function() {...} }} />
|
|
101
84
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
85
|
FollowIt.Cacheable = cacheComponent(FollowIt, 'widget.followit', function (props) {
|
|
105
86
|
var helper = props.helper,
|
|
106
|
-
|
|
87
|
+
widget = props.widget;
|
|
107
88
|
var action_url = widget.action_url,
|
|
108
|
-
|
|
89
|
+
description = widget.description;
|
|
109
90
|
return {
|
|
110
91
|
description: description,
|
|
111
92
|
actionUrl: action_url,
|