@gravity-ui/markdown-editor 13.5.2 → 13.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,10 +9,11 @@ const common_1 = require("../i18n/common");
|
|
|
9
9
|
const lodash_1 = require("../lodash");
|
|
10
10
|
const const_1 = require("./const");
|
|
11
11
|
const b = (0, classname_1.cn)('toolbar-button');
|
|
12
|
-
exports.ToolbarButtonView = react_1.default.forwardRef(function ToolbarButtonView({ icon, title, hotkey, disabledPopoverVisible = true, hintWhenDisabled, active, enabled, onClick, className, }, ref) {
|
|
12
|
+
exports.ToolbarButtonView = react_1.default.forwardRef(function ToolbarButtonView({ icon, title, hint, hotkey, disabledPopoverVisible = true, hintWhenDisabled, active, enabled, onClick, className, }, ref) {
|
|
13
13
|
var _a;
|
|
14
14
|
const disabled = !active && !enabled;
|
|
15
15
|
const titleText = (0, lodash_1.isFunction)(title) ? title() : title;
|
|
16
|
+
const hintText = (0, lodash_1.isFunction)(hint) ? hint() : hint;
|
|
16
17
|
const hideHintWhenDisabled = hintWhenDisabled === false || !disabledPopoverVisible || !disabled;
|
|
17
18
|
const hintWhenDisabledText = typeof hintWhenDisabled === 'string'
|
|
18
19
|
? hintWhenDisabled
|
|
@@ -20,7 +21,7 @@ exports.ToolbarButtonView = react_1.default.forwardRef(function ToolbarButtonVie
|
|
|
20
21
|
? hintWhenDisabled()
|
|
21
22
|
: (0, common_1.i18n)('toolbar_action_disabled');
|
|
22
23
|
return (react_1.default.createElement(uikit_1.Popover, { content: hintWhenDisabledText, disabled: hideHintWhenDisabled, tooltipContentClassName: b('action-disabled-tooltip'), placement: ['bottom'] },
|
|
23
|
-
react_1.default.createElement(uikit_1.ActionTooltip, { openDelay: const_1.ToolbarTooltipDelay.Open, closeDelay: const_1.ToolbarTooltipDelay.Close, title: titleText, hotkey: hotkey },
|
|
24
|
+
react_1.default.createElement(uikit_1.ActionTooltip, { openDelay: const_1.ToolbarTooltipDelay.Open, closeDelay: const_1.ToolbarTooltipDelay.Close, description: hintText, title: titleText, hotkey: hotkey },
|
|
24
25
|
react_1.default.createElement(uikit_1.Button, { size: "m", ref: ref, selected: active, disabled: disabled, view: active ? 'normal' : 'flat', onClick: onClick, className: b(null, [className]), extraProps: { 'aria-label': titleText } },
|
|
25
26
|
react_1.default.createElement(uikit_1.Icon, { data: icon.data, size: (_a = icon.size) !== null && _a !== void 0 ? _a : 16 })))));
|
|
26
27
|
});
|
package/build/cjs/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
/** During build process, the current version will be injected here */
|
|
5
|
-
exports.VERSION = typeof '13.5.
|
|
5
|
+
exports.VERSION = typeof '13.5.3' !== 'undefined' ? '13.5.3' : 'unknown';
|
|
@@ -6,10 +6,11 @@ import { isFunction } from '../lodash';
|
|
|
6
6
|
import { ToolbarTooltipDelay } from './const';
|
|
7
7
|
import './ToolbarButton.css';
|
|
8
8
|
const b = cn('toolbar-button');
|
|
9
|
-
export const ToolbarButtonView = React.forwardRef(function ToolbarButtonView({ icon, title, hotkey, disabledPopoverVisible = true, hintWhenDisabled, active, enabled, onClick, className, }, ref) {
|
|
9
|
+
export const ToolbarButtonView = React.forwardRef(function ToolbarButtonView({ icon, title, hint, hotkey, disabledPopoverVisible = true, hintWhenDisabled, active, enabled, onClick, className, }, ref) {
|
|
10
10
|
var _a;
|
|
11
11
|
const disabled = !active && !enabled;
|
|
12
12
|
const titleText = isFunction(title) ? title() : title;
|
|
13
|
+
const hintText = isFunction(hint) ? hint() : hint;
|
|
13
14
|
const hideHintWhenDisabled = hintWhenDisabled === false || !disabledPopoverVisible || !disabled;
|
|
14
15
|
const hintWhenDisabledText = typeof hintWhenDisabled === 'string'
|
|
15
16
|
? hintWhenDisabled
|
|
@@ -17,7 +18,7 @@ export const ToolbarButtonView = React.forwardRef(function ToolbarButtonView({ i
|
|
|
17
18
|
? hintWhenDisabled()
|
|
18
19
|
: i18n('toolbar_action_disabled');
|
|
19
20
|
return (React.createElement(Popover, { content: hintWhenDisabledText, disabled: hideHintWhenDisabled, tooltipContentClassName: b('action-disabled-tooltip'), placement: ['bottom'] },
|
|
20
|
-
React.createElement(ActionTooltip, { openDelay: ToolbarTooltipDelay.Open, closeDelay: ToolbarTooltipDelay.Close, title: titleText, hotkey: hotkey },
|
|
21
|
+
React.createElement(ActionTooltip, { openDelay: ToolbarTooltipDelay.Open, closeDelay: ToolbarTooltipDelay.Close, description: hintText, title: titleText, hotkey: hotkey },
|
|
21
22
|
React.createElement(Button, { size: "m", ref: ref, selected: active, disabled: disabled, view: active ? 'normal' : 'flat', onClick: onClick, className: b(null, [className]), extraProps: { 'aria-label': titleText } },
|
|
22
23
|
React.createElement(Icon, { data: icon.data, size: (_a = icon.size) !== null && _a !== void 0 ? _a : 16 })))));
|
|
23
24
|
});
|
package/build/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** During build process, the current version will be injected here */
|
|
2
|
-
export const VERSION = typeof '13.5.
|
|
2
|
+
export const VERSION = typeof '13.5.3' !== 'undefined' ? '13.5.3' : 'unknown';
|