Compare commits

...

3 Commits

Author SHA1 Message Date
Wells 0f1711868d chore(release): publish
- @music163/tango-context@1.0.1
 - @music163/tango-core@1.0.1
 - @music163/tango-designer@1.0.2
 - @music163/tango-helpers@1.0.0-alpha.7
 - @music163/tango-sandbox@1.0.1
 - @music163/tango-setting-form@1.0.2
 - @music163/tango-ui@1.0.2
2024-04-22 11:36:47 +08:00
Wells 06cd3b3a18 chore: generate setting-form docs 2024-04-22 11:34:20 +08:00
Wells 2664613ab2 fix: allow reload state tree & display pageStore in variable tree (#135)
* fix: update state tree display

* fix: allow reload state tree

* fix: update action props

* fix: display pageStore in variable tree
2024-04-19 19:55:40 +08:00
20 changed files with 99 additions and 39 deletions
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-context@1.0.0...@music163/tango-context@1.0.1) (2024-04-22)
### Bug Fixes
- allow reload state tree & display pageStore in variable tree ([#135](https://github.com/netease/tango/issues/135)) ([2664613](https://github.com/netease/tango/commit/2664613ab263aead2a5239fa012454fc7fd5ff99))
# [1.0.0-alpha.10](https://github.com/netease/tango/compare/@music163/tango-context@1.0.0-alpha.9...@music163/tango-context@1.0.0-alpha.10) (2024-04-09)
**Note:** Version bump only for package @music163/tango-context
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-context",
"version": "1.0.0",
"version": "1.0.1",
"description": "react context for tango-apps",
"keywords": [
"react",
@@ -31,8 +31,8 @@
"react": ">= 16.8"
},
"dependencies": {
"@music163/tango-core": "^1.0.0",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-core": "^1.0.1",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"mobx-react-lite": "4.0.5"
},
"publishConfig": {
+7
View File
@@ -35,8 +35,14 @@ export const useWorkspaceData = () => {
const modelVariables: IVariableTreeNode[] = []; // 绑定变量列表
const storeActionVariables: IVariableTreeNode[] = []; // 模型中的所有 actions
const storeVariables: IVariableTreeNode[] = []; // 模型中的所有变量
const pageStoreVariables: IVariableTreeNode[] = []; // 页面中的组件实例变量
const serviceVariables: IVariableTreeNode[] = []; // 服务中的所有变量
pageStoreVariables.push({
title: 'pageStore',
key: 'pageStore',
});
Object.values(workspace.storeModules).forEach((file) => {
const prefix = `stores.${file.name}`;
const states: IVariableTreeNode[] = file.states.map((item) => ({
@@ -109,6 +115,7 @@ export const useWorkspaceData = () => {
}
let expressionVariables: IVariableTreeNode[] = [
buildVariableOptions('当前页面组件实例', '$pageStore', pageStoreVariables),
buildVariableOptions('数据模型', '$stores', storeVariables),
buildVariableOptions('服务函数', '$services', serviceVariables),
];
+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.
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-core@1.0.0...@music163/tango-core@1.0.1) (2024-04-22)
**Note:** Version bump only for package @music163/tango-core
# [1.0.0-alpha.10](https://github.com/netease/tango/compare/@music163/tango-core@1.0.0-alpha.9...@music163/tango-core@1.0.0-alpha.10) (2024-04-09)
### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-core",
"version": "1.0.0",
"version": "1.0.1",
"description": "tango core",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
@@ -28,7 +28,7 @@
"@babel/parser": "^7.23.5",
"@babel/traverse": "^7.23.5",
"@babel/types": "^7.23.5",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"@types/babel__generator": "^7.6.7",
"@types/babel__traverse": "^7.20.4",
"mobx": "6.12.0",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.2](https://github.com/netease/tango/compare/@music163/tango-designer@1.0.1...@music163/tango-designer@1.0.2) (2024-04-22)
### Bug Fixes
- allow reload state tree & display pageStore in variable tree ([#135](https://github.com/netease/tango/issues/135)) ([2664613](https://github.com/netease/tango/commit/2664613ab263aead2a5239fa012454fc7fd5ff99))
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-designer@1.0.0...@music163/tango-designer@1.0.1) (2024-04-16)
### Bug Fixes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-designer",
"version": "1.0.1",
"version": "1.0.2",
"description": "lowcode designer",
"keywords": [
"react"
@@ -33,12 +33,12 @@
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/request": "^0.1.2",
"@music163/tango-context": "^1.0.0",
"@music163/tango-core": "^1.0.0",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-sandbox": "^1.0.0",
"@music163/tango-setting-form": "^1.0.1",
"@music163/tango-ui": "^1.0.1",
"@music163/tango-context": "^1.0.1",
"@music163/tango-core": "^1.0.1",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"@music163/tango-sandbox": "^1.0.1",
"@music163/tango-setting-form": "^1.0.2",
"@music163/tango-ui": "^1.0.2",
"antd": "^4.24.2",
"cash-dom": "^8.1.2",
"classnames": "^2.3.2",
@@ -23,11 +23,7 @@ export function OutlinePanel({ showStateView = true, ...treeProps }: OutlineView
>
<ComponentsTree {...treeProps} />
</CollapsePanel>
{showStateView && (
<CollapsePanel title="页面状态" stickyHeader maxHeight="90%" overflowY="auto">
<StateTree />
</CollapsePanel>
)}
{showStateView && <StateTree />}
</Box>
);
}
@@ -1,7 +1,8 @@
import React, { useEffect, useReducer } from 'react';
import { observer } from '@music163/tango-context';
import { isFunction, isObject, pick } from '@music163/tango-helpers';
import { JsonView } from '@music163/tango-ui';
import { CollapsePanel, IconButton, JsonView } from '@music163/tango-ui';
import { ReloadOutlined } from '@ant-design/icons';
import { useSandboxQuery } from '../../context';
function processTango(obj: any = {}, index = 0) {
@@ -26,7 +27,7 @@ export const StateTree = observer(() => {
const [, forceUpdate] = useReducer((x) => x + 1, 0);
const tangoContext = pick(sandboxQuery.window['tango'] || {}, [
'stores',
'page',
'pageStore',
'services',
'config',
]);
@@ -34,6 +35,7 @@ export const StateTree = observer(() => {
forceUpdate();
};
useEffect(() => {
// FIXME: 优化这段代码,应该监听 tangoContext 的变化,来刷新
const settingForm = document.querySelector('.SettingPanel');
const ob = new MutationObserver(callback);
if (settingForm) {
@@ -48,13 +50,31 @@ export const StateTree = observer(() => {
};
}, []);
return (
<JsonView
src={processTango(tangoContext)}
collapsed={1}
name="tango"
displayObjectSize={false}
indentWidth={2}
enableCopy
/>
<CollapsePanel
title="页面状态"
stickyHeader
maxHeight="90%"
overflowY="auto"
extra={
<IconButton
tooltip="同步状态"
size="small"
icon={<ReloadOutlined />}
onClick={(e) => {
e.stopPropagation();
forceUpdate();
}}
/>
}
>
<JsonView
src={processTango(tangoContext)}
collapsed={1}
name="tango"
displayObjectSize={false}
indentWidth={2}
enableCopy
/>
</CollapsePanel>
);
});
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.0.0-alpha.7](https://github.com/netease/tango/compare/@music163/tango-helpers@1.0.0-alpha.6...@music163/tango-helpers@1.0.0-alpha.7) (2024-04-22)
### Bug Fixes
- allow reload state tree & display pageStore in variable tree ([#135](https://github.com/netease/tango/issues/135)) ([2664613](https://github.com/netease/tango/commit/2664613ab263aead2a5239fa012454fc7fd5ff99))
# [1.0.0-alpha.6](https://github.com/netease/tango/compare/@music163/tango-helpers@1.0.0-alpha.5...@music163/tango-helpers@1.0.0-alpha.6) (2024-04-09)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-helpers",
"version": "1.0.0-alpha.6",
"version": "1.0.0-alpha.7",
"description": "Shared types, helpers, and hooks of tango-apps",
"keywords": [
"shared",
+1 -1
View File
@@ -50,7 +50,7 @@ export function isNil(val: any) {
* @returns
*/
export function isStoreVariablePath(key: string) {
return /^stores\.[a-zA-Z0-9]+\.\w+$/.test(key);
return key === 'pageStore' || /^stores\.[a-zA-Z0-9]+\.\w+$/.test(key);
}
/**
+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.
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-sandbox@1.0.0...@music163/tango-sandbox@1.0.1) (2024-04-22)
**Note:** Version bump only for package @music163/tango-sandbox
# [1.0.0-alpha.10](https://github.com/netease/tango/compare/@music163/tango-sandbox@1.0.0-alpha.9...@music163/tango-sandbox@1.0.0-alpha.10) (2024-04-09)
**Note:** Version bump only for package @music163/tango-sandbox
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-sandbox",
"version": "1.0.0",
"version": "1.0.1",
"description": "sandbox of tango apps",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
@@ -29,8 +29,8 @@
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/tango-core": "^1.0.0",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-core": "^1.0.1",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"crypto-js": "^4.1.1",
"lodash.isequal": "4.5.0",
"react-frame-component": "^5.2.4"
+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.
## [1.0.2](https://github.com/netease/tango/compare/@music163/tango-setting-form@1.0.1...@music163/tango-setting-form@1.0.2) (2024-04-22)
**Note:** Version bump only for package @music163/tango-setting-form
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-setting-form@1.0.0...@music163/tango-setting-form@1.0.1) (2024-04-16)
**Note:** Version bump only for package @music163/tango-setting-form
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-setting-form",
"version": "1.0.1",
"version": "1.0.2",
"description": "setting form of tango-apps",
"author": "wwsun <ww.sun@outlook.com>",
"homepage": "",
@@ -28,9 +28,9 @@
},
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@music163/tango-core": "^1.0.0",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-ui": "^1.0.1",
"@music163/tango-core": "^1.0.1",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"@music163/tango-ui": "^1.0.2",
"antd": "^4.24.2",
"coral-system": "^1.0.5",
"mobx": "6.12.0",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.2](https://github.com/netease/tango/compare/@music163/tango-ui@1.0.1...@music163/tango-ui@1.0.2) (2024-04-22)
### Bug Fixes
- allow reload state tree & display pageStore in variable tree ([#135](https://github.com/netease/tango/issues/135)) ([2664613](https://github.com/netease/tango/commit/2664613ab263aead2a5239fa012454fc7fd5ff99))
## [1.0.1](https://github.com/netease/tango/compare/@music163/tango-ui@1.0.0...@music163/tango-ui@1.0.1) (2024-04-16)
**Note:** Version bump only for package @music163/tango-ui
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@music163/tango-ui",
"version": "1.0.1",
"version": "1.0.2",
"description": "ui widgets of tango",
"keywords": [
"react",
@@ -38,7 +38,7 @@
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lint": "^6.4.2",
"@codemirror/search": "^6.5.5",
"@music163/tango-helpers": "^1.0.0-alpha.6",
"@music163/tango-helpers": "^1.0.0-alpha.7",
"@uiw/react-codemirror": "^4.21.21",
"antd": "^4.24.2",
"classnames": "^2.5.1",
+1
View File
@@ -68,6 +68,7 @@ export interface ActionProps extends HTMLCoralProps<any> {
*/
className?: string;
children?: React.ReactNode;
onClick?: React.MouseEventHandler;
}
export function Action({
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://typedoc.org/schema.json",
"name": "Tango LowCode Builder",
"entryPoints": ["packages/core", "packages/designer", "packages/helpers"],
"entryPoints": ["packages/core", "packages/designer","packages/setting-form", "packages/helpers"],
"entryPointStrategy": "packages",
"exclude": ["packages/**/tests/**/*"],
"out": "docs",