diff --git a/packages/image/README.md b/packages/image/README.md index cdd5ec1df..e7668f533 100755 --- a/packages/image/README.md +++ b/packages/image/README.md @@ -15,7 +15,7 @@ Images are encoded using base64, which means they will be 33% larger than the si ## Requirements -This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+. +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. ## Install diff --git a/packages/image/package.json b/packages/image/package.json index 86461766c..5e628ef9b 100644 --- a/packages/image/package.json +++ b/packages/image/package.json @@ -13,10 +13,15 @@ "author": "Rich Harris", "homepage": "https://github.com/rollup/plugins/tree/master/packages/image/#readme", "bugs": "https://github.com/rollup/plugins/issues", - "main": "dist/index.js", - "module": "dist/index.es.js", + "main": "./dist/cjs/index.js", + "module": "./dist/es/index.js", + "exports": { + "import": "./dist/es/index.js", + "types": "./types/index.d.ts", + "default": "./dist/cjs/index.js" + }, "engines": { - "node": ">= 8.0.0" + "node": ">=14.0.0" }, "scripts": { "build": "rollup -c", @@ -33,6 +38,7 @@ }, "files": [ "dist", + "!dist/**/*.map", "types", "README.md", "LICENSE" @@ -44,21 +50,24 @@ "modules" ], "peerDependencies": { - "rollup": "^1.20.0 || ^2.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } }, "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "mini-svg-data-uri": "^1.2.3" + "@rollup/pluginutils": "^4.2.1", + "mini-svg-data-uri": "^1.4.4" }, "devDependencies": { "@rollup/plugin-buble": "^0.21.3", - "rollup": "^2.67.3" + "rollup": "^3.0.0-7" }, "types": "./types/index.d.ts", "ava": { - "babel": { - "compileEnhancements": false - }, + "workerThreads": false, "files": [ "!**/fixtures/**", "!**/helpers/**", diff --git a/packages/image/rollup.config.js b/packages/image/rollup.config.js deleted file mode 100755 index 7c05e5c92..000000000 --- a/packages/image/rollup.config.js +++ /dev/null @@ -1,13 +0,0 @@ -import buble from '@rollup/plugin-buble'; - -import pkg from './package.json'; - -export default { - input: 'src/index.js', - external: [...Object.keys(pkg.dependencies), 'fs', 'path'], - output: [ - { file: pkg.main, format: 'cjs', sourcemap: true, exports: 'auto' }, - { file: pkg.module, format: 'es', sourcemap: true } - ], - plugins: [buble()] -}; diff --git a/packages/image/rollup.config.mjs b/packages/image/rollup.config.mjs new file mode 100755 index 000000000..888000cd3 --- /dev/null +++ b/packages/image/rollup.config.mjs @@ -0,0 +1,13 @@ +import { readFileSync } from 'fs'; + +import buble from '@rollup/plugin-buble'; + +import { createConfig } from '../../shared/rollup.config.mjs'; + +export default { + ...createConfig({ + pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) + }), + input: 'src/index.js', + plugins: [buble()] +}; diff --git a/packages/image/test/snapshots/test.js.md b/packages/image/test/snapshots/test.js.md index b803509a9..6616873f2 100644 --- a/packages/image/test/snapshots/test.js.md +++ b/packages/image/test/snapshots/test.js.md @@ -35,14 +35,13 @@ Generated by [AVA](https://avajs.dev). console.log(state, img);␊ ` -## imports an svg for dom, encodes for url +## imports an svg, encodes for url > Snapshot 1 `'use strict';␊ ␊ - var img = new Image();␊ - img.src = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='256px' height='335px' viewBox='0 0 256 335' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' preserveAspectRatio='xMidYMid'%3e %3cdefs%3e %3clinearGradient x1='26.8242921%25' y1='48.2236445%25' x2='67.5758137%25' y2='55.339338%25' id='linearGradient-1'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='20.4503837%25' y1='38.1333935%25' x2='93.4858428%25' y2='80.4322382%25' id='linearGradient-2'%3e %3cstop stop-color='%23BF3338' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='32.2926113%25' y1='39.496861%25' x2='45.5563705%25' y2='48.9139013%25' id='linearGradient-3'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='51.5641026%25' y1='78.3444231%25' x2='48.5176441%25' y2='41.6628279%25' id='linearGradient-4'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='40.2012262%25' y1='47.2148639%25' x2='53.9750044%25' y2='54.5349876%25' id='linearGradient-5'%3e %3cstop stop-color='%23FBB040' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FB8840' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='55.2222794%25' y1='5.88782542%25' x2='40.9262994%25' y2='128.016462%25' id='linearGradient-6'%3e %3cstop stop-color='white' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='white' stop-opacity='0' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3c/defs%3e %3cg%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-1)'%3e%3c/path%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-2)'%3e%3c/path%3e %3cpath d='M35.7345538%2c330.983982 C43.9359268%2c326.297483 100.173913%2c214.993135 155.240275%2c162.270023 C210.306636%2c109.546911 217.336384%2c127.121281 186.874142%2c69.7116705 C186.874142%2c69.7116705 70.2974828%2c233.153318 28.1189931%2c313.995423' fill='url(%23linearGradient-3)'%3e%3c/path%3e %3cpath d='M52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C220.382609%2c21.3235698 186.464073%2c0.644393593 147.624714%2c0.0585812357 L13.8837529%2c0.0585812357 C11.0718535%2c0.0585812357 8.78718535%2c2.34324943 8.78718535%2c5.15514874 L8.78718535%2c274.745995 C16.7542334%2c254.183982 30.2864989%2c224.776201 52.1372998%2c184.530892 Z' fill='url(%23linearGradient-4)'%3e%3c/path%3e %3cpath d='M155.240275%2c162.270023 C100.173913%2c214.993135 43.9359268%2c326.297483 35.7345538%2c330.983982 C27.5331808%2c335.670481 13.7665904%2c336.256293 6.44393593%2c328.05492 C-1.34736842%2c319.326316 -13.4736842%2c305.208238 52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C240.300229%2c53.426087 241.061785%2c54.7148741 241.823341%2c56.0036613 C217.746453%2c31.2237986 165.374828%2c25.4828375 152.369794%2c55.8864989 C139.013272%2c87.0517162 174.806407%2c121.731808 190.447597%2c118.97849 C210.365217%2c115.463616 186.932723%2c69.7702517 186.932723%2c69.7702517 C217.336384%2c127.121281 210.306636%2c109.546911 155.240275%2c162.270023 Z' fill='url(%23linearGradient-5)'%3e%3c/path%3e %3cpath d='M58.5812357%2c190.974828 C137.314416%2c46.220595 147.624714%2c31.6338673 188.631579%2c31.6338673 C206.381693%2c31.6338673 224.24897%2c38.2535469 237.839817%2c50.204119 C223.78032%2c34.1528604 202.9254%2c25.1899314 182.187643%2c25.1899314 C141.180778%2c25.1899314 130.870481%2c39.776659 52.1372998%2c184.530892 C-13.4736842%2c305.208238 -1.34736842%2c319.326316 6.44393593%2c328.05492 C7.55697941%2c329.285126 8.84576659%2c330.339588 10.193135%2c331.218307 C3.33913043%2c321.259497 0.292906178%2c298.119908 58.5812357%2c190.974828 Z' fill='url(%23linearGradient-6)' opacity='0.3'%3e%3c/path%3e %3c/g%3e%3c/svg%3e";␊ + var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='256px' height='335px' viewBox='0 0 256 335' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' preserveAspectRatio='xMidYMid'%3e %3cdefs%3e %3clinearGradient x1='26.8242921%25' y1='48.2236445%25' x2='67.5758137%25' y2='55.339338%25' id='linearGradient-1'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='20.4503837%25' y1='38.1333935%25' x2='93.4858428%25' y2='80.4322382%25' id='linearGradient-2'%3e %3cstop stop-color='%23BF3338' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='32.2926113%25' y1='39.496861%25' x2='45.5563705%25' y2='48.9139013%25' id='linearGradient-3'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='51.5641026%25' y1='78.3444231%25' x2='48.5176441%25' y2='41.6628279%25' id='linearGradient-4'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='40.2012262%25' y1='47.2148639%25' x2='53.9750044%25' y2='54.5349876%25' id='linearGradient-5'%3e %3cstop stop-color='%23FBB040' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FB8840' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='55.2222794%25' y1='5.88782542%25' x2='40.9262994%25' y2='128.016462%25' id='linearGradient-6'%3e %3cstop stop-color='white' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='white' stop-opacity='0' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3c/defs%3e %3cg%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-1)'%3e%3c/path%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-2)'%3e%3c/path%3e %3cpath d='M35.7345538%2c330.983982 C43.9359268%2c326.297483 100.173913%2c214.993135 155.240275%2c162.270023 C210.306636%2c109.546911 217.336384%2c127.121281 186.874142%2c69.7116705 C186.874142%2c69.7116705 70.2974828%2c233.153318 28.1189931%2c313.995423' fill='url(%23linearGradient-3)'%3e%3c/path%3e %3cpath d='M52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C220.382609%2c21.3235698 186.464073%2c0.644393593 147.624714%2c0.0585812357 L13.8837529%2c0.0585812357 C11.0718535%2c0.0585812357 8.78718535%2c2.34324943 8.78718535%2c5.15514874 L8.78718535%2c274.745995 C16.7542334%2c254.183982 30.2864989%2c224.776201 52.1372998%2c184.530892 Z' fill='url(%23linearGradient-4)'%3e%3c/path%3e %3cpath d='M155.240275%2c162.270023 C100.173913%2c214.993135 43.9359268%2c326.297483 35.7345538%2c330.983982 C27.5331808%2c335.670481 13.7665904%2c336.256293 6.44393593%2c328.05492 C-1.34736842%2c319.326316 -13.4736842%2c305.208238 52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C240.300229%2c53.426087 241.061785%2c54.7148741 241.823341%2c56.0036613 C217.746453%2c31.2237986 165.374828%2c25.4828375 152.369794%2c55.8864989 C139.013272%2c87.0517162 174.806407%2c121.731808 190.447597%2c118.97849 C210.365217%2c115.463616 186.932723%2c69.7702517 186.932723%2c69.7702517 C217.336384%2c127.121281 210.306636%2c109.546911 155.240275%2c162.270023 Z' fill='url(%23linearGradient-5)'%3e%3c/path%3e %3cpath d='M58.5812357%2c190.974828 C137.314416%2c46.220595 147.624714%2c31.6338673 188.631579%2c31.6338673 C206.381693%2c31.6338673 224.24897%2c38.2535469 237.839817%2c50.204119 C223.78032%2c34.1528604 202.9254%2c25.1899314 182.187643%2c25.1899314 C141.180778%2c25.1899314 130.870481%2c39.776659 52.1372998%2c184.530892 C-13.4736842%2c305.208238 -1.34736842%2c319.326316 6.44393593%2c328.05492 C7.55697941%2c329.285126 8.84576659%2c330.339588 10.193135%2c331.218307 C3.33913043%2c321.259497 0.292906178%2c298.119908 58.5812357%2c190.974828 Z' fill='url(%23linearGradient-6)' opacity='0.3'%3e%3c/path%3e %3c/g%3e%3c/svg%3e";␊ ␊ /* eslint-disable */␊ ␊ @@ -51,13 +50,14 @@ Generated by [AVA](https://avajs.dev). console.log(state, img);␊ ` -## imports an svg, encodes for url +## imports an svg for dom, encodes for url > Snapshot 1 `'use strict';␊ ␊ - var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='256px' height='335px' viewBox='0 0 256 335' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' preserveAspectRatio='xMidYMid'%3e %3cdefs%3e %3clinearGradient x1='26.8242921%25' y1='48.2236445%25' x2='67.5758137%25' y2='55.339338%25' id='linearGradient-1'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='20.4503837%25' y1='38.1333935%25' x2='93.4858428%25' y2='80.4322382%25' id='linearGradient-2'%3e %3cstop stop-color='%23BF3338' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='32.2926113%25' y1='39.496861%25' x2='45.5563705%25' y2='48.9139013%25' id='linearGradient-3'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='51.5641026%25' y1='78.3444231%25' x2='48.5176441%25' y2='41.6628279%25' id='linearGradient-4'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='40.2012262%25' y1='47.2148639%25' x2='53.9750044%25' y2='54.5349876%25' id='linearGradient-5'%3e %3cstop stop-color='%23FBB040' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FB8840' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='55.2222794%25' y1='5.88782542%25' x2='40.9262994%25' y2='128.016462%25' id='linearGradient-6'%3e %3cstop stop-color='white' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='white' stop-opacity='0' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3c/defs%3e %3cg%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-1)'%3e%3c/path%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-2)'%3e%3c/path%3e %3cpath d='M35.7345538%2c330.983982 C43.9359268%2c326.297483 100.173913%2c214.993135 155.240275%2c162.270023 C210.306636%2c109.546911 217.336384%2c127.121281 186.874142%2c69.7116705 C186.874142%2c69.7116705 70.2974828%2c233.153318 28.1189931%2c313.995423' fill='url(%23linearGradient-3)'%3e%3c/path%3e %3cpath d='M52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C220.382609%2c21.3235698 186.464073%2c0.644393593 147.624714%2c0.0585812357 L13.8837529%2c0.0585812357 C11.0718535%2c0.0585812357 8.78718535%2c2.34324943 8.78718535%2c5.15514874 L8.78718535%2c274.745995 C16.7542334%2c254.183982 30.2864989%2c224.776201 52.1372998%2c184.530892 Z' fill='url(%23linearGradient-4)'%3e%3c/path%3e %3cpath d='M155.240275%2c162.270023 C100.173913%2c214.993135 43.9359268%2c326.297483 35.7345538%2c330.983982 C27.5331808%2c335.670481 13.7665904%2c336.256293 6.44393593%2c328.05492 C-1.34736842%2c319.326316 -13.4736842%2c305.208238 52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C240.300229%2c53.426087 241.061785%2c54.7148741 241.823341%2c56.0036613 C217.746453%2c31.2237986 165.374828%2c25.4828375 152.369794%2c55.8864989 C139.013272%2c87.0517162 174.806407%2c121.731808 190.447597%2c118.97849 C210.365217%2c115.463616 186.932723%2c69.7702517 186.932723%2c69.7702517 C217.336384%2c127.121281 210.306636%2c109.546911 155.240275%2c162.270023 Z' fill='url(%23linearGradient-5)'%3e%3c/path%3e %3cpath d='M58.5812357%2c190.974828 C137.314416%2c46.220595 147.624714%2c31.6338673 188.631579%2c31.6338673 C206.381693%2c31.6338673 224.24897%2c38.2535469 237.839817%2c50.204119 C223.78032%2c34.1528604 202.9254%2c25.1899314 182.187643%2c25.1899314 C141.180778%2c25.1899314 130.870481%2c39.776659 52.1372998%2c184.530892 C-13.4736842%2c305.208238 -1.34736842%2c319.326316 6.44393593%2c328.05492 C7.55697941%2c329.285126 8.84576659%2c330.339588 10.193135%2c331.218307 C3.33913043%2c321.259497 0.292906178%2c298.119908 58.5812357%2c190.974828 Z' fill='url(%23linearGradient-6)' opacity='0.3'%3e%3c/path%3e %3c/g%3e%3c/svg%3e";␊ + var img = new Image();␊ + img.src = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg width='256px' height='335px' viewBox='0 0 256 335' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' preserveAspectRatio='xMidYMid'%3e %3cdefs%3e %3clinearGradient x1='26.8242921%25' y1='48.2236445%25' x2='67.5758137%25' y2='55.339338%25' id='linearGradient-1'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='20.4503837%25' y1='38.1333935%25' x2='93.4858428%25' y2='80.4322382%25' id='linearGradient-2'%3e %3cstop stop-color='%23BF3338' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='32.2926113%25' y1='39.496861%25' x2='45.5563705%25' y2='48.9139013%25' id='linearGradient-3'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='51.5641026%25' y1='78.3444231%25' x2='48.5176441%25' y2='41.6628279%25' id='linearGradient-4'%3e %3cstop stop-color='%23FF6533' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FF5633' offset='15.7%25'%3e%3c/stop%3e %3cstop stop-color='%23FF4333' offset='43.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3733' offset='71.4%25'%3e%3c/stop%3e %3cstop stop-color='%23FF3333' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='40.2012262%25' y1='47.2148639%25' x2='53.9750044%25' y2='54.5349876%25' id='linearGradient-5'%3e %3cstop stop-color='%23FBB040' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='%23FB8840' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3clinearGradient x1='55.2222794%25' y1='5.88782542%25' x2='40.9262994%25' y2='128.016462%25' id='linearGradient-6'%3e %3cstop stop-color='white' offset='0%25'%3e%3c/stop%3e %3cstop stop-color='white' stop-opacity='0' offset='100%25'%3e%3c/stop%3e %3c/linearGradient%3e %3c/defs%3e %3cg%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-1)'%3e%3c/path%3e %3cpath d='M256%2c110.132723 C256%2c90.4494279 250.844851%2c71.9963387 241.76476%2c56.0036613 C217.687872%2c31.2237986 165.316247%2c25.4828375 152.311213%2c55.8864989 C138.954691%2c87.0517162 174.747826%2c121.731808 190.389016%2c118.97849 C210.306636%2c115.463616 186.874142%2c69.7702517 186.874142%2c69.7702517 C217.336384%2c127.179863 210.306636%2c109.605492 155.240275%2c162.328604 C100.173913%2c215.051716 43.9359268%2c326.297483 35.7345538%2c330.983982 C35.3830664%2c331.218307 35.0315789%2c331.39405 34.6215103%2c331.569794 L250.610526%2c331.569794 C254.418307%2c331.569794 256.878719%2c327.527689 255.179863%2c324.129977 L198.707551%2c212.356979 C197.477346%2c209.955149 198.356064%2c206.967506 200.699314%2c205.620137 C233.73913%2c186.639817 256%2c151.022426 256%2c110.132723 Z' fill='url(%23linearGradient-2)'%3e%3c/path%3e %3cpath d='M35.7345538%2c330.983982 C43.9359268%2c326.297483 100.173913%2c214.993135 155.240275%2c162.270023 C210.306636%2c109.546911 217.336384%2c127.121281 186.874142%2c69.7116705 C186.874142%2c69.7116705 70.2974828%2c233.153318 28.1189931%2c313.995423' fill='url(%23linearGradient-3)'%3e%3c/path%3e %3cpath d='M52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C220.382609%2c21.3235698 186.464073%2c0.644393593 147.624714%2c0.0585812357 L13.8837529%2c0.0585812357 C11.0718535%2c0.0585812357 8.78718535%2c2.34324943 8.78718535%2c5.15514874 L8.78718535%2c274.745995 C16.7542334%2c254.183982 30.2864989%2c224.776201 52.1372998%2c184.530892 Z' fill='url(%23linearGradient-4)'%3e%3c/path%3e %3cpath d='M155.240275%2c162.270023 C100.173913%2c214.993135 43.9359268%2c326.297483 35.7345538%2c330.983982 C27.5331808%2c335.670481 13.7665904%2c336.256293 6.44393593%2c328.05492 C-1.34736842%2c319.326316 -13.4736842%2c305.208238 52.1372998%2c184.530892 C130.870481%2c39.776659 141.180778%2c25.1899314 182.187643%2c25.1899314 C203.745538%2c25.1899314 225.479176%2c34.9144165 239.538673%2c52.195881 C240.300229%2c53.426087 241.061785%2c54.7148741 241.823341%2c56.0036613 C217.746453%2c31.2237986 165.374828%2c25.4828375 152.369794%2c55.8864989 C139.013272%2c87.0517162 174.806407%2c121.731808 190.447597%2c118.97849 C210.365217%2c115.463616 186.932723%2c69.7702517 186.932723%2c69.7702517 C217.336384%2c127.121281 210.306636%2c109.546911 155.240275%2c162.270023 Z' fill='url(%23linearGradient-5)'%3e%3c/path%3e %3cpath d='M58.5812357%2c190.974828 C137.314416%2c46.220595 147.624714%2c31.6338673 188.631579%2c31.6338673 C206.381693%2c31.6338673 224.24897%2c38.2535469 237.839817%2c50.204119 C223.78032%2c34.1528604 202.9254%2c25.1899314 182.187643%2c25.1899314 C141.180778%2c25.1899314 130.870481%2c39.776659 52.1372998%2c184.530892 C-13.4736842%2c305.208238 -1.34736842%2c319.326316 6.44393593%2c328.05492 C7.55697941%2c329.285126 8.84576659%2c330.339588 10.193135%2c331.218307 C3.33913043%2c321.259497 0.292906178%2c298.119908 58.5812357%2c190.974828 Z' fill='url(%23linearGradient-6)' opacity='0.3'%3e%3c/path%3e %3c/g%3e%3c/svg%3e";␊ ␊ /* eslint-disable */␊ ␊ diff --git a/packages/image/test/snapshots/test.js.snap b/packages/image/test/snapshots/test.js.snap index 77ce8396c..15ed8f77b 100644 Binary files a/packages/image/test/snapshots/test.js.snap and b/packages/image/test/snapshots/test.js.snap differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc5a5c705..a042bd7d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -300,15 +300,15 @@ importers: packages/image: specifiers: '@rollup/plugin-buble': ^0.21.3 - '@rollup/pluginutils': ^3.1.0 - mini-svg-data-uri: ^1.2.3 - rollup: ^2.67.3 + '@rollup/pluginutils': ^4.2.1 + mini-svg-data-uri: ^1.4.4 + rollup: ^3.0.0-7 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 4.2.1 mini-svg-data-uri: 1.4.4 devDependencies: - '@rollup/plugin-buble': 0.21.3_rollup@2.79.1 - rollup: 2.79.1 + '@rollup/plugin-buble': 0.21.3_rollup@3.0.0-7 + rollup: 3.0.0-7 packages/inject: specifiers: