{"id":20532612,"url":"https://github.com/cimpress-mcp/draft-js-handlebars-plugin","last_synced_at":"2025-04-14T06:31:39.076Z","repository":{"id":34065322,"uuid":"166019286","full_name":"Cimpress-MCP/draft-js-handlebars-plugin","owner":"Cimpress-MCP","description":"This plugin allows replaces the handlebars syntax with visual placeholders.","archived":false,"fork":false,"pushed_at":"2023-01-03T16:01:51.000Z","size":3861,"stargazers_count":6,"open_issues_count":16,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T07:18:37.105Z","etag":null,"topics":["draft-js","draft-js-plugins","handlebars"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cimpress-MCP.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T10:16:16.000Z","updated_at":"2021-12-27T20:19:49.000Z","dependencies_parsed_at":"2023-01-15T04:30:46.092Z","dependency_job_id":null,"html_url":"https://github.com/Cimpress-MCP/draft-js-handlebars-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cimpress-MCP%2Fdraft-js-handlebars-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cimpress-MCP%2Fdraft-js-handlebars-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cimpress-MCP%2Fdraft-js-handlebars-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cimpress-MCP%2Fdraft-js-handlebars-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cimpress-MCP","download_url":"https://codeload.github.com/Cimpress-MCP/draft-js-handlebars-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530602,"owners_count":21119601,"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":["draft-js","draft-js-plugins","handlebars"],"created_at":"2024-11-16T00:15:58.185Z","updated_at":"2025-04-14T06:31:38.991Z","avatar_url":"https://github.com/Cimpress-MCP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# draft-js-handlebars-plugin\n\n\n## Installation\n\n`npm install draft-js-handlebars-plugin --save`\n\n\nadd the css dependencies\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://static.ux.cimpress.io/mcp-ux-css/1.4/development/1.4.8/css/mcp-ux-css.min.css\" charset=\"utf-8\" integrity=\"sha256-N7q2V/oEomo+XXIEsLN2JsmpMoGvO8EgGC9eWPjx8Ec=\" crossorigin=\"anonymous\"\u003e\n\u003clink rel=\"stylesheet\" href=\"//cloud.typography.com/7971714/6011752/css/fonts.css\"/\u003e\n```\n\n\n\n## Import\n\n`import createPlaceholderVisualizationPlugin, { insertPlaceholderEntity, placeholderVisualizationDecorator, selectionUtils } from 'draft-js-handlebars-plugin'`\n\n## Usage\n\n### createPlaceholderVisualizationPlugin()\n\nFunction that creates the plugin that has to be added to draft-js plugins\n\n### insertPlaceholderEntity(currentContent, placeholderText, selection, inlineStyle, link)\n\nReturns a new ContentState with the placeholder entity created on the selection specified if provided, if not is added at the end of the editor.\n\n```\n /**\n *\n * @param {ContentState} currentContent\n * @param {String} placeholderText\n * @param {SelectionState} selection\n * @param {DraftInlineStyle} inlineStyle\n * @param {String} link\n */\n```\n### placeholderVisualizationDecorator\n\nDecorator included in the plugin\n\n\n### selectionUtils\n\n\nUseful functions for handling selections on draft js\n\n- moveBehindEntity(entityKey, editorState) \n//Move selector behind the entity with the entity key provided.\n\n- selectWholeEntities(getEditorState, setEditorState, traversingLeft = true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimpress-mcp%2Fdraft-js-handlebars-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcimpress-mcp%2Fdraft-js-handlebars-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimpress-mcp%2Fdraft-js-handlebars-plugin/lists"}