{"id":18263150,"url":"https://github.com/vanillawc/wc-monaco-editor","last_synced_at":"2025-04-04T20:31:08.576Z","repository":{"id":57152142,"uuid":"219065781","full_name":"vanillawc/wc-monaco-editor","owner":"vanillawc","description":"A vanilla Monaco Editor web component","archived":false,"fork":false,"pushed_at":"2021-11-11T19:41:09.000Z","size":19509,"stargazers_count":113,"open_issues_count":6,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-26T23:02:53.504Z","etag":null,"topics":["editor","monaco","vanilla","web-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanillawc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-01T21:33:38.000Z","updated_at":"2024-04-18T19:33:41.000Z","dependencies_parsed_at":"2022-09-03T17:51:35.318Z","dependency_job_id":null,"html_url":"https://github.com/vanillawc/wc-monaco-editor","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillawc%2Fwc-monaco-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillawc%2Fwc-monaco-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillawc%2Fwc-monaco-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillawc%2Fwc-monaco-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanillawc","download_url":"https://codeload.github.com/vanillawc/wc-monaco-editor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247246264,"owners_count":20907761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editor","monaco","vanilla","web-components"],"created_at":"2024-11-05T11:09:58.753Z","updated_at":"2025-04-04T20:31:04.477Z","avatar_url":"https://github.com/vanillawc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u0026lt;wc-monaco-editor\u0026gt; Easily Embed a Monaco Editor\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/vanillawc/wc-monaco-editor/releases\"\u003e\u003cimg src=\"https://badgen.net/github/tag/vanillawc/wc-monaco-editor\" alt=\"GitHub Releases\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@vanillawc/wc-monaco-editor\"\u003e\u003cimg src=\"https://badgen.net/npm/v/@vanillawc/wc-monaco-editor\" alt=\"NPM Releases\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/vanillawc/wc-monaco-editor/actions\"\u003e\u003cimg src=\"https://github.com/vanillawc/wc-monaco-editor/workflows/Latest/badge.svg\" alt=\"Latest Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/vanillawc/wc-monaco-editor/actions\"\u003e\u003cimg src=\"https://github.com/vanillawc/wc-monaco-editor/workflows/Release/badge.svg\" alt=\"Release Status\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://discord.gg/aSWYgtybzV\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/723296249121603604?color=%23738ADB\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.webcomponents.org/element/vanillawc/wc-monaco-editor\"\u003e\u003cimg src=\"https://img.shields.io/badge/webcomponents.org-published-blue.svg\" alt=\"Published on WebComponents.org\"\u003e\u003c/a\u003e\n  \u003c!-- \u003ca href=\"https://bundlephobia.com/result?p=@vanillawc/wc-monaco-editor\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/minzip/@vanillawc/wc-monaco-editor\" alt=\"Bundlephobia\"\u003e\u003c/a\u003e --\u003e\n\u003c/div\u003e\n\n## Installation\n\n*Installation*\n```sh\nnpm i @vanillawc/wc-monaco-editor\n```\n\n*Import from NPM*\n```html\n\u003cscript type=\"module\" src=\"node_modules/@vanillawc/wc-monaco-editor/index.js\"\u003e\u003c/script\u003e\n```\n\n*Import from CDN*\n```html\n\u003cscript type=\"module\" src=\"https://cdn.jsdelivr.net/gh/vanillawc/wc-monaco-editor@1/index.js\"\u003e\u003c/script\u003e\n```\n\n## Demo\n\nTry it out [here](https://vanillawc.github.io/wc-monaco-editor/demo/index.html)\n\n## Usage\n\n**Attributes**\n\n- `id` - the editor id (default `editor`)\n- `src` - load the source from an external file\n- `language` - set the source language\n- `font-size` - set the font size (default `14px`);\n- `tab-size` - set the tab size (in spaces) (default `2`)\n- `style` - CSS styling (default `height: 100%; width: 100%;`)\n- `no-minimap` - disables the source minimap when present\n- `word-wrap` - enables word wrapping when present\n- `wrap-indent` - set the indent `['none','same','indent','deepindent']` for word wrapped lines (default `none`)\n\n*Note: The ID attribute is required if there are multiple editors*\n\n**Properties**\n\n- `editor` - the Monaco editor instance\n- `src` - get/set the `src` attribute from JS\n- `value` - get/set the editor's contents\n- `tabSize` - get/set the `tab-index` attribute from JS\n\n### Basic Usage\n\nTo edit plaintext\n\n```html\n\u003cwc-monaco-editor\u003e\u003c/wc-monaco-editor\u003e\n```\n\n### Language Support\n\nLanguage support enables syntax highlighting, code completion, etc.\n\n```html\n\u003cwc-monaco-editor language=\"javascript\"\u003e\u003c/wc-monaco-editor\u003e\n```\n\n### External Source\n\nLoad an external source file with the `src` attribute\n\n```html\n\u003cwc-monaco-editor src=\"sample.js\" language=\"javascript\"\u003e\u003c/wc-monaco-editor\u003e\n```\n\n### Advanced Configuration\n\nA config can be provided for advanced use cases that require the full spectrum of Monaco Editor options.\n\n```html\n\u003cwc-monaco-editor config=\"config.json\"\u003e\u003c/wc-monaco-editor\u003e\n```\n\n*config.json*\n```json\n{\n  \"language\": \"javascript\",\n  \"minimap\": {\n    \"enabled\": false\n  },\n  \"tabSize\": 2,\n  \"fontSize\": 16,\n  \"wordWrap\": \"on\",\n  \"lineNumbersMinChars\": 3,\n  \"wrappingIndent\": \"same\",\n  \"mouseWheelZoom\": true,\n  \"copyWithSyntaxHighlighting\": false\n}\n```\n\n*Note: See the [EditorOptions][] official documentation for all available options.* \n\n[EditorOptions]: https://microsoft.github.io/monaco-editor/api/modules/monaco.editor.html#editoroptions\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/vanillawc/vanillawc/blob/main/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillawc%2Fwc-monaco-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanillawc%2Fwc-monaco-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillawc%2Fwc-monaco-editor/lists"}