@atlaskit/link-picker 1.30.13 → 1.31.0

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/ui/index.js +1 -1
  3. package/dist/cjs/ui/link-picker/form-footer/index.js +3 -2
  4. package/dist/cjs/ui/link-picker/index.js +9 -7
  5. package/dist/cjs/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +8 -1
  6. package/dist/es2019/ui/index.js +1 -1
  7. package/dist/es2019/ui/link-picker/form-footer/index.js +2 -1
  8. package/dist/es2019/ui/link-picker/index.js +9 -7
  9. package/dist/es2019/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +4 -0
  10. package/dist/esm/ui/index.js +1 -1
  11. package/dist/esm/ui/link-picker/form-footer/index.js +3 -2
  12. package/dist/esm/ui/link-picker/index.js +9 -7
  13. package/dist/esm/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +8 -1
  14. package/dist/types/ui/link-picker/form-footer/index.d.ts +3 -1
  15. package/dist/types/ui/link-picker/index.d.ts +17 -0
  16. package/dist/types/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.d.ts +1 -1
  17. package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +3 -1
  18. package/dist/types-ts4.5/ui/link-picker/index.d.ts +17 -0
  19. package/dist/types-ts4.5/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.d.ts +1 -1
  20. package/package.json +9 -6
  21. package/dist/cjs/ui/messages-provider/lazy-messages-provider/utils/types.js +0 -5
  22. package/dist/es2019/ui/messages-provider/lazy-messages-provider/utils/types.js +0 -1
  23. package/dist/esm/ui/messages-provider/lazy-messages-provider/utils/types.js +0 -1
  24. package/dist/types/ui/messages-provider/lazy-messages-provider/utils/types.d.ts +0 -2
  25. package/dist/types-ts4.5/ui/messages-provider/lazy-messages-provider/utils/types.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#64242](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64242) [`066547c92554`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/066547c92554) - Add customMessages prop to link picker
8
+
9
+ ## 1.30.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [#63626](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63626) [`e71c8f5f586e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e71c8f5f586e) - loaderFn returns undefined if failed to dynamicaly import locale messages - fixes issue in Jira where default English replaces languages chunk.
14
+ - Updated dependencies
15
+
3
16
  ## 1.30.13
4
17
 
5
18
  ### Patch Changes
@@ -26,7 +26,7 @@ var testIds = exports.testIds = {
26
26
  };
27
27
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
28
28
  packageName: "@atlaskit/link-picker" || '',
29
- packageVersion: "1.30.13" || '',
29
+ packageVersion: "1.31.0" || '',
30
30
  componentName: _constants.COMPONENT_NAME,
31
31
  source: _constants.COMPONENT_NAME
32
32
  };
@@ -17,7 +17,7 @@ var _errors = require("../../../common/utils/errors");
17
17
  var _featureDiscovery = _interopRequireDefault(require("./feature-discovery"));
18
18
  var _styled = require("./styled");
19
19
  var _utils = require("./utils");
20
- var _excluded = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "createFeatureDiscovery"];
20
+ var _excluded = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "createFeatureDiscovery", "customSubmitButtonLabel"];
21
21
  /** @jsx jsx */
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -56,6 +56,7 @@ var FormFooter = exports.FormFooter = /*#__PURE__*/(0, _react.memo)(function (_r
56
56
  action = _ref.action,
57
57
  _ref$createFeatureDis = _ref.createFeatureDiscovery,
58
58
  createFeatureDiscovery = _ref$createFeatureDis === void 0 ? false : _ref$createFeatureDis,
59
+ customSubmitButtonLabel = _ref.customSubmitButtonLabel,
59
60
  restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
60
61
  var intl = (0, _reactIntlNext.useIntl)();
61
62
  if (error && error instanceof _errors.UnauthenticatedError) {
@@ -89,5 +90,5 @@ var FormFooter = exports.FormFooter = /*#__PURE__*/(0, _react.memo)(function (_r
89
90
  appearance: "primary",
90
91
  testId: testIds.insertButton,
91
92
  isDisabled: isSubmitDisabled
92
- }, intl.formatMessage(insertButtonMsg))));
93
+ }, customSubmitButtonLabel ? intl.formatMessage(customSubmitButtonLabel) : intl.formatMessage(insertButtonMsg))));
93
94
  });
