@instructure/ui-link 8.10.1-snapshot.8 → 8.10.2

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
+ ## [8.10.2](https://github.com/instructure/instructure-ui/compare/v8.10.1...v8.10.2) (2021-10-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-link
9
+
10
+ ## [8.10.1](https://github.com/instructure/instructure-ui/compare/v8.10.0...v8.10.1) (2021-10-01)
11
+
12
+ **Note:** Version bump only for package @instructure/ui-link
13
+
6
14
  # [8.10.0](https://github.com/instructure/instructure-ui/compare/v8.9.1...v8.10.0) (2021-09-28)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-link
package/es/Link/index.js CHANGED
@@ -51,6 +51,8 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
51
51
  this.state = {
52
52
  hasFocus: false
53
53
  };
54
+ this._link = null;
55
+ this.ref = null;
54
56
 
55
57
  this.makeStyleProps = () => {
56
58
  return {
@@ -60,8 +62,10 @@ let Link = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
60
62
  };
61
63
 
62
64
  this.handleElementRef = el => {
63
- const elementRef = this.props.elementRef;
65
+ const elementRef = this.props.elementRef; // TODO: deprecate _link? ref should be enough
66
+
64
67
  this._link = el;
68
+ this.ref = el;
65
69
  if (typeof elementRef === 'function') elementRef(el);
66
70
  };
67
71
 
package/lib/Link/index.js CHANGED
@@ -58,6 +58,8 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
58
58
  this.state = {
59
59
  hasFocus: false
60
60
  };
61
+ this._link = null;
62
+ this.ref = null;
61
63
 
62
64
  this.makeStyleProps = () => {
63
65
  return {
@@ -67,8 +69,10 @@ let Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
67
69
  };
68
70
 
69
71
  this.handleElementRef = el => {
70
- const elementRef = this.props.elementRef;
72
+ const elementRef = this.props.elementRef; // TODO: deprecate _link? ref should be enough
73
+
71
74
  this._link = el;
75
+ this.ref = el;
72
76
  if (typeof elementRef === 'function') elementRef(el);
73
77
  };
74
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-link",
3
- "version": "8.10.1-snapshot.8+21f46f4e3",
3
+ "version": "8.10.2",
4
4
  "description": "A component for creating links",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,25 +25,25 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.10.1-snapshot.8+21f46f4e3",
29
- "@instructure/emotion": "8.10.1-snapshot.8+21f46f4e3",
30
- "@instructure/shared-types": "8.10.1-snapshot.8+21f46f4e3",
31
- "@instructure/ui-a11y-utils": "8.10.1-snapshot.8+21f46f4e3",
32
- "@instructure/ui-color-utils": "8.10.1-snapshot.8+21f46f4e3",
33
- "@instructure/ui-dom-utils": "8.10.1-snapshot.8+21f46f4e3",
34
- "@instructure/ui-icons": "8.10.1-snapshot.8+21f46f4e3",
35
- "@instructure/ui-prop-types": "8.10.1-snapshot.8+21f46f4e3",
36
- "@instructure/ui-react-utils": "8.10.1-snapshot.8+21f46f4e3",
37
- "@instructure/ui-testable": "8.10.1-snapshot.8+21f46f4e3",
38
- "@instructure/ui-view": "8.10.1-snapshot.8+21f46f4e3",
28
+ "@instructure/console": "8.10.2",
29
+ "@instructure/emotion": "8.10.2",
30
+ "@instructure/shared-types": "8.10.2",
31
+ "@instructure/ui-a11y-utils": "8.10.2",
32
+ "@instructure/ui-color-utils": "8.10.2",
33
+ "@instructure/ui-dom-utils": "8.10.2",
34
+ "@instructure/ui-icons": "8.10.2",
35
+ "@instructure/ui-prop-types": "8.10.2",
36
+ "@instructure/ui-react-utils": "8.10.2",
37
+ "@instructure/ui-testable": "8.10.2",
38
+ "@instructure/ui-view": "8.10.2",
39
39
  "prop-types": "^15"
40
40
  },
41
41
  "devDependencies": {
42
- "@instructure/ui-babel-preset": "8.10.1-snapshot.8+21f46f4e3",
43
- "@instructure/ui-test-locator": "8.10.1-snapshot.8+21f46f4e3",
44
- "@instructure/ui-test-queries": "8.10.1-snapshot.8+21f46f4e3",
45
- "@instructure/ui-test-utils": "8.10.1-snapshot.8+21f46f4e3",
46
- "@instructure/ui-themes": "8.10.1-snapshot.8+21f46f4e3"
42
+ "@instructure/ui-babel-preset": "8.10.2",
43
+ "@instructure/ui-test-locator": "8.10.2",
44
+ "@instructure/ui-test-queries": "8.10.2",
45
+ "@instructure/ui-test-utils": "8.10.2",
46
+ "@instructure/ui-themes": "8.10.2"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": ">=16.8 <=17"
@@ -51,6 +51,5 @@
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "sideEffects": false,
55
- "gitHead": "21f46f4e342898b019ab943a7e69a455621d9576"
54
+ "sideEffects": false
56
55
  }
@@ -67,6 +67,9 @@ class Link extends Component<LinkProps> {
67
67
 
68
68
  state = { hasFocus: false }
69
69
 
70
+ _link: Element | null = null
71
+ ref: Element | null = null
72
+
70
73
  componentDidMount() {
71
74
  // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
72
75
  this.props.makeStyles(this.makeStyleProps())
@@ -89,8 +92,9 @@ class Link extends Component<LinkProps> {
89
92
  handleElementRef = (el) => {
90
93
  const { elementRef } = this.props
91
94
 
92
- // @ts-expect-error ts-migrate(2339) FIXME: Property '_link' does not exist on type 'Link'.
95
+ // TODO: deprecate _link? ref should be enough
93
96
  this._link = el
97
+ this.ref = el
94
98
  if (typeof elementRef === 'function') elementRef(el)
95
99
  }
96
100
 
@@ -164,12 +168,10 @@ class Link extends Component<LinkProps> {
164
168
  }
165
169
 
166
170
  get focused() {
167
- // @ts-expect-error ts-migrate(2339) FIXME: Property '_link' does not exist on type 'Link'.
168
171
  return isActiveElement(this._link)
169
172
  }
170
173
 
171
174
  get focusable() {
172
- // @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1.
173
175
  return findFocusable(this._link)
174
176
  }
175
177
 
package/src/Link/props.ts CHANGED
@@ -42,7 +42,7 @@ type LinkOwnProps = {
42
42
  children: React.ReactNode
43
43
  href?: string
44
44
  color?: 'link' | 'link-inverse'
45
- elementRef?: (...args: any[]) => any
45
+ elementRef?: (element: Element | null) => void
46
46
  as?: AsElementType
47
47
  interaction?: 'enabled' | 'disabled'
48
48
  margin?: Spacing
@@ -13,7 +13,7 @@ declare class Link extends Component<LinkProps> {
13
13
  children: React.ReactNode;
14
14
  href?: string | undefined;
15
15
  color?: "link" | "link-inverse" | undefined;
16
- elementRef?: ((...args: any[]) => any) | undefined;
16
+ elementRef?: ((element: Element | null) => void) | undefined;
17
17
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
18
18
  interaction?: "enabled" | "disabled" | undefined;
19
19
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
@@ -29,7 +29,7 @@ declare class Link extends Component<LinkProps> {
29
29
  children: React.ReactNode;
30
30
  href?: string | undefined;
31
31
  color?: "link" | "link-inverse" | undefined;
32
- elementRef?: ((...args: any[]) => any) | undefined;
32
+ elementRef?: ((element: Element | null) => void) | undefined;
33
33
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
34
34
  interaction?: "enabled" | "disabled" | undefined;
35
35
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
@@ -50,6 +50,8 @@ declare class Link extends Component<LinkProps> {
50
50
  state: {
51
51
  hasFocus: boolean;
52
52
  };
53
+ _link: Element | null;
54
+ ref: Element | null;
53
55
  componentDidMount(): void;
54
56
  componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
55
57
  makeStyleProps: () => LinkStyleProps;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Link/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAexC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExD;;;;GAIG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAMT;IAEV,KAAK;;MAAsB;IAE3B,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,cAAc,QAAO,cAAc,CAKlC;IAGD,gBAAgB,oBAMf;IAGD,WAAW,uBAUV;IAGD,WAAW,uBAKV;IAGD,UAAU,uBAKT;IAED,IAAI,oBAAoB,YAgBvB;IAED,IAAI,OAAO,+DAYV;IAED,IAAI,WAAW,0DAEd;IAED,IAAI,OAAO,wEAEV;IAED,IAAI,OAAO,YAGV;IAED,IAAI,SAAS,cAGZ;IAED,IAAI,kBAAkB,YAErB;IAED,KAAK;IAKL,UAAU;IAaV,MAAM;CA+CP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Link/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAexC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExD;;;;GAIG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAMT;IAEV,KAAK;;MAAsB;IAE3B,KAAK,EAAE,OAAO,GAAG,IAAI,CAAO;IAC5B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,cAAc,QAAO,cAAc,CAKlC;IAGD,gBAAgB,oBAOf;IAGD,WAAW,uBAUV;IAGD,WAAW,uBAKV;IAGD,UAAU,uBAKT;IAED,IAAI,oBAAoB,YAgBvB;IAED,IAAI,OAAO,+DAYV;IAED,IAAI,WAAW,0DAEd;IAED,IAAI,OAAO,wEAEV;IAED,IAAI,OAAO,YAEV;IAED,IAAI,SAAS,cAEZ;IAED,IAAI,kBAAkB,YAErB;IAED,KAAK;IAKL,UAAU;IAaV,MAAM;CA+CP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -5,7 +5,7 @@ declare type LinkOwnProps = {
5
5
  children: React.ReactNode;
6
6
  href?: string;
7
7
  color?: 'link' | 'link-inverse';
8
- elementRef?: (...args: any[]) => any;
8
+ elementRef?: (element: Element | null) => void;
9
9
  as?: AsElementType;
10
10
  interaction?: 'enabled' | 'disabled';
11
11
  margin?: Spacing;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Link/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;A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;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CACjC,CAAA;AAED,oBAAY,cAAc,GAAG;IAC3B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAEpE,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;AAEhD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAkEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,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.