Pranomvignesh / constrained-editor-plugin

This project is to restrict the editable area in the monaco-editor
https://constrained-editor-plugin.vercel.app/
MIT License
102 stars 12 forks source link

TypeScript support #25

Closed burkaysucu closed 1 year ago

burkaysucu commented 1 year ago

First of all, thank you for this great library!

We have an Angular project and we are using the ngx-monaco-editor library from https://github.com/materiahq/ngx-monaco-editor . We managed to make the constrained-editor-plugin work with it but not in a pleasant way. Are you considering adding TypeScript support?

Pranomvignesh commented 1 year ago

@busucu I'm glad that this package helped you.

Currently and in near future, I don't have any plans to add a typescript support to it.

I created this as a dependency free plain JS package, so that It would be compatible in most places

But,

We managed to make the constrained-editor-plugin work with it but not in a pleasant way

Can you let me know the difficulties faced ?

burkaysucu commented 1 year ago

Monaco editor is only a part of our project, there are many other pages. So, we do not want to load the plugin globally by adding it to the scripts in angular.json. Instead, importing it to the component where Monaco editor is used is what we want. Yesterday, we made it work after setting allowJs to true in TypeScript configuration. That was why we did not like it. Today, we realized that it is not necessary. We imported the plugin to the component with import { constrainedEditor } from "../../../../node_modules/constrained-editor-plugin/dist/esm/constrainedEditor"; and it worked just fine. Thank you again!