@chamn/engine 0.0.27 → 0.0.29
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/component/CSSEditor/index.d.ts +1 -1
- package/dist/component/CSSPropertiesEditor/index.d.ts +3 -27
- package/dist/component/CSSPropertiesEditor/signleProperty.d.ts +25 -0
- package/dist/component/CSSPropertiesEditor/style.module.scss.d.ts +3 -1
- package/dist/component/CSSPropertiesVariableBindEditor/SingleProperty.d.ts +24 -0
- package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +5 -26
- package/dist/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +1 -0
- package/dist/component/CSSSizeInput/index.d.ts +39 -0
- package/dist/component/CSSSizeInput/style.module.scss.d.ts +10 -0
- package/dist/component/CSSUIPanel/BackgroundInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/BorderInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/DimensionInput/index.d.ts +11 -0
- package/dist/component/CSSUIPanel/FontInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/MarginAndPaddingInput/index.d.ts +11 -0
- package/dist/component/CSSUIPanel/ShadowInput/index.d.ts +10 -0
- package/dist/component/CSSUIPanel/index.d.ts +9 -0
- package/dist/component/CSSUIPanel/style.module.scss.d.ts +11 -0
- package/dist/component/CSSUIPanel/type.d.ts +3 -0
- package/dist/component/ClassNameEditor/index.d.ts +3 -9
- package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +1 -0
- package/dist/component/CustomSchemaForm/components/Setters/AntDColorSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/CSSSizeSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/ColorSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/RadioGroupSetter/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Setters/SliderSetter/index.d.ts +3 -0
- package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +3 -3
- package/dist/component/InputNumberPlus/index.d.ts +9 -0
- package/dist/component/InputNumberPlus/style.module.scss.d.ts +6 -0
- package/dist/config/colorPickerColorList.d.ts +4 -0
- package/dist/index.js +141 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28517 -18256
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/RightPanel/view.d.ts +1 -0
- package/dist/plugins/VisualPanelPlus/index.d.ts +2 -7
- package/dist/style.css +1 -1
- package/dist/utils/css.d.ts +26 -5
- package/dist/utils/index.d.ts +4 -1
- package/package.json +28 -18
- package/dist/component/CSSPropertiesEditor/util.d.ts +0 -1
- package/dist/component/CSSPropertiesVariableBindEditor/util.d.ts +0 -1
- package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +0 -1
|
@@ -3,7 +3,7 @@ declare const DOM_CSS_STATUS: ("normal" | "hover" | "focus" | "focus-within" | "
|
|
|
3
3
|
type DomCSSStatusType = typeof DOM_CSS_STATUS[number];
|
|
4
4
|
export type CSSVal = Partial<Record<DomCSSStatusType, Record<
|
|
5
5
|
/** media query key */
|
|
6
|
-
string,
|
|
6
|
+
string, string>>>;
|
|
7
7
|
export type CSSEditorRef = {
|
|
8
8
|
setValue: (val: CSSVal) => void;
|
|
9
9
|
};
|
|
@@ -2,43 +2,19 @@
|
|
|
2
2
|
export declare const defaultPropertyOptions: {
|
|
3
3
|
value: string;
|
|
4
4
|
}[];
|
|
5
|
-
export type SinglePropertyEditorProps = {
|
|
6
|
-
mode: 'create' | 'edit';
|
|
7
|
-
value: {
|
|
8
|
-
key: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
allValues: {
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
onValueChange: (value: {
|
|
16
|
-
key: string;
|
|
17
|
-
value: string;
|
|
18
|
-
}) => void;
|
|
19
|
-
onCreate?: (value: {
|
|
20
|
-
key: string;
|
|
21
|
-
value: string;
|
|
22
|
-
}) => void;
|
|
23
|
-
onDelete?: () => void;
|
|
24
|
-
};
|
|
25
|
-
export type SinglePropertyEditorRef = {
|
|
26
|
-
reset: () => void;
|
|
27
|
-
};
|
|
28
|
-
export declare const SinglePropertyEditor: import("react").ForwardRefExoticComponent<SinglePropertyEditorProps & import("react").RefAttributes<SinglePropertyEditorRef>>;
|
|
29
5
|
export type CSSPropertiesEditorProps = {
|
|
30
6
|
initialValue?: {
|
|
31
|
-
|
|
7
|
+
property: string;
|
|
32
8
|
value: string;
|
|
33
9
|
}[];
|
|
34
10
|
onValueChange?: (val: {
|
|
35
|
-
|
|
11
|
+
property: string;
|
|
36
12
|
value: string;
|
|
37
13
|
}[]) => void;
|
|
38
14
|
};
|
|
39
15
|
export type CSSPropertiesEditorRef = {
|
|
40
16
|
setValue: (val: {
|
|
41
|
-
|
|
17
|
+
property: string;
|
|
42
18
|
value: string;
|
|
43
19
|
}[]) => void;
|
|
44
20
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type SinglePropertyEditorProps = {
|
|
3
|
+
mode: 'create' | 'edit';
|
|
4
|
+
value?: {
|
|
5
|
+
property: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
allValues: {
|
|
9
|
+
property: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
onValueChange?: (value: {
|
|
13
|
+
property: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onCreate?: (value: {
|
|
17
|
+
property: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
onDelete?: () => void;
|
|
21
|
+
};
|
|
22
|
+
export type SinglePropertyEditorRef = {
|
|
23
|
+
reset: () => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const SinglePropertyEditor: import("react").ForwardRefExoticComponent<SinglePropertyEditorProps & import("react").RefAttributes<SinglePropertyEditorRef>>;
|
|
@@ -4,8 +4,10 @@ declare const classNames: typeof globalClassNames & {
|
|
|
4
4
|
readonly 'ant-select-selector': 'ant-select-selector';
|
|
5
5
|
readonly 'ant-select-single': 'ant-select-single';
|
|
6
6
|
readonly 'ant-select-selection-search': 'ant-select-selection-search';
|
|
7
|
-
readonly 'ant-select-status-error': 'ant-select-status-error';
|
|
8
7
|
readonly inputAuto: 'inputAuto';
|
|
8
|
+
readonly error: 'error';
|
|
9
|
+
readonly keyField: 'keyField';
|
|
10
|
+
readonly notEdit: 'notEdit';
|
|
9
11
|
readonly active: 'active';
|
|
10
12
|
readonly cssBox: 'cssBox';
|
|
11
13
|
readonly 'ant-collapse-borderless': 'ant-collapse-borderless';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { JSExpressionPropType } from '@chamn/model';
|
|
3
|
+
export type InnerSinglePropertyEditorProps = {
|
|
4
|
+
value?: {
|
|
5
|
+
property: string;
|
|
6
|
+
value: JSExpressionPropType | string;
|
|
7
|
+
};
|
|
8
|
+
onValueChange: (value: {
|
|
9
|
+
property: string;
|
|
10
|
+
value: JSExpressionPropType | string;
|
|
11
|
+
}) => void;
|
|
12
|
+
onDelete?: () => void;
|
|
13
|
+
onCreate?: (value: {
|
|
14
|
+
property: string;
|
|
15
|
+
value: JSExpressionPropType | string;
|
|
16
|
+
}) => {
|
|
17
|
+
errorKey?: string[];
|
|
18
|
+
} | void;
|
|
19
|
+
mod?: 'create' | 'edit';
|
|
20
|
+
};
|
|
21
|
+
export type InnerSinglePropertyEditorRef = {
|
|
22
|
+
reset: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const SinglePropertyEditor: import("react").ForwardRefExoticComponent<InnerSinglePropertyEditorProps & import("react").RefAttributes<InnerSinglePropertyEditorRef>>;
|
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { JSExpressionPropType } from '@chamn/model';
|
|
3
|
-
export type InnerSinglePropertyEditorProps = {
|
|
4
|
-
value?: {
|
|
5
|
-
key: string;
|
|
6
|
-
value: JSExpressionPropType;
|
|
7
|
-
};
|
|
8
|
-
onValueChange: (value: {
|
|
9
|
-
key: string;
|
|
10
|
-
value: JSExpressionPropType;
|
|
11
|
-
}) => void;
|
|
12
|
-
onDelete?: () => void;
|
|
13
|
-
onCreate?: (value: {
|
|
14
|
-
key: string;
|
|
15
|
-
value: JSExpressionPropType;
|
|
16
|
-
}) => {
|
|
17
|
-
errorKey?: string[];
|
|
18
|
-
} | void;
|
|
19
|
-
mod?: 'create' | 'edit';
|
|
20
|
-
};
|
|
21
|
-
export type InnerSinglePropertyEditorRef = {
|
|
22
|
-
reset: () => void;
|
|
23
|
-
};
|
|
24
3
|
export type CSSPropertiesVariableBindEditorProps = {
|
|
25
4
|
initialValue?: {
|
|
26
|
-
|
|
27
|
-
value: string;
|
|
5
|
+
property: string;
|
|
6
|
+
value: string | JSExpressionPropType;
|
|
28
7
|
}[];
|
|
29
8
|
onValueChange?: (val: {
|
|
30
|
-
|
|
9
|
+
property: string;
|
|
31
10
|
value: string;
|
|
32
11
|
}[]) => void;
|
|
33
12
|
};
|
|
34
13
|
export type CSSPropertiesVariableBindEditorRef = {
|
|
35
14
|
setValue: (val: {
|
|
36
|
-
|
|
37
|
-
value: string;
|
|
15
|
+
property: string;
|
|
16
|
+
value: string | JSExpressionPropType;
|
|
38
17
|
}[]) => void;
|
|
39
18
|
};
|
|
40
19
|
export declare const CSSPropertiesVariableBindEditor: import("react").ForwardRefExoticComponent<CSSPropertiesVariableBindEditorProps & import("react").RefAttributes<CSSPropertiesVariableBindEditorRef>>;
|
|
@@ -11,5 +11,6 @@ declare const classNames: typeof globalClassNames & {
|
|
|
11
11
|
readonly 'ant-collapse-borderless': 'ant-collapse-borderless';
|
|
12
12
|
readonly 'ant-collapse-item': 'ant-collapse-item';
|
|
13
13
|
readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
|
|
14
|
+
readonly switchBtn: 'switchBtn';
|
|
14
15
|
};
|
|
15
16
|
export = classNames;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InputProps } from 'antd';
|
|
2
|
+
import { MouseEventHandler } from 'react';
|
|
3
|
+
type CumulativeInfoType = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
cumulativeX: number;
|
|
7
|
+
cumulativeY: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const useDragSize: (options?: {
|
|
10
|
+
onStart?: ((data: CumulativeInfoType) => void) | undefined;
|
|
11
|
+
onChange?: ((data: CumulativeInfoType) => void) | undefined;
|
|
12
|
+
onEnd?: ((data: CumulativeInfoType) => void) | undefined;
|
|
13
|
+
limitCumulative?: {
|
|
14
|
+
x?: [number | undefined, number | undefined] | undefined;
|
|
15
|
+
y?: [number | undefined, number | undefined] | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
} | undefined) => {
|
|
18
|
+
onMouseDown: MouseEventHandler<any>;
|
|
19
|
+
};
|
|
20
|
+
type MinMaxType = {
|
|
21
|
+
px?: number;
|
|
22
|
+
vw?: number;
|
|
23
|
+
vh?: number;
|
|
24
|
+
rem?: number;
|
|
25
|
+
};
|
|
26
|
+
export type CSSSizeInputProps = {
|
|
27
|
+
value?: string;
|
|
28
|
+
onValueChange?: (newVal: string | undefined) => void;
|
|
29
|
+
min?: MinMaxType | number;
|
|
30
|
+
max?: MinMaxType | number;
|
|
31
|
+
size?: InputProps['size'];
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
unit?: boolean;
|
|
34
|
+
/** 累计的偏移量,映射为具体的值,默认 1:1 */
|
|
35
|
+
cumulativeTransform?: (params: CumulativeInfoType) => CumulativeInfoType;
|
|
36
|
+
unitList?: (keyof MinMaxType)[];
|
|
37
|
+
};
|
|
38
|
+
export declare const CSSSizeInput: (props: CSSSizeInputProps) => JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import globalClassNames from '../../style.d';
|
|
2
|
+
declare const classNames: typeof globalClassNames & {
|
|
3
|
+
readonly cssSizeInput: 'cssSizeInput';
|
|
4
|
+
readonly unitSelect: 'unitSelect';
|
|
5
|
+
readonly 'ant-select-focused': 'ant-select-focused';
|
|
6
|
+
readonly 'ant-select-selector': 'ant-select-selector';
|
|
7
|
+
readonly 'ant-select-selection-item': 'ant-select-selection-item';
|
|
8
|
+
readonly 'ant-select-arrow': 'ant-select-arrow';
|
|
9
|
+
};
|
|
10
|
+
export = classNames;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
type Value = Record<'background-color' | 'background-image' | 'background-repeat' | 'background-size', string>;
|
|
4
|
+
export type BackgroundInputProps = {
|
|
5
|
+
value?: Value;
|
|
6
|
+
initialValue?: Value;
|
|
7
|
+
onChange?: (newVal: Value) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const BackgroundInput: import("react").ForwardRefExoticComponent<BackgroundInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
type Value = Record<'border' | 'border-radius', string>;
|
|
4
|
+
export type BorderInputProps = {
|
|
5
|
+
value?: Value;
|
|
6
|
+
initialValue?: Value;
|
|
7
|
+
onChange?: (newVal: Value) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const BorderInput: import("react").ForwardRefExoticComponent<BorderInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
declare const keyList: readonly ["width", "height", "min-width", "max-width", "min-height", "max-height", "flex", "display"];
|
|
4
|
+
type Value = Record<typeof keyList[number], string>;
|
|
5
|
+
export type DimensionInputProps = {
|
|
6
|
+
value?: Value;
|
|
7
|
+
initialValue?: Value;
|
|
8
|
+
onChange?: (newVal: Value) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const DimensionInput: import("react").ForwardRefExoticComponent<DimensionInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
type Value = Record<'font-size' | 'color' | 'text-align' | 'font-weight', string>;
|
|
4
|
+
export type FontInputProps = {
|
|
5
|
+
initialValue?: Value;
|
|
6
|
+
value?: Value;
|
|
7
|
+
onChange?: (newVal: Value) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const FontInput: import("react").ForwardRefExoticComponent<FontInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
type Value = Record<'left' | 'right' | 'top' | 'bottom' | 'all', string>;
|
|
4
|
+
export type MarginAndPaddingInputProps = {
|
|
5
|
+
value?: Value;
|
|
6
|
+
initialValue?: Value;
|
|
7
|
+
onChange?: (newVal: Value) => void;
|
|
8
|
+
prefix: 'margin' | 'padding';
|
|
9
|
+
};
|
|
10
|
+
export declare const MarginAndPaddingInput: import("react").ForwardRefExoticComponent<MarginAndPaddingInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from '../type';
|
|
3
|
+
type Value = Record<'box-shadow', string>;
|
|
4
|
+
export type ShadowInputProps = {
|
|
5
|
+
value?: Value;
|
|
6
|
+
initialValue?: Value;
|
|
7
|
+
onChange?: (newVal: Value) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const ShadowInput: import("react").ForwardRefExoticComponent<ShadowInputProps & import("react").RefAttributes<InputCommonRef>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputCommonRef } from './type';
|
|
3
|
+
export type CSSUIPanelProps = {
|
|
4
|
+
initialVal?: Record<string, string>;
|
|
5
|
+
value?: Record<string, string>;
|
|
6
|
+
onValueChange?: (newVal: Record<string, string>) => void;
|
|
7
|
+
};
|
|
8
|
+
export type CSSUIPanelRef = InputCommonRef;
|
|
9
|
+
export declare const CSSUIPanel: import("react").ForwardRefExoticComponent<CSSUIPanelProps & import("react").RefAttributes<InputCommonRef>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import globalClassNames from '../../style.d';
|
|
2
|
+
declare const classNames: typeof globalClassNames & {
|
|
3
|
+
readonly label: 'label';
|
|
4
|
+
readonly font: 'font';
|
|
5
|
+
readonly 'm-p': 'm-p';
|
|
6
|
+
readonly fontOption: 'fontOption';
|
|
7
|
+
readonly row: 'row';
|
|
8
|
+
readonly CSSUIPanel: 'CSSUIPanel';
|
|
9
|
+
readonly 'ant-radio-button-wrapper': 'ant-radio-button-wrapper';
|
|
10
|
+
};
|
|
11
|
+
export = classNames;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { ClassNameType } from '@chamn/model';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { ClassNameType } from '@chamn/model';
|
|
3
3
|
export type ClassNameEditorProps = {
|
|
4
|
-
initialValue?:
|
|
5
|
-
key: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}[];
|
|
4
|
+
initialValue?: ClassNameType[];
|
|
8
5
|
onValueChange?: (val: ClassNameType[]) => void;
|
|
9
6
|
};
|
|
10
7
|
export type ClassNameEditorRef = {
|
|
11
|
-
setValue: (val:
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[]) => void;
|
|
8
|
+
setValue: (val: ClassNameType[]) => void;
|
|
15
9
|
};
|
|
16
10
|
export declare const ClassNameEditor: React.ForwardRefExoticComponent<ClassNameEditorProps & React.RefAttributes<ClassNameEditorRef>>;
|
|
@@ -7,9 +7,9 @@ export type CSetter<T = any> = {
|
|
|
7
7
|
export type CSetterProps<T = {
|
|
8
8
|
_: any;
|
|
9
9
|
}> = {
|
|
10
|
-
onValueChange?: (
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
onValueChange?: (val: any) => void;
|
|
11
|
+
initialValue?: any;
|
|
12
|
+
value?: any;
|
|
13
13
|
setterContext: {
|
|
14
14
|
pluginCtx: CPluginCtx;
|
|
15
15
|
setCollapseHeaderExt?: (el: React.ReactNode) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
export type InputNumberPlusProps = Omit<InputProps, 'onChange'> & {
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
value?: number;
|
|
7
|
+
onChange?: (newVal: number | undefined) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const InputNumberPlus: ({ min, max, value, onChange, addonAfter, ...restProps }: InputNumberPlusProps) => JSX.Element;
|