@thoughtbot/superglue 0.41.0 → 0.50.0-beta1
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/package.json +1 -3
- package/utils/ujs.js +1 -2
- package/components/RailsTag.js +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtbot/superglue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0-beta1",
|
|
4
4
|
"description": "Use a vanilla Rails with React and Redux",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"fetch-headers": "^2.0.0",
|
|
28
28
|
"fetch-mock": "^9.11.0",
|
|
29
29
|
"history": "^5.3.0",
|
|
30
|
-
"html-react-parser": "^1.2.6",
|
|
31
30
|
"jest": "^27.0.4",
|
|
32
31
|
"node-fetch": "^2.6.1",
|
|
33
32
|
"prettier": "^2.3.1",
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"history": "^5.3.0",
|
|
44
|
-
"html-react-parser": ">=1.2.6",
|
|
45
43
|
"react": ">=16",
|
|
46
44
|
"react-redux": ">=7.2",
|
|
47
45
|
"redux": ">=4.1",
|
package/utils/ujs.js
CHANGED
|
@@ -74,9 +74,8 @@ var HandlerBuilder = /*#__PURE__*/function () {
|
|
|
74
74
|
event.preventDefault();
|
|
75
75
|
var url = link.getAttribute('href');
|
|
76
76
|
url = (0, _url.withoutBusters)(url);
|
|
77
|
-
var method = link.getAttribute(this.attributePrefix + '-method') || 'GET';
|
|
78
77
|
this.visitOrRemote(link, url, {
|
|
79
|
-
method:
|
|
78
|
+
method: 'GET'
|
|
80
79
|
});
|
|
81
80
|
};
|
|
82
81
|
|
package/components/RailsTag.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
|
|
8
|
-
var _htmlReactParser = _interopRequireWildcard(require("html-react-parser"));
|
|
9
|
-
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
-
|
|
18
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
19
|
-
|
|
20
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
-
|
|
22
|
-
var RailsTag = /*#__PURE__*/function (_React$Component) {
|
|
23
|
-
_inheritsLoose(RailsTag, _React$Component);
|
|
24
|
-
|
|
25
|
-
function RailsTag(props) {
|
|
26
|
-
var _this;
|
|
27
|
-
|
|
28
|
-
_this = _React$Component.call(this, props) || this;
|
|
29
|
-
_this.replace = _this.replace.bind(_assertThisInitialized(_this));
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var _proto = RailsTag.prototype;
|
|
34
|
-
|
|
35
|
-
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
|
36
|
-
return this.props.html !== nextProps.html;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
_proto.replace = function replace(domNode) {
|
|
40
|
-
var parent = domNode.parent,
|
|
41
|
-
type = domNode.type,
|
|
42
|
-
name = domNode.name,
|
|
43
|
-
attribs = domNode.attribs,
|
|
44
|
-
children = domNode.children;
|
|
45
|
-
|
|
46
|
-
if (!parent && type === 'tag') {
|
|
47
|
-
var nextProps = Object.assign({}, this.props, (0, _htmlReactParser.attributesToProps)(attribs), {
|
|
48
|
-
children: (0, _htmlReactParser.domToReact)(children)
|
|
49
|
-
});
|
|
50
|
-
delete nextProps.html;
|
|
51
|
-
return /*#__PURE__*/_react["default"].createElement(name, nextProps);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
_proto.render = function render() {
|
|
56
|
-
return (0, _htmlReactParser["default"])(this.props.html, {
|
|
57
|
-
replace: this.replace
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return RailsTag;
|
|
62
|
-
}(_react["default"].Component);
|
|
63
|
-
|
|
64
|
-
exports["default"] = RailsTag;
|