@khanacademy/wonder-blocks-link 3.8.12 → 3.8.14

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,20 @@
1
1
  # @khanacademy/wonder-blocks-link
2
2
 
3
+ ## 3.8.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4c682709]
8
+ - @khanacademy/wonder-blocks-clickable@2.4.1
9
+
10
+ ## 3.8.13
11
+
12
+ ### Patch Changes
13
+
14
+ - ceb111df: ClickableBehavior no longer has tabIndex 0 by default. It must be passed in.
15
+ - Updated dependencies [ceb111df]
16
+ - @khanacademy/wonder-blocks-clickable@2.4.0
17
+
3
18
  ## 3.8.12
4
19
 
5
20
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -112,9 +112,7 @@ const _generateStyles = (kind, light, visitable) => {
112
112
  return styles[buttonType];
113
113
  };
114
114
 
115
- const _excluded = ["onClick", "beforeNav", "safeWithNav", "href", "skipClientNav", "children", "tabIndex", "onKeyDown", "onKeyUp", "target"],
116
- _excluded2 = ["tabIndex"],
117
- _excluded3 = ["tabIndex"];
115
+ const _excluded = ["onClick", "beforeNav", "safeWithNav", "href", "skipClientNav", "children", "tabIndex", "onKeyDown", "onKeyUp", "target"];
118
116
  class Link extends React.Component {
119
117
  renderClickableBehavior(router) {
120
118
  const _this$props = this.props,
@@ -145,16 +143,13 @@ class Link extends React.Component {
145
143
  onKeyDown: onKeyDown,
146
144
  onKeyUp: onKeyUp
147
145
  }, (state, _ref) => {
148
- let {
149
- tabIndex: clickableTabIndex
150
- } = _ref,
151
- childrenProps = _objectWithoutPropertiesLoose(_ref, _excluded2);
146
+ let childrenProps = _extends({}, _ref);
152
147
 
153
148
  return React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
154
149
  skipClientNav: skipClientNav,
155
150
  href: href,
156
151
  target: target,
157
- tabIndex: tabIndex || clickableTabIndex
152
+ tabIndex: tabIndex
158
153
  }), children);
159
154
  });
160
155
  } else {
@@ -168,16 +163,13 @@ class Link extends React.Component {
168
163
  onKeyDown: onKeyDown,
169
164
  onKeyUp: onKeyUp
170
165
  }, (state, _ref2) => {
171
- let {
172
- tabIndex: clickableTabIndex
173
- } = _ref2,
174
- childrenProps = _objectWithoutPropertiesLoose(_ref2, _excluded3);
166
+ let childrenProps = _extends({}, _ref2);
175
167
 
176
168
  return React.createElement(LinkCore, _extends({}, sharedProps, state, childrenProps, {
177
169
  skipClientNav: skipClientNav,
178
170
  href: href,
179
171
  target: target,
180
- tabIndex: tabIndex || clickableTabIndex
172
+ tabIndex: tabIndex
181
173
  }), children);
182
174
  });
183
175
  }
package/dist/index.js CHANGED
@@ -105,19 +105,16 @@ function _extends() {
105
105
  module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
106
106
  for (var i = 1; i < arguments.length; i++) {
107
107
  var source = arguments[i];
108
-
109
108
  for (var key in source) {
110
109
  if (Object.prototype.hasOwnProperty.call(source, key)) {
111
110
  target[key] = source[key];
112
111
  }
113
112
  }
114
113
  }
115
-
116
114
  return target;
117
115
  }, module.exports.__esModule = true, module.exports["default"] = module.exports;
118
116
  return _extends.apply(this, arguments);
119
117
  }
120
-
121
118
  module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
122
119
 
123
120
  /***/ }),
@@ -345,18 +342,13 @@ class Link extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
345
342
  safeWithNav: safeWithNav,
346
343
  onKeyDown: onKeyDown,
347
344
  onKeyUp: onKeyUp
348
- }, (state, {
349
- tabIndex: clickableTabIndex,
350
- ...childrenProps
345
+ }, (state, { ...childrenProps
351
346
  }) => {
352
347
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_link_core_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedProps, state, childrenProps, {
353
348
  skipClientNav: skipClientNav,
354
349
  href: href,
355
- target: target // If tabIndex is provide to the component we allow
356
- // it to override the tabIndex provide to use by
357
- // ClickableBehavior.
358
- ,
359
- tabIndex: tabIndex || clickableTabIndex
350
+ target: target,
351
+ tabIndex: tabIndex
360
352
  }), children);
