@finos/legend-application-studio 13.0.1 → 13.1.0
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/lib/components/editor/command/project-search.css +1 -1
- package/lib/components/editor/command/project-search.css.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +11 -3
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.js +41 -34
- package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +35 -54
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.js +2 -2
- package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/RuntimeEditor.js +11 -20
- package/lib/components/editor/edit-panel/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +4 -8
- package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +1 -1
- package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +3 -7
- package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js +2 -2
- package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js +1 -1
- package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -9
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js +3 -4
- package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +3 -10
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +4 -10
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js +7 -9
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +9 -12
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js +12 -10
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js +5 -7
- package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js +3 -4
- package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +3 -5
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +9 -6
- package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +1 -1
- package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +4 -8
- package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +157 -57
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +39 -21
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +62 -9
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js +4 -8
- package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts +7 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +33 -5
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts +7 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +35 -7
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +4 -4
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +8 -15
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/shared/StudioLambdaEditor.d.ts +1 -0
- package/lib/components/shared/StudioLambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/StudioLambdaEditor.js +2 -2
- package/lib/components/shared/StudioLambdaEditor.js.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +5 -5
- package/lib/stores/EditorStore.d.ts.map +1 -1
- package/lib/stores/EditorStore.js +7 -7
- package/lib/stores/EditorStore.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +8 -2
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts +0 -2
- package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/GenerationSpecificationEditorState.js +1 -8
- package/lib/stores/editor-state/GenerationSpecificationEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +2 -4
- package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts +4 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +31 -15
- package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +6 -3
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +30 -17
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts +10 -0
- package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graphModifier/DomainGraphModifierHelper.js +31 -1
- package/lib/stores/graphModifier/DomainGraphModifierHelper.js.map +1 -1
- package/lib/stores/shared/DnDUtil.d.ts +1 -2
- package/lib/stores/shared/DnDUtil.d.ts.map +1 -1
- package/lib/stores/shared/DnDUtil.js +0 -2
- package/lib/stores/shared/DnDUtil.js.map +1 -1
- package/package.json +13 -13
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +13 -2
- package/src/components/editor/edit-panel/FunctionEditor.tsx +220 -152
- package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +154 -184
- package/src/components/editor/edit-panel/GrammarTextEditor.tsx +4 -5
- package/src/components/editor/edit-panel/RuntimeEditor.tsx +89 -90
- package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +57 -40
- package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +1 -1
- package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +50 -45
- package/src/components/editor/edit-panel/external-format-editor/BindingElementEditor.tsx +36 -32
- package/src/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +46 -41
- package/src/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.tsx +9 -7
- package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +18 -21
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +39 -29
- package/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +39 -39
- package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +82 -58
- package/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +66 -50
- package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +2 -2
- package/src/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.tsx +48 -45
- package/src/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.tsx +12 -8
- package/src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +2 -3
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +75 -72
- package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +63 -43
- package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +1 -1
- package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +55 -38
- package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +813 -499
- package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +209 -113
- package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +184 -52
- package/src/components/editor/edit-panel/uml-editor/PropertyEditor.tsx +62 -39
- package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +137 -52
- package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +171 -88
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +4 -2
- package/src/components/editor/side-bar/Explorer.tsx +13 -20
- package/src/components/shared/StudioLambdaEditor.tsx +3 -0
- package/src/components/workspace-setup/WorkspaceSetup.tsx +1 -1
- package/src/stores/EditorStore.ts +7 -6
- package/src/stores/editor/NewElementState.ts +8 -2
- package/src/stores/editor-state/GenerationSpecificationEditorState.ts +1 -15
- package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +2 -3
- package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
- package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +46 -29
- package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +39 -20
- package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +1 -1
- package/src/stores/graphModifier/DomainGraphModifierHelper.ts +92 -0
- package/src/stores/shared/DnDUtil.ts +0 -2
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { useState, useCallback } from 'react';
|
|
17
|
+
import { useState, useCallback, useRef } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import {
|
|
20
20
|
UMLEditorState,
|
|
21
21
|
UML_EDITOR_TAB,
|
|
22
22
|
} from '../../../../stores/editor-state/element-editor-state/UMLEditorState.js';
|
|
23
|
-
import { useDrop } from 'react-dnd';
|
|
23
|
+
import { useDrag, useDrop } from 'react-dnd';
|
|
24
24
|
import {
|
|
25
25
|
CORE_DND_TYPE,
|
|
26
26
|
type ElementDragSource,
|
|
@@ -42,10 +42,21 @@ import {
|
|
|
42
42
|
LockIcon,
|
|
43
43
|
FireIcon,
|
|
44
44
|
StickArrowCircleRightIcon,
|
|
45
|
+
PanelEntryDragHandle,
|
|
46
|
+
PanelEntryDropZonePlaceholder,
|
|
47
|
+
DragPreviewLayer,
|
|
48
|
+
useDragPreviewLayer,
|
|
49
|
+
PanelDropZone,
|
|
45
50
|
} from '@finos/legend-art';
|
|
46
51
|
import { LEGEND_STUDIO_TEST_ID } from '../../../LegendStudioTestID.js';
|
|
47
|
-
import {
|
|
48
|
-
|
|
52
|
+
import {
|
|
53
|
+
StereotypeDragPreviewLayer,
|
|
54
|
+
StereotypeSelector,
|
|
55
|
+
} from './StereotypeSelector.js';
|
|
56
|
+
import {
|
|
57
|
+
TaggedValueDragPreviewLayer,
|
|
58
|
+
TaggedValueEditor,
|
|
59
|
+
} from './TaggedValueEditor.js';
|
|
49
60
|
import { useEditorStore } from '../../EditorStoreProvider.js';
|
|
50
61
|
import {
|
|
51
62
|
type Enumeration,
|
|
@@ -68,57 +79,113 @@ import {
|
|
|
68
79
|
annotatedElement_deleteTaggedValue,
|
|
69
80
|
enum_deleteValue,
|
|
70
81
|
enum_addValue,
|
|
82
|
+
enum_swapValues,
|
|
71
83
|
} from '../../../../stores/graphModifier/DomainGraphModifierHelper.js';
|
|
72
84
|
import { useApplicationNavigationContext } from '@finos/legend-application';
|
|
73
85
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../stores/LegendStudioApplicationNavigationContext.js';
|
|
74
86
|
|
|
87
|
+
type EnumValueDragSource = {
|
|
88
|
+
enumValue: Enum;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const ENUM_VALUE_DND_TYPE = 'ENUMERATION';
|
|
92
|
+
|
|
75
93
|
const EnumBasicEditor = observer(
|
|
76
94
|
(props: {
|
|
77
|
-
|
|
95
|
+
enumValue: Enum;
|
|
78
96
|
selectValue: () => void;
|
|
79
97
|
deleteValue: () => void;
|
|
80
98
|
isReadOnly: boolean;
|
|
81
99
|
}) => {
|
|
82
|
-
const
|
|
100
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
101
|
+
const { enumValue, selectValue, deleteValue, isReadOnly } = props;
|
|
83
102
|
const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
|
84
|
-
enum_setName(
|
|
103
|
+
enum_setName(enumValue, event.target.value);
|
|
85
104
|
};
|
|
86
105
|
const isEnumValueDuplicated = (val: Enum): boolean =>
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
enumValue._OWNER.values.filter((value) => value.name === val.name)
|
|
107
|
+
.length >= 2;
|
|
108
|
+
|
|
109
|
+
// Drag and Drop
|
|
110
|
+
const handleHover = useCallback(
|
|
111
|
+
(item: EnumValueDragSource): void => {
|
|
112
|
+
const draggingEnumeration = item.enumValue;
|
|
113
|
+
const hoveredEnumeration = enumValue;
|
|
114
|
+
enum_swapValues(
|
|
115
|
+
enumValue._OWNER,
|
|
116
|
+
draggingEnumeration,
|
|
117
|
+
hoveredEnumeration,
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
[enumValue],
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const [{ isBeingDraggedEnumeration }, dropConnector] = useDrop<
|
|
124
|
+
EnumValueDragSource,
|
|
125
|
+
void,
|
|
126
|
+
{ isBeingDraggedEnumeration: Enum | undefined }
|
|
127
|
+
>(
|
|
128
|
+
() => ({
|
|
129
|
+
accept: [ENUM_VALUE_DND_TYPE],
|
|
130
|
+
hover: (item) => handleHover(item),
|
|
131
|
+
collect: (monitor) => ({
|
|
132
|
+
isBeingDraggedEnumeration:
|
|
133
|
+
monitor.getItem<EnumValueDragSource | null>()?.enumValue,
|
|
134
|
+
}),
|
|
135
|
+
}),
|
|
136
|
+
[handleHover],
|
|
137
|
+
);
|
|
138
|
+
const isBeingDragged = enumValue === isBeingDraggedEnumeration;
|
|
139
|
+
const [, dragConnector, dragPreviewConnector] =
|
|
140
|
+
useDrag<EnumValueDragSource>(
|
|
141
|
+
() => ({
|
|
142
|
+
type: ENUM_VALUE_DND_TYPE,
|
|
143
|
+
item: () => ({
|
|
144
|
+
enumValue: enumValue,
|
|
145
|
+
}),
|
|
146
|
+
}),
|
|
147
|
+
[enumValue],
|
|
148
|
+
);
|
|
149
|
+
dragConnector(dropConnector(ref));
|
|
150
|
+
useDragPreviewLayer(dragPreviewConnector);
|
|
89
151
|
|
|
90
152
|
return (
|
|
91
|
-
<div className="enum-basic-
|
|
92
|
-
<
|
|
93
|
-
className="enum-basic-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
153
|
+
<div ref={ref} className="enum-basic-editor__container">
|
|
154
|
+
<PanelEntryDropZonePlaceholder showPlaceholder={isBeingDragged}>
|
|
155
|
+
<div className="enum-basic-editor">
|
|
156
|
+
<PanelEntryDragHandle />
|
|
157
|
+
<InputWithInlineValidation
|
|
158
|
+
className="enum-basic-editor__name input-group__input"
|
|
159
|
+
spellCheck={false}
|
|
160
|
+
disabled={isReadOnly}
|
|
161
|
+
value={enumValue.name}
|
|
162
|
+
onChange={changeValue}
|
|
163
|
+
placeholder={`Enum name`}
|
|
164
|
+
validationErrorMessage={
|
|
165
|
+
isEnumValueDuplicated(enumValue) ? 'Duplicated enum' : undefined
|
|
166
|
+
}
|
|
167
|
+
/>
|
|
168
|
+
<button
|
|
169
|
+
className="uml-element-editor__basic__detail-btn"
|
|
170
|
+
onClick={selectValue}
|
|
171
|
+
tabIndex={-1}
|
|
172
|
+
title={'See detail'}
|
|
173
|
+
>
|
|
174
|
+
<LongArrowRightIcon />
|
|
175
|
+
</button>
|
|
176
|
+
{!isReadOnly && (
|
|
177
|
+
<button
|
|
178
|
+
className="uml-element-editor__remove-btn"
|
|
179
|
+
disabled={isReadOnly}
|
|
180
|
+
onClick={deleteValue}
|
|
181
|
+
tabIndex={-1}
|
|
182
|
+
title={'Remove'}
|
|
183
|
+
>
|
|
184
|
+
<TimesIcon />
|
|
185
|
+
</button>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
</PanelEntryDropZonePlaceholder>
|
|
122
189
|
</div>
|
|
123
190
|
);
|
|
124
191
|
},
|
|
@@ -183,11 +250,15 @@ const EnumEditor = observer(
|
|
|
183
250
|
},
|
|
184
251
|
[_enum, isReadOnly],
|
|
185
252
|
);
|
|
186
|
-
const [{ isTaggedValueDragOver }, dropTaggedValueRef] = useDrop
|
|
253
|
+
const [{ isTaggedValueDragOver }, dropTaggedValueRef] = useDrop<
|
|
254
|
+
ElementDragSource,
|
|
255
|
+
void,
|
|
256
|
+
{ isTaggedValueDragOver: boolean }
|
|
257
|
+
>(
|
|
187
258
|
() => ({
|
|
188
259
|
accept: [CORE_DND_TYPE.PROJECT_EXPLORER_PROFILE],
|
|
189
|
-
drop: (item
|
|
190
|
-
collect: (monitor)
|
|
260
|
+
drop: (item) => handleDropTaggedValue(item),
|
|
261
|
+
collect: (monitor) => ({
|
|
191
262
|
isTaggedValueDragOver: monitor.isOver({ shallow: true }),
|
|
192
263
|
}),
|
|
193
264
|
}),
|
|
@@ -206,11 +277,15 @@ const EnumEditor = observer(
|
|
|
206
277
|
},
|
|
207
278
|
[_enum, isReadOnly],
|
|
208
279
|
);
|
|
209
|
-
const [{ isStereotypeDragOver }, dropStereotypeRef] = useDrop
|
|
280
|
+
const [{ isStereotypeDragOver }, dropStereotypeRef] = useDrop<
|
|
281
|
+
ElementDragSource,
|
|
282
|
+
void,
|
|
283
|
+
{ isStereotypeDragOver: boolean }
|
|
284
|
+
>(
|
|
210
285
|
() => ({
|
|
211
286
|
accept: [CORE_DND_TYPE.PROJECT_EXPLORER_PROFILE],
|
|
212
|
-
drop: (item
|
|
213
|
-
collect: (monitor)
|
|
287
|
+
drop: (item) => handleDropStereotype(item),
|
|
288
|
+
collect: (monitor) => ({
|
|
214
289
|
isStereotypeDragOver: monitor.isOver({ shallow: true }),
|
|
215
290
|
}),
|
|
216
291
|
}),
|
|
@@ -272,40 +347,42 @@ const EnumEditor = observer(
|
|
|
272
347
|
</div>
|
|
273
348
|
<div className="panel__content">
|
|
274
349
|
{selectedTab === UML_EDITOR_TAB.TAGGED_VALUES && (
|
|
275
|
-
<
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
'panel__content__lists--dnd-over':
|
|
279
|
-
isTaggedValueDragOver && !isReadOnly,
|
|
280
|
-
})}
|
|
350
|
+
<PanelDropZone
|
|
351
|
+
isDragOver={isTaggedValueDragOver && !isReadOnly}
|
|
352
|
+
dropTargetConnector={dropTaggedValueRef}
|
|
281
353
|
>
|
|
282
|
-
|
|
283
|
-
<
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
354
|
+
<div className="panel__content__lists">
|
|
355
|
+
<TaggedValueDragPreviewLayer />
|
|
356
|
+
{_enum.taggedValues.map((taggedValue) => (
|
|
357
|
+
<TaggedValueEditor
|
|
358
|
+
annotatedElement={_enum}
|
|
359
|
+
key={taggedValue._UUID}
|
|
360
|
+
taggedValue={taggedValue}
|
|
361
|
+
deleteValue={_deleteTaggedValue(taggedValue)}
|
|
362
|
+
isReadOnly={isReadOnly}
|
|
363
|
+
/>
|
|
364
|
+
))}
|
|
365
|
+
</div>
|
|
366
|
+
</PanelDropZone>
|
|
291
367
|
)}
|
|
292
368
|
{selectedTab === UML_EDITOR_TAB.STEREOTYPES && (
|
|
293
|
-
<
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
'panel__content__lists--dnd-over':
|
|
297
|
-
isStereotypeDragOver && !isReadOnly,
|
|
298
|
-
})}
|
|
369
|
+
<PanelDropZone
|
|
370
|
+
isDragOver={isStereotypeDragOver && !isReadOnly}
|
|
371
|
+
dropTargetConnector={dropStereotypeRef}
|
|
299
372
|
>
|
|
300
|
-
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
373
|
+
<div className="panel__content__lists">
|
|
374
|
+
<StereotypeDragPreviewLayer />
|
|
375
|
+
{_enum.stereotypes.map((stereotype) => (
|
|
376
|
+
<StereotypeSelector
|
|
377
|
+
key={stereotype.value._UUID}
|
|
378
|
+
annotatedElement={_enum}
|
|
379
|
+
stereotype={stereotype}
|
|
380
|
+
deleteStereotype={_deleteStereotype(stereotype)}
|
|
381
|
+
isReadOnly={isReadOnly}
|
|
382
|
+
/>
|
|
383
|
+
))}
|
|
384
|
+
</div>
|
|
385
|
+
</PanelDropZone>
|
|
309
386
|
)}
|
|
310
387
|
</div>
|
|
311
388
|
</div>
|
|
@@ -400,11 +477,15 @@ export const EnumerationEditor = observer(
|
|
|
400
477
|
},
|
|
401
478
|
[enumeration, isReadOnly],
|
|
402
479
|
);
|
|
403
|
-
const [{ isTaggedValueDragOver }, dropTaggedValueRef] = useDrop
|
|
480
|
+
const [{ isTaggedValueDragOver }, dropTaggedValueRef] = useDrop<
|
|
481
|
+
ElementDragSource,
|
|
482
|
+
void,
|
|
483
|
+
{ isTaggedValueDragOver: boolean }
|
|
484
|
+
>(
|
|
404
485
|
() => ({
|
|
405
486
|
accept: [CORE_DND_TYPE.PROJECT_EXPLORER_PROFILE],
|
|
406
|
-
drop: (item
|
|
407
|
-
collect: (monitor)
|
|
487
|
+
drop: (item) => handleDropTaggedValue(item),
|
|
488
|
+
collect: (monitor) => ({
|
|
408
489
|
isTaggedValueDragOver: monitor.isOver({ shallow: true }),
|
|
409
490
|
}),
|
|
410
491
|
}),
|
|
@@ -423,16 +504,21 @@ export const EnumerationEditor = observer(
|
|
|
423
504
|
},
|
|
424
505
|
[enumeration, isReadOnly],
|
|
425
506
|
);
|
|
426
|
-
const [{ isStereotypeDragOver }, dropStereotypeRef] = useDrop
|
|
507
|
+
const [{ isStereotypeDragOver }, dropStereotypeRef] = useDrop<
|
|
508
|
+
ElementDragSource,
|
|
509
|
+
void,
|
|
510
|
+
{ isStereotypeDragOver: boolean }
|
|
511
|
+
>(
|
|
427
512
|
() => ({
|
|
428
513
|
accept: [CORE_DND_TYPE.PROJECT_EXPLORER_PROFILE],
|
|
429
|
-
drop: (item
|
|
430
|
-
collect: (monitor)
|
|
514
|
+
drop: (item) => handleDropStereotype(item),
|
|
515
|
+
collect: (monitor) => ({
|
|
431
516
|
isStereotypeDragOver: monitor.isOver({ shallow: true }),
|
|
432
517
|
}),
|
|
433
518
|
}),
|
|
434
519
|
[handleDropStereotype],
|
|
435
520
|
);
|
|
521
|
+
|
|
436
522
|
// Generation
|
|
437
523
|
const generationParentElementPath =
|
|
438
524
|
editorStore.graphState.graphGenerationState.findGenerationParentPath(
|
|
@@ -522,10 +608,18 @@ export const EnumerationEditor = observer(
|
|
|
522
608
|
<div className="panel__content">
|
|
523
609
|
{selectedTab === UML_EDITOR_TAB.ENUM_VALUES && (
|
|
524
610
|
<div className="panel__content__lists">
|
|
611
|
+
<DragPreviewLayer
|
|
612
|
+
labelGetter={(item: EnumValueDragSource): string =>
|
|
613
|
+
item.enumValue.name === ''
|
|
614
|
+
? '(unknown)'
|
|
615
|
+
: item.enumValue.name
|
|
616
|
+
}
|
|
617
|
+
types={[ENUM_VALUE_DND_TYPE]}
|
|
618
|
+
/>
|
|
525
619
|
{enumeration.values.map((enumValue) => (
|
|
526
620
|
<EnumBasicEditor
|
|
527
621
|
key={enumValue._UUID}
|
|
528
|
-
|
|
622
|
+
enumValue={enumValue}
|
|
529
623
|
deleteValue={deleteValue(enumValue)}
|
|
530
624
|
selectValue={selectValue(enumValue)}
|
|
531
625
|
isReadOnly={isReadOnly}
|
|
@@ -534,40 +628,42 @@ export const EnumerationEditor = observer(
|
|
|
534
628
|
</div>
|
|
535
629
|
)}
|
|
536
630
|
{selectedTab === UML_EDITOR_TAB.TAGGED_VALUES && (
|
|
537
|
-
<
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
'panel__content__lists--dnd-over':
|
|
541
|
-
isTaggedValueDragOver && !isReadOnly,
|
|
542
|
-
})}
|
|
631
|
+
<PanelDropZone
|
|
632
|
+
isDragOver={isTaggedValueDragOver && !isReadOnly}
|
|
633
|
+
dropTargetConnector={dropTaggedValueRef}
|
|
543
634
|
>
|
|
544
|
-
|
|
545
|
-
<
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
635
|
+
<div className="panel__content__lists">
|
|
636
|
+
<TaggedValueDragPreviewLayer />
|
|
637
|
+
{enumeration.taggedValues.map((taggedValue) => (
|
|
638
|
+
<TaggedValueEditor
|
|
639
|
+
annotatedElement={enumeration}
|
|
640
|
+
key={taggedValue._UUID}
|
|
641
|
+
taggedValue={taggedValue}
|
|
642
|
+
deleteValue={_deleteTaggedValue(taggedValue)}
|
|
643
|
+
isReadOnly={isReadOnly}
|
|
644
|
+
/>
|
|
645
|
+
))}
|
|
646
|
+
</div>
|
|
647
|
+
</PanelDropZone>
|
|
553
648
|
)}
|
|
554
649
|
{selectedTab === UML_EDITOR_TAB.STEREOTYPES && (
|
|
555
|
-
<
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
'panel__content__lists--dnd-over':
|
|
559
|
-
isStereotypeDragOver && !isReadOnly,
|
|
560
|
-
})}
|
|
650
|
+
<PanelDropZone
|
|
651
|
+
isDragOver={isStereotypeDragOver && !isReadOnly}
|
|
652
|
+
dropTargetConnector={dropStereotypeRef}
|
|
561
653
|
>
|
|
562
|
-
|
|
563
|
-
<
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
654
|
+
<div className="panel__content__lists">
|
|
655
|
+
<StereotypeDragPreviewLayer />
|
|
656
|
+
{enumeration.stereotypes.map((stereotype) => (
|
|
657
|
+
<StereotypeSelector
|
|
658
|
+
key={stereotype.value._UUID}
|
|
659
|
+
annotatedElement={enumeration}
|
|
660
|
+
stereotype={stereotype}
|
|
661
|
+
deleteStereotype={_deleteStereotype(stereotype)}
|
|
662
|
+
isReadOnly={isReadOnly}
|
|
663
|
+
/>
|
|
664
|
+
))}
|
|
665
|
+
</div>
|
|
666
|
+
</PanelDropZone>
|
|
571
667
|
)}
|
|
572
668
|
</div>
|
|
573
669
|
</div>
|