@instructure/ui-dom-utils 8.56.0 → 9.0.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [9.0.0](https://github.com/instructure/instructure-ui/compare/v8.56.0...v9.0.0) (2024-05-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * **ui-dom-utils,ui-react-utils,ui-utils:** remove deprecated utils ([0a8c8e3](https://github.com/instructure/instructure-ui/commit/0a8c8e3230db7a7ec107bb726d1f98375c9446c4))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * **ui-dom-utils,ui-react-utils,ui-utils:** deprecated utils has been removed
17
+
18
+
19
+
20
+
21
+
6
22
  # [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
7
23
 
8
24
  **Note:** Version bump only for package @instructure/ui-dom-utils
@@ -34,7 +34,7 @@
34
34
  * http://api.jqueryui.com/category/ui-core/
35
35
  **/
36
36
 
37
- import { getComputedStyle, findDOMNode, elementMatches } from './';
37
+ import { getComputedStyle, findDOMNode } from './';
38
38
  const focusableSelector = ['a[href]', 'frame', 'iframe', 'object', 'input:not([type=hidden])', 'select', 'textarea', 'button', '*[tabindex]', '[contenteditable="true"]'].join(',');
39
39
  function findFocusable(el, filter, shouldSearchRootNode) {
40
40
  const element = el && findDOMNode(el);
@@ -42,7 +42,7 @@ function findFocusable(el, filter, shouldSearchRootNode) {
42
42
  return [];
43
43
  }
44
44
  let matches = Array.from(element.querySelectorAll(focusableSelector));
45
- if (shouldSearchRootNode && elementMatches(element, focusableSelector)) {
45
+ if (shouldSearchRootNode && element.matches(focusableSelector)) {
46
46
  matches = [...matches, element];
47
47
  }
48
48
  return matches.filter(el => {
package/es/index.js CHANGED
@@ -26,11 +26,9 @@
26
26
  export { addEventListener } from './addEventListener';
27
27
  export { addInputModeListener } from './addInputModeListener';
28
28
  export { addPositionChangeListener } from './addPositionChangeListener';
29
- export { addResizeListener } from './addResizeListener';
30
29
  export { canUseDOM } from './canUseDOM';
31
30
  export { contains } from './contains';
32
31
  export { containsActiveElement } from './containsActiveElement';
33
- export { elementMatches } from './elementMatches';
34
32
  export { findDOMNode } from './findDOMNode';
35
33
  export { findFocusable } from './findFocusable';
36
34
  export { findTabbable } from './findTabbable';
@@ -49,7 +49,7 @@ function findFocusable(el, filter, shouldSearchRootNode) {
49
49
  return [];
50
50
  }
51
51
  let matches = Array.from(element.querySelectorAll(focusableSelector));
52
- if (shouldSearchRootNode && (0, _.elementMatches)(element, focusableSelector)) {
52
+ if (shouldSearchRootNode && element.matches(focusableSelector)) {
53
53
  matches = [...matches, element];
54
54
  }
55
55
  return matches.filter(el => {
package/lib/index.js CHANGED
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "addPositionChangeListener", {
21
21
  return _addPositionChangeListener.addPositionChangeListener;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "addResizeListener", {
25
- enumerable: true,
26
- get: function () {
27
- return _addResizeListener.addResizeListener;
28
- }
29
- });
30
24
  Object.defineProperty(exports, "canUseDOM", {
31
25
  enumerable: true,
32
26
  get: function () {
@@ -45,12 +39,6 @@ Object.defineProperty(exports, "containsActiveElement", {
45
39
  return _containsActiveElement.containsActiveElement;
46
40
  }
47
41
  });
48
- Object.defineProperty(exports, "elementMatches", {
49
- enumerable: true,
50
- get: function () {
51
- return _elementMatches.elementMatches;
52
- }
53
- });
54
42
  Object.defineProperty(exports, "findDOMNode", {
55
43
  enumerable: true,
56
44
  get: function () {
@@ -162,11 +150,9 @@ Object.defineProperty(exports, "transformSelection", {
162
150
  var _addEventListener = require("./addEventListener");
163
151
  var _addInputModeListener = require("./addInputModeListener");
164
152
  var _addPositionChangeListener = require("./addPositionChangeListener");
165
- var _addResizeListener = require("./addResizeListener");
166
153
  var _canUseDOM = require("./canUseDOM");
167
154
  var _contains = require("./contains");
168
155
  var _containsActiveElement = require("./containsActiveElement");
169
- var _elementMatches = require("./elementMatches");
170
156
  var _findDOMNode = require("./findDOMNode");
171
157
  var _findFocusable = require("./findFocusable");
172
158
  var _findTabbable = require("./findTabbable");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dom-utils",
3
- "version": "8.56.0",
3
+ "version": "9.0.0",
4
4
  "description": "A DOM utility library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@instructure/ui-babel-preset": "8.56.0",
25
+ "@instructure/ui-babel-preset": "9.0.0",
26
26
  "@testing-library/jest-dom": "^6.1.4",
27
27
  "@testing-library/react": "^14.1.2"
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.23.2",
31
- "@instructure/console": "8.56.0",
32
- "@instructure/shared-types": "8.56.0"
31
+ "@instructure/console": "9.0.0",
32
+ "@instructure/shared-types": "9.0.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=16.8 <=18",
@@ -34,7 +34,7 @@
34
34
  * http://api.jqueryui.com/category/ui-core/
35
35
  **/
36
36
 
37
- import { getComputedStyle, findDOMNode, elementMatches } from './'
37
+ import { getComputedStyle, findDOMNode } from './'
38
38
  import type { UIElement } from '@instructure/shared-types'
39
39
 
40
40
  const focusableSelector = [
@@ -68,7 +68,7 @@ function findFocusable(
68
68
  (element as Element | Document).querySelectorAll(focusableSelector)
69
69
  )
70
70
 
71
- if (shouldSearchRootNode && elementMatches(element, focusableSelector)) {
71
+ if (shouldSearchRootNode && (element as Element).matches(focusableSelector)) {
72
72
  matches = [...matches, element as Element]
73
73
  }
74
74
 
package/src/index.ts CHANGED
@@ -27,11 +27,9 @@ export { addEventListener } from './addEventListener'
27
27
  export { addInputModeListener } from './addInputModeListener'
28
28
  export { addPositionChangeListener } from './addPositionChangeListener'
29
29
  export type { PositionChangeListenerType } from './addPositionChangeListener'
30
- export { addResizeListener } from './addResizeListener'
31
30
  export { canUseDOM } from './canUseDOM'
32
31
  export { contains } from './contains'
33
32
  export { containsActiveElement } from './containsActiveElement'
34
- export { elementMatches } from './elementMatches'
35
33
  export { findDOMNode } from './findDOMNode'
36
34
  export { findFocusable } from './findFocusable'
37
35
  export { findTabbable } from './findTabbable'