{"_id":"@blockdia/scratch-svg-renderer","name":"@blockdia/scratch-svg-renderer","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@blockdia/scratch-svg-renderer","version":"0.1.0","description":"Blockdia SVG renderer based on TurboWarp and Scratch 3.0","main":"./src/index.js","scripts":{"prepublishOnly":"npm run build","build":"npm run clean && webpack --progress --colors --bail","clean":"rimraf ./dist","start":"webpack-dev-server","test":"npm run test:lint && npm run test:unit","test:lint":"eslint . --ext .js","test:unit":"tap ./test/*.js","watch":"webpack --progress --colors --watch"},"license":"MPL-2.0","homepage":"https://github.com/blockdia/scratch-svg-renderer#readme","repository":{"type":"git","url":"git+https://github.com/blockdia/scratch-svg-renderer.git"},"bugs":{"url":"https://github.com/blockdia/scratch-svg-renderer/issues"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"peerDependencies":{"scratch-render-fonts":"github:TurboWarp/scratch-render-fonts#master"},"dependencies":{"@turbowarp/nanolog":"^0.2.0","base64-js":"1.2.1","base64-loader":"1.0.0","dompurify":"^3.4.5","transformation-matrix":"1.15.0"},"devDependencies":{"babel-core":"6.26.0","babel-eslint":"^10.1.0","babel-loader":"7.1.5","babel-preset-env":"1.6.1","copy-webpack-plugin":"4.6.0","eslint":"8.55.0","eslint-config-scratch":"9.0.3","eslint-plugin-import":"2.29.0","jsdom":"13.2.0","json":"9.0.6","lodash.defaultsdeep":"4.6.1","mkdirp":"2.0.0","rimraf":"3.0.2","scratch-render-fonts":"github:TurboWarp/scratch-render-fonts#master","tap":"11.1.5","webpack":"4.47.0","webpack-cli":"3.3.12","webpack-dev-server":"3.11.2","xmldom":"0.1.31"},"overrides":{"webpack@4.47.0":{"terser-webpack-plugin":"^4.2.3"}},"gitHead":"4c7292fb9a20b3927a3ead6643c0ca20249d12ff","_id":"@blockdia/scratch-svg-renderer@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-gBZ6VtD4NJRqE5dO6HMeGeZn2m+GXnPNc2UpX+OiTN+rlUGdh8LoqmR0Hrm8kPIDYXz9Re9TVi8qWO21V6+w9g==","shasum":"d7df6d166d56b40ddcd9abebcd36a38b5ff06030","tarball":"https://registry.npmjs.org/@blockdia/scratch-svg-renderer/-/scratch-svg-renderer-0.1.0.tgz","fileCount":72,"unpackedSize":3152437,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICN4yVepo0kq5S3fCfNhl3fXV4RKOgQt4NtO5bf2CixwAiEA+CIEARtG7B3FCgyjHTXSkYDi7v/sNA9yMsswAWfX2gI="}]},"_npmUser":{"name":"luyifei2011","email":"luyifei13@outlook.com"},"directories":{},"maintainers":[{"name":"luyifei2011","email":"luyifei13@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/scratch-svg-renderer_0.1.0_1787798821387_0.543504549218379"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T02:47:01.105Z","0.1.0":"2026-08-27T02:47:01.566Z","modified":"2026-08-27T02:47:01.784Z"},"maintainers":[{"name":"luyifei2011","email":"luyifei13@outlook.com"}],"description":"Blockdia SVG renderer based on TurboWarp and Scratch 3.0","homepage":"https://github.com/blockdia/scratch-svg-renderer#readme","repository":{"type":"git","url":"git+https://github.com/blockdia/scratch-svg-renderer.git"},"bugs":{"url":"https://github.com/blockdia/scratch-svg-renderer/issues"},"license":"MPL-2.0","readme":"# @blockdia/scratch-svg-renderer\n\nBlockdia's SVG renderer, based on the scratch-svg-renderer fork used by TurboWarp.\n\nThe initial Blockdia `0.1.0` release is based on TurboWarp commit `4c7292fb9a20b3927a3ead6643c0ca20249d12ff`.\n\n## License\n\nThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nThis program is based on [scratchfoundation/scratch-svg-renderer](https://github.com/scratchfoundation/scratch-svg-renderer), which is under this license:\n\n```\nCopyright (c) 2016, Massachusetts Institute of Technology\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n\n<!--\n# scratch-svg-renderer\n[![CircleCI](https://circleci.com/gh/LLK/scratch-svg-renderer/tree/develop.svg?style=shield&circle-token=239172a1b9275ee1e8f949489e6e36ea57b7fc86)](https://circleci.com/gh/LLK/scratch-svg-renderer?branch=develop)\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/LLK/scratch-svg-renderer.svg)](https://greenkeeper.io/)\nA class built for importing SVGs into [Scratch](https://github.com/LLK/scratch-gui). Imports an SVG string to a DOM element or an HTML canvas. Handles some of the quirks with Scratch 2.0 SVGs, which sometimes misreport their width, height and view box.\n\n## Installation\nThis requires you to have Git and Node.js installed.\n\nTo install as a dependency for your own application:\n```bash\nnpm install scratch-svg-renderer\n```\nTo set up a development environment to edit scratch-svg-renderer yourself:\n```bash\ngit clone https://github.com/LLK/scratch-svg-renderer.git\ncd scratch-svg-renderer\nnpm install\n```\n\n## How to include in a Node.js App\n```js\nimport SvgRenderer from 'scratch-svg-renderer';\n\nconst svgRenderer = new SvgRenderer();\n\nconst svgData = \"<svg>...</svg>\";\nconst scale = 1;\nconst quirksMode = false; // If true, emulate Scratch 2.0 SVG rendering \"quirks\"\nfunction doSomethingWith(canvas) {...};\n\nsvgRenderer.loadSVG(svgData, quirksMode, () => {\n\tsvgRenderer.draw(scale);\n\tdoSomethingWith(svgRenderer.canvas);\n});\n```\n\n## How to run locally as part of scratch-gui\n\nTo run scratch-svg-renderer locally as part of scratch-gui, for development:\n\n1. Set up local repositories (or pull updated code):\n    1. scratch-svg-renderer (this repo)\n    2. [scratch-render](https://github.com/LLK/scratch-render)\n    3. [scratch-paint](https://github.com/LLK/scratch-paint)\n    4. [scratch-gui](https://github.com/LLK/scratch-gui)\n2. In each of the local repos above, run `npm install`\n3. Run `npm link` in each of these local repos:\n    1. scratch-svg-renderer\n    2. scratch-render\n    3. scratch-paint\n4. Run `npm link scratch-svg-renderer` in each of these local repos:\n    1. scratch-render\n    2. scratch-paint\n    3. scratch-gui\n5. In your local scratch-gui repo:\n    1. run `npm link scratch-render`\n    2. run `npm link scratch-paint`\n6. In scratch-gui, follow its instructions to run it or build its code\n\n## Donate\nWe provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!\n\n## Committing\n\nThis project uses [semantic release](https://github.com/semantic-release/semantic-release) to ensure version bumps\nfollow semver so that projects depending on it don't break unexpectedly.\n\nIn order to automatically determine version updates, semantic release expects commit messages to follow the\n[conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md)\nspecification.\n\nYou can use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits formatted in this way:\n\n```bash\nnpm install -g commitizen@latest cz-conventional-changelog@latest\n```\n\nNow you're ready to make commits using `git cz`.\n\n-->\n","readmeFilename":"README.md","_rev":"1-0fa8d6968345117817ed4413a0405f63"}