aor-codemirror

0.0.2 • Public • Published

Admin on Rest - CodeMirror

Wrapper around CodeMirror for admin-on-rest.

Supported formats:

  • html
  • json
  • sql

Install

Install using npm: npm install aor-codemirror

Usage

JSON editor

We should to turn on validation for JSON.

import { CodeMirror, validJson } from 'aor-codemirror'

<CodeEditor label="My Label" name="fieldName" type="json" defaultValue="{}" required validate={validJson} />

Output from the CodeMirrror will be JSON object (not string);

SQL editor

import { CodeMirror } from 'aor-codemirror'

<CodeMirror label="My Label" name="fieldName"  type="sql" required />

HTML editor

import { required } from 'admin-on-rest'
import { CodeMirror } from 'aor-codemirror'

<CodeMirror label="My Label" name="fieldName" type="html" required validate={required} />

Readme

Keywords

Package Sidebar

Install

npm i aor-codemirror

Weekly Downloads

2

Version

0.0.2

License

ISC

Unpacked Size

132 kB

Total Files

33

Last publish

Collaborators

  • ondrej.kvasnovsky