@@ -85,7 +85,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
85
85
  initUrl = _ref.url,
86
86
  initDisplayText = _ref.displayText,
87
87
  hideDisplayText = _ref.hideDisplayText,
88
- featureFlags = _ref.featureFlags;
88
+ featureFlags = _ref.featureFlags,
89
+ customMessages = _ref.customMessages;
89
90
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
90
91
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
91
92
  var _useReducer = (0, _react.useReducer)(reducer, _objectSpread(_objectSpread({}, initState), {}, {
@@ -290,13 +291,13 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
290
291
  delay: 250
291
292
  }), (0, _react2.jsx)(_visuallyHidden.default, {
292
293
  id: screenReaderDescriptionId
293
- }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, messages.linkAriaLabel)), (0, _react2.jsx)(LinkInputField, {
294
+ }, customMessages !== null && customMessages !== void 0 && customMessages.linkAriaLabel ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, customMessages.linkAriaLabel) : (0, _react2.jsx)(_reactIntlNext.FormattedMessage, messages.linkAriaLabel)), (0, _react2.jsx)(LinkInputField, {
294
295
  role: "combobox",
295
296
  autoComplete: "off",
296
297
  name: "url",
297
298
  testId: testIds.urlInputField,
298
- label: intl.formatMessage(messages.linkLabel),
299
- placeholder: intl.formatMessage(messages.linkPlaceholder),
299
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkLabel ? intl.formatMessage(customMessages.linkLabel) : intl.formatMessage(messages.linkLabel),
300
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkPlaceholder) : intl.formatMessage(messages.linkPlaceholder),
300
301
  value: url,
301
302
  autoFocus: true,
302
303
  clearLabel: intl.formatMessage(_messages.formMessages.clearLink),
@@ -315,8 +316,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
315
316
  name: "displayText",
316
317
  testId: testIds.textInputField,
317
318
  value: displayText,
318
- label: intl.formatMessage(_messages.linkTextMessages.linkTextLabel),
319
- placeholder: intl.formatMessage(_messages.linkTextMessages.linkTextPlaceholder),
319
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkTextLabel ? intl.formatMessage(customMessages.linkTextLabel) : intl.formatMessage(_messages.linkTextMessages.linkTextLabel),
320
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkTextPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkTextPlaceholder) : intl.formatMessage(_messages.linkTextMessages.linkTextPlaceholder),
320
321
  clearLabel: intl.formatMessage(_messages.linkTextMessages.clearLinkText),
321
322
  onClear: handleClear,
322
323
  onChange: handleChangeText
@@ -351,6 +352,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
351
352
  css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? _styled.formFooterMargin : undefined
352
353
  /* Show the feature discovery pulse when we're on the Jira tab, we haven't started typing a url and
353
354
  the feature flag is enabled */,
354
- createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.enable-jira-create')
355
+ createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.enable-jira-create'),
356
+ customSubmitButtonLabel: customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined
355
357
  }));
356
358
  }));
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.fetchMessagesForLocale = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _en = _interopRequireDefault(require("../../../../i18n/en"));
12
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -50,8 +51,14 @@ var fetchMessagesForLocale = exports.fetchMessagesForLocale = /*#__PURE__*/funct
50
51
  _context.prev = 17;
51
52
  _context.t1 = _context["catch"](9);
52
53
  case 19:
54
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.tmp-fix-translations')) {
55
+ _context.next = 21;
56
+ break;
57
+ }
58
+ return _context.abrupt("return");
59
+ case 21:
53
60
  return _context.abrupt("return", _en.default);
54
- case 20:
61
+ case 22:
55
62
  case "end":
56
63
  return _context.stop();
57
64
  }
@@ -16,7 +16,7 @@ export const testIds = {
16
16
  };
17
17
  export const PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/link-picker" || '',
19
- packageVersion: "1.30.13" || '',
19
+ packageVersion: "1.31.0" || '',
20
20
  componentName: COMPONENT_NAME,
