{"_id":"@advanced-rest-client/monaco-support","_rev":"8-298931801475a44ef1590f0f69e10fae","name":"@advanced-rest-client/monaco-support","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@advanced-rest-client/monaco-support","version":"1.0.0","keywords":["advanced-rest-client","monaco"],"_id":"@advanced-rest-client/monaco-support@1.0.0","maintainers":[{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"jarrodek","email":"jarrodek@gmail.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/monaco-support#readme","bugs":{"url":"https://github.com/advanced-rest-client/monaco-support/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"40a11ec494145ebf98e223a2d9e406205b568f11","tarball":"https://registry.npmjs.org/@advanced-rest-client/monaco-support/-/monaco-support-1.0.0.tgz","fileCount":13,"integrity":"sha512-H/s8YCPZ1uv+VCQCsmaZR9IcDWhDa+vN20nuDn4nPZwUqV6HYoytli9Qg22Ovs9cGNOL+gqfzXFpxEi1F9+y7A==","signatures":[{"sig":"MEUCIQCMrbpyj+pOkxdfXpf6xPms8zSnw1EmBhpgvyFEAcgPeQIgITI6E2FAytw/4rbLJeVNXRToZpsaiE2l0mYBzJrV+vA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvcjNCRA9TVsSAnZWagAAipwP+wYBNxb142BneLtH9/c5\nbEVY1UyTt/9YvW/ptuEikSN1zhSy7G/7HUw+37wQZIBFwCJuxsuJjLqpfsv2\nkssAVk8F8vxeEaLUgCxNduyQy0B1XhIsGGZNYCi8TJFXGs87pMct8Vg7Mre5\noSkPyWFaTB4/uf/8iJ5vdA7biZXRQqgy5sBWee/2BHtY6QRMDROpSZ6ZEvMU\nUUEk2pCfPF6fMATbZ6NseDFtO51I+Dx4CmXAh2VfRWIadzx+mwKb6XmaRWMu\nOmWTHecAqcmOiCgtdmROzAkaC4Eru+y2h00JFos38PrcFbvHGQbH9wgdhjgA\nIP7yXO0nzvQDd/N0j/5Yf+TreQXO9GYLbZ4XENiPSLHUoBXOmvymADBsMT3B\nv4pkVMsNyKzzpdWbOn3ROcYJn3y81hZtVHHrsmEAnmFikAt6Qm+zTXdxPDMj\nRbgMJVa0FprVMrJbZlK/YYOMbfJe2RCEXrFobiP8Cy6vC4um+Y97bWfrkOK3\nPgibNUg77cPC4o2zh40oDF1ZATrfo2M29MD9E0GOC1fmrAspd3MCtL0GT43x\nltL79oPtkXbZy8cBsL1XdE21UKAreIFgGmUGmHxVYn1mYdfjl9hA4PTypfLB\nslEI4AsuyYTiiAT4hBRXP1jNLQllkL9OH+TzBzLiO5en3EpuLd8+Vj+tsOyQ\n8Wdx\r\n=Th46\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc"],"gitHead":"00d11569bce89327d1023d686718566e64e0e96b","scripts":{"lint":"npm run lint:eslint","test":"exit 0","format":"npm run format:eslint","lint:types":"tsc","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/monaco-support.git","type":"git"},"_npmVersion":"6.14.8","description":"Helper library to add support for the Monaco editor across the components","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.15.1","dependencies":{"lit-element":"^2.4.0"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.3.0","eslint":"^7.14.0","typescript":"^4.1.2","lint-staged":"^10.5.2","@open-wc/eslint-config":"^4.0.1","eslint-config-prettier":"^6.15.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-support_1.0.0_1606273228923_0.27642354486781096","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@advanced-rest-client/monaco-support","version":"1.0.1","keywords":["advanced-rest-client","monaco"],"_id":"@advanced-rest-client/monaco-support@1.0.1","maintainers":[{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"jarrodek","email":"jarrodek@gmail.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/monaco-support#readme","bugs":{"url":"https://github.com/advanced-rest-client/monaco-support/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"79a48385ddb67221fa174d9a78fa285801c49029","tarball":"https://registry.npmjs.org/@advanced-rest-client/monaco-support/-/monaco-support-1.0.1.tgz","fileCount":13,"integrity":"sha512-Vdv12H2acYT0dD2jn0YpBYnv53+/ZhvzExRsWbRWkqlSTWPEqTQCwruqE5UET2BjnFeaPTMQ5jjOZQpOEZSRtg==","signatures":[{"sig":"MEUCIDCNlS5DzZdBcUm7063BpNIXZ8myXxCfex8q2Kk4+lgvAiEAgBg1SW2AcKECIP7mNXlmaMFcw3xHeYRMsl68XqOxiF4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvctdCRA9TVsSAnZWagAA/PAP/0gDUfJmxp24bnGwjNhZ\nqfDkgt+gSY5Yhz40vCs4jlKSWFeZPYQfqOsdFexGRhXhAVnJvc8E3b1UgJyI\n6lE+F6gb9CRKLsMbiaKaF3zdxUeG1KcF0Xull+m7yVZJGwBYEcyg3Fe8xepD\nCacOkdRgTOV4336Byl6a9h5CajeJ4X/e2L2nWVj35Xs5qippbRR8h4Yi0faj\njRt7daCWGv6UD+Hfx0Llnvk6Yq8QQXP+9eLZpIMi2bELojrLrwi/i9Zh2zK/\nqkH6VZQW4PV3pNK5ypA9TeEFI30rQioWD+MUU81Q6ttutA0PI05hhEk/rRlJ\nm4roUCMiYmXPL+ZaHuzZQ1i4idAiG00GIE4mK6GN7aSbFzPp3Dh4Bz+h/ocW\nzY/Ph7Vclhvj6QEiETPWxeW1YVtjEdUHqpZt3DnXHWBSVaTRaH/geOgLbKoB\n/1qbWrz6L+XCwOpITH9l0aS2WNVNgexLYNh18k6payMZ5EUnWwGOiwf+0J9k\nXXBB9AWROiczyXTzmzrjFovwg/L4xsl0t6bZW+msATK/rjiQxDuLWsloTVOe\nlHMYGnUlOAlzENeGnpt8hAyJyBDrFbohNORCS1Strh/come3MgNWWWW8Fp8q\nDDLnyurJlZ5LuSGmM6dfrcCxIDKTO+ziw2fWibCvko8paLHfJmP12xS8h637\nHpp3\r\n=wsh9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc"],"gitHead":"9eee3957d682b720536ce561a26643d4c6dd11c3","scripts":{"lint":"npm run lint:eslint","test":"exit 0","format":"npm run format:eslint","lint:types":"tsc","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/monaco-support.git","type":"git"},"_npmVersion":"6.14.8","description":"Helper library to add support for the Monaco editor across the components","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.15.1","dependencies":{"lit-element":"^2.4.0"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.3.0","eslint":"^7.14.0","typescript":"^4.1.2","lint-staged":"^10.5.2","@open-wc/eslint-config":"^4.0.1","eslint-config-prettier":"^6.15.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-support_1.0.1_1606273885207_0.7720637642136614","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-11-25T03:00:28.754Z","modified":"2026-04-07T19:30:47.377Z","1.0.0":"2020-11-25T03:00:29.156Z","1.0.1":"2020-11-25T03:11:25.372Z"},"bugs":{"url":"https://github.com/advanced-rest-client/monaco-support/issues","email":"arc@mulesoft.com"},"homepage":"https://github.com/advanced-rest-client/monaco-support#readme","keywords":["advanced-rest-client","monaco"],"repository":{"url":"git://github.com/advanced-rest-client/monaco-support.git","type":"git"},"description":"Helper library to add support for the Monaco editor across the components","contributors":[{"name":"Your name can be here!"}],"maintainers":[{"email":"jarrodek@gmail.com","name":"jarrodek"},{"email":"alexperez@mulesoft.com","name":"alexperez_march_2024"},{"email":"elmellidiego@gmail.com","name":"dmacias"}],"readme":"# Monaco support\n\nA set of helper functions with common logic when working with Monaco editor in ARC components.\n\nThis module offers the following exports:\n\n- `MonacoStyles` - a `lit-element` based styles for Monaco editor\n- `MonacoLoader` - functions that allows to manage loading Monaco into the global scope and tun the logic after it is loaded\n- `MonacoTheme` - very basic theme configuration for ARC\n- `MonacoHelper` - additional helper library with common functions.\n\n\n## Usage\n\n### Installation\n\n```sh\nnpm install --save @advanced-rest-client/monaco-support\n```\n\n### Loading monaco\n\nMonaco uses CSS files import in their ES modules which makes it unusable in pure web environment. The alternative is to load Monaco globally (bad idea but it's a path to move forward) and use the global `monaco` object in the components.\n\nThese functions helps to load monaco and recognize when the library is finally loaded:\n\n```javascript\nimport { MonacoLoader } from '@advanced-rest-client/monaco-support';\n\nconst monacoBase = '../node_modules/monaco-editor/';\nMonacoLoader.createEnvironment(monacoBase);\nawait MonacoLoader.loadMonaco(monacoBase);\nawait MonacoLoader.monacoReady();\n\n// it is safe to load a component\n```\n\n### ARC common theme\n\nThe `MonacoTheme.assignTheme()` function is to be called when monaco is loaded and preparing configuration for the editor instance.\nThis check for the current user preference for the dark theme and sets the corresponding theme on the configuration option.\n\n```javascript\nlet config = /** IStandaloneEditorConstructionOptions */ ({\n  minimap: {\n    enabled: false,\n  },\n  tabSize: 2,\n  detectIndentation: true,\n});\nconfig = MonacoTheme.assignTheme(monaco, config);\n```\n\nThe `monaco` refers to the global variable loaded to the global scope. The function returns a copy of the configuration object so the original one has to be updated.\n","readmeFilename":"README.md"}