@yuntijs/ui 1.0.0-beta.9 → 1.0.0-beta.90
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/es/App/index.d.ts +7 -0
- package/es/App/index.js +19 -0
- package/es/ButtonGroup/index.d.ts +24 -0
- package/es/ButtonGroup/index.js +66 -0
- package/es/Card/index.d.ts +1 -0
- package/es/Card/index.js +1 -0
- package/es/CardList/Item/index.d.ts +4 -0
- package/es/CardList/Item/index.js +43 -0
- package/es/CardList/Item/style.d.ts +0 -0
- package/es/CardList/Item/style.js +0 -0
- package/es/CardList/index.d.ts +2 -0
- package/es/CardList/index.js +39 -0
- package/es/ChatInputArea/desktop/ChatInputArea.d.ts +19 -0
- package/es/ChatInputArea/desktop/ChatInputArea.js +72 -0
- package/es/ChatInputArea/index.d.ts +6 -0
- package/es/ChatInputArea/index.js +6 -0
- package/es/ChatItem/components/Actions.d.ts +10 -0
- package/es/ChatItem/components/Actions.js +23 -0
- package/es/ChatItem/components/MessageContent.d.ts +21 -0
- package/es/ChatItem/components/MessageContent.js +59 -0
- package/es/ChatItem/index.d.ts +4 -0
- package/es/ChatItem/index.js +120 -0
- package/es/ChatItem/style.d.ts +25 -0
- package/es/ChatItem/style.js +39 -0
- package/es/ChatItem/type.d.ts +86 -0
- package/es/ChatItem/type.js +1 -0
- package/es/CollapseGroup/index.d.ts +4 -0
- package/es/CollapseGroup/index.js +23 -0
- package/es/CollapseGroup/style.d.ts +3 -0
- package/es/CollapseGroup/style.js +11 -0
- package/es/ConfigProvider/index.d.ts +3 -0
- package/es/ConfigProvider/index.js +17 -11
- package/es/Descriptions/index.d.ts +14 -0
- package/es/Descriptions/index.js +31 -0
- package/es/Descriptions/style.d.ts +4 -0
- package/es/Descriptions/style.js +24 -0
- package/es/Divider/index.d.ts +38 -0
- package/es/Divider/index.js +66 -0
- package/es/Divider/style.d.ts +3 -0
- package/es/Divider/style.js +12 -0
- package/es/DragPanel/index.d.ts +10 -0
- package/es/DragPanel/index.js +97 -0
- package/es/DragPanel/style.d.ts +7 -0
- package/es/DragPanel/style.js +15 -0
- package/es/Drawer/index.d.ts +13 -0
- package/es/Drawer/index.js +20 -0
- package/es/Drawer/style.d.ts +4 -0
- package/es/Drawer/style.js +16 -0
- package/es/Dropdown/index.d.ts +14 -0
- package/es/Dropdown/index.js +59 -0
- package/es/Dropdown/style.d.ts +7 -0
- package/es/Dropdown/style.js +13 -0
- package/es/EditableMessage/index.d.ts +75 -0
- package/es/EditableMessage/index.js +99 -0
- package/es/Form/collapse-list/index.d.ts +40 -0
- package/es/Form/collapse-list/index.js +209 -0
- package/es/Form/collapse-list/style.d.ts +5 -0
- package/es/Form/collapse-list/style.js +13 -0
- package/es/Form/index.d.ts +8 -0
- package/es/Form/index.js +5 -0
- package/es/FormHelper/autoFocus.d.ts +10 -0
- package/es/FormHelper/autoFocus.js +38 -0
- package/es/FormHelper/index.d.ts +13 -0
- package/es/FormHelper/index.js +41 -0
- package/es/Highlighter/FullFeatured.d.ts +18 -0
- package/es/Highlighter/FullFeatured.js +102 -0
- package/es/Highlighter/SyntaxHighlighter/index.d.ts +7 -0
- package/es/Highlighter/SyntaxHighlighter/index.js +51 -0
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
- package/es/Highlighter/SyntaxHighlighter/style.js +16 -0
- package/es/Highlighter/index.d.ts +50 -0
- package/es/Highlighter/index.js +77 -0
- package/es/Highlighter/style.d.ts +9 -0
- package/es/Highlighter/style.js +23 -0
- package/es/Highlighter/theme.d.ts +1 -0
- package/es/Highlighter/theme.js +1661 -0
- package/es/JsonViewer/index.d.ts +21 -0
- package/es/JsonViewer/index.js +120 -0
- package/es/JsonViewer/style.d.ts +7 -0
- package/es/JsonViewer/style.js +19 -0
- package/es/LogViewer/index.d.ts +10 -0
- package/es/LogViewer/index.js +141 -0
- package/es/LogViewer/style.d.ts +6 -0
- package/es/LogViewer/style.js +16 -0
- package/es/LogViewer/types.d.ts +235 -0
- package/es/LogViewer/types.js +1 -0
- package/es/Mentions/constants.d.ts +6 -0
- package/es/Mentions/constants.js +28 -0
- package/es/Mentions/hooks.d.ts +20 -0
- package/es/Mentions/hooks.js +133 -0
- package/es/Mentions/index.d.ts +23 -0
- package/es/Mentions/index.js +157 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.d.ts +7 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.js +35 -0
- package/es/Mentions/plugins/custom-text/node.d.ts +11 -0
- package/es/Mentions/plugins/custom-text/node.js +72 -0
- package/es/Mentions/plugins/editable.d.ts +4 -0
- package/es/Mentions/plugins/editable.js +13 -0
- package/es/Mentions/plugins/mention-node/component.d.ts +6 -0
- package/es/Mentions/plugins/mention-node/component.js +64 -0
- package/es/Mentions/plugins/mention-node/index.d.ts +9 -0
- package/es/Mentions/plugins/mention-node/index.js +32 -0
- package/es/Mentions/plugins/mention-node/node.d.ts +22 -0
- package/es/Mentions/plugins/mention-node/node.js +100 -0
- package/es/Mentions/plugins/mention-node/replacement.d.ts +5 -0
- package/es/Mentions/plugins/mention-node/replacement.js +43 -0
- package/es/Mentions/plugins/mention-node/style.d.ts +8 -0
- package/es/Mentions/plugins/mention-node/style.js +47 -0
- package/es/Mentions/plugins/mention-node/utils.d.ts +4 -0
- package/es/Mentions/plugins/mention-node/utils.js +10 -0
- package/es/Mentions/plugins/mention-picker/hooks.d.ts +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.js +65 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +39 -0
- package/es/Mentions/plugins/mention-picker/index.js +137 -0
- package/es/Mentions/plugins/mention-picker/menu-item.d.ts +12 -0
- package/es/Mentions/plugins/mention-picker/menu-item.js +73 -0
- package/es/Mentions/plugins/mention-picker/menu.d.ts +10 -0
- package/es/Mentions/plugins/mention-picker/menu.js +31 -0
- package/es/Mentions/plugins/mention-picker/style.d.ts +11 -0
- package/es/Mentions/plugins/mention-picker/style.js +19 -0
- package/es/Mentions/plugins/mention-picker/utils.d.ts +31 -0
- package/es/Mentions/plugins/mention-picker/utils.js +66 -0
- package/es/Mentions/provider.d.ts +12 -0
- package/es/Mentions/provider.js +15 -0
- package/es/Mentions/style.d.ts +11 -0
- package/es/Mentions/style.js +22 -0
- package/es/Mentions/types.d.ts +12 -0
- package/es/Mentions/types.js +1 -0
- package/es/Mentions/utils.d.ts +9 -0
- package/es/Mentions/utils.js +95 -0
- package/es/Modal/index.d.ts +19 -0
- package/es/Modal/index.js +36 -0
- package/es/Modal/style.d.ts +4 -0
- package/es/Modal/style.js +17 -0
- package/es/MonacoEditor/base/controller.d.ts +17 -0
- package/es/MonacoEditor/base/controller.js +49 -0
- package/es/MonacoEditor/base/helper.d.ts +65 -0
- package/es/MonacoEditor/base/helper.js +324 -0
- package/es/MonacoEditor/base/index.d.ts +39 -0
- package/es/MonacoEditor/base/index.js +238 -0
- package/es/MonacoEditor/base/monaco.d.ts +6 -0
- package/es/MonacoEditor/base/monaco.js +64 -0
- package/es/MonacoEditor/{style.d.ts → base/style.d.ts} +4 -1
- package/es/MonacoEditor/base/style.js +43 -0
- package/es/MonacoEditor/index.d.ts +5 -4
- package/es/MonacoEditor/index.js +26 -62
- package/es/Page/Breadcrumb/index.d.ts +9 -0
- package/es/Page/Breadcrumb/index.js +56 -0
- package/es/Page/Content/index.d.ts +4 -0
- package/es/Page/Content/index.js +59 -0
- package/es/Page/Content/style.d.ts +3 -0
- package/es/Page/Content/style.js +12 -0
- package/es/Page/Footer/index.d.ts +2 -0
- package/es/Page/Footer/index.js +6 -0
- package/es/Page/Header/Icon.d.ts +17 -0
- package/es/Page/Header/Icon.js +42 -0
- package/es/Page/Header/index.d.ts +43 -0
- package/es/Page/Header/index.js +202 -0
- package/es/Page/Header/style.d.ts +12 -0
- package/es/Page/Header/style.js +21 -0
- package/es/Page/Page.d.ts +9 -0
- package/es/Page/Page.js +49 -0
- package/es/Page/PageContext.d.ts +15 -0
- package/es/Page/PageContext.js +21 -0
- package/es/Page/Title/index.d.ts +5 -0
- package/es/Page/Title/index.js +18 -0
- package/es/Page/Title/style.d.ts +3 -0
- package/es/Page/Title/style.js +10 -0
- package/es/Page/index.d.ts +18 -0
- package/es/Page/index.js +15 -0
- package/es/Page/style.d.ts +3 -0
- package/es/Page/style.js +10 -0
- package/es/ProCard/Card/index.d.ts +6 -0
- package/es/ProCard/Card/index.js +25 -0
- package/es/ProCard/Card/style.d.ts +7 -0
- package/es/ProCard/Card/style.js +15 -0
- package/es/ProCard/Content/index.d.ts +4 -0
- package/es/ProCard/Content/index.js +24 -0
- package/es/ProCard/Content/style.d.ts +3 -0
- package/es/ProCard/Content/style.js +10 -0
- package/es/ProCard/Descriptions/index.d.ts +4 -0
- package/es/ProCard/Descriptions/index.js +28 -0
- package/es/ProCard/Descriptions/style.d.ts +3 -0
- package/es/ProCard/Descriptions/style.js +12 -0
- package/es/ProCard/Header/index.d.ts +15 -0
- package/es/ProCard/Header/index.js +86 -0
- package/es/ProCard/Header/style.d.ts +12 -0
- package/es/ProCard/Header/style.js +21 -0
- package/es/ProCard/index.d.ts +13 -0
- package/es/ProCard/index.js +8 -0
- package/es/SelectCard/index.d.ts +33 -0
- package/es/SelectCard/index.js +132 -0
- package/es/SelectCard/style.d.ts +10 -0
- package/es/SelectCard/style.js +42 -0
- package/es/SliderInput/index.js +2 -2
- package/es/Status/index.d.ts +7 -0
- package/es/Status/index.js +39 -0
- package/es/Status/style.d.ts +4 -0
- package/es/Status/style.js +14 -0
- package/es/Table/collapse/index.d.ts +9 -0
- package/es/Table/collapse/index.js +39 -0
- package/es/Table/collapse/style.d.ts +3 -0
- package/es/Table/collapse/style.js +11 -0
- package/es/Table/index.d.ts +20 -0
- package/es/Table/index.js +56 -0
- package/es/Typography/index.d.ts +32 -0
- package/es/Typography/index.js +77 -0
- package/es/WaveformIcon/index.d.ts +9 -0
- package/es/WaveformIcon/index.js +51 -0
- package/es/hooks/languageMap.d.ts +1 -0
- package/es/hooks/languageMap.js +1 -0
- package/es/hooks/useHighlight.d.ts +5 -0
- package/es/hooks/useHighlight.js +78 -0
- package/es/index.d.ts +38 -3
- package/es/index.js +48 -3
- package/es/notification/index.d.ts +24 -0
- package/es/notification/index.js +237 -0
- package/es/notification/style.d.ts +2 -0
- package/es/notification/style.js +28 -0
- package/es/styles/colors/colors.d.ts +39 -0
- package/es/styles/colors/colors.js +86 -0
- package/es/styles/colors/generateColorPalette.d.ts +11 -0
- package/es/styles/colors/generateColorPalette.js +31 -0
- package/es/styles/colors/neutralColors.d.ts +9 -0
- package/es/styles/colors/neutralColors.js +32 -0
- package/es/styles/index.d.ts +4 -0
- package/es/styles/index.js +4 -0
- package/es/useSpeechSynthes/const/polyfill.d.ts +3 -0
- package/es/useSpeechSynthes/const/polyfill.js +21 -0
- package/es/useSpeechSynthes/index.d.ts +13 -0
- package/es/useSpeechSynthes/index.js +69 -0
- package/es/utils/constants.d.ts +1 -0
- package/es/utils/constants.js +1 -0
- package/es/utils/tools.d.ts +1 -0
- package/es/utils/tools.js +1 -0
- package/package.json +31 -9
- package/umd/index.min.css +2 -0
- package/umd/index.min.css.map +1 -0
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
- package/es/MonacoEditor/style.js +0 -24
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuOption } from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
3
|
+
export interface MentionMenuOptionInitParams {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
icon?: JSX.Element;
|
|
8
|
+
extraElement?: JSX.Element;
|
|
9
|
+
keywords?: Array<string>;
|
|
10
|
+
keyboardShortcut?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onSelect: (queryString: string) => void;
|
|
13
|
+
isChild?: boolean;
|
|
14
|
+
children?: MentionMenuOptionInitParams[];
|
|
15
|
+
}
|
|
16
|
+
export declare class MentionMenuOption extends MenuOption {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
title: string;
|
|
20
|
+
key: string;
|
|
21
|
+
icon?: JSX.Element;
|
|
22
|
+
extraElement?: JSX.Element;
|
|
23
|
+
keywords: Array<string>;
|
|
24
|
+
keyboardShortcut?: string;
|
|
25
|
+
onSelect: (queryString: string) => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
data?: any;
|
|
28
|
+
children?: MentionMenuOption[];
|
|
29
|
+
isChild?: boolean;
|
|
30
|
+
constructor({ label, value, data, icon, extraElement, keywords, keyboardShortcut, disabled, onSelect, children, isChild, }: MentionMenuOptionInitParams);
|
|
31
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
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; }
|
|
10
|
+
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); }; }
|
|
11
|
+
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; } }
|
|
12
|
+
import { MenuOption } from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
13
|
+
export var MentionMenuOption = /*#__PURE__*/function (_MenuOption) {
|
|
14
|
+
_inherits(MentionMenuOption, _MenuOption);
|
|
15
|
+
var _super = _createSuper(MentionMenuOption);
|
|
16
|
+
function MentionMenuOption(_ref) {
|
|
17
|
+
var _this;
|
|
18
|
+
var label = _ref.label,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
data = _ref.data,
|
|
21
|
+
icon = _ref.icon,
|
|
22
|
+
extraElement = _ref.extraElement,
|
|
23
|
+
keywords = _ref.keywords,
|
|
24
|
+
keyboardShortcut = _ref.keyboardShortcut,
|
|
25
|
+
disabled = _ref.disabled,
|
|
26
|
+
onSelect = _ref.onSelect,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
isChild = _ref.isChild;
|
|
29
|
+
_classCallCheck(this, MentionMenuOption);
|
|
30
|
+
_this = _super.call(this, value);
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "label", void 0);
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "value", void 0);
|
|
33
|
+
// for Tree, the same as label
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "title", void 0);
|
|
35
|
+
// for Tree, the same as value
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "key", void 0);
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "icon", void 0);
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "extraElement", void 0);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "keywords", void 0);
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "keyboardShortcut", void 0);
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "onSelect", void 0);
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "disabled", void 0);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "isChild", void 0);
|
|
46
|
+
_this.value = value;
|
|
47
|
+
_this.label = label;
|
|
48
|
+
_this.title = label;
|
|
49
|
+
_this.key = value;
|
|
50
|
+
_this.keywords = keywords || [];
|
|
51
|
+
_this.icon = icon;
|
|
52
|
+
_this.extraElement = extraElement;
|
|
53
|
+
_this.keyboardShortcut = keyboardShortcut;
|
|
54
|
+
_this.onSelect = onSelect.bind(_assertThisInitialized(_this));
|
|
55
|
+
_this.disabled = disabled;
|
|
56
|
+
_this.data = data;
|
|
57
|
+
_this.isChild = isChild !== null && isChild !== void 0 ? isChild : false;
|
|
58
|
+
_this.children = children === null || children === void 0 ? void 0 : children.map(function (m) {
|
|
59
|
+
return new MentionMenuOption(_objectSpread(_objectSpread({}, m), {}, {
|
|
60
|
+
isChild: true
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
return _createClass(MentionMenuOption);
|
|
66
|
+
}(MenuOption);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MentionsOptionsMap } from './types';
|
|
3
|
+
interface Value {
|
|
4
|
+
optionsMap: MentionsOptionsMap;
|
|
5
|
+
}
|
|
6
|
+
export declare const MentionsConfigContext: import("react").Context<Value | null>;
|
|
7
|
+
export declare const MentionsConfigProvider: import("react").NamedExoticComponent<{
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
value: Value;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const useOptionsMap: () => MentionsOptionsMap | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext, memo, useContext } from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var MentionsConfigContext = /*#__PURE__*/createContext(null);
|
|
4
|
+
export var MentionsConfigProvider = /*#__PURE__*/memo(function (_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
value = _ref.value;
|
|
7
|
+
return /*#__PURE__*/_jsx(MentionsConfigContext.Provider, {
|
|
8
|
+
value: value,
|
|
9
|
+
children: children
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
export var useOptionsMap = function useOptionsMap() {
|
|
13
|
+
var config = useContext(MentionsConfigContext);
|
|
14
|
+
return config === null || config === void 0 ? void 0 : config.optionsMap;
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AutoSize } from './types';
|
|
2
|
+
export declare const useStyles: (props?: {
|
|
3
|
+
autoSize?: AutoSize | undefined;
|
|
4
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
+
wrapper: import("antd-style").SerializedStyles;
|
|
6
|
+
placeholder: import("antd-style").SerializedStyles;
|
|
7
|
+
root: import("antd-style").SerializedStyles;
|
|
8
|
+
filled: import("antd-style").SerializedStyles;
|
|
9
|
+
borderless: import("antd-style").SerializedStyles;
|
|
10
|
+
disabled: import("antd-style").SerializedStyles;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
var inputHeight = 32;
|
|
5
|
+
var lineHeight = 22;
|
|
6
|
+
var calculateHeight = function calculateHeight(rows) {
|
|
7
|
+
return inputHeight + Math.max(rows - 1, 0) * lineHeight;
|
|
8
|
+
};
|
|
9
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
10
|
+
var css = _ref.css,
|
|
11
|
+
token = _ref.token,
|
|
12
|
+
prefixCls = _ref.prefixCls;
|
|
13
|
+
var autoSize = _ref2.autoSize;
|
|
14
|
+
return {
|
|
15
|
+
wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n width: 100%;\n min-width: 0;\n "]))),
|
|
16
|
+
placeholder: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pointer-events: none;\n user-select: none;\n\n position: absolute;\n top: 0;\n left: 13px;\n\n height: ", "px;\n\n font-size: ", "px;\n line-height: ", "px;\n color: ", ";\n "])), inputHeight, token.fontSize, inputHeight, token.colorTextPlaceholder),
|
|
17
|
+
root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n outline: none;\n border: 1px solid ", ";\n border-radius: ", "px;\n\n margin: 0;\n padding: 4px 11px;\n\n color: ", ";\n font-size: ", "px;\n font-family: ", ";\n\n display: inline-block;\n\n width: 100%;\n min-width: 0;\n\n ", "\n ", "\n overflow: auto;\n\n transition: all ", ";\n &:focus {\n border-color: ", ";\n }\n p {\n margin-bottom: 0;\n margin-block: 0 0;\n line-height: ", "px;\n }\n "])), token.colorBorder, token.borderRadius, token.colorText, token.fontSize, token.fontFamily, (autoSize === null || autoSize === void 0 ? void 0 : autoSize.minRows) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), calculateHeight(autoSize.minRows)), (autoSize === null || autoSize === void 0 ? void 0 : autoSize.maxRows) && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), calculateHeight(autoSize.maxRows)), token.motionDurationMid, token.colorPrimaryBorder, lineHeight),
|
|
18
|
+
filled: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background: ", ";\n border-color: transparent;\n &:hover {\n background: ", ";\n }\n &:focus {\n background: ", ";\n }\n "])), token.colorFillTertiary, token.colorFillSecondary, token.colorBgBase),
|
|
19
|
+
borderless: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n "]))),
|
|
20
|
+
disabled: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n color: ", ";\n background: ", ";\n "])), token.colorTextDisabled, token.colorBgContainerDisabled)
|
|
21
|
+
};
|
|
22
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MentionMenuOptionInitParams } from './plugins/mention-picker/utils';
|
|
2
|
+
export interface MentionOption extends Omit<MentionMenuOptionInitParams, 'onSelect' | 'children'> {
|
|
3
|
+
/** 选中后展示的 label 名称,不指定则直接使用 label */
|
|
4
|
+
selectedLabel?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
children?: MentionOption[];
|
|
7
|
+
}
|
|
8
|
+
export type MentionsOptionsMap = Record<string, MentionOption>;
|
|
9
|
+
export interface AutoSize {
|
|
10
|
+
minRows?: number;
|
|
11
|
+
maxRows?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EntityMatch } from '@lexical/text';
|
|
2
|
+
import type { LexicalNode, TextNode } from 'lexical';
|
|
3
|
+
import { CustomTextNode } from './plugins/custom-text/node';
|
|
4
|
+
export declare const INSERT_MENTION_COMMAND: import("lexical").LexicalCommand<unknown>;
|
|
5
|
+
export declare const DELETE_MENTION_COMMAND: import("lexical").LexicalCommand<unknown>;
|
|
6
|
+
export declare const CLEAR_HIDE_MENU_TIMEOUT: import("lexical").LexicalCommand<unknown>;
|
|
7
|
+
export declare const UPDATE_MENTIONS_OPTIONS: import("lexical").LexicalCommand<unknown>;
|
|
8
|
+
export declare const decoratorTransform: (node: CustomTextNode, getMatch: (text: string) => null | EntityMatch, createNode: (textNode: TextNode) => LexicalNode) => void;
|
|
9
|
+
export declare function textToEditorState(text: string): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { $isTextNode, createCommand } from 'lexical';
|
|
3
|
+
export var INSERT_MENTION_COMMAND = createCommand('INSERT_MENTION_COMMAND');
|
|
4
|
+
export var DELETE_MENTION_COMMAND = createCommand('DELETE_MENTION_COMMAND');
|
|
5
|
+
export var CLEAR_HIDE_MENU_TIMEOUT = createCommand('CLEAR_HIDE_MENU_TIMEOUT');
|
|
6
|
+
export var UPDATE_MENTIONS_OPTIONS = createCommand('UPDATE_MENTIONS_OPTIONS');
|
|
7
|
+
export var decoratorTransform = function decoratorTransform(node, getMatch, createNode) {
|
|
8
|
+
if (!node.isSimpleText()) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
var prevSibling = node.getPreviousSibling();
|
|
12
|
+
var text = node.getTextContent();
|
|
13
|
+
var currentNode = node;
|
|
14
|
+
var match;
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line no-constant-condition
|
|
17
|
+
while (true) {
|
|
18
|
+
match = getMatch(text);
|
|
19
|
+
var nextText = match === null ? '' : text.slice(match.end);
|
|
20
|
+
text = nextText;
|
|
21
|
+
if (nextText === '') {
|
|
22
|
+
var nextSibling = currentNode.getNextSibling();
|
|
23
|
+
if ($isTextNode(nextSibling)) {
|
|
24
|
+
nextText = currentNode.getTextContent() + nextSibling.getTextContent();
|
|
25
|
+
var nextMatch = getMatch(nextText);
|
|
26
|
+
if (nextMatch === null) {
|
|
27
|
+
nextSibling.markDirty();
|
|
28
|
+
return;
|
|
29
|
+
} else if (nextMatch.start !== 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
var _nextMatch = getMatch(nextText);
|
|
35
|
+
if (_nextMatch !== null && _nextMatch.start === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (match === null) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (match.start === 0 && $isTextNode(prevSibling) && prevSibling.isTextEntity()) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
var nodeToReplace = void 0;
|
|
46
|
+
if (match.start === 0) {
|
|
47
|
+
var _currentNode$splitTex = currentNode.splitText(match.end);
|
|
48
|
+
var _currentNode$splitTex2 = _slicedToArray(_currentNode$splitTex, 2);
|
|
49
|
+
nodeToReplace = _currentNode$splitTex2[0];
|
|
50
|
+
currentNode = _currentNode$splitTex2[1];
|
|
51
|
+
} else {
|
|
52
|
+
var _currentNode$splitTex3 = currentNode.splitText(match.start, match.end);
|
|
53
|
+
var _currentNode$splitTex4 = _slicedToArray(_currentNode$splitTex3, 3);
|
|
54
|
+
nodeToReplace = _currentNode$splitTex4[1];
|
|
55
|
+
currentNode = _currentNode$splitTex4[2];
|
|
56
|
+
}
|
|
57
|
+
var replacementNode = createNode(nodeToReplace);
|
|
58
|
+
nodeToReplace.replace(replacementNode);
|
|
59
|
+
|
|
60
|
+
// eslint-disable-next-line eqeqeq
|
|
61
|
+
if (currentNode == null) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export function textToEditorState(text) {
|
|
67
|
+
var paragraph = text.split('\n');
|
|
68
|
+
return JSON.stringify({
|
|
69
|
+
root: {
|
|
70
|
+
children: paragraph.map(function (p) {
|
|
71
|
+
return {
|
|
72
|
+
children: [{
|
|
73
|
+
detail: 0,
|
|
74
|
+
format: 0,
|
|
75
|
+
mode: 'normal',
|
|
76
|
+
style: '',
|
|
77
|
+
text: p,
|
|
78
|
+
type: 'custom-text',
|
|
79
|
+
version: 1
|
|
80
|
+
}],
|
|
81
|
+
direction: 'ltr',
|
|
82
|
+
format: '',
|
|
83
|
+
indent: 0,
|
|
84
|
+
type: 'paragraph',
|
|
85
|
+
version: 1
|
|
86
|
+
};
|
|
87
|
+
}),
|
|
88
|
+
direction: 'ltr',
|
|
89
|
+
format: '',
|
|
90
|
+
indent: 0,
|
|
91
|
+
type: 'root',
|
|
92
|
+
version: 1
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ModalFuncProps as AntdModalFuncProps, type ModalProps as AntdModalProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type ModalFuncProps = AntdModalFuncProps;
|
|
4
|
+
interface CustomModalProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description Whether support border-bottom of header and border-top of footer.
|
|
7
|
+
* @default 'true'
|
|
8
|
+
*/
|
|
9
|
+
borderd?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ModalProps extends AntdModalProps, CustomModalProps {
|
|
12
|
+
}
|
|
13
|
+
export declare const Modal: React.FC<AntdModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
14
|
+
useModal: typeof import("antd/es/modal/useModal").default;
|
|
15
|
+
destroyAll: () => void;
|
|
16
|
+
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
17
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
export default Modal;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "borderd"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
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; }
|
|
6
|
+
import { Modal as AntdModal } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { prefixCls } from "../utils/constants";
|
|
9
|
+
import { useStyles } from "./style";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var OriginModal = function OriginModal(props) {
|
|
12
|
+
var className = props.className,
|
|
13
|
+
_props$borderd = props.borderd,
|
|
14
|
+
borderd = _props$borderd === void 0 ? true : _props$borderd,
|
|
15
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
16
|
+
var _useStyles = useStyles(_objectSpread({
|
|
17
|
+
borderd: borderd
|
|
18
|
+
}, otherProps)),
|
|
19
|
+
styles = _useStyles.styles,
|
|
20
|
+
cx = _useStyles.cx;
|
|
21
|
+
return /*#__PURE__*/_jsx(AntdModal, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
22
|
+
className: cx(styles.custom, "".concat(prefixCls, "-modal"), className)
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
export var Modal = OriginModal;
|
|
26
|
+
Modal.useModal = AntdModal.useModal;
|
|
27
|
+
Modal.destroyAll = AntdModal.destroyAll;
|
|
28
|
+
Modal.config = AntdModal.config;
|
|
29
|
+
Modal._InternalPanelDoNotUseOrYouWillBeFired = AntdModal._InternalPanelDoNotUseOrYouWillBeFired;
|
|
30
|
+
Modal.info = AntdModal.info;
|
|
31
|
+
Modal.success = AntdModal.success;
|
|
32
|
+
Modal.error = AntdModal.error;
|
|
33
|
+
Modal.warning = AntdModal.warning;
|
|
34
|
+
Modal.warn = AntdModal.warn;
|
|
35
|
+
Modal.confirm = AntdModal.confirm;
|
|
36
|
+
export default Modal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
prefixCls = _ref.prefixCls;
|
|
7
|
+
var _ref2$borderd = _ref2.borderd,
|
|
8
|
+
borderd = _ref2$borderd === void 0 ? true : _ref2$borderd,
|
|
9
|
+
footer = _ref2.footer;
|
|
10
|
+
var noFooter = footer === null || Array.isArray(footer) && footer.length === 0;
|
|
11
|
+
var borderdStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-header::after {\n content: ' ';\n\n position: absolute;\n top: 56px;\n left: 0;\n\n width: 100%;\n height: 1px;\n\n background: rgba(5, 5, 5, 0.06);\n }\n .", "-modal-body {\n margin-top: 40px;\n margin-bottom: ", ";\n }\n .", "-modal-body::after {\n content: ' ';\n\n position: absolute;\n bottom: 72px;\n left: 0;\n\n width: 100%;\n height: ", ";\n\n background: rgba(5, 5, 5, 0.06);\n }\n "])), prefixCls, prefixCls, noFooter ? 0 : '40px', prefixCls, noFooter ? 0 : '1px');
|
|
12
|
+
return {
|
|
13
|
+
custom: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n "])), borderd && borderdStyle)
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
hashPriority: 'low'
|
|
17
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface EditorMeta {
|
|
2
|
+
singleton: boolean;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export declare class Controller {
|
|
6
|
+
private methodMap;
|
|
7
|
+
private meta;
|
|
8
|
+
constructor();
|
|
9
|
+
registerMethod(name: string, fn: (...args: any[]) => void): void;
|
|
10
|
+
call(name: string, ...args: any[]): void;
|
|
11
|
+
updateMeta(obj: Partial<EditorMeta>): void;
|
|
12
|
+
getMeta(): Readonly<{
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
singleton: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export declare const controller: Controller;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
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; }
|
|
6
|
+
import { isBrowser } from "../../utils/tools";
|
|
7
|
+
export var Controller = /*#__PURE__*/function () {
|
|
8
|
+
function Controller() {
|
|
9
|
+
_classCallCheck(this, Controller);
|
|
10
|
+
_defineProperty(this, "methodMap", void 0);
|
|
11
|
+
_defineProperty(this, "meta", void 0);
|
|
12
|
+
this.methodMap = {};
|
|
13
|
+
this.meta = {
|
|
14
|
+
singleton: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
_createClass(Controller, [{
|
|
18
|
+
key: "registerMethod",
|
|
19
|
+
value: function registerMethod(name, fn) {
|
|
20
|
+
this.methodMap[name] = fn;
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "call",
|
|
24
|
+
value: function call(name) {
|
|
25
|
+
var _this$methodMap$name, _this$methodMap;
|
|
26
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
27
|
+
args[_key - 1] = arguments[_key];
|
|
28
|
+
}
|
|
29
|
+
return (_this$methodMap$name = (_this$methodMap = this.methodMap)[name]) === null || _this$methodMap$name === void 0 ? void 0 : _this$methodMap$name.call.apply(_this$methodMap$name, [_this$methodMap].concat(args));
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "updateMeta",
|
|
33
|
+
value: function updateMeta(obj) {
|
|
34
|
+
Object.assign(this.meta, obj);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "getMeta",
|
|
38
|
+
value: function getMeta() {
|
|
39
|
+
return Object.freeze(_objectSpread({}, this.meta));
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
return Controller;
|
|
43
|
+
}();
|
|
44
|
+
var CONFIGURE_KEY = '__base_monaco_editor_controller__';
|
|
45
|
+
var fakeWindow = isBrowser && window;
|
|
46
|
+
if (fakeWindow && !fakeWindow[CONFIGURE_KEY]) {
|
|
47
|
+
fakeWindow[CONFIGURE_KEY] = new Controller();
|
|
48
|
+
}
|
|
49
|
+
export var controller = fakeWindow[CONFIGURE_KEY];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Monaco } from '@monaco-editor/loader';
|
|
2
|
+
import type { editor as IEditor } from 'monaco-editor';
|
|
3
|
+
import React, { CSSProperties } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* @see https://microsoft.github.io/monaco-editor/api/index.html
|
|
6
|
+
*/
|
|
7
|
+
export type IEditorInstance = IEditor.IStandaloneCodeEditor | IEditor.IStandaloneDiffEditor;
|
|
8
|
+
export type EditorEnhancer = (monaco: Monaco, editorIns: IEditorInstance) => any;
|
|
9
|
+
export interface IGeneralManacoEditorProps {
|
|
10
|
+
/** [Monaco editor options](https://microsoft.github.io/monaco-editor/) */
|
|
11
|
+
options?: Record<string, any>;
|
|
12
|
+
/** callback after monaco's loaded and after editor's loaded */
|
|
13
|
+
editorDidMount?: (monaco: Monaco, editor: IEditorInstance) => void;
|
|
14
|
+
/** callback after monaco's loaded and before editor's loaded */
|
|
15
|
+
editorWillMount?: (monaco: Monaco) => void;
|
|
16
|
+
/** path of the current model, useful when creating a multi-model editor */
|
|
17
|
+
path?: string;
|
|
18
|
+
/** whether to save the models' view states between model changes or not */
|
|
19
|
+
saveViewState?: boolean;
|
|
20
|
+
/** language of the editor @see https://microsoft.github.io/monaco-editor/ for available languages */
|
|
21
|
+
language?: string;
|
|
22
|
+
/** theme of the editor, "light" | "vs-dark" */
|
|
23
|
+
theme?: string;
|
|
24
|
+
/** [config passing to require](https://github.com/suren-atoyan/monaco-react#loader-config), can be used to upgrade monaco-editor */
|
|
25
|
+
requireConfig?: Record<string, any>;
|
|
26
|
+
/** value, controlled */
|
|
27
|
+
value?: string;
|
|
28
|
+
/** defaultValue for creating model, uncontrolled */
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
/** className of wrapper */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** width of wrapper */
|
|
33
|
+
width?: number | string;
|
|
34
|
+
/** height of wrapper */
|
|
35
|
+
height?: number | string;
|
|
36
|
+
/** whether to enable outline of wrapper or not */
|
|
37
|
+
enableOutline?: boolean;
|
|
38
|
+
/** style of wrapper */
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
enhancers?: EditorEnhancer[];
|
|
41
|
+
}
|
|
42
|
+
export interface ISingleMonacoEditorProps extends IGeneralManacoEditorProps {
|
|
43
|
+
onChange?: (input: string, event: IEditor.IModelContentChangedEvent) => void;
|
|
44
|
+
supportFullScreen?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface IDiffMonacoEditorProps extends IGeneralManacoEditorProps {
|
|
47
|
+
onChange?: (input: string, event: IEditor.IModelContentChangedEvent) => void;
|
|
48
|
+
supportFullScreen?: boolean;
|
|
49
|
+
original?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare const WORD_EDITOR_INITIALIZING: string;
|
|
52
|
+
export declare const INITIAL_OPTIONS: IEditor.IStandaloneEditorConstructionOptions;
|
|
53
|
+
export declare const useEditor: <T = IEditorInstance>(type: 'single' | 'diff', props: IGeneralManacoEditorProps) => {
|
|
54
|
+
readonly isEditorReady: boolean;
|
|
55
|
+
readonly focused: boolean;
|
|
56
|
+
readonly loading: boolean;
|
|
57
|
+
readonly containerRef: React.MutableRefObject<HTMLDivElement | undefined>;
|
|
58
|
+
readonly monacoRef: React.MutableRefObject<typeof import("monaco-editor") | undefined>;
|
|
59
|
+
readonly editorRef: React.MutableRefObject<T>;
|
|
60
|
+
readonly valueRef: React.MutableRefObject<string | undefined>;
|
|
61
|
+
};
|
|
62
|
+
export declare const useFullScreen: (editor?: IEditor.IStandaloneCodeEditor) => {
|
|
63
|
+
isFullScreen: boolean;
|
|
64
|
+
fullScreen: () => void;
|
|
65
|
+
};
|