@atlaskit/editor-common 76.9.0 → 76.9.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +1 -1
  3. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +43 -42
  4. package/dist/cjs/link/LinkSearch/LinkSearchList.js +2 -1
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/ui/DropList/index.js +1 -1
  7. package/dist/cjs/ui/PanelTextInput/index.js +4 -2
  8. package/dist/cjs/ui/PanelTextInput/styles.js +1 -1
  9. package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +1 -1
  10. package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +56 -48
  11. package/dist/es2019/link/LinkSearch/LinkSearchList.js +3 -0
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/es2019/ui/PanelTextInput/index.js +5 -2
  15. package/dist/es2019/ui/PanelTextInput/styles.js +5 -3
  16. package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +1 -1
  17. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +45 -43
  18. package/dist/esm/link/LinkSearch/LinkSearchList.js +2 -1
  19. package/dist/esm/monitoring/error.js +1 -1
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/ui/PanelTextInput/index.js +5 -2
  22. package/dist/esm/ui/PanelTextInput/styles.js +2 -2
  23. package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +3 -2
  24. package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +11 -7
  25. package/dist/types/link/LinkSearch/LinkSearchList.d.ts +1 -1
  26. package/dist/types/ui/PanelTextInput/index.d.ts +3 -1
  27. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 76.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#40437](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40437) [`24a1d9ae0b6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24a1d9ae0b6) - [ux] Add visible labels for hyperlink input and text description input and remove placeholders because Placeholder text disappears when a user starts to type into the mentioned combobox field, thus users with cognitive impairments (such as dyslexia or attention disorders) and the elderly may face trouble remembering the purpose of the field if the label is not visible at all times as the place holder disappears as soon as users start typing.
8
+
3
9
  ## 76.9.0
4
10
 
5
11
  ### Minor Changes
@@ -30,7 +30,7 @@ var EditorSmartLinkPageObject = exports.EditorSmartLinkPageObject = /*#__PURE__*
30
30
  displayCardOption: 'block-appearance',
31
31
  displayEmbedOption: 'embed-appearance',
32
32
  linkUrl: 'link-url',
33
- linkLabel: 'link-label'
33
+ linkLabel: 'link-text'
34
34
  });
35
35
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaLabels", {
36
36
  editLink: 'Edit link',
@@ -26,19 +26,17 @@ var _adfSchema = require("@atlaskit/adf-schema");
26
26
  var _analyticsNext = require("@atlaskit/analytics-next");
27
27
  var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/page/16"));
28
28
  var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/cross-circle"));
29
- var _alignLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-left"));
30
- var _link = _interopRequireDefault(require("@atlaskit/icon/glyph/link"));
31
29
  var _colors = require("@atlaskit/theme/colors");
30
+ var _constants = require("@atlaskit/theme/constants");
32
31
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
33
32
  var _analytics = require("../../../analytics");
34
- var _messages = require("../../../messages");
35
33
  var _ui = require("../../../ui");
36
34
  var _utils = require("../../../utils");
37
35
  var _LinkSearchList = _interopRequireDefault(require("../../LinkSearch/LinkSearchList"));
38
36
  var _ToolbarComponents = require("../../LinkSearch/ToolbarComponents");
39
37
  var _transformTimeStamp = require("../../LinkSearch/transformTimeStamp");
40
38
  var _utils2 = require("./utils");
41
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
39
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
42
40
  /** @jsx jsx */
43
41
  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); }
44
42
  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; }
@@ -51,8 +49,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
51
49
  var visuallyHiddenStyles = exports.visuallyHiddenStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n clip: rect(1px, 1px, 1px, 1px);\n clip-path: inset(50%);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n"])));
52
50
  var RECENT_SEARCH_LIST_SIZE = exports.RECENT_SEARCH_LIST_SIZE = 5;
53
51
  var clearText = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n padding: 0;\n margin-right: ", ";\n color: ", ";\n background: transparent;\n border: none;\n"])), "var(--ds-space-100, 8px)", "var(--ds-icon-subtle, ".concat(_colors.N90, ")"));
54
- var textInputWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), _ToolbarComponents.inputWrapper, "var(--ds-border, ".concat(_colors.N30, ")"), "var(--ds-border, ".concat(_colors.N30, ")"));
55
- var iconWrapper = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n padding: ", " ", ";\n width: 18px;\n"])), "var(--ds-icon-subtle, ".concat(_colors.N80, ")"), "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)");
52
+ var clearTextWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 0;\n"])));
53
+ var containerPadding = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", " ", ";\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)");
54
+ var textLabelMargin = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-top: ", ";\n"])), "var(--ds-space-150, 12px)");
55
+ var inputLabel = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n color: ", ";\n font-weight: 500;\n padding-bottom: ", ";\n"])), (0, _constants.fontSizeSmall)(), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-space-050, 4px)");
56
+ var inputWrapperPosition = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
56
57
  var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
57
58
  displayText: {
58
59
  id: 'fabric.editor.displayText',
@@ -79,10 +80,15 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
79
80
  defaultMessage: '{count, plural, =0 {no results} one {# result} other {# results}} found',
80
81
  description: 'Announce search results for screen-reader users.'
81
82
  },
