@instructure/ui-dom-utils 8.12.1-snapshot.7 → 8.13.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,12 @@
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
+ # [8.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ui-popover,ui-tooltip:** fixed Tooltip triggers being transformed to links/buttons ([07b0037](https://github.com/instructure/instructure-ui/commit/07b0037b0ddaf6d4f19cca140fc82fc9a2f1efc9))
11
+
6
12
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
13
 
8
14
  **Note:** Version bump only for package @instructure/ui-dom-utils
@@ -61,7 +61,8 @@ import { requestAnimationFrame } from './requestAnimationFrame';
61
61
  * @param dimensions
62
62
  * @returns {function} remove - cancel the listener and no longer execute the handler function
63
63
  */
64
- function addResizeListener(el, handler, dimensions = ['width']) {
64
+ function addResizeListener(el, handler) {
65
+ let dimensions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ['width'];
65
66
  const node = findDOMNode(el);
66
67
  let origSize = getBoundingClientRect(node);
67
68
  let cancelled = false;
package/es/getFontSize.js CHANGED
@@ -38,7 +38,9 @@ const COMPUTED_CACHE = new WeakMap();
38
38
  * @returns { number } font size in px
39
39
  */
40
40
 
41
- function getFontSize(el, ignoreCache = false) {
41
+ function getFontSize(el) {
42
+ let ignoreCache = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
43
+
42
44
  if (!canUseDOM) {
43
45
  return 16;
44
46
  }
package/es/isVisible.js CHANGED
@@ -38,7 +38,8 @@ import { getComputedStyle } from './getComputedStyle';
38
38
  * will determine visibility based only on the styles of the given node.
39
39
  * @returns {boolean} if the element is visible
40
40
  */
41
- function isVisible(el, recursive = true) {
41
+ function isVisible(el) {
42
+ let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
42
43
  const node = el && findDOMNode(el); // skip document or window nodes
43
44
 
44
45
  if (node === window || node === document || node === document.body) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InputModeListener = exports.default = exports.MODES = void 0;
6
+ exports.default = exports.MODES = exports.InputModeListener = void 0;
7
7
 
8
8
  var _console = require("@instructure/console");
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.MODES = exports.addInputModeListener = exports.default = void 0;
6
+ exports.default = exports.addInputModeListener = exports.MODES = void 0;
7
7
 
8
8
  var _addEventListener = require("./addEventListener");
9
9
 
@@ -72,7 +72,8 @@ var _requestAnimationFrame = require("./requestAnimationFrame");
72
72
  * @param dimensions
73
73
  * @returns {function} remove - cancel the listener and no longer execute the handler function
74
74
  */
75
- function addResizeListener(el, handler, dimensions = ['width']) {
75
+ function addResizeListener(el, handler) {
76
+ let dimensions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ['width'];
76
77
  const node = (0, _findDOMNode.findDOMNode)(el);
77
78
  let origSize = (0, _getBoundingClientRect.getBoundingClientRect)(node);
78
79
  let cancelled = false;
package/lib/canUseDOM.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.canUseDOM = exports.default = void 0;
6
+ exports.default = exports.canUseDOM = void 0;
7
7
 
8
8
  /*
9
9
  * The MIT License (MIT)
package/lib/contains.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.contains = exports.default = void 0;
6
+ exports.default = exports.contains = void 0;
7
7
 
8
8
  var _findDOMNode = require("./findDOMNode");
9
9
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.elementMatches = elementMatches;
7
6
  exports.default = void 0;
7
+ exports.elementMatches = elementMatches;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.findDOMNode = findDOMNode;
9
8
  exports.default = void 0;
9
+ exports.findDOMNode = findDOMNode;
10
10
 
11
11
  var _reactDom = _interopRequireDefault(require("react-dom"));
12
12
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findFocusable = findFocusable;
7
6
  exports.default = void 0;
7
+ exports.findFocusable = findFocusable;
8
8
 
9
9
  var _ = require("./");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findTabbable = findTabbable;
7
6
  exports.default = void 0;
7
+ exports.findTabbable = findTabbable;
8
8
 
9
9
  var _findFocusable = require("./findFocusable");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getActiveElement = getActiveElement;
7
6
  exports.default = void 0;
7
+ exports.getActiveElement = getActiveElement;
8
8
 
9
9
  /*
10
10
  * The MIT License (MIT)
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getBoundingClientRect = getBoundingClientRect;
7
6
  exports.default = void 0;
7
+ exports.getBoundingClientRect = getBoundingClientRect;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getClassList = getClassList;
7
6
  exports.default = void 0;
7
+ exports.getClassList = getClassList;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getComputedStyle = getComputedStyle;
7
6
  exports.default = void 0;
7
+ exports.getComputedStyle = getComputedStyle;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getFontSize = getFontSize;
7
6
  exports.default = void 0;
7
+ exports.getFontSize = getFontSize;
8
8
 
9
9
  var _canUseDOM = require("./canUseDOM");
10
10
 
@@ -49,7 +49,9 @@ const COMPUTED_CACHE = new WeakMap();
49
49
  * @returns { number } font size in px
50
50
  */
51
51
 
52
- function getFontSize(el, ignoreCache = false) {
52
+ function getFontSize(el) {
53
+ let ignoreCache = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
54
+
53
55
  if (!_canUseDOM.canUseDOM) {
54
56
  return 16;
55
57
  }
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getOffsetParents = getOffsetParents;
7
6
  exports.default = void 0;
7
+ exports.getOffsetParents = getOffsetParents;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getScrollParents = getScrollParents;
7
6
  exports.default = void 0;
7
+ exports.getScrollParents = getScrollParents;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.handleMouseOverOut = handleMouseOverOut;
7
6
  exports.default = void 0;
7
+ exports.handleMouseOverOut = handleMouseOverOut;
8
8
 
9
9
  var _contains = require("./contains");
10
10
 
package/lib/index.js CHANGED
@@ -129,6 +129,12 @@ Object.defineProperty(exports, "isVisible", {
129
129
  return _isVisible.isVisible;
130
130
  }
131
131
  });
132
+ Object.defineProperty(exports, "matchMedia", {
133
+ enumerable: true,
134
+ get: function () {
135
+ return _matchMedia.matchMedia;
136
+ }
137
+ });
132
138
  Object.defineProperty(exports, "ownerDocument", {
133
139
  enumerable: true,
134
140
  get: function () {
@@ -153,12 +159,6 @@ Object.defineProperty(exports, "transformSelection", {
153
159
  return _transformSelection.transformSelection;
154
160
  }
155
161
  });
156
- Object.defineProperty(exports, "matchMedia", {
157
- enumerable: true,
158
- get: function () {
159
- return _matchMedia.matchMedia;
160
- }
161
- });
162
162
 
163
163
  var _addEventListener = require("./addEventListener");
164
164
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isActiveElement = isActiveElement;
7
6
  exports.default = void 0;
7
+ exports.isActiveElement = isActiveElement;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
package/lib/isVisible.js CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isVisible = isVisible;
7
6
  exports.default = void 0;
7
+ exports.isVisible = isVisible;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -48,7 +48,8 @@ var _getComputedStyle = require("./getComputedStyle");
48
48
  * will determine visibility based only on the styles of the given node.
49
49
  * @returns {boolean} if the element is visible
50
50
  */
51
- function isVisible(el, recursive = true) {
51
+ function isVisible(el) {
52
+ let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
52
53
  const node = el && (0, _findDOMNode.findDOMNode)(el); // skip document or window nodes
53
54
 
54
55
  if (node === window || node === document || node === document.body) {
package/lib/matchMedia.js CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.matchMedia = matchMedia;
7
6
  exports.default = void 0;
7
+ exports.matchMedia = matchMedia;
8
8
 
9
9
  var _canUseDOM = require("./canUseDOM");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ownerDocument = ownerDocument;
7
6
  exports.default = void 0;
7
+ exports.ownerDocument = ownerDocument;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ownerWindow = ownerWindow;
7
6
  exports.default = void 0;
7
+ exports.ownerWindow = ownerWindow;
8
8
 
9
9
  var _findDOMNode = require("./findDOMNode");
10
10
 
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.default = void 0;
6
7
  exports.transformCursor = transformCursor;
7
8
  exports.transformSelection = transformSelection;
8
- exports.default = void 0;
9
9
 
10
10
  /*
11
11
  * The MIT License (MIT)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dom-utils",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.0",
4
4
  "description": "A DOM utility library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -23,13 +23,13 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
27
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219"
26
+ "@instructure/ui-babel-preset": "8.13.0",
27
+ "@instructure/ui-test-utils": "8.13.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.13.10",
31
- "@instructure/console": "8.12.1-snapshot.7+1e7ac8219",
32
- "@instructure/shared-types": "8.12.1-snapshot.7+1e7ac8219"
31
+ "@instructure/console": "8.13.0",
32
+ "@instructure/shared-types": "8.13.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=16.8 <=17",
@@ -38,6 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "sideEffects": false,
42
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
41
+ "sideEffects": false
43
42
  }
@@ -39,7 +39,7 @@ import { UIElement } from '@instructure/shared-types'
39
39
  * @param { Node | Window | React.ReactElement | React.Component | function } el - component or DOM node
40
40
  * @returns { Object } object containing css properties and values for the element
41
41
  */
42
- function getComputedStyle(el: UIElement) {
42
+ function getComputedStyle(el?: UIElement) {
43
43
  let style = {}
44
44
  if (canUseDOM) {
45
45
  const node = el && findDOMNode(el)
@@ -40,7 +40,10 @@ import { contains } from './contains'
40
40
  */
41
41
  function handleMouseOverOut(
42
42
  handler: (...args: any[]) => any,
43
- event: Event & { relatedTarget: EventTarget | null }
43
+ event: {
44
+ currentTarget: EventTarget | null
45
+ relatedTarget?: EventTarget | null
46
+ }
44
47
  ) {
45
48
  const target = event.currentTarget
46
49
  const related = event.relatedTarget
@@ -11,7 +11,7 @@ import { UIElement } from '@instructure/shared-types';
11
11
  * @param { Node | Window | React.ReactElement | React.Component | function } el - component or DOM node
12
12
  * @returns { Object } object containing css properties and values for the element
13
13
  */
14
- declare function getComputedStyle(el: UIElement): CSSStyleDeclaration;
14
+ declare function getComputedStyle(el?: UIElement): CSSStyleDeclaration;
15
15
  export default getComputedStyle;
16
16
  export { getComputedStyle };
17
17
  //# sourceMappingURL=getComputedStyle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getComputedStyle.d.ts","sourceRoot":"","sources":["../src/getComputedStyle.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD;;;;;;;;;;;GAWG;AACH,iBAAS,gBAAgB,CAAC,EAAE,EAAE,SAAS,uBAUtC;AAED,eAAe,gBAAgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"getComputedStyle.d.ts","sourceRoot":"","sources":["../src/getComputedStyle.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD;;;;;;;;;;;GAWG;AACH,iBAAS,gBAAgB,CAAC,EAAE,CAAC,EAAE,SAAS,uBAUvC;AAED,eAAe,gBAAgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -12,8 +12,9 @@
12
12
  * @param handler {function} Callback function for handling the event
13
13
  * @param event {Event} The DOM Event that was fired
14
14
  */
15
- declare function handleMouseOverOut(handler: (...args: any[]) => any, event: Event & {
16
- relatedTarget: EventTarget | null;
15
+ declare function handleMouseOverOut(handler: (...args: any[]) => any, event: {
16
+ currentTarget: EventTarget | null;
17
+ relatedTarget?: EventTarget | null;
17
18
  }): void;
18
19
  export default handleMouseOverOut;
19
20
  export { handleMouseOverOut };
@@ -1 +1 @@
1
- {"version":3,"file":"handleMouseOverOut.d.ts","sourceRoot":"","sources":["../src/handleMouseOverOut.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;GAaG;AACH,iBAAS,kBAAkB,CACzB,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChC,KAAK,EAAE,KAAK,GAAG;IAAE,aAAa,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,QAYrD;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"handleMouseOverOut.d.ts","sourceRoot":"","sources":["../src/handleMouseOverOut.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;GAaG;AACH,iBAAS,kBAAkB,CACzB,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChC,KAAK,EAAE;IACL,aAAa,EAAE,WAAW,GAAG,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACnC,QAYF;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.