shared.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. /* to-do execute multiple blocks simultaneously, keyboard shortcut */
  2. import { nanoid } from 'nanoid';
  3. export const tasks = {
  4. trigger: {
  5. name: 'Trigger',
  6. description: 'Block where workflow will start executing',
  7. icon: 'riFlashlightLine',
  8. component: 'BlockBasic',
  9. editComponent: 'EditTrigger',
  10. category: 'general',
  11. inputs: 0,
  12. docs: true,
  13. outputs: 1,
  14. allowedInputs: true,
  15. maxConnection: 1,
  16. refDataKeys: ['url'],
  17. data: {
  18. description: '',
  19. type: 'manual',
  20. interval: 60,
  21. delay: 5,
  22. date: '',
  23. time: '00:00',
  24. url: '',
  25. shortcut: '',
  26. activeInInput: false,
  27. isUrlRegex: false,
  28. days: [],
  29. },
  30. },
  31. 'execute-workflow': {
  32. name: 'Execute workflow',
  33. description: '',
  34. icon: 'riFlowChart',
  35. component: 'BlockBasic',
  36. category: 'general',
  37. editComponent: 'EditExecuteWorkflow',
  38. inputs: 1,
  39. outputs: 1,
  40. allowedInputs: true,
  41. maxConnection: 1,
  42. refDataKeys: ['globalData'],
  43. data: {
  44. workflowId: '',
  45. globalData: '',
  46. },
  47. },
  48. 'active-tab': {
  49. name: 'Active tab',
  50. description: "Set current tab that you're in as an active tab",
  51. icon: 'riWindowLine',
  52. component: 'BlockBasic',
  53. category: 'browser',
  54. disableEdit: true,
  55. inputs: 1,
  56. outputs: 1,
  57. allowedInputs: true,
  58. maxConnection: 1,
  59. data: {},
  60. },
  61. 'new-tab': {
  62. name: 'New tab',
  63. description: 'Create a new tab',
  64. icon: 'riGlobalLine',
  65. component: 'BlockBasic',
  66. editComponent: 'EditNewTab',
  67. category: 'browser',
  68. inputs: 1,
  69. outputs: 1,
  70. allowedInputs: true,
  71. maxConnection: 1,
  72. refDataKeys: ['url'],
  73. data: {
  74. description: '',
  75. url: '',
  76. active: true,
  77. inGroup: false,
  78. updatePrevTab: false,
  79. },
  80. },
  81. 'new-window': {
  82. name: 'New window',
  83. description: 'Create a new window',
  84. icon: 'riWindow2Line',
  85. component: 'BlockBasic',
  86. editComponent: 'EditNewWindow',
  87. category: 'browser',
  88. inputs: 1,
  89. outputs: 1,
  90. allowedInputs: true,
  91. maxConnection: 1,
  92. data: {
  93. description: '',
  94. incognito: false,
  95. windowState: 'normal',
  96. },
  97. },
  98. proxy: {
  99. name: 'Proxy',
  100. description: 'Set the proxy of the browser',
  101. icon: 'riShieldKeyholeLine',
  102. component: 'BlockBasic',
  103. category: 'browser',
  104. editComponent: 'EditProxy',
  105. inputs: 1,
  106. outputs: 1,
  107. maxConnection: 1,
  108. allowedInputs: true,
  109. data: {
  110. scheme: 'https',
  111. host: '',
  112. port: 443,
  113. bypassList: '',
  114. clearProxy: false,
  115. },
  116. },
  117. 'go-back': {
  118. name: 'Go back',
  119. description: 'Go back to the previous page',
  120. icon: 'riArrowGoBackLine',
  121. component: 'BlockBasic',
  122. category: 'browser',
  123. inputs: 1,
  124. outputs: 1,
  125. maxConnection: 1,
  126. disableEdit: true,
  127. allowedInputs: true,
  128. data: {},
  129. },
  130. 'forward-page': {
  131. name: 'Go forward',
  132. description: 'Go forward to the next page',
  133. icon: 'riArrowGoForwardLine',
  134. component: 'BlockBasic',
  135. category: 'browser',
  136. inputs: 1,
  137. outputs: 1,
  138. maxConnection: 1,
  139. disableEdit: true,
  140. allowedInputs: true,
  141. data: {},
  142. },
  143. 'close-tab': {
  144. name: 'Close tab/window',
  145. icon: 'riCloseCircleLine',
  146. component: 'BlockBasic',
  147. category: 'browser',
  148. editComponent: 'EditCloseTab',
  149. inputs: 1,
  150. outputs: 1,
  151. maxConnection: 1,
  152. allowedInputs: true,
  153. refDataKeys: ['url'],
  154. data: {
  155. url: '',
  156. activeTab: true,
  157. closeType: 'tab',
  158. allWindows: false,
  159. },
  160. },
  161. 'take-screenshot': {
  162. name: 'Take screenshot',
  163. description: 'Take a screenshot of current active tab',
  164. icon: 'riImageLine',
  165. component: 'BlockBasic',
  166. category: 'browser',
  167. editComponent: 'EditTakeScreenshot',
  168. inputs: 1,
  169. outputs: 1,
  170. maxConnection: 1,
  171. allowedInputs: true,
  172. refDataKeys: ['fileName'],
  173. data: {
  174. fileName: '',
  175. ext: 'png',
  176. quality: 100,
  177. dataColumn: '',
  178. saveToColumn: false,
  179. saveToComputer: true,
  180. captureActiveTab: true,
  181. },
  182. },
  183. 'browser-event': {
  184. name: 'Browser event',
  185. description: 'Wait until the selected event is triggered',
  186. icon: 'riLightbulbLine',
  187. component: 'BlockBasic',
  188. category: 'browser',
  189. editComponent: 'EditBrowserEvent',
  190. inputs: 1,
  191. outputs: 1,
  192. maxConnection: 1,
  193. allowedInputs: true,
  194. data: {
  195. description: '',
  196. timeout: 10000,
  197. eventName: 'tab:loaded',
  198. setAsActiveTab: true,
  199. activeTabLoaded: true,
  200. tabLoadedUrl: '',
  201. tabUrl: '',
  202. fileQuery: '',
  203. },
  204. },
  205. 'event-click': {
  206. name: 'Click element',
  207. icon: 'riCursorLine',
  208. component: 'BlockBasic',
  209. editComponent: 'EditInteractionBase',
  210. category: 'interaction',
  211. inputs: 1,
  212. outputs: 1,
  213. allowedInputs: true,
  214. maxConnection: 1,
  215. refDataKeys: ['selector'],
  216. data: {
  217. description: '',
  218. findBy: 'cssSelector',
  219. selector: '',
  220. markEl: false,
  221. multiple: false,
  222. },
  223. },
  224. delay: {
  225. name: 'Delay',
  226. description: 'Add delay before executing the next block',
  227. icon: 'riTimerLine',
  228. component: 'BlockDelay',
  229. editComponent: 'EditTrigger',
  230. category: 'general',
  231. inputs: 1,
  232. outputs: 1,
  233. allowedInputs: true,
  234. maxConnection: 1,
  235. data: {
  236. time: 500,
  237. },
  238. },
  239. 'get-text': {
  240. name: 'Get text',
  241. description: 'Get text from an element',
  242. icon: 'riParagraph',
  243. component: 'BlockBasic',
  244. editComponent: 'EditGetText',
  245. category: 'interaction',
  246. inputs: 1,
  247. outputs: 1,
  248. allowedInputs: true,
  249. maxConnection: 1,
  250. refDataKeys: ['selector', 'prefixText', 'suffixText', 'extraRowValue'],
  251. data: {
  252. description: '',
  253. findBy: 'cssSelector',
  254. selector: '',
  255. markEl: false,
  256. multiple: false,
  257. regex: '',
  258. prefixText: '',
  259. suffixText: '',
  260. regexExp: ['g'],
  261. dataColumn: '',
  262. saveData: true,
  263. addExtraRow: false,
  264. extraRowValue: '',
  265. extraRowDataColumn: '',
  266. },
  267. },
  268. 'export-data': {
  269. name: 'Export data',
  270. icon: 'riDownloadLine',
  271. component: 'BlockBasic',
  272. editComponent: 'EditExportData',
  273. category: 'general',
  274. inputs: 1,
  275. outputs: 1,
  276. allowedInputs: true,
  277. maxConnection: 1,
  278. refDataKeys: ['name'],
  279. data: {
  280. name: '',
  281. refKey: '',
  282. type: 'json',
  283. description: '',
  284. dataToExport: 'data-columns',
  285. },
  286. },
  287. 'element-scroll': {
  288. name: 'Scroll element',
  289. icon: 'riMouseLine',
  290. component: 'BlockBasic',
  291. editComponent: 'EditScrollElement',
  292. category: 'interaction',
  293. inputs: 1,
  294. outputs: 1,
  295. allowedInputs: true,
  296. maxConnection: 1,
  297. refDataKeys: ['selector'],
  298. data: {
  299. description: '',
  300. findBy: 'cssSelector',
  301. selector: 'html',
  302. markEl: false,
  303. multiple: false,
  304. scrollY: 0,
  305. scrollX: 0,
  306. incX: false,
  307. incY: false,
  308. smooth: false,
  309. scrollIntoView: false,
  310. },
  311. },
  312. link: {
  313. name: 'Link',
  314. description: 'Open link element',
  315. icon: 'riLink',
  316. component: 'BlockBasic',
  317. editComponent: 'EditInteractionBase',
  318. category: 'interaction',
  319. inputs: 1,
  320. outputs: 1,
  321. allowedInputs: true,
  322. maxConnection: 1,
  323. refDataKeys: ['selector'],
  324. data: {
  325. description: '',
  326. findBy: 'cssSelector',
  327. selector: '',
  328. markEl: false,
  329. disableMultiple: true,
  330. },
  331. },
  332. 'attribute-value': {
  333. name: 'Attribute value',
  334. description: 'Get attribute value of an element',
  335. icon: 'riBracketsLine',
  336. component: 'BlockBasic',
  337. editComponent: 'EditAttributeValue',
  338. category: 'interaction',
  339. inputs: 1,
  340. outputs: 1,
  341. allowedInputs: true,
  342. maxConnection: 1,
  343. refDataKeys: ['selector', 'attributeName', 'extraRowValue'],
  344. data: {
  345. description: '',
  346. findBy: 'cssSelector',
  347. selector: '',
  348. markEl: false,
  349. multiple: false,
  350. attributeName: '',
  351. dataColumn: '',
  352. saveData: true,
  353. addExtraRow: false,
  354. extraRowValue: '',
  355. extraRowDataColumn: '',
  356. },
  357. },
  358. forms: {
  359. name: 'Forms',
  360. icon: 'riInputCursorMove',
  361. description: 'Manipulate form(input, select, checkbox, and radio) element',
  362. component: 'BlockBasic',
  363. editComponent: 'EditForms',
  364. category: 'interaction',
  365. inputs: 1,
  366. outputs: 1,
  367. allowedInputs: true,
  368. maxConnection: 1,
  369. refDataKeys: ['selector', 'value'],
  370. data: {
  371. description: '',
  372. findBy: 'cssSelector',
  373. selector: '',
  374. markEl: false,
  375. multiple: false,
  376. selected: true,
  377. clearValue: true,
  378. getValue: false,
  379. saveData: true,
  380. dataColumn: '',
  381. type: 'text-field',
  382. value: '',
  383. delay: 0,
  384. events: [],
  385. },
  386. },
  387. 'repeat-task': {
  388. name: 'Repeat task',
  389. icon: 'riRepeat2Line',
  390. component: 'BlockRepeatTask',
  391. editComponent: 'EditTrigger',
  392. category: 'general',
  393. inputs: 1,
  394. outputs: 2,
  395. allowedInputs: true,
  396. maxConnection: 1,
  397. data: {
  398. repeatFor: 1,
  399. },
  400. },
  401. // 'reload-page': {
  402. // name: 'Reload page',
  403. // icon: 'riRestartLine',
  404. // component: 'BlockBasic',
  405. // category: 'interaction',
  406. // inputs: 1,
  407. // outputs: 1,
  408. // allowedInputs: true,
  409. // maxConnection: 1,
  410. // disableEdit: true,
  411. // data: {},
  412. // },
  413. 'javascript-code': {
  414. name: 'JavaScript code',
  415. description: 'Execute your custom javascript code in a webpage',
  416. icon: 'riCodeSSlashLine',
  417. component: 'BlockBasic',
  418. editComponent: 'EditJavascriptCode',
  419. category: 'interaction',
  420. inputs: 1,
  421. outputs: 1,
  422. docs: true,
  423. allowedInputs: true,
  424. maxConnection: 1,
  425. data: {
  426. description: '',
  427. timeout: 20000,
  428. code: 'console.log("Hello world!");\nautomaNextBlock()',
  429. preloadScripts: [],
  430. },
  431. },
  432. 'trigger-event': {
  433. name: 'Trigger event',
  434. description: 'Trigger event',
  435. icon: 'riLightbulbFlashLine',
  436. component: 'BlockBasic',
  437. editComponent: 'EditTriggerEvent',
  438. category: 'interaction',
  439. inputs: 1,
  440. outputs: 1,
  441. allowedInputs: true,
  442. maxConnection: 1,
  443. refDataKeys: ['selector'],
  444. data: {
  445. description: '',
  446. findBy: 'cssSelector',
  447. selector: '',
  448. markEl: false,
  449. multiple: false,
  450. eventName: '',
  451. eventType: '',
  452. eventParams: { bubbles: true, cancelable: false },
  453. },
  454. },
  455. 'google-sheets': {
  456. name: 'Google sheets',
  457. description: 'Read Google Sheets data',
  458. icon: 'mdiGoogleSheet',
  459. component: 'BlockBasic',
  460. editComponent: 'EditGoogleSheets',
  461. category: 'onlineServices',
  462. inputs: 1,
  463. outputs: 1,
  464. docs: true,
  465. allowedInputs: true,
  466. maxConnection: 1,
  467. refDataKeys: ['customData'],
  468. data: {
  469. range: '',
  470. refKey: '',
  471. type: 'get',
  472. customData: '',
  473. description: '',
  474. spreadsheetId: '',
  475. firstRowAsKey: false,
  476. keysAsFirstRow: false,
  477. valueInputOption: 'RAW',
  478. dataFrom: 'data-columns',
  479. },
  480. },
  481. conditions: {
  482. name: 'Conditions',
  483. description: 'Conditional block',
  484. icon: 'riAB',
  485. component: 'BlockConditions',
  486. editComponent: 'EditConditions',
  487. category: 'conditions',
  488. inputs: 1,
  489. outputs: 0,
  490. allowedInputs: true,
  491. maxConnection: 1,
  492. data: {
  493. conditions: [],
  494. },
  495. },
  496. 'element-exists': {
  497. name: 'Element exists',
  498. description: 'Check if an element is exists',
  499. icon: 'riFocus3Line',
  500. component: 'BlockElementExists',
  501. editComponent: 'EditElementExists',
  502. category: 'conditions',
  503. inputs: 1,
  504. outputs: 2,
  505. allowedInputs: true,
  506. maxConnection: 1,
  507. refDataKeys: ['selector'],
  508. data: {
  509. findBy: 'cssSelector',
  510. selector: '',
  511. tryCount: 1,
  512. timeout: 500,
  513. markEl: false,
  514. },
  515. },
  516. webhook: {
  517. name: 'Webhook',
  518. description: 'Webhook allow external service to be notified',
  519. icon: 'webhookIcon',
  520. component: 'BlockBasic',
  521. editComponent: 'EditWebhook',
  522. category: 'general',
  523. inputs: 1,
  524. outputs: 1,
  525. allowedInputs: true,
  526. maxConnection: 1,
  527. refDataKeys: ['body', 'url'],
  528. data: {
  529. description: '',
  530. url: '',
  531. contentType: 'json',
  532. timeout: 10000,
  533. headers: [],
  534. body: '{}',
  535. },
  536. },
  537. 'loop-data': {
  538. name: 'Loop data',
  539. icon: 'riRefreshLine',
  540. component: 'BlockBasic',
  541. editComponent: 'EditLoopData',
  542. category: 'general',
  543. docs: true,
  544. inputs: 1,
  545. outputs: 1,
  546. allowedInputs: true,
  547. maxConnection: 1,
  548. refDataKeys: ['loopData'],
  549. data: {
  550. loopId: '',
  551. maxLoop: 0,
  552. fromNumber: 1,
  553. toNumber: 10,
  554. loopData: '[]',
  555. description: '',
  556. referenceKey: '',
  557. specificRowAndCol: false,
  558. loopThrough: 'data-columns',
  559. },
  560. },
  561. 'loop-breakpoint': {
  562. name: 'Loop breakpoint',
  563. description: 'To tell where loop data must stop',
  564. icon: 'riStopLine',
  565. component: 'BlockLoopBreakpoint',
  566. category: 'general',
  567. disableEdit: true,
  568. docs: true,
  569. inputs: 1,
  570. outputs: 1,
  571. allowedInputs: true,
  572. maxConnection: 1,
  573. data: {
  574. loopId: '',
  575. },
  576. },
  577. 'blocks-group': {
  578. name: 'Blocks group',
  579. description: 'Grouping blocks',
  580. icon: 'riFolderZipLine',
  581. component: 'BlockGroup',
  582. category: 'general',
  583. disableEdit: true,
  584. inputs: 1,
  585. outputs: 1,
  586. allowedInputs: true,
  587. maxConnection: 1,
  588. data: {
  589. name: '',
  590. blocks: [],
  591. },
  592. },
  593. 'switch-to': {
  594. name: 'Switch frame',
  595. description: 'Switch between main window and iframe',
  596. icon: 'riArrowUpDownLine',
  597. component: 'BlockBasic',
  598. editComponent: 'EditSwitchTo',
  599. category: 'interaction',
  600. inputs: 1,
  601. outputs: 1,
  602. allowedInputs: true,
  603. maxConnection: 1,
  604. refDataKeys: ['selector'],
  605. data: {
  606. findBy: 'cssSelector',
  607. selector: '',
  608. windowType: 'main-window',
  609. },
  610. },
  611. 'upload-file': {
  612. name: 'Upload file',
  613. description: 'Upload file into <input type="file"> element',
  614. icon: 'riFileUploadLine',
  615. component: 'BlockBasic',
  616. editComponent: 'EditUploadFile',
  617. category: 'interaction',
  618. inputs: 1,
  619. outputs: 1,
  620. allowedInputs: true,
  621. maxConnection: 1,
  622. refDataKeys: ['selector', 'filePaths'],
  623. data: {
  624. findBy: 'cssSelector',
  625. selector: '',
  626. filePaths: [],
  627. },
  628. },
  629. };
  630. export const categories = {
  631. interaction: {
  632. name: 'Web interaction',
  633. color: 'bg-green-200',
  634. },
  635. browser: {
  636. name: 'Browser',
  637. color: 'bg-orange-200',
  638. },
  639. general: {
  640. name: 'General',
  641. color: 'bg-yellow-200',
  642. },
  643. onlineServices: {
  644. name: 'Online services',
  645. color: 'bg-red-200',
  646. },
  647. conditions: {
  648. name: 'Conditions',
  649. color: 'bg-blue-200',
  650. },
  651. };
  652. export const eventList = [
  653. { id: 'click', name: 'Click', type: 'mouse-event' },
  654. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  655. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  656. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  657. { id: 'mouseenter', name: 'Mouseenter', type: 'mouse-event' },
  658. { id: 'mouseleave', name: 'Mouseleave', type: 'mouse-event' },
  659. { id: 'mouseover', name: 'Mouseover', type: 'mouse-event' },
  660. { id: 'mouseout', name: 'Mouseout', type: 'mouse-event' },
  661. { id: 'mousemove', name: 'Mousemove', type: 'mouse-event' },
  662. { id: 'focus', name: 'Focus', type: 'focus-event' },
  663. { id: 'blur', name: 'Blur', type: 'focus-event' },
  664. { id: 'input', name: 'Input', type: 'input-event' },
  665. { id: 'change', name: 'Change', type: 'event' },
  666. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  667. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  668. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  669. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  670. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  671. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  672. { id: 'submit', name: 'Submit', type: 'submit-event' },
  673. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  674. ];
  675. export const dataExportTypes = [
  676. { name: 'JSON', id: 'json' },
  677. { name: 'CSV', id: 'csv' },
  678. { name: 'Plain text', id: 'plain-text' },
  679. ];
  680. export const firstWorkflows = [
  681. {
  682. id: nanoid(),
  683. name: 'Google search',
  684. createdAt: Date.now(),
  685. drawflow: `{"drawflow":{"Home":{"data":{"d634ff22-5dfe-44dc-83d2-842412bd9fbf":{"id":"d634ff22-5dfe-44dc-83d2-842412bd9fbf","name":"trigger","data":{"type":"manual","interval":10},"class":"trigger","html":"BlockBasic","typenode":"vue","inputs":{},"outputs":{"output_1":{"connections":[{"node":"b9e7e0d4-e86a-4635-a352-31c63723fef4","output":"input_1"}]}},"pos_x":50,"pos_y":300},"b9e7e0d4-e86a-4635-a352-31c63723fef4":{"id":"b9e7e0d4-e86a-4635-a352-31c63723fef4","name":"new-tab","data":{"url":"https://google.com","active":true},"class":"new-tab","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"d634ff22-5dfe-44dc-83d2-842412bd9fbf","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"09f3a14c-0514-4287-93b0-aa92b0064fba","output":"input_1"}]}},"pos_x":278,"pos_y":268},"09f3a14c-0514-4287-93b0-aa92b0064fba":{"id":"09f3a14c-0514-4287-93b0-aa92b0064fba","name":"forms","data":{"description":"Type query","selector":"[name='q']","markEl":false,"multiple":false,"selected":true,"type":"text-field","value":"Stackoverflow","delay":"120","events":[]},"class":"forms","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"b9e7e0d4-e86a-4635-a352-31c63723fef4","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"5f76370d-aa3d-4258-8319-230fcfc49a3a","output":"input_1"}]}},"pos_x":551,"pos_y":290},"5f76370d-aa3d-4258-8319-230fcfc49a3a":{"id":"5f76370d-aa3d-4258-8319-230fcfc49a3a","name":"event-click","data":{"description":"Click search","selector":"center:nth-child(1) > .gNO89b","markEl":false,"multiple":false},"class":"event-click","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"09f3a14c-0514-4287-93b0-aa92b0064fba","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":794,"pos_y":308}}}}}`,
  686. },
  687. {
  688. id: nanoid(),
  689. name: 'Generate lorem ipsum',
  690. createdAt: Date.now(),
  691. drawflow:
  692. '{"drawflow":{"Home":{"data":{"c5774692-0be4-457f-82be-d5e4b3344ad7":{"id":"c5774692-0be4-457f-82be-d5e4b3344ad7","name":"trigger","data":{"type":"manual"},"class":"trigger","html":"BlockBasic","typenode":"vue","inputs":{},"outputs":{"output_1":{"connections":[{"node":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","output":"input_1"}]}},"pos_x":50,"pos_y":300},"10a0429e-b8c4-4c04-9ea3-df169cea78e4":{"id":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","name":"new-tab","data":{"url":"http://lipsum.com","active":true},"class":"new-tab","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"c5774692-0be4-457f-82be-d5e4b3344ad7","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","output":"input_1"}]}},"pos_x":285,"pos_y":282},"df24edcc-4c29-49f5-8a29-0e572a4bc6ae":{"id":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","name":"delay","data":{"time":4000},"class":"delay","html":"BlockDelay","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","output":"input_1"}]}},"pos_x":833,"pos_y":297},"24bdec44-1e80-4cee-9139-00545b8d33d9":{"id":"24bdec44-1e80-4cee-9139-00545b8d33d9","name":"element-scroll","data":{"description":"","selector":"#amount","markEl":false,"multiple":false,"scrollY":0,"scrollX":0,"incX":false,"incY":false,"smooth":true,"scrollIntoView":true},"class":"element-scroll","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","input":"output_1"},{"node":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","output":"input_1"}]}},"pos_x":566,"pos_y":317},"2d93c1de-42ca-4f39-8e61-e3e55529fbba":{"id":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","name":"forms","data":{"description":"Lipsum length","selector":"#amount","markEl":false,"multiple":false,"selected":true,"type":"text-field","value":"3","delay":0,"events":[]},"class":"forms","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","output":"input_1"}]}},"pos_x":1058,"pos_y":327},"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb":{"id":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","name":"event-click","data":{"description":"Generate button","selector":"#generate","markEl":false,"multiple":false},"class":"event-click","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"fb9be12f-8995-4876-8bfe-79323769474b","output":"input_1"}]}},"pos_x":1309,"pos_y":329},"fb9be12f-8995-4876-8bfe-79323769474b":{"id":"fb9be12f-8995-4876-8bfe-79323769474b","name":"delay","data":{"time":2000},"class":"delay","html":"BlockDelay","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"7205fcf2-deda-445e-9690-4e36adb52585","output":"input_1"}]}},"pos_x":1566,"pos_y":310},"7205fcf2-deda-445e-9690-4e36adb52585":{"id":"7205fcf2-deda-445e-9690-4e36adb52585","name":"get-text","data":{"description":"Get text result","selector":"#lipsum","markEl":false,"multiple":false,"regex":"","regexExp":["g"],"dataColumn":"","saveData":true},"class":"get-text","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"fb9be12f-8995-4876-8bfe-79323769474b","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","output":"input_1"}]}},"pos_x":1823,"pos_y":337},"3d3e8fac-97fa-4c3d-84bc-a3db18740184":{"id":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","name":"repeat-task","data":{"repeatFor":2},"class":"repeat-task","html":"BlockRepeatTask","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"7205fcf2-deda-445e-9690-4e36adb52585","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"4d39ecd5-f33f-4e57-b11d-2f26b1076334","output":"input_1"}]},"output_2":{"connections":[{"node":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","output":"input_1","points":[{"pos_x":2290.2500152587886,"pos_y":542.0000076293943},{"pos_x":1125.2500152587886,"pos_y":552.0000076293943}]}]}},"pos_x":2073,"pos_y":293.5},"2f5fec61-a318-4e2b-b7d3-bc7328bd282c":{"id":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","name":"go-back","data":{},"class":"go-back","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","input":"output_2"}]}},"outputs":{"output_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","output":"input_1","points":[{"pos_x":1305.2500152587886,"pos_y":829.5000076293943},{"pos_x":545.250015258789,"pos_y":834.499988555908}]}]}},"pos_x":1135.5,"pos_y":628},"4d39ecd5-f33f-4e57-b11d-2f26b1076334":{"id":"4d39ecd5-f33f-4e57-b11d-2f26b1076334","name":"export-data","data":{"name":"Lipsum","type":"plain-text"},"class":"export-data","html":"BlockExportData","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":2409.75,"pos_y":289}}}}}',
  693. },
  694. ];
  695. export const contentTypes = [
  696. { name: 'application/json', value: 'json' },
  697. { name: 'application/x-www-form-urlencoded', value: 'form' },
  698. ];
  699. export const supportLocales = [
  700. { id: 'en', name: 'English' },
  701. { id: 'zh', name: '简体中文' },
  702. { id: 'zh-tw', name: '繁體中文' },
  703. { id: 'vi', name: 'Tiếng Việt' },
  704. { id: 'fr', name: 'Français' },
  705. ];