Compare commits

...

6 Commits

Author SHA1 Message Date
wwsun 640859d36e chore(release): publish
- @music163/tango-context@0.2.8
 - @music163/tango-core@0.2.7
 - @music163/tango-designer@0.5.8
 - @music163/tango-sandbox@0.1.12
 - @music163/tango-setting-form@0.2.11
2023-11-27 14:02:30 +08:00
wwsun d91763379c fix: parse tango variables in view file 2023-11-27 13:55:53 +08:00
wwsun 588861f649 fix: event setter 2023-11-27 13:46:45 +08:00
wwsun 91b53da38e fix: list service functions 2023-11-24 09:50:14 +08:00
wwsun 9b0ada94a0 chore(release): publish
- @music163/tango-designer@0.5.7
2023-11-23 18:50:57 +08:00
Wells f604996e56 fix: update varTreeNode style (#69)
Co-authored-by: wwsun <ww.sww@outlook.com>
2023-11-23 18:46:56 +08:00
16 changed files with 87 additions and 32 deletions
+7
View File
@@ -187,6 +187,13 @@ import { defineServices } from '@music163/tango-boot';
import './sub';
export default defineServices({
longLongLongLongLongLongLongLongGet: {
url: 'https://nei.hz.netease.com/api/apimock-v2/cc974ffbaa7a85c77f30e4ce67deb67f/api/getUserProfile',
formatter: res => res.data,
headers: {
'Content-Type': 'application/json',
}
},
get: {
url: 'https://nei.hz.netease.com/api/apimock-v2/cc974ffbaa7a85c77f30e4ce67deb67f/api/getUserProfile',
formatter: res => res.data,
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.8](https://github.com/netease/tango/compare/@music163/tango-context@0.2.7...@music163/tango-context@0.2.8) (2023-11-27)
**Note:** Version bump only for package @music163/tango-context
## [0.2.7](https://github.com/netease/tango/compare/@music163/tango-context@0.2.6...@music163/tango-context@0.2.7) (2023-11-23)
**Note:** Version bump only for package @music163/tango-context
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-context",
"version": "0.2.7",
"version": "0.2.8",
"description": "react context for tango-apps",
"keywords": [
"react",
@@ -31,7 +31,7 @@
"react": ">= 16.8"
},
"dependencies": {
"@music163/tango-core": "^0.2.6",
"@music163/tango-core": "^0.2.7",
"@music163/tango-helpers": "^0.1.8",
"mobx-react-lite": "4.0.2"
},
+7
View File
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.7](https://github.com/netease/tango/compare/@music163/tango-core@0.2.6...@music163/tango-core@0.2.7) (2023-11-27)
### Bug Fixes
- list service functions ([91b53da](https://github.com/netease/tango/commit/91b53da38e362ae320457429037dc347adf90bd3))
- parse tango variables in view file ([d917633](https://github.com/netease/tango/commit/d91763379c4ccf9d826b717aa80a07abdaf2e3a2))
## [0.2.6](https://github.com/netease/tango/compare/@music163/tango-core@0.2.5...@music163/tango-core@0.2.6) (2023-11-23)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-core",
"version": "0.2.6",
"version": "0.2.7",
"description": "tango core",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
+6 -1
View File
@@ -1262,7 +1262,12 @@ export function traverseViewFile(ast: t.File, idGenerator: IdGenerator) {
MemberExpression(path) {
const variable = node2value(path.node, false);
if (isTangoVariable(variable) && !variables.includes(variable)) {
const parentNode = path.parentPath.node;
if (
!t.isMemberExpression(parentNode) &&
isTangoVariable(variable) &&
!variables.includes(variable)
) {
variables.push(variable);
}
},
+3 -5
View File
@@ -696,12 +696,10 @@ export class Workspace extends EventTarget implements IWorkspace {
*/
listServiceFunctions() {
const ret: Record<string, object> = {};
Object.values(this.serviceModules).forEach((module) => {
Object.keys(this.serviceModules).forEach((moduleName) => {
const module = this.serviceModules[moduleName];
Object.keys(module.serviceFunctions).forEach((name) => {
const serviceKey =
module.baseConfig.namespace !== 'index'
? name
: [module.baseConfig.namespace, name].join('.');
const serviceKey = moduleName === 'index' ? name : [moduleName, name].join('.');
ret[serviceKey] = module.serviceFunctions[name];
});
});
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.5.8](https://github.com/netease/tango/compare/@music163/tango-designer@0.5.7...@music163/tango-designer@0.5.8) (2023-11-27)
### Bug Fixes
- event setter ([588861f](https://github.com/netease/tango/commit/588861f6492b45954e29ceed950567781b822492))
## [0.5.7](https://github.com/netease/tango/compare/@music163/tango-designer@0.5.6...@music163/tango-designer@0.5.7) (2023-11-23)
### Bug Fixes
- update varTreeNode style ([#69](https://github.com/netease/tango/issues/69)) ([f604996](https://github.com/netease/tango/commit/f604996e56c9e4d58ff7f80cd98c3753986f081f))
## [0.5.6](https://github.com/netease/tango/compare/@music163/tango-designer@0.5.5...@music163/tango-designer@0.5.6) (2023-11-23)
**Note:** Version bump only for package @music163/tango-designer
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-designer",
"version": "0.5.6",
"version": "0.5.8",
"description": "lowcode designer",
"keywords": [
"react"
@@ -33,11 +33,11 @@
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/request": "^0.1.2",
"@music163/tango-context": "^0.2.7",
"@music163/tango-core": "^0.2.6",
"@music163/tango-context": "^0.2.8",
"@music163/tango-core": "^0.2.7",
"@music163/tango-helpers": "^0.1.8",
"@music163/tango-sandbox": "^0.1.11",
"@music163/tango-setting-form": "^0.2.10",
"@music163/tango-sandbox": "^0.1.12",
"@music163/tango-setting-form": "^0.2.11",
"@music163/tango-ui": "^0.1.11",
"antd": "^4.24.2",
"cash-dom": "^8.1.2",
@@ -317,6 +317,10 @@ const varTreeStyle = css`
font-family: Consolas, Menlo, Courier, monospace;
}
.ant-tree-node-content-wrapper.ant-tree-node-content-wrapper-normal {
width: calc(100% - 50px);
}
.ant-tree .ant-tree-treenode {
padding: 0;
}
@@ -4,7 +4,7 @@ import { AutoComplete } from 'antd';
import { ActionSelect } from '@music163/tango-ui';
import { FormItemComponentProps } from '@music163/tango-setting-form';
import { useWorkspace, useWorkspaceData } from '@music163/tango-context';
import { ExpressionModal } from './expression-setter';
import { ExpressionModal, getWrappedExpressionCode } from './expression-setter';
enum EventAction {
NoAction = 'noAction',
@@ -47,8 +47,9 @@ export function EventSetter(props: EventSetterProps) {
const handleChange = useCallback<FormItemComponentProps['onChange']>(
(nextValue: any, ...args) => {
if (nextValue !== value) {
onChange(nextValue, ...args);
const ret = getWrappedExpressionCode(nextValue);
if (ret !== value) {
onChange(ret, ...args);
}
},
[onChange, value],
@@ -83,7 +84,7 @@ export function EventSetter(props: EventSetterProps) {
onCancel={() => setExpModalVisible(false)}
onOk={(nextValue) => {
setExpModalVisible(false);
handleChange(`{${nextValue}}`);
handleChange(nextValue);
}}
dataSource={actionVariables}
/>
@@ -34,6 +34,23 @@ export const jsonValueValidate = (value: string) => {
}
};
/**
* 返回 `{}` 包裹后的表达式代码
* @param code 原始代码
* @returns
*/
export function getWrappedExpressionCode(code: string) {
let ret;
if (!code) {
// do nothing
} else if (isWrappedByExpressionContainer(code)) {
ret = code;
} else {
ret = `{${code}}`;
}
return ret;
}
const suffixStyle = css`
.anticon-close-circle {
color: rgba(0, 0, 0, 0.25);
@@ -79,15 +96,7 @@ export function ExpressionSetter(props: ExpressionSetterProps) {
return;
}
let ret;
if (!code) {
// do nothing
} else if (isWrappedByExpressionContainer(code)) {
ret = code;
} else {
ret = `{${code}}`;
}
const ret = getWrappedExpressionCode(code);
if (ret === valueProp) {
return;
@@ -138,7 +147,7 @@ export function ExpressionSetter(props: ExpressionSetterProps) {
value={inputValue}
onCancel={() => off()}
onOk={(value) => {
onChange(value);
change(value);
off();
}}
/>
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.12](https://github.com/netease/tango/compare/@music163/tango-sandbox@0.1.11...@music163/tango-sandbox@0.1.12) (2023-11-27)
**Note:** Version bump only for package @music163/tango-sandbox
## [0.1.11](https://github.com/netease/tango/compare/@music163/tango-sandbox@0.1.10...@music163/tango-sandbox@0.1.11) (2023-11-23)
**Note:** Version bump only for package @music163/tango-sandbox
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-sandbox",
"version": "0.1.11",
"version": "0.1.12",
"description": "sandbox of tango apps",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
@@ -29,7 +29,7 @@
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/tango-core": "^0.2.6",
"@music163/tango-core": "^0.2.7",
"@music163/tango-helpers": "^0.1.8",
"crypto-js": "^4.1.1",
"lodash.isequal": "4.5.0",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.11](https://github.com/netease/tango/compare/@music163/tango-setting-form@0.2.10...@music163/tango-setting-form@0.2.11) (2023-11-27)
**Note:** Version bump only for package @music163/tango-setting-form
## [0.2.10](https://github.com/netease/tango/compare/@music163/tango-setting-form@0.2.9...@music163/tango-setting-form@0.2.10) (2023-11-23)
**Note:** Version bump only for package @music163/tango-setting-form
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-setting-form",
"version": "0.2.10",
"version": "0.2.11",
"description": "setting form of tango-apps",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
@@ -28,7 +28,7 @@
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/tango-core": "^0.2.6",
"@music163/tango-core": "^0.2.7",
"@music163/tango-helpers": "^0.1.8",
"@music163/tango-ui": "^0.1.11",
"antd": "^4.24.2",