You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-monaco-editor

Package Overview
Dependencies
Maintainers
3
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-monaco-editor - npm Package Compare versions

Comparing version

to
0.56.1

6

lib/editor.js

@@ -26,3 +26,3 @@ var __assign = (this && this.__assign) || function () {

import { useEffect, useMemo, useRef } from "react";
import { noop, processSize } from "./utils";
import { noop, processSize, propCallbacks } from "./utils";
function MonacoEditor(_a) {

@@ -36,2 +36,3 @@ var width = _a.width, height = _a.height, value = _a.value, defaultValue = _a.defaultValue, language = _a.language, theme = _a.theme, options = _a.options, overrideServices = _a.overrideServices, editorWillMount = _a.editorWillMount, editorDidMount = _a.editorDidMount, editorWillUnmount = _a.editorWillUnmount, onChange = _a.onChange, className = _a.className, uri = _a.uri;

var fixedHeight = processSize(height);
propCallbacks.onChange = onChange;
var style = useMemo(function () { return ({

@@ -48,4 +49,5 @@ width: fixedWidth,

_subscription.current = editor.current.onDidChangeModelContent(function (event) {
var _a;
if (!__prevent_trigger_change_event.current) {
onChange(editor.current.getValue(), event);
(_a = propCallbacks.onChange) === null || _a === void 0 ? void 0 : _a.call(propCallbacks, editor.current.getValue(), event);
}

@@ -52,0 +54,0 @@ });

@@ -0,2 +1,4 @@

import { MonacoEditorProps } from "./types";
export declare function processSize(size: number | string): string | number;
export declare function noop(): void;
export declare const propCallbacks: Pick<MonacoEditorProps, "onChange">;

@@ -5,2 +5,5 @@ export function processSize(size) {

export function noop() { }
export var propCallbacks = {
onChange: null,
};
//# sourceMappingURL=utils.js.map
{
"name": "react-monaco-editor",
"version": "0.56.0",
"version": "0.56.1",
"description": "Monaco Editor for React",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -0,1 +1,3 @@

import { MonacoEditorProps } from "./types";
export function processSize(size: number | string) {

@@ -6,1 +8,5 @@ return !/^\d+$/.test(size as string) ? size : `${size}px`;

export function noop() {}
export const propCallbacks: Pick<MonacoEditorProps, "onChange"> = {
onChange: null,
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.