diff --git a/.gitignore b/.gitignore index c2658d7..ea0b6b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules/ +yarn.lock +package-lock.json diff --git a/lib/ElementQueries.d.ts b/lib/ElementQueries.d.ts new file mode 100644 index 0000000..00c5d93 --- /dev/null +++ b/lib/ElementQueries.d.ts @@ -0,0 +1,14 @@ +export declare class ElementQueries { + /** + * Attaches to DOMLoadContent + */ + static listen(): void; + + /** + * Parses all available CSS and attach ResizeSensor to those elements which have rules attached. + * Make sure this is called after 'load' event, because CSS files are not ready when domReady is fired. + */ + static init(): void; +} + +export default ElementQueries; diff --git a/lib/ElementQueries.js b/lib/ElementQueries.js new file mode 100644 index 0000000..79ceade --- /dev/null +++ b/lib/ElementQueries.js @@ -0,0 +1,546 @@ +import ResizeSensor from './ResizeSensor.js'; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, basedir, module) { + return module = { + path: basedir, + exports: {}, + require: function (path, base) { + return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); + } + }, fn(module, module.exports), module.exports; +} + +function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); +} + +var ElementQueries = createCommonjsModule(function (module, exports) { + +/** + * Copyright Marc J. Schmidt. See the LICENSE file at the top-level + * directory of this distribution and at + * https://github.com/marcj/css-element-queries/blob/master/LICENSE. + */ +(function (root, factory) { + { + module.exports = factory(ResizeSensor); + } +}(typeof window !== 'undefined' ? window : commonjsGlobal, function (ResizeSensor) { + + /** + * + * @type {Function} + * @constructor + */ + var ElementQueries = function () { + // + + +
+ + +