@khanacademy/wonder-blocks-link 3.9.0 → 3.9.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
@@ -1,5 +1,18 @@
1
1
  # @khanacademy/wonder-blocks-link
2
2
 
3
+ ## 3.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 91cb727c: Remove file extensions from imports
8
+ - 91cb727c: Merge disjoint prop types since the codemod doesn't handle these properly.
9
+ - Updated dependencies [91cb727c]
10
+ - Updated dependencies [91cb727c]
11
+ - Updated dependencies [91cb727c]
12
+ - @khanacademy/wonder-blocks-clickable@2.4.5
13
+ - @khanacademy/wonder-blocks-color@1.2.1
14
+ - @khanacademy/wonder-blocks-core@4.7.0
15
+
3
16
  ## 3.9.0
4
17
 
5
18
  ### Minor Changes
@@ -1,2 +1,2 @@
1
1
  // @flow
2
- export * from "../src/index.js";
2
+ export * from "../src/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-link",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "design": "v1",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,9 +16,9 @@
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
- "@khanacademy/wonder-blocks-clickable": "^2.4.4",
20
- "@khanacademy/wonder-blocks-color": "^1.2.0",
21
- "@khanacademy/wonder-blocks-core": "^4.6.2"
19
+ "@khanacademy/wonder-blocks-clickable": "^2.4.5",
20
+ "@khanacademy/wonder-blocks-color": "^1.2.1",
21
+ "@khanacademy/wonder-blocks-core": "^4.7.0"
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.7.0"
30
+ "wb-dev-build-settings": "^0.7.1"
31
31
  }
32
32
  }
@@ -2,8 +2,8 @@
2
2
  import React from "react";
3
3
  import renderer from "react-test-renderer";
4
4
 
5
- import LinkCore from "../components/link-core.js";
6
- import Link from "../components/link.js";
5
+ import LinkCore from "../components/link-core";
6
+ import Link from "../components/link";
7
7
 
8
8
  const defaultHandlers = {
9
9
  onClick: () => void 0,
@@ -20,8 +20,8 @@ import {
20
20
  } from "@khanacademy/wonder-blocks-typography";
21
21
  import type {StoryComponentType} from "@storybook/react";
22
22
 
23
- import LinkArgTypes from "./link.argtypes.js";
24
- import ComponentInfo from "../../../../../.storybook/components/component-info.js";
23
+ import LinkArgTypes from "./link.argtypes";
24
+ import ComponentInfo from "../../../../../.storybook/components/component-info";
25
25
  import {name, version} from "../../../package.json";
26
26
 
27
27
  export default {
@@ -2,13 +2,15 @@
2
2
  /* eslint-disable ft-flow/no-unused-expressions */
3
3
  import * as React from "react";
4
4
 
5
- import Link from "../link.js";
5
+ import Link from "../link";
6
6
 
7
7
  // $FlowExpectedError[incompatible-type]: href must be used with beforeNav
8
- <Link beforeNav={() => Promise.resolve()}>Hello, world!</Link>;
8
+ // TODO(FEI-5000): Re-enable test after updating props to be conditional.
9
+ // <Link beforeNav={() => Promise.resolve()}>Hello, world!</Link>;
9
10
 
10
11
  // $FlowExpectedError[incompatible-type]: href must be used with safeWithNav
11
- <Link safeWithNav={() => Promise.resolve()}>Hello, world!</Link>;
12
+ // TODO(FEI-5000): Re-enable test after updating props to be conditional.
13
+ // <Link safeWithNav={() => Promise.resolve()}>Hello, world!</Link>;
12
14
 
13
15
  // It's okay to use onClick with href
14
16
  <Link href="/foo" onClick={() => {}}>
@@ -6,7 +6,7 @@ import userEvent from "@testing-library/user-event";
6
6
 
7
7
  import Color from "@khanacademy/wonder-blocks-color";
8
8
 
9
- import Link from "../link.js";
9
+ import Link from "../link";
10
10
 
11
11
  describe("Link", () => {
12
12
  beforeEach(() => {
@@ -13,7 +13,7 @@ import type {
13
13
  ClickableState,
14
14
  } from "@khanacademy/wonder-blocks-clickable";
15
15
  import type {StyleDeclaration} from "aphrodite";
16
- import type {SharedProps} from "./link.js";
16
+ import type {SharedProps} from "./link";
17
17
 
18
18
  type Props = {|
19
19
  ...SharedProps,
@@ -5,9 +5,10 @@ import {getClickableBehavior} from "@khanacademy/wonder-blocks-clickable";
5
5
 
6
6
  import type {AriaProps, StyleType} from "@khanacademy/wonder-blocks-core";
7
7
  import type {Typography} from "@khanacademy/wonder-blocks-typography";
8
- import LinkCore from "./link-core.js";
8
+ import LinkCore from "./link-core";
9
9
 
10
- type CommonProps = {|
10
+ // TODO(FEI-5000): Convert back to conditional props after TS migration is complete.
11
+ export type SharedProps = {|
11
12
  ...AriaProps,
12
13
 
13
14
  /**
@@ -132,38 +133,30 @@ type CommonProps = {|
132
133
  * Respond to raw "keyup" event.
133
134
  */
134
135
  onKeyUp?: (e: SyntheticKeyboardEvent<>) => mixed,
135
- |};
136
-
137
- export type SharedProps =
138
- | {|
139
- ...CommonProps,
140
136
 
141
- /**
142
- * A target destination window for a link to open in. We only support
143
- * "_blank" which opens the URL in a new tab.
144
- *
145
- * TODO(WB-1262): only allow this prop when `href` is also set.t
146
- */
147
- target?: "_blank",
148
- |}
149
- | {|
150
- ...CommonProps,
137
+ /**
138
+ * A target destination window for a link to open in. We only support
139
+ * "_blank" which opens the URL in a new tab.
140
+ *
141
+ * TODO(WB-1262): only allow this prop when `href` is also set.t
142
+ */
143
+ target?: "_blank",
151
144
 
152
- /**
153
- * Run async code before navigating to the URL passed to `href`. If the
154
- * promise returned rejects then navigation will not occur.
155
- *
156
- * If both safeWithNav and beforeNav are provided, beforeNav will be run
157
- * first and safeWithNav will only be run if beforeNav does not reject.
158
- *
159
- * WARNING: Using this with `target="_blank"` will trigger built-in popup
160
- * blockers in Firefox and Safari. This is because we do navigation
161
- * programmatically and `beforeNav` causes a delay which means that the
162
- * browser can't make a directly link between a user action and the
163
- * navigation.
164
- */
165
- beforeNav?: () => Promise<mixed>,
166
- |};
145
+ /**
146
+ * Run async code before navigating to the URL passed to `href`. If the
147
+ * promise returned rejects then navigation will not occur.
148
+ *
149
+ * If both safeWithNav and beforeNav are provided, beforeNav will be run
150
+ * first and safeWithNav will only be run if beforeNav does not reject.
151
+ *
152
+ * WARNING: Using this with `target="_blank"` will trigger built-in popup
153
+ * blockers in Firefox and Safari. This is because we do navigation
154
+ * programmatically and `beforeNav` causes a delay which means that the
155
+ * browser can't make a directly link between a user action and the
156
+ * navigation.
157
+ */
158
+ beforeNav?: () => Promise<mixed>,
159
+ |};
167
160
 
168
161
  type DefaultProps = {|
169
162
  inline: $PropertyType<SharedProps, "inline">,
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // @flow
2
- import Link from "./components/link.js";
2
+ import Link from "./components/link";
3
3
 
4
4
  export {Link as default};