- Compatibility fix (openclipart): Ensure polyfill present; make separate non-modular build (still not integrated as API incomplete)

- Docs: Add compatibility fix to Contributing
master
Brett Zamir 2018-09-26 16:06:57 +08:00
parent ab5aec978e
commit ae7d0d1331
9 changed files with 2434 additions and 4 deletions

View File

@ -58,6 +58,25 @@ const filesAndReplacements = [
]
]
},
{
input: 'editor/extensions/imagelib/openclipart-es.html',
output: 'editor/extensions/imagelib/openclipart.html',
replacements: [
[
'<!DOCTYPE html>',
`<!DOCTYPE html>
<!-- AUTO-GENERATED FROM imagelib/openclipart-es.html; DO NOT EDIT; use build-html.js to build -->`
],
[
'<script src="../../external/dom-polyfill/dom-polyfill.js"></script>',
'<script src="../../../dist/dom-polyfill.js"></script>'
],
[
'<script type="module" src="openclipart.js"></script>',
'<script defer="defer" src="../../../dist/extensions/imagelib/openclipart.js"></script>'
]
]
},
{
input: 'editor/extensions/imagelib/index-es.html',
output: 'editor/extensions/imagelib/index.html',

2368
dist/extensions/imagelib/openclipart.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
- `Security fix: `
- `Known regression: `
- `Breaking change: `
- `Compatibility fix: `
- `Fix: `
- `Fix (<component>): ` Component may be an extension, locale, etc.
- `Forward compatibility enhancement: `

View File

@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script src="../../external/dom-polyfill/dom-polyfill.js"></script>
<script src="../../external/babel-polyfill/polyfill.min.js"></script>
<script type="module" src="openclipart.js"></script>
</head>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!-- AUTO-GENERATED FROM imagelib/openclipart-es.html; DO NOT EDIT; use build-html.js to build -->
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script src="../../../dist/dom-polyfill.js"></script>
<script src="../../external/babel-polyfill/polyfill.min.js"></script>
<script defer="defer" src="../../../dist/extensions/imagelib/openclipart.js"></script>
</head>
<body>
</body>
</html>

View File

@ -83,6 +83,8 @@ async function processResults (url) {
// Todo: Pass to our API
}
}}, [
// If we wanted interactive versions despite security risk:
// ['object', {data: svgURL, type: 'image/svg+xml'}]
['img', {src: svgURL, style: `width: ${imgHW}; height: ${imgHW};`}]
]],
['b', [title]],

15
package-lock.json generated
View File

@ -698,6 +698,16 @@
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-transform-builtin-extend": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-builtin-extend/-/babel-plugin-transform-builtin-extend-1.1.2.tgz",
"integrity": "sha1-Xpb+z1i4+h7XTvytiEdbKvPJEW4=",
"dev": true,
"requires": {
"babel-runtime": "^6.2.0",
"babel-template": "^6.3.0"
}
},
"babel-plugin-transform-es2015-arrow-functions": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
@ -5599,9 +5609,8 @@
"dev": true
},
"query-result": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/query-result/-/query-result-0.2.0.tgz",
"integrity": "sha512-IYS3H3bctALxk93tgZP7GOSRdsUr/o5rOzzFqZOohX5WNQ3XMQn+pkC7vyVA6bBwDOG0M1mKy8MVhIDkwBS67w==",
"version": "git+https://github.com/WebReflection/query-result.git#98ee572b7a62d8eb30a367e5b6d1fc953c8684ce",
"from": "git+https://github.com/WebReflection/query-result.git",
"dev": true
},
"qunit": {

View File

@ -55,6 +55,7 @@
"devDependencies": {
"babel-core": "6.26.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
@ -74,7 +75,7 @@
"opn-cli": "^3.1.0",
"promise-fs": "^1.3.0",
"qr-manipulation": "^0.7.0",
"query-result": "^0.2.0",
"query-result": "https://github.com/WebReflection/query-result",
"qunit": "^2.6.2",
"rollup": "0.66.2",
"rollup-plugin-babel": "^3.0.7",

View File

@ -106,6 +106,20 @@ export default [
})
]
},
{
input: 'editor/extensions/imagelib/openclipart.js',
output: {
format: 'iife',
file: 'dist/extensions/imagelib/openclipart.js'
},
plugins: [
babel({
plugins: ['transform-object-rest-spread', ['babel-plugin-transform-builtin-extend', {
globals: ['Array']
}]]
})
]
},
{
input: 'editor/external/dom-polyfill/dom-polyfill.js',
output: {