{"id":20794571,"url":"https://github.com/silexlabs/prodotype","last_synced_at":"2025-05-06T00:18:42.342Z","repository":{"id":39422456,"uuid":"65088905","full_name":"silexlabs/Prodotype","owner":"silexlabs","description":"ReactJS generator, streamline your editor's UI.","archived":false,"fork":false,"pushed_at":"2022-06-24T08:48:31.000Z","size":2422,"stargazers_count":25,"open_issues_count":7,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-06T00:18:34.545Z","etag":null,"topics":["es6","prototype","prototyping","react","react-components","reactjs","ui","ui-components","ui-library","website-builder","website-design"],"latest_commit_sha":null,"homepage":"http://projects.silexlabs.org/Prodotype/pub/","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/silexlabs.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":"2016-08-06T15:27:24.000Z","updated_at":"2024-07-17T06:22:36.000Z","dependencies_parsed_at":"2022-09-10T03:53:54.672Z","dependency_job_id":null,"html_url":"https://github.com/silexlabs/Prodotype","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silexlabs%2FProdotype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silexlabs%2FProdotype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silexlabs%2FProdotype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silexlabs%2FProdotype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silexlabs","download_url":"https://codeload.github.com/silexlabs/Prodotype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252596432,"owners_count":21773846,"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":["es6","prototype","prototyping","react","react-components","reactjs","ui","ui-components","ui-library","website-builder","website-design"],"created_at":"2024-11-17T16:15:49.659Z","updated_at":"2025-05-06T00:18:42.324Z","avatar_url":"https://github.com/silexlabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nProdotype is used in [Silex website builder](https://www.silex.me) as a component creation tool. Use it to create components and the UI to edit them out of html templates and yaml files.\n\nLinks\n\n* [Website](http://projects.silexlabs.org/Prodotype/)\n* [Github repo](https://github.com/silexlabs/Prodotype)\n* [npm package](https://www.npmjs.com/package/prodotype)\n* [docs](http://projects.silexlabs.org/Prodotype/)\n\nFeatures\n\n* build components from 1 template file and 1 definition file per component\n* generate a UI to edit each component, which creates a data object\n* render a component given data object\n* manage dependencies for components\n\n## Install\n\nAdd to your project and build `pub/prodotype.js`\n\n```sh\n$ npm install\n$ npm run build\n```\n\n## Use in your projects\n\nIn your HTML page - e.g. see this [demo page](./pub/index.html)\n\n```html\n  \u003cscript type=\"text/javascript\" src=\"./ejs.min.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"./prodotype.js\"\u003e\u003c/script\u003e\n  \u003cdiv id=\"stage\"\u003e\u003c/div\u003e\n  \u003cdiv id=\"ui\"\u003e\u003c/div\u003e\n```\n\nIn your js file - e.g. see this [demo script](./pub/demo.js) for a complete / real world example.\n```js\n// the div where you want your components to be rendered\nconst stage = document.querySelector('#stage');\n// the div where we want the UI to edit the components\nconst ui = document.querySelector('#ui');\n// where prodotype templates are located\nconst templateFolder = './sample'\n// the main Prodotype object\nconst prodotype = new Prodotype(ui, templateFolder);\nprodotype.ready(function(err) {\n  // create a slide show in the stage div\n  const templateName = 'unslider';\n  prodotype.decorate(templateName).then(html =\u003e stage.innerHTML = html);\n  // display tool boxes to edit the component\n  prodotype.edit(data, [{templateName:templateName}], templateName, {\n    onChange: function(newData, html) {\n      stage.innerHTML = html;\n    }\n  });\n});\n\n```\n\nRun it with `npm start` and you should be able to edit the component like this:\n\n![sample component edition](./screenshot.png)\n\n## create your own templates\n\nCreate a folder with a `.yaml` file and a `.ejs` file - see [the `sample/` folder](./sample/) to see examples of templates.\n\nThen build your templates with this command line, which will generate a `components.json` in the destination folder (`pub/sample/` in this example):\n\n```sh\n$ npm run build:templates\n```\n[All the types of editors here](https://github.com/silexlabs/Prodotype/blob/master/src/Editor.js#L29)\n\n\n\n## Development\n\nProduction (uses http-server to serve `pub/`):\n\n```sh\n$ npm start\n```\n\nDevelopment (serve, watch, build and live reload):\n\n```sh\n$ npm run watch\n$ npm run reload\n```\n\nCreate a new version\n\n```sh\n$ npm version patch\n$ git push origin master --follow-tags\n$ npm publish\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilexlabs%2Fprodotype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilexlabs%2Fprodotype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilexlabs%2Fprodotype/lists"}