@chamn/engine 0.0.10 → 0.0.12
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/CustomSchemaForm/components/Form/context.d.ts +2 -0
- package/dist/component/CustomSchemaForm/components/Form/index.d.ts +1 -0
- package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +2 -0
- package/dist/component/CustomSchemaForm/index.d.ts +3 -0
- package/dist/component/Workbench/index.d.ts +4 -0
- package/dist/core/pluginManager.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +3849 -3814
- package/dist/index.mjs.map +1 -0
- package/dist/material/innerMaterial.d.ts +1 -1
- package/dist/plugins/RightPanel/view.d.ts +4 -0
- package/package.json +12 -9
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -36
- package/.prettierrc.json +0 -7
- package/.storybook/main.js +0 -24
- package/.storybook/preview.js +0 -9
- package/CHANGELOG.md +0 -54
- package/__tests__/demo.test.ts +0 -3
- package/build.config.js +0 -88
- package/dist/index.cjs.js +0 -197
- 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/Engine.module.scss.d.ts +0 -5
- package/public/_dev_/render.d.ts +0 -2
- package/public/component/CSSEditor/style.module.scss.d.ts +0 -6
- package/public/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
- package/public/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
- package/public/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
- package/public/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
- package/public/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
- package/public/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
- package/public/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
- package/public/component/Workbench/style.module.scss.d.ts +0 -25
- package/public/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
- package/public/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
- package/public/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
- package/public/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
- package/public/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
- package/public/plugins/Designer/style.module.scss.d.ts +0 -5
- package/public/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
- package/public/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
- package/public/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
- package/public/plugins/RightPanel/style.module.scss.d.ts +0 -10
- package/public/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
- package/public/render.umd.js +0 -42
- package/public/render.umd.js.map +0 -1
- package/src/Engine.module.scss +0 -10
- package/src/Engine.module.scss.d.ts +0 -5
- package/src/_dev_/index.css +0 -22
- package/src/_dev_/index.tsx +0 -5
- package/src/_dev_/page/Editor/index.tsx +0 -198
- package/src/_dev_/page/Editor/indexCustom.tsx +0 -274
- package/src/_dev_/page/Preview/index.tsx +0 -56
- package/src/_dev_/render.ts +0 -3
- package/src/_dev_/router.tsx +0 -14
- package/src/assets/react.svg +0 -4
- package/src/assets/styles/mixin.scss +0 -15
- package/src/component/CSSEditor/index.tsx +0 -247
- package/src/component/CSSEditor/style.module.scss +0 -22
- package/src/component/CSSEditor/style.module.scss.d.ts +0 -6
- package/src/component/CSSPropertiesEditor/cssProperties.ts +0 -1062
- package/src/component/CSSPropertiesEditor/index.tsx +0 -389
- package/src/component/CSSPropertiesEditor/style.module.scss +0 -46
- package/src/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
- package/src/component/CSSPropertiesEditor/util.ts +0 -19
- package/src/component/CSSPropertiesVariableBindEditor/cssProperties.ts +0 -782
- package/src/component/CSSPropertiesVariableBindEditor/index.tsx +0 -366
- package/src/component/CSSPropertiesVariableBindEditor/style.module.scss +0 -48
- package/src/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
- package/src/component/CSSPropertiesVariableBindEditor/util.ts +0 -19
- package/src/component/ClassNameEditor/index.tsx +0 -91
- package/src/component/ClassNameEditor/style.module.scss +0 -0
- package/src/component/CustomSchemaForm/components/Form/Field/index.tsx +0 -81
- package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss +0 -32
- package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
- package/src/component/CustomSchemaForm/components/Form/context.ts +0 -23
- package/src/component/CustomSchemaForm/components/Form/index.tsx +0 -71
- package/src/component/CustomSchemaForm/components/SetterSwitcher/index.tsx +0 -273
- package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss +0 -16
- package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.tsx +0 -55
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.tsx +0 -160
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/index.tsx +0 -129
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss +0 -22
- package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
- package/src/component/CustomSchemaForm/components/Setters/BooleanSetter/index.tsx +0 -32
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.tsx +0 -78
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss +0 -7
- package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
- package/src/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.tsx +0 -47
- package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.ts +0 -28
- package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/index.tsx +0 -93
- package/src/component/CustomSchemaForm/components/Setters/JSONSetter/index.tsx +0 -80
- package/src/component/CustomSchemaForm/components/Setters/NumberSetter/index.tsx +0 -34
- package/src/component/CustomSchemaForm/components/Setters/SelectSetter/index.tsx +0 -35
- package/src/component/CustomSchemaForm/components/Setters/ShapeSetter/index.tsx +0 -65
- package/src/component/CustomSchemaForm/components/Setters/StringSetter/index.tsx +0 -30
- package/src/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.tsx +0 -31
- package/src/component/CustomSchemaForm/components/Setters/index.ts +0 -26
- package/src/component/CustomSchemaForm/components/Setters/type.ts +0 -18
- package/src/component/CustomSchemaForm/context.ts +0 -20
- package/src/component/CustomSchemaForm/index.tsx +0 -93
- package/src/component/CustomSchemaForm/style.module.scss +0 -15
- package/src/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
- package/src/component/CustomSchemaForm/utils.ts +0 -13
- package/src/component/MonacoEditor/index.tsx +0 -81
- package/src/component/Workbench/index.tsx +0 -329
- package/src/component/Workbench/style.module.scss +0 -159
- package/src/component/Workbench/style.module.scss.d.ts +0 -25
- package/src/core/pluginManager.ts +0 -151
- package/src/i18n/en_US/index.ts +0 -5
- package/src/i18n/index.ts +0 -39
- package/src/i18n/zh_CN/index.ts +0 -5
- package/src/index.tsx +0 -150
- package/src/material/innerMaterial.ts +0 -343
- package/src/plugins/AdvancePanel/index.tsx +0 -191
- package/src/plugins/AdvancePanel/style.module.scss +0 -8
- package/src/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
- package/src/plugins/ComponentLibrary/components/DragItem/index.tsx +0 -65
- package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss +0 -58
- package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
- package/src/plugins/ComponentLibrary/components/ListView/index.tsx +0 -50
- package/src/plugins/ComponentLibrary/components/ListView/style.module.scss +0 -27
- package/src/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
- package/src/plugins/ComponentLibrary/index.tsx +0 -184
- package/src/plugins/ComponentLibrary/localize/en_US/index.ts +0 -3
- package/src/plugins/ComponentLibrary/localize/index.ts +0 -3
- package/src/plugins/ComponentLibrary/localize/zh_CN/index.ts +0 -3
- package/src/plugins/ComponentLibrary/style.module.scss +0 -31
- package/src/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
- package/src/plugins/ComponentLibrary/util.ts +0 -14
- package/src/plugins/ComponentStatePanel/index.tsx +0 -59
- package/src/plugins/Designer/components/DefaultSelectToolBar/index.tsx +0 -94
- package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss +0 -59
- package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
- package/src/plugins/Designer/components/GhostView/index.tsx +0 -18
- package/src/plugins/Designer/config.ts +0 -1
- package/src/plugins/Designer/index.tsx +0 -61
- package/src/plugins/Designer/localize/en_US/index.ts +0 -3
- package/src/plugins/Designer/localize/index.ts +0 -3
- package/src/plugins/Designer/localize/zh_CN/index.ts +0 -3
- package/src/plugins/Designer/style.module.scss +0 -10
- package/src/plugins/Designer/style.module.scss.d.ts +0 -5
- package/src/plugins/Designer/util.ts +0 -18
- package/src/plugins/Designer/view.tsx +0 -225
- package/src/plugins/DisplaySourceSchema/index.tsx +0 -76
- package/src/plugins/GlobalStatePanel/index.tsx +0 -96
- package/src/plugins/GlobalStatePanel/localize/en_US/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/localize/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/localize/zh_CN/index.ts +0 -3
- package/src/plugins/GlobalStatePanel/style.module.scss +0 -8
- package/src/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
- package/src/plugins/History/index.tsx +0 -110
- package/src/plugins/OutlineTree/components/TreeView/context.ts +0 -43
- package/src/plugins/OutlineTree/components/TreeView/dataStruct.ts +0 -58
- package/src/plugins/OutlineTree/components/TreeView/index.tsx +0 -376
- package/src/plugins/OutlineTree/components/TreeView/style.module.scss +0 -93
- package/src/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
- package/src/plugins/OutlineTree/components/TreeView/treeNode.tsx +0 -271
- package/src/plugins/OutlineTree/index.tsx +0 -39
- package/src/plugins/OutlineTree/localize/en_US/index.ts +0 -3
- package/src/plugins/OutlineTree/localize/index.ts +0 -3
- package/src/plugins/OutlineTree/localize/zh_CN/index.ts +0 -3
- package/src/plugins/OutlineTree/util.tsx +0 -302
- package/src/plugins/PropertyPanel/index.tsx +0 -63
- package/src/plugins/PropertyPanel/style.module.scss +0 -12
- package/src/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
- package/src/plugins/PropertyPanel/utils.ts +0 -13
- package/src/plugins/RightPanel/index.tsx +0 -30
- package/src/plugins/RightPanel/style.module.scss +0 -16
- package/src/plugins/RightPanel/style.module.scss.d.ts +0 -10
- package/src/plugins/RightPanel/view.tsx +0 -177
- package/src/plugins/VisualPanel/index.tsx +0 -185
- package/src/plugins/VisualPanel/style.module.scss +0 -17
- package/src/plugins/VisualPanelPlus/index.tsx +0 -103
- package/src/plugins/VisualPanelPlus/style.module.scss +0 -20
- package/src/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
- package/src/plugins/index.tsx +0 -26
- package/src/stories/Button.jsx +0 -50
- package/src/stories/Button.stories.jsx +0 -40
- package/src/stories/Introduction.stories.mdx +0 -194
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/plugins/CSSEditor.stories.tsx +0 -75
- package/src/stories/plugins/VisualPanelPlus.stories.tsx +0 -74
- package/src/style.d.ts +0 -2
- package/src/typing.d.ts +0 -9
- package/src/utils/css.ts +0 -88
- package/src/utils/defaultEngineConfig.tsx +0 -55
- package/src/utils/index.ts +0 -12
- package/src/utils/logger.ts +0 -4
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -32
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { waitReactUpdate } from '@/utils';
|
|
2
|
-
import { formatCSSProperty, StyleArr, styleArr2Obj } from '@/utils/css';
|
|
3
|
-
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
|
4
|
-
import { Card, Collapse, Dropdown, Space } from 'antd';
|
|
5
|
-
import CheckableTag from 'antd/es/tag/CheckableTag';
|
|
6
|
-
import { MutableRefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
-
import { CSSPropertiesEditor, CSSPropertiesEditorRef } from '../CSSPropertiesEditor';
|
|
8
|
-
import styles from './style.module.scss';
|
|
9
|
-
// state: 'normal' | 'hover' | 'active' | 'focus' | 'first' | 'last' | 'even' | 'odd';
|
|
10
|
-
|
|
11
|
-
const DOM_CSS_STATUS = [
|
|
12
|
-
'normal' as const,
|
|
13
|
-
'hover' as const,
|
|
14
|
-
'focus' as const,
|
|
15
|
-
'focus-within' as const,
|
|
16
|
-
'focus-visible' as const,
|
|
17
|
-
'checked' as const,
|
|
18
|
-
'disable' as const,
|
|
19
|
-
'active' as const,
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
type DomCSSStatusType = typeof DOM_CSS_STATUS[number];
|
|
23
|
-
|
|
24
|
-
const DOM_CSS_STATUS_LIST = DOM_CSS_STATUS.map((el) => {
|
|
25
|
-
return {
|
|
26
|
-
key: el,
|
|
27
|
-
label: el,
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
type MediaQueryItem = {
|
|
32
|
-
key: string;
|
|
33
|
-
maxWidth: string;
|
|
34
|
-
label: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type CSSVal = Partial<
|
|
38
|
-
Record<
|
|
39
|
-
DomCSSStatusType,
|
|
40
|
-
Record<
|
|
41
|
-
/** media query key */
|
|
42
|
-
string,
|
|
43
|
-
Record<string, string>
|
|
44
|
-
>
|
|
45
|
-
>
|
|
46
|
-
>;
|
|
47
|
-
|
|
48
|
-
export type CSSEditorRef = {
|
|
49
|
-
setValue: (val: CSSVal) => void;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type CSSEditorProps = {
|
|
53
|
-
onValueChange?: (val: CSSVal) => void;
|
|
54
|
-
initialValue?: CSSVal;
|
|
55
|
-
handler?: MutableRefObject<CSSEditorRef | null>;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const CSSEditor = (props: CSSEditorProps) => {
|
|
59
|
-
const [selectedStateTag, setSelectedStateTag] = useState<DomCSSStatusType>('normal');
|
|
60
|
-
const [mediaQueryList] = useState<MediaQueryItem[]>([
|
|
61
|
-
{
|
|
62
|
-
key: '991',
|
|
63
|
-
maxWidth: '991',
|
|
64
|
-
label: 'Medial Query ( <= 991 px )',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: '767',
|
|
68
|
-
maxWidth: '767',
|
|
69
|
-
label: 'Medial Query ( <= 767 px )',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
key: '479',
|
|
73
|
-
maxWidth: '479',
|
|
74
|
-
label: 'Medial Query ( <= 479 px )',
|
|
75
|
-
},
|
|
76
|
-
]);
|
|
77
|
-
const cssPropertyRefMap = useRef<Record<string, CSSPropertiesEditorRef | null>>({});
|
|
78
|
-
const handleChange = (tag: DomCSSStatusType) => {
|
|
79
|
-
setSelectedStateTag(tag);
|
|
80
|
-
};
|
|
81
|
-
const [domStatusList, setDomStatusList] = useState<string[]>(['normal']);
|
|
82
|
-
const cssStatusList = useMemo(() => {
|
|
83
|
-
return DOM_CSS_STATUS_LIST.filter((el) => {
|
|
84
|
-
return !domStatusList.includes(el.key);
|
|
85
|
-
});
|
|
86
|
-
}, [domStatusList]);
|
|
87
|
-
|
|
88
|
-
const selectCssStatusList = useMemo(() => {
|
|
89
|
-
return DOM_CSS_STATUS_LIST.filter((el) => {
|
|
90
|
-
return domStatusList.includes(el.key);
|
|
91
|
-
});
|
|
92
|
-
}, [domStatusList]);
|
|
93
|
-
|
|
94
|
-
const [cssVal, setCssVal] = useState<CSSVal>(props.initialValue ?? {});
|
|
95
|
-
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
const list = Object.keys(cssVal);
|
|
98
|
-
setDomStatusList(list);
|
|
99
|
-
}, [cssVal]);
|
|
100
|
-
|
|
101
|
-
const currentCssStateVal = useMemo(() => {
|
|
102
|
-
const res = cssVal?.[selectedStateTag];
|
|
103
|
-
if (!res) {
|
|
104
|
-
return {};
|
|
105
|
-
}
|
|
106
|
-
const newVal: Record<string, { key: string; value: string }[]> = {};
|
|
107
|
-
Object.keys(res).forEach((key) => {
|
|
108
|
-
newVal[key] = formatCSSProperty(res[key] || {}).normalProperty;
|
|
109
|
-
});
|
|
110
|
-
return newVal;
|
|
111
|
-
}, [selectedStateTag, cssVal]);
|
|
112
|
-
|
|
113
|
-
const initVal = useCallback(() => {
|
|
114
|
-
Object.keys(cssPropertyRefMap.current).forEach((key) => {
|
|
115
|
-
const ref = cssPropertyRefMap.current?.[key];
|
|
116
|
-
const cssVal = currentCssStateVal[key] || [];
|
|
117
|
-
if (ref) {
|
|
118
|
-
ref.setValue(cssVal);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}, [currentCssStateVal]);
|
|
122
|
-
const initRef = useRef<() => void>();
|
|
123
|
-
initRef.current = initVal;
|
|
124
|
-
|
|
125
|
-
if (props.handler) {
|
|
126
|
-
props.handler.current = {
|
|
127
|
-
setValue: async (newVal) => {
|
|
128
|
-
setCssVal(newVal);
|
|
129
|
-
await waitReactUpdate();
|
|
130
|
-
initRef.current?.();
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 初始化赋值
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
initVal();
|
|
138
|
-
}, [selectedStateTag]);
|
|
139
|
-
|
|
140
|
-
const updateCssVal = useCallback(
|
|
141
|
-
(mediaKey: string, val: StyleArr) => {
|
|
142
|
-
const newVal = {
|
|
143
|
-
...cssVal,
|
|
144
|
-
[selectedStateTag]: {
|
|
145
|
-
...(cssVal[selectedStateTag] || {}),
|
|
146
|
-
[mediaKey]: styleArr2Obj(val),
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
props.onValueChange?.(newVal);
|
|
150
|
-
},
|
|
151
|
-
[cssVal, selectedStateTag]
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<>
|
|
156
|
-
<Card
|
|
157
|
-
size="small"
|
|
158
|
-
type="inner"
|
|
159
|
-
title={<span style={{ fontSize: '12px' }}>CSS</span>}
|
|
160
|
-
extra={
|
|
161
|
-
<Dropdown
|
|
162
|
-
menu={{
|
|
163
|
-
items: cssStatusList,
|
|
164
|
-
onClick: (el) => {
|
|
165
|
-
setDomStatusList((oldVal) => {
|
|
166
|
-
return [...oldVal, el.key];
|
|
167
|
-
});
|
|
168
|
-
},
|
|
169
|
-
}}
|
|
170
|
-
>
|
|
171
|
-
<PlusOutlined />
|
|
172
|
-
</Dropdown>
|
|
173
|
-
}
|
|
174
|
-
>
|
|
175
|
-
<Space
|
|
176
|
-
size={[0, 8]}
|
|
177
|
-
wrap
|
|
178
|
-
style={{
|
|
179
|
-
paddingBottom: '10px',
|
|
180
|
-
}}
|
|
181
|
-
>
|
|
182
|
-
{selectCssStatusList.map((tag) => {
|
|
183
|
-
const checked = selectedStateTag.includes(tag.key);
|
|
184
|
-
return (
|
|
185
|
-
<CheckableTag
|
|
186
|
-
key={tag.key}
|
|
187
|
-
style={{
|
|
188
|
-
border: !checked ? '1px solid rgb(216 216 216 / 82%)' : '1px solid rgba(0,0,0,0))',
|
|
189
|
-
}}
|
|
190
|
-
checked={checked}
|
|
191
|
-
onChange={() => handleChange(tag.key)}
|
|
192
|
-
className={styles.stateTag}
|
|
193
|
-
>
|
|
194
|
-
{tag.label}
|
|
195
|
-
{tag.key !== 'normal' && (
|
|
196
|
-
<MinusCircleOutlined
|
|
197
|
-
className={styles.stateTagClose}
|
|
198
|
-
onClick={(e) => {
|
|
199
|
-
e.stopPropagation();
|
|
200
|
-
e.preventDefault();
|
|
201
|
-
setDomStatusList((oldVal) => {
|
|
202
|
-
return oldVal.filter((el) => {
|
|
203
|
-
return el !== tag.key;
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
setSelectedStateTag('normal');
|
|
207
|
-
}}
|
|
208
|
-
/>
|
|
209
|
-
)}
|
|
210
|
-
</CheckableTag>
|
|
211
|
-
);
|
|
212
|
-
})}
|
|
213
|
-
</Space>
|
|
214
|
-
|
|
215
|
-
<Collapse
|
|
216
|
-
defaultActiveKey={['normal']}
|
|
217
|
-
bordered={false}
|
|
218
|
-
style={{
|
|
219
|
-
marginBottom: '10px',
|
|
220
|
-
}}
|
|
221
|
-
>
|
|
222
|
-
<Collapse.Panel header={<span>Normal</span>} key="normal">
|
|
223
|
-
<CSSPropertiesEditor
|
|
224
|
-
ref={(ref) => {
|
|
225
|
-
cssPropertyRefMap.current['normal'] = ref;
|
|
226
|
-
}}
|
|
227
|
-
onValueChange={(val) => updateCssVal('normal', val)}
|
|
228
|
-
initialValue={currentCssStateVal['normal']}
|
|
229
|
-
/>
|
|
230
|
-
</Collapse.Panel>
|
|
231
|
-
{mediaQueryList.map((el) => {
|
|
232
|
-
return (
|
|
233
|
-
<Collapse.Panel header={<span>{el.label}</span>} key={el.key}>
|
|
234
|
-
<CSSPropertiesEditor
|
|
235
|
-
ref={(ref) => {
|
|
236
|
-
cssPropertyRefMap.current[el.key] = ref;
|
|
237
|
-
}}
|
|
238
|
-
onValueChange={(val) => updateCssVal(el.key, val)}
|
|
239
|
-
/>
|
|
240
|
-
</Collapse.Panel>
|
|
241
|
-
);
|
|
242
|
-
})}
|
|
243
|
-
</Collapse>
|
|
244
|
-
</Card>
|
|
245
|
-
</>
|
|
246
|
-
);
|
|
247
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.stateTag {
|
|
2
|
-
position: relative;
|
|
3
|
-
.stateTagClose {
|
|
4
|
-
position: absolute;
|
|
5
|
-
right: -10px;
|
|
6
|
-
top: -10px;
|
|
7
|
-
background-color: white;
|
|
8
|
-
color: #4d4d4d;
|
|
9
|
-
opacity: 0;
|
|
10
|
-
font-size: 20px;
|
|
11
|
-
transform: scale(0.6);
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
border-radius: 10px;
|
|
16
|
-
}
|
|
17
|
-
&:hover {
|
|
18
|
-
.stateTagClose {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|