21
21
  source: COMPONENT_NAME
22
22
  };
@@ -43,6 +43,7 @@ export const FormFooter = /*#__PURE__*/memo(({
43
43
  onCancel,
44
44
  action,
45
45
  createFeatureDiscovery = false,
46
+ customSubmitButtonLabel,
46
47
  ...restProps
47
48
  }) => {
48
49
  const intl = useIntl();
@@ -75,5 +76,5 @@ export const FormFooter = /*#__PURE__*/memo(({
75
76
  appearance: "primary",
76
77
  testId: testIds.insertButton,
77
78
  isDisabled: isSubmitDisabled
78
- }, intl.formatMessage(insertButtonMsg))));
79
+ }, customSubmitButtonLabel ? intl.formatMessage(customSubmitButtonLabel) : intl.formatMessage(insertButtonMsg))));
79
80
  });
@@ -82,7 +82,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
82
82
  url: initUrl,
83
83
  displayText: initDisplayText,
84
84
  hideDisplayText,
85
- featureFlags
85
+ featureFlags,
86
+ customMessages
86
87
  }) => {
87
88
  const {
88
89
  createAnalyticsEvent
@@ -291,13 +292,13 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
291
292
  delay: 250
292
293
  }), jsx(VisuallyHidden, {
293
294
  id: screenReaderDescriptionId
294
- }, jsx(FormattedMessage, messages.linkAriaLabel)), jsx(LinkInputField, {
295
+ }, customMessages !== null && customMessages !== void 0 && customMessages.linkAriaLabel ? jsx(FormattedMessage, customMessages.linkAriaLabel) : jsx(FormattedMessage, messages.linkAriaLabel)), jsx(LinkInputField, {
295
296
  role: "combobox",
296
297
  autoComplete: "off",
297
298
  name: "url",
298
299
  testId: testIds.urlInputField,
299
- label: intl.formatMessage(messages.linkLabel),
300
- placeholder: intl.formatMessage(messages.linkPlaceholder),
300
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkLabel ? intl.formatMessage(customMessages.linkLabel) : intl.formatMessage(messages.linkLabel),
301
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkPlaceholder) : intl.formatMessage(messages.linkPlaceholder),
301
302
  value: url,
302
303
  autoFocus: true,
303
304
  clearLabel: intl.formatMessage(formMessages.clearLink),
@@ -316,8 +317,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
316
317
  name: "displayText",
317
318
  testId: testIds.textInputField,
318
319
  value: displayText,
319
- label: intl.formatMessage(linkTextMessages.linkTextLabel),
320
- placeholder: intl.formatMessage(linkTextMessages.linkTextPlaceholder),
320
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkTextLabel ? intl.formatMessage(customMessages.linkTextLabel) : intl.formatMessage(linkTextMessages.linkTextLabel),
321
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkTextPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkTextPlaceholder) : intl.formatMessage(linkTextMessages.linkTextPlaceholder),
321
322
  clearLabel: intl.formatMessage(linkTextMessages.clearLinkText),
322
323
  onClear: handleClear,
323
324
  onChange: handleChangeText
@@ -352,6 +353,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
352
353
  css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
353
354
  /* Show the feature discovery pulse when we're on the Jira tab, we haven't started typing a url and
354
355
  the feature flag is enabled */,
355
- createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create')
356
+ createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create'),
357
+ customSubmitButtonLabel: customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined
356
358
  }));
357
359
  }));
@@ -1,3 +1,4 @@
1
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
1
2
  import messages from '../../../../i18n/en';
