nodeskini 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. package/blocklySkini/archive/blocklyControleur.js +87 -0
  2. package/blocklySkini/archive/blocklySkini.js +84 -0
  3. package/blocklySkini/archive/blocklyhop.js +75 -0
  4. package/blocklySkini/archive/clientControleurBlocly.js +170 -0
  5. package/blocklySkini/archive/index.html +76 -0
  6. package/blocklySkini/archive/testHHsuspend.txt +89 -0
  7. package/blocklySkini/archive/testHHtrap.txt +262 -0
  8. package/blocklySkini/archive/testOrchestration.txt +177 -0
  9. package/blocklySkini/archive/testOrchestration.xml +447 -0
  10. package/blocklySkini/archive/testOrchestration2.xml +456 -0
  11. package/blocklySkini/blockly/README.md +77 -0
  12. package/blocklySkini/blockly/blockly.d.ts +21480 -0
  13. package/blocklySkini/blockly/blockly.js +25 -0
  14. package/blocklySkini/blockly/blockly.min.js +2188 -0
  15. package/blocklySkini/blockly/blockly_compressed.js +1455 -0
  16. package/blocklySkini/blockly/blockly_compressed.js.map +1 -0
  17. package/blocklySkini/blockly/blocks/colour.js +122 -0
  18. package/blocklySkini/blockly/blocks/lists.js +862 -0
  19. package/blocklySkini/blockly/blocks/logic.js +635 -0
  20. package/blocklySkini/blockly/blocks/loops.js +357 -0
  21. package/blocklySkini/blockly/blocks/math.js +566 -0
  22. package/blocklySkini/blockly/blocks/procedures.js +1072 -0
  23. package/blocklySkini/blockly/blocks/text.js +923 -0
  24. package/blocklySkini/blockly/blocks/variables.js +163 -0
  25. package/blocklySkini/blockly/blocks/variables_dynamic.js +180 -0
  26. package/blocklySkini/blockly/blocks.d.ts +15 -0
  27. package/blocklySkini/blockly/blocks.js +27 -0
  28. package/blocklySkini/blockly/blocks_compressed.js +182 -0
  29. package/blocklySkini/blockly/blocks_compressed.js.map +1 -0
  30. package/blocklySkini/blockly/browser.js +36 -0
  31. package/blocklySkini/blockly/core/block.js +2010 -0
  32. package/blocklySkini/blockly/core/block_animations.js +203 -0
  33. package/blocklySkini/blockly/core/block_drag_surface.js +212 -0
  34. package/blocklySkini/blockly/core/block_dragger.js +378 -0
  35. package/blocklySkini/blockly/core/block_events.js +548 -0
  36. package/blocklySkini/blockly/core/block_svg.js +1763 -0
  37. package/blocklySkini/blockly/core/blockly.js +674 -0
  38. package/blocklySkini/blockly/core/blocks.js +23 -0
  39. package/blocklySkini/blockly/core/bubble.js +880 -0
  40. package/blocklySkini/blockly/core/bubble_dragger.js +274 -0
  41. package/blocklySkini/blockly/core/comment.js +439 -0
  42. package/blocklySkini/blockly/core/components/component.js +554 -0
  43. package/blocklySkini/blockly/core/components/tree/basenode.js +895 -0
  44. package/blocklySkini/blockly/core/components/tree/treecontrol.js +332 -0
  45. package/blocklySkini/blockly/core/components/tree/treenode.js +172 -0
  46. package/blocklySkini/blockly/core/connection.js +682 -0
  47. package/blocklySkini/blockly/core/connection_checker.js +285 -0
  48. package/blocklySkini/blockly/core/connection_db.js +295 -0
  49. package/blocklySkini/blockly/core/constants.js +277 -0
  50. package/blocklySkini/blockly/core/contextmenu.js +307 -0
  51. package/blocklySkini/blockly/core/contextmenu_items.js +534 -0
  52. package/blocklySkini/blockly/core/contextmenu_registry.js +165 -0
  53. package/blocklySkini/blockly/core/css.js +549 -0
  54. package/blocklySkini/blockly/core/dropdowndiv.js +776 -0
  55. package/blocklySkini/blockly/core/events.js +387 -0
  56. package/blocklySkini/blockly/core/events_abstract.js +106 -0
  57. package/blocklySkini/blockly/core/extensions.js +450 -0
  58. package/blocklySkini/blockly/core/field.js +1162 -0
  59. package/blocklySkini/blockly/core/field_angle.js +562 -0
  60. package/blocklySkini/blockly/core/field_checkbox.js +220 -0
  61. package/blocklySkini/blockly/core/field_colour.js +664 -0
  62. package/blocklySkini/blockly/core/field_dropdown.js +760 -0
  63. package/blocklySkini/blockly/core/field_image.js +286 -0
  64. package/blocklySkini/blockly/core/field_label.js +130 -0
  65. package/blocklySkini/blockly/core/field_label_serializable.js +69 -0
  66. package/blocklySkini/blockly/core/field_multilineinput.js +299 -0
  67. package/blocklySkini/blockly/core/field_number.js +317 -0
  68. package/blocklySkini/blockly/core/field_registry.js +66 -0
  69. package/blocklySkini/blockly/core/field_textinput.js +616 -0
  70. package/blocklySkini/blockly/core/field_variable.js +463 -0
  71. package/blocklySkini/blockly/core/flyout_base.js +1071 -0
  72. package/blocklySkini/blockly/core/flyout_button.js +325 -0
  73. package/blocklySkini/blockly/core/flyout_dragger.js +76 -0
  74. package/blocklySkini/blockly/core/flyout_horizontal.js +388 -0
  75. package/blocklySkini/blockly/core/flyout_vertical.js +397 -0
  76. package/blocklySkini/blockly/core/generator.js +482 -0
  77. package/blocklySkini/blockly/core/gesture.js +993 -0
  78. package/blocklySkini/blockly/core/grid.js +222 -0
  79. package/blocklySkini/blockly/core/icon.js +206 -0
  80. package/blocklySkini/blockly/core/inject.js +487 -0
  81. package/blocklySkini/blockly/core/input.js +296 -0
  82. package/blocklySkini/blockly/core/insertion_marker_manager.js +700 -0
  83. package/blocklySkini/blockly/core/interfaces/i_accessibility.js +72 -0
  84. package/blocklySkini/blockly/core/interfaces/i_bounded_element.js +31 -0
  85. package/blocklySkini/blockly/core/interfaces/i_bubble.js +83 -0
  86. package/blocklySkini/blockly/core/interfaces/i_connection_checker.js +94 -0
  87. package/blocklySkini/blockly/core/interfaces/i_contextmenu.js +26 -0
  88. package/blocklySkini/blockly/core/interfaces/i_copyable.js +40 -0
  89. package/blocklySkini/blockly/core/interfaces/i_deletable.js +27 -0
  90. package/blocklySkini/blockly/core/interfaces/i_deletearea.js +28 -0
  91. package/blocklySkini/blockly/core/interfaces/i_flyout.js +178 -0
  92. package/blocklySkini/blockly/core/interfaces/i_movable.js +27 -0
  93. package/blocklySkini/blockly/core/interfaces/i_registrable.js +22 -0
  94. package/blocklySkini/blockly/core/interfaces/i_registrable_field.js +31 -0
  95. package/blocklySkini/blockly/core/interfaces/i_selectable.js +43 -0
  96. package/blocklySkini/blockly/core/interfaces/i_styleable.js +33 -0
  97. package/blocklySkini/blockly/core/interfaces/i_toolbox.js +131 -0
  98. package/blocklySkini/blockly/core/interfaces/i_toolbox_item.js +148 -0
  99. package/blocklySkini/blockly/core/keyboard_nav/action.js +26 -0
  100. package/blocklySkini/blockly/core/keyboard_nav/ast_node.js +684 -0
  101. package/blocklySkini/blockly/core/keyboard_nav/basic_cursor.js +208 -0
  102. package/blocklySkini/blockly/core/keyboard_nav/cursor.js +170 -0
  103. package/blocklySkini/blockly/core/keyboard_nav/flyout_cursor.js +106 -0
  104. package/blocklySkini/blockly/core/keyboard_nav/key_map.js +190 -0
  105. package/blocklySkini/blockly/core/keyboard_nav/marker.js +120 -0
  106. package/blocklySkini/blockly/core/keyboard_nav/navigation.js +1084 -0
  107. package/blocklySkini/blockly/core/keyboard_nav/tab_navigate_cursor.js +48 -0
  108. package/blocklySkini/blockly/core/marker_manager.js +183 -0
  109. package/blocklySkini/blockly/core/menu.js +465 -0
  110. package/blocklySkini/blockly/core/menuitem.js +280 -0
  111. package/blocklySkini/blockly/core/msg.js +31 -0
  112. package/blocklySkini/blockly/core/mutator.js +555 -0
  113. package/blocklySkini/blockly/core/names.js +186 -0
  114. package/blocklySkini/blockly/core/options.js +365 -0
  115. package/blocklySkini/blockly/core/procedures.js +404 -0
  116. package/blocklySkini/blockly/core/registry.js +265 -0
  117. package/blocklySkini/blockly/core/rendered_connection.js +565 -0
  118. package/blocklySkini/blockly/core/renderers/common/block_rendering.js +81 -0
  119. package/blocklySkini/blockly/core/renderers/common/constants.js +1256 -0
  120. package/blocklySkini/blockly/core/renderers/common/debugger.js +431 -0
  121. package/blocklySkini/blockly/core/renderers/common/drawer.js +468 -0
  122. package/blocklySkini/blockly/core/renderers/common/i_path_object.js +151 -0
  123. package/blocklySkini/blockly/core/renderers/common/info.js +775 -0
  124. package/blocklySkini/blockly/core/renderers/common/marker_svg.js +687 -0
  125. package/blocklySkini/blockly/core/renderers/common/path_object.js +279 -0
  126. package/blocklySkini/blockly/core/renderers/common/renderer.js +301 -0
  127. package/blocklySkini/blockly/core/renderers/geras/constants.js +64 -0
  128. package/blocklySkini/blockly/core/renderers/geras/drawer.js +205 -0
  129. package/blocklySkini/blockly/core/renderers/geras/highlight_constants.js +311 -0
  130. package/blocklySkini/blockly/core/renderers/geras/highlighter.js +256 -0
  131. package/blocklySkini/blockly/core/renderers/geras/info.js +483 -0
  132. package/blocklySkini/blockly/core/renderers/geras/measurables/inputs.js +67 -0
  133. package/blocklySkini/blockly/core/renderers/geras/path_object.js +177 -0
  134. package/blocklySkini/blockly/core/renderers/geras/renderer.js +138 -0
  135. package/blocklySkini/blockly/core/renderers/measurables/base.js +44 -0
  136. package/blocklySkini/blockly/core/renderers/measurables/connections.js +114 -0
  137. package/blocklySkini/blockly/core/renderers/measurables/inputs.js +160 -0
  138. package/blocklySkini/blockly/core/renderers/measurables/row_elements.js +185 -0
  139. package/blocklySkini/blockly/core/renderers/measurables/rows.js +532 -0
  140. package/blocklySkini/blockly/core/renderers/measurables/types.js +349 -0
  141. package/blocklySkini/blockly/core/renderers/minimalist/constants.js +29 -0
  142. package/blocklySkini/blockly/core/renderers/minimalist/drawer.js +32 -0
  143. package/blocklySkini/blockly/core/renderers/minimalist/info.js +45 -0
  144. package/blocklySkini/blockly/core/renderers/minimalist/renderer.js +70 -0
  145. package/blocklySkini/blockly/core/renderers/thrasos/info.js +338 -0
  146. package/blocklySkini/blockly/core/renderers/thrasos/renderer.js +45 -0
  147. package/blocklySkini/blockly/core/renderers/zelos/constants.js +1002 -0
  148. package/blocklySkini/blockly/core/renderers/zelos/drawer.js +233 -0
  149. package/blocklySkini/blockly/core/renderers/zelos/info.js +587 -0
  150. package/blocklySkini/blockly/core/renderers/zelos/marker_svg.js +148 -0
  151. package/blocklySkini/blockly/core/renderers/zelos/measurables/inputs.js +47 -0
  152. package/blocklySkini/blockly/core/renderers/zelos/measurables/row_elements.js +37 -0
  153. package/blocklySkini/blockly/core/renderers/zelos/measurables/rows.js +108 -0
  154. package/blocklySkini/blockly/core/renderers/zelos/path_object.js +244 -0
  155. package/blocklySkini/blockly/core/renderers/zelos/renderer.js +130 -0
  156. package/blocklySkini/blockly/core/requires.js +84 -0
  157. package/blocklySkini/blockly/core/scrollbar.js +880 -0
  158. package/blocklySkini/blockly/core/theme/classic.js +87 -0
  159. package/blocklySkini/blockly/core/theme/dark.js +33 -0
  160. package/blocklySkini/blockly/core/theme/deuteranopia.js +104 -0
  161. package/blocklySkini/blockly/core/theme/highcontrast.js +119 -0
  162. package/blocklySkini/blockly/core/theme/modern.js +108 -0
  163. package/blocklySkini/blockly/core/theme/tritanopia.js +103 -0
  164. package/blocklySkini/blockly/core/theme/zelos.js +106 -0
  165. package/blocklySkini/blockly/core/theme.js +236 -0
  166. package/blocklySkini/blockly/core/theme_manager.js +197 -0
  167. package/blocklySkini/blockly/core/toolbox/category.js +690 -0
  168. package/blocklySkini/blockly/core/toolbox/collapsible_category.js +294 -0
  169. package/blocklySkini/blockly/core/toolbox/separator.js +123 -0
  170. package/blocklySkini/blockly/core/toolbox/toolbox.js +984 -0
  171. package/blocklySkini/blockly/core/toolbox/toolbox_item.js +145 -0
  172. package/blocklySkini/blockly/core/toolbox.js +943 -0
  173. package/blocklySkini/blockly/core/tooltip.js +387 -0
  174. package/blocklySkini/blockly/core/touch.js +255 -0
  175. package/blocklySkini/blockly/core/touch_gesture.js +325 -0
  176. package/blocklySkini/blockly/core/trashcan.js +661 -0
  177. package/blocklySkini/blockly/core/ui_events.js +85 -0
  178. package/blocklySkini/blockly/core/utils/aria.js +167 -0
  179. package/blocklySkini/blockly/core/utils/colour.js +208 -0
  180. package/blocklySkini/blockly/core/utils/coordinate.js +125 -0
  181. package/blocklySkini/blockly/core/utils/deprecation.js +34 -0
  182. package/blocklySkini/blockly/core/utils/dom.js +391 -0
  183. package/blocklySkini/blockly/core/utils/global.js +37 -0
  184. package/blocklySkini/blockly/core/utils/idgenerator.js +33 -0
  185. package/blocklySkini/blockly/core/utils/keycodes.js +164 -0
  186. package/blocklySkini/blockly/core/utils/math.js +56 -0
  187. package/blocklySkini/blockly/core/utils/metrics.js +124 -0
  188. package/blocklySkini/blockly/core/utils/object.js +73 -0
  189. package/blocklySkini/blockly/core/utils/rect.js +54 -0
  190. package/blocklySkini/blockly/core/utils/size.js +58 -0
  191. package/blocklySkini/blockly/core/utils/string.js +284 -0
  192. package/blocklySkini/blockly/core/utils/style.js +281 -0
  193. package/blocklySkini/blockly/core/utils/svg.js +181 -0
  194. package/blocklySkini/blockly/core/utils/svg_paths.js +142 -0
  195. package/blocklySkini/blockly/core/utils/toolbox.js +401 -0
  196. package/blocklySkini/blockly/core/utils/useragent.js +110 -0
  197. package/blocklySkini/blockly/core/utils/xml.js +79 -0
  198. package/blocklySkini/blockly/core/utils.js +652 -0
  199. package/blocklySkini/blockly/core/variable_events.js +248 -0
  200. package/blocklySkini/blockly/core/variable_map.js +414 -0
  201. package/blocklySkini/blockly/core/variable_model.js +95 -0
  202. package/blocklySkini/blockly/core/variables.js +571 -0
  203. package/blocklySkini/blockly/core/variables_dynamic.js +100 -0
  204. package/blocklySkini/blockly/core/warning.js +200 -0
  205. package/blocklySkini/blockly/core/widgetdiv.js +241 -0
  206. package/blocklySkini/blockly/core/workspace.js +786 -0
  207. package/blocklySkini/blockly/core/workspace_audio.js +153 -0
  208. package/blocklySkini/blockly/core/workspace_comment.js +373 -0
  209. package/blocklySkini/blockly/core/workspace_comment_render_svg.js +461 -0
  210. package/blocklySkini/blockly/core/workspace_comment_svg.js +701 -0
  211. package/blocklySkini/blockly/core/workspace_drag_surface_svg.js +176 -0
  212. package/blocklySkini/blockly/core/workspace_dragger.js +85 -0
  213. package/blocklySkini/blockly/core/workspace_events.js +93 -0
  214. package/blocklySkini/blockly/core/workspace_svg.js +2661 -0
  215. package/blocklySkini/blockly/core/ws_comment_events.js +417 -0
  216. package/blocklySkini/blockly/core/xml.js +827 -0
  217. package/blocklySkini/blockly/core/zoom_controls.js +449 -0
  218. package/blocklySkini/blockly/core-browser.js +34 -0
  219. package/blocklySkini/blockly/core.d.ts +15 -0
  220. package/blocklySkini/blockly/core.js +38 -0
  221. package/blocklySkini/blockly/dart.d.ts +15 -0
  222. package/blocklySkini/blockly/dart.js +27 -0
  223. package/blocklySkini/blockly/dart_compressed.js +114 -0
  224. package/blocklySkini/blockly/dart_compressed.js.map +1 -0
  225. package/blocklySkini/blockly/generators/dart/colour.js +114 -0
  226. package/blocklySkini/blockly/generators/dart/lists.js +447 -0
  227. package/blocklySkini/blockly/generators/dart/logic.js +127 -0
  228. package/blocklySkini/blockly/generators/dart/loops.js +169 -0
  229. package/blocklySkini/blockly/generators/dart/math.js +485 -0
  230. package/blocklySkini/blockly/generators/dart/procedures.js +111 -0
  231. package/blocklySkini/blockly/generators/dart/text.js +339 -0
  232. package/blocklySkini/blockly/generators/dart/variables.js +32 -0
  233. package/blocklySkini/blockly/generators/dart/variables_dynamic.js +21 -0
  234. package/blocklySkini/blockly/generators/dart.js +290 -0
  235. package/blocklySkini/blockly/generators/javascript/colour.js +89 -0
  236. package/blocklySkini/blockly/generators/javascript/lists.js +388 -0
  237. package/blocklySkini/blockly/generators/javascript/logic.js +129 -0
  238. package/blocklySkini/blockly/generators/javascript/loops.js +184 -0
  239. package/blocklySkini/blockly/generators/javascript/math.js +409 -0
  240. package/blocklySkini/blockly/generators/javascript/procedures.js +113 -0
  241. package/blocklySkini/blockly/generators/javascript/text.js +367 -0
  242. package/blocklySkini/blockly/generators/javascript/variables.js +32 -0
  243. package/blocklySkini/blockly/generators/javascript/variables_dynamic.js +23 -0
  244. package/blocklySkini/blockly/generators/javascript.js +317 -0
  245. package/blocklySkini/blockly/generators/lua/colour.js +76 -0
  246. package/blocklySkini/blockly/generators/lua/lists.js +368 -0
  247. package/blocklySkini/blockly/generators/lua/logic.js +127 -0
  248. package/blocklySkini/blockly/generators/lua/loops.js +173 -0
  249. package/blocklySkini/blockly/generators/lua/math.js +423 -0
  250. package/blocklySkini/blockly/generators/lua/procedures.js +113 -0
  251. package/blocklySkini/blockly/generators/lua/text.js +353 -0
  252. package/blocklySkini/blockly/generators/lua/variables.js +32 -0
  253. package/blocklySkini/blockly/generators/lua/variables_dynamic.js +21 -0
  254. package/blocklySkini/blockly/generators/lua.js +198 -0
  255. package/blocklySkini/blockly/generators/php/colour.js +91 -0
  256. package/blocklySkini/blockly/generators/php/lists.js +498 -0
  257. package/blocklySkini/blockly/generators/php/logic.js +128 -0
  258. package/blocklySkini/blockly/generators/php/loops.js +170 -0
  259. package/blocklySkini/blockly/generators/php/math.js +370 -0
  260. package/blocklySkini/blockly/generators/php/procedures.js +132 -0
  261. package/blocklySkini/blockly/generators/php/text.js +271 -0
  262. package/blocklySkini/blockly/generators/php/variables.js +32 -0
  263. package/blocklySkini/blockly/generators/php/variables_dynamic.js +21 -0
  264. package/blocklySkini/blockly/generators/php.js +318 -0
  265. package/blocklySkini/blockly/generators/python/colour.js +72 -0
  266. package/blocklySkini/blockly/generators/python/lists.js +349 -0
  267. package/blocklySkini/blockly/generators/python/logic.js +127 -0
  268. package/blocklySkini/blockly/generators/python/loops.js +214 -0
  269. package/blocklySkini/blockly/generators/python/math.js +385 -0
  270. package/blocklySkini/blockly/generators/python/procedures.js +134 -0
  271. package/blocklySkini/blockly/generators/python/text.js +293 -0
  272. package/blocklySkini/blockly/generators/python/variables.js +32 -0
  273. package/blocklySkini/blockly/generators/python/variables_dynamic.js +21 -0
  274. package/blocklySkini/blockly/generators/python.js +322 -0
  275. package/blocklySkini/blockly/index.d.ts +22 -0
  276. package/blocklySkini/blockly/index.js +24 -0
  277. package/blocklySkini/blockly/javascript.d.ts +15 -0
  278. package/blocklySkini/blockly/javascript.js +27 -0
  279. package/blocklySkini/blockly/javascript_compressed.js +115 -0
  280. package/blocklySkini/blockly/javascript_compressed.js.map +1 -0
  281. package/blocklySkini/blockly/lua.d.ts +15 -0
  282. package/blocklySkini/blockly/lua.js +27 -0
  283. package/blocklySkini/blockly/lua_compressed.js +94 -0
  284. package/blocklySkini/blockly/lua_compressed.js.map +1 -0
  285. package/blocklySkini/blockly/media/1x1.gif +0 -0
  286. package/blocklySkini/blockly/media/click.mp3 +0 -0
  287. package/blocklySkini/blockly/media/click.ogg +0 -0
  288. package/blocklySkini/blockly/media/click.wav +0 -0
  289. package/blocklySkini/blockly/media/delete.mp3 +0 -0
  290. package/blocklySkini/blockly/media/delete.ogg +0 -0
  291. package/blocklySkini/blockly/media/delete.wav +0 -0
  292. package/blocklySkini/blockly/media/disconnect.mp3 +0 -0
  293. package/blocklySkini/blockly/media/disconnect.ogg +0 -0
  294. package/blocklySkini/blockly/media/disconnect.wav +0 -0
  295. package/blocklySkini/blockly/media/dropdown-arrow.svg +1 -0
  296. package/blocklySkini/blockly/media/handclosed.cur +0 -0
  297. package/blocklySkini/blockly/media/handdelete.cur +0 -0
  298. package/blocklySkini/blockly/media/handopen.cur +0 -0
  299. package/blocklySkini/blockly/media/pilcrow.png +0 -0
  300. package/blocklySkini/blockly/media/quote0.png +0 -0
  301. package/blocklySkini/blockly/media/quote1.png +0 -0
  302. package/blocklySkini/blockly/media/sprites.png +0 -0
  303. package/blocklySkini/blockly/media/sprites.svg +74 -0
  304. package/blocklySkini/blockly/msg/ab.d.ts +16 -0
  305. package/blocklySkini/blockly/msg/ab.js +447 -0
  306. package/blocklySkini/blockly/msg/ar.d.ts +16 -0
  307. package/blocklySkini/blockly/msg/ar.js +447 -0
  308. package/blocklySkini/blockly/msg/az.d.ts +16 -0
  309. package/blocklySkini/blockly/msg/az.js +447 -0
  310. package/blocklySkini/blockly/msg/ba.d.ts +16 -0
  311. package/blocklySkini/blockly/msg/ba.js +447 -0
  312. package/blocklySkini/blockly/msg/bcc.d.ts +16 -0
  313. package/blocklySkini/blockly/msg/bcc.js +447 -0
  314. package/blocklySkini/blockly/msg/be-tarask.d.ts +16 -0
  315. package/blocklySkini/blockly/msg/be-tarask.js +447 -0
  316. package/blocklySkini/blockly/msg/be.d.ts +16 -0
  317. package/blocklySkini/blockly/msg/be.js +447 -0
  318. package/blocklySkini/blockly/msg/bg.d.ts +16 -0
  319. package/blocklySkini/blockly/msg/bg.js +447 -0
  320. package/blocklySkini/blockly/msg/bn.d.ts +16 -0
  321. package/blocklySkini/blockly/msg/bn.js +447 -0
  322. package/blocklySkini/blockly/msg/br.d.ts +16 -0
  323. package/blocklySkini/blockly/msg/br.js +447 -0
  324. package/blocklySkini/blockly/msg/ca.d.ts +16 -0
  325. package/blocklySkini/blockly/msg/ca.js +447 -0
  326. package/blocklySkini/blockly/msg/constants.d.ts +16 -0
  327. package/blocklySkini/blockly/msg/cs.d.ts +16 -0
  328. package/blocklySkini/blockly/msg/cs.js +447 -0
  329. package/blocklySkini/blockly/msg/da.d.ts +16 -0
  330. package/blocklySkini/blockly/msg/da.js +447 -0
  331. package/blocklySkini/blockly/msg/de.d.ts +16 -0
  332. package/blocklySkini/blockly/msg/de.js +447 -0
  333. package/blocklySkini/blockly/msg/diq.d.ts +16 -0
  334. package/blocklySkini/blockly/msg/diq.js +447 -0
  335. package/blocklySkini/blockly/msg/dty.d.ts +16 -0
  336. package/blocklySkini/blockly/msg/dty.js +447 -0
  337. package/blocklySkini/blockly/msg/ee.d.ts +16 -0
  338. package/blocklySkini/blockly/msg/ee.js +447 -0
  339. package/blocklySkini/blockly/msg/el.d.ts +16 -0
  340. package/blocklySkini/blockly/msg/el.js +447 -0
  341. package/blocklySkini/blockly/msg/en-gb.d.ts +16 -0
  342. package/blocklySkini/blockly/msg/en-gb.js +447 -0
  343. package/blocklySkini/blockly/msg/en.d.ts +16 -0
  344. package/blocklySkini/blockly/msg/en.js +447 -0
  345. package/blocklySkini/blockly/msg/eo.d.ts +16 -0
  346. package/blocklySkini/blockly/msg/eo.js +447 -0
  347. package/blocklySkini/blockly/msg/es.d.ts +16 -0
  348. package/blocklySkini/blockly/msg/es.js +447 -0
  349. package/blocklySkini/blockly/msg/et.d.ts +16 -0
  350. package/blocklySkini/blockly/msg/et.js +447 -0
  351. package/blocklySkini/blockly/msg/eu.d.ts +16 -0
  352. package/blocklySkini/blockly/msg/eu.js +447 -0
  353. package/blocklySkini/blockly/msg/fa.d.ts +16 -0
  354. package/blocklySkini/blockly/msg/fa.js +447 -0
  355. package/blocklySkini/blockly/msg/fi.d.ts +16 -0
  356. package/blocklySkini/blockly/msg/fi.js +447 -0
  357. package/blocklySkini/blockly/msg/fr.d.ts +16 -0
  358. package/blocklySkini/blockly/msg/fr.js +447 -0
  359. package/blocklySkini/blockly/msg/gl.d.ts +16 -0
  360. package/blocklySkini/blockly/msg/gl.js +447 -0
  361. package/blocklySkini/blockly/msg/gor.d.ts +16 -0
  362. package/blocklySkini/blockly/msg/gor.js +447 -0
  363. package/blocklySkini/blockly/msg/ha.d.ts +16 -0
  364. package/blocklySkini/blockly/msg/ha.js +447 -0
  365. package/blocklySkini/blockly/msg/he.d.ts +16 -0
  366. package/blocklySkini/blockly/msg/he.js +447 -0
  367. package/blocklySkini/blockly/msg/hi.d.ts +16 -0
  368. package/blocklySkini/blockly/msg/hi.js +447 -0
  369. package/blocklySkini/blockly/msg/hrx.d.ts +16 -0
  370. package/blocklySkini/blockly/msg/hrx.js +447 -0
  371. package/blocklySkini/blockly/msg/hu.d.ts +16 -0
  372. package/blocklySkini/blockly/msg/hu.js +447 -0
  373. package/blocklySkini/blockly/msg/hy.d.ts +16 -0
  374. package/blocklySkini/blockly/msg/hy.js +447 -0
  375. package/blocklySkini/blockly/msg/ia.d.ts +16 -0
  376. package/blocklySkini/blockly/msg/ia.js +447 -0
  377. package/blocklySkini/blockly/msg/id.d.ts +16 -0
  378. package/blocklySkini/blockly/msg/id.js +447 -0
  379. package/blocklySkini/blockly/msg/ig.d.ts +16 -0
  380. package/blocklySkini/blockly/msg/ig.js +447 -0
  381. package/blocklySkini/blockly/msg/is.d.ts +16 -0
  382. package/blocklySkini/blockly/msg/is.js +447 -0
  383. package/blocklySkini/blockly/msg/it.d.ts +16 -0
  384. package/blocklySkini/blockly/msg/it.js +447 -0
  385. package/blocklySkini/blockly/msg/ja.d.ts +16 -0
  386. package/blocklySkini/blockly/msg/ja.js +447 -0
  387. package/blocklySkini/blockly/msg/kab.d.ts +16 -0
  388. package/blocklySkini/blockly/msg/kab.js +447 -0
  389. package/blocklySkini/blockly/msg/kn.d.ts +16 -0
  390. package/blocklySkini/blockly/msg/kn.js +447 -0
  391. package/blocklySkini/blockly/msg/ko.d.ts +16 -0
  392. package/blocklySkini/blockly/msg/ko.js +447 -0
  393. package/blocklySkini/blockly/msg/lb.d.ts +16 -0
  394. package/blocklySkini/blockly/msg/lb.js +447 -0
  395. package/blocklySkini/blockly/msg/lki.d.ts +16 -0
  396. package/blocklySkini/blockly/msg/lki.js +447 -0
  397. package/blocklySkini/blockly/msg/lo.d.ts +16 -0
  398. package/blocklySkini/blockly/msg/lo.js +447 -0
  399. package/blocklySkini/blockly/msg/lrc.d.ts +16 -0
  400. package/blocklySkini/blockly/msg/lrc.js +447 -0
  401. package/blocklySkini/blockly/msg/lt.d.ts +16 -0
  402. package/blocklySkini/blockly/msg/lt.js +447 -0
  403. package/blocklySkini/blockly/msg/lv.d.ts +16 -0
  404. package/blocklySkini/blockly/msg/lv.js +447 -0
  405. package/blocklySkini/blockly/msg/mk.d.ts +16 -0
  406. package/blocklySkini/blockly/msg/mk.js +447 -0
  407. package/blocklySkini/blockly/msg/mnw.d.ts +16 -0
  408. package/blocklySkini/blockly/msg/mnw.js +447 -0
  409. package/blocklySkini/blockly/msg/ms.d.ts +16 -0
  410. package/blocklySkini/blockly/msg/ms.js +447 -0
  411. package/blocklySkini/blockly/msg/msg.d.ts +444 -0
  412. package/blocklySkini/blockly/msg/nb.d.ts +16 -0
  413. package/blocklySkini/blockly/msg/nb.js +447 -0
  414. package/blocklySkini/blockly/msg/nl.d.ts +16 -0
  415. package/blocklySkini/blockly/msg/nl.js +447 -0
  416. package/blocklySkini/blockly/msg/oc.d.ts +16 -0
  417. package/blocklySkini/blockly/msg/oc.js +447 -0
  418. package/blocklySkini/blockly/msg/pl.d.ts +16 -0
  419. package/blocklySkini/blockly/msg/pl.js +447 -0
  420. package/blocklySkini/blockly/msg/pms.d.ts +16 -0
  421. package/blocklySkini/blockly/msg/pms.js +447 -0
  422. package/blocklySkini/blockly/msg/pt-br.d.ts +16 -0
  423. package/blocklySkini/blockly/msg/pt-br.js +447 -0
  424. package/blocklySkini/blockly/msg/pt.d.ts +16 -0
  425. package/blocklySkini/blockly/msg/pt.js +447 -0
  426. package/blocklySkini/blockly/msg/qqq.d.ts +16 -0
  427. package/blocklySkini/blockly/msg/ro.d.ts +16 -0
  428. package/blocklySkini/blockly/msg/ro.js +447 -0
  429. package/blocklySkini/blockly/msg/ru.d.ts +16 -0
  430. package/blocklySkini/blockly/msg/ru.js +447 -0
  431. package/blocklySkini/blockly/msg/sc.d.ts +16 -0
  432. package/blocklySkini/blockly/msg/sc.js +447 -0
  433. package/blocklySkini/blockly/msg/sd.d.ts +16 -0
  434. package/blocklySkini/blockly/msg/sd.js +447 -0
  435. package/blocklySkini/blockly/msg/shn.d.ts +16 -0
  436. package/blocklySkini/blockly/msg/shn.js +447 -0
  437. package/blocklySkini/blockly/msg/sk.d.ts +16 -0
  438. package/blocklySkini/blockly/msg/sk.js +447 -0
  439. package/blocklySkini/blockly/msg/skr-arab.d.ts +16 -0
  440. package/blocklySkini/blockly/msg/skr-arab.js +447 -0
  441. package/blocklySkini/blockly/msg/sl.d.ts +16 -0
  442. package/blocklySkini/blockly/msg/sl.js +447 -0
  443. package/blocklySkini/blockly/msg/sq.d.ts +16 -0
  444. package/blocklySkini/blockly/msg/sq.js +447 -0
  445. package/blocklySkini/blockly/msg/sr-latn.d.ts +16 -0
  446. package/blocklySkini/blockly/msg/sr-latn.js +447 -0
  447. package/blocklySkini/blockly/msg/sr.d.ts +16 -0
  448. package/blocklySkini/blockly/msg/sr.js +447 -0
  449. package/blocklySkini/blockly/msg/sv.d.ts +16 -0
  450. package/blocklySkini/blockly/msg/sv.js +447 -0
  451. package/blocklySkini/blockly/msg/synonyms.d.ts +16 -0
  452. package/blocklySkini/blockly/msg/ta.d.ts +16 -0
  453. package/blocklySkini/blockly/msg/ta.js +447 -0
  454. package/blocklySkini/blockly/msg/tcy.d.ts +16 -0
  455. package/blocklySkini/blockly/msg/tcy.js +447 -0
  456. package/blocklySkini/blockly/msg/te.d.ts +16 -0
  457. package/blocklySkini/blockly/msg/te.js +447 -0
  458. package/blocklySkini/blockly/msg/th.d.ts +16 -0
  459. package/blocklySkini/blockly/msg/th.js +447 -0
  460. package/blocklySkini/blockly/msg/tl.d.ts +16 -0
  461. package/blocklySkini/blockly/msg/tl.js +447 -0
  462. package/blocklySkini/blockly/msg/tlh.d.ts +16 -0
  463. package/blocklySkini/blockly/msg/tlh.js +447 -0
  464. package/blocklySkini/blockly/msg/tr.d.ts +16 -0
  465. package/blocklySkini/blockly/msg/tr.js +447 -0
  466. package/blocklySkini/blockly/msg/ug-arab.d.ts +16 -0
  467. package/blocklySkini/blockly/msg/ug-arab.js +447 -0
  468. package/blocklySkini/blockly/msg/uk.d.ts +16 -0
  469. package/blocklySkini/blockly/msg/uk.js +447 -0
  470. package/blocklySkini/blockly/msg/ur.d.ts +16 -0
  471. package/blocklySkini/blockly/msg/ur.js +447 -0
  472. package/blocklySkini/blockly/msg/vi.d.ts +16 -0
  473. package/blocklySkini/blockly/msg/vi.js +447 -0
  474. package/blocklySkini/blockly/msg/xmf.d.ts +16 -0
  475. package/blocklySkini/blockly/msg/xmf.js +447 -0
  476. package/blocklySkini/blockly/msg/yo.d.ts +16 -0
  477. package/blocklySkini/blockly/msg/yo.js +447 -0
  478. package/blocklySkini/blockly/msg/zh-hans.d.ts +16 -0
  479. package/blocklySkini/blockly/msg/zh-hans.js +447 -0
  480. package/blocklySkini/blockly/msg/zh-hant.d.ts +16 -0
  481. package/blocklySkini/blockly/msg/zh-hant.js +447 -0
  482. package/blocklySkini/blockly/node.js +35 -0
  483. package/blocklySkini/blockly/package.json +84 -0
  484. package/blocklySkini/blockly/php.d.ts +15 -0
  485. package/blocklySkini/blockly/php.js +27 -0
  486. package/blocklySkini/blockly/php_compressed.js +103 -0
  487. package/blocklySkini/blockly/php_compressed.js.map +1 -0
  488. package/blocklySkini/blockly/python.d.ts +15 -0
  489. package/blocklySkini/blockly/python.js +27 -0
  490. package/blocklySkini/blockly/python_compressed.js +98 -0
  491. package/blocklySkini/blockly/python_compressed.js.map +1 -0
  492. package/blocklySkini/blocklySkini.html +81 -0
  493. package/blocklySkini/orchestrations/.xml +1 -0
  494. package/blocklySkini/orchestrations/BluesSkini-1.xml +231 -0
  495. package/blocklySkini/orchestrations/BluesSkini-2.xml +741 -0
  496. package/blocklySkini/orchestrations/BluesSkini-3.xml +731 -0
  497. package/blocklySkini/orchestrations/BluesSkini-4.xml +695 -0
  498. package/blocklySkini/orchestrations/BluesSkini-5.xml +731 -0
  499. package/blocklySkini/orchestrations/BluesSkini.xml +704 -0
  500. package/blocklySkini/orchestrations/FunkBitwig-1.xml +778 -0
  501. package/blocklySkini/orchestrations/FunkBitwig-2.xml +471 -0
  502. package/blocklySkini/orchestrations/JouerLeBonInstrument1-1.xml +784 -0
  503. package/blocklySkini/orchestrations/MajeurMineur-1.xml +638 -0
  504. package/blocklySkini/orchestrations/Opus5-3 - Copie.xml +1041 -0
  505. package/blocklySkini/orchestrations/Opus5-3.xml +1128 -0
  506. package/blocklySkini/orchestrations/Quatuor1-1.xml +357 -0
  507. package/blocklySkini/orchestrations/TechnoBitwig-1.xml +221 -0
  508. package/blocklySkini/orchestrations/TestBlockly.xml +497 -0
  509. package/blocklySkini/orchestrations/TestBlockly1.xml +500 -0
  510. package/blocklySkini/orchestrations/TestBlockly2.xml +792 -0
  511. package/blocklySkini/orchestrations/TestBlockly3-1.xml +1182 -0
  512. package/blocklySkini/orchestrations/TestBlockly3.xml +1251 -0
  513. package/blocklySkini/orchestrations/TestFunction.xml +143 -0
  514. package/blocklySkini/orchestrations/TestIf.xml +80 -0
  515. package/blocklySkini/orchestrations/TestLoop.xml +127 -0
  516. package/blocklySkini/orchestrations/TestOrchestration2.xml +460 -0
  517. package/blocklySkini/orchestrations/TestPrint.xml +70 -0
  518. package/blocklySkini/orchestrations/TestSubMod.xml +81 -0
  519. package/blocklySkini/orchestrations/Testlogic.xml +113 -0
  520. package/blocklySkini/orchestrations/TrouveLaPercu-1.xml +813 -0
  521. package/blocklySkini/orchestrations/TrouveLaPercu-2.xml +813 -0
  522. package/blocklySkini/orchestrations/bar.xml +496 -0
  523. package/blocklySkini/orchestrations/bar2.xml +496 -0
  524. package/blocklySkini/orchestrations/foo.xml +500 -0
  525. package/blocklySkini/orchestrations/opus5Blockly - Copie.xml +496 -0
  526. package/blocklySkini/orchestrations/opus5Blockly-3.xml +868 -0
  527. package/blocklySkini/orchestrations/opus5Blockly.xml +496 -0
  528. package/blocklySkini/orchestrations/testOrchestration3.xml +483 -0
  529. package/blocklySkini/orchestrations/testOrchestration4.xml +487 -0
  530. package/blocklySkini/scripts/hiphop_blocks.js +6104 -0
  531. package/blocklySkini/scripts/main2.js +801 -0
  532. package/blocklySkini/styles/index.css +320 -0
  533. package/blocklySkini/styles/material.css +11552 -0
  534. package/package.json +4 -3
