@atlaskit/link-picker 1.2.0 → 1.2.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 +6 -0
- package/dist/cjs/ui/link-picker/index.js +12 -14
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/link-picker/index.js +13 -14
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/link-picker/index.js +12 -14
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -243,24 +243,22 @@ var LinkPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
243
243
|
url = _this$state5.url,
|
|
244
244
|
selectedIndex = _this$state5.selectedIndex,
|
|
245
245
|
items = _this$state5.items;
|
|
246
|
+
var intl = _this.props.intl;
|
|
246
247
|
var selectedItem = items[selectedIndex];
|
|
247
248
|
|
|
248
249
|
if (_this.isUrlPopulatedWithSelectedItem()) {
|
|
249
|
-
_this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
250
|
-
} else if (url.length > 0) {
|
|
251
|
-
var normalized = (0, _url.normalizeUrl)(url);
|
|
252
|
-
|
|
253
|
-
if (normalized) {
|
|
254
|
-
_this.handleInsert(normalized, null, 'manual');
|
|
255
|
-
} else {
|
|
256
|
-
var intl = _this.props.intl;
|
|
257
|
-
var linkInvalid = intl.formatMessage(_messages.messages.linkInvalid);
|
|
258
|
-
|
|
259
|
-
_this.setState({
|
|
260
|
-
invalidUrl: linkInvalid
|
|
261
|
-
});
|
|
262
|
-
}
|
|
250
|
+
return _this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
263
251
|
}
|
|
252
|
+
|
|
253
|
+
var normalized = (0, _url.normalizeUrl)(url);
|
|
254
|
+
|
|
255
|
+
if (normalized) {
|
|
256
|
+
return _this.handleInsert(normalized, null, 'manual');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return _this.setState({
|
|
260
|
+
invalidUrl: intl.formatMessage(_messages.messages.linkInvalid)
|
|
261
|
+
});
|
|
264
262
|
});
|
|
265
263
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
|
|
266
264
|
var _this$state6 = _this.state,
|
package/dist/cjs/version.json
CHANGED
|
@@ -181,25 +181,24 @@ class LinkPicker extends PureComponent {
|
|
|
181
181
|
selectedIndex,
|
|
182
182
|
items
|
|
183
183
|
} = this.state;
|
|
184
|
+
const {
|
|
185
|
+
intl
|
|
186
|
+
} = this.props;
|
|
184
187
|
const selectedItem = items[selectedIndex];
|
|
185
188
|
|
|
186
189
|
if (this.isUrlPopulatedWithSelectedItem()) {
|
|
187
|
-
this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
188
|
-
}
|
|
189
|
-
const normalized = normalizeUrl(url);
|
|
190
|
+
return this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
191
|
+
}
|
|
190
192
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
intl
|
|
196
|
-
} = this.props;
|
|
197
|
-
const linkInvalid = intl.formatMessage(messages.linkInvalid);
|
|
198
|
-
this.setState({
|
|
199
|
-
invalidUrl: linkInvalid
|
|
200
|
-
});
|
|
201
|
-
}
|
|
193
|
+
const normalized = normalizeUrl(url);
|
|
194
|
+
|
|
195
|
+
if (normalized) {
|
|
196
|
+
return this.handleInsert(normalized, null, 'manual');
|
|
202
197
|
}
|
|
198
|
+
|
|
199
|
+
return this.setState({
|
|
200
|
+
invalidUrl: intl.formatMessage(messages.linkInvalid)
|
|
201
|
+
});
|
|
203
202
|
});
|
|
204
203
|
|
|
205
204
|
_defineProperty(this, "handleKeyDown", event => {
|
package/dist/es2019/version.json
CHANGED
|
@@ -216,24 +216,22 @@ var LinkPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
216
216
|
url = _this$state5.url,
|
|
217
217
|
selectedIndex = _this$state5.selectedIndex,
|
|
218
218
|
items = _this$state5.items;
|
|
219
|
+
var intl = _this.props.intl;
|
|
219
220
|
var selectedItem = items[selectedIndex];
|
|
220
221
|
|
|
221
222
|
if (_this.isUrlPopulatedWithSelectedItem()) {
|
|
222
|
-
_this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
223
|
-
} else if (url.length > 0) {
|
|
224
|
-
var normalized = normalizeUrl(url);
|
|
225
|
-
|
|
226
|
-
if (normalized) {
|
|
227
|
-
_this.handleInsert(normalized, null, 'manual');
|
|
228
|
-
} else {
|
|
229
|
-
var intl = _this.props.intl;
|
|
230
|
-
var linkInvalid = intl.formatMessage(messages.linkInvalid);
|
|
231
|
-
|
|
232
|
-
_this.setState({
|
|
233
|
-
invalidUrl: linkInvalid
|
|
234
|
-
});
|
|
235
|
-
}
|
|
223
|
+
return _this.handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
|
|
236
224
|
}
|
|
225
|
+
|
|
226
|
+
var normalized = normalizeUrl(url);
|
|
227
|
+
|
|
228
|
+
if (normalized) {
|
|
229
|
+
return _this.handleInsert(normalized, null, 'manual');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return _this.setState({
|
|
233
|
+
invalidUrl: intl.formatMessage(messages.linkInvalid)
|
|
234
|
+
});
|
|
237
235
|
});
|
|
238
236
|
|
|
239
237
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
package/dist/esm/version.json
CHANGED