Skip to content

Commit

Permalink
v1.28.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 authored Sep 3, 2023
2 parents 860989d + 72cc181 commit e1d8721
Show file tree
Hide file tree
Showing 11 changed files with 2,171 additions and 2,043 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand Down
12 changes: 12 additions & 0 deletions src/components/newtab/workflow/edit/EditNewTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
}
}
4 changes: 1 addition & 3 deletions src/newtab/pages/workflows/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1453,8 +1453,6 @@ async function pasteCopiedElements(position) {
editor.value.addEdges(edges);
state.dataChanged = true;
return;
}
} catch (error) {
console.error(error);
Expand Down
1 change: 1 addition & 0 deletions src/utils/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const tasks = {
url: '',
userAgent: '',
active: true,
tabZoom: 1,
inGroup: false,
waitTabLoaded: false,
updatePrevTab: false,
Expand Down
8 changes: 0 additions & 8 deletions src/workflowEngine/blocksHandler/handlerActiveTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async function activeTab(block) {
active: true,
url: '*://*/*',
};
let dashboardWindowId = null;

if (BROWSER_TYPE === 'firefox') {
tabsQuery.currentWindow = true;
Expand All @@ -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;
}
Expand All @@ -52,7 +49,6 @@ async function activeTab(block) {
await Promise.all(
dashboardTabs.map((item) =>
browser.windows.update(item.windowId, {
state: 'minimized',
focused: false,
})
)
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/workflowEngine/blocksHandler/handlerInsertData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
22 changes: 15 additions & 7 deletions src/workflowEngine/blocksHandler/handlerJavascriptCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} } }));
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/workflowEngine/blocksHandler/handlerNewTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit e1d8721

Please sign in to comment.