@atlaskit/link-picker 1.7.1 → 1.8.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
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
8
+
9
+ ## 1.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`afd2368145a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/afd2368145a) - Added link picker mount/unmount analytic events
14
+
15
+ ## 1.8.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`89fffde2a59`](https://bitbucket.org/atlassian/atlassian-frontend/commits/89fffde2a59) - Wrap link picker in native form element
20
+
3
21
  ## 1.7.1
4
22
 
5
23
  ### Patch Changes
@@ -10,16 +10,16 @@ exports.default = void 0;
10
10
  *
11
11
  * Generates analytics utilities from the package analytics spec yaml
12
12
  *
13
- * @codegen <<SignedSource::0cc1b4d9c22b31491ded3e581114ab2c>>
13
+ * @codegen <<SignedSource::ffa7ec78cc793f941d06cdb25b07dc8a>>
14
14
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
15
15
  */
16
16
  function createEventPayload(eventKey, attributes) {
17
17
  var event = eventKey.split('.');
18
18
  return {
19
- eventType: 'ui',
20
- actionSubject: event[0],
21
- action: event[1],
22
- actionSubjectId: event[2],
19
+ eventType: event[0],
20
+ actionSubject: event[1],
21
+ action: event[2],
22
+ actionSubjectId: event[3],
23
23
  attributes: attributes
24
24
  };
25
25
  }
