@tryghost/helpers-gatsby 2.0.30 → 2.0.32
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/Tags.js +3 -18
- package/lib/index.js +1 -3
- package/package.json +5 -5
package/lib/Tags.js
CHANGED
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _gatsbyLink = _interopRequireDefault(require("gatsby-link"));
|
|
13
|
-
|
|
14
10
|
var _helpers = require("@tryghost/helpers");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
12
|
/**
|
|
19
13
|
* Tags helper
|
|
20
14
|
*
|
|
@@ -48,43 +42,37 @@ var Tags = function Tags(props) {
|
|
|
48
42
|
visibility: props.visibility
|
|
49
43
|
};
|
|
50
44
|
var keyIndex = 0;
|
|
51
|
-
|
|
52
45
|
var generateKey = function generateKey(pre) {
|
|
53
46
|
keyIndex = keyIndex + 1;
|
|
54
47
|
return "".concat(pre, "_").concat(keyIndex);
|
|
55
48
|
};
|
|
56
|
-
|
|
57
49
|
Object.defineProperty(opts, 'separator', {
|
|
58
50
|
get: function get() {
|
|
59
51
|
if (props.separator === '') {
|
|
60
52
|
return null;
|
|
61
|
-
} else if (
|
|
53
|
+
} else if (/*#__PURE__*/_react["default"].isValidElement(props.separator)) {
|
|
62
54
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
63
55
|
key: generateKey('separator')
|
|
64
56
|
}, props.separator);
|
|
65
57
|
}
|
|
66
|
-
|
|
67
58
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
68
59
|
className: props.separatorClasses,
|
|
69
60
|
key: generateKey('separator')
|
|
70
61
|
}, props.separator);
|
|
71
62
|
}
|
|
72
63
|
});
|
|
73
|
-
|
|
74
64
|
if (props.prefix) {
|
|
75
65
|
opts.prefix = /*#__PURE__*/_react["default"].isValidElement(props.prefix) ? props.prefix : /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
66
|
className: props.prefixClasses,
|
|
77
67
|
key: "prefix"
|
|
78
68
|
}, props.prefix);
|
|
79
69
|
}
|
|
80
|
-
|
|
81
70
|
if (props.suffix) {
|
|
82
71
|
opts.suffix = /*#__PURE__*/_react["default"].isValidElement(props.suffix) ? props.suffix : /*#__PURE__*/_react["default"].createElement("span", {
|
|
83
72
|
className: props.suffixClasses,
|
|
84
73
|
key: "suffix"
|
|
85
74
|
}, props.suffix);
|
|
86
75
|
}
|
|
87
|
-
|
|
88
76
|
opts.fn = function process(tag) {
|
|
89
77
|
var tagLink = props.permalink;
|
|
90
78
|
tagLink = tagLink.replace(/:slug/, tag.slug) || "/".concat(tag.slug, "/");
|
|
@@ -99,10 +87,8 @@ var Tags = function Tags(props) {
|
|
|
99
87
|
key: tag.slug
|
|
100
88
|
}, tag.name);
|
|
101
89
|
};
|
|
102
|
-
|
|
103
90
|
return (0, _helpers.tags)(props.post, opts);
|
|
104
91
|
};
|
|
105
|
-
|
|
106
92
|
Tags.defaultProps = {
|
|
107
93
|
separator: ", ",
|
|
108
94
|
from: 1,
|
|
@@ -134,5 +120,4 @@ Tags.propTypes = {
|
|
|
134
120
|
suffixClasses: _propTypes["default"].string,
|
|
135
121
|
linkClasses: _propTypes["default"].string
|
|
136
122
|
};
|
|
137
|
-
var _default = Tags;
|
|
138
|
-
exports["default"] = _default;
|
|
123
|
+
var _default = exports["default"] = Tags;
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "Tags", {
|
|
|
9
9
|
return _Tags["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _Tags = _interopRequireDefault(require("./Tags"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/helpers-gatsby",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/TryGhost/SDK.git",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"c8": "10.1.3",
|
|
36
36
|
"mocha": "11.7.5",
|
|
37
37
|
"react": "18.3.1",
|
|
38
|
-
"rimraf": "6.1.
|
|
38
|
+
"rimraf": "6.1.2",
|
|
39
39
|
"should": "13.2.3",
|
|
40
|
-
"sinon": "21.0.
|
|
40
|
+
"sinon": "21.0.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@gatsbyjs/reach-router": "1.3.9",
|
|
44
|
-
"@tryghost/helpers": "^1.1.
|
|
44
|
+
"@tryghost/helpers": "^1.1.100",
|
|
45
45
|
"gatsby-link": "4.17.0",
|
|
46
46
|
"prop-types": "^15.6.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^18.1.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a5b249c5514742350f74bcb30b332977d373598a"
|
|
52
52
|
}
|