361
353
  });
362
354
  } else {
@@ -369,18 +361,13 @@ class Link extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
369
361
  target: target,
370
362
  onKeyDown: onKeyDown,
371
363
  onKeyUp: onKeyUp
372
- }, (state, {
373
- tabIndex: clickableTabIndex,
374
- ...childrenProps
364
+ }, (state, { ...childrenProps
375
365
  }) => {
376
366
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_link_core_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedProps, state, childrenProps, {
377
367
  skipClientNav: skipClientNav,
378
368
  href: href,
379
- target: target // If tabIndex is provide to the component we allow
380
- // it to override the tabIndex provide to use by
381
- // ClickableBehavior.
382
- ,
383
- tabIndex: tabIndex || clickableTabIndex
369
+ target: target,
370
+ tabIndex: tabIndex
384
371
  }), children);
385
372
  });
386
373
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-link",
3
- "version": "3.8.12",
3
+ "version": "3.8.14",
4
4
  "design": "v1",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,7 +16,7 @@
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
- "@khanacademy/wonder-blocks-clickable": "^2.3.3",
19
+ "@khanacademy/wonder-blocks-clickable": "^2.4.1",
20
20
  "@khanacademy/wonder-blocks-color": "^1.2.0",
21
21
  "@khanacademy/wonder-blocks-core": "^4.5.0"
22
22
  },
@@ -6,7 +6,6 @@ exports[`Link <Link tabIndex={-1}> 1`] = `
6
6
  href="#"
7
7
  onBlur={[Function]}
8
8
  onClick={[Function]}
9
- onDragStart={[Function]}
10
9
  onFocus={[Function]}
11
10
  onKeyDown={[Function]}
12
11
  onKeyUp={[Function]}
@@ -37,7 +36,6 @@ exports[`Link <Link tabIndex={0}> 1`] = `
37
36
  href="#"
38
37
  onBlur={[Function]}
39
38
  onClick={[Function]}
40
- onDragStart={[Function]}
41
39
  onFocus={[Function]}
42
40
  onKeyDown={[Function]}
43
41
  onKeyUp={[Function]}
@@ -68,7 +66,6 @@ exports[`Link <Link tabIndex={1}> 1`] = `
68
66
  href="#"
69
67
  onBlur={[Function]}
70
68
  onClick={[Function]}
71
- onDragStart={[Function]}
72
69
  onFocus={[Function]}
73
70
  onKeyDown={[Function]}
74
71
  onKeyUp={[Function]}
@@ -99,7 +96,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:false focused 1`] =
99
96
  href="#"
100
97
  onBlur={[Function]}
101
98
  onClick={[Function]}
102
- onDragStart={[Function]}
103
99
  onFocus={[Function]}
104
100
  onKeyDown={[Function]}
105
101
  onKeyUp={[Function]}
@@ -130,7 +126,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:false hovered 1`] =
130
126
  href="#"
131
127
  onBlur={[Function]}
132
128
  onClick={[Function]}
133
- onDragStart={[Function]}
134
129
  onFocus={[Function]}
135
130
  onKeyDown={[Function]}
136
131
  onKeyUp={[Function]}
@@ -161,7 +156,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:false pressed 1`] =
161
156
  href="#"
162
157
  onBlur={[Function]}
163
158
  onClick={[Function]}
164
- onDragStart={[Function]}
165
159
  onFocus={[Function]}
166
160
  onKeyDown={[Function]}
167
161
  onKeyUp={[Function]}
@@ -192,7 +186,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:true focused 1`] = `
192
186
  href="#"
193
187
  onBlur={[Function]}
194
188
  onClick={[Function]}
195
- onDragStart={[Function]}
196
189
  onFocus={[Function]}
197
190
  onKeyDown={[Function]}
198
191
  onKeyUp={[Function]}
@@ -226,7 +219,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:true hovered 1`] = `
226
219
  href="#"
227
220
  onBlur={[Function]}
228
221
  onClick={[Function]}
229
- onDragStart={[Function]}
230
222
  onFocus={[Function]}
231
223
  onKeyDown={[Function]}
232
224
  onKeyUp={[Function]}
@@ -260,7 +252,6 @@ exports[`LinkCore kind:primary href:# light:false visitable:true pressed 1`] = `
260
252
  href="#"
261
253
  onBlur={[Function]}
262
254
  onClick={[Function]}
263
- onDragStart={[Function]}
264
255
  onFocus={[Function]}
265
256
  onKeyDown={[Function]}
266
257
  onKeyUp={[Function]}
@@ -294,7 +285,6 @@ exports[`LinkCore kind:primary href:# light:true visitable:false focused 1`] = `
294
285
  href="#"
