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,880 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2012 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Object representing a UI bubble.
9
+ * @author fraser@google.com (Neil Fraser)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.Bubble');
14
+
15
+ goog.require('Blockly.Scrollbar');
16
+ goog.require('Blockly.Touch');
17
+ goog.require('Blockly.utils');
18
+ goog.require('Blockly.utils.Coordinate');
19
+ goog.require('Blockly.utils.dom');
20
+ goog.require('Blockly.utils.math');
21
+ goog.require('Blockly.utils.Svg');
22
+ goog.require('Blockly.utils.userAgent');
23
+ goog.require('Blockly.Workspace');
24
+
25
+ goog.requireType('Blockly.IBubble');
26
+ goog.requireType('Blockly.utils.Metrics');
27
+
28
+
29
+ /**
30
+ * Class for UI bubble.
31
+ * @param {!Blockly.WorkspaceSvg} workspace The workspace on which to draw the
32
+ * bubble.
33
+ * @param {!Element} content SVG content for the bubble.
34
+ * @param {Element} shape SVG element to avoid eclipsing.
35
+ * @param {!Blockly.utils.Coordinate} anchorXY Absolute position of bubble's
36
+ * anchor point.
37
+ * @param {?number} bubbleWidth Width of bubble, or null if not resizable.
38
+ * @param {?number} bubbleHeight Height of bubble, or null if not resizable.
39
+ * @implements {Blockly.IBubble}
40
+ * @constructor
41
+ */
42
+ Blockly.Bubble = function(
43
+ workspace, content, shape, anchorXY, bubbleWidth, bubbleHeight) {
44
+ this.workspace_ = workspace;
45
+ this.content_ = content;
46
+ this.shape_ = shape;
47
+
48
+ /**
49
+ * Method to call on resize of bubble.
50
+ * @type {?function()}
51
+ * @private
52
+ */
53
+ this.resizeCallback_ = null;
54
+
55
+ /**
56
+ * Method to call on move of bubble.
57
+ * @type {?function()}
58
+ * @private
59
+ */
60
+ this.moveCallback_ = null;
61
+
62
+ /**
63
+ * Mouse down on bubbleBack_ event data.
64
+ * @type {?Blockly.EventData}
65
+ * @private
66
+ */
67
+ this.onMouseDownBubbleWrapper_ = null;
68
+
69
+ /**
70
+ * Mouse down on resizeGroup_ event data.
71
+ * @type {?Blockly.EventData}
72
+ * @private
73
+ */
74
+ this.onMouseDownResizeWrapper_ = null;
75
+
76
+ /**
77
+ * Describes whether this bubble has been disposed of (nodes and event
78
+ * listeners removed from the page) or not.
79
+ * @type {boolean}
80
+ * @package
81
+ */
82
+ this.disposed = false;
83
+
84
+ var angle = Blockly.Bubble.ARROW_ANGLE;
85
+ if (this.workspace_.RTL) {
86
+ angle = -angle;
87
+ }
88
+ this.arrow_radians_ = Blockly.utils.math.toRadians(angle);
89
+
90
+ var canvas = workspace.getBubbleCanvas();
91
+ canvas.appendChild(this.createDom_(content, !!(bubbleWidth && bubbleHeight)));
92
+
93
+ this.setAnchorLocation(anchorXY);
94
+ if (!bubbleWidth || !bubbleHeight) {
95
+ var bBox = /** @type {SVGLocatable} */ (this.content_).getBBox();
96
+ bubbleWidth = bBox.width + 2 * Blockly.Bubble.BORDER_WIDTH;
97
+ bubbleHeight = bBox.height + 2 * Blockly.Bubble.BORDER_WIDTH;
98
+ }
99
+ this.setBubbleSize(bubbleWidth, bubbleHeight);
100
+
101
+ // Render the bubble.
102
+ this.positionBubble_();
103
+ this.renderArrow_();
104
+ this.rendered_ = true;
105
+ };
106
+
107
+ /**
108
+ * Width of the border around the bubble.
109
+ */
110
+ Blockly.Bubble.BORDER_WIDTH = 6;
111
+
112
+ /**
113
+ * Determines the thickness of the base of the arrow in relation to the size
114
+ * of the bubble. Higher numbers result in thinner arrows.
115
+ */
116
+ Blockly.Bubble.ARROW_THICKNESS = 5;
117
+
118
+ /**
119
+ * The number of degrees that the arrow bends counter-clockwise.
120
+ */
121
+ Blockly.Bubble.ARROW_ANGLE = 20;
122
+
123
+ /**
124
+ * The sharpness of the arrow's bend. Higher numbers result in smoother arrows.
125
+ */
126
+ Blockly.Bubble.ARROW_BEND = 4;
127
+
128
+ /**
129
+ * Distance between arrow point and anchor point.
130
+ */
131
+ Blockly.Bubble.ANCHOR_RADIUS = 8;
132
+
133
+ /**
134
+ * Mouse up event data.
135
+ * @type {?Blockly.EventData}
136
+ * @private
137
+ */
138
+ Blockly.Bubble.onMouseUpWrapper_ = null;
139
+
140
+ /**
141
+ * Mouse move event data.
142
+ * @type {?Blockly.EventData}
143
+ * @private
144
+ */
145
+ Blockly.Bubble.onMouseMoveWrapper_ = null;
146
+
147
+ /**
148
+ * Stop binding to the global mouseup and mousemove events.
149
+ * @private
150
+ */
151
+ Blockly.Bubble.unbindDragEvents_ = function() {
152
+ if (Blockly.Bubble.onMouseUpWrapper_) {
153
+ Blockly.unbindEvent_(Blockly.Bubble.onMouseUpWrapper_);
154
+ Blockly.Bubble.onMouseUpWrapper_ = null;
155
+ }
156
+ if (Blockly.Bubble.onMouseMoveWrapper_) {
157
+ Blockly.unbindEvent_(Blockly.Bubble.onMouseMoveWrapper_);
158
+ Blockly.Bubble.onMouseMoveWrapper_ = null;
159
+ }
160
+ };
161
+
162
+ /**
163
+ * Handle a mouse-up event while dragging a bubble's border or resize handle.
164
+ * @param {!Event} _e Mouse up event.
165
+ * @private
166
+ */
167
+ Blockly.Bubble.bubbleMouseUp_ = function(_e) {
168
+ Blockly.Touch.clearTouchIdentifier();
169
+ Blockly.Bubble.unbindDragEvents_();
170
+ };
171
+
172
+ /**
173
+ * Flag to stop incremental rendering during construction.
174
+ * @private
175
+ */
176
+ Blockly.Bubble.prototype.rendered_ = false;
177
+
178
+ /**
179
+ * Absolute coordinate of anchor point, in workspace coordinates.
180
+ * @type {Blockly.utils.Coordinate}
181
+ * @private
182
+ */
183
+ Blockly.Bubble.prototype.anchorXY_ = null;
184
+
185
+ /**
186
+ * Relative X coordinate of bubble with respect to the anchor's centre,
187
+ * in workspace units.
188
+ * In RTL mode the initial value is negated.
189
+ * @private
190
+ */
191
+ Blockly.Bubble.prototype.relativeLeft_ = 0;
192
+
193
+ /**
194
+ * Relative Y coordinate of bubble with respect to the anchor's centre, in
195
+ * workspace units.
196
+ * @private
197
+ */
198
+ Blockly.Bubble.prototype.relativeTop_ = 0;
199
+
200
+ /**
201
+ * Width of bubble, in workspace units.
202
+ * @private
203
+ */
204
+ Blockly.Bubble.prototype.width_ = 0;
205
+
206
+ /**
207
+ * Height of bubble, in workspace units.
208
+ * @private
209
+ */
210
+ Blockly.Bubble.prototype.height_ = 0;
211
+
212
+ /**
213
+ * Automatically position and reposition the bubble.
214
+ * @private
215
+ */
216
+ Blockly.Bubble.prototype.autoLayout_ = true;
217
+
218
+ /**
219
+ * Create the bubble's DOM.
220
+ * @param {!Element} content SVG content for the bubble.
221
+ * @param {boolean} hasResize Add diagonal resize gripper if true.
222
+ * @return {!SVGElement} The bubble's SVG group.
223
+ * @private
224
+ */
225
+ Blockly.Bubble.prototype.createDom_ = function(content, hasResize) {
226
+ /* Create the bubble. Here's the markup that will be generated:
227
+ <g>
228
+ <g filter="url(#blocklyEmbossFilter837493)">
229
+ <path d="... Z" />
230
+ <rect class="blocklyDraggable" rx="8" ry="8" width="180" height="180"/>
231
+ </g>
232
+ <g transform="translate(165, 165)" class="blocklyResizeSE">
233
+ <polygon points="0,15 15,15 15,0"/>
234
+ <line class="blocklyResizeLine" x1="5" y1="14" x2="14" y2="5"/>
235
+ <line class="blocklyResizeLine" x1="10" y1="14" x2="14" y2="10"/>
236
+ </g>
237
+ [...content goes here...]
238
+ </g>
239
+ */
240
+ this.bubbleGroup_ = Blockly.utils.dom.createSvgElement(
241
+ Blockly.utils.Svg.G, {}, null);
242
+ var filter = {
243
+ 'filter': 'url(#' +
244
+ this.workspace_.getRenderer().getConstants().embossFilterId + ')'
245
+ };
246
+ if (Blockly.utils.userAgent.JAVA_FX) {
247
+ // Multiple reports that JavaFX can't handle filters.
248
+ // https://github.com/google/blockly/issues/99
249
+ filter = {};
250
+ }
251
+ var bubbleEmboss = Blockly.utils.dom.createSvgElement(
252
+ Blockly.utils.Svg.G, filter, this.bubbleGroup_);
253
+ this.bubbleArrow_ = Blockly.utils.dom.createSvgElement(
254
+ Blockly.utils.Svg.PATH, {}, bubbleEmboss);
255
+ this.bubbleBack_ = Blockly.utils.dom.createSvgElement(
256
+ Blockly.utils.Svg.RECT, {
257
+ 'class': 'blocklyDraggable',
258
+ 'x': 0,
259
+ 'y': 0,
260
+ 'rx': Blockly.Bubble.BORDER_WIDTH,
261
+ 'ry': Blockly.Bubble.BORDER_WIDTH
262
+ },
263
+ bubbleEmboss);
264
+ if (hasResize) {
265
+ this.resizeGroup_ = Blockly.utils.dom.createSvgElement(
266
+ Blockly.utils.Svg.G,
267
+ {'class': this.workspace_.RTL ? 'blocklyResizeSW' : 'blocklyResizeSE'},
268
+ this.bubbleGroup_);
269
+ var resizeSize = 2 * Blockly.Bubble.BORDER_WIDTH;
270
+ Blockly.utils.dom.createSvgElement(
271
+ Blockly.utils.Svg.POLYGON,
272
+ {'points': '0,x x,x x,0'.replace(/x/g, resizeSize.toString())},
273
+ this.resizeGroup_);
274
+ Blockly.utils.dom.createSvgElement(
275
+ Blockly.utils.Svg.LINE, {
276
+ 'class': 'blocklyResizeLine',
277
+ 'x1': resizeSize / 3,
278
+ 'y1': resizeSize - 1,
279
+ 'x2': resizeSize - 1,
280
+ 'y2': resizeSize / 3
281
+ },
282
+ this.resizeGroup_);
283
+ Blockly.utils.dom.createSvgElement(
284
+ Blockly.utils.Svg.LINE, {
285
+ 'class': 'blocklyResizeLine',
286
+ 'x1': resizeSize * 2 / 3,
287
+ 'y1': resizeSize - 1,
288
+ 'x2': resizeSize - 1,
289
+ 'y2': resizeSize * 2 / 3
290
+ },
291
+ this.resizeGroup_);
292
+ } else {
293
+ this.resizeGroup_ = null;
294
+ }
295
+
296
+ if (!this.workspace_.options.readOnly) {
297
+ this.onMouseDownBubbleWrapper_ = Blockly.bindEventWithChecks_(
298
+ this.bubbleBack_, 'mousedown', this, this.bubbleMouseDown_);
299
+ if (this.resizeGroup_) {
300
+ this.onMouseDownResizeWrapper_ = Blockly.bindEventWithChecks_(
301
+ this.resizeGroup_, 'mousedown', this, this.resizeMouseDown_);
302
+ }
303
+ }
304
+ this.bubbleGroup_.appendChild(content);
305
+ return this.bubbleGroup_;
306
+ };
307
+
308
+ /**
309
+ * Return the root node of the bubble's SVG group.
310
+ * @return {!SVGElement} The root SVG node of the bubble's group.
311
+ */
312
+ Blockly.Bubble.prototype.getSvgRoot = function() {
313
+ return this.bubbleGroup_;
314
+ };
315
+
316
+ /**
317
+ * Expose the block's ID on the bubble's top-level SVG group.
318
+ * @param {string} id ID of block.
319
+ */
320
+ Blockly.Bubble.prototype.setSvgId = function(id) {
321
+ if (this.bubbleGroup_.dataset) {
322
+ this.bubbleGroup_.dataset['blockId'] = id;
323
+ }
324
+ };
325
+
326
+ /**
327
+ * Handle a mouse-down on bubble's border.
328
+ * @param {!Event} e Mouse down event.
329
+ * @private
330
+ */
331
+ Blockly.Bubble.prototype.bubbleMouseDown_ = function(e) {
332
+ var gesture = this.workspace_.getGesture(e);
333
+ if (gesture) {
334
+ gesture.handleBubbleStart(e, this);
335
+ }
336
+ };
337
+
338
+ /**
339
+ * Show the context menu for this bubble.
340
+ * @param {!Event} _e Mouse event.
341
+ * @package
342
+ */
343
+ Blockly.Bubble.prototype.showContextMenu = function(_e) {
344
+ // NOP on bubbles, but used by the bubble dragger to pass events to
345
+ // workspace comments.
346
+ };
347
+
348
+ /**
349
+ * Get whether this bubble is deletable or not.
350
+ * @return {boolean} True if deletable.
351
+ * @package
352
+ */
353
+ Blockly.Bubble.prototype.isDeletable = function() {
354
+ return false;
355
+ };
356
+
357
+ /**
358
+ * Update the style of this bubble when it is dragged over a delete area.
359
+ * @param {boolean} _enable True if the bubble is about to be deleted, false
360
+ * otherwise.
361
+ */
362
+ Blockly.Bubble.prototype.setDeleteStyle = function(_enable) {
363
+ // NOP if bubble is not deletable.
364
+ };
365
+
366
+ /**
367
+ * Handle a mouse-down on bubble's resize corner.
368
+ * @param {!Event} e Mouse down event.
369
+ * @private
370
+ */
371
+ Blockly.Bubble.prototype.resizeMouseDown_ = function(e) {
372
+ this.promote();
373
+ Blockly.Bubble.unbindDragEvents_();
374
+ if (Blockly.utils.isRightButton(e)) {
375
+ // No right-click.
376
+ e.stopPropagation();
377
+ return;
378
+ }
379
+ // Left-click (or middle click)
380
+ this.workspace_.startDrag(
381
+ e,
382
+ new Blockly.utils.Coordinate(
383
+ this.workspace_.RTL ? -this.width_ : this.width_, this.height_));
384
+
385
+ Blockly.Bubble.onMouseUpWrapper_ = Blockly.bindEventWithChecks_(
386
+ document, 'mouseup', this, Blockly.Bubble.bubbleMouseUp_);
387
+ Blockly.Bubble.onMouseMoveWrapper_ = Blockly.bindEventWithChecks_(
388
+ document, 'mousemove', this, this.resizeMouseMove_);
389
+ Blockly.hideChaff();
390
+ // This event has been handled. No need to bubble up to the document.
391
+ e.stopPropagation();
392
+ };
393
+
394
+ /**
395
+ * Resize this bubble to follow the mouse.
396
+ * @param {!Event} e Mouse move event.
397
+ * @private
398
+ */
399
+ Blockly.Bubble.prototype.resizeMouseMove_ = function(e) {
400
+ this.autoLayout_ = false;
401
+ var newXY = this.workspace_.moveDrag(e);
402
+ this.setBubbleSize(this.workspace_.RTL ? -newXY.x : newXY.x, newXY.y);
403
+ if (this.workspace_.RTL) {
404
+ // RTL requires the bubble to move its left edge.
405
+ this.positionBubble_();
406
+ }
407
+ };
408
+
409
+ /**
410
+ * Register a function as a callback event for when the bubble is resized.
411
+ * @param {!Function} callback The function to call on resize.
412
+ */
413
+ Blockly.Bubble.prototype.registerResizeEvent = function(callback) {
414
+ this.resizeCallback_ = callback;
415
+ };
416
+
417
+ /**
418
+ * Register a function as a callback event for when the bubble is moved.
419
+ * @param {!Function} callback The function to call on move.
420
+ */
421
+ Blockly.Bubble.prototype.registerMoveEvent = function(callback) {
422
+ this.moveCallback_ = callback;
423
+ };
424
+
425
+ /**
426
+ * Move this bubble to the top of the stack.
427
+ * @return {boolean} Whether or not the bubble has been moved.
428
+ * @package
429
+ */
430
+ Blockly.Bubble.prototype.promote = function() {
431
+ var svgGroup = this.bubbleGroup_.parentNode;
432
+ if (svgGroup.lastChild !== this.bubbleGroup_) {
433
+ svgGroup.appendChild(this.bubbleGroup_);
434
+ return true;
435
+ }
436
+ return false;
437
+ };
438
+
439
+ /**
440
+ * Notification that the anchor has moved.
441
+ * Update the arrow and bubble accordingly.
442
+ * @param {!Blockly.utils.Coordinate} xy Absolute location.
443
+ */
444
+ Blockly.Bubble.prototype.setAnchorLocation = function(xy) {
445
+ this.anchorXY_ = xy;
446
+ if (this.rendered_) {
447
+ this.positionBubble_();
448
+ }
449
+ };
450
+
451
+ /**
452
+ * Position the bubble so that it does not fall off-screen.
453
+ * @private
454
+ */
455
+ Blockly.Bubble.prototype.layoutBubble_ = function() {
456
+ // Get the metrics in workspace units.
457
+ var metrics = this.workspace_.getMetrics();
458
+ metrics.viewLeft /= this.workspace_.scale;
459
+ metrics.viewWidth /= this.workspace_.scale;
460
+ metrics.viewTop /= this.workspace_.scale;
461
+ metrics.viewHeight /= this.workspace_.scale;
462
+
463
+ var optimalLeft = this.getOptimalRelativeLeft_(metrics);
464
+ var optimalTop = this.getOptimalRelativeTop_(metrics);
465
+ var bbox = this.shape_.getBBox();
466
+
467
+ var topPosition = {
468
+ x: optimalLeft,
469
+ y: -this.height_ -
470
+ this.workspace_.getRenderer().getConstants().MIN_BLOCK_HEIGHT
471
+ };
472
+ var startPosition = {x: -this.width_ - 30, y: optimalTop};
473
+ var endPosition = {x: bbox.width, y: optimalTop};
474
+ var bottomPosition = {x: optimalLeft, y: bbox.height};
475
+
476
+ var closerPosition = bbox.width < bbox.height ? endPosition : bottomPosition;
477
+ var fartherPosition = bbox.width < bbox.height ? bottomPosition : endPosition;
478
+
479
+ var topPositionOverlap = this.getOverlap_(topPosition, metrics);
480
+ var startPositionOverlap = this.getOverlap_(startPosition, metrics);
481
+ var closerPositionOverlap = this.getOverlap_(closerPosition, metrics);
482
+ var fartherPositionOverlap = this.getOverlap_(fartherPosition, metrics);
483
+
484
+ // Set the position to whichever position shows the most of the bubble,
485
+ // with tiebreaks going in the order: top > start > close > far.
486
+ var mostOverlap = Math.max(
487
+ topPositionOverlap, startPositionOverlap, closerPositionOverlap,
488
+ fartherPositionOverlap);
489
+ if (topPositionOverlap == mostOverlap) {
490
+ this.relativeLeft_ = topPosition.x;
491
+ this.relativeTop_ = topPosition.y;
492
+ return;
493
+ }
494
+ if (startPositionOverlap == mostOverlap) {
495
+ this.relativeLeft_ = startPosition.x;
496
+ this.relativeTop_ = startPosition.y;
497
+ return;
498
+ }
499
+ if (closerPositionOverlap == mostOverlap) {
500
+ this.relativeLeft_ = closerPosition.x;
501
+ this.relativeTop_ = closerPosition.y;
502
+ return;
503
+ }
504
+ // TODO: I believe relativeLeft_ should actually be called relativeStart_
505
+ // and then the math should be fixed to reflect this. (hopefully it'll
506
+ // make it look simpler)
507
+ this.relativeLeft_ = fartherPosition.x;
508
+ this.relativeTop_ = fartherPosition.y;
509
+ };
510
+
511
+ /**
512
+ * Calculate the what percentage of the bubble overlaps with the visible
513
+ * workspace (what percentage of the bubble is visible).
514
+ * @param {!{x: number, y: number}} relativeMin The position of the top-left
515
+ * corner of the bubble relative to the anchor point.
516
+ * @param {!Blockly.utils.Metrics} metrics The metrics of the workspace the
517
+ * bubble will appear in.
518
+ * @return {number} The percentage of the bubble that is visible.
519
+ * @private
520
+ */
521
+ Blockly.Bubble.prototype.getOverlap_ = function(relativeMin, metrics) {
522
+ // The position of the top-left corner of the bubble in workspace units.
523
+ var bubbleMin = {
524
+ x: this.workspace_.RTL ? (this.anchorXY_.x - relativeMin.x - this.width_) :
525
+ (relativeMin.x + this.anchorXY_.x),
526
+ y: relativeMin.y + this.anchorXY_.y
527
+ };
528
+ // The position of the bottom-right corner of the bubble in workspace units.
529
+ var bubbleMax = {x: bubbleMin.x + this.width_, y: bubbleMin.y + this.height_};
530
+
531
+ // We could adjust these values to account for the scrollbars, but the
532
+ // bubbles should have been adjusted to not collide with them anyway, so
533
+ // giving the workspace a slightly larger "bounding box" shouldn't affect the
534
+ // calculation.
535
+
536
+ // The position of the top-left corner of the workspace.
537
+ var workspaceMin = {x: metrics.viewLeft, y: metrics.viewTop};
538
+ // The position of the bottom-right corner of the workspace.
539
+ var workspaceMax = {
540
+ x: metrics.viewLeft + metrics.viewWidth,
541
+ y: metrics.viewTop + metrics.viewHeight
542
+ };
543
+
544
+ var overlapWidth = Math.min(bubbleMax.x, workspaceMax.x) -
545
+ Math.max(bubbleMin.x, workspaceMin.x);
546
+ var overlapHeight = Math.min(bubbleMax.y, workspaceMax.y) -
547
+ Math.max(bubbleMin.y, workspaceMin.y);
548
+ return Math.max(
549
+ 0,
550
+ Math.min(
551
+ 1, (overlapWidth * overlapHeight) / (this.width_ * this.height_)));
552
+ };
553
+
554
+ /**
555
+ * Calculate what the optimal horizontal position of the top-left corner of the
556
+ * bubble is (relative to the anchor point) so that the most area of the
557
+ * bubble is shown.
558
+ * @param {!Blockly.utils.Metrics} metrics The metrics of the workspace the
559
+ * bubble will appear in.
560
+ * @return {number} The optimal horizontal position of the top-left corner
561
+ * of the bubble.
562
+ * @private
563
+ */
564
+ Blockly.Bubble.prototype.getOptimalRelativeLeft_ = function(metrics) {
565
+ var relativeLeft = -this.width_ / 4;
566
+
567
+ // No amount of sliding left or right will give us a better overlap.
568
+ if (this.width_ > metrics.viewWidth) {
569
+ return relativeLeft;
570
+ }
571
+
572
+ if (this.workspace_.RTL) {
573
+ // Bubble coordinates are flipped in RTL.
574
+ var bubbleRight = this.anchorXY_.x - relativeLeft;
575
+ var bubbleLeft = bubbleRight - this.width_;
576
+
577
+ var workspaceRight = metrics.viewLeft + metrics.viewWidth;
578
+ var workspaceLeft = metrics.viewLeft +
579
+ // Thickness in workspace units.
580
+ (Blockly.Scrollbar.scrollbarThickness / this.workspace_.scale);
581
+ } else {
582
+ var bubbleLeft = relativeLeft + this.anchorXY_.x;
583
+ var bubbleRight = bubbleLeft + this.width_;
584
+
585
+ var workspaceLeft = metrics.viewLeft;
586
+ var workspaceRight = metrics.viewLeft + metrics.viewWidth -
587
+ // Thickness in workspace units.
588
+ (Blockly.Scrollbar.scrollbarThickness / this.workspace_.scale);
589
+ }
590
+
591
+ if (this.workspace_.RTL) {
592
+ if (bubbleLeft < workspaceLeft) {
593
+ // Slide the bubble right until it is onscreen.
594
+ relativeLeft = -(workspaceLeft - this.anchorXY_.x + this.width_);
595
+ } else if (bubbleRight > workspaceRight) {
596
+ // Slide the bubble left until it is onscreen.
597
+ relativeLeft = -(workspaceRight - this.anchorXY_.x);
598
+ }
599
+ } else {
600
+ if (bubbleLeft < workspaceLeft) {
601
+ // Slide the bubble right until it is onscreen.
602
+ relativeLeft = workspaceLeft - this.anchorXY_.x;
603
+ } else if (bubbleRight > workspaceRight) {
604
+ // Slide the bubble left until it is onscreen.
605
+ relativeLeft = workspaceRight - this.anchorXY_.x - this.width_;
606
+ }
607
+ }
608
+
609
+ return relativeLeft;
610
+ };
611
+
612
+ /**
613
+ * Calculate what the optimal vertical position of the top-left corner of
614
+ * the bubble is (relative to the anchor point) so that the most area of the
615
+ * bubble is shown.
616
+ * @param {!Blockly.utils.Metrics} metrics The metrics of the workspace the
617
+ * bubble will appear in.
618
+ * @return {number} The optimal vertical position of the top-left corner
619
+ * of the bubble.
620
+ * @private
621
+ */
622
+ Blockly.Bubble.prototype.getOptimalRelativeTop_ = function(metrics) {
623
+ var relativeTop = -this.height_ / 4;
624
+
625
+ // No amount of sliding up or down will give us a better overlap.
626
+ if (this.height_ > metrics.viewHeight) {
627
+ return relativeTop;
628
+ }
629
+
630
+ var bubbleTop = this.anchorXY_.y + relativeTop;
631
+ var bubbleBottom = bubbleTop + this.height_;
632
+ var workspaceTop = metrics.viewTop;
633
+ var workspaceBottom = metrics.viewTop + metrics.viewHeight -
634
+ // Thickness in workspace units.
635
+ (Blockly.Scrollbar.scrollbarThickness / this.workspace_.scale);
636
+
637
+ var anchorY = this.anchorXY_.y;
638
+ if (bubbleTop < workspaceTop) {
639
+ // Slide the bubble down until it is onscreen.
640
+ relativeTop = workspaceTop - anchorY;
641
+ } else if (bubbleBottom > workspaceBottom) {
642
+ // Slide the bubble up until it is onscreen.
643
+ relativeTop = workspaceBottom - anchorY - this.height_;
644
+ }
645
+
646
+ return relativeTop;
647
+ };
648
+
649
+ /**
650
+ * Move the bubble to a location relative to the anchor's centre.
651
+ * @private
652
+ */
653
+ Blockly.Bubble.prototype.positionBubble_ = function() {
654
+ var left = this.anchorXY_.x;
655
+ if (this.workspace_.RTL) {
656
+ left -= this.relativeLeft_ + this.width_;
657
+ } else {
658
+ left += this.relativeLeft_;
659
+ }
660
+ var top = this.relativeTop_ + this.anchorXY_.y;
661
+ this.moveTo(left, top);
662
+ };
663
+
664
+ /**
665
+ * Move the bubble group to the specified location in workspace coordinates.
666
+ * @param {number} x The x position to move to.
667
+ * @param {number} y The y position to move to.
668
+ * @package
669
+ */
670
+ Blockly.Bubble.prototype.moveTo = function(x, y) {
671
+ this.bubbleGroup_.setAttribute('transform', 'translate(' + x + ',' + y + ')');
672
+ };
673
+
674
+ /**
675
+ * Triggers a move callback if one exists at the end of a drag.
676
+ * @param {boolean} adding True if adding, false if removing.
677
+ * @package
678
+ */
679
+ Blockly.Bubble.prototype.setDragging = function(adding) {
680
+ if (!adding && this.moveCallback_) {
681
+ this.moveCallback_();
682
+ }
683
+ };
684
+
685
+ /**
686
+ * Get the dimensions of this bubble.
687
+ * @return {!Blockly.utils.Size} The height and width of the bubble.
688
+ */
689
+ Blockly.Bubble.prototype.getBubbleSize = function() {
690
+ return new Blockly.utils.Size(this.width_, this.height_);
691
+ };
692
+
693
+ /**
694
+ * Size this bubble.
695
+ * @param {number} width Width of the bubble.
696
+ * @param {number} height Height of the bubble.
697
+ */
698
+ Blockly.Bubble.prototype.setBubbleSize = function(width, height) {
699
+ var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH;
700
+ // Minimum size of a bubble.
701
+ width = Math.max(width, doubleBorderWidth + 45);
702
+ height = Math.max(height, doubleBorderWidth + 20);
703
+ this.width_ = width;
704
+ this.height_ = height;
705
+ this.bubbleBack_.setAttribute('width', width);
706
+ this.bubbleBack_.setAttribute('height', height);
707
+ if (this.resizeGroup_) {
708
+ if (this.workspace_.RTL) {
709
+ // Mirror the resize group.
710
+ var resizeSize = 2 * Blockly.Bubble.BORDER_WIDTH;
711
+ this.resizeGroup_.setAttribute(
712
+ 'transform',
713
+ 'translate(' + resizeSize + ',' + (height - doubleBorderWidth) +
714
+ ') scale(-1 1)');
715
+ } else {
716
+ this.resizeGroup_.setAttribute(
717
+ 'transform',
718
+ 'translate(' + (width - doubleBorderWidth) + ',' +
719
+ (height - doubleBorderWidth) + ')');
720
+ }
721
+ }
722
+ if (this.autoLayout_) {
723
+ this.layoutBubble_();
724
+ }
725
+ this.positionBubble_();
726
+ this.renderArrow_();
727
+
728
+ // Allow the contents to resize.
729
+ if (this.resizeCallback_) {
730
+ this.resizeCallback_();
731
+ }
732
+ };
733
+
734
+ /**
735
+ * Draw the arrow between the bubble and the origin.
736
+ * @private
737
+ */
738
+ Blockly.Bubble.prototype.renderArrow_ = function() {
739
+ var steps = [];
740
+ // Find the relative coordinates of the center of the bubble.
741
+ var relBubbleX = this.width_ / 2;
742
+ var relBubbleY = this.height_ / 2;
743
+ // Find the relative coordinates of the center of the anchor.
744
+ var relAnchorX = -this.relativeLeft_;
745
+ var relAnchorY = -this.relativeTop_;
746
+ if (relBubbleX == relAnchorX && relBubbleY == relAnchorY) {
747
+ // Null case. Bubble is directly on top of the anchor.
748
+ // Short circuit this rather than wade through divide by zeros.
749
+ steps.push('M ' + relBubbleX + ',' + relBubbleY);
750
+ } else {
751
+ // Compute the angle of the arrow's line.
752
+ var rise = relAnchorY - relBubbleY;
753
+ var run = relAnchorX - relBubbleX;
754
+ if (this.workspace_.RTL) {
755
+ run *= -1;
756
+ }
757
+ var hypotenuse = Math.sqrt(rise * rise + run * run);
758
+ var angle = Math.acos(run / hypotenuse);
759
+ if (rise < 0) {
760
+ angle = 2 * Math.PI - angle;
761
+ }
762
+ // Compute a line perpendicular to the arrow.
763
+ var rightAngle = angle + Math.PI / 2;
764
+ if (rightAngle > Math.PI * 2) {
765
+ rightAngle -= Math.PI * 2;
766
+ }
767
+ var rightRise = Math.sin(rightAngle);
768
+ var rightRun = Math.cos(rightAngle);
769
+
770
+ // Calculate the thickness of the base of the arrow.
771
+ var bubbleSize = this.getBubbleSize();
772
+ var thickness =
773
+ (bubbleSize.width + bubbleSize.height) / Blockly.Bubble.ARROW_THICKNESS;
774
+ thickness = Math.min(thickness, bubbleSize.width, bubbleSize.height) / 4;
775
+
776
+ // Back the tip of the arrow off of the anchor.
777
+ var backoffRatio = 1 - Blockly.Bubble.ANCHOR_RADIUS / hypotenuse;
778
+ relAnchorX = relBubbleX + backoffRatio * run;
779
+ relAnchorY = relBubbleY + backoffRatio * rise;
780
+
781
+ // Coordinates for the base of the arrow.
782
+ var baseX1 = relBubbleX + thickness * rightRun;
783
+ var baseY1 = relBubbleY + thickness * rightRise;
784
+ var baseX2 = relBubbleX - thickness * rightRun;
785
+ var baseY2 = relBubbleY - thickness * rightRise;
786
+
787
+ // Distortion to curve the arrow.
788
+ var swirlAngle = angle + this.arrow_radians_;
789
+ if (swirlAngle > Math.PI * 2) {
790
+ swirlAngle -= Math.PI * 2;
791
+ }
792
+ var swirlRise =
793
+ Math.sin(swirlAngle) * hypotenuse / Blockly.Bubble.ARROW_BEND;
794
+ var swirlRun =
795
+ Math.cos(swirlAngle) * hypotenuse / Blockly.Bubble.ARROW_BEND;
796
+
797
+ steps.push('M' + baseX1 + ',' + baseY1);
798
+ steps.push(
799
+ 'C' + (baseX1 + swirlRun) + ',' + (baseY1 + swirlRise) + ' ' +
800
+ relAnchorX + ',' + relAnchorY + ' ' + relAnchorX + ',' + relAnchorY);
801
+ steps.push(
802
+ 'C' + relAnchorX + ',' + relAnchorY + ' ' + (baseX2 + swirlRun) + ',' +
803
+ (baseY2 + swirlRise) + ' ' + baseX2 + ',' + baseY2);
804
+ }
805
+ steps.push('z');
806
+ this.bubbleArrow_.setAttribute('d', steps.join(' '));
807
+ };
808
+
809
+ /**
810
+ * Change the colour of a bubble.
811
+ * @param {string} hexColour Hex code of colour.
812
+ */
813
+ Blockly.Bubble.prototype.setColour = function(hexColour) {
814
+ this.bubbleBack_.setAttribute('fill', hexColour);
815
+ this.bubbleArrow_.setAttribute('fill', hexColour);
816
+ };
817
+
818
+ /**
819
+ * Dispose of this bubble.
820
+ */
821
+ Blockly.Bubble.prototype.dispose = function() {
822
+ if (this.onMouseDownBubbleWrapper_) {
823
+ Blockly.unbindEvent_(this.onMouseDownBubbleWrapper_);
824
+ }
825
+ if (this.onMouseDownResizeWrapper_) {
826
+ Blockly.unbindEvent_(this.onMouseDownResizeWrapper_);
827
+ }
828
+ Blockly.Bubble.unbindDragEvents_();
829
+ Blockly.utils.dom.removeNode(this.bubbleGroup_);
830
+ this.disposed = true;
831
+ };
832
+
833
+ /**
834
+ * Move this bubble during a drag, taking into account whether or not there is
835
+ * a drag surface.
836
+ * @param {Blockly.BlockDragSurfaceSvg} dragSurface The surface that carries
837
+ * rendered items during a drag, or null if no drag surface is in use.
838
+ * @param {!Blockly.utils.Coordinate} newLoc The location to translate to, in
839
+ * workspace coordinates.
840
+ * @package
841
+ */
842
+ Blockly.Bubble.prototype.moveDuringDrag = function(dragSurface, newLoc) {
843
+ if (dragSurface) {
844
+ dragSurface.translateSurface(newLoc.x, newLoc.y);
845
+ } else {
846
+ this.moveTo(newLoc.x, newLoc.y);
847
+ }
848
+ if (this.workspace_.RTL) {
849
+ this.relativeLeft_ = this.anchorXY_.x - newLoc.x - this.width_;
850
+ } else {
851
+ this.relativeLeft_ = newLoc.x - this.anchorXY_.x;
852
+ }
853
+ this.relativeTop_ = newLoc.y - this.anchorXY_.y;
854
+ this.renderArrow_();
855
+ };
856
+
857
+ /**
858
+ * Return the coordinates of the top-left corner of this bubble's body relative
859
+ * to the drawing surface's origin (0,0), in workspace units.
860
+ * @return {!Blockly.utils.Coordinate} Object with .x and .y properties.
861
+ */
862
+ Blockly.Bubble.prototype.getRelativeToSurfaceXY = function() {
863
+ return new Blockly.utils.Coordinate(
864
+ this.workspace_.RTL ?
865
+ -this.relativeLeft_ + this.anchorXY_.x - this.width_ :
866
+ this.anchorXY_.x + this.relativeLeft_,
867
+ this.anchorXY_.y + this.relativeTop_);
868
+ };
869
+
870
+ /**
871
+ * Set whether auto-layout of this bubble is enabled. The first time a bubble
872
+ * is shown it positions itself to not cover any blocks. Once a user has
873
+ * dragged it to reposition, it renders where the user put it.
874
+ * @param {boolean} enable True if auto-layout should be enabled, false
875
+ * otherwise.
876
+ * @package
877
+ */
878
+ Blockly.Bubble.prototype.setAutoLayout = function(enable) {
879
+ this.autoLayout_ = enable;
880
+ };