@yuntijs/ui 1.0.0-beta.4 → 1.0.0-beta.6
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/README.md +6 -6
- package/es/MonacoEditor/index.d.ts +1 -2
- package/es/MonacoEditor/index.js +14 -6
- package/es/index.d.ts +1 -0
- package/es/index.js +4 -1
- package/package.json +1 -1
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
package/README.md
CHANGED
|
@@ -81,13 +81,13 @@ const nextConfig = {
|
|
|
81
81
|
> and it is recommended to use [antd-style](https://ant-design.github.io/antd-style/) as the default css-in-js styling solution.
|
|
82
82
|
|
|
83
83
|
```tsx
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
84
|
+
import { ConfigProvider } from '@yuntijs/ui';
|
|
85
|
+
import { Logo } from 'antd';
|
|
86
86
|
|
|
87
87
|
export default () => (
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
</
|
|
88
|
+
<ConfigProvider>
|
|
89
|
+
<Logo />
|
|
90
|
+
</ConfigProvider>
|
|
91
91
|
);
|
|
92
92
|
```
|
|
93
93
|
|
|
@@ -174,6 +174,6 @@ This project is [MIT](./LICENSE) licensed.
|
|
|
174
174
|
[npm-downloads-shield]: https://img.shields.io/npm/dt/@yuntijs/ui?labelColor=black&style=flat-square
|
|
175
175
|
[npm-release-link]: https://www.npmjs.com/package/@yuntijs/ui
|
|
176
176
|
[npm-release-shield]: https://img.shields.io/npm/v/@yuntijs/ui?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square
|
|
177
|
-
[pr-welcome-link]: https://github.com/yuntijs/yunti-
|
|
177
|
+
[pr-welcome-link]: https://github.com/yuntijs/yunti-ui/pulls
|
|
178
178
|
[pr-welcome-shield]: https://img.shields.io/badge/☁️_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge
|
|
179
179
|
[profile-link]: https://github.com/yuntijs
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IDiffMonacoEditorProps, IGeneralManacoEditorProps, ISingleMonacoEditorProps } from '@alilc/lowcode-plugin-base-monaco-editor/lib/helper';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
4
|
-
export * from '@alilc/lowcode-plugin-base-monaco-editor/es/monaco';
|
|
3
|
+
export { type EditorMeta, Controller as MonacoController, } from '@alilc/lowcode-plugin-base-monaco-editor/es/controller';
|
|
5
4
|
export interface BaseMonacoEditorProps extends IGeneralManacoEditorProps {
|
|
6
5
|
/** Should the editor be read only. See also domReadOnly. Defaults to false. */
|
|
7
6
|
readOnly?: boolean;
|
package/es/MonacoEditor/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["type", "editorDidMount", "readOnly", "lineNumbers", "wordWrap", "contextmenu", "minimapEnabled", "version", "requireConfig", "options", "onChange"],
|
|
4
|
+
var _excluded = ["type", "editorDidMount", "readOnly", "lineNumbers", "wordWrap", "contextmenu", "theme", "minimapEnabled", "version", "requireConfig", "options", "onChange"],
|
|
5
5
|
_excluded2 = ["inlineView", "options"];
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
8
|
import { SingleMonacoEditorComponent } from '@alilc/lowcode-plugin-base-monaco-editor';
|
|
9
|
+
import { useThemeMode } from 'antd-style';
|
|
9
10
|
import React, { useMemo, useState } from 'react';
|
|
10
11
|
import { useCdnFn } from '..';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export
|
|
13
|
-
export * from '@alilc/lowcode-plugin-base-monaco-editor/es/monaco';
|
|
13
|
+
export { Controller as MonacoController } from '@alilc/lowcode-plugin-base-monaco-editor/es/controller';
|
|
14
14
|
export var BaseMonacoEditor = function BaseMonacoEditor(props) {
|
|
15
15
|
var _props$type = props.type,
|
|
16
16
|
type = _props$type === void 0 ? 'single' : _props$type,
|
|
@@ -23,6 +23,7 @@ export var BaseMonacoEditor = function BaseMonacoEditor(props) {
|
|
|
23
23
|
wordWrap = _props$wordWrap === void 0 ? 'off' : _props$wordWrap,
|
|
24
24
|
_props$contextmenu = props.contextmenu,
|
|
25
25
|
contextmenu = _props$contextmenu === void 0 ? true : _props$contextmenu,
|
|
26
|
+
themeFromProps = props.theme,
|
|
26
27
|
_props$minimapEnabled = props.minimapEnabled,
|
|
27
28
|
minimapEnabled = _props$minimapEnabled === void 0 ? false : _props$minimapEnabled,
|
|
28
29
|
_props$version = props.version,
|
|
@@ -32,6 +33,14 @@ export var BaseMonacoEditor = function BaseMonacoEditor(props) {
|
|
|
32
33
|
options = props.options,
|
|
33
34
|
onChange = props.onChange,
|
|
34
35
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
36
|
+
var _useThemeMode = useThemeMode(),
|
|
37
|
+
isDarkMode = _useThemeMode.isDarkMode;
|
|
38
|
+
var theme = useMemo(function () {
|
|
39
|
+
if (themeFromProps) {
|
|
40
|
+
return themeFromProps;
|
|
41
|
+
}
|
|
42
|
+
return isDarkMode ? 'vs-dark' : 'vs';
|
|
43
|
+
}, [isDarkMode, themeFromProps]);
|
|
35
44
|
var _useState = useState(),
|
|
36
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
46
|
editorInstance = _useState2[0],
|
|
@@ -48,8 +57,6 @@ export var BaseMonacoEditor = function BaseMonacoEditor(props) {
|
|
|
48
57
|
});
|
|
49
58
|
}
|
|
50
59
|
};
|
|
51
|
-
|
|
52
|
-
// @Todo: auto change light/dark theme
|
|
53
60
|
var editorOptions = useMemo(function () {
|
|
54
61
|
var newOps = Object.assign({}, options, {
|
|
55
62
|
readOnly: readOnly,
|
|
@@ -80,7 +87,8 @@ export var BaseMonacoEditor = function BaseMonacoEditor(props) {
|
|
|
80
87
|
editorDidMount: handleEditorDidMount,
|
|
81
88
|
onChange: onChange,
|
|
82
89
|
options: editorOptions,
|
|
83
|
-
requireConfig: requireConfig
|
|
90
|
+
requireConfig: requireConfig,
|
|
91
|
+
theme: theme
|
|
84
92
|
}, otherProps));
|
|
85
93
|
};
|
|
86
94
|
export var MonacoEditor = function MonacoEditor(props) {
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED