@atlaskit/link-datasource 4.19.2 → 4.19.3
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 +12 -0
- package/dist/cjs/ui/assets-modal/search-container/object-schema-select/index.js +36 -24
- package/dist/cjs/ui/common/modal/popup-select/control.js +2 -1
- package/dist/es2019/ui/assets-modal/search-container/object-schema-select/index.js +8 -2
- package/dist/es2019/ui/common/modal/popup-select/control.js +2 -1
- package/dist/esm/ui/assets-modal/search-container/object-schema-select/index.js +37 -25
- package/dist/esm/ui/common/modal/popup-select/control.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 4.19.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#199487](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199487)
|
|
8
|
+
[`13c28edd2823a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/13c28edd2823a) -
|
|
9
|
+
[ux] NAVX-1053 fixing the debounce for asset modal schema selector input
|
|
10
|
+
- [#199353](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199353)
|
|
11
|
+
[`f2d4ca35574b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2d4ca35574b8) -
|
|
12
|
+
Internal changes to how border radius values are applied. No visual change.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 4.19.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -122,27 +122,39 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
|
|
|
122
122
|
}
|
|
123
123
|
return undefined;
|
|
124
124
|
};
|
|
125
|
+
var debounceTimeout = (0, _react.useRef)(null);
|
|
125
126
|
var handleInputChange = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
126
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
127
|
-
return _regenerator.default.wrap(function
|
|
128
|
-
while (1) switch (
|
|
127
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(newSearchTerm, actionMeta) {
|
|
128
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
129
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
129
130
|
case 0:
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
if (actionMeta.action === 'input-change' && newSearchTerm !== searchTerm) {
|
|
132
|
+
setSearchTerm(newSearchTerm);
|
|
133
|
+
if (debounceTimeout.current) {
|
|
134
|
+
clearTimeout(debounceTimeout.current);
|
|
135
|
+
}
|
|
136
|
+
debounceTimeout.current = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
137
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
138
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
_context2.t0 = setOptions;
|
|
141
|
+
_context2.next = 3;
|
|
142
|
+
return debouncedLoadOptions(newSearchTerm);
|
|
143
|
+
case 3:
|
|
144
|
+
_context2.t1 = _context2.sent;
|
|
145
|
+
(0, _context2.t0)(_context2.t1);
|
|
146
|
+
case 5:
|
|
147
|
+
case "end":
|
|
148
|
+
return _context2.stop();
|
|
149
|
+
}
|
|
150
|
+
}, _callee2);
|
|
151
|
+
})), SEARCH_DEBOUNCE_MS);
|
|
133
152
|
}
|
|
134
|
-
|
|
135
|
-
_context2.t0 = setOptions;
|
|
136
|
-
_context2.next = 5;
|
|
137
|
-
return debouncedLoadOptions(newSearchTerm);
|
|
138
|
-
case 5:
|
|
139
|
-
_context2.t1 = _context2.sent;
|
|
140
|
-
(0, _context2.t0)(_context2.t1);
|
|
141
|
-
case 7:
|
|
153
|
+
case 1:
|
|
142
154
|
case "end":
|
|
143
|
-
return
|
|
155
|
+
return _context3.stop();
|
|
144
156
|
}
|
|
145
|
-
},
|
|
157
|
+
}, _callee3);
|
|
146
158
|
}));
|
|
147
159
|
return function (_x2, _x3) {
|
|
148
160
|
return _ref4.apply(this, arguments);
|
|
@@ -159,11 +171,11 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
|
|
|
159
171
|
return validateSchema(value);
|
|
160
172
|
},
|
|
161
173
|
testId: testId
|
|
162
|
-
}, function (
|
|
163
|
-
var
|
|
164
|
-
_onChange =
|
|
165
|
-
onFocus =
|
|
166
|
-
restFieldProps = (0, _objectWithoutProperties2.default)(
|
|
174
|
+
}, function (_ref6) {
|
|
175
|
+
var _ref6$fieldProps = _ref6.fieldProps,
|
|
176
|
+
_onChange = _ref6$fieldProps.onChange,
|
|
177
|
+
onFocus = _ref6$fieldProps.onFocus,
|
|
178
|
+
restFieldProps = (0, _objectWithoutProperties2.default)(_ref6$fieldProps, _excluded2);
|
|
167
179
|
return (0, _platformFeatureFlags.fg)('linking-platform-assests-schema-selector-refresh') ? /*#__PURE__*/React.createElement(_select.PopupSelect, (0, _extends2.default)({
|
|
168
180
|
autoFocus: true,
|
|
169
181
|
maxMenuWidth: 300,
|
|
@@ -181,10 +193,10 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
|
|
|
181
193
|
onMenuClose: onClose
|
|
182
194
|
}, restFieldProps, {
|
|
183
195
|
label: formatMessage(_messages.objectSchemaSelectMessages.placeholder),
|
|
184
|
-
target: function target(
|
|
196
|
+
target: function target(_ref7) {
|
|
185
197
|
var _restFieldProps$value;
|
|
186
|
-
var isOpen =
|
|
187
|
-
triggerProps = (0, _objectWithoutProperties2.default)(
|
|
198
|
+
var isOpen = _ref7.isOpen,
|
|
199
|
+
triggerProps = (0, _objectWithoutProperties2.default)(_ref7, _excluded3);
|
|
188
200
|
return /*#__PURE__*/React.createElement(_new.default, (0, _extends2.default)({}, triggerProps, {
|
|
189
201
|
isSelected: isOpen,
|
|
190
202
|
iconAfter: function iconAfter() {
|
|
@@ -17,7 +17,8 @@ var _excluded = ["children"];
|
|
|
17
17
|
var getPopupCustomControlStyles = function getPopupCustomControlStyles() {
|
|
18
18
|
return {
|
|
19
19
|
display: 'flex',
|
|
20
|
-
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
21
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
21
22
|
border: "solid 1px ".concat("var(--ds-border-input, #8C8F97)"),
|
|
22
23
|
minHeight: 'auto'
|
|
23
24
|
};
|
|
@@ -4,7 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
-
import { useCallback, useState } from 'react';
|
|
7
|
+
import { useCallback, useRef, useState } from 'react';
|
|
8
8
|
import debounce from 'debounce-promise';
|
|
9
9
|
import { useIntl } from 'react-intl-next';
|
|
10
10
|
import Button from '@atlaskit/button/new';
|
|
@@ -81,10 +81,16 @@ export const AssetsObjectSchemaSelect = ({
|
|
|
81
81
|
}
|
|
82
82
|
return undefined;
|
|
83
83
|
};
|
|
84
|
+
const debounceTimeout = useRef(null);
|
|
84
85
|
const handleInputChange = useCallback(async (newSearchTerm, actionMeta) => {
|
|
85
86
|
if (actionMeta.action === 'input-change' && newSearchTerm !== searchTerm) {
|
|
86
87
|
setSearchTerm(newSearchTerm);
|
|
87
|
-
|
|
88
|
+
if (debounceTimeout.current) {
|
|
89
|
+
clearTimeout(debounceTimeout.current);
|
|
90
|
+
}
|
|
91
|
+
debounceTimeout.current = setTimeout(async () => {
|
|
92
|
+
setOptions(await debouncedLoadOptions(newSearchTerm));
|
|
93
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
88
94
|
}
|
|
89
95
|
}, [debouncedLoadOptions, searchTerm]);
|
|
90
96
|
const onClose = useCallback(() => {
|
|
@@ -7,7 +7,8 @@ import { Box } from '@atlaskit/primitives/compiled';
|
|
|
7
7
|
import { components } from '@atlaskit/select';
|
|
8
8
|
const getPopupCustomControlStyles = () => ({
|
|
9
9
|
display: 'flex',
|
|
10
|
-
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
11
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
11
12
|
border: `solid 1px ${"var(--ds-border-input, #8C8F97)"}`,
|
|
12
13
|
minHeight: 'auto'
|
|
13
14
|
});
|
|
@@ -14,7 +14,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
14
14
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
import { useCallback, useState } from 'react';
|
|
17
|
+
import { useCallback, useRef, useState } from 'react';
|
|
18
18
|
import debounce from 'debounce-promise';
|
|
19
19
|
import { useIntl } from 'react-intl-next';
|
|
20
20
|
import Button from '@atlaskit/button/new';
|
|
@@ -115,27 +115,39 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
|
|
|
115
115
|
}
|
|
116
116
|
return undefined;
|
|
117
117
|
};
|
|
118
|
+
var debounceTimeout = useRef(null);
|
|
118
119
|
var handleInputChange = useCallback( /*#__PURE__*/function () {
|
|
119
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
120
|
-
return _regeneratorRuntime.wrap(function
|
|
121
|
-
while (1) switch (
|
|
120
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(newSearchTerm, actionMeta) {
|
|
121
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
122
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
122
123
|
case 0:
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
if (actionMeta.action === 'input-change' && newSearchTerm !== searchTerm) {
|
|
125
|
+
setSearchTerm(newSearchTerm);
|
|
126
|
+
if (debounceTimeout.current) {
|
|
127
|
+
clearTimeout(debounceTimeout.current);
|
|
128
|
+
}
|
|
129
|
+
debounceTimeout.current = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
130
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
131
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
132
|
+
case 0:
|
|
133
|
+
_context2.t0 = setOptions;
|
|
134
|
+
_context2.next = 3;
|
|
135
|
+
return debouncedLoadOptions(newSearchTerm);
|
|
136
|
+
case 3:
|
|
137
|
+
_context2.t1 = _context2.sent;
|
|
138
|
+
(0, _context2.t0)(_context2.t1);
|
|
139
|
+
case 5:
|
|
140
|
+
case "end":
|
|
141
|
+
return _context2.stop();
|
|
142
|
+
}
|
|
143
|
+
}, _callee2);
|
|
144
|
+
})), SEARCH_DEBOUNCE_MS);
|
|
126
145
|
}
|
|
127
|
-
|
|
128
|
-
_context2.t0 = setOptions;
|
|
129
|
-
_context2.next = 5;
|
|
130
|
-
return debouncedLoadOptions(newSearchTerm);
|
|
131
|
-
case 5:
|
|
132
|
-
_context2.t1 = _context2.sent;
|
|
133
|
-
(0, _context2.t0)(_context2.t1);
|
|
134
|
-
case 7:
|
|
146
|
+
case 1:
|
|
135
147
|
case "end":
|
|
136
|
-
return
|
|
148
|
+
return _context3.stop();
|
|
137
149
|
}
|
|
138
|
-
},
|
|
150
|
+
}, _callee3);
|
|
139
151
|
}));
|
|
140
152
|
return function (_x2, _x3) {
|
|
141
153
|
return _ref4.apply(this, arguments);
|
|
@@ -152,11 +164,11 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
|
|
|
152
164
|
return validateSchema(value);
|
|
153
165
|
},
|
|
154
166
|
testId: testId
|
|
155
|
-
}, function (
|
|
156
|
-
var
|
|
157
|
-
_onChange =
|
|
158
|
-
onFocus =
|
|
159
|
-
restFieldProps = _objectWithoutProperties(
|
|
167
|
+
}, function (_ref6) {
|
|
168
|
+
var _ref6$fieldProps = _ref6.fieldProps,
|
|
169
|
+
_onChange = _ref6$fieldProps.onChange,
|
|
170
|
+
onFocus = _ref6$fieldProps.onFocus,
|
|
171
|
+
restFieldProps = _objectWithoutProperties(_ref6$fieldProps, _excluded2);
|
|
160
172
|
return fg('linking-platform-assests-schema-selector-refresh') ? /*#__PURE__*/React.createElement(PopupSelect, _extends({
|
|
161
173
|
autoFocus: true,
|
|
162
174
|
maxMenuWidth: 300,
|
|
@@ -174,10 +186,10 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
|
|
|
174
186
|
onMenuClose: onClose
|
|
175
187
|
}, restFieldProps, {
|
|
176
188
|
label: formatMessage(objectSchemaSelectMessages.placeholder),
|
|
177
|
-
target: function target(
|
|
189
|
+
target: function target(_ref7) {
|
|
178
190
|
var _restFieldProps$value;
|
|
179
|
-
var isOpen =
|
|
180
|
-
triggerProps = _objectWithoutProperties(
|
|
191
|
+
var isOpen = _ref7.isOpen,
|
|
192
|
+
triggerProps = _objectWithoutProperties(_ref7, _excluded3);
|
|
181
193
|
return /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
|
|
182
194
|
isSelected: isOpen,
|
|
183
195
|
iconAfter: function iconAfter() {
|
|
@@ -10,7 +10,8 @@ import { components } from '@atlaskit/select';
|
|
|
10
10
|
var getPopupCustomControlStyles = function getPopupCustomControlStyles() {
|
|
11
11
|
return {
|
|
12
12
|
display: 'flex',
|
|
13
|
-
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
14
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
14
15
|
border: "solid 1px ".concat("var(--ds-border-input, #8C8F97)"),
|
|
15
16
|
minHeight: 'auto'
|
|
16
17
|
};
|