nodeskini 1.0.1 → 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 +3 -3
@@ -0,0 +1,700 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Class that controls updates to connections during drags.
9
+ * @author fenichel@google.com (Rachel Fenichel)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.InsertionMarkerManager');
14
+
15
+ goog.require('Blockly.blockAnimations');
16
+ goog.require('Blockly.Events');
17
+
18
+
19
+ /**
20
+ * Class that controls updates to connections during drags. It is primarily
21
+ * responsible for finding the closest eligible connection and highlighting or
22
+ * unhiglighting it as needed during a drag.
23
+ * @param {!Blockly.BlockSvg} block The top block in the stack being dragged.
24
+ * @constructor
25
+ */
26
+ Blockly.InsertionMarkerManager = function(block) {
27
+ Blockly.selected = block;
28
+
29
+ /**
30
+ * The top block in the stack being dragged.
31
+ * Does not change during a drag.
32
+ * @type {!Blockly.BlockSvg}
33
+ * @private
34
+ */
35
+ this.topBlock_ = block;
36
+
37
+ /**
38
+ * The workspace on which these connections are being dragged.
39
+ * Does not change during a drag.
40
+ * @type {!Blockly.WorkspaceSvg}
41
+ * @private
42
+ */
43
+ this.workspace_ = block.workspace;
44
+
45
+ /**
46
+ * The last connection on the stack, if it's not the last connection on the
47
+ * first block.
48
+ * Set in initAvailableConnections, if at all.
49
+ * @type {Blockly.RenderedConnection}
50
+ * @private
51
+ */
52
+ this.lastOnStack_ = null;
53
+
54
+ /**
55
+ * The insertion marker corresponding to the last block in the stack, if
56
+ * that's not the same as the first block in the stack.
57
+ * Set in initAvailableConnections, if at all
58
+ * @type {Blockly.BlockSvg}
59
+ * @private
60
+ */
61
+ this.lastMarker_ = null;
62
+
63
+ /**
64
+ * The insertion marker that shows up between blocks to show where a block
65
+ * would go if dropped immediately.
66
+ * @type {Blockly.BlockSvg}
67
+ * @private
68
+ */
69
+ this.firstMarker_ = this.createMarkerBlock_(this.topBlock_);
70
+
71
+ /**
72
+ * The connection that this block would connect to if released immediately.
73
+ * Updated on every mouse move.
74
+ * This is not on any of the blocks that are being dragged.
75
+ * @type {Blockly.RenderedConnection}
76
+ * @private
77
+ */
78
+ this.closestConnection_ = null;
79
+
80
+ /**
81
+ * The connection that would connect to this.closestConnection_ if this block
82
+ * were released immediately.
83
+ * Updated on every mouse move.
84
+ * This is on the top block that is being dragged or the last block in the
85
+ * dragging stack.
86
+ * @type {Blockly.RenderedConnection}
87
+ * @private
88
+ */
89
+ this.localConnection_ = null;
90
+
91
+ /**
92
+ * Whether the block would be deleted if it were dropped immediately.
93
+ * Updated on every mouse move.
94
+ * @type {boolean}
95
+ * @private
96
+ */
97
+ this.wouldDeleteBlock_ = false;
98
+
99
+ /**
100
+ * Connection on the insertion marker block that corresponds to
101
+ * this.localConnection_ on the currently dragged block.
102
+ * @type {Blockly.RenderedConnection}
103
+ * @private
104
+ */
105
+ this.markerConnection_ = null;
106
+
107
+ /**
108
+ * The block that currently has an input being highlighted, or null.
109
+ * @type {Blockly.BlockSvg}
110
+ * @private
111
+ */
112
+ this.highlightedBlock_ = null;
113
+
114
+ /**
115
+ * The block being faded to indicate replacement, or null.
116
+ * @type {Blockly.BlockSvg}
117
+ * @private
118
+ */
119
+ this.fadedBlock_ = null;
120
+
121
+ /**
122
+ * The connections on the dragging blocks that are available to connect to
123
+ * other blocks. This includes all open connections on the top block, as well
124
+ * as the last connection on the block stack.
125
+ * Does not change during a drag.
126
+ * @type {!Array.<!Blockly.RenderedConnection>}
127
+ * @private
128
+ */
129
+ this.availableConnections_ = this.initAvailableConnections_();
130
+ };
131
+
132
+ /**
133
+ * An enum describing different kinds of previews the InsertionMarkerManager
134
+ * could display.
135
+ * @enum {number}
136
+ */
137
+ Blockly.InsertionMarkerManager.PREVIEW_TYPE = {
138
+ INSERTION_MARKER: 0,
139
+ INPUT_OUTLINE: 1,
140
+ REPLACEMENT_FADE: 2,
141
+ };
142
+
143
+ /**
144
+ * Sever all links from this object.
145
+ * @package
146
+ */
147
+ Blockly.InsertionMarkerManager.prototype.dispose = function() {
148
+ this.availableConnections_.length = 0;
149
+
150
+ Blockly.Events.disable();
151
+ try {
152
+ if (this.firstMarker_) {
153
+ this.firstMarker_.dispose();
154
+ }
155
+ if (this.lastMarker_) {
156
+ this.lastMarker_.dispose();
157
+ }
158
+ } finally {
159
+ Blockly.Events.enable();
160
+ }
161
+ };
162
+
163
+ /**
164
+ * Update the available connections for the top block. These connections can
165
+ * change if a block is unplugged and the stack is healed.
166
+ * @package
167
+ */
168
+ Blockly.InsertionMarkerManager.prototype.updateAvailableConnections = function() {
169
+ this.availableConnections_ = this.initAvailableConnections_();
170
+ };
171
+
172
+ /**
173
+ * Return whether the block would be deleted if dropped immediately, based on
174
+ * information from the most recent move event.
175
+ * @return {boolean} True if the block would be deleted if dropped immediately.
176
+ * @package
177
+ */
178
+ Blockly.InsertionMarkerManager.prototype.wouldDeleteBlock = function() {
179
+ return this.wouldDeleteBlock_;
180
+ };
181
+
182
+ /**
183
+ * Return whether the block would be connected if dropped immediately, based on
184
+ * information from the most recent move event.
185
+ * @return {boolean} True if the block would be connected if dropped
186
+ * immediately.
187
+ * @package
188
+ */
189
+ Blockly.InsertionMarkerManager.prototype.wouldConnectBlock = function() {
190
+ return !!this.closestConnection_;
191
+ };
192
+
193
+ /**
194
+ * Connect to the closest connection and render the results.
195
+ * This should be called at the end of a drag.
196
+ * @package
197
+ */
198
+ Blockly.InsertionMarkerManager.prototype.applyConnections = function() {
199
+ if (this.closestConnection_) {
200
+ // Don't fire events for insertion markers.
201
+ Blockly.Events.disable();
202
+ this.hidePreview_();
203
+ Blockly.Events.enable();
204
+ // Connect two blocks together.
205
+ this.localConnection_.connect(this.closestConnection_);
206
+ if (this.topBlock_.rendered) {
207
+ // Trigger a connection animation.
208
+ // Determine which connection is inferior (lower in the source stack).
209
+ var inferiorConnection = this.localConnection_.isSuperior() ?
210
+ this.closestConnection_ : this.localConnection_;
211
+ Blockly.blockAnimations.connectionUiEffect(
212
+ inferiorConnection.getSourceBlock());
213
+ // Bring the just-edited stack to the front.
214
+ var rootBlock = this.topBlock_.getRootBlock();
215
+ rootBlock.bringToFront();
216
+ }
217
+ }
218
+ };
219
+
220
+ /**
221
+ * Update connections based on the most recent move location.
222
+ * @param {!Blockly.utils.Coordinate} dxy Position relative to drag start,
223
+ * in workspace units.
224
+ * @param {?number} deleteArea One of {@link Blockly.DELETE_AREA_TRASH},
225
+ * {@link Blockly.DELETE_AREA_TOOLBOX}, or {@link Blockly.DELETE_AREA_NONE}.
226
+ * @package
227
+ */
228
+ Blockly.InsertionMarkerManager.prototype.update = function(dxy, deleteArea) {
229
+ var candidate = this.getCandidate_(dxy);
230
+
231
+ this.wouldDeleteBlock_ = this.shouldDelete_(candidate, deleteArea);
232
+ var shouldUpdate = this.wouldDeleteBlock_ ||
233
+ this.shouldUpdatePreviews_(candidate, dxy);
234
+
235
+ if (shouldUpdate) {
236
+ // Don't fire events for insertion marker creation or movement.
237
+ Blockly.Events.disable();
238
+ this.maybeHidePreview_(candidate);
239
+ this.maybeShowPreview_(candidate);
240
+ Blockly.Events.enable();
241
+ }
242
+ };
243
+
244
+ /**
245
+ * Create an insertion marker that represents the given block.
246
+ * @param {!Blockly.BlockSvg} sourceBlock The block that the insertion marker
247
+ * will represent.
248
+ * @return {!Blockly.BlockSvg} The insertion marker that represents the given
249
+ * block.
250
+ * @private
251
+ */
252
+ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlock) {
253
+ var imType = sourceBlock.type;
254
+
255
+ Blockly.Events.disable();
256
+ try {
257
+ var result = this.workspace_.newBlock(imType);
258
+ result.setInsertionMarker(true);
259
+ if (sourceBlock.mutationToDom) {
260
+ var oldMutationDom = sourceBlock.mutationToDom();
261
+ if (oldMutationDom) {
262
+ result.domToMutation(oldMutationDom);
263
+ }
264
+ }
265
+ // Copy field values from the other block. These values may impact the
266
+ // rendered size of the insertion marker. Note that we do not care about
267
+ // child blocks here.
268
+ for (var i = 0; i < sourceBlock.inputList.length; i++) {
269
+ var sourceInput = sourceBlock.inputList[i];
270
+ if (sourceInput.name == Blockly.Block.COLLAPSED_INPUT_NAME) {
271
+ continue; // Ignore the collapsed input.
272
+ }
273
+ var resultInput = result.inputList[i];
274
+ for (var j = 0; j < sourceInput.fieldRow.length; j++) {
275
+ var sourceField = sourceInput.fieldRow[j];
276
+ var resultField = resultInput.fieldRow[j];
277
+ resultField.setValue(sourceField.getValue());
278
+ }
279
+ }
280
+
281
+ result.setCollapsed(sourceBlock.isCollapsed());
282
+ result.setInputsInline(sourceBlock.getInputsInline());
283
+
284
+ result.initSvg();
285
+ result.getSvgRoot().setAttribute('visibility', 'hidden');
286
+ } finally {
287
+ Blockly.Events.enable();
288
+ }
289
+
290
+ return result;
291
+ };
292
+
293
+ /**
294
+ * Populate the list of available connections on this block stack. This should
295
+ * only be called once, at the beginning of a drag.
296
+ * If the stack has more than one block, this function will populate
297
+ * lastOnStack_ and create the corresponding insertion marker.
298
+ * @return {!Array.<!Blockly.RenderedConnection>} A list of available
299
+ * connections.
300
+ * @private
301
+ */
302
+ Blockly.InsertionMarkerManager.prototype.initAvailableConnections_ = function() {
303
+ var available = this.topBlock_.getConnections_(false);
304
+ // Also check the last connection on this stack
305
+ var lastOnStack = this.topBlock_.lastConnectionInStack();
306
+ if (lastOnStack && lastOnStack != this.topBlock_.nextConnection) {
307
+ available.push(lastOnStack);
308
+ this.lastOnStack_ = lastOnStack;
309
+ if (this.lastMarker_) {
310
+ Blockly.Events.disable();
311
+ try {
312
+ this.lastMarker_.dispose();
313
+ } finally {
314
+ Blockly.Events.enable();
315
+ }
316
+ }
317
+ this.lastMarker_ = this.createMarkerBlock_(lastOnStack.getSourceBlock());
318
+ }
319
+ return available;
320
+ };
321
+
322
+ /**
323
+ * Whether the previews (insertion marker and replacement marker) should be
324
+ * updated based on the closest candidate and the current drag distance.
325
+ * @param {!Object} candidate An object containing a local connection, a closest
326
+ * connection, and a radius. Returned by getCandidate_.
327
+ * @param {!Blockly.utils.Coordinate} dxy Position relative to drag start,
328
+ * in workspace units.
329
+ * @return {boolean} Whether the preview should be updated.
330
+ * @private
331
+ */
332
+ Blockly.InsertionMarkerManager.prototype.shouldUpdatePreviews_ = function(
333
+ candidate, dxy) {
334
+ var candidateLocal = candidate.local;
335
+ var candidateClosest = candidate.closest;
336
+ var radius = candidate.radius;
337
+
338
+ // Found a connection!
339
+ if (candidateLocal && candidateClosest) {
340
+ // We're already showing an insertion marker.
341
+ // Decide whether the new connection has higher priority.
342
+ if (this.localConnection_ && this.closestConnection_) {
343
+ // The connection was the same as the current connection.
344
+ if (this.closestConnection_ == candidateClosest &&
345
+ this.localConnection_ == candidateLocal) {
346
+ return false;
347
+ }
348
+ var xDiff = this.localConnection_.x + dxy.x - this.closestConnection_.x;
349
+ var yDiff = this.localConnection_.y + dxy.y - this.closestConnection_.y;
350
+ var curDistance = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
351
+ // Slightly prefer the existing preview over a new preview.
352
+ return !(candidateClosest && radius > curDistance -
353
+ Blockly.CURRENT_CONNECTION_PREFERENCE);
354
+ } else if (!this.localConnection_ && !this.closestConnection_) {
355
+ // We weren't showing a preview before, but we should now.
356
+ return true;
357
+ } else {
358
+ console.error('Only one of localConnection_ and closestConnection_ was set.');
359
+ }
360
+ } else { // No connection found.
361
+ // Only need to update if we were showing a preview before.
362
+ return !!(this.localConnection_ && this.closestConnection_);
363
+ }
364
+
365
+ console.error('Returning true from shouldUpdatePreviews, but it\'s not clear why.');
366
+ return true;
367
+ };
368
+
369
+ /**
370
+ * Find the nearest valid connection, which may be the same as the current
371
+ * closest connection.
372
+ * @param {!Blockly.utils.Coordinate} dxy Position relative to drag start,
373
+ * in workspace units.
374
+ * @return {!Object} An object containing a local connection, a closest
375
+ * connection, and a radius.
376
+ * @private
377
+ */
378
+ Blockly.InsertionMarkerManager.prototype.getCandidate_ = function(dxy) {
379
+ var radius = this.getStartRadius_();
380
+ var candidateClosest = null;
381
+ var candidateLocal = null;
382
+
383
+ for (var i = 0; i < this.availableConnections_.length; i++) {
384
+ var myConnection = this.availableConnections_[i];
385
+ var neighbour = myConnection.closest(radius, dxy);
386
+ if (neighbour.connection) {
387
+ candidateClosest = neighbour.connection;
388
+ candidateLocal = myConnection;
389
+ radius = neighbour.radius;
390
+ }
391
+ }
392
+ return {
393
+ closest: candidateClosest,
394
+ local: candidateLocal,
395
+ radius: radius
396
+ };
397
+ };
398
+
399
+ /**
400
+ * Decide the radius at which to start searching for the closest connection.
401
+ * @return {number} The radius at which to start the search for the closest
402
+ * connection.
403
+ * @private
404
+ */
405
+ Blockly.InsertionMarkerManager.prototype.getStartRadius_ = function() {
406
+ // If there is already a connection highlighted,
407
+ // increase the radius we check for making new connections.
408
+ // Why? When a connection is highlighted, blocks move around when the insertion
409
+ // marker is created, which could cause the connection became out of range.
410
+ // By increasing radiusConnection when a connection already exists,
411
+ // we never "lose" the connection from the offset.
412
+ if (this.closestConnection_ && this.localConnection_) {
413
+ return Blockly.CONNECTING_SNAP_RADIUS;
414
+ }
415
+ return Blockly.SNAP_RADIUS;
416
+ };
417
+
418
+ /**
419
+ * Whether ending the drag would delete the block.
420
+ * @param {!Object} candidate An object containing a local connection, a closest
421
+ * connection, and a radius.
422
+ * @param {?number} deleteArea One of {@link Blockly.DELETE_AREA_TRASH},
423
+ * {@link Blockly.DELETE_AREA_TOOLBOX}, or {@link Blockly.DELETE_AREA_NONE}.
424
+ * @return {boolean} True if dropping the block immediately would replace
425
+ * delete the block. False otherwise.
426
+ * @private
427
+ */
428
+ Blockly.InsertionMarkerManager.prototype.shouldDelete_ = function(candidate,
429
+ deleteArea) {
430
+ // Prefer connecting over dropping into the trash can, but prefer dragging to
431
+ // the toolbox over connecting to other blocks.
432
+ var wouldConnect = candidate && !!candidate.closest &&
433
+ deleteArea != Blockly.DELETE_AREA_TOOLBOX;
434
+ var wouldDelete = !!deleteArea && !this.topBlock_.getParent() &&
435
+ this.topBlock_.isDeletable();
436
+
437
+ return wouldDelete && !wouldConnect;
438
+ };
439
+
440
+ /**
441
+ * Show an insertion marker or replacement highlighting during a drag, if
442
+ * needed.
443
+ * At the beginning of this function, this.localConnection_ and
444
+ * this.closestConnection_ should both be null.
445
+ * @param {!Object} candidate An object containing a local connection, a closest
446
+ * connection, and a radius.
447
+ * @private
448
+ */
449
+ Blockly.InsertionMarkerManager.prototype.maybeShowPreview_ = function(candidate) {
450
+ // Nope, don't add a marker.
451
+ if (this.wouldDeleteBlock_) {
452
+ return;
453
+ }
454
+ var closest = candidate.closest;
455
+ var local = candidate.local;
456
+
457
+ // Nothing to connect to.
458
+ if (!closest) {
459
+ return;
460
+ }
461
+
462
+ // Something went wrong and we're trying to connect to an invalid connection.
463
+ if (closest == this.closestConnection_ ||
464
+ closest.getSourceBlock().isInsertionMarker()) {
465
+ console.log('Trying to connect to an insertion marker');
466
+ return;
467
+ }
468
+ // Add an insertion marker or replacement marker.
469
+ this.closestConnection_ = closest;
470
+ this.localConnection_ = local;
471
+ this.showPreview_();
472
+ };
473
+
474
+ /**
475
+ * A preview should be shown. This function figures out if it should be a block
476
+ * highlight or an insertion marker, and shows the appropriate one.
477
+ * @private
478
+ */
479
+ Blockly.InsertionMarkerManager.prototype.showPreview_ = function() {
480
+ var closest = this.closestConnection_;
481
+ var renderer = this.workspace_.getRenderer();
482
+ var method = renderer.getConnectionPreviewMethod(
483
+ /** @type {!Blockly.RenderedConnection} */ (closest),
484
+ /** @type {!Blockly.RenderedConnection} */ (this.localConnection_),
485
+ this.topBlock_);
486
+
487
+ switch (method) {
488
+ case Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE:
489
+ this.showInsertionInputOutline_();
490
+ break;
491
+ case Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER:
492
+ this.showInsertionMarker_();
493
+ break;
494
+ case Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:
495
+ this.showReplacementFade_();
496
+ break;
497
+ }
498
+
499
+ // Optionally highlight the actual connection, as a nod to previous behaviour.
500
+ if (closest && renderer.shouldHighlightConnection(closest)) {
501
+ closest.highlight();
502
+ }
503
+ };
504
+
505
+ /**
506
+ * Show an insertion marker or replacement highlighting during a drag, if
507
+ * needed.
508
+ * At the end of this function, this.localConnection_ and
509
+ * this.closestConnection_ should both be null.
510
+ * @param {!Object} candidate An object containing a local connection, a closest
511
+ * connection, and a radius.
512
+ * @private
513
+ */
514
+ Blockly.InsertionMarkerManager.prototype.maybeHidePreview_ = function(candidate) {
515
+ // If there's no new preview, remove the old one but don't bother deleting it.
516
+ // We might need it later, and this saves disposing of it and recreating it.
517
+ if (!candidate.closest) {
518
+ this.hidePreview_();
519
+ } else {
520
+ // If there's a new preview and there was an preview before, and either
521
+ // connection has changed, remove the old preview.
522
+ var hadPreview = this.closestConnection_ && this.localConnection_;
523
+ var closestChanged = this.closestConnection_ != candidate.closest;
524
+ var localChanged = this.localConnection_ != candidate.local;
525
+
526
+ // Also hide if we had a preview before but now we're going to delete instead.
527
+ if (hadPreview && (closestChanged || localChanged || this.wouldDeleteBlock_)) {
528
+ this.hidePreview_();
529
+ }
530
+ }
531
+
532
+ // Either way, clear out old state.
533
+ this.markerConnection_ = null;
534
+ this.closestConnection_ = null;
535
+ this.localConnection_ = null;
536
+ };
537
+
538
+ /**
539
+ * A preview should be hidden. This function figures out if it is a block
540
+ * highlight or an insertion marker, and hides the appropriate one.
541
+ * @private
542
+ */
543
+ Blockly.InsertionMarkerManager.prototype.hidePreview_ = function() {
544
+ if (this.closestConnection_ && this.closestConnection_.targetBlock() &&
545
+ this.workspace_.getRenderer()
546
+ .shouldHighlightConnection(this.closestConnection_)) {
547
+ this.closestConnection_.unhighlight();
548
+ }
549
+ if (this.fadedBlock_) {
550
+ this.hideReplacementFade_();
551
+ } else if (this.highlightedBlock_) {
552
+ this.hideInsertionInputOutline_();
553
+ } else if (this.markerConnection_) {
554
+ this.hideInsertionMarker_();
555
+ }
556
+ };
557
+
558
+ /**
559
+ * Shows an insertion marker connected to the appropriate blocks (based on
560
+ * manager state).
561
+ * @private
562
+ */
563
+ Blockly.InsertionMarkerManager.prototype.showInsertionMarker_ = function() {
564
+ var local = this.localConnection_;
565
+ var closest = this.closestConnection_;
566
+
567
+ var isLastInStack = this.lastOnStack_ && local == this.lastOnStack_;
568
+ var imBlock = isLastInStack ? this.lastMarker_ : this.firstMarker_;
569
+ var imConn = imBlock.getMatchingConnection(local.getSourceBlock(), local);
570
+
571
+ if (imConn == this.markerConnection_) {
572
+ throw Error('Made it to showInsertionMarker_ even though the marker isn\'t ' +
573
+ 'changing');
574
+ }
575
+
576
+ // Render disconnected from everything else so that we have a valid
577
+ // connection location.
578
+ imBlock.render();
579
+ imBlock.rendered = true;
580
+ imBlock.getSvgRoot().setAttribute('visibility', 'visible');
581
+
582
+ if (imConn && closest) {
583
+ // Position so that the existing block doesn't move.
584
+ imBlock.positionNearConnection(imConn, closest);
585
+ }
586
+ if (closest) {
587
+ // Connect() also renders the insertion marker.
588
+ imConn.connect(closest);
589
+ }
590
+
591
+ this.markerConnection_ = imConn;
592
+ };
593
+
594
+ /**
595
+ * Disconnects and hides the current insertion marker. Should return the blocks
596
+ * to their original state.
597
+ * @private
598
+ */
599
+ Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() {
600
+ if (!this.markerConnection_) {
601
+ console.log('No insertion marker connection to disconnect');
602
+ return;
603
+ }
604
+
605
+ var imConn = this.markerConnection_;
606
+ var imBlock = imConn.getSourceBlock();
607
+ var markerNext = imBlock.nextConnection;
608
+ var markerPrev = imBlock.previousConnection;
609
+ var markerOutput = imBlock.outputConnection;
610
+
611
+ var isFirstInStatementStack =
612
+ (imConn == markerNext && !(markerPrev && markerPrev.targetConnection));
613
+
614
+ var isFirstInOutputStack = imConn.type == Blockly.INPUT_VALUE &&
615
+ !(markerOutput && markerOutput.targetConnection);
616
+ // The insertion marker is the first block in a stack. Unplug won't do
617
+ // anything in that case. Instead, unplug the following block.
618
+ if (isFirstInStatementStack || isFirstInOutputStack) {
619
+ imConn.targetBlock().unplug(false);
620
+ }
621
+ // Inside of a C-block, first statement connection.
622
+ else if (imConn.type == Blockly.NEXT_STATEMENT && imConn != markerNext) {
623
+ var innerConnection = imConn.targetConnection;
624
+ innerConnection.getSourceBlock().unplug(false);
625
+
626
+ var previousBlockNextConnection =
627
+ markerPrev ? markerPrev.targetConnection : null;
628
+
629
+ imBlock.unplug(true);
630
+ if (previousBlockNextConnection) {
631
+ previousBlockNextConnection.connect(innerConnection);
632
+ }
633
+ } else {
634
+ imBlock.unplug(true /* healStack */);
635
+ }
636
+
637
+ if (imConn.targetConnection) {
638
+ throw Error('markerConnection_ still connected at the end of ' +
639
+ 'disconnectInsertionMarker');
640
+ }
641
+
642
+ this.markerConnection_ = null;
643
+ imBlock.getSvgRoot().setAttribute('visibility', 'hidden');
644
+ };
645
+
646
+ /**
647
+ * Shows an outline around the input the closest connection belongs to.
648
+ * @private
649
+ */
650
+ Blockly.InsertionMarkerManager.prototype.showInsertionInputOutline_ = function() {
651
+ var closest = this.closestConnection_;
652
+ this.highlightedBlock_ = closest.getSourceBlock();
653
+ this.highlightedBlock_.highlightShapeForInput(closest, true);
654
+ };
655
+
656
+ /**
657
+ * Hides any visible input outlines.
658
+ * @private
659
+ */
660
+ Blockly.InsertionMarkerManager.prototype.hideInsertionInputOutline_ = function() {
661
+ this.highlightedBlock_.highlightShapeForInput(this.closestConnection_, false);
662
+ this.highlightedBlock_ = null;
663
+ };
664
+
665
+ /**
666
+ * Shows a replacement fade affect on the closest connection's target block
667
+ * (the block that is currently connected to it).
668
+ * @private
669
+ */
670
+ Blockly.InsertionMarkerManager.prototype.showReplacementFade_ = function() {
671
+ this.fadedBlock_ = this.closestConnection_.targetBlock();
672
+ this.fadedBlock_.fadeForReplacement(true);
673
+ };
674
+
675
+ /**
676
+ * Hides/Removes any visible fade affects.
677
+ * @private
678
+ */
679
+ Blockly.InsertionMarkerManager.prototype.hideReplacementFade_ = function() {
680
+ this.fadedBlock_.fadeForReplacement(false);
681
+ this.fadedBlock_ = null;
682
+ };
683
+
684
+ /**
685
+ * Get a list of the insertion markers that currently exist. Drags have 0, 1,
686
+ * or 2 insertion markers.
687
+ * @return {!Array.<!Blockly.BlockSvg>} A possibly empty list of insertion
688
+ * marker blocks.
689
+ * @package
690
+ */
691
+ Blockly.InsertionMarkerManager.prototype.getInsertionMarkers = function() {
692
+ var result = [];
693
+ if (this.firstMarker_) {
694
+ result.push(this.firstMarker_);
695
+ }
696
+ if (this.lastMarker_) {
697
+ result.push(this.lastMarker_);
698
+ }
699
+ return result;
700
+ };