gatsby-plugin-disqus
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -20,3 +20,2 @@ "use strict"; | ||
var _jsxFileName = "/Users/brettstevenson/Desktop/Folder/gatsby-plugin-workspace/gatsby-plugin-disqus/src/components/CommentCount.jsx"; | ||
var queueResetCount = (0, _utils.debounce)(function () { | ||
@@ -48,3 +47,6 @@ if (window.DISQUSWIDGETS) { | ||
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { | ||
if (this.props === nextProps) return false; | ||
if (this.props === nextProps) { | ||
return false; | ||
} | ||
return (0, _utils.shallowComparison)(this.props, nextProps); | ||
@@ -77,16 +79,11 @@ }; | ||
config = _this$props.config, | ||
className = _this$props.className, | ||
placeholder = _this$props.placeholder, | ||
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["config", "placeholder"]); | ||
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["config", "className", "placeholder"]); | ||
var componentClass = "disqus-comment-count" + (className ? " " + className : ''); | ||
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({ | ||
className: "disqus-comment-count", | ||
className: componentClass, | ||
"data-disqus-identifier": config.identifier, | ||
"data-disqus-url": config.url | ||
}, props, { | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 53, | ||
columnNumber: 7 | ||
} | ||
}), placeholder); | ||
}, props), placeholder); | ||
}; | ||
@@ -104,20 +101,20 @@ | ||
/* | ||
* Tells the Disqus service how to identify the current page. | ||
* When the Disqus embed is loaded, the identifier is used to look up | ||
* the correct thread. | ||
*/ | ||
* Tells the Disqus service how to identify the current page. | ||
* When the Disqus embed is loaded, the identifier is used to look up | ||
* the correct thread. | ||
*/ | ||
identifier: _propTypes.default.string, | ||
/* | ||
* Tells the Disqus service the title of the current page. | ||
* This is used when creating the thread on Disqus. | ||
*/ | ||
* Tells the Disqus service the title of the current page. | ||
* This is used when creating the thread on Disqus. | ||
*/ | ||
title: _propTypes.default.string, | ||
/* | ||
* Tells the Disqus service the URL of the current page. | ||
* This URL is used when a thread is created so that Disqus knows which | ||
* page a thread belongs to. | ||
* (If undefined, Disqus will use the global.location.href) | ||
*/ | ||
* Tells the Disqus service the URL of the current page. | ||
* This URL is used when a thread is created so that Disqus knows which | ||
* page a thread belongs to. | ||
* (If undefined, Disqus will use the global.location.href) | ||
*/ | ||
url: _propTypes.default.string | ||
@@ -127,6 +124,11 @@ }), | ||
/* | ||
* This is the text that will be used as a placeholder prior to | ||
* loading the response. | ||
*/ | ||
placeholder: _propTypes.default.string | ||
* This is the text that will be used as a placeholder prior to | ||
* loading the response. | ||
*/ | ||
placeholder: _propTypes.default.string, | ||
/* | ||
* This allows users to pass a custom class to the comment-count component | ||
*/ | ||
className: _propTypes.default.string | ||
}; |
@@ -8,2 +8,6 @@ "use strict"; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); | ||
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")); | ||
@@ -15,4 +19,2 @@ | ||
var _jsxFileName = "/Users/brettstevenson/Desktop/Folder/gatsby-plugin-workspace/gatsby-plugin-disqus/src/components/CommentEmbed.jsx"; | ||
var CommentEmbed = /*#__PURE__*/function (_React$Component) { | ||
@@ -36,3 +38,9 @@ (0, _inheritsLoose2.default)(CommentEmbed, _React$Component); | ||
_proto.render = function render() { | ||
return /*#__PURE__*/_react.default.createElement("iframe", { | ||
// eslint-disable-next-line no-unused-vars | ||
var _this$props = this.props, | ||
commentId = _this$props.commentId, | ||
showMedia = _this$props.showMedia, | ||
showParentComment = _this$props.showParentComment, | ||
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["commentId", "showMedia", "showParentComment"]); | ||
return /*#__PURE__*/_react.default.createElement("iframe", (0, _extends2.default)({ | ||
src: this.getSrc(), | ||
@@ -44,9 +52,4 @@ width: this.props.width, | ||
frameBorder: "0", | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 17, | ||
columnNumber: 13 | ||
} | ||
}); | ||
title: "embedded-comment" | ||
}, props)); | ||
}; | ||
@@ -68,5 +71,5 @@ | ||
* The ID can be found in the Disqus moderation panel or as a `data-post-id` | ||
* attribute on the HTML element. | ||
* attribute on the HTML element. | ||
*/ | ||
commentId: _propTypes.default.string.isRequired, | ||
commentId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired, | ||
@@ -84,3 +87,3 @@ /* | ||
/* | ||
* Determines whether the embedded comment should include or omit media from | ||
* Determines whether the embedded comment should include or omit media from | ||
* within the original comment. | ||
@@ -91,5 +94,5 @@ */ | ||
/* | ||
* Determines whether the parent comment should be displayed for nested comments. | ||
*/ | ||
* Determines whether the parent comment should be displayed for * nested comments. | ||
*/ | ||
showParentComment: _propTypes.default.bool | ||
}; |
@@ -20,4 +20,2 @@ "use strict"; | ||
var _jsxFileName = "/Users/brettstevenson/Desktop/Folder/gatsby-plugin-workspace/gatsby-plugin-disqus/src/components/Disqus.jsx"; | ||
var Disqus = /*#__PURE__*/function (_React$Component) { | ||
@@ -109,3 +107,3 @@ (0, _inheritsLoose2.default)(Disqus, _React$Component); | ||
if (iframeQuery) { | ||
var iframe = window.document.getElementById(window.document.querySelector('[id^="dsq-app"]').id); | ||
var iframe = window.document.getElementById(iframeQuery.id); | ||
iframe.parentNode.removeChild(iframe); | ||
@@ -116,2 +114,3 @@ } | ||
_proto.render = function render() { | ||
// eslint-disable-next-line no-unused-vars | ||
var _this$props = this.props, | ||
@@ -122,10 +121,3 @@ config = _this$props.config, | ||
id: "disqus_thread" | ||
}, props, { | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 86, | ||
columnNumber: 7 | ||
} | ||
})); | ||
}, props)); | ||
}; | ||
@@ -140,41 +132,41 @@ | ||
/* | ||
* Tells the Disqus service how to identify the current page. | ||
* When the Disqus embed is loaded, the identifier is used to look up | ||
* the correct thread. | ||
*/ | ||
* Tells the Disqus service how to identify the current page. | ||
* When the Disqus embed is loaded, the identifier is used to look up | ||
* the correct thread. | ||
*/ | ||
identifier: _propTypes.default.string, | ||
/* | ||
* Tells the Disqus service the title of the current page. | ||
* This is used when creating the thread on Disqus. | ||
*/ | ||
* Tells the Disqus service the title of the current page. | ||
* This is used when creating the thread on Disqus. | ||
*/ | ||
title: _propTypes.default.string, | ||
/* | ||
* Tells the Disqus service the URL of the current page. | ||
* This URL is used when a thread is created so that Disqus knows which | ||
* page a thread belongs to. | ||
* (If undefined, Disqus will use the global.location.href) | ||
*/ | ||
* Tells the Disqus service the URL of the current page. | ||
* This URL is used when a thread is created so that Disqus knows which | ||
* page a thread belongs to. | ||
* (If undefined, Disqus will use the global.location.href) | ||
*/ | ||
url: _propTypes.default.string, | ||
/* | ||
* Tells the Disqus service to override the default site language for the | ||
* current page. | ||
* This allows for dynamically loading the Disqus embed in different | ||
* languages on a per-page basis. | ||
* (If undefined, Disqus will use the default site language) | ||
*/ | ||
* Tells the Disqus service to override the default site language for the | ||
* current page. | ||
* This allows for dynamically loading the Disqus embed in different | ||
* languages on a per-page basis. | ||
* (If undefined, Disqus will use the default site language) | ||
*/ | ||
language: _propTypes.default.string, | ||
/* | ||
The generated payload used to pass Single Sign-On (SSO) user data | ||
*/ | ||
The generated payload used to pass Single Sign-On (SSO) user data | ||
*/ | ||
remoteAuthS3: _propTypes.default.string, | ||
/* | ||
* This is the public API key for your Single Sign-On (SSO) integration | ||
*/ | ||
* This is the public API key for your Single Sign-On (SSO) integration | ||
*/ | ||
apiKey: _propTypes.default.string | ||
}) | ||
}; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var didRunAlready = false; |
{ | ||
"name": "gatsby-plugin-disqus", | ||
"description": "A component for integrating Disqus comments in Gatsby.", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"repository": "https://github.com/tterb/gatsby-plugin-disqus", | ||
@@ -22,24 +22,44 @@ "homepage": "https://brettstevenson.io/gatsby-plugin-disqus", | ||
"scripts": { | ||
"release": "standard-version", | ||
"copy-files": "mkdir lib || true && cp .eslintrc readme.md package.json lib", | ||
"clean": "rm -r lib", | ||
"copy-files": "mkdir lib || true && cp .eslintrc README.md package.json lib", | ||
"clean": "rimraf lib", | ||
"build": "yarn clean && yarn copy-files && babel src --out-dir lib --copy-files --ignore **/__tests__", | ||
"lint": "eslint --debug .", | ||
"test": "jest", | ||
"watch": "yarn copy-files && babel -w src --out-dir lib --copy-files --ignore **/__tests__", | ||
"npm-publish": "git push --follow-tags origin master && yarn build && cd lib && npm publish && cd ../" | ||
"release": "standard-version", | ||
"npm-publish": "git push --follow-tags origin master && yarn build && cd lib && npm publish && cd ../", | ||
"dry-run": "./bin/publish-dry-run.sh" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.2", | ||
"@babel/core": "^7.1.2", | ||
"@babel/plugin-proposal-class-properties": "^7.1.0", | ||
"@babel/plugin-transform-spread": "^7.10.1", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"babel-preset-gatsby-package": "^0.1.2", | ||
"@testing-library/jest-dom": "^5.0.0", | ||
"@testing-library/react": "^9.4.0", | ||
"babel-eslint": "^8.0.3", | ||
"babel-jest": "^24.9.0", | ||
"babel-preset-gatsby-package": "^0.2.5", | ||
"cross-env": "^5.2.0", | ||
"prop-types": "^15.6.2" | ||
"eslint": "^5.11.1", | ||
"eslint-config-airbnb": "^17.1.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-jsx-a11y": "^6.1.2", | ||
"eslint-plugin-react": "^7.16.0", | ||
"jest": "^24.9.0", | ||
"prop-types": "^15.6.2", | ||
"rimraf": "^3.0.2" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"react": "^16.8.5" | ||
"react": "^16.0.0 || ^17.0.0" | ||
}, | ||
"standard": { | ||
"parser": "babel-eslint" | ||
}, | ||
"jest": { | ||
"roots": [ | ||
"src" | ||
] | ||
} | ||
} |
11
utils.js
@@ -36,4 +36,7 @@ "use strict"; | ||
return function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var context = this; | ||
var args = arguments; | ||
@@ -59,7 +62,7 @@ var deferredExecution = function deferredExecution() { | ||
function isReactElement(element) { | ||
if (_react.default.isValidElement(element)) { | ||
if ( /*#__PURE__*/_react.default.isValidElement(element)) { | ||
return true; | ||
} else if (Array.isArray(element)) { | ||
return element.some(function (value) { | ||
return _react.default.isValidElement(value); | ||
return /*#__PURE__*/_react.default.isValidElement(value); | ||
}); | ||
@@ -86,2 +89,4 @@ } | ||
} | ||
return false; | ||
}); | ||
@@ -88,0 +93,0 @@ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24409
0
18
406