@contentful/field-editor-markdown 1.0.3 → 1.1.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.
@@ -7,7 +7,7 @@ import React, { useRef, useState, useEffect } from 'react';
7
7
  import { css, cx } from 'emotion';
8
8
  import tokens from '@contentful/f36-tokens';
9
9
  import { ConstraintsUtils, CharCounter, CharValidation, FieldConnector, ModalDialogLauncher } from '@contentful/field-editor-shared';
10
- import { Menu, Button, Tooltip, Flex, Paragraph, TextLink, ModalContent, Heading, Form, FormControl, TextInput, ModalControls, Text, Radio, Checkbox, EntityList } from '@contentful/f36-components';
10
+ import { Menu, Button, Tooltip, IconButton, Flex, Paragraph, TextLink, ModalContent, Heading, Form, FormControl, TextInput, ModalControls, Text, Radio, Checkbox, EntityList } from '@contentful/f36-components';
11
11
  import { AssetIcon, ChevronDownIcon, MoreHorizontalIcon, HeadingIcon, FormatBoldIcon, FormatItalicIcon, QuoteIcon, ListBulletedIcon, ListNumberedIcon, LinkIcon, CodeIcon, HorizontalRuleIcon, ChevronRightIcon, ChevronLeftIcon } from '@contentful/f36-icons';
12
12
  import transform from 'lodash-es/transform';
13
13
  import throttle from 'lodash-es/throttle';
@@ -446,24 +446,20 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
446
446
  isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
447
447
  otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
448
448
 
449
- var button = React.createElement(Button, Object.assign({}, otherProps, {
449
+ return React.createElement(Tooltip, {
450
+ className: styles$1.tooltip,
451
+ placement: tooltipPlace,
452
+ content: tooltip
453
+ }, React.createElement(IconButton, Object.assign({}, otherProps, {
450
454
  ref: ref,
451
455
  className: cx(styles$1.button, className),
452
456
  isDisabled: isDisabled,
453
457
  onClick: onClick,
454
458
  variant: variant,
455
- size: "small"
456
- }), children);
457
-
458
- if (tooltip) {
459
- return React.createElement(Tooltip, {
460
- className: styles$1.tooltip,
461
- placement: tooltipPlace,
462
- content: tooltip
463
- }, button);
464
- }
465
-
466
- return button;
459
+ size: "small",
460
+ icon: children,
461
+ "aria-label": tooltip
462
+ })));
467
463
  });
468
464
  ToolbarButton.displayName = 'ToolbarButton';
469
465
 
@@ -672,7 +668,8 @@ function DefaultMarkdownToolbar(props) {
672
668
  testId: "markdown-action-button-zen",
673
669
  variant: "secondary",
674
670
  onClick: props.actions.openZenMode,
675
- className: styles$1.zenButton
671
+ className: styles$1.zenButton,
672
+ tooltip: "Expand"
676
673
  }, React.createElement(Zen, {
677
674
  label: "Expand",
678
675
  className: styles$1.icon
@@ -691,18 +688,20 @@ function ZenMarkdownToolbar(props) {
691
688
  onSelectExisting: props.actions.linkExistingMedia,
692
689
  onAddNew: props.actions.addNewMedia,
693
690
  canAddNew: props.canUploadAssets
694
- }), React.createElement(Button, {
691
+ }), React.createElement(IconButton, {
695
692
  testId: "markdown-action-button-zen-close",
696
693
  variant: "secondary",
697
694
  size: "small",
698
695
  className: cx(styles$1.zenButton, styles$1.zenButtonPressed),
699
696
  onClick: function onClick() {
700
697
  props.actions.closeZenMode();
701
- }
702
- }, React.createElement(Zen, {
703
- label: "Collapse",
704
- className: styles$1.icon
705
- })))));
698
+ },
699
+ icon: React.createElement(Zen, {
700
+ label: "Collapse",
701
+ className: styles$1.icon
702
+ }),
703
+ "aria-label": "Collapse"
704
+ }))));
706
705
  }
707
706
  var MarkdownToolbar = /*#__PURE__*/React.memo(function (props) {
708
707
  if (props.mode === 'zen') {
@@ -2776,7 +2775,7 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
2776
2775
  setTitle(e.target.value);
2777
2776
  },
2778
2777
  testId: "link-title-field"
2779
- }), React.createElement(FormControl.HelpText, null, "Recommended for accessibility")))), React.createElement(ModalControls, null, React.createElement(Button, {
2778
+ }), React.createElement(FormControl.HelpText, null, "Extra link information, usually shown as a tooltip on mouse hover")))), React.createElement(ModalControls, null, React.createElement(Button, {
2780
2779
  testId: "insert-link-cancel",
2781
2780
  onClick: function onClick() {
2782
2781
  return onClose(false);