Ahmad Kholid 3 years ago
parent
commit
336bec8493
2 changed files with 3 additions and 12 deletions
  1. 1 1
      package.json
  2. 2 11
      src/components/block/BlockElementExists.vue

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "automa",
   "name": "automa",
-  "version": "1.14.0",
+  "version": "1.14.1",
   "description": "An extension for automating your browser by connecting blocks",
   "description": "An extension for automating your browser by connecting blocks",
   "license": "MIT",
   "license": "MIT",
   "repository": {
   "repository": {

+ 2 - 11
src/components/block/BlockElementExists.vue

@@ -3,7 +3,7 @@
     :id="componentId"
     :id="componentId"
     class="element-exists"
     class="element-exists"
     style="width: 195px"
     style="width: 195px"
-    @edit="editBlock"
+    @edit="$emit('edit')"
     @delete="$emit('delete', id)"
     @delete="$emit('delete', id)"
   >
   >
     <Handle :id="`${id}-input-1`" type="target" :position="Position.Left" />
     <Handle :id="`${id}-input-1`" type="target" :position="Position.Left" />
@@ -44,7 +44,6 @@
 <script setup>
 <script setup>
 import { useI18n } from 'vue-i18n';
 import { useI18n } from 'vue-i18n';
 import { Handle, Position } from '@braks/vue-flow';
 import { Handle, Position } from '@braks/vue-flow';
-import emitter from '@/lib/mitt';
 import { useComponentId } from '@/composable/componentId';
 import { useComponentId } from '@/composable/componentId';
 import { useEditorBlock } from '@/composable/editorBlock';
 import { useEditorBlock } from '@/composable/editorBlock';
 import BlockBase from './BlockBase.vue';
 import BlockBase from './BlockBase.vue';
@@ -63,19 +62,11 @@ const props = defineProps({
     default: () => ({}),
     default: () => ({}),
   },
   },
 });
 });
-defineEmits(['delete']);
+defineEmits(['delete', 'edit']);
 
 
 const { t } = useI18n();
 const { t } = useI18n();
 const block = useEditorBlock(props.label);
 const block = useEditorBlock(props.label);
 const componentId = useComponentId('block-delay');
 const componentId = useComponentId('block-delay');
-
-function editBlock() {
-  emitter.emit('editor:edit-block', {
-    ...block.details,
-    data: props.data,
-    blockId: block.id,
-  });
-}
 </script>
 </script>
 <style>
 <style>
 .drawflow .element-exists .outputs {
 .drawflow .element-exists .outputs {