nodeskini 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +3 -3
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview The class representing an AST node.
|
|
9
|
+
* Used to traverse the Blockly AST.
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.ASTNode');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.utils.Coordinate');
|
|
16
|
+
|
|
17
|
+
goog.requireType('Blockly.IASTNodeLocation');
|
|
18
|
+
goog.requireType('Blockly.IASTNodeLocationWithBlock');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Class for an AST node.
|
|
23
|
+
* It is recommended that you use one of the createNode methods instead of
|
|
24
|
+
* creating a node directly.
|
|
25
|
+
* @param {string} type The type of the location.
|
|
26
|
+
* Must be in Blockly.ASTNode.types.
|
|
27
|
+
* @param {!Blockly.IASTNodeLocation} location The position in the AST.
|
|
28
|
+
* @param {!Blockly.ASTNode.Params=} opt_params Optional dictionary of options.
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
Blockly.ASTNode = function(type, location, opt_params) {
|
|
32
|
+
if (!location) {
|
|
33
|
+
throw Error('Cannot create a node without a location.');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The type of the location.
|
|
38
|
+
* One of Blockly.ASTNode.types
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
this.type_ = type;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Whether the location points to a connection.
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
this.isConnection_ = Blockly.ASTNode.isConnectionType_(type);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The location of the AST node.
|
|
53
|
+
* @type {!Blockly.IASTNodeLocation}
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
this.location_ = location;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The coordinate on the workspace.
|
|
60
|
+
* @type {Blockly.utils.Coordinate}
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
this.wsCoordinate_ = null;
|
|
64
|
+
|
|
65
|
+
this.processParams_(opt_params || null);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {{
|
|
70
|
+
* wsCoordinate: Blockly.utils.Coordinate
|
|
71
|
+
* }}
|
|
72
|
+
*/
|
|
73
|
+
Blockly.ASTNode.Params;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Object holding different types for an AST node.
|
|
77
|
+
* @enum {string}
|
|
78
|
+
*/
|
|
79
|
+
Blockly.ASTNode.types = {
|
|
80
|
+
FIELD: 'field',
|
|
81
|
+
BLOCK: 'block',
|
|
82
|
+
INPUT: 'input',
|
|
83
|
+
OUTPUT: 'output',
|
|
84
|
+
NEXT: 'next',
|
|
85
|
+
PREVIOUS: 'previous',
|
|
86
|
+
STACK: 'stack',
|
|
87
|
+
WORKSPACE: 'workspace'
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* True to navigate to all fields. False to only navigate to clickable fields.
|
|
92
|
+
* @type {boolean}
|
|
93
|
+
*/
|
|
94
|
+
Blockly.ASTNode.NAVIGATE_ALL_FIELDS = false;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The default y offset to use when moving the cursor from a stack to the
|
|
98
|
+
* workspace.
|
|
99
|
+
* @type {number}
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
Blockly.ASTNode.DEFAULT_OFFSET_Y = -20;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Whether an AST node of the given type points to a connection.
|
|
106
|
+
* @param {string} type The type to check. One of Blockly.ASTNode.types.
|
|
107
|
+
* @return {boolean} True if a node of the given type points to a connection.
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
Blockly.ASTNode.isConnectionType_ = function(type) {
|
|
111
|
+
switch (type) {
|
|
112
|
+
case Blockly.ASTNode.types.PREVIOUS:
|
|
113
|
+
case Blockly.ASTNode.types.NEXT:
|
|
114
|
+
case Blockly.ASTNode.types.INPUT:
|
|
115
|
+
case Blockly.ASTNode.types.OUTPUT:
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Create an AST node pointing to a field.
|
|
123
|
+
* @param {Blockly.Field} field The location of the AST node.
|
|
124
|
+
* @return {Blockly.ASTNode} An AST node pointing to a field.
|
|
125
|
+
*/
|
|
126
|
+
Blockly.ASTNode.createFieldNode = function(field) {
|
|
127
|
+
if (!field) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.FIELD, field);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Creates an AST node pointing to a connection. If the connection has a parent
|
|
135
|
+
* input then create an AST node of type input that will hold the connection.
|
|
136
|
+
* @param {Blockly.Connection} connection This is the connection the node will
|
|
137
|
+
* point to.
|
|
138
|
+
* @return {Blockly.ASTNode} An AST node pointing to a connection.
|
|
139
|
+
*/
|
|
140
|
+
Blockly.ASTNode.createConnectionNode = function(connection) {
|
|
141
|
+
if (!connection) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (connection.type == Blockly.INPUT_VALUE) {
|
|
145
|
+
return Blockly.ASTNode.createInputNode(connection.getParentInput());
|
|
146
|
+
} else if (connection.type == Blockly.NEXT_STATEMENT &&
|
|
147
|
+
connection.getParentInput()) {
|
|
148
|
+
return Blockly.ASTNode.createInputNode(connection.getParentInput());
|
|
149
|
+
} else if (connection.type == Blockly.NEXT_STATEMENT) {
|
|
150
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.NEXT, connection);
|
|
151
|
+
} else if (connection.type == Blockly.OUTPUT_VALUE) {
|
|
152
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.OUTPUT, connection);
|
|
153
|
+
} else if (connection.type == Blockly.PREVIOUS_STATEMENT) {
|
|
154
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.PREVIOUS, connection);
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Creates an AST node pointing to an input. Stores the input connection as the
|
|
161
|
+
* location.
|
|
162
|
+
* @param {Blockly.Input} input The input used to create an AST node.
|
|
163
|
+
* @return {Blockly.ASTNode} An AST node pointing to a input.
|
|
164
|
+
*/
|
|
165
|
+
Blockly.ASTNode.createInputNode = function(input) {
|
|
166
|
+
if (!input || !input.connection) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.INPUT, input.connection);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Creates an AST node pointing to a block.
|
|
174
|
+
* @param {Blockly.Block} block The block used to create an AST node.
|
|
175
|
+
* @return {Blockly.ASTNode} An AST node pointing to a block.
|
|
176
|
+
*/
|
|
177
|
+
Blockly.ASTNode.createBlockNode = function(block) {
|
|
178
|
+
if (!block) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.BLOCK, block);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Create an AST node of type stack. A stack, represented by its top block, is
|
|
186
|
+
* the set of all blocks connected to a top block, including the top block.
|
|
187
|
+
* @param {Blockly.Block} topBlock A top block has no parent and can be found
|
|
188
|
+
* in the list returned by workspace.getTopBlocks().
|
|
189
|
+
* @return {Blockly.ASTNode} An AST node of type stack that points to the top
|
|
190
|
+
* block on the stack.
|
|
191
|
+
*/
|
|
192
|
+
Blockly.ASTNode.createStackNode = function(topBlock) {
|
|
193
|
+
if (!topBlock) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return new Blockly.ASTNode(Blockly.ASTNode.types.STACK, topBlock);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Creates an AST node pointing to a workspace.
|
|
201
|
+
* @param {!Blockly.Workspace} workspace The workspace that we are on.
|
|
202
|
+
* @param {Blockly.utils.Coordinate} wsCoordinate The position on the workspace
|
|
203
|
+
* for this node.
|
|
204
|
+
* @return {Blockly.ASTNode} An AST node pointing to a workspace and a position
|
|
205
|
+
* on the workspace.
|
|
206
|
+
*/
|
|
207
|
+
Blockly.ASTNode.createWorkspaceNode = function(workspace, wsCoordinate) {
|
|
208
|
+
if (!wsCoordinate || !workspace) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
var params = {
|
|
212
|
+
wsCoordinate: wsCoordinate
|
|
213
|
+
};
|
|
214
|
+
return new Blockly.ASTNode(
|
|
215
|
+
Blockly.ASTNode.types.WORKSPACE, workspace, params);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Creates an AST node for the top position on a block.
|
|
220
|
+
* This is either an output connection, previous connection, or block.
|
|
221
|
+
* @param {!Blockly.Block} block The block to find the top most AST node on.
|
|
222
|
+
* @return {Blockly.ASTNode} The AST node holding the top most position on the
|
|
223
|
+
* block.
|
|
224
|
+
*/
|
|
225
|
+
Blockly.ASTNode.createTopNode = function(block) {
|
|
226
|
+
var astNode;
|
|
227
|
+
var topConnection = block.previousConnection || block.outputConnection;
|
|
228
|
+
if (topConnection) {
|
|
229
|
+
astNode = Blockly.ASTNode.createConnectionNode(topConnection);
|
|
230
|
+
} else {
|
|
231
|
+
astNode = Blockly.ASTNode.createBlockNode(block);
|
|
232
|
+
}
|
|
233
|
+
return astNode;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Parse the optional parameters.
|
|
238
|
+
* @param {?Blockly.ASTNode.Params} params The user specified parameters.
|
|
239
|
+
* @private
|
|
240
|
+
*/
|
|
241
|
+
Blockly.ASTNode.prototype.processParams_ = function(params) {
|
|
242
|
+
if (!params) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (params.wsCoordinate) {
|
|
246
|
+
this.wsCoordinate_ = params.wsCoordinate;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Gets the value pointed to by this node.
|
|
252
|
+
* It is the callers responsibility to check the node type to figure out what
|
|
253
|
+
* type of object they get back from this.
|
|
254
|
+
* @return {!Blockly.IASTNodeLocation} The current field, connection, workspace, or
|
|
255
|
+
* block the cursor is on.
|
|
256
|
+
*/
|
|
257
|
+
Blockly.ASTNode.prototype.getLocation = function() {
|
|
258
|
+
return this.location_;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The type of the current location.
|
|
263
|
+
* One of Blockly.ASTNode.types
|
|
264
|
+
* @return {string} The type of the location.
|
|
265
|
+
*/
|
|
266
|
+
Blockly.ASTNode.prototype.getType = function() {
|
|
267
|
+
return this.type_;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The coordinate on the workspace.
|
|
272
|
+
* @return {Blockly.utils.Coordinate} The workspace coordinate or null if the
|
|
273
|
+
* location is not a workspace.
|
|
274
|
+
*/
|
|
275
|
+
Blockly.ASTNode.prototype.getWsCoordinate = function() {
|
|
276
|
+
return this.wsCoordinate_;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Whether the node points to a connection.
|
|
281
|
+
* @return {boolean} [description]
|
|
282
|
+
* @package
|
|
283
|
+
*/
|
|
284
|
+
Blockly.ASTNode.prototype.isConnection = function() {
|
|
285
|
+
return this.isConnection_;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Given an input find the next editable field or an input with a non null
|
|
290
|
+
* connection in the same block. The current location must be an input
|
|
291
|
+
* connection.
|
|
292
|
+
* @return {Blockly.ASTNode} The AST node holding the next field or connection
|
|
293
|
+
* or null if there is no editable field or input connection after the given
|
|
294
|
+
* input.
|
|
295
|
+
* @private
|
|
296
|
+
*/
|
|
297
|
+
Blockly.ASTNode.prototype.findNextForInput_ = function() {
|
|
298
|
+
var location = /** @type {!Blockly.Connection} */ (this.location_);
|
|
299
|
+
var parentInput = location.getParentInput();
|
|
300
|
+
var block = parentInput.getSourceBlock();
|
|
301
|
+
var curIdx = block.inputList.indexOf(parentInput);
|
|
302
|
+
for (var i = curIdx + 1, input; (input = block.inputList[i]); i++) {
|
|
303
|
+
var fieldRow = input.fieldRow;
|
|
304
|
+
for (var j = 0, field; (field = fieldRow[j]); j++) {
|
|
305
|
+
if (field.isClickable() || Blockly.ASTNode.NAVIGATE_ALL_FIELDS) {
|
|
306
|
+
return Blockly.ASTNode.createFieldNode(field);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (input.connection) {
|
|
310
|
+
return Blockly.ASTNode.createInputNode(input);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Given a field find the next editable field or an input with a non null
|
|
318
|
+
* connection in the same block. The current location must be a field.
|
|
319
|
+
* @return {Blockly.ASTNode} The AST node pointing to the next field or
|
|
320
|
+
* connection or null if there is no editable field or input connection
|
|
321
|
+
* after the given input.
|
|
322
|
+
* @private
|
|
323
|
+
*/
|
|
324
|
+
Blockly.ASTNode.prototype.findNextForField_ = function() {
|
|
325
|
+
var location = /** @type {!Blockly.Field} */ (this.location_);
|
|
326
|
+
var input = location.getParentInput();
|
|
327
|
+
var block = location.getSourceBlock();
|
|
328
|
+
var curIdx = block.inputList.indexOf(/** @type {!Blockly.Input} */ (input));
|
|
329
|
+
var fieldIdx = input.fieldRow.indexOf(location) + 1;
|
|
330
|
+
for (var i = curIdx, newInput; (newInput = block.inputList[i]); i++) {
|
|
331
|
+
var fieldRow = newInput.fieldRow;
|
|
332
|
+
while (fieldIdx < fieldRow.length) {
|
|
333
|
+
if (fieldRow[fieldIdx].isClickable() || Blockly.ASTNode.NAVIGATE_ALL_FIELDS) {
|
|
334
|
+
return Blockly.ASTNode.createFieldNode(fieldRow[fieldIdx]);
|
|
335
|
+
}
|
|
336
|
+
fieldIdx++;
|
|
337
|
+
}
|
|
338
|
+
fieldIdx = 0;
|
|
339
|
+
if (newInput.connection) {
|
|
340
|
+
return Blockly.ASTNode.createInputNode(newInput);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Given an input find the previous editable field or an input with a non null
|
|
348
|
+
* connection in the same block. The current location must be an input
|
|
349
|
+
* connection.
|
|
350
|
+
* @return {Blockly.ASTNode} The AST node holding the previous field or
|
|
351
|
+
* connection.
|
|
352
|
+
* @private
|
|
353
|
+
*/
|
|
354
|
+
Blockly.ASTNode.prototype.findPrevForInput_ = function() {
|
|
355
|
+
var location = /** @type {!Blockly.Connection} */ (this.location_);
|
|
356
|
+
var parentInput = location.getParentInput();
|
|
357
|
+
var block = parentInput.getSourceBlock();
|
|
358
|
+
var curIdx = block.inputList.indexOf(parentInput);
|
|
359
|
+
for (var i = curIdx, input; (input = block.inputList[i]); i--) {
|
|
360
|
+
if (input.connection && input !== parentInput) {
|
|
361
|
+
return Blockly.ASTNode.createInputNode(input);
|
|
362
|
+
}
|
|
363
|
+
var fieldRow = input.fieldRow;
|
|
364
|
+
for (var j = fieldRow.length - 1, field; (field = fieldRow[j]); j--) {
|
|
365
|
+
if (field.isClickable() || Blockly.ASTNode.NAVIGATE_ALL_FIELDS) {
|
|
366
|
+
return Blockly.ASTNode.createFieldNode(field);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Given a field find the previous editable field or an input with a non null
|
|
375
|
+
* connection in the same block. The current location must be a field.
|
|
376
|
+
* @return {Blockly.ASTNode} The AST node holding the previous input or field.
|
|
377
|
+
* @private
|
|
378
|
+
*/
|
|
379
|
+
Blockly.ASTNode.prototype.findPrevForField_ = function() {
|
|
380
|
+
var location = /** @type {!Blockly.Field} */ (this.location_);
|
|
381
|
+
var parentInput = location.getParentInput();
|
|
382
|
+
var block = location.getSourceBlock();
|
|
383
|
+
var curIdx = block.inputList.indexOf(
|
|
384
|
+
/** @type {!Blockly.Input} */ (parentInput));
|
|
385
|
+
var fieldIdx = parentInput.fieldRow.indexOf(location) - 1;
|
|
386
|
+
for (var i = curIdx, input; (input = block.inputList[i]); i--) {
|
|
387
|
+
if (input.connection && input !== parentInput) {
|
|
388
|
+
return Blockly.ASTNode.createInputNode(input);
|
|
389
|
+
}
|
|
390
|
+
var fieldRow = input.fieldRow;
|
|
391
|
+
while (fieldIdx > -1) {
|
|
392
|
+
if (fieldRow[fieldIdx].isClickable() || Blockly.ASTNode.NAVIGATE_ALL_FIELDS) {
|
|
393
|
+
return Blockly.ASTNode.createFieldNode(fieldRow[fieldIdx]);
|
|
394
|
+
}
|
|
395
|
+
fieldIdx--;
|
|
396
|
+
}
|
|
397
|
+
// Reset the fieldIdx to the length of the field row of the previous input.
|
|
398
|
+
if (i - 1 >= 0) {
|
|
399
|
+
fieldIdx = block.inputList[i - 1].fieldRow.length - 1;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return null;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Navigate between stacks of blocks on the workspace.
|
|
407
|
+
* @param {boolean} forward True to go forward. False to go backwards.
|
|
408
|
+
* @return {Blockly.ASTNode} The first block of the next stack or null if there
|
|
409
|
+
* are no blocks on the workspace.
|
|
410
|
+
* @private
|
|
411
|
+
*/
|
|
412
|
+
Blockly.ASTNode.prototype.navigateBetweenStacks_ = function(forward) {
|
|
413
|
+
var curLocation = this.getLocation();
|
|
414
|
+
if (!(curLocation instanceof Blockly.Block)) {
|
|
415
|
+
curLocation = /** @type {!Blockly.IASTNodeLocationWithBlock} */ (
|
|
416
|
+
curLocation).getSourceBlock();
|
|
417
|
+
}
|
|
418
|
+
if (!curLocation || !curLocation.workspace) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
var curRoot = curLocation.getRootBlock();
|
|
422
|
+
var topBlocks = curRoot.workspace.getTopBlocks(true);
|
|
423
|
+
for (var i = 0, topBlock; (topBlock = topBlocks[i]); i++) {
|
|
424
|
+
if (curRoot.id == topBlock.id) {
|
|
425
|
+
var offset = forward ? 1 : -1;
|
|
426
|
+
var resultIndex = i + offset;
|
|
427
|
+
if (resultIndex == -1 || resultIndex == topBlocks.length) {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
return Blockly.ASTNode.createStackNode(topBlocks[resultIndex]);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
throw Error('Couldn\'t find ' + (forward ? 'next' : 'previous') + ' stack?!');
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Finds the top most AST node for a given block.
|
|
438
|
+
* This is either the previous connection, output connection or block depending
|
|
439
|
+
* on what kind of connections the block has.
|
|
440
|
+
* @param {!Blockly.Block} block The block that we want to find the top
|
|
441
|
+
* connection on.
|
|
442
|
+
* @return {!Blockly.ASTNode} The AST node containing the top connection.
|
|
443
|
+
* @private
|
|
444
|
+
*/
|
|
445
|
+
Blockly.ASTNode.prototype.findTopASTNodeForBlock_ = function(block) {
|
|
446
|
+
var topConnection = block.previousConnection || block.outputConnection;
|
|
447
|
+
if (topConnection) {
|
|
448
|
+
return /** @type {!Blockly.ASTNode} */ (Blockly.ASTNode.createConnectionNode(
|
|
449
|
+
topConnection));
|
|
450
|
+
} else {
|
|
451
|
+
return /** @type {!Blockly.ASTNode} */ (Blockly.ASTNode.createBlockNode(
|
|
452
|
+
block));
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Get the AST node pointing to the input that the block is nested under or if
|
|
458
|
+
* the block is not nested then get the stack AST node.
|
|
459
|
+
* @param {Blockly.Block} block The source block of the current location.
|
|
460
|
+
* @return {Blockly.ASTNode} The AST node pointing to the input connection or
|
|
461
|
+
* the top block of the stack this block is in.
|
|
462
|
+
* @private
|
|
463
|
+
*/
|
|
464
|
+
Blockly.ASTNode.prototype.getOutAstNodeForBlock_ = function(block) {
|
|
465
|
+
if (!block) {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
var topBlock;
|
|
469
|
+
// If the block doesn't have a previous connection then it is the top of the
|
|
470
|
+
// substack.
|
|
471
|
+
topBlock = block.getTopStackBlock();
|
|
472
|
+
var topConnection = topBlock.previousConnection || topBlock.outputConnection;
|
|
473
|
+
// If the top connection has a parentInput, create an AST node pointing to
|
|
474
|
+
// that input.
|
|
475
|
+
if (topConnection && topConnection.targetConnection &&
|
|
476
|
+
topConnection.targetConnection.getParentInput()) {
|
|
477
|
+
return Blockly.ASTNode.createInputNode(
|
|
478
|
+
topConnection.targetConnection.getParentInput());
|
|
479
|
+
} else {
|
|
480
|
+
// Go to stack level if you are not underneath an input.
|
|
481
|
+
return Blockly.ASTNode.createStackNode(topBlock);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Find the first editable field or input with a connection on a given block.
|
|
487
|
+
* @param {!Blockly.Block} block The source block of the current location.
|
|
488
|
+
* @return {Blockly.ASTNode} An AST node pointing to the first field or input.
|
|
489
|
+
* Null if there are no editable fields or inputs with connections on the block.
|
|
490
|
+
* @private
|
|
491
|
+
*/
|
|
492
|
+
Blockly.ASTNode.prototype.findFirstFieldOrInput_ = function(block) {
|
|
493
|
+
var inputs = block.inputList;
|
|
494
|
+
for (var i = 0, input; (input = inputs[i]); i++) {
|
|
495
|
+
var fieldRow = input.fieldRow;
|
|
496
|
+
for (var j = 0, field; (field = fieldRow[j]); j++) {
|
|
497
|
+
if (field.isClickable() || Blockly.ASTNode.NAVIGATE_ALL_FIELDS) {
|
|
498
|
+
return Blockly.ASTNode.createFieldNode(field);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
if (input.connection) {
|
|
502
|
+
return Blockly.ASTNode.createInputNode(input);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return null;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Finds the source block of the location of this node.
|
|
510
|
+
* @return {Blockly.Block} The source block of the location, or null if the node
|
|
511
|
+
* is of type workspace.
|
|
512
|
+
*/
|
|
513
|
+
Blockly.ASTNode.prototype.getSourceBlock = function() {
|
|
514
|
+
if (this.getType() === Blockly.ASTNode.types.BLOCK) {
|
|
515
|
+
return /** @type {Blockly.Block} */ (this.getLocation());
|
|
516
|
+
} else if (this.getType() === Blockly.ASTNode.types.STACK) {
|
|
517
|
+
return /** @type {Blockly.Block} */ (this.getLocation());
|
|
518
|
+
} else if (this.getType() === Blockly.ASTNode.types.WORKSPACE) {
|
|
519
|
+
return null;
|
|
520
|
+
} else {
|
|
521
|
+
return /** @type {Blockly.IASTNodeLocationWithBlock} */ (
|
|
522
|
+
this.getLocation()).getSourceBlock();
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Find the element to the right of the current element in the AST.
|
|
528
|
+
* @return {Blockly.ASTNode} An AST node that wraps the next field, connection,
|
|
529
|
+
* block, or workspace. Or null if there is no node to the right.
|
|
530
|
+
*/
|
|
531
|
+
Blockly.ASTNode.prototype.next = function() {
|
|
532
|
+
switch (this.type_) {
|
|
533
|
+
case Blockly.ASTNode.types.STACK:
|
|
534
|
+
return this.navigateBetweenStacks_(true);
|
|
535
|
+
|
|
536
|
+
case Blockly.ASTNode.types.OUTPUT:
|
|
537
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
538
|
+
return Blockly.ASTNode.createBlockNode(connection.getSourceBlock());
|
|
539
|
+
|
|
540
|
+
case Blockly.ASTNode.types.FIELD:
|
|
541
|
+
return this.findNextForField_();
|
|
542
|
+
|
|
543
|
+
case Blockly.ASTNode.types.INPUT:
|
|
544
|
+
return this.findNextForInput_();
|
|
545
|
+
|
|
546
|
+
case Blockly.ASTNode.types.BLOCK:
|
|
547
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
548
|
+
var nextConnection = block.nextConnection;
|
|
549
|
+
return Blockly.ASTNode.createConnectionNode(nextConnection);
|
|
550
|
+
|
|
551
|
+
case Blockly.ASTNode.types.PREVIOUS:
|
|
552
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
553
|
+
return Blockly.ASTNode.createBlockNode(connection.getSourceBlock());
|
|
554
|
+
|
|
555
|
+
case Blockly.ASTNode.types.NEXT:
|
|
556
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
557
|
+
var targetConnection = connection.targetConnection;
|
|
558
|
+
return Blockly.ASTNode.createConnectionNode(targetConnection);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
return null;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Find the element one level below and all the way to the left of the current
|
|
566
|
+
* location.
|
|
567
|
+
* @return {Blockly.ASTNode} An AST node that wraps the next field, connection,
|
|
568
|
+
* workspace, or block. Or null if there is nothing below this node.
|
|
569
|
+
*/
|
|
570
|
+
Blockly.ASTNode.prototype.in = function() {
|
|
571
|
+
switch (this.type_) {
|
|
572
|
+
case Blockly.ASTNode.types.WORKSPACE:
|
|
573
|
+
var workspace = /** @type {!Blockly.Workspace} */ (this.location_);
|
|
574
|
+
var topBlocks = workspace.getTopBlocks(true);
|
|
575
|
+
if (topBlocks.length > 0) {
|
|
576
|
+
return Blockly.ASTNode.createStackNode(topBlocks[0]);
|
|
577
|
+
}
|
|
578
|
+
break;
|
|
579
|
+
|
|
580
|
+
case Blockly.ASTNode.types.STACK:
|
|
581
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
582
|
+
return this.findTopASTNodeForBlock_(block);
|
|
583
|
+
|
|
584
|
+
case Blockly.ASTNode.types.BLOCK:
|
|
585
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
586
|
+
return this.findFirstFieldOrInput_(block);
|
|
587
|
+
|
|
588
|
+
case Blockly.ASTNode.types.INPUT:
|
|
589
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
590
|
+
var targetConnection = connection.targetConnection;
|
|
591
|
+
return Blockly.ASTNode.createConnectionNode(targetConnection);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return null;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Find the element to the left of the current element in the AST.
|
|
599
|
+
* @return {Blockly.ASTNode} An AST node that wraps the previous field,
|
|
600
|
+
* connection, workspace or block. Or null if no node exists to the left.
|
|
601
|
+
* null.
|
|
602
|
+
*/
|
|
603
|
+
Blockly.ASTNode.prototype.prev = function() {
|
|
604
|
+
switch (this.type_) {
|
|
605
|
+
case Blockly.ASTNode.types.STACK:
|
|
606
|
+
return this.navigateBetweenStacks_(false);
|
|
607
|
+
|
|
608
|
+
case Blockly.ASTNode.types.OUTPUT:
|
|
609
|
+
return null;
|
|
610
|
+
|
|
611
|
+
case Blockly.ASTNode.types.FIELD:
|
|
612
|
+
return this.findPrevForField_();
|
|
613
|
+
|
|
614
|
+
case Blockly.ASTNode.types.INPUT:
|
|
615
|
+
return this.findPrevForInput_();
|
|
616
|
+
|
|
617
|
+
case Blockly.ASTNode.types.BLOCK:
|
|
618
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
619
|
+
var topConnection = block.previousConnection || block.outputConnection;
|
|
620
|
+
return Blockly.ASTNode.createConnectionNode(topConnection);
|
|
621
|
+
|
|
622
|
+
case Blockly.ASTNode.types.PREVIOUS:
|
|
623
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
624
|
+
var targetConnection = connection.targetConnection;
|
|
625
|
+
if (targetConnection && !targetConnection.getParentInput()) {
|
|
626
|
+
return Blockly.ASTNode.createConnectionNode(targetConnection);
|
|
627
|
+
}
|
|
628
|
+
break;
|
|
629
|
+
|
|
630
|
+
case Blockly.ASTNode.types.NEXT:
|
|
631
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
632
|
+
return Blockly.ASTNode.createBlockNode(connection.getSourceBlock());
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
return null;
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Find the next element that is one position above and all the way to the left
|
|
640
|
+
* of the current location.
|
|
641
|
+
* @return {Blockly.ASTNode} An AST node that wraps the next field, connection,
|
|
642
|
+
* workspace or block. Or null if we are at the workspace level.
|
|
643
|
+
*/
|
|
644
|
+
Blockly.ASTNode.prototype.out = function() {
|
|
645
|
+
switch (this.type_) {
|
|
646
|
+
case Blockly.ASTNode.types.STACK:
|
|
647
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
648
|
+
var blockPos = block.getRelativeToSurfaceXY();
|
|
649
|
+
// TODO: Make sure this is in the bounds of the workspace.
|
|
650
|
+
var wsCoordinate = new Blockly.utils.Coordinate(
|
|
651
|
+
blockPos.x, blockPos.y + Blockly.ASTNode.DEFAULT_OFFSET_Y);
|
|
652
|
+
return Blockly.ASTNode.createWorkspaceNode(block.workspace, wsCoordinate);
|
|
653
|
+
|
|
654
|
+
case Blockly.ASTNode.types.OUTPUT:
|
|
655
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
656
|
+
var target = connection.targetConnection;
|
|
657
|
+
if (target) {
|
|
658
|
+
return Blockly.ASTNode.createConnectionNode(target);
|
|
659
|
+
}
|
|
660
|
+
return Blockly.ASTNode.createStackNode(connection.getSourceBlock());
|
|
661
|
+
|
|
662
|
+
case Blockly.ASTNode.types.FIELD:
|
|
663
|
+
var field = /** @type {!Blockly.Field} */ (this.location_);
|
|
664
|
+
return Blockly.ASTNode.createBlockNode(field.getSourceBlock());
|
|
665
|
+
|
|
666
|
+
case Blockly.ASTNode.types.INPUT:
|
|
667
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
668
|
+
return Blockly.ASTNode.createBlockNode(connection.getSourceBlock());
|
|
669
|
+
|
|
670
|
+
case Blockly.ASTNode.types.BLOCK:
|
|
671
|
+
var block = /** @type {!Blockly.Block} */ (this.location_);
|
|
672
|
+
return this.getOutAstNodeForBlock_(block);
|
|
673
|
+
|
|
674
|
+
case Blockly.ASTNode.types.PREVIOUS:
|
|
675
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
676
|
+
return this.getOutAstNodeForBlock_(connection.getSourceBlock());
|
|
677
|
+
|
|
678
|
+
case Blockly.ASTNode.types.NEXT:
|
|
679
|
+
var connection = /** @type {!Blockly.Connection} */ (this.location_);
|
|
680
|
+
return this.getOutAstNodeForBlock_(connection.getSourceBlock());
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
return null;
|
|
684
|
+
};
|