@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 +6 -0
- package/es/addResizeListener.js +2 -1
- package/es/getFontSize.js +3 -1
- package/es/isVisible.js +2 -1
- package/lib/InputModeListener.js +1 -1
- package/lib/addInputModeListener.js +1 -1
- package/lib/addResizeListener.js +2 -1
- package/lib/canUseDOM.js +1 -1
- package/lib/contains.js +1 -1
- package/lib/elementMatches.js +1 -1
- package/lib/findDOMNode.js +1 -1
- package/lib/findFocusable.js +1 -1
- package/lib/findTabbable.js +1 -1
- package/lib/getActiveElement.js +1 -1
- package/lib/getBoundingClientRect.js +1 -1
- package/lib/getClassList.js +1 -1
- package/lib/getComputedStyle.js +1 -1
- package/lib/getFontSize.js +4 -2
- package/lib/getOffsetParents.js +1 -1
- package/lib/getScrollParents.js +1 -1
- package/lib/handleMouseOverOut.js +1 -1
- package/lib/index.js +6 -6
- package/lib/isActiveElement.js +1 -1
- package/lib/isVisible.js +3 -2
- package/lib/matchMedia.js +1 -1
- package/lib/ownerDocument.js +1 -1
- package/lib/ownerWindow.js +1 -1
- package/lib/transformSelection.js +1 -1
- package/package.json +6 -7
- package/src/getComputedStyle.ts +1 -1
- package/src/handleMouseOverOut.ts +4 -1
- package/types/getComputedStyle.d.ts +1 -1
- package/types/getComputedStyle.d.ts.map +1 -1
- package/types/handleMouseOverOut.d.ts +3 -2
- package/types/handleMouseOverOut.d.ts.map +1 -1
- package/LICENSE.md +0 -27
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
|
package/es/addResizeListener.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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) {
|
package/lib/InputModeListener.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.addInputModeListener = exports.MODES = void 0;
|
|
7
7
|
|
|
8
8
|
var _addEventListener = require("./addEventListener");
|
|
9
9
|
|
package/lib/addResizeListener.js
CHANGED
|
@@ -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
|
|
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
package/lib/contains.js
CHANGED
package/lib/elementMatches.js
CHANGED
package/lib/findDOMNode.js
CHANGED
|
@@ -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
|
|
package/lib/findFocusable.js
CHANGED
package/lib/findTabbable.js
CHANGED
package/lib/getActiveElement.js
CHANGED
package/lib/getClassList.js
CHANGED
package/lib/getComputedStyle.js
CHANGED
package/lib/getFontSize.js
CHANGED
|
@@ -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
|
|
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
|
}
|
package/lib/getOffsetParents.js
CHANGED
package/lib/getScrollParents.js
CHANGED
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
|
|
package/lib/isActiveElement.js
CHANGED
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
|
|
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
package/lib/ownerDocument.js
CHANGED
package/lib/ownerWindow.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-dom-utils",
|
|
3
|
-
"version": "8.
|
|
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.
|
|
27
|
-
"@instructure/ui-test-utils": "8.
|
|
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.
|
|
32
|
-
"@instructure/shared-types": "8.
|
|
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
|
}
|
package/src/getComputedStyle.ts
CHANGED
|
@@ -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
|
|
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:
|
|
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
|
|
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,
|
|
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:
|
|
16
|
-
|
|
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,
|
|
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.
|