update
This commit is contained in:
+142
-106
@@ -1,125 +1,161 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var AnsiPainter, object, styles, tags, tools,
|
||||
hasProp = {}.hasOwnProperty,
|
||||
slice = [].slice;
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var AnsiPainter,
|
||||
styles,
|
||||
tags,
|
||||
tools,
|
||||
hasProp = {}.hasOwnProperty;
|
||||
tools = require('./tools');
|
||||
|
||||
tags = require('./ansiPainter/tags');
|
||||
|
||||
styles = require('./ansiPainter/styles');
|
||||
|
||||
object = require('utila').object;
|
||||
|
||||
module.exports = AnsiPainter = (function() {
|
||||
module.exports = AnsiPainter = function () {
|
||||
var self;
|
||||
|
||||
function AnsiPainter() {}
|
||||
|
||||
AnsiPainter.tags = tags;
|
||||
|
||||
AnsiPainter.prototype.paint = function(s) {
|
||||
return this._replaceSpecialStrings(this._renderDom(this._parse(s)));
|
||||
};
|
||||
|
||||
AnsiPainter.prototype._replaceSpecialStrings = function(str) {
|
||||
return str.replace(/&sp;/g, ' ').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/&/g, '&');
|
||||
};
|
||||
|
||||
AnsiPainter.prototype._parse = function(string, injectFakeRoot) {
|
||||
if (injectFakeRoot == null) {
|
||||
injectFakeRoot = true;
|
||||
var AnsiPainter = /*#__PURE__*/function () {
|
||||
function AnsiPainter() {
|
||||
_classCallCheck(this, AnsiPainter);
|
||||
}
|
||||
if (injectFakeRoot) {
|
||||
string = '<none>' + string + '</none>';
|
||||
}
|
||||
return tools.toDom(string);
|
||||
};
|
||||
|
||||
AnsiPainter.prototype._renderDom = function(dom) {
|
||||
var parentStyles;
|
||||
parentStyles = {
|
||||
bg: 'none',
|
||||
color: 'none'
|
||||
};
|
||||
return this._renderChildren(dom, parentStyles);
|
||||
};
|
||||
_createClass(AnsiPainter, [{
|
||||
key: "paint",
|
||||
value: function paint(s) {
|
||||
return this._replaceSpecialStrings(this._renderDom(this._parse(s)));
|
||||
}
|
||||
}, {
|
||||
key: "_replaceSpecialStrings",
|
||||
value: function _replaceSpecialStrings(str) {
|
||||
return str.replace(/&sp;/g, ' ').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/&/g, '&');
|
||||
}
|
||||
}, {
|
||||
key: "_parse",
|
||||
value: function _parse(string) {
|
||||
var injectFakeRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
|
||||
AnsiPainter.prototype._renderChildren = function(children, parentStyles) {
|
||||
var child, n, ret;
|
||||
ret = '';
|
||||
for (n in children) {
|
||||
if (!hasProp.call(children, n)) continue;
|
||||
child = children[n];
|
||||
ret += this._renderNode(child, parentStyles);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
if (injectFakeRoot) {
|
||||
string = '<none>' + string + '</none>';
|
||||
}
|
||||
|
||||
AnsiPainter.prototype._renderNode = function(node, parentStyles) {
|
||||
if (node.type === 'text') {
|
||||
return this._renderTextNode(node, parentStyles);
|
||||
} else {
|
||||
return this._renderTag(node, parentStyles);
|
||||
}
|
||||
};
|
||||
return tools.toDom(string);
|
||||
}
|
||||
}, {
|
||||
key: "_renderDom",
|
||||
value: function _renderDom(dom) {
|
||||
var parentStyles;
|
||||
parentStyles = {
|
||||
bg: 'none',
|
||||
color: 'none'
|
||||
};
|
||||
return this._renderChildren(dom, parentStyles);
|
||||
}
|
||||
}, {
|
||||
key: "_renderChildren",
|
||||
value: function _renderChildren(children, parentStyles) {
|
||||
var child, n, ret;
|
||||
ret = '';
|
||||
|
||||
AnsiPainter.prototype._renderTextNode = function(node, parentStyles) {
|
||||
return this._wrapInStyle(node.data, parentStyles);
|
||||
};
|
||||
for (n in children) {
|
||||
if (!hasProp.call(children, n)) continue;
|
||||
child = children[n];
|
||||
ret += this._renderNode(child, parentStyles);
|
||||
}
|
||||
|
||||
AnsiPainter.prototype._wrapInStyle = function(str, style) {
|
||||
return styles.color(style.color) + styles.bg(style.bg) + str + styles.none();
|
||||
};
|
||||
|
||||
AnsiPainter.prototype._renderTag = function(node, parentStyles) {
|
||||
var currentStyles, tagStyles;
|
||||
tagStyles = this._getStylesForTagName(node.name);
|
||||
currentStyles = this._mixStyles(parentStyles, tagStyles);
|
||||
return this._renderChildren(node.children, currentStyles);
|
||||
};
|
||||
|
||||
AnsiPainter.prototype._mixStyles = function() {
|
||||
var final, i, key, len, style, styles, val;
|
||||
styles = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
||||
final = {};
|
||||
for (i = 0, len = styles.length; i < len; i++) {
|
||||
style = styles[i];
|
||||
for (key in style) {
|
||||
if (!hasProp.call(style, key)) continue;
|
||||
val = style[key];
|
||||
if ((final[key] == null) || val !== 'inherit') {
|
||||
final[key] = val;
|
||||
return ret;
|
||||
}
|
||||
}, {
|
||||
key: "_renderNode",
|
||||
value: function _renderNode(node, parentStyles) {
|
||||
if (node.type === 'text') {
|
||||
return this._renderTextNode(node, parentStyles);
|
||||
} else {
|
||||
return this._renderTag(node, parentStyles);
|
||||
}
|
||||
}
|
||||
}
|
||||
return final;
|
||||
};
|
||||
}, {
|
||||
key: "_renderTextNode",
|
||||
value: function _renderTextNode(node, parentStyles) {
|
||||
return this._wrapInStyle(node.data, parentStyles);
|
||||
}
|
||||
}, {
|
||||
key: "_wrapInStyle",
|
||||
value: function _wrapInStyle(str, style) {
|
||||
return styles.color(style.color) + styles.bg(style.bg) + str + styles.none();
|
||||
}
|
||||
}, {
|
||||
key: "_renderTag",
|
||||
value: function _renderTag(node, parentStyles) {
|
||||
var currentStyles, tagStyles;
|
||||
tagStyles = this._getStylesForTagName(node.name);
|
||||
currentStyles = this._mixStyles(parentStyles, tagStyles);
|
||||
return this._renderChildren(node.children, currentStyles);
|
||||
}
|
||||
}, {
|
||||
key: "_mixStyles",
|
||||
value: function _mixStyles() {
|
||||
var final, i, key, len, style, val;
|
||||
final = {};
|
||||
|
||||
AnsiPainter.prototype._getStylesForTagName = function(name) {
|
||||
if (tags[name] == null) {
|
||||
throw Error("Unknown tag name `" + name + "`");
|
||||
}
|
||||
return tags[name];
|
||||
};
|
||||
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
styles[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
for (i = 0, len = styles.length; i < len; i++) {
|
||||
style = styles[i];
|
||||
|
||||
for (key in style) {
|
||||
if (!hasProp.call(style, key)) continue;
|
||||
val = style[key];
|
||||
|
||||
if (final[key] == null || val !== 'inherit') {
|
||||
final[key] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return final;
|
||||
}
|
||||
}, {
|
||||
key: "_getStylesForTagName",
|
||||
value: function _getStylesForTagName(name) {
|
||||
if (tags[name] == null) {
|
||||
throw Error("Unknown tag name `".concat(name, "`"));
|
||||
}
|
||||
|
||||
return tags[name];
|
||||
}
|
||||
}], [{
|
||||
key: "getInstance",
|
||||
value: function getInstance() {
|
||||
if (self._instance == null) {
|
||||
self._instance = new self();
|
||||
}
|
||||
|
||||
return self._instance;
|
||||
}
|
||||
}, {
|
||||
key: "paint",
|
||||
value: function paint(str) {
|
||||
return self.getInstance().paint(str);
|
||||
}
|
||||
}, {
|
||||
key: "strip",
|
||||
value: function strip(s) {
|
||||
return s.replace(/\x1b\[[0-9]+m/g, '');
|
||||
}
|
||||
}]);
|
||||
|
||||
return AnsiPainter;
|
||||
}();
|
||||
|
||||
;
|
||||
AnsiPainter.tags = tags;
|
||||
self = AnsiPainter;
|
||||
|
||||
AnsiPainter.getInstance = function() {
|
||||
if (self._instance == null) {
|
||||
self._instance = new self;
|
||||
}
|
||||
return self._instance;
|
||||
};
|
||||
|
||||
AnsiPainter.paint = function(str) {
|
||||
return self.getInstance().paint(str);
|
||||
};
|
||||
|
||||
AnsiPainter.strip = function(s) {
|
||||
return s.replace(/\x1b\[[0-9]+m/g, '');
|
||||
};
|
||||
|
||||
return AnsiPainter;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+94
-70
@@ -1,19 +1,96 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Block, Layout, SpecialString, fn, i, len, object, prop, ref, terminalWidth;
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Block, Layout, SpecialString, cloneAndMergeDeep, i, len, prop, ref, terminalWidth;
|
||||
Block = require('./layout/Block');
|
||||
|
||||
object = require('utila').object;
|
||||
var _require = require('./tools');
|
||||
|
||||
cloneAndMergeDeep = _require.cloneAndMergeDeep;
|
||||
SpecialString = require('./layout/SpecialString');
|
||||
|
||||
terminalWidth = require('./tools').getCols();
|
||||
|
||||
module.exports = Layout = (function() {
|
||||
module.exports = Layout = function () {
|
||||
var self;
|
||||
|
||||
self = Layout;
|
||||
var Layout = /*#__PURE__*/function () {
|
||||
function Layout() {
|
||||
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var rootBlockConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
_classCallCheck(this, Layout);
|
||||
|
||||
var rootConfig;
|
||||
this._written = [];
|
||||
this._activeBlock = null;
|
||||
this._config = cloneAndMergeDeep(self._defaultConfig, config); // Every layout has a root block
|
||||
|
||||
rootConfig = cloneAndMergeDeep(self._rootBlockDefaultConfig, rootBlockConfig);
|
||||
this._root = new Block(this, null, rootConfig, '__root');
|
||||
|
||||
this._root._open();
|
||||
}
|
||||
|
||||
_createClass(Layout, [{
|
||||
key: "getRootBlock",
|
||||
value: function getRootBlock() {
|
||||
return this._root;
|
||||
}
|
||||
}, {
|
||||
key: "_append",
|
||||
value: function _append(text) {
|
||||
return this._written.push(text);
|
||||
}
|
||||
}, {
|
||||
key: "_appendLine",
|
||||
value: function _appendLine(text) {
|
||||
var s;
|
||||
|
||||
this._append(text);
|
||||
|
||||
s = new SpecialString(text);
|
||||
|
||||
if (s.length < this._config.terminalWidth) {
|
||||
this._append('<none>\n</none>');
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "get",
|
||||
value: function get() {
|
||||
this._ensureClosed();
|
||||
|
||||
if (this._written[this._written.length - 1] === '<none>\n</none>') {
|
||||
this._written.pop();
|
||||
}
|
||||
|
||||
return this._written.join("");
|
||||
}
|
||||
}, {
|
||||
key: "_ensureClosed",
|
||||
value: function _ensureClosed() {
|
||||
if (this._activeBlock !== this._root) {
|
||||
throw Error("Not all the blocks have been closed. Please call block.close() on all open blocks.");
|
||||
}
|
||||
|
||||
if (this._root.isOpen()) {
|
||||
this._root.close();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return Layout;
|
||||
}();
|
||||
|
||||
;
|
||||
self = Layout;
|
||||
Layout._rootBlockDefaultConfig = {
|
||||
linePrependor: {
|
||||
options: {
|
||||
@@ -36,75 +113,22 @@ module.exports = Layout = (function() {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Layout._defaultConfig = {
|
||||
terminalWidth: terminalWidth
|
||||
};
|
||||
|
||||
function Layout(config, rootBlockConfig) {
|
||||
var rootConfig;
|
||||
if (config == null) {
|
||||
config = {};
|
||||
}
|
||||
if (rootBlockConfig == null) {
|
||||
rootBlockConfig = {};
|
||||
}
|
||||
this._written = [];
|
||||
this._activeBlock = null;
|
||||
this._config = object.append(self._defaultConfig, config);
|
||||
rootConfig = object.append(self._rootBlockDefaultConfig, rootBlockConfig);
|
||||
this._root = new Block(this, null, rootConfig, '__root');
|
||||
this._root._open();
|
||||
}
|
||||
|
||||
Layout.prototype.getRootBlock = function() {
|
||||
return this._root;
|
||||
};
|
||||
|
||||
Layout.prototype._append = function(text) {
|
||||
return this._written.push(text);
|
||||
};
|
||||
|
||||
Layout.prototype._appendLine = function(text) {
|
||||
var s;
|
||||
this._append(text);
|
||||
s = SpecialString(text);
|
||||
if (s.length < this._config.terminalWidth) {
|
||||
this._append('<none>\n</none>');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Layout.prototype.get = function() {
|
||||
this._ensureClosed();
|
||||
if (this._written[this._written.length - 1] === '<none>\n</none>') {
|
||||
this._written.pop();
|
||||
}
|
||||
return this._written.join("");
|
||||
};
|
||||
|
||||
Layout.prototype._ensureClosed = function() {
|
||||
if (this._activeBlock !== this._root) {
|
||||
throw Error("Not all the blocks have been closed. Please call block.close() on all open blocks.");
|
||||
}
|
||||
if (this._root.isOpen()) {
|
||||
this._root.close();
|
||||
}
|
||||
};
|
||||
|
||||
return Layout;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
|
||||
ref = ['openBlock', 'write'];
|
||||
fn = function() {
|
||||
var method;
|
||||
method = prop;
|
||||
return Layout.prototype[method] = function() {
|
||||
return this._root[method].apply(this._root, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
prop = ref[i];
|
||||
fn();
|
||||
}
|
||||
|
||||
(function () {
|
||||
var method;
|
||||
method = prop;
|
||||
return Layout.prototype[method] = function () {
|
||||
return this._root[method].apply(this._root, arguments);
|
||||
};
|
||||
})();
|
||||
}
|
||||
+217
-173
@@ -1,197 +1,241 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var AnsiPainter, Layout, RenderKid, Styles, blockStyleApplier, inlineStyleApplier, object, stripAnsi, terminalWidth, tools;
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var AnsiPainter, Layout, RenderKid, Styles, blockStyleApplier, cloneAndMergeDeep, inlineStyleApplier, isPlainObject, stripAnsi, terminalWidth, tools;
|
||||
inlineStyleApplier = require('./renderKid/styleApplier/inline');
|
||||
|
||||
blockStyleApplier = require('./renderKid/styleApplier/block');
|
||||
isPlainObject = require('lodash/isPlainObject');
|
||||
|
||||
var _require = require('./tools');
|
||||
|
||||
cloneAndMergeDeep = _require.cloneAndMergeDeep;
|
||||
AnsiPainter = require('./AnsiPainter');
|
||||
|
||||
Styles = require('./renderKid/Styles');
|
||||
|
||||
Layout = require('./Layout');
|
||||
|
||||
tools = require('./tools');
|
||||
|
||||
object = require('utila').object;
|
||||
|
||||
stripAnsi = require('strip-ansi');
|
||||
|
||||
terminalWidth = require('./tools').getCols();
|
||||
|
||||
module.exports = RenderKid = (function() {
|
||||
module.exports = RenderKid = function () {
|
||||
var self;
|
||||
|
||||
var RenderKid = /*#__PURE__*/function () {
|
||||
function RenderKid() {
|
||||
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
_classCallCheck(this, RenderKid);
|
||||
|
||||
this.tools = self.tools;
|
||||
this._config = cloneAndMergeDeep(self._defaultConfig, config);
|
||||
|
||||
this._initStyles();
|
||||
}
|
||||
|
||||
_createClass(RenderKid, [{
|
||||
key: "_initStyles",
|
||||
value: function _initStyles() {
|
||||
return this._styles = new Styles();
|
||||
}
|
||||
}, {
|
||||
key: "style",
|
||||
value: function style() {
|
||||
return this._styles.setRule.apply(this._styles, arguments);
|
||||
}
|
||||
}, {
|
||||
key: "_getStyleFor",
|
||||
value: function _getStyleFor(el) {
|
||||
return this._styles.getStyleFor(el);
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render(input) {
|
||||
var withColors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
return this._paint(this._renderDom(this._toDom(input)), withColors);
|
||||
}
|
||||
}, {
|
||||
key: "_toDom",
|
||||
value: function _toDom(input) {
|
||||
if (typeof input === 'string') {
|
||||
return this._parse(input);
|
||||
} else if (isPlainObject(input) || Array.isArray(input)) {
|
||||
return this._objToDom(input);
|
||||
} else {
|
||||
throw Error("Invalid input type. Only strings, arrays and objects are accepted");
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_objToDom",
|
||||
value: function _objToDom(o) {
|
||||
var injectFakeRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
|
||||
if (injectFakeRoot) {
|
||||
o = {
|
||||
body: o
|
||||
};
|
||||
}
|
||||
|
||||
return tools.objectToDom(o);
|
||||
}
|
||||
}, {
|
||||
key: "_paint",
|
||||
value: function _paint(text, withColors) {
|
||||
var painted;
|
||||
painted = AnsiPainter.paint(text);
|
||||
|
||||
if (withColors) {
|
||||
return painted;
|
||||
} else {
|
||||
return stripAnsi(painted);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_parse",
|
||||
value: function _parse(string) {
|
||||
var injectFakeRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
|
||||
if (injectFakeRoot) {
|
||||
string = '<body>' + string + '</body>';
|
||||
}
|
||||
|
||||
return tools.stringToDom(string);
|
||||
}
|
||||
}, {
|
||||
key: "_renderDom",
|
||||
value: function _renderDom(dom) {
|
||||
var bodyTag, layout, rootBlock;
|
||||
bodyTag = dom[0];
|
||||
layout = new Layout(this._config.layout);
|
||||
rootBlock = layout.getRootBlock();
|
||||
|
||||
this._renderBlockNode(bodyTag, null, rootBlock);
|
||||
|
||||
return layout.get();
|
||||
}
|
||||
}, {
|
||||
key: "_renderChildrenOf",
|
||||
value: function _renderChildrenOf(parentNode, parentBlock) {
|
||||
var i, len, node, nodes;
|
||||
nodes = parentNode.children;
|
||||
|
||||
for (i = 0, len = nodes.length; i < len; i++) {
|
||||
node = nodes[i];
|
||||
|
||||
this._renderNode(node, parentNode, parentBlock);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_renderNode",
|
||||
value: function _renderNode(node, parentNode, parentBlock) {
|
||||
if (node.type === 'text') {
|
||||
this._renderText(node, parentNode, parentBlock);
|
||||
} else if (node.name === 'br') {
|
||||
this._renderBr(node, parentNode, parentBlock);
|
||||
} else if (this._isBlock(node)) {
|
||||
this._renderBlockNode(node, parentNode, parentBlock);
|
||||
} else if (this._isNone(node)) {
|
||||
return;
|
||||
} else {
|
||||
this._renderInlineNode(node, parentNode, parentBlock);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_renderText",
|
||||
value: function _renderText(node, parentNode, parentBlock) {
|
||||
var ref, text;
|
||||
text = node.data;
|
||||
text = text.replace(/\s+/g, ' '); // let's only trim if the parent is an inline element
|
||||
|
||||
if ((parentNode != null ? (ref = parentNode.styles) != null ? ref.display : void 0 : void 0) !== 'inline') {
|
||||
text = text.trim();
|
||||
}
|
||||
|
||||
if (text.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
text = text.replace(/&nl;/g, "\n");
|
||||
return parentBlock.write(text);
|
||||
}
|
||||
}, {
|
||||
key: "_renderBlockNode",
|
||||
value: function _renderBlockNode(node, parentNode, parentBlock) {
|
||||
var after, before, block, blockConfig;
|
||||
|
||||
var _blockStyleApplier$ap = blockStyleApplier.applyTo(node, this._getStyleFor(node));
|
||||
|
||||
before = _blockStyleApplier$ap.before;
|
||||
after = _blockStyleApplier$ap.after;
|
||||
blockConfig = _blockStyleApplier$ap.blockConfig;
|
||||
block = parentBlock.openBlock(blockConfig);
|
||||
|
||||
if (before !== '') {
|
||||
block.write(before);
|
||||
}
|
||||
|
||||
this._renderChildrenOf(node, block);
|
||||
|
||||
if (after !== '') {
|
||||
block.write(after);
|
||||
}
|
||||
|
||||
return block.close();
|
||||
}
|
||||
}, {
|
||||
key: "_renderInlineNode",
|
||||
value: function _renderInlineNode(node, parentNode, parentBlock) {
|
||||
var after, before;
|
||||
|
||||
var _inlineStyleApplier$a = inlineStyleApplier.applyTo(node, this._getStyleFor(node));
|
||||
|
||||
before = _inlineStyleApplier$a.before;
|
||||
after = _inlineStyleApplier$a.after;
|
||||
|
||||
if (before !== '') {
|
||||
parentBlock.write(before);
|
||||
}
|
||||
|
||||
this._renderChildrenOf(node, parentBlock);
|
||||
|
||||
if (after !== '') {
|
||||
return parentBlock.write(after);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_renderBr",
|
||||
value: function _renderBr(node, parentNode, parentBlock) {
|
||||
return parentBlock.write("\n");
|
||||
}
|
||||
}, {
|
||||
key: "_isBlock",
|
||||
value: function _isBlock(node) {
|
||||
return !(node.type === 'text' || node.name === 'br' || this._getStyleFor(node).display !== 'block');
|
||||
}
|
||||
}, {
|
||||
key: "_isNone",
|
||||
value: function _isNone(node) {
|
||||
return !(node.type === 'text' || node.name === 'br' || this._getStyleFor(node).display !== 'none');
|
||||
}
|
||||
}]);
|
||||
|
||||
return RenderKid;
|
||||
}();
|
||||
|
||||
;
|
||||
self = RenderKid;
|
||||
|
||||
RenderKid.AnsiPainter = AnsiPainter;
|
||||
|
||||
RenderKid.Layout = Layout;
|
||||
|
||||
RenderKid.quote = tools.quote;
|
||||
|
||||
RenderKid.tools = tools;
|
||||
|
||||
RenderKid._defaultConfig = {
|
||||
layout: {
|
||||
terminalWidth: terminalWidth
|
||||
}
|
||||
};
|
||||
|
||||
function RenderKid(config) {
|
||||
if (config == null) {
|
||||
config = {};
|
||||
}
|
||||
this.tools = self.tools;
|
||||
this._config = object.append(self._defaultConfig, config);
|
||||
this._initStyles();
|
||||
}
|
||||
|
||||
RenderKid.prototype._initStyles = function() {
|
||||
return this._styles = new Styles;
|
||||
};
|
||||
|
||||
RenderKid.prototype.style = function() {
|
||||
return this._styles.setRule.apply(this._styles, arguments);
|
||||
};
|
||||
|
||||
RenderKid.prototype._getStyleFor = function(el) {
|
||||
return this._styles.getStyleFor(el);
|
||||
};
|
||||
|
||||
RenderKid.prototype.render = function(input, withColors) {
|
||||
if (withColors == null) {
|
||||
withColors = true;
|
||||
}
|
||||
return this._paint(this._renderDom(this._toDom(input)), withColors);
|
||||
};
|
||||
|
||||
RenderKid.prototype._toDom = function(input) {
|
||||
if (typeof input === 'string') {
|
||||
return this._parse(input);
|
||||
} else if (object.isBareObject(input) || Array.isArray(input)) {
|
||||
return this._objToDom(input);
|
||||
} else {
|
||||
throw Error("Invalid input type. Only strings, arrays and objects are accepted");
|
||||
}
|
||||
};
|
||||
|
||||
RenderKid.prototype._objToDom = function(o, injectFakeRoot) {
|
||||
if (injectFakeRoot == null) {
|
||||
injectFakeRoot = true;
|
||||
}
|
||||
if (injectFakeRoot) {
|
||||
o = {
|
||||
body: o
|
||||
};
|
||||
}
|
||||
return tools.objectToDom(o);
|
||||
};
|
||||
|
||||
RenderKid.prototype._paint = function(text, withColors) {
|
||||
var painted;
|
||||
painted = AnsiPainter.paint(text);
|
||||
if (withColors) {
|
||||
return painted;
|
||||
} else {
|
||||
return stripAnsi(painted);
|
||||
}
|
||||
};
|
||||
|
||||
RenderKid.prototype._parse = function(string, injectFakeRoot) {
|
||||
if (injectFakeRoot == null) {
|
||||
injectFakeRoot = true;
|
||||
}
|
||||
if (injectFakeRoot) {
|
||||
string = '<body>' + string + '</body>';
|
||||
}
|
||||
return tools.stringToDom(string);
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderDom = function(dom) {
|
||||
var bodyTag, layout, rootBlock;
|
||||
bodyTag = dom[0];
|
||||
layout = new Layout(this._config.layout);
|
||||
rootBlock = layout.getRootBlock();
|
||||
this._renderBlockNode(bodyTag, null, rootBlock);
|
||||
return layout.get();
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderChildrenOf = function(parentNode, parentBlock) {
|
||||
var i, len, node, nodes;
|
||||
nodes = parentNode.children;
|
||||
for (i = 0, len = nodes.length; i < len; i++) {
|
||||
node = nodes[i];
|
||||
this._renderNode(node, parentNode, parentBlock);
|
||||
}
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderNode = function(node, parentNode, parentBlock) {
|
||||
if (node.type === 'text') {
|
||||
this._renderText(node, parentNode, parentBlock);
|
||||
} else if (node.name === 'br') {
|
||||
this._renderBr(node, parentNode, parentBlock);
|
||||
} else if (this._isBlock(node)) {
|
||||
this._renderBlockNode(node, parentNode, parentBlock);
|
||||
} else if (this._isNone(node)) {
|
||||
return;
|
||||
} else {
|
||||
this._renderInlineNode(node, parentNode, parentBlock);
|
||||
}
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderText = function(node, parentNode, parentBlock) {
|
||||
var ref, text;
|
||||
text = node.data;
|
||||
text = text.replace(/\s+/g, ' ');
|
||||
if ((parentNode != null ? (ref = parentNode.styles) != null ? ref.display : void 0 : void 0) !== 'inline') {
|
||||
text = text.trim();
|
||||
}
|
||||
if (text.length === 0) {
|
||||
return;
|
||||
}
|
||||
text = text.replace(/&nl;/g, "\n");
|
||||
return parentBlock.write(text);
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderBlockNode = function(node, parentNode, parentBlock) {
|
||||
var after, before, block, blockConfig, ref;
|
||||
ref = blockStyleApplier.applyTo(node, this._getStyleFor(node)), before = ref.before, after = ref.after, blockConfig = ref.blockConfig;
|
||||
block = parentBlock.openBlock(blockConfig);
|
||||
if (before !== '') {
|
||||
block.write(before);
|
||||
}
|
||||
this._renderChildrenOf(node, block);
|
||||
if (after !== '') {
|
||||
block.write(after);
|
||||
}
|
||||
return block.close();
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderInlineNode = function(node, parentNode, parentBlock) {
|
||||
var after, before, ref;
|
||||
ref = inlineStyleApplier.applyTo(node, this._getStyleFor(node)), before = ref.before, after = ref.after;
|
||||
if (before !== '') {
|
||||
parentBlock.write(before);
|
||||
}
|
||||
this._renderChildrenOf(node, parentBlock);
|
||||
if (after !== '') {
|
||||
return parentBlock.write(after);
|
||||
}
|
||||
};
|
||||
|
||||
RenderKid.prototype._renderBr = function(node, parentNode, parentBlock) {
|
||||
return parentBlock.write("\n");
|
||||
};
|
||||
|
||||
RenderKid.prototype._isBlock = function(node) {
|
||||
return !(node.type === 'text' || node.name === 'br' || this._getStyleFor(node).display !== 'block');
|
||||
};
|
||||
|
||||
RenderKid.prototype._isNone = function(node) {
|
||||
return !(node.type === 'text' || node.name === 'br' || this._getStyleFor(node).display !== 'none');
|
||||
};
|
||||
|
||||
return RenderKid;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+17
-9
@@ -1,8 +1,8 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var codes, styles;
|
||||
|
||||
module.exports = styles = {};
|
||||
|
||||
styles.codes = codes = {
|
||||
'none': 0,
|
||||
'black': 30,
|
||||
@@ -39,30 +39,38 @@ styles.codes = codes = {
|
||||
'bg-bright-white': 107
|
||||
};
|
||||
|
||||
styles.color = function(str) {
|
||||
styles.color = function (str) {
|
||||
var code;
|
||||
|
||||
if (str === 'none') {
|
||||
return '';
|
||||
}
|
||||
|
||||
code = codes[str];
|
||||
|
||||
if (code == null) {
|
||||
throw Error("Unknown color `" + str + "`");
|
||||
throw Error("Unknown color `".concat(str, "`"));
|
||||
}
|
||||
|
||||
return "\x1b[" + code + "m";
|
||||
};
|
||||
|
||||
styles.bg = function(str) {
|
||||
styles.bg = function (str) {
|
||||
var code;
|
||||
|
||||
if (str === 'none') {
|
||||
return '';
|
||||
}
|
||||
|
||||
code = codes['bg-' + str];
|
||||
|
||||
if (code == null) {
|
||||
throw Error("Unknown bg color `" + str + "`");
|
||||
throw Error("Unknown bg color `".concat(str, "`"));
|
||||
}
|
||||
|
||||
return "\x1B[" + code + "m";
|
||||
};
|
||||
|
||||
styles.none = function(str) {
|
||||
styles.none = function (str) {
|
||||
return "\x1B[" + codes.none + "m";
|
||||
};
|
||||
};
|
||||
+6
-6
@@ -1,6 +1,7 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var color, colors, i, len, tags;
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var color, colors, i, len, tags;
|
||||
module.exports = tags = {
|
||||
'none': {
|
||||
color: 'none',
|
||||
@@ -15,7 +16,6 @@ module.exports = tags = {
|
||||
bg: 'inherit'
|
||||
}
|
||||
};
|
||||
|
||||
colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'grey', 'bright-red', 'bright-green', 'bright-yellow', 'bright-blue', 'bright-magenta', 'bright-cyan', 'bright-white'];
|
||||
|
||||
for (i = 0, len = colors.length; i < len; i++) {
|
||||
@@ -24,12 +24,12 @@ for (i = 0, len = colors.length; i < len; i++) {
|
||||
color: color,
|
||||
bg: 'inherit'
|
||||
};
|
||||
tags["color-" + color] = {
|
||||
tags["color-".concat(color)] = {
|
||||
color: color,
|
||||
bg: 'inherit'
|
||||
};
|
||||
tags["bg-" + color] = {
|
||||
tags["bg-".concat(color)] = {
|
||||
color: 'inherit',
|
||||
bg: color
|
||||
};
|
||||
}
|
||||
}
|
||||
+307
-210
@@ -1,17 +1,316 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Block, SpecialString, object, terminalWidth;
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Block, SpecialString, cloneAndMergeDeep, terminalWidth;
|
||||
SpecialString = require('./SpecialString');
|
||||
|
||||
object = require('utila').object;
|
||||
|
||||
terminalWidth = require('../tools').getCols();
|
||||
|
||||
module.exports = Block = (function() {
|
||||
var _require = require('../tools');
|
||||
|
||||
cloneAndMergeDeep = _require.cloneAndMergeDeep;
|
||||
|
||||
module.exports = Block = function () {
|
||||
var self;
|
||||
|
||||
self = Block;
|
||||
var Block = /*#__PURE__*/function () {
|
||||
function Block(_layout, _parent) {
|
||||
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
var _name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
||||
|
||||
_classCallCheck(this, Block);
|
||||
|
||||
this._layout = _layout;
|
||||
this._parent = _parent;
|
||||
this._name = _name;
|
||||
this._config = cloneAndMergeDeep(self.defaultConfig, config);
|
||||
this._closed = false;
|
||||
this._wasOpenOnce = false;
|
||||
this._active = false;
|
||||
this._buffer = '';
|
||||
this._didSeparateBlock = false;
|
||||
this._linePrependor = new this._config.linePrependor.fn(this._config.linePrependor.options);
|
||||
this._lineAppendor = new this._config.lineAppendor.fn(this._config.lineAppendor.options);
|
||||
this._blockPrependor = new this._config.blockPrependor.fn(this._config.blockPrependor.options);
|
||||
this._blockAppendor = new this._config.blockAppendor.fn(this._config.blockAppendor.options);
|
||||
}
|
||||
|
||||
_createClass(Block, [{
|
||||
key: "_activate",
|
||||
value: function _activate() {
|
||||
var deactivateParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
||||
|
||||
if (this._active) {
|
||||
throw Error("This block is already active. This is probably a bug in RenderKid itself");
|
||||
}
|
||||
|
||||
if (this._closed) {
|
||||
throw Error("This block is closed and cannot be activated. This is probably a bug in RenderKid itself");
|
||||
}
|
||||
|
||||
this._active = true;
|
||||
this._layout._activeBlock = this;
|
||||
|
||||
if (deactivateParent) {
|
||||
if (this._parent != null) {
|
||||
this._parent._deactivate(false);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_deactivate",
|
||||
value: function _deactivate() {
|
||||
var activateParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
||||
|
||||
this._ensureActive();
|
||||
|
||||
this._flushBuffer();
|
||||
|
||||
if (activateParent) {
|
||||
if (this._parent != null) {
|
||||
this._parent._activate(false);
|
||||
}
|
||||
}
|
||||
|
||||
this._active = false;
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_ensureActive",
|
||||
value: function _ensureActive() {
|
||||
if (!this._wasOpenOnce) {
|
||||
throw Error("This block has never been open before. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
|
||||
if (!this._active) {
|
||||
throw Error("This block is not active. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
|
||||
if (this._closed) {
|
||||
throw Error("This block is already closed. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_open",
|
||||
value: function _open() {
|
||||
if (this._wasOpenOnce) {
|
||||
throw Error("Block._open() has been called twice. This is probably a RenderKid bug.");
|
||||
}
|
||||
|
||||
this._wasOpenOnce = true;
|
||||
|
||||
if (this._parent != null) {
|
||||
this._parent.write(this._whatToPrependToBlock());
|
||||
}
|
||||
|
||||
this._activate();
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "close",
|
||||
value: function close() {
|
||||
this._deactivate();
|
||||
|
||||
this._closed = true;
|
||||
|
||||
if (this._parent != null) {
|
||||
this._parent.write(this._whatToAppendToBlock());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "isOpen",
|
||||
value: function isOpen() {
|
||||
return this._wasOpenOnce && !this._closed;
|
||||
}
|
||||
}, {
|
||||
key: "write",
|
||||
value: function write(str) {
|
||||
this._ensureActive();
|
||||
|
||||
if (str === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
str = String(str);
|
||||
this._buffer += str;
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "openBlock",
|
||||
value: function openBlock(config, name) {
|
||||
var block;
|
||||
|
||||
this._ensureActive();
|
||||
|
||||
block = new Block(this._layout, this, config, name);
|
||||
|
||||
block._open();
|
||||
|
||||
return block;
|
||||
}
|
||||
}, {
|
||||
key: "_flushBuffer",
|
||||
value: function _flushBuffer() {
|
||||
var str;
|
||||
|
||||
if (this._buffer === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
str = this._buffer;
|
||||
this._buffer = '';
|
||||
|
||||
this._writeInline(str);
|
||||
}
|
||||
}, {
|
||||
key: "_toPrependToLine",
|
||||
value: function _toPrependToLine() {
|
||||
var fromParent;
|
||||
fromParent = '';
|
||||
|
||||
if (this._parent != null) {
|
||||
fromParent = this._parent._toPrependToLine();
|
||||
}
|
||||
|
||||
return this._linePrependor.render(fromParent);
|
||||
}
|
||||
}, {
|
||||
key: "_toAppendToLine",
|
||||
value: function _toAppendToLine() {
|
||||
var fromParent;
|
||||
fromParent = '';
|
||||
|
||||
if (this._parent != null) {
|
||||
fromParent = this._parent._toAppendToLine();
|
||||
}
|
||||
|
||||
return this._lineAppendor.render(fromParent);
|
||||
}
|
||||
}, {
|
||||
key: "_whatToPrependToBlock",
|
||||
value: function _whatToPrependToBlock() {
|
||||
return this._blockPrependor.render();
|
||||
}
|
||||
}, {
|
||||
key: "_whatToAppendToBlock",
|
||||
value: function _whatToAppendToBlock() {
|
||||
return this._blockAppendor.render();
|
||||
}
|
||||
}, {
|
||||
key: "_writeInline",
|
||||
value: function _writeInline(str) {
|
||||
var i, j, k, l, lineBreaksToAppend, m, ref, ref1, ref2, remaining; // special characters (such as <bg-white>) don't require
|
||||
// any wrapping...
|
||||
|
||||
if (new SpecialString(str).isOnlySpecialChars()) {
|
||||
// ... and directly get appended to the layout.
|
||||
this._layout._append(str);
|
||||
|
||||
return;
|
||||
} // we'll be removing from the original string till it's empty
|
||||
|
||||
|
||||
remaining = str; // we might need to add a few line breaks at the end of the text.
|
||||
|
||||
lineBreaksToAppend = 0; // if text starts with line breaks...
|
||||
|
||||
if (m = remaining.match(/^\n+/)) {
|
||||
// ... we want to write the exact same number of line breaks
|
||||
// to the layout.
|
||||
for (i = j = 1, ref = m[0].length; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._writeLine('');
|
||||
}
|
||||
|
||||
remaining = remaining.substr(m[0].length, remaining.length);
|
||||
} // and if the text ends with line breaks...
|
||||
|
||||
|
||||
if (m = remaining.match(/\n+$/)) {
|
||||
// we want to write the exact same number of line breaks
|
||||
// to the end of the layout.
|
||||
lineBreaksToAppend = m[0].length;
|
||||
remaining = remaining.substr(0, remaining.length - m[0].length);
|
||||
} // now let's parse the body of the text:
|
||||
|
||||
|
||||
while (remaining.length > 0) {
|
||||
// anything other than a break line...
|
||||
if (m = remaining.match(/^[^\n]+/)) {
|
||||
// ... should be wrapped as a block of text.
|
||||
this._writeLine(m[0]);
|
||||
|
||||
remaining = remaining.substr(m[0].length, remaining.length); // for any number of line breaks we find inside the text...
|
||||
} else if (m = remaining.match(/^\n+/)) {
|
||||
// ... we write one less break line to the layout.
|
||||
for (i = k = 1, ref1 = m[0].length; 1 <= ref1 ? k < ref1 : k > ref1; i = 1 <= ref1 ? ++k : --k) {
|
||||
this._writeLine('');
|
||||
}
|
||||
|
||||
remaining = remaining.substr(m[0].length, remaining.length);
|
||||
}
|
||||
} // if we had line breaks to append to the layout...
|
||||
|
||||
|
||||
if (lineBreaksToAppend > 0) {
|
||||
// ... we append the exact same number of line breaks to the layout.
|
||||
for (i = l = 1, ref2 = lineBreaksToAppend; 1 <= ref2 ? l <= ref2 : l >= ref2; i = 1 <= ref2 ? ++l : --l) {
|
||||
this._writeLine('');
|
||||
}
|
||||
}
|
||||
} // wraps a line into multiple lines if necessary, adds horizontal margins,
|
||||
// etc, and appends it to the layout.
|
||||
|
||||
}, {
|
||||
key: "_writeLine",
|
||||
value: function _writeLine(str) {
|
||||
var line, lineContent, lineContentLength, remaining, roomLeft, toAppend, toAppendLength, toPrepend, toPrependLength; // we'll be cutting from our string as we go
|
||||
|
||||
remaining = new SpecialString(str);
|
||||
|
||||
while (true) {
|
||||
// left margin...
|
||||
// this will continue until nothing is left of our block.
|
||||
toPrepend = this._toPrependToLine(); // ... and its length
|
||||
|
||||
toPrependLength = new SpecialString(toPrepend).length; // right margin...
|
||||
|
||||
toAppend = this._toAppendToLine(); // ... and its length
|
||||
|
||||
toAppendLength = new SpecialString(toAppend).length; // how much room is left for content
|
||||
|
||||
roomLeft = this._layout._config.terminalWidth - (toPrependLength + toAppendLength); // how much room each line of content will have
|
||||
|
||||
lineContentLength = Math.min(this._config.width, roomLeft); // cut line content, only for the amount needed
|
||||
|
||||
lineContent = remaining.cut(0, lineContentLength, true); // line will consist of both margins and the content
|
||||
|
||||
line = toPrepend + lineContent.str + toAppend; // send it off to layout
|
||||
|
||||
this._layout._appendLine(line);
|
||||
|
||||
if (remaining.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return Block;
|
||||
}();
|
||||
|
||||
;
|
||||
self = Block;
|
||||
Block.defaultConfig = {
|
||||
blockPrependor: {
|
||||
fn: require('./block/blockPrependor/Default'),
|
||||
@@ -47,207 +346,5 @@ module.exports = Block = (function() {
|
||||
prefixRaw: '',
|
||||
suffixRaw: ''
|
||||
};
|
||||
|
||||
function Block(_layout, _parent, config, _name) {
|
||||
this._layout = _layout;
|
||||
this._parent = _parent;
|
||||
if (config == null) {
|
||||
config = {};
|
||||
}
|
||||
this._name = _name != null ? _name : '';
|
||||
this._config = object.append(self.defaultConfig, config);
|
||||
this._closed = false;
|
||||
this._wasOpenOnce = false;
|
||||
this._active = false;
|
||||
this._buffer = '';
|
||||
this._didSeparateBlock = false;
|
||||
this._linePrependor = new this._config.linePrependor.fn(this._config.linePrependor.options);
|
||||
this._lineAppendor = new this._config.lineAppendor.fn(this._config.lineAppendor.options);
|
||||
this._blockPrependor = new this._config.blockPrependor.fn(this._config.blockPrependor.options);
|
||||
this._blockAppendor = new this._config.blockAppendor.fn(this._config.blockAppendor.options);
|
||||
}
|
||||
|
||||
Block.prototype._activate = function(deactivateParent) {
|
||||
if (deactivateParent == null) {
|
||||
deactivateParent = true;
|
||||
}
|
||||
if (this._active) {
|
||||
throw Error("This block is already active. This is probably a bug in RenderKid itself");
|
||||
}
|
||||
if (this._closed) {
|
||||
throw Error("This block is closed and cannot be activated. This is probably a bug in RenderKid itself");
|
||||
}
|
||||
this._active = true;
|
||||
this._layout._activeBlock = this;
|
||||
if (deactivateParent) {
|
||||
if (this._parent != null) {
|
||||
this._parent._deactivate(false);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Block.prototype._deactivate = function(activateParent) {
|
||||
if (activateParent == null) {
|
||||
activateParent = true;
|
||||
}
|
||||
this._ensureActive();
|
||||
this._flushBuffer();
|
||||
if (activateParent) {
|
||||
if (this._parent != null) {
|
||||
this._parent._activate(false);
|
||||
}
|
||||
}
|
||||
this._active = false;
|
||||
return this;
|
||||
};
|
||||
|
||||
Block.prototype._ensureActive = function() {
|
||||
if (!this._wasOpenOnce) {
|
||||
throw Error("This block has never been open before. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
if (!this._active) {
|
||||
throw Error("This block is not active. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
if (this._closed) {
|
||||
throw Error("This block is already closed. This is probably a bug in RenderKid itself.");
|
||||
}
|
||||
};
|
||||
|
||||
Block.prototype._open = function() {
|
||||
if (this._wasOpenOnce) {
|
||||
throw Error("Block._open() has been called twice. This is probably a RenderKid bug.");
|
||||
}
|
||||
this._wasOpenOnce = true;
|
||||
if (this._parent != null) {
|
||||
this._parent.write(this._whatToPrependToBlock());
|
||||
}
|
||||
this._activate();
|
||||
return this;
|
||||
};
|
||||
|
||||
Block.prototype.close = function() {
|
||||
this._deactivate();
|
||||
this._closed = true;
|
||||
if (this._parent != null) {
|
||||
this._parent.write(this._whatToAppendToBlock());
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Block.prototype.isOpen = function() {
|
||||
return this._wasOpenOnce && !this._closed;
|
||||
};
|
||||
|
||||
Block.prototype.write = function(str) {
|
||||
this._ensureActive();
|
||||
if (str === '') {
|
||||
return;
|
||||
}
|
||||
str = String(str);
|
||||
this._buffer += str;
|
||||
return this;
|
||||
};
|
||||
|
||||
Block.prototype.openBlock = function(config, name) {
|
||||
var block;
|
||||
this._ensureActive();
|
||||
block = new Block(this._layout, this, config, name);
|
||||
block._open();
|
||||
return block;
|
||||
};
|
||||
|
||||
Block.prototype._flushBuffer = function() {
|
||||
var str;
|
||||
if (this._buffer === '') {
|
||||
return;
|
||||
}
|
||||
str = this._buffer;
|
||||
this._buffer = '';
|
||||
this._writeInline(str);
|
||||
};
|
||||
|
||||
Block.prototype._toPrependToLine = function() {
|
||||
var fromParent;
|
||||
fromParent = '';
|
||||
if (this._parent != null) {
|
||||
fromParent = this._parent._toPrependToLine();
|
||||
}
|
||||
return this._linePrependor.render(fromParent);
|
||||
};
|
||||
|
||||
Block.prototype._toAppendToLine = function() {
|
||||
var fromParent;
|
||||
fromParent = '';
|
||||
if (this._parent != null) {
|
||||
fromParent = this._parent._toAppendToLine();
|
||||
}
|
||||
return this._lineAppendor.render(fromParent);
|
||||
};
|
||||
|
||||
Block.prototype._whatToPrependToBlock = function() {
|
||||
return this._blockPrependor.render();
|
||||
};
|
||||
|
||||
Block.prototype._whatToAppendToBlock = function() {
|
||||
return this._blockAppendor.render();
|
||||
};
|
||||
|
||||
Block.prototype._writeInline = function(str) {
|
||||
var i, j, k, l, lineBreaksToAppend, m, ref, ref1, ref2, remaining;
|
||||
if (SpecialString(str).isOnlySpecialChars()) {
|
||||
this._layout._append(str);
|
||||
return;
|
||||
}
|
||||
remaining = str;
|
||||
lineBreaksToAppend = 0;
|
||||
if (m = remaining.match(/^\n+/)) {
|
||||
for (i = j = 1, ref = m[0].length; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._writeLine('');
|
||||
}
|
||||
remaining = remaining.substr(m[0].length, remaining.length);
|
||||
}
|
||||
if (m = remaining.match(/\n+$/)) {
|
||||
lineBreaksToAppend = m[0].length;
|
||||
remaining = remaining.substr(0, remaining.length - m[0].length);
|
||||
}
|
||||
while (remaining.length > 0) {
|
||||
if (m = remaining.match(/^[^\n]+/)) {
|
||||
this._writeLine(m[0]);
|
||||
remaining = remaining.substr(m[0].length, remaining.length);
|
||||
} else if (m = remaining.match(/^\n+/)) {
|
||||
for (i = k = 1, ref1 = m[0].length; 1 <= ref1 ? k < ref1 : k > ref1; i = 1 <= ref1 ? ++k : --k) {
|
||||
this._writeLine('');
|
||||
}
|
||||
remaining = remaining.substr(m[0].length, remaining.length);
|
||||
}
|
||||
}
|
||||
if (lineBreaksToAppend > 0) {
|
||||
for (i = l = 1, ref2 = lineBreaksToAppend; 1 <= ref2 ? l <= ref2 : l >= ref2; i = 1 <= ref2 ? ++l : --l) {
|
||||
this._writeLine('');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Block.prototype._writeLine = function(str) {
|
||||
var line, lineContent, lineContentLength, remaining, roomLeft, toAppend, toAppendLength, toPrepend, toPrependLength;
|
||||
remaining = SpecialString(str);
|
||||
while (true) {
|
||||
toPrepend = this._toPrependToLine();
|
||||
toPrependLength = SpecialString(toPrepend).length;
|
||||
toAppend = this._toAppendToLine();
|
||||
toAppendLength = SpecialString(toAppend).length;
|
||||
roomLeft = this._layout._config.terminalWidth - (toPrependLength + toAppendLength);
|
||||
lineContentLength = Math.min(this._config.width, roomLeft);
|
||||
lineContent = remaining.cut(0, lineContentLength, true);
|
||||
line = toPrepend + lineContent.str + toAppend;
|
||||
this._layout._appendLine(line);
|
||||
if (remaining.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return Block;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+197
-155
@@ -1,176 +1,218 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var SpecialString, fn, i, len, prop, ref;
|
||||
"use strict";
|
||||
|
||||
module.exports = SpecialString = (function() {
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var SpecialString, i, len, prop, ref;
|
||||
|
||||
module.exports = SpecialString = function () {
|
||||
var self;
|
||||
|
||||
self = SpecialString;
|
||||
var SpecialString = /*#__PURE__*/function () {
|
||||
function SpecialString(str) {
|
||||
_classCallCheck(this, SpecialString);
|
||||
|
||||
SpecialString._tabRx = /^\t/;
|
||||
if (!(this instanceof self)) {
|
||||
return new self(str);
|
||||
}
|
||||
|
||||
SpecialString._tagRx = /^<[^>]+>/;
|
||||
|
||||
SpecialString._quotedHtmlRx = /^&(gt|lt|quot|amp|apos|sp);/;
|
||||
|
||||
function SpecialString(str) {
|
||||
if (!(this instanceof self)) {
|
||||
return new self(str);
|
||||
this._str = String(str);
|
||||
this._len = 0;
|
||||
}
|
||||
this._str = String(str);
|
||||
this._len = 0;
|
||||
}
|
||||
|
||||
SpecialString.prototype._getStr = function() {
|
||||
return this._str;
|
||||
};
|
||||
|
||||
SpecialString.prototype.set = function(str) {
|
||||
this._str = String(str);
|
||||
return this;
|
||||
};
|
||||
|
||||
SpecialString.prototype.clone = function() {
|
||||
return new SpecialString(this._str);
|
||||
};
|
||||
|
||||
SpecialString.prototype.isEmpty = function() {
|
||||
return this._str === '';
|
||||
};
|
||||
|
||||
SpecialString.prototype.isOnlySpecialChars = function() {
|
||||
return !this.isEmpty() && this.length === 0;
|
||||
};
|
||||
|
||||
SpecialString.prototype._reset = function() {
|
||||
return this._len = 0;
|
||||
};
|
||||
|
||||
SpecialString.prototype.splitIn = function(limit, trimLeftEachLine) {
|
||||
var buffer, bufferLength, justSkippedSkipChar, lines;
|
||||
if (trimLeftEachLine == null) {
|
||||
trimLeftEachLine = false;
|
||||
}
|
||||
buffer = '';
|
||||
bufferLength = 0;
|
||||
lines = [];
|
||||
justSkippedSkipChar = false;
|
||||
self._countChars(this._str, function(char, charLength) {
|
||||
if (bufferLength > limit || bufferLength + charLength > limit) {
|
||||
lines.push(buffer);
|
||||
_createClass(SpecialString, [{
|
||||
key: "_getStr",
|
||||
value: function _getStr() {
|
||||
return this._str;
|
||||
}
|
||||
}, {
|
||||
key: "set",
|
||||
value: function set(str) {
|
||||
this._str = String(str);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "clone",
|
||||
value: function clone() {
|
||||
return new SpecialString(this._str);
|
||||
}
|
||||
}, {
|
||||
key: "isEmpty",
|
||||
value: function isEmpty() {
|
||||
return this._str === '';
|
||||
}
|
||||
}, {
|
||||
key: "isOnlySpecialChars",
|
||||
value: function isOnlySpecialChars() {
|
||||
return !this.isEmpty() && this.length === 0;
|
||||
}
|
||||
}, {
|
||||
key: "_reset",
|
||||
value: function _reset() {
|
||||
return this._len = 0;
|
||||
}
|
||||
}, {
|
||||
key: "splitIn",
|
||||
value: function splitIn(limit) {
|
||||
var trimLeftEachLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
var buffer, bufferLength, justSkippedSkipChar, lines;
|
||||
buffer = '';
|
||||
bufferLength = 0;
|
||||
}
|
||||
if (bufferLength === 0 && char === ' ' && !justSkippedSkipChar && trimLeftEachLine) {
|
||||
return justSkippedSkipChar = true;
|
||||
} else {
|
||||
buffer += char;
|
||||
bufferLength += charLength;
|
||||
return justSkippedSkipChar = false;
|
||||
}
|
||||
});
|
||||
if (buffer.length > 0) {
|
||||
lines.push(buffer);
|
||||
}
|
||||
return lines;
|
||||
};
|
||||
lines = [];
|
||||
justSkippedSkipChar = false;
|
||||
|
||||
SpecialString.prototype.trim = function() {
|
||||
return new SpecialString(this.str.trim());
|
||||
};
|
||||
self._countChars(this._str, function (char, charLength) {
|
||||
if (bufferLength > limit || bufferLength + charLength > limit) {
|
||||
lines.push(buffer);
|
||||
buffer = '';
|
||||
bufferLength = 0;
|
||||
}
|
||||
|
||||
SpecialString.prototype.trimLeft = function() {
|
||||
return new SpecialString(this.str.replace(/^\s+/, ''));
|
||||
};
|
||||
if (bufferLength === 0 && char === ' ' && !justSkippedSkipChar && trimLeftEachLine) {
|
||||
return justSkippedSkipChar = true;
|
||||
} else {
|
||||
buffer += char;
|
||||
bufferLength += charLength;
|
||||
return justSkippedSkipChar = false;
|
||||
}
|
||||
});
|
||||
|
||||
SpecialString.prototype.trimRight = function() {
|
||||
return new SpecialString(this.str.replace(/\s+$/, ''));
|
||||
};
|
||||
|
||||
SpecialString.prototype._getLength = function() {
|
||||
var sum;
|
||||
sum = 0;
|
||||
self._countChars(this._str, function(char, charLength) {
|
||||
sum += charLength;
|
||||
});
|
||||
return sum;
|
||||
};
|
||||
|
||||
SpecialString.prototype.cut = function(from, to, trimLeft) {
|
||||
var after, before, cur, cut;
|
||||
if (trimLeft == null) {
|
||||
trimLeft = false;
|
||||
}
|
||||
if (to == null) {
|
||||
to = this.length;
|
||||
}
|
||||
from = parseInt(from);
|
||||
if (from >= to) {
|
||||
throw Error("`from` shouldn't be larger than `to`");
|
||||
}
|
||||
before = '';
|
||||
after = '';
|
||||
cut = '';
|
||||
cur = 0;
|
||||
self._countChars(this._str, (function(_this) {
|
||||
return function(char, charLength) {
|
||||
if (_this.str === 'ab<tag>') {
|
||||
console.log(charLength, char);
|
||||
if (buffer.length > 0) {
|
||||
lines.push(buffer);
|
||||
}
|
||||
if (cur === from && char.match(/^\s+$/) && trimLeft) {
|
||||
return;
|
||||
}
|
||||
if (cur < from) {
|
||||
before += char;
|
||||
} else if (cur < to || cur + charLength <= to) {
|
||||
cut += char;
|
||||
} else {
|
||||
after += char;
|
||||
}
|
||||
cur += charLength;
|
||||
};
|
||||
})(this));
|
||||
this._str = before + after;
|
||||
this._reset();
|
||||
return SpecialString(cut);
|
||||
};
|
||||
|
||||
SpecialString._countChars = function(text, cb) {
|
||||
var char, charLength, m;
|
||||
while (text.length !== 0) {
|
||||
if (m = text.match(self._tagRx)) {
|
||||
char = m[0];
|
||||
charLength = 0;
|
||||
text = text.substr(char.length, text.length);
|
||||
} else if (m = text.match(self._quotedHtmlRx)) {
|
||||
char = m[0];
|
||||
charLength = 1;
|
||||
text = text.substr(char.length, text.length);
|
||||
} else if (text.match(self._tabRx)) {
|
||||
char = "\t";
|
||||
charLength = 8;
|
||||
text = text.substr(1, text.length);
|
||||
} else {
|
||||
char = text[0];
|
||||
charLength = 1;
|
||||
text = text.substr(1, text.length);
|
||||
return lines;
|
||||
}
|
||||
cb.call(null, char, charLength);
|
||||
}
|
||||
};
|
||||
}, {
|
||||
key: "trim",
|
||||
value: function trim() {
|
||||
return new SpecialString(this.str.trim());
|
||||
}
|
||||
}, {
|
||||
key: "trimLeft",
|
||||
value: function trimLeft() {
|
||||
return new SpecialString(this.str.replace(/^\s+/, ''));
|
||||
}
|
||||
}, {
|
||||
key: "trimRight",
|
||||
value: function trimRight() {
|
||||
return new SpecialString(this.str.replace(/\s+$/, ''));
|
||||
}
|
||||
}, {
|
||||
key: "_getLength",
|
||||
value: function _getLength() {
|
||||
var sum;
|
||||
sum = 0;
|
||||
|
||||
self._countChars(this._str, function (char, charLength) {
|
||||
sum += charLength;
|
||||
});
|
||||
|
||||
return sum;
|
||||
}
|
||||
}, {
|
||||
key: "cut",
|
||||
value: function cut(from, to) {
|
||||
var _this = this;
|
||||
|
||||
var trimLeft = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
var after, before, cur, cut;
|
||||
|
||||
if (to == null) {
|
||||
to = this.length;
|
||||
}
|
||||
|
||||
from = parseInt(from);
|
||||
|
||||
if (from >= to) {
|
||||
throw Error("`from` shouldn't be larger than `to`");
|
||||
}
|
||||
|
||||
before = '';
|
||||
after = '';
|
||||
cut = '';
|
||||
cur = 0;
|
||||
|
||||
self._countChars(this._str, function (char, charLength) {
|
||||
if (_this.str === 'ab<tag>') {
|
||||
console.log(charLength, char);
|
||||
}
|
||||
|
||||
if (cur === from && char.match(/^\s+$/) && trimLeft) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur < from) {
|
||||
before += char; // let's be greedy
|
||||
} else if (cur < to || cur + charLength <= to) {
|
||||
cut += char;
|
||||
} else {
|
||||
after += char;
|
||||
}
|
||||
|
||||
cur += charLength;
|
||||
});
|
||||
|
||||
this._str = before + after;
|
||||
|
||||
this._reset();
|
||||
|
||||
return new SpecialString(cut);
|
||||
}
|
||||
}], [{
|
||||
key: "_countChars",
|
||||
value: function _countChars(text, cb) {
|
||||
var char, charLength, m;
|
||||
|
||||
while (text.length !== 0) {
|
||||
if (m = text.match(self._tagRx)) {
|
||||
char = m[0];
|
||||
charLength = 0;
|
||||
text = text.substr(char.length, text.length);
|
||||
} else if (m = text.match(self._quotedHtmlRx)) {
|
||||
char = m[0];
|
||||
charLength = 1;
|
||||
text = text.substr(char.length, text.length);
|
||||
} else if (text.match(self._tabRx)) {
|
||||
char = "\t";
|
||||
charLength = 8;
|
||||
text = text.substr(1, text.length);
|
||||
} else {
|
||||
char = text[0];
|
||||
charLength = 1;
|
||||
text = text.substr(1, text.length);
|
||||
}
|
||||
|
||||
cb.call(null, char, charLength);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return SpecialString;
|
||||
}();
|
||||
|
||||
;
|
||||
self = SpecialString;
|
||||
SpecialString._tabRx = /^\t/;
|
||||
SpecialString._tagRx = /^<[^>]+>/;
|
||||
SpecialString._quotedHtmlRx = /^&(gt|lt|quot|amp|apos|sp);/;
|
||||
return SpecialString;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
|
||||
ref = ['str', 'length'];
|
||||
fn = function() {
|
||||
var methodName;
|
||||
methodName = '_get' + prop[0].toUpperCase() + prop.substr(1, prop.length);
|
||||
return SpecialString.prototype.__defineGetter__(prop, function() {
|
||||
return this[methodName]();
|
||||
});
|
||||
};
|
||||
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
prop = ref[i];
|
||||
fn();
|
||||
}
|
||||
|
||||
(function () {
|
||||
var methodName;
|
||||
methodName = '_get' + prop[0].toUpperCase() + prop.substr(1, prop.length);
|
||||
return SpecialString.prototype.__defineGetter__(prop, function () {
|
||||
return this[methodName]();
|
||||
});
|
||||
})();
|
||||
}
|
||||
+39
-12
@@ -1,21 +1,48 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var DefaultBlockAppendor, tools,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DefaultBlockAppendor, tools;
|
||||
tools = require('../../../tools');
|
||||
|
||||
module.exports = DefaultBlockAppendor = (function(superClass) {
|
||||
extend(DefaultBlockAppendor, superClass);
|
||||
module.exports = DefaultBlockAppendor = /*#__PURE__*/function (_require) {
|
||||
_inherits(DefaultBlockAppendor, _require);
|
||||
|
||||
var _super = _createSuper(DefaultBlockAppendor);
|
||||
|
||||
function DefaultBlockAppendor() {
|
||||
return DefaultBlockAppendor.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, DefaultBlockAppendor);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
DefaultBlockAppendor.prototype._render = function(options) {
|
||||
return tools.repeatString("\n", this._config.amount);
|
||||
};
|
||||
_createClass(DefaultBlockAppendor, [{
|
||||
key: "_render",
|
||||
value: function _render(options) {
|
||||
return tools.repeatString("\n", this._config.amount);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DefaultBlockAppendor;
|
||||
|
||||
})(require('./_BlockAppendor'));
|
||||
}(require('./_BlockAppendor'));
|
||||
+19
-7
@@ -1,15 +1,27 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _BlockAppendor;
|
||||
|
||||
module.exports = _BlockAppendor = (function() {
|
||||
module.exports = _BlockAppendor = /*#__PURE__*/function () {
|
||||
function _BlockAppendor(_config) {
|
||||
_classCallCheck(this, _BlockAppendor);
|
||||
|
||||
this._config = _config;
|
||||
}
|
||||
|
||||
_BlockAppendor.prototype.render = function(options) {
|
||||
return this._render(options);
|
||||
};
|
||||
_createClass(_BlockAppendor, [{
|
||||
key: "render",
|
||||
value: function render(options) {
|
||||
return this._render(options);
|
||||
}
|
||||
}]);
|
||||
|
||||
return _BlockAppendor;
|
||||
|
||||
})();
|
||||
}();
|
||||
+39
-12
@@ -1,21 +1,48 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var DefaultBlockPrependor, tools,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DefaultBlockPrependor, tools;
|
||||
tools = require('../../../tools');
|
||||
|
||||
module.exports = DefaultBlockPrependor = (function(superClass) {
|
||||
extend(DefaultBlockPrependor, superClass);
|
||||
module.exports = DefaultBlockPrependor = /*#__PURE__*/function (_require) {
|
||||
_inherits(DefaultBlockPrependor, _require);
|
||||
|
||||
var _super = _createSuper(DefaultBlockPrependor);
|
||||
|
||||
function DefaultBlockPrependor() {
|
||||
return DefaultBlockPrependor.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, DefaultBlockPrependor);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
DefaultBlockPrependor.prototype._render = function(options) {
|
||||
return tools.repeatString("\n", this._config.amount);
|
||||
};
|
||||
_createClass(DefaultBlockPrependor, [{
|
||||
key: "_render",
|
||||
value: function _render(options) {
|
||||
return tools.repeatString("\n", this._config.amount);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DefaultBlockPrependor;
|
||||
|
||||
})(require('./_BlockPrependor'));
|
||||
}(require('./_BlockPrependor'));
|
||||
+19
-7
@@ -1,15 +1,27 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _BlockPrependor;
|
||||
|
||||
module.exports = _BlockPrependor = (function() {
|
||||
module.exports = _BlockPrependor = /*#__PURE__*/function () {
|
||||
function _BlockPrependor(_config) {
|
||||
_classCallCheck(this, _BlockPrependor);
|
||||
|
||||
this._config = _config;
|
||||
}
|
||||
|
||||
_BlockPrependor.prototype.render = function(options) {
|
||||
return this._render(options);
|
||||
};
|
||||
_createClass(_BlockPrependor, [{
|
||||
key: "render",
|
||||
value: function render(options) {
|
||||
return this._render(options);
|
||||
}
|
||||
}]);
|
||||
|
||||
return _BlockPrependor;
|
||||
|
||||
})();
|
||||
}();
|
||||
+39
-12
@@ -1,21 +1,48 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var DefaultLineAppendor, tools,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DefaultLineAppendor, tools;
|
||||
tools = require('../../../tools');
|
||||
|
||||
module.exports = DefaultLineAppendor = (function(superClass) {
|
||||
extend(DefaultLineAppendor, superClass);
|
||||
module.exports = DefaultLineAppendor = /*#__PURE__*/function (_require) {
|
||||
_inherits(DefaultLineAppendor, _require);
|
||||
|
||||
var _super = _createSuper(DefaultLineAppendor);
|
||||
|
||||
function DefaultLineAppendor() {
|
||||
return DefaultLineAppendor.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, DefaultLineAppendor);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
DefaultLineAppendor.prototype._render = function(inherited, options) {
|
||||
return inherited + tools.repeatString(" ", this._config.amount);
|
||||
};
|
||||
_createClass(DefaultLineAppendor, [{
|
||||
key: "_render",
|
||||
value: function _render(inherited, options) {
|
||||
return inherited + tools.repeatString(" ", this._config.amount);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DefaultLineAppendor;
|
||||
|
||||
})(require('./_LineAppendor'));
|
||||
}(require('./_LineAppendor'));
|
||||
+20
-8
@@ -1,17 +1,29 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _LineAppendor;
|
||||
|
||||
module.exports = _LineAppendor = (function() {
|
||||
module.exports = _LineAppendor = /*#__PURE__*/function () {
|
||||
function _LineAppendor(_config) {
|
||||
_classCallCheck(this, _LineAppendor);
|
||||
|
||||
this._config = _config;
|
||||
this._lineNo = 0;
|
||||
}
|
||||
|
||||
_LineAppendor.prototype.render = function(inherited, options) {
|
||||
this._lineNo++;
|
||||
return '<none>' + this._render(inherited, options) + '</none>';
|
||||
};
|
||||
_createClass(_LineAppendor, [{
|
||||
key: "render",
|
||||
value: function render(inherited, options) {
|
||||
this._lineNo++;
|
||||
return '<none>' + this._render(inherited, options) + '</none>';
|
||||
}
|
||||
}]);
|
||||
|
||||
return _LineAppendor;
|
||||
|
||||
})();
|
||||
}();
|
||||
+82
-46
@@ -1,58 +1,94 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var DefaultLinePrependor, SpecialString, tools,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DefaultLinePrependor, SpecialString, tools;
|
||||
tools = require('../../../tools');
|
||||
|
||||
SpecialString = require('../../SpecialString');
|
||||
|
||||
module.exports = DefaultLinePrependor = (function(superClass) {
|
||||
module.exports = DefaultLinePrependor = function () {
|
||||
var self;
|
||||
|
||||
extend(DefaultLinePrependor, superClass);
|
||||
var DefaultLinePrependor = /*#__PURE__*/function (_require) {
|
||||
_inherits(DefaultLinePrependor, _require);
|
||||
|
||||
function DefaultLinePrependor() {
|
||||
return DefaultLinePrependor.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
var _super = _createSuper(DefaultLinePrependor);
|
||||
|
||||
self = DefaultLinePrependor;
|
||||
function DefaultLinePrependor() {
|
||||
_classCallCheck(this, DefaultLinePrependor);
|
||||
|
||||
DefaultLinePrependor.pad = function(howMuch) {
|
||||
return tools.repeatString(" ", howMuch);
|
||||
};
|
||||
|
||||
DefaultLinePrependor.prototype._render = function(inherited, options) {
|
||||
var addToLeft, addToRight, alignment, bullet, char, charLen, diff, left, output, space, toWrite;
|
||||
if (this._lineNo === 0 && (bullet = this._config.bullet)) {
|
||||
char = bullet.char;
|
||||
charLen = SpecialString(char).length;
|
||||
alignment = bullet.alignment;
|
||||
space = this._config.amount;
|
||||
toWrite = char;
|
||||
addToLeft = '';
|
||||
addToRight = '';
|
||||
if (space > charLen) {
|
||||
diff = space - charLen;
|
||||
if (alignment === 'right') {
|
||||
addToLeft = self.pad(diff);
|
||||
} else if (alignment === 'left') {
|
||||
addToRight = self.pad(diff);
|
||||
} else if (alignment === 'center') {
|
||||
left = Math.round(diff / 2);
|
||||
addToLeft = self.pad(left);
|
||||
addToRight = self.pad(diff - left);
|
||||
} else {
|
||||
throw Error("Unknown alignment `" + alignment + "`");
|
||||
}
|
||||
}
|
||||
output = addToLeft + char + addToRight;
|
||||
} else {
|
||||
output = self.pad(this._config.amount);
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
return inherited + output;
|
||||
};
|
||||
|
||||
_createClass(DefaultLinePrependor, [{
|
||||
key: "_render",
|
||||
value: function _render(inherited, options) {
|
||||
var addToLeft, addToRight, alignment, bullet, char, charLen, diff, left, output, space, toWrite;
|
||||
|
||||
if (this._lineNo === 0 && (bullet = this._config.bullet)) {
|
||||
char = bullet.char;
|
||||
charLen = new SpecialString(char).length;
|
||||
alignment = bullet.alignment;
|
||||
space = this._config.amount;
|
||||
toWrite = char;
|
||||
addToLeft = '';
|
||||
addToRight = '';
|
||||
|
||||
if (space > charLen) {
|
||||
diff = space - charLen;
|
||||
|
||||
if (alignment === 'right') {
|
||||
addToLeft = self.pad(diff);
|
||||
} else if (alignment === 'left') {
|
||||
addToRight = self.pad(diff);
|
||||
} else if (alignment === 'center') {
|
||||
left = Math.round(diff / 2);
|
||||
addToLeft = self.pad(left);
|
||||
addToRight = self.pad(diff - left);
|
||||
} else {
|
||||
throw Error("Unknown alignment `".concat(alignment, "`"));
|
||||
}
|
||||
}
|
||||
|
||||
output = addToLeft + char + addToRight;
|
||||
} else {
|
||||
output = self.pad(this._config.amount);
|
||||
}
|
||||
|
||||
return inherited + output;
|
||||
}
|
||||
}], [{
|
||||
key: "pad",
|
||||
value: function pad(howMuch) {
|
||||
return tools.repeatString(" ", howMuch);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DefaultLinePrependor;
|
||||
}(require('./_LinePrependor'));
|
||||
|
||||
;
|
||||
self = DefaultLinePrependor;
|
||||
return DefaultLinePrependor;
|
||||
|
||||
})(require('./_LinePrependor'));
|
||||
}.call(void 0);
|
||||
+20
-8
@@ -1,17 +1,29 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _LinePrependor;
|
||||
|
||||
module.exports = _LinePrependor = (function() {
|
||||
module.exports = _LinePrependor = /*#__PURE__*/function () {
|
||||
function _LinePrependor(_config) {
|
||||
_classCallCheck(this, _LinePrependor);
|
||||
|
||||
this._config = _config;
|
||||
this._lineNo = -1;
|
||||
}
|
||||
|
||||
_LinePrependor.prototype.render = function(inherited, options) {
|
||||
this._lineNo++;
|
||||
return '<none>' + this._render(inherited, options) + '</none>';
|
||||
};
|
||||
_createClass(_LinePrependor, [{
|
||||
key: "render",
|
||||
value: function render(inherited, options) {
|
||||
this._lineNo++;
|
||||
return '<none>' + this._render(inherited, options) + '</none>';
|
||||
}
|
||||
}]);
|
||||
|
||||
return _LinePrependor;
|
||||
|
||||
})();
|
||||
}();
|
||||
+38
-10
@@ -1,17 +1,45 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var DefaultLineWrapper,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
module.exports = DefaultLineWrapper = (function(superClass) {
|
||||
extend(DefaultLineWrapper, superClass);
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DefaultLineWrapper;
|
||||
|
||||
module.exports = DefaultLineWrapper = /*#__PURE__*/function (_require) {
|
||||
_inherits(DefaultLineWrapper, _require);
|
||||
|
||||
var _super = _createSuper(DefaultLineWrapper);
|
||||
|
||||
function DefaultLineWrapper() {
|
||||
return DefaultLineWrapper.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, DefaultLineWrapper);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
DefaultLineWrapper.prototype._render = function() {};
|
||||
_createClass(DefaultLineWrapper, [{
|
||||
key: "_render",
|
||||
value: function _render() {}
|
||||
}]);
|
||||
|
||||
return DefaultLineWrapper;
|
||||
|
||||
})(require('./_LineWrapper'));
|
||||
}(require('./_LineWrapper'));
|
||||
+20
-8
@@ -1,13 +1,25 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _LineWrapper;
|
||||
|
||||
module.exports = _LineWrapper = (function() {
|
||||
function _LineWrapper() {}
|
||||
module.exports = _LineWrapper = /*#__PURE__*/function () {
|
||||
function _LineWrapper() {
|
||||
_classCallCheck(this, _LineWrapper);
|
||||
}
|
||||
|
||||
_LineWrapper.prototype.render = function(str, options) {
|
||||
return this._render(str, options);
|
||||
};
|
||||
_createClass(_LineWrapper, [{
|
||||
key: "render",
|
||||
value: function render(str, options) {
|
||||
return this._render(str, options);
|
||||
}
|
||||
}]);
|
||||
|
||||
return _LineWrapper;
|
||||
|
||||
})();
|
||||
}();
|
||||
+79
-56
@@ -1,17 +1,89 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MixedDeclarationSet, StyleSheet, Styles, terminalWidth;
|
||||
|
||||
StyleSheet = require('./styles/StyleSheet');
|
||||
|
||||
MixedDeclarationSet = require('./styles/rule/MixedDeclarationSet');
|
||||
|
||||
terminalWidth = require('../tools').getCols();
|
||||
|
||||
module.exports = Styles = (function() {
|
||||
module.exports = Styles = function () {
|
||||
var self;
|
||||
|
||||
self = Styles;
|
||||
var Styles = /*#__PURE__*/function () {
|
||||
function Styles() {
|
||||
_classCallCheck(this, Styles);
|
||||
|
||||
this._defaultStyles = new StyleSheet();
|
||||
this._userStyles = new StyleSheet();
|
||||
|
||||
this._setDefaultStyles();
|
||||
}
|
||||
|
||||
_createClass(Styles, [{
|
||||
key: "_setDefaultStyles",
|
||||
value: function _setDefaultStyles() {
|
||||
this._defaultStyles.setRule(self.defaultRules);
|
||||
}
|
||||
}, {
|
||||
key: "setRule",
|
||||
value: function setRule(selector, rules) {
|
||||
this._userStyles.setRule.apply(this._userStyles, arguments);
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "getStyleFor",
|
||||
value: function getStyleFor(el) {
|
||||
var styles;
|
||||
styles = el.styles;
|
||||
|
||||
if (styles == null) {
|
||||
el.styles = styles = this._getComputedStyleFor(el);
|
||||
}
|
||||
|
||||
return styles;
|
||||
}
|
||||
}, {
|
||||
key: "_getRawStyleFor",
|
||||
value: function _getRawStyleFor(el) {
|
||||
var def, user;
|
||||
def = this._defaultStyles.getRulesFor(el);
|
||||
user = this._userStyles.getRulesFor(el);
|
||||
return MixedDeclarationSet.mix(def, user).toObject();
|
||||
}
|
||||
}, {
|
||||
key: "_getComputedStyleFor",
|
||||
value: function _getComputedStyleFor(el) {
|
||||
var decs, parent, prop, ref, val;
|
||||
decs = {};
|
||||
parent = el.parent;
|
||||
ref = this._getRawStyleFor(el);
|
||||
|
||||
for (prop in ref) {
|
||||
val = ref[prop];
|
||||
|
||||
if (val !== 'inherit') {
|
||||
decs[prop] = val;
|
||||
} else {
|
||||
throw Error("Inherited styles are not supported yet.");
|
||||
}
|
||||
}
|
||||
|
||||
return decs;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Styles;
|
||||
}();
|
||||
|
||||
;
|
||||
self = Styles;
|
||||
Styles.defaultRules = {
|
||||
'*': {
|
||||
display: 'inline'
|
||||
@@ -23,54 +95,5 @@ module.exports = Styles = (function() {
|
||||
width: terminalWidth + ' !important'
|
||||
}
|
||||
};
|
||||
|
||||
function Styles() {
|
||||
this._defaultStyles = new StyleSheet;
|
||||
this._userStyles = new StyleSheet;
|
||||
this._setDefaultStyles();
|
||||
}
|
||||
|
||||
Styles.prototype._setDefaultStyles = function() {
|
||||
this._defaultStyles.setRule(self.defaultRules);
|
||||
};
|
||||
|
||||
Styles.prototype.setRule = function(selector, rules) {
|
||||
this._userStyles.setRule.apply(this._userStyles, arguments);
|
||||
return this;
|
||||
};
|
||||
|
||||
Styles.prototype.getStyleFor = function(el) {
|
||||
var styles;
|
||||
styles = el.styles;
|
||||
if (styles == null) {
|
||||
el.styles = styles = this._getComputedStyleFor(el);
|
||||
}
|
||||
return styles;
|
||||
};
|
||||
|
||||
Styles.prototype._getRawStyleFor = function(el) {
|
||||
var def, user;
|
||||
def = this._defaultStyles.getRulesFor(el);
|
||||
user = this._userStyles.getRulesFor(el);
|
||||
return MixedDeclarationSet.mix(def, user).toObject();
|
||||
};
|
||||
|
||||
Styles.prototype._getComputedStyleFor = function(el) {
|
||||
var decs, parent, prop, ref, val;
|
||||
decs = {};
|
||||
parent = el.parent;
|
||||
ref = this._getRawStyleFor(el);
|
||||
for (prop in ref) {
|
||||
val = ref[prop];
|
||||
if (val !== 'inherit') {
|
||||
decs[prop] = val;
|
||||
} else {
|
||||
throw Error("Inherited styles are not supported yet.");
|
||||
}
|
||||
}
|
||||
return decs;
|
||||
};
|
||||
|
||||
return Styles;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+18
-8
@@ -1,35 +1,45 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var AnsiPainter, _common;
|
||||
|
||||
AnsiPainter = require('../../AnsiPainter');
|
||||
|
||||
module.exports = _common = {
|
||||
getStyleTagsFor: function(style) {
|
||||
getStyleTagsFor: function getStyleTagsFor(style) {
|
||||
var i, len, ret, tag, tagName, tagsToAdd;
|
||||
tagsToAdd = [];
|
||||
|
||||
if (style.color != null) {
|
||||
tagName = 'color-' + style.color;
|
||||
|
||||
if (AnsiPainter.tags[tagName] == null) {
|
||||
throw Error("Unknown color `" + style.color + "`");
|
||||
throw Error("Unknown color `".concat(style.color, "`"));
|
||||
}
|
||||
|
||||
tagsToAdd.push(tagName);
|
||||
}
|
||||
|
||||
if (style.background != null) {
|
||||
tagName = 'bg-' + style.background;
|
||||
|
||||
if (AnsiPainter.tags[tagName] == null) {
|
||||
throw Error("Unknown background `" + style.background + "`");
|
||||
throw Error("Unknown background `".concat(style.background, "`"));
|
||||
}
|
||||
|
||||
tagsToAdd.push(tagName);
|
||||
}
|
||||
|
||||
ret = {
|
||||
before: '',
|
||||
after: ''
|
||||
};
|
||||
|
||||
for (i = 0, len = tagsToAdd.length; i < len; i++) {
|
||||
tag = tagsToAdd[i];
|
||||
ret.before = ("<" + tag + ">") + ret.before;
|
||||
ret.after = ret.after + ("</" + tag + ">");
|
||||
ret.before = "<".concat(tag, ">") + ret.before;
|
||||
ret.after = ret.after + "</".concat(tag, ">");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
};
|
||||
+32
-19
@@ -1,23 +1,27 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var _common, blockStyleApplier, object, self;
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _common, blockStyleApplier, merge, self;
|
||||
|
||||
_common = require('./_common');
|
||||
|
||||
object = require('utila').object;
|
||||
|
||||
merge = require('lodash/merge');
|
||||
module.exports = blockStyleApplier = self = {
|
||||
applyTo: function(el, style) {
|
||||
applyTo: function applyTo(el, style) {
|
||||
var config, ret;
|
||||
ret = _common.getStyleTagsFor(style);
|
||||
ret.blockConfig = config = {};
|
||||
|
||||
this._margins(style, config);
|
||||
|
||||
this._bullet(style, config);
|
||||
|
||||
this._dims(style, config);
|
||||
|
||||
return ret;
|
||||
},
|
||||
_margins: function(style, config) {
|
||||
_margins: function _margins(style, config) {
|
||||
if (style.marginLeft != null) {
|
||||
object.appendOnto(config, {
|
||||
merge(config, {
|
||||
linePrependor: {
|
||||
options: {
|
||||
amount: parseInt(style.marginLeft)
|
||||
@@ -25,8 +29,9 @@ module.exports = blockStyleApplier = self = {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (style.marginRight != null) {
|
||||
object.appendOnto(config, {
|
||||
merge(config, {
|
||||
lineAppendor: {
|
||||
options: {
|
||||
amount: parseInt(style.marginRight)
|
||||
@@ -34,8 +39,9 @@ module.exports = blockStyleApplier = self = {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (style.marginTop != null) {
|
||||
object.appendOnto(config, {
|
||||
merge(config, {
|
||||
blockPrependor: {
|
||||
options: {
|
||||
amount: parseInt(style.marginTop)
|
||||
@@ -43,8 +49,9 @@ module.exports = blockStyleApplier = self = {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (style.marginBottom != null) {
|
||||
object.appendOnto(config, {
|
||||
merge(config, {
|
||||
blockAppendor: {
|
||||
options: {
|
||||
amount: parseInt(style.marginBottom)
|
||||
@@ -53,18 +60,23 @@ module.exports = blockStyleApplier = self = {
|
||||
});
|
||||
}
|
||||
},
|
||||
_bullet: function(style, config) {
|
||||
var after, before, bullet, conf, ref;
|
||||
if ((style.bullet != null) && style.bullet.enabled) {
|
||||
_bullet: function _bullet(style, config) {
|
||||
var after, before, bullet, conf;
|
||||
|
||||
if (style.bullet != null && style.bullet.enabled) {
|
||||
bullet = style.bullet;
|
||||
conf = {};
|
||||
conf.alignment = style.bullet.alignment;
|
||||
ref = _common.getStyleTagsFor({
|
||||
|
||||
var _common$getStyleTagsF = _common.getStyleTagsFor({
|
||||
color: bullet.color,
|
||||
background: bullet.background
|
||||
}), before = ref.before, after = ref.after;
|
||||
});
|
||||
|
||||
before = _common$getStyleTagsF.before;
|
||||
after = _common$getStyleTagsF.after;
|
||||
conf.char = before + bullet.char + after;
|
||||
object.appendOnto(config, {
|
||||
merge(config, {
|
||||
linePrependor: {
|
||||
options: {
|
||||
bullet: conf
|
||||
@@ -73,11 +85,12 @@ module.exports = blockStyleApplier = self = {
|
||||
});
|
||||
}
|
||||
},
|
||||
_dims: function(style, config) {
|
||||
_dims: function _dims(style, config) {
|
||||
var w;
|
||||
|
||||
if (style.width != null) {
|
||||
w = parseInt(style.width);
|
||||
config.width = w;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
+12
-7
@@ -1,26 +1,31 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _common, inlineStyleApplier, self, tools;
|
||||
|
||||
tools = require('../../tools');
|
||||
|
||||
_common = require('./_common');
|
||||
|
||||
module.exports = inlineStyleApplier = self = {
|
||||
applyTo: function(el, style) {
|
||||
applyTo: function applyTo(el, style) {
|
||||
var ret;
|
||||
ret = _common.getStyleTagsFor(style);
|
||||
|
||||
if (style.marginLeft != null) {
|
||||
ret.before = (tools.repeatString("&sp;", parseInt(style.marginLeft))) + ret.before;
|
||||
ret.before = tools.repeatString("&sp;", parseInt(style.marginLeft)) + ret.before;
|
||||
}
|
||||
|
||||
if (style.marginRight != null) {
|
||||
ret.after += tools.repeatString("&sp;", parseInt(style.marginRight));
|
||||
}
|
||||
|
||||
if (style.paddingLeft != null) {
|
||||
ret.before += tools.repeatString("&sp;", parseInt(style.paddingLeft));
|
||||
}
|
||||
|
||||
if (style.paddingRight != null) {
|
||||
ret.after = (tools.repeatString("&sp;", parseInt(style.paddingRight))) + ret.after;
|
||||
ret.after = tools.repeatString("&sp;", parseInt(style.paddingRight)) + ret.after;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
};
|
||||
+21
-11
@@ -1,21 +1,31 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var DeclarationBlock, Rule, Selector;
|
||||
|
||||
Selector = require('./rule/Selector');
|
||||
|
||||
DeclarationBlock = require('./rule/DeclarationBlock');
|
||||
|
||||
module.exports = Rule = (function() {
|
||||
module.exports = Rule = /*#__PURE__*/function () {
|
||||
function Rule(selector) {
|
||||
_classCallCheck(this, Rule);
|
||||
|
||||
this.selector = new Selector(selector);
|
||||
this.styles = new DeclarationBlock;
|
||||
this.styles = new DeclarationBlock();
|
||||
}
|
||||
|
||||
Rule.prototype.setStyles = function(styles) {
|
||||
this.styles.set(styles);
|
||||
return this;
|
||||
};
|
||||
_createClass(Rule, [{
|
||||
key: "setStyles",
|
||||
value: function setStyles(styles) {
|
||||
this.styles.set(styles);
|
||||
return this;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Rule;
|
||||
|
||||
})();
|
||||
}();
|
||||
+98
-65
@@ -1,72 +1,105 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Rule, StyleSheet;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Rule, StyleSheet;
|
||||
Rule = require('./Rule');
|
||||
|
||||
module.exports = StyleSheet = (function() {
|
||||
module.exports = StyleSheet = function () {
|
||||
var self;
|
||||
|
||||
var StyleSheet = /*#__PURE__*/function () {
|
||||
function StyleSheet() {
|
||||
_classCallCheck(this, StyleSheet);
|
||||
|
||||
this._rulesBySelector = {};
|
||||
}
|
||||
|
||||
_createClass(StyleSheet, [{
|
||||
key: "setRule",
|
||||
value: function setRule(selector, styles) {
|
||||
var key, val;
|
||||
|
||||
if (typeof selector === 'string') {
|
||||
this._setRule(selector, styles);
|
||||
} else if (_typeof(selector) === 'object') {
|
||||
for (key in selector) {
|
||||
val = selector[key];
|
||||
|
||||
this._setRule(key, val);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_setRule",
|
||||
value: function _setRule(s, styles) {
|
||||
var i, len, ref, selector;
|
||||
ref = self.splitSelectors(s);
|
||||
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
selector = ref[i];
|
||||
|
||||
this._setSingleRule(selector, styles);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_setSingleRule",
|
||||
value: function _setSingleRule(s, styles) {
|
||||
var rule, selector;
|
||||
selector = self.normalizeSelector(s);
|
||||
|
||||
if (!(rule = this._rulesBySelector[selector])) {
|
||||
rule = new Rule(selector);
|
||||
this._rulesBySelector[selector] = rule;
|
||||
}
|
||||
|
||||
rule.setStyles(styles);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "getRulesFor",
|
||||
value: function getRulesFor(el) {
|
||||
var ref, rule, rules, selector;
|
||||
rules = [];
|
||||
ref = this._rulesBySelector;
|
||||
|
||||
for (selector in ref) {
|
||||
rule = ref[selector];
|
||||
|
||||
if (rule.selector.matches(el)) {
|
||||
rules.push(rule);
|
||||
}
|
||||
}
|
||||
|
||||
return rules;
|
||||
}
|
||||
}], [{
|
||||
key: "normalizeSelector",
|
||||
value: function normalizeSelector(selector) {
|
||||
return selector.replace(/[\s]+/g, ' ').replace(/[\s]*([>\,\+]{1})[\s]*/g, '$1').trim();
|
||||
}
|
||||
}, {
|
||||
key: "splitSelectors",
|
||||
value: function splitSelectors(s) {
|
||||
return s.trim().split(',');
|
||||
}
|
||||
}]);
|
||||
|
||||
return StyleSheet;
|
||||
}();
|
||||
|
||||
;
|
||||
self = StyleSheet;
|
||||
|
||||
function StyleSheet() {
|
||||
this._rulesBySelector = {};
|
||||
}
|
||||
|
||||
StyleSheet.prototype.setRule = function(selector, styles) {
|
||||
var key, val;
|
||||
if (typeof selector === 'string') {
|
||||
this._setRule(selector, styles);
|
||||
} else if (typeof selector === 'object') {
|
||||
for (key in selector) {
|
||||
val = selector[key];
|
||||
this._setRule(key, val);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
StyleSheet.prototype._setRule = function(s, styles) {
|
||||
var i, len, ref, selector;
|
||||
ref = self.splitSelectors(s);
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
selector = ref[i];
|
||||
this._setSingleRule(selector, styles);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
StyleSheet.prototype._setSingleRule = function(s, styles) {
|
||||
var rule, selector;
|
||||
selector = self.normalizeSelector(s);
|
||||
if (!(rule = this._rulesBySelector[selector])) {
|
||||
rule = new Rule(selector);
|
||||
this._rulesBySelector[selector] = rule;
|
||||
}
|
||||
rule.setStyles(styles);
|
||||
return this;
|
||||
};
|
||||
|
||||
StyleSheet.prototype.getRulesFor = function(el) {
|
||||
var ref, rule, rules, selector;
|
||||
rules = [];
|
||||
ref = this._rulesBySelector;
|
||||
for (selector in ref) {
|
||||
rule = ref[selector];
|
||||
if (rule.selector.matches(el)) {
|
||||
rules.push(rule);
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
};
|
||||
|
||||
StyleSheet.normalizeSelector = function(selector) {
|
||||
return selector.replace(/[\s]+/g, ' ').replace(/[\s]*([>\,\+]{1})[\s]*/g, '$1').trim();
|
||||
};
|
||||
|
||||
StyleSheet.splitSelectors = function(s) {
|
||||
return s.trim().split(',');
|
||||
};
|
||||
|
||||
return StyleSheet;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+62
-35
@@ -1,50 +1,77 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Arbitrary, DeclarationBlock, declarationClasses;
|
||||
|
||||
module.exports = DeclarationBlock = (function() {
|
||||
module.exports = DeclarationBlock = function () {
|
||||
var self;
|
||||
|
||||
self = DeclarationBlock;
|
||||
var DeclarationBlock = /*#__PURE__*/function () {
|
||||
function DeclarationBlock() {
|
||||
_classCallCheck(this, DeclarationBlock);
|
||||
|
||||
function DeclarationBlock() {
|
||||
this._declarations = {};
|
||||
}
|
||||
this._declarations = {};
|
||||
}
|
||||
|
||||
DeclarationBlock.prototype.set = function(prop, value) {
|
||||
var key, val;
|
||||
if (typeof prop === 'object') {
|
||||
for (key in prop) {
|
||||
val = prop[key];
|
||||
this.set(key, val);
|
||||
_createClass(DeclarationBlock, [{
|
||||
key: "set",
|
||||
value: function set(prop, value) {
|
||||
var key, val;
|
||||
|
||||
if (_typeof(prop) === 'object') {
|
||||
for (key in prop) {
|
||||
val = prop[key];
|
||||
this.set(key, val);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
prop = self.sanitizeProp(prop);
|
||||
|
||||
this._getDeclarationClass(prop).setOnto(this._declarations, prop, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
prop = self.sanitizeProp(prop);
|
||||
this._getDeclarationClass(prop).setOnto(this._declarations, prop, value);
|
||||
return this;
|
||||
};
|
||||
}, {
|
||||
key: "_getDeclarationClass",
|
||||
value: function _getDeclarationClass(prop) {
|
||||
var cls;
|
||||
|
||||
DeclarationBlock.prototype._getDeclarationClass = function(prop) {
|
||||
var cls;
|
||||
if (prop[0] === '_') {
|
||||
return Arbitrary;
|
||||
}
|
||||
if (!(cls = declarationClasses[prop])) {
|
||||
throw Error("Unknown property `" + prop + "`. Write it as `_" + prop + "` if you're defining a custom property");
|
||||
}
|
||||
return cls;
|
||||
};
|
||||
if (prop[0] === '_') {
|
||||
return Arbitrary;
|
||||
}
|
||||
|
||||
DeclarationBlock.sanitizeProp = function(prop) {
|
||||
return String(prop).trim();
|
||||
};
|
||||
if (!(cls = declarationClasses[prop])) {
|
||||
throw Error("Unknown property `".concat(prop, "`. Write it as `_").concat(prop, "` if you're defining a custom property"));
|
||||
}
|
||||
|
||||
return cls;
|
||||
}
|
||||
}], [{
|
||||
key: "sanitizeProp",
|
||||
value: function sanitizeProp(prop) {
|
||||
return String(prop).trim();
|
||||
}
|
||||
}]);
|
||||
|
||||
return DeclarationBlock;
|
||||
}();
|
||||
|
||||
;
|
||||
self = DeclarationBlock;
|
||||
return DeclarationBlock;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
|
||||
Arbitrary = require('./declarationBlock/Arbitrary');
|
||||
|
||||
declarationClasses = {
|
||||
color: require('./declarationBlock/Color'),
|
||||
background: require('./declarationBlock/Background'),
|
||||
@@ -62,4 +89,4 @@ declarationClasses = {
|
||||
paddingLeft: require('./declarationBlock/PaddingLeft'),
|
||||
paddingRight: require('./declarationBlock/PaddingRight'),
|
||||
paddingBottom: require('./declarationBlock/PaddingBottom')
|
||||
};
|
||||
};
|
||||
+109
-73
@@ -1,78 +1,114 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var MixedDeclarationSet,
|
||||
slice = [].slice;
|
||||
"use strict";
|
||||
|
||||
module.exports = MixedDeclarationSet = (function() {
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MixedDeclarationSet;
|
||||
|
||||
module.exports = MixedDeclarationSet = function () {
|
||||
var self;
|
||||
|
||||
var MixedDeclarationSet = /*#__PURE__*/function () {
|
||||
function MixedDeclarationSet() {
|
||||
_classCallCheck(this, MixedDeclarationSet);
|
||||
|
||||
this._declarations = {};
|
||||
}
|
||||
|
||||
_createClass(MixedDeclarationSet, [{
|
||||
key: "mixWithList",
|
||||
value: function mixWithList(rules) {
|
||||
var i, len, rule;
|
||||
rules.sort(function (a, b) {
|
||||
return a.selector.priority > b.selector.priority;
|
||||
});
|
||||
|
||||
for (i = 0, len = rules.length; i < len; i++) {
|
||||
rule = rules[i];
|
||||
|
||||
this._mixWithRule(rule);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_mixWithRule",
|
||||
value: function _mixWithRule(rule) {
|
||||
var dec, prop, ref;
|
||||
ref = rule.styles._declarations;
|
||||
|
||||
for (prop in ref) {
|
||||
dec = ref[prop];
|
||||
|
||||
this._mixWithDeclaration(dec);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_mixWithDeclaration",
|
||||
value: function _mixWithDeclaration(dec) {
|
||||
var cur;
|
||||
cur = this._declarations[dec.prop];
|
||||
|
||||
if (cur != null && cur.important && !dec.important) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._declarations[dec.prop] = dec;
|
||||
}
|
||||
}, {
|
||||
key: "get",
|
||||
value: function get(prop) {
|
||||
if (prop == null) {
|
||||
return this._declarations;
|
||||
}
|
||||
|
||||
if (this._declarations[prop] == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._declarations[prop].val;
|
||||
}
|
||||
}, {
|
||||
key: "toObject",
|
||||
value: function toObject() {
|
||||
var dec, obj, prop, ref;
|
||||
obj = {};
|
||||
ref = this._declarations;
|
||||
|
||||
for (prop in ref) {
|
||||
dec = ref[prop];
|
||||
obj[prop] = dec.val;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
}], [{
|
||||
key: "mix",
|
||||
value: function mix() {
|
||||
var i, len, mixed, rules;
|
||||
mixed = new self();
|
||||
|
||||
for (var _len = arguments.length, ruleSets = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
ruleSets[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
for (i = 0, len = ruleSets.length; i < len; i++) {
|
||||
rules = ruleSets[i];
|
||||
mixed.mixWithList(rules);
|
||||
}
|
||||
|
||||
return mixed;
|
||||
}
|
||||
}]);
|
||||
|
||||
return MixedDeclarationSet;
|
||||
}();
|
||||
|
||||
;
|
||||
self = MixedDeclarationSet;
|
||||
|
||||
MixedDeclarationSet.mix = function() {
|
||||
var i, len, mixed, ruleSets, rules;
|
||||
ruleSets = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
||||
mixed = new self;
|
||||
for (i = 0, len = ruleSets.length; i < len; i++) {
|
||||
rules = ruleSets[i];
|
||||
mixed.mixWithList(rules);
|
||||
}
|
||||
return mixed;
|
||||
};
|
||||
|
||||
function MixedDeclarationSet() {
|
||||
this._declarations = {};
|
||||
}
|
||||
|
||||
MixedDeclarationSet.prototype.mixWithList = function(rules) {
|
||||
var i, len, rule;
|
||||
rules.sort(function(a, b) {
|
||||
return a.selector.priority > b.selector.priority;
|
||||
});
|
||||
for (i = 0, len = rules.length; i < len; i++) {
|
||||
rule = rules[i];
|
||||
this._mixWithRule(rule);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
MixedDeclarationSet.prototype._mixWithRule = function(rule) {
|
||||
var dec, prop, ref;
|
||||
ref = rule.styles._declarations;
|
||||
for (prop in ref) {
|
||||
dec = ref[prop];
|
||||
this._mixWithDeclaration(dec);
|
||||
}
|
||||
};
|
||||
|
||||
MixedDeclarationSet.prototype._mixWithDeclaration = function(dec) {
|
||||
var cur;
|
||||
cur = this._declarations[dec.prop];
|
||||
if ((cur != null) && cur.important && !dec.important) {
|
||||
return;
|
||||
}
|
||||
this._declarations[dec.prop] = dec;
|
||||
};
|
||||
|
||||
MixedDeclarationSet.prototype.get = function(prop) {
|
||||
if (prop == null) {
|
||||
return this._declarations;
|
||||
}
|
||||
if (this._declarations[prop] == null) {
|
||||
return null;
|
||||
}
|
||||
return this._declarations[prop].val;
|
||||
};
|
||||
|
||||
MixedDeclarationSet.prototype.toObject = function() {
|
||||
var dec, obj, prop, ref;
|
||||
obj = {};
|
||||
ref = this._declarations;
|
||||
for (prop in ref) {
|
||||
dec = ref[prop];
|
||||
obj[prop] = dec.val;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
return MixedDeclarationSet;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+54
-31
@@ -1,38 +1,61 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var CSSSelect, Selector;
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var CSSSelect, Selector;
|
||||
CSSSelect = require('css-select');
|
||||
|
||||
module.exports = Selector = (function() {
|
||||
module.exports = Selector = function () {
|
||||
var self;
|
||||
|
||||
var Selector = /*#__PURE__*/function () {
|
||||
function Selector(text1) {
|
||||
_classCallCheck(this, Selector);
|
||||
|
||||
this.text = text1;
|
||||
this._fn = CSSSelect.compile(this.text);
|
||||
this.priority = self.calculatePriority(this.text);
|
||||
}
|
||||
|
||||
_createClass(Selector, [{
|
||||
key: "matches",
|
||||
value: function matches(elem) {
|
||||
return CSSSelect.is(elem, this._fn);
|
||||
} // This stupid piece of code is supposed to calculate
|
||||
// selector priority, somehow according to
|
||||
// http://www.w3.org/wiki/CSS/Training/Priority_level_of_selector
|
||||
|
||||
}], [{
|
||||
key: "calculatePriority",
|
||||
value: function calculatePriority(text) {
|
||||
var n, priotrity;
|
||||
priotrity = 0;
|
||||
|
||||
if (n = text.match(/[\#]{1}/g)) {
|
||||
priotrity += 100 * n.length;
|
||||
}
|
||||
|
||||
if (n = text.match(/[a-zA-Z]+/g)) {
|
||||
priotrity += 2 * n.length;
|
||||
}
|
||||
|
||||
if (n = text.match(/\*/g)) {
|
||||
priotrity += 1 * n.length;
|
||||
}
|
||||
|
||||
return priotrity;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Selector;
|
||||
}();
|
||||
|
||||
;
|
||||
self = Selector;
|
||||
|
||||
function Selector(text1) {
|
||||
this.text = text1;
|
||||
this._fn = CSSSelect.compile(this.text);
|
||||
this.priority = self.calculatePriority(this.text);
|
||||
}
|
||||
|
||||
Selector.prototype.matches = function(elem) {
|
||||
return CSSSelect.is(elem, this._fn);
|
||||
};
|
||||
|
||||
Selector.calculatePriority = function(text) {
|
||||
var n, priotrity;
|
||||
priotrity = 0;
|
||||
if (n = text.match(/[\#]{1}/g)) {
|
||||
priotrity += 100 * n.length;
|
||||
}
|
||||
if (n = text.match(/[a-zA-Z]+/g)) {
|
||||
priotrity += 2 * n.length;
|
||||
}
|
||||
if (n = text.match(/\*/g)) {
|
||||
priotrity += 1 * n.length;
|
||||
}
|
||||
return priotrity;
|
||||
};
|
||||
|
||||
return Selector;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Arbitrary, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Arbitrary, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = Arbitrary = (function(superClass) {
|
||||
extend(Arbitrary, superClass);
|
||||
module.exports = Arbitrary = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Arbitrary, _Declaration2);
|
||||
|
||||
var _super = _createSuper(Arbitrary);
|
||||
|
||||
function Arbitrary() {
|
||||
return Arbitrary.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, Arbitrary);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Arbitrary;
|
||||
|
||||
})(_Declaration);
|
||||
}(_Declaration);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Background, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Background, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = Background = (function(superClass) {
|
||||
extend(Background, superClass);
|
||||
module.exports = Background = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Background, _Declaration2);
|
||||
|
||||
var _super = _createSuper(Background);
|
||||
|
||||
function Background() {
|
||||
return Background.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, Background);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Background;
|
||||
|
||||
})(_Declaration);
|
||||
}(_Declaration);
|
||||
+93
-54
@@ -1,63 +1,102 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Bullet, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Bullet, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = Bullet = (function(superClass) {
|
||||
module.exports = Bullet = function () {
|
||||
var self;
|
||||
|
||||
extend(Bullet, superClass);
|
||||
var Bullet = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Bullet, _Declaration2);
|
||||
|
||||
function Bullet() {
|
||||
return Bullet.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
var _super = _createSuper(Bullet);
|
||||
|
||||
function Bullet() {
|
||||
_classCallCheck(this, Bullet);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
_createClass(Bullet, [{
|
||||
key: "_set",
|
||||
value: function _set(val) {
|
||||
var alignment, bg, char, color, enabled, m, original;
|
||||
val = String(val);
|
||||
original = val;
|
||||
char = null;
|
||||
enabled = false;
|
||||
color = 'none';
|
||||
bg = 'none';
|
||||
|
||||
if (m = val.match(/\"([^"]+)\"/) || (m = val.match(/\'([^']+)\'/))) {
|
||||
char = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (m = val.match(/(none|left|right|center)/)) {
|
||||
alignment = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
} else {
|
||||
alignment = 'left';
|
||||
}
|
||||
|
||||
if (alignment === 'none') {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
if (m = val.match(/color\:([\w\-]+)/)) {
|
||||
color = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
}
|
||||
|
||||
if (m = val.match(/bg\:([\w\-]+)/)) {
|
||||
bg = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
}
|
||||
|
||||
if (val.trim() !== '') {
|
||||
throw Error("Unrecognizable value `".concat(original, "` for `").concat(this.prop, "`"));
|
||||
}
|
||||
|
||||
return this.val = {
|
||||
enabled: enabled,
|
||||
char: char,
|
||||
alignment: alignment,
|
||||
background: bg,
|
||||
color: color
|
||||
};
|
||||
}
|
||||
}]);
|
||||
|
||||
return Bullet;
|
||||
}(_Declaration);
|
||||
|
||||
;
|
||||
self = Bullet;
|
||||
|
||||
Bullet.prototype._set = function(val) {
|
||||
var alignment, bg, char, color, enabled, m, original;
|
||||
val = String(val);
|
||||
original = val;
|
||||
char = null;
|
||||
enabled = false;
|
||||
color = 'none';
|
||||
bg = 'none';
|
||||
if (m = val.match(/\"([^"]+)\"/) || (m = val.match(/\'([^']+)\'/))) {
|
||||
char = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
enabled = true;
|
||||
}
|
||||
if (m = val.match(/(none|left|right|center)/)) {
|
||||
alignment = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
} else {
|
||||
alignment = 'left';
|
||||
}
|
||||
if (alignment === 'none') {
|
||||
enabled = false;
|
||||
}
|
||||
if (m = val.match(/color\:([\w\-]+)/)) {
|
||||
color = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
}
|
||||
if (m = val.match(/bg\:([\w\-]+)/)) {
|
||||
bg = m[1];
|
||||
val = val.replace(m[0], '');
|
||||
}
|
||||
if (val.trim() !== '') {
|
||||
throw Error("Unrecognizable value `" + original + "` for `" + this.prop + "`");
|
||||
}
|
||||
return this.val = {
|
||||
enabled: enabled,
|
||||
char: char,
|
||||
alignment: alignment,
|
||||
background: bg,
|
||||
color: color
|
||||
};
|
||||
};
|
||||
|
||||
return Bullet;
|
||||
|
||||
})(_Declaration);
|
||||
}.call(void 0);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Color, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Color, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = Color = (function(superClass) {
|
||||
extend(Color, superClass);
|
||||
module.exports = Color = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Color, _Declaration2);
|
||||
|
||||
var _super = _createSuper(Color);
|
||||
|
||||
function Color() {
|
||||
return Color.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, Color);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Color;
|
||||
|
||||
})(_Declaration);
|
||||
}(_Declaration);
|
||||
+55
-21
@@ -1,32 +1,66 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Display, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Display,
|
||||
_Declaration,
|
||||
indexOf = [].indexOf;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = Display = (function(superClass) {
|
||||
module.exports = Display = function () {
|
||||
var self;
|
||||
|
||||
extend(Display, superClass);
|
||||
var Display = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Display, _Declaration2);
|
||||
|
||||
function Display() {
|
||||
return Display.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
var _super = _createSuper(Display);
|
||||
|
||||
self = Display;
|
||||
function Display() {
|
||||
_classCallCheck(this, Display);
|
||||
|
||||
Display._allowed = ['inline', 'block', 'none'];
|
||||
|
||||
Display.prototype._set = function(val) {
|
||||
val = String(val).toLowerCase();
|
||||
if (indexOf.call(self._allowed, val) < 0) {
|
||||
throw Error("Unrecognizable value `" + val + "` for `" + this.prop + "`");
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
return this.val = val;
|
||||
};
|
||||
|
||||
_createClass(Display, [{
|
||||
key: "_set",
|
||||
value: function _set(val) {
|
||||
val = String(val).toLowerCase();
|
||||
|
||||
if (indexOf.call(self._allowed, val) < 0) {
|
||||
throw Error("Unrecognizable value `".concat(val, "` for `").concat(this.prop, "`"));
|
||||
}
|
||||
|
||||
return this.val = val;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Display;
|
||||
}(_Declaration);
|
||||
|
||||
;
|
||||
self = Display;
|
||||
Display._allowed = ['inline', 'block', 'none'];
|
||||
return Display;
|
||||
|
||||
})(_Declaration);
|
||||
}.call(void 0);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Height, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Height, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = Height = (function(superClass) {
|
||||
extend(Height, superClass);
|
||||
module.exports = Height = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(Height, _Length2);
|
||||
|
||||
var _super = _createSuper(Height);
|
||||
|
||||
function Height() {
|
||||
return Height.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, Height);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Height;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+85
-51
@@ -1,64 +1,98 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Margin, MarginBottom, MarginLeft, MarginRight, MarginTop, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Margin, MarginBottom, MarginLeft, MarginRight, MarginTop, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
MarginTop = require('./MarginTop');
|
||||
|
||||
MarginLeft = require('./MarginLeft');
|
||||
|
||||
MarginRight = require('./MarginRight');
|
||||
|
||||
MarginBottom = require('./MarginBottom');
|
||||
|
||||
module.exports = Margin = (function(superClass) {
|
||||
module.exports = Margin = function () {
|
||||
var self;
|
||||
|
||||
extend(Margin, superClass);
|
||||
var Margin = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Margin, _Declaration2);
|
||||
|
||||
function Margin() {
|
||||
return Margin.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
var _super = _createSuper(Margin);
|
||||
|
||||
function Margin() {
|
||||
_classCallCheck(this, Margin);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
_createClass(Margin, null, [{
|
||||
key: "setOnto",
|
||||
value: function setOnto(declarations, prop, originalValue) {
|
||||
var append, val, vals;
|
||||
append = '';
|
||||
val = _Declaration.sanitizeValue(originalValue);
|
||||
|
||||
if (_Declaration.importantClauseRx.test(String(val))) {
|
||||
append = ' !important';
|
||||
val = val.replace(_Declaration.importantClauseRx, '');
|
||||
}
|
||||
|
||||
val = val.trim();
|
||||
|
||||
if (val.length === 0) {
|
||||
return self._setAllDirections(declarations, append, append, append, append);
|
||||
}
|
||||
|
||||
vals = val.split(" ").map(function (val) {
|
||||
return val + append;
|
||||
});
|
||||
|
||||
if (vals.length === 1) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]);
|
||||
} else if (vals.length === 2) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]);
|
||||
} else if (vals.length === 3) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]);
|
||||
} else if (vals.length === 4) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]);
|
||||
} else {
|
||||
throw Error("Can't understand value for margin: `".concat(originalValue, "`"));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_setAllDirections",
|
||||
value: function _setAllDirections(declarations, top, right, bottom, left) {
|
||||
MarginTop.setOnto(declarations, 'marginTop', top);
|
||||
MarginTop.setOnto(declarations, 'marginRight', right);
|
||||
MarginTop.setOnto(declarations, 'marginBottom', bottom);
|
||||
MarginTop.setOnto(declarations, 'marginLeft', left);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Margin;
|
||||
}(_Declaration);
|
||||
|
||||
;
|
||||
self = Margin;
|
||||
|
||||
Margin.setOnto = function(declarations, prop, originalValue) {
|
||||
var append, val, vals;
|
||||
append = '';
|
||||
val = _Declaration.sanitizeValue(originalValue);
|
||||
if (_Declaration.importantClauseRx.test(String(val))) {
|
||||
append = ' !important';
|
||||
val = val.replace(_Declaration.importantClauseRx, '');
|
||||
}
|
||||
val = val.trim();
|
||||
if (val.length === 0) {
|
||||
return self._setAllDirections(declarations, append, append, append, append);
|
||||
}
|
||||
vals = val.split(" ").map(function(val) {
|
||||
return val + append;
|
||||
});
|
||||
if (vals.length === 1) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]);
|
||||
} else if (vals.length === 2) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]);
|
||||
} else if (vals.length === 3) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]);
|
||||
} else if (vals.length === 4) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]);
|
||||
} else {
|
||||
throw Error("Can't understand value for margin: `" + originalValue + "`");
|
||||
}
|
||||
};
|
||||
|
||||
Margin._setAllDirections = function(declarations, top, right, bottom, left) {
|
||||
MarginTop.setOnto(declarations, 'marginTop', top);
|
||||
MarginTop.setOnto(declarations, 'marginRight', right);
|
||||
MarginTop.setOnto(declarations, 'marginBottom', bottom);
|
||||
MarginTop.setOnto(declarations, 'marginLeft', left);
|
||||
};
|
||||
|
||||
return Margin;
|
||||
|
||||
})(_Declaration);
|
||||
}.call(void 0);
|
||||
Generated
Vendored
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var MarginBottom, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MarginBottom, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = MarginBottom = (function(superClass) {
|
||||
extend(MarginBottom, superClass);
|
||||
module.exports = MarginBottom = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(MarginBottom, _Length2);
|
||||
|
||||
var _super = _createSuper(MarginBottom);
|
||||
|
||||
function MarginBottom() {
|
||||
return MarginBottom.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, MarginBottom);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return MarginBottom;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var MarginLeft, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MarginLeft, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = MarginLeft = (function(superClass) {
|
||||
extend(MarginLeft, superClass);
|
||||
module.exports = MarginLeft = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(MarginLeft, _Length2);
|
||||
|
||||
var _super = _createSuper(MarginLeft);
|
||||
|
||||
function MarginLeft() {
|
||||
return MarginLeft.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, MarginLeft);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return MarginLeft;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var MarginRight, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MarginRight, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = MarginRight = (function(superClass) {
|
||||
extend(MarginRight, superClass);
|
||||
module.exports = MarginRight = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(MarginRight, _Length2);
|
||||
|
||||
var _super = _createSuper(MarginRight);
|
||||
|
||||
function MarginRight() {
|
||||
return MarginRight.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, MarginRight);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return MarginRight;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var MarginTop, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var MarginTop, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = MarginTop = (function(superClass) {
|
||||
extend(MarginTop, superClass);
|
||||
module.exports = MarginTop = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(MarginTop, _Length2);
|
||||
|
||||
var _super = _createSuper(MarginTop);
|
||||
|
||||
function MarginTop() {
|
||||
return MarginTop.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, MarginTop);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return MarginTop;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+85
-51
@@ -1,64 +1,98 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Padding, PaddingBottom, PaddingLeft, PaddingRight, PaddingTop, _Declaration,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Padding, PaddingBottom, PaddingLeft, PaddingRight, PaddingTop, _Declaration;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
PaddingTop = require('./PaddingTop');
|
||||
|
||||
PaddingLeft = require('./PaddingLeft');
|
||||
|
||||
PaddingRight = require('./PaddingRight');
|
||||
|
||||
PaddingBottom = require('./PaddingBottom');
|
||||
|
||||
module.exports = Padding = (function(superClass) {
|
||||
module.exports = Padding = function () {
|
||||
var self;
|
||||
|
||||
extend(Padding, superClass);
|
||||
var Padding = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(Padding, _Declaration2);
|
||||
|
||||
function Padding() {
|
||||
return Padding.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
var _super = _createSuper(Padding);
|
||||
|
||||
function Padding() {
|
||||
_classCallCheck(this, Padding);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
_createClass(Padding, null, [{
|
||||
key: "setOnto",
|
||||
value: function setOnto(declarations, prop, originalValue) {
|
||||
var append, val, vals;
|
||||
append = '';
|
||||
val = _Declaration.sanitizeValue(originalValue);
|
||||
|
||||
if (_Declaration.importantClauseRx.test(String(val))) {
|
||||
append = ' !important';
|
||||
val = val.replace(_Declaration.importantClauseRx, '');
|
||||
}
|
||||
|
||||
val = val.trim();
|
||||
|
||||
if (val.length === 0) {
|
||||
return self._setAllDirections(declarations, append, append, append, append);
|
||||
}
|
||||
|
||||
vals = val.split(" ").map(function (val) {
|
||||
return val + append;
|
||||
});
|
||||
|
||||
if (vals.length === 1) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]);
|
||||
} else if (vals.length === 2) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]);
|
||||
} else if (vals.length === 3) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]);
|
||||
} else if (vals.length === 4) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]);
|
||||
} else {
|
||||
throw Error("Can't understand value for padding: `".concat(originalValue, "`"));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "_setAllDirections",
|
||||
value: function _setAllDirections(declarations, top, right, bottom, left) {
|
||||
PaddingTop.setOnto(declarations, 'paddingTop', top);
|
||||
PaddingTop.setOnto(declarations, 'paddingRight', right);
|
||||
PaddingTop.setOnto(declarations, 'paddingBottom', bottom);
|
||||
PaddingTop.setOnto(declarations, 'paddingLeft', left);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Padding;
|
||||
}(_Declaration);
|
||||
|
||||
;
|
||||
self = Padding;
|
||||
|
||||
Padding.setOnto = function(declarations, prop, originalValue) {
|
||||
var append, val, vals;
|
||||
append = '';
|
||||
val = _Declaration.sanitizeValue(originalValue);
|
||||
if (_Declaration.importantClauseRx.test(String(val))) {
|
||||
append = ' !important';
|
||||
val = val.replace(_Declaration.importantClauseRx, '');
|
||||
}
|
||||
val = val.trim();
|
||||
if (val.length === 0) {
|
||||
return self._setAllDirections(declarations, append, append, append, append);
|
||||
}
|
||||
vals = val.split(" ").map(function(val) {
|
||||
return val + append;
|
||||
});
|
||||
if (vals.length === 1) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]);
|
||||
} else if (vals.length === 2) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]);
|
||||
} else if (vals.length === 3) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]);
|
||||
} else if (vals.length === 4) {
|
||||
return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]);
|
||||
} else {
|
||||
throw Error("Can't understand value for padding: `" + originalValue + "`");
|
||||
}
|
||||
};
|
||||
|
||||
Padding._setAllDirections = function(declarations, top, right, bottom, left) {
|
||||
PaddingTop.setOnto(declarations, 'paddingTop', top);
|
||||
PaddingTop.setOnto(declarations, 'paddingRight', right);
|
||||
PaddingTop.setOnto(declarations, 'paddingBottom', bottom);
|
||||
PaddingTop.setOnto(declarations, 'paddingLeft', left);
|
||||
};
|
||||
|
||||
return Padding;
|
||||
|
||||
})(_Declaration);
|
||||
}.call(void 0);
|
||||
Generated
Vendored
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var PaddingBottom, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var PaddingBottom, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = PaddingBottom = (function(superClass) {
|
||||
extend(PaddingBottom, superClass);
|
||||
module.exports = PaddingBottom = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(PaddingBottom, _Length2);
|
||||
|
||||
var _super = _createSuper(PaddingBottom);
|
||||
|
||||
function PaddingBottom() {
|
||||
return PaddingBottom.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, PaddingBottom);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return PaddingBottom;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var PaddingLeft, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var PaddingLeft, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = PaddingLeft = (function(superClass) {
|
||||
extend(PaddingLeft, superClass);
|
||||
module.exports = PaddingLeft = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(PaddingLeft, _Length2);
|
||||
|
||||
var _super = _createSuper(PaddingLeft);
|
||||
|
||||
function PaddingLeft() {
|
||||
return PaddingLeft.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, PaddingLeft);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return PaddingLeft;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
Generated
Vendored
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var PaddingRight, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var PaddingRight, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = PaddingRight = (function(superClass) {
|
||||
extend(PaddingRight, superClass);
|
||||
module.exports = PaddingRight = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(PaddingRight, _Length2);
|
||||
|
||||
var _super = _createSuper(PaddingRight);
|
||||
|
||||
function PaddingRight() {
|
||||
return PaddingRight.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, PaddingRight);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return PaddingRight;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var PaddingTop, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var PaddingTop, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = PaddingTop = (function(superClass) {
|
||||
extend(PaddingTop, superClass);
|
||||
module.exports = PaddingTop = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(PaddingTop, _Length2);
|
||||
|
||||
var _super = _createSuper(PaddingTop);
|
||||
|
||||
function PaddingTop() {
|
||||
return PaddingTop.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, PaddingTop);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return PaddingTop;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
+30
-9
@@ -1,17 +1,38 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var Width, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var Width, _Length;
|
||||
|
||||
_Length = require('./_Length');
|
||||
|
||||
module.exports = Width = (function(superClass) {
|
||||
extend(Width, superClass);
|
||||
module.exports = Width = /*#__PURE__*/function (_Length2) {
|
||||
_inherits(Width, _Length2);
|
||||
|
||||
var _super = _createSuper(Width);
|
||||
|
||||
function Width() {
|
||||
return Width.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, Width);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Width;
|
||||
|
||||
})(_Length);
|
||||
}(_Length);
|
||||
Generated
Vendored
+101
-73
@@ -1,84 +1,112 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
"use strict";
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
// Abstract Style Declaration
|
||||
var _Declaration;
|
||||
|
||||
module.exports = _Declaration = (function() {
|
||||
module.exports = _Declaration = function () {
|
||||
var self;
|
||||
|
||||
self = _Declaration;
|
||||
var _Declaration = /*#__PURE__*/function () {
|
||||
function _Declaration(prop1, val) {
|
||||
_classCallCheck(this, _Declaration);
|
||||
|
||||
_Declaration.importantClauseRx = /(\s\!important)$/;
|
||||
|
||||
_Declaration.setOnto = function(declarations, prop, val) {
|
||||
var dec;
|
||||
if (!(dec = declarations[prop])) {
|
||||
return declarations[prop] = new this(prop, val);
|
||||
} else {
|
||||
return dec.set(val);
|
||||
}
|
||||
};
|
||||
|
||||
_Declaration.sanitizeValue = function(val) {
|
||||
return String(val).trim().replace(/[\s]+/g, ' ');
|
||||
};
|
||||
|
||||
_Declaration.inheritAllowed = false;
|
||||
|
||||
function _Declaration(prop1, val) {
|
||||
this.prop = prop1;
|
||||
this.important = false;
|
||||
this.set(val);
|
||||
}
|
||||
|
||||
_Declaration.prototype.get = function() {
|
||||
return this._get();
|
||||
};
|
||||
|
||||
_Declaration.prototype._get = function() {
|
||||
return this.val;
|
||||
};
|
||||
|
||||
_Declaration.prototype._pickImportantClause = function(val) {
|
||||
if (self.importantClauseRx.test(String(val))) {
|
||||
this.important = true;
|
||||
return val.replace(self.importantClauseRx, '');
|
||||
} else {
|
||||
this.prop = prop1;
|
||||
this.important = false;
|
||||
return val;
|
||||
this.set(val);
|
||||
}
|
||||
};
|
||||
|
||||
_Declaration.prototype.set = function(val) {
|
||||
val = self.sanitizeValue(val);
|
||||
val = this._pickImportantClause(val);
|
||||
val = val.trim();
|
||||
if (this._handleNullOrInherit(val)) {
|
||||
return this;
|
||||
}
|
||||
this._set(val);
|
||||
return this;
|
||||
};
|
||||
|
||||
_Declaration.prototype._set = function(val) {
|
||||
return this.val = val;
|
||||
};
|
||||
|
||||
_Declaration.prototype._handleNullOrInherit = function(val) {
|
||||
if (val === '') {
|
||||
this.val = '';
|
||||
return true;
|
||||
}
|
||||
if (val === 'inherit') {
|
||||
if (this.constructor.inheritAllowed) {
|
||||
this.val = 'inherit';
|
||||
} else {
|
||||
throw Error("Inherit is not allowed for `" + this.prop + "`");
|
||||
_createClass(_Declaration, [{
|
||||
key: "get",
|
||||
value: function get() {
|
||||
return this._get();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}, {
|
||||
key: "_get",
|
||||
value: function _get() {
|
||||
return this.val;
|
||||
}
|
||||
}, {
|
||||
key: "_pickImportantClause",
|
||||
value: function _pickImportantClause(val) {
|
||||
if (self.importantClauseRx.test(String(val))) {
|
||||
this.important = true;
|
||||
return val.replace(self.importantClauseRx, '');
|
||||
} else {
|
||||
this.important = false;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "set",
|
||||
value: function set(val) {
|
||||
val = self.sanitizeValue(val);
|
||||
val = this._pickImportantClause(val);
|
||||
val = val.trim();
|
||||
|
||||
if (this._handleNullOrInherit(val)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
this._set(val);
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "_set",
|
||||
value: function _set(val) {
|
||||
return this.val = val;
|
||||
}
|
||||
}, {
|
||||
key: "_handleNullOrInherit",
|
||||
value: function _handleNullOrInherit(val) {
|
||||
if (val === '') {
|
||||
this.val = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
if (val === 'inherit') {
|
||||
if (this.constructor.inheritAllowed) {
|
||||
this.val = 'inherit';
|
||||
} else {
|
||||
throw Error("Inherit is not allowed for `".concat(this.prop, "`"));
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}], [{
|
||||
key: "setOnto",
|
||||
value: function setOnto(declarations, prop, val) {
|
||||
var dec;
|
||||
|
||||
if (!(dec = declarations[prop])) {
|
||||
return declarations[prop] = new this(prop, val);
|
||||
} else {
|
||||
return dec.set(val);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "sanitizeValue",
|
||||
value: function sanitizeValue(val) {
|
||||
return String(val).trim().replace(/[\s]+/g, ' ');
|
||||
}
|
||||
}]);
|
||||
|
||||
return _Declaration;
|
||||
}();
|
||||
|
||||
;
|
||||
self = _Declaration;
|
||||
_Declaration.importantClauseRx = /(\s\!important)$/;
|
||||
_Declaration.inheritAllowed = false;
|
||||
return _Declaration;
|
||||
|
||||
})();
|
||||
}.call(void 0);
|
||||
+43
-14
@@ -1,24 +1,53 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var _Declaration, _Length,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var _Declaration, _Length;
|
||||
|
||||
_Declaration = require('./_Declaration');
|
||||
|
||||
module.exports = _Length = (function(superClass) {
|
||||
extend(_Length, superClass);
|
||||
module.exports = _Length = /*#__PURE__*/function (_Declaration2) {
|
||||
_inherits(_Length, _Declaration2);
|
||||
|
||||
var _super = _createSuper(_Length);
|
||||
|
||||
function _Length() {
|
||||
return _Length.__super__.constructor.apply(this, arguments);
|
||||
_classCallCheck(this, _Length);
|
||||
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
_Length.prototype._set = function(val) {
|
||||
if (!/^[0-9]+$/.test(String(val))) {
|
||||
throw Error("`" + this.prop + "` only takes an integer for value");
|
||||
_createClass(_Length, [{
|
||||
key: "_set",
|
||||
value: function _set(val) {
|
||||
if (!/^[0-9]+$/.test(String(val))) {
|
||||
throw Error("`".concat(this.prop, "` only takes an integer for value"));
|
||||
}
|
||||
|
||||
return this.val = parseInt(val);
|
||||
}
|
||||
return this.val = parseInt(val);
|
||||
};
|
||||
}]);
|
||||
|
||||
return _Length;
|
||||
|
||||
})(_Declaration);
|
||||
}(_Declaration);
|
||||
+40
-22
@@ -1,72 +1,89 @@
|
||||
// Generated by CoffeeScript 1.9.3
|
||||
var htmlparser, object, objectToDom, self;
|
||||
"use strict";
|
||||
|
||||
// Generated by CoffeeScript 2.5.1
|
||||
var cloneDeep, htmlparser, isPlainObject, merge, _objectToDom, self;
|
||||
|
||||
htmlparser = require('htmlparser2');
|
||||
|
||||
object = require('utila').object;
|
||||
|
||||
objectToDom = require('dom-converter').objectToDom;
|
||||
var _require = require('dom-converter');
|
||||
|
||||
_objectToDom = _require.objectToDom;
|
||||
merge = require('lodash/merge');
|
||||
cloneDeep = require('lodash/cloneDeep');
|
||||
isPlainObject = require('lodash/isPlainObject');
|
||||
module.exports = self = {
|
||||
repeatString: function(str, times) {
|
||||
repeatString: function repeatString(str, times) {
|
||||
var i, j, output, ref;
|
||||
output = '';
|
||||
|
||||
for (i = j = 0, ref = times; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
|
||||
output += str;
|
||||
}
|
||||
|
||||
return output;
|
||||
},
|
||||
toDom: function(subject) {
|
||||
cloneAndMergeDeep: function cloneAndMergeDeep(base, toAppend) {
|
||||
return merge(cloneDeep(base), toAppend);
|
||||
},
|
||||
toDom: function toDom(subject) {
|
||||
if (typeof subject === 'string') {
|
||||
return self.stringToDom(subject);
|
||||
} else if (object.isBareObject(subject)) {
|
||||
} else if (isPlainObject(subject)) {
|
||||
return self._objectToDom(subject);
|
||||
} else {
|
||||
throw Error("tools.toDom() only supports strings and objects");
|
||||
}
|
||||
},
|
||||
stringToDom: function(string) {
|
||||
stringToDom: function stringToDom(string) {
|
||||
var handler, parser;
|
||||
handler = new htmlparser.DomHandler;
|
||||
handler = new htmlparser.DomHandler();
|
||||
parser = new htmlparser.Parser(handler);
|
||||
parser.write(string);
|
||||
parser.end();
|
||||
return handler.dom;
|
||||
},
|
||||
_fixQuotesInDom: function(input) {
|
||||
_fixQuotesInDom: function _fixQuotesInDom(input) {
|
||||
var j, len, node;
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
for (j = 0, len = input.length; j < len; j++) {
|
||||
node = input[j];
|
||||
|
||||
self._fixQuotesInDom(node);
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
node = input;
|
||||
|
||||
if (node.type === 'text') {
|
||||
return node.data = self._quoteNodeText(node.data);
|
||||
} else {
|
||||
return self._fixQuotesInDom(node.children);
|
||||
}
|
||||
},
|
||||
objectToDom: function(o) {
|
||||
objectToDom: function objectToDom(o) {
|
||||
if (!Array.isArray(o)) {
|
||||
if (!object.isBareObject(o)) {
|
||||
if (!isPlainObject(o)) {
|
||||
throw Error("objectToDom() only accepts a bare object or an array");
|
||||
}
|
||||
}
|
||||
return self._fixQuotesInDom(objectToDom(o));
|
||||
|
||||
return self._fixQuotesInDom(_objectToDom(o));
|
||||
},
|
||||
quote: function(str) {
|
||||
quote: function quote(str) {
|
||||
return String(str).replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"').replace(/\ /g, '&sp;').replace(/\n/g, '<br />');
|
||||
},
|
||||
_quoteNodeText: function(text) {
|
||||
_quoteNodeText: function _quoteNodeText(text) {
|
||||
return String(text).replace(/\&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"').replace(/\ /g, '&sp;').replace(/\n/g, "&nl;");
|
||||
},
|
||||
getCols: function() {
|
||||
var cols, tty;
|
||||
getCols: function getCols() {
|
||||
var cols, tty; // Based on https://github.com/jonschlinkert/window-size
|
||||
|
||||
tty = require('tty');
|
||||
cols = (function() {
|
||||
|
||||
cols = function () {
|
||||
try {
|
||||
if (tty.isatty(1) && tty.isatty(2)) {
|
||||
if (process.stdout.getWindowSize) {
|
||||
@@ -77,12 +94,13 @@ module.exports = self = {
|
||||
return process.stdout.columns;
|
||||
}
|
||||
}
|
||||
} catch (_error) {}
|
||||
})();
|
||||
} catch (error) {}
|
||||
}();
|
||||
|
||||
if (typeof cols === 'number' && cols > 30) {
|
||||
return cols;
|
||||
} else {
|
||||
return 80;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
"_args": [
|
||||
[
|
||||
"ansi-regex@2.1.1",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "ansi-regex@2.1.1",
|
||||
"_id": "ansi-regex@2.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||
"_integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
|
||||
"_location": "/renderkid/ansi-regex",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"_spec": "2.1.1",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
"_args": [
|
||||
[
|
||||
"strip-ansi@3.0.1",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "strip-ansi@3.0.1",
|
||||
"_id": "strip-ansi@3.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"_integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
|
||||
"_location": "/renderkid/strip-ansi",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"_spec": "3.0.1",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
|
||||
+31
-38
@@ -1,37 +1,32 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"renderkid@2.0.3",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"renderkid@2.0.7",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "renderkid@2.0.3",
|
||||
"_id": "renderkid@2.0.3",
|
||||
"_from": "renderkid@2.0.7",
|
||||
"_id": "renderkid@2.0.7",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA==",
|
||||
"_integrity": "sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ==",
|
||||
"_location": "/renderkid",
|
||||
"_phantomChildren": {
|
||||
"boolbase": "1.0.0",
|
||||
"dom-serializer": "0.2.2",
|
||||
"domelementtype": "1.3.1",
|
||||
"nth-check": "1.0.2"
|
||||
},
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "renderkid@2.0.3",
|
||||
"raw": "renderkid@2.0.7",
|
||||
"name": "renderkid",
|
||||
"escapedName": "renderkid",
|
||||
"rawSpec": "2.0.3",
|
||||
"rawSpec": "2.0.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.3"
|
||||
"fetchSpec": "2.0.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/pretty-error"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz",
|
||||
"_spec": "2.0.3",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.7.tgz",
|
||||
"_spec": "2.0.7",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Aria Minaei"
|
||||
},
|
||||
@@ -39,24 +34,23 @@
|
||||
"url": "https://github.com/AriaMinaei/RenderKid/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"css-select": "^1.1.0",
|
||||
"dom-converter": "^0.2",
|
||||
"htmlparser2": "^3.3.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"utila": "^0.4.0"
|
||||
"css-select": "^4.1.3",
|
||||
"dom-converter": "^0.2.0",
|
||||
"htmlparser2": "^6.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"strip-ansi": "^3.0.1"
|
||||
},
|
||||
"description": "Stylish console.log for node",
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.2",
|
||||
"chai-changes": "^1.3.4",
|
||||
"chai-fuzzy": "^1.5.0",
|
||||
"coffee-script": "^1.9.1",
|
||||
"jitter": "^1.3.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha-pretty-spec-reporter": "0.1.0-beta.2",
|
||||
"sinon": "^1.14.1",
|
||||
"sinon-chai": "^2.7.0",
|
||||
"underscore": "^1.8.3"
|
||||
"@babel/core": "^7.14.5",
|
||||
"@babel/preset-env": "^7.14.5",
|
||||
"chai": "^4.3.4",
|
||||
"chai-changes": "^1.3.6",
|
||||
"chai-fuzzy": "^1.6.1",
|
||||
"coffeescript": "^2.5.1",
|
||||
"mocha": "^9.0.0",
|
||||
"sinon": "^11.1.1",
|
||||
"sinon-chai": "^3.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/AriaMinaei/RenderKid#readme",
|
||||
"license": "MIT",
|
||||
@@ -67,13 +61,12 @@
|
||||
"url": "git+https://github.com/AriaMinaei/RenderKid.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "coffee --bare --compile --output ./lib ./src",
|
||||
"compile:watch": "jitter src lib -b",
|
||||
"compile": "coffee --bare --transpile --output ./lib ./src",
|
||||
"compile:watch": "coffee --watch --bare --transpile --output ./lib ./src",
|
||||
"prepublish": "npm run compile",
|
||||
"test": "mocha \"test/**/*.coffee\"",
|
||||
"test:watch": "mocha \"test/**/*.coffee\" --watch",
|
||||
"watch": "npm run compile:watch & npm run test:watch",
|
||||
"winwatch": "start/b npm run compile:watch & npm run test:watch"
|
||||
"test:watch": "npm run test -- --watch",
|
||||
"watch": "npm run compile:watch & npm run test:watch"
|
||||
},
|
||||
"version": "2.0.3"
|
||||
"version": "2.0.7"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user