Skip to content

Commit

Permalink
deploy: a659155
Browse files Browse the repository at this point in the history
  • Loading branch information
securingsincity committed Mar 23, 2024
1 parent 5d14119 commit e0c9993
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 8 deletions.
28 changes: 28 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class App extends Component {
fontSize: parseInt(e.target.value, 10)
});
}
setLineHeight(e) {
this.setState({
lineHeight: parseInt(e.target.value, 10)
});
}
constructor(props) {
super(props);
this.state = {
Expand All @@ -108,6 +113,7 @@ class App extends Component {
enableBasicAutocompletion: false,
enableLiveAutocompletion: false,
fontSize: 14,
lineHeight: 19,
showGutter: true,
showPrintMargin: true,
highlightActiveLine: true,
Expand All @@ -119,6 +125,7 @@ class App extends Component {
this.setMode = this.setMode.bind(this);
this.onChange = this.onChange.bind(this);
this.setFontSize = this.setFontSize.bind(this);
this.setLineHeight = this.setLineHeight.bind(this),
this.setBoolean = this.setBoolean.bind(this);
}
render() {
Expand Down Expand Up @@ -182,6 +189,25 @@ class App extends Component {
</p>
</div>

<div className="field">
<label>Line Height:</label>
<p className="control">
<span className="select">
<select
name="Line Height"
onChange={this.setLineHeight}
value={this.state.lineHeight}
>
{[19, 24, 28, 32, 40].map(lang => (
<option key={lang} value={lang}>
{lang}
</option>
))}
</select>
</span>
</p>
</div>

<div className="field">
<label>Placeholder:</label>
<p className="control">
Expand Down Expand Up @@ -312,6 +338,7 @@ class App extends Component {
onCursorChange={this.onCursorChange}
onValidate={this.onValidate}
value={this.state.value}
lineHeight={this.state.lineHeight}
fontSize={this.state.fontSize}
showPrintMargin={this.state.showPrintMargin}
showGutter={this.state.showGutter}
Expand Down Expand Up @@ -340,6 +367,7 @@ class App extends Component {
onLoad={this.onLoad}
onChange={this.onChange}
fontSize={${this.state.fontSize}}
lineHeight={${this.state.lineHeight}}
showPrintMargin={${this.state.showPrintMargin}}
showGutter={${this.state.showGutter}}
highlightActiveLine={${this.state.highlightActiveLine}}
Expand Down
12 changes: 11 additions & 1 deletion static/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -207405,6 +207405,7 @@ var ReactAce = /** @class */function (_super) {
focus = _a.focus,
theme = _a.theme,
fontSize = _a.fontSize,
lineHeight = _a.lineHeight,
value = _a.value,
defaultValue = _a.defaultValue,
showGutter = _a.showGutter,
Expand Down Expand Up @@ -207436,6 +207437,10 @@ var ReactAce = /** @class */function (_super) {
this.editor.getSession().setMode(typeof mode === "string" ? "ace/mode/".concat(mode) : mode);
if (theme && theme !== "") this.editor.setTheme("ace/theme/".concat(theme));
this.editor.setFontSize(typeof fontSize === "number" ? "".concat(fontSize, "px") : fontSize);
if (lineHeight) {
this.editor.container.style.lineHeight = typeof lineHeight === "number" ? "".concat(lineHeight, "px") : "".concat(lineHeight);
this.editor.renderer.updateFontSize();
}
this.editor.getSession().setValue(!defaultValue ? value || "" : defaultValue);
if (this.props.navigateToFileEnd) {
this.editor.navigateFileEnd();
Expand Down Expand Up @@ -207550,6 +207555,10 @@ var ReactAce = /** @class */function (_super) {
if (nextProps.fontSize !== oldProps.fontSize) {
this.editor.setFontSize(typeof nextProps.fontSize === "number" ? "".concat(nextProps.fontSize, "px") : nextProps.fontSize);
}
if (nextProps.lineHeight !== oldProps.lineHeight) {
this.editor.container.style.lineHeight = typeof nextProps.lineHeight === "number" ? "".concat(nextProps.lineHeight, "px") : nextProps.lineHeight;
this.editor.renderer.updateFontSize();
}
if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {
this.editor.getSession().setUseWrapMode(nextProps.wrapEnabled);
}
Expand Down Expand Up @@ -207732,6 +207741,7 @@ var ReactAce = /** @class */function (_super) {
height: PropTypes.string,
width: PropTypes.string,
fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
lineHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
showGutter: PropTypes.bool,
onChange: PropTypes.func,
onCopy: PropTypes.func,
Expand Down Expand Up @@ -243140,7 +243150,7 @@ if (false) {} else {
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("145ae05648060732c94a")
/******/ __webpack_require__.h = () => ("408fc558726621733c06")
/******/ })();
/******/
/******/ /* webpack/runtime/global */
Expand Down
2 changes: 1 addition & 1 deletion static/diff.js.map

Large diffs are not rendered by default.

40 changes: 37 additions & 3 deletions static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212002,6 +212002,7 @@ var App = /*#__PURE__*/function (_Component) {
enableBasicAutocompletion: false,
enableLiveAutocompletion: false,
fontSize: 14,
lineHeight: 19,
showGutter: true,
showPrintMargin: true,
highlightActiveLine: true,
Expand All @@ -212013,7 +212014,7 @@ var App = /*#__PURE__*/function (_Component) {
_this.setMode = _this.setMode.bind(_assertThisInitialized(_this));
_this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
_this.setFontSize = _this.setFontSize.bind(_assertThisInitialized(_this));
_this.setBoolean = _this.setBoolean.bind(_assertThisInitialized(_this));
_this.setLineHeight = _this.setLineHeight.bind(_assertThisInitialized(_this)), _this.setBoolean = _this.setBoolean.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(App, [{
Expand Down Expand Up @@ -212079,6 +212080,13 @@ var App = /*#__PURE__*/function (_Component) {
fontSize: parseInt(e.target.value, 10)
});
}
}, {
key: "setLineHeight",
value: function setLineHeight(e) {
this.setState({
lineHeight: parseInt(e.target.value, 10)
});
}
}, {
key: "render",
value: function render() {
Expand Down Expand Up @@ -212134,6 +212142,21 @@ var App = /*#__PURE__*/function (_Component) {
}, lang);
}))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
className: "field"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("label", null, "Line Height:"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", {
className: "control"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", {
className: "select"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("select", {
name: "Line Height",
onChange: this.setLineHeight,
value: this.state.lineHeight
}, [19, 24, 28, 32, 40].map(function (lang) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("option", {
key: lang,
value: lang
}, lang);
}))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
className: "field"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("label", null, "Placeholder:"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", {
className: "control"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", {
Expand Down Expand Up @@ -212238,6 +212261,7 @@ var App = /*#__PURE__*/function (_Component) {
onCursorChange: this.onCursorChange,
onValidate: this.onValidate,
value: this.state.value,
lineHeight: this.state.lineHeight,
fontSize: this.state.fontSize,
showPrintMargin: this.state.showPrintMargin,
showGutter: this.state.showGutter,
Expand All @@ -212256,7 +212280,7 @@ var App = /*#__PURE__*/function (_Component) {
mode: "jsx",
theme: "monokai",
readOnly: true,
value: "<AceEditor\n placeholder=\"".concat(this.state.placeholder, "\"\n mode=\"").concat(this.state.mode, "\"\n theme=\"").concat(this.state.theme, "\"\n name=\"blah2\"\n onLoad={this.onLoad}\n onChange={this.onChange}\n fontSize={").concat(this.state.fontSize, "}\n showPrintMargin={").concat(this.state.showPrintMargin, "}\n showGutter={").concat(this.state.showGutter, "}\n highlightActiveLine={").concat(this.state.highlightActiveLine, "}\n value={`").concat(this.state.value, "`}\n setOptions={{\n enableBasicAutocompletion: ").concat(this.state.enableBasicAutocompletion, ",\n enableLiveAutocompletion: ").concat(this.state.enableLiveAutocompletion, ",\n enableSnippets: ").concat(this.state.enableSnippets, ",\n showLineNumbers: ").concat(this.state.showLineNumbers, ",\n tabSize: 2,\n }}/>\n ")
value: "<AceEditor\n placeholder=\"".concat(this.state.placeholder, "\"\n mode=\"").concat(this.state.mode, "\"\n theme=\"").concat(this.state.theme, "\"\n name=\"blah2\"\n onLoad={this.onLoad}\n onChange={this.onChange}\n fontSize={").concat(this.state.fontSize, "}\n lineHeight={").concat(this.state.lineHeight, "}\n showPrintMargin={").concat(this.state.showPrintMargin, "}\n showGutter={").concat(this.state.showGutter, "}\n highlightActiveLine={").concat(this.state.highlightActiveLine, "}\n value={`").concat(this.state.value, "`}\n setOptions={{\n enableBasicAutocompletion: ").concat(this.state.enableBasicAutocompletion, ",\n enableLiveAutocompletion: ").concat(this.state.enableLiveAutocompletion, ",\n enableSnippets: ").concat(this.state.enableSnippets, ",\n showLineNumbers: ").concat(this.state.showLineNumbers, ",\n tabSize: 2,\n }}/>\n ")
})));
}
}]);
Expand Down Expand Up @@ -212348,6 +212372,7 @@ var ReactAce = /** @class */function (_super) {
focus = _a.focus,
theme = _a.theme,
fontSize = _a.fontSize,
lineHeight = _a.lineHeight,
value = _a.value,
defaultValue = _a.defaultValue,
showGutter = _a.showGutter,
Expand Down Expand Up @@ -212379,6 +212404,10 @@ var ReactAce = /** @class */function (_super) {
this.editor.getSession().setMode(typeof mode === "string" ? "ace/mode/".concat(mode) : mode);
if (theme && theme !== "") this.editor.setTheme("ace/theme/".concat(theme));
this.editor.setFontSize(typeof fontSize === "number" ? "".concat(fontSize, "px") : fontSize);
if (lineHeight) {
this.editor.container.style.lineHeight = typeof lineHeight === "number" ? "".concat(lineHeight, "px") : "".concat(lineHeight);
this.editor.renderer.updateFontSize();
}
this.editor.getSession().setValue(!defaultValue ? value || "" : defaultValue);
if (this.props.navigateToFileEnd) {
this.editor.navigateFileEnd();
Expand Down Expand Up @@ -212493,6 +212522,10 @@ var ReactAce = /** @class */function (_super) {
if (nextProps.fontSize !== oldProps.fontSize) {
this.editor.setFontSize(typeof nextProps.fontSize === "number" ? "".concat(nextProps.fontSize, "px") : nextProps.fontSize);
}
if (nextProps.lineHeight !== oldProps.lineHeight) {
this.editor.container.style.lineHeight = typeof nextProps.lineHeight === "number" ? "".concat(nextProps.lineHeight, "px") : nextProps.lineHeight;
this.editor.renderer.updateFontSize();
}
if (nextProps.wrapEnabled !== oldProps.wrapEnabled) {
this.editor.getSession().setUseWrapMode(nextProps.wrapEnabled);
}
Expand Down Expand Up @@ -212675,6 +212708,7 @@ var ReactAce = /** @class */function (_super) {
height: PropTypes.string,
width: PropTypes.string,
fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
lineHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
showGutter: PropTypes.bool,
onChange: PropTypes.func,
onCopy: PropTypes.func,
Expand Down Expand Up @@ -244127,7 +244161,7 @@ if (false) {} else {
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("145ae05648060732c94a")
/******/ __webpack_require__.h = () => ("408fc558726621733c06")
/******/ })();
/******/
/******/ /* webpack/runtime/global */
Expand Down
2 changes: 1 addition & 1 deletion static/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/split.js
Original file line number Diff line number Diff line change
Expand Up @@ -245284,7 +245284,7 @@ if (false) {} else {
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("145ae05648060732c94a")
/******/ __webpack_require__.h = () => ("408fc558726621733c06")
/******/ })();
/******/
/******/ /* webpack/runtime/global */
Expand Down
2 changes: 1 addition & 1 deletion static/split.js.map

Large diffs are not rendered by default.

0 comments on commit e0c9993

Please sign in to comment.