@instructure/ui-pages 8.11.2-snapshot.7 → 8.12.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,10 @@
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.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-pages
9
+
6
10
  ## [8.11.1](https://github.com/instructure/instructure-ui/compare/v8.11.0...v8.11.1) (2021-10-19)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-pages
@@ -44,12 +44,14 @@ class Page extends Component {
44
44
  this.ref = null;
45
45
 
46
46
  this.handleRef = el => {
47
- this._content = el; // TODO remove and keep 'ref' in v9
48
-
49
47
  this.ref = el;
50
48
  };
51
49
  }
52
50
 
51
+ get _content() {
52
+ return this.ref;
53
+ }
54
+
53
55
  get defaultFocusElement() {
54
56
  let defaultFocusElement = this.props.defaultFocusElement;
55
57
 
@@ -62,7 +64,7 @@ class Page extends Component {
62
64
  }
63
65
 
64
66
  if (!defaultFocusElement) {
65
- const tabbable = findTabbable(this._content);
67
+ const tabbable = findTabbable(this.ref);
66
68
  defaultFocusElement = tabbable && tabbable[0];
67
69
  }
68
70
 
package/es/Pages/index.js CHANGED
@@ -47,14 +47,16 @@ category: components
47
47
  **/
48
48
 
49
49
  let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Pages extends Component {
50
+ get _contentElement() {
51
+ return this.ref;
52
+ }
53
+
50
54
  constructor(props) {
51
55
  super(props);
52
56
  this._timeouts = [];
53
57
  this.ref = null;
54
58
 
55
59
  this.handleRef = el => {
56
- this._contentElement = el; // TODO remove with v9 and keep ref
57
-
58
60
  this.ref = el;
59
61
  };
60
62
 
@@ -96,7 +98,7 @@ let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
96
98
  }
97
99
 
98
100
  get focused() {
99
- return containsActiveElement(this._contentElement);
101
+ return containsActiveElement(this.ref);
100
102
  }
101
103
 
102
104
  focus() {
@@ -107,7 +109,7 @@ let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
107
109
  activePage.focus();
108
110
  } else {
109
111
  // Use first tabbable as last ditch effort
110
- const tabbable = findTabbable(this._contentElement);
112
+ const tabbable = findTabbable(this.ref);
111
113
  const element = tabbable && tabbable[0];
112
114
  element && element.focus();
113
115
  }
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -41,12 +41,14 @@ class Page extends _react.Component {
41
41
  this.ref = null;
42
42
 
43
43
  this.handleRef = el => {
44
- this._content = el; // TODO remove and keep 'ref' in v9
45
-
46
44
  this.ref = el;
47
45
  };
48
46
  }
49
47
 
48
+ get _content() {
49
+ return this.ref;
50
+ }
51
+
50
52
  get defaultFocusElement() {
51
53
  let defaultFocusElement = this.props.defaultFocusElement;
52
54
 
@@ -59,7 +61,7 @@ class Page extends _react.Component {
59
61
  }
60
62
 
61
63
  if (!defaultFocusElement) {
62
- const tabbable = (0, _findTabbable.findTabbable)(this._content);
64
+ const tabbable = (0, _findTabbable.findTabbable)(this.ref);
63
65
  defaultFocusElement = tabbable && tabbable[0];
64
66
  }
65
67
 
@@ -53,14 +53,16 @@ category: components
53
53
 
54
54
  exports.PagesContext = PagesContext;
55
55
  let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Pages extends _react.Component {
56
+ get _contentElement() {
57
+ return this.ref;
58
+ }
59
+
56
60
  constructor(props) {
57
61
  super(props);
58
62
  this._timeouts = [];
59
63
  this.ref = null;
60
64
 
61
65
  this.handleRef = el => {
62
- this._contentElement = el; // TODO remove with v9 and keep ref
63
-
64
66
  this.ref = el;
65
67
  };
66
68
 
@@ -102,7 +104,7 @@ let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
102
104
  }
103
105
 
104
106
  get focused() {
105
- return (0, _containsActiveElement.containsActiveElement)(this._contentElement);
107
+ return (0, _containsActiveElement.containsActiveElement)(this.ref);
106
108
  }
107
109
 
108
110
  focus() {
@@ -113,7 +115,7 @@ let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
113
115
  activePage.focus();
114
116
  } else {
115
117
  // Use first tabbable as last ditch effort
116
- const tabbable = (0, _findTabbable.findTabbable)(this._contentElement);
118
+ const tabbable = (0, _findTabbable.findTabbable)(this.ref);
117
119
  const element = tabbable && tabbable[0];
118
120
  element && element.focus();
119
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pages",
3
- "version": "8.11.2-snapshot.7+2681e145a",
3
+ "version": "8.12.0",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,23 +24,23 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.11.2-snapshot.7+2681e145a",
28
- "@instructure/ui-color-utils": "8.11.2-snapshot.7+2681e145a",
29
- "@instructure/ui-test-utils": "8.11.2-snapshot.7+2681e145a",
30
- "@instructure/ui-themes": "8.11.2-snapshot.7+2681e145a"
27
+ "@instructure/ui-babel-preset": "8.12.0",
28
+ "@instructure/ui-color-utils": "8.12.0",
29
+ "@instructure/ui-test-utils": "8.12.0",
30
+ "@instructure/ui-themes": "8.12.0"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/console": "8.11.2-snapshot.7+2681e145a",
35
- "@instructure/emotion": "8.11.2-snapshot.7+2681e145a",
36
- "@instructure/shared-types": "8.11.2-snapshot.7+2681e145a",
37
- "@instructure/ui-a11y-utils": "8.11.2-snapshot.7+2681e145a",
38
- "@instructure/ui-dom-utils": "8.11.2-snapshot.7+2681e145a",
39
- "@instructure/ui-prop-types": "8.11.2-snapshot.7+2681e145a",
40
- "@instructure/ui-react-utils": "8.11.2-snapshot.7+2681e145a",
41
- "@instructure/ui-utils": "8.11.2-snapshot.7+2681e145a",
42
- "@instructure/ui-view": "8.11.2-snapshot.7+2681e145a",
43
- "@instructure/uid": "8.11.2-snapshot.7+2681e145a",
34
+ "@instructure/console": "8.12.0",
35
+ "@instructure/emotion": "8.12.0",
36
+ "@instructure/shared-types": "8.12.0",
37
+ "@instructure/ui-a11y-utils": "8.12.0",
38
+ "@instructure/ui-dom-utils": "8.12.0",
39
+ "@instructure/ui-prop-types": "8.12.0",
40
+ "@instructure/ui-react-utils": "8.12.0",
41
+ "@instructure/ui-utils": "8.12.0",
42
+ "@instructure/ui-view": "8.12.0",
43
+ "@instructure/uid": "8.12.0",
44
44
  "prop-types": "^15"
45
45
  },
46
46
  "peerDependencies": {
@@ -49,6 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "sideEffects": false,
53
- "gitHead": "2681e145ad469e1396536d3e9eed75a19995eb8a"
52
+ "sideEffects": false
54
53
  }
@@ -56,12 +56,15 @@ class Page extends Component<PagesPageProps> {
56
56
  navigateToPreviousPage: PropTypes.func
57
57
  }
58
58
 
59
+ get _content() {
60
+ console.warn('_content deprecated, please use ref instead')
61
+
62
+ return this.ref
63
+ }
64
+
59
65
  ref: Element | null = null
60
66
 
61
67
  handleRef = (el: Element | null) => {
62
- // @ts-expect-error ts-migrate(2551) FIXME: Property '_content' does not exist on type 'Page'.... Remove this comment to see the full error message
63
- this._content = el // TODO remove and keep 'ref' in v9
64
-
65
68
  this.ref = el
66
69
  }
67
70
 
@@ -77,8 +80,7 @@ class Page extends Component<PagesPageProps> {
77
80
  }
78
81
 
79
82
  if (!defaultFocusElement) {
80
- // @ts-expect-error ts-migrate(2551) FIXME:
81
- const tabbable = findTabbable(this._content)
83
+ const tabbable = findTabbable(this.ref)
82
84
  // @ts-expect-error ts-migrate(2554) FIXME:
83
85
  defaultFocusElement = tabbable && tabbable[0]
84
86
  }
@@ -66,12 +66,16 @@ class Pages extends Component<PagesProps> {
66
66
  static Page = Page
67
67
 
68
68
  _timeouts = []
69
+ get _contentElement() {
70
+ console.warn(
71
+ '_contentElement property is deprecated and will be removed in v9, please use ref instead'
72
+ )
73
+
74
+ return this.ref
75
+ }
69
76
  ref: Element | null = null
70
77
 
71
78
  handleRef = (el: Element | null) => {
72
- // @ts-expect-error ts-migrate(2339) FIXME: Property '_contentElement' does not exist on type ... Remove this comment to see the full error message
73
- this._contentElement = el // TODO remove with v9 and keep ref
74
-
75
79
  this.ref = el
76
80
  }
77
81
 
@@ -133,8 +137,7 @@ class Pages extends Component<PagesProps> {
133
137
  }
134
138
 
135
139
  get focused() {
136
- // @ts-expect-error ts-migrate(2339) FIXME: Property '_contentElement' does not exist on type ... Remove this comment to see the full error message
137
- return containsActiveElement(this._contentElement)
140
+ return containsActiveElement(this.ref)
138
141
  }
139
142
 
140
143
  focus() {
@@ -149,8 +152,7 @@ class Pages extends Component<PagesProps> {
149
152
  activePage.focus()
150
153
  } else {
151
154
  // Use first tabbable as last ditch effort
152
- // @ts-expect-error ts-migrate(2339) FIXME:
153
- const tabbable = findTabbable(this._contentElement)
155
+ const tabbable = findTabbable(this.ref)
154
156
  const element = tabbable && tabbable[0]
155
157
 
156
158
  // @ts-expect-error ts-migrate(2554) FIXME:
@@ -31,6 +31,7 @@ declare class Page extends Component<PagesPageProps> {
31
31
  history: PropTypes.Requireable<any[]>;
32
32
  navigateToPreviousPage: PropTypes.Requireable<(...args: any[]) => any>;
33
33
  };
34
+ get _content(): Element | null;
34
35
  ref: Element | null;
35
36
  handleRef: (el: Element | null) => void;
36
37
  get defaultFocusElement(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pages/Page/index.tsx"],"names":[],"mappings":"AA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ED,IAAI,mBAAmB,+GAwBtB;IAED,IAAI,SAAS,wBAKZ;IAED,KAAK;IAOL,MAAM;CAoBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -36,6 +36,7 @@ declare class Pages extends Component<PagesProps> {
36
36
  };
37
37
  static Page: typeof Page;
38
38
  _timeouts: never[];
39
+ get _contentElement(): Element | null;
39
40
  ref: Element | null;
40
41
  handleRef: (el: Element | null) => void;
41
42
  constructor(props: any);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pages/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAA;AAQrE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,eAAO,MAAM,YAAY;;;EAGvB,CAAA;AAEF;;;;GAIG;AACH,cACM,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAU;IAErC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,MAAM,CAAC,IAAI,cAAO;IAElB,SAAS,UAAK;IACd,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAK9B;gBAGW,KAAK,KAAA;IAcjB,iBAAiB;IAIjB,qBAAqB,aAOpB;IAGD,yBAAyB,CAAC,SAAS,KAAA,EAAE,WAAW,KAAA;IAchD,kBAAkB;IAUlB,oBAAoB;IAIpB,IAAI,OAAO,YAGV;IAED,KAAK;IAuBL,IAAI,UAAU,8EAkBb;IAED,MAAM;CAyBP;AAED,eAAe,KAAK,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pages/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAA;AAQrE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,eAAO,MAAM,YAAY;;;EAGvB,CAAA;AAEF;;;;GAIG;AACH,cACM,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAU;IAErC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,MAAM,CAAC,IAAI,cAAO;IAElB,SAAS,UAAK;IACd,IAAI,eAAe,mBAMlB;IACD,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;gBAGW,KAAK,KAAA;IAcjB,iBAAiB;IAIjB,qBAAqB,aAOpB;IAGD,yBAAyB,CAAC,SAAS,KAAA,EAAE,WAAW,KAAA;IAchD,kBAAkB;IAUlB,oBAAoB;IAIpB,IAAI,OAAO,YAEV;IAED,KAAK;IAsBL,IAAI,UAAU,8EAkBb;IAED,MAAM;CAyBP;AAED,eAAe,KAAK,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,IAAI,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.