2
3
  export const fetchMessagesForLocale = async locale => {
3
4
  try {
@@ -13,6 +14,9 @@ export const fetchMessagesForLocale = async locale => {
13
14
  } catch (e) {
14
15
  // ignore
15
16
  }
17
+ if (getBooleanFF('platform.linking-platform.link-create.tmp-fix-translations')) {
18
+ return;
19
+ }
16
20
 
17
21
  /**
18
22
  * English bundled by default as this is the majority of users
@@ -17,7 +17,7 @@ export var testIds = {
17
17
  };
18
18
  export var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/link-picker" || '',
20
- packageVersion: "1.30.13" || '',
20
+ packageVersion: "1.31.0" || '',
21
21
  componentName: COMPONENT_NAME,
22
22
  source: COMPONENT_NAME
23
23
  };
@@ -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 = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "createFeatureDiscovery"];
3
+ var _excluded = ["isLoading", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "createFeatureDiscovery", "customSubmitButtonLabel"];
4
4
  /** @jsx jsx */
5
5
  import { memo } from 'react';
6
6
  import { jsx } from '@emotion/react';
@@ -46,6 +46,7 @@ export var FormFooter = /*#__PURE__*/memo(function (_ref) {
46
46
  action = _ref.action,
47
47
  _ref$createFeatureDis = _ref.createFeatureDiscovery,
48
48
  createFeatureDiscovery = _ref$createFeatureDis === void 0 ? false : _ref$createFeatureDis,
49
+ customSubmitButtonLabel = _ref.customSubmitButtonLabel,
49
50
  restProps = _objectWithoutProperties(_ref, _excluded);
50
51
  var intl = useIntl();
51
52
  if (error && error instanceof UnauthenticatedError) {
@@ -79,5 +80,5 @@ export var FormFooter = /*#__PURE__*/memo(function (_ref) {
79
80
  appearance: "primary",
80
81
  testId: testIds.insertButton,
81
82
  isDisabled: isSubmitDisabled
82
- }, intl.formatMessage(insertButtonMsg))));
83
+ }, customSubmitButtonLabel ? intl.formatMessage(customSubmitButtonLabel) : intl.formatMessage(insertButtonMsg))));
83
84
  });
@@ -79,7 +79,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
79
79
  initUrl = _ref.url,
80
80
  initDisplayText = _ref.displayText,
81
81
  hideDisplayText = _ref.hideDisplayText,
82
- featureFlags = _ref.featureFlags;
82
+ featureFlags = _ref.featureFlags,
83
+ customMessages = _ref.customMessages;
83
84
  var _useAnalyticsEvents = useAnalyticsEvents(),
84
85
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
85
86
  var _useReducer = useReducer(reducer, _objectSpread(_objectSpread({}, initState), {}, {
@@ -284,13 +285,13 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
284
285
  delay: 250
285
286
  }), jsx(VisuallyHidden, {
286
287
  id: screenReaderDescriptionId
287
- }, jsx(FormattedMessage, messages.linkAriaLabel)), jsx(LinkInputField, {
288
+ }, customMessages !== null && customMessages !== void 0 && customMessages.linkAriaLabel ? jsx(FormattedMessage, customMessages.linkAriaLabel) : jsx(FormattedMessage, messages.linkAriaLabel)), jsx(LinkInputField, {
288
289
  role: "combobox",
289
290
  autoComplete: "off",
290
291
  name: "url",
291
292
  testId: testIds.urlInputField,
292
- label: intl.formatMessage(messages.linkLabel),
293
- placeholder: intl.formatMessage(messages.linkPlaceholder),
293
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkLabel ? intl.formatMessage(customMessages.linkLabel) : intl.formatMessage(messages.linkLabel),
294
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkPlaceholder) : intl.formatMessage(messages.linkPlaceholder),
294
295
  value: url,
295
296
  autoFocus: true,
296
297
  clearLabel: intl.formatMessage(formMessages.clearLink),
@@ -309,8 +310,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
309
310
  name: "displayText",
310
311
  testId: testIds.textInputField,
311
312
  value: displayText,
312
- label: intl.formatMessage(linkTextMessages.linkTextLabel),
313
- placeholder: intl.formatMessage(linkTextMessages.linkTextPlaceholder),
313
+ label: customMessages !== null && customMessages !== void 0 && customMessages.linkTextLabel ? intl.formatMessage(customMessages.linkTextLabel) : intl.formatMessage(linkTextMessages.linkTextLabel),
314
+ placeholder: customMessages !== null && customMessages !== void 0 && customMessages.linkTextPlaceholder ? intl.formatMessage(customMessages === null || customMessages === void 0 ? void 0 : customMessages.linkTextPlaceholder) : intl.formatMessage(linkTextMessages.linkTextPlaceholder),
314
315
  clearLabel: intl.formatMessage(linkTextMessages.clearLinkText),
315
316
  onClear: handleClear,
316
317
  onChange: handleChangeText
@@ -345,6 +346,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
345
346
  css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
346
347
  /* Show the feature discovery pulse when we're on the Jira tab, we haven't started typing a url and
347
348
  the feature flag is enabled */,
348
- createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create')
349
+ createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create'),
350
+ customSubmitButtonLabel: customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined
349
351
  }));
