"rollup-pluginutils": "^2.3.3"
}
},
+ "rollup-plugin-polyfill": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill/-/rollup-plugin-polyfill-3.0.0.tgz",
+ "integrity": "sha512-LfJ1OR/wJrJdNDVNrdhVm7CgENfaNoQlFYMaQ0vlQH3zO+BMVrBMWDX9k6HVcr9gHsKbthrkiBzWRfFU9fr0hQ==",
+ "dev": true,
+ "requires": {
+ "magic-string": "^0.25.3"
+ }
+ },
"rollup-plugin-terser": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.2.0.tgz",
"rollup": "^1.31.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-cleanup": "^3.1.1",
+ "rollup-plugin-polyfill": "^3.0.0",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-web-worker-loader": "^0.8.1",
"typedoc": "^0.16.10",
const babel = require('rollup-plugin-babel');
const cleanup = require('rollup-plugin-cleanup');
+const polyfill = require('rollup-plugin-polyfill')
const json = require('@rollup/plugin-json');
const resolve = require('@rollup/plugin-node-resolve');
const terser = require('rollup-plugin-terser').terser;
{
input,
plugins: [
+ polyfill(['resize-observer-polyfill', './platform/platform.dom.js']),
json(),
resolve(),
babel(),
{
input,
plugins: [
+ polyfill(['resize-observer-polyfill', './platform/platform.dom.js']),
json(),
resolve(),
babel(),
import helpers from '../helpers/index';
import BasePlatform from './platform.base';
import {_getParentNode} from '../helpers/helpers.dom';
-import ResizeObserver from 'resize-observer-polyfill';
/**
* @typedef { import("../core/core.controller").default } Chart
* Calling `fn` is limited to once per animation frame
* @param {Element} element - The element to monitor
* @param {function} fn - Callback function to call when resized
- * @return {ResizeObserver}
*/
function watchForResize(element, fn) {
const resize = throttled((width, height) => {
}
}, window);
+ // @ts-ignore until https://github.com/Microsoft/TypeScript/issues/28502 implemented
const observer = new ResizeObserver(entries => {
const entry = entries[0];
resize(entry.contentRect.width, entry.contentRect.height);