295
286
  onBlur={[Function]}
296
287
  onClick={[Function]}
297
- onDragStart={[Function]}
298
288
  onFocus={[Function]}
299
289
  onKeyDown={[Function]}
300
290
  onKeyUp={[Function]}
@@ -325,7 +315,6 @@ exports[`LinkCore kind:primary href:# light:true visitable:false hovered 1`] = `
325
315
  href="#"
326
316
  onBlur={[Function]}
327
317
  onClick={[Function]}
328
- onDragStart={[Function]}
329
318
  onFocus={[Function]}
330
319
  onKeyDown={[Function]}
331
320
  onKeyUp={[Function]}
@@ -356,7 +345,6 @@ exports[`LinkCore kind:primary href:# light:true visitable:false pressed 1`] = `
356
345
  href="#"
357
346
  onBlur={[Function]}
358
347
  onClick={[Function]}
359
- onDragStart={[Function]}
360
348
  onFocus={[Function]}
361
349
  onKeyDown={[Function]}
362
350
  onKeyUp={[Function]}
@@ -387,7 +375,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:fal
387
375
  href="#"
388
376
  onBlur={[Function]}
389
377
  onClick={[Function]}
390
- onDragStart={[Function]}
391
378
  onFocus={[Function]}
392
379
  onKeyDown={[Function]}
393
380
  onKeyUp={[Function]}
@@ -418,7 +405,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:fal
418
405
  href="#"
419
406
  onBlur={[Function]}
420
407
  onClick={[Function]}
421
- onDragStart={[Function]}
422
408
  onFocus={[Function]}
423
409
  onKeyDown={[Function]}
424
410
  onKeyUp={[Function]}
@@ -449,7 +435,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:fal
449
435
  href="#"
450
436
  onBlur={[Function]}
451
437
  onClick={[Function]}
452
- onDragStart={[Function]}
453
438
  onFocus={[Function]}
454
439
  onKeyDown={[Function]}
455
440
  onKeyUp={[Function]}
@@ -480,7 +465,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:tru
480
465
  href="#"
481
466
  onBlur={[Function]}
482
467
  onClick={[Function]}
483
- onDragStart={[Function]}
484
468
  onFocus={[Function]}
485
469
  onKeyDown={[Function]}
486
470
  onKeyUp={[Function]}
@@ -514,7 +498,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:tru
514
498
  href="#"
515
499
  onBlur={[Function]}
516
500
  onClick={[Function]}
517
- onDragStart={[Function]}
518
501
  onFocus={[Function]}
519
502
  onKeyDown={[Function]}
520
503
  onKeyUp={[Function]}
@@ -548,7 +531,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:false visitable:tru
548
531
  href="#"
549
532
  onBlur={[Function]}
550
533
  onClick={[Function]}
551
- onDragStart={[Function]}
552
534
  onFocus={[Function]}
553
535
  onKeyDown={[Function]}
554
536
  onKeyUp={[Function]}
@@ -582,7 +564,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:true visitable:fals
582
564
  href="#"
583
565
  onBlur={[Function]}
584
566
  onClick={[Function]}
585
- onDragStart={[Function]}
586
567
  onFocus={[Function]}
587
568
  onKeyDown={[Function]}
588
569
  onKeyUp={[Function]}
@@ -613,7 +594,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:true visitable:fals
613
594
  href="#"
614
595
  onBlur={[Function]}
615
596
  onClick={[Function]}
616
- onDragStart={[Function]}
617
597
  onFocus={[Function]}
618
598
  onKeyDown={[Function]}
619
599
  onKeyUp={[Function]}
