@instructure/ui-position 8.18.0 → 8.18.1-snapshot.12

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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
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.
@@ -104,11 +104,15 @@ let Position = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
104
104
  }
105
105
 
106
106
  componentDidMount() {
107
+ var _this$props$makeStyle, _this$props;
108
+
107
109
  this.toggleLocatorAttributes(true);
108
- this.props.makeStyles?.();
110
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
109
111
  }
110
112
 
111
113
  componentDidUpdate(prevProps, prevState) {
114
+ var _this$props$makeStyle2, _this$props2;
115
+
112
116
  this.position();
113
117
  this.toggleLocatorAttributes(true);
114
118
 
@@ -128,7 +132,7 @@ let Position = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
128
132
  });
129
133
  }
130
134
 
131
- this.props.makeStyles?.();
135
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
132
136
  }
133
137
 
134
138
  componentWillUnmount() {
@@ -191,13 +195,15 @@ let Position = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
191
195
  let content = ensureSingleChild(this.props.children);
192
196
 
193
197
  if (content) {
198
+ var _this$props$styles;
199
+
194
200
  content = safeCloneElement(content, {
195
201
  ref: el => {
196
202
  this._content = el;
197
203
  },
198
204
  style: {
199
205
  boxSizing: 'border-box',
200
- zIndex: this.props.styles?.zIndex,
206
+ zIndex: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.zIndex,
201
207
  ...content.props.style,
202
208
  ...this.state.style
203
209
  },
@@ -30,7 +30,7 @@
30
30
  const generateComponentTheme = theme => {
31
31
  const stacking = theme.stacking;
32
32
  const componentVariables = {
33
- zIndex: stacking?.topmost
33
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.topmost
34
34
  };
35
35
  return { ...componentVariables
36
36
  };
@@ -288,7 +288,7 @@ class PositionData {
288
288
  left = _addOffsets.left,
289
289
  top = _addOffsets.top;
290
290
 
291
- if (canUseDOM && win?.matchMedia) {
291
+ if (canUseDOM && win !== null && win !== void 0 && win.matchMedia) {
292
292
  const retina = win.matchMedia('only screen and (min-resolution: 1.3dppx)').matches || win.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3)').matches;
293
293
 
294
294
  if (!retina) {
@@ -109,11 +109,15 @@ let Position = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 =
109
109
  }
110
110
 
111
111
  componentDidMount() {
112
+ var _this$props$makeStyle, _this$props;
113
+
112
114
  this.toggleLocatorAttributes(true);
113
- this.props.makeStyles?.();
115
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
114
116
  }
115
117
 
116
118
  componentDidUpdate(prevProps, prevState) {
119
+ var _this$props$makeStyle2, _this$props2;
120
+
117
121
  this.position();
118
122
  this.toggleLocatorAttributes(true);
119
123
 
@@ -133,7 +137,7 @@ let Position = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 =
133
137
  });
134
138
  }
135
139
 
136
- this.props.makeStyles?.();
140
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
137
141
  }
138
142
 
139
143
  componentWillUnmount() {
@@ -196,13 +200,15 @@ let Position = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 =
196
200
  let content = (0, _ensureSingleChild.ensureSingleChild)(this.props.children);
197
201
 
198
202
  if (content) {
203
+ var _this$props$styles;
204
+
199
205
  content = (0, _safeCloneElement.safeCloneElement)(content, {
200
206
  ref: el => {
201
207
  this._content = el;
202
208
  },
203
209
  style: {
204
210
  boxSizing: 'border-box',
205
- zIndex: this.props.styles?.zIndex,
211
+ zIndex: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.zIndex,
206
212
  ...content.props.style,
207
213
  ...this.state.style
208
214
  },
@@ -37,7 +37,7 @@ exports.default = void 0;
37
37
  const generateComponentTheme = theme => {
38
38
  const stacking = theme.stacking;
39
39
  const componentVariables = {
40
- zIndex: stacking?.topmost
40
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.topmost
41
41
  };
42
42
  return { ...componentVariables
43
43
  };
@@ -312,7 +312,7 @@ class PositionData {
312
312
  left = _addOffsets.left,
313
313
  top = _addOffsets.top;
314
314
 
315
- if (_canUseDOM.canUseDOM && win?.matchMedia) {
315
+ if (_canUseDOM.canUseDOM && win !== null && win !== void 0 && win.matchMedia) {
316
316
  const retina = win.matchMedia('only screen and (min-resolution: 1.3dppx)').matches || win.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3)').matches;
317
317
 
318
318
  if (!retina) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-position",
3
- "version": "8.18.0",
3
+ "version": "8.18.1-snapshot.12+ca14b3dc8",
4
4
  "description": "A component for positioning content with respect to a designated target.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,24 +24,24 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.13.10",
27
- "@instructure/debounce": "8.18.0",
28
- "@instructure/emotion": "8.18.0",
29
- "@instructure/shared-types": "8.18.0",
30
- "@instructure/ui-dom-utils": "8.18.0",
31
- "@instructure/ui-portal": "8.18.0",
32
- "@instructure/ui-prop-types": "8.18.0",
33
- "@instructure/ui-react-utils": "8.18.0",
34
- "@instructure/ui-testable": "8.18.0",
35
- "@instructure/ui-utils": "8.18.0",
36
- "@instructure/uid": "8.18.0",
27
+ "@instructure/debounce": "8.18.1-snapshot.12+ca14b3dc8",
28
+ "@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
29
+ "@instructure/shared-types": "8.18.1-snapshot.12+ca14b3dc8",
30
+ "@instructure/ui-dom-utils": "8.18.1-snapshot.12+ca14b3dc8",
31
+ "@instructure/ui-portal": "8.18.1-snapshot.12+ca14b3dc8",
32
+ "@instructure/ui-prop-types": "8.18.1-snapshot.12+ca14b3dc8",
33
+ "@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
34
+ "@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
35
+ "@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
36
+ "@instructure/uid": "8.18.1-snapshot.12+ca14b3dc8",
37
37
  "prop-types": "^15"
38
38
  },
39
39
  "devDependencies": {
40
- "@instructure/ui-babel-preset": "8.18.0",
41
- "@instructure/ui-color-utils": "8.18.0",
42
- "@instructure/ui-test-locator": "8.18.0",
43
- "@instructure/ui-test-utils": "8.18.0",
44
- "@instructure/ui-themes": "8.18.0"
40
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.12+ca14b3dc8",
41
+ "@instructure/ui-color-utils": "8.18.1-snapshot.12+ca14b3dc8",
42
+ "@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
43
+ "@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8",
44
+ "@instructure/ui-themes": "8.18.1-snapshot.12+ca14b3dc8"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=16.8 <=17"
@@ -49,5 +49,6 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "sideEffects": false
52
+ "sideEffects": false,
53
+ "gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
53
54
  }