shared.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /* link, 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. type: 'JSON',
  79. },
  80. },
  81. 'element-scroll': {
  82. name: 'Scroll element',
  83. icon: 'riMouseLine',
  84. component: 'BlockBasic',
  85. editComponent: 'EditScrollElement',
  86. category: 'interaction',
  87. inputs: 1,
  88. outputs: 1,
  89. allowedInputs: true,
  90. maxConnection: 1,
  91. data: {
  92. description: '',
  93. selector: 'html',
  94. multiple: false,
  95. scrollY: 0,
  96. scrollX: 0,
  97. },
  98. },
  99. link: {
  100. name: 'Link',
  101. icon: 'riLink',
  102. component: 'BlockBasic',
  103. editComponent: 'EditInteractionBase',
  104. category: 'interaction',
  105. inputs: 1,
  106. outputs: 1,
  107. allowedInputs: true,
  108. maxConnection: 1,
  109. data: {
  110. description: '',
  111. selector: '',
  112. disableMultiple: true,
  113. },
  114. },
  115. 'attribute-value': {
  116. name: 'Attribute value',
  117. icon: 'riBracketsLine',
  118. component: 'BlockBasic',
  119. editComponent: 'EditAttributeValue',
  120. category: 'interaction',
  121. inputs: 1,
  122. outputs: 1,
  123. allowedInputs: true,
  124. maxConnection: 1,
  125. data: {
  126. description: '',
  127. selector: '',
  128. multiple: false,
  129. attributeName: '',
  130. dataColumn: '',
  131. },
  132. },
  133. 'open-website': {
  134. name: 'Open website',
  135. icon: 'riGlobalLine',
  136. component: 'BlockOpenWebsite',
  137. editComponent: 'EditTrigger',
  138. category: 'general',
  139. inputs: 1,
  140. outputs: 1,
  141. allowedInputs: true,
  142. maxConnection: 1,
  143. data: {
  144. url: '',
  145. },
  146. },
  147. forms: {
  148. name: 'Forms',
  149. icon: 'riInputCursorMove',
  150. component: 'BlockBasic',
  151. editComponent: 'EditForms',
  152. category: 'interaction',
  153. inputs: 1,
  154. outputs: 1,
  155. allowedInputs: true,
  156. maxConnection: 1,
  157. data: {
  158. description: '',
  159. selector: '',
  160. multiple: false,
  161. selected: true,
  162. type: 'text-field',
  163. value: '',
  164. delay: 0,
  165. events: [],
  166. },
  167. },
  168. 'repeat-task': {
  169. name: 'Repeat task',
  170. icon: 'riRepeat2Line',
  171. component: 'BlockRepeatTask',
  172. editComponent: 'EditTrigger',
  173. category: 'general',
  174. inputs: 1,
  175. outputs: 2,
  176. allowedInputs: true,
  177. maxConnection: 1,
  178. data: {
  179. repeatFor: 1,
  180. },
  181. },
  182. // 'reload-page': {
  183. // name: 'Reload page',
  184. // icon: 'riRestartLine',
  185. // component: 'BlockBasic',
  186. // category: 'interaction',
  187. // inputs: 1,
  188. // outputs: 1,
  189. // allowedInputs: true,
  190. // maxConnection: 1,
  191. // disableEdit: true,
  192. // data: {},
  193. // },
  194. 'trigger-event': {
  195. name: 'Trigger event',
  196. icon: 'riLightbulbFlashLine',
  197. component: 'BlockBasic',
  198. editComponent: 'EditTriggerEvent',
  199. category: 'interaction',
  200. inputs: 1,
  201. outputs: 1,
  202. allowedInputs: true,
  203. maxConnection: 1,
  204. data: {
  205. description: '',
  206. selector: '',
  207. multiple: false,
  208. eventName: '',
  209. eventType: '',
  210. eventParams: { bubbles: true, cancelable: false },
  211. },
  212. },
  213. conditions: {
  214. name: 'Conditions',
  215. icon: 'riAB',
  216. component: 'BlockConditions',
  217. category: 'conditions',
  218. inputs: 1,
  219. outputs: 0,
  220. allowedInputs: true,
  221. maxConnection: 1,
  222. data: {
  223. conditions: [],
  224. },
  225. },
  226. 'element-exists': {
  227. name: 'Element exists',
  228. icon: 'riFocus3Line',
  229. component: 'BlockElementExists',
  230. category: 'conditions',
  231. inputs: 1,
  232. outputs: 2,
  233. allowedInputs: true,
  234. maxConnection: 1,
  235. data: {
  236. selector: '',
  237. },
  238. },
  239. };
  240. export const categories = {
  241. interaction: {
  242. name: 'Web interaction',
  243. color: 'bg-green-200',
  244. },
  245. general: {
  246. name: 'General',
  247. color: 'bg-yellow-200',
  248. },
  249. conditions: {
  250. name: 'Conditions',
  251. color: 'bg-blue-200',
  252. },
  253. };
  254. export const eventList = [
  255. { id: 'click', name: 'Click', type: 'mouse-event' },
  256. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  257. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  258. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  259. { id: 'focus', name: 'Focus', type: 'focus-event' },
  260. { id: 'blur', name: 'Blur', type: 'focus-event' },
  261. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  262. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  263. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  264. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  265. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  266. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  267. { id: 'keypress', name: 'Keypress', type: 'keyboard-event' },
  268. { id: 'submit', name: 'Submit', type: 'submit-event' },
  269. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  270. ];