82
- linkAriaLabel: {
83
- id: 'fabric.editor.hyperlink.linkAriaLabel',
84
- defaultMessage: 'Link label',
85
- description: 'aria label for a link'
83
+ linkVisibleLabel: {
84
+ id: 'fabric.editor.hyperlink.linkVisibleLabel',
85
+ defaultMessage: 'Paste or search for link',
86
+ description: 'Visible label for link input in hyperlink floating control'
87
+ },
88
+ textVisibleLabel: {
89
+ id: 'fabric.editor.hyperlink.textVisibleLabel',
90
+ defaultMessage: 'Display text (optional)',
91
+ description: 'Visible label for text input in hyperlink floating control'
86
92
  }
87
93
  });
88
94
  var defaultIcon = (0, _react2.jsx)(_.default, {
@@ -801,14 +807,12 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
801
807
  var _this$props5 = this.props,
802
808
  formatMessage = _this$props5.intl.formatMessage,
803
809
  activityProvider = _this$props5.activityProvider;
804
- var placeholder = formatMessage(activityProvider ? _messages.linkToolbarMessages.placeholder : _messages.linkToolbarMessages.linkPlaceholder);
805
- var formatLinkAddressText = formatMessage(_messages.linkToolbarMessages.linkAddress);
806
810
  var formatClearLinkText = formatMessage(messages.clearLink);
807
- var formatDisplayText = formatMessage(messages.displayText);
808
811
  var screenReaderDescriptionId = 'search-recent-links-field-description';
809
812
  var linkSearchListId = 'hyperlink-search-list';
810
813
  var ariaActiveDescendant = selectedIndex > -1 ? "link-search-list-item-".concat(selectedIndex) : '';
811
-
814
+ var linkSearchInputId = 'search-recent-links-field-id';
815
+ var displayTextInputId = 'display-text-filed-id';
812
816
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
813
817
  // as the Aria design pattern for combobox does not work in this case
814
818
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
@@ -817,17 +821,14 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
817
821
  "aria-label": "Hyperlink Edit",
818
822
  className: "recent-list"
819
823
  }, (0, _react2.jsx)("div", {
820
- css: [_ToolbarComponents.container, !!activityProvider && _ToolbarComponents.containerWithProvider],
824
+ css: [_ToolbarComponents.container, !!activityProvider && _ToolbarComponents.containerWithProvider, containerPadding],
821
825
  ref: this.wrapperRef
822
- }, (0, _react2.jsx)("div", {
823
- css: _ToolbarComponents.inputWrapper
824
- }, (0, _react2.jsx)("span", {
825
- css: iconWrapper
826
- }, (0, _react2.jsx)(_tooltip.default, {
827
- content: formatLinkAddressText
828
- }, (0, _react2.jsx)(_link.default, {
829
- label: formatLinkAddressText
830
- }))), screenReaderText && (0, _react2.jsx)(_ui.Announcer, {
826
+ }, (0, _react2.jsx)("label", {
827
+ htmlFor: linkSearchInputId,
828
+ css: inputLabel
829
+ }, formatMessage(messages.linkVisibleLabel)), (0, _react2.jsx)("div", {
830
+ css: [_ToolbarComponents.inputWrapper, inputWrapperPosition]
831
+ }, screenReaderText && (0, _react2.jsx)(_ui.Announcer, {
831
832
  ariaLive: "assertive",
832
833
  text: screenReaderText,
833
834
  ariaRelevant: "additions",
@@ -846,7 +847,6 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
846
847
  ref: function ref(ele) {
847
848
  return _this2.urlInputContainer = ele;
848
849
  },
849
- placeholder: placeholder,
850
850
  testId: 'link-url',
851
851
  onSubmit: this.handleSubmit,
852
852
  onChange: this.updateInput,
@@ -855,8 +855,11 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
855
855
  },
856
856
  onCancel: this.handleCancel,
857
857
  defaultValue: displayUrl,
858
- onKeyDown: this.handleKeyDown
859
- }), displayUrl && (0, _react2.jsx)(_tooltip.default, {
858
+ onKeyDown: this.handleKeyDown,
859
+ inputId: linkSearchInputId
860
+ }), displayUrl && (0, _react2.jsx)("div", {
861
+ css: clearTextWrapper
862
+ }, (0, _react2.jsx)(_tooltip.default, {
860
863
  content: formatClearLinkText
861
864
  }, (0, _react2.jsx)("button", {
862
865
  type: "button",
@@ -865,27 +868,25 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
865
868
  tabIndex: 0
866
869
  }, (0, _react2.jsx)(_crossCircle.default, {
867
870
  label: formatClearLinkText
868
- })))), (0, _react2.jsx)("div", {
869
- css: textInputWrapper
870
- }, (0, _react2.jsx)("span", {
871
- css: iconWrapper
872
- }, (0, _react2.jsx)(_tooltip.default, {
873
- content: formatDisplayText
874
- }, (0, _react2.jsx)(_alignLeft.default, {
875
- label: formatDisplayText
876
- }))), (0, _react2.jsx)(_ui.PanelTextInput, {
871
+ }))))), (0, _react2.jsx)("label", {
872
+ htmlFor: displayTextInputId,
873
+ css: [inputLabel, textLabelMargin]
874
+ }, formatMessage(messages.textVisibleLabel)), (0, _react2.jsx)("div", {
875
+ css: [_ToolbarComponents.inputWrapper, inputWrapperPosition]
876
+ }, (0, _react2.jsx)(_ui.PanelTextInput, {
877
877
  ref: function ref(ele) {
878
878
  return _this2.displayTextInputContainer = ele;
879
879
  },
880
- placeholder: formatDisplayText,
881
- ariaLabel: formatMessage(messages.linkAriaLabel),
882
- testId: 'link-label',
880
+ testId: 'link-text',
883
881
  onChange: this.updateTextInput,
884
882
  onCancel: this.handleCancel,
885
883
  defaultValue: displayText,
886
884
  onSubmit: this.handleSubmit,
887
- onKeyDown: this.handleKeyDown
888
- }), displayText && (0, _react2.jsx)(_tooltip.default, {
885
+ onKeyDown: this.handleKeyDown,
886
+ inputId: displayTextInputId
887
+ }), displayText && (0, _react2.jsx)("div", {
888
+ css: clearTextWrapper
889
+ }, (0, _react2.jsx)(_tooltip.default, {
889
890
  content: formatMessage(messages.clearText)
890
891
  }, (0, _react2.jsx)("button", {
891
892
  type: "button",
@@ -894,7 +895,7 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
894
895
  onKeyDown: this.handleClearTextKeyDown
895
896
  }, (0, _react2.jsx)(_crossCircle.default, {
896
897
  label: formatMessage(messages.clearText)
897
- })))), (0, _react2.jsx)("div", {
898
+ }))))), (0, _react2.jsx)("div", {
898
899
  css: visuallyHiddenStyles,
899
900
  "aria-live": "polite",
900
901
  "aria-atomic": "true",
@@ -14,12 +14,13 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
14
14
  var _react = require("react");
15
15
  var _react2 = require("@emotion/react");
16
16
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
17
+ var _colors = require("@atlaskit/theme/colors");
17
18
  var _LinkSearchListItem = _interopRequireDefault(require("./LinkSearchListItem"));
18
19
  var _templateObject, _templateObject2, _templateObject3;
19
20
  /** @jsx jsx */
20
21
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
22
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
- var listContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0;\n"])));
23
+ var listContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0;\n margin-top: ", ";\n border-top: 1px solid ", ";\n"])), "var(--ds-space-150, 12px)", "var(--ds-border, ".concat(_colors.N30, ")"));
23
24
  var spinnerContainer = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-align: center;\n min-height: 80px;\n margin-top: 30px;\n"])));
24
25
  var linkSearchList = exports.linkSearchList = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0;\n list-style: none;\n"])));
25
26
  var LinkSearchList = exports.default = /*#__PURE__*/function (_PureComponent) {
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  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; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "76.9.0";
19
+ var packageVersion = "76.9.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "76.9.0";
27
+ var packageVersion = "76.9.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -119,7 +119,8 @@ var PanelTextInput = exports.default = /*#__PURE__*/function (_PureComponent) {
119
119
  ariaControls = _this$props2.ariaControls,
120
120
  ariaExpanded = _this$props2.ariaExpanded,
121
121
  ariaAutoComplete = _this$props2.ariaAutoComplete,
122
- role = _this$props2.role;
122
+ role = _this$props2.role,
123
+ inputId = _this$props2.inputId;
123
124
  var value = this.state.value;
124
125
  return (0, _react2.jsx)("input", {
125
126
  css: [_styles.panelTextInput, width !== undefined && (0, _styles.panelTextInputWithCustomWidth)(width)],
@@ -139,7 +140,8 @@ var PanelTextInput = exports.default = /*#__PURE__*/function (_PureComponent) {
139
140
  onBlur: this.onBlur,
140
141
  ref: this.handleRef,
141
142
  maxLength: maxLength,
142
- "aria-label": ariaLabel
143
+ "aria-label": ariaLabel,
144
+ id: inputId
143
145
  });
144
146
  }
145
147
  }, {
@@ -11,7 +11,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
11
  var _colors = require("@atlaskit/theme/colors");
12
12
  var _templateObject, _templateObject2;
13
13
  // Normal .className gets overridden by input[type=text] hence this hack to produce input.className
14
- var panelTextInput = exports.panelTextInput = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input& {\n background: transparent;\n border: 0;\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: 0;\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-text-subtle, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), "var(--ds-text-subtlest, ".concat(_colors.N100, ")"));
14
+ var panelTextInput = exports.panelTextInput = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input& {\n background: transparent;\n border: 2px solid ", ";\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: ", " ", "\n ", " ", ";\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-border, ".concat(_colors.N30, ")"), "var(--ds-text-subtle, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), "var(--ds-space-075, 6px)", "var(--ds-space-400, 32px)", "var(--ds-space-075, 6px)", "var(--ds-space-100, 8px)", "var(--ds-border-focused, ".concat(_colors.B100, ")"), "var(--ds-text-subtlest, ".concat(_colors.N100, ")"));
15
15
  var panelTextInputWithCustomWidth = exports.panelTextInputWithCustomWidth = function panelTextInputWithCustomWidth(width) {
16
16
  return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n input& {\n width: ", "px;\n }\n"])), width);
17
17
  };
@@ -12,7 +12,7 @@ export class EditorSmartLinkPageObject extends InProductTestPageObject {
12
12
  displayCardOption: 'block-appearance',
13
13
  displayEmbedOption: 'embed-appearance',
14
14
  linkUrl: 'link-url',
15
- linkLabel: 'link-label'
15
+ linkLabel: 'link-text'
16
16
  });
