hexo-component-inferno 4.2.0 → 4.2.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.
@@ -21,7 +21,7 @@
21
21
  "theme": {
22
22
  "type": "string",
23
23
  "description": "Theme of Cusdis: light, dark, or auto to follow the system color scheme. Follows the appearance of the theme (the data-appearance attribute of <html>) if not set",
24
- "enum": ["light", "dark", "auto"],
24
+ "enum": ["light", "dark", "auto", null],
25
25
  "nullable": true
26
26
  },
27
27
  "lang": {
@@ -29,7 +29,7 @@
29
29
  "mapping": {
30
30
  "type": "string",
31
31
  "description": "The mapping between the embedding page and the embedded discussion",
32
- "enum": ["pathname", "url", "title", "og:title", "specific", "number"],
32
+ "enum": ["pathname", "url", "title", "og:title", "specific", "number", null],
33
33
  "default": "pathname",
34
34
  "nullable": true
35
35
  },
@@ -59,7 +59,7 @@
59
59
  "inputPosition": {
60
60
  "type": "string",
61
61
  "description": "Where the input block will display",
62
- "enum": ["top", "bottom"],
62
+ "enum": ["top", "bottom", null],
63
63
  "default": "top",
64
64
  "nullable": true
65
65
  },
@@ -83,7 +83,8 @@
83
83
  "noborder_gray",
84
84
  "cobalt",
85
85
  "purple_dark",
86
- "custom"
86
+ "custom",
87
+ null
87
88
  ],
88
89
  "default": "noborder_light",
89
90
  "nullable": true
@@ -26,7 +26,8 @@
26
26
  "github-dark-orange",
27
27
  "icy-dark",
28
28
  "dark-blue",
29
- "photon-dark"
29
+ "photon-dark",
30
+ null
30
31
  ],
31
32
  "default": "github-light",
32
33
  "nullable": true
@@ -40,7 +41,8 @@
40
41
  "github-dark-orange",
41
42
  "icy-dark",
42
43
  "dark-blue",
43
- "photon-dark"
44
+ "photon-dark",
45
+ null
44
46
  ],
45
47
  "default": "github-dark",
46
48
  "nullable": true
@@ -24,7 +24,18 @@
24
24
  "avatar": {
25
25
  "type": "string",
26
26
  "description": "Gravatar type",
27
- "enum": ["", "mp", "identicon", "monsterid", "wavatar", "robohash", "retro", "hide", "mm"],
27
+ "enum": [
28
+ "",
29
+ "mp",
30
+ "identicon",
31
+ "monsterid",
32
+ "wavatar",
33
+ "robohash",
34
+ "retro",
35
+ "hide",
36
+ "mm",
37
+ null
38
+ ],
28
39
  "default": "mm",
29
40
  "nullable": true
30
41
  },
@@ -19,7 +19,7 @@
19
19
  "lang": {
20
20
  "type": "string",
21
21
  "description": "Display language.",
22
- "enum": ["zh", "zh-CN", "zh-TW", "en", "en-US", "jp", "jp-JP", "pt-BR", "ru", "ru-RU"],
22
+ "enum": ["zh", "zh-CN", "zh-TW", "en", "en-US", "jp", "jp-JP", "pt-BR", "ru", "ru-RU", null],
23
23
  "default": "zh-CN",
24
24
  "nullable": true
25
25
  },
@@ -98,7 +98,7 @@
98
98
  "login": {
99
99
  "type": "string",
100
100
  "description": "Login mode status.",
101
- "enum": ["enable", "disable", "force"],
101
+ "enum": ["enable", "disable", "force", null],
102
102
  "default": "enable",
103
103
  "nullable": true
104
104
  },
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "group_by": {
17
17
  "type": "string",
18
- "enum": ["monthly", "yearly"],
18
+ "enum": ["monthly", "yearly", null],
19
19
  "description": "Whether to group the archives by month or by year. Groups by month if not set",
20
20
  "nullable": true
21
21
  },
22
22
  "order": {
23
23
  "type": "integer",
24
- "enum": [1, -1],
24
+ "enum": [1, -1, null],
25
25
  "description": "1 to show the oldest archives first, or -1 to show the newest first. Shows the newest first if not set",
26
26
  "nullable": true
27
27
  },
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "order": {
22
22
  "type": "integer",
23
- "enum": [1, -1],
23
+ "enum": [1, -1, null],
24
24
  "description": "1 for ascending order, or -1 for descending order. Ascending if not set",
25
25
  "nullable": true
26
26
  },
@@ -23,6 +23,9 @@ var _require = require('inferno'),
23
23
 
24
24
  /**
25
25
  * A simple article overview JSX component.
26
+ * <p>
27
+ * Its thumbnail is only loaded when it is about to be scrolled to: the component lists posts in
28
+ * the archives and in the sidebar, which is below the content on mobile.
26
29
  *
27
30
  * @name ArticleMedia
28
31
  * @example
@@ -63,7 +66,9 @@ module.exports = /*#__PURE__*/function (_Component) {
63
66
  });
