@finos/legend-application-studio 13.0.3 → 13.1.2

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.
Files changed (204) hide show
  1. package/lib/components/editor/command/project-search.css +1 -1
  2. package/lib/components/editor/command/project-search.css.map +1 -1
  3. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  4. package/lib/components/editor/command-center/ProjectSearchCommand.js +11 -3
  5. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  6. package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
  7. package/lib/components/editor/edit-panel/FunctionEditor.js +41 -34
  8. package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
  9. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
  10. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +35 -54
  11. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
  12. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  13. package/lib/components/editor/edit-panel/GrammarTextEditor.js +2 -2
  14. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  15. package/lib/components/editor/edit-panel/RuntimeEditor.d.ts.map +1 -1
  16. package/lib/components/editor/edit-panel/RuntimeEditor.js +11 -20
  17. package/lib/components/editor/edit-panel/RuntimeEditor.js.map +1 -1
  18. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  19. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +10 -2
  20. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  21. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
  22. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +4 -8
  23. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
  24. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +1 -1
  25. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
  26. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  27. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +3 -7
  28. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  29. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts.map +1 -1
  30. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js +2 -2
  31. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js.map +1 -1
  32. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js +1 -1
  33. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js.map +1 -1
  34. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  35. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -9
  36. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  37. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts.map +1 -1
  38. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js +3 -4
  39. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
  40. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  41. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +3 -10
  42. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  43. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  44. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +4 -10
  45. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  46. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js +7 -9
  47. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js.map +1 -1
  48. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
  49. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +3 -6
  50. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
  51. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
  52. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js +7 -8
  53. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js.map +1 -1
  54. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  55. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +1 -3
  56. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  57. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts.map +1 -1
  58. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js +5 -7
  59. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js.map +1 -1
  60. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts.map +1 -1
  61. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js +3 -4
  62. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
  63. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts.map +1 -1
  64. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js +1 -1
  65. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
  66. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
  67. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +3 -5
  68. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
  69. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
  70. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js +6 -4
  71. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  72. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +1 -1
  73. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  74. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
  75. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +6 -12
  76. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
  77. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  78. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +156 -62
  79. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  80. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
  81. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +39 -21
  82. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
  83. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
  84. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +62 -9
  85. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
  86. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts.map +1 -1
  87. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js +4 -8
  88. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js.map +1 -1
  89. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts +7 -1
  90. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts.map +1 -1
  91. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +33 -5
  92. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
  93. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts +7 -1
  94. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts.map +1 -1
  95. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +35 -7
  96. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
  97. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  98. package/lib/components/editor/side-bar/CreateNewElementModal.js +2 -3
  99. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  100. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  101. package/lib/components/editor/side-bar/Explorer.js +8 -9
  102. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  103. package/lib/components/shared/StudioLambdaEditor.d.ts +1 -0
  104. package/lib/components/shared/StudioLambdaEditor.d.ts.map +1 -1
  105. package/lib/components/shared/StudioLambdaEditor.js +2 -2
  106. package/lib/components/shared/StudioLambdaEditor.js.map +1 -1
  107. package/lib/index.css +2 -2
  108. package/lib/index.css.map +1 -1
  109. package/lib/package.json +5 -5
  110. package/lib/stores/EditorStore.d.ts.map +1 -1
  111. package/lib/stores/EditorStore.js +7 -7
  112. package/lib/stores/EditorStore.js.map +1 -1
  113. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  114. package/lib/stores/editor/NewElementState.js +12 -5
  115. package/lib/stores/editor/NewElementState.js.map +1 -1
  116. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts +0 -2
  117. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts.map +1 -1
  118. package/lib/stores/editor-state/GenerationSpecificationEditorState.js +1 -8
  119. package/lib/stores/editor-state/GenerationSpecificationEditorState.js.map +1 -1
  120. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  121. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +2 -4
  122. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  123. package/lib/stores/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts +2 -1
  124. package/lib/stores/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts.map +1 -1
  125. package/lib/stores/editor-state/element-editor-state/connection/ConnectionEditorState.js +9 -1
  126. package/lib/stores/editor-state/element-editor-state/connection/ConnectionEditorState.js.map +1 -1
  127. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
  128. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  129. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  130. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  131. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  132. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
  133. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  134. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  135. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +2 -2
  136. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  137. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  138. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +3 -3
  139. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  140. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts +10 -0
  141. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts.map +1 -1
  142. package/lib/stores/graphModifier/DomainGraphModifierHelper.js +31 -1
  143. package/lib/stores/graphModifier/DomainGraphModifierHelper.js.map +1 -1
  144. package/lib/stores/graphModifier/StoreRelational_GraphModifierHelper.d.ts +2 -1
  145. package/lib/stores/graphModifier/StoreRelational_GraphModifierHelper.d.ts.map +1 -1
  146. package/lib/stores/graphModifier/StoreRelational_GraphModifierHelper.js +3 -0
  147. package/lib/stores/graphModifier/StoreRelational_GraphModifierHelper.js.map +1 -1
  148. package/lib/stores/shared/DnDUtil.d.ts +1 -2
  149. package/lib/stores/shared/DnDUtil.d.ts.map +1 -1
  150. package/lib/stores/shared/DnDUtil.js +0 -2
  151. package/lib/stores/shared/DnDUtil.js.map +1 -1
  152. package/lib/stores/shared/testable/TestableUtils.d.ts.map +1 -1
  153. package/lib/stores/shared/testable/TestableUtils.js +2 -3
  154. package/lib/stores/shared/testable/TestableUtils.js.map +1 -1
  155. package/package.json +13 -13
  156. package/src/components/editor/command-center/ProjectSearchCommand.tsx +13 -2
  157. package/src/components/editor/edit-panel/FunctionEditor.tsx +220 -152
  158. package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +154 -184
  159. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +4 -5
  160. package/src/components/editor/edit-panel/RuntimeEditor.tsx +89 -90
  161. package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +36 -0
  162. package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +57 -40
  163. package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +1 -1
  164. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +50 -45
  165. package/src/components/editor/edit-panel/external-format-editor/BindingElementEditor.tsx +36 -32
  166. package/src/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.tsx +1 -1
  167. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +46 -41
  168. package/src/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.tsx +9 -7
  169. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +18 -21
  170. package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +39 -29
  171. package/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +39 -39
  172. package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +23 -15
  173. package/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +40 -38
  174. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +1 -3
  175. package/src/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.tsx +48 -45
  176. package/src/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.tsx +12 -8
  177. package/src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +2 -3
  178. package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +75 -72
  179. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.tsx +63 -36
  180. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +1 -1
  181. package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +56 -45
  182. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +812 -504
  183. package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +209 -113
  184. package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +184 -52
  185. package/src/components/editor/edit-panel/uml-editor/PropertyEditor.tsx +62 -39
  186. package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +137 -52
  187. package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +171 -88
  188. package/src/components/editor/side-bar/CreateNewElementModal.tsx +2 -1
  189. package/src/components/editor/side-bar/Explorer.tsx +11 -15
  190. package/src/components/shared/StudioLambdaEditor.tsx +3 -0
  191. package/src/stores/EditorStore.ts +7 -6
  192. package/src/stores/editor/NewElementState.ts +12 -5
  193. package/src/stores/editor-state/GenerationSpecificationEditorState.ts +1 -15
  194. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +2 -3
  195. package/src/stores/editor-state/element-editor-state/connection/ConnectionEditorState.ts +10 -0
  196. package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -1
  197. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  198. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -0
  199. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +2 -1
  200. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +12 -3
  201. package/src/stores/graphModifier/DomainGraphModifierHelper.ts +92 -0
  202. package/src/stores/graphModifier/StoreRelational_GraphModifierHelper.ts +10 -0
  203. package/src/stores/shared/DnDUtil.ts +0 -2
  204. package/src/stores/shared/testable/TestableUtils.ts +4 -3
