first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

5
app_vue/node_modules/renderkid/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,5 @@
# Renderkid Changelog
## `3.0.0`
* **Breaking change**: Dropped support for Node `<12.x`

20
app_vue/node_modules/renderkid/LICENSE generated vendored Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2015 Aria Minaei
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

189
app_vue/node_modules/renderkid/README.md generated vendored Normal file
View File

@ -0,0 +1,189 @@
# RenderKid
[![Build Status](https://secure.travis-ci.org/AriaMinaei/RenderKid.png)](http://travis-ci.org/AriaMinaei/RenderKid)
RenderKid allows you to use HTML and CSS to style your CLI output, making it easy to create a beautiful, readable, and consistent look for your nodejs tool.
## Installation
Install with npm:
```
$ npm install renderkid
```
## Usage
```coffeescript
RenderKid = require('renderkid')
r = new RenderKid()
r.style({
"ul": {
display: "block"
margin: "2 0 2"
}
"li": {
display: "block"
marginBottom: "1"
}
"key": {
color: "grey"
marginRight: "1"
}
"value": {
color: "bright-white"
}
})
output = r.render("
<ul>
<li>
<key>Name:</key>
<value>RenderKid</value>
</li>
<li>
<key>Version:</key>
<value>0.2</value>
</li>
<li>
<key>Last Update:</key>
<value>Jan 2015</value>
</li>
</ul>
")
console.log(output)
```
![screenshot of usage](https://github.com/AriaMinaei/RenderKid/raw/master/docs/images/usage.png)
## Stylesheet properties
### Display mode
Elements can have a `display` of either `inline`, `block`, or `none`:
```coffeescript
r.style({
"div": {
display: "block"
}
"span": {
display: "inline" # default
}
"hidden": {
display: "none"
}
})
output = r.render("
<div>This will fill one or more rows.</div>
<span>These</span> <span>will</span> <span>be</span> in the same <span>line.</span>
<hidden>This won't be displayed.</hidden>
")
console.log(output)
```
![screenshot of usage](https://github.com/AriaMinaei/RenderKid/raw/master/docs/images/display.png)
### Margin
Margins work just like they do in browsers:
```coffeescript
r.style({
"li": {
display: "block"
marginTop: "1"
marginRight: "2"
marginBottom: "3"
marginLeft: "4"
# or the shorthand version:
"margin": "1 2 3 4"
},
"highlight": {
display: "inline"
marginLeft: "2"
marginRight: "2"
}
})
r.render("
<ul>
<li>Item <highlgiht>1</highlight></li>
<li>Item <highlgiht>2</highlight></li>
<li>Item <highlgiht>3</highlight></li>
</ul>
")
```
### Padding
See margins above. Paddings work the same way, only inward.
### Width and Height
Block elements can have explicit width and height:
```coffeescript
r.style({
"box": {
display: "block"
"width": "4"
"height": "2"
}
})
r.render("<box>This is a box and some of its text will be truncated.</box>")
```
### Colors
You can set a custom color and background color for each element:
```coffeescript
r.style({
"error": {
color: "black"
background: "red"
}
})
```
List of colors currently supported are `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `grey`, `bright-red`, `bright-green`, `bright-yellow`, `bright-blue`, `bright-magenta`, `bright-cyan`, `bright-white`.
### Bullet points
Block elements can have bullet points on their margins. Let's start with an example:
```coffeescript
r.style({
"li": {
# To add bullet points to an element, first you
# should make some room for the bullet point by
# giving your element some margin to the left:
marginLeft: "4",
# Now we can add a bullet point to our margin:
bullet: '"-"'
}
})
# The four hyphens are there for visual reference
r.render("
----
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
----
")
```
And here is the result:
![screenshot of bullet points, 1](https://github.com/AriaMinaei/RenderKid/raw/master/docs/images/bullets-1.png)

11
app_vue/node_modules/renderkid/SECURITY.md generated vendored Normal file
View File

@ -0,0 +1,11 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 2.0.x | :white_check_mark: |
## Reporting a Vulnerability
Send security alerts to aria@theatrejs.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
app_vue/node_modules/renderkid/docs/images/display.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
app_vue/node_modules/renderkid/docs/images/usage.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

161
app_vue/node_modules/renderkid/lib/AnsiPainter.js generated vendored Normal file
View File

@ -0,0 +1,161 @@
"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');
module.exports = AnsiPainter = function () {
var self;
var AnsiPainter = /*#__PURE__*/function () {
function AnsiPainter() {
_classCallCheck(this, AnsiPainter);
}
_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(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&amp;/g, '&');
}
}, {
key: "_parse",
value: function _parse(string) {
var injectFakeRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (injectFakeRoot) {
string = '<none>' + string + '</none>';
}
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 = '';
for (n in children) {
if (!hasProp.call(children, n)) continue;
child = children[n];
ret += this._renderNode(child, parentStyles);
}
return ret;
}
}, {
key: "_renderNode",
value: function _renderNode(node, parentStyles) {
if (node.type === 'text') {
return this._renderTextNode(node, parentStyles);
} else {
return this._renderTag(node, parentStyles);
}
}
}, {
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 = {};
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;
return AnsiPainter;
}.call(void 0);

134
app_vue/node_modules/renderkid/lib/Layout.js generated vendored Normal file
View File

@ -0,0 +1,134 @@
"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');
var _require = require('./tools');
cloneAndMergeDeep = _require.cloneAndMergeDeep;
SpecialString = require('./layout/SpecialString');
terminalWidth = require('./tools').getCols();
module.exports = Layout = function () {
var self;
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: {
amount: 0
}
},
lineAppendor: {
options: {
amount: 0
}
},
blockPrependor: {
options: {
amount: 0
}
},
blockAppendor: {
options: {
amount: 0
}
}
};
Layout._defaultConfig = {
terminalWidth: terminalWidth
};
return Layout;
}.call(void 0);
ref = ['openBlock', 'write'];
for (i = 0, len = ref.length; i < len; i++) {
prop = ref[i];
(function () {
var method;
method = prop;
return Layout.prototype[method] = function () {
return this._root[method].apply(this._root, arguments);
};
})();
}

241
app_vue/node_modules/renderkid/lib/RenderKid.js generated vendored Normal file
View File

@ -0,0 +1,241 @@
"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');
stripAnsi = require('strip-ansi');
terminalWidth = require('./tools').getCols();
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
}
};
return RenderKid;
}.call(void 0);

View File

@ -0,0 +1,76 @@
"use strict";
// Generated by CoffeeScript 2.5.1
var codes, styles;
module.exports = styles = {};
styles.codes = codes = {
'none': 0,
'black': 30,
'red': 31,
'green': 32,
'yellow': 33,
'blue': 34,
'magenta': 35,
'cyan': 36,
'white': 37,
'grey': 90,
'bright-red': 91,
'bright-green': 92,
'bright-yellow': 93,
'bright-blue': 94,
'bright-magenta': 95,
'bright-cyan': 96,
'bright-white': 97,
'bg-black': 40,
'bg-red': 41,
'bg-green': 42,
'bg-yellow': 43,
'bg-blue': 44,
'bg-magenta': 45,
'bg-cyan': 46,
'bg-white': 47,
'bg-grey': 100,
'bg-bright-red': 101,
'bg-bright-green': 102,
'bg-bright-yellow': 103,
'bg-bright-blue': 104,
'bg-bright-magenta': 105,
'bg-bright-cyan': 106,
'bg-bright-white': 107
};
styles.color = function (str) {
var code;
if (str === 'none') {
return '';
}
code = codes[str];
if (code == null) {
throw Error("Unknown color `".concat(str, "`"));
}
return "\x1b[" + code + "m";
};
styles.bg = function (str) {
var code;
if (str === 'none') {
return '';
}
code = codes['bg-' + str];
if (code == null) {
throw Error("Unknown bg color `".concat(str, "`"));
}
return "\x1B[" + code + "m";
};
styles.none = function (str) {
return "\x1B[" + codes.none + "m";
};

35
app_vue/node_modules/renderkid/lib/ansiPainter/tags.js generated vendored Normal file
View File

@ -0,0 +1,35 @@
"use strict";
// Generated by CoffeeScript 2.5.1
var color, colors, i, len, tags;
module.exports = tags = {
'none': {
color: 'none',
bg: 'none'
},
'bg-none': {
color: 'inherit',
bg: 'none'
},
'color-none': {
color: 'none',
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++) {
color = colors[i];
tags[color] = {
color: color,
bg: 'inherit'
};
tags["color-".concat(color)] = {
color: color,
bg: 'inherit'
};
tags["bg-".concat(color)] = {
color: 'inherit',
bg: color
};
}

350
app_vue/node_modules/renderkid/lib/layout/Block.js generated vendored Normal file
View File

@ -0,0 +1,350 @@
"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');
terminalWidth = require('../tools').getCols();
var _require = require('../tools');
cloneAndMergeDeep = _require.cloneAndMergeDeep;
module.exports = Block = function () {
var self;
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'),
options: {
amount: 0
}
},
blockAppendor: {
fn: require('./block/blockAppendor/Default'),
options: {
amount: 0
}
},
linePrependor: {
fn: require('./block/linePrependor/Default'),
options: {
amount: 0
}
},
lineAppendor: {
fn: require('./block/lineAppendor/Default'),
options: {
amount: 0
}
},
lineWrapper: {
fn: require('./block/lineWrapper/Default'),
options: {
lineWidth: null
}
},
width: terminalWidth,
prefixRaw: '',
suffixRaw: ''
};
return Block;
}.call(void 0);

View File

@ -0,0 +1,208 @@
"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 SpecialString, i, len, prop, ref;
module.exports = SpecialString = function () {
var self;
var SpecialString = /*#__PURE__*/function () {
function SpecialString(str) {
_classCallCheck(this, SpecialString);
if (!(this instanceof self)) {
return new self(str);
}
this._str = String(str);
this._len = 0;
}
_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;
lines = [];
justSkippedSkipChar = false;
self._countChars(this._str, function (char, charLength) {
if (bufferLength > limit || bufferLength + charLength > limit) {
lines.push(buffer);
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;
}
}, {
key: "trim",
value: function trim() {
return new SpecialString(this.str.trim());
}
}, {
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'];
for (i = 0, len = ref.length; i < len; i++) {
prop = ref[i];
(function () {
var methodName;
methodName = '_get' + prop[0].toUpperCase() + prop.substr(1, prop.length);
return SpecialString.prototype.__defineGetter__(prop, function () {
return this[methodName]();
});
})();
}

View File

@ -0,0 +1,48 @@
"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 = /*#__PURE__*/function (_require) {
_inherits(DefaultBlockAppendor, _require);
var _super = _createSuper(DefaultBlockAppendor);
function DefaultBlockAppendor() {
_classCallCheck(this, DefaultBlockAppendor);
return _super.apply(this, arguments);
}
_createClass(DefaultBlockAppendor, [{
key: "_render",
value: function _render(options) {
return tools.repeatString("\n", this._config.amount);
}
}]);
return DefaultBlockAppendor;
}(require('./_BlockAppendor'));

View File

@ -0,0 +1,27 @@
"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 = /*#__PURE__*/function () {
function _BlockAppendor(_config) {
_classCallCheck(this, _BlockAppendor);
this._config = _config;
}
_createClass(_BlockAppendor, [{
key: "render",
value: function render(options) {
return this._render(options);
}
}]);
return _BlockAppendor;
}();

View File

@ -0,0 +1,48 @@
"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 = /*#__PURE__*/function (_require) {
_inherits(DefaultBlockPrependor, _require);
var _super = _createSuper(DefaultBlockPrependor);
function DefaultBlockPrependor() {
_classCallCheck(this, DefaultBlockPrependor);
return _super.apply(this, arguments);
}
_createClass(DefaultBlockPrependor, [{
key: "_render",
value: function _render(options) {
return tools.repeatString("\n", this._config.amount);
}
}]);
return DefaultBlockPrependor;
}(require('./_BlockPrependor'));

View File

@ -0,0 +1,27 @@
"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 = /*#__PURE__*/function () {
function _BlockPrependor(_config) {
_classCallCheck(this, _BlockPrependor);
this._config = _config;
}
_createClass(_BlockPrependor, [{
key: "render",
value: function render(options) {
return this._render(options);
}
}]);
return _BlockPrependor;
}();

View File

@ -0,0 +1,48 @@
"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 = /*#__PURE__*/function (_require) {
_inherits(DefaultLineAppendor, _require);
var _super = _createSuper(DefaultLineAppendor);
function DefaultLineAppendor() {
_classCallCheck(this, DefaultLineAppendor);
return _super.apply(this, arguments);
}
_createClass(DefaultLineAppendor, [{
key: "_render",
value: function _render(inherited, options) {
return inherited + tools.repeatString(" ", this._config.amount);
}
}]);
return DefaultLineAppendor;
}(require('./_LineAppendor'));

View File

@ -0,0 +1,29 @@
"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 = /*#__PURE__*/function () {
function _LineAppendor(_config) {
_classCallCheck(this, _LineAppendor);
this._config = _config;
this._lineNo = 0;
}
_createClass(_LineAppendor, [{
key: "render",
value: function render(inherited, options) {
this._lineNo++;
return '<none>' + this._render(inherited, options) + '</none>';
}
}]);
return _LineAppendor;
}();

View File

@ -0,0 +1,94 @@
"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 () {
var self;
var DefaultLinePrependor = /*#__PURE__*/function (_require) {
_inherits(DefaultLinePrependor, _require);
var _super = _createSuper(DefaultLinePrependor);
function DefaultLinePrependor() {
_classCallCheck(this, DefaultLinePrependor);
return _super.apply(this, arguments);
}
_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;
}.call(void 0);

View File

@ -0,0 +1,29 @@
"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 = /*#__PURE__*/function () {
function _LinePrependor(_config) {
_classCallCheck(this, _LinePrependor);
this._config = _config;
this._lineNo = -1;
}
_createClass(_LinePrependor, [{
key: "render",
value: function render(inherited, options) {
this._lineNo++;
return '<none>' + this._render(inherited, options) + '</none>';
}
}]);
return _LinePrependor;
}();

View File

@ -0,0 +1,45 @@
"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 DefaultLineWrapper;
module.exports = DefaultLineWrapper = /*#__PURE__*/function (_require) {
_inherits(DefaultLineWrapper, _require);
var _super = _createSuper(DefaultLineWrapper);
function DefaultLineWrapper() {
_classCallCheck(this, DefaultLineWrapper);
return _super.apply(this, arguments);
}
_createClass(DefaultLineWrapper, [{
key: "_render",
value: function _render() {}
}]);
return DefaultLineWrapper;
}(require('./_LineWrapper'));

View File

@ -0,0 +1,25 @@
"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 = /*#__PURE__*/function () {
function _LineWrapper() {
_classCallCheck(this, _LineWrapper);
}
_createClass(_LineWrapper, [{
key: "render",
value: function render(str, options) {
return this._render(str, options);
}
}]);
return _LineWrapper;
}();

99
app_vue/node_modules/renderkid/lib/renderKid/Styles.js generated vendored Normal file
View File

@ -0,0 +1,99 @@
"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 () {
var self;
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'
},
'body': {
background: 'none',
color: 'white',
display: 'block',
width: terminalWidth + ' !important'
}
};
return Styles;
}.call(void 0);

View File

@ -0,0 +1,45 @@
"use strict";
// Generated by CoffeeScript 2.5.1
var AnsiPainter, _common;
AnsiPainter = require('../../AnsiPainter');
module.exports = _common = {
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 `".concat(style.color, "`"));
}
tagsToAdd.push(tagName);
}
if (style.background != null) {
tagName = 'bg-' + style.background;
if (AnsiPainter.tags[tagName] == null) {
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 = "<".concat(tag, ">") + ret.before;
ret.after = ret.after + "</".concat(tag, ">");
}
return ret;
}
};

View File

@ -0,0 +1,96 @@
"use strict";
// Generated by CoffeeScript 2.5.1
var _common, blockStyleApplier, merge, self;
_common = require('./_common');
merge = require('lodash/merge');
module.exports = blockStyleApplier = self = {
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 _margins(style, config) {
if (style.marginLeft != null) {
merge(config, {
linePrependor: {
options: {
amount: parseInt(style.marginLeft)
}
}
});
}
if (style.marginRight != null) {
merge(config, {
lineAppendor: {
options: {
amount: parseInt(style.marginRight)
}
}
});
}
if (style.marginTop != null) {
merge(config, {
blockPrependor: {
options: {
amount: parseInt(style.marginTop)
}
}
});
}
if (style.marginBottom != null) {
merge(config, {
blockAppendor: {
options: {
amount: parseInt(style.marginBottom)
}
}
});
}
},
_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;
var _common$getStyleTagsF = _common.getStyleTagsFor({
color: bullet.color,
background: bullet.background
});
before = _common$getStyleTagsF.before;
after = _common$getStyleTagsF.after;
conf.char = before + bullet.char + after;
merge(config, {
linePrependor: {
options: {
bullet: conf
}
}
});
}
},
_dims: function _dims(style, config) {
var w;
if (style.width != null) {
w = parseInt(style.width);
config.width = w;
}
}
};

View File

@ -0,0 +1,31 @@
"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 applyTo(el, style) {
var ret;
ret = _common.getStyleTagsFor(style);
if (style.marginLeft != null) {
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;
}
return ret;
}
};

View File

@ -0,0 +1,31 @@
"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 = /*#__PURE__*/function () {
function Rule(selector) {
_classCallCheck(this, Rule);
this.selector = new Selector(selector);
this.styles = new DeclarationBlock();
}
_createClass(Rule, [{
key: "setStyles",
value: function setStyles(styles) {
this.styles.set(styles);
return this;
}
}]);
return Rule;
}();

View File

@ -0,0 +1,105 @@
"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 () {
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;
return StyleSheet;
}.call(void 0);

View File

@ -0,0 +1,92 @@
"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 () {
var self;
var DeclarationBlock = /*#__PURE__*/function () {
function DeclarationBlock() {
_classCallCheck(this, DeclarationBlock);
this._declarations = {};
}
_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;
}
}, {
key: "_getDeclarationClass",
value: function _getDeclarationClass(prop) {
var cls;
if (prop[0] === '_') {
return Arbitrary;
}
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'),
width: require('./declarationBlock/Width'),
height: require('./declarationBlock/Height'),
bullet: require('./declarationBlock/Bullet'),
display: require('./declarationBlock/Display'),
margin: require('./declarationBlock/Margin'),
marginTop: require('./declarationBlock/MarginTop'),
marginLeft: require('./declarationBlock/MarginLeft'),
marginRight: require('./declarationBlock/MarginRight'),
marginBottom: require('./declarationBlock/MarginBottom'),
padding: require('./declarationBlock/Padding'),
paddingTop: require('./declarationBlock/PaddingTop'),
paddingLeft: require('./declarationBlock/PaddingLeft'),
paddingRight: require('./declarationBlock/PaddingRight'),
paddingBottom: require('./declarationBlock/PaddingBottom')
};

View File

@ -0,0 +1,114 @@
"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;
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;
return MixedDeclarationSet;
}.call(void 0);

View File

@ -0,0 +1,61 @@
"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 () {
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;
return Selector;
}.call(void 0);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Declaration2) {
_inherits(Arbitrary, _Declaration2);
var _super = _createSuper(Arbitrary);
function Arbitrary() {
_classCallCheck(this, Arbitrary);
return _super.apply(this, arguments);
}
return Arbitrary;
}(_Declaration);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Declaration2) {
_inherits(Background, _Declaration2);
var _super = _createSuper(Background);
function Background() {
_classCallCheck(this, Background);
return _super.apply(this, arguments);
}
return Background;
}(_Declaration);

View File

@ -0,0 +1,102 @@
"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 () {
var self;
var Bullet = /*#__PURE__*/function (_Declaration2) {
_inherits(Bullet, _Declaration2);
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;
return Bullet;
}.call(void 0);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Declaration2) {
_inherits(Color, _Declaration2);
var _super = _createSuper(Color);
function Color() {
_classCallCheck(this, Color);
return _super.apply(this, arguments);
}
return Color;
}(_Declaration);

View File

@ -0,0 +1,66 @@
"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 () {
var self;
var Display = /*#__PURE__*/function (_Declaration2) {
_inherits(Display, _Declaration2);
var _super = _createSuper(Display);
function Display() {
_classCallCheck(this, Display);
return _super.apply(this, arguments);
}
_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;
}.call(void 0);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(Height, _Length2);
var _super = _createSuper(Height);
function Height() {
_classCallCheck(this, Height);
return _super.apply(this, arguments);
}
return Height;
}(_Length);

View File

@ -0,0 +1,98 @@
"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 () {
var self;
var Margin = /*#__PURE__*/function (_Declaration2) {
_inherits(Margin, _Declaration2);
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;
return Margin;
}.call(void 0);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(MarginBottom, _Length2);
var _super = _createSuper(MarginBottom);
function MarginBottom() {
_classCallCheck(this, MarginBottom);
return _super.apply(this, arguments);
}
return MarginBottom;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(MarginLeft, _Length2);
var _super = _createSuper(MarginLeft);
function MarginLeft() {
_classCallCheck(this, MarginLeft);
return _super.apply(this, arguments);
}
return MarginLeft;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(MarginRight, _Length2);
var _super = _createSuper(MarginRight);
function MarginRight() {
_classCallCheck(this, MarginRight);
return _super.apply(this, arguments);
}
return MarginRight;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(MarginTop, _Length2);
var _super = _createSuper(MarginTop);
function MarginTop() {
_classCallCheck(this, MarginTop);
return _super.apply(this, arguments);
}
return MarginTop;
}(_Length);

View File

@ -0,0 +1,98 @@
"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 () {
var self;
var Padding = /*#__PURE__*/function (_Declaration2) {
_inherits(Padding, _Declaration2);
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;
return Padding;
}.call(void 0);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(PaddingBottom, _Length2);
var _super = _createSuper(PaddingBottom);
function PaddingBottom() {
_classCallCheck(this, PaddingBottom);
return _super.apply(this, arguments);
}
return PaddingBottom;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(PaddingLeft, _Length2);
var _super = _createSuper(PaddingLeft);
function PaddingLeft() {
_classCallCheck(this, PaddingLeft);
return _super.apply(this, arguments);
}
return PaddingLeft;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(PaddingRight, _Length2);
var _super = _createSuper(PaddingRight);
function PaddingRight() {
_classCallCheck(this, PaddingRight);
return _super.apply(this, arguments);
}
return PaddingRight;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(PaddingTop, _Length2);
var _super = _createSuper(PaddingTop);
function PaddingTop() {
_classCallCheck(this, PaddingTop);
return _super.apply(this, arguments);
}
return PaddingTop;
}(_Length);

View File

@ -0,0 +1,38 @@
"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 = /*#__PURE__*/function (_Length2) {
_inherits(Width, _Length2);
var _super = _createSuper(Width);
function Width() {
_classCallCheck(this, Width);
return _super.apply(this, arguments);
}
return Width;
}(_Length);

View File

@ -0,0 +1,112 @@
"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 () {
var self;
var _Declaration = /*#__PURE__*/function () {
function _Declaration(prop1, val) {
_classCallCheck(this, _Declaration);
this.prop = prop1;
this.important = false;
this.set(val);
}
_createClass(_Declaration, [{
key: "get",
value: function get() {
return this._get();
}
}, {
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);

View File

@ -0,0 +1,53 @@
"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 = /*#__PURE__*/function (_Declaration2) {
_inherits(_Length, _Declaration2);
var _super = _createSuper(_Length);
function _Length() {
_classCallCheck(this, _Length);
return _super.apply(this, arguments);
}
_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 _Length;
}(_Declaration);

106
app_vue/node_modules/renderkid/lib/tools.js generated vendored Normal file
View File

@ -0,0 +1,106 @@
"use strict";
// Generated by CoffeeScript 2.5.1
var cloneDeep, htmlparser, isPlainObject, merge, _objectToDom, self;
htmlparser = require('htmlparser2');
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 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;
},
cloneAndMergeDeep: function cloneAndMergeDeep(base, toAppend) {
return merge(cloneDeep(base), toAppend);
},
toDom: function toDom(subject) {
if (typeof subject === 'string') {
return self.stringToDom(subject);
} else if (isPlainObject(subject)) {
return self._objectToDom(subject);
} else {
throw Error("tools.toDom() only supports strings and objects");
}
},
stringToDom: function stringToDom(string) {
var handler, parser;
handler = new htmlparser.DomHandler();
parser = new htmlparser.Parser(handler);
parser.write(string);
parser.end();
return handler.dom;
},
_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 objectToDom(o) {
if (!Array.isArray(o)) {
if (!isPlainObject(o)) {
throw Error("objectToDom() only accepts a bare object or an array");
}
}
return self._fixQuotesInDom(_objectToDom(o));
},
quote: function quote(str) {
return String(str).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/\ /g, '&sp;').replace(/\n/g, '<br />');
},
_quoteNodeText: function _quoteNodeText(text) {
return String(text).replace(/\&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/\ /g, '&sp;').replace(/\n/g, "&nl;");
},
getCols: function getCols() {
var cols, tty; // Based on https://github.com/jonschlinkert/window-size
tty = require('tty');
cols = function () {
try {
if (tty.isatty(1) && tty.isatty(2)) {
if (process.stdout.getWindowSize) {
return process.stdout.getWindowSize(1)[0];
} else if (tty.getWindowSize) {
return tty.getWindowSize()[1];
} else if (process.stdout.columns) {
return process.stdout.columns;
}
}
} catch (error) {}
}();
if (typeof cols === 'number' && cols > 30) {
return cols;
} else {
return 80;
}
}
};

41
app_vue/node_modules/renderkid/package.json generated vendored Normal file
View File

@ -0,0 +1,41 @@
{
"name": "renderkid",
"version": "3.0.0",
"description": "Stylish console.log for node",
"main": "lib/RenderKid.js",
"dependencies": {
"css-select": "^4.1.3",
"dom-converter": "^0.2.0",
"htmlparser2": "^6.1.0",
"lodash": "^4.17.21",
"strip-ansi": "^6.0.1"
},
"devDependencies": {
"@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.1.3",
"sinon": "^11.1.1",
"sinon-chai": "^3.7.0"
},
"scripts": {
"test": "mocha \"test/**/*.coffee\"",
"test:watch": "npm run test -- --watch",
"compile": "coffee --bare --transpile --output ./lib ./src",
"compile:watch": "coffee --watch --bare --transpile --output ./lib ./src",
"watch": "npm run compile:watch & npm run test:watch",
"prepublish": "npm run compile"
},
"repository": {
"type": "git",
"url": "https://github.com/AriaMinaei/RenderKid.git"
},
"bugs": {
"url": "https://github.com/AriaMinaei/RenderKid/issues"
},
"author": "Aria Minaei",
"license": "MIT"
}