@saber2pr/monaco

0.0.90 • Public • Published

@saber2pr/monaco

monaco

yarn add @saber2pr/monaco

Usage

editor:

import { createEditor } from '@saber2pr/monaco'

// 1. create editor
const editor = await createEditor(
  dom,
  {
    // file: file-content
    'input.jsx': "const a = 'hello';",
    'input.css': '#root { color: red; }',
  },
  { theme: 'vs-dark' }
)

// get current modal value
editor.getValue()

// set value to current modal
editor.setValue('code')

// change current modal
editor.changeModel('input.css')

// get modal
editor.getModel('input.jsx').onDidChangeContent

diffEditor:

import { createDiffEditor } from '@saber2pr/monaco'

// container, oldText, newText, language
createDiffEditor(dom, '{"name": "app"}', '{"name": "subApp"}', 'json')

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.901latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.901
0.0.891
0.0.880
0.0.870
0.0.860
0.0.850
0.0.840
0.0.830
0.0.820
0.0.810
0.0.800
0.0.790
0.0.780
0.0.770
0.0.760
0.0.750
0.0.740
0.0.730
0.0.720
0.0.710
0.0.701
0.0.690
0.0.680
0.0.670
0.0.660
0.0.650
0.0.641
0.0.621
0.0.612
0.0.600
0.0.590
0.0.580
0.0.570
0.0.560
0.0.551
0.0.540
0.0.530
0.0.521
0.0.510
0.0.500
0.0.492
0.0.480
0.0.470
0.0.460
0.0.451
0.0.440
0.0.430
0.0.421
0.0.410
0.0.401
0.0.390
0.0.380
0.0.371
0.0.360
0.0.351
0.0.347
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.281
0.0.271
0.0.260
0.0.250
0.0.220
0.0.210
0.0.200
0.0.180
0.0.170
0.0.160
0.0.150
0.0.141
0.0.130
0.0.120
0.0.111
0.0.100
0.0.90
0.0.81
0.0.70
0.0.61
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @saber2pr/monaco

Weekly Downloads

27

Version

0.0.90

License

ISC

Unpacked Size

634 kB

Total Files

137

Last publish

Collaborators

  • saber2pr