@@ -25,6 +25,7 @@ import {
25
25
  ResizablePanelSplitterLine,
26
26
  TimesIcon,
27
27
  LockIcon,
28
+ PanelDropZone,
28
29
  } from '@finos/legend-art';
29
30
  import {
30
31
  filterByType,
@@ -121,7 +122,11 @@ const BindingScopeEditor = observer(
121
122
  handleDropElement,
122
123
  isReadOnly,
123
124
  } = props;
124
- const [{ isElementDragOver }, dropElementRef] = useDrop(
125
+ const [{ isElementDragOver }, dropElementRef] = useDrop<
126
+ ElementDragSource,
127
+ void,
128
+ { isElementDragOver: boolean }
129
+ >(
125
130
  () => ({
126
131
  accept: [
127
132
  CORE_DND_TYPE.PROJECT_EXPLORER_ENUMERATION,
@@ -131,8 +136,8 @@ const BindingScopeEditor = observer(
131
136
  CORE_DND_TYPE.PROJECT_EXPLORER_ASSOCIATION,
132
137
  CORE_DND_TYPE.PROJECT_EXPLORER_FUNCTION,
133
138
  ],
134
- drop: (item: ElementDragSource): void => handleDropElement(item),
135
- collect: (monitor): { isElementDragOver: boolean } => ({
139
+ drop: (item) => handleDropElement(item),
140
+ collect: (monitor) => ({
136
141
  isElementDragOver: monitor.isOver({ shallow: true }),
137
142
  }),
138
143
  }),
@@ -141,38 +146,37 @@ const BindingScopeEditor = observer(
141
146
 
142
147
  return (
143
148
  <div className="binding-scope-editor">
144
- <div
145
- ref={dropElementRef}
146
- className="binding-scope-editor__panel__content dnd__overlay__container"
147
- >
148
- <div
149
- className={clsx({ dnd__overlay: isElementDragOver && !isReadOnly })}
150
- />
151
- <div className="binding-scope-editor__panel__content__form">
152
- <div className="binding-scope-editor__panel__content__form__section">
153
- <div className="binding-scope-editor__panel__content__form__section__list">
154
- {elements.map((elementRef) => (
155
- <BindingScopeEntryEditor
156
- key={elementRef.value._UUID}
157
- elementRef={elementRef}
158
- removeElement={removeElement}
159
- isReadOnly={isReadOnly}
160
- />
161
- ))}
162
- <div className="binding-scope-editor__panel__content__form__section__list__new-item__add">
163
- <button
164
- className="binding-scope-editor__panel__content__form__section__list__new-item__add-btn btn btn--dark"
165
- disabled={!allowAddingElement}
166
- tabIndex={-1}
167
- onClick={addElement}
168
- title="Add Element"
169
- >
170
- Add Value
171
- </button>
149
+ <div className="binding-scope-editor__panel__content">
150
+ <PanelDropZone
151
+ dropTargetConnector={dropElementRef}
152
+ isDragOver={isElementDragOver && !isReadOnly}
153
+ >
154
+ <div className="binding-scope-editor__panel__content__form">
155
+ <div className="binding-scope-editor__panel__content__form__section">
156
+ <div className="binding-scope-editor__panel__content__form__section__list">
157
+ {elements.map((elementRef) => (
158
+ <BindingScopeEntryEditor
159
+ key={elementRef.value._UUID}
160
+ elementRef={elementRef}
161
+ removeElement={removeElement}
162
+ isReadOnly={isReadOnly}
163
+ />
164
+ ))}
165
+ <div className="binding-scope-editor__panel__content__form__section__list__new-item__add">
166
+ <button
167
+ className="binding-scope-editor__panel__content__form__section__list__new-item__add-btn btn btn--dark"
168
+ disabled={!allowAddingElement}
169
+ tabIndex={-1}
170
+ onClick={addElement}
171
+ title="Add Element"
172
+ >
173
+ Add Value
174
+ </button>
175
+ </div>
172
176
  </div>
173
177
  </div>
174
178
  </div>
175
- </div>
179
+ </PanelDropZone>
176
180
  </div>
177
181
  </div>
178
182
  );
@@ -422,7 +422,7 @@ const SchemaSetModelGenerationEditor = observer(
422
422
  </button>
423
423
  </div>
424
424
  </div>
425
- <div className="panel__content dnd__dropzone">
425
+ <div className="panel__content">
426
426
  <div className="file-generation-editor__configuration__content">
427
427
  {modelGenerationState.modelGenerationProperties.map(
428
428
  (abstractGenerationProperty) => (
@@ -30,6 +30,7 @@ import {
30
30
  PencilIcon,
31
31
  TimesIcon,
32
32
  PlusIcon,
33
+ PanelDropZone,
33
34
  } from '@finos/legend-art';
34
35
  import { MappingEditorState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingEditorState.js';
35
36
  import { TypeTree } from '../../../shared/TypeTree.js';
@@ -203,11 +204,15 @@ export const SourceValueInput = observer(
203
204
  },
204
205
  [isReadOnly, updateSourceValue, value],
205
206
  );
206
- const [{ canDrop }, dropRef] = useDrop(
207
+ const [{ canDrop }, dropRef] = useDrop<
208
+ TypeDragSource,
209
+ void,
210
+ { canDrop: boolean }
211
+ >(
207
212
  () => ({
208
213
  accept: CORE_DND_TYPE.TYPE_TREE_ENUM,
209
- drop: (item: TransformDropTarget): void => handleDrop(item),
210
- collect: (monitor): { canDrop: boolean } => ({
214
+ drop: (item) => handleDrop(item),
215
+ collect: (monitor) => ({
211
216
  canDrop: monitor.canDrop(),
212
217
  }),
213
218
  }),
@@ -365,11 +370,15 @@ export const EnumerationMappingEditor = observer(
365
370
  },
366
371
  [enumerationMapping, isReadOnly],
367
372
  );
368
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
373
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
374
+ ElementDragSource,
375
+ void,
376
+ { isDragOver: boolean; canDrop: boolean }
377
+ >(
369
378
  () => ({
370
379
  accept: CORE_DND_TYPE.PROJECT_EXPLORER_ENUMERATION,
371
- drop: (item: ElementDragSource): void => handleDrop(item),
372
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
380
+ drop: (item) => handleDrop(item),
381
+ collect: (monitor) => ({
373
382
  isDragOver: monitor.isOver({ shallow: true }),
374
383
  canDrop: monitor.canDrop(),
375
384
  }),
@@ -502,42 +511,38 @@ export const EnumerationMappingEditor = observer(
502
511
  </button>
503
512
  </div>
504
513
  </div>
505
- <div ref={dropRef} className="panel__content dnd__dropzone">
506
- {sourceType && isDragOver && !isReadOnly && (
507
- <div className="dnd__overlay"></div>
508
- )}
509
- {sourceType && (
510
- <div className="source-panel__explorer">
511
- {sourceType instanceof Enumeration && (
512
- <TypeTree type={sourceType} />
513
- )}
514
- {/* TODO?: do we need to show anything when the source type is string or integer */}
515
- </div>
516
- )}
517
- {!sourceType && (
518
- <BlankPanelPlaceholder
519
- placeholderText="Choose a source"
520
- onClick={showSourceSelectorModal}
521
- clickActionType="add"
522
- tooltipText="Drop an enumeration"
523
- dndProps={{
524
- isDragOver: isDragOver && !isReadOnly,
525
- canDrop: canDrop && !isReadOnly,
526
- }}
527
- readOnlyProps={
528
- !isReadOnly
529
- ? undefined
530
- : {
531
- placeholderText: 'No source',
532
- }
533
- }
514
+ <div className="panel__content">
515
+ <PanelDropZone
516
+ dropTargetConnector={dropRef}
517
+ isDragOver={
518
+ Boolean(sourceType) && isDragOver && !isReadOnly
519
+ }
520
+ >
521
+ {sourceType && (
522
+ <div className="source-panel__explorer">
523
+ {sourceType instanceof Enumeration && (
524
+ <TypeTree type={sourceType} />
525
+ )}
526
+ {/* TODO?: do we need to show anything when the source type is string or integer */}
527
+ </div>
528
+ )}
529
+ {!sourceType && (
530
+ <BlankPanelPlaceholder
531
+ text="Choose a source"
532
+ onClick={showSourceSelectorModal}
533
+ clickActionType="add"
534
+ tooltipText="Drop an enumeration"
535
+ isDropZoneActive={canDrop}
536
+ disabled={isReadOnly}
537
+ previewText="No source"
538
+ />
539
+ )}
540
+ <EnumerationMappingSourceSelectorModal
541
+ enumerationMapping={enumerationMapping}
542
+ open={openSourceSelectorModal}
543
+ closeModal={hideSourceSelectorModal}
534
544
  />
535
- )}
536
- <EnumerationMappingSourceSelectorModal
537
- enumerationMapping={enumerationMapping}
538
- open={openSourceSelectorModal}
539
- closeModal={hideSourceSelectorModal}
540
- />
545
+ </PanelDropZone>
541
546
  </div>
542
547
  </div>
543
548
  </ResizablePanel>
@@ -255,19 +255,21 @@ export const FlatDataPropertyMappingEditor = observer(
255
255
  },
256
256
  [disableEditingTransform, flatDataPropertyMappingState],
257
257
  );
258
- const [{ item }, drop] = useDrop(
258
+ const [{ dragItem }, drop] = useDrop<
259
+ FlatDataColumnDragSource,
260
+ void,
261
+ { dragItem: FlatDataColumnDragSource | undefined }
262
+ >(
259
263
  () => ({
260
264
  accept: [CORE_DND_TYPE.TYPE_TREE_PRIMITIVE],
261
- drop: (droppedItem: FlatDataPropertyMappingTransformDropTarget): void =>
262
- handleDrop(droppedItem),
263
- collect: (monitor): { item: FlatDataColumnDragSource | null } => ({
264
- item: monitor.getItem<FlatDataColumnDragSource | null>(),
265
+ drop: (_item) => handleDrop(_item),
266
+ collect: (monitor) => ({
267
+ dragItem:
268
+ monitor.getItem<FlatDataColumnDragSource | null>() ?? undefined,
265
269
  }),
266
270
  }),
267
271
  [handleDrop],
268
272
  );
269
- const dragItem =
270
- item instanceof FlatDataColumnDragSource ? item : undefined;
271
273
  const transformProps = {
272
274
  disableTransform:
273
275
  flatDataInstanceSetImplementationState.isConvertingTransformLambdaObjects,
@@ -25,6 +25,7 @@ import {
25
25
  AsteriskIcon,
26
26
  LongArrowAltDownIcon,
27
27
  PencilEditIcon,
28
+ PanelDropZone,
28
29
  } from '@finos/legend-art';
29
30
  import {
30
31
  CORE_DND_TYPE,
@@ -244,11 +245,15 @@ export const InstanceSetImplementationSourceExplorer = observer(
244
245
  setImplementation,
245
246
  ],
246
247
  );
247
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
248
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
249
+ ElementDragSource,
250
+ void,
251
+ { isDragOver: boolean; canDrop: boolean }
252
+ >(
248
253
  () => ({
249
254
  accept: dndType,
250
- drop: (item: ElementDragSource): void => handleDrop(item),
251
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
255
+ drop: (item) => handleDrop(item),
256
+ collect: (monitor) => ({
252
257
  isDragOver: monitor.isOver({ shallow: true }),
253
258
  canDrop: monitor.canDrop(),
254
259
  }),
@@ -318,11 +323,11 @@ export const InstanceSetImplementationSourceExplorer = observer(
318
323
  </button>
319
324
  </div>
320
325
  </div>
321
- <div ref={dropRef} className="panel__content dnd__dropzone">
322
- <>
323
- {srcElement && isDragOver && !isReadOnly && (
324
- <div className="dnd__overlay" />
325
- )}
326
+ <div className="panel__content">
327
+ <PanelDropZone
328
+ dropTargetConnector={dropRef}
329
+ isDragOver={isDragOver && !isReadOnly}
330
+ >
326
331
  {srcElement ? (
327
332
  <div className="source-panel__explorer">
328
333
  {srcElement instanceof Type && (
@@ -346,21 +351,13 @@ export const InstanceSetImplementationSourceExplorer = observer(
346
351
  </div>
347
352
  ) : (
348
353
  <BlankPanelPlaceholder
349
- placeholderText="Choose a source"
354
+ text="Choose a source"
350
355
  onClick={showSourceSelectorModal}
351
356
  clickActionType="add"
352
357
  tooltipText="Drop a class mapping source, or click to choose one"
353
- dndProps={{
354
- isDragOver: isDragOver && !isReadOnly,
355
- canDrop: canDrop && !isReadOnly,
356
- }}
357
- readOnlyProps={
358
- !isReadOnly
359
- ? undefined
360
- : {
361
- placeholderText: 'No source',
362
- }
363
- }
358
+ isDropZoneActive={canDrop}
359
+ disabled={isReadOnly}
360
+ previewText="No source"
364
361
  />
365
362
  )}
366
363
  {isUnsupported && (
@@ -377,7 +374,7 @@ export const InstanceSetImplementationSourceExplorer = observer(
377
374
  closeModal={hideSourceSelectorModal}
378
375
  />
379
376
  )}
380
- </>
377
+ </PanelDropZone>
381
378
  </div>
382
379
  </div>
383
380
  );
@@ -37,6 +37,7 @@ import {
37
37
  CaretDownIcon,
38
38
  RefreshIcon,
39
39
  RobotIcon,
40
+ PanelDropZone,
40
41
  } from '@finos/legend-art';
41
42
  import { observer } from 'mobx-react-lite';
42
43
  import {
@@ -204,7 +205,7 @@ const MappingExecutionQueryEditor = observer(
204
205
  flowResult(
205
206
  queryState.updateLamba(
206
207
  setImplementation
207
- ? editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
208
+ ? editorStore.graphManagerState.graphManager.createGetAllRawLambda(
208
209
  guaranteeType(
209
210
  getMappingElementTarget(setImplementation),
210
211
  Class,
@@ -281,11 +282,15 @@ const MappingExecutionQueryEditor = observer(
281
282
  },
282
283
  [changeClassMapping],
283
284
  );
284
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
285
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
286
+ MappingElementDragSource,
287
+ void,
288
+ { isDragOver: boolean; canDrop: boolean }
289
+ >(
285
290
  () => ({
286
291
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
287
- drop: (item: MappingElementDragSource): void => handleDrop(item),
288
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
292
+ drop: (item) => handleDrop(item),
293
+ collect: (monitor) => ({
289
294
  isDragOver: monitor.isOver({ shallow: true }),
290
295
  canDrop: monitor.canDrop(),
291
296
  }),
@@ -328,17 +333,19 @@ const MappingExecutionQueryEditor = observer(
328
333
  </div>
329
334
  )}
330
335
  {isStubbed_RawLambda(queryState.query) && (
331
- <div ref={dropRef} className="panel__content">
332
- <BlankPanelPlaceholder
333
- placeholderText="Choose a class mapping"
334
- onClick={showClassMappingSelectorModal}
335
- clickActionType="add"
336
- tooltipText="Drop a class mapping, or click to choose one to start building the query"
337
- dndProps={{
338
- isDragOver: isDragOver,
339
- canDrop: canDrop,
340
- }}
341
- />
336
+ <div className="panel__content">
337
+ <PanelDropZone
338
+ dropTargetConnector={dropRef}
339
+ isDragOver={isDragOver}
340
+ >
341
+ <BlankPanelPlaceholder
342
+ text="Choose a class mapping"
343
+ onClick={showClassMappingSelectorModal}
344
+ clickActionType="add"
345
+ tooltipText="Drop a class mapping, or click to choose one to start building the query"
346
+ isDropZoneActive={canDrop}
347
+ />
348
+ </PanelDropZone>
342
349
  </div>
343
350
  )}
344
351
  {openClassMappingSelectorModal && (
@@ -437,11 +444,15 @@ export const MappingExecutionEmptyInputDataBuilder = observer(
437
444
  },
438
445
  [changeClassMapping],
439
446
  );
440
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
447
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
448
+ MappingElementDragSource,
449
+ void,
450
+ { isDragOver: boolean; canDrop: boolean }
451
+ >(
441
452
  () => ({
442
453
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
443
- drop: (item: MappingElementDragSource): void => handleDrop(item),
444
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
454
+ drop: (item) => handleDrop(item),
455
+ collect: (monitor) => ({
445
456
  isDragOver: monitor.isOver({ shallow: true }),
446
457
  canDrop: monitor.canDrop(),
447
458
  }),
@@ -450,17 +461,16 @@ export const MappingExecutionEmptyInputDataBuilder = observer(
450
461
  );
451
462
 
452
463
  return (
453
- <div ref={dropRef} className="panel__content">
454
- <BlankPanelPlaceholder
455
- placeholderText="Choose a class mapping"
456
- onClick={showClassMappingSelectorModal}
457
- clickActionType="add"
458
- tooltipText="Drop a class mapping, or click to choose one to generate input data"
459
- dndProps={{
460
- isDragOver: isDragOver,
461
- canDrop: canDrop,
462
- }}
463
- />
464
+ <div className="panel__content">
465
+ <PanelDropZone dropTargetConnector={dropRef} isDragOver={isDragOver}>
466
+ <BlankPanelPlaceholder
467
+ text="Choose a class mapping"
468
+ onClick={showClassMappingSelectorModal}
469
+ clickActionType="add"
470
+ tooltipText="Drop a class mapping, or click to choose one to generate input data"
471
+ isDropZoneActive={canDrop}
472
+ />
473
+ </PanelDropZone>
464
474
  </div>
465
475
  );
466
476
  },
@@ -27,8 +27,6 @@ import {
27
27
  clsx,
28
28
  TreeView,
29
29
  ContextMenu,
30
- VerticalAlignBottomIcon,
31
- AddIcon,
32
30
  PlusIcon,
33
31
  LockIcon,
34
32
  FireIcon,
@@ -36,6 +34,8 @@ import {
36
34
  ChevronRightIcon,
37
35
  ChevronDownIcon,
38
36
  FilterIcon,
37
+ PanelDropZone,
38
+ BlankPanelPlaceholder,
39
39
  } from '@finos/legend-art';
40
40
  import { MappingElementState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingElementState.js';
41
41
  import { useDrop, useDrag } from 'react-dnd';
@@ -453,15 +453,19 @@ export const MappingExplorer = observer((props: { isReadOnly: boolean }) => {
453
453
  }),
454
454
  [isReadOnly, mappingEditorState],
455
455
  );
456
- const [{ isDragOver }, dropRef] = useDrop(
456
+ const [{ isDragOver }, dropRef] = useDrop<
457
+ ElementDragSource,
458
+ void,
459
+ { isDragOver: boolean }
460
+ >(
457
461
  () => ({
458
462
  accept: [
459
463
  CORE_DND_TYPE.PROJECT_EXPLORER_ENUMERATION,
460
464
  CORE_DND_TYPE.PROJECT_EXPLORER_CLASS,
461
465
  CORE_DND_TYPE.PROJECT_EXPLORER_ASSOCIATION,
462
466
  ],
463
- drop: (item: ElementDragSource): void => handleDrop(item),
464
- collect: (monitor): { isDragOver: boolean } => ({
467
+ drop: (item) => handleDrop(item),
468
+ collect: (monitor) => ({
465
469
  isDragOver: monitor.isOver({ shallow: true }),
466
470
  }),
467
471
  }),
@@ -553,41 +557,37 @@ export const MappingExplorer = observer((props: { isReadOnly: boolean }) => {
553
557
  }
554
558
  menuProps={{ elevation: 7 }}
555
559
  >
556
- <div
557
- ref={dropRef}
558
- className={clsx('mapping-explorer__content', {
559
- 'mapping-explorer__content--dnd-over': isDragOver && !isReadOnly,
560
- })}
560
+ <PanelDropZone
561
+ isDragOver={isDragOver && !isReadOnly}
562
+ dropTargetConnector={dropRef}
561
563
  >
562
- <TreeView
563
- components={{
564
- TreeNodeContainer: MappingElementTreeNodeContainer,
565
- }}
566
- treeData={mappingElementsTreeData}
567
- onNodeSelect={onNodeSelect}
568
- getChildNodes={getMappingElementTreeChildNodes}
569
- innerProps={{
570
- isReadOnly,
571
- onNodeExpand,
572
- }}
573
- />
574
- {/* TODO: use BlankPanelPlaceholder */}
575
- {!isReadOnly && !mappingElements.length && (
576
- <div
577
- className="mapping-explorer__content mapping-explorer__content__adder"
578
- onClick={openNewMapingModal}
579
- >
580
- <div className="mapping-explorer__content__adder__text">
581
- {'Add a mapping element'}
582
- </div>
583
- <div className="mapping-explorer__content__adder__action">
584
- <VerticalAlignBottomIcon className="mapping-explorer__content__adder__action__dnd-icon" />
585
- <AddIcon className="mapping-explorer__content__adder__action__add-icon" />
586
- </div>
587
- </div>
588
- )}
589
- <NewMappingElementModal />
590
- </div>
564
+ <div className="mapping-explorer__content">
565
+ <TreeView
566
+ components={{
567
+ TreeNodeContainer: MappingElementTreeNodeContainer,
568
+ }}
569
+ treeData={mappingElementsTreeData}
570
+ onNodeSelect={onNodeSelect}
571
+ getChildNodes={getMappingElementTreeChildNodes}
572
+ innerProps={{
573
+ isReadOnly,
574
+ onNodeExpand,
575
+ }}
576
+ />
577
+ {!isReadOnly && !mappingElements.length && (
578
+ <BlankPanelPlaceholder
579
+ text="Add a mapping element"
580
+ onClick={openNewMapingModal}
581
+ clickActionType="add"
582
+ tooltipText="Drop a class or an enumeration to start creating mappings"
583
+ isDropZoneActive={isDragOver && !isReadOnly}
584
+ disabled={isReadOnly}
585
+ previewText="No mapping"
586
+ />
587
+ )}
588
+ <NewMappingElementModal />
589
+ </div>
590
+ </PanelDropZone>
591
591
  </ContextMenu>
592
592
  </div>
593
593
  );
@@ -44,6 +44,7 @@ import {
44
44
  RefreshIcon,
45
45
  WrenchIcon,
46
46
  PauseCircleIcon,
47
+ PanelDropZone,
47
48
  } from '@finos/legend-art';
48
49
  import { useDrop } from 'react-dnd';
49
50
  import {
@@ -124,7 +125,7 @@ const MappingTestQueryEditor = observer(
124
125
  flowResult(
125
126
  queryState.updateLamba(
126
127
  setImplementation
127
- ? editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
128
+ ? editorStore.graphManagerState.graphManager.createGetAllRawLambda(
128
129
  guaranteeType(
129
130
  getMappingElementTarget(setImplementation),
130
131
  Class,
@@ -175,11 +176,15 @@ const MappingTestQueryEditor = observer(
175
176
  },
176
177
  [changeClassMapping],
177
178
  );
178
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
179
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
180
+ MappingElementDragSource,
181
+ void,
182
+ { isDragOver: boolean; canDrop: boolean }
183
+ >(
179
184
  () => ({
180
185
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
181
- drop: (item: MappingElementDragSource): void => handleDrop(item),
182
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
186
+ drop: (item) => handleDrop(item),
187
+ collect: (monitor) => ({
183
188
  isDragOver: monitor.isOver({ shallow: true }),
184
189
  canDrop: monitor.canDrop(),
185
190
  }),
@@ -223,17 +228,20 @@ const MappingTestQueryEditor = observer(
223
228
  </div>
224
229
  )}
225
230
  {isStubbed_RawLambda(queryState.query) && (
226
- <div ref={dropRef} className="panel__content">
227
- <BlankPanelPlaceholder
228
- placeholderText="Choose a class mapping"
229
- onClick={showClassMappingSelectorModal}
230
- clickActionType="add"
231
- tooltipText="Drop a class mapping, or click to choose one to start building the query"
232
- dndProps={{
233
- isDragOver: isDragOver,
234
- canDrop: canDrop,
235
- }}
236
- />
231
+ <div className="panel__content">
232
+ <PanelDropZone
233
+ dropTargetConnector={dropRef}
234
+ isDragOver={isDragOver}
235
+ >
236
+ <BlankPanelPlaceholder
237
+ text="Choose a class mapping"
238
+ onClick={showClassMappingSelectorModal}
239
+ clickActionType="add"
240
+ tooltipText="Drop a class mapping, or click to choose one to start building the query"
241
+ isDropZoneActive={canDrop}
242
+ disabled={isReadOnly}
243
+ />
244
+ </PanelDropZone>
237
245
  </div>
238
246
  )}
239
247
  {openClassMappingSelectorModal && (