350
352
  }));
@@ -1,5 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import messages from '../../../../i18n/en';
4
5
  export var fetchMessagesForLocale = /*#__PURE__*/function () {
5
6
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(locale) {
@@ -28,8 +29,14 @@ export var fetchMessagesForLocale = /*#__PURE__*/function () {
28
29
  _context.prev = 17;
29
30
  _context.t1 = _context["catch"](9);
30
31
  case 19:
32
+ if (!getBooleanFF('platform.linking-platform.link-create.tmp-fix-translations')) {
33
+ _context.next = 21;
34
+ break;
35
+ }
36
+ return _context.abrupt("return");
37
+ case 21:
31
38
  return _context.abrupt("return", messages);
32
- case 20:
39
+ case 22:
33
40
  case "end":
34
41
  return _context.stop();
35
42
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
+ import { MessageDescriptor } from 'react-intl-next';
3
4
  import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
4
5
  export declare const testIds: {
5
6
  readonly insertButton: "link-picker-insert-button";
@@ -19,6 +20,7 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
19
20
  onCancel?: () => void;
20
21
  action?: LinkPickerPluginAction;
21
22
  createFeatureDiscovery?: boolean;
23
+ customSubmitButtonLabel?: MessageDescriptor;
22
24
  }
23
- export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
25
+ export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, customSubmitButtonLabel, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
24
26
  export {};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { MessageDescriptor } from 'react-intl-next';
2
3
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  import { LinkInputType, LinkPickerPlugin } from '../../common/types';
4
5
  export declare const testIds: {
@@ -77,7 +78,23 @@ export interface LinkPickerProps {
77
78
  component?: React.ComponentType<Partial<LinkPickerProps> & {
78
79
  children: React.ReactElement;
79
80
  }>;
81
+ /** Allows for customisation of text in the link picker. */
82
+ customMessages?: CustomLinkPickerMessages;
80
83
  featureFlags?: Record<string, unknown>;
81
84
  }
85
+ type CustomLinkPickerMessages = {
86
+ /** Label for the link input field */
87
+ linkLabel?: MessageDescriptor;
88
+ /** Aria label for the link input field */
89
+ linkAriaLabel?: MessageDescriptor;
90
+ /** Placeholder for the link input field */
91
+ linkPlaceholder?: MessageDescriptor;
92
+ /** Label for the link display text field */
93
+ linkTextLabel?: MessageDescriptor;
94
+ /** Placeholder for the link display text field */
95
+ linkTextPlaceholder?: MessageDescriptor;
96
+ /** Label for the submit button */
97
+ submitButtonLabel?: MessageDescriptor;
98
+ };
82
99
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
83
100
  export {};
@@ -1,2 +1,2 @@
1
- import { I18NMessages } from './types';
1
+ import { I18NMessages } from '@atlaskit/intl-messages-provider';
2
2
  export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
+ import { MessageDescriptor } from 'react-intl-next';
3
4
  import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
4
5
  export declare const testIds: {
5
6
  readonly insertButton: "link-picker-insert-button";
@@ -19,6 +20,7 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
19
20
  onCancel?: () => void;
20
21
  action?: LinkPickerPluginAction;
21
22
  createFeatureDiscovery?: boolean;
23
+ customSubmitButtonLabel?: MessageDescriptor;
22
24
  }
23
- export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
25
+ export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, createFeatureDiscovery, customSubmitButtonLabel, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
24
26
  export {};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { MessageDescriptor } from 'react-intl-next';
2
3
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  import { LinkInputType, LinkPickerPlugin } from '../../common/types';
4
5
  export declare const testIds: {
@@ -77,7 +78,23 @@ export interface LinkPickerProps {
77
78
  component?: React.ComponentType<Partial<LinkPickerProps> & {
78
79
  children: React.ReactElement;
79
80
  }>;
81
+ /** Allows for customisation of text in the link picker. */
82
+ customMessages?: CustomLinkPickerMessages;
80
83
  featureFlags?: Record<string, unknown>;
81
84
  }
85
+ type CustomLinkPickerMessages = {
86
+ /** Label for the link input field */
87
+ linkLabel?: MessageDescriptor;
88
+ /** Aria label for the link input field */
89
+ linkAriaLabel?: MessageDescriptor;
90
+ /** Placeholder for the link input field */
91
+ linkPlaceholder?: MessageDescriptor;
92
+ /** Label for the link display text field */
93
+ linkTextLabel?: MessageDescriptor;
94
+ /** Placeholder for the link display text field */
95
+ linkTextPlaceholder?: MessageDescriptor;
96
+ /** Label for the submit button */
97
+ submitButtonLabel?: MessageDescriptor;
98
+ };
82
99
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
83
100
  export {};
@@ -1,2 +1,2 @@
1
- import { I18NMessages } from './types';
1
+ import { I18NMessages } from '@atlaskit/intl-messages-provider';
2
2
  export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.30.13",
3
+ "version": "1.31.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -49,6 +49,9 @@
49
49
  },
50
50
  "platform.linking-platform.link-picker.enable-jira-create": {
51
51
  "type": "boolean"
52
+ },
53
+ "platform.linking-platform.link-create.tmp-fix-translations": {
54
+ "type": "boolean"
52
55
  }
53
56
  },
54
57
  "scripts": {
@@ -57,20 +60,20 @@
57
60
  },
58
61
  "dependencies": {
59
62
  "@atlaskit/analytics-next": "^9.1.0",
60
- "@atlaskit/button": "^17.1.0",
63
+ "@atlaskit/button": "^17.2.0",
61
64
  "@atlaskit/empty-state": "^7.6.0",
62
65
  "@atlaskit/form": "^9.0.3",
63
66
  "@atlaskit/frontend-utilities": "^2.7.0",
64
67
  "@atlaskit/icon": "^22.0.0",
65
68
  "@atlaskit/intl-messages-provider": "^1.0.2",
66
- "@atlaskit/linking-common": "^5.0.0",
67
- "@atlaskit/onboarding": "^11.1.2",
69
+ "@atlaskit/linking-common": "^5.3.0",
70
+ "@atlaskit/onboarding": "^11.2.0",
68
71
  "@atlaskit/platform-feature-flags": "^0.2.1",
69
72
  "@atlaskit/spinner": "^16.0.0",
70
73
  "@atlaskit/tabs": "^14.0.0",
71
74
  "@atlaskit/textfield": "^6.0.0",
72
75
  "@atlaskit/theme": "^12.6.0",
73
- "@atlaskit/tokens": "^1.32.0",
76
+ "@atlaskit/tokens": "^1.33.0",
74
77
  "@atlaskit/tooltip": "^18.1.0",
75
78
  "@atlaskit/ufo": "^0.2.0",
76
79
  "@atlaskit/visually-hidden": "^1.2.0",
@@ -93,7 +96,7 @@
93
96
  "@atlaskit/dropdown-menu": "^12.1.0",
94
97
  "@atlaskit/link-provider": "^1.6.0",
95
98
  "@atlaskit/link-test-helpers": "^6.2.0",
96
- "@atlaskit/primitives": "^1.15.0",
99
+ "@atlaskit/primitives": "^1.16.0",
97
100
  "@atlaskit/visual-regression": "*",
98
101
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
99
102
  "@atlassian/feature-flags-test-utils": "*",
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,2 +0,0 @@
1
- import { MessageFormatElement } from 'react-intl-next';
2
- export type I18NMessages = Record<string, string> | Record<string, MessageFormatElement[]>;
@@ -1,2 +0,0 @@
1
- import { MessageFormatElement } from 'react-intl-next';
2
- export type I18NMessages = Record<string, string> | Record<string, MessageFormatElement[]>;