@instructure/ui-responsive 11.7.8 → 11.7.9-snapshot-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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [11.7.9-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-responsive
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-responsive
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Responsive = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
var _console = require("@instructure/console");
|
|
10
10
|
var _addElementQueryMatchListener = require("../../utils/v1/addElementQueryMatchListener.js");
|
|
11
11
|
var _addMediaQueryMatchListener = require("../../utils/v1/addMediaQueryMatchListener.js");
|
|
12
|
-
var
|
|
12
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
13
13
|
var _props = require("./props.js");
|
|
14
14
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
15
15
|
/*
|
|
@@ -90,14 +90,14 @@ category: components
|
|
|
90
90
|
match,
|
|
91
91
|
query
|
|
92
92
|
} = this.props;
|
|
93
|
-
if (match !== prevProps.match || !(0,
|
|
93
|
+
if (match !== prevProps.match || !(0, _uiUtils.deepEqual)(query, prevProps.query)) {
|
|
94
94
|
this.removeMatchListener();
|
|
95
95
|
this._matchListener = this.addMatchListener(query, this.updateMatches, match);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
addMatchListener(query, updateMatches, match = this.props.match) {
|
|
99
99
|
const matchListener = match === 'element' ? _addElementQueryMatchListener.addElementQueryMatchListener : _addMediaQueryMatchListener.addMediaQueryMatchListener;
|
|
100
|
-
return matchListener(query, () => (0,
|
|
100
|
+
return matchListener(query, () => (0, _uiDomUtils.findDOMNode)(this), updateMatches);
|
|
101
101
|
}
|
|
102
102
|
removeMatchListener() {
|
|
103
103
|
if (this._matchListener) {
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.addElementQueryMatchListener = void 0;
|
|
7
7
|
exports.updateElementMatches = updateElementMatches;
|
|
8
8
|
var _parseQuery = require("./parseQuery.js");
|
|
9
|
-
var
|
|
10
|
-
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
9
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
10
|
var _debounce = require("@instructure/debounce");
|
|
12
11
|
/*
|
|
13
12
|
* The MIT License (MIT)
|
|
@@ -93,7 +92,7 @@ const addElementQueryMatchListener = (query, el, cb) => {
|
|
|
93
92
|
const {
|
|
94
93
|
width,
|
|
95
94
|
height
|
|
96
|
-
} = (0,
|
|
95
|
+
} = (0, _uiDomUtils.getBoundingClientRect)(node);
|
|
97
96
|
let matches = [];
|
|
98
97
|
const update = size => {
|
|
99
98
|
const newMatches = updateElementMatches(query, node, matches, size);
|
|
@@ -139,11 +138,11 @@ const addElementQueryMatchListener = (query, el, cb) => {
|
|
|
139
138
|
};
|
|
140
139
|
exports.addElementQueryMatchListener = addElementQueryMatchListener;
|
|
141
140
|
function updateElementMatches(query, el, matches = [], size) {
|
|
142
|
-
const node = (0,
|
|
141
|
+
const node = (0, _uiDomUtils.findDOMNode)(el);
|
|
143
142
|
let {
|
|
144
143
|
width,
|
|
145
144
|
height
|
|
146
|
-
} = size || (0,
|
|
145
|
+
} = size || (0, _uiDomUtils.getBoundingClientRect)(node);
|
|
147
146
|
|
|
148
147
|
// round dimensions to make sure matcher can match queries with integer values
|
|
149
148
|
width = Math.floor(width);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.addMediaQueryMatchListener = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
8
8
|
var _jsonToMediaQuery = require("./jsonToMediaQuery.js");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -82,7 +82,7 @@ var _jsonToMediaQuery = require("./jsonToMediaQuery.js");
|
|
|
82
82
|
* @param {object} matchMedia - called with an array of the names of the currently matching queries whenever a matching query changes
|
|
83
83
|
* @returns {function} remove() function to call to remove the listener
|
|
84
84
|
*/
|
|
85
|
-
const addMediaQueryMatchListener = (query, el, cb, matchMedia =
|
|
85
|
+
const addMediaQueryMatchListener = (query, el, cb, matchMedia = _uiDomUtils.matchMedia) => {
|
|
86
86
|
const node = typeof el === 'function' ? el() : el;
|
|
87
87
|
const updateMediaMatches = mediaQueryLists => {
|
|
88
88
|
const matches = Object.keys(mediaQueryLists).filter(key => mediaQueryLists[key].matches).map(key => key);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.jsonToMediaQuery = jsonToMediaQuery;
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
11
11
|
*
|
|
@@ -75,7 +75,7 @@ function jsonToMediaQuery(query, el) {
|
|
|
75
75
|
if (!value) {
|
|
76
76
|
throw new Error('No value supplied for query object');
|
|
77
77
|
}
|
|
78
|
-
mediaQuery += `(${hyphenateQueryKey(key)}: ${(0,
|
|
78
|
+
mediaQuery += `(${hyphenateQueryKey(key)}: ${(0, _uiUtils.px)(value, el)}px) ${QUERY_SEPARATOR} `;
|
|
79
79
|
}
|
|
80
80
|
return mediaQuery.slice(0, -QUERY_SEPARATOR.length - 2);
|
|
81
81
|
}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.parseQuery = parseQuery;
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
11
11
|
*
|
|
@@ -62,10 +62,10 @@ function parseQuery(query, el) {
|
|
|
62
62
|
maxHeight
|
|
63
63
|
} = query[selectorName];
|
|
64
64
|
rules[selectorName] = {
|
|
65
|
-
minWidth: minWidth && (0,
|
|
66
|
-
maxWidth: maxWidth && (0,
|
|
67
|
-
minHeight: minHeight && (0,
|
|
68
|
-
maxHeight: maxHeight && (0,
|
|
65
|
+
minWidth: minWidth && (0, _uiUtils.px)(minWidth, el) || 0,
|
|
66
|
+
maxWidth: maxWidth && (0, _uiUtils.px)(maxWidth, el) || Infinity,
|
|
67
|
+
minHeight: minHeight && (0, _uiUtils.px)(minHeight, el) || 0,
|
|
68
|
+
maxHeight: maxHeight && (0, _uiUtils.px)(maxHeight, el) || Infinity
|
|
69
69
|
};
|
|
70
70
|
});
|
|
71
71
|
return function ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-responsive",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "A component that allows for rendering a component differently based on either the element or the viewport size",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/console": "11.7.
|
|
19
|
-
"@instructure/ui-dom-utils": "11.7.
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/ui-react-utils": "11.7.
|
|
23
|
-
"@instructure/ui-utils": "11.7.
|
|
18
|
+
"@instructure/console": "11.7.9-snapshot-1",
|
|
19
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1",
|
|
20
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
21
|
+
"@instructure/debounce": "11.7.9-snapshot-1",
|
|
22
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-1",
|
|
23
|
+
"@instructure/ui-utils": "11.7.9-snapshot-1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"vitest": "^5.0.0",
|
|
27
|
-
"@instructure/ui-babel-preset": "11.7.
|
|
28
|
-
"@instructure/ui-color-utils": "11.7.
|
|
27
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1",
|
|
28
|
+
"@instructure/ui-color-utils": "11.7.9-snapshot-1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=18 <=19"
|