@commercetools-uikit/hooks 16.1.1 → 16.2.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.
@@ -359,7 +359,7 @@ const useDataTableSortingState = function () {
359
359
  var useDataTableSortingState$1 = useDataTableSortingState;
360
360
 
361
361
  // NOTE: This string will be replaced on build time with the package version.
362
- var version = "16.1.1";
362
+ var version = "16.2.1";
363
363
 
364
364
  exports.useDataTableSortingState = useDataTableSortingState$1;
365
365
  exports.useFieldId = useFieldId$1;
@@ -359,7 +359,7 @@ const useDataTableSortingState = function () {
359
359
  var useDataTableSortingState$1 = useDataTableSortingState;
360
360
 
361
361
  // NOTE: This string will be replaced on build time with the package version.
362
- var version = "16.1.1";
362
+ var version = "16.2.1";
363
363
 
364
364
  exports.useDataTableSortingState = useDataTableSortingState$1;
365
365
  exports.useFieldId = useFieldId$1;
@@ -335,6 +335,6 @@ const useDataTableSortingState = function () {
335
335
  var useDataTableSortingState$1 = useDataTableSortingState;
336
336
 
337
337
  // NOTE: This string will be replaced on build time with the package version.
338
- var version = "16.1.1";
338
+ var version = "16.2.1";
339
339
 
340
340
  export { useDataTableSortingState$1 as useDataTableSortingState, useFieldId$1 as useFieldId, useMutationObserver, usePaginationState$1 as usePaginationState, usePrevious$1 as usePrevious, useRowSelection$1 as useRowSelection, useSorting$1 as useSorting, useToggleState$1 as useToggleState, version };
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import './polyfill';
3
2
  export type TUseMutationObserverCallback = (mutationsList: MutationRecord[], observer: MutationObserver) => void;
4
3
  declare function useMutationObserver<T extends HTMLElement>(target: React.RefObject<T> | T | null, callback: TUseMutationObserverCallback, options?: MutationObserverInit): MutationObserver;
5
4
  export default useMutationObserver;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/hooks",
3
3
  "description": "A collection of React hooks used across some of the UI-Kit components.",
4
- "version": "16.1.1",
4
+ "version": "16.2.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -17,11 +17,14 @@
17
17
  "sideEffects": false,
18
18
  "main": "dist/commercetools-uikit-hooks.cjs.js",
19
19
  "module": "dist/commercetools-uikit-hooks.esm.js",
20
- "files": ["dist"],
20
+ "preconstruct": {
21
+ "entrypoints": ["./index.ts", "./polyfills.ts"]
22
+ },
23
+ "files": ["dist", "polyfills"],
21
24
  "dependencies": {
22
25
  "@babel/runtime": "^7.20.13",
23
26
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/utils": "16.1.1",
27
+ "@commercetools-uikit/utils": "16.2.1",
25
28
  "@types/raf-schd": "^4.0.1",
26
29
  "lodash": "4.17.21",
27
30
  "raf-schd": "^4.0.3"
@@ -0,0 +1,2 @@
1
+ export * from "../../dist/declarations/src/polyfills";
2
+ //# sourceMappingURL=commercetools-uikit-hooks-polyfills.cjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commercetools-uikit-hooks-polyfills.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/polyfills.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
4
+ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
5
+ var _globalThis = require('@babel/runtime-corejs3/core-js/global-this');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
8
+
9
+ var _globalThis__default = /*#__PURE__*/_interopDefault(_globalThis);
10
+
11
+ // Polyfill for `MutationObserver` when used with SSR.
12
+ // eslint-disable-next-line no-undef
13
+ _globalThis__default["default"].MutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? window.MutationObserver : /*#__PURE__*/function () {
14
+ function MutationObserver() {
15
+ _classCallCheck(this, MutationObserver);
16
+ }
17
+ _createClass(MutationObserver, [{
18
+ key: "observe",
19
+ value: function observe() {}
20
+ }, {
21
+ key: "disconnect",
22
+ value: function disconnect() {}
23
+ }, {
24
+ key: "takeRecords",
25
+ value: function takeRecords() {
26
+ return [];
27
+ }
28
+ }]);
29
+ return MutationObserver;
30
+ }();
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./commercetools-uikit-hooks-polyfills.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./commercetools-uikit-hooks-polyfills.cjs.dev.js");
7
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
4
+ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
5
+ var _globalThis = require('@babel/runtime-corejs3/core-js/global-this');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
8
+
9
+ var _globalThis__default = /*#__PURE__*/_interopDefault(_globalThis);
10
+
11
+ // Polyfill for `MutationObserver` when used with SSR.
12
+ // eslint-disable-next-line no-undef
13
+ _globalThis__default["default"].MutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? window.MutationObserver : /*#__PURE__*/function () {
14
+ function MutationObserver() {
15
+ _classCallCheck(this, MutationObserver);
16
+ }
17
+ _createClass(MutationObserver, [{
18
+ key: "observe",
19
+ value: function observe() {}
20
+ }, {
21
+ key: "disconnect",
22
+ value: function disconnect() {}
23
+ }, {
24
+ key: "takeRecords",
25
+ value: function takeRecords() {
26
+ return [];
27
+ }
28
+ }]);
29
+ return MutationObserver;
30
+ }();
@@ -0,0 +1,24 @@
1
+ import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
2
+ import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
3
+ import _globalThis from '@babel/runtime-corejs3/core-js/global-this';
4
+
5
+ // Polyfill for `MutationObserver` when used with SSR.
6
+ // eslint-disable-next-line no-undef
7
+ _globalThis.MutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? window.MutationObserver : /*#__PURE__*/function () {
8
+ function MutationObserver() {
9
+ _classCallCheck(this, MutationObserver);
10
+ }
11
+ _createClass(MutationObserver, [{
12
+ key: "observe",
13
+ value: function observe() {}
14
+ }, {
15
+ key: "disconnect",
16
+ value: function disconnect() {}
17
+ }, {
18
+ key: "takeRecords",
19
+ value: function takeRecords() {
20
+ return [];
21
+ }
22
+ }]);
23
+ return MutationObserver;
24
+ }();
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/commercetools-uikit-hooks-polyfills.cjs.js",
3
+ "module": "dist/commercetools-uikit-hooks-polyfills.esm.js"
4
+ }