A raw payload input editor based on CodeMirror
npm install @advanced-rest-client/raw-payload-editorThis component is deprecated. The code base has been moved to body-editor module.
-----
An element with CodeMirror editor to allow the user to enter HTTP message body.
> This component is no longer developed. Please, do not use it.
1. Upgrade
The element now uses LitElement library instead of Polymer. This means that all attributes are lowercase without - characters.
For example, previously the lineSeparator property was reflected to line-separator attribute. Now it is lineseparator attribute.
2. Tab handling
CodeMirror traps focus in the editor area. This is not accessible way of handling user input. Because of that this element overrides default tab key behavior
and removes focus from the element.
3. Required imports
This version uses latest and final specs for web components. This means the component works as a ES module. Because of that
CodeMirror and any related library has to be included into the document before inserting this element to the DOM.
CodeMirror 6 possibly will be working with ES imports but this is not set in stone at the moment.
Below is the default set of scripts to be added to the document.
``html`
If you are using JSON linter
`html`
Finally, if your application will use modes that aren't included in the document, you should set import URI. This will be used to resolve modes dependencies.
`html`
This components is a part of API components ecosystem
npm install --save @advanced-rest-client/raw-payload-editor
`$3
`html
`$3
`js
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/code-mirror/code-mirror.js';class SampleElement extends PolymerElement {
render() {
return html
;
} _valueHandler(e) {
this.value = e.detail.value;
}
}
customElements.define('sample-element', SampleElement);
`$3
`sh
git clone https://github.com/advanced-rest-client/raw-payload-editor
cd raw-payload-editor
npm install
`$3
`sh
npm start
`$3
`sh
npm test
``