nodeskini 1.0.1 → 1.0.3
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.
- package/blocklySkini/archive/blocklyControleur.js +87 -0
- package/blocklySkini/archive/blocklySkini.js +84 -0
- package/blocklySkini/archive/blocklyhop.js +75 -0
- package/blocklySkini/archive/clientControleurBlocly.js +170 -0
- package/blocklySkini/archive/index.html +76 -0
- package/blocklySkini/archive/testHHsuspend.txt +89 -0
- package/blocklySkini/archive/testHHtrap.txt +262 -0
- package/blocklySkini/archive/testOrchestration.txt +177 -0
- package/blocklySkini/archive/testOrchestration.xml +447 -0
- package/blocklySkini/archive/testOrchestration2.xml +456 -0
- package/blocklySkini/blockly/README.md +77 -0
- package/blocklySkini/blockly/blockly.d.ts +21480 -0
- package/blocklySkini/blockly/blockly.js +25 -0
- package/blocklySkini/blockly/blockly.min.js +2188 -0
- package/blocklySkini/blockly/blockly_compressed.js +1455 -0
- package/blocklySkini/blockly/blockly_compressed.js.map +1 -0
- package/blocklySkini/blockly/blocks/colour.js +122 -0
- package/blocklySkini/blockly/blocks/lists.js +862 -0
- package/blocklySkini/blockly/blocks/logic.js +635 -0
- package/blocklySkini/blockly/blocks/loops.js +357 -0
- package/blocklySkini/blockly/blocks/math.js +566 -0
- package/blocklySkini/blockly/blocks/procedures.js +1072 -0
- package/blocklySkini/blockly/blocks/text.js +923 -0
- package/blocklySkini/blockly/blocks/variables.js +163 -0
- package/blocklySkini/blockly/blocks/variables_dynamic.js +180 -0
- package/blocklySkini/blockly/blocks.d.ts +15 -0
- package/blocklySkini/blockly/blocks.js +27 -0
- package/blocklySkini/blockly/blocks_compressed.js +182 -0
- package/blocklySkini/blockly/blocks_compressed.js.map +1 -0
- package/blocklySkini/blockly/browser.js +36 -0
- package/blocklySkini/blockly/core/block.js +2010 -0
- package/blocklySkini/blockly/core/block_animations.js +203 -0
- package/blocklySkini/blockly/core/block_drag_surface.js +212 -0
- package/blocklySkini/blockly/core/block_dragger.js +378 -0
- package/blocklySkini/blockly/core/block_events.js +548 -0
- package/blocklySkini/blockly/core/block_svg.js +1763 -0
- package/blocklySkini/blockly/core/blockly.js +674 -0
- package/blocklySkini/blockly/core/blocks.js +23 -0
- package/blocklySkini/blockly/core/bubble.js +880 -0
- package/blocklySkini/blockly/core/bubble_dragger.js +274 -0
- package/blocklySkini/blockly/core/comment.js +439 -0
- package/blocklySkini/blockly/core/components/component.js +554 -0
- package/blocklySkini/blockly/core/components/tree/basenode.js +895 -0
- package/blocklySkini/blockly/core/components/tree/treecontrol.js +332 -0
- package/blocklySkini/blockly/core/components/tree/treenode.js +172 -0
- package/blocklySkini/blockly/core/connection.js +682 -0
- package/blocklySkini/blockly/core/connection_checker.js +285 -0
- package/blocklySkini/blockly/core/connection_db.js +295 -0
- package/blocklySkini/blockly/core/constants.js +277 -0
- package/blocklySkini/blockly/core/contextmenu.js +307 -0
- package/blocklySkini/blockly/core/contextmenu_items.js +534 -0
- package/blocklySkini/blockly/core/contextmenu_registry.js +165 -0
- package/blocklySkini/blockly/core/css.js +549 -0
- package/blocklySkini/blockly/core/dropdowndiv.js +776 -0
- package/blocklySkini/blockly/core/events.js +387 -0
- package/blocklySkini/blockly/core/events_abstract.js +106 -0
- package/blocklySkini/blockly/core/extensions.js +450 -0
- package/blocklySkini/blockly/core/field.js +1162 -0
- package/blocklySkini/blockly/core/field_angle.js +562 -0
- package/blocklySkini/blockly/core/field_checkbox.js +220 -0
- package/blocklySkini/blockly/core/field_colour.js +664 -0
- package/blocklySkini/blockly/core/field_dropdown.js +760 -0
- package/blocklySkini/blockly/core/field_image.js +286 -0
- package/blocklySkini/blockly/core/field_label.js +130 -0
- package/blocklySkini/blockly/core/field_label_serializable.js +69 -0
- package/blocklySkini/blockly/core/field_multilineinput.js +299 -0
- package/blocklySkini/blockly/core/field_number.js +317 -0
- package/blocklySkini/blockly/core/field_registry.js +66 -0
- package/blocklySkini/blockly/core/field_textinput.js +616 -0
- package/blocklySkini/blockly/core/field_variable.js +463 -0
- package/blocklySkini/blockly/core/flyout_base.js +1071 -0
- package/blocklySkini/blockly/core/flyout_button.js +325 -0
- package/blocklySkini/blockly/core/flyout_dragger.js +76 -0
- package/blocklySkini/blockly/core/flyout_horizontal.js +388 -0
- package/blocklySkini/blockly/core/flyout_vertical.js +397 -0
- package/blocklySkini/blockly/core/generator.js +482 -0
- package/blocklySkini/blockly/core/gesture.js +993 -0
- package/blocklySkini/blockly/core/grid.js +222 -0
- package/blocklySkini/blockly/core/icon.js +206 -0
- package/blocklySkini/blockly/core/inject.js +487 -0
- package/blocklySkini/blockly/core/input.js +296 -0
- package/blocklySkini/blockly/core/insertion_marker_manager.js +700 -0
- package/blocklySkini/blockly/core/interfaces/i_accessibility.js +72 -0
- package/blocklySkini/blockly/core/interfaces/i_bounded_element.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_bubble.js +83 -0
- package/blocklySkini/blockly/core/interfaces/i_connection_checker.js +94 -0
- package/blocklySkini/blockly/core/interfaces/i_contextmenu.js +26 -0
- package/blocklySkini/blockly/core/interfaces/i_copyable.js +40 -0
- package/blocklySkini/blockly/core/interfaces/i_deletable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_deletearea.js +28 -0
- package/blocklySkini/blockly/core/interfaces/i_flyout.js +178 -0
- package/blocklySkini/blockly/core/interfaces/i_movable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable.js +22 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable_field.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_selectable.js +43 -0
- package/blocklySkini/blockly/core/interfaces/i_styleable.js +33 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox.js +131 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox_item.js +148 -0
- package/blocklySkini/blockly/core/keyboard_nav/action.js +26 -0
- package/blocklySkini/blockly/core/keyboard_nav/ast_node.js +684 -0
- package/blocklySkini/blockly/core/keyboard_nav/basic_cursor.js +208 -0
- package/blocklySkini/blockly/core/keyboard_nav/cursor.js +170 -0
- package/blocklySkini/blockly/core/keyboard_nav/flyout_cursor.js +106 -0
- package/blocklySkini/blockly/core/keyboard_nav/key_map.js +190 -0
- package/blocklySkini/blockly/core/keyboard_nav/marker.js +120 -0
- package/blocklySkini/blockly/core/keyboard_nav/navigation.js +1084 -0
- package/blocklySkini/blockly/core/keyboard_nav/tab_navigate_cursor.js +48 -0
- package/blocklySkini/blockly/core/marker_manager.js +183 -0
- package/blocklySkini/blockly/core/menu.js +465 -0
- package/blocklySkini/blockly/core/menuitem.js +280 -0
- package/blocklySkini/blockly/core/msg.js +31 -0
- package/blocklySkini/blockly/core/mutator.js +555 -0
- package/blocklySkini/blockly/core/names.js +186 -0
- package/blocklySkini/blockly/core/options.js +365 -0
- package/blocklySkini/blockly/core/procedures.js +404 -0
- package/blocklySkini/blockly/core/registry.js +265 -0
- package/blocklySkini/blockly/core/rendered_connection.js +565 -0
- package/blocklySkini/blockly/core/renderers/common/block_rendering.js +81 -0
- package/blocklySkini/blockly/core/renderers/common/constants.js +1256 -0
- package/blocklySkini/blockly/core/renderers/common/debugger.js +431 -0
- package/blocklySkini/blockly/core/renderers/common/drawer.js +468 -0
- package/blocklySkini/blockly/core/renderers/common/i_path_object.js +151 -0
- package/blocklySkini/blockly/core/renderers/common/info.js +775 -0
- package/blocklySkini/blockly/core/renderers/common/marker_svg.js +687 -0
- package/blocklySkini/blockly/core/renderers/common/path_object.js +279 -0
- package/blocklySkini/blockly/core/renderers/common/renderer.js +301 -0
- package/blocklySkini/blockly/core/renderers/geras/constants.js +64 -0
- package/blocklySkini/blockly/core/renderers/geras/drawer.js +205 -0
- package/blocklySkini/blockly/core/renderers/geras/highlight_constants.js +311 -0
- package/blocklySkini/blockly/core/renderers/geras/highlighter.js +256 -0
- package/blocklySkini/blockly/core/renderers/geras/info.js +483 -0
- package/blocklySkini/blockly/core/renderers/geras/measurables/inputs.js +67 -0
- package/blocklySkini/blockly/core/renderers/geras/path_object.js +177 -0
- package/blocklySkini/blockly/core/renderers/geras/renderer.js +138 -0
- package/blocklySkini/blockly/core/renderers/measurables/base.js +44 -0
- package/blocklySkini/blockly/core/renderers/measurables/connections.js +114 -0
- package/blocklySkini/blockly/core/renderers/measurables/inputs.js +160 -0
- package/blocklySkini/blockly/core/renderers/measurables/row_elements.js +185 -0
- package/blocklySkini/blockly/core/renderers/measurables/rows.js +532 -0
- package/blocklySkini/blockly/core/renderers/measurables/types.js +349 -0
- package/blocklySkini/blockly/core/renderers/minimalist/constants.js +29 -0
- package/blocklySkini/blockly/core/renderers/minimalist/drawer.js +32 -0
- package/blocklySkini/blockly/core/renderers/minimalist/info.js +45 -0
- package/blocklySkini/blockly/core/renderers/minimalist/renderer.js +70 -0
- package/blocklySkini/blockly/core/renderers/thrasos/info.js +338 -0
- package/blocklySkini/blockly/core/renderers/thrasos/renderer.js +45 -0
- package/blocklySkini/blockly/core/renderers/zelos/constants.js +1002 -0
- package/blocklySkini/blockly/core/renderers/zelos/drawer.js +233 -0
- package/blocklySkini/blockly/core/renderers/zelos/info.js +587 -0
- package/blocklySkini/blockly/core/renderers/zelos/marker_svg.js +148 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/inputs.js +47 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/row_elements.js +37 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/rows.js +108 -0
- package/blocklySkini/blockly/core/renderers/zelos/path_object.js +244 -0
- package/blocklySkini/blockly/core/renderers/zelos/renderer.js +130 -0
- package/blocklySkini/blockly/core/requires.js +84 -0
- package/blocklySkini/blockly/core/scrollbar.js +880 -0
- package/blocklySkini/blockly/core/theme/classic.js +87 -0
- package/blocklySkini/blockly/core/theme/dark.js +33 -0
- package/blocklySkini/blockly/core/theme/deuteranopia.js +104 -0
- package/blocklySkini/blockly/core/theme/highcontrast.js +119 -0
- package/blocklySkini/blockly/core/theme/modern.js +108 -0
- package/blocklySkini/blockly/core/theme/tritanopia.js +103 -0
- package/blocklySkini/blockly/core/theme/zelos.js +106 -0
- package/blocklySkini/blockly/core/theme.js +236 -0
- package/blocklySkini/blockly/core/theme_manager.js +197 -0
- package/blocklySkini/blockly/core/toolbox/category.js +690 -0
- package/blocklySkini/blockly/core/toolbox/collapsible_category.js +294 -0
- package/blocklySkini/blockly/core/toolbox/separator.js +123 -0
- package/blocklySkini/blockly/core/toolbox/toolbox.js +984 -0
- package/blocklySkini/blockly/core/toolbox/toolbox_item.js +145 -0
- package/blocklySkini/blockly/core/toolbox.js +943 -0
- package/blocklySkini/blockly/core/tooltip.js +387 -0
- package/blocklySkini/blockly/core/touch.js +255 -0
- package/blocklySkini/blockly/core/touch_gesture.js +325 -0
- package/blocklySkini/blockly/core/trashcan.js +661 -0
- package/blocklySkini/blockly/core/ui_events.js +85 -0
- package/blocklySkini/blockly/core/utils/aria.js +167 -0
- package/blocklySkini/blockly/core/utils/colour.js +208 -0
- package/blocklySkini/blockly/core/utils/coordinate.js +125 -0
- package/blocklySkini/blockly/core/utils/deprecation.js +34 -0
- package/blocklySkini/blockly/core/utils/dom.js +391 -0
- package/blocklySkini/blockly/core/utils/global.js +37 -0
- package/blocklySkini/blockly/core/utils/idgenerator.js +33 -0
- package/blocklySkini/blockly/core/utils/keycodes.js +164 -0
- package/blocklySkini/blockly/core/utils/math.js +56 -0
- package/blocklySkini/blockly/core/utils/metrics.js +124 -0
- package/blocklySkini/blockly/core/utils/object.js +73 -0
- package/blocklySkini/blockly/core/utils/rect.js +54 -0
- package/blocklySkini/blockly/core/utils/size.js +58 -0
- package/blocklySkini/blockly/core/utils/string.js +284 -0
- package/blocklySkini/blockly/core/utils/style.js +281 -0
- package/blocklySkini/blockly/core/utils/svg.js +181 -0
- package/blocklySkini/blockly/core/utils/svg_paths.js +142 -0
- package/blocklySkini/blockly/core/utils/toolbox.js +401 -0
- package/blocklySkini/blockly/core/utils/useragent.js +110 -0
- package/blocklySkini/blockly/core/utils/xml.js +79 -0
- package/blocklySkini/blockly/core/utils.js +652 -0
- package/blocklySkini/blockly/core/variable_events.js +248 -0
- package/blocklySkini/blockly/core/variable_map.js +414 -0
- package/blocklySkini/blockly/core/variable_model.js +95 -0
- package/blocklySkini/blockly/core/variables.js +571 -0
- package/blocklySkini/blockly/core/variables_dynamic.js +100 -0
- package/blocklySkini/blockly/core/warning.js +200 -0
- package/blocklySkini/blockly/core/widgetdiv.js +241 -0
- package/blocklySkini/blockly/core/workspace.js +786 -0
- package/blocklySkini/blockly/core/workspace_audio.js +153 -0
- package/blocklySkini/blockly/core/workspace_comment.js +373 -0
- package/blocklySkini/blockly/core/workspace_comment_render_svg.js +461 -0
- package/blocklySkini/blockly/core/workspace_comment_svg.js +701 -0
- package/blocklySkini/blockly/core/workspace_drag_surface_svg.js +176 -0
- package/blocklySkini/blockly/core/workspace_dragger.js +85 -0
- package/blocklySkini/blockly/core/workspace_events.js +93 -0
- package/blocklySkini/blockly/core/workspace_svg.js +2661 -0
- package/blocklySkini/blockly/core/ws_comment_events.js +417 -0
- package/blocklySkini/blockly/core/xml.js +827 -0
- package/blocklySkini/blockly/core/zoom_controls.js +449 -0
- package/blocklySkini/blockly/core-browser.js +34 -0
- package/blocklySkini/blockly/core.d.ts +15 -0
- package/blocklySkini/blockly/core.js +38 -0
- package/blocklySkini/blockly/dart.d.ts +15 -0
- package/blocklySkini/blockly/dart.js +27 -0
- package/blocklySkini/blockly/dart_compressed.js +114 -0
- package/blocklySkini/blockly/dart_compressed.js.map +1 -0
- package/blocklySkini/blockly/generators/dart/colour.js +114 -0
- package/blocklySkini/blockly/generators/dart/lists.js +447 -0
- package/blocklySkini/blockly/generators/dart/logic.js +127 -0
- package/blocklySkini/blockly/generators/dart/loops.js +169 -0
- package/blocklySkini/blockly/generators/dart/math.js +485 -0
- package/blocklySkini/blockly/generators/dart/procedures.js +111 -0
- package/blocklySkini/blockly/generators/dart/text.js +339 -0
- package/blocklySkini/blockly/generators/dart/variables.js +32 -0
- package/blocklySkini/blockly/generators/dart/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/dart.js +290 -0
- package/blocklySkini/blockly/generators/javascript/colour.js +89 -0
- package/blocklySkini/blockly/generators/javascript/lists.js +388 -0
- package/blocklySkini/blockly/generators/javascript/logic.js +129 -0
- package/blocklySkini/blockly/generators/javascript/loops.js +184 -0
- package/blocklySkini/blockly/generators/javascript/math.js +409 -0
- package/blocklySkini/blockly/generators/javascript/procedures.js +113 -0
- package/blocklySkini/blockly/generators/javascript/text.js +367 -0
- package/blocklySkini/blockly/generators/javascript/variables.js +32 -0
- package/blocklySkini/blockly/generators/javascript/variables_dynamic.js +23 -0
- package/blocklySkini/blockly/generators/javascript.js +317 -0
- package/blocklySkini/blockly/generators/lua/colour.js +76 -0
- package/blocklySkini/blockly/generators/lua/lists.js +368 -0
- package/blocklySkini/blockly/generators/lua/logic.js +127 -0
- package/blocklySkini/blockly/generators/lua/loops.js +173 -0
- package/blocklySkini/blockly/generators/lua/math.js +423 -0
- package/blocklySkini/blockly/generators/lua/procedures.js +113 -0
- package/blocklySkini/blockly/generators/lua/text.js +353 -0
- package/blocklySkini/blockly/generators/lua/variables.js +32 -0
- package/blocklySkini/blockly/generators/lua/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/lua.js +198 -0
- package/blocklySkini/blockly/generators/php/colour.js +91 -0
- package/blocklySkini/blockly/generators/php/lists.js +498 -0
- package/blocklySkini/blockly/generators/php/logic.js +128 -0
- package/blocklySkini/blockly/generators/php/loops.js +170 -0
- package/blocklySkini/blockly/generators/php/math.js +370 -0
- package/blocklySkini/blockly/generators/php/procedures.js +132 -0
- package/blocklySkini/blockly/generators/php/text.js +271 -0
- package/blocklySkini/blockly/generators/php/variables.js +32 -0
- package/blocklySkini/blockly/generators/php/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/php.js +318 -0
- package/blocklySkini/blockly/generators/python/colour.js +72 -0
- package/blocklySkini/blockly/generators/python/lists.js +349 -0
- package/blocklySkini/blockly/generators/python/logic.js +127 -0
- package/blocklySkini/blockly/generators/python/loops.js +214 -0
- package/blocklySkini/blockly/generators/python/math.js +385 -0
- package/blocklySkini/blockly/generators/python/procedures.js +134 -0
- package/blocklySkini/blockly/generators/python/text.js +293 -0
- package/blocklySkini/blockly/generators/python/variables.js +32 -0
- package/blocklySkini/blockly/generators/python/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/python.js +322 -0
- package/blocklySkini/blockly/index.d.ts +22 -0
- package/blocklySkini/blockly/index.js +24 -0
- package/blocklySkini/blockly/javascript.d.ts +15 -0
- package/blocklySkini/blockly/javascript.js +27 -0
- package/blocklySkini/blockly/javascript_compressed.js +115 -0
- package/blocklySkini/blockly/javascript_compressed.js.map +1 -0
- package/blocklySkini/blockly/lua.d.ts +15 -0
- package/blocklySkini/blockly/lua.js +27 -0
- package/blocklySkini/blockly/lua_compressed.js +94 -0
- package/blocklySkini/blockly/lua_compressed.js.map +1 -0
- package/blocklySkini/blockly/media/1x1.gif +0 -0
- package/blocklySkini/blockly/media/click.mp3 +0 -0
- package/blocklySkini/blockly/media/click.ogg +0 -0
- package/blocklySkini/blockly/media/click.wav +0 -0
- package/blocklySkini/blockly/media/delete.mp3 +0 -0
- package/blocklySkini/blockly/media/delete.ogg +0 -0
- package/blocklySkini/blockly/media/delete.wav +0 -0
- package/blocklySkini/blockly/media/disconnect.mp3 +0 -0
- package/blocklySkini/blockly/media/disconnect.ogg +0 -0
- package/blocklySkini/blockly/media/disconnect.wav +0 -0
- package/blocklySkini/blockly/media/dropdown-arrow.svg +1 -0
- package/blocklySkini/blockly/media/handclosed.cur +0 -0
- package/blocklySkini/blockly/media/handdelete.cur +0 -0
- package/blocklySkini/blockly/media/handopen.cur +0 -0
- package/blocklySkini/blockly/media/pilcrow.png +0 -0
- package/blocklySkini/blockly/media/quote0.png +0 -0
- package/blocklySkini/blockly/media/quote1.png +0 -0
- package/blocklySkini/blockly/media/sprites.png +0 -0
- package/blocklySkini/blockly/media/sprites.svg +74 -0
- package/blocklySkini/blockly/msg/ab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ab.js +447 -0
- package/blocklySkini/blockly/msg/ar.d.ts +16 -0
- package/blocklySkini/blockly/msg/ar.js +447 -0
- package/blocklySkini/blockly/msg/az.d.ts +16 -0
- package/blocklySkini/blockly/msg/az.js +447 -0
- package/blocklySkini/blockly/msg/ba.d.ts +16 -0
- package/blocklySkini/blockly/msg/ba.js +447 -0
- package/blocklySkini/blockly/msg/bcc.d.ts +16 -0
- package/blocklySkini/blockly/msg/bcc.js +447 -0
- package/blocklySkini/blockly/msg/be-tarask.d.ts +16 -0
- package/blocklySkini/blockly/msg/be-tarask.js +447 -0
- package/blocklySkini/blockly/msg/be.d.ts +16 -0
- package/blocklySkini/blockly/msg/be.js +447 -0
- package/blocklySkini/blockly/msg/bg.d.ts +16 -0
- package/blocklySkini/blockly/msg/bg.js +447 -0
- package/blocklySkini/blockly/msg/bn.d.ts +16 -0
- package/blocklySkini/blockly/msg/bn.js +447 -0
- package/blocklySkini/blockly/msg/br.d.ts +16 -0
- package/blocklySkini/blockly/msg/br.js +447 -0
- package/blocklySkini/blockly/msg/ca.d.ts +16 -0
- package/blocklySkini/blockly/msg/ca.js +447 -0
- package/blocklySkini/blockly/msg/constants.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.js +447 -0
- package/blocklySkini/blockly/msg/da.d.ts +16 -0
- package/blocklySkini/blockly/msg/da.js +447 -0
- package/blocklySkini/blockly/msg/de.d.ts +16 -0
- package/blocklySkini/blockly/msg/de.js +447 -0
- package/blocklySkini/blockly/msg/diq.d.ts +16 -0
- package/blocklySkini/blockly/msg/diq.js +447 -0
- package/blocklySkini/blockly/msg/dty.d.ts +16 -0
- package/blocklySkini/blockly/msg/dty.js +447 -0
- package/blocklySkini/blockly/msg/ee.d.ts +16 -0
- package/blocklySkini/blockly/msg/ee.js +447 -0
- package/blocklySkini/blockly/msg/el.d.ts +16 -0
- package/blocklySkini/blockly/msg/el.js +447 -0
- package/blocklySkini/blockly/msg/en-gb.d.ts +16 -0
- package/blocklySkini/blockly/msg/en-gb.js +447 -0
- package/blocklySkini/blockly/msg/en.d.ts +16 -0
- package/blocklySkini/blockly/msg/en.js +447 -0
- package/blocklySkini/blockly/msg/eo.d.ts +16 -0
- package/blocklySkini/blockly/msg/eo.js +447 -0
- package/blocklySkini/blockly/msg/es.d.ts +16 -0
- package/blocklySkini/blockly/msg/es.js +447 -0
- package/blocklySkini/blockly/msg/et.d.ts +16 -0
- package/blocklySkini/blockly/msg/et.js +447 -0
- package/blocklySkini/blockly/msg/eu.d.ts +16 -0
- package/blocklySkini/blockly/msg/eu.js +447 -0
- package/blocklySkini/blockly/msg/fa.d.ts +16 -0
- package/blocklySkini/blockly/msg/fa.js +447 -0
- package/blocklySkini/blockly/msg/fi.d.ts +16 -0
- package/blocklySkini/blockly/msg/fi.js +447 -0
- package/blocklySkini/blockly/msg/fr.d.ts +16 -0
- package/blocklySkini/blockly/msg/fr.js +447 -0
- package/blocklySkini/blockly/msg/gl.d.ts +16 -0
- package/blocklySkini/blockly/msg/gl.js +447 -0
- package/blocklySkini/blockly/msg/gor.d.ts +16 -0
- package/blocklySkini/blockly/msg/gor.js +447 -0
- package/blocklySkini/blockly/msg/ha.d.ts +16 -0
- package/blocklySkini/blockly/msg/ha.js +447 -0
- package/blocklySkini/blockly/msg/he.d.ts +16 -0
- package/blocklySkini/blockly/msg/he.js +447 -0
- package/blocklySkini/blockly/msg/hi.d.ts +16 -0
- package/blocklySkini/blockly/msg/hi.js +447 -0
- package/blocklySkini/blockly/msg/hrx.d.ts +16 -0
- package/blocklySkini/blockly/msg/hrx.js +447 -0
- package/blocklySkini/blockly/msg/hu.d.ts +16 -0
- package/blocklySkini/blockly/msg/hu.js +447 -0
- package/blocklySkini/blockly/msg/hy.d.ts +16 -0
- package/blocklySkini/blockly/msg/hy.js +447 -0
- package/blocklySkini/blockly/msg/ia.d.ts +16 -0
- package/blocklySkini/blockly/msg/ia.js +447 -0
- package/blocklySkini/blockly/msg/id.d.ts +16 -0
- package/blocklySkini/blockly/msg/id.js +447 -0
- package/blocklySkini/blockly/msg/ig.d.ts +16 -0
- package/blocklySkini/blockly/msg/ig.js +447 -0
- package/blocklySkini/blockly/msg/is.d.ts +16 -0
- package/blocklySkini/blockly/msg/is.js +447 -0
- package/blocklySkini/blockly/msg/it.d.ts +16 -0
- package/blocklySkini/blockly/msg/it.js +447 -0
- package/blocklySkini/blockly/msg/ja.d.ts +16 -0
- package/blocklySkini/blockly/msg/ja.js +447 -0
- package/blocklySkini/blockly/msg/kab.d.ts +16 -0
- package/blocklySkini/blockly/msg/kab.js +447 -0
- package/blocklySkini/blockly/msg/kn.d.ts +16 -0
- package/blocklySkini/blockly/msg/kn.js +447 -0
- package/blocklySkini/blockly/msg/ko.d.ts +16 -0
- package/blocklySkini/blockly/msg/ko.js +447 -0
- package/blocklySkini/blockly/msg/lb.d.ts +16 -0
- package/blocklySkini/blockly/msg/lb.js +447 -0
- package/blocklySkini/blockly/msg/lki.d.ts +16 -0
- package/blocklySkini/blockly/msg/lki.js +447 -0
- package/blocklySkini/blockly/msg/lo.d.ts +16 -0
- package/blocklySkini/blockly/msg/lo.js +447 -0
- package/blocklySkini/blockly/msg/lrc.d.ts +16 -0
- package/blocklySkini/blockly/msg/lrc.js +447 -0
- package/blocklySkini/blockly/msg/lt.d.ts +16 -0
- package/blocklySkini/blockly/msg/lt.js +447 -0
- package/blocklySkini/blockly/msg/lv.d.ts +16 -0
- package/blocklySkini/blockly/msg/lv.js +447 -0
- package/blocklySkini/blockly/msg/mk.d.ts +16 -0
- package/blocklySkini/blockly/msg/mk.js +447 -0
- package/blocklySkini/blockly/msg/mnw.d.ts +16 -0
- package/blocklySkini/blockly/msg/mnw.js +447 -0
- package/blocklySkini/blockly/msg/ms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ms.js +447 -0
- package/blocklySkini/blockly/msg/msg.d.ts +444 -0
- package/blocklySkini/blockly/msg/nb.d.ts +16 -0
- package/blocklySkini/blockly/msg/nb.js +447 -0
- package/blocklySkini/blockly/msg/nl.d.ts +16 -0
- package/blocklySkini/blockly/msg/nl.js +447 -0
- package/blocklySkini/blockly/msg/oc.d.ts +16 -0
- package/blocklySkini/blockly/msg/oc.js +447 -0
- package/blocklySkini/blockly/msg/pl.d.ts +16 -0
- package/blocklySkini/blockly/msg/pl.js +447 -0
- package/blocklySkini/blockly/msg/pms.d.ts +16 -0
- package/blocklySkini/blockly/msg/pms.js +447 -0
- package/blocklySkini/blockly/msg/pt-br.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt-br.js +447 -0
- package/blocklySkini/blockly/msg/pt.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt.js +447 -0
- package/blocklySkini/blockly/msg/qqq.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.js +447 -0
- package/blocklySkini/blockly/msg/ru.d.ts +16 -0
- package/blocklySkini/blockly/msg/ru.js +447 -0
- package/blocklySkini/blockly/msg/sc.d.ts +16 -0
- package/blocklySkini/blockly/msg/sc.js +447 -0
- package/blocklySkini/blockly/msg/sd.d.ts +16 -0
- package/blocklySkini/blockly/msg/sd.js +447 -0
- package/blocklySkini/blockly/msg/shn.d.ts +16 -0
- package/blocklySkini/blockly/msg/shn.js +447 -0
- package/blocklySkini/blockly/msg/sk.d.ts +16 -0
- package/blocklySkini/blockly/msg/sk.js +447 -0
- package/blocklySkini/blockly/msg/skr-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/skr-arab.js +447 -0
- package/blocklySkini/blockly/msg/sl.d.ts +16 -0
- package/blocklySkini/blockly/msg/sl.js +447 -0
- package/blocklySkini/blockly/msg/sq.d.ts +16 -0
- package/blocklySkini/blockly/msg/sq.js +447 -0
- package/blocklySkini/blockly/msg/sr-latn.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr-latn.js +447 -0
- package/blocklySkini/blockly/msg/sr.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr.js +447 -0
- package/blocklySkini/blockly/msg/sv.d.ts +16 -0
- package/blocklySkini/blockly/msg/sv.js +447 -0
- package/blocklySkini/blockly/msg/synonyms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.js +447 -0
- package/blocklySkini/blockly/msg/tcy.d.ts +16 -0
- package/blocklySkini/blockly/msg/tcy.js +447 -0
- package/blocklySkini/blockly/msg/te.d.ts +16 -0
- package/blocklySkini/blockly/msg/te.js +447 -0
- package/blocklySkini/blockly/msg/th.d.ts +16 -0
- package/blocklySkini/blockly/msg/th.js +447 -0
- package/blocklySkini/blockly/msg/tl.d.ts +16 -0
- package/blocklySkini/blockly/msg/tl.js +447 -0
- package/blocklySkini/blockly/msg/tlh.d.ts +16 -0
- package/blocklySkini/blockly/msg/tlh.js +447 -0
- package/blocklySkini/blockly/msg/tr.d.ts +16 -0
- package/blocklySkini/blockly/msg/tr.js +447 -0
- package/blocklySkini/blockly/msg/ug-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ug-arab.js +447 -0
- package/blocklySkini/blockly/msg/uk.d.ts +16 -0
- package/blocklySkini/blockly/msg/uk.js +447 -0
- package/blocklySkini/blockly/msg/ur.d.ts +16 -0
- package/blocklySkini/blockly/msg/ur.js +447 -0
- package/blocklySkini/blockly/msg/vi.d.ts +16 -0
- package/blocklySkini/blockly/msg/vi.js +447 -0
- package/blocklySkini/blockly/msg/xmf.d.ts +16 -0
- package/blocklySkini/blockly/msg/xmf.js +447 -0
- package/blocklySkini/blockly/msg/yo.d.ts +16 -0
- package/blocklySkini/blockly/msg/yo.js +447 -0
- package/blocklySkini/blockly/msg/zh-hans.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hans.js +447 -0
- package/blocklySkini/blockly/msg/zh-hant.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hant.js +447 -0
- package/blocklySkini/blockly/node.js +35 -0
- package/blocklySkini/blockly/package.json +84 -0
- package/blocklySkini/blockly/php.d.ts +15 -0
- package/blocklySkini/blockly/php.js +27 -0
- package/blocklySkini/blockly/php_compressed.js +103 -0
- package/blocklySkini/blockly/php_compressed.js.map +1 -0
- package/blocklySkini/blockly/python.d.ts +15 -0
- package/blocklySkini/blockly/python.js +27 -0
- package/blocklySkini/blockly/python_compressed.js +98 -0
- package/blocklySkini/blockly/python_compressed.js.map +1 -0
- package/blocklySkini/blocklySkini.html +81 -0
- package/blocklySkini/orchestrations/.xml +1 -0
- package/blocklySkini/orchestrations/BluesSkini-1.xml +231 -0
- package/blocklySkini/orchestrations/BluesSkini-2.xml +741 -0
- package/blocklySkini/orchestrations/BluesSkini-3.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini-4.xml +695 -0
- package/blocklySkini/orchestrations/BluesSkini-5.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini.xml +704 -0
- package/blocklySkini/orchestrations/FunkBitwig-1.xml +778 -0
- package/blocklySkini/orchestrations/FunkBitwig-2.xml +471 -0
- package/blocklySkini/orchestrations/JouerLeBonInstrument1-1.xml +784 -0
- package/blocklySkini/orchestrations/MajeurMineur-1.xml +638 -0
- package/blocklySkini/orchestrations/Opus5-3 - Copie.xml +1041 -0
- package/blocklySkini/orchestrations/Opus5-3.xml +1128 -0
- package/blocklySkini/orchestrations/Quatuor1-1.xml +357 -0
- package/blocklySkini/orchestrations/TechnoBitwig-1.xml +221 -0
- package/blocklySkini/orchestrations/TestBlockly.xml +497 -0
- package/blocklySkini/orchestrations/TestBlockly1.xml +500 -0
- package/blocklySkini/orchestrations/TestBlockly2.xml +792 -0
- package/blocklySkini/orchestrations/TestBlockly3-1.xml +1182 -0
- package/blocklySkini/orchestrations/TestBlockly3.xml +1251 -0
- package/blocklySkini/orchestrations/TestFunction.xml +143 -0
- package/blocklySkini/orchestrations/TestIf.xml +80 -0
- package/blocklySkini/orchestrations/TestLoop.xml +127 -0
- package/blocklySkini/orchestrations/TestOrchestration2.xml +460 -0
- package/blocklySkini/orchestrations/TestPrint.xml +70 -0
- package/blocklySkini/orchestrations/TestSubMod.xml +81 -0
- package/blocklySkini/orchestrations/Testlogic.xml +113 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-1.xml +813 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-2.xml +813 -0
- package/blocklySkini/orchestrations/bar.xml +496 -0
- package/blocklySkini/orchestrations/bar2.xml +496 -0
- package/blocklySkini/orchestrations/foo.xml +500 -0
- package/blocklySkini/orchestrations/opus5Blockly - Copie.xml +496 -0
- package/blocklySkini/orchestrations/opus5Blockly-3.xml +868 -0
- package/blocklySkini/orchestrations/opus5Blockly.xml +496 -0
- package/blocklySkini/orchestrations/testOrchestration3.xml +483 -0
- package/blocklySkini/orchestrations/testOrchestration4.xml +487 -0
- package/blocklySkini/scripts/hiphop_blocks.js +6104 -0
- package/blocklySkini/scripts/main2.js +801 -0
- package/blocklySkini/styles/index.css +320 -0
- package/blocklySkini/styles/material.css +11552 -0
- package/package.json +5 -5
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview An object that encapsulates logic for checking whether a potential
|
|
9
|
+
* connection is safe and valid.
|
|
10
|
+
* @author fenichel@google.com (Rachel Fenichel)
|
|
11
|
+
*/
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
goog.provide('Blockly.ConnectionChecker');
|
|
15
|
+
|
|
16
|
+
goog.require('Blockly.registry');
|
|
17
|
+
|
|
18
|
+
goog.requireType('Blockly.Connection');
|
|
19
|
+
goog.requireType('Blockly.IConnectionChecker');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Class for connection type checking logic.
|
|
24
|
+
* @implements {Blockly.IConnectionChecker}
|
|
25
|
+
* @constructor
|
|
26
|
+
*/
|
|
27
|
+
Blockly.ConnectionChecker = function() {
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check whether the current connection can connect with the target
|
|
32
|
+
* connection.
|
|
33
|
+
* @param {Blockly.Connection} a Connection to check compatibility with.
|
|
34
|
+
* @param {Blockly.Connection} b Connection to check compatibility with.
|
|
35
|
+
* @param {boolean} isDragging True if the connection is being made by dragging
|
|
36
|
+
* a block.
|
|
37
|
+
* @param {number=} opt_distance The max allowable distance between the
|
|
38
|
+
* connections for drag checks.
|
|
39
|
+
* @return {boolean} Whether the connection is legal.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
Blockly.ConnectionChecker.prototype.canConnect = function(a, b,
|
|
43
|
+
isDragging, opt_distance) {
|
|
44
|
+
return this.canConnectWithReason(a, b, isDragging, opt_distance) ==
|
|
45
|
+
Blockly.Connection.CAN_CONNECT;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether the current connection can connect with the target
|
|
50
|
+
* connection, and return an error code if there are problems.
|
|
51
|
+
* @param {Blockly.Connection} a Connection to check compatibility with.
|
|
52
|
+
* @param {Blockly.Connection} b Connection to check compatibility with.
|
|
53
|
+
* @param {boolean} isDragging True if the connection is being made by dragging
|
|
54
|
+
* a block.
|
|
55
|
+
* @param {number=} opt_distance The max allowable distance between the
|
|
56
|
+
* connections for drag checks.
|
|
57
|
+
* @return {number} Blockly.Connection.CAN_CONNECT if the connection is legal,
|
|
58
|
+
* an error code otherwise.
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
Blockly.ConnectionChecker.prototype.canConnectWithReason = function(
|
|
62
|
+
a, b, isDragging, opt_distance) {
|
|
63
|
+
var safety = this.doSafetyChecks(a, b);
|
|
64
|
+
if (safety != Blockly.Connection.CAN_CONNECT) {
|
|
65
|
+
return safety;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// If the safety checks passed, both connections are non-null.
|
|
69
|
+
var connOne = /** @type {!Blockly.Connection} **/ (a);
|
|
70
|
+
var connTwo = /** @type {!Blockly.Connection} **/ (b);
|
|
71
|
+
if (!this.doTypeChecks(connOne, connTwo)) {
|
|
72
|
+
return Blockly.Connection.REASON_CHECKS_FAILED;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isDragging &&
|
|
76
|
+
!this.doDragChecks(
|
|
77
|
+
/** @type {!Blockly.RenderedConnection} **/ (a),
|
|
78
|
+
/** @type {!Blockly.RenderedConnection} **/ (b),
|
|
79
|
+
opt_distance || 0)) {
|
|
80
|
+
return Blockly.Connection.REASON_DRAG_CHECKS_FAILED;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return Blockly.Connection.CAN_CONNECT;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Helper method that translates a connection error code into a string.
|
|
88
|
+
* @param {number} errorCode The error code.
|
|
89
|
+
* @param {Blockly.Connection} a One of the two connections being checked.
|
|
90
|
+
* @param {Blockly.Connection} b The second of the two connections being
|
|
91
|
+
* checked.
|
|
92
|
+
* @return {string} A developer-readable error string.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
Blockly.ConnectionChecker.prototype.getErrorMessage = function(errorCode,
|
|
96
|
+
a, b) {
|
|
97
|
+
switch (errorCode) {
|
|
98
|
+
case Blockly.Connection.REASON_SELF_CONNECTION:
|
|
99
|
+
return 'Attempted to connect a block to itself.';
|
|
100
|
+
case Blockly.Connection.REASON_DIFFERENT_WORKSPACES:
|
|
101
|
+
// Usually this means one block has been deleted.
|
|
102
|
+
return 'Blocks not on same workspace.';
|
|
103
|
+
case Blockly.Connection.REASON_WRONG_TYPE:
|
|
104
|
+
return 'Attempt to connect incompatible types.';
|
|
105
|
+
case Blockly.Connection.REASON_TARGET_NULL:
|
|
106
|
+
return 'Target connection is null.';
|
|
107
|
+
case Blockly.Connection.REASON_CHECKS_FAILED:
|
|
108
|
+
var connOne = /** @type {!Blockly.Connection} **/ (a);
|
|
109
|
+
var connTwo = /** @type {!Blockly.Connection} **/ (b);
|
|
110
|
+
var msg = 'Connection checks failed. ';
|
|
111
|
+
msg += connOne + ' expected ' + connOne.getCheck() + ', found ' + connTwo.getCheck();
|
|
112
|
+
return msg;
|
|
113
|
+
case Blockly.Connection.REASON_SHADOW_PARENT:
|
|
114
|
+
return 'Connecting non-shadow to shadow block.';
|
|
115
|
+
case Blockly.Connection.REASON_DRAG_CHECKS_FAILED:
|
|
116
|
+
return 'Drag checks failed.';
|
|
117
|
+
default:
|
|
118
|
+
return 'Unknown connection failure: this should never happen!';
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Check that connecting the given connections is safe, meaning that it would
|
|
124
|
+
* not break any of Blockly's basic assumptions (e.g. no self connections).
|
|
125
|
+
* @param {Blockly.Connection} a The first of the connections to check.
|
|
126
|
+
* @param {Blockly.Connection} b The second of the connections to check.
|
|
127
|
+
* @return {number} An enum with the reason this connection is safe or unsafe.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
Blockly.ConnectionChecker.prototype.doSafetyChecks = function(a, b) {
|
|
131
|
+
if (!a || !b) {
|
|
132
|
+
return Blockly.Connection.REASON_TARGET_NULL;
|
|
133
|
+
}
|
|
134
|
+
if (a.isSuperior()) {
|
|
135
|
+
var blockA = a.getSourceBlock();
|
|
136
|
+
var blockB = b.getSourceBlock();
|
|
137
|
+
} else {
|
|
138
|
+
var blockB = a.getSourceBlock();
|
|
139
|
+
var blockA = b.getSourceBlock();
|
|
140
|
+
}
|
|
141
|
+
if (blockA == blockB) {
|
|
142
|
+
return Blockly.Connection.REASON_SELF_CONNECTION;
|
|
143
|
+
} else if (b.type != Blockly.OPPOSITE_TYPE[a.type]) {
|
|
144
|
+
return Blockly.Connection.REASON_WRONG_TYPE;
|
|
145
|
+
} else if (blockA.workspace !== blockB.workspace) {
|
|
146
|
+
return Blockly.Connection.REASON_DIFFERENT_WORKSPACES;
|
|
147
|
+
} else if (blockA.isShadow() && !blockB.isShadow()) {
|
|
148
|
+
return Blockly.Connection.REASON_SHADOW_PARENT;
|
|
149
|
+
}
|
|
150
|
+
return Blockly.Connection.CAN_CONNECT;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Check whether this connection is compatible with another connection with
|
|
155
|
+
* respect to the value type system. E.g. square_root("Hello") is not
|
|
156
|
+
* compatible.
|
|
157
|
+
* @param {!Blockly.Connection} a Connection to compare.
|
|
158
|
+
* @param {!Blockly.Connection} b Connection to compare against.
|
|
159
|
+
* @return {boolean} True if the connections share a type.
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
Blockly.ConnectionChecker.prototype.doTypeChecks = function(a, b) {
|
|
163
|
+
var checkArrayOne = a.getCheck();
|
|
164
|
+
var checkArrayTwo = b.getCheck();
|
|
165
|
+
|
|
166
|
+
if (!checkArrayOne || !checkArrayTwo) {
|
|
167
|
+
// One or both sides are promiscuous enough that anything will fit.
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
// Find any intersection in the check lists.
|
|
171
|
+
for (var i = 0; i < checkArrayOne.length; i++) {
|
|
172
|
+
if (checkArrayTwo.indexOf(checkArrayOne[i]) != -1) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// No intersection.
|
|
177
|
+
return false;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Check whether this connection can be made by dragging.
|
|
182
|
+
* @param {!Blockly.RenderedConnection} a Connection to compare.
|
|
183
|
+
* @param {!Blockly.RenderedConnection} b Connection to compare against.
|
|
184
|
+
* @param {number} distance The maximum allowable distance between connections.
|
|
185
|
+
* @return {boolean} True if the connection is allowed during a drag.
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
Blockly.ConnectionChecker.prototype.doDragChecks = function(a, b, distance) {
|
|
189
|
+
if (a.distanceFrom(b) > distance) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Don't consider insertion markers.
|
|
194
|
+
if (b.getSourceBlock().isInsertionMarker()) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
switch (b.type) {
|
|
199
|
+
case Blockly.PREVIOUS_STATEMENT:
|
|
200
|
+
return this.canConnectToPrevious_(a, b);
|
|
201
|
+
case Blockly.OUTPUT_VALUE: {
|
|
202
|
+
// Don't offer to connect an already connected left (male) value plug to
|
|
203
|
+
// an available right (female) value plug.
|
|
204
|
+
if ((b.isConnected() &&
|
|
205
|
+
!b.targetBlock().isInsertionMarker()) ||
|
|
206
|
+
a.isConnected()) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
case Blockly.INPUT_VALUE: {
|
|
212
|
+
// Offering to connect the left (male) of a value block to an already
|
|
213
|
+
// connected value pair is ok, we'll splice it in.
|
|
214
|
+
// However, don't offer to splice into an immovable block.
|
|
215
|
+
if (b.isConnected() &&
|
|
216
|
+
!b.targetBlock().isMovable() &&
|
|
217
|
+
!b.targetBlock().isShadow()) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
case Blockly.NEXT_STATEMENT: {
|
|
223
|
+
// Don't let a block with no next connection bump other blocks out of the
|
|
224
|
+
// stack. But covering up a shadow block or stack of shadow blocks is
|
|
225
|
+
// fine. Similarly, replacing a terminal statement with another terminal
|
|
226
|
+
// statement is allowed.
|
|
227
|
+
if (b.isConnected() &&
|
|
228
|
+
!a.getSourceBlock().nextConnection &&
|
|
229
|
+
!b.targetBlock().isShadow() &&
|
|
230
|
+
b.targetBlock().nextConnection) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
default:
|
|
236
|
+
// Unexpected connection type.
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Don't let blocks try to connect to themselves or ones they nest.
|
|
241
|
+
if (Blockly.draggingConnections.indexOf(b) != -1) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return true;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Helper function for drag checking.
|
|
250
|
+
* @param {!Blockly.Connection} a The connection to check, which must be a
|
|
251
|
+
* statement input or next connection.
|
|
252
|
+
* @param {!Blockly.Connection} b A nearby connection to check, which
|
|
253
|
+
* must be a previous connection.
|
|
254
|
+
* @return {boolean} True if the connection is allowed, false otherwise.
|
|
255
|
+
* @protected
|
|
256
|
+
*/
|
|
257
|
+
Blockly.ConnectionChecker.prototype.canConnectToPrevious_ = function(a, b) {
|
|
258
|
+
if (a.targetConnection) {
|
|
259
|
+
// This connection is already occupied.
|
|
260
|
+
// A next connection will never disconnect itself mid-drag.
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Don't let blocks try to connect to themselves or ones they nest.
|
|
265
|
+
if (Blockly.draggingConnections.indexOf(b) != -1) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (!b.targetConnection) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
var targetBlock = b.targetBlock();
|
|
274
|
+
// If it is connected to a real block, game over.
|
|
275
|
+
if (!targetBlock.isInsertionMarker()) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
// If it's connected to an insertion marker but that insertion marker
|
|
279
|
+
// is the first block in a stack, it's still fine. If that insertion
|
|
280
|
+
// marker is in the middle of a stack, it won't work.
|
|
281
|
+
return !targetBlock.getPreviousBlock();
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
Blockly.registry.register(Blockly.registry.Type.CONNECTION_CHECKER,
|
|
285
|
+
Blockly.registry.DEFAULT, Blockly.ConnectionChecker);
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2011 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview A database of all the rendered connections that could
|
|
9
|
+
* possibly be connected to (i.e. not collapsed, etc).
|
|
10
|
+
* Sorted by y coordinate.
|
|
11
|
+
* @author fraser@google.com (Neil Fraser)
|
|
12
|
+
*/
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
goog.provide('Blockly.ConnectionDB');
|
|
16
|
+
|
|
17
|
+
goog.require('Blockly.RenderedConnection');
|
|
18
|
+
|
|
19
|
+
goog.requireType('Blockly.IConnectionChecker');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Database of connections.
|
|
24
|
+
* Connections are stored in order of their vertical component. This way
|
|
25
|
+
* connections in an area may be looked up quickly using a binary search.
|
|
26
|
+
* @param {!Blockly.IConnectionChecker} checker The workspace's
|
|
27
|
+
* connection type checker, used to decide if connections are valid during a
|
|
28
|
+
* drag.
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
Blockly.ConnectionDB = function(checker) {
|
|
32
|
+
/**
|
|
33
|
+
* Array of connections sorted by y position in workspace units.
|
|
34
|
+
* @type {!Array.<!Blockly.RenderedConnection>}
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
this.connections_ = [];
|
|
38
|
+
/**
|
|
39
|
+
* The workspace's connection type checker, used to decide if connections are
|
|
40
|
+
* valid during a drag.
|
|
41
|
+
* @type {!Blockly.IConnectionChecker}
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
this.connectionChecker_ = checker;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Add a connection to the database. Should not already exist in the database.
|
|
49
|
+
* @param {!Blockly.RenderedConnection} connection The connection to be added.
|
|
50
|
+
* @param {number} yPos The y position used to decide where to insert the
|
|
51
|
+
* connection.
|
|
52
|
+
* @package
|
|
53
|
+
*/
|
|
54
|
+
Blockly.ConnectionDB.prototype.addConnection = function(connection, yPos) {
|
|
55
|
+
var index = this.calculateIndexForYPos_(yPos);
|
|
56
|
+
this.connections_.splice(index, 0, connection);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Finds the index of the given connection.
|
|
61
|
+
*
|
|
62
|
+
* Starts by doing a binary search to find the approximate location, then
|
|
63
|
+
* linearly searches nearby for the exact connection.
|
|
64
|
+
* @param {!Blockly.RenderedConnection} conn The connection to find.
|
|
65
|
+
* @param {number} yPos The y position used to find the index of the connection.
|
|
66
|
+
* @return {number} The index of the connection, or -1 if the connection was
|
|
67
|
+
* not found.
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
Blockly.ConnectionDB.prototype.findIndexOfConnection_ = function(conn, yPos) {
|
|
71
|
+
if (!this.connections_.length) {
|
|
72
|
+
return -1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var bestGuess = this.calculateIndexForYPos_(yPos);
|
|
76
|
+
if (bestGuess >= this.connections_.length) {
|
|
77
|
+
// Not in list
|
|
78
|
+
return -1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
yPos = conn.y;
|
|
82
|
+
// Walk forward and back on the y axis looking for the connection.
|
|
83
|
+
var pointerMin = bestGuess;
|
|
84
|
+
var pointerMax = bestGuess;
|
|
85
|
+
while (pointerMin >= 0 && this.connections_[pointerMin].y == yPos) {
|
|
86
|
+
if (this.connections_[pointerMin] == conn) {
|
|
87
|
+
return pointerMin;
|
|
88
|
+
}
|
|
89
|
+
pointerMin--;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
while (pointerMax < this.connections_.length &&
|
|
93
|
+
this.connections_[pointerMax].y == yPos) {
|
|
94
|
+
if (this.connections_[pointerMax] == conn) {
|
|
95
|
+
return pointerMax;
|
|
96
|
+
}
|
|
97
|
+
pointerMax++;
|
|
98
|
+
}
|
|
99
|
+
return -1;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Finds the correct index for the given y position.
|
|
104
|
+
* @param {number} yPos The y position used to decide where to
|
|
105
|
+
* insert the connection.
|
|
106
|
+
* @return {number} The candidate index.
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
109
|
+
Blockly.ConnectionDB.prototype.calculateIndexForYPos_ = function(yPos) {
|
|
110
|
+
if (!this.connections_.length) {
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
var pointerMin = 0;
|
|
114
|
+
var pointerMax = this.connections_.length;
|
|
115
|
+
while (pointerMin < pointerMax) {
|
|
116
|
+
var pointerMid = Math.floor((pointerMin + pointerMax) / 2);
|
|
117
|
+
if (this.connections_[pointerMid].y < yPos) {
|
|
118
|
+
pointerMin = pointerMid + 1;
|
|
119
|
+
} else if (this.connections_[pointerMid].y > yPos) {
|
|
120
|
+
pointerMax = pointerMid;
|
|
121
|
+
} else {
|
|
122
|
+
pointerMin = pointerMid;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return pointerMin;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Remove a connection from the database. Must already exist in DB.
|
|
131
|
+
* @param {!Blockly.RenderedConnection} connection The connection to be removed.
|
|
132
|
+
* @param {number} yPos The y position used to find the index of the connection.
|
|
133
|
+
* @throws {Error} If the connection cannot be found in the database.
|
|
134
|
+
*/
|
|
135
|
+
Blockly.ConnectionDB.prototype.removeConnection = function(connection, yPos) {
|
|
136
|
+
var index = this.findIndexOfConnection_(connection, yPos);
|
|
137
|
+
if (index == -1) {
|
|
138
|
+
throw Error('Unable to find connection in connectionDB.');
|
|
139
|
+
}
|
|
140
|
+
this.connections_.splice(index, 1);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Find all nearby connections to the given connection.
|
|
145
|
+
* Type checking does not apply, since this function is used for bumping.
|
|
146
|
+
* @param {!Blockly.RenderedConnection} connection The connection whose
|
|
147
|
+
* neighbours should be returned.
|
|
148
|
+
* @param {number} maxRadius The maximum radius to another connection.
|
|
149
|
+
* @return {!Array.<!Blockly.RenderedConnection>} List of connections.
|
|
150
|
+
*/
|
|
151
|
+
Blockly.ConnectionDB.prototype.getNeighbours = function(connection, maxRadius) {
|
|
152
|
+
var db = this.connections_;
|
|
153
|
+
var currentX = connection.x;
|
|
154
|
+
var currentY = connection.y;
|
|
155
|
+
|
|
156
|
+
// Binary search to find the closest y location.
|
|
157
|
+
var pointerMin = 0;
|
|
158
|
+
var pointerMax = db.length - 2;
|
|
159
|
+
var pointerMid = pointerMax;
|
|
160
|
+
while (pointerMin < pointerMid) {
|
|
161
|
+
if (db[pointerMid].y < currentY) {
|
|
162
|
+
pointerMin = pointerMid;
|
|
163
|
+
} else {
|
|
164
|
+
pointerMax = pointerMid;
|
|
165
|
+
}
|
|
166
|
+
pointerMid = Math.floor((pointerMin + pointerMax) / 2);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var neighbours = [];
|
|
170
|
+
/**
|
|
171
|
+
* Computes if the current connection is within the allowed radius of another
|
|
172
|
+
* connection.
|
|
173
|
+
* This function is a closure and has access to outside variables.
|
|
174
|
+
* @param {number} yIndex The other connection's index in the database.
|
|
175
|
+
* @return {boolean} True if the current connection's vertical distance from
|
|
176
|
+
* the other connection is less than the allowed radius.
|
|
177
|
+
*/
|
|
178
|
+
function checkConnection_(yIndex) {
|
|
179
|
+
var dx = currentX - db[yIndex].x;
|
|
180
|
+
var dy = currentY - db[yIndex].y;
|
|
181
|
+
var r = Math.sqrt(dx * dx + dy * dy);
|
|
182
|
+
if (r <= maxRadius) {
|
|
183
|
+
neighbours.push(db[yIndex]);
|
|
184
|
+
}
|
|
185
|
+
return dy < maxRadius;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Walk forward and back on the y axis looking for the closest x,y point.
|
|
189
|
+
pointerMin = pointerMid;
|
|
190
|
+
pointerMax = pointerMid;
|
|
191
|
+
if (db.length) {
|
|
192
|
+
while (pointerMin >= 0 && checkConnection_(pointerMin)) {
|
|
193
|
+
pointerMin--;
|
|
194
|
+
}
|
|
195
|
+
do {
|
|
196
|
+
pointerMax++;
|
|
197
|
+
} while (pointerMax < db.length && checkConnection_(pointerMax));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return neighbours;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Is the candidate connection close to the reference connection.
|
|
205
|
+
* Extremely fast; only looks at Y distance.
|
|
206
|
+
* @param {number} index Index in database of candidate connection.
|
|
207
|
+
* @param {number} baseY Reference connection's Y value.
|
|
208
|
+
* @param {number} maxRadius The maximum radius to another connection.
|
|
209
|
+
* @return {boolean} True if connection is in range.
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
Blockly.ConnectionDB.prototype.isInYRange_ = function(index, baseY, maxRadius) {
|
|
213
|
+
return (Math.abs(this.connections_[index].y - baseY) <= maxRadius);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Find the closest compatible connection to this connection.
|
|
218
|
+
* @param {!Blockly.RenderedConnection} conn The connection searching for a compatible
|
|
219
|
+
* mate.
|
|
220
|
+
* @param {number} maxRadius The maximum radius to another connection.
|
|
221
|
+
* @param {!Blockly.utils.Coordinate} dxy Offset between this connection's
|
|
222
|
+
* location in the database and the current location (as a result of
|
|
223
|
+
* dragging).
|
|
224
|
+
* @return {!{connection: Blockly.RenderedConnection, radius: number}}
|
|
225
|
+
* Contains two properties: 'connection' which is either another
|
|
226
|
+
* connection or null, and 'radius' which is the distance.
|
|
227
|
+
*/
|
|
228
|
+
Blockly.ConnectionDB.prototype.searchForClosest = function(conn, maxRadius,
|
|
229
|
+
dxy) {
|
|
230
|
+
if (!this.connections_.length) {
|
|
231
|
+
// Don't bother.
|
|
232
|
+
return {connection: null, radius: maxRadius};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Stash the values of x and y from before the drag.
|
|
236
|
+
var baseY = conn.y;
|
|
237
|
+
var baseX = conn.x;
|
|
238
|
+
|
|
239
|
+
conn.x = baseX + dxy.x;
|
|
240
|
+
conn.y = baseY + dxy.y;
|
|
241
|
+
|
|
242
|
+
// calculateIndexForYPos_ finds an index for insertion, which is always
|
|
243
|
+
// after any block with the same y index. We want to search both forward
|
|
244
|
+
// and back, so search on both sides of the index.
|
|
245
|
+
var closestIndex = this.calculateIndexForYPos_(conn.y);
|
|
246
|
+
|
|
247
|
+
var bestConnection = null;
|
|
248
|
+
var bestRadius = maxRadius;
|
|
249
|
+
var temp;
|
|
250
|
+
|
|
251
|
+
// Walk forward and back on the y axis looking for the closest x,y point.
|
|
252
|
+
var pointerMin = closestIndex - 1;
|
|
253
|
+
while (pointerMin >= 0 && this.isInYRange_(pointerMin, conn.y, maxRadius)) {
|
|
254
|
+
temp = this.connections_[pointerMin];
|
|
255
|
+
if (this.connectionChecker_.canConnect(conn, temp, true, bestRadius)) {
|
|
256
|
+
bestConnection = temp;
|
|
257
|
+
bestRadius = temp.distanceFrom(conn);
|
|
258
|
+
}
|
|
259
|
+
pointerMin--;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
var pointerMax = closestIndex;
|
|
263
|
+
while (pointerMax < this.connections_.length &&
|
|
264
|
+
this.isInYRange_(pointerMax, conn.y, maxRadius)) {
|
|
265
|
+
temp = this.connections_[pointerMax];
|
|
266
|
+
if (this.connectionChecker_.canConnect(conn, temp, true, bestRadius)) {
|
|
267
|
+
bestConnection = temp;
|
|
268
|
+
bestRadius = temp.distanceFrom(conn);
|
|
269
|
+
}
|
|
270
|
+
pointerMax++;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Reset the values of x and y.
|
|
274
|
+
conn.x = baseX;
|
|
275
|
+
conn.y = baseY;
|
|
276
|
+
|
|
277
|
+
// If there were no valid connections, bestConnection will be null.
|
|
278
|
+
return {connection: bestConnection, radius: bestRadius};
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Initialize a set of connection DBs for a workspace.
|
|
283
|
+
* @param {!Blockly.IConnectionChecker} checker The workspace's
|
|
284
|
+
* connection checker, used to decide if connections are valid during a drag.
|
|
285
|
+
* @return {!Array.<!Blockly.ConnectionDB>} Array of databases.
|
|
286
|
+
*/
|
|
287
|
+
Blockly.ConnectionDB.init = function(checker) {
|
|
288
|
+
// Create four databases, one for each connection type.
|
|
289
|
+
var dbList = [];
|
|
290
|
+
dbList[Blockly.INPUT_VALUE] = new Blockly.ConnectionDB(checker);
|
|
291
|
+
dbList[Blockly.OUTPUT_VALUE] = new Blockly.ConnectionDB(checker);
|
|
292
|
+
dbList[Blockly.NEXT_STATEMENT] = new Blockly.ConnectionDB(checker);
|
|
293
|
+
dbList[Blockly.PREVIOUS_STATEMENT] = new Blockly.ConnectionDB(checker);
|
|
294
|
+
return dbList;
|
|
295
|
+
};
|