shared.js 6.1 KB

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