@chamn/render 0.0.9 → 0.0.11
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/dist/commonComponent/index.d.ts +12 -0
- package/dist/const/index.d.ts +2 -0
- package/dist/core/ReactErrorBoundary.d.ts +26 -0
- package/dist/core/adapter.d.ts +64 -0
- package/dist/core/adapterReact.d.ts +108 -0
- package/dist/core/designReactRender.d.ts +47 -0
- package/dist/core/refManager.d.ts +7 -0
- package/dist/core/render.d.ts +32 -0
- package/dist/core/storeManager.d.ts +11 -0
- package/dist/core/type.d.ts +9 -0
- package/dist/{index.cjs.js → index.js} +2 -2
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +94 -83
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/util/assetsLoader.d.ts +15 -0
- package/dist/util/index.d.ts +20 -0
- package/package.json +14 -9
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -30
- package/.prettierrc.json +0 -7
- package/CHANGELOG.md +0 -40
- package/__tests__/demo.test.ts +0 -3
- package/build.config.ts +0 -20
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/index.html +0 -16
- package/jest.config.js +0 -196
- package/public/vite.svg +0 -1
- package/src/_dev_/components.tsx +0 -12
- package/src/_dev_/dev.tsx +0 -12
- package/src/_dev_/index.css +0 -13
- package/src/_dev_/page/DesignerRenderDemo.tsx +0 -65
- package/src/_dev_/page/RenderDemo.tsx +0 -60
- package/src/_dev_/router.tsx +0 -15
- package/src/commonComponent/index.tsx +0 -184
- package/src/const/index.ts +0 -5
- package/src/core/ReactErrorBoundary.ts +0 -91
- package/src/core/adapter.ts +0 -133
- package/src/core/adapterReact.ts +0 -734
- package/src/core/designReactRender.ts +0 -325
- package/src/core/refManager.ts +0 -18
- package/src/core/render.ts +0 -123
- package/src/core/storeManager.ts +0 -57
- package/src/core/type.ts +0 -10
- package/src/util/assetsLoader.ts +0 -73
- package/src/util/index.ts +0 -164
- package/src/vite-env.d.ts +0 -1
- package/stats.html +0 -6177
- package/tsconfig.json +0 -26
- /package/{src/index.ts → dist/index.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AssetPackage } from '@chamn/model';
|
|
2
|
+
export type Asset = AssetPackage;
|
|
3
|
+
export declare class AssetLoader {
|
|
4
|
+
assets: Asset[];
|
|
5
|
+
loadStatus: 'INIT' | 'SUCCESS' | 'ERROR';
|
|
6
|
+
win: Window;
|
|
7
|
+
private _onSuccessList;
|
|
8
|
+
private _onErrorList;
|
|
9
|
+
constructor(assets: Asset[], options?: {
|
|
10
|
+
window?: Window;
|
|
11
|
+
});
|
|
12
|
+
load(): Promise<unknown> | undefined;
|
|
13
|
+
onSuccess(cb: () => void): this;
|
|
14
|
+
onError(cb: () => void): this;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ContextType } from '../core/adapter';
|
|
2
|
+
import { StoreManager } from '../core/storeManager';
|
|
3
|
+
import { AssetPackage } from '@chamn/model';
|
|
4
|
+
export declare const isClass: (val: any) => boolean;
|
|
5
|
+
export declare function shouldConstruct(Component: Function): boolean;
|
|
6
|
+
export declare function canAcceptsRef(Comp: any): any;
|
|
7
|
+
export declare function compWrapper(Comp: any): any;
|
|
8
|
+
export declare const runExpression: (expStr: string, context: any) => any;
|
|
9
|
+
export declare const convertCodeStringToFunction: (functionStr: string, $$context: ContextType, storeManager: StoreManager) => (...args: any[]) => void;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param args 对象的值
|
|
13
|
+
* @param argsName 对因位置的 名称
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare const getObjFromArrayMap: (args: any[], argsName: string[]) => Record<any, any>;
|
|
17
|
+
export declare const formatSourceStylePropertyName: (style: Record<string, string>) => Record<string, string>;
|
|
18
|
+
export declare const getCSSTextValue: (cssObj: Record<string, string>) => string;
|
|
19
|
+
export declare const collectVariable: (assetPackages: AssetPackage[], win: Window) => Record<string, any>;
|
|
20
|
+
export declare const flatObject: (obj: Record<string, any>, level?: number) => {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chamn/render",
|
|
3
3
|
"private": false,
|
|
4
|
-
"
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"version": "0.0.11",
|
|
5
8
|
"publishConfig": {
|
|
6
9
|
"access": "public"
|
|
7
10
|
},
|
|
8
|
-
"main": "dist/index.
|
|
9
|
-
"module": "dist/index.
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"module": "dist/index.mjs",
|
|
10
13
|
"types": "dist/index.d.ts",
|
|
11
14
|
"scripts": {
|
|
12
15
|
"start": "build-script",
|
|
@@ -18,7 +21,7 @@
|
|
|
18
21
|
"test": "jest"
|
|
19
22
|
},
|
|
20
23
|
"dependencies": {
|
|
21
|
-
"@chamn/model": "0.0.
|
|
24
|
+
"@chamn/model": "0.0.11",
|
|
22
25
|
"cross-env": "^7.0.3",
|
|
23
26
|
"html-tag-names": "^2.0.1",
|
|
24
27
|
"loadjs": "4.3.0-rc1",
|
|
@@ -29,16 +32,18 @@
|
|
|
29
32
|
"zustand": "^4.1.5"
|
|
30
33
|
},
|
|
31
34
|
"devDependencies": {
|
|
32
|
-
"@chamn/build-script": "0.0.
|
|
33
|
-
"@chamn/demo-page": "0.0.
|
|
34
|
-
"@chamn/material": "0.0.
|
|
35
|
+
"@chamn/build-script": "0.0.11",
|
|
36
|
+
"@chamn/demo-page": "0.0.11",
|
|
37
|
+
"@chamn/material": "0.0.11",
|
|
35
38
|
"@types/loadjs": "^4.0.1",
|
|
36
39
|
"@types/lodash-es": "^4.17.6",
|
|
40
|
+
"@types/node": "^18.15.9",
|
|
37
41
|
"@types/react": "^18.0.15",
|
|
38
42
|
"@types/react-dom": "^18.0.6",
|
|
39
43
|
"antd": "^5.0.0",
|
|
40
|
-
"react-router-dom": "^6.6.1"
|
|
44
|
+
"react-router-dom": "^6.6.1",
|
|
45
|
+
"vite-plugin-dts": "^2.1.0"
|
|
41
46
|
},
|
|
42
47
|
"config": {},
|
|
43
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "dab187afcca315664284a4bc03d01a40a43e1cdf"
|
|
44
49
|
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.*
|
package/.eslintrc.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
module.exports = {
|
|
3
|
-
root: true,
|
|
4
|
-
settings: {
|
|
5
|
-
react: {
|
|
6
|
-
version: 'detect',
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
env: {
|
|
10
|
-
browser: true,
|
|
11
|
-
es2021: true,
|
|
12
|
-
},
|
|
13
|
-
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended'],
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaFeatures: {
|
|
17
|
-
jsx: true,
|
|
18
|
-
},
|
|
19
|
-
ecmaVersion: 'latest',
|
|
20
|
-
sourceType: 'module',
|
|
21
|
-
},
|
|
22
|
-
plugins: ['react', '@typescript-eslint'],
|
|
23
|
-
rules: {
|
|
24
|
-
indent: ['error', 2],
|
|
25
|
-
'linebreak-style': ['error', 'unix'],
|
|
26
|
-
quotes: ['error', 'single'],
|
|
27
|
-
semi: ['error', 'always'],
|
|
28
|
-
'no-debugger': 0,
|
|
29
|
-
},
|
|
30
|
-
};
|
package/.prettierrc.json
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [0.0.9](https://github.com/ByteCrazy/chameleon/compare/v0.0.8...v0.0.9) (2023-04-17)
|
|
7
|
-
|
|
8
|
-
### ✨ Features | 新功能
|
|
9
|
-
|
|
10
|
-
* **docs-website, engine, render:** 🎸 render add collectVariable flatObject util method ([ae25160](https://github.com/ByteCrazy/chameleon/commit/ae25160b568c267041b3827e836c95f60ecaee59))
|
|
11
|
-
|
|
12
|
-
## [0.0.8](https://github.com/ByteCrazy/chameleon/compare/v0.0.7...v0.0.8) (2023-04-16)
|
|
13
|
-
|
|
14
|
-
### ✨ Features | 新功能
|
|
15
|
-
|
|
16
|
-
* **build-script, engine, layout, model, render:** 🎸 optimize pack package ([78d99c5](https://github.com/ByteCrazy/chameleon/commit/78d99c507ad65ca39101f0239467737d2b445c87))
|
|
17
|
-
|
|
18
|
-
## [0.0.7](https://github.com/ByteCrazy/chameleon/compare/v0.0.6...v0.0.7) (2023-03-29)
|
|
19
|
-
|
|
20
|
-
### ✨ Features | 新功能
|
|
21
|
-
|
|
22
|
-
* **build-script, build-script-example, demo-page, engine, layout, material, model, render:** 🎸 external monaco eitor and remove style panel ([494d898](https://github.com/ByteCrazy/chameleon/commit/494d898fd75dabe84d867ff45e84ae63f9b59c5e))
|
|
23
|
-
|
|
24
|
-
## [0.0.6](https://github.com/ByteCrazy/chameleon/compare/v0.0.5...v0.0.6) (2023-03-28)
|
|
25
|
-
|
|
26
|
-
**Note:** Version bump only for package @chamn/render
|
|
27
|
-
|
|
28
|
-
## [0.0.5](https://github.com/ByteCrazy/chameleon/compare/v0.0.4...v0.0.5) (2023-03-28)
|
|
29
|
-
|
|
30
|
-
### ✨ Features | 新功能
|
|
31
|
-
|
|
32
|
-
* **build-script, engine, layout, material, model, render:** 🎸 complete package info ([86b095d](https://github.com/ByteCrazy/chameleon/commit/86b095da6c955946300591b1775f59c1a141c065))
|
|
33
|
-
|
|
34
|
-
## [0.0.4](https://github.com/ByteCrazy/chameleon/compare/v0.0.3...v0.0.4) (2023-03-27)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @chamn/render
|
|
37
|
-
|
|
38
|
-
## [0.0.2](https://github.com/ByteCrazy/chameleon/compare/v0.0.1...v0.0.2) (2023-03-27)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @chamn/render
|
package/__tests__/demo.test.ts
DELETED
package/build.config.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
// 开发模式默认读取 index.html 作为开发模式入口
|
|
3
|
-
// entry 作为打包库入口
|
|
4
|
-
export default {
|
|
5
|
-
entry: './src/index.ts',
|
|
6
|
-
formats: ['es', 'cjs', 'umd'],
|
|
7
|
-
libName: 'CRender',
|
|
8
|
-
fileName: 'index',
|
|
9
|
-
external: ['react', 'react-dom'],
|
|
10
|
-
global: {
|
|
11
|
-
react: 'React',
|
|
12
|
-
'react-dom': 'ReactDOM',
|
|
13
|
-
},
|
|
14
|
-
// 额外的 vite 配置
|
|
15
|
-
vite: {
|
|
16
|
-
define: {
|
|
17
|
-
// 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|