{"id":13808456,"url":"https://github.com/acrodata/code-editor","last_synced_at":"2025-04-26T09:31:58.617Z","repository":{"id":241131391,"uuid":"803361114","full_name":"acrodata/code-editor","owner":"acrodata","description":"📝 CodeMirror 6 wrapper for Angular","archived":false,"fork":false,"pushed_at":"2025-04-26T02:14:41.000Z","size":4047,"stargazers_count":36,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-26T03:33:01.134Z","etag":null,"topics":["angular","code-editor","codemirror","codemirror6","ngx-codemirror"],"latest_commit_sha":null,"homepage":"https://acrodata.github.io/code-editor/","language":"TypeScript","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/acrodata.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-20T15:19:31.000Z","updated_at":"2025-04-26T02:13:51.000Z","dependencies_parsed_at":"2024-11-11T00:35:00.108Z","dependency_job_id":"41325224-d747-4a3c-bd33-37ef244649dc","html_url":"https://github.com/acrodata/code-editor","commit_stats":null,"previous_names":["acrodata/code-editor"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrodata%2Fcode-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrodata%2Fcode-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrodata%2Fcode-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrodata%2Fcode-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acrodata","download_url":"https://codeload.github.com/acrodata/code-editor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250929821,"owners_count":21509709,"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":["angular","code-editor","codemirror","codemirror6","ngx-codemirror"],"created_at":"2024-08-04T01:01:43.238Z","updated_at":"2025-04-26T09:31:58.264Z","avatar_url":"https://github.com/acrodata.png","language":"TypeScript","readme":"# Code Editor\n\n[![npm](https://img.shields.io/npm/v/@acrodata/code-editor.svg)](https://www.npmjs.com/package/@acrodata/code-editor)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/acrodata/code-editor/blob/main/LICENSE)\n\n\u003cimg src=\"https://github.com/acrodata/code-editor/assets/20625845/2a511ccf-bf6a-414b-9f0d-4aafe4a8079b\" width=\"400\" alt=\"codemirror+angular\"\u003e\n\nCodeMirror 6 wrapper for Angular\n\n#### Quick links\n\n[Documentation](https://github.com/acrodata/code-editor?tab=readme-ov-file#code-editor) |\n[Playground](https://acrodata.github.io/code-editor/)\n\n## Installation\n\n```bash\nnpm install @acrodata/code-editor --save\n```\n\n## Usage\n\n### Code Editor\n\n```ts\nimport { Component } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CodeEditor } from '@acrodata/code-editor';\n\n@Component({\n  selector: 'your-app',\n  template: `\u003ccode-editor [(ngModel)]=\"value\" /\u003e`,\n  standalone: true,\n  imports: [FormsModule, CodeEditor],\n})\nexport class YourAppComponent {\n  value = `console.log(\"Hello world\")`;\n}\n```\n\n### Diff Editor\n\n```ts\nimport { Component } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { DiffEditor } from '@acrodata/code-editor';\n\n@Component({\n  selector: 'your-app',\n  template: `\u003cdiff-editor [(ngModel)]=\"value\" /\u003e`,\n  standalone: true,\n  imports: [FormsModule, DiffEditor],\n})\nexport class YourAppComponent {\n  value = {\n    original: `bar`;\n    modified: `foo`;\n  }\n}\n```\n\n## API\n\n### Code Editor\n\n| Name                  | Type                   | Default     | Description                                                                                                        |\n| --------------------- | ---------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |\n| [value]               | string                 | `''`        | The editor's value.                                                                                                |\n| [root]                | Document \\| ShadowRoot | `undefined` | EditorView's [root][_root].                                                                                        |\n| [autoFocus]           | boolean                | `false`     | Whether focus on the editor after init.                                                                            |\n| [disabled]            | boolean                | `false`     | Whether the editor is disabled.                                                                                    |\n| [readonly]            | boolean                | `false`     | Whether the editor is readonly.                                                                                    |\n| [theme]               | Theme                  | `light`     | The editor's theme.                                                                                                |\n| [placeholder]         | string                 | `''`        | The editor's placecholder.                                                                                         |\n| [indentWithTab]       | boolean                | `false`     | Whether indent with Tab key.                                                                                       |\n| [indentUnit]          | string                 | `''`        | Should be a string consisting either entirely of the same whitespace character.                                    |\n| [lineWrapping]        | boolean                | `false`     | Whether the editor wraps lines.                                                                                    |\n| [highlightWhitespace] | boolean                | `false`     | Whether highlight the whitespace.                                                                                  |\n| [languages]           | LanguageDescription[]  | `[]`        | An array of language descriptions for known [language-data][_language-data].                                       |\n| [language]            | string                 | `''`        | The editor's language. You should set the `languages` prop at first.                                               |\n| [setup]               | Setup                  | `'basic'`   | The editor's built-in setup. The value can be set to [`basic`][_basicSetup], [`minimal`][_minimalSetup] or `null`. |\n| [extensions]          | Extension[]            | `[]`        | It will be appended to the root [extensions][_extensions].                                                         |\n| (change)              | EventEmitter\u003cstring\u003e   | `-`         | Event emitted when the editor's value changes.                                                                     |\n| (focus)               | EventEmitter\u003cvoid\u003e     | `-`         | Event emitted when focus on the editor.                                                                            |\n| (blur)                | EventEmitter\u003cvoid\u003e     | `-`         | Event emitted when the editor has lost focus.                                                                      |\n\n### Diff Editor\n\n| Name                  | Type                                  | Default     | Description                                                                                                        |\n| --------------------- | ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |\n| [setup]               | Setup                                 | `'basic'`   | The editor's built-in setup. The value can be set to [`basic`][_basicSetup], [`minimal`][_minimalSetup] or `null`. |\n| [originalValue]       | string                                | `''`        | The diff-editor's original value.                                                                                  |\n| [originalExtensions]  | Extension[]                           | `[]`        | The MergeView original config's [extensions][_extensions].                                                         |\n| [modifiedValue]       | string                                | `''`        | The diff-editor's modified value.                                                                                  |\n| [modifiedExtensions]  | Extension[]                           | `[]`        | The MergeView modified config's [extensions][_extensions].                                                         |\n| [orientation]         | Orientation                           | `undefined` | Controls whether editor A or editor B is shown first. Defaults to `\"a-b\"`.                                         |\n| [revertControls]      | RevertControls                        | `undefined` | Controls whether revert controls are shown between changed chunks.                                                 |\n| [renderRevertControl] | RenderRevertControl                   | `undefined` | When given, this function is called to render the button to revert a chunk.                                        |\n| [highlightChanges]    | boolean                               | `true`      | By default, the merge view will mark inserted and deleted text in changed chunks.                                  |\n| [gutter]              | boolean                               | `true`      | Controls whether a gutter marker is shown next to changed lines.                                                   |\n| [disabled]            | boolean                               | `false`     | Whether the diff-editor is disabled.                                                                               |\n| [collapseUnchanged]   | { margin?: number; minSize?: number } | `undefined` | When given, long stretches of unchanged text are collapsed.                                                        |\n| [diffConfig]          | DiffConfig                            | `undefined` | Pass options to the diff algorithm.                                                                                |\n| (originalValueChange) | EventEmitter\u003cstring\u003e                  | `-`         | Event emitted when the editor's original value changes.                                                            |\n| (originalFocus)       | EventEmitter\u003cvoid\u003e                    | `-`         | Event emitted when focus on the original editor.                                                                   |\n| (originalBlur)        | EventEmitter\u003cvoid\u003e                    | `-`         | Event emitted when blur on the original editor.                                                                    |\n| (modifiedValueChange) | EventEmitter\u003cstring\u003e                  | `-`         | Event emitted when the editor's modified value changes.                                                            |\n| (modifiedFocus)       | EventEmitter\u003cvoid\u003e                    | `-`         | Event emitted when focus on the modified editor.                                                                   |\n| (modifiedBlur)        | EventEmitter\u003cvoid\u003e                    | `-`         | Event emitted when blur on the modified editor.                                                                    |\n\n## License\n\nMIT\n\n[_root]: https://codemirror.net/docs/ref/#view.EditorView.root\n[_language-data]: https://github.com/codemirror/language-data/blob/main/src/language-data.ts\n[_basicSetup]: https://codemirror.net/docs/ref/#codemirror.basicSetup\n[_minimalSetup]: https://codemirror.net/docs/ref/#codemirror.minimalSetup\n[_extensions]: https://codemirror.net/docs/ref/#state.EditorStateConfig.extensions\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Editors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrodata%2Fcode-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facrodata%2Fcode-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrodata%2Fcode-editor/lists"}