@@ -154,6 +154,16 @@ function LinkPicker(_ref) {
154
154
  var isEditing = !!initUrl;
155
155
  var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
156
156
  var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
157
+ (0, _react.useEffect)(function () {
158
+ // Anything in here is fired on component mount.
159
+ var event = createAnalyticsEvent((0, _analytics.default)('ui.inlineDialog.viewed.linkPicker', {}));
160
+ event.fire(_constants.ANALYTICS_CHANNEL);
161
+ return function () {
162
+ // Anything in here is fired on component unmount.
163
+ var event = createAnalyticsEvent((0, _analytics.default)('ui.inlineDialog.closed.linkPicker', {}));
164
+ event.fire(_constants.ANALYTICS_CHANNEL);
165
+ };
166
+ }, [createAnalyticsEvent]);
157
167
  (0, _react.useLayoutEffect)(function () {
158
168
  if (onContentResize) {
159
169
  onContentResize();
@@ -226,7 +236,7 @@ function LinkPicker(_ref) {
226
236
  }
227
237
  }, [activeIndex, items]);
228
238
  var handleInsert = (0, _react.useCallback)(function (url, title, inputType) {
229
- var event = createAnalyticsEvent((0, _analytics.default)('form.submitted.linkPicker', {}));
239
+ var event = createAnalyticsEvent((0, _analytics.default)('ui.form.submitted.linkPicker', {}));
230
240
  event.fire(_constants.ANALYTICS_CHANNEL);
231
241
  onSubmit(_objectSpread({
232
242
  url: url,
@@ -247,10 +257,13 @@ function LinkPicker(_ref) {
247
257
  if (selectedItem) {
248
258
  var _url = selectedItem.url,
249
259
  name = selectedItem.name;
260
+ dispatchEvent(new Event('submit'));
250
261
  handleInsert(_url, name, 'typeAhead');
251
262
  }
252
263
  }, [handleInsert, items]);
253
- var handleSubmit = (0, _react.useCallback)(function () {
264
+ var handleSubmit = (0, _react.useCallback)(function (event) {
265
+ event.preventDefault();
266
+
254
267
  if (isSelectedItem && selectedItem) {
255
268
  return handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
256
269
  }
@@ -283,9 +296,10 @@ function LinkPicker(_ref) {
283
296
  size: "medium",
284
297
  label: ''
285
298
  }));
286
- return (0, _react2.jsx)("div", {
299
+ return (0, _react2.jsx)("form", {
287
300
  "data-testid": testIds.linkPicker,
288
- css: _styled.rootContainerStyles
301
+ css: _styled.rootContainerStyles,
302
+ onSubmit: handleSubmit
289
303
  }, screenReaderText && (0, _react2.jsx)(_announcer.default, {
290
304
  ariaLive: "assertive",
291
305
  text: screenReaderText,
@@ -311,7 +325,6 @@ function LinkPicker(_ref) {
311
325
  "aria-describedby": screenReaderDescriptionId,
312
326
  error: invalidUrl ? intl.formatMessage(_messages.messages.linkInvalid) : null,
313
327
  onClear: handleClear,
314
- onSubmit: handleSubmit,
315
328
  onKeyDown: handleKeyDown,
316
329
  onChange: handleChangeUrl
317
330
  }), (0, _react2.jsx)(_textInput.default, {
@@ -324,7 +337,6 @@ function LinkPicker(_ref) {
324
337
  clearLabel: intl.formatMessage(_messages.messages.clearText),
325
338
  "aria-label": intl.formatMessage(_messages.messages.linkAriaLabel),
326
339
  onClear: handleClear,
327
- onSubmit: handleSubmit,
328
340
  onKeyDown: handleKeyDown,
329
341
  onChange: handleChangeText
330
342
  }), queryState && (0, _react2.jsx)(_react.Fragment, null, tabs.length > 0 && (0, _react2.jsx)("div", {
@@ -398,7 +410,6 @@ function LinkPicker(_ref) {
398
410
  }, intl.formatMessage(_messages.messages.cancelButton)), (0, _react2.jsx)(_button.default, {
399
411
  type: "submit",
400
412
  appearance: "primary",
401
- onClick: handleSubmit,
402
413
  testId: testIds.insertButton
403
414
  }, intl.formatMessage(insertButtonMsg)))));
404
415
  }
@@ -29,13 +29,12 @@ var _styled = require("./styled");
29
29
 
30
30
  var _ = require("../");
31
31
 
32
- var _excluded = ["name", "label", "autoFocus", "onSubmit", "onRedo", "onUndo", "onChange", "onKeyDown", "onClear", "clearLabel", "error"];
32
+ var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onChange", "onKeyDown", "onClear", "clearLabel", "error"];
33
33
 
34
34
  var PanelTextInput = function PanelTextInput(props) {
35
35
  var name = props.name,
36
36
  label = props.label,
37
37
  autoFocus = props.autoFocus,
38
- onSubmit = props.onSubmit,
39
38
  onRedo = props.onRedo,
40
39
  onUndo = props.onUndo,
41
40
  onChange = props.onChange,
@@ -61,13 +60,7 @@ var PanelTextInput = function PanelTextInput(props) {
61
60
  onChange(e.currentTarget.value);
62
61
  }, [onChange]);
63
62
  var handleKeydown = (0, _react.useCallback)(function (e) {
64
- var value = e.currentTarget.value;
65
-
66
- if (e.keyCode === 13 && onSubmit) {
67
- e.preventDefault(); // Prevent from submitting if an editor is inside a form.
68
-
69
- onSubmit(value);
70
- } else if (typeof onUndo === 'function' && (0, _utils.isUndoEvent)(e)) {
63
+ if (typeof onUndo === 'function' && (0, _utils.isUndoEvent)(e)) {
71
64
  e.preventDefault();
72
65
  onUndo();
73
66
  } else if (typeof onRedo === 'function' && (0, _utils.isRedoEvent)(e)) {
@@ -78,7 +71,7 @@ var PanelTextInput = function PanelTextInput(props) {
78
71
  if (onKeyDown) {
79
72
  onKeyDown(e);
80
73
  }
81
- }, [onSubmit, onUndo, onRedo, onKeyDown]);
74
+ }, [onUndo, onRedo, onKeyDown]);
82
75
  var handleClear = (0, _react.useCallback)(function () {
83
76
  if (inputRef.current && onClear) {
84
77
  inputRef.current.focus();
@@ -88,6 +81,7 @@ var PanelTextInput = function PanelTextInput(props) {
88
81
  var clearText = restProps.value !== '' && (0, _react2.jsx)(_tooltip.default, {
89
82
  content: clearLabel
90
83
  }, (0, _react2.jsx)("button", {
84
+ type: "button",
91
85
  css: _styled.clearTextButtonStyles,
92
86
  onClick: handleClear,
93
87
  "data-testid": _.testIds.clearUrlButton
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.7.1",
3
+ "version": "1.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::0cc1b4d9c22b31491ded3e581114ab2c>>
6
+ * @codegen <<SignedSource::ffa7ec78cc793f941d06cdb25b07dc8a>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
10
10
  const event = eventKey.split('.');
11
11
  return {
12
- eventType: 'ui',
13
- actionSubject: event[0],
14
- action: event[1],
15
- actionSubjectId: event[2],
12
+ eventType: event[0],
13
+ actionSubject: event[1],
14
+ action: event[2],
15
+ actionSubjectId: event[3],
16
16
  attributes: attributes
17
17
  };
18
18
  }
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
- import { Fragment, useCallback, useLayoutEffect, useReducer } from 'react';
4
+ import { Fragment, useCallback, useEffect, useLayoutEffect, useReducer } from 'react';
5
5
  import { jsx } from '@emotion/react';
6
6
  import { useIntl, FormattedMessage } from 'react-intl-next';
7
7
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
@@ -106,6 +106,16 @@ function LinkPicker({
106
106
  const isEditing = !!initUrl;
107
107
  const selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
108
108
  const isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
109
+ useEffect(() => {
110
+ // Anything in here is fired on component mount.
111
+ const event = createAnalyticsEvent(createEventPayload('ui.inlineDialog.viewed.linkPicker', {}));
112
+ event.fire(ANALYTICS_CHANNEL);
113
+ return () => {
114
+ // Anything in here is fired on component unmount.
115
+ const event = createAnalyticsEvent(createEventPayload('ui.inlineDialog.closed.linkPicker', {}));
116
+ event.fire(ANALYTICS_CHANNEL);
117
+ };
118
+ }, [createAnalyticsEvent]);
109
119
  useLayoutEffect(() => {
110
120
  if (onContentResize) {
111
121
  onContentResize();
@@ -178,7 +188,7 @@ function LinkPicker({
178
188
  }
179
189
  }, [activeIndex, items]);
180
190
  const handleInsert = useCallback((url, title, inputType) => {
181
- const event = createAnalyticsEvent(createEventPayload('form.submitted.linkPicker', {}));
191
+ const event = createAnalyticsEvent(createEventPayload('ui.form.submitted.linkPicker', {}));
182
192
  event.fire(ANALYTICS_CHANNEL);
183
193
  onSubmit({
184
194
  url,
@@ -200,10 +210,13 @@ function LinkPicker({
200
210
  url,
201
211
  name
202
212
  } = selectedItem;
213
+ dispatchEvent(new Event('submit'));
203
214
  handleInsert(url, name, 'typeAhead');
204
215
  }
205
216
  }, [handleInsert, items]);
206
- const handleSubmit = useCallback(() => {
217
+ const handleSubmit = useCallback(event => {
218
+ event.preventDefault();
219
+
207
220
  if (isSelectedItem && selectedItem) {
208
221
  return handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
209
222
  }
@@ -236,9 +249,10 @@ function LinkPicker({
236
249
  size: "medium",
237
250
  label: ''
238
251
  }));
239
- return jsx("div", {
252
+ return jsx("form", {
240
253
  "data-testid": testIds.linkPicker,
241
- css: rootContainerStyles
254
+ css: rootContainerStyles,
255
+ onSubmit: handleSubmit
242
256
  }, screenReaderText && jsx(Announcer, {
243
257
  ariaLive: "assertive",
244
258
  text: screenReaderText,
@@ -264,7 +278,6 @@ function LinkPicker({
264
278
  "aria-describedby": screenReaderDescriptionId,
265
279
  error: invalidUrl ? intl.formatMessage(messages.linkInvalid) : null,
266
280
  onClear: handleClear,
267
- onSubmit: handleSubmit,
268
281
  onKeyDown: handleKeyDown,
269
282
  onChange: handleChangeUrl
270
283
  }), jsx(PanelTextInput, {
@@ -277,7 +290,6 @@ function LinkPicker({
277
290
  clearLabel: intl.formatMessage(messages.clearText),
278
291
  "aria-label": intl.formatMessage(messages.linkAriaLabel),
279
292
  onClear: handleClear,
280
- onSubmit: handleSubmit,
281
293
  onKeyDown: handleKeyDown,
282
294
  onChange: handleChangeText
283
295
  }), queryState && jsx(Fragment, null, tabs.length > 0 && jsx("div", {
@@ -345,7 +357,6 @@ function LinkPicker({
345
357
  }, intl.formatMessage(messages.cancelButton)), jsx(Button, {
346
358
  type: "submit",
347
359
  appearance: "primary",
348
- onClick: handleSubmit,
349
360
  testId: testIds.insertButton
350
361
  }, intl.formatMessage(insertButtonMsg)))));
351
362
  }
@@ -16,7 +16,6 @@ const PanelTextInput = props => {
16
16
  name,
17
17
  label,
18
18
  autoFocus,
19
- onSubmit,
20
19
  onRedo,
21
20
  onUndo,
22
21
  onChange,
@@ -43,13 +42,7 @@ const PanelTextInput = props => {
43
42
  onChange(e.currentTarget.value);
44
43
  }, [onChange]);
45
44
  const handleKeydown = useCallback(e => {
46
- const value = e.currentTarget.value;
47
-
48
- if (e.keyCode === 13 && onSubmit) {
49
- e.preventDefault(); // Prevent from submitting if an editor is inside a form.
50
-
51
- onSubmit(value);
52
- } else if (typeof onUndo === 'function' && isUndoEvent(e)) {
45
+ if (typeof onUndo === 'function' && isUndoEvent(e)) {
53
46
  e.preventDefault();
54
47
  onUndo();
55
48
  } else if (typeof onRedo === 'function' && isRedoEvent(e)) {
@@ -60,7 +53,7 @@ const PanelTextInput = props => {
60
53
  if (onKeyDown) {
61
54
  onKeyDown(e);
62
55
  }
63
- }, [onSubmit, onUndo, onRedo, onKeyDown]);
56
+ }, [onUndo, onRedo, onKeyDown]);
64
57
  const handleClear = useCallback(() => {
65
58
  if (inputRef.current && onClear) {
66
59
  inputRef.current.focus();
@@ -70,6 +63,7 @@ const PanelTextInput = props => {
70
63
  const clearText = restProps.value !== '' && jsx(Tooltip, {
71
64
  content: clearLabel
72
65
  }, jsx("button", {
66
+ type: "button",
73
67
  css: clearTextButtonStyles,
74
68
  onClick: handleClear,
75
69
  "data-testid": testIds.clearUrlButton
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.7.1",
3
+ "version": "1.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::0cc1b4d9c22b31491ded3e581114ab2c>>
6
+ * @codegen <<SignedSource::ffa7ec78cc793f941d06cdb25b07dc8a>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
10
10
  var event = eventKey.split('.');
11
11
  return {
12
- eventType: 'ui',
13
- actionSubject: event[0],
14
- action: event[1],
15
- actionSubjectId: event[2],
12
+ eventType: event[0],
13
+ actionSubject: event[1],
14
+ action: event[2],
15
+ actionSubjectId: event[3],
16
16
  attributes: attributes
17
17
  };
18
18
  }
@@ -7,7 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  /** @jsx jsx */
10
- import { Fragment, useCallback, useLayoutEffect, useReducer } from 'react';
10
+ import { Fragment, useCallback, useEffect, useLayoutEffect, useReducer } from 'react';
11
11
  import { jsx } from '@emotion/react';
12
12
  import { useIntl, FormattedMessage } from 'react-intl-next';
13
13
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
@@ -112,6 +112,16 @@ function LinkPicker(_ref) {
112
112
  var isEditing = !!initUrl;
113
113
  var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
114
114
  var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
115
+ useEffect(function () {
116
+ // Anything in here is fired on component mount.
117
+ var event = createAnalyticsEvent(createEventPayload('ui.inlineDialog.viewed.linkPicker', {}));
118
+ event.fire(ANALYTICS_CHANNEL);
119
+ return function () {
120
+ // Anything in here is fired on component unmount.
121
+ var event = createAnalyticsEvent(createEventPayload('ui.inlineDialog.closed.linkPicker', {}));
122
+ event.fire(ANALYTICS_CHANNEL);
123
+ };
124
+ }, [createAnalyticsEvent]);
115
125
  useLayoutEffect(function () {
116
126
  if (onContentResize) {
117
127
  onContentResize();
@@ -184,7 +194,7 @@ function LinkPicker(_ref) {
184
194
  }
185
195
  }, [activeIndex, items]);
186
196
  var handleInsert = useCallback(function (url, title, inputType) {
187
- var event = createAnalyticsEvent(createEventPayload('form.submitted.linkPicker', {}));
197
+ var event = createAnalyticsEvent(createEventPayload('ui.form.submitted.linkPicker', {}));
188
198
  event.fire(ANALYTICS_CHANNEL);
189
199
  onSubmit(_objectSpread({
190
200
  url: url,
@@ -205,10 +215,13 @@ function LinkPicker(_ref) {
205
215
  if (selectedItem) {
206
216
  var _url = selectedItem.url,
207
217
  name = selectedItem.name;
218
+ dispatchEvent(new Event('submit'));
208
219
  handleInsert(_url, name, 'typeAhead');
209
220
  }
210
221
  }, [handleInsert, items]);
211
- var handleSubmit = useCallback(function () {
222
+ var handleSubmit = useCallback(function (event) {
223
+ event.preventDefault();
224
+
212
225
  if (isSelectedItem && selectedItem) {
213
226
  return handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
214
227
  }
@@ -241,9 +254,10 @@ function LinkPicker(_ref) {
241
254
  size: "medium",
242
255
  label: ''
243
256
  }));
244
- return jsx("div", {
257
+ return jsx("form", {
245
258
  "data-testid": testIds.linkPicker,
246
- css: rootContainerStyles
259
+ css: rootContainerStyles,
260
+ onSubmit: handleSubmit
247
261
  }, screenReaderText && jsx(Announcer, {
248
262
  ariaLive: "assertive",
249
263
  text: screenReaderText,
@@ -269,7 +283,6 @@ function LinkPicker(_ref) {
269
283
  "aria-describedby": screenReaderDescriptionId,
270
284
  error: invalidUrl ? intl.formatMessage(messages.linkInvalid) : null,
271
285
  onClear: handleClear,
272
- onSubmit: handleSubmit,
273
286
  onKeyDown: handleKeyDown,
274
287
  onChange: handleChangeUrl
275
288
  }), jsx(PanelTextInput, {
@@ -282,7 +295,6 @@ function LinkPicker(_ref) {
282
295
  clearLabel: intl.formatMessage(messages.clearText),
283
296
  "aria-label": intl.formatMessage(messages.linkAriaLabel),
284
297
  onClear: handleClear,
285
- onSubmit: handleSubmit,
286
298
  onKeyDown: handleKeyDown,
287
299
  onChange: handleChangeText
288
300
  }), queryState && jsx(Fragment, null, tabs.length > 0 && jsx("div", {
@@ -356,7 +368,6 @@ function LinkPicker(_ref) {
356
368
  }, intl.formatMessage(messages.cancelButton)), jsx(Button, {
357
369
  type: "submit",
358
370
  appearance: "primary",
359
- onClick: handleSubmit,
360
371
  testId: testIds.insertButton
361
372
  }, intl.formatMessage(insertButtonMsg)))));
362
373
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["name", "label", "autoFocus", "onSubmit", "onRedo", "onUndo", "onChange", "onKeyDown", "onClear", "clearLabel", "error"];
3
+ var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onChange", "onKeyDown", "onClear", "clearLabel", "error"];
4
4
 
5
5
  /** @jsx jsx */
6
6
  import { useCallback, useRef, Fragment } from 'react';
@@ -17,7 +17,6 @@ var PanelTextInput = function PanelTextInput(props) {
17
17
  var name = props.name,
18
18
  label = props.label,
19
19
  autoFocus = props.autoFocus,
20
- onSubmit = props.onSubmit,
21
20
  onRedo = props.onRedo,
22
21
  onUndo = props.onUndo,
23
22
  onChange = props.onChange,
@@ -44,13 +43,7 @@ var PanelTextInput = function PanelTextInput(props) {
44
43
  onChange(e.currentTarget.value);
45
44
  }, [onChange]);
46
45
  var handleKeydown = useCallback(function (e) {
47
- var value = e.currentTarget.value;
48
-
49
- if (e.keyCode === 13 && onSubmit) {
50
- e.preventDefault(); // Prevent from submitting if an editor is inside a form.
51
-
52
- onSubmit(value);
53
- } else if (typeof onUndo === 'function' && isUndoEvent(e)) {
46
+ if (typeof onUndo === 'function' && isUndoEvent(e)) {
54
47
  e.preventDefault();
55
48
  onUndo();
56
49
  } else if (typeof onRedo === 'function' && isRedoEvent(e)) {
@@ -61,7 +54,7 @@ var PanelTextInput = function PanelTextInput(props) {
61
54
  if (onKeyDown) {
62
55
  onKeyDown(e);
63
56
  }
64
- }, [onSubmit, onUndo, onRedo, onKeyDown]);
57
+ }, [onUndo, onRedo, onKeyDown]);
65
58
  var handleClear = useCallback(function () {
66
59
  if (inputRef.current && onClear) {
67
60
  inputRef.current.focus();
@@ -71,6 +64,7 @@ var PanelTextInput = function PanelTextInput(props) {
71
64
  var clearText = restProps.value !== '' && jsx(Tooltip, {
72
65
  content: clearLabel
73
66
  }, jsx("button", {
67
+ type: "button",
74
68
  css: clearTextButtonStyles,
75
69
  onClick: handleClear,
76
70
  "data-testid": testIds.clearUrlButton
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.7.1",
3
+ "version": "1.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -3,12 +3,16 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::0cc1b4d9c22b31491ded3e581114ab2c>>
6
+ * @codegen <<SignedSource::ffa7ec78cc793f941d06cdb25b07dc8a>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  declare type FormSubmittedLinkPickerAttributesType = {};
10
+ declare type InlineDialogViewedLinkPickerAttributesType = {};
11
+ declare type InlineDialogClosedLinkPickerAttributesType = {};
10
12
  declare type AnalyticsEventAttributes = {
11
- 'form.submitted.linkPicker': FormSubmittedLinkPickerAttributesType;
13
+ 'ui.form.submitted.linkPicker': FormSubmittedLinkPickerAttributesType;
14
+ 'ui.inlineDialog.viewed.linkPicker': InlineDialogViewedLinkPickerAttributesType;
15
+ 'ui.inlineDialog.closed.linkPicker': InlineDialogClosedLinkPickerAttributesType;
12
16
  };
13
17
  declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
14
18
  eventType: string;
@@ -6,7 +6,6 @@ export interface Props extends Omit<TextFieldProps, 'value' | 'onChange' | 'auto
6
6
  autoFocus?: boolean;
7
7
  value: string;
8
8
  onChange: (value: string) => void;
9
- onSubmit?: (value: string) => void;
10
9
  onUndo?: Function;
11
10
  onRedo?: Function;
12
11
  onClear?: Function;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.7.1",
3
+ "version": "1.8.2",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -63,9 +63,9 @@
63
63
  "@atlaskit/visual-regression": "*",
64
64
  "@atlaskit/webdriver-runner": "*",
65
65
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
66
- "@atlassian/link-picker-atlassian-plugin": "^17.0.0",
67
- "@atlassian/link-picker-plugins": "^4.0.0",
68
- "@atlassian/recent-work-client": "^1.5.0",
66
+ "@atlassian/link-picker-atlassian-plugin": "^18.0.0",
67
+ "@atlassian/link-picker-plugins": "^5.1.0",
68
+ "@atlassian/recent-work-client": "^1.6.0",
69
69
  "@atlassian/search-provider": "^2.3.0",
70
70
  "@testing-library/dom": "^7.7.3",
71
71
  "@testing-library/jest-dom": "^4.1.0",
@@ -76,11 +76,12 @@
76
76
  "enzyme": "^3.10.0",
77
77
  "fetch-mock": "^8.0.0",
78
78
  "js-yaml": "^3.13.1",
79
+ "lodash": "^4.17.21",
79
80
  "mockdate": "^3.0.2",
80
81
  "prettier": "^2.1.1",
81
82
  "react-dom": "^16.8.0",
82
83
  "sinon": "^2.2.0",
83
- "typescript": "4.2.4"
84
+ "typescript": "4.3.5"
84
85
  },
85
86
  "techstack": {
86
87
  "@repo/internal": {