@@ -0,0 +1,993 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview The class representing an in-progress gesture, usually a drag
9
+ * or a tap.
10
+ * @author fenichel@google.com (Rachel Fenichel)
11
+ */
12
+ 'use strict';
13
+
14
+ goog.provide('Blockly.Gesture');
15
+
16
+ goog.require('Blockly.ASTNode');
17
+ goog.require('Blockly.blockAnimations');
18
+ goog.require('Blockly.BlockDragger');
19
+ goog.require('Blockly.BubbleDragger');
20
+ goog.require('Blockly.constants');
21
+ goog.require('Blockly.Events');
22
+ goog.require('Blockly.Events.Ui');
23
+ goog.require('Blockly.FlyoutDragger');
24
+ goog.require('Blockly.navigation');
25
+ goog.require('Blockly.Tooltip');
26
+ goog.require('Blockly.Touch');
27
+ goog.require('Blockly.utils');
28
+ goog.require('Blockly.utils.Coordinate');
29
+ goog.require('Blockly.WorkspaceDragger');
30
+
31
+ goog.requireType('Blockly.IBubble');
32
+ goog.requireType('Blockly.IFlyout');
33
+
34
+
35
+ /**
36
+ * Note: In this file "start" refers to touchstart, mousedown, and pointerstart
37
+ * events. "End" refers to touchend, mouseup, and pointerend events.
38
+ */
39
+ // TODO: Consider touchcancel/pointercancel.
40
+
41
+ /**
42
+ * Class for one gesture.
43
+ * @param {!Event} e The event that kicked off this gesture.
44
+ * @param {!Blockly.WorkspaceSvg} creatorWorkspace The workspace that created
45
+ * this gesture and has a reference to it.
46
+ * @constructor
47
+ */
48
+ Blockly.Gesture = function(e, creatorWorkspace) {
49
+ /**
50
+ * The position of the mouse when the gesture started. Units are CSS pixels,
51
+ * with (0, 0) at the top left of the browser window (mouseEvent clientX/Y).
52
+ * @type {Blockly.utils.Coordinate}
53
+ * @private
54
+ */
55
+ this.mouseDownXY_ = null;
56
+
57
+ /**
58
+ * How far the mouse has moved during this drag, in pixel units.
59
+ * (0, 0) is at this.mouseDownXY_.
60
+ * @type {!Blockly.utils.Coordinate}
61
+ * @private
62
+ */
63
+ this.currentDragDeltaXY_ = new Blockly.utils.Coordinate(0, 0);
64
+
65
+ /**
66
+ * The bubble that the gesture started on, or null if it did not start on a
67
+ * bubble.
68
+ * @type {Blockly.IBubble}
69
+ * @private
70
+ */
71
+ this.startBubble_ = null;
72
+
73
+ /**
74
+ * The field that the gesture started on, or null if it did not start on a
75
+ * field.
76
+ * @type {Blockly.Field}
77
+ * @private
78
+ */
79
+ this.startField_ = null;
80
+
81
+ /**
82
+ * The block that the gesture started on, or null if it did not start on a
83
+ * block.
84
+ * @type {Blockly.BlockSvg}
85
+ * @private
86
+ */
87
+ this.startBlock_ = null;
88
+
89
+ /**
90
+ * The block that this gesture targets. If the gesture started on a
91
+ * shadow block, this is the first non-shadow parent of the block. If the
92
+ * gesture started in the flyout, this is the root block of the block group
93
+ * that was clicked or dragged.
94
+ * @type {Blockly.BlockSvg}
95
+ * @private
96
+ */
97
+ this.targetBlock_ = null;
98
+
99
+ /**
100
+ * The workspace that the gesture started on. There may be multiple
101
+ * workspaces on a page; this is more accurate than using
102
+ * Blockly.getMainWorkspace().
103
+ * @type {Blockly.WorkspaceSvg}
104
+ * @protected
105
+ */
106
+ this.startWorkspace_ = null;
107
+
108
+ /**
109
+ * The workspace that created this gesture. This workspace keeps a reference
110
+ * to the gesture, which will need to be cleared at deletion.
111
+ * This may be different from the start workspace. For instance, a flyout is
112
+ * a workspace, but its parent workspace manages gestures for it.
113
+ * @type {!Blockly.WorkspaceSvg}
114
+ * @private
115
+ */
116
+ this.creatorWorkspace_ = creatorWorkspace;
117
+
118
+ /**
119
+ * Whether the pointer has at any point moved out of the drag radius.
120
+ * A gesture that exceeds the drag radius is a drag even if it ends exactly
121
+ * at its start point.
122
+ * @type {boolean}
123
+ * @private
124
+ */
125
+ this.hasExceededDragRadius_ = false;
126
+
127
+ /**
128
+ * Whether the workspace is currently being dragged.
129
+ * @type {boolean}
130
+ * @private
131
+ */
132
+ this.isDraggingWorkspace_ = false;
133
+
134
+ /**
135
+ * Whether the block is currently being dragged.
136
+ * @type {boolean}
137
+ * @private
138
+ */
139
+ this.isDraggingBlock_ = false;
140
+
141
+ /**
142
+ * Whether the bubble is currently being dragged.
143
+ * @type {boolean}
144
+ * @private
145
+ */
146
+ this.isDraggingBubble_ = false;
147
+
148
+ /**
149
+ * The event that most recently updated this gesture.
150
+ * @type {!Event}
151
+ * @private
152
+ */
153
+ this.mostRecentEvent_ = e;
154
+
155
+ /**
156
+ * A handle to use to unbind a mouse move listener at the end of a drag.
157
+ * Opaque data returned from Blockly.bindEventWithChecks_.
158
+ * @type {?Blockly.EventData}
159
+ * @protected
160
+ */
161
+ this.onMoveWrapper_ = null;
162
+
163
+ /**
164
+ * A handle to use to unbind a mouse up listener at the end of a drag.
165
+ * Opaque data returned from Blockly.bindEventWithChecks_.
166
+ * @type {?Blockly.EventData}
167
+ * @protected
168
+ */
169
+ this.onUpWrapper_ = null;
170
+
171
+ /**
172
+ * The object tracking a bubble drag, or null if none is in progress.
173
+ * @type {Blockly.BubbleDragger}
174
+ * @private
175
+ */
176
+ this.bubbleDragger_ = null;
177
+
178
+ /**
179
+ * The object tracking a block drag, or null if none is in progress.
180
+ * @type {Blockly.BlockDragger}
181
+ * @private
182
+ */
183
+ this.blockDragger_ = null;
184
+
185
+ /**
186
+ * The object tracking a workspace or flyout workspace drag, or null if none
187
+ * is in progress.
188
+ * @type {Blockly.WorkspaceDragger}
189
+ * @private
190
+ */
191
+ this.workspaceDragger_ = null;
192
+
193
+ /**
194
+ * The flyout a gesture started in, if any.
195
+ * @type {Blockly.IFlyout}
196
+ * @private
197
+ */
198
+ this.flyout_ = null;
199
+
200
+ /**
201
+ * Boolean for sanity-checking that some code is only called once.
202
+ * @type {boolean}
203
+ * @private
204
+ */
205
+ this.calledUpdateIsDragging_ = false;
206
+
207
+ /**
208
+ * Boolean for sanity-checking that some code is only called once.
209
+ * @type {boolean}
210
+ * @private
211
+ */
212
+ this.hasStarted_ = false;
213
+
214
+ /**
215
+ * Boolean used internally to break a cycle in disposal.
216
+ * @type {boolean}
217
+ * @protected
218
+ */
219
+ this.isEnding_ = false;
220
+
221
+ /**
222
+ * Boolean used to indicate whether or not to heal the stack after
223
+ * disconnecting a block.
224
+ * @type {boolean}
225
+ * @private
226
+ */
227
+ this.healStack_ = !Blockly.DRAG_STACK;
228
+ };
229
+
230
+ /**
231
+ * Sever all links from this object.
232
+ * @package
233
+ */
234
+ Blockly.Gesture.prototype.dispose = function() {
235
+ Blockly.Touch.clearTouchIdentifier();
236
+ Blockly.Tooltip.unblock();
237
+ // Clear the owner's reference to this gesture.
238
+ this.creatorWorkspace_.clearGesture();
239
+
240
+ if (this.onMoveWrapper_) {
241
+ Blockly.unbindEvent_(this.onMoveWrapper_);
242
+ }
243
+ if (this.onUpWrapper_) {
244
+ Blockly.unbindEvent_(this.onUpWrapper_);
245
+ }
246
+
247
+ if (this.blockDragger_) {
248
+ this.blockDragger_.dispose();
249
+ }
250
+ if (this.workspaceDragger_) {
251
+ this.workspaceDragger_.dispose();
252
+ }
253
+ if (this.bubbleDragger_) {
254
+ this.bubbleDragger_.dispose();
255
+ }
256
+ };
257
+
258
+ /**
259
+ * Update internal state based on an event.
260
+ * @param {!Event} e The most recent mouse or touch event.
261
+ * @private
262
+ */
263
+ Blockly.Gesture.prototype.updateFromEvent_ = function(e) {
264
+ var currentXY = new Blockly.utils.Coordinate(e.clientX, e.clientY);
265
+ var changed = this.updateDragDelta_(currentXY);
266
+ // Exceeded the drag radius for the first time.
267
+ if (changed) {
268
+ this.updateIsDragging_();
269
+ Blockly.longStop_();
270
+ }
271
+ this.mostRecentEvent_ = e;
272
+ };
273
+
274
+ /**
275
+ * DO MATH to set currentDragDeltaXY_ based on the most recent mouse position.
276
+ * @param {!Blockly.utils.Coordinate} currentXY The most recent mouse/pointer
277
+ * position, in pixel units, with (0, 0) at the window's top left corner.
278
+ * @return {boolean} True if the drag just exceeded the drag radius for the
279
+ * first time.
280
+ * @private
281
+ */
282
+ Blockly.Gesture.prototype.updateDragDelta_ = function(currentXY) {
283
+ this.currentDragDeltaXY_ = Blockly.utils.Coordinate.difference(
284
+ currentXY,
285
+ /** @type {!Blockly.utils.Coordinate} */ (this.mouseDownXY_));
286
+
287
+ if (!this.hasExceededDragRadius_) {
288
+ var currentDragDelta =
289
+ Blockly.utils.Coordinate.magnitude(this.currentDragDeltaXY_);
290
+
291
+ // The flyout has a different drag radius from the rest of Blockly.
292
+ var limitRadius =
293
+ this.flyout_ ? Blockly.FLYOUT_DRAG_RADIUS : Blockly.DRAG_RADIUS;
294
+
295
+ this.hasExceededDragRadius_ = currentDragDelta > limitRadius;
296
+ return this.hasExceededDragRadius_;
297
+ }
298
+ return false;
299
+ };
300
+
301
+ /**
302
+ * Update this gesture to record whether a block is being dragged from the
303
+ * flyout.
304
+ * This function should be called on a mouse/touch move event the first time the
305
+ * drag radius is exceeded. It should be called no more than once per gesture.
306
+ * If a block should be dragged from the flyout this function creates the new
307
+ * block on the main workspace and updates targetBlock_ and startWorkspace_.
308
+ * @return {boolean} True if a block is being dragged from the flyout.
309
+ * @private
310
+ */
311
+ Blockly.Gesture.prototype.updateIsDraggingFromFlyout_ = function() {
312
+ if (!this.targetBlock_) {
313
+ return false;
314
+ }
315
+ if (!this.flyout_.isBlockCreatable_(this.targetBlock_)) {
316
+ return false;
317
+ }
318
+ if (!this.flyout_.isScrollable() ||
319
+ this.flyout_.isDragTowardWorkspace(this.currentDragDeltaXY_)) {
320
+ this.startWorkspace_ = this.flyout_.targetWorkspace;
321
+ this.startWorkspace_.updateScreenCalculationsIfScrolled();
322
+ // Start the event group now, so that the same event group is used for block
323
+ // creation and block dragging.
324
+ if (!Blockly.Events.getGroup()) {
325
+ Blockly.Events.setGroup(true);
326
+ }
327
+ // The start block is no longer relevant, because this is a drag.
328
+ this.startBlock_ = null;
329
+ this.targetBlock_ = this.flyout_.createBlock(this.targetBlock_);
330
+ this.targetBlock_.select();
331
+ return true;
332
+ }
333
+ return false;
334
+ };
335
+
336
+ /**
337
+ * Update this gesture to record whether a bubble is being dragged.
338
+ * This function should be called on a mouse/touch move event the first time the
339
+ * drag radius is exceeded. It should be called no more than once per gesture.
340
+ * If a bubble should be dragged this function creates the necessary
341
+ * BubbleDragger and starts the drag.
342
+ * @return {boolean} True if a bubble is being dragged.
343
+ * @private
344
+ */
345
+ Blockly.Gesture.prototype.updateIsDraggingBubble_ = function() {
346
+ if (!this.startBubble_) {
347
+ return false;
348
+ }
349
+
350
+ this.isDraggingBubble_ = true;
351
+ this.startDraggingBubble_();
352
+ return true;
353
+ };
354
+
355
+ /**
356
+ * Update this gesture to record whether a block is being dragged.
357
+ * This function should be called on a mouse/touch move event the first time the
358
+ * drag radius is exceeded. It should be called no more than once per gesture.
359
+ * If a block should be dragged, either from the flyout or in the workspace,
360
+ * this function creates the necessary BlockDragger and starts the drag.
361
+ * @return {boolean} True if a block is being dragged.
362
+ * @private
363
+ */
364
+ Blockly.Gesture.prototype.updateIsDraggingBlock_ = function() {
365
+ if (!this.targetBlock_) {
366
+ return false;
367
+ }
368
+
369
+ if (this.flyout_) {
370
+ this.isDraggingBlock_ = this.updateIsDraggingFromFlyout_();
371
+ } else if (this.targetBlock_.isMovable()) {
372
+ this.isDraggingBlock_ = true;
373
+ }
374
+
375
+ if (this.isDraggingBlock_) {
376
+ this.startDraggingBlock_();
377
+ return true;
378
+ }
379
+ return false;
380
+ };
381
+
382
+ /**
383
+ * Update this gesture to record whether a workspace is being dragged.
384
+ * This function should be called on a mouse/touch move event the first time the
385
+ * drag radius is exceeded. It should be called no more than once per gesture.
386
+ * If a workspace is being dragged this function creates the necessary
387
+ * WorkspaceDragger or FlyoutDragger and starts the drag.
388
+ * @private
389
+ */
390
+ Blockly.Gesture.prototype.updateIsDraggingWorkspace_ = function() {
391
+ var wsMovable = this.flyout_ ?
392
+ this.flyout_.isScrollable() :
393
+ this.startWorkspace_ && this.startWorkspace_.isDraggable();
394
+
395
+ if (!wsMovable) {
396
+ return;
397
+ }
398
+
399
+ if (this.flyout_) {
400
+ this.workspaceDragger_ = new Blockly.FlyoutDragger(this.flyout_);
401
+ } else {
402
+ this.workspaceDragger_ = new Blockly.WorkspaceDragger(
403
+ /** @type {!Blockly.WorkspaceSvg} */ (this.startWorkspace_));
404
+ }
405
+
406
+ this.isDraggingWorkspace_ = true;
407
+ this.workspaceDragger_.startDrag();
408
+ };
409
+
410
+ /**
411
+ * Update this gesture to record whether anything is being dragged.
412
+ * This function should be called on a mouse/touch move event the first time the
413
+ * drag radius is exceeded. It should be called no more than once per gesture.
414
+ * @private
415
+ */
416
+ Blockly.Gesture.prototype.updateIsDragging_ = function() {
417
+ // Sanity check.
418
+ if (this.calledUpdateIsDragging_) {
419
+ throw Error('updateIsDragging_ should only be called once per gesture.');
420
+ }
421
+ this.calledUpdateIsDragging_ = true;
422
+
423
+ // First check if it was a bubble drag. Bubbles always sit on top of blocks.
424
+ if (this.updateIsDraggingBubble_()) {
425
+ return;
426
+ }
427
+ // Then check if it was a block drag.
428
+ if (this.updateIsDraggingBlock_()) {
429
+ return;
430
+ }
431
+ // Then check if it's a workspace drag.
432
+ this.updateIsDraggingWorkspace_();
433
+ };
434
+
435
+ /**
436
+ * Create a block dragger and start dragging the selected block.
437
+ * @private
438
+ */
439
+ Blockly.Gesture.prototype.startDraggingBlock_ = function() {
440
+ this.blockDragger_ = new Blockly.BlockDragger(
441
+ /** @type {!Blockly.BlockSvg} */ (this.targetBlock_),
442
+ /** @type {!Blockly.WorkspaceSvg} */ (this.startWorkspace_));
443
+ this.blockDragger_.startBlockDrag(this.currentDragDeltaXY_, this.healStack_);
444
+ this.blockDragger_.dragBlock(this.mostRecentEvent_, this.currentDragDeltaXY_);
445
+ };
446
+
447
+ /**
448
+ * Create a bubble dragger and start dragging the selected bubble.
449
+ * @private
450
+ */
451
+ // TODO (fenichel): Possibly combine this and startDraggingBlock_.
452
+ Blockly.Gesture.prototype.startDraggingBubble_ = function() {
453
+ this.bubbleDragger_ = new Blockly.BubbleDragger(
454
+ /** @type {!Blockly.IBubble} */ (this.startBubble_),
455
+ /** @type {!Blockly.WorkspaceSvg} */ (this.startWorkspace_));
456
+ this.bubbleDragger_.startBubbleDrag();
457
+ this.bubbleDragger_.dragBubble(
458
+ this.mostRecentEvent_, this.currentDragDeltaXY_);
459
+ };
460
+ /**
461
+ * Start a gesture: update the workspace to indicate that a gesture is in
462
+ * progress and bind mousemove and mouseup handlers.
463
+ * @param {!Event} e A mouse down or touch start event.
464
+ * @package
465
+ */
466
+ Blockly.Gesture.prototype.doStart = function(e) {
467
+ if (Blockly.utils.isTargetInput(e)) {
468
+ this.cancel();
469
+ return;
470
+ }
471
+ this.hasStarted_ = true;
472
+
473
+ Blockly.blockAnimations.disconnectUiStop();
474
+ this.startWorkspace_.updateScreenCalculationsIfScrolled();
475
+ if (this.startWorkspace_.isMutator) {
476
+ // Mutator's coordinate system could be out of date because the bubble was
477
+ // dragged, the block was moved, the parent workspace zoomed, etc.
478
+ this.startWorkspace_.resize();
479
+ }
480
+
481
+ // Hide chaff also hides the flyout, so don't do it if the click is in a
482
+ // flyout.
483
+ Blockly.hideChaff(!!this.flyout_);
484
+
485
+ this.startWorkspace_.markFocused();
486
+ this.mostRecentEvent_ = e;
487
+
488
+ Blockly.Tooltip.block();
489
+
490
+ if (this.targetBlock_) {
491
+ if (!this.targetBlock_.isInFlyout && e.shiftKey &&
492
+ this.targetBlock_.workspace.keyboardAccessibilityMode) {
493
+ this.creatorWorkspace_.getCursor().setCurNode(
494
+ Blockly.ASTNode.createTopNode(this.targetBlock_));
495
+ } else {
496
+ this.targetBlock_.select();
497
+ }
498
+ }
499
+
500
+ if (Blockly.utils.isRightButton(e)) {
501
+ this.handleRightClick(e);
502
+ return;
503
+ }
504
+
505
+ if ((e.type.toLowerCase() == 'touchstart' ||
506
+ e.type.toLowerCase() == 'pointerdown') &&
507
+ e.pointerType != 'mouse') {
508
+ Blockly.longStart(e, this);
509
+ }
510
+
511
+ this.mouseDownXY_ = new Blockly.utils.Coordinate(e.clientX, e.clientY);
512
+ this.healStack_ = e.altKey || e.ctrlKey || e.metaKey;
513
+
514
+ this.bindMouseEvents(e);
515
+ };
516
+
517
+ /**
518
+ * Bind gesture events.
519
+ * @param {!Event} e A mouse down or touch start event.
520
+ * @package
521
+ */
522
+ Blockly.Gesture.prototype.bindMouseEvents = function(e) {
523
+ this.onMoveWrapper_ = Blockly.bindEventWithChecks_(
524
+ document, 'mousemove', null, this.handleMove.bind(this));
525
+ this.onUpWrapper_ = Blockly.bindEventWithChecks_(
526
+ document, 'mouseup', null, this.handleUp.bind(this));
527
+
528
+ e.preventDefault();
529
+ e.stopPropagation();
530
+ };
531
+
532
+ /**
533
+ * Handle a mouse move or touch move event.
534
+ * @param {!Event} e A mouse move or touch move event.
535
+ * @package
536
+ */
537
+ Blockly.Gesture.prototype.handleMove = function(e) {
538
+ this.updateFromEvent_(e);
539
+ if (this.isDraggingWorkspace_) {
540
+ this.workspaceDragger_.drag(this.currentDragDeltaXY_);
541
+ } else if (this.isDraggingBlock_) {
542
+ this.blockDragger_.dragBlock(
543
+ this.mostRecentEvent_, this.currentDragDeltaXY_);
544
+ } else if (this.isDraggingBubble_) {
545
+ this.bubbleDragger_.dragBubble(
546
+ this.mostRecentEvent_, this.currentDragDeltaXY_);
547
+ }
548
+ e.preventDefault();
549
+ e.stopPropagation();
550
+ };
551
+
552
+ /**
553
+ * Handle a mouse up or touch end event.
554
+ * @param {!Event} e A mouse up or touch end event.
555
+ * @package
556
+ */
557
+ Blockly.Gesture.prototype.handleUp = function(e) {
558
+ this.updateFromEvent_(e);
559
+ Blockly.longStop_();
560
+
561
+ if (this.isEnding_) {
562
+ console.log('Trying to end a gesture recursively.');
563
+ return;
564
+ }
565
+ this.isEnding_ = true;
566
+ // The ordering of these checks is important: drags have higher priority than
567
+ // clicks. Fields have higher priority than blocks; blocks have higher
568
+ // priority than workspaces.
569
+ // The ordering within drags does not matter, because the three types of
570
+ // dragging are exclusive.
571
+ if (this.isDraggingBubble_) {
572
+ this.bubbleDragger_.endBubbleDrag(e, this.currentDragDeltaXY_);
573
+ } else if (this.isDraggingBlock_) {
574
+ this.blockDragger_.endBlockDrag(e, this.currentDragDeltaXY_);
575
+ } else if (this.isDraggingWorkspace_) {
576
+ this.workspaceDragger_.endDrag(this.currentDragDeltaXY_);
577
+ } else if (this.isBubbleClick_()) {
578
+ // Bubbles are in front of all fields and blocks.
579
+ this.doBubbleClick_();
580
+ } else if (this.isFieldClick_()) {
581
+ this.doFieldClick_();
582
+ } else if (this.isBlockClick_()) {
583
+ this.doBlockClick_();
584
+ } else if (this.isWorkspaceClick_()) {
585
+ this.doWorkspaceClick_(e);
586
+ }
587
+
588
+ e.preventDefault();
589
+ e.stopPropagation();
590
+
591
+ this.dispose();
592
+ };
593
+
594
+ /**
595
+ * Cancel an in-progress gesture. If a workspace or block drag is in progress,
596
+ * end the drag at the most recent location.
597
+ * @package
598
+ */
599
+ Blockly.Gesture.prototype.cancel = function() {
600
+ // Disposing of a block cancels in-progress drags, but dragging to a delete
601
+ // area disposes of a block and leads to recursive disposal. Break that cycle.
602
+ if (this.isEnding_) {
603
+ return;
604
+ }
605
+ Blockly.longStop_();
606
+ if (this.isDraggingBubble_) {
607
+ this.bubbleDragger_.endBubbleDrag(
608
+ this.mostRecentEvent_, this.currentDragDeltaXY_);
609
+ } else if (this.isDraggingBlock_) {
610
+ this.blockDragger_.endBlockDrag(
611
+ this.mostRecentEvent_, this.currentDragDeltaXY_);
612
+ } else if (this.isDraggingWorkspace_) {
613
+ this.workspaceDragger_.endDrag(this.currentDragDeltaXY_);
614
+ }
615
+ this.dispose();
616
+ };
617
+
618
+ /**
619
+ * Handle a real or faked right-click event by showing a context menu.
620
+ * @param {!Event} e A mouse move or touch move event.
621
+ * @package
622
+ */
623
+ Blockly.Gesture.prototype.handleRightClick = function(e) {
624
+ if (this.targetBlock_) {
625
+ this.bringBlockToFront_();
626
+ Blockly.hideChaff(!!this.flyout_);
627
+ this.targetBlock_.showContextMenu(e);
628
+ } else if (this.startBubble_) {
629
+ this.startBubble_.showContextMenu(e);
630
+ } else if (this.startWorkspace_ && !this.flyout_) {
631
+ Blockly.hideChaff();
632
+ this.startWorkspace_.showContextMenu(e);
633
+ }
634
+
635
+ // TODO: Handle right-click on a bubble.
636
+ e.preventDefault();
637
+ e.stopPropagation();
638
+
639
+ this.dispose();
640
+ };
641
+
642
+ /**
643
+ * Handle a mousedown/touchstart event on a workspace.
644
+ * @param {!Event} e A mouse down or touch start event.
645
+ * @param {!Blockly.WorkspaceSvg} ws The workspace the event hit.
646
+ * @package
647
+ */
648
+ Blockly.Gesture.prototype.handleWsStart = function(e, ws) {
649
+ if (this.hasStarted_) {
650
+ throw Error(
651
+ 'Tried to call gesture.handleWsStart, ' +
652
+ 'but the gesture had already been started.');
653
+ }
654
+ this.setStartWorkspace_(ws);
655
+ this.mostRecentEvent_ = e;
656
+ this.doStart(e);
657
+ if (this.startWorkspace_.keyboardAccessibilityMode) {
658
+ Blockly.navigation.setState(Blockly.navigation.STATE_WS);
659
+ }
660
+ };
661
+
662
+ /**
663
+ * Fires a workspace click event.
664
+ * @param {!Blockly.WorkspaceSvg} ws The workspace that a user clicks on.
665
+ * @private
666
+ */
667
+ Blockly.Gesture.prototype.fireWorkspaceClick_ = function(ws) {
668
+ var clickEvent = new Blockly.Events.Ui(null, 'click', null, 'workspace');
669
+ clickEvent.workspaceId = ws.id;
670
+ Blockly.Events.fire(clickEvent);
671
+ };
672
+
673
+ /**
674
+ * Handle a mousedown/touchstart event on a flyout.
675
+ * @param {!Event} e A mouse down or touch start event.
676
+ * @param {!Blockly.IFlyout} flyout The flyout the event hit.
677
+ * @package
678
+ */
679
+ Blockly.Gesture.prototype.handleFlyoutStart = function(e, flyout) {
680
+ if (this.hasStarted_) {
681
+ throw Error(
682
+ 'Tried to call gesture.handleFlyoutStart, ' +
683
+ 'but the gesture had already been started.');
684
+ }
685
+ this.setStartFlyout_(flyout);
686
+ this.handleWsStart(e, flyout.getWorkspace());
687
+ };
688
+
689
+ /**
690
+ * Handle a mousedown/touchstart event on a block.
691
+ * @param {!Event} e A mouse down or touch start event.
692
+ * @param {!Blockly.BlockSvg} block The block the event hit.
693
+ * @package
694
+ */
695
+ Blockly.Gesture.prototype.handleBlockStart = function(e, block) {
696
+ if (this.hasStarted_) {
697
+ throw Error(
698
+ 'Tried to call gesture.handleBlockStart, ' +
699
+ 'but the gesture had already been started.');
700
+ }
701
+ this.setStartBlock(block);
702
+ this.mostRecentEvent_ = e;
703
+ };
704
+
705
+ /**
706
+ * Handle a mousedown/touchstart event on a bubble.
707
+ * @param {!Event} e A mouse down or touch start event.
708
+ * @param {!Blockly.IBubble} bubble The bubble the event hit.
709
+ * @package
710
+ */
711
+ Blockly.Gesture.prototype.handleBubbleStart = function(e, bubble) {
712
+ if (this.hasStarted_) {
713
+ throw Error(
714
+ 'Tried to call gesture.handleBubbleStart, ' +
715
+ 'but the gesture had already been started.');
716
+ }
717
+ this.setStartBubble(bubble);
718
+ this.mostRecentEvent_ = e;
719
+ };
720
+
721
+ /* Begin functions defining what actions to take to execute clicks on each type
722
+ * of target. Any developer wanting to add behaviour on clicks should modify
723
+ * only this code. */
724
+
725
+ /**
726
+ * Execute a bubble click.
727
+ * @private
728
+ */
729
+ Blockly.Gesture.prototype.doBubbleClick_ = function() {
730
+ // TODO (#1673): Consistent handling of single clicks.
731
+ this.startBubble_.setFocus && this.startBubble_.setFocus();
732
+ this.startBubble_.select && this.startBubble_.select();
733
+ };
734
+
735
+ /**
736
+ * Execute a field click.
737
+ * @private
738
+ */
739
+ Blockly.Gesture.prototype.doFieldClick_ = function() {
740
+ this.startField_.showEditor(this.mostRecentEvent_);
741
+ this.bringBlockToFront_();
742
+ };
743
+
744
+ /**
745
+ * Execute a block click.
746
+ * @private
747
+ */
748
+ Blockly.Gesture.prototype.doBlockClick_ = function() {
749
+ // Block click in an autoclosing flyout.
750
+ if (this.flyout_ && this.flyout_.autoClose) {
751
+ if (this.targetBlock_.isEnabled()) {
752
+ if (!Blockly.Events.getGroup()) {
753
+ Blockly.Events.setGroup(true);
754
+ }
755
+ var newBlock = this.flyout_.createBlock(this.targetBlock_);
756
+ newBlock.scheduleSnapAndBump();
757
+ }
758
+ } else {
759
+ // Clicks events are on the start block, even if it was a shadow.
760
+ Blockly.Events.fire(
761
+ new Blockly.Events.Ui(this.startBlock_, 'click', undefined, 'block'));
762
+ }
763
+ this.bringBlockToFront_();
764
+ Blockly.Events.setGroup(false);
765
+ };
766
+
767
+ /**
768
+ * Execute a workspace click. When in accessibility mode shift clicking will
769
+ * move the cursor.
770
+ * @param {!Event} e A mouse up or touch end event.
771
+ * @private
772
+ */
773
+ Blockly.Gesture.prototype.doWorkspaceClick_ = function(e) {
774
+ var ws = this.creatorWorkspace_;
775
+ if (e.shiftKey && ws.keyboardAccessibilityMode) {
776
+ var screenCoord = new Blockly.utils.Coordinate(e.clientX, e.clientY);
777
+ var wsCoord = Blockly.utils.screenToWsCoordinates(ws, screenCoord);
778
+ var wsNode = Blockly.ASTNode.createWorkspaceNode(ws, wsCoord);
779
+ ws.getCursor().setCurNode(wsNode);
780
+ } else if (Blockly.selected) {
781
+ Blockly.selected.unselect();
782
+ }
783
+ this.fireWorkspaceClick_(this.startWorkspace_ || ws);
784
+ };
785
+
786
+ /* End functions defining what actions to take to execute clicks on each type
787
+ * of target. */
788
+
789
+ // TODO (fenichel): Move bubbles to the front.
790
+ /**
791
+ * Move the dragged/clicked block to the front of the workspace so that it is
792
+ * not occluded by other blocks.
793
+ * @private
794
+ */
795
+ Blockly.Gesture.prototype.bringBlockToFront_ = function() {
796
+ // Blocks in the flyout don't overlap, so skip the work.
797
+ if (this.targetBlock_ && !this.flyout_) {
798
+ this.targetBlock_.bringToFront();
799
+ }
800
+ };
801
+
802
+ /* Begin functions for populating a gesture at mouse down. */
803
+
804
+ /**
805
+ * Record the field that a gesture started on.
806
+ * @param {Blockly.Field} field The field the gesture started on.
807
+ * @package
808
+ */
809
+ Blockly.Gesture.prototype.setStartField = function(field) {
810
+ if (this.hasStarted_) {
811
+ throw Error(
812
+ 'Tried to call gesture.setStartField, ' +
813
+ 'but the gesture had already been started.');
814
+ }
815
+ if (!this.startField_) {
816
+ this.startField_ = field;
817
+ }
818
+ };
819
+
820
+ /**
821
+ * Record the bubble that a gesture started on
822
+ * @param {Blockly.IBubble} bubble The bubble the gesture started on.
823
+ * @package
824
+ */
825
+ Blockly.Gesture.prototype.setStartBubble = function(bubble) {
826
+ if (!this.startBubble_) {
827
+ this.startBubble_ = bubble;
828
+ }
829
+ };
830
+
831
+ /**
832
+ * Record the block that a gesture started on, and set the target block
833
+ * appropriately.
834
+ * @param {Blockly.BlockSvg} block The block the gesture started on.
835
+ * @package
836
+ */
837
+ Blockly.Gesture.prototype.setStartBlock = function(block) {
838
+ // If the gesture already went through a bubble, don't set the start block.
839
+ if (!this.startBlock_ && !this.startBubble_) {
840
+ this.startBlock_ = block;
841
+ if (block.isInFlyout && block != block.getRootBlock()) {
842
+ this.setTargetBlock_(block.getRootBlock());
843
+ } else {
844
+ this.setTargetBlock_(block);
845
+ }
846
+ }
847
+ };
848
+
849
+ /**
850
+ * Record the block that a gesture targets, meaning the block that will be
851
+ * dragged if this turns into a drag. If this block is a shadow, that will be
852
+ * its first non-shadow parent.
853
+ * @param {Blockly.BlockSvg} block The block the gesture targets.
854
+ * @private
855
+ */
856
+ Blockly.Gesture.prototype.setTargetBlock_ = function(block) {
857
+ if (block.isShadow()) {
858
+ this.setTargetBlock_(block.getParent());
859
+ } else {
860
+ this.targetBlock_ = block;
861
+ }
862
+ };
863
+
864
+ /**
865
+ * Record the workspace that a gesture started on.
866
+ * @param {Blockly.WorkspaceSvg} ws The workspace the gesture started on.
867
+ * @private
868
+ */
869
+ Blockly.Gesture.prototype.setStartWorkspace_ = function(ws) {
870
+ if (!this.startWorkspace_) {
871
+ this.startWorkspace_ = ws;
872
+ }
873
+ };
874
+
875
+ /**
876
+ * Record the flyout that a gesture started on.
877
+ * @param {Blockly.IFlyout} flyout The flyout the gesture started on.
878
+ * @private
879
+ */
880
+ Blockly.Gesture.prototype.setStartFlyout_ = function(flyout) {
881
+ if (!this.flyout_) {
882
+ this.flyout_ = flyout;
883
+ }
884
+ };
885
+
886
+
887
+ /* End functions for populating a gesture at mouse down. */
888
+
889
+ /* Begin helper functions defining types of clicks. Any developer wanting
890
+ * to change the definition of a click should modify only this code. */
891
+
892
+ /**
893
+ * Whether this gesture is a click on a bubble. This should only be called when
894
+ * ending a gesture (mouse up, touch end).
895
+ * @return {boolean} Whether this gesture was a click on a bubble.
896
+ * @private
897
+ */
898
+ Blockly.Gesture.prototype.isBubbleClick_ = function() {
899
+ // A bubble click starts on a bubble and never escapes the drag radius.
900
+ var hasStartBubble = !!this.startBubble_;
901
+ return hasStartBubble && !this.hasExceededDragRadius_;
902
+ };
903
+
904
+ /**
905
+ * Whether this gesture is a click on a block. This should only be called when
906
+ * ending a gesture (mouse up, touch end).
907
+ * @return {boolean} Whether this gesture was a click on a block.
908
+ * @private
909
+ */
910
+ Blockly.Gesture.prototype.isBlockClick_ = function() {
911
+ // A block click starts on a block, never escapes the drag radius, and is not
912
+ // a field click.
913
+ var hasStartBlock = !!this.startBlock_;
914
+ return hasStartBlock && !this.hasExceededDragRadius_ && !this.isFieldClick_();
915
+ };
916
+
917
+ /**
918
+ * Whether this gesture is a click on a field. This should only be called when
919
+ * ending a gesture (mouse up, touch end).
920
+ * @return {boolean} Whether this gesture was a click on a field.
921
+ * @private
922
+ */
923
+ Blockly.Gesture.prototype.isFieldClick_ = function() {
924
+ var fieldClickable =
925
+ this.startField_ ? this.startField_.isClickable() : false;
926
+ return fieldClickable && !this.hasExceededDragRadius_ &&
927
+ (!this.flyout_ || !this.flyout_.autoClose);
928
+ };
929
+
930
+ /**
931
+ * Whether this gesture is a click on a workspace. This should only be called
932
+ * when ending a gesture (mouse up, touch end).
933
+ * @return {boolean} Whether this gesture was a click on a workspace.
934
+ * @private
935
+ */
936
+ Blockly.Gesture.prototype.isWorkspaceClick_ = function() {
937
+ var onlyTouchedWorkspace =
938
+ !this.startBlock_ && !this.startBubble_ && !this.startField_;
939
+ return onlyTouchedWorkspace && !this.hasExceededDragRadius_;
940
+ };
941
+
942
+ /* End helper functions defining types of clicks. */
943
+
944
+ /**
945
+ * Whether this gesture is a drag of either a workspace or block.
946
+ * This function is called externally to block actions that cannot be taken
947
+ * mid-drag (e.g. using the keyboard to delete the selected blocks).
948
+ * @return {boolean} True if this gesture is a drag of a workspace or block.
949
+ * @package
950
+ */
951
+ Blockly.Gesture.prototype.isDragging = function() {
952
+ return this.isDraggingWorkspace_ || this.isDraggingBlock_ ||
953
+ this.isDraggingBubble_;
954
+ };
955
+
956
+ /**
957
+ * Whether this gesture has already been started. In theory every mouse down
958
+ * has a corresponding mouse up, but in reality it is possible to lose a
959
+ * mouse up, leaving an in-process gesture hanging.
960
+ * @return {boolean} Whether this gesture was a click on a workspace.
961
+ * @package
962
+ */
963
+ Blockly.Gesture.prototype.hasStarted = function() {
964
+ return this.hasStarted_;
965
+ };
966
+
967
+ /**
968
+ * Get a list of the insertion markers that currently exist. Block drags have
969
+ * 0, 1, or 2 insertion markers.
970
+ * @return {!Array.<!Blockly.BlockSvg>} A possibly empty list of insertion
971
+ * marker blocks.
972
+ * @package
973
+ */
974
+ Blockly.Gesture.prototype.getInsertionMarkers = function() {
975
+ if (this.blockDragger_) {
976
+ return this.blockDragger_.getInsertionMarkers();
977
+ }
978
+ return [];
979
+ };
980
+
981
+ /**
982
+ * Is a drag or other gesture currently in progress on any workspace?
983
+ * @return {boolean} True if gesture is occurring.
984
+ */
985
+ Blockly.Gesture.inProgress = function() {
986
+ var workspaces = Blockly.Workspace.getAll();
987
+ for (var i = 0, workspace; (workspace = workspaces[i]); i++) {
988
+ if (workspace.currentGesture_) {
989
+ return true;
990
+ }
991
+ }
992
+ return false;
993
+ };