@chamn/engine 0.0.46 → 0.1.1
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/README.md +5 -2
- package/dist/component/CSSEditor/index.d.ts +1 -1
- package/dist/component/CSSSizeInput/index.d.ts +1 -1
- package/dist/component/CSSUIPanel/BackgroundInput/index.d.ts +3 -1
- package/dist/component/CSSUIPanel/BorderInput/index.d.ts +3 -1
- package/dist/component/CSSUIPanel/FontInput/index.d.ts +3 -1
- package/dist/component/CSSUIPanel/MarginAndPaddingInput/index.d.ts +1 -1
- package/dist/component/CSSUIPanel/type.d.ts +1 -0
- package/dist/component/CustomColorPicker/index.d.ts +8 -0
- package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +1 -1
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts +1 -2
- package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +1 -2
- package/dist/component/CustomSchemaForm/components/Setters/index.d.ts +1 -1
- package/dist/component/DesignerSizer/index.d.ts +4 -0
- package/dist/component/InputNumberPlus/index.d.ts +1 -2
- package/dist/component/MonacoEditor/index.d.ts +1 -2
- package/dist/component/Workbench/index.d.ts +1 -1
- package/dist/component/index.d.ts +8 -0
- package/dist/index.d.ts +8 -23
- package/dist/index.js +82 -63
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17082 -15763
- package/dist/index.mjs.map +1 -1
- package/dist/material/innerMaterial.d.ts +1 -1
- package/dist/plugins/AdvancePanel/index.d.ts +1 -2
- package/dist/plugins/ComponentLibrary/components/DragItem/index.d.ts +1 -1
- package/dist/plugins/ComponentLibrary/components/ListView/index.d.ts +1 -2
- package/dist/plugins/ComponentStatePanel/index.d.ts +1 -2
- package/dist/plugins/Designer/components/Canvas/advanceCustomHook.d.ts +1 -0
- package/dist/plugins/Designer/components/Canvas/index.d.ts +4 -6
- package/dist/plugins/Designer/components/DefaultSelectToolBar/index.d.ts +8 -6
- package/dist/plugins/Designer/components/GhostView/index.d.ts +1 -2
- package/dist/plugins/Designer/type.d.ts +4 -1
- package/dist/plugins/DisplaySourceSchema/index.d.ts +2 -2
- package/dist/plugins/GlobalStatePanel/index.d.ts +0 -1
- package/dist/plugins/Hotkeys/action.d.ts +11 -0
- package/dist/plugins/Hotkeys/hotKeyManager.d.ts +35 -0
- package/dist/plugins/Hotkeys/index.d.ts +2 -0
- package/dist/plugins/Hotkeys/keymap.d.ts +20 -0
- package/dist/plugins/Hotkeys/localize/en_US/index.d.ts +1 -0
- package/dist/plugins/Hotkeys/localize/index.d.ts +2 -0
- package/dist/plugins/Hotkeys/localize/zh_CN/index.d.ts +1 -0
- package/dist/plugins/Hotkeys/utils.d.ts +4 -0
- package/dist/plugins/OutlineTree/components/TreeView/index.d.ts +1 -1
- package/dist/plugins/OutlineTree/components/TreeView/treeNode.d.ts +1 -2
- package/dist/plugins/OutlineTree/index.d.ts +0 -1
- package/dist/plugins/PropertyPanel/index.d.ts +1 -2
- package/dist/plugins/RightPanel/view.d.ts +1 -1
- package/dist/plugins/VisualPanelPlus/index.d.ts +1 -2
- package/dist/plugins/index.d.ts +14 -1
- package/dist/style.css +1 -1
- package/dist/type.d.ts +25 -0
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -16,9 +16,12 @@ npm i @chamn/engine @chamn/model @chamn/render
|
|
|
16
16
|
|
|
17
17
|
[Example Project](https://github.com/ByteCrazy/chameleon-demo)
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### ScreenSnapshot
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
<img width="1776" alt="image" src="https://github.com/user-attachments/assets/7b06dc4c-80a3-455d-bc91-14a1cf1fb331">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+

|
|
22
25
|
|
|
23
26
|

|
|
24
27
|
|
|
@@ -12,5 +12,5 @@ export type CSSEditorProps = {
|
|
|
12
12
|
initialValue?: CSSVal;
|
|
13
13
|
handler?: MutableRefObject<CSSEditorRef | null>;
|
|
14
14
|
};
|
|
15
|
-
export declare const CSSEditor: (props: CSSEditorProps) => JSX.Element;
|
|
15
|
+
export declare const CSSEditor: (props: CSSEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -35,5 +35,5 @@ export type CSSSizeInputProps = {
|
|
|
35
35
|
cumulativeTransform?: (params: CumulativeInfoType) => CumulativeInfoType;
|
|
36
36
|
unitList?: (keyof MinMaxType)[];
|
|
37
37
|
};
|
|
38
|
-
export declare const CSSSizeInput: (props: CSSSizeInputProps) => JSX.Element;
|
|
38
|
+
export declare const CSSSizeInput: (props: CSSSizeInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputCommonRef } from '../type';
|
|
3
|
-
|
|
3
|
+
declare const CSS_BACKGROUND_KEY_LIST: readonly ["background-color", "background-image", "background-repeat", "background-size"];
|
|
4
|
+
type CSSBackgroundKeyType = typeof CSS_BACKGROUND_KEY_LIST[number];
|
|
5
|
+
type Value = Record<CSSBackgroundKeyType, string>;
|
|
4
6
|
export type BackgroundInputProps = {
|
|
5
7
|
value?: Value;
|
|
6
8
|
initialValue?: Value;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputCommonRef } from '../type';
|
|
3
|
-
|
|
3
|
+
declare const CSS_BORDER_KEY_LIST: readonly ["border", "border-radius"];
|
|
4
|
+
type CSSBorderKeyType = typeof CSS_BORDER_KEY_LIST[number];
|
|
5
|
+
type Value = Record<CSSBorderKeyType, string>;
|
|
4
6
|
export type BorderInputProps = {
|
|
5
7
|
value?: Value;
|
|
6
8
|
initialValue?: Value;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputCommonRef } from '../type';
|
|
3
|
-
|
|
3
|
+
declare const FONT_CSS_KEY_LIST: readonly ["font-size", "color", "text-align", "font-weight"];
|
|
4
|
+
type FontKeyType = typeof FONT_CSS_KEY_LIST[number];
|
|
5
|
+
type Value = Record<FontKeyType, string>;
|
|
4
6
|
export type FontInputProps = {
|
|
5
7
|
initialValue?: Value;
|
|
6
8
|
value?: Value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputCommonRef } from '../type';
|
|
3
|
-
type Value = Record<
|
|
3
|
+
type Value = Record<string, string>;
|
|
4
4
|
export type MarginAndPaddingInputProps = {
|
|
5
5
|
value?: Value;
|
|
6
6
|
initialValue?: Value;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorPickerProps } from 'antd';
|
|
3
|
+
export type CustomColorPickerRef = {
|
|
4
|
+
updateColor: (color: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const CustomColorPicker: import("react").ForwardRefExoticComponent<Omit<ColorPickerProps, "onChange"> & {
|
|
7
|
+
onChange: (color: string) => void;
|
|
8
|
+
} & import("react").RefAttributes<CustomColorPickerRef>>;
|
|
@@ -11,4 +11,4 @@ export type SetterSwitcherProps = {
|
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
useField?: boolean;
|
|
13
13
|
} & Omit<CFieldProps, 'children'>;
|
|
14
|
-
export declare const SetterSwitcher: ({ setters, keyPaths, condition, useField, ...props }: SetterSwitcherProps) => JSX.Element;
|
|
14
|
+
export declare const SetterSwitcher: ({ setters, keyPaths, condition, useField, ...props }: SetterSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ModalProps } from 'antd';
|
|
3
2
|
export type SortItemOrderProps = {
|
|
4
3
|
list: any[];
|
|
@@ -7,4 +6,4 @@ export type SortItemOrderProps = {
|
|
|
7
6
|
sortLabelKey?: string;
|
|
8
7
|
onValueChange?: (newList: any[]) => void;
|
|
9
8
|
} & ModalProps;
|
|
10
|
-
export declare const SortItemOrderModal: ({ list, onValueChange, keyPaths, label, sortLabelKey, ...modalProps }: SortItemOrderProps) => JSX.Element;
|
|
9
|
+
export declare const SortItemOrderModal: ({ list, onValueChange, keyPaths, label, sortLabelKey, ...modalProps }: SortItemOrderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CSetterProps } from '../type';
|
|
3
2
|
import { SetterType } from '@chamn/model';
|
|
4
3
|
export type CArraySetterProps = {
|
|
@@ -9,6 +8,6 @@ export type CArraySetterProps = {
|
|
|
9
8
|
sortLabelKey?: string;
|
|
10
9
|
};
|
|
11
10
|
export declare const ArraySetter: {
|
|
12
|
-
({ onValueChange, setterContext, item: { setters, initialValue: itemInitialValue }, sortLabelKey, initialValue, ...props }: CSetterProps<CArraySetterProps>): JSX.Element;
|
|
11
|
+
({ onValueChange, setterContext, item: { setters, initialValue: itemInitialValue }, sortLabelKey, initialValue, ...props }: CSetterProps<CArraySetterProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
setterName: string;
|
|
14
13
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { InputProps } from 'antd';
|
|
3
2
|
export type InputNumberPlusProps = Omit<InputProps, 'onChange'> & {
|
|
4
3
|
min?: number;
|
|
@@ -6,4 +5,4 @@ export type InputNumberPlusProps = Omit<InputProps, 'onChange'> & {
|
|
|
6
5
|
value?: number;
|
|
7
6
|
onChange?: (newVal: number | undefined) => void;
|
|
8
7
|
};
|
|
9
|
-
export declare const InputNumberPlus: ({ min, max, value, onChange, addonAfter, ...restProps }: InputNumberPlusProps) => JSX.Element;
|
|
8
|
+
export declare const InputNumberPlus: ({ min, max, value, onChange, addonAfter, ...restProps }: InputNumberPlusProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EditorProps, Monaco } from '@monaco-editor/react';
|
|
3
2
|
type EditorType = EditorProps;
|
|
4
3
|
export type MonacoEditorInstance = Parameters<Required<EditorType>['onMount']>[0];
|
|
@@ -10,5 +9,5 @@ export type MonacoEditorProps = {
|
|
|
10
9
|
initialValue?: string;
|
|
11
10
|
language?: 'json' | 'javascript' | 'typescript';
|
|
12
11
|
};
|
|
13
|
-
export declare const MonacoEditor: (props: MonacoEditorProps) => JSX.Element;
|
|
12
|
+
export declare const MonacoEditor: (props: MonacoEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
|
@@ -67,6 +67,6 @@ export declare class Workbench extends React.Component<WorkbenchPropsType, Workb
|
|
|
67
67
|
onLeftBoxResizeStop: ResizeCallback;
|
|
68
68
|
onGlobalClick: (e: MouseEvent) => void;
|
|
69
69
|
componentDidMount(): void;
|
|
70
|
-
render(): JSX.Element;
|
|
70
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
71
71
|
}
|
|
72
72
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CSSEditor';
|
|
2
|
+
export * from './CSSPropertiesEditor';
|
|
3
|
+
export * from './CSSPropertiesVariableBindEditor';
|
|
4
|
+
export * from './ClassNameEditor';
|
|
5
|
+
export * from './CustomSchemaForm';
|
|
6
|
+
export * from './MonacoEditor';
|
|
7
|
+
export * from './Workbench';
|
|
8
|
+
export * from './DesignerSizer';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Workbench } from './component/Workbench';
|
|
3
|
-
import {
|
|
3
|
+
import { PluginManager } from './core/pluginManager';
|
|
4
4
|
import { Emitter } from 'mitt';
|
|
5
5
|
import { AssetPackage, CMaterialType, CNode, CPage, CPageDataType, CRootNode } from '@chamn/model';
|
|
6
6
|
import { ComponentsType } from '@chamn/render';
|
|
7
7
|
import { AssetsPackageListManager } from './core/assetPackagesListManage';
|
|
8
|
-
|
|
9
|
-
pluginManager: PluginManager;
|
|
10
|
-
engine: Engine;
|
|
11
|
-
};
|
|
12
|
-
export type EngineProps = {
|
|
13
|
-
plugins: CPlugin[];
|
|
14
|
-
schema: CPageDataType;
|
|
15
|
-
material?: CMaterialType[];
|
|
16
|
-
components?: Record<string, any>;
|
|
17
|
-
assetPackagesList?: AssetPackage[];
|
|
18
|
-
beforePluginRun?: (options: {
|
|
19
|
-
pluginManager: PluginManager;
|
|
20
|
-
}) => void;
|
|
21
|
-
/** 所有的加插件加载完成 */
|
|
22
|
-
onReady?: (ctx: EnginContext) => void;
|
|
23
|
-
onMount?: (ctx: EnginContext) => void;
|
|
24
|
-
/** 渲染器 umd 格式 js 地址, 默认 ./render.umd.js */
|
|
25
|
-
renderJSUrl?: string;
|
|
26
|
-
style?: React.CSSProperties;
|
|
27
|
-
className?: string;
|
|
28
|
-
};
|
|
8
|
+
import { EngineProps } from './type';
|
|
29
9
|
export declare class Engine extends React.Component<EngineProps> {
|
|
30
10
|
static version: string;
|
|
31
11
|
currentSelectNode: CNode | CRootNode | null;
|
|
@@ -46,12 +26,17 @@ export declare class Engine extends React.Component<EngineProps> {
|
|
|
46
26
|
} | undefined) => Promise<void>;
|
|
47
27
|
refresh: () => Promise<void>;
|
|
48
28
|
getWorkbench: () => Workbench | null;
|
|
49
|
-
|
|
29
|
+
/** return i18n object */
|
|
30
|
+
getI18n(): import("./i18n/index").CustomI18n;
|
|
31
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
50
32
|
}
|
|
51
33
|
export * as plugins from './plugins';
|
|
34
|
+
export * from './plugins';
|
|
35
|
+
export * from './component';
|
|
52
36
|
export * from '@chamn/layout';
|
|
53
37
|
export * from './material/innerMaterial';
|
|
54
38
|
export * from './component/CustomSchemaForm/components/Setters/type';
|
|
55
39
|
export * from './utils/index';
|
|
56
40
|
/** 注册自定义 setter */
|
|
57
41
|
export { registerCustomSetter } from './component/CustomSchemaForm/components/Form';
|
|
42
|
+
export * from './type';
|