64
67
  return (0, _inferno.createVNode)(1, "article", "media", [thumbnail ? (0, _inferno.createVNode)(1, "figure", "media-left", (0, _inferno.createVNode)(1, "a", "image", (0, _inferno.createVNode)(1, "img", null, null, 1, {
65
68
  "src": thumbnail,
66
- "alt": title
69
+ "alt": title,
70
+ "loading": "lazy",
71
+ "decoding": "async"
67
72
  }), 2, {
68
73
  "href": url
69
74
  }), 2) : null, (0, _inferno.createVNode)(1, "div", "media-content", [(0, _inferno.createVNode)(1, "p", "date", (0, _inferno.createVNode)(1, "time", null, date, 0, {
@@ -137,12 +137,10 @@ Archives.Cacheable = cacheComponent(Archives, 'widget.archives', function (props
137
137
  page = props.page,
138
138
  helper = props.helper,
139
139
  widget = props.widget;
140
- var _widget$group_by = widget.group_by,
141
- group_by = _widget$group_by === void 0 ? 'monthly' : _widget$group_by,
142
- _widget$order = widget.order,
143
- order = _widget$order === void 0 ? -1 : _widget$order,
144
- _widget$format = widget.format,
145
- format = _widget$format === void 0 ? null : _widget$format,
140
+ // Options left empty in the config are null, which also take the defaults
141
+ var groupBy = firstSet(widget.group_by, 'monthly');
142
+ var order = firstSet(widget.order, -1);
143
+ var format = widget.format,
146
144
  amount = widget.amount;
147
145
  // show_count, like the tags widget, or showCount, which this widget used to read
148
146
  var showCount = firstSet(widget.show_count, widget.showCount, true);
@@ -167,7 +165,7 @@ Archives.Cacheable = cacheComponent(Archives, 'widget.archives', function (props
167
165
  }
168
166
  var year = date.year();
169
167
  var month = date.month() + 1;
170
- var name = date.format(format || (group_by === 'monthly' ? 'MMMM YYYY' : 'YYYY'));
168
+ var name = date.format(format || (groupBy === 'monthly' ? 'MMMM YYYY' : 'YYYY'));
171
169
  var lastData = data[length - 1];
172
170
  if (!lastData || lastData.name !== name) {
173
171
  length = data.push({
@@ -182,7 +180,7 @@ Archives.Cacheable = cacheComponent(Archives, 'widget.archives', function (props
182
180
  });
183
181
  var link = function link(item) {
184
182
  var url = "".concat(config.archive_dir, "/").concat(item.year, "/");
185
- if (group_by === 'monthly') {
183
+ if (groupBy === 'monthly') {
186
184
  if (item.month < 10) url += '0';
187
185
  url += "".concat(item.month, "/");
188
186
  }
@@ -127,9 +127,9 @@ Categories.Cacheable = cacheComponent(Categories, 'widget.categories', function
127
127
  widget = _props$widget === void 0 ? {} : _props$widget;
128
128
  var _widget$categories = widget.categories,
129
129
  categories = _widget$categories === void 0 ? props.site.categories : _widget$categories,
130
- _widget$order = widget.order,
131
- order = _widget$order === void 0 ? 1 : _widget$order,
132
130
  amount = widget.amount;
131
+ // Options left empty in the config are null, which also take the defaults
132
+ var order = firstSet(widget.order, 1);
133
133
  // Snake case, like the tags widget, or camel case, which this widget used to read
134
134
  var orderBy = firstSet(widget.order_by, widget.orderBy, 'name');
135
135
  var showCurrent = firstSet(widget.show_current, widget.showCurrent, false);
@@ -90,8 +90,8 @@ RecentPosts.Cacheable = cacheComponent(RecentPosts, 'widget.recentposts', functi
90
90
  var site = props.site,
91
91
  helper = props.helper,
92
92
  widget = props.widget;
93
- var _widget$limit = widget.limit,
94
- limit = _widget$limit === void 0 ? 5 : _widget$limit;
93
+ // A limit left empty in the config is null, which would show no posts
94
+ var limit = widget.limit > 0 ? widget.limit : 5;
95
95
  var url_for = helper.url_for,
96
96
  __ = helper.__,
97
97
  date_xml = helper.date_xml,
@@ -95,11 +95,10 @@ Tags.Cacheable = cacheComponent(Tags, 'widget.tags', function (props) {
95
95
  var helper = props.helper,
96
96
  _props$widget = props.widget,
97
97
  widget = _props$widget === void 0 ? {} : _props$widget;
98
- var _widget$order_by = widget.order_by,
99
- order_by = _widget$order_by === void 0 ? 'name' : _widget$order_by,
100
- amount = widget.amount,
101
- _widget$show_count = widget.show_count,
102
- show_count = _widget$show_count === void 0 ? true : _widget$show_count;
98
+ var amount = widget.amount;
99
+ // Options left empty in the config are null, which also take the defaults
100
+ var order_by = widget.order_by || 'name';
101
+ var show_count = widget.show_count !== false;
103
102
  var tags = props.tags || props.site.tags;
104
103
  var url_for = helper.url_for,
105
104
  _p = helper._p,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-component-inferno",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "A collection of Inferno.js layout components and utility scripts for Hexo",
5
5
  "main": "lib/index.js",
6
6
  "repository": "https://github.com/ppoffice/hexo-component-inferno",