@khanacademy/wonder-blocks-link 3.8.5 → 3.8.8

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
@@ -1,5 +1,28 @@
1
1
  # @khanacademy/wonder-blocks-link
2
2
 
3
+ ## 3.8.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ee6fc773]
8
+ - @khanacademy/wonder-blocks-clickable@2.3.0
9
+
10
+ ## 3.8.7
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [5f4a4297]
15
+ - Updated dependencies [2b96fd59]
16
+ - @khanacademy/wonder-blocks-core@4.3.2
17
+ - @khanacademy/wonder-blocks-clickable@2.2.7
18
+
19
+ ## 3.8.6
20
+
21
+ ### Patch Changes
22
+
23
+ - @khanacademy/wonder-blocks-clickable@2.2.6
24
+ - @khanacademy/wonder-blocks-core@4.3.1
25
+
3
26
  ## 3.8.5
4
27
 
5
28
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -38,15 +38,15 @@ class LinkCore extends React.Component {
38
38
  style: [defaultStyles, style]
39
39
  }, restProps);
40
40
 
41
- return router && !skipClientNav && isClientSideUrl(href) ? /*#__PURE__*/React.createElement(StyledLink, _extends({}, commonProps, {
41
+ return router && !skipClientNav && isClientSideUrl(href) ? React.createElement(StyledLink, _extends({}, commonProps, {
42
42
  to: href
43
- }), children) : /*#__PURE__*/React.createElement(StyledAnchor, _extends({}, commonProps, {
43
+ }), children) : React.createElement(StyledAnchor, _extends({}, commonProps, {
44
44
  href: href
45
45
  }), children);
46
46
  }
47
47
 
48
48
  render() {
49
- return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, router => this.renderInner(router));
49
+ return React.createElement(__RouterContext.Consumer, null, router => this.renderInner(router));
50
50
  }
51
51
 
52
52
  }
@@ -115,24 +115,6 @@ const _generateStyles = (kind, light, visitable) => {
115
115
  const _excluded = ["onClick", "beforeNav", "safeWithNav", "href", "skipClientNav", "children", "tabIndex", "onKeyDown", "onKeyUp", "target"],
116
116
  _excluded2 = ["tabIndex"],
117
117
  _excluded3 = ["tabIndex"];
118
-
119
- /**
120
- * Reusable link component.
121
- *
122
- * Consisting of a [`ClickableBehavior`](#clickablebehavior) surrounding a
123
- * `LinkCore`. `ClickableBehavior` handles interactions and state changes.
124
- * `LinkCore` is a stateless component which displays the different states
125
- * the `Link` can take.
126
- *
127
- * Example usage:
128
- * ```jsx
129
- * <Link
130
- * href="https://khanacademy.org/"
131
- * >
132
- * Label
133
- * </Link>
134
- * ```
135
- */
136
118
  class Link extends React.Component {
137
119
  renderClickableBehavior(router) {
138
120
  const _this$props = this.props,
@@ -153,7 +135,7 @@ class Link extends React.Component {
153
135
  const ClickableBehavior = getClickableBehavior(href, skipClientNav, router);
154
136
 
155
137
  if (beforeNav) {
156
- return /*#__PURE__*/React.createElement(ClickableBehavior, {
138
+ return React.createElement(ClickableBehavior, {
157
139
  disabled: false,
158
140
  href: href,
159
141
  role: "link",
@@ -168,18 +150,15 @@ class Link extends React.Component {
168
150
  } = _ref,
169
151
  childrenProps = _objectWithoutPropertiesLoose(_ref, _excluded2);
170
152
 
171
- return /*#__PURE__*/React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
153
+ return React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
172
154
  skipClientNav: skipClientNav,
173
155
  href: href,
174
- target: target // If tabIndex is provide to the component we allow
175
- // it to override the tabIndex provide to use by
176
- // ClickableBehavior.
177
- ,
156
+ target: target,
178
157
  tabIndex: tabIndex || clickableTabIndex
179
158
  }), children);
180
159
  });
181
160
  } else {
182
- return /*#__PURE__*/React.createElement(ClickableBehavior, {
161
+ return React.createElement(ClickableBehavior, {
183
162
  disabled: false,
184
163
  href: href,
185
164
  role: "link",
@@ -194,13 +173,10 @@ class Link extends React.Component {
194
173
  } = _ref2,
195
174
  childrenProps = _objectWithoutPropertiesLoose(_ref2, _excluded3);
196
175
 
197
- return /*#__PURE__*/React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
176
+ return React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
198
177
  skipClientNav: skipClientNav,
199
178
  href: href,
200
- target: target // If tabIndex is provide to the component we allow
201
- // it to override the tabIndex provide to use by
202
- // ClickableBehavior.
203
- ,
179
+ target: target,
204
180
  tabIndex: tabIndex || clickableTabIndex
205
181
  }), children);
206
182
  });
@@ -208,7 +184,7 @@ class Link extends React.Component {
208
184
  }
209
185
 
210
186
  render() {
211
- return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));
187
+ return React.createElement(__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));
212
188
  }
213
189
 
214
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-link",
3
- "version": "3.8.5",
3
+ "version": "3.8.8",
4
4
  "design": "v1",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,10 +15,10 @@
15
15
  "author": "",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@babel/runtime": "^7.16.3",
19
- "@khanacademy/wonder-blocks-clickable": "^2.2.5",
18
+ "@babel/runtime": "^7.18.6",
19
+ "@khanacademy/wonder-blocks-clickable": "^2.3.0",
20
20
  "@khanacademy/wonder-blocks-color": "^1.1.20",
21
- "@khanacademy/wonder-blocks-core": "^4.3.0"
21
+ "@khanacademy/wonder-blocks-core": "^4.3.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "aphrodite": "^1.2.5",
@@ -27,6 +27,6 @@
27
27
  "react-router-dom": "5.3.0"
28
28
  },
29
29
  "devDependencies": {
30
- "wb-dev-build-settings": "^0.3.0"
30
+ "wb-dev-build-settings": "^0.4.0"
31
31
  }
32
32
  }
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- /* eslint-disable flowtype/no-unused-expressions */
2
+ /* eslint-disable ft-flow/no-unused-expressions */
3
3
  import * as React from "react";
4
4
 
5
5
  import Link from "../link.js";
@@ -134,6 +134,8 @@ export type SharedProps =
134
134
  /**
135
135
  * A target destination window for a link to open in. We only support
136
136
  * "_blank" which opens the URL in a new tab.
137
+ *
138
+ * TODO(WB-1262): only allow this prop when `href` is also set.t
137
139
  */
138
140
  target?: "_blank",
139
141
  |}