@@ -644,7 +624,6 @@ exports[`LinkCore kind:primary href:#non-existent-link light:true visitable:fals
644
624
  href="#"
645
625
  onBlur={[Function]}
646
626
  onClick={[Function]}
647
- onDragStart={[Function]}
648
627
  onFocus={[Function]}
649
628
  onKeyDown={[Function]}
650
629
  onKeyUp={[Function]}
@@ -675,7 +654,6 @@ exports[`LinkCore kind:secondary href:# light:false visitable:false focused 1`]
675
654
  href="#"
676
655
  onBlur={[Function]}
677
656
  onClick={[Function]}
678
- onDragStart={[Function]}
679
657
  onFocus={[Function]}
680
658
  onKeyDown={[Function]}
681
659
  onKeyUp={[Function]}
@@ -706,7 +684,6 @@ exports[`LinkCore kind:secondary href:# light:false visitable:false hovered 1`]
706
684
  href="#"
707
685
  onBlur={[Function]}
708
686
  onClick={[Function]}
709
- onDragStart={[Function]}
710
687
  onFocus={[Function]}
711
688
  onKeyDown={[Function]}
712
689
  onKeyUp={[Function]}
@@ -737,7 +714,6 @@ exports[`LinkCore kind:secondary href:# light:false visitable:false pressed 1`]
737
714
  href="#"
738
715
  onBlur={[Function]}
739
716
  onClick={[Function]}
740
- onDragStart={[Function]}
741
717
  onFocus={[Function]}
742
718
  onKeyDown={[Function]}
743
719
  onKeyUp={[Function]}
@@ -768,7 +744,6 @@ exports[`LinkCore kind:secondary href:#non-existent-link light:false visitable:f
768
744
  href="#"
769
745
  onBlur={[Function]}
770
746
  onClick={[Function]}
771
- onDragStart={[Function]}
772
747
  onFocus={[Function]}
773
748
  onKeyDown={[Function]}
774
749
  onKeyUp={[Function]}
@@ -799,7 +774,6 @@ exports[`LinkCore kind:secondary href:#non-existent-link light:false visitable:f
799
774
  href="#"
800
775
  onBlur={[Function]}
801
776
  onClick={[Function]}
802
- onDragStart={[Function]}
803
777
  onFocus={[Function]}
804
778
  onKeyDown={[Function]}
805
779
  onKeyUp={[Function]}
@@ -830,7 +804,6 @@ exports[`LinkCore kind:secondary href:#non-existent-link light:false visitable:f
830
804
  href="#"
831
805
  onBlur={[Function]}
832
806
  onClick={[Function]}
833
- onDragStart={[Function]}
834
807
  onFocus={[Function]}
835
808
  onKeyDown={[Function]}
836
809
  onKeyUp={[Function]}
@@ -11,7 +11,6 @@ const defaultHandlers = {
11
11
  onMouseLeave: () => void 0,
12
12
  onMouseDown: () => void 0,
13
13
  onMouseUp: () => void 0,
14
- onDragStart: () => void 0,
15
14
  onTouchStart: () => void 0,
16
15
  onTouchEnd: () => void 0,
17
16
  onTouchCancel: () => void 0,
@@ -222,10 +222,7 @@ export default class Link extends React.Component<SharedProps> {
222
222
  onKeyDown={onKeyDown}
223
223
  onKeyUp={onKeyUp}
224
224
  >
225
- {(
226
- state,
227
- {tabIndex: clickableTabIndex, ...childrenProps},
228
- ) => {
225
+ {(state, {...childrenProps}) => {
229
226
  return (
230
227
  <LinkCore
231
228
  {...sharedProps}
@@ -234,10 +231,7 @@ export default class Link extends React.Component<SharedProps> {
234
231
  skipClientNav={skipClientNav}
235
232
  href={href}
236
233
  target={target}
237
- // If tabIndex is provide to the component we allow
238
- // it to override the tabIndex provide to use by
239
- // ClickableBehavior.
240
- tabIndex={tabIndex || clickableTabIndex}
234
+ tabIndex={tabIndex}
241
235
  >
242
236
  {children}
243
237
  </LinkCore>
@@ -257,10 +251,7 @@ export default class Link extends React.Component<SharedProps> {
257
251
  onKeyDown={onKeyDown}
258
252
  onKeyUp={onKeyUp}
259
253
  >
260
- {(
261
- state,
262
- {tabIndex: clickableTabIndex, ...childrenProps},
263
- ) => {
254
+ {(state, {...childrenProps}) => {
264
255
  return (
265
256
  <LinkCore
266
257
  {...sharedProps}
@@ -269,10 +260,7 @@ export default class Link extends React.Component<SharedProps> {
269
260
  skipClientNav={skipClientNav}
270
261
  href={href}
271
262
  target={target}
272
- // If tabIndex is provide to the component we allow
273
- // it to override the tabIndex provide to use by
274
- // ClickableBehavior.
275
- tabIndex={tabIndex || clickableTabIndex}
263
+ tabIndex={tabIndex}
276
264
  >
277
265
  {children}
278
266
  </LinkCore>