@studiometa/js-toolkit 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,6 @@ __reExport(decorators_exports, require("./withResponsiveOptions.cjs"), module.ex
27
27
  __reExport(decorators_exports, require("./withScrolledInView/index.cjs"), module.exports);
28
28
  __reExport(decorators_exports, require("./withVue2.cjs"), module.exports);
29
29
  __reExport(decorators_exports, require("./withMountOnMediaQuery.cjs"), module.exports);
30
- __reExport(decorators_exports, require("./withMountWhenPrefersMotion"), module.exports);
30
+ __reExport(decorators_exports, require("./withMountWhenPrefersMotion.cjs"), module.exports);
31
31
  if (module.exports.default) module.exports = module.exports.default;
32
32
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/decorators/index.ts"],
4
- "sourcesContent": ["export * from './withBreakpointManager.js';\nexport * from './withBreakpointObserver.js';\nexport * from './withDrag.js';\nexport * from './withExtraConfig.js';\nexport * from './withFreezedOptions.js';\nexport * from './withIntersectionObserver.js';\nexport * from './withMountWhenInView.js';\nexport * from './withResponsiveOptions.js';\nexport * from './withScrolledInView/index.js';\nexport * from './withVue2.js';\nexport * from './withMountOnMediaQuery.js';\nexport * from './withMountWhenPrefersMotion';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,wCAAd;AACA,+BAAc,yCADd;AAEA,+BAAc,2BAFd;AAGA,+BAAc,kCAHd;AAIA,+BAAc,qCAJd;AAKA,+BAAc,2CALd;AAMA,+BAAc,sCANd;AAOA,+BAAc,wCAPd;AAQA,+BAAc,2CARd;AASA,+BAAc,2BATd;AAUA,+BAAc,wCAVd;AAWA,+BAAc,yCAXd;",
4
+ "sourcesContent": ["export * from './withBreakpointManager.js';\nexport * from './withBreakpointObserver.js';\nexport * from './withDrag.js';\nexport * from './withExtraConfig.js';\nexport * from './withFreezedOptions.js';\nexport * from './withIntersectionObserver.js';\nexport * from './withMountWhenInView.js';\nexport * from './withResponsiveOptions.js';\nexport * from './withScrolledInView/index.js';\nexport * from './withVue2.js';\nexport * from './withMountOnMediaQuery.js';\nexport * from './withMountWhenPrefersMotion.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,wCAAd;AACA,+BAAc,yCADd;AAEA,+BAAc,2BAFd;AAGA,+BAAc,kCAHd;AAIA,+BAAc,qCAJd;AAKA,+BAAc,2CALd;AAMA,+BAAc,sCANd;AAOA,+BAAc,wCAPd;AAQA,+BAAc,2CARd;AASA,+BAAc,2BATd;AAUA,+BAAc,wCAVd;AAWA,+BAAc,6CAXd;",
6
6
  "names": []
7
7
  }
@@ -9,4 +9,4 @@ export * from './withResponsiveOptions.js';
9
9
  export * from './withScrolledInView/index.js';
10
10
  export * from './withVue2.js';
11
11
  export * from './withMountOnMediaQuery.js';
12
- export * from './withMountWhenPrefersMotion';
12
+ export * from './withMountWhenPrefersMotion.js';
@@ -9,5 +9,5 @@ export * from "./withResponsiveOptions.js";
9
9
  export * from "./withScrolledInView/index.js";
10
10
  export * from "./withVue2.js";
11
11
  export * from "./withMountOnMediaQuery.js";
12
- export * from "./withMountWhenPrefersMotion";
12
+ export * from "./withMountWhenPrefersMotion.js";
13
13
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/decorators/index.ts"],
4
- "sourcesContent": ["export * from './withBreakpointManager.js';\nexport * from './withBreakpointObserver.js';\nexport * from './withDrag.js';\nexport * from './withExtraConfig.js';\nexport * from './withFreezedOptions.js';\nexport * from './withIntersectionObserver.js';\nexport * from './withMountWhenInView.js';\nexport * from './withResponsiveOptions.js';\nexport * from './withScrolledInView/index.js';\nexport * from './withVue2.js';\nexport * from './withMountOnMediaQuery.js';\nexport * from './withMountWhenPrefersMotion';\n"],
4
+ "sourcesContent": ["export * from './withBreakpointManager.js';\nexport * from './withBreakpointObserver.js';\nexport * from './withDrag.js';\nexport * from './withExtraConfig.js';\nexport * from './withFreezedOptions.js';\nexport * from './withIntersectionObserver.js';\nexport * from './withMountWhenInView.js';\nexport * from './withResponsiveOptions.js';\nexport * from './withScrolledInView/index.js';\nexport * from './withVue2.js';\nexport * from './withMountOnMediaQuery.js';\nexport * from './withMountWhenPrefersMotion.js';\n"],
5
5
  "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -22,7 +22,7 @@ __export(importOnMediaQuery_exports, {
22
22
  default: () => importOnMediaQuery
23
23
  });
