Socket
Socket
Sign inDemoInstall

@fusebit/monaco-jsonforms

Package Overview
Dependencies
143
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fusebit/monaco-jsonforms

The Fusebit Monaco jsonforms package enables you to easily integrate a monaco code editor to react with jsonforms.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

ℹ︎ About

The Fusebit Monaco jsonforms package enables you to easily integrate a monaco code editor to react with jsonforms.

📦 Install


npm i @fusebit/monaco-jsonforms

🔨 Usage

In raw HTML:

<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-core.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-react.js"></script>
<script src="https://cdn.fusebit.io/fusebit/js/fusebit-form/latest/jsonforms-material.js"></script>
<script src="https://unpkg.com/@fusebit/monaco-jsonforms@latest/dist/cjs/index.js"></script>
...
<JSONFormsReact.JsonForms
  renderers={[
    ...JSONFormsMaterial.materialRenderers,
    MonacoJSONForms.MonacoEditorControl,
  ]}
  ...
/>

Use it in JSONForms as a custom render by importing the controls and adding them to your JSONForms renderers

import { JsonForms } from '@jsonforms/react';
import { MonacoEditorControl } from '@fusebit/monaco-jsonforms';

return <JsonForms {...props} cells={materialCells} renderers={[...materialRenderers, MonacoEditorControl]} />;

In the form

For schema.json:

{
  "type": "object",
  "properties": {
    "mappingCode": {
      "type": "string",
      "title": "Transformation JavaScript function",
      "isExpandable": false,
      "language": "javascript"
    }
  }
}

Notes: the isExpandable flag allows for the editor to vertically expand to fit the code supplied. the language flag allows for the editor to change it's language. If it's undefined, it will default to javascript.

For uischema.json:

{
  "type": "CodeBlock",
  "scope": "#/properties/mappingCode",
  "label": "Customer Transform"
}

Build

npm install && npm run-script build

FAQs

Last updated on 12 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc