Ahmad Kholid 1 yıl önce
ebeveyn
işleme
e1d8721e5b

+ 10 - 9
package.json

@@ -1,6 +1,6 @@
 {
   "name": "automa",
-  "version": "1.28.7",
+  "version": "1.28.8",
   "description": "An extension for automating your browser by connecting blocks",
   "repository": {
     "type": "git",
@@ -28,13 +28,13 @@
     "*.{js,ts,vue}": "eslint --fix"
   },
   "dependencies": {
-    "@codemirror/autocomplete": "^6.4.0",
-    "@codemirror/lang-css": "^6.0.2",
-    "@codemirror/lang-html": "^6.4.0",
-    "@codemirror/lang-javascript": "^6.1.2",
+    "@codemirror/autocomplete": "^6.9.0",
+    "@codemirror/lang-css": "^6.2.1",
+    "@codemirror/lang-html": "^6.4.6",
+    "@codemirror/lang-javascript": "^6.2.1",
     "@codemirror/lang-json": "^6.0.1",
-    "@codemirror/language": "^6.4.0",
-    "@codemirror/theme-one-dark": "^6.1.0",
+    "@codemirror/language": "^6.9.0",
+    "@codemirror/theme-one-dark": "^6.1.2",
     "@medv/finder": "^2.1.0",
     "@n8n_io/riot-tmpl": "^2.0.0",
     "@tiptap/core": "^2.0.4",
@@ -49,7 +49,7 @@
     "@viselect/vanilla": "^3.2.5",
     "@vue-flow/additional-components": "^1.3.3",
     "@vue-flow/core": "^1.12.7",
-    "@vueuse/head": "^1.0.23",
+    "@vueuse/head": "^1.3.1",
     "@vueuse/rxjs": "^9.12.0",
     "@vuex-orm/core": "^0.36.4",
     "codemirror": "^6.0.1",
@@ -90,6 +90,7 @@
     "vue-i18n": "9",
     "vue-imask": "^6.4.2",
     "vue-router": "^4.2.4",
+    "vue-slider-component": "^4.1.0-beta.7",
     "vue-toastification": "^2.0.0-rc.5",
     "vuedraggable": "^4.1.0",
     "vuex": "^4.0.2",
@@ -134,7 +135,7 @@
     "terser-webpack-plugin": "^5.3.6",
     "vue-loader": "^17.2.2",
     "web-worker": "^1.2.0",
-    "webpack": "^5.73.0",
+    "webpack": "5.76.0",
     "webpack-cli": "^5.0.1",
     "webpack-dev-server": "^4.11.1"
   }

+ 12 - 0
src/components/newtab/workflow/edit/EditNewTab.vue

@@ -66,11 +66,23 @@
       class="mt-1 w-full"
       @change="updateData({ userAgent: $event })"
     />
+    <div class="mt-4">
+      <p>{{ t('workflow.blocks.new-tab.tab-zoom') }}</p>
+      <vue-slider
+        :min="0.25"
+        :max="4.5"
+        :interval="0.25"
+        :model-value="data.tabZoom || 1"
+        @change="updateData({ tabZoom: $event })"
+      />
+    </div>
   </div>
 </template>
 <script setup>
 import { useI18n } from 'vue-i18n';
+import VueSlider from 'vue-slider-component';
 import EditAutocomplete from './EditAutocomplete.vue';
+import 'vue-slider-component/theme/default.css';
 
 const props = defineProps({
   data: {

+ 1 - 0
src/locales/en/blocks.json

@@ -565,6 +565,7 @@
         "name": "New tab",
         "description": "",
         "url": "New tab URL",
+        "tab-zoom": "Tab zoom",
         "customUserAgent": "Use custom User-Agent",
         "activeTab": "Set as active tab",
         "tabToGroup": "Add tab to a group",

+ 1 - 1
src/manifest.chrome.json

@@ -74,4 +74,4 @@
     "pages": ["/sandbox.html"]
   },
   "content_security_policy": "script-src 'self' https://apis.google.com/ https://accounts.google.com/ https://www.googleapis.com https://ajax.googleapis.com; object-src 'self'"
-}
+}

+ 1 - 3
src/newtab/pages/workflows/[id].vue

@@ -4,7 +4,7 @@
       v-if="state.showSidebar && haveEditAccess"
       :class="
         editState.editing
-          ? 'absolute h-full w-full md:relative z-50'
+          ? 'absolute h-full md:relative z-50'
           : 'hidden md:flex'
       "
       class="w-80 flex-col border-l border-gray-100 bg-white py-6 dark:border-gray-700 dark:border-opacity-50 dark:bg-gray-800"
@@ -1453,8 +1453,6 @@ async function pasteCopiedElements(position) {
       editor.value.addEdges(edges);
 
       state.dataChanged = true;
-
-      return;
     }
   } catch (error) {
     console.error(error);

+ 1 - 0
src/utils/shared.js

@@ -103,6 +103,7 @@ export const tasks = {
       url: '',
       userAgent: '',
       active: true,
+      tabZoom: 1,
       inGroup: false,
       waitTabLoaded: false,
       updatePrevTab: false,

+ 0 - 8
src/workflowEngine/blocksHandler/handlerActiveTab.js

@@ -19,7 +19,6 @@ async function activeTab(block) {
       active: true,
       url: '*://*/*',
     };
-    let dashboardWindowId = null;
 
     if (BROWSER_TYPE === 'firefox') {
       tabsQuery.currentWindow = true;
@@ -35,9 +34,7 @@ async function activeTab(block) {
         if (isDashboard) {
           await browser.windows.update(browserWindow.id, {
             focused: false,
-            state: 'minimized',
           });
-          dashboardWindowId = browserWindow.id;
         } else if (browserWindow.focused) {
           windowId = browserWindow.id;
         }
@@ -52,7 +49,6 @@ async function activeTab(block) {
       await Promise.all(
         dashboardTabs.map((item) =>
           browser.windows.update(item.windowId, {
-            state: 'minimized',
             focused: false,
           })
         )
@@ -61,10 +57,6 @@ async function activeTab(block) {
       tabsQuery.currentWindow = true;
     }
 
-    if (dashboardWindowId) {
-      await browser.windows.update(dashboardWindowId, { state: 'normal' });
-    }
-
     const [tab] = await browser.tabs.query(tabsQuery);
     if (!tab) {
       throw new Error("Can't find active tab");

+ 1 - 1
src/workflowEngine/blocksHandler/handlerInsertData.js

@@ -76,7 +76,7 @@ async function insertData({ id, data }, { refData }) {
     }
 
     if (item.type === 'table') {
-      const values = value.split('||');
+      const values = typeof value === 'string' ? value.split('||') : [value];
       values.forEach((tableValue) => {
         this.addDataToColumn(item.name, tableValue);
       });

+ 15 - 7
src/workflowEngine/blocksHandler/handlerJavascriptCode.js

@@ -29,11 +29,11 @@ function automaSetVariable(name, value) {
 function automaNextBlock(data, insert = true) {
   if (${isEval}) {
     $automaResolve({
-      columns: { 
-        data, 
+      columns: {
+        data,
         insert,
-      }, 
-      variables: ${varName}.variables, 
+      },
+      variables: ${varName}.variables,
     });
   } else{
     document.body.dispatchEvent(new CustomEvent('__automa-next-block__', { detail: { data, insert, refData: ${varName} } }));
@@ -210,11 +210,16 @@ export async function javascriptCode({ outputs, data, ...block }, { refData }) {
     }
 
     let insert = true;
+    let replaceTable = false;
     if (isObject(result.columns.insert)) {
-      const { insert: insertData, nextBlockId: inputNextBlockId } =
-        result.columns.insert;
+      const {
+        insert: insertData,
+        nextBlockId: inputNextBlockId,
+        replaceTable: replaceTableParam,
+      } = result.columns.insert;
 
-      insert = Boolean(insertData);
+      replaceTable = Boolean(replaceTableParam);
+      insert = typeof insertData === 'boolean' ? insertData : true;
 
       if (inputNextBlockId) {
         const customNextBlockId = this.getBlockConnections(inputNextBlockId);
@@ -237,6 +242,9 @@ export async function javascriptCode({ outputs, data, ...block }, { refData }) {
         const params = Array.isArray(columnDataObj)
           ? columnDataObj
           : [columnDataObj];
+
+        if (replaceTable) this.engine.referenceData.table = [];
+
         this.addDataToColumn(params);
       }
     }

+ 5 - 0
src/workflowEngine/blocksHandler/handlerNewTab.js

@@ -66,6 +66,11 @@ async function newTab({ id, data }) {
       }
     }
 
+    if (data.tabZoom && data.tabZoom !== 1) {
+      await sleep(1000);
+      await browser.tabs.setZoom(tab.id, data.tabZoom);
+    }
+
     this.activeTab.id = tab.id;
     this.windowId = tab.windowId;
   }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 594 - 579
yarn.lock


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor