@skbkontur/markdown 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import styled from '../../styles/styled-components';
|
|
|
9
9
|
* https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart-website/example-custom-styles.html
|
|
10
10
|
*/
|
|
11
11
|
/* stylelint-disable function-name-case */
|
|
12
|
-
export var EmojiPickerWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n em-emoji-picker {\n --font-family: inherit;\n --shadow: unset;\n --rgb-accent: ", ";\n --color-border: ", ";\n --rgb-background: ", ";\n --rgb-input: ", ";\n --rgb-color: ", ";\n\n max-height: 300px;\n
|
|
12
|
+
export var EmojiPickerWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n em-emoji-picker {\n --font-family: inherit;\n --shadow: unset;\n --rgb-accent: ", ";\n --color-border: ", ";\n --rgb-background: ", ";\n --rgb-input: ", ";\n --rgb-color: ", ";\n\n max-height: 300px;\n width: 100%;\n }\n"], ["\n em-emoji-picker {\n --font-family: inherit;\n --shadow: unset;\n --rgb-accent: ", ";\n --color-border: ", ";\n --rgb-background: ", ";\n --rgb-input: ", ";\n --rgb-color: ", ";\n\n max-height: 300px;\n width: 100%;\n }\n"])), function (_a) {
|
|
13
13
|
var theme = _a.theme;
|
|
14
14
|
return getColor(theme.colors.brand);
|
|
15
15
|
}, function (_a) {
|
|
@@ -16,7 +16,7 @@ export var EmojiDropdown = function (_a) {
|
|
|
16
16
|
return (React.createElement(DropdownMenu, { ref: dropdownMenuRef, caption: function (_a) {
|
|
17
17
|
var toggleMenu = _a.toggleMenu;
|
|
18
18
|
return (React.createElement(MarkdownFormatButton, { showShortKey: showShortKey, hintText: "Emoji", disabled: isPreviewMode, icon: React.createElement(EmojiFace, null), text: "Emoji", onClick: toggleMenu }));
|
|
19
|
-
}, positions: ['bottom right', 'bottom left', 'top right', 'top right'] },
|
|
19
|
+
}, menuWidth: 300, positions: ['bottom right', 'bottom left', 'top right', 'top right'] },
|
|
20
20
|
React.createElement(EmojiPickerWrapper, null,
|
|
21
21
|
React.createElement(EmojiPicker, { dynamicWidth: true, data: data, i18n: emojiLocale, locale: "ru", theme: currentTheme.themeMode, skinTonePosition: "none", previewPosition: "none", onEmojiSelect: handleSelectEmoji }))));
|
|
22
22
|
}));
|
|
@@ -51,10 +51,10 @@ export var MarkdownActions = function (_a) {
|
|
|
51
51
|
}),
|
|
52
52
|
hasFilesApi && !(hideOptions === null || hideOptions === void 0 ? void 0 : hideOptions.file) && (React.createElement(MarkdownFormatButton, { hintText: "\u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B", showShortKey: showShortKeys, disabled: isPreviewMode, isLoading: loadingFile, icon: React.createElement(AttachPaperclip, null), text: "\u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B", onClick: onOpenFileDialog })),
|
|
53
53
|
!(hideOptions === null || hideOptions === void 0 ? void 0 : hideOptions.emoji) && (React.createElement(EmojiDropdown, { showShortKey: showShortKeys, isPreviewMode: isPreviewMode, onSelect: onSelectEmoji })),
|
|
54
|
-
React.createElement(MarkdownFormatButton, { hintText: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F Markdown", icon: React.createElement(DocIcon, null), text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F Markdown", href: COMMONMARK_HELP_URL })),
|
|
54
|
+
!(hideOptions === null || hideOptions === void 0 ? void 0 : hideOptions.help) && (React.createElement(MarkdownFormatButton, { hintText: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F Markdown", icon: React.createElement(DocIcon, null), text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F Markdown", href: COMMONMARK_HELP_URL }))),
|
|
55
55
|
React.createElement(ActionsWrapper, null,
|
|
56
|
-
renderViewModeButton(),
|
|
57
|
-
React.createElement(MarkdownFormatButton, { hintText: fullscreen ? 'Свернуть' : 'Развернуть', icon: fullscreen ? React.createElement(Collapse, null) : React.createElement(Expand, null), text: fullscreen ? 'Свернуть' : 'Развернуть', onClick: onClickFullscreen })))));
|
|
56
|
+
!(hideOptions === null || hideOptions === void 0 ? void 0 : hideOptions.viewMode) && renderViewModeButton(),
|
|
57
|
+
!(hideOptions === null || hideOptions === void 0 ? void 0 : hideOptions.screenMode) && (React.createElement(MarkdownFormatButton, { hintText: fullscreen ? 'Свернуть' : 'Развернуть', icon: fullscreen ? React.createElement(Collapse, null) : React.createElement(Expand, null), text: fullscreen ? 'Свернуть' : ' Развернуть', onClick: onClickFullscreen }))))));
|
|
58
58
|
function renderViewModeButton() {
|
|
59
59
|
var buttonProps = {
|
|
60
60
|
hintText: isPreviewMode ? 'Вернуться в редактор' : 'Превью',
|
package/src/Markdown/types.d.ts
CHANGED
|
@@ -38,4 +38,4 @@ export interface TestCase<V, E> {
|
|
|
38
38
|
values: V;
|
|
39
39
|
}
|
|
40
40
|
export type ReactUIThemeType = Partial<typeof THEME_2022>;
|
|
41
|
-
export type HideActionsOptions = Partial<Record<MarkdownFormat | 'heading' | 'emoji' | 'allActions', boolean>>;
|
|
41
|
+
export type HideActionsOptions = Partial<Record<MarkdownFormat | 'heading' | 'emoji' | 'viewMode' | 'screenMode' | 'help' | 'allActions', boolean>>;
|