24
24
  module.exports = __toCommonJS(importOnMediaQuery_exports);
25
- var import_utils = require("../utils");
25
+ var import_utils = require("../utils/index.cjs");
26
26
  function importOnMediaQuery(fn, media) {
27
27
  const resolver = (0, import_utils.getComponentResolver)(fn);
28
28
  return new Promise((resolve) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/helpers/importOnMediaQuery.ts"],
4
- "sourcesContent": ["import type { BaseConstructor } from '../Base/index.js';\nimport { getComponentResolver } from '../utils';\n\n/**\n * Import a component when given media query is true.\n *\n * @template {BaseConstructor} T\n * @param {() => Promise<T|{default:T}>} fn\n * The import function.\n * @param {string} media\n * The media query name and value (see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features)\n * @returns {Promise<T>}\n */\nexport default function importOnMediaQuery<T extends BaseConstructor = BaseConstructor>(\n fn: () => Promise<T | { default: T }>,\n media: string,\n): Promise<T> {\n const resolver = getComponentResolver(fn);\n\n return new Promise((resolve) => {\n const mediaQueryList = window.matchMedia(media);\n\n if (mediaQueryList.matches) {\n resolver(resolve);\n }\n\n const changeHandler = (event: MediaQueryListEvent) => {\n if (event.matches) {\n setTimeout(() => {\n // Remove listener and mount the component\n resolver(resolve, () => mediaQueryList.removeEventListener('change', changeHandler));\n }, 0);\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n });\n}\n"],
4
+ "sourcesContent": ["import type { BaseConstructor } from '../Base/index.js';\nimport { getComponentResolver } from '../utils/index.js';\n\n/**\n * Import a component when given media query is true.\n *\n * @template {BaseConstructor} T\n * @param {() => Promise<T|{default:T}>} fn\n * The import function.\n * @param {string} media\n * The media query name and value (see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features)\n * @returns {Promise<T>}\n */\nexport default function importOnMediaQuery<T extends BaseConstructor = BaseConstructor>(\n fn: () => Promise<T | { default: T }>,\n media: string,\n): Promise<T> {\n const resolver = getComponentResolver(fn);\n\n return new Promise((resolve) => {\n const mediaQueryList = window.matchMedia(media);\n\n if (mediaQueryList.matches) {\n resolver(resolve);\n }\n\n const changeHandler = (event: MediaQueryListEvent) => {\n if (event.matches) {\n setTimeout(() => {\n // Remove listener and mount the component\n resolver(resolve, () => mediaQueryList.removeEventListener('change', changeHandler));\n }, 0);\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n });\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAqC;AAYtB,SAAR,mBACL,IACA,OACY;AACZ,QAAM,eAAW,mCAAqB,EAAE;AAExC,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,iBAAiB,OAAO,WAAW,KAAK;AAE9C,QAAI,eAAe,SAAS;AAC1B,eAAS,OAAO;AAAA,IAClB;AAEA,UAAM,gBAAgB,CAAC,UAA+B;AACpD,UAAI,MAAM,SAAS;AACjB,mBAAW,MAAM;AAEf,mBAAS,SAAS,MAAM,eAAe,oBAAoB,UAAU,aAAa,CAAC;AAAA,QACrF,GAAG,CAAC;AAAA,MACN;AAAA,IACF;AAGA,mBAAe,iBAAiB,UAAU,aAAa;AAAA,EACzD,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { getComponentResolver } from "../utils";
1
+ import { getComponentResolver } from "../utils/index.js";
2
2
  function importOnMediaQuery(fn, media) {
3
3
  const resolver = getComponentResolver(fn);
4
4
  return new Promise((resolve) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/helpers/importOnMediaQuery.ts"],
4
- "sourcesContent": ["import type { BaseConstructor } from '../Base/index.js';\nimport { getComponentResolver } from '../utils';\n\n/**\n * Import a component when given media query is true.\n *\n * @template {BaseConstructor} T\n * @param {() => Promise<T|{default:T}>} fn\n * The import function.\n * @param {string} media\n * The media query name and value (see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features)\n * @returns {Promise<T>}\n */\nexport default function importOnMediaQuery<T extends BaseConstructor = BaseConstructor>(\n fn: () => Promise<T | { default: T }>,\n media: string,\n): Promise<T> {\n const resolver = getComponentResolver(fn);\n\n return new Promise((resolve) => {\n const mediaQueryList = window.matchMedia(media);\n\n if (mediaQueryList.matches) {\n resolver(resolve);\n }\n\n const changeHandler = (event: MediaQueryListEvent) => {\n if (event.matches) {\n setTimeout(() => {\n // Remove listener and mount the component\n resolver(resolve, () => mediaQueryList.removeEventListener('change', changeHandler));\n }, 0);\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n });\n}\n"],
4
+ "sourcesContent": ["import type { BaseConstructor } from '../Base/index.js';\nimport { getComponentResolver } from '../utils/index.js';\n\n/**\n * Import a component when given media query is true.\n *\n * @template {BaseConstructor} T\n * @param {() => Promise<T|{default:T}>} fn\n * The import function.\n * @param {string} media\n * The media query name and value (see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features)\n * @returns {Promise<T>}\n */\nexport default function importOnMediaQuery<T extends BaseConstructor = BaseConstructor>(\n fn: () => Promise<T | { default: T }>,\n media: string,\n): Promise<T> {\n const resolver = getComponentResolver(fn);\n\n return new Promise((resolve) => {\n const mediaQueryList = window.matchMedia(media);\n\n if (mediaQueryList.matches) {\n resolver(resolve);\n }\n\n const changeHandler = (event: MediaQueryListEvent) => {\n if (event.matches) {\n setTimeout(() => {\n // Remove listener and mount the component\n resolver(resolve, () => mediaQueryList.removeEventListener('change', changeHandler));\n }, 0);\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n });\n}\n"],
5
5
  "mappings": "AACA,SAAS,4BAA4B;AAYtB,SAAR,mBACL,IACA,OACY;AACZ,QAAM,WAAW,qBAAqB,EAAE;AAExC,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,iBAAiB,OAAO,WAAW,KAAK;AAE9C,QAAI,eAAe,SAAS;AAC1B,eAAS,OAAO;AAAA,IAClB;AAEA,UAAM,gBAAgB,CAAC,UAA+B;AACpD,UAAI,MAAM,SAAS;AACjB,mBAAW,MAAM;AAEf,mBAAS,SAAS,MAAM,eAAe,oBAAoB,UAAU,aAAa,CAAC;AAAA,QACrF,GAAG,CAAC;AAAA,MACN;AAAA,IACF;AAGA,mBAAe,iBAAiB,UAAU,aAAa;AAAA,EACzD,CAAC;AACH;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/js-toolkit",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "description": "A set of useful little bits of JavaScript to boost your project! 🚀",
5
5
  "publishConfig": {
6
6
  "access": "public"