nodeskini 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. package/blocklySkini/archive/blocklyControleur.js +87 -0
  2. package/blocklySkini/archive/blocklySkini.js +84 -0
  3. package/blocklySkini/archive/blocklyhop.js +75 -0
  4. package/blocklySkini/archive/clientControleurBlocly.js +170 -0
  5. package/blocklySkini/archive/index.html +76 -0
  6. package/blocklySkini/archive/testHHsuspend.txt +89 -0
  7. package/blocklySkini/archive/testHHtrap.txt +262 -0
  8. package/blocklySkini/archive/testOrchestration.txt +177 -0
  9. package/blocklySkini/archive/testOrchestration.xml +447 -0
  10. package/blocklySkini/archive/testOrchestration2.xml +456 -0
  11. package/blocklySkini/blockly/README.md +77 -0
  12. package/blocklySkini/blockly/blockly.d.ts +21480 -0
  13. package/blocklySkini/blockly/blockly.js +25 -0
  14. package/blocklySkini/blockly/blockly.min.js +2188 -0
  15. package/blocklySkini/blockly/blockly_compressed.js +1455 -0
  16. package/blocklySkini/blockly/blockly_compressed.js.map +1 -0
  17. package/blocklySkini/blockly/blocks/colour.js +122 -0
  18. package/blocklySkini/blockly/blocks/lists.js +862 -0
  19. package/blocklySkini/blockly/blocks/logic.js +635 -0
  20. package/blocklySkini/blockly/blocks/loops.js +357 -0
  21. package/blocklySkini/blockly/blocks/math.js +566 -0
  22. package/blocklySkini/blockly/blocks/procedures.js +1072 -0
  23. package/blocklySkini/blockly/blocks/text.js +923 -0
  24. package/blocklySkini/blockly/blocks/variables.js +163 -0
  25. package/blocklySkini/blockly/blocks/variables_dynamic.js +180 -0
  26. package/blocklySkini/blockly/blocks.d.ts +15 -0
  27. package/blocklySkini/blockly/blocks.js +27 -0
  28. package/blocklySkini/blockly/blocks_compressed.js +182 -0
  29. package/blocklySkini/blockly/blocks_compressed.js.map +1 -0
  30. package/blocklySkini/blockly/browser.js +36 -0
  31. package/blocklySkini/blockly/core/block.js +2010 -0
  32. package/blocklySkini/blockly/core/block_animations.js +203 -0
  33. package/blocklySkini/blockly/core/block_drag_surface.js +212 -0
  34. package/blocklySkini/blockly/core/block_dragger.js +378 -0
  35. package/blocklySkini/blockly/core/block_events.js +548 -0
  36. package/blocklySkini/blockly/core/block_svg.js +1763 -0
  37. package/blocklySkini/blockly/core/blockly.js +674 -0
  38. package/blocklySkini/blockly/core/blocks.js +23 -0
  39. package/blocklySkini/blockly/core/bubble.js +880 -0
  40. package/blocklySkini/blockly/core/bubble_dragger.js +274 -0
  41. package/blocklySkini/blockly/core/comment.js +439 -0
  42. package/blocklySkini/blockly/core/components/component.js +554 -0
  43. package/blocklySkini/blockly/core/components/tree/basenode.js +895 -0
  44. package/blocklySkini/blockly/core/components/tree/treecontrol.js +332 -0
  45. package/blocklySkini/blockly/core/components/tree/treenode.js +172 -0
  46. package/blocklySkini/blockly/core/connection.js +682 -0
  47. package/blocklySkini/blockly/core/connection_checker.js +285 -0
  48. package/blocklySkini/blockly/core/connection_db.js +295 -0
  49. package/blocklySkini/blockly/core/constants.js +277 -0
  50. package/blocklySkini/blockly/core/contextmenu.js +307 -0
  51. package/blocklySkini/blockly/core/contextmenu_items.js +534 -0
  52. package/blocklySkini/blockly/core/contextmenu_registry.js +165 -0
  53. package/blocklySkini/blockly/core/css.js +549 -0
  54. package/blocklySkini/blockly/core/dropdowndiv.js +776 -0
  55. package/blocklySkini/blockly/core/events.js +387 -0
  56. package/blocklySkini/blockly/core/events_abstract.js +106 -0
  57. package/blocklySkini/blockly/core/extensions.js +450 -0
  58. package/blocklySkini/blockly/core/field.js +1162 -0
  59. package/blocklySkini/blockly/core/field_angle.js +562 -0
  60. package/blocklySkini/blockly/core/field_checkbox.js +220 -0
  61. package/blocklySkini/blockly/core/field_colour.js +664 -0
  62. package/blocklySkini/blockly/core/field_dropdown.js +760 -0
  63. package/blocklySkini/blockly/core/field_image.js +286 -0
  64. package/blocklySkini/blockly/core/field_label.js +130 -0
  65. package/blocklySkini/blockly/core/field_label_serializable.js +69 -0
  66. package/blocklySkini/blockly/core/field_multilineinput.js +299 -0
  67. package/blocklySkini/blockly/core/field_number.js +317 -0
  68. package/blocklySkini/blockly/core/field_registry.js +66 -0
  69. package/blocklySkini/blockly/core/field_textinput.js +616 -0
  70. package/blocklySkini/blockly/core/field_variable.js +463 -0
  71. package/blocklySkini/blockly/core/flyout_base.js +1071 -0
  72. package/blocklySkini/blockly/core/flyout_button.js +325 -0
  73. package/blocklySkini/blockly/core/flyout_dragger.js +76 -0
  74. package/blocklySkini/blockly/core/flyout_horizontal.js +388 -0
  75. package/blocklySkini/blockly/core/flyout_vertical.js +397 -0
  76. package/blocklySkini/blockly/core/generator.js +482 -0
  77. package/blocklySkini/blockly/core/gesture.js +993 -0
  78. package/blocklySkini/blockly/core/grid.js +222 -0
  79. package/blocklySkini/blockly/core/icon.js +206 -0
  80. package/blocklySkini/blockly/core/inject.js +487 -0
  81. package/blocklySkini/blockly/core/input.js +296 -0
  82. package/blocklySkini/blockly/core/insertion_marker_manager.js +700 -0
  83. package/blocklySkini/blockly/core/interfaces/i_accessibility.js +72 -0
  84. package/blocklySkini/blockly/core/interfaces/i_bounded_element.js +31 -0
  85. package/blocklySkini/blockly/core/interfaces/i_bubble.js +83 -0
  86. package/blocklySkini/blockly/core/interfaces/i_connection_checker.js +94 -0
  87. package/blocklySkini/blockly/core/interfaces/i_contextmenu.js +26 -0
  88. package/blocklySkini/blockly/core/interfaces/i_copyable.js +40 -0
  89. package/blocklySkini/blockly/core/interfaces/i_deletable.js +27 -0
  90. package/blocklySkini/blockly/core/interfaces/i_deletearea.js +28 -0
  91. package/blocklySkini/blockly/core/interfaces/i_flyout.js +178 -0
  92. package/blocklySkini/blockly/core/interfaces/i_movable.js +27 -0
  93. package/blocklySkini/blockly/core/interfaces/i_registrable.js +22 -0
  94. package/blocklySkini/blockly/core/interfaces/i_registrable_field.js +31 -0
  95. package/blocklySkini/blockly/core/interfaces/i_selectable.js +43 -0
  96. package/blocklySkini/blockly/core/interfaces/i_styleable.js +33 -0
  97. package/blocklySkini/blockly/core/interfaces/i_toolbox.js +131 -0
  98. package/blocklySkini/blockly/core/interfaces/i_toolbox_item.js +148 -0
  99. package/blocklySkini/blockly/core/keyboard_nav/action.js +26 -0
  100. package/blocklySkini/blockly/core/keyboard_nav/ast_node.js +684 -0
  101. package/blocklySkini/blockly/core/keyboard_nav/basic_cursor.js +208 -0
  102. package/blocklySkini/blockly/core/keyboard_nav/cursor.js +170 -0
  103. package/blocklySkini/blockly/core/keyboard_nav/flyout_cursor.js +106 -0
  104. package/blocklySkini/blockly/core/keyboard_nav/key_map.js +190 -0
  105. package/blocklySkini/blockly/core/keyboard_nav/marker.js +120 -0
  106. package/blocklySkini/blockly/core/keyboard_nav/navigation.js +1084 -0
  107. package/blocklySkini/blockly/core/keyboard_nav/tab_navigate_cursor.js +48 -0
  108. package/blocklySkini/blockly/core/marker_manager.js +183 -0
  109. package/blocklySkini/blockly/core/menu.js +465 -0
  110. package/blocklySkini/blockly/core/menuitem.js +280 -0
  111. package/blocklySkini/blockly/core/msg.js +31 -0
  112. package/blocklySkini/blockly/core/mutator.js +555 -0
  113. package/blocklySkini/blockly/core/names.js +186 -0
  114. package/blocklySkini/blockly/core/options.js +365 -0
  115. package/blocklySkini/blockly/core/procedures.js +404 -0
  116. package/blocklySkini/blockly/core/registry.js +265 -0
  117. package/blocklySkini/blockly/core/rendered_connection.js +565 -0
  118. package/blocklySkini/blockly/core/renderers/common/block_rendering.js +81 -0
  119. package/blocklySkini/blockly/core/renderers/common/constants.js +1256 -0
  120. package/blocklySkini/blockly/core/renderers/common/debugger.js +431 -0
  121. package/blocklySkini/blockly/core/renderers/common/drawer.js +468 -0
  122. package/blocklySkini/blockly/core/renderers/common/i_path_object.js +151 -0
  123. package/blocklySkini/blockly/core/renderers/common/info.js +775 -0
  124. package/blocklySkini/blockly/core/renderers/common/marker_svg.js +687 -0
  125. package/blocklySkini/blockly/core/renderers/common/path_object.js +279 -0
  126. package/blocklySkini/blockly/core/renderers/common/renderer.js +301 -0
  127. package/blocklySkini/blockly/core/renderers/geras/constants.js +64 -0
  128. package/blocklySkini/blockly/core/renderers/geras/drawer.js +205 -0
  129. package/blocklySkini/blockly/core/renderers/geras/highlight_constants.js +311 -0
  130. package/blocklySkini/blockly/core/renderers/geras/highlighter.js +256 -0
  131. package/blocklySkini/blockly/core/renderers/geras/info.js +483 -0
  132. package/blocklySkini/blockly/core/renderers/geras/measurables/inputs.js +67 -0
  133. package/blocklySkini/blockly/core/renderers/geras/path_object.js +177 -0
  134. package/blocklySkini/blockly/core/renderers/geras/renderer.js +138 -0
  135. package/blocklySkini/blockly/core/renderers/measurables/base.js +44 -0
  136. package/blocklySkini/blockly/core/renderers/measurables/connections.js +114 -0
  137. package/blocklySkini/blockly/core/renderers/measurables/inputs.js +160 -0
  138. package/blocklySkini/blockly/core/renderers/measurables/row_elements.js +185 -0
  139. package/blocklySkini/blockly/core/renderers/measurables/rows.js +532 -0
  140. package/blocklySkini/blockly/core/renderers/measurables/types.js +349 -0
  141. package/blocklySkini/blockly/core/renderers/minimalist/constants.js +29 -0
  142. package/blocklySkini/blockly/core/renderers/minimalist/drawer.js +32 -0
  143. package/blocklySkini/blockly/core/renderers/minimalist/info.js +45 -0
  144. package/blocklySkini/blockly/core/renderers/minimalist/renderer.js +70 -0
  145. package/blocklySkini/blockly/core/renderers/thrasos/info.js +338 -0
  146. package/blocklySkini/blockly/core/renderers/thrasos/renderer.js +45 -0
  147. package/blocklySkini/blockly/core/renderers/zelos/constants.js +1002 -0
  148. package/blocklySkini/blockly/core/renderers/zelos/drawer.js +233 -0
  149. package/blocklySkini/blockly/core/renderers/zelos/info.js +587 -0
  150. package/blocklySkini/blockly/core/renderers/zelos/marker_svg.js +148 -0
  151. package/blocklySkini/blockly/core/renderers/zelos/measurables/inputs.js +47 -0
  152. package/blocklySkini/blockly/core/renderers/zelos/measurables/row_elements.js +37 -0
  153. package/blocklySkini/blockly/core/renderers/zelos/measurables/rows.js +108 -0
  154. package/blocklySkini/blockly/core/renderers/zelos/path_object.js +244 -0
  155. package/blocklySkini/blockly/core/renderers/zelos/renderer.js +130 -0
  156. package/blocklySkini/blockly/core/requires.js +84 -0
  157. package/blocklySkini/blockly/core/scrollbar.js +880 -0
  158. package/blocklySkini/blockly/core/theme/classic.js +87 -0
  159. package/blocklySkini/blockly/core/theme/dark.js +33 -0
  160. package/blocklySkini/blockly/core/theme/deuteranopia.js +104 -0
  161. package/blocklySkini/blockly/core/theme/highcontrast.js +119 -0
  162. package/blocklySkini/blockly/core/theme/modern.js +108 -0
  163. package/blocklySkini/blockly/core/theme/tritanopia.js +103 -0
  164. package/blocklySkini/blockly/core/theme/zelos.js +106 -0
  165. package/blocklySkini/blockly/core/theme.js +236 -0
  166. package/blocklySkini/blockly/core/theme_manager.js +197 -0
  167. package/blocklySkini/blockly/core/toolbox/category.js +690 -0
  168. package/blocklySkini/blockly/core/toolbox/collapsible_category.js +294 -0
  169. package/blocklySkini/blockly/core/toolbox/separator.js +123 -0
  170. package/blocklySkini/blockly/core/toolbox/toolbox.js +984 -0
  171. package/blocklySkini/blockly/core/toolbox/toolbox_item.js +145 -0
  172. package/blocklySkini/blockly/core/toolbox.js +943 -0
  173. package/blocklySkini/blockly/core/tooltip.js +387 -0
  174. package/blocklySkini/blockly/core/touch.js +255 -0
  175. package/blocklySkini/blockly/core/touch_gesture.js +325 -0
  176. package/blocklySkini/blockly/core/trashcan.js +661 -0
  177. package/blocklySkini/blockly/core/ui_events.js +85 -0
  178. package/blocklySkini/blockly/core/utils/aria.js +167 -0
  179. package/blocklySkini/blockly/core/utils/colour.js +208 -0
  180. package/blocklySkini/blockly/core/utils/coordinate.js +125 -0
  181. package/blocklySkini/blockly/core/utils/deprecation.js +34 -0
  182. package/blocklySkini/blockly/core/utils/dom.js +391 -0
  183. package/blocklySkini/blockly/core/utils/global.js +37 -0
  184. package/blocklySkini/blockly/core/utils/idgenerator.js +33 -0
  185. package/blocklySkini/blockly/core/utils/keycodes.js +164 -0
  186. package/blocklySkini/blockly/core/utils/math.js +56 -0
  187. package/blocklySkini/blockly/core/utils/metrics.js +124 -0
  188. package/blocklySkini/blockly/core/utils/object.js +73 -0
  189. package/blocklySkini/blockly/core/utils/rect.js +54 -0
  190. package/blocklySkini/blockly/core/utils/size.js +58 -0
  191. package/blocklySkini/blockly/core/utils/string.js +284 -0
  192. package/blocklySkini/blockly/core/utils/style.js +281 -0
  193. package/blocklySkini/blockly/core/utils/svg.js +181 -0
  194. package/blocklySkini/blockly/core/utils/svg_paths.js +142 -0
  195. package/blocklySkini/blockly/core/utils/toolbox.js +401 -0
  196. package/blocklySkini/blockly/core/utils/useragent.js +110 -0
  197. package/blocklySkini/blockly/core/utils/xml.js +79 -0
  198. package/blocklySkini/blockly/core/utils.js +652 -0
  199. package/blocklySkini/blockly/core/variable_events.js +248 -0
  200. package/blocklySkini/blockly/core/variable_map.js +414 -0
  201. package/blocklySkini/blockly/core/variable_model.js +95 -0
  202. package/blocklySkini/blockly/core/variables.js +571 -0
  203. package/blocklySkini/blockly/core/variables_dynamic.js +100 -0
  204. package/blocklySkini/blockly/core/warning.js +200 -0
  205. package/blocklySkini/blockly/core/widgetdiv.js +241 -0
  206. package/blocklySkini/blockly/core/workspace.js +786 -0
  207. package/blocklySkini/blockly/core/workspace_audio.js +153 -0
  208. package/blocklySkini/blockly/core/workspace_comment.js +373 -0
  209. package/blocklySkini/blockly/core/workspace_comment_render_svg.js +461 -0
  210. package/blocklySkini/blockly/core/workspace_comment_svg.js +701 -0
  211. package/blocklySkini/blockly/core/workspace_drag_surface_svg.js +176 -0
  212. package/blocklySkini/blockly/core/workspace_dragger.js +85 -0
  213. package/blocklySkini/blockly/core/workspace_events.js +93 -0
  214. package/blocklySkini/blockly/core/workspace_svg.js +2661 -0
  215. package/blocklySkini/blockly/core/ws_comment_events.js +417 -0
  216. package/blocklySkini/blockly/core/xml.js +827 -0
  217. package/blocklySkini/blockly/core/zoom_controls.js +449 -0
  218. package/blocklySkini/blockly/core-browser.js +34 -0
  219. package/blocklySkini/blockly/core.d.ts +15 -0
  220. package/blocklySkini/blockly/core.js +38 -0
  221. package/blocklySkini/blockly/dart.d.ts +15 -0
  222. package/blocklySkini/blockly/dart.js +27 -0
  223. package/blocklySkini/blockly/dart_compressed.js +114 -0
  224. package/blocklySkini/blockly/dart_compressed.js.map +1 -0
  225. package/blocklySkini/blockly/generators/dart/colour.js +114 -0
  226. package/blocklySkini/blockly/generators/dart/lists.js +447 -0
  227. package/blocklySkini/blockly/generators/dart/logic.js +127 -0
  228. package/blocklySkini/blockly/generators/dart/loops.js +169 -0
  229. package/blocklySkini/blockly/generators/dart/math.js +485 -0
  230. package/blocklySkini/blockly/generators/dart/procedures.js +111 -0
  231. package/blocklySkini/blockly/generators/dart/text.js +339 -0
  232. package/blocklySkini/blockly/generators/dart/variables.js +32 -0
  233. package/blocklySkini/blockly/generators/dart/variables_dynamic.js +21 -0
  234. package/blocklySkini/blockly/generators/dart.js +290 -0
  235. package/blocklySkini/blockly/generators/javascript/colour.js +89 -0
  236. package/blocklySkini/blockly/generators/javascript/lists.js +388 -0
  237. package/blocklySkini/blockly/generators/javascript/logic.js +129 -0
  238. package/blocklySkini/blockly/generators/javascript/loops.js +184 -0
  239. package/blocklySkini/blockly/generators/javascript/math.js +409 -0
  240. package/blocklySkini/blockly/generators/javascript/procedures.js +113 -0
  241. package/blocklySkini/blockly/generators/javascript/text.js +367 -0
  242. package/blocklySkini/blockly/generators/javascript/variables.js +32 -0
  243. package/blocklySkini/blockly/generators/javascript/variables_dynamic.js +23 -0
  244. package/blocklySkini/blockly/generators/javascript.js +317 -0
  245. package/blocklySkini/blockly/generators/lua/colour.js +76 -0
  246. package/blocklySkini/blockly/generators/lua/lists.js +368 -0
  247. package/blocklySkini/blockly/generators/lua/logic.js +127 -0
  248. package/blocklySkini/blockly/generators/lua/loops.js +173 -0
  249. package/blocklySkini/blockly/generators/lua/math.js +423 -0
  250. package/blocklySkini/blockly/generators/lua/procedures.js +113 -0
  251. package/blocklySkini/blockly/generators/lua/text.js +353 -0
  252. package/blocklySkini/blockly/generators/lua/variables.js +32 -0
  253. package/blocklySkini/blockly/generators/lua/variables_dynamic.js +21 -0
  254. package/blocklySkini/blockly/generators/lua.js +198 -0
  255. package/blocklySkini/blockly/generators/php/colour.js +91 -0
  256. package/blocklySkini/blockly/generators/php/lists.js +498 -0
  257. package/blocklySkini/blockly/generators/php/logic.js +128 -0
  258. package/blocklySkini/blockly/generators/php/loops.js +170 -0
  259. package/blocklySkini/blockly/generators/php/math.js +370 -0
  260. package/blocklySkini/blockly/generators/php/procedures.js +132 -0
  261. package/blocklySkini/blockly/generators/php/text.js +271 -0
  262. package/blocklySkini/blockly/generators/php/variables.js +32 -0
  263. package/blocklySkini/blockly/generators/php/variables_dynamic.js +21 -0
  264. package/blocklySkini/blockly/generators/php.js +318 -0
  265. package/blocklySkini/blockly/generators/python/colour.js +72 -0
  266. package/blocklySkini/blockly/generators/python/lists.js +349 -0
  267. package/blocklySkini/blockly/generators/python/logic.js +127 -0
  268. package/blocklySkini/blockly/generators/python/loops.js +214 -0
  269. package/blocklySkini/blockly/generators/python/math.js +385 -0
  270. package/blocklySkini/blockly/generators/python/procedures.js +134 -0
  271. package/blocklySkini/blockly/generators/python/text.js +293 -0
  272. package/blocklySkini/blockly/generators/python/variables.js +32 -0
  273. package/blocklySkini/blockly/generators/python/variables_dynamic.js +21 -0
  274. package/blocklySkini/blockly/generators/python.js +322 -0
  275. package/blocklySkini/blockly/index.d.ts +22 -0
  276. package/blocklySkini/blockly/index.js +24 -0
  277. package/blocklySkini/blockly/javascript.d.ts +15 -0
  278. package/blocklySkini/blockly/javascript.js +27 -0
  279. package/blocklySkini/blockly/javascript_compressed.js +115 -0
  280. package/blocklySkini/blockly/javascript_compressed.js.map +1 -0
  281. package/blocklySkini/blockly/lua.d.ts +15 -0
  282. package/blocklySkini/blockly/lua.js +27 -0
  283. package/blocklySkini/blockly/lua_compressed.js +94 -0
  284. package/blocklySkini/blockly/lua_compressed.js.map +1 -0
  285. package/blocklySkini/blockly/media/1x1.gif +0 -0
  286. package/blocklySkini/blockly/media/click.mp3 +0 -0
  287. package/blocklySkini/blockly/media/click.ogg +0 -0
  288. package/blocklySkini/blockly/media/click.wav +0 -0
  289. package/blocklySkini/blockly/media/delete.mp3 +0 -0
  290. package/blocklySkini/blockly/media/delete.ogg +0 -0
  291. package/blocklySkini/blockly/media/delete.wav +0 -0
  292. package/blocklySkini/blockly/media/disconnect.mp3 +0 -0
  293. package/blocklySkini/blockly/media/disconnect.ogg +0 -0
  294. package/blocklySkini/blockly/media/disconnect.wav +0 -0
  295. package/blocklySkini/blockly/media/dropdown-arrow.svg +1 -0
  296. package/blocklySkini/blockly/media/handclosed.cur +0 -0
  297. package/blocklySkini/blockly/media/handdelete.cur +0 -0
  298. package/blocklySkini/blockly/media/handopen.cur +0 -0
  299. package/blocklySkini/blockly/media/pilcrow.png +0 -0
  300. package/blocklySkini/blockly/media/quote0.png +0 -0
  301. package/blocklySkini/blockly/media/quote1.png +0 -0
  302. package/blocklySkini/blockly/media/sprites.png +0 -0
  303. package/blocklySkini/blockly/media/sprites.svg +74 -0
  304. package/blocklySkini/blockly/msg/ab.d.ts +16 -0
  305. package/blocklySkini/blockly/msg/ab.js +447 -0
  306. package/blocklySkini/blockly/msg/ar.d.ts +16 -0
  307. package/blocklySkini/blockly/msg/ar.js +447 -0
  308. package/blocklySkini/blockly/msg/az.d.ts +16 -0
  309. package/blocklySkini/blockly/msg/az.js +447 -0
  310. package/blocklySkini/blockly/msg/ba.d.ts +16 -0
  311. package/blocklySkini/blockly/msg/ba.js +447 -0
  312. package/blocklySkini/blockly/msg/bcc.d.ts +16 -0
  313. package/blocklySkini/blockly/msg/bcc.js +447 -0
  314. package/blocklySkini/blockly/msg/be-tarask.d.ts +16 -0
  315. package/blocklySkini/blockly/msg/be-tarask.js +447 -0
  316. package/blocklySkini/blockly/msg/be.d.ts +16 -0
  317. package/blocklySkini/blockly/msg/be.js +447 -0
  318. package/blocklySkini/blockly/msg/bg.d.ts +16 -0
  319. package/blocklySkini/blockly/msg/bg.js +447 -0
  320. package/blocklySkini/blockly/msg/bn.d.ts +16 -0
  321. package/blocklySkini/blockly/msg/bn.js +447 -0
  322. package/blocklySkini/blockly/msg/br.d.ts +16 -0
  323. package/blocklySkini/blockly/msg/br.js +447 -0
  324. package/blocklySkini/blockly/msg/ca.d.ts +16 -0
  325. package/blocklySkini/blockly/msg/ca.js +447 -0
  326. package/blocklySkini/blockly/msg/constants.d.ts +16 -0
  327. package/blocklySkini/blockly/msg/cs.d.ts +16 -0
  328. package/blocklySkini/blockly/msg/cs.js +447 -0
  329. package/blocklySkini/blockly/msg/da.d.ts +16 -0
  330. package/blocklySkini/blockly/msg/da.js +447 -0
  331. package/blocklySkini/blockly/msg/de.d.ts +16 -0
  332. package/blocklySkini/blockly/msg/de.js +447 -0
  333. package/blocklySkini/blockly/msg/diq.d.ts +16 -0
  334. package/blocklySkini/blockly/msg/diq.js +447 -0
  335. package/blocklySkini/blockly/msg/dty.d.ts +16 -0
  336. package/blocklySkini/blockly/msg/dty.js +447 -0
  337. package/blocklySkini/blockly/msg/ee.d.ts +16 -0
  338. package/blocklySkini/blockly/msg/ee.js +447 -0
  339. package/blocklySkini/blockly/msg/el.d.ts +16 -0
  340. package/blocklySkini/blockly/msg/el.js +447 -0
  341. package/blocklySkini/blockly/msg/en-gb.d.ts +16 -0
  342. package/blocklySkini/blockly/msg/en-gb.js +447 -0
  343. package/blocklySkini/blockly/msg/en.d.ts +16 -0
  344. package/blocklySkini/blockly/msg/en.js +447 -0
  345. package/blocklySkini/blockly/msg/eo.d.ts +16 -0
  346. package/blocklySkini/blockly/msg/eo.js +447 -0
  347. package/blocklySkini/blockly/msg/es.d.ts +16 -0
  348. package/blocklySkini/blockly/msg/es.js +447 -0
  349. package/blocklySkini/blockly/msg/et.d.ts +16 -0
  350. package/blocklySkini/blockly/msg/et.js +447 -0
  351. package/blocklySkini/blockly/msg/eu.d.ts +16 -0
  352. package/blocklySkini/blockly/msg/eu.js +447 -0
  353. package/blocklySkini/blockly/msg/fa.d.ts +16 -0
  354. package/blocklySkini/blockly/msg/fa.js +447 -0
  355. package/blocklySkini/blockly/msg/fi.d.ts +16 -0
  356. package/blocklySkini/blockly/msg/fi.js +447 -0
  357. package/blocklySkini/blockly/msg/fr.d.ts +16 -0
  358. package/blocklySkini/blockly/msg/fr.js +447 -0
  359. package/blocklySkini/blockly/msg/gl.d.ts +16 -0
  360. package/blocklySkini/blockly/msg/gl.js +447 -0
  361. package/blocklySkini/blockly/msg/gor.d.ts +16 -0
  362. package/blocklySkini/blockly/msg/gor.js +447 -0
  363. package/blocklySkini/blockly/msg/ha.d.ts +16 -0
  364. package/blocklySkini/blockly/msg/ha.js +447 -0
  365. package/blocklySkini/blockly/msg/he.d.ts +16 -0
  366. package/blocklySkini/blockly/msg/he.js +447 -0
  367. package/blocklySkini/blockly/msg/hi.d.ts +16 -0
  368. package/blocklySkini/blockly/msg/hi.js +447 -0
  369. package/blocklySkini/blockly/msg/hrx.d.ts +16 -0
  370. package/blocklySkini/blockly/msg/hrx.js +447 -0
  371. package/blocklySkini/blockly/msg/hu.d.ts +16 -0
  372. package/blocklySkini/blockly/msg/hu.js +447 -0
  373. package/blocklySkini/blockly/msg/hy.d.ts +16 -0
  374. package/blocklySkini/blockly/msg/hy.js +447 -0
  375. package/blocklySkini/blockly/msg/ia.d.ts +16 -0
  376. package/blocklySkini/blockly/msg/ia.js +447 -0
  377. package/blocklySkini/blockly/msg/id.d.ts +16 -0
  378. package/blocklySkini/blockly/msg/id.js +447 -0
  379. package/blocklySkini/blockly/msg/ig.d.ts +16 -0
  380. package/blocklySkini/blockly/msg/ig.js +447 -0
  381. package/blocklySkini/blockly/msg/is.d.ts +16 -0
  382. package/blocklySkini/blockly/msg/is.js +447 -0
  383. package/blocklySkini/blockly/msg/it.d.ts +16 -0
  384. package/blocklySkini/blockly/msg/it.js +447 -0
  385. package/blocklySkini/blockly/msg/ja.d.ts +16 -0
  386. package/blocklySkini/blockly/msg/ja.js +447 -0
  387. package/blocklySkini/blockly/msg/kab.d.ts +16 -0
  388. package/blocklySkini/blockly/msg/kab.js +447 -0
  389. package/blocklySkini/blockly/msg/kn.d.ts +16 -0
  390. package/blocklySkini/blockly/msg/kn.js +447 -0
  391. package/blocklySkini/blockly/msg/ko.d.ts +16 -0
  392. package/blocklySkini/blockly/msg/ko.js +447 -0
  393. package/blocklySkini/blockly/msg/lb.d.ts +16 -0
  394. package/blocklySkini/blockly/msg/lb.js +447 -0
  395. package/blocklySkini/blockly/msg/lki.d.ts +16 -0
  396. package/blocklySkini/blockly/msg/lki.js +447 -0
  397. package/blocklySkini/blockly/msg/lo.d.ts +16 -0
  398. package/blocklySkini/blockly/msg/lo.js +447 -0
  399. package/blocklySkini/blockly/msg/lrc.d.ts +16 -0
  400. package/blocklySkini/blockly/msg/lrc.js +447 -0
  401. package/blocklySkini/blockly/msg/lt.d.ts +16 -0
  402. package/blocklySkini/blockly/msg/lt.js +447 -0
  403. package/blocklySkini/blockly/msg/lv.d.ts +16 -0
  404. package/blocklySkini/blockly/msg/lv.js +447 -0
  405. package/blocklySkini/blockly/msg/mk.d.ts +16 -0
  406. package/blocklySkini/blockly/msg/mk.js +447 -0
  407. package/blocklySkini/blockly/msg/mnw.d.ts +16 -0
  408. package/blocklySkini/blockly/msg/mnw.js +447 -0
  409. package/blocklySkini/blockly/msg/ms.d.ts +16 -0
  410. package/blocklySkini/blockly/msg/ms.js +447 -0
  411. package/blocklySkini/blockly/msg/msg.d.ts +444 -0
  412. package/blocklySkini/blockly/msg/nb.d.ts +16 -0
  413. package/blocklySkini/blockly/msg/nb.js +447 -0
  414. package/blocklySkini/blockly/msg/nl.d.ts +16 -0
  415. package/blocklySkini/blockly/msg/nl.js +447 -0
  416. package/blocklySkini/blockly/msg/oc.d.ts +16 -0
  417. package/blocklySkini/blockly/msg/oc.js +447 -0
  418. package/blocklySkini/blockly/msg/pl.d.ts +16 -0
  419. package/blocklySkini/blockly/msg/pl.js +447 -0
  420. package/blocklySkini/blockly/msg/pms.d.ts +16 -0
  421. package/blocklySkini/blockly/msg/pms.js +447 -0
  422. package/blocklySkini/blockly/msg/pt-br.d.ts +16 -0
  423. package/blocklySkini/blockly/msg/pt-br.js +447 -0
  424. package/blocklySkini/blockly/msg/pt.d.ts +16 -0
  425. package/blocklySkini/blockly/msg/pt.js +447 -0
  426. package/blocklySkini/blockly/msg/qqq.d.ts +16 -0
  427. package/blocklySkini/blockly/msg/ro.d.ts +16 -0
  428. package/blocklySkini/blockly/msg/ro.js +447 -0
  429. package/blocklySkini/blockly/msg/ru.d.ts +16 -0
  430. package/blocklySkini/blockly/msg/ru.js +447 -0
  431. package/blocklySkini/blockly/msg/sc.d.ts +16 -0
  432. package/blocklySkini/blockly/msg/sc.js +447 -0
  433. package/blocklySkini/blockly/msg/sd.d.ts +16 -0
  434. package/blocklySkini/blockly/msg/sd.js +447 -0
  435. package/blocklySkini/blockly/msg/shn.d.ts +16 -0
  436. package/blocklySkini/blockly/msg/shn.js +447 -0
  437. package/blocklySkini/blockly/msg/sk.d.ts +16 -0
  438. package/blocklySkini/blockly/msg/sk.js +447 -0
  439. package/blocklySkini/blockly/msg/skr-arab.d.ts +16 -0
  440. package/blocklySkini/blockly/msg/skr-arab.js +447 -0
  441. package/blocklySkini/blockly/msg/sl.d.ts +16 -0
  442. package/blocklySkini/blockly/msg/sl.js +447 -0
  443. package/blocklySkini/blockly/msg/sq.d.ts +16 -0
  444. package/blocklySkini/blockly/msg/sq.js +447 -0
  445. package/blocklySkini/blockly/msg/sr-latn.d.ts +16 -0
  446. package/blocklySkini/blockly/msg/sr-latn.js +447 -0
  447. package/blocklySkini/blockly/msg/sr.d.ts +16 -0
  448. package/blocklySkini/blockly/msg/sr.js +447 -0
  449. package/blocklySkini/blockly/msg/sv.d.ts +16 -0
  450. package/blocklySkini/blockly/msg/sv.js +447 -0
  451. package/blocklySkini/blockly/msg/synonyms.d.ts +16 -0
  452. package/blocklySkini/blockly/msg/ta.d.ts +16 -0
  453. package/blocklySkini/blockly/msg/ta.js +447 -0
  454. package/blocklySkini/blockly/msg/tcy.d.ts +16 -0
  455. package/blocklySkini/blockly/msg/tcy.js +447 -0
  456. package/blocklySkini/blockly/msg/te.d.ts +16 -0
  457. package/blocklySkini/blockly/msg/te.js +447 -0
  458. package/blocklySkini/blockly/msg/th.d.ts +16 -0
  459. package/blocklySkini/blockly/msg/th.js +447 -0
  460. package/blocklySkini/blockly/msg/tl.d.ts +16 -0
  461. package/blocklySkini/blockly/msg/tl.js +447 -0
  462. package/blocklySkini/blockly/msg/tlh.d.ts +16 -0
  463. package/blocklySkini/blockly/msg/tlh.js +447 -0
  464. package/blocklySkini/blockly/msg/tr.d.ts +16 -0
  465. package/blocklySkini/blockly/msg/tr.js +447 -0
  466. package/blocklySkini/blockly/msg/ug-arab.d.ts +16 -0
  467. package/blocklySkini/blockly/msg/ug-arab.js +447 -0
  468. package/blocklySkini/blockly/msg/uk.d.ts +16 -0
  469. package/blocklySkini/blockly/msg/uk.js +447 -0
  470. package/blocklySkini/blockly/msg/ur.d.ts +16 -0
  471. package/blocklySkini/blockly/msg/ur.js +447 -0
  472. package/blocklySkini/blockly/msg/vi.d.ts +16 -0
  473. package/blocklySkini/blockly/msg/vi.js +447 -0
  474. package/blocklySkini/blockly/msg/xmf.d.ts +16 -0
  475. package/blocklySkini/blockly/msg/xmf.js +447 -0
  476. package/blocklySkini/blockly/msg/yo.d.ts +16 -0
  477. package/blocklySkini/blockly/msg/yo.js +447 -0
  478. package/blocklySkini/blockly/msg/zh-hans.d.ts +16 -0
  479. package/blocklySkini/blockly/msg/zh-hans.js +447 -0
  480. package/blocklySkini/blockly/msg/zh-hant.d.ts +16 -0
  481. package/blocklySkini/blockly/msg/zh-hant.js +447 -0
  482. package/blocklySkini/blockly/node.js +35 -0
  483. package/blocklySkini/blockly/package.json +84 -0
  484. package/blocklySkini/blockly/php.d.ts +15 -0
  485. package/blocklySkini/blockly/php.js +27 -0
  486. package/blocklySkini/blockly/php_compressed.js +103 -0
  487. package/blocklySkini/blockly/php_compressed.js.map +1 -0
  488. package/blocklySkini/blockly/python.d.ts +15 -0
  489. package/blocklySkini/blockly/python.js +27 -0
  490. package/blocklySkini/blockly/python_compressed.js +98 -0
  491. package/blocklySkini/blockly/python_compressed.js.map +1 -0
  492. package/blocklySkini/blocklySkini.html +81 -0
  493. package/blocklySkini/orchestrations/.xml +1 -0
  494. package/blocklySkini/orchestrations/BluesSkini-1.xml +231 -0
  495. package/blocklySkini/orchestrations/BluesSkini-2.xml +741 -0
  496. package/blocklySkini/orchestrations/BluesSkini-3.xml +731 -0
  497. package/blocklySkini/orchestrations/BluesSkini-4.xml +695 -0
  498. package/blocklySkini/orchestrations/BluesSkini-5.xml +731 -0
  499. package/blocklySkini/orchestrations/BluesSkini.xml +704 -0
  500. package/blocklySkini/orchestrations/FunkBitwig-1.xml +778 -0
  501. package/blocklySkini/orchestrations/FunkBitwig-2.xml +471 -0
  502. package/blocklySkini/orchestrations/JouerLeBonInstrument1-1.xml +784 -0
  503. package/blocklySkini/orchestrations/MajeurMineur-1.xml +638 -0
  504. package/blocklySkini/orchestrations/Opus5-3 - Copie.xml +1041 -0
  505. package/blocklySkini/orchestrations/Opus5-3.xml +1128 -0
  506. package/blocklySkini/orchestrations/Quatuor1-1.xml +357 -0
  507. package/blocklySkini/orchestrations/TechnoBitwig-1.xml +221 -0
  508. package/blocklySkini/orchestrations/TestBlockly.xml +497 -0
  509. package/blocklySkini/orchestrations/TestBlockly1.xml +500 -0
  510. package/blocklySkini/orchestrations/TestBlockly2.xml +792 -0
  511. package/blocklySkini/orchestrations/TestBlockly3-1.xml +1182 -0
  512. package/blocklySkini/orchestrations/TestBlockly3.xml +1251 -0
  513. package/blocklySkini/orchestrations/TestFunction.xml +143 -0
  514. package/blocklySkini/orchestrations/TestIf.xml +80 -0
  515. package/blocklySkini/orchestrations/TestLoop.xml +127 -0
  516. package/blocklySkini/orchestrations/TestOrchestration2.xml +460 -0
  517. package/blocklySkini/orchestrations/TestPrint.xml +70 -0
  518. package/blocklySkini/orchestrations/TestSubMod.xml +81 -0
  519. package/blocklySkini/orchestrations/Testlogic.xml +113 -0
  520. package/blocklySkini/orchestrations/TrouveLaPercu-1.xml +813 -0
  521. package/blocklySkini/orchestrations/TrouveLaPercu-2.xml +813 -0
  522. package/blocklySkini/orchestrations/bar.xml +496 -0
  523. package/blocklySkini/orchestrations/bar2.xml +496 -0
  524. package/blocklySkini/orchestrations/foo.xml +500 -0
  525. package/blocklySkini/orchestrations/opus5Blockly - Copie.xml +496 -0
  526. package/blocklySkini/orchestrations/opus5Blockly-3.xml +868 -0
  527. package/blocklySkini/orchestrations/opus5Blockly.xml +496 -0
  528. package/blocklySkini/orchestrations/testOrchestration3.xml +483 -0
  529. package/blocklySkini/orchestrations/testOrchestration4.xml +487 -0
  530. package/blocklySkini/scripts/hiphop_blocks.js +6104 -0
  531. package/blocklySkini/scripts/main2.js +801 -0
  532. package/blocklySkini/styles/index.css +320 -0
  533. package/blocklySkini/styles/material.css +11552 -0
  534. package/package.json +4 -3
