{"id":18685820,"url":"https://github.com/grapesjs/tui-image-editor","last_synced_at":"2025-04-07T16:18:02.336Z","repository":{"id":39559285,"uuid":"171375970","full_name":"GrapesJS/tui-image-editor","owner":"GrapesJS","description":"GrapesJS TOAST UI Image Editor","archived":false,"fork":false,"pushed_at":"2023-06-12T11:00:56.000Z","size":463,"stargazers_count":86,"open_issues_count":2,"forks_count":36,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-16T01:02:36.502Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrapesJS.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}},"created_at":"2019-02-19T00:18:19.000Z","updated_at":"2024-04-07T11:10:08.000Z","dependencies_parsed_at":"2024-01-29T20:36:31.117Z","dependency_job_id":null,"html_url":"https://github.com/GrapesJS/tui-image-editor","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":"0.16981132075471694","last_synced_commit":"a9ad7aa8cd2015753285d6e7a058bfc3391eba1b"},"previous_names":["artf/grapesjs-tui-image-editor"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Ftui-image-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Ftui-image-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Ftui-image-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Ftui-image-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrapesJS","download_url":"https://codeload.github.com/GrapesJS/tui-image-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"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":[],"created_at":"2024-11-07T10:24:23.113Z","updated_at":"2025-04-07T16:18:02.306Z","avatar_url":"https://github.com/GrapesJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrapesJS TOAST UI Image Editor\n\nAdd the [TOAST UI Image Editor](https://ui.toast.com/tui-image-editor/) on Image Components in GrapesJS\n\n[Demo](http://grapesjs.com/demo.html)\n\n![Preview](https://user-images.githubusercontent.com/11614725/52981724-c195f800-33e1-11e9-98a9-f071a2721761.png)\n\n\n## Summary\n\n* Plugin name: `grapesjs-tui-image-editor`\n* Commands\n  * `tui-image-editor` - Open the modal with the image editor.\n    Options:\n    * `target` - component from which to get and update the image\n\n\n\n\n\n## Options\n\n|Option|Description|Default|\n|-|-|-\n|`config`|TOAST UI's configuration [object](http://nhnent.github.io/tui.image-editor/latest/ImageEditor.html)|`{}`|\n|`constructor`|Pass the editor constructor. By default, the `tui.ImageEditor` will be called|``|\n|`labelImageEditor`|Label for the image editor (used in the modal)|`Image Editor`|\n|`labelApply`|Label used on the apply button|`Apply`|\n|`height`|Default editor height|`650px`|\n|`width`|Default editor width|`100%`|\n|`commandId`|Id to use to create the image editor command|`tui-image-editor`|\n|`toolbarIcon`|Icon used in the image component toolbar. Pass an empty string to avoid adding the icon.|`\u003csvg ....`|\n|`hideHeader`|Hide the default editor header|`true`|\n|`onApply`|By default, GrapesJS takes the modified image, adds it to the Asset Manager and update the target. If you need some custom logic you can use this custom 'onApply' function. `onApply: (imageEditor, imageModel) =\u003e {...}`|`null`|\n|`addToAssets`|If no custom `onApply` is passed and this option is `true`, the result image will be added to assets|`true`|\n|`upload`|If no custom `onApply` is passed, on confirm, the edited image, will be passed to the AssetManager's uploader and the result (eg. instead of having the dataURL you'll have the URL) will be passed to the default `onApply` process (update target, etc.)|`false`|\n|`onApplyButton`|The apply button (HTMLElement) will be passed as an argument to this function, once created. This will allow you a higher customization.|`null`|\n|`script`|Scripts to load dynamically in case no TOAST UI editor constructor is found|`['...tui-code-snippet.js', '...tui-color-picker.js', '...tui-image-editor.min.js']`|\n|`style`|In case the `script` is loaded this style will be loaded too|`['...tui-color-picker.css', '...tui-image-editor.css']`|\n\n\n\n\n\n## Download\n\n* CDN\n  * `https://unpkg.com/grapesjs-tui-image-editor`\n* NPM\n  * `npm i grapesjs-tui-image-editor`\n* GIT\n  * `git clone https://github.com/GrapesJS/tui-image-editor.git`\n\n\n\n\n\n## Usage\n\nDirectly in the browser\n```html\n\u003clink href=\"https://unpkg.com/grapesjs/dist/css/grapes.min.css\" rel=\"stylesheet\"/\u003e\n\u003cscript src=\"https://unpkg.com/grapesjs\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/grapesjs-tui-image-editor.min.js\"\u003e\u003c/script\u003e\n\n\u003cdiv id=\"gjs\"\u003e\u003c/div\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n  var editor = grapesjs.init({\n      container : '#gjs',\n      // ...\n      plugins: ['grapesjs-tui-image-editor'],\n      pluginsOpts: {\n        'grapesjs-tui-image-editor': {\n          config: {\n            includeUI: {\n              initMenu: 'filter',\n            },\n          },\n        }\n      }\n  });\n\u003c/script\u003e\n```\n\nModern javascript\n```js\nimport grapesjs from 'grapesjs';\nimport plugin from 'grapesjs-tui-image-editor';\n\nconst editor = grapesjs.init({\n  container : '#gjs',\n  // ...\n  plugins: [plugin],\n  pluginsOpts: {\n    [plugin]: { /* options */ }\n  }\n  // or\n  plugins: [\n    editor =\u003e plugin(editor, { /* options */ }),\n  ],\n});\n```\n\n\n\n\n\n## Development\n\nClone the repository\n\n```sh\n$ git clone https://github.com/GrapesJS/tui-image-editor.git\n$ cd grapesjs-tui-image-editor\n```\n\nInstall dependencies\n\n```sh\n$ npm i\n```\n\nStart the dev server\n\n```sh\n$ npm start\n```\n\n\n\n\n\n## License\n\nBSD 3-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrapesjs%2Ftui-image-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrapesjs%2Ftui-image-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrapesjs%2Ftui-image-editor/lists"}