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,661 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2011 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Object representing a trash can icon.
9
+ * @author fraser@google.com (Neil Fraser)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.Trashcan');
14
+
15
+ goog.require('Blockly.Scrollbar');
16
+ goog.require('Blockly.utils.dom');
17
+ goog.require('Blockly.utils.Rect');
18
+ goog.require('Blockly.utils.Svg');
19
+ goog.require('Blockly.utils.toolbox');
20
+ goog.require('Blockly.Xml');
21
+
22
+ goog.requireType('Blockly.IDeleteArea');
23
+ goog.requireType('Blockly.IFlyout');
24
+
25
+
26
+ /**
27
+ * Class for a trash can.
28
+ * @param {!Blockly.WorkspaceSvg} workspace The workspace to sit in.
29
+ * @constructor
30
+ * @implements {Blockly.IDeleteArea}
31
+ */
32
+ Blockly.Trashcan = function(workspace) {
33
+ /**
34
+ * The workspace the trashcan sits in.
35
+ * @type {!Blockly.WorkspaceSvg}
36
+ * @private
37
+ */
38
+ this.workspace_ = workspace;
39
+
40
+ /**
41
+ * A list of XML (stored as strings) representing blocks in the trashcan.
42
+ * @type {!Array.<string>}
43
+ * @private
44
+ */
45
+ this.contents_ = [];
46
+
47
+ /**
48
+ * The trashcan flyout.
49
+ * @type {Blockly.IFlyout}
50
+ * @package
51
+ */
52
+ this.flyout = null;
53
+
54
+ if (this.workspace_.options.maxTrashcanContents <= 0) {
55
+ return;
56
+ }
57
+ // Create flyout options.
58
+ var flyoutWorkspaceOptions = new Blockly.Options(
59
+ /** @type {!Blockly.BlocklyOptions} */
60
+ ({
61
+ 'scrollbars': true,
62
+ 'parentWorkspace': this.workspace_,
63
+ 'rtl': this.workspace_.RTL,
64
+ 'oneBasedIndex': this.workspace_.options.oneBasedIndex,
65
+ 'renderer': this.workspace_.options.renderer,
66
+ 'rendererOverrides': this.workspace_.options.rendererOverrides
67
+ }));
68
+ // Create vertical or horizontal flyout.
69
+ if (this.workspace_.horizontalLayout) {
70
+ flyoutWorkspaceOptions.toolboxPosition =
71
+ this.workspace_.toolboxPosition == Blockly.utils.toolbox.Position.TOP ?
72
+ Blockly.utils.toolbox.Position.BOTTOM : Blockly.utils.toolbox.Position.TOP;
73
+ if (!Blockly.HorizontalFlyout) {
74
+ throw Error('Missing require for Blockly.HorizontalFlyout');
75
+ }
76
+ this.flyout = new Blockly.HorizontalFlyout(flyoutWorkspaceOptions);
77
+ } else {
78
+ flyoutWorkspaceOptions.toolboxPosition =
79
+ this.workspace_.toolboxPosition == Blockly.utils.toolbox.Position.RIGHT ?
80
+ Blockly.utils.toolbox.Position.LEFT : Blockly.utils.toolbox.Position.RIGHT;
81
+ if (!Blockly.VerticalFlyout) {
82
+ throw Error('Missing require for Blockly.VerticalFlyout');
83
+ }
84
+ this.flyout = new Blockly.VerticalFlyout(flyoutWorkspaceOptions);
85
+ }
86
+ this.workspace_.addChangeListener(this.onDelete_.bind(this));
87
+ };
88
+
89
+ /**
90
+ * Width of both the trash can and lid images.
91
+ * @const {number}
92
+ * @private
93
+ */
94
+ Blockly.Trashcan.prototype.WIDTH_ = 47;
95
+
96
+ /**
97
+ * Height of the trashcan image (minus lid).
98
+ * @const {number}
99
+ * @private
100
+ */
101
+ Blockly.Trashcan.prototype.BODY_HEIGHT_ = 44;
102
+
103
+ /**
104
+ * Height of the lid image.
105
+ * @const {number}
106
+ * @private
107
+ */
108
+ Blockly.Trashcan.prototype.LID_HEIGHT_ = 16;
109
+
110
+ /**
111
+ * Distance between trashcan and bottom edge of workspace.
112
+ * @const {number}
113
+ * @private
114
+ */
115
+ Blockly.Trashcan.prototype.MARGIN_BOTTOM_ = 20;
116
+
117
+ /**
118
+ * Distance between trashcan and right edge of workspace.
119
+ * @const {number}
120
+ * @private
121
+ */
122
+ Blockly.Trashcan.prototype.MARGIN_SIDE_ = 20;
123
+
124
+ /**
125
+ * Extent of hotspot on all sides beyond the size of the image.
126
+ * @const {number}
127
+ * @private
128
+ */
129
+ Blockly.Trashcan.prototype.MARGIN_HOTSPOT_ = 10;
130
+
131
+ /**
132
+ * Location of trashcan in sprite image.
133
+ * @const {number}
134
+ * @private
135
+ */
136
+ Blockly.Trashcan.prototype.SPRITE_LEFT_ = 0;
137
+
138
+ /**
139
+ * Location of trashcan in sprite image.
140
+ * @const {number}
141
+ * @private
142
+ */
143
+ Blockly.Trashcan.prototype.SPRITE_TOP_ = 32;
144
+
145
+ /**
146
+ * The openness of the lid when the trashcan contains blocks.
147
+ * (0.0 = closed, 1.0 = open)
148
+ * @const {number}
149
+ * @private
150
+ */
151
+ Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_ = 0.1;
152
+
153
+ /**
154
+ * The length of the lid open/close animation in milliseconds.
155
+ * @const {number}
156
+ * @private
157
+ */
158
+ Blockly.Trashcan.ANIMATION_LENGTH_ = 80;
159
+
160
+ /**
161
+ * The number of frames in the animation.
162
+ * @const {number}
163
+ * @private
164
+ */
165
+ Blockly.Trashcan.ANIMATION_FRAMES_ = 4;
166
+
167
+ /**
168
+ * The minimum (resting) opacity of the trashcan and lid.
169
+ * @const {number}
170
+ * @private
171
+ */
172
+ Blockly.Trashcan.OPACITY_MIN_ = 0.4;
173
+
174
+ /**
175
+ * The maximum (hovered) opacity of the trashcan and lid.
176
+ * @const {number}
177
+ * @private
178
+ */
179
+ Blockly.Trashcan.OPACITY_MAX_ = 0.8;
180
+
181
+ /**
182
+ * The maximum angle the trashcan lid can opens to. At the end of the open
183
+ * animation the lid will be open to this angle.
184
+ * @const {number}
185
+ * @private
186
+ */
187
+ Blockly.Trashcan.MAX_LID_ANGLE_ = 45;
188
+
189
+ /**
190
+ * Current open/close state of the lid.
191
+ * @type {boolean}
192
+ */
193
+ Blockly.Trashcan.prototype.isLidOpen = false;
194
+
195
+ /**
196
+ * The minimum openness of the lid. Used to indicate if the trashcan contains
197
+ * blocks.
198
+ * @type {number}
199
+ * @private
200
+ */
201
+ Blockly.Trashcan.prototype.minOpenness_ = 0;
202
+
203
+ /**
204
+ * The SVG group containing the trash can.
205
+ * @type {SVGElement}
206
+ * @private
207
+ */
208
+ Blockly.Trashcan.prototype.svgGroup_ = null;
209
+
210
+ /**
211
+ * The SVG image element of the trash can lid.
212
+ * @type {SVGElement}
213
+ * @private
214
+ */
215
+ Blockly.Trashcan.prototype.svgLid_ = null;
216
+
217
+ /**
218
+ * Task ID of opening/closing animation.
219
+ * @type {number}
220
+ * @private
221
+ */
222
+ Blockly.Trashcan.prototype.lidTask_ = 0;
223
+
224
+ /**
225
+ * Current state of lid opening (0.0 = closed, 1.0 = open).
226
+ * @type {number}
227
+ * @private
228
+ */
229
+ Blockly.Trashcan.prototype.lidOpen_ = 0;
230
+
231
+ /**
232
+ * Left coordinate of the trash can.
233
+ * @type {number}
234
+ * @private
235
+ */
236
+ Blockly.Trashcan.prototype.left_ = 0;
237
+
238
+ /**
239
+ * Top coordinate of the trash can.
240
+ * @type {number}
241
+ * @private
242
+ */
243
+ Blockly.Trashcan.prototype.top_ = 0;
244
+
245
+ /**
246
+ * Create the trash can elements.
247
+ * @return {!SVGElement} The trash can's SVG group.
248
+ */
249
+ Blockly.Trashcan.prototype.createDom = function() {
250
+ /* Here's the markup that will be generated:
251
+ <g class="blocklyTrash">
252
+ <clippath id="blocklyTrashBodyClipPath837493">
253
+ <rect width="47" height="45" y="15"></rect>
254
+ </clippath>
255
+ <image width="64" height="92" y="-32" xlink:href="media/sprites.png"
256
+ clip-path="url(#blocklyTrashBodyClipPath837493)"></image>
257
+ <clippath id="blocklyTrashLidClipPath837493">
258
+ <rect width="47" height="15"></rect>
259
+ </clippath>
260
+ <image width="84" height="92" y="-32" xlink:href="media/sprites.png"
261
+ clip-path="url(#blocklyTrashLidClipPath837493)"></image>
262
+ </g>
263
+ */
264
+ this.svgGroup_ = Blockly.utils.dom.createSvgElement(
265
+ Blockly.utils.Svg.G,
266
+ {'class': 'blocklyTrash'}, null);
267
+ var clip;
268
+ var rnd = String(Math.random()).substring(2);
269
+ clip = Blockly.utils.dom.createSvgElement(
270
+ Blockly.utils.Svg.CLIPPATH,
271
+ {'id': 'blocklyTrashBodyClipPath' + rnd},
272
+ this.svgGroup_);
273
+ Blockly.utils.dom.createSvgElement(
274
+ Blockly.utils.Svg.RECT,
275
+ {
276
+ 'width': this.WIDTH_,
277
+ 'height': this.BODY_HEIGHT_,
278
+ 'y': this.LID_HEIGHT_
279
+ },
280
+ clip);
281
+ var body = Blockly.utils.dom.createSvgElement(
282
+ Blockly.utils.Svg.IMAGE,
283
+ {
284
+ 'width': Blockly.SPRITE.width,
285
+ 'x': -this.SPRITE_LEFT_,
286
+ 'height': Blockly.SPRITE.height,
287
+ 'y': -this.SPRITE_TOP_,
288
+ 'clip-path': 'url(#blocklyTrashBodyClipPath' + rnd + ')'
289
+ },
290
+ this.svgGroup_);
291
+ body.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href',
292
+ this.workspace_.options.pathToMedia + Blockly.SPRITE.url);
293
+
294
+ clip = Blockly.utils.dom.createSvgElement(
295
+ Blockly.utils.Svg.CLIPPATH,
296
+ {'id': 'blocklyTrashLidClipPath' + rnd},
297
+ this.svgGroup_);
298
+ Blockly.utils.dom.createSvgElement(
299
+ Blockly.utils.Svg.RECT,
300
+ {'width': this.WIDTH_, 'height': this.LID_HEIGHT_}, clip);
301
+ this.svgLid_ = Blockly.utils.dom.createSvgElement(
302
+ Blockly.utils.Svg.IMAGE,
303
+ {
304
+ 'width': Blockly.SPRITE.width,
305
+ 'x': -this.SPRITE_LEFT_,
306
+ 'height': Blockly.SPRITE.height,
307
+ 'y': -this.SPRITE_TOP_,
308
+ 'clip-path': 'url(#blocklyTrashLidClipPath' + rnd + ')'
309
+ },
310
+ this.svgGroup_);
311
+ this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href',
312
+ this.workspace_.options.pathToMedia + Blockly.SPRITE.url);
313
+
314
+ Blockly.bindEventWithChecks_(this.svgGroup_, 'mouseup', this, this.click);
315
+ // bindEventWithChecks_ quashes events too aggressively. See:
316
+ // https://groups.google.com/forum/#!topic/blockly/QF4yB9Wx00s
317
+ // Bind to body instead of this.svgGroup_ so that we don't get lid jitters
318
+ Blockly.bindEvent_(body, 'mouseover', this, this.mouseOver_);
319
+ Blockly.bindEvent_(body, 'mouseout', this, this.mouseOut_);
320
+ this.animateLid_();
321
+ return this.svgGroup_;
322
+ };
323
+
324
+ /**
325
+ * Initialize the trash can.
326
+ * @param {number} verticalSpacing Vertical distance from workspace edge to the
327
+ * same edge of the trashcan.
328
+ * @return {number} Vertical distance from workspace edge to the opposite
329
+ * edge of the trashcan.
330
+ */
331
+ Blockly.Trashcan.prototype.init = function(verticalSpacing) {
332
+ if (this.workspace_.options.maxTrashcanContents > 0) {
333
+ Blockly.utils.dom.insertAfter(
334
+ this.flyout.createDom(Blockly.utils.Svg.SVG),
335
+ this.workspace_.getParentSvg());
336
+ this.flyout.init(this.workspace_);
337
+ }
338
+
339
+ this.verticalSpacing_ = this.MARGIN_BOTTOM_ + verticalSpacing;
340
+ this.setLidOpen(false);
341
+ return this.verticalSpacing_ + this.BODY_HEIGHT_ + this.LID_HEIGHT_;
342
+ };
343
+
344
+ /**
345
+ * Dispose of this trash can.
346
+ * Unlink from all DOM elements to prevent memory leaks.
347
+ * @suppress {checkTypes}
348
+ */
349
+ Blockly.Trashcan.prototype.dispose = function() {
350
+ if (this.svgGroup_) {
351
+ Blockly.utils.dom.removeNode(this.svgGroup_);
352
+ this.svgGroup_ = null;
353
+ }
354
+ this.svgLid_ = null;
355
+ this.workspace_ = null;
356
+ clearTimeout(this.lidTask_);
357
+ };
358
+
359
+ /**
360
+ * Whether the trashcan has contents.
361
+ * @return {boolean} True if the trashcan has contents.
362
+ * @private
363
+ */
364
+ Blockly.Trashcan.prototype.hasContents_ = function() {
365
+ return !!this.contents_.length;
366
+ };
367
+
368
+ /**
369
+ * Returns true if the trashcan contents-flyout is currently open.
370
+ * @return {boolean} True if the trashcan contents-flyout is currently open.
371
+ */
372
+ Blockly.Trashcan.prototype.contentsIsOpen = function() {
373
+ return this.flyout.isVisible();
374
+ };
375
+
376
+ /**
377
+ * Opens the trashcan flyout.
378
+ */
379
+ Blockly.Trashcan.prototype.openFlyout = function() {
380
+ if (this.contentsIsOpen()) {
381
+ return;
382
+ }
383
+
384
+ var xml = [];
385
+ for (var i = 0, text; (text = this.contents_[i]); i++) {
386
+ xml[i] = Blockly.Xml.textToDom(text);
387
+ }
388
+ this.flyout.show(xml);
389
+ this.fireUiEvent_(true);
390
+ };
391
+
392
+ /**
393
+ * Closes the trashcan flyout.
394
+ */
395
+ Blockly.Trashcan.prototype.closeFlyout = function() {
396
+ if (!this.contentsIsOpen()) {
397
+ return;
398
+ }
399
+
400
+ this.flyout.hide();
401
+ this.fireUiEvent_(false);
402
+ };
403
+
404
+ /**
405
+ * Empties the trashcan's contents. If the contents-flyout is currently open
406
+ * it will be closed.
407
+ */
408
+ Blockly.Trashcan.prototype.emptyContents = function() {
409
+ if (!this.hasContents_()) {
410
+ return;
411
+ }
412
+ this.contents_.length = 0;
413
+ this.setMinOpenness_(0);
414
+ this.closeFlyout();
415
+ };
416
+
417
+ /**
418
+ * Position the trashcan.
419
+ * It is positioned in the opposite corner to the corner the
420
+ * categories/toolbox starts at.
421
+ */
422
+ Blockly.Trashcan.prototype.position = function() {
423
+ // Not yet initialized.
424
+ if (!this.verticalSpacing_) {
425
+ return;
426
+ }
427
+ var metrics = this.workspace_.getMetrics();
428
+ if (!metrics) {
429
+ // There are no metrics available (workspace is probably not visible).
430
+ return;
431
+ }
432
+ if (metrics.toolboxPosition == Blockly.TOOLBOX_AT_LEFT ||
433
+ (this.workspace_.horizontalLayout && !this.workspace_.RTL)) {
434
+ // Toolbox starts in the left corner.
435
+ this.left_ = metrics.viewWidth + metrics.absoluteLeft -
436
+ this.WIDTH_ - this.MARGIN_SIDE_ - Blockly.Scrollbar.scrollbarThickness;
437
+ } else {
438
+ // Toolbox starts in the right corner.
439
+ this.left_ = this.MARGIN_SIDE_ + Blockly.Scrollbar.scrollbarThickness;
440
+ }
441
+
442
+ if (metrics.toolboxPosition == Blockly.TOOLBOX_AT_BOTTOM) {
443
+ this.top_ = this.verticalSpacing_;
444
+ } else {
445
+ this.top_ = metrics.viewHeight + metrics.absoluteTop -
446
+ (this.BODY_HEIGHT_ + this.LID_HEIGHT_) - this.verticalSpacing_;
447
+ }
448
+
449
+ this.svgGroup_.setAttribute('transform',
450
+ 'translate(' + this.left_ + ',' + this.top_ + ')');
451
+ };
452
+
453
+ /**
454
+ * Return the deletion rectangle for this trash can.
455
+ * @return {Blockly.utils.Rect} Rectangle in which to delete.
456
+ */
457
+ Blockly.Trashcan.prototype.getClientRect = function() {
458
+ if (!this.svgGroup_) {
459
+ return null;
460
+ }
461
+
462
+ var trashRect = this.svgGroup_.getBoundingClientRect();
463
+ var top = trashRect.top + this.SPRITE_TOP_ - this.MARGIN_HOTSPOT_;
464
+ var bottom = top + this.LID_HEIGHT_ + this.BODY_HEIGHT_ +
465
+ 2 * this.MARGIN_HOTSPOT_;
466
+ var left = trashRect.left + this.SPRITE_LEFT_ - this.MARGIN_HOTSPOT_;
467
+ var right = left + this.WIDTH_ + 2 * this.MARGIN_HOTSPOT_;
468
+ return new Blockly.utils.Rect(top, bottom, left, right);
469
+ };
470
+
471
+ /**
472
+ * Flip the lid open or shut.
473
+ * @param {boolean} state True if open.
474
+ * @package
475
+ */
476
+ Blockly.Trashcan.prototype.setLidOpen = function(state) {
477
+ if (this.isLidOpen == state) {
478
+ return;
479
+ }
480
+ clearTimeout(this.lidTask_);
481
+ this.isLidOpen = state;
482
+ this.animateLid_();
483
+ };
484
+
485
+ /**
486
+ * Rotate the lid open or closed by one step. Then wait and recurse.
487
+ * @private
488
+ */
489
+ Blockly.Trashcan.prototype.animateLid_ = function() {
490
+ var frames = Blockly.Trashcan.ANIMATION_FRAMES_;
491
+
492
+ var delta = 1 / (frames + 1);
493
+ this.lidOpen_ += this.isLidOpen ? delta : -delta;
494
+ this.lidOpen_ = Math.min(Math.max(this.lidOpen_, this.minOpenness_), 1);
495
+
496
+ this.setLidAngle_(this.lidOpen_ * Blockly.Trashcan.MAX_LID_ANGLE_);
497
+
498
+ var minOpacity = Blockly.Trashcan.OPACITY_MIN_;
499
+ var maxOpacity = Blockly.Trashcan.OPACITY_MAX_;
500
+ // Linear interpolation between min and max.
501
+ var opacity = minOpacity + this.lidOpen_ * (maxOpacity - minOpacity);
502
+ this.svgGroup_.style.opacity = opacity;
503
+
504
+ if (this.lidOpen_ > this.minOpenness_ && this.lidOpen_ < 1) {
505
+ this.lidTask_ = setTimeout(this.animateLid_.bind(this),
506
+ Blockly.Trashcan.ANIMATION_LENGTH_ / frames);
507
+ }
508
+ };
509
+
510
+ /**
511
+ * Set the angle of the trashcan's lid.
512
+ * @param {number} lidAngle The angle at which to set the lid.
513
+ * @private
514
+ */
515
+ Blockly.Trashcan.prototype.setLidAngle_ = function(lidAngle) {
516
+ var openAtRight = this.workspace_.toolboxPosition == Blockly.TOOLBOX_AT_RIGHT ||
517
+ (this.workspace_.horizontalLayout && this.workspace_.RTL);
518
+ this.svgLid_.setAttribute('transform', 'rotate(' +
519
+ (openAtRight ? -lidAngle : lidAngle) + ',' +
520
+ (openAtRight ? 4 : this.WIDTH_ - 4) + ',' +
521
+ (this.LID_HEIGHT_ - 2) + ')');
522
+ };
523
+
524
+ /**
525
+ * Sets the minimum openness of the trashcan lid. If the lid is currently
526
+ * closed, this will update lid's position.
527
+ * @param {number} newMin The new minimum openness of the lid. Should be between
528
+ * 0 and 1.
529
+ * @private
530
+ */
531
+ Blockly.Trashcan.prototype.setMinOpenness_ = function(newMin) {
532
+ this.minOpenness_ = newMin;
533
+ if (!this.isLidOpen) {
534
+ this.setLidAngle_(newMin * Blockly.Trashcan.MAX_LID_ANGLE_);
535
+ }
536
+ };
537
+
538
+ /**
539
+ * Flip the lid shut.
540
+ * Called externally after a drag.
541
+ */
542
+ Blockly.Trashcan.prototype.closeLid = function() {
543
+ this.setLidOpen(false);
544
+ };
545
+
546
+ /**
547
+ * Inspect the contents of the trash.
548
+ */
549
+ Blockly.Trashcan.prototype.click = function() {
550
+ if (!this.hasContents_()) {
551
+ return;
552
+ }
553
+ this.openFlyout();
554
+ };
555
+
556
+ /**
557
+ * Fires a ui event for trashcan flyout open or close.
558
+ * @param {boolean} trashcanOpen Whether the flyout is opening.
559
+ * @private
560
+ */
561
+ Blockly.Trashcan.prototype.fireUiEvent_ = function(trashcanOpen) {
562
+ var uiEvent = new Blockly.Events.Ui(null, 'trashcanOpen', null, trashcanOpen);
563
+ uiEvent.workspaceId = this.workspace_.id;
564
+ Blockly.Events.fire(uiEvent);
565
+ };
566
+
567
+ /**
568
+ * Indicate that the trashcan can be clicked (by opening it) if it has blocks.
569
+ * @private
570
+ */
571
+ Blockly.Trashcan.prototype.mouseOver_ = function() {
572
+ if (this.hasContents_()) {
573
+ this.setLidOpen(true);
574
+ }
575
+ };
576
+
577
+ /**
578
+ * Close the lid of the trashcan if it was open (Vis. it was indicating it had
579
+ * blocks).
580
+ * @private
581
+ */
582
+ Blockly.Trashcan.prototype.mouseOut_ = function() {
583
+ // No need to do a .hasBlocks check here because if it doesn't the trashcan
584
+ // won't be open in the first place, and setOpen won't run.
585
+ this.setLidOpen(false);
586
+ };
587
+
588
+ /**
589
+ * Handle a BLOCK_DELETE event. Adds deleted blocks oldXml to the content array.
590
+ * @param {!Blockly.Events.Abstract} event Workspace event.
591
+ * @private
592
+ */
593
+ Blockly.Trashcan.prototype.onDelete_ = function(event) {
594
+ if (this.workspace_.options.maxTrashcanContents <= 0) {
595
+ return;
596
+ }
597
+ // Must check that the tagName exists since oldXml can be a DocumentFragment.
598
+ if (event.type == Blockly.Events.BLOCK_DELETE && event.oldXml.tagName &&
599
+ event.oldXml.tagName.toLowerCase() != 'shadow') {
600
+ var cleanedXML = this.cleanBlockXML_(event.oldXml);
601
+ if (this.contents_.indexOf(cleanedXML) != -1) {
602
+ return;
603
+ }
604
+ this.contents_.unshift(cleanedXML);
605
+ while (this.contents_.length >
606
+ this.workspace_.options.maxTrashcanContents) {
607
+ this.contents_.pop();
608
+ }
609
+
610
+ this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_);
611
+ }
612
+ };
613
+
614
+ /**
615
+ * Converts XML representing a block into text that can be stored in the
616
+ * content array.
617
+ * @param {!Element} xml An XML tree defining the block and any
618
+ * connected child blocks.
619
+ * @return {string} Text representing the XML tree, cleaned of all unnecessary
620
+ * attributes.
621
+ * @private
622
+ */
623
+ Blockly.Trashcan.prototype.cleanBlockXML_ = function(xml) {
624
+ var xmlBlock = xml.cloneNode(true);
625
+ var node = xmlBlock;
626
+ while (node) {
627
+ // Things like text inside tags are still treated as nodes, but they
628
+ // don't have attributes (or the removeAttribute function) so we can
629
+ // skip removing attributes from them.
630
+ if (node.removeAttribute) {
631
+ node.removeAttribute('x');
632
+ node.removeAttribute('y');
633
+ node.removeAttribute('id');
634
+ node.removeAttribute('disabled');
635
+ if (node.nodeName == 'comment') { // Future proof just in case.
636
+ node.removeAttribute('h');
637
+ node.removeAttribute('w');
638
+ node.removeAttribute('pinned');
639
+ }
640
+ }
641
+
642
+ // Try to go down the tree
643
+ var nextNode = node.firstChild || node.nextSibling;
644
+ // If we can't go down, try to go back up the tree.
645
+ if (!nextNode) {
646
+ nextNode = node.parentNode;
647
+ while (nextNode) {
648
+ // We are valid again!
649
+ if (nextNode.nextSibling) {
650
+ nextNode = nextNode.nextSibling;
651
+ break;
652
+ }
653
+ // Try going up again. If parentNode is null that means we have
654
+ // reached the top, and we will break out of both loops.
655
+ nextNode = nextNode.parentNode;
656
+ }
657
+ }
658
+ node = nextNode;
659
+ }
660
+ return Blockly.Xml.domToText(xmlBlock);
661
+ };