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,186 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2012 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Utility functions for handling variables and procedure names.
9
+ * @author fraser@google.com (Neil Fraser)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.Names');
14
+
15
+ goog.require('Blockly.Msg');
16
+
17
+
18
+ /**
19
+ * Class for a database of entity names (variables, functions, etc).
20
+ * @param {string} reservedWords A comma-separated string of words that are
21
+ * illegal for use as names in a language (e.g. 'new,if,this,...').
22
+ * @param {string=} opt_variablePrefix Some languages need a '$' or a namespace
23
+ * before all variable names.
24
+ * @constructor
25
+ */
26
+ Blockly.Names = function(reservedWords, opt_variablePrefix) {
27
+ this.variablePrefix_ = opt_variablePrefix || '';
28
+ this.reservedDict_ = Object.create(null);
29
+ if (reservedWords) {
30
+ var splitWords = reservedWords.split(',');
31
+ for (var i = 0; i < splitWords.length; i++) {
32
+ this.reservedDict_[splitWords[i]] = true;
33
+ }
34
+ }
35
+ this.reset();
36
+ };
37
+
38
+ /**
39
+ * Constant to separate developer variable names from user-defined variable
40
+ * names when running generators.
41
+ * A developer variable will be declared as a global in the generated code, but
42
+ * will never be shown to the user in the workspace or stored in the variable
43
+ * map.
44
+ */
45
+ Blockly.Names.DEVELOPER_VARIABLE_TYPE = 'DEVELOPER_VARIABLE';
46
+
47
+ /**
48
+ * When JavaScript (or most other languages) is generated, variable 'foo' and
49
+ * procedure 'foo' would collide. However, Blockly has no such problems since
50
+ * variable get 'foo' and procedure call 'foo' are unambiguous.
51
+ * Therefore, Blockly keeps a separate type name to disambiguate.
52
+ * getName('foo', 'variable') -> 'foo'
53
+ * getName('foo', 'procedure') -> 'foo2'
54
+ */
55
+
56
+ /**
57
+ * Empty the database and start from scratch. The reserved words are kept.
58
+ */
59
+ Blockly.Names.prototype.reset = function() {
60
+ this.db_ = Object.create(null);
61
+ this.dbReverse_ = Object.create(null);
62
+ this.variableMap_ = null;
63
+ };
64
+
65
+ /**
66
+ * Set the variable map that maps from variable name to variable object.
67
+ * @param {!Blockly.VariableMap} map The map to track.
68
+ */
69
+ Blockly.Names.prototype.setVariableMap = function(map) {
70
+ this.variableMap_ = map;
71
+ };
72
+
73
+ /**
74
+ * Get the name for a user-defined variable, based on its ID.
75
+ * This should only be used for variables of type
76
+ * Blockly.VARIABLE_CATEGORY_NAME.
77
+ * @param {string} id The ID to look up in the variable map.
78
+ * @return {?string} The name of the referenced variable, or null if there was
79
+ * no variable map or the variable was not found in the map.
80
+ * @private
81
+ */
82
+ Blockly.Names.prototype.getNameForUserVariable_ = function(id) {
83
+ if (!this.variableMap_) {
84
+ console.log('Deprecated call to Blockly.Names.prototype.getName without ' +
85
+ 'defining a variable map. To fix, add the following code in your ' +
86
+ 'generator\'s init() function:\n' +
87
+ 'Blockly.YourGeneratorName.variableDB_.setVariableMap(' +
88
+ 'workspace.getVariableMap());');
89
+ return null;
90
+ }
91
+ var variable = this.variableMap_.getVariableById(id);
92
+ if (variable) {
93
+ return variable.name;
94
+ } else {
95
+ return null;
96
+ }
97
+ };
98
+
99
+ /**
100
+ * Convert a Blockly entity name to a legal exportable entity name.
101
+ * @param {string} name The Blockly entity name (no constraints).
102
+ * @param {string} type The type of entity in Blockly
103
+ * ('VARIABLE', 'PROCEDURE', 'BUILTIN', etc...).
104
+ * @return {string} An entity name that is legal in the exported language.
105
+ */
106
+ Blockly.Names.prototype.getName = function(name, type) {
107
+ if (type == Blockly.VARIABLE_CATEGORY_NAME) {
108
+ var varName = this.getNameForUserVariable_(name);
109
+ if (varName) {
110
+ name = varName;
111
+ }
112
+ }
113
+ var normalized = name.toLowerCase() + '_' + type;
114
+
115
+ var isVarType = type == Blockly.VARIABLE_CATEGORY_NAME ||
116
+ type == Blockly.Names.DEVELOPER_VARIABLE_TYPE;
117
+
118
+ var prefix = isVarType ? this.variablePrefix_ : '';
119
+ if (normalized in this.db_) {
120
+ return prefix + this.db_[normalized];
121
+ }
122
+ var safeName = this.getDistinctName(name, type);
123
+ this.db_[normalized] = safeName.substr(prefix.length);
124
+ return safeName;
125
+ };
126
+
127
+ /**
128
+ * Convert a Blockly entity name to a legal exportable entity name.
129
+ * Ensure that this is a new name not overlapping any previously defined name.
130
+ * Also check against list of reserved words for the current language and
131
+ * ensure name doesn't collide.
132
+ * @param {string} name The Blockly entity name (no constraints).
133
+ * @param {string} type The type of entity in Blockly
134
+ * ('VARIABLE', 'PROCEDURE', 'BUILTIN', etc...).
135
+ * @return {string} An entity name that is legal in the exported language.
136
+ */
137
+ Blockly.Names.prototype.getDistinctName = function(name, type) {
138
+ var safeName = this.safeName_(name);
139
+ var i = '';
140
+ while (this.dbReverse_[safeName + i] ||
141
+ (safeName + i) in this.reservedDict_) {
142
+ // Collision with existing name. Create a unique name.
143
+ i = i ? i + 1 : 2;
144
+ }
145
+ safeName += i;
146
+ this.dbReverse_[safeName] = true;
147
+ var isVarType = type == Blockly.VARIABLE_CATEGORY_NAME ||
148
+ type == Blockly.Names.DEVELOPER_VARIABLE_TYPE;
149
+ var prefix = isVarType ? this.variablePrefix_ : '';
150
+ return prefix + safeName;
151
+ };
152
+
153
+ /**
154
+ * Given a proposed entity name, generate a name that conforms to the
155
+ * [_A-Za-z][_A-Za-z0-9]* format that most languages consider legal for
156
+ * variables.
157
+ * @param {string} name Potentially illegal entity name.
158
+ * @return {string} Safe entity name.
159
+ * @private
160
+ */
161
+ Blockly.Names.prototype.safeName_ = function(name) {
162
+ if (!name) {
163
+ name = Blockly.Msg['UNNAMED_KEY'] || 'unnamed';
164
+ } else {
165
+ // Unfortunately names in non-latin characters will look like
166
+ // _E9_9F_B3_E4_B9_90 which is pretty meaningless.
167
+ // https://github.com/google/blockly/issues/1654
168
+ name = encodeURI(name.replace(/ /g, '_')).replace(/[^\w]/g, '_');
169
+ // Most languages don't allow names with leading numbers.
170
+ if ('0123456789'.indexOf(name[0]) != -1) {
171
+ name = 'my_' + name;
172
+ }
173
+ }
174
+ return name;
175
+ };
176
+
177
+ /**
178
+ * Do the given two entity names refer to the same entity?
179
+ * Blockly names are case-insensitive.
180
+ * @param {string} name1 First name.
181
+ * @param {string} name2 Second name.
182
+ * @return {boolean} True if names are the same.
183
+ */
184
+ Blockly.Names.equals = function(name1, name2) {
185
+ return name1.toLowerCase() == name2.toLowerCase();
186
+ };
@@ -0,0 +1,365 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Object that controls settings for the workspace.
9
+ * @author fenichel@google.com (Rachel Fenichel)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.Options');
14
+
15
+ goog.require('Blockly.Theme');
16
+ goog.require('Blockly.Themes.Classic');
17
+ goog.require('Blockly.registry');
18
+ goog.require('Blockly.user.keyMap');
19
+ goog.require('Blockly.utils.IdGenerator');
20
+ goog.require('Blockly.utils.Metrics');
21
+ goog.require('Blockly.utils.toolbox');
22
+ goog.require('Blockly.utils.userAgent');
23
+ goog.require('Blockly.Xml');
24
+
25
+ goog.requireType('Blockly.WorkspaceSvg');
26
+
27
+
28
+ /**
29
+ * Parse the user-specified options, using reasonable defaults where behaviour
30
+ * is unspecified.
31
+ * @param {!Blockly.BlocklyOptions} options Dictionary of options.
32
+ * Specification: https://developers.google.com/blockly/guides/get-started/web#configuration
33
+ * @constructor
34
+ */
35
+ Blockly.Options = function(options) {
36
+ var readOnly = !!options['readOnly'];
37
+ if (readOnly) {
38
+ var toolboxJsonDef = null;
39
+ var hasCategories = false;
40
+ var hasTrashcan = false;
41
+ var hasCollapse = false;
42
+ var hasComments = false;
43
+ var hasDisable = false;
44
+ var hasSounds = false;
45
+ } else {
46
+ var toolboxJsonDef = Blockly.utils.toolbox.convertToolboxDefToJson(options['toolbox']);
47
+ var hasCategories = Blockly.utils.toolbox.hasCategories(toolboxJsonDef);
48
+ var hasTrashcan = options['trashcan'];
49
+ if (hasTrashcan === undefined) {
50
+ hasTrashcan = hasCategories;
51
+ }
52
+ var maxTrashcanContents = options['maxTrashcanContents'];
53
+ if (hasTrashcan) {
54
+ if (maxTrashcanContents === undefined) {
55
+ maxTrashcanContents = 32;
56
+ }
57
+ } else {
58
+ maxTrashcanContents = 0;
59
+ }
60
+ var hasCollapse = options['collapse'];
61
+ if (hasCollapse === undefined) {
62
+ hasCollapse = hasCategories;
63
+ }
64
+ var hasComments = options['comments'];
65
+ if (hasComments === undefined) {
66
+ hasComments = hasCategories;
67
+ }
68
+ var hasDisable = options['disable'];
69
+ if (hasDisable === undefined) {
70
+ hasDisable = hasCategories;
71
+ }
72
+ var hasSounds = options['sounds'];
73
+ if (hasSounds === undefined) {
74
+ hasSounds = true;
75
+ }
76
+ }
77
+ var rtl = !!options['rtl'];
78
+ var horizontalLayout = options['horizontalLayout'];
79
+ if (horizontalLayout === undefined) {
80
+ horizontalLayout = false;
81
+ }
82
+ var toolboxAtStart = options['toolboxPosition'];
83
+ toolboxAtStart = toolboxAtStart !== 'end';
84
+
85
+ /** @type {!Blockly.utils.toolbox.Position} */
86
+ var toolboxPosition;
87
+ if (horizontalLayout) {
88
+ toolboxPosition = toolboxAtStart ?
89
+ Blockly.utils.toolbox.Position.TOP : Blockly.utils.toolbox.Position.BOTTOM;
90
+ } else {
91
+ toolboxPosition = (toolboxAtStart == rtl) ?
92
+ Blockly.utils.toolbox.Position.RIGHT : Blockly.utils.toolbox.Position.LEFT;
93
+ }
94
+
95
+ var hasCss = options['css'];
96
+ if (hasCss === undefined) {
97
+ hasCss = true;
98
+ }
99
+ var pathToMedia = 'https://blockly-demo.appspot.com/static/media/';
100
+ if (options['media']) {
101
+ pathToMedia = options['media'];
102
+ } else if (options['path']) {
103
+ // 'path' is a deprecated option which has been replaced by 'media'.
104
+ pathToMedia = options['path'] + 'media/';
105
+ }
106
+ if (options['oneBasedIndex'] === undefined) {
107
+ var oneBasedIndex = true;
108
+ } else {
109
+ var oneBasedIndex = !!options['oneBasedIndex'];
110
+ }
111
+ var keyMap = options['keyMap'] || Blockly.user.keyMap.createDefaultKeyMap();
112
+
113
+ var renderer = options['renderer'] || 'geras';
114
+
115
+ var plugins = options['plugins'] || {};
116
+
117
+ /** @type {boolean} */
118
+ this.RTL = rtl;
119
+ /** @type {boolean} */
120
+ this.oneBasedIndex = oneBasedIndex;
121
+ /** @type {boolean} */
122
+ this.collapse = hasCollapse;
123
+ /** @type {boolean} */
124
+ this.comments = hasComments;
125
+ /** @type {boolean} */
126
+ this.disable = hasDisable;
127
+ /** @type {boolean} */
128
+ this.readOnly = readOnly;
129
+ /** @type {number} */
130
+ this.maxBlocks = options['maxBlocks'] || Infinity;
131
+ /** @type {?Object.<string, number>} */
132
+ this.maxInstances = options['maxInstances'];
133
+ /** @type {string} */
134
+ this.pathToMedia = pathToMedia;
135
+ /** @type {boolean} */
136
+ this.hasCategories = hasCategories;
137
+ /** @type {!Blockly.Options.MoveOptions} */
138
+ this.moveOptions = Blockly.Options.parseMoveOptions_(options, hasCategories);
139
+ /** @deprecated January 2019 */
140
+ this.hasScrollbars = this.moveOptions.scrollbars;
141
+ /** @type {boolean} */
142
+ this.hasTrashcan = hasTrashcan;
143
+ /** @type {number} */
144
+ this.maxTrashcanContents = maxTrashcanContents;
145
+ /** @type {boolean} */
146
+ this.hasSounds = hasSounds;
147
+ /** @type {boolean} */
148
+ this.hasCss = hasCss;
149
+ /** @type {boolean} */
150
+ this.horizontalLayout = horizontalLayout;
151
+ /** @type {?Blockly.utils.toolbox.ToolboxInfo} */
152
+ this.languageTree = toolboxJsonDef;
153
+ /** @type {!Blockly.Options.GridOptions} */
154
+ this.gridOptions = Blockly.Options.parseGridOptions_(options);
155
+ /** @type {!Blockly.Options.ZoomOptions} */
156
+ this.zoomOptions = Blockly.Options.parseZoomOptions_(options);
157
+ /** @type {!Blockly.utils.toolbox.Position} */
158
+ this.toolboxPosition = toolboxPosition;
159
+ /** @type {!Blockly.Theme} */
160
+ this.theme = Blockly.Options.parseThemeOptions_(options);
161
+ /** @type {!Object<string,Blockly.Action>} */
162
+ this.keyMap = keyMap;
163
+ /** @type {string} */
164
+ this.renderer = renderer;
165
+ /** @type {?Object} */
166
+ this.rendererOverrides = options['rendererOverrides'];
167
+
168
+ /**
169
+ * The SVG element for the grid pattern.
170
+ * Created during injection.
171
+ * @type {?SVGElement}
172
+ */
173
+ this.gridPattern = null;
174
+
175
+ /**
176
+ * The parent of the current workspace, or null if there is no parent
177
+ * workspace. We can assert that this is of type WorkspaceSvg as opposed to
178
+ * Workspace as this is only used in a rendered workspace.
179
+ * @type {Blockly.WorkspaceSvg}
180
+ */
181
+ this.parentWorkspace = options['parentWorkspace'];
182
+
183
+ /**
184
+ * Map of plugin type to name of registered plugin or plugin class.
185
+ * @type {!Object.<string, (function(new:?, ...?)|string)>}
186
+ */
187
+ this.plugins = plugins;
188
+ };
189
+
190
+ /**
191
+ * Blockly options.
192
+ * This interface is further described in
193
+ * `typings/parts/blockly-interfaces.d.ts`.
194
+ * @interface
195
+ */
196
+ Blockly.BlocklyOptions = function() {};
197
+
198
+ /**
199
+ * Grid Options.
200
+ * @typedef {{
201
+ * colour: string,
202
+ * length: number,
203
+ * snap: boolean,
204
+ * spacing: number
205
+ * }}
206
+ */
207
+ Blockly.Options.GridOptions;
208
+
209
+ /**
210
+ * Move Options.
211
+ * @typedef {{
212
+ * drag: boolean,
213
+ * scrollbars: boolean,
214
+ * wheel: boolean
215
+ * }}
216
+ */
217
+ Blockly.Options.MoveOptions;
218
+
219
+ /**
220
+ * Zoom Options.
221
+ * @typedef {{
222
+ * controls: boolean,
223
+ * maxScale: number,
224
+ * minScale: number,
225
+ * pinch: boolean,
226
+ * scaleSpeed: number,
227
+ * startScale: number,
228
+ * wheel: boolean
229
+ * }}
230
+ */
231
+ Blockly.Options.ZoomOptions;
232
+
233
+ /**
234
+ * If set, sets the translation of the workspace to match the scrollbars.
235
+ * @param {!{x:number,y:number}} xyRatio Contains an x and/or y property which
236
+ * is a float between 0 and 1 specifying the degree of scrolling.
237
+ * @return {void}
238
+ */
239
+ Blockly.Options.prototype.setMetrics;
240
+
241
+ /**
242
+ * Return an object with the metrics required to size the workspace.
243
+ * @return {!Blockly.utils.Metrics} Contains size and position metrics.
244
+ */
245
+ Blockly.Options.prototype.getMetrics;
246
+
247
+ /**
248
+ * Parse the user-specified move options, using reasonable defaults where
249
+ * behaviour is unspecified.
250
+ * @param {!Object} options Dictionary of options.
251
+ * @param {boolean} hasCategories Whether the workspace has categories or not.
252
+ * @return {!Blockly.Options.MoveOptions} Normalized move options.
253
+ * @private
254
+ */
255
+ Blockly.Options.parseMoveOptions_ = function(options, hasCategories) {
256
+ var move = options['move'] || {};
257
+ var moveOptions = {};
258
+ if (move['scrollbars'] === undefined && options['scrollbars'] === undefined) {
259
+ moveOptions.scrollbars = hasCategories;
260
+ } else {
261
+ moveOptions.scrollbars = !!move['scrollbars'] || !!options['scrollbars'];
262
+ }
263
+ if (!moveOptions.scrollbars || move['wheel'] === undefined) {
264
+ // Defaults to false so that developers' settings don't appear to change.
265
+ moveOptions.wheel = false;
266
+ } else {
267
+ moveOptions.wheel = !!move['wheel'];
268
+ }
269
+ if (!moveOptions.scrollbars) {
270
+ moveOptions.drag = false;
271
+ } else if (move['drag'] === undefined) {
272
+ // Defaults to true if scrollbars is true.
273
+ moveOptions.drag = true;
274
+ } else {
275
+ moveOptions.drag = !!move['drag'];
276
+ }
277
+ return moveOptions;
278
+ };
279
+
280
+ /**
281
+ * Parse the user-specified zoom options, using reasonable defaults where
282
+ * behaviour is unspecified. See zoom documentation:
283
+ * https://developers.google.com/blockly/guides/configure/web/zoom
284
+ * @param {!Object} options Dictionary of options.
285
+ * @return {!Blockly.Options.ZoomOptions} Normalized zoom options.
286
+ * @private
287
+ */
288
+ Blockly.Options.parseZoomOptions_ = function(options) {
289
+ var zoom = options['zoom'] || {};
290
+ var zoomOptions = {};
291
+ if (zoom['controls'] === undefined) {
292
+ zoomOptions.controls = false;
293
+ } else {
294
+ zoomOptions.controls = !!zoom['controls'];
295
+ }
296
+ if (zoom['wheel'] === undefined) {
297
+ zoomOptions.wheel = false;
298
+ } else {
299
+ zoomOptions.wheel = !!zoom['wheel'];
300
+ }
301
+ if (zoom['startScale'] === undefined) {
302
+ zoomOptions.startScale = 1;
303
+ } else {
304
+ zoomOptions.startScale = Number(zoom['startScale']);
305
+ }
306
+ if (zoom['maxScale'] === undefined) {
307
+ zoomOptions.maxScale = 3;
308
+ } else {
309
+ zoomOptions.maxScale = Number(zoom['maxScale']);
310
+ }
311
+ if (zoom['minScale'] === undefined) {
312
+ zoomOptions.minScale = 0.3;
313
+ } else {
314
+ zoomOptions.minScale = Number(zoom['minScale']);
315
+ }
316
+ if (zoom['scaleSpeed'] === undefined) {
317
+ zoomOptions.scaleSpeed = 1.2;
318
+ } else {
319
+ zoomOptions.scaleSpeed = Number(zoom['scaleSpeed']);
320
+ }
321
+ if (zoom['pinch'] === undefined) {
322
+ zoomOptions.pinch = zoomOptions.wheel || zoomOptions.controls;
323
+ } else {
324
+ zoomOptions.pinch = !!zoom['pinch'];
325
+ }
326
+ return zoomOptions;
327
+ };
328
+
329
+ /**
330
+ * Parse the user-specified grid options, using reasonable defaults where
331
+ * behaviour is unspecified. See grid documentation:
332
+ * https://developers.google.com/blockly/guides/configure/web/grid
333
+ * @param {!Object} options Dictionary of options.
334
+ * @return {!Blockly.Options.GridOptions} Normalized grid options.
335
+ * @private
336
+ */
337
+ Blockly.Options.parseGridOptions_ = function(options) {
338
+ var grid = options['grid'] || {};
339
+ var gridOptions = {};
340
+ gridOptions.spacing = Number(grid['spacing']) || 0;
341
+ gridOptions.colour = grid['colour'] || '#888';
342
+ gridOptions.length =
343
+ (grid['length'] === undefined) ? 1 : Number(grid['length']);
344
+ gridOptions.snap = gridOptions.spacing > 0 && !!grid['snap'];
345
+ return gridOptions;
346
+ };
347
+
348
+ /**
349
+ * Parse the user-specified theme options, using the classic theme as a default.
350
+ * https://developers.google.com/blockly/guides/configure/web/themes
351
+ * @param {!Object} options Dictionary of options.
352
+ * @return {!Blockly.Theme} A Blockly Theme.
353
+ * @private
354
+ */
355
+ Blockly.Options.parseThemeOptions_ = function(options) {
356
+ var theme = options['theme'] || Blockly.Themes.Classic;
357
+ if (typeof theme == 'string') {
358
+ return /** @type {!Blockly.Theme} */ (
359
+ Blockly.registry.getObject(Blockly.registry.Type.THEME, theme));
360
+ } else if (theme instanceof Blockly.Theme) {
361
+ return /** @type {!Blockly.Theme} */ (theme);
362
+ }
363
+ return Blockly.Theme.defineTheme(theme.name ||
364
+ ('builtin' + Blockly.utils.IdGenerator.getNextUniqueId()), theme);
365
+ };