17
17
  _defineProperty(this, "ariaLabels", {
18
18
  editLink: 'Edit link',
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
+
3
4
  import React, { PureComponent } from 'react';
4
5
  import { css, jsx } from '@emotion/react';
5
6
  import debounce from 'lodash/debounce';
@@ -8,12 +9,10 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
8
9
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
9
10
  import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
10
11
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
11
- import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
12
- import LinkIcon from '@atlaskit/icon/glyph/link';
13
- import { N30, N80, N90 } from '@atlaskit/theme/colors';
12
+ import { N200, N90 } from '@atlaskit/theme/colors';
13
+ import { fontSizeSmall } from '@atlaskit/theme/constants';
14
14
  import Tooltip from '@atlaskit/tooltip';
15
15
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
16
- import { linkToolbarMessages as linkToolbarCommonMessages } from '../../../messages';
17
16
  import { Announcer, PanelTextInput } from '../../../ui';
18
17
  import { browser, normalizeUrl } from '../../../utils';
19
18
  import LinkSearchList from '../../LinkSearch/LinkSearchList';
@@ -44,15 +43,24 @@ const clearText = css`
44
43
  background: transparent;
45
44
  border: none;
46
45
  `;
47
- const textInputWrapper = css`
48
- ${inputWrapper};
49
- border-top: 1px solid ${`var(--ds-border, ${N30})`};
50
- border-bottom: 1px solid ${`var(--ds-border, ${N30})`};
46
+ const clearTextWrapper = css`
47
+ position: absolute;
48
+ right: 0;
49
+ `;
50
+ const containerPadding = css`
51
+ padding: ${"var(--ds-space-150, 12px)"} ${"var(--ds-space-100, 8px)"};
51
52
  `;
52
- const iconWrapper = css`
53
- color: ${`var(--ds-icon-subtle, ${N80})`};
54
- padding: ${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"};
55
- width: 18px;
53
+ const textLabelMargin = css`
54
+ margin-top: ${"var(--ds-space-150, 12px)"};
55
+ `;
56
+ const inputLabel = css`
57
+ font-size: ${fontSizeSmall()}px;
58
+ color: ${`var(--ds-text-subtlest, ${N200})`};
59
+ font-weight: 500;
60
+ padding-bottom: ${"var(--ds-space-050, 4px)"};
61
+ `;
62
+ const inputWrapperPosition = css`
63
+ position: relative;
56
64
  `;
57
65
  export const messages = defineMessages({
58
66
  displayText: {
@@ -80,10 +88,15 @@ export const messages = defineMessages({
80
88
  defaultMessage: '{count, plural, =0 {no results} one {# result} other {# results}} found',
81
89
  description: 'Announce search results for screen-reader users.'
82
90
  },
83
- linkAriaLabel: {
84
- id: 'fabric.editor.hyperlink.linkAriaLabel',
85
- defaultMessage: 'Link label',
86
- description: 'aria label for a link'
91
+ linkVisibleLabel: {
92
+ id: 'fabric.editor.hyperlink.linkVisibleLabel',
93
+ defaultMessage: 'Paste or search for link',
94
+ description: 'Visible label for link input in hyperlink floating control'
95
+ },
96
+ textVisibleLabel: {
97
+ id: 'fabric.editor.hyperlink.textVisibleLabel',
98
+ defaultMessage: 'Display text (optional)',
99
+ description: 'Visible label for text input in hyperlink floating control'
87
100
  }
88
101
  });
89
102
  const defaultIcon = jsx(Page16Icon, {
@@ -663,14 +676,12 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
663
676
  },
664
677
  activityProvider
665
678
  } = this.props;
666
- const placeholder = formatMessage(activityProvider ? linkToolbarCommonMessages.placeholder : linkToolbarCommonMessages.linkPlaceholder);
667
- const formatLinkAddressText = formatMessage(linkToolbarCommonMessages.linkAddress);
668
679
  const formatClearLinkText = formatMessage(messages.clearLink);
669
- const formatDisplayText = formatMessage(messages.displayText);
670
680
  const screenReaderDescriptionId = 'search-recent-links-field-description';
671
681
  const linkSearchListId = 'hyperlink-search-list';
672
682
  const ariaActiveDescendant = selectedIndex > -1 ? `link-search-list-item-${selectedIndex}` : '';
673
-
683
+ const linkSearchInputId = 'search-recent-links-field-id';
684
+ const displayTextInputId = 'display-text-filed-id';
674
685
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
675
686
  // as the Aria design pattern for combobox does not work in this case
676
687
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
@@ -679,17 +690,14 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
679
690
  "aria-label": "Hyperlink Edit",
680
691
  className: "recent-list"
681
692
  }, jsx("div", {
682
- css: [container, !!activityProvider && containerWithProvider],
693
+ css: [container, !!activityProvider && containerWithProvider, containerPadding],
683
694
  ref: this.wrapperRef
684
- }, jsx("div", {
685
- css: inputWrapper
686
- }, jsx("span", {
687
- css: iconWrapper
688
- }, jsx(Tooltip, {
689
- content: formatLinkAddressText
690
- }, jsx(LinkIcon, {
691
- label: formatLinkAddressText
692
- }))), screenReaderText && jsx(Announcer, {
695
+ }, jsx("label", {
696
+ htmlFor: linkSearchInputId,
697
+ css: inputLabel
698
+ }, formatMessage(messages.linkVisibleLabel)), jsx("div", {
699
+ css: [inputWrapper, inputWrapperPosition]
700
+ }, screenReaderText && jsx(Announcer, {
693
701
  ariaLive: "assertive",
694
702
  text: screenReaderText,
695
703
  ariaRelevant: "additions",
@@ -706,7 +714,6 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
706
714
  ariaAutoComplete: true,
707
715
  describedById: screenReaderDescriptionId,
708
716
  ref: ele => this.urlInputContainer = ele,
709
- placeholder: placeholder,
710
717
  testId: 'link-url',
711
718
  onSubmit: this.handleSubmit,
712
719
  onChange: this.updateInput,
@@ -715,8 +722,11 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
715
722
  },
716
723
  onCancel: this.handleCancel,
717
724
  defaultValue: displayUrl,
718
- onKeyDown: this.handleKeyDown
719
- }), displayUrl && jsx(Tooltip, {
725
+ onKeyDown: this.handleKeyDown,
726
+ inputId: linkSearchInputId
727
+ }), displayUrl && jsx("div", {
728
+ css: clearTextWrapper
729
+ }, jsx(Tooltip, {
720
730
  content: formatClearLinkText
721
731
  }, jsx("button", {
722
732
  type: "button",
@@ -725,25 +735,23 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
725
735
  tabIndex: 0
726
736
  }, jsx(CrossCircleIcon, {
727
737
  label: formatClearLinkText
728
- })))), jsx("div", {
729
- css: textInputWrapper
730
- }, jsx("span", {
731
- css: iconWrapper
732
- }, jsx(Tooltip, {
733
- content: formatDisplayText
734
- }, jsx(EditorAlignLeftIcon, {
735
- label: formatDisplayText
736
- }))), jsx(PanelTextInput, {
738
+ }))))), jsx("label", {
739
+ htmlFor: displayTextInputId,
740
+ css: [inputLabel, textLabelMargin]
741
+ }, formatMessage(messages.textVisibleLabel)), jsx("div", {
742
+ css: [inputWrapper, inputWrapperPosition]
743
+ }, jsx(PanelTextInput, {
737
744
  ref: ele => this.displayTextInputContainer = ele,
738
- placeholder: formatDisplayText,
739
- ariaLabel: formatMessage(messages.linkAriaLabel),
740
- testId: 'link-label',
745
+ testId: 'link-text',
741
746
  onChange: this.updateTextInput,
742
747
  onCancel: this.handleCancel,
743
748
  defaultValue: displayText,
744
749
  onSubmit: this.handleSubmit,
745
- onKeyDown: this.handleKeyDown
746
- }), displayText && jsx(Tooltip, {
750
+ onKeyDown: this.handleKeyDown,
751
+ inputId: displayTextInputId
752
+ }), displayText && jsx("div", {
753
+ css: clearTextWrapper
754
+ }, jsx(Tooltip, {
747
755
  content: formatMessage(messages.clearText)
748
756
  }, jsx("button", {
749
757
  type: "button",
@@ -752,7 +760,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
752
760
  onKeyDown: this.handleClearTextKeyDown
753
761
  }, jsx(CrossCircleIcon, {
754
762
  label: formatMessage(messages.clearText)
755
- })))), jsx("div", {
763
+ }))))), jsx("div", {
756
764
  css: visuallyHiddenStyles,
757
765
  "aria-live": "polite",
758
766
  "aria-atomic": "true",
@@ -2,9 +2,12 @@
2
2
  import { PureComponent } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import Spinner from '@atlaskit/spinner';
5
+ import { N30 } from '@atlaskit/theme/colors';
5
6
  import LinkSearchListItem from './LinkSearchListItem';
6
7
  const listContainer = css`
7
8
  padding-top: 0;
9
+ margin-top: ${"var(--ds-space-150, 12px)"};
10
+ border-top: 1px solid ${`var(--ds-border, ${N30})`};
8
11
  `;
9
12
  const spinnerContainer = css`
10
13
  text-align: center;
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "76.9.0";
3
+ const packageVersion = "76.9.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius } from '@atlaskit/theme/constants';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "76.9.0";
12
+ const packageVersion = "76.9.1";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
+
3
4
  import { PureComponent } from 'react';
4
5
  import { jsx } from '@emotion/react';
5
6
  import { browser } from '../../utils';
@@ -98,7 +99,8 @@ export default class PanelTextInput extends PureComponent {
98
99
  ariaControls,
99
100
  ariaExpanded,
100
101
  ariaAutoComplete,
101
- role
102
+ role,
103
+ inputId
102
104
  } = this.props;
103
105
  const {
104
106
  value
@@ -121,7 +123,8 @@ export default class PanelTextInput extends PureComponent {
121
123
  onBlur: this.onBlur,
122
124
  ref: this.handleRef,
123
125
  maxLength: maxLength,
124
- "aria-label": ariaLabel
126
+ "aria-label": ariaLabel,
127
+ id: inputId
125
128
  });
126
129
  }
127
130
  focus() {
@@ -1,18 +1,19 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
3
- import { N100, N400 } from '@atlaskit/theme/colors';
3
+ import { B100, N100, N30, N400 } from '@atlaskit/theme/colors';
4
4
  // Normal .className gets overridden by input[type=text] hence this hack to produce input.className
5
5
  export const panelTextInput = css`
6
6
  input& {
7
7
  background: transparent;
8
- border: 0;
8
+ border: 2px solid ${`var(--ds-border, ${N30})`};
9
9
  border-radius: 0;
10
10
  box-sizing: content-box;
11
11
  color: ${`var(--ds-text-subtle, ${N400})`};
12
12
  flex-grow: 1;
13
13
  font-size: ${relativeFontSizeToBase16(13)};
14
14
  line-height: 20px;
15
- padding: 0;
15
+ padding: ${"var(--ds-space-075, 6px)"} ${"var(--ds-space-400, 32px)"}
16
+ ${"var(--ds-space-075, 6px)"} ${"var(--ds-space-100, 8px)"};
16
17
  min-width: 145px;
17
18
 
18
19
  /* Hides IE10+ built-in [x] clear input button */
@@ -22,6 +23,7 @@ export const panelTextInput = css`
22
23
 
23
24
  &:focus {
24
25
  outline: none;
26
+ border-color: ${`var(--ds-border-focused, ${B100})`};
25
27
  }
26
28
 
27
29
  &::placeholder {
@@ -24,7 +24,7 @@ export var EditorSmartLinkPageObject = /*#__PURE__*/function (_InProductTestPage
24
24
  displayCardOption: 'block-appearance',
25
25
  displayEmbedOption: 'embed-appearance',
26
26
  linkUrl: 'link-url',
27
- linkLabel: 'link-label'
27
+ linkLabel: 'link-text'
28
28
  });
29
29
  _defineProperty(_assertThisInitialized(_this), "ariaLabels", {
30
30
  editLink: 'Edit link',
@@ -9,11 +9,12 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
9
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
11
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
12
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
12
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
15
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
16
  /** @jsx jsx */
17
+
17
18
  import React, { PureComponent } from 'react';
18
19
  import { css, jsx } from '@emotion/react';
19
20
  import debounce from 'lodash/debounce';
@@ -22,12 +23,10 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
22
23
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
23
24
  import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
24
25
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
25
- import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
26
- import LinkIcon from '@atlaskit/icon/glyph/link';
27
- import { N30, N80, N90 } from '@atlaskit/theme/colors';
26
+ import { N200, N90 } from '@atlaskit/theme/colors';
27
+ import { fontSizeSmall } from '@atlaskit/theme/constants';
28
28
  import Tooltip from '@atlaskit/tooltip';
29
29
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
30
- import { linkToolbarMessages as linkToolbarCommonMessages } from '../../../messages';
31
30
  import { Announcer, PanelTextInput } from '../../../ui';
32
31
  import { browser, normalizeUrl } from '../../../utils';
33
32
  import LinkSearchList from '../../LinkSearch/LinkSearchList';
@@ -42,8 +41,11 @@ import { filterUniqueItems, mapContentTypeToIcon, sha1, wordCount } from './util
42
41
  export var visuallyHiddenStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n clip: rect(1px, 1px, 1px, 1px);\n clip-path: inset(50%);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n"])));
43
42
  export var RECENT_SEARCH_LIST_SIZE = 5;
44
43
  var clearText = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n padding: 0;\n margin-right: ", ";\n color: ", ";\n background: transparent;\n border: none;\n"])), "var(--ds-space-100, 8px)", "var(--ds-icon-subtle, ".concat(N90, ")"));
45
- var textInputWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), inputWrapper, "var(--ds-border, ".concat(N30, ")"), "var(--ds-border, ".concat(N30, ")"));
46
- var iconWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n padding: ", " ", ";\n width: 18px;\n"])), "var(--ds-icon-subtle, ".concat(N80, ")"), "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)");
44
+ var clearTextWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0;\n"])));
45
+ var containerPadding = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: ", " ", ";\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)");
46
+ var textLabelMargin = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: ", ";\n"])), "var(--ds-space-150, 12px)");
47
+ var inputLabel = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n color: ", ";\n font-weight: 500;\n padding-bottom: ", ";\n"])), fontSizeSmall(), "var(--ds-text-subtlest, ".concat(N200, ")"), "var(--ds-space-050, 4px)");
48
+ var inputWrapperPosition = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n"])));
47
49
  export var messages = defineMessages({
48
50
  displayText: {
49
51
  id: 'fabric.editor.displayText',
@@ -70,10 +72,15 @@ export var messages = defineMessages({
70
72
  defaultMessage: '{count, plural, =0 {no results} one {# result} other {# results}} found',
71
73
  description: 'Announce search results for screen-reader users.'
72
74
  },
73
- linkAriaLabel: {
74
- id: 'fabric.editor.hyperlink.linkAriaLabel',
75
- defaultMessage: 'Link label',
76
- description: 'aria label for a link'
75
+ linkVisibleLabel: {
76
+ id: 'fabric.editor.hyperlink.linkVisibleLabel',
77
+ defaultMessage: 'Paste or search for link',
78
+ description: 'Visible label for link input in hyperlink floating control'
79
+ },
80
+ textVisibleLabel: {
81
+ id: 'fabric.editor.hyperlink.textVisibleLabel',
82
+ defaultMessage: 'Display text (optional)',
83
+ description: 'Visible label for text input in hyperlink floating control'
77
84
  }
78
85
  });
79
86
  var defaultIcon = jsx(Page16Icon, {
@@ -792,14 +799,12 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
792
799
  var _this$props5 = this.props,
793
800
  formatMessage = _this$props5.intl.formatMessage,
794
801
  activityProvider = _this$props5.activityProvider;
795
- var placeholder = formatMessage(activityProvider ? linkToolbarCommonMessages.placeholder : linkToolbarCommonMessages.linkPlaceholder);
796
- var formatLinkAddressText = formatMessage(linkToolbarCommonMessages.linkAddress);
797
802
  var formatClearLinkText = formatMessage(messages.clearLink);
798
- var formatDisplayText = formatMessage(messages.displayText);
799
803
  var screenReaderDescriptionId = 'search-recent-links-field-description';
800
804
  var linkSearchListId = 'hyperlink-search-list';
801
805
  var ariaActiveDescendant = selectedIndex > -1 ? "link-search-list-item-".concat(selectedIndex) : '';
802
-
806
+ var linkSearchInputId = 'search-recent-links-field-id';
807
+ var displayTextInputId = 'display-text-filed-id';
803
808
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
804
809
  // as the Aria design pattern for combobox does not work in this case
805
810
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
@@ -808,17 +813,14 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
808
813
  "aria-label": "Hyperlink Edit",
809
814
  className: "recent-list"
810
815
  }, jsx("div", {
811
- css: [container, !!activityProvider && containerWithProvider],
816
+ css: [container, !!activityProvider && containerWithProvider, containerPadding],
812
817
  ref: this.wrapperRef
813
- }, jsx("div", {
814
- css: inputWrapper
815
- }, jsx("span", {
816
- css: iconWrapper
817
- }, jsx(Tooltip, {
818
- content: formatLinkAddressText
819
- }, jsx(LinkIcon, {
820
- label: formatLinkAddressText
821
- }))), screenReaderText && jsx(Announcer, {
818
+ }, jsx("label", {
819
+ htmlFor: linkSearchInputId,
820
+ css: inputLabel
821
+ }, formatMessage(messages.linkVisibleLabel)), jsx("div", {
822
+ css: [inputWrapper, inputWrapperPosition]
823
+ }, screenReaderText && jsx(Announcer, {
822
824
  ariaLive: "assertive",
823
825
  text: screenReaderText,
824
826
  ariaRelevant: "additions",
@@ -837,7 +839,6 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
837
839
  ref: function ref(ele) {
838
840
  return _this2.urlInputContainer = ele;
839
841
  },
840
- placeholder: placeholder,
841
842
  testId: 'link-url',
842
843
  onSubmit: this.handleSubmit,
843
844
  onChange: this.updateInput,
@@ -846,8 +847,11 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
846
847
  },
847
848
  onCancel: this.handleCancel,
848
849
  defaultValue: displayUrl,
849
- onKeyDown: this.handleKeyDown
850
- }), displayUrl && jsx(Tooltip, {
850
+ onKeyDown: this.handleKeyDown,
851
+ inputId: linkSearchInputId
852
+ }), displayUrl && jsx("div", {
853
+ css: clearTextWrapper
854
+ }, jsx(Tooltip, {
851
855
  content: formatClearLinkText
852
856
  }, jsx("button", {
853
857
  type: "button",
@@ -856,27 +860,25 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
856
860
  tabIndex: 0
857
861
  }, jsx(CrossCircleIcon, {
858
862
  label: formatClearLinkText
859
- })))), jsx("div", {
860
- css: textInputWrapper
861
- }, jsx("span", {
862
- css: iconWrapper
863
- }, jsx(Tooltip, {
864
- content: formatDisplayText
865
- }, jsx(EditorAlignLeftIcon, {
866
- label: formatDisplayText
867
- }))), jsx(PanelTextInput, {
863
+ }))))), jsx("label", {
864
+ htmlFor: displayTextInputId,
865
+ css: [inputLabel, textLabelMargin]
866
+ }, formatMessage(messages.textVisibleLabel)), jsx("div", {
867
+ css: [inputWrapper, inputWrapperPosition]
868
+ }, jsx(PanelTextInput, {
868
869
  ref: function ref(ele) {
869
870
  return _this2.displayTextInputContainer = ele;
870
871
  },
871
- placeholder: formatDisplayText,
872
- ariaLabel: formatMessage(messages.linkAriaLabel),
873
- testId: 'link-label',
872
+ testId: 'link-text',
874
873
  onChange: this.updateTextInput,
875
874
  onCancel: this.handleCancel,
876
875
  defaultValue: displayText,
877
876
  onSubmit: this.handleSubmit,
878
- onKeyDown: this.handleKeyDown
879
- }), displayText && jsx(Tooltip, {
877
+ onKeyDown: this.handleKeyDown,
878
+ inputId: displayTextInputId
879
+ }), displayText && jsx("div", {
880
+ css: clearTextWrapper
881
+ }, jsx(Tooltip, {
880
882
  content: formatMessage(messages.clearText)
881
883
  }, jsx("button", {
882
884
  type: "button",
@@ -885,7 +887,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
885
887
  onKeyDown: this.handleClearTextKeyDown
886
888
  }, jsx(CrossCircleIcon, {
887
889
  label: formatMessage(messages.clearText)
888
- })))), jsx("div", {
890
+ }))))), jsx("div", {
889
891
  css: visuallyHiddenStyles,
890
892
  "aria-live": "polite",
891
893
  "aria-atomic": "true",
@@ -11,8 +11,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
11
11
  import { PureComponent } from 'react';
12
12
  import { css, jsx } from '@emotion/react';
13
13
  import Spinner from '@atlaskit/spinner';
14
+ import { N30 } from '@atlaskit/theme/colors';
14
15
  import LinkSearchListItem from './LinkSearchListItem';
15
- var listContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 0;\n"])));
16
+ var listContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 0;\n margin-top: ", ";\n border-top: 1px solid ", ";\n"])), "var(--ds-space-150, 12px)", "var(--ds-border, ".concat(N30, ")"));
16
17
  var spinnerContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-align: center;\n min-height: 80px;\n margin-top: 30px;\n"])));
17
18
  export var linkSearchList = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0;\n list-style: none;\n"])));
18
19
  var LinkSearchList = /*#__PURE__*/function (_PureComponent) {
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  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; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "76.9.0";
9
+ var packageVersion = "76.9.1";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
19
19
  import { borderRadius } from '@atlaskit/theme/constants';
20
20
  import Layer from '../Layer';
21
21
  var packageName = "@atlaskit/editor-common";
22
- var packageVersion = "76.9.0";
22
+ var packageVersion = "76.9.1";
23
23
  var halfFocusRing = 1;
24
24
  var dropOffset = '0, 8';
25
25
  var DropList = /*#__PURE__*/function (_Component) {
@@ -9,6 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
10
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
11
  /** @jsx jsx */
12
+
12
13
  import { PureComponent } from 'react';
13
14
  import { jsx } from '@emotion/react';
14
15
  import { browser } from '../../utils';
@@ -113,7 +114,8 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
113
114
  ariaControls = _this$props2.ariaControls,
114
115
  ariaExpanded = _this$props2.ariaExpanded,
115
116
  ariaAutoComplete = _this$props2.ariaAutoComplete,
116
- role = _this$props2.role;
117
+ role = _this$props2.role,
118
+ inputId = _this$props2.inputId;
117
119
  var value = this.state.value;
118
120
  return jsx("input", {
119
121
  css: [panelTextInput, width !== undefined && panelTextInputWithCustomWidth(width)],
@@ -133,7 +135,8 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
133
135
  onBlur: this.onBlur,
134
136
  ref: this.handleRef,
135
137
  maxLength: maxLength,
136
- "aria-label": ariaLabel
138
+ "aria-label": ariaLabel,
139
+ id: inputId
137
140
  });
138
141
  }
139
142
  }, {
@@ -2,9 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject, _templateObject2;
3
3
  import { css } from '@emotion/react';
4
4
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
5
- import { N100, N400 } from '@atlaskit/theme/colors';
5
+ import { B100, N100, N30, N400 } from '@atlaskit/theme/colors';
6
6
  // Normal .className gets overridden by input[type=text] hence this hack to produce input.className
7
- export var panelTextInput = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n input& {\n background: transparent;\n border: 0;\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: 0;\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-text-subtle, ".concat(N400, ")"), relativeFontSizeToBase16(13), "var(--ds-text-subtlest, ".concat(N100, ")"));
7
+ export var panelTextInput = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n input& {\n background: transparent;\n border: 2px solid ", ";\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: ", " ", "\n ", " ", ";\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-border, ".concat(N30, ")"), "var(--ds-text-subtle, ".concat(N400, ")"), relativeFontSizeToBase16(13), "var(--ds-space-075, 6px)", "var(--ds-space-400, 32px)", "var(--ds-space-075, 6px)", "var(--ds-space-100, 8px)", "var(--ds-border-focused, ".concat(B100, ")"), "var(--ds-text-subtlest, ".concat(N100, ")"));
8
8
  export var panelTextInputWithCustomWidth = function panelTextInputWithCustomWidth(width) {
9
9
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n input& {\n width: ", "px;\n }\n"])), width);
10
10
  };
@@ -1,9 +1,10 @@
1
1
  /// <reference types="cypress" />
2
2
  /// <reference types="cypress" />
3
3
  /// <reference types="cypress" />
4
- import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
4
+ import type { CypressType } from '@atlaskit/in-product-testing';
5
+ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
5
6
  import type { CardAppearance } from '@atlaskit/smart-card';
6
- import { EditorPageObject } from './Editor';
7
+ import type { EditorPageObject } from './Editor';
7
8
  export declare class EditorSmartLinkPageObject extends InProductTestPageObject {
8
9
  protected cy: CypressType;
9
10
  private editor;
@@ -1,14 +1,13 @@
1
- /** @jsx jsx */
2
1
  import React, { PureComponent } from 'react';
3
2
  import { jsx } from '@emotion/react';
4
- import { WrappedComponentProps } from 'react-intl-next';
5
- import { ActivityProvider } from '@atlaskit/activity-provider';
6
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
7
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { ActivityProvider } from '@atlaskit/activity-provider';
5
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
7
  import type { HyperlinkState } from '../../../link';
9
8
  import type { SearchProvider } from '../../../provider-factory';
10
9
  import type { Command, LinkInputType } from '../../../types';
11
- import { LinkSearchListItemData } from '../../LinkSearch/types';
10
+ import type { LinkSearchListItemData } from '../../LinkSearch/types';
12
11
  /**
13
12
  * Visible only to screenreaders. Use when there is a need
14
13
  * to provide more context to a non-sighted user.
@@ -41,7 +40,12 @@ export declare const messages: {
41
40
  defaultMessage: string;
42
41
  description: string;
43
42
  };
44
- linkAriaLabel: {
43
+ linkVisibleLabel: {
44
+ id: string;
45
+ defaultMessage: string;
46
+ description: string;
47
+ };
48
+ textVisibleLabel: {
45
49
  id: string;
46
50
  defaultMessage: string;
47
51
  description: string;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { PureComponent } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { LinkSearchListItemData } from './types';
4
+ import type { LinkSearchListItemData } from './types';
5
5
  export declare const linkSearchList: import("@emotion/react").SerializedStyles;
6
6
  export interface Props {
7
7
  items?: LinkSearchListItemData[];
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { FocusEvent, KeyboardEvent, PureComponent } from 'react';
2
+ import type { FocusEvent, KeyboardEvent } from 'react';
3
+ import { PureComponent } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  export interface Props {
5
6
  autoFocus?: boolean | FocusOptions;
@@ -23,6 +24,7 @@ export interface Props {
23
24
  ariaControls?: string;
24
25
  role?: string;
25
26
  ariaAutoComplete?: boolean;
27
+ inputId?: string;
26
28
  }
27
29
  export interface State {
28
30
  value?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.9.0",
3
+ "version": "76.9.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"