Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function make(style, value, defaultValue, editorDidMount, onChange, options, children) {
return ReasonReact.wrapJsForReason(ReactCodemirror2.Controlled, {
style: Js_undefined.fromOption(style),
value: Js_undefined.fromOption(value),
defaultValue: Js_undefined.fromOption(defaultValue),
editorDidMount: Js_undefined.fromOption(editorDidMount),
onBeforeChange: Rebase.Option[/* mapOr */18]((function (f, _, _$1, value) {
return Curry._1(f, value);
}), (function (_, _$1, _$2) {
return /* () */0;
}), onChange),
options: Js_undefined.fromOption(options)
}, children);
}
import * as React from "react";
import { renderToString } from "react-dom/server";
import styled, { ThemeProvider } from "styled-components";
const CodeMirror = require("react-codemirror2").Controlled;
import { MarkdownDemo } from "@patternplate/component-markdown/demo";
import { FlagDemo } from "@patternplate/component-flag/demo";
import * as SVG from "@patternplate/component-svg";
import { getThemes } from "./themes";
// TODO: Remove after lift
const { MainNavigationDemo } = require("@patternplate/components/lib/main-navigation/demo");
if ((global as any).document) {
require("codemirror/mode/javascript/javascript");
}
const DEFAULT_CONFIG = `
// patternplate.config.js
module.exports = {
ui: {
// For SSR, CodeMirror will throw an error, so return a div instead
let CodeMirror = 'div'
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
CodeMirror = require('react-codemirror2').Controlled
}
export default CodeMirror
"use strict";
var React = require('react')
, ReactCM2 = require('react-codemirror2')
, Controlled = ReactCM2.Controlled
, UnControlled = ReactCM2.UnControlled
, CodeMirror = require('codemirror')
, ipcRenderer = require('electron').ipcRenderer
;
require('codemirror/addon/dialog/dialog');
require('codemirror/addon/search/search');
require('codemirror/addon/search/searchcursor');
require('codemirror/addon/search/jump-to-line');
require('codemirror/addon/mode/overlay');
require('codemirror/mode/markdown/markdown');
require('codemirror/mode/yaml/yaml');
require('codemirror/mode/yaml-frontmatter/yaml-frontmatter');
require('codemirror/addon/edit/continuelist');
var editor