Skip to content

Commit eb3b776

Browse files
committed
Merge branch 'main' of https://github.com/wangshihao111/lowcode-plugins into feat/multiple-editor
2 parents 7dd8994 + f6d81bd commit eb3b776

File tree

54 files changed

+2268
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2268
-363
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
}
4141
},
4242
"devDependencies": {
43-
"lerna": "^4.x",
4443
"f2elint": "^2.0.1",
4544
"husky": "^7.0.4",
45+
"lerna": "^4.x",
4646
"typescript": "^3.2.2"
4747
},
4848
"engines": {

packages/action-block/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alilc/action-block",
3-
"version": "1.0.0-beta.0",
3+
"version": "1.0.1",
44
"description": "",
55
"main": "lib/index.js",
66
"repository": {
@@ -27,5 +27,5 @@
2727
"build-plugin-fusion": "^0.1.22",
2828
"build-plugin-moment-locales": "^0.1.3"
2929
},
30-
"homepage": "https://unpkg.com/@alilc/action-block@1.0.0-beta.0/build/index.html"
30+
"homepage": "https://unpkg.com/@alilc/action-block@1.0.1/build/index.html"
3131
}

packages/action-block/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const SaveAsBlock = (props: SaveAsBlockProps) => {
3030
React.useEffect(() => {
3131
const generateImage = async () => {
3232
let dom2 = node.getDOMNode();
33-
console.log('html2canvas: ', html2canvas);
33+
// console.log('html2canvas: ', html2canvas);
3434
const canvas = await html2canvas?.(dom2, { scale: 0.5 });
3535
const dataUrl = canvas.toDataURL();
3636
setSrc(dataUrl);
@@ -106,7 +106,7 @@ export default {
106106
},
107107
title: '新增',
108108
action(node: Node) {
109-
console.log('node: ', node);
109+
// console.log('node: ', node);
110110
dialog = Dialog.show({
111111
v2: true,
112112
title: "保存为区块",
@@ -116,4 +116,4 @@ export default {
116116
},
117117
},
118118
important: true,
119-
};
119+
};

packages/base-monaco-editor/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "@alilc/lowcode-plugin-base-monaco-editor",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "代码编辑组件,monaco-editor 的低代码适配封装",
55
"publishConfig": {
6+
"registry": "https://registry.npmjs.org/",
67
"access": "public"
78
},
89
"files": [
@@ -62,7 +63,7 @@
6263
"commit-msg": "f2elint commit-msg-scan"
6364
}
6465
},
65-
"homepage": "https://unpkg.com/@alilc/lowcode-plugin-base-monaco-editor@1.1.1/build/index.html",
66+
"homepage": "https://unpkg.com/@alilc/lowcode-plugin-base-monaco-editor@1.1.2/build/index.html",
6667
"repository": {
6768
"type": "git",
6869
"url": "https://github.com/alibaba/lowcode-plugins.git",

packages/base-monaco-editor/src/helper.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface IGeneralManacoEditorProps {
4444
enableOutline?: boolean;
4545
/** style of wrapper */
4646
style?: CSSProperties;
47+
overrideServices?: oEditor.IEditorOverrideServices;
4748
enhancers?: EditorEnhancer[];
4849
}
4950

@@ -113,7 +114,7 @@ const DIFF_EDITOR_INITIAL_OPTIONS: oEditor.IStandaloneDiffEditorConstructionOpti
113114

114115
export const useEditor = <T = IEditorInstance>(type: 'single' | 'diff', props: IGeneralManacoEditorProps) => {
115116
const {
116-
editorDidMount, editorWillMount, theme, value, path, language, saveViewState, defaultValue, enhancers,
117+
editorDidMount, editorWillMount, theme, value, path, language, saveViewState, defaultValue, enhancers, overrideServices
117118
} = props;
118119

119120
const [isEditorReady, setIsEditorReady] = useState(false);
@@ -196,7 +197,7 @@ export const useEditor = <T = IEditorInstance>(type: 'single' | 'diff', props: I
196197
automaticLayout: true,
197198
...INITIAL_OPTIONS,
198199
...optionRef.current,
199-
});
200+
}, overrideServices);
200201
editor.setModel(model);
201202
} else {
202203
const originalModel = monaco
@@ -211,7 +212,7 @@ export const useEditor = <T = IEditorInstance>(type: 'single' | 'diff', props: I
211212
automaticLayout: true,
212213
...DIFF_EDITOR_INITIAL_OPTIONS,
213214
...optionRef.current,
214-
});
215+
}, overrideServices);
215216

216217
editor.setModel({ original: originalModel, modified: modifiedModel });
217218
}

packages/plugin-code-editor/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@alilc/lowcode-plugin-code-editor",
33
"author": "59174526@qq.com & humphry.huang9@gmail.com",
4-
"version": "1.0.6",
4+
"version": "1.0.8",
55
"description": "CodeEditor",
66
"files": [
77
"es",
@@ -17,14 +17,15 @@
1717
"build": "build-scripts build --config build.js"
1818
},
1919
"publishConfig": {
20+
"registry": "https://registry.npmjs.org/",
2021
"access": "public"
2122
},
2223
"dependencies": {
2324
"@alifd/next": "^1.25.13",
2425
"@alilc/lowcode-plugin-base-monaco-editor": "^1.1.1",
2526
"@babel/core": "^7.15.8",
2627
"@babel/parser": "^7.15.8",
27-
"@babel/preset-env": "^7.15.8",
28+
"@babel/preset-env": "7.22.9",
2829
"@babel/preset-react": "^7.14.5",
2930
"@babel/standalone": "^7.15.8",
3031
"@babel/traverse": "^7.15.4",

packages/plugin-code-editor/src/pane/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const CodeEditorPane = memo(({ project, event, skeleton }: CodeEditorPane
9494

9595
useEffect(() => {
9696
// load schema on open
97-
eventRef.current?.on('skeleton.panel-dock.active', (pluginName) => {
97+
skeletonRef.current?.onShowPanel((pluginName: string) => {
9898
if (pluginName === 'codeEditor') {
9999
const schema = lowcodeProjectRef.current?.exportSchema(common.designerCabin.TransformStage.Save);
100100
if (!schema) {
@@ -109,7 +109,7 @@ export const CodeEditorPane = memo(({ project, event, skeleton }: CodeEditorPane
109109
});
110110

111111
// save schema when panel closed
112-
eventRef.current?.on('skeleton.panel-dock.unactive', (pluginName) => {
112+
skeletonRef.current?.onHidePanel((pluginName: string) => {
113113
if (pluginName === 'codeEditor') {
114114
saveSchemaRef.current?.();
115115
}

packages/plugin-components-pane/build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"plugins": [
33
"build-plugin-component",
4+
[
5+
"@alilc/build-plugin-alt",
6+
{
7+
"type": "plugin",
8+
"inject": true,
9+
"openUrl": "https://lowcode-engine.cn/demo/index.html?debug"
10+
}
11+
],
412
"build-plugin-fusion",
513
[
614
"build-plugin-moment-locales",

packages/plugin-components-pane/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alilc/lowcode-plugin-components-pane",
3-
"version": "1.0.7",
3+
"version": "2.0.4",
44
"description": "低代码组件面板",
55
"files": [
66
"es/",

0 commit comments

Comments
 (0)