@@ -0,0 +1,1256 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @fileoverview An object that provides constants for rendering blocks.
9
+ * @author fenichel@google.com (Rachel Fenichel)
10
+ */
11
+ 'use strict';
12
+
13
+ goog.provide('Blockly.blockRendering.ConstantProvider');
14
+
15
+ goog.require('Blockly.utils');
16
+ goog.require('Blockly.utils.colour');
17
+ goog.require('Blockly.utils.dom');
18
+ goog.require('Blockly.utils.Svg');
19
+ goog.require('Blockly.utils.svgPaths');
20
+ goog.require('Blockly.utils.userAgent');
21
+
22
+ goog.requireType('Blockly.blockRendering.Debug');
23
+
24
+
25
+ /**
26
+ * An object that provides constants for rendering blocks.
27
+ * @constructor
28
+ * @package
29
+ */
30
+ Blockly.blockRendering.ConstantProvider = function() {
31
+
32
+ /**
33
+ * The size of an empty spacer.
34
+ * @type {number}
35
+ */
36
+ this.NO_PADDING = 0;
37
+
38
+ /**
39
+ * The size of small padding.
40
+ * @type {number}
41
+ */
42
+ this.SMALL_PADDING = 3;
43
+
44
+ /**
45
+ * The size of medium padding.
46
+ * @type {number}
47
+ */
48
+ this.MEDIUM_PADDING = 5;
49
+
50
+ /**
51
+ * The size of medium-large padding.
52
+ * @type {number}
53
+ */
54
+ this.MEDIUM_LARGE_PADDING = 8;
55
+
56
+ /**
57
+ * The size of large padding.
58
+ * @type {number}
59
+ */
60
+ this.LARGE_PADDING = 10;
61
+
62
+ /**
63
+ * Offset from the top of the row for placing fields on inline input rows
64
+ * and statement input rows.
65
+ * Matches existing rendering (in 2019).
66
+ * @type {number}
67
+ */
68
+ this.TALL_INPUT_FIELD_OFFSET_Y = this.MEDIUM_PADDING;
69
+
70
+ /**
71
+ * The height of the puzzle tab used for input and output connections.
72
+ * @type {number}
73
+ */
74
+ this.TAB_HEIGHT = 15;
75
+
76
+ /**
77
+ * The offset from the top of the block at which a puzzle tab is positioned.
78
+ * @type {number}
79
+ */
80
+ this.TAB_OFFSET_FROM_TOP = 5;
81
+
82
+ /**
83
+ * Vertical overlap of the puzzle tab, used to make it look more like a puzzle
84
+ * piece.
85
+ * @type {number}
86
+ */
87
+ this.TAB_VERTICAL_OVERLAP = 2.5;
88
+
89
+ /**
90
+ * The width of the puzzle tab used for input and output connections.
91
+ * @type {number}
92
+ */
93
+ this.TAB_WIDTH = 8;
94
+
95
+ /**
96
+ * The width of the notch used for previous and next connections.
97
+ * @type {number}
98
+ */
99
+ this.NOTCH_WIDTH = 15;
100
+
101
+ /**
102
+ * The height of the notch used for previous and next connections.
103
+ * @type {number}
104
+ */
105
+ this.NOTCH_HEIGHT = 4;
106
+
107
+ /**
108
+ * The minimum width of the block.
109
+ * @type {number}
110
+ */
111
+ this.MIN_BLOCK_WIDTH = 12;
112
+
113
+ this.EMPTY_BLOCK_SPACER_HEIGHT = 16;
114
+
115
+ /**
116
+ * The minimum height of a dummy input row.
117
+ * @type {number}
118
+ */
119
+ this.DUMMY_INPUT_MIN_HEIGHT = this.TAB_HEIGHT;
120
+
121
+ /**
122
+ * The minimum height of a dummy input row in a shadow block.
123
+ * @type {number}
124
+ */
125
+ this.DUMMY_INPUT_SHADOW_MIN_HEIGHT = this.TAB_HEIGHT;
126
+
127
+ /**
128
+ * Rounded corner radius.
129
+ * @type {number}
130
+ */
131
+ this.CORNER_RADIUS = 8;
132
+
133
+ /**
134
+ * Offset from the left side of a block or the inside of a statement input to
135
+ * the left side of the notch.
136
+ * @type {number}
137
+ */
138
+ this.NOTCH_OFFSET_LEFT = 15;
139
+
140
+ /**
141
+ * Additional offset added to the statement input's width to account for the
142
+ * notch.
143
+ * @type {number}
144
+ */
145
+ this.STATEMENT_INPUT_NOTCH_OFFSET = this.NOTCH_OFFSET_LEFT;
146
+
147
+ this.STATEMENT_BOTTOM_SPACER = 0;
148
+ this.STATEMENT_INPUT_PADDING_LEFT = 20;
149
+
150
+ /**
151
+ * Vertical padding between consecutive statement inputs.
152
+ * @type {number}
153
+ */
154
+ this.BETWEEN_STATEMENT_PADDING_Y = 4;
155
+
156
+ /**
157
+ * The top row's minimum height.
158
+ * @type {number}
159
+ */
160
+ this.TOP_ROW_MIN_HEIGHT = this.MEDIUM_PADDING;
161
+
162
+ /**
163
+ * The top row's minimum height if it precedes a statement.
164
+ * @type {number}
165
+ */
166
+ this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT = this.LARGE_PADDING;
167
+
168
+ /**
169
+ * The bottom row's minimum height.
170
+ * @type {number}
171
+ */
172
+ this.BOTTOM_ROW_MIN_HEIGHT = this.MEDIUM_PADDING;
173
+
174
+ /**
175
+ * The bottom row's minimum height if it follows a statement input.
176
+ * @type {number}
177
+ */
178
+ this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT = this.LARGE_PADDING;
179
+
180
+ /**
181
+ * Whether to add a 'hat' on top of all blocks with no previous or output
182
+ * connections. Can be overridden by 'hat' property on Theme.BlockStyle.
183
+ * @type {boolean}
184
+ */
185
+ this.ADD_START_HATS = false;
186
+
187
+ /**
188
+ * Height of the top hat.
189
+ * @type {number}
190
+ */
191
+ this.START_HAT_HEIGHT = 15;
192
+
193
+ /**
194
+ * Width of the top hat.
195
+ * @type {number}
196
+ */
197
+ this.START_HAT_WIDTH = 100;
198
+
199
+ this.SPACER_DEFAULT_HEIGHT = 15;
200
+
201
+ this.MIN_BLOCK_HEIGHT = 24;
202
+
203
+ this.EMPTY_INLINE_INPUT_PADDING = 14.5;
204
+
205
+ /**
206
+ * The height of an empty inline input.
207
+ * @type {number}
208
+ */
209
+ this.EMPTY_INLINE_INPUT_HEIGHT = this.TAB_HEIGHT + 11;
210
+
211
+ this.EXTERNAL_VALUE_INPUT_PADDING = 2;
212
+
213
+ /**
214
+ * The height of an empty statement input. Note that in the old rendering this
215
+ * varies slightly depending on whether the block has external or inline inputs.
216
+ * In the new rendering this is consistent. It seems unlikely that the old
217
+ * behaviour was intentional.
218
+ * @type {number}
219
+ */
220
+ this.EMPTY_STATEMENT_INPUT_HEIGHT = this.MIN_BLOCK_HEIGHT;
221
+
222
+ this.START_POINT = Blockly.utils.svgPaths.moveBy(0, 0);
223
+
224
+ /**
225
+ * Height of SVG path for jagged teeth at the end of collapsed blocks.
226
+ * @type {number}
227
+ */
228
+ this.JAGGED_TEETH_HEIGHT = 12;
229
+
230
+ /**
231
+ * Width of SVG path for jagged teeth at the end of collapsed blocks.
232
+ * @type {number}
233
+ */
234
+ this.JAGGED_TEETH_WIDTH = 6;
235
+
236
+ /**
237
+ * Point size of text.
238
+ * @type {number}
239
+ */
240
+ this.FIELD_TEXT_FONTSIZE = 11;
241
+
242
+ /**
243
+ * Text font weight.
244
+ * @type {string}
245
+ */
246
+ this.FIELD_TEXT_FONTWEIGHT = 'normal';
247
+
248
+ /**
249
+ * Text font family.
250
+ * @type {string}
251
+ */
252
+ this.FIELD_TEXT_FONTFAMILY = 'sans-serif';
253
+
254
+ /**
255
+ * Height of text. This constant is dynamically set in ``setFontConstants_``
256
+ * to be the height of the text based on the font used.
257
+ * @type {number}
258
+ */
259
+ this.FIELD_TEXT_HEIGHT = -1; // Dynamically set
260
+
261
+ /**
262
+ * Text baseline. This constant is dynamically set in ``setFontConstants_``
263
+ * to be the baseline of the text based on the font used.
264
+ * @type {number}
265
+ */
266
+ this.FIELD_TEXT_BASELINE = -1; // Dynamically set
267
+
268
+ /**
269
+ * A field's border rect corner radius.
270
+ * @type {number}
271
+ */
272
+ this.FIELD_BORDER_RECT_RADIUS = 4;
273
+
274
+ /**
275
+ * A field's border rect default height.
276
+ * @type {number}
277
+ */
278
+ this.FIELD_BORDER_RECT_HEIGHT = 16;
279
+
280
+ /**
281
+ * A field's border rect X padding.
282
+ * @type {number}
283
+ */
284
+ this.FIELD_BORDER_RECT_X_PADDING = 5;
285
+
286
+ /**
287
+ * A field's border rect Y padding.
288
+ * @type {number}
289
+ */
290
+ this.FIELD_BORDER_RECT_Y_PADDING = 3;
291
+
292
+ /**
293
+ * The backing colour of a field's border rect.
294
+ * @type {string}
295
+ * @package
296
+ */
297
+ this.FIELD_BORDER_RECT_COLOUR = '#fff';
298
+
299
+ /**
300
+ * A field's text element's dominant baseline.
301
+ * @type {boolean}
302
+ */
303
+ this.FIELD_TEXT_BASELINE_CENTER =
304
+ !Blockly.utils.userAgent.IE && !Blockly.utils.userAgent.EDGE;
305
+
306
+ /**
307
+ * A dropdown field's border rect height.
308
+ * @type {number}
309
+ */
310
+ this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT = this.FIELD_BORDER_RECT_HEIGHT;
311
+
312
+ /**
313
+ * Whether or not a dropdown field should add a border rect when in a shadow
314
+ * block.
315
+ * @type {boolean}
316
+ */
317
+ this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW = false;
318
+
319
+ /**
320
+ * Whether or not a dropdown field's div should be coloured to match the
321
+ * block colours.
322
+ * @type {boolean}
323
+ */
324
+ this.FIELD_DROPDOWN_COLOURED_DIV = false;
325
+
326
+ /**
327
+ * Whether or not a dropdown field uses a text or SVG arrow.
328
+ * @type {boolean}
329
+ */
330
+ this.FIELD_DROPDOWN_SVG_ARROW = false;
331
+
332
+ /**
333
+ * A dropdown field's SVG arrow padding.
334
+ * @type {number}
335
+ */
336
+ this.FIELD_DROPDOWN_SVG_ARROW_PADDING = this.FIELD_BORDER_RECT_X_PADDING;
337
+
338
+ /**
339
+ * A dropdown field's SVG arrow size.
340
+ * @type {number}
341
+ */
342
+ this.FIELD_DROPDOWN_SVG_ARROW_SIZE = 12;
343
+
344
+ /**
345
+ * A dropdown field's SVG arrow datauri.
346
+ * @type {string}
347
+ */
348
+ this.FIELD_DROPDOWN_SVG_ARROW_DATAURI =
349
+ 'data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllci' +
350
+ 'AxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaG' +
351
+ 'VpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLW' +
352
+ 'Fycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuND' +
353
+ 'EsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTD' +
354
+ 'AuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNz' +
355
+ 'FDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMC' +
356
+ 'wxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNz' +
357
+ 'lhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYz' +
358
+ 'AuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMz' +
359
+ 'dBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=';
360
+
361
+ /**
362
+ * Whether or not to show a box shadow around the widget div. This is only a
363
+ * feature of full block fields.
364
+ * @type {boolean}
365
+ */
366
+ this.FIELD_TEXTINPUT_BOX_SHADOW = false;
367
+
368
+ /**
369
+ * Whether or not the colour field should display its colour value on the
370
+ * entire block.
371
+ * @type {boolean}
372
+ */
373
+ this.FIELD_COLOUR_FULL_BLOCK = false;
374
+
375
+ /**
376
+ * A colour field's default width.
377
+ * @type {number}
378
+ */
379
+ this.FIELD_COLOUR_DEFAULT_WIDTH = 26;
380
+
381
+ /**
382
+ * A colour field's default height.
383
+ * @type {number}
384
+ */
385
+ this.FIELD_COLOUR_DEFAULT_HEIGHT = this.FIELD_BORDER_RECT_HEIGHT;
386
+
387
+ /**
388
+ * A checkbox field's X offset.
389
+ * @type {number}
390
+ */
391
+ this.FIELD_CHECKBOX_X_OFFSET = this.FIELD_BORDER_RECT_X_PADDING - 3;
392
+
393
+ /**
394
+ * A random identifier used to ensure a unique ID is used for each
395
+ * filter/pattern for the case of multiple Blockly instances on a page.
396
+ * @type {string}
397
+ * @package
398
+ */
399
+ this.randomIdentifier = String(Math.random()).substring(2);
400
+
401
+ /**
402
+ * The ID of the emboss filter, or the empty string if no filter is set.
403
+ * @type {string}
404
+ * @package
405
+ */
406
+ this.embossFilterId = '';
407
+
408
+ /**
409
+ * The <filter> element to use for highlighting, or null if not set.
410
+ * @type {SVGElement}
411
+ * @private
412
+ */
413
+ this.embossFilter_ = null;
414
+
415
+ /**
416
+ * The ID of the disabled pattern, or the empty string if no pattern is set.
417
+ * @type {string}
418
+ * @package
419
+ */
420
+ this.disabledPatternId = '';
421
+
422
+ /**
423
+ * The <pattern> element to use for disabled blocks, or null if not set.
424
+ * @type {SVGElement}
425
+ * @private
426
+ */
427
+ this.disabledPattern_ = null;
428
+
429
+ /**
430
+ * The ID of the debug filter, or the empty string if no pattern is set.
431
+ * @type {string}
432
+ * @package
433
+ */
434
+ this.debugFilterId = '';
435
+
436
+ /**
437
+ * The <filter> element to use for a debug highlight, or null if not set.
438
+ * @type {SVGElement}
439
+ * @private
440
+ */
441
+ this.debugFilter_ = null;
442
+
443
+ /**
444
+ * The <style> element to use for injecting renderer specific CSS.
445
+ * @type {HTMLStyleElement}
446
+ * @private
447
+ */
448
+ this.cssNode_ = null;
449
+
450
+ /**
451
+ * Cursor colour.
452
+ * @type {string}
453
+ * @package
454
+ */
455
+ this.CURSOR_COLOUR = '#cc0a0a';
456
+
457
+ /**
458
+ * Immovable marker colour.
459
+ * @type {string}
460
+ * @package
461
+ */
462
+ this.MARKER_COLOUR = '#4286f4';
463
+
464
+ /**
465
+ * Width of the horizontal cursor.
466
+ * @type {number}
467
+ * @package
468
+ */
469
+ this.CURSOR_WS_WIDTH = 100;
470
+
471
+ /**
472
+ * Height of the horizontal cursor.
473
+ * @type {number}
474
+ * @package
475
+ */
476
+ this.WS_CURSOR_HEIGHT = 5;
477
+
478
+ /**
479
+ * Padding around a stack.
480
+ * @type {number}
481
+ * @package
482
+ */
483
+ this.CURSOR_STACK_PADDING = 10;
484
+
485
+ /**
486
+ * Padding around a block.
487
+ * @type {number}
488
+ * @package
489
+ */
490
+ this.CURSOR_BLOCK_PADDING = 2;
491
+
492
+ /**
493
+ * Stroke of the cursor.
494
+ * @type {number}
495
+ * @package
496
+ */
497
+ this.CURSOR_STROKE_WIDTH = 4;
498
+
499
+ /**
500
+ * Whether text input and colour fields fill up the entire source block.
501
+ * @type {boolean}
502
+ * @package
503
+ */
504
+ this.FULL_BLOCK_FIELDS = false;
505
+
506
+ /**
507
+ * The main colour of insertion markers, in hex. The block is rendered a
508
+ * transparent grey by changing the fill opacity in CSS.
509
+ * @type {string}
510
+ * @package
511
+ */
512
+ this.INSERTION_MARKER_COLOUR = '#000000';
513
+
514
+ /**
515
+ * The insertion marker opacity.
516
+ * @type {number}
517
+ * @package
518
+ */
519
+ this.INSERTION_MARKER_OPACITY = 0.2;
520
+
521
+ /**
522
+ * Enum for connection shapes.
523
+ * @enum {number}
524
+ */
525
+ this.SHAPES = {
526
+ PUZZLE: 1,
527
+ NOTCH: 2
528
+ };
529
+ };
530
+
531
+ /**
532
+ * Initialize shape objects based on the constants set in the constructor.
533
+ * @package
534
+ */
535
+ Blockly.blockRendering.ConstantProvider.prototype.init = function() {
536
+
537
+ /**
538
+ * An object containing sizing and path information about collapsed block
539
+ * indicators.
540
+ * @type {!Object}
541
+ */
542
+ this.JAGGED_TEETH = this.makeJaggedTeeth();
543
+
544
+ /**
545
+ * An object containing sizing and path information about notches.
546
+ * @type {!Object}
547
+ */
548
+ this.NOTCH = this.makeNotch();
549
+
550
+ /**
551
+ * An object containing sizing and path information about start hats
552
+ * @type {!Object}
553
+ */
554
+ this.START_HAT = this.makeStartHat();
555
+
556
+ /**
557
+ * An object containing sizing and path information about puzzle tabs.
558
+ * @type {!Object}
559
+ */
560
+ this.PUZZLE_TAB = this.makePuzzleTab();
561
+
562
+ /**
563
+ * An object containing sizing and path information about inside corners
564
+ * @type {!Object}
565
+ */
566
+ this.INSIDE_CORNERS = this.makeInsideCorners();
567
+
568
+ /**
569
+ * An object containing sizing and path information about outside corners.
570
+ * @type {!Object}
571
+ */
572
+ this.OUTSIDE_CORNERS = this.makeOutsideCorners();
573
+ };
574
+
575
+ /**
576
+ * Refresh constants properties that depend on the theme.
577
+ * @param {!Blockly.Theme} theme The current workspace theme.
578
+ * @package
579
+ */
580
+ Blockly.blockRendering.ConstantProvider.prototype.setTheme = function(
581
+ theme) {
582
+
583
+ /**
584
+ * The block styles map.
585
+ * @type {Object.<string, Blockly.Theme.BlockStyle>}
586
+ * @package
587
+ */
588
+ this.blockStyles = {};
589
+
590
+ var blockStyles = theme.blockStyles;
591
+ for (var key in blockStyles) {
592
+ this.blockStyles[key] = this.validatedBlockStyle_(blockStyles[key]);
593
+ }
594
+
595
+ this.setDynamicProperties_(theme);
596
+ };
597
+
598
+ /**
599
+ * Sets dynamic properties that depend on other values or theme properties.
600
+ * @param {!Blockly.Theme} theme The current workspace theme.
601
+ * @protected
602
+ */
603
+ Blockly.blockRendering.ConstantProvider.prototype.setDynamicProperties_ =
604
+ function(theme) {
605
+ /* eslint-disable indent */
606
+ this.setFontConstants_(theme);
607
+ this.setComponentConstants_(theme);
608
+
609
+ this.ADD_START_HATS = theme.startHats != null ? theme.startHats :
610
+ this.ADD_START_HATS;
611
+ }; /* eslint-enable indent */
612
+
613
+ /**
614
+ * Set constants related to fonts.
615
+ * @param {!Blockly.Theme} theme The current workspace theme.
616
+ * @protected
617
+ */
618
+ Blockly.blockRendering.ConstantProvider.prototype.setFontConstants_ = function(
619
+ theme) {
620
+ this.FIELD_TEXT_FONTFAMILY =
621
+ theme.fontStyle && theme.fontStyle['family'] != undefined ?
622
+ theme.fontStyle['family'] : this.FIELD_TEXT_FONTFAMILY;
623
+ this.FIELD_TEXT_FONTWEIGHT =
624
+ theme.fontStyle && theme.fontStyle['weight'] != undefined ?
625
+ theme.fontStyle['weight'] : this.FIELD_TEXT_FONTWEIGHT;
626
+ this.FIELD_TEXT_FONTSIZE =
627
+ theme.fontStyle && theme.fontStyle['size'] != undefined ?
628
+ theme.fontStyle['size'] : this.FIELD_TEXT_FONTSIZE;
629
+
630
+ var fontMetrics = Blockly.utils.dom.measureFontMetrics('Hg',
631
+ this.FIELD_TEXT_FONTSIZE + 'pt',
632
+ this.FIELD_TEXT_FONTWEIGHT,
633
+ this.FIELD_TEXT_FONTFAMILY);
634
+
635
+ this.FIELD_TEXT_HEIGHT = fontMetrics.height;
636
+ this.FIELD_TEXT_BASELINE = fontMetrics.baseline;
637
+ };
638
+
639
+ /**
640
+ * Set constants from a theme's component styles.
641
+ * @param {!Blockly.Theme} theme The current workspace theme.
642
+ * @protected
643
+ */
644
+ Blockly.blockRendering.ConstantProvider.prototype.setComponentConstants_ =
645
+ function(theme) {
646
+ /* eslint-disable indent */
647
+ this.CURSOR_COLOUR = theme.getComponentStyle('cursorColour') ||
648
+ this.CURSOR_COLOUR;
649
+ this.MARKER_COLOUR = theme.getComponentStyle('markerColour') ||
650
+ this.MARKER_COLOUR;
651
+ this.INSERTION_MARKER_COLOUR =
652
+ theme.getComponentStyle('insertionMarkerColour') ||
653
+ this.INSERTION_MARKER_COLOUR;
654
+ this.INSERTION_MARKER_OPACITY =
655
+ Number(theme.getComponentStyle('insertionMarkerOpacity')) ||
656
+ this.INSERTION_MARKER_OPACITY;
657
+ }; /* eslint-enable indent */
658
+
659
+ /**
660
+ * Get or create a block style based on a single colour value. Generate a name
661
+ * for the style based on the colour.
662
+ * @param {string} colour #RRGGBB colour string.
663
+ * @return {{style: !Blockly.Theme.BlockStyle, name: string}} An object
664
+ * containing the style and an autogenerated name for that style.
665
+ * @package
666
+ */
667
+ Blockly.blockRendering.ConstantProvider.prototype.getBlockStyleForColour =
668
+ function(colour) {
669
+ /* eslint-disable indent */
670
+ var name = 'auto_' + colour;
671
+ if (!this.blockStyles[name]) {
672
+ this.blockStyles[name] = this.createBlockStyle_(colour);
673
+ }
674
+ return {style: this.blockStyles[name], name: name};
675
+ }; /* eslint-enable indent */
676
+
677
+ /**
678
+ * Gets the BlockStyle for the given block style name.
679
+ * @param {?string} blockStyleName The name of the block style.
680
+ * @return {!Blockly.Theme.BlockStyle} The named block style, or a default style
681
+ * if no style with the given name was found.
682
+ */
683
+ Blockly.blockRendering.ConstantProvider.prototype.getBlockStyle = function(
684
+ blockStyleName) {
685
+ return this.blockStyles[blockStyleName || ''] ||
686
+ (blockStyleName && blockStyleName.indexOf('auto_') == 0 ?
687
+ this.getBlockStyleForColour(blockStyleName.substring(5)).style :
688
+ this.createBlockStyle_('#000000'));
689
+ };
690
+
691
+ /**
692
+ * Create a block style object based on the given colour.
693
+ * @param {string} colour #RRGGBB colour string.
694
+ * @return {!Blockly.Theme.BlockStyle} A populated block style based on the
695
+ * given colour.
696
+ * @protected
697
+ */
698
+ Blockly.blockRendering.ConstantProvider.prototype.createBlockStyle_ = function(
699
+ colour) {
700
+ return this.validatedBlockStyle_({
701
+ 'colourPrimary': colour
702
+ });
703
+ };
704
+
705
+ /**
706
+ * Get a full block style object based on the input style object. Populate
707
+ * any missing values.
708
+ * @param {{
709
+ * colourPrimary:string,
710
+ * colourSecondary:(string|undefined),
711
+ * colourTertiary:(string|undefined),
712
+ * hat:(string|undefined)
713
+ * }} blockStyle A full or partial block style object.
714
+
715
+ * @return {!Blockly.Theme.BlockStyle} A full block style object, with all
716
+ * required properties populated.
717
+ * @protected
718
+ */
719
+ Blockly.blockRendering.ConstantProvider.prototype.validatedBlockStyle_ =
720
+ function(blockStyle) {
721
+ /* eslint-disable indent */
722
+ // Make a new object with all of the same properties.
723
+ var valid = /** @type {!Blockly.Theme.BlockStyle} */ ({});
724
+ if (blockStyle) {
725
+ Blockly.utils.object.mixin(valid, blockStyle);
726
+ }
727
+ // Validate required properties.
728
+ var parsedColour = Blockly.utils.parseBlockColour(
729
+ valid['colourPrimary'] || '#000');
730
+ valid.colourPrimary = parsedColour.hex;
731
+ valid.colourSecondary = valid['colourSecondary'] ?
732
+ Blockly.utils.parseBlockColour(valid['colourSecondary']).hex :
733
+ this.generateSecondaryColour_(valid.colourPrimary);
734
+ valid.colourTertiary = valid['colourTertiary'] ?
735
+ Blockly.utils.parseBlockColour(valid['colourTertiary']).hex :
736
+ this.generateTertiaryColour_(valid.colourPrimary);
737
+
738
+ valid.hat = valid['hat'] || '';
739
+ return valid;
740
+ }; /* eslint-enable indent */
741
+
742
+ /**
743
+ * Generate a secondary colour from the passed in primary colour.
744
+ * @param {string} colour Primary colour.
745
+ * @return {string} The generated secondary colour.
746
+ * @protected
747
+ */
748
+ Blockly.blockRendering.ConstantProvider.prototype.generateSecondaryColour_ =
749
+ function(colour) {
750
+ /* eslint-disable indent */
751
+ return Blockly.utils.colour.blend('#fff', colour, 0.6) || colour;
752
+ }; /* eslint-enable indent */
753
+
754
+ /**
755
+ * Generate a tertiary colour from the passed in primary colour.
756
+ * @param {string} colour Primary colour.
757
+ * @return {string} The generated tertiary colour.
758
+ * @protected
759
+ */
760
+ Blockly.blockRendering.ConstantProvider.prototype.generateTertiaryColour_ =
761
+ function(colour) {
762
+ /* eslint-disable indent */
763
+ return Blockly.utils.colour.blend('#fff', colour, 0.3) || colour;
764
+ }; /* eslint-enable indent */
765
+
766
+
767
+ /**
768
+ * Dispose of this constants provider.
769
+ * Delete all DOM elements that this provider created.
770
+ * @package
771
+ */
772
+ Blockly.blockRendering.ConstantProvider.prototype.dispose = function() {
773
+ if (this.embossFilter_) {
774
+ Blockly.utils.dom.removeNode(this.embossFilter_);
775
+ }
776
+ if (this.disabledPattern_) {
777
+ Blockly.utils.dom.removeNode(this.disabledPattern_);
778
+ }
779
+ if (this.debugFilter_) {
780
+ Blockly.utils.dom.removeNode(this.debugFilter_);
781
+ }
782
+ this.cssNode_ = null;
783
+ };
784
+
785
+ /**
786
+ * @return {!Object} An object containing sizing and path information about
787
+ * collapsed block indicators.
788
+ * @package
789
+ */
790
+ Blockly.blockRendering.ConstantProvider.prototype.makeJaggedTeeth = function() {
791
+ var height = this.JAGGED_TEETH_HEIGHT;
792
+ var width = this.JAGGED_TEETH_WIDTH;
793
+
794
+ var mainPath =
795
+ Blockly.utils.svgPaths.line(
796
+ [
797
+ Blockly.utils.svgPaths.point(width, height / 4),
798
+ Blockly.utils.svgPaths.point(-width * 2, height / 2),
799
+ Blockly.utils.svgPaths.point(width, height / 4)
800
+ ]);
801
+ return {
802
+ height: height,
803
+ width: width,
804
+ path: mainPath
805
+ };
806
+ };
807
+
808
+ /**
809
+ * @return {!Object} An object containing sizing and path information about
810
+ * start hats.
811
+ * @package
812
+ */
813
+ Blockly.blockRendering.ConstantProvider.prototype.makeStartHat = function() {
814
+ var height = this.START_HAT_HEIGHT;
815
+ var width = this.START_HAT_WIDTH;
816
+
817
+ var mainPath =
818
+ Blockly.utils.svgPaths.curve('c',
819
+ [
820
+ Blockly.utils.svgPaths.point(30, -height),
821
+ Blockly.utils.svgPaths.point(70, -height),
822
+ Blockly.utils.svgPaths.point(width, 0)
823
+ ]);
824
+ return {
825
+ height: height,
826
+ width: width,
827
+ path: mainPath
828
+ };
829
+ };
830
+
831
+ /**
832
+ * @return {!Object} An object containing sizing and path information about
833
+ * puzzle tabs.
834
+ * @package
835
+ */
836
+ Blockly.blockRendering.ConstantProvider.prototype.makePuzzleTab = function() {
837
+ var width = this.TAB_WIDTH;
838
+ var height = this.TAB_HEIGHT;
839
+
840
+ // The main path for the puzzle tab is made out of a few curves (c and s).
841
+ // Those curves are defined with relative positions. The 'up' and 'down'
842
+ // versions of the paths are the same, but the Y sign flips. Forward and back
843
+ // are the signs to use to move the cursor in the direction that the path is
844
+ // being drawn.
845
+ function makeMainPath(up) {
846
+ var forward = up ? -1 : 1;
847
+ var back = -forward;
848
+
849
+ var overlap = 2.5;
850
+ var halfHeight = height / 2;
851
+ var control1Y = halfHeight + overlap;
852
+ var control2Y = halfHeight + 0.5;
853
+ var control3Y = overlap; // 2.5
854
+
855
+ var endPoint1 = Blockly.utils.svgPaths.point(-width, forward * halfHeight);
856
+ var endPoint2 = Blockly.utils.svgPaths.point(width, forward * halfHeight);
857
+
858
+ return Blockly.utils.svgPaths.curve('c',
859
+ [
860
+ Blockly.utils.svgPaths.point(0, forward * control1Y),
861
+ Blockly.utils.svgPaths.point(-width, back * control2Y),
862
+ endPoint1
863
+ ]) +
864
+ Blockly.utils.svgPaths.curve('s',
865
+ [
866
+ Blockly.utils.svgPaths.point(width, back * control3Y),
867
+ endPoint2
868
+ ]);
869
+ }
870
+
871
+ // c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5
872
+ var pathUp = makeMainPath(true);
873
+ // c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5
874
+ var pathDown = makeMainPath(false);
875
+
876
+ return {
877
+ type: this.SHAPES.PUZZLE,
878
+ width: width,
879
+ height: height,
880
+ pathDown: pathDown,
881
+ pathUp: pathUp
882
+ };
883
+ };
884
+
885
+ /**
886
+ * @return {!Object} An object containing sizing and path information about
887
+ * notches.
888
+ * @package
889
+ */
890
+ Blockly.blockRendering.ConstantProvider.prototype.makeNotch = function() {
891
+ var width = this.NOTCH_WIDTH;
892
+ var height = this.NOTCH_HEIGHT;
893
+ var innerWidth = 3;
894
+ var outerWidth = (width - innerWidth) / 2;
895
+ function makeMainPath(dir) {
896
+ return Blockly.utils.svgPaths.line(
897
+ [
898
+ Blockly.utils.svgPaths.point(dir * outerWidth, height),
899
+ Blockly.utils.svgPaths.point(dir * innerWidth, 0),
900
+ Blockly.utils.svgPaths.point(dir * outerWidth, -height)
901
+ ]);
902
+ }
903
+ var pathLeft = makeMainPath(1);
904
+ var pathRight = makeMainPath(-1);
905
+
906
+ return {
907
+ type: this.SHAPES.NOTCH,
908
+ width: width,
909
+ height: height,
910
+ pathLeft: pathLeft,
911
+ pathRight: pathRight
912
+ };
913
+ };
914
+
915
+ /**
916
+ * @return {!Object} An object containing sizing and path information about
917
+ * inside corners.
918
+ * @package
919
+ */
920
+ Blockly.blockRendering.ConstantProvider.prototype.makeInsideCorners = function() {
921
+ var radius = this.CORNER_RADIUS;
922
+
923
+ var innerTopLeftCorner = Blockly.utils.svgPaths.arc('a', '0 0,0', radius,
924
+ Blockly.utils.svgPaths.point(-radius, radius));
925
+
926
+ var innerBottomLeftCorner = Blockly.utils.svgPaths.arc('a', '0 0,0', radius,
927
+ Blockly.utils.svgPaths.point(radius, radius));
928
+
929
+ return {
930
+ width: radius,
931
+ height: radius,
932
+ pathTop: innerTopLeftCorner,
933
+ pathBottom: innerBottomLeftCorner
934
+ };
935
+ };
936
+
937
+ /**
938
+ * @return {!Object} An object containing sizing and path information about
939
+ * outside corners.
940
+ * @package
941
+ */
942
+ Blockly.blockRendering.ConstantProvider.prototype.makeOutsideCorners = function() {
943
+ var radius = this.CORNER_RADIUS;
944
+ /**
945
+ * SVG path for drawing the rounded top-left corner.
946
+ * @const
947
+ */
948
+ var topLeft =
949
+ Blockly.utils.svgPaths.moveBy(0, radius) +
950
+ Blockly.utils.svgPaths.arc('a', '0 0,1', radius,
951
+ Blockly.utils.svgPaths.point(radius, -radius));
952
+
953
+ /**
954
+ * SVG path for drawing the rounded top-right corner.
955
+ * @const
956
+ */
957
+ var topRight =
958
+ Blockly.utils.svgPaths.arc('a', '0 0,1', radius,
959
+ Blockly.utils.svgPaths.point(radius, radius));
960
+
961
+ /**
962
+ * SVG path for drawing the rounded bottom-left corner.
963
+ * @const
964
+ */
965
+ var bottomLeft = Blockly.utils.svgPaths.arc('a', '0 0,1', radius,
966
+ Blockly.utils.svgPaths.point(-radius, -radius));
967
+
968
+ /**
969
+ * SVG path for drawing the rounded bottom-right corner.
970
+ * @const
971
+ */
972
+ var bottomRight = Blockly.utils.svgPaths.arc('a', '0 0,1', radius,
973
+ Blockly.utils.svgPaths.point(-radius, radius));
974
+
975
+ return {
976
+ topLeft: topLeft,
977
+ topRight: topRight,
978
+ bottomRight: bottomRight,
979
+ bottomLeft: bottomLeft,
980
+ rightHeight: radius
981
+ };
982
+ };
983
+
984
+ /**
985
+ * Get an object with connection shape and sizing information based on the type
986
+ * of the connection.
987
+ * @param {!Blockly.RenderedConnection} connection The connection to find a
988
+ * shape object for
989
+ * @return {!Object} The shape object for the connection.
990
+ * @package
991
+ */
992
+ Blockly.blockRendering.ConstantProvider.prototype.shapeFor = function(
993
+ connection) {
994
+ switch (connection.type) {
995
+ case Blockly.INPUT_VALUE:
996
+ case Blockly.OUTPUT_VALUE:
997
+ return this.PUZZLE_TAB;
998
+ case Blockly.PREVIOUS_STATEMENT:
999
+ case Blockly.NEXT_STATEMENT:
1000
+ return this.NOTCH;
1001
+ default:
1002
+ throw Error('Unknown connection type');
1003
+ }
1004
+ };
1005
+
1006
+ /**
1007
+ * Create any DOM elements that this renderer needs (filters, patterns, etc).
1008
+ * @param {!SVGElement} svg The root of the workspace's SVG.
1009
+ * @param {string} tagName The name to use for the CSS style tag.
1010
+ * @param {string} selector The CSS selector to use.
1011
+ * @suppress {strictModuleDepCheck} Debug renderer only included in playground.
1012
+ * @package
1013
+ */
1014
+ Blockly.blockRendering.ConstantProvider.prototype.createDom = function(svg,
1015
+ tagName, selector) {
1016
+ this.injectCSS_(tagName, selector);
1017
+
1018
+ /*
1019
+ <defs>
1020
+ ... filters go here ...
1021
+ </defs>
1022
+ */
1023
+ var defs = Blockly.utils.dom.createSvgElement(
1024
+ Blockly.utils.Svg.DEFS, {}, svg);
1025
+ /*
1026
+ <filter id="blocklyEmbossFilter837493">
1027
+ <feGaussianBlur in="SourceAlpha" stdDeviation="1" result="blur" />
1028
+ <feSpecularLighting in="blur" surfaceScale="1" specularConstant="0.5"
1029
+ specularExponent="10" lighting-color="white"
1030
+ result="specOut">
1031
+ <fePointLight x="-5000" y="-10000" z="20000" />
1032
+ </feSpecularLighting>
1033
+ <feComposite in="specOut" in2="SourceAlpha" operator="in"
1034
+ result="specOut" />
1035
+ <feComposite in="SourceGraphic" in2="specOut" operator="arithmetic"
1036
+ k1="0" k2="1" k3="1" k4="0" />
1037
+ </filter>
1038
+ */
1039
+ var embossFilter = Blockly.utils.dom.createSvgElement(
1040
+ Blockly.utils.Svg.FILTER,
1041
+ {'id': 'blocklyEmbossFilter' + this.randomIdentifier}, defs);
1042
+ Blockly.utils.dom.createSvgElement(
1043
+ Blockly.utils.Svg.FEGAUSSIANBLUR,
1044
+ {'in': 'SourceAlpha', 'stdDeviation': 1, 'result': 'blur'}, embossFilter);
1045
+ var feSpecularLighting = Blockly.utils.dom.createSvgElement(
1046
+ Blockly.utils.Svg.FESPECULARLIGHTING,
1047
+ {
1048
+ 'in': 'blur',
1049
+ 'surfaceScale': 1,
1050
+ 'specularConstant': 0.5,
1051
+ 'specularExponent': 10,
1052
+ 'lighting-color': 'white',
1053
+ 'result': 'specOut'
1054
+ },
1055
+ embossFilter);
1056
+ Blockly.utils.dom.createSvgElement(
1057
+ Blockly.utils.Svg.FEPOINTLIGHT,
1058
+ {'x': -5000, 'y': -10000, 'z': 20000}, feSpecularLighting);
1059
+ Blockly.utils.dom.createSvgElement(
1060
+ Blockly.utils.Svg.FECOMPOSITE,
1061
+ {
1062
+ 'in': 'specOut',
1063
+ 'in2': 'SourceAlpha',
1064
+ 'operator': 'in',
1065
+ 'result': 'specOut'
1066
+ }, embossFilter);
1067
+ Blockly.utils.dom.createSvgElement(
1068
+ Blockly.utils.Svg.FECOMPOSITE,
1069
+ {
1070
+ 'in': 'SourceGraphic',
1071
+ 'in2': 'specOut',
1072
+ 'operator': 'arithmetic',
1073
+ 'k1': 0,
1074
+ 'k2': 1,
1075
+ 'k3': 1,
1076
+ 'k4': 0
1077
+ }, embossFilter);
1078
+ this.embossFilterId = embossFilter.id;
1079
+ this.embossFilter_ = embossFilter;
1080
+
1081
+ /*
1082
+ <pattern id="blocklyDisabledPattern837493" patternUnits="userSpaceOnUse"
1083
+ width="10" height="10">
1084
+ <rect width="10" height="10" fill="#aaa" />
1085
+ <path d="M 0 0 L 10 10 M 10 0 L 0 10" stroke="#cc0" />
1086
+ </pattern>
1087
+ */
1088
+ var disabledPattern = Blockly.utils.dom.createSvgElement(
1089
+ Blockly.utils.Svg.PATTERN,
1090
+ {
1091
+ 'id': 'blocklyDisabledPattern' + this.randomIdentifier,
1092
+ 'patternUnits': 'userSpaceOnUse',
1093
+ 'width': 10,
1094
+ 'height': 10
1095
+ }, defs);
1096
+ Blockly.utils.dom.createSvgElement(
1097
+ Blockly.utils.Svg.RECT,
1098
+ {'width': 10, 'height': 10, 'fill': '#aaa'}, disabledPattern);
1099
+ Blockly.utils.dom.createSvgElement(
1100
+ Blockly.utils.Svg.PATH,
1101
+ {'d': 'M 0 0 L 10 10 M 10 0 L 0 10', 'stroke': '#cc0'}, disabledPattern);
1102
+ this.disabledPatternId = disabledPattern.id;
1103
+ this.disabledPattern_ = disabledPattern;
1104
+
1105
+ if (Blockly.blockRendering.Debug) {
1106
+ var debugFilter = Blockly.utils.dom.createSvgElement(
1107
+ Blockly.utils.Svg.FILTER,
1108
+ {
1109
+ 'id': 'blocklyDebugFilter' + this.randomIdentifier,
1110
+ 'height': '160%',
1111
+ 'width': '180%',
1112
+ y: '-30%',
1113
+ x: '-40%'
1114
+ },
1115
+ defs);
1116
+ // Set all gaussian blur pixels to 1 opacity before applying flood
1117
+ var debugComponentTransfer = Blockly.utils.dom.createSvgElement(
1118
+ Blockly.utils.Svg.FECOMPONENTTRANSFER, {
1119
+ 'result': 'outBlur'
1120
+ }, debugFilter);
1121
+ Blockly.utils.dom.createSvgElement(
1122
+ Blockly.utils.Svg.FEFUNCA,
1123
+ {
1124
+ 'type': 'table', 'tableValues': '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1'
1125
+ },
1126
+ debugComponentTransfer);
1127
+ // Color the highlight
1128
+ Blockly.utils.dom.createSvgElement(
1129
+ Blockly.utils.Svg.FEFLOOD,
1130
+ {
1131
+ 'flood-color': '#ff0000',
1132
+ 'flood-opacity': 0.5,
1133
+ 'result': 'outColor'
1134
+ },
1135
+ debugFilter);
1136
+ Blockly.utils.dom.createSvgElement(
1137
+ Blockly.utils.Svg.FECOMPOSITE,
1138
+ {
1139
+ 'in': 'outColor', 'in2': 'outBlur',
1140
+ 'operator': 'in', 'result': 'outGlow'
1141
+ },
1142
+ debugFilter);
1143
+ this.debugFilterId = debugFilter.id;
1144
+ this.debugFilter_ = debugFilter;
1145
+ }
1146
+ };
1147
+
1148
+ /**
1149
+ * Inject renderer specific CSS into the page.
1150
+ * @param {string} tagName The name of the style tag to use.
1151
+ * @param {string} selector The CSS selector to use.
1152
+ * @protected
1153
+ */
1154
+ Blockly.blockRendering.ConstantProvider.prototype.injectCSS_ = function(
1155
+ tagName, selector) {
1156
+ var cssArray = this.getCSS_(selector);
1157
+ var cssNodeId = 'blockly-renderer-style-' + tagName;
1158
+ this.cssNode_ =
1159
+ /** @type {!HTMLStyleElement} */ (document.getElementById(cssNodeId));
1160
+ var text = cssArray.join('\n');
1161
+ if (this.cssNode_) {
1162
+ // Already injected, update if the theme changed.
1163
+ this.cssNode_.firstChild.textContent = text;
1164
+ return;
1165
+ }
1166
+ // Inject CSS tag at start of head.
1167
+ var cssNode =
1168
+ /** @type {!HTMLStyleElement} */ (document.createElement('style'));
1169
+ cssNode.id = cssNodeId;
1170
+ var cssTextNode = document.createTextNode(text);
1171
+ cssNode.appendChild(cssTextNode);
1172
+ document.head.insertBefore(cssNode, document.head.firstChild);
1173
+ this.cssNode_ = cssNode;
1174
+ };
1175
+
1176
+ /**
1177
+ * Get any renderer specific CSS to inject when the renderer is initialized.
1178
+ * @param {string} selector CSS selector to use.
1179
+ * @return {!Array.<string>} Array of CSS strings.
1180
+ * @protected
1181
+ */
1182
+ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) {
1183
+ return [
1184
+ /* eslint-disable indent */
1185
+ // Text.
1186
+ selector + ' .blocklyText, ',
1187
+ selector + ' .blocklyFlyoutLabelText {',
1188
+ 'font: ' + this.FIELD_TEXT_FONTWEIGHT + ' ' +
1189
+ this.FIELD_TEXT_FONTSIZE + 'pt ' + this.FIELD_TEXT_FONTFAMILY + ';',
1190
+ '}',
1191
+
1192
+ // Fields.
1193
+ selector + ' .blocklyText {',
1194
+ 'fill: #fff;',
1195
+ '}',
1196
+ selector + ' .blocklyNonEditableText>rect,',
1197
+ selector + ' .blocklyEditableText>rect {',
1198
+ 'fill: ' + this.FIELD_BORDER_RECT_COLOUR + ';',
1199
+ 'fill-opacity: .6;',
1200
+ 'stroke: none;',
1201
+ '}',
1202
+ selector + ' .blocklyNonEditableText>text,',
1203
+ selector + ' .blocklyEditableText>text {',
1204
+ 'fill: #000;',
1205
+ '}',
1206
+
1207
+ // Flyout labels.
1208
+ selector + ' .blocklyFlyoutLabelText {',
1209
+ 'fill: #000;',
1210
+ '}',
1211
+
1212
+ // Bubbles.
1213
+ selector + ' .blocklyText.blocklyBubbleText {',
1214
+ 'fill: #000;',
1215
+ '}',
1216
+
1217
+ // Editable field hover.
1218
+ selector + ' .blocklyEditableText:not(.editing):hover>rect {',
1219
+ 'stroke: #fff;',
1220
+ 'stroke-width: 2;',
1221
+ '}',
1222
+
1223
+ // Text field input.
1224
+ selector + ' .blocklyHtmlInput {',
1225
+ 'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';',
1226
+ 'font-weight: ' + this.FIELD_TEXT_FONTWEIGHT + ';',
1227
+ '}',
1228
+
1229
+ // Selection highlight.
1230
+ selector + ' .blocklySelected>.blocklyPath {',
1231
+ 'stroke: #fc3;',
1232
+ 'stroke-width: 3px;',
1233
+ '}',
1234
+
1235
+ // Connection highlight.
1236
+ selector + ' .blocklyHighlightedConnectionPath {',
1237
+ 'stroke: #fc3;',
1238
+ '}',
1239
+
1240
+ // Replaceable highlight.
1241
+ selector + ' .blocklyReplaceable .blocklyPath {',
1242
+ 'fill-opacity: .5;',
1243
+ '}',
1244
+ selector + ' .blocklyReplaceable .blocklyPathLight,',
1245
+ selector + ' .blocklyReplaceable .blocklyPathDark {',
1246
+ 'display: none;',
1247
+ '}',
1248
+
1249
+ // Insertion marker.
1250
+ selector + ' .blocklyInsertionMarker>.blocklyPath {',
1251
+ 'fill-opacity: ' + this.INSERTION_MARKER_OPACITY + ';',
1252
+ 'stroke: none;',
1253
+ '}',
1254
+ /* eslint-enable indent */
1255
+ ];
1256
+ };