{"id":13498351,"url":"https://github.com/mint-lang/mint-codemirror","last_synced_at":"2025-03-29T01:30:23.021Z","repository":{"id":93598818,"uuid":"141378663","full_name":"mint-lang/mint-codemirror","owner":"mint-lang","description":"A Mint package that provides a CodeMirror component","archived":false,"fork":false,"pushed_at":"2024-03-20T09:53:12.000Z","size":90,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T00:00:07.844Z","etag":null,"topics":["codemirror","mint-lang"],"latest_commit_sha":null,"homepage":"","language":"Mint","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/mint-lang.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},"funding":{"open_collective":"mint"}},"created_at":"2018-07-18T03:56:06.000Z","updated_at":"2024-10-08T00:46:48.000Z","dependencies_parsed_at":"2023-07-03T03:52:48.676Z","dependency_job_id":"e0e07dc5-90f2-4726-ba4b-50867f652a6a","html_url":"https://github.com/mint-lang/mint-codemirror","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.2142857142857143,"last_synced_commit":"67e004fec6dec91a9b5e77a9a282e8f6a07983fd"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mint-lang%2Fmint-codemirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mint-lang%2Fmint-codemirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mint-lang%2Fmint-codemirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mint-lang%2Fmint-codemirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mint-lang","download_url":"https://codeload.github.com/mint-lang/mint-codemirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068279,"owners_count":20718504,"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":["codemirror","mint-lang"],"created_at":"2024-07-31T21:00:24.220Z","updated_at":"2025-03-29T01:30:22.983Z","avatar_url":"https://github.com/mint-lang.png","language":"Mint","funding_links":["https://opencollective.com/mint"],"categories":["Components \u0026 Libraries"],"sub_categories":["Text Editors"],"readme":"# mint-codemirror\n\nThis package provides a component for the [CodeMirror](https://codemirror.net) code editor to be used in Mint projects.\n\n## Installation\n\nTo use the component just add this to the `dependencies` field of the projects\n`mint.json` file.\n\n```json\n\"mint-codemirror\": {\n  \"repository\": \"https://github.com/mint-lang/mint-codemirror\",\n  \"constraint\": \"10.0.0 \u003c= v \u003c 11.0.0\"\n}\n```\n\n## Usage\n\nTo get the basic component without any modes and the default theme, just add the component to your render function:\n\n```mint\ncomponent Main {\n  fun onChange (value : String) : Promise(Void) {\n    Debug.log(value)\n    next { }\n  }\n\n  fun render : Html {\n    \u003cCodeMirror onChange={onChange}/\u003e\n  }\n}\n```\n\n## Properties\n\nThe following properties are available:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eName\u003c/th\u003e\n    \u003cth\u003eType\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ejavascripts\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eArray(String)\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      URLs for the JavaScript files that are needed for CodeMirror to work.\n      This can come from a CDN or from local files. This should contain the\n      base JavaScript and any other addons or modes that is required.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003estyles\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eArray(String)\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      URLs for the CSS files that are that are needed for CodeMirror to work.\n      This can come from a CDN or from local files. This should contain the\n      base CSS and any other files for themes.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eonChange\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"white-space: nowrap;\"\u003e\n      \u003ccode\u003eFunction(String, a)\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      This is called when the content changes.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eloadingContent\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eHtml\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      This is shown until the all the files have loaded and editor is ready.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003elineNumbers\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eBool\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      Whether or not to show the line numbers.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003elineWrapping\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eBool\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      Whether or not to wrap the lines.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003evalue\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eBool\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      When provided this value will be in the editor.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003etheme\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eString\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      The theme of the editor.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emode\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eString\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      The mode of the editor.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Advanced Usage\n\nThis is an example for using the all of the properties:\n\n```mint\ncomponent Main {\n  state value : String = \"def print\\n  puts 'Hello World!'\\nend\"\n\n  fun onChange (value : String) : Promise(Void) {\n    next { value: value }\n  }\n\n  fun render : Html {\n    \u003cCodeMirror\n      javascripts=[\n        \"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.js\",\n        \"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/mode/ruby/ruby.min.js\"\n      ]\n      styles=[\n        \"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.css\",\n        \"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/theme/dracula.min.css\"\n      ]\n      onChange={onChange}\n      theme=\"dracula\"\n      value={value}\n      mode=\"ruby\"/\u003e\n  }\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmint-lang%2Fmint-codemirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmint-lang%2Fmint-codemirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmint-lang%2Fmint-codemirror/lists"}