These are all the files from the Tabler react repos, made to work with laravel and webpack.

This commit is contained in:
James Cole
2019-01-04 17:03:16 +01:00
parent 961e7e92b3
commit 40028c8be7
94 changed files with 51417 additions and 3 deletions

View File

@@ -0,0 +1,68 @@
Object.defineProperty(exports, "__esModule", {
value: true,
});
var _formatReactElementNode = require("./formatReactElementNode");
var _formatReactElementNode2 = _interopRequireDefault(_formatReactElementNode);
var _formatReactFragmentNode = require("./formatReactFragmentNode");
var _formatReactFragmentNode2 = _interopRequireDefault(
_formatReactFragmentNode
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var jsxStopChars = ["<", ">", "{", "}"];
var shouldBeEscaped = function shouldBeEscaped(s) {
return jsxStopChars.some(function(jsxStopChar) {
return s.includes(jsxStopChar);
});
};
var escape = function escape(s) {
if (!shouldBeEscaped(s)) {
return s;
}
return "{`" + s + "`}";
};
var preserveTrailingSpace = function preserveTrailingSpace(s) {
var result = s;
if (result.endsWith(" ")) {
result = result.replace(/^(\S*)(\s*)$/, "$1{'$2'}");
}
if (result.startsWith(" ")) {
result = result.replace(/^(\s*)(\S*)$/, "{'$1'}$2");
}
return result;
};
exports.default = function(node, inline, lvl, options) {
if (node.type === "number") {
return String(node.value);
}
if (node.type === "string") {
return node.value
? "" + preserveTrailingSpace(escape(String(node.value)))
: "";
}
if (node.type === "ReactElement") {
return (0, _formatReactElementNode2.default)(node, inline, lvl, options);
}
if (node.type === "ReactFragment") {
return (0, _formatReactFragmentNode2.default)(node, inline, lvl, options);
}
throw new TypeError('Unknow format type "' + node.type + '"');
};
//# sourceMappingURL=formatTreeNode.js.map