@tryghost/helpers-gatsby 2.0.3 → 2.0.5
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 +0 -14
- package/lib/index.js +0 -2
- package/package.json +8 -8
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
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* Tags helper
|
|
20
14
|
*
|
|
@@ -48,12 +42,10 @@ 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 === '') {
|
|
@@ -63,28 +55,24 @@ var Tags = function Tags(props) {
|
|
|
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,
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/helpers-gatsby",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"repository": "https://github.com/TryGhost/SDK/tree/master/packages/helpers-gatsby",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/cli": "7.
|
|
28
|
-
"@babel/core": "7.
|
|
29
|
-
"@babel/preset-env": "7.
|
|
27
|
+
"@babel/cli": "7.19.3",
|
|
28
|
+
"@babel/core": "7.20.5",
|
|
29
|
+
"@babel/preset-env": "7.20.2",
|
|
30
30
|
"@babel/preset-react": "7.18.6",
|
|
31
31
|
"c8": "7.12.0",
|
|
32
|
-
"mocha": "10.
|
|
32
|
+
"mocha": "10.1.0",
|
|
33
33
|
"react": "18.2.0",
|
|
34
34
|
"rimraf": "3.0.2",
|
|
35
35
|
"should": "13.2.3",
|
|
36
|
-
"sinon": "
|
|
36
|
+
"sinon": "15.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@gatsbyjs/reach-router": "1.3.9",
|
|
40
|
-
"@tryghost/helpers": "^1.1.
|
|
40
|
+
"@tryghost/helpers": "^1.1.75",
|
|
41
41
|
"gatsby-link": "4.17.0",
|
|
42
42
|
"prop-types": "^15.6.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^18.1.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "bc7ef4154981d09195c25acd6eda0531b1cffa32"
|
|
48
48
|
}
|