@gravity-ui/markdown-editor 15.26.1 → 15.27.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.
- package/build/cjs/bundle/MarkdownEditorView.js +1 -1
- package/build/cjs/bundle/MarkdownEditorView.js.map +1 -1
- package/build/cjs/bundle/types.d.ts +5 -0
- package/build/cjs/bundle/types.js.map +1 -1
- package/build/cjs/bundle/useMarkdownEditor.js +1 -0
- package/build/cjs/bundle/useMarkdownEditor.js.map +1 -1
- package/build/cjs/bundle/wysiwyg-preset.d.ts +1 -0
- package/build/cjs/bundle/wysiwyg-preset.js +1 -0
- package/build/cjs/bundle/wysiwyg-preset.js.map +1 -1
- package/build/cjs/extensions/behavior/Search/Search.d.ts +4 -0
- package/build/cjs/extensions/behavior/Search/Search.js +10 -0
- package/build/cjs/extensions/behavior/Search/Search.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/SearchViewPlugin.d.ts +7 -0
- package/build/cjs/extensions/behavior/Search/SearchViewPlugin.js +157 -0
- package/build/cjs/extensions/behavior/Search/SearchViewPlugin.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/commands.d.ts +7 -0
- package/build/cjs/extensions/behavior/Search/commands.js +42 -0
- package/build/cjs/extensions/behavior/Search/commands.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/const.d.ts +7 -0
- package/build/cjs/extensions/behavior/Search/const.js +10 -0
- package/build/cjs/extensions/behavior/Search/const.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/index.d.ts +1 -0
- package/build/cjs/extensions/behavior/Search/index.js +5 -0
- package/build/cjs/extensions/behavior/Search/index.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/key-handler.d.ts +1 -0
- package/build/cjs/extensions/behavior/Search/key-handler.js +14 -0
- package/build/cjs/extensions/behavior/Search/key-handler.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/search-plugin.css +7 -0
- package/build/cjs/extensions/behavior/Search/types.d.ts +3 -0
- package/build/cjs/extensions/behavior/Search/types.js +3 -0
- package/build/cjs/extensions/behavior/Search/types.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/utils/connect-tracker.d.ts +7 -0
- package/build/cjs/extensions/behavior/Search/utils/connect-tracker.js +24 -0
- package/build/cjs/extensions/behavior/Search/utils/connect-tracker.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/utils/focus-manager.d.ts +6 -0
- package/build/cjs/extensions/behavior/Search/utils/focus-manager.js +18 -0
- package/build/cjs/extensions/behavior/Search/utils/focus-manager.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/utils/search-counter.d.ts +3 -0
- package/build/cjs/extensions/behavior/Search/utils/search-counter.js +18 -0
- package/build/cjs/extensions/behavior/Search/utils/search-counter.js.map +1 -0
- package/build/cjs/extensions/behavior/Search/utils/wrap-command.d.ts +4 -0
- package/build/cjs/extensions/behavior/Search/utils/wrap-command.js +16 -0
- package/build/cjs/extensions/behavior/Search/utils/wrap-command.js.map +1 -0
- package/build/cjs/extensions/behavior/SelectionContext/index.d.ts +2 -0
- package/build/cjs/extensions/behavior/SelectionContext/index.js +20 -2
- package/build/cjs/extensions/behavior/SelectionContext/index.js.map +1 -1
- package/build/cjs/extensions/behavior/index.d.ts +2 -0
- package/build/cjs/extensions/behavior/index.js +3 -0
- package/build/cjs/extensions/behavior/index.js.map +1 -1
- package/build/cjs/i18n/search/en.json +9 -2
- package/build/cjs/i18n/search/index.d.ts +9 -2
- package/build/cjs/i18n/search/ru.json +10 -3
- package/build/cjs/markup/codemirror/create.js +1 -1
- package/build/cjs/markup/codemirror/create.js.map +1 -1
- package/build/cjs/markup/codemirror/search-plugin/plugin.d.ts +7 -9
- package/build/cjs/markup/codemirror/search-plugin/plugin.js +44 -55
- package/build/cjs/markup/codemirror/search-plugin/plugin.js.map +1 -1
- package/build/cjs/markup/codemirror/search-plugin/theme.d.ts +1 -0
- package/build/cjs/markup/codemirror/search-plugin/theme.js +15 -0
- package/build/cjs/markup/codemirror/search-plugin/theme.js.map +1 -0
- package/build/cjs/modules/search/components/SearchCardView.css +7 -0
- package/build/cjs/modules/search/components/SearchCardView.d.ts +17 -0
- package/build/cjs/modules/search/components/SearchCardView.js +22 -0
- package/build/cjs/modules/search/components/SearchCardView.js.map +1 -0
- package/build/cjs/modules/search/components/SearchCompactView.css +5 -0
- package/build/cjs/modules/search/components/SearchCompactView.d.ts +13 -0
- package/build/cjs/modules/search/components/SearchCompactView.js +26 -0
- package/build/cjs/modules/search/components/SearchCompactView.js.map +1 -0
- package/build/cjs/modules/search/components/SearchCounter.d.ts +6 -0
- package/build/cjs/modules/search/components/SearchCounter.js +15 -0
- package/build/cjs/modules/search/components/SearchCounter.js.map +1 -0
- package/build/cjs/modules/search/components/SearchPopup.css +9 -0
- package/build/cjs/modules/search/components/SearchPopup.d.ts +15 -0
- package/build/cjs/modules/search/components/SearchPopup.js +29 -0
- package/build/cjs/modules/search/components/SearchPopup.js.map +1 -0
- package/build/cjs/modules/search/components/SearchTextInput.d.ts +10 -0
- package/build/cjs/modules/search/components/SearchTextInput.js +24 -0
- package/build/cjs/modules/search/components/SearchTextInput.js.map +1 -0
- package/build/cjs/modules/search/hooks/use-search.d.ts +24 -0
- package/build/cjs/modules/search/hooks/use-search.js +47 -0
- package/build/cjs/modules/search/hooks/use-search.js.map +1 -0
- package/build/cjs/modules/search/index.d.ts +3 -0
- package/build/cjs/modules/search/index.js +9 -0
- package/build/cjs/modules/search/index.js.map +1 -0
- package/build/cjs/modules/search/qa.d.ts +14 -0
- package/build/cjs/modules/search/qa.js +18 -0
- package/build/cjs/modules/search/qa.js.map +1 -0
- package/build/cjs/modules/search/types.d.ts +10 -0
- package/build/cjs/modules/search/types.js +3 -0
- package/build/cjs/modules/search/types.js.map +1 -0
- package/build/cjs/react-utils/useAutoFocus.d.ts +1 -1
- package/build/cjs/react-utils/useAutoFocus.js +8 -10
- package/build/cjs/react-utils/useAutoFocus.js.map +1 -1
- package/build/cjs/version.js +1 -1
- package/build/cjs/version.js.map +1 -1
- package/build/esm/bundle/MarkdownEditorView.js +1 -1
- package/build/esm/bundle/MarkdownEditorView.js.map +1 -1
- package/build/esm/bundle/types.d.ts +5 -0
- package/build/esm/bundle/types.js.map +1 -1
- package/build/esm/bundle/useMarkdownEditor.js +1 -0
- package/build/esm/bundle/useMarkdownEditor.js.map +1 -1
- package/build/esm/bundle/wysiwyg-preset.d.ts +1 -0
- package/build/esm/bundle/wysiwyg-preset.js +1 -0
- package/build/esm/bundle/wysiwyg-preset.js.map +1 -1
- package/build/esm/extensions/behavior/Search/Search.d.ts +4 -0
- package/build/esm/extensions/behavior/Search/Search.js +6 -0
- package/build/esm/extensions/behavior/Search/Search.js.map +1 -0
- package/build/esm/extensions/behavior/Search/SearchViewPlugin.d.ts +7 -0
- package/build/esm/extensions/behavior/Search/SearchViewPlugin.js +153 -0
- package/build/esm/extensions/behavior/Search/SearchViewPlugin.js.map +1 -0
- package/build/esm/extensions/behavior/Search/commands.d.ts +7 -0
- package/build/esm/extensions/behavior/Search/commands.js +37 -0
- package/build/esm/extensions/behavior/Search/commands.js.map +1 -0
- package/build/esm/extensions/behavior/Search/const.d.ts +7 -0
- package/build/esm/extensions/behavior/Search/const.js +7 -0
- package/build/esm/extensions/behavior/Search/const.js.map +1 -0
- package/build/esm/extensions/behavior/Search/index.d.ts +1 -0
- package/build/esm/extensions/behavior/Search/index.js +2 -0
- package/build/esm/extensions/behavior/Search/index.js.map +1 -0
- package/build/esm/extensions/behavior/Search/key-handler.d.ts +1 -0
- package/build/esm/extensions/behavior/Search/key-handler.js +11 -0
- package/build/esm/extensions/behavior/Search/key-handler.js.map +1 -0
- package/build/esm/extensions/behavior/Search/search-plugin.css +7 -0
- package/build/esm/extensions/behavior/Search/types.d.ts +3 -0
- package/build/esm/extensions/behavior/Search/types.js +2 -0
- package/build/esm/extensions/behavior/Search/types.js.map +1 -0
- package/build/esm/extensions/behavior/Search/utils/connect-tracker.d.ts +7 -0
- package/build/esm/extensions/behavior/Search/utils/connect-tracker.js +21 -0
- package/build/esm/extensions/behavior/Search/utils/connect-tracker.js.map +1 -0
- package/build/esm/extensions/behavior/Search/utils/focus-manager.d.ts +6 -0
- package/build/esm/extensions/behavior/Search/utils/focus-manager.js +14 -0
- package/build/esm/extensions/behavior/Search/utils/focus-manager.js.map +1 -0
- package/build/esm/extensions/behavior/Search/utils/search-counter.d.ts +3 -0
- package/build/esm/extensions/behavior/Search/utils/search-counter.js +15 -0
- package/build/esm/extensions/behavior/Search/utils/search-counter.js.map +1 -0
- package/build/esm/extensions/behavior/Search/utils/wrap-command.d.ts +4 -0
- package/build/esm/extensions/behavior/Search/utils/wrap-command.js +13 -0
- package/build/esm/extensions/behavior/Search/utils/wrap-command.js.map +1 -0
- package/build/esm/extensions/behavior/SelectionContext/index.d.ts +2 -0
- package/build/esm/extensions/behavior/SelectionContext/index.js +19 -2
- package/build/esm/extensions/behavior/SelectionContext/index.js.map +1 -1
- package/build/esm/extensions/behavior/index.d.ts +2 -0
- package/build/esm/extensions/behavior/index.js +3 -0
- package/build/esm/extensions/behavior/index.js.map +1 -1
- package/build/esm/i18n/search/en.json +9 -2
- package/build/esm/i18n/search/index.d.ts +9 -2
- package/build/esm/i18n/search/ru.json +10 -3
- package/build/esm/markup/codemirror/create.js +1 -1
- package/build/esm/markup/codemirror/create.js.map +1 -1
- package/build/esm/markup/codemirror/search-plugin/plugin.d.ts +7 -9
- package/build/esm/markup/codemirror/search-plugin/plugin.js +44 -55
- package/build/esm/markup/codemirror/search-plugin/plugin.js.map +1 -1
- package/build/esm/markup/codemirror/search-plugin/theme.d.ts +1 -0
- package/build/esm/markup/codemirror/search-plugin/theme.js +12 -0
- package/build/esm/markup/codemirror/search-plugin/theme.js.map +1 -0
- package/build/esm/modules/search/components/SearchCardView.css +7 -0
- package/build/esm/modules/search/components/SearchCardView.d.ts +17 -0
- package/build/esm/modules/search/components/SearchCardView.js +18 -0
- package/build/esm/modules/search/components/SearchCardView.js.map +1 -0
- package/build/esm/modules/search/components/SearchCompactView.css +5 -0
- package/build/esm/modules/search/components/SearchCompactView.d.ts +13 -0
- package/build/esm/modules/search/components/SearchCompactView.js +22 -0
- package/build/esm/modules/search/components/SearchCompactView.js.map +1 -0
- package/build/esm/modules/search/components/SearchCounter.d.ts +6 -0
- package/build/esm/modules/search/components/SearchCounter.js +11 -0
- package/build/esm/modules/search/components/SearchCounter.js.map +1 -0
- package/build/esm/modules/search/components/SearchPopup.css +9 -0
- package/build/esm/modules/search/components/SearchPopup.d.ts +15 -0
- package/build/esm/modules/search/components/SearchPopup.js +24 -0
- package/build/esm/modules/search/components/SearchPopup.js.map +1 -0
- package/build/esm/modules/search/components/SearchTextInput.d.ts +10 -0
- package/build/esm/modules/search/components/SearchTextInput.js +20 -0
- package/build/esm/modules/search/components/SearchTextInput.js.map +1 -0
- package/build/esm/modules/search/hooks/use-search.d.ts +24 -0
- package/build/esm/modules/search/hooks/use-search.js +44 -0
- package/build/esm/modules/search/hooks/use-search.js.map +1 -0
- package/build/esm/modules/search/index.d.ts +3 -0
- package/build/esm/modules/search/index.js +4 -0
- package/build/esm/modules/search/index.js.map +1 -0
- package/build/esm/modules/search/qa.d.ts +14 -0
- package/build/esm/modules/search/qa.js +15 -0
- package/build/esm/modules/search/qa.js.map +1 -0
- package/build/esm/modules/search/types.d.ts +10 -0
- package/build/esm/modules/search/types.js +2 -0
- package/build/esm/modules/search/types.js.map +1 -0
- package/build/esm/react-utils/useAutoFocus.d.ts +1 -1
- package/build/esm/react-utils/useAutoFocus.js +7 -8
- package/build/esm/react-utils/useAutoFocus.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/styles.css +28 -10
- package/package.json +2 -4
- package/build/cjs/markup/codemirror/search-plugin/view/ReplaceIcons.d.ts +0 -3
- package/build/cjs/markup/codemirror/search-plugin/view/ReplaceIcons.js +0 -9
- package/build/cjs/markup/codemirror/search-plugin/view/ReplaceIcons.js.map +0 -1
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.css +0 -10
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.d.ts +0 -27
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.js +0 -83
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.js.map +0 -1
- package/build/esm/markup/codemirror/search-plugin/view/ReplaceIcons.d.ts +0 -3
- package/build/esm/markup/codemirror/search-plugin/view/ReplaceIcons.js +0 -4
- package/build/esm/markup/codemirror/search-plugin/view/ReplaceIcons.js.map +0 -1
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.css +0 -10
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.d.ts +0 -27
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.js +0 -77
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DOMProps } from '@gravity-ui/uikit';
|
|
2
|
+
import type { SearchCounter, SearchState } from "../types.js";
|
|
3
|
+
import "./SearchCardView.css";
|
|
4
|
+
export type SearchCardViewProps = DOMProps & {
|
|
5
|
+
counter?: SearchCounter;
|
|
6
|
+
searchState: SearchState;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onSearchChange: (value: string) => void;
|
|
9
|
+
onReplacementChange: (value: string) => void;
|
|
10
|
+
onFindPrevious: () => void;
|
|
11
|
+
onFindNext: () => void;
|
|
12
|
+
onReplace: () => void;
|
|
13
|
+
onReplaceAll: () => void;
|
|
14
|
+
onWholeWordChange: (value: boolean) => void;
|
|
15
|
+
onCaseSensitiveChange: (value: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const SearchCardView: React.FC<SearchCardViewProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { DelayedTextInput, FormRow } from '@gravity-ui/components';
|
|
4
|
+
import { Xmark } from '@gravity-ui/icons';
|
|
5
|
+
import { Button, Card, Checkbox, Flex, Icon, Text, sp } from '@gravity-ui/uikit';
|
|
6
|
+
import { cn } from "../../../classname.js";
|
|
7
|
+
import { i18n } from "../../../i18n/search/index.js";
|
|
8
|
+
import { useAutoFocus } from "../../../react-utils/useAutoFocus.js";
|
|
9
|
+
import { SearchQA } from "../qa.js";
|
|
10
|
+
import { SearchTextInput } from "./SearchTextInput.js";
|
|
11
|
+
import "./SearchCardView.css";
|
|
12
|
+
const b = cn('search-card');
|
|
13
|
+
export const SearchCardView = ({ style, className, counter, searchState, onClose, onSearchChange, onReplacementChange, onFindPrevious, onFindNext, onReplace, onReplaceAll, onWholeWordChange, onCaseSensitiveChange, }) => {
|
|
14
|
+
const searchInputRef = useRef(null);
|
|
15
|
+
useAutoFocus(searchInputRef, [], 200);
|
|
16
|
+
return (_jsxs(Card, { size: "l", spacing: { pt: 4, pb: 5, pl: 5, pr: 5 }, style: style, className: b(null, className), children: [_jsxs(Flex, { spacing: { mb: 5 }, alignItems: "center", justifyContent: "space-between", className: b('header'), children: [_jsx(Text, { variant: "subheader-2", className: b('title'), children: i18n('title') }), _jsx(Button, { size: "m", view: "flat", onClick: onClose, "aria-label": i18n('action_close'), qa: SearchQA.CloseBtn, children: _jsx(Icon, { data: Xmark }) })] }), _jsxs(FormRow, { direction: "row", label: i18n('title_search'), className: b('row', sp({ mb: 4 })), children: [_jsx(SearchTextInput, { counter: counter, onFindNext: onFindNext, onFindPrevious: onFindPrevious, controlRef: searchInputRef, className: sp({ mb: 2 }), onUpdate: onSearchChange, value: searchState.search, delay: 300 }), _jsx(Checkbox, { size: "m", onUpdate: onCaseSensitiveChange, checked: searchState.caseSensitive, qa: SearchQA.CaseSensitiveCheck, className: sp({ mr: 4 }), children: i18n('label_case-sensitive') }), _jsx(Checkbox, { size: "m", checked: searchState.wholeWord, onUpdate: onWholeWordChange, qa: SearchQA.WholeWordCheck, children: i18n('label_whole-word') })] }), _jsx(FormRow, { direction: "row", label: i18n('title_replace'), className: b('row', sp({ mb: 5 })), children: _jsx(DelayedTextInput, { size: "l", delay: 300, value: searchState.replace, onUpdate: onReplacementChange, qa: SearchQA.ReplaceInput }) }), _jsxs(Flex, { justifyContent: "flex-end", gap: 2, className: b('footer'), children: [_jsx(Button, { size: "l", view: "normal", onClick: onReplaceAll, disabled: !searchState.search, qa: SearchQA.ReplaceAllBtn, children: i18n('action_replace_all') }), _jsx(Button, { view: "action", size: "l", disabled: !searchState.search, onClick: onReplace, qa: SearchQA.ReplaceBtn, children: i18n('action_replace') })] })] }));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=SearchCardView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchCardView.js","sourceRoot":"../../../../../src","sources":["modules/search/components/SearchCardView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAiB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAC,MAAM,mBAAmB,CAAC;AAE9F,OAAO,EAAC,EAAE,EAAC,8BAAsB;AACjC,OAAO,EAAC,IAAI,EAAC,sCAAwB;AACrC,OAAO,EAAC,YAAY,EAAC,6CAAqC;AAE1D,OAAO,EAAC,QAAQ,EAAC,iBAAc;AAG/B,OAAO,EAAC,eAAe,EAAC,6BAA0B;AAElD,8BAA+B;AAgB/B,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAC1D,KAAK,EACL,SAAS,EAET,OAAO,EACP,WAAW,EACX,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,UAAU,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Aa,YAEzB,IAAI,CAAC,oBAAoB,CAAC,GACtB,EACT,KAAC,MAAM,IACH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,GAAG,EACR,QAAQ,EAAE,CAAC,WAAW,CAAC,MAAM,EAC7B,OAAO,EAAE,SAAS,EAClB,EAAE,EAAE,QAAQ,CAAC,UAAU,YAEtB,IAAI,CAAC,gBAAgB,CAAC,GAClB,IACN,IACJ,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useRef} from 'react';\n\nimport {DelayedTextInput, FormRow} from '@gravity-ui/components';\nimport {Xmark} from '@gravity-ui/icons';\nimport {Button, Card, Checkbox, type DOMProps, Flex, Icon, Text, sp} from '@gravity-ui/uikit';\n\nimport {cn} from 'src/classname';\nimport {i18n} from 'src/i18n/search';\nimport {useAutoFocus} from 'src/react-utils/useAutoFocus';\n\nimport {SearchQA} from '../qa';\nimport type {SearchCounter, SearchState} from '../types';\n\nimport {SearchTextInput} from './SearchTextInput';\n\nimport './SearchCardView.scss';\n\nexport type SearchCardViewProps = DOMProps & {\n counter?: SearchCounter;\n searchState: SearchState;\n onClose: () => void;\n onSearchChange: (value: string) => void;\n onReplacementChange: (value: string) => void;\n onFindPrevious: () => void;\n onFindNext: () => void;\n onReplace: () => void;\n onReplaceAll: () => void;\n onWholeWordChange: (value: boolean) => void;\n onCaseSensitiveChange: (value: boolean) => void;\n};\n\nconst b = cn('search-card');\n\nexport const SearchCardView: React.FC<SearchCardViewProps> = ({\n style,\n className,\n\n counter,\n searchState,\n onClose,\n onSearchChange,\n onReplacementChange,\n onFindPrevious,\n onFindNext,\n onReplace,\n onReplaceAll,\n onWholeWordChange,\n onCaseSensitiveChange,\n}) => {\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n useAutoFocus(searchInputRef, [], 200);\n\n return (\n <Card\n size=\"l\"\n spacing={{pt: 4, pb: 5, pl: 5, pr: 5}}\n style={style}\n className={b(null, className)}\n >\n <Flex\n spacing={{mb: 5}}\n alignItems=\"center\"\n justifyContent=\"space-between\"\n className={b('header')}\n >\n <Text variant=\"subheader-2\" className={b('title')}>\n {i18n('title')}\n </Text>\n <Button\n size=\"m\"\n view=\"flat\"\n onClick={onClose}\n aria-label={i18n('action_close')}\n qa={SearchQA.CloseBtn}\n >\n <Icon data={Xmark} />\n </Button>\n </Flex>\n\n <FormRow direction=\"row\" label={i18n('title_search')} className={b('row', sp({mb: 4}))}>\n <SearchTextInput\n counter={counter}\n onFindNext={onFindNext}\n onFindPrevious={onFindPrevious}\n controlRef={searchInputRef}\n className={sp({mb: 2})}\n onUpdate={onSearchChange}\n value={searchState.search}\n delay={300}\n />\n\n <Checkbox\n size=\"m\"\n onUpdate={onCaseSensitiveChange}\n checked={searchState.caseSensitive}\n qa={SearchQA.CaseSensitiveCheck}\n className={sp({mr: 4})}\n >\n {i18n('label_case-sensitive')}\n </Checkbox>\n\n <Checkbox\n size=\"m\"\n checked={searchState.wholeWord}\n onUpdate={onWholeWordChange}\n qa={SearchQA.WholeWordCheck}\n >\n {i18n('label_whole-word')}\n </Checkbox>\n </FormRow>\n\n <FormRow\n direction=\"row\"\n label={i18n('title_replace')}\n className={b('row', sp({mb: 5}))}\n >\n <DelayedTextInput\n size=\"l\"\n delay={300}\n value={searchState.replace}\n onUpdate={onReplacementChange}\n qa={SearchQA.ReplaceInput}\n />\n </FormRow>\n\n <Flex justifyContent=\"flex-end\" gap={2} className={b('footer')}>\n <Button\n size=\"l\"\n view=\"normal\"\n onClick={onReplaceAll}\n disabled={!searchState.search}\n qa={SearchQA.ReplaceAllBtn}\n >\n {i18n('action_replace_all')}\n </Button>\n <Button\n view=\"action\"\n size=\"l\"\n disabled={!searchState.search}\n onClick={onReplace}\n qa={SearchQA.ReplaceBtn}\n >\n {i18n('action_replace')}\n </Button>\n </Flex>\n </Card>\n );\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DOMProps, type QAProps } from '@gravity-ui/uikit';
|
|
2
|
+
import type { SearchCounter } from "../types.js";
|
|
3
|
+
import "./SearchCompactView.css";
|
|
4
|
+
export type SearchCompactProps = DOMProps & QAProps & {
|
|
5
|
+
value: string;
|
|
6
|
+
counter?: SearchCounter;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
onFindPrevious: () => void;
|
|
9
|
+
onFindNext: () => void;
|
|
10
|
+
onExpand: () => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const SeachCompactView: React.FC<SearchCompactProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { ChevronsExpandUpRight, Xmark } from '@gravity-ui/icons';
|
|
4
|
+
import { Button, ButtonIcon, Card, Icon, Tooltip, sp, } from '@gravity-ui/uikit';
|
|
5
|
+
import { cn } from "../../../classname.js";
|
|
6
|
+
import { i18n } from "../../../i18n/search/index.js";
|
|
7
|
+
import { useAutoFocus } from "../../../react-utils/useAutoFocus.js";
|
|
8
|
+
import { SearchQA } from "../qa.js";
|
|
9
|
+
import { SearchTextInput } from "./SearchTextInput.js";
|
|
10
|
+
import "./SearchCompactView.css";
|
|
11
|
+
const b = cn('search-compact');
|
|
12
|
+
export const SeachCompactView = function SearchCompactView({ value, counter, onChange, onFindNext, onFindPrevious, onExpand, onClose, qa, style, className, }) {
|
|
13
|
+
const inputRef = useRef(null);
|
|
14
|
+
useAutoFocus(inputRef, [], 200);
|
|
15
|
+
return (_jsxs(Card, { spacing: { pr: 1 }, "data-qa": qa, style: style, className: b(null, className), children: [_jsx(SearchTextInput, { counter: counter, onFindNext: onFindNext, onFindPrevious: onFindPrevious, value: value, view: "clear", delay: 300, onUpdate: onChange, controlRef: inputRef, placeholder: i18n('search_placeholder'), className: sp({ pl: 3 }) }), _jsx("div", { className: sp({ mr: 1 }), style: {
|
|
16
|
+
flexShrink: 0,
|
|
17
|
+
background: 'var(--g-color-line-generic-solid)',
|
|
18
|
+
height: '36px',
|
|
19
|
+
width: '1px',
|
|
20
|
+
} }), _jsx(Tooltip, { content: i18n('action_expand'), role: "label", children: (props, ref) => (_jsx(Button, { ...props, size: "m", view: "flat-secondary", onClick: onExpand, qa: SearchQA.ExpandBtn, ref: ref, "aria-label": i18n('action_expand'), children: _jsx(ButtonIcon, { children: _jsx(Icon, { data: ChevronsExpandUpRight }) }) })) }), _jsx(Button, { size: "m", view: "flat-secondary", onClick: onClose, className: sp({ ml: 1 }), "aria-label": i18n('action_close'), qa: SearchQA.CloseBtn, children: _jsx(ButtonIcon, { children: _jsx(Icon, { data: Xmark }) }) })] }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=SearchCompactView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchCompactView.js","sourceRoot":"../../../../../src","sources":["modules/search/components/SearchCompactView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAC,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACH,MAAM,EACN,UAAU,EACV,IAAI,EAEJ,IAAI,EAEJ,OAAO,EACP,EAAE,GACL,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAC,EAAE,EAAC,8BAAsB;AACjC,OAAO,EAAC,IAAI,EAAC,sCAAwB;AACrC,OAAO,EAAC,YAAY,EAAC,6CAAqC;AAE1D,OAAO,EAAC,QAAQ,EAAC,iBAAc;AAG/B,OAAO,EAAC,eAAe,EAAC,6BAA0B;AAElD,iCAAkC;AAElC,MAAM,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAa/B,MAAM,CAAC,MAAM,gBAAgB,GAAiC,SAAS,iBAAiB,CAAC,EACrF,KAAK,EACL,OAAO,EAEP,QAAQ,EACR,UAAU,EACV,cAAc,EACd,QAAQ,EACR,OAAO,EAEP,EAAE,EACF,KAA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AI,GAC5B,GACR,CACZ,GACK,EACV,KAAC,MAAM,IACH,IAAI,EAAC,GAAG,EACR,IAAI,EAAC,gBAAgB,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CAAC,EAAC,EAAE,EAAE,CAAC,EAAC,CAAC,gBACV,IAAI,CAAC,cAAc,CAAC,EAChC,EAAE,EAAE,QAAQ,CAAC,QAAQ,YAErB,KAAC,UAAU,cACP,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,GAAI,GACZ,GACR,IACN,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useRef} from 'react';\n\nimport {ChevronsExpandUpRight, Xmark} from '@gravity-ui/icons';\nimport {\n Button,\n ButtonIcon,\n Card,\n type DOMProps,\n Icon,\n type QAProps,\n Tooltip,\n sp,\n} from '@gravity-ui/uikit';\n\nimport {cn} from 'src/classname';\nimport {i18n} from 'src/i18n/search';\nimport {useAutoFocus} from 'src/react-utils/useAutoFocus';\n\nimport {SearchQA} from '../qa';\nimport type {SearchCounter} from '../types';\n\nimport {SearchTextInput} from './SearchTextInput';\n\nimport './SearchCompactView.scss';\n\nconst b = cn('search-compact');\n\nexport type SearchCompactProps = DOMProps &\n QAProps & {\n value: string;\n counter?: SearchCounter;\n onChange: (value: string) => void;\n onFindPrevious: () => void;\n onFindNext: () => void;\n onExpand: () => void;\n onClose: () => void;\n };\n\nexport const SeachCompactView: React.FC<SearchCompactProps> = function SearchCompactView({\n value,\n counter,\n\n onChange,\n onFindNext,\n onFindPrevious,\n onExpand,\n onClose,\n\n qa,\n style,\n className,\n}) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n useAutoFocus(inputRef, [], 200);\n\n return (\n <Card spacing={{pr: 1}} data-qa={qa} style={style} className={b(null, className)}>\n <SearchTextInput\n counter={counter}\n onFindNext={onFindNext}\n onFindPrevious={onFindPrevious}\n value={value}\n view=\"clear\"\n delay={300}\n onUpdate={onChange}\n controlRef={inputRef}\n placeholder={i18n('search_placeholder')}\n className={sp({pl: 3})}\n />\n\n <div\n className={sp({mr: 1})}\n style={{\n flexShrink: 0,\n background: 'var(--g-color-line-generic-solid)',\n height: '36px',\n width: '1px',\n }}\n />\n\n {/* eslint-disable-next-line jsx-a11y/aria-role */}\n <Tooltip content={i18n('action_expand')} role=\"label\">\n {(props, ref) => (\n <Button\n {...props}\n size=\"m\"\n view=\"flat-secondary\"\n onClick={onExpand}\n qa={SearchQA.ExpandBtn}\n ref={ref as React.Ref<HTMLButtonElement>}\n aria-label={i18n('action_expand')}\n >\n <ButtonIcon>\n <Icon data={ChevronsExpandUpRight} />\n </ButtonIcon>\n </Button>\n )}\n </Tooltip>\n <Button\n size=\"m\"\n view=\"flat-secondary\"\n onClick={onClose}\n className={sp({ml: 1})}\n aria-label={i18n('action_close')}\n qa={SearchQA.CloseBtn}\n >\n <ButtonIcon>\n <Icon data={Xmark} />\n </ButtonIcon>\n </Button>\n </Card>\n );\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '@gravity-ui/uikit';
|
|
3
|
+
import { i18n } from "../../../i18n/search/index.js";
|
|
4
|
+
import { SearchQA } from "../qa.js";
|
|
5
|
+
export const SearchCounterText = ({ counter, style, className }) => {
|
|
6
|
+
return (_jsx(Text, { whiteSpace: "nowrap", style: style, className: className, qa: SearchQA.Counter, children: i18n('search_counter', {
|
|
7
|
+
current: String(counter.current),
|
|
8
|
+
total: String(counter.total),
|
|
9
|
+
}) }));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=SearchCounter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchCounter.js","sourceRoot":"../../../../../src","sources":["modules/search/components/SearchCounter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgB,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAC,IAAI,EAAC,sCAAwB;AAErC,OAAO,EAAC,QAAQ,EAAC,iBAAc;AAO/B,MAAM,CAAC,MAAM,iBAAiB,GAAiC,CAAC,EAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,EAAE,EAAE;IAC3F,OAAO,CACH,KAAC,IAAI,IAAC,UAAU,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,YAC7E,IAAI,CAAC,gBAAgB,EAAE;YACpB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAChC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SAC/B,CAAC,GACC,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {type DOMProps, Text} from '@gravity-ui/uikit';\n\nimport {i18n} from 'src/i18n/search';\n\nimport {SearchQA} from '../qa';\nimport type {SearchCounter} from '../types';\n\nexport type SearchCounterProps = DOMProps & {\n counter: SearchCounter;\n};\n\nexport const SearchCounterText: React.FC<SearchCounterProps> = ({counter, style, className}) => {\n return (\n <Text whiteSpace=\"nowrap\" style={style} className={className} qa={SearchQA.Counter}>\n {i18n('search_counter', {\n current: String(counter.current),\n total: String(counter.total),\n })}\n </Text>\n );\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseSearchProps } from "../hooks/use-search.js";
|
|
2
|
+
import type { SearchCounter } from "../types.js";
|
|
3
|
+
import "./SearchPopup.css";
|
|
4
|
+
export type SearchPopupProps = UseSearchProps & {
|
|
5
|
+
open: boolean;
|
|
6
|
+
anchor: Element;
|
|
7
|
+
counter?: SearchCounter;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const SearchPopup: React.FC<SearchPopupProps>;
|
|
11
|
+
interface SearchPopupWithRefProps extends Omit<SearchPopupProps, 'anchor'> {
|
|
12
|
+
anchor: Element | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function renderSearchPopup({ anchor, ...props }: SearchPopupWithRefProps): JSX.Element | null;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Popup } from '@gravity-ui/uikit';
|
|
3
|
+
import { cn } from "../../../classname.js";
|
|
4
|
+
import { useSearch } from "../hooks/use-search.js";
|
|
5
|
+
import { SearchQA } from "../qa.js";
|
|
6
|
+
import { SearchCardView } from "./SearchCardView.js";
|
|
7
|
+
import { SeachCompactView } from "./SearchCompactView.js";
|
|
8
|
+
import "./SearchPopup.css";
|
|
9
|
+
const b = cn('search-popup');
|
|
10
|
+
export const SearchPopup = ({ open, anchor, counter, onClose, ...props }) => {
|
|
11
|
+
const { isCompact, searchState, handlers } = useSearch(props);
|
|
12
|
+
return (_jsx(Popup, { open: open, qa: SearchQA.Panel, anchorElement: anchor, placement: "bottom-end", className: b({ compact: isCompact }), onOpenChange: (_open, _event, reason) => {
|
|
13
|
+
if (reason === 'escape-key') {
|
|
14
|
+
onClose();
|
|
15
|
+
}
|
|
16
|
+
}, children: isCompact ? (_jsx(SeachCompactView, { counter: counter, onClose: onClose, value: searchState.search, onExpand: handlers.onExpand, onChange: handlers.onSearchChange, onFindNext: handlers.onFindNext, onFindPrevious: handlers.onFindPrevious })) : (_jsx(SearchCardView, { counter: counter, onClose: onClose, searchState: searchState, onSearchChange: handlers.onSearchChange, onReplacementChange: handlers.onReplaceChange, onFindNext: handlers.onFindNext, onFindPrevious: handlers.onFindPrevious, onReplace: handlers.onReplace, onReplaceAll: handlers.onReplaceAll, onWholeWordChange: handlers.onWholeWordChange, onCaseSensitiveChange: handlers.onCaseSensitiveChange })) }));
|
|
17
|
+
};
|
|
18
|
+
SearchPopup.displayName = 'SearchPopup';
|
|
19
|
+
export function renderSearchPopup({ anchor, ...props }) {
|
|
20
|
+
if (!anchor)
|
|
21
|
+
return null;
|
|
22
|
+
return _jsx(SearchPopup, { anchor: anchor, ...props });
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=SearchPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchPopup.js","sourceRoot":"../../../../../src","sources":["modules/search/components/SearchPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAC,EAAE,EAAC,8BAAsB;AAEjC,OAAO,EAAsB,SAAS,EAAC,+BAA4B;AACnE,OAAO,EAAC,QAAQ,EAAC,iBAAc;AAG/B,OAAO,EAAC,cAAc,EAAC,4BAAyB;AAChD,OAAO,EAAC,gBAAgB,EAAC,+BAA4B;AAErD,2BAA4B;AAE5B,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;AAS7B,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACpD,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACX,EAAE,EAAE;IACD,MAAM,EAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAE5D,OAAO,CACH,KAAC,KAAK,IACF,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,QAAQ,CAAC,KAAK,EAClB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,EAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACpC,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;gBAC1B,OAAO,EAAE,CAAC;YACd,CAAC;QACL,CAAC,YAEA,SAAS,CAAC,CAAC,CAAC,CACT,KAAC,gBAAgB,IACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,WAAW,CAAC,MAAM,EACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,QAAQ,EAAE,QAAQ,CAAC,cAAc,EACjC,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,cAAc,EAAE,QAAQ,CAAC,cAAc,GACzC,CACL,CAAC,CAAC,CAAC,CACA,KAAC,cAAc,IACX,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,QAAQ,CAAC,cAAc,EACvC,mBAAmB,EAAE,QAAQ,CAAC,eAAe,EAC7C,UAAU,EAAE,QAAQ,CAAC,UAAU,EAC/B,cAAc,EAAE,QAAQ,CAAC,cAAc,EACvC,SAAS,EAAE,QAAQ,CAAC,SAAS,EAC7B,YAAY,EAAE,QAAQ,CAAC,YAAY,EACnC,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,EAC7C,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB,GACvD,CACL,GACG,CACX,CAAC;AACN,CAAC,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAMxC,MAAM,UAAU,iBAAiB,CAAC,EAAC,MAAM,EAAE,GAAG,KAAK,EAA0B;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,OAAO,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CAAC;AACtD,CAAC","sourcesContent":["import {Popup} from '@gravity-ui/uikit';\n\nimport {cn} from 'src/classname';\n\nimport {type UseSearchProps, useSearch} from '../hooks/use-search';\nimport {SearchQA} from '../qa';\nimport type {SearchCounter} from '../types';\n\nimport {SearchCardView} from './SearchCardView';\nimport {SeachCompactView} from './SearchCompactView';\n\nimport './SearchPopup.scss';\n\nconst b = cn('search-popup');\n\nexport type SearchPopupProps = UseSearchProps & {\n open: boolean;\n anchor: Element;\n counter?: SearchCounter;\n onClose: () => void;\n};\n\nexport const SearchPopup: React.FC<SearchPopupProps> = ({\n open,\n anchor,\n counter,\n onClose,\n ...props\n}) => {\n const {isCompact, searchState, handlers} = useSearch(props);\n\n return (\n <Popup\n open={open}\n qa={SearchQA.Panel}\n anchorElement={anchor}\n placement=\"bottom-end\"\n className={b({compact: isCompact})}\n onOpenChange={(_open, _event, reason) => {\n if (reason === 'escape-key') {\n onClose();\n }\n }}\n >\n {isCompact ? (\n <SeachCompactView\n counter={counter}\n onClose={onClose}\n value={searchState.search}\n onExpand={handlers.onExpand}\n onChange={handlers.onSearchChange}\n onFindNext={handlers.onFindNext}\n onFindPrevious={handlers.onFindPrevious}\n />\n ) : (\n <SearchCardView\n counter={counter}\n onClose={onClose}\n searchState={searchState}\n onSearchChange={handlers.onSearchChange}\n onReplacementChange={handlers.onReplaceChange}\n onFindNext={handlers.onFindNext}\n onFindPrevious={handlers.onFindPrevious}\n onReplace={handlers.onReplace}\n onReplaceAll={handlers.onReplaceAll}\n onWholeWordChange={handlers.onWholeWordChange}\n onCaseSensitiveChange={handlers.onCaseSensitiveChange}\n />\n )}\n </Popup>\n );\n};\n\nSearchPopup.displayName = 'SearchPopup';\n\ninterface SearchPopupWithRefProps extends Omit<SearchPopupProps, 'anchor'> {\n anchor: Element | null;\n}\n\nexport function renderSearchPopup({anchor, ...props}: SearchPopupWithRefProps) {\n if (!anchor) return null;\n\n return <SearchPopup anchor={anchor} {...props} />;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DelayedTextInput } from '@gravity-ui/components';
|
|
2
|
+
import type { SearchCounter } from "../types.js";
|
|
3
|
+
type DelayedTextInputProps = React.ComponentProps<typeof DelayedTextInput>;
|
|
4
|
+
export type SearchTextInputProps = DelayedTextInputProps & {
|
|
5
|
+
counter?: SearchCounter;
|
|
6
|
+
onFindNext: () => void;
|
|
7
|
+
onFindPrevious: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const SearchTextInput: React.FC<SearchTextInputProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { DelayedTextInput } from '@gravity-ui/components';
|
|
4
|
+
import { ChevronDown, ChevronUp } from '@gravity-ui/icons';
|
|
5
|
+
import { Button, ButtonIcon, Icon, sp } from '@gravity-ui/uikit';
|
|
6
|
+
import { i18n } from "../../../i18n/search/index.js";
|
|
7
|
+
import { SearchQA } from "../qa.js";
|
|
8
|
+
import { SearchCounterText } from "./SearchCounter.js";
|
|
9
|
+
export const SearchTextInput = function SearchTextInput({ counter, onFindNext, onFindPrevious, ...inputProps }) {
|
|
10
|
+
const handleKeyDown = useCallback((event) => {
|
|
11
|
+
if (event.key === 'Enter') {
|
|
12
|
+
if (event.shiftKey)
|
|
13
|
+
onFindPrevious();
|
|
14
|
+
else
|
|
15
|
+
onFindNext();
|
|
16
|
+
}
|
|
17
|
+
}, [onFindNext, onFindPrevious]);
|
|
18
|
+
return (_jsx(DelayedTextInput, { size: "l", qa: SearchQA.FindInput, onKeyDown: handleKeyDown, endContent: Boolean(inputProps.value) && (_jsxs(_Fragment, { children: [counter && _jsx(SearchCounterText, { counter: counter, className: sp({ px: 1 }) }), _jsx(Button, { size: "m", view: "flat-secondary", onClick: onFindPrevious, "aria-label": i18n('action_prev'), qa: SearchQA.PrevBtn, children: _jsx(ButtonIcon, { children: _jsx(Icon, { data: ChevronUp }) }) }), _jsx(Button, { size: "m", view: "flat-secondary", onClick: onFindNext, className: sp({ ml: 1 }), "aria-label": i18n('action_next'), qa: SearchQA.NextBtn, children: _jsx(ButtonIcon, { children: _jsx(Icon, { data: ChevronDown }) }) })] })), ...inputProps }));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=SearchTextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchTextInput.js","sourceRoot":"../../../../../src","sources":["modules/search/components/SearchTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;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AAI,GAChB,GACR,EACT,KAAC,MAAM,IACH,IAAI,EAAC,GAAG,EACR,IAAI,EAAC,gBAAgB,EACrB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,EAAE,CAAC,EAAC,EAAE,EAAE,CAAC,EAAC,CAAC,gBACV,IAAI,CAAC,aAAa,CAAC,EAC/B,EAAE,EAAE,QAAQ,CAAC,OAAO,YAEpB,KAAC,UAAU,cACP,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI,GAClB,GACR,IACV,CACN,KAED,UAAU,GAChB,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useCallback} from 'react';\n\nimport {DelayedTextInput} from '@gravity-ui/components';\nimport {ChevronDown, ChevronUp} from '@gravity-ui/icons';\nimport {Button, ButtonIcon, Icon, sp} from '@gravity-ui/uikit';\n\nimport {i18n} from 'src/i18n/search';\n\nimport {SearchQA} from '../qa';\nimport type {SearchCounter} from '../types';\n\nimport {SearchCounterText} from './SearchCounter';\n\ntype DelayedTextInputProps = React.ComponentProps<typeof DelayedTextInput>;\n\nexport type SearchTextInputProps = DelayedTextInputProps & {\n counter?: SearchCounter;\n onFindNext: () => void;\n onFindPrevious: () => void;\n};\n\nexport const SearchTextInput: React.FC<SearchTextInputProps> = function SearchTextInput({\n counter,\n onFindNext,\n onFindPrevious,\n ...inputProps\n}) {\n const handleKeyDown = useCallback<React.KeyboardEventHandler>(\n (event) => {\n if (event.key === 'Enter') {\n if (event.shiftKey) onFindPrevious();\n else onFindNext();\n }\n },\n [onFindNext, onFindPrevious],\n );\n\n return (\n <DelayedTextInput\n size=\"l\"\n qa={SearchQA.FindInput}\n onKeyDown={handleKeyDown}\n endContent={\n Boolean(inputProps.value) && (\n <>\n {counter && <SearchCounterText counter={counter} className={sp({px: 1})} />}\n <Button\n size=\"m\"\n view=\"flat-secondary\"\n onClick={onFindPrevious}\n aria-label={i18n('action_prev')}\n qa={SearchQA.PrevBtn}\n >\n <ButtonIcon>\n <Icon data={ChevronUp} />\n </ButtonIcon>\n </Button>\n <Button\n size=\"m\"\n view=\"flat-secondary\"\n onClick={onFindNext}\n className={sp({ml: 1})}\n aria-label={i18n('action_next')}\n qa={SearchQA.NextBtn}\n >\n <ButtonIcon>\n <Icon data={ChevronDown} />\n </ButtonIcon>\n </Button>\n </>\n )\n }\n {...inputProps}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SearchState } from "../types.js";
|
|
2
|
+
export type UseSearchProps = {
|
|
3
|
+
state: SearchState;
|
|
4
|
+
onChange: (config: SearchState) => void;
|
|
5
|
+
onSearchPrev: (config: SearchState) => void;
|
|
6
|
+
onSearchNext: (config: SearchState) => void;
|
|
7
|
+
onReplaceNext: (config: SearchState) => void;
|
|
8
|
+
onReplaceAll: (config: SearchState) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function useSearch({ state, onChange, onSearchPrev, onSearchNext, onReplaceNext, onReplaceAll, }: UseSearchProps): {
|
|
11
|
+
isCompact: boolean;
|
|
12
|
+
searchState: SearchState;
|
|
13
|
+
handlers: {
|
|
14
|
+
onExpand: () => void;
|
|
15
|
+
onSearchChange: (value: string) => void;
|
|
16
|
+
onReplaceChange: (value: string) => void;
|
|
17
|
+
onWholeWordChange: (val: boolean) => void;
|
|
18
|
+
onCaseSensitiveChange: (val: boolean) => void;
|
|
19
|
+
onFindPrevious: () => void;
|
|
20
|
+
onFindNext: () => void;
|
|
21
|
+
onReplace: () => void;
|
|
22
|
+
onReplaceAll: () => void;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useBooleanState } from "../../../react-utils/index.js";
|
|
2
|
+
export function useSearch({ state, onChange, onSearchPrev, onSearchNext, onReplaceNext, onReplaceAll, }) {
|
|
3
|
+
const [isCompact, , showFullForm] = useBooleanState(true);
|
|
4
|
+
const handleSearchChange = (value) => {
|
|
5
|
+
onChange({ ...state, search: value });
|
|
6
|
+
};
|
|
7
|
+
const handleReplacementChange = (value) => {
|
|
8
|
+
onChange({ ...state, replace: value });
|
|
9
|
+
};
|
|
10
|
+
const handleFindPrevious = () => {
|
|
11
|
+
onSearchPrev(state);
|
|
12
|
+
};
|
|
13
|
+
const handleFindNext = () => {
|
|
14
|
+
onSearchNext(state);
|
|
15
|
+
};
|
|
16
|
+
const handleReplace = () => {
|
|
17
|
+
onReplaceNext(state);
|
|
18
|
+
};
|
|
19
|
+
const handleReplaceAll = () => {
|
|
20
|
+
onReplaceAll(state);
|
|
21
|
+
};
|
|
22
|
+
const handleCaseSensitiveChange = (val) => {
|
|
23
|
+
onChange({ ...state, caseSensitive: val });
|
|
24
|
+
};
|
|
25
|
+
const handleWholeWordChange = (val) => {
|
|
26
|
+
onChange({ ...state, wholeWord: val });
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
isCompact,
|
|
30
|
+
searchState: state,
|
|
31
|
+
handlers: {
|
|
32
|
+
onExpand: showFullForm,
|
|
33
|
+
onSearchChange: handleSearchChange,
|
|
34
|
+
onReplaceChange: handleReplacementChange,
|
|
35
|
+
onWholeWordChange: handleWholeWordChange,
|
|
36
|
+
onCaseSensitiveChange: handleCaseSensitiveChange,
|
|
37
|
+
onFindPrevious: handleFindPrevious,
|
|
38
|
+
onFindNext: handleFindNext,
|
|
39
|
+
onReplace: handleReplace,
|
|
40
|
+
onReplaceAll: handleReplaceAll,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=use-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-search.js","sourceRoot":"../../../../../src","sources":["modules/search/hooks/use-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,sCAAwB;AAahD,MAAM,UAAU,SAAS,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,GACC;IACb,MAAM,CAAC,SAAS,EAAE,AAA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AAc,EAAE,kBAAkB;YAClC,UAAU,EAAE,cAAc;YAE1B,SAAS,EAAE,aAAa;YACxB,YAAY,EAAE,gBAAgB;SACjC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {useBooleanState} from 'src/react-utils';\n\nimport type {SearchState} from '../types';\n\nexport type UseSearchProps = {\n state: SearchState;\n onChange: (config: SearchState) => void;\n onSearchPrev: (config: SearchState) => void;\n onSearchNext: (config: SearchState) => void;\n onReplaceNext: (config: SearchState) => void;\n onReplaceAll: (config: SearchState) => void;\n};\n\nexport function useSearch({\n state,\n onChange,\n onSearchPrev,\n onSearchNext,\n onReplaceNext,\n onReplaceAll,\n}: UseSearchProps) {\n const [isCompact, , showFullForm] = useBooleanState(true);\n\n const handleSearchChange = (value: string) => {\n onChange({...state, search: value});\n };\n\n const handleReplacementChange = (value: string) => {\n onChange({...state, replace: value});\n };\n\n const handleFindPrevious = () => {\n onSearchPrev(state);\n };\n\n const handleFindNext = () => {\n onSearchNext(state);\n };\n\n const handleReplace = () => {\n onReplaceNext(state);\n };\n\n const handleReplaceAll = () => {\n onReplaceAll(state);\n };\n\n const handleCaseSensitiveChange = (val: boolean) => {\n onChange({...state, caseSensitive: val});\n };\n\n const handleWholeWordChange = (val: boolean) => {\n onChange({...state, wholeWord: val});\n };\n\n return {\n isCompact,\n\n searchState: state,\n\n handlers: {\n onExpand: showFullForm,\n\n onSearchChange: handleSearchChange,\n onReplaceChange: handleReplacementChange,\n\n onWholeWordChange: handleWholeWordChange,\n onCaseSensitiveChange: handleCaseSensitiveChange,\n\n onFindPrevious: handleFindPrevious,\n onFindNext: handleFindNext,\n\n onReplace: handleReplace,\n onReplaceAll: handleReplaceAll,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../src","sources":["modules/search/index.ts"],"names":[],"mappings":"AAAA,2BAAwB;AACxB,4CAAyC;AACzC,OAAO,EAAC,QAAQ,EAAC,gBAAa","sourcesContent":["export * from './types';\nexport * from './components/SearchPopup';\nexport {SearchQA} from './qa';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SearchQA: {
|
|
2
|
+
readonly Panel: "g-md-search-panel";
|
|
3
|
+
readonly Counter: "g-md-search-counter";
|
|
4
|
+
readonly NextBtn: "g-md-search-next-btn";
|
|
5
|
+
readonly PrevBtn: "g-md-search-prev-btn";
|
|
6
|
+
readonly FindInput: "g-md-search-find-input";
|
|
7
|
+
readonly ReplaceInput: "g-md-search-replace-input";
|
|
8
|
+
readonly ReplaceBtn: "g-md-search-replace-btn";
|
|
9
|
+
readonly ReplaceAllBtn: "g-md-search-replace-all-btn";
|
|
10
|
+
readonly ExpandBtn: "g-md-search-expand-btn";
|
|
11
|
+
readonly CaseSensitiveCheck: "g-md-search-case-sensitive-check";
|
|
12
|
+
readonly WholeWordCheck: "g-md-search-whole-word-check";
|
|
13
|
+
readonly CloseBtn: "g-md-search-close-btn";
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SearchQA = {
|
|
2
|
+
Panel: 'g-md-search-panel',
|
|
3
|
+
Counter: 'g-md-search-counter',
|
|
4
|
+
NextBtn: 'g-md-search-next-btn',
|
|
5
|
+
PrevBtn: 'g-md-search-prev-btn',
|
|
6
|
+
FindInput: 'g-md-search-find-input',
|
|
7
|
+
ReplaceInput: 'g-md-search-replace-input',
|
|
8
|
+
ReplaceBtn: 'g-md-search-replace-btn',
|
|
9
|
+
ReplaceAllBtn: 'g-md-search-replace-all-btn',
|
|
10
|
+
ExpandBtn: 'g-md-search-expand-btn',
|
|
11
|
+
CaseSensitiveCheck: 'g-md-search-case-sensitive-check',
|
|
12
|
+
WholeWordCheck: 'g-md-search-whole-word-check',
|
|
13
|
+
CloseBtn: 'g-md-search-close-btn',
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=qa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa.js","sourceRoot":"../../../../src","sources":["modules/search/qa.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,sBAAsB;IAC/B,SAAS,EAAE,wBAAwB;IACnC,YAAY,EAAE,2BAA2B;IACzC,UAAU,EAAE,yBAAyB;IACrC,aAAa,EAAE,6BAA6B;IAC5C,SAAS,EAAE,wBAAwB;IACnC,kBAAkB,EAAE,kCAAkC;IACtD,cAAc,EAAE,8BAA8B;IAC9C,QAAQ,EAAE,uBAAuB;CAC3B,CAAC","sourcesContent":["export const SearchQA = {\n Panel: 'g-md-search-panel',\n Counter: 'g-md-search-counter',\n NextBtn: 'g-md-search-next-btn',\n PrevBtn: 'g-md-search-prev-btn',\n FindInput: 'g-md-search-find-input',\n ReplaceInput: 'g-md-search-replace-input',\n ReplaceBtn: 'g-md-search-replace-btn',\n ReplaceAllBtn: 'g-md-search-replace-all-btn',\n ExpandBtn: 'g-md-search-expand-btn',\n CaseSensitiveCheck: 'g-md-search-case-sensitive-check',\n WholeWordCheck: 'g-md-search-whole-word-check',\n CloseBtn: 'g-md-search-close-btn',\n} as const;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"../../../../src","sources":["modules/search/types.ts"],"names":[],"mappings":"","sourcesContent":["export type SearchState = {\n search: string;\n replace: string;\n caseSensitive: boolean;\n wholeWord: boolean;\n};\n\nexport type SearchCounter = {\n current: number;\n total: number;\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function useAutoFocus<T extends HTMLElement>(ref: RefObject<T>, dependencies?: unknown[], timeout?: number): void;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export function useAutoFocus(ref, dependencies = [], timeout = 0) {
|
|
3
3
|
useEffect(() => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
4
|
+
const timeoutId = setTimeout(() => {
|
|
5
|
+
ref.current?.focus();
|
|
6
|
+
}, timeout);
|
|
8
7
|
return () => {
|
|
9
|
-
clearTimeout(
|
|
8
|
+
clearTimeout(timeoutId);
|
|
10
9
|
};
|
|
11
10
|
// https://github.com/facebook/react/issues/23392#issuecomment-1055610198
|
|
12
11
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
},
|
|
14
|
-
}
|
|
12
|
+
}, dependencies);
|
|
13
|
+
}
|
|
15
14
|
//# sourceMappingURL=useAutoFocus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoFocus.js","sourceRoot":"../../../src","sources":["react-utils/useAutoFocus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhD,MAAM,
|
|
1
|
+
{"version":3,"file":"useAutoFocus.js","sourceRoot":"../../../src","sources":["react-utils/useAutoFocus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhD,MAAM,UAAU,YAAY,CACxB,GAAiB,EACjB,eAA0B,EAAE,EAC5B,OAAO,GAAG,CAAC;IAEX,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QACzB,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,GAAG,EAAE;YACR,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;QACF,yEAAyE;QACzE,uDAAuD;IAC3D,CAAC,EAAE,YAAY,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import {type RefObject, useEffect} from 'react';\n\nexport function useAutoFocus<T extends HTMLElement>(\n ref: RefObject<T>,\n dependencies: unknown[] = [],\n timeout = 0,\n) {\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n ref.current?.focus();\n }, timeout);\n\n return () => {\n clearTimeout(timeoutId);\n };\n // https://github.com/facebook/react/issues/23392#issuecomment-1055610198\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n"]}
|
package/build/esm/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** During build process, the current version will be injected here */
|
|
2
|
-
export const VERSION = typeof '15.
|
|
2
|
+
export const VERSION = typeof '15.27.1' !== 'undefined' ? '15.27.1' : 'unknown';
|
|
3
3
|
//# sourceMappingURL=version.js.map
|
package/build/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"../../src","sources":["version.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["/** During build process, the current version will be injected here */\nexport const VERSION = typeof '15.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"../../src","sources":["version.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["/** During build process, the current version will be injected here */\nexport const VERSION = typeof '15.27.1' !== 'undefined' ? '15.27.1' : 'unknown';\n"]}
|
package/build/styles.css
CHANGED
|
@@ -1661,6 +1661,13 @@ body :has(.g-md-resizable_resizing) {
|
|
|
1661
1661
|
background: rgba(127, 127, 127, 0.8);
|
|
1662
1662
|
transition: opacity 300ms ease-in 0s;
|
|
1663
1663
|
}
|
|
1664
|
+
.ProseMirror-search-match {
|
|
1665
|
+
background-color: var(--g-color-base-info-light);
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
.ProseMirror-active-search-match {
|
|
1669
|
+
background-color: var(--g-color-base-info-heavy);
|
|
1670
|
+
}
|
|
1664
1671
|
.g-md-editor.ProseMirror-focused .pm-node-selected {
|
|
1665
1672
|
box-shadow: var(--g-color-text-info) 0 0 0 1px;
|
|
1666
1673
|
}
|
|
@@ -1858,6 +1865,27 @@ body :has(.g-md-resizable_resizing) {
|
|
|
1858
1865
|
.cm-file-upload-widget + .cm-file-upload-widget {
|
|
1859
1866
|
margin-left: 2px;
|
|
1860
1867
|
}
|
|
1868
|
+
.g-md-search-card {
|
|
1869
|
+
width: 428px;
|
|
1870
|
+
}
|
|
1871
|
+
.g-md-search-card__row.g-md-search-card__row {
|
|
1872
|
+
--gc-form-row-label-width: 86px;
|
|
1873
|
+
--gc-form-row-field-height: 36px;
|
|
1874
|
+
}
|
|
1875
|
+
.g-md-search-compact {
|
|
1876
|
+
display: flex;
|
|
1877
|
+
align-items: center;
|
|
1878
|
+
width: 428px;
|
|
1879
|
+
}
|
|
1880
|
+
.g-md-search-popup {
|
|
1881
|
+
--g-popup-border-width: 0;
|
|
1882
|
+
--g-popup-border-radius: 16px;
|
|
1883
|
+
border-radius: 16px;
|
|
1884
|
+
}
|
|
1885
|
+
.g-md-search-popup_compact {
|
|
1886
|
+
--g-popup-border-radius: var(--g-border-radius-l);
|
|
1887
|
+
border-radius: var(--g-border-radius-l);
|
|
1888
|
+
}
|
|
1861
1889
|
.ProseMirror .pm-h-folding-hidden,
|
|
1862
1890
|
.yfm.ProseMirror .pm-h-folding-hidden {
|
|
1863
1891
|
display: none;
|
|
@@ -2250,16 +2278,6 @@ body :has(.g-md-resizable_resizing) {
|
|
|
2250
2278
|
.g-md-file-placeholder .yfm-file__icon {
|
|
2251
2279
|
margin-right: 8px;
|
|
2252
2280
|
}
|
|
2253
|
-
.g-md-search-card {
|
|
2254
|
-
width: 450px;
|
|
2255
|
-
padding: var(--g-spacing-2) var(--g-spacing-2) var(--g-spacing-3) var(--g-spacing-4);
|
|
2256
|
-
}
|
|
2257
|
-
.g-md-search-card__header {
|
|
2258
|
-
display: flex;
|
|
2259
|
-
justify-content: space-between;
|
|
2260
|
-
align-items: center;
|
|
2261
|
-
margin-bottom: var(--g-spacing-1);
|
|
2262
|
-
}
|
|
2263
2281
|
.g-md-gpt-dialog-loading-screen__header {
|
|
2264
2282
|
display: flex;
|
|
2265
2283
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/markdown-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.27.1",
|
|
4
4
|
"description": "Markdown wysiwyg and markup editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -208,6 +208,7 @@
|
|
|
208
208
|
"prosemirror-keymap": "^1.2.2",
|
|
209
209
|
"prosemirror-model": "^1.24.1",
|
|
210
210
|
"prosemirror-schema-list": "^1.5.0",
|
|
211
|
+
"prosemirror-search": "^1.1.0",
|
|
211
212
|
"prosemirror-state": "^1.4.3",
|
|
212
213
|
"prosemirror-test-builder": "^1.1.1",
|
|
213
214
|
"prosemirror-transform": "^1.10.2",
|
|
@@ -313,9 +314,6 @@
|
|
|
313
314
|
},
|
|
314
315
|
"lowlight": {
|
|
315
316
|
"optional": true
|
|
316
|
-
},
|
|
317
|
-
"@gravity-ui/components": {
|
|
318
|
-
"optional": true
|
|
319
317
|
}
|
|
320
318
|
},
|
|
321
319
|
"peerDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReplaceAllIcon = exports.ReplaceIcon = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ReplaceIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", width: 14, height: 14, ...props, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.221 3.739l2.261 2.269L7.7 3.784l-.7-.7-1.012 1.007-.008-1.6a.523.523 0 0 1 .5-.526H8V1H6.48A1.482 1.482 0 0 0 5 2.489V4.1L3.927 3.033l-.706.706zm6.67 1.794h.01c.183.311.451.467.806.467.393 0 .706-.168.94-.503.236-.335.353-.78.353-1.333 0-.511-.1-.913-.301-1.207-.201-.295-.488-.442-.86-.442-.405 0-.718.194-.938.581h-.01V1H9v4.919h.89v-.386zm-.015-1.061v-.34c0-.248.058-.448.175-.601a.54.54 0 0 1 .445-.23.49.49 0 0 1 .436.233c.104.154.155.368.155.643 0 .33-.056.587-.169.768a.524.524 0 0 1-.47.27.495.495 0 0 1-.411-.211.853.853 0 0 1-.16-.532zM9 12.769c-.256.154-.625.231-1.108.231-.563 0-1.02-.178-1.369-.533-.349-.355-.523-.813-.523-1.374 0-.648.186-1.158.56-1.53.374-.376.875-.563 1.5-.563.433 0 .746.06.94.179v.998a1.26 1.26 0 0 0-.792-.276c-.325 0-.583.1-.774.298-.19.196-.283.468-.283.816 0 .338.09.603.272.797.182.191.431.287.749.287.282 0 .558-.092.828-.276v.946zM4 7L3 8v6l1 1h7l1-1V8l-1-1H4zm0 1h7v6H4V8z" }) }));
|
|
6
|
-
exports.ReplaceIcon = ReplaceIcon;
|
|
7
|
-
const ReplaceAllIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", width: 14, height: 14, ...props, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.6 2.677c.147-.31.356-.465.626-.465.248 0 .44.118.573.353.134.236.201.557.201.966 0 .443-.078.798-.235 1.067-.156.268-.365.402-.627.402-.237 0-.416-.125-.537-.374h-.008v.31H11V1h.593v1.677h.008zm-.016 1.1a.78.78 0 0 0 .107.426c.071.113.163.169.274.169.136 0 .24-.072.314-.216.075-.145.113-.35.113-.615 0-.22-.035-.39-.104-.514-.067-.124-.164-.187-.29-.187-.12 0-.219.062-.297.185a.886.886 0 0 0-.117.48v.272zM4.12 7.695L2 5.568l.662-.662 1.006 1v-1.51A1.39 1.39 0 0 1 5.055 3H7.4v.905H5.055a.49.49 0 0 0-.468.493l.007 1.5.949-.944.656.656-2.08 2.085zM9.356 4.93H10V3.22C10 2.408 9.685 2 9.056 2c-.135 0-.285.024-.45.073a1.444 1.444 0 0 0-.388.167v.665c.237-.203.487-.304.75-.304.261 0 .392.156.392.469l-.6.103c-.506.086-.76.406-.76.961 0 .263.061.473.183.631A.61.61 0 0 0 8.69 5c.29 0 .509-.16.657-.48h.009v.41zm.004-1.355v.193a.75.75 0 0 1-.12.436.368.368 0 0 1-.313.17.276.276 0 0 1-.22-.095.38.38 0 0 1-.08-.248c0-.222.11-.351.332-.389l.4-.067zM7 12.93h-.644v-.41h-.009c-.148.32-.367.48-.657.48a.61.61 0 0 1-.507-.235c-.122-.158-.183-.368-.183-.63 0-.556.254-.876.76-.962l.6-.103c0-.313-.13-.47-.392-.47-.263 0-.513.102-.75.305v-.665c.095-.063.224-.119.388-.167.165-.049.315-.073.45-.073.63 0 .944.407.944 1.22v1.71zm-.64-1.162v-.193l-.4.068c-.222.037-.333.166-.333.388 0 .1.027.183.08.248a.276.276 0 0 0 .22.095.368.368 0 0 0 .312-.17c.08-.116.12-.26.12-.436zM9.262 13c.321 0 .568-.058.738-.173v-.71a.9.9 0 0 1-.552.207.619.619 0 0 1-.5-.215c-.12-.145-.181-.345-.181-.598 0-.26.063-.464.189-.612a.644.644 0 0 1 .516-.223c.194 0 .37.069.528.207v-.749c-.129-.09-.338-.134-.626-.134-.417 0-.751.14-1.001.422-.249.28-.373.662-.373 1.148 0 .42.116.764.349 1.03.232.267.537.4.913.4zM2 9l1-1h9l1 1v5l-1 1H3l-1-1V9zm1 0v5h9V9H3zm3-2l1-1h7l1 1v5l-1 1V7H6z" }) }));
|
|
8
|
-
exports.ReplaceAllIcon = ReplaceAllIcon;
|
|
9
|
-
//# sourceMappingURL=ReplaceIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReplaceIcons.js","sourceRoot":"../../../../../../src","sources":["markup/codemirror/search-plugin/view/ReplaceIcons.tsx"],"names":[],"mappings":";;;;AAEO,MAAM,WAAW,GAA4C,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3E,gCACI,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,KACN,KAAK,YAET,iCACI,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,y5BAAy5B,GAC75B,GACA,CACT,CAAC;AAfW,QAAA,WAAW,eAetB;AAEK,MAAM,cAAc,GAA4C,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9E,gCACI,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,KACN,KAAK,YAET,iCACI,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,2tDAA2tD,GAC/tD,GACA,CACT,CAAC;AAfW,QAAA,cAAc,kBAezB","sourcesContent":["import type React from 'react';\n\nexport const ReplaceIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n width={14}\n height={14}\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.221 3.739l2.261 2.269L7.7 3.784l-.7-.7-1.012 1.007-.008-1.6a.523.523 0 0 1 .5-.526H8V1H6.48A1.482 1.482 0 0 0 5 2.489V4.1L3.927 3.033l-.706.706zm6.67 1.794h.01c.183.311.451.467.806.467.393 0 .706-.168.94-.503.236-.335.353-.78.353-1.333 0-.511-.1-.913-.301-1.207-.201-.295-.488-.442-.86-.442-.405 0-.718.194-.938.581h-.01V1H9v4.919h.89v-.386zm-.015-1.061v-.34c0-.248.058-.448.175-.601a.54.54 0 0 1 .445-.23.49.49 0 0 1 .436.233c.104.154.155.368.155.643 0 .33-.056.587-.169.768a.524.524 0 0 1-.47.27.495.495 0 0 1-.411-.211.853.853 0 0 1-.16-.532zM9 12.769c-.256.154-.625.231-1.108.231-.563 0-1.02-.178-1.369-.533-.349-.355-.523-.813-.523-1.374 0-.648.186-1.158.56-1.53.374-.376.875-.563 1.5-.563.433 0 .746.06.94.179v.998a1.26 1.26 0 0 0-.792-.276c-.325 0-.583.1-.774.298-.19.196-.283.468-.283.816 0 .338.09.603.272.797.182.191.431.287.749.287.282 0 .558-.092.828-.276v.946zM4 7L3 8v6l1 1h7l1-1V8l-1-1H4zm0 1h7v6H4V8z\"\n />\n </svg>\n);\n\nexport const ReplaceAllIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n width={14}\n height={14}\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.6 2.677c.147-.31.356-.465.626-.465.248 0 .44.118.573.353.134.236.201.557.201.966 0 .443-.078.798-.235 1.067-.156.268-.365.402-.627.402-.237 0-.416-.125-.537-.374h-.008v.31H11V1h.593v1.677h.008zm-.016 1.1a.78.78 0 0 0 .107.426c.071.113.163.169.274.169.136 0 .24-.072.314-.216.075-.145.113-.35.113-.615 0-.22-.035-.39-.104-.514-.067-.124-.164-.187-.29-.187-.12 0-.219.062-.297.185a.886.886 0 0 0-.117.48v.272zM4.12 7.695L2 5.568l.662-.662 1.006 1v-1.51A1.39 1.39 0 0 1 5.055 3H7.4v.905H5.055a.49.49 0 0 0-.468.493l.007 1.5.949-.944.656.656-2.08 2.085zM9.356 4.93H10V3.22C10 2.408 9.685 2 9.056 2c-.135 0-.285.024-.45.073a1.444 1.444 0 0 0-.388.167v.665c.237-.203.487-.304.75-.304.261 0 .392.156.392.469l-.6.103c-.506.086-.76.406-.76.961 0 .263.061.473.183.631A.61.61 0 0 0 8.69 5c.29 0 .509-.16.657-.48h.009v.41zm.004-1.355v.193a.75.75 0 0 1-.12.436.368.368 0 0 1-.313.17.276.276 0 0 1-.22-.095.38.38 0 0 1-.08-.248c0-.222.11-.351.332-.389l.4-.067zM7 12.93h-.644v-.41h-.009c-.148.32-.367.48-.657.48a.61.61 0 0 1-.507-.235c-.122-.158-.183-.368-.183-.63 0-.556.254-.876.76-.962l.6-.103c0-.313-.13-.47-.392-.47-.263 0-.513.102-.75.305v-.665c.095-.063.224-.119.388-.167.165-.049.315-.073.45-.073.63 0 .944.407.944 1.22v1.71zm-.64-1.162v-.193l-.4.068c-.222.037-.333.166-.333.388 0 .1.027.183.08.248a.276.276 0 0 0 .22.095.368.368 0 0 0 .312-.17c.08-.116.12-.26.12-.436zM9.262 13c.321 0 .568-.058.738-.173v-.71a.9.9 0 0 1-.552.207.619.619 0 0 1-.5-.215c-.12-.145-.181-.345-.181-.598 0-.26.063-.464.189-.612a.644.644 0 0 1 .516-.223c.194 0 .37.069.528.207v-.749c-.129-.09-.338-.134-.626-.134-.417 0-.751.14-1.001.422-.249.28-.373.662-.373 1.148 0 .42.116.764.349 1.03.232.267.537.4.913.4zM2 9l1-1h9l1 1v5l-1 1H3l-1-1V9zm1 0v5h9V9H3zm3-2l1-1h7l1 1v5l-1 1V7H6z\"\n />\n </svg>\n);\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
.g-md-search-card {
|
|
2
|
-
width: 450px;
|
|
3
|
-
padding: var(--g-spacing-2) var(--g-spacing-2) var(--g-spacing-3) var(--g-spacing-4);
|
|
4
|
-
}
|
|
5
|
-
.g-md-search-card__header {
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
align-items: center;
|
|
9
|
-
margin-bottom: var(--g-spacing-1);
|
|
10
|
-
}
|