ink
Advanced tools
Comparing version 3.0.0-4 to 3.0.0-5
@@ -36,4 +36,4 @@ "use strict"; | ||
const ErrorOverview = ({ error }) => { | ||
const stack = error.stack.split('\n').slice(1); | ||
const origin = stackUtils.parseLine(stack[0]); | ||
const stack = error.stack ? error.stack.split('\n').slice(1) : undefined; | ||
const origin = stack ? stackUtils.parseLine(stack[0]) : undefined; | ||
let excerpt; | ||
@@ -72,4 +72,4 @@ let lineWidth = 0; | ||
react_1.default.createElement(Text_1.default, { key: line, backgroundColor: line === origin.line ? 'red' : undefined, color: line === origin.line ? 'white' : undefined }, ' ' + value)))))), | ||
react_1.default.createElement(Box_1.default, { marginTop: 1, flexDirection: "column" }, error | ||
.stack.split('\n') | ||
error.stack && (react_1.default.createElement(Box_1.default, { marginTop: 1, flexDirection: "column" }, error.stack | ||
.split('\n') | ||
.slice(1) | ||
@@ -90,5 +90,5 @@ .map(line => { | ||
")"))); | ||
})))); | ||
}))))); | ||
}; | ||
exports.default = ErrorOverview; | ||
//# sourceMappingURL=ErrorOverview.js.map |
@@ -38,2 +38,5 @@ "use strict"; | ||
} | ||
if (node.nodeName === 'ink-text' || node.nodeName === 'ink-virtual-text') { | ||
markNodeAsDirty(node); | ||
} | ||
}; | ||
@@ -58,2 +61,5 @@ exports.insertBeforeNode = (node, newChildNode, beforeChildNode) => { | ||
} | ||
if (node.nodeName === 'ink-text' || node.nodeName === 'ink-virtual-text') { | ||
markNodeAsDirty(node); | ||
} | ||
}; | ||
@@ -70,2 +76,5 @@ exports.removeChildNode = (node, removeNode) => { | ||
} | ||
if (node.nodeName === 'ink-text' || node.nodeName === 'ink-virtual-text') { | ||
markNodeAsDirty(node); | ||
} | ||
}; | ||
@@ -109,3 +118,3 @@ exports.setAttribute = (node, key, value) => { | ||
}; | ||
const findParentYogaNode = (node) => { | ||
const findClosestYogaNode = (node) => { | ||
var _a; | ||
@@ -115,4 +124,9 @@ if (!node || !node.parentNode) { | ||
} | ||
return (_a = node.yogaNode) !== null && _a !== void 0 ? _a : findParentYogaNode(node.parentNode); | ||
return (_a = node.yogaNode) !== null && _a !== void 0 ? _a : findClosestYogaNode(node.parentNode); | ||
}; | ||
const markNodeAsDirty = (node) => { | ||
// Mark closest Yoga node as dirty to measure text dimensions again | ||
const yogaNode = findClosestYogaNode(node); | ||
yogaNode === null || yogaNode === void 0 ? void 0 : yogaNode.markDirty(); | ||
}; | ||
exports.setTextNodeValue = (node, text) => { | ||
@@ -123,6 +137,4 @@ if (typeof text !== 'string') { | ||
node.nodeValue = text; | ||
// Mark parent Yoga node as dirty to measure text dimensions again | ||
const parentYogaNode = findParentYogaNode(node); | ||
parentYogaNode === null || parentYogaNode === void 0 ? void 0 : parentYogaNode.markDirty(); | ||
markNodeAsDirty(node); | ||
}; | ||
//# sourceMappingURL=dom.js.map |
@@ -84,3 +84,5 @@ "use strict"; | ||
} | ||
inputHandler(input, key); | ||
if (!(input === 'c' && key.ctrl)) { | ||
inputHandler(input, key); | ||
} | ||
}; | ||
@@ -87,0 +89,0 @@ stdin === null || stdin === void 0 ? void 0 : stdin.on('data', handleData); |
{ | ||
"name": "ink", | ||
"version": "3.0.0-4", | ||
"version": "3.0.0-5", | ||
"description": "React for CLI", | ||
@@ -78,2 +78,3 @@ "license": "MIT", | ||
"@sindresorhus/tsconfig": "0.7.0", | ||
"@vdemedes/prettier-config": "^1.0.1", | ||
"ava": "^3.5.0", | ||
@@ -172,10 +173,3 @@ "babel-eslint": "^10.0.1", | ||
}, | ||
"prettier": { | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"quoteProps": "as-needed", | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid" | ||
} | ||
"prettier": "@vdemedes/prettier-config" | ||
} |
<h1 align="center"> | ||
<br> | ||
<br> | ||
<img width="300" alt="Ink" src="media/logo.png"> | ||
<img width="200" alt="Ink" src="media/logo.png"> | ||
<br> | ||
@@ -1693,3 +1693,2 @@ <br> | ||
- [ink-link](https://github.com/sindresorhus/ink-link) - Link component. | ||
- [ink-box](https://github.com/sindresorhus/ink-box) - Styled box component. | ||
- [ink-gradient](https://github.com/sindresorhus/ink-gradient) - Gradient color component. | ||
@@ -1719,3 +1718,3 @@ - [ink-big-text](https://github.com/sindresorhus/ink-big-text) - Awesome text component. | ||
- [Borders](examples/borders/border.js) - Add borders to `<Box>` component. | ||
- [Suspense](examples/suspense/suspenes.js) - Use React Suspense. | ||
- [Suspense](examples/suspense/suspense.js) - Use React Suspense. | ||
- [Table](examples/table/table.js) - Render a table with multiple columns and rows. | ||
@@ -1722,0 +1721,0 @@ - [Focus Management](examples/use-focus/use-focus.js) - Use `useFocus` hook to manage focus between components. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
279423
3836
25
1729