shared.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /* to-do screenshot, assets, tab loaded, opened tab, and close tab block? */
  2. /* to-do add timeout and trying to exists-element? */
  3. /* active-tab: execute workflow on active tab */
  4. export const tasks = {
  5. trigger: {
  6. name: 'Trigger',
  7. icon: 'riFlashlightLine',
  8. component: 'BlockBasic',
  9. editComponent: 'EditTrigger',
  10. category: 'general',
  11. inputs: 0,
  12. outputs: 1,
  13. allowedInputs: true,
  14. maxConnection: 1,
  15. data: {
  16. description: '',
  17. type: 'manual',
  18. interval: 60,
  19. delay: 5,
  20. date: '',
  21. time: '00:00',
  22. url: '',
  23. isUrlRegex: false,
  24. },
  25. },
  26. 'event-click': {
  27. name: 'Click element',
  28. icon: 'riCursorLine',
  29. component: 'BlockBasic',
  30. editComponent: 'EditInteractionBase',
  31. category: 'interaction',
  32. inputs: 1,
  33. outputs: 1,
  34. allowedInputs: true,
  35. maxConnection: 1,
  36. data: {
  37. description: '',
  38. selector: '',
  39. markEl: false,
  40. multiple: false,
  41. },
  42. },
  43. delay: {
  44. name: 'Delay',
  45. icon: 'riTimerLine',
  46. component: 'BlockDelay',
  47. editComponent: 'EditTrigger',
  48. category: 'general',
  49. inputs: 1,
  50. outputs: 1,
  51. allowedInputs: true,
  52. maxConnection: 1,
  53. data: {
  54. time: 500,
  55. },
  56. },
  57. 'get-text': {
  58. name: 'Get text',
  59. icon: 'riParagraph',
  60. component: 'BlockBasic',
  61. editComponent: 'EditGetText',
  62. category: 'interaction',
  63. inputs: 1,
  64. outputs: 1,
  65. allowedInputs: true,
  66. maxConnection: 1,
  67. data: {
  68. description: '',
  69. selector: '',
  70. markEl: false,
  71. multiple: false,
  72. regex: '',
  73. regexExp: ['g'],
  74. dataColumn: '',
  75. },
  76. },
  77. 'export-data': {
  78. name: 'Export data',
  79. icon: 'riDownloadLine',
  80. component: 'BlockExportData',
  81. editComponent: 'EditTrigger',
  82. category: 'general',
  83. inputs: 1,
  84. outputs: 1,
  85. allowedInputs: true,
  86. maxConnection: 1,
  87. data: {
  88. name: '',
  89. type: 'json',
  90. },
  91. },
  92. 'element-scroll': {
  93. name: 'Scroll element',
  94. icon: 'riMouseLine',
  95. component: 'BlockBasic',
  96. editComponent: 'EditScrollElement',
  97. category: 'interaction',
  98. inputs: 1,
  99. outputs: 1,
  100. allowedInputs: true,
  101. maxConnection: 1,
  102. data: {
  103. description: '',
  104. selector: 'html',
  105. markEl: false,
  106. multiple: false,
  107. scrollY: 0,
  108. scrollX: 0,
  109. incX: false,
  110. incY: false,
  111. smooth: false,
  112. },
  113. },
  114. link: {
  115. name: 'Link',
  116. icon: 'riLink',
  117. component: 'BlockBasic',
  118. editComponent: 'EditInteractionBase',
  119. category: 'interaction',
  120. inputs: 1,
  121. outputs: 1,
  122. allowedInputs: true,
  123. maxConnection: 1,
  124. data: {
  125. description: '',
  126. selector: '',
  127. markEl: false,
  128. disableMultiple: true,
  129. },
  130. },
  131. 'attribute-value': {
  132. name: 'Attribute value',
  133. icon: 'riBracketsLine',
  134. component: 'BlockBasic',
  135. editComponent: 'EditAttributeValue',
  136. category: 'interaction',
  137. inputs: 1,
  138. outputs: 1,
  139. allowedInputs: true,
  140. maxConnection: 1,
  141. data: {
  142. description: '',
  143. selector: '',
  144. markEl: false,
  145. multiple: false,
  146. attributeName: '',
  147. dataColumn: '',
  148. },
  149. },
  150. 'open-website': {
  151. name: 'Open website',
  152. icon: 'riGlobalLine',
  153. component: 'BlockOpenWebsite',
  154. editComponent: 'EditTrigger',
  155. category: 'general',
  156. inputs: 1,
  157. outputs: 1,
  158. allowedInputs: true,
  159. maxConnection: 1,
  160. data: {
  161. url: '',
  162. active: true,
  163. },
  164. },
  165. forms: {
  166. name: 'Forms',
  167. icon: 'riInputCursorMove',
  168. component: 'BlockBasic',
  169. editComponent: 'EditForms',
  170. category: 'interaction',
  171. inputs: 1,
  172. outputs: 1,
  173. allowedInputs: true,
  174. maxConnection: 1,
  175. data: {
  176. description: '',
  177. selector: '',
  178. markEl: false,
  179. multiple: false,
  180. selected: true,
  181. type: 'text-field',
  182. value: '',
  183. delay: 0,
  184. events: [],
  185. },
  186. },
  187. 'repeat-task': {
  188. name: 'Repeat task',
  189. icon: 'riRepeat2Line',
  190. component: 'BlockRepeatTask',
  191. editComponent: 'EditTrigger',
  192. category: 'general',
  193. inputs: 1,
  194. outputs: 2,
  195. allowedInputs: true,
  196. maxConnection: 1,
  197. data: {
  198. repeatFor: 1,
  199. },
  200. },
  201. // 'reload-page': {
  202. // name: 'Reload page',
  203. // icon: 'riRestartLine',
  204. // component: 'BlockBasic',
  205. // category: 'interaction',
  206. // inputs: 1,
  207. // outputs: 1,
  208. // allowedInputs: true,
  209. // maxConnection: 1,
  210. // disableEdit: true,
  211. // data: {},
  212. // },
  213. 'trigger-event': {
  214. name: 'Trigger event',
  215. icon: 'riLightbulbFlashLine',
  216. component: 'BlockBasic',
  217. editComponent: 'EditTriggerEvent',
  218. category: 'interaction',
  219. inputs: 1,
  220. outputs: 1,
  221. allowedInputs: true,
  222. maxConnection: 1,
  223. data: {
  224. description: '',
  225. selector: '',
  226. markEl: false,
  227. multiple: false,
  228. eventName: '',
  229. eventType: '',
  230. eventParams: { bubbles: true, cancelable: false },
  231. },
  232. },
  233. conditions: {
  234. name: 'Conditions',
  235. icon: 'riAB',
  236. component: 'BlockConditions',
  237. category: 'conditions',
  238. inputs: 1,
  239. outputs: 0,
  240. allowedInputs: true,
  241. maxConnection: 1,
  242. data: {
  243. conditions: [],
  244. },
  245. },
  246. 'element-exists': {
  247. name: 'Element exists',
  248. icon: 'riFocus3Line',
  249. component: 'BlockElementExists',
  250. category: 'conditions',
  251. inputs: 1,
  252. outputs: 2,
  253. allowedInputs: true,
  254. maxConnection: 1,
  255. data: {
  256. selector: '',
  257. markEl: false,
  258. },
  259. },
  260. };
  261. export const categories = {
  262. interaction: {
  263. name: 'Web interaction',
  264. color: 'bg-green-200',
  265. },
  266. general: {
  267. name: 'General',
  268. color: 'bg-yellow-200',
  269. },
  270. conditions: {
  271. name: 'Conditions',
  272. color: 'bg-blue-200',
  273. },
  274. };
  275. export const eventList = [
  276. { id: 'click', name: 'Click', type: 'mouse-event' },
  277. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  278. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  279. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  280. { id: 'focus', name: 'Focus', type: 'focus-event' },
  281. { id: 'blur', name: 'Blur', type: 'focus-event' },
  282. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  283. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  284. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  285. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  286. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  287. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  288. { id: 'keypress', name: 'Keypress', type: 'keyboard-event' },
  289. { id: 'submit', name: 'Submit', type: 'submit-event' },
  290. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  291. ];