diff --git a/.eslintrc.js b/.eslintrc.js
index f1b6c7b..b22d43b 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -31,6 +31,16 @@ module.exports = {
'@typescript-eslint/indent': 0,
'import/no-cycle': 0,
'@typescript-eslint/no-shadow': 0,
- 'max-len': ["error", {"code": 180}]
- }
+ 'max-len': ['error', { code: 180 }],
+ 'comma-dangle': [
+ 'warn',
+ {
+ objects: 'always',
+ arrays: 'always',
+ imports: 'never',
+ functions: 'never',
+ },
+ ],
+ semi: ['error', 'always'],
+ },
};
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..281c877
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,20 @@
+# ref: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
+
+# These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence
+* @liujuping @JackLian @alvarto
+
+/packages/plugin-manual/ @alvarto
+/packages/base-monaco-editor/ @alvarto @wangshihao111 @SuSunSam
+/packages/plugin-code-editor/ @alvarto @SuSunSam
+/packages/plugin-schema/ @alvarto
+/packages/plugin-components-pane/ @mark-ck @love999262
+/packages/plugin-datasource-pane/ @YSMJ1994
+/packages/plugin-zh-en/ @JackLian @liujuping
+/packages/plugin-undo-redo/ @JackLian @liujuping
+/packages/plugin-resource-tabs/ @JackLian @liujuping
+/packages/plugin-set-ref-prop/ @JackLian @liujuping
+/packages/plugin-view-manager-pane/ @JackLian @liujuping
+/packages/base-monaco-editor/ @hzd822
+/packages/plugin-multiple-editor/ @hzd822
+/packages/action-block @liujuping
\ No newline at end of file
diff --git a/.github/workflows/deprecate npm.yml b/.github/workflows/deprecate npm.yml
new file mode 100644
index 0000000..ea096ec
--- /dev/null
+++ b/.github/workflows/deprecate npm.yml
@@ -0,0 +1,32 @@
+name: deprecate Package Version
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version to be deleted package@version'
+ required: true
+
+jobs:
+ delete-package-version:
+ runs-on: ubuntu-latest
+ if: >-
+ github.ref == 'refs/heads/main' &&
+ (github.actor == 'JackLian' || github.actor == 'liujuping')
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: '14'
+
+ - name: deprecate Package Version
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
+ npm deprecate ${{ github.event.inputs.version }} "This version is deprecated. Please consider upgrading to a newer version."
diff --git a/.github/workflows/publish beta npm.yml b/.github/workflows/publish beta npm.yml
new file mode 100644
index 0000000..01ab685
--- /dev/null
+++ b/.github/workflows/publish beta npm.yml
@@ -0,0 +1,38 @@
+name: Publish Beta NPM Packages
+on:
+ workflow_dispatch:
+ inputs:
+ packagePath:
+ description: 'Path to the package (e.g., action-block)'
+ required: true
+ betaVersion:
+ description: 'Beta version number (e.g., 1.0.1-beta.0)'
+ required: true
+
+jobs:
+ publish-package:
+ runs-on: ubuntu-latest
+ if: >-
+ github.actor == 'JackLian' || github.actor == 'liujuping'
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: '16' # 或者您希望的任何版本
+
+ - name: Change to Package Directory
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ npm install --legacy-peer-deps
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
+ cd packages/${{ github.event.inputs.packagePath }}
+ npm install --legacy-peer-deps
+ npm run build
+ npm version ${{ github.event.inputs.betaVersion }}
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
+ npm publish --tag beta
\ No newline at end of file
diff --git a/.github/workflows/publish npm.yml b/.github/workflows/publish npm.yml
new file mode 100644
index 0000000..5ada959
--- /dev/null
+++ b/.github/workflows/publish npm.yml
@@ -0,0 +1,51 @@
+name: Publish NPM Packages
+on:
+ workflow_dispatch:
+ inputs:
+ packagePath:
+ description: 'Path to the package (e.g., action-block)'
+ required: true
+ versionType:
+ description: 'Version update type (major, minor, patch)'
+ required: true
+ default: 'patch'
+
+jobs:
+ publish-package:
+ runs-on: ubuntu-latest
+ if: >-
+ github.ref == 'refs/heads/main' &&
+ (github.actor == 'JackLian' || github.actor == 'liujuping')
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: '16' # 或者您希望的任何版本
+
+ - name: Publish Package
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
+ npm install --legacy-peer-deps
+ cd packages/${{ github.event.inputs.packagePath }}
+ npm install --legacy-peer-deps
+ npm version ${{ github.event.inputs.versionType }}
+ npm run build
+
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
+ npm publish
+
+ echo "PACKAGE_NAME=$(node -p "require('./package.json').name")" >> $GITHUB_ENV
+ echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
+
+ git add package.json
+ git commit -m "Bump version to ${PACKAGE_VERSION}"
+
+ git tag -a "${PACKAGE_NAME}@${PACKAGE_VERSION}" -m "Release ${PACKAGE_NAME} version ${PACKAGE_VERSION}"
+ git push origin "${PACKAGE_NAME}@${PACKAGE_VERSION}"
\ No newline at end of file
diff --git a/README.md b/README.md
index d23206e..c71cea3 100644
--- a/README.md
+++ b/README.md
@@ -25,3 +25,5 @@
- plugin-schema
- plugin-undo-redo
- plugin-zh-cn
+- plugin-block
+- action-block
diff --git a/package.json b/package.json
index c4dfabc..761e9e0 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
]
},
"scripts": {
+ "bootstrap": "lerna bootstrap",
"dev": "npm run bootstrap && npm run build && cooking watch -c build/cooking.demo.js -p",
"build": "./scripts/build.sh",
"clean": "rm -rf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
@@ -39,9 +40,9 @@
}
},
"devDependencies": {
- "lerna": "^4.x",
"f2elint": "^2.0.1",
"husky": "^7.0.4",
+ "lerna": "^4.x",
"typescript": "^3.2.2"
},
"engines": {
@@ -53,5 +54,6 @@
},
"resolutions": {
"@builder/babel-preset-ice": "1.0.1"
- }
-}
+ },
+ "repository": "https://github.com/alibaba/lowcode-plugins.git"
+}
\ No newline at end of file
diff --git a/packages/action-block/README.md b/packages/action-block/README.md
new file mode 100644
index 0000000..9bda2b0
--- /dev/null
+++ b/packages/action-block/README.md
@@ -0,0 +1,46 @@
+# 区块管理 - 保存为区块
+
+## 区块实体
+
+```
+
+interface Block {
+ name: string;
+ title: string;
+ schema: string;
+ screenshot: string;
+ created_at?: string;
+ updated_at?: string;
+}
+
+```
+
+## 注意
+
+使用区块管理需要提前将对应的 API 注册到 engine config 里:
+
+```
+
+interface BlockAPI {
+ listBlocks: () => Block[];
+ createBlock: (Block) => any;
+}
+
+function setupConfig() {
+ config.set('apiList', {
+ block: {
+ listBlocks,
+ createBlock
+ },
+ })
+}
+```
+
+# 使用方式
+
+```
+import { material } from '@alilc/lowcode-engine';
+import { default as saveAsBlock } from '@alilc/action-block';
+
+material.addBuiltinComponentAction(saveAsBlock);
+```
\ No newline at end of file
diff --git a/packages/action-block/build.json b/packages/action-block/build.json
new file mode 100644
index 0000000..d2836c1
--- /dev/null
+++ b/packages/action-block/build.json
@@ -0,0 +1,17 @@
+{
+ "externals": {
+ "react": "var window.React",
+ "@alifd/next": "var window.Next",
+ "@alilc/lowcode-engine": "var window.AliLowCodeEngine"
+ },
+ "plugins": [
+ "build-plugin-component",
+ "build-plugin-fusion",
+ [
+ "build-plugin-moment-locales",
+ {
+ "locales": ["zh-cn"]
+ }
+ ]
+ ]
+}
diff --git a/packages/action-block/package.json b/packages/action-block/package.json
new file mode 100644
index 0000000..e9c0c00
--- /dev/null
+++ b/packages/action-block/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@alilc/action-block",
+ "version": "1.0.1",
+ "description": "",
+ "main": "lib/index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/alibaba/lowcode-plugins.git",
+ "directory": "packages/action-block"
+ },
+ "scripts": {
+ "start": "build-scripts start",
+ "build": "build-scripts build",
+ "prepublishOnly": "npm run build"
+ },
+ "author": "mark.ck",
+ "license": "MIT",
+ "dependencies": {
+ "@alifd/next": "^1.25.31",
+ "@alilc/lowcode-engine": "^1.0.5",
+ "html2canvas": "^1.4.1",
+ "react": "^16.8.1"
+ },
+ "devDependencies": {
+ "@alib/build-scripts": "^0.1.32",
+ "build-plugin-component": "^1.10.0",
+ "build-plugin-fusion": "^0.1.22",
+ "build-plugin-moment-locales": "^0.1.3"
+ },
+ "homepage": "https://unpkg.com/@alilc/action-block@1.0.1/build/index.html"
+}
diff --git a/packages/action-block/src/index.scss b/packages/action-block/src/index.scss
new file mode 100644
index 0000000..1f019fb
--- /dev/null
+++ b/packages/action-block/src/index.scss
@@ -0,0 +1,11 @@
+.block-screenshot {
+ background: gainsboro;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 10px 0;
+
+ img {
+ max-width: 80%;
+ }
+}
\ No newline at end of file
diff --git a/packages/action-block/src/index.tsx b/packages/action-block/src/index.tsx
new file mode 100644
index 0000000..22eaa46
--- /dev/null
+++ b/packages/action-block/src/index.tsx
@@ -0,0 +1,119 @@
+import * as React from 'react';
+import { default as html2canvas } from 'html2canvas';
+import { Node, config, event } from '@alilc/lowcode-engine';
+import { Dialog, Form, Input } from '@alifd/next';
+import './index.scss';
+
+const FormItem = Form.Item;
+
+interface SaveAsBlockProps {
+ node: Node;
+}
+
+function checkBlockAPI () {
+ const apiList = config.get('apiList') || {};
+ const { block: blockAPI } = apiList;
+
+ if (!blockAPI?.createBlock) {
+ throw new Error('[BlockPane] block api required in engine config.');
+ }
+
+ return blockAPI;
+}
+
+let dialog: any;
+
+const SaveAsBlock = (props: SaveAsBlockProps) => {
+ const { createBlock } = checkBlockAPI();
+ const { node } = props;
+ const [ src, setSrc ] = React.useState();
+ React.useEffect(() => {
+ const generateImage = async () => {
+ let dom2 = node.getDOMNode();
+ // console.log('html2canvas: ', html2canvas);
+ const canvas = await html2canvas?.(dom2, { scale: 0.5 });
+ const dataUrl = canvas.toDataURL();
+ setSrc(dataUrl);
+ };
+
+ generateImage();
+ }, []);
+
+ const save = async (values) => {
+ const { name, title } = values;
+ const { schema } = node;
+
+ await createBlock({
+ name,
+ title,
+ schema: JSON.stringify(schema),
+ screenshot: src,
+ });
+ dialog?.hide();
+ event.emit('BlockChanged');
+ }
+
+ return
+}
+
+
+export default {
+ name: 'add',
+ content: {
+ icon: {
+ type: 'add',
+ size: 'xs'
+ },
+ title: '新增',
+ action(node: Node) {
+ // console.log('node: ', node);
+ dialog = Dialog.show({
+ v2: true,
+ title: "保存为区块",
+ content: ,
+ footer: false
+ });
+ },
+ },
+ important: true,
+};
diff --git a/packages/base-monaco-editor/CHANGELOG.md b/packages/base-monaco-editor/CHANGELOG.md
index 58196de..1ca5153 100644
--- a/packages/base-monaco-editor/CHANGELOG.md
+++ b/packages/base-monaco-editor/CHANGELOG.md
@@ -1,3 +1,27 @@
+## 1.1.1
+
+- 避免 UIPaaS 中的样式冲突,将 `.ve-code-control` 替换为 `.lc-code-control`
+
+## 1.1.0
+
+- Publish following changes
+
+## 1.1.0-beta.3
+
+- 去除 `overflow: visible` 样式,避免动作面板遮住按钮
+
+## 1.1.0-beta.1
+
+- 添加 controller 实例,可用作中间交换介质,解决与代码编辑相关的插件间的协作问题 [@wangshihao111](https://github.com/wangshihao111)
+- 优化 Monaco 单例,元信息保存在 controller 实例内部 [@wangshihao111](https://github.com/wangshihao111)
+
+## 1.1.0-beta.0
+
+- 重构 type / path / value 联动,彻底修复 monaco 在多文件模式下覆盖多个 path 值的 bug
+- 修复 ts 类型问题 [@wangshihao111](https://github.com/wangshihao111)
+- 添加 configure 方法,支持配置是否开启 monaco 单例模式 [@wangshihao111](https://github.com/wangshihao111)
+- 新增插件参数:`enhancers`,用于强化编辑器功能 [@wangshihao111](https://github.com/wangshihao111)
+
## 1.0.0
- Publish following changes
diff --git a/packages/base-monaco-editor/README.md b/packages/base-monaco-editor/README.md
index 0740b37..49473bb 100644
--- a/packages/base-monaco-editor/README.md
+++ b/packages/base-monaco-editor/README.md
@@ -125,6 +125,24 @@ function App() {
ReactDOM.render(, mountNode);
```
+### Using controller
+
+```ts
+import { controller } from '@alilc/lowcode-plugin-base-monaco-editor';
+
+// configure Monaco to be singleton
+controller.updateMeta({ singleton: true });
+
+// Get all metadata
+controller.getMeta();
+
+// register a custom method
+controller.registerMethod('methodName', (a, b, c) => { });
+
+// call custom methods
+const ret = controller.call('methodName', a, b, c);
+```
+
## Citation
This is forked from [monaco-react](https://github.com/suren-atoyan/monaco-react). Thanks for [suren-atoyan](https://github.com/suren-atoyan)'s effort for making monaco editor appoachable.
diff --git a/packages/base-monaco-editor/package.json b/packages/base-monaco-editor/package.json
index 520741f..6dfa41a 100644
--- a/packages/base-monaco-editor/package.json
+++ b/packages/base-monaco-editor/package.json
@@ -1,8 +1,9 @@
{
"name": "@alilc/lowcode-plugin-base-monaco-editor",
- "version": "1.0.0",
+ "version": "1.1.2",
"description": "代码编辑组件,monaco-editor 的低代码适配封装",
"publishConfig": {
+ "registry": "https://registry.npmjs.org/",
"access": "public"
},
"files": [
@@ -31,7 +32,7 @@
"component"
],
"dependencies": {
- "@monaco-editor/loader": "^1.2.0",
+ "@monaco-editor/loader": "1.3.0",
"classnames": "^2.3.1"
},
"devDependencies": {
@@ -62,5 +63,10 @@
"commit-msg": "f2elint commit-msg-scan"
}
},
- "homepage": "https://unpkg.com/@alilc/lowcode-plugin-base-monaco-editor@1.0.0/build/index.html"
+ "homepage": "https://unpkg.com/@alilc/lowcode-plugin-base-monaco-editor@1.1.2/build/index.html",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/alibaba/lowcode-plugins.git",
+ "directory": "packages/base-monaco-editor"
+ }
}
diff --git a/packages/base-monaco-editor/src/controller.ts b/packages/base-monaco-editor/src/controller.ts
new file mode 100644
index 0000000..2ebe419
--- /dev/null
+++ b/packages/base-monaco-editor/src/controller.ts
@@ -0,0 +1,39 @@
+export interface EditorMeta {
+ singleton: boolean;
+ [key: string]: any;
+}
+
+export class Controller {
+ private methodMap: Record;
+ private meta: EditorMeta;
+
+ constructor() {
+ this.methodMap = {};
+ this.meta = { singleton: false };
+ }
+
+ registerMethod(name: string, fn: Function) {
+ this.methodMap[name] = fn;
+ }
+
+ call(name: string, ...args: any[]) {
+ return this.methodMap[name]?.(...args);
+ }
+
+ updateMeta(obj: Partial) {
+ Object.assign(this.meta, obj);
+ }
+
+ getMeta() {
+ return Object.freeze({ ...this.meta });
+ }
+}
+
+const CONFIGURE_KEY = '__base_monaco_editor_controller__';
+const fakeWindow: any = window;
+
+if (!fakeWindow[CONFIGURE_KEY]) {
+ fakeWindow[CONFIGURE_KEY] = new Controller();
+}
+
+export const controller: Controller = fakeWindow[CONFIGURE_KEY];
diff --git a/packages/base-monaco-editor/src/helper.ts b/packages/base-monaco-editor/src/helper.ts
index 475f80a..5180c52 100644
--- a/packages/base-monaco-editor/src/helper.ts
+++ b/packages/base-monaco-editor/src/helper.ts
@@ -1,70 +1,25 @@
/* eslint-disable no-empty */
-import { useEffect, useState, useRef, CSSProperties } from 'react';
-import loader from '@monaco-editor/loader';
-
-loader.config({
- paths: {
- vs: 'https://g.alicdn.com/code/lib/monaco-editor/0.31.1/min/vs',
- },
-});
-
-type IAmbigousFn = (...args: any[]) => any;
+import React, { useEffect, useState, useRef, CSSProperties } from 'react';
+import { Monaco } from '@monaco-editor/loader';
+import type { editor as oEditor } from 'monaco-editor';
+import { getMonaco } from './monaco';
// @todo fill type def for monaco editor without refering monaco editor
/**
* @see https://microsoft.github.io/monaco-editor/api/index.html
*/
-export interface IEditorInstance {
- getModel: IAmbigousFn;
- dispose: IAmbigousFn;
- getValue: () => string;
- onDidChangeModelContent: (input: any) => void;
- setTheme: (input: string) => void;
- setModelLanguage: (model: any, language: string) => void;
- layout: () => void;
- setValue: (value: string) => void;
- executeEdits: IAmbigousFn;
- pushUndoStop: IAmbigousFn;
- EditorOption?: Record;
- getOption?: (input: string) => any;
- onDidFocusEditorText: (...args: any[]) => void;
- onDidBlurEditorText: (...args: any[]) => void;
- getModifiedEditor?: () => IEditorInstance;
- setModel: IAmbigousFn;
- revealLineInCenter: IAmbigousFn;
- focus: IAmbigousFn;
- Range: new(...args: any[]) => any;
- getPosition: IAmbigousFn;
- setPosition: IAmbigousFn;
- deltaDecorations: IAmbigousFn;
- addAction: IAmbigousFn;
- saveViewState: () => ICodeEditorViewState;
- createModel: IAmbigousFn;
- [key: string]: any;
-}
-export interface IMonacoInstance {
- editor?: {
- create: IAmbigousFn;
- [key: string]: any;
- };
- KeyCode?: Record;
- KeyMod?: Record;
- [otherKeys: string]: any;
-}
+export type IEditorInstance = oEditor.IStandaloneCodeEditor | oEditor.IStandaloneDiffEditor;
-type ICodeEditorViewState = {
- contributionsState: any;
- cursorState: any;
- viewState: any;
-}
+export type EditorEnhancer =
+ (monaco: Monaco, editorIns: IEditorInstance) => any;
export interface IGeneralManacoEditorProps {
/** [Monaco editor options](https://microsoft.github.io/monaco-editor/) */
options?: Record;
/** callback after monaco's loaded and after editor's loaded */
- editorDidMount?: (monaco: IMonacoInstance, editor: IEditorInstance) => void;
+ editorDidMount?: (monaco: Monaco, editor: IEditorInstance) => void;
/** callback after monaco's loaded and before editor's loaded */
- editorWillMount?: (monaco: IMonacoInstance) => void;
+ editorWillMount?: (monaco: Monaco) => void;
/** path of the current model, useful when creating a multi-model editor */
path?: string;
/** whether to save the models' view states between model changes or not */
@@ -89,6 +44,8 @@ export interface IGeneralManacoEditorProps {
enableOutline?: boolean;
/** style of wrapper */
style?: CSSProperties;
+ overrideServices?: oEditor.IEditorOverrideServices;
+ enhancers?: EditorEnhancer[];
}
export interface ISingleMonacoEditorProps extends IGeneralManacoEditorProps {
@@ -103,16 +60,15 @@ export interface IDiffMonacoEditorProps extends IGeneralManacoEditorProps {
const CURRENT_LANGUAGE = ((window as any).locale || window.localStorage.getItem('vdev-locale') || '').replace(/_/, '-') || 'zh-CN';
export const WORD_EDITOR_INITIALIZING = CURRENT_LANGUAGE === 'en-US' ? 'Initializing Editor' : '编辑器初始化中';
-export const INITIAL_OPTIONS = {
+export const INITIAL_OPTIONS: oEditor.IStandaloneEditorConstructionOptions = {
fontSize: 12,
tabSize: 2,
fontFamily: 'Menlo, Monaco, Courier New, monospace',
- renderIndentGuides: true,
folding: true,
minimap: {
enabled: false,
},
- autoIndent: true,
+ autoIndent: 'advanced',
contextmenu: true,
useTabStops: true,
wordBasedSuggestions: true,
@@ -131,9 +87,34 @@ export const INITIAL_OPTIONS = {
},
};
-export const useEditor = (type: 'single' | 'diff', props: IGeneralManacoEditorProps) => {
+const DIFF_EDITOR_INITIAL_OPTIONS: oEditor.IStandaloneDiffEditorConstructionOptions = {
+ fontSize: 12,
+ fontFamily: 'Menlo, Monaco, Courier New, monospace',
+ folding: true,
+ minimap: {
+ enabled: false,
+ },
+ autoIndent: 'advanced',
+ contextmenu: true,
+ useTabStops: true,
+ formatOnPaste: true,
+ automaticLayout: true,
+ lineNumbers: 'on',
+ wordWrap: 'off',
+ scrollBeyondLastLine: false,
+ fixedOverflowWidgets: false,
+ snippetSuggestions: 'top',
+ scrollbar: {
+ vertical: 'auto',
+ horizontal: 'auto',
+ verticalScrollbarSize: 10,
+ horizontalScrollbarSize: 10,
+ },
+};
+
+export const useEditor = (type: 'single' | 'diff', props: IGeneralManacoEditorProps) => {
const {
- editorDidMount, editorWillMount, theme, value, path, language, saveViewState, defaultValue,
+ editorDidMount, editorWillMount, theme, value, path, language, saveViewState, defaultValue, enhancers, overrideServices
} = props;
const [isEditorReady, setIsEditorReady] = useState(false);
@@ -146,7 +127,7 @@ export const useEditor = (type: 'single' | 'diff', props: IGeneralManacoEditorPr
const previousPath = usePrevious(path);
const requireConfigRef = useRef(props.requireConfig);
const optionRef = useRef(props.options);
- const monacoRef = useRef();
+ const monacoRef = useRef();
const editorRef = useRef();
const containerRef = useRef();
const typeRef = useRef(type);
@@ -154,7 +135,13 @@ export const useEditor = (type: 'single' | 'diff', props: IGeneralManacoEditorPr
const editorWillMountRef = useRef();
const decomposeRef = useRef(false);
- const viewStatusRef = useRef