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,895 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Definition of the Blockly.tree.BaseNode class.
|
|
9
|
+
* This class is similar to Closure's goog.ui.tree.BaseNode class.
|
|
10
|
+
* @author samelh@google.com (Sam El-Husseini)
|
|
11
|
+
*/
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
goog.provide('Blockly.tree.BaseNode');
|
|
15
|
+
|
|
16
|
+
goog.require('Blockly.Component');
|
|
17
|
+
goog.require('Blockly.utils.aria');
|
|
18
|
+
goog.require('Blockly.utils.object');
|
|
19
|
+
goog.require('Blockly.utils.KeyCodes');
|
|
20
|
+
goog.require('Blockly.utils.style');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An abstract base class for a node in the tree.
|
|
25
|
+
* Similar to goog.ui.tree.BaseNode
|
|
26
|
+
*
|
|
27
|
+
* @param {string} content The content of the node label treated as
|
|
28
|
+
* plain-text and will be HTML escaped.
|
|
29
|
+
* @param {!Blockly.tree.BaseNode.Config} config The configuration for the tree.
|
|
30
|
+
* @constructor
|
|
31
|
+
* @extends {Blockly.Component}
|
|
32
|
+
*/
|
|
33
|
+
Blockly.tree.BaseNode = function(content, config) {
|
|
34
|
+
Blockly.Component.call(this);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Text content of the node label.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @package
|
|
40
|
+
*/
|
|
41
|
+
this.content = content;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @package
|
|
46
|
+
*/
|
|
47
|
+
this.iconClass;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @package
|
|
52
|
+
*/
|
|
53
|
+
this.expandedIconClass;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The configuration for the tree.
|
|
57
|
+
* @type {!Blockly.tree.BaseNode.Config}
|
|
58
|
+
* @protected
|
|
59
|
+
*/
|
|
60
|
+
this.config_ = config;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @type {Blockly.tree.TreeControl}
|
|
64
|
+
* @protected
|
|
65
|
+
*/
|
|
66
|
+
this.tree;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @type {Blockly.tree.BaseNode}
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
this.previousSibling_;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @type {Blockly.tree.BaseNode}
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
this.nextSibling_;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Whether the tree item is selected.
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @protected
|
|
84
|
+
*/
|
|
85
|
+
this.selected_ = false;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Whether the tree node is expanded.
|
|
89
|
+
* @type {boolean}
|
|
90
|
+
* @protected
|
|
91
|
+
*/
|
|
92
|
+
this.expanded_ = false;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Nesting depth of this node; cached result of getDepth.
|
|
96
|
+
* -1 if value has not been cached.
|
|
97
|
+
* @type {number}
|
|
98
|
+
* @private
|
|
99
|
+
*/
|
|
100
|
+
this.depth_ = -1;
|
|
101
|
+
};
|
|
102
|
+
Blockly.utils.object.inherits(Blockly.tree.BaseNode, Blockly.Component);
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The config type for the tree.
|
|
107
|
+
* @typedef {{
|
|
108
|
+
* indentWidth:number,
|
|
109
|
+
* cssRoot:string,
|
|
110
|
+
* cssHideRoot:string,
|
|
111
|
+
* cssTreeRow:string,
|
|
112
|
+
* cssItemLabel:string,
|
|
113
|
+
* cssTreeIcon:string,
|
|
114
|
+
* cssExpandedFolderIcon:string,
|
|
115
|
+
* cssCollapsedFolderIcon:string,
|
|
116
|
+
* cssFileIcon:string,
|
|
117
|
+
* cssSelectedRow:string
|
|
118
|
+
* }}
|
|
119
|
+
*/
|
|
120
|
+
Blockly.tree.BaseNode.Config;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Map of nodes in existence. Needed to route events to the appropriate nodes.
|
|
124
|
+
* Nodes are added to the map at {@link #enterDocument} time and removed at
|
|
125
|
+
* {@link #exitDocument} time.
|
|
126
|
+
* @type {Object}
|
|
127
|
+
* @protected
|
|
128
|
+
*/
|
|
129
|
+
Blockly.tree.BaseNode.allNodes = {};
|
|
130
|
+
|
|
131
|
+
/** @override */
|
|
132
|
+
Blockly.tree.BaseNode.prototype.disposeInternal = function() {
|
|
133
|
+
Blockly.tree.BaseNode.superClass_.disposeInternal.call(this);
|
|
134
|
+
if (this.tree) {
|
|
135
|
+
this.tree = null;
|
|
136
|
+
}
|
|
137
|
+
this.setElementInternal(null);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Adds roles and states.
|
|
143
|
+
* @protected
|
|
144
|
+
*/
|
|
145
|
+
Blockly.tree.BaseNode.prototype.initAccessibility = function() {
|
|
146
|
+
var el = this.getElement();
|
|
147
|
+
if (el) {
|
|
148
|
+
// Set an id for the label
|
|
149
|
+
var label = this.getLabelElement();
|
|
150
|
+
if (label && !label.id) {
|
|
151
|
+
label.id = this.getId() + '.label';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
Blockly.utils.aria.setRole(el, Blockly.utils.aria.Role.TREEITEM);
|
|
155
|
+
Blockly.utils.aria.setState(el, Blockly.utils.aria.State.SELECTED, false);
|
|
156
|
+
Blockly.utils.aria.setState(el,
|
|
157
|
+
Blockly.utils.aria.State.LEVEL, this.getDepth());
|
|
158
|
+
if (label) {
|
|
159
|
+
Blockly.utils.aria.setState(el,
|
|
160
|
+
Blockly.utils.aria.State.LABELLEDBY, label.id);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
var img = this.getIconElement();
|
|
164
|
+
if (img) {
|
|
165
|
+
Blockly.utils.aria.setRole(img, Blockly.utils.aria.Role.PRESENTATION);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var ce = this.getChildrenElement();
|
|
169
|
+
if (ce) {
|
|
170
|
+
Blockly.utils.aria.setRole(ce, Blockly.utils.aria.Role.GROUP);
|
|
171
|
+
|
|
172
|
+
// In case the children will be created lazily.
|
|
173
|
+
if (ce.hasChildNodes()) {
|
|
174
|
+
// Only set aria-expanded if the node has children (can be expanded).
|
|
175
|
+
Blockly.utils.aria.setState(el, Blockly.utils.aria.State.EXPANDED, false);
|
|
176
|
+
|
|
177
|
+
// do setsize for each child
|
|
178
|
+
var count = this.getChildCount();
|
|
179
|
+
for (var i = 1; i <= count; i++) {
|
|
180
|
+
var child = /** @type {!Element} */ (this.getChildAt(i - 1).getElement());
|
|
181
|
+
Blockly.utils.aria.setState(child,
|
|
182
|
+
Blockly.utils.aria.State.SETSIZE, count);
|
|
183
|
+
Blockly.utils.aria.setState(child,
|
|
184
|
+
Blockly.utils.aria.State.POSINSET, i);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
/** @override */
|
|
193
|
+
Blockly.tree.BaseNode.prototype.createDom = function() {
|
|
194
|
+
var element = document.createElement('div');
|
|
195
|
+
element.appendChild(this.toDom());
|
|
196
|
+
this.setElementInternal(/** @type {!HTMLElement} */ (element));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/** @override */
|
|
201
|
+
Blockly.tree.BaseNode.prototype.enterDocument = function() {
|
|
202
|
+
Blockly.tree.BaseNode.superClass_.enterDocument.call(this);
|
|
203
|
+
Blockly.tree.BaseNode.allNodes[this.getId()] = this;
|
|
204
|
+
this.initAccessibility();
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
/** @override */
|
|
209
|
+
Blockly.tree.BaseNode.prototype.exitDocument = function() {
|
|
210
|
+
Blockly.tree.BaseNode.superClass_.exitDocument.call(this);
|
|
211
|
+
delete Blockly.tree.BaseNode.allNodes[this.getId()];
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The method assumes that the child doesn't have parent node yet.
|
|
217
|
+
* @override
|
|
218
|
+
*/
|
|
219
|
+
Blockly.tree.BaseNode.prototype.addChildAt = function(child, index) {
|
|
220
|
+
child = /** @type {Blockly.tree.BaseNode} */ (child);
|
|
221
|
+
var prevNode = this.getChildAt(index - 1);
|
|
222
|
+
var nextNode = this.getChildAt(index);
|
|
223
|
+
|
|
224
|
+
Blockly.tree.BaseNode.superClass_.addChildAt.call(this, child, index);
|
|
225
|
+
|
|
226
|
+
child.previousSibling_ = prevNode;
|
|
227
|
+
child.nextSibling_ = nextNode;
|
|
228
|
+
|
|
229
|
+
if (prevNode) {
|
|
230
|
+
prevNode.nextSibling_ = child;
|
|
231
|
+
}
|
|
232
|
+
if (nextNode) {
|
|
233
|
+
nextNode.previousSibling_ = child;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
var tree = this.getTree();
|
|
237
|
+
if (tree) {
|
|
238
|
+
child.setTreeInternal(tree);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
child.setDepth_(this.getDepth() + 1);
|
|
242
|
+
|
|
243
|
+
var el = this.getElement();
|
|
244
|
+
if (el) {
|
|
245
|
+
this.updateExpandIcon();
|
|
246
|
+
Blockly.utils.aria.setState(
|
|
247
|
+
el, Blockly.utils.aria.State.EXPANDED, this.expanded_);
|
|
248
|
+
if (this.expanded_) {
|
|
249
|
+
var childrenEl = this.getChildrenElement();
|
|
250
|
+
if (!child.getElement()) {
|
|
251
|
+
child.createDom();
|
|
252
|
+
}
|
|
253
|
+
var childElement = child.getElement();
|
|
254
|
+
var nextElement = nextNode && nextNode.getElement();
|
|
255
|
+
childrenEl.insertBefore(childElement, nextElement);
|
|
256
|
+
|
|
257
|
+
if (this.isInDocument()) {
|
|
258
|
+
child.enterDocument();
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (!nextNode) {
|
|
262
|
+
if (prevNode) {
|
|
263
|
+
prevNode.updateExpandIcon();
|
|
264
|
+
} else {
|
|
265
|
+
Blockly.utils.style.setElementShown(childrenEl, true);
|
|
266
|
+
this.setExpanded(this.expanded_);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Appends a node as a child to the current node.
|
|
275
|
+
* @param {Blockly.tree.BaseNode} child The child to add.
|
|
276
|
+
* @package
|
|
277
|
+
*/
|
|
278
|
+
Blockly.tree.BaseNode.prototype.add = function(child) {
|
|
279
|
+
if (child.getParent()) {
|
|
280
|
+
throw Error(Blockly.Component.Error.PARENT_UNABLE_TO_BE_SET);
|
|
281
|
+
}
|
|
282
|
+
this.addChildAt(child, this.getChildCount());
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Returns the tree.
|
|
287
|
+
* @return {?Blockly.tree.TreeControl} tree
|
|
288
|
+
* @protected
|
|
289
|
+
*/
|
|
290
|
+
Blockly.tree.BaseNode.prototype.getTree = function() {
|
|
291
|
+
return null;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Returns the depth of the node in the tree. Should not be overridden.
|
|
296
|
+
* @return {number} The non-negative depth of this node (the root is zero).
|
|
297
|
+
* @protected
|
|
298
|
+
*/
|
|
299
|
+
Blockly.tree.BaseNode.prototype.getDepth = function() {
|
|
300
|
+
var depth = this.depth_;
|
|
301
|
+
if (depth < 0) {
|
|
302
|
+
var parent = this.getParent();
|
|
303
|
+
if (parent) {
|
|
304
|
+
depth = parent.getDepth() + 1;
|
|
305
|
+
} else {
|
|
306
|
+
depth = 0;
|
|
307
|
+
}
|
|
308
|
+
this.setDepth_(depth);
|
|
309
|
+
}
|
|
310
|
+
return depth;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Changes the depth of a node (and all its descendants).
|
|
315
|
+
* @param {number} depth The new nesting depth; must be non-negative.
|
|
316
|
+
* @private
|
|
317
|
+
*/
|
|
318
|
+
Blockly.tree.BaseNode.prototype.setDepth_ = function(depth) {
|
|
319
|
+
if (depth != this.depth_) {
|
|
320
|
+
this.depth_ = depth;
|
|
321
|
+
var row = this.getRowElement();
|
|
322
|
+
if (row) {
|
|
323
|
+
var indent = this.getPixelIndent_() + 'px';
|
|
324
|
+
if (this.rightToLeft_) {
|
|
325
|
+
row.style.paddingRight = indent;
|
|
326
|
+
} else {
|
|
327
|
+
row.style.paddingLeft = indent;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
this.forEachChild(function(child) { child.setDepth_(depth + 1); });
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Returns true if the node is a descendant of this node.
|
|
336
|
+
* @param {Blockly.Component} node The node to check.
|
|
337
|
+
* @return {boolean} True if the node is a descendant of this node, false
|
|
338
|
+
* otherwise.
|
|
339
|
+
* @protected
|
|
340
|
+
*/
|
|
341
|
+
Blockly.tree.BaseNode.prototype.contains = function(node) {
|
|
342
|
+
while (node) {
|
|
343
|
+
if (node == this) {
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
node = node.getParent();
|
|
347
|
+
}
|
|
348
|
+
return false;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* This is re-defined here to indicate to the Closure Compiler the correct
|
|
353
|
+
* child return type.
|
|
354
|
+
* @param {number} index 0-based index.
|
|
355
|
+
* @return {Blockly.tree.BaseNode} The child at the given index; null if none.
|
|
356
|
+
* @protected
|
|
357
|
+
*/
|
|
358
|
+
Blockly.tree.BaseNode.prototype.getChildAt;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Returns the children of this node.
|
|
362
|
+
* @return {!Array.<!Blockly.tree.BaseNode>} The children.
|
|
363
|
+
* @package
|
|
364
|
+
*/
|
|
365
|
+
Blockly.tree.BaseNode.prototype.getChildren = function() {
|
|
366
|
+
var children = [];
|
|
367
|
+
this.forEachChild(function(child) { children.push(child); });
|
|
368
|
+
return children;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Returns the node's parent, if any.
|
|
373
|
+
* @return {?Blockly.tree.BaseNode} The parent node.
|
|
374
|
+
* @protected
|
|
375
|
+
*/
|
|
376
|
+
Blockly.tree.BaseNode.prototype.getParent = function() {
|
|
377
|
+
return /** @type {Blockly.tree.BaseNode} */ (
|
|
378
|
+
Blockly.tree.BaseNode.superClass_.getParent.call(this));
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @return {Blockly.tree.BaseNode} The previous sibling of this node.
|
|
383
|
+
* @protected
|
|
384
|
+
*/
|
|
385
|
+
Blockly.tree.BaseNode.prototype.getPreviousSibling = function() {
|
|
386
|
+
return this.previousSibling_;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @return {Blockly.tree.BaseNode} The next sibling of this node.
|
|
391
|
+
* @protected
|
|
392
|
+
*/
|
|
393
|
+
Blockly.tree.BaseNode.prototype.getNextSibling = function() {
|
|
394
|
+
return this.nextSibling_;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @return {boolean} Whether the node is the last sibling.
|
|
399
|
+
* @protected
|
|
400
|
+
*/
|
|
401
|
+
Blockly.tree.BaseNode.prototype.isLastSibling = function() {
|
|
402
|
+
return !this.nextSibling_;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* @return {boolean} Whether the node is selected.
|
|
407
|
+
* @protected
|
|
408
|
+
*/
|
|
409
|
+
Blockly.tree.BaseNode.prototype.isSelected = function() {
|
|
410
|
+
return this.selected_;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Selects the node.
|
|
415
|
+
* @protected
|
|
416
|
+
*/
|
|
417
|
+
Blockly.tree.BaseNode.prototype.select = function() {
|
|
418
|
+
var tree = this.getTree();
|
|
419
|
+
if (tree) {
|
|
420
|
+
tree.setSelectedItem(this);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Called from the tree to instruct the node change its selection state.
|
|
426
|
+
* @param {boolean} selected The new selection state.
|
|
427
|
+
* @protected
|
|
428
|
+
*/
|
|
429
|
+
Blockly.tree.BaseNode.prototype.setSelected = function(selected) {
|
|
430
|
+
if (this.selected_ == selected) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
this.selected_ = selected;
|
|
434
|
+
|
|
435
|
+
this.updateRow();
|
|
436
|
+
|
|
437
|
+
var el = this.getElement();
|
|
438
|
+
if (el) {
|
|
439
|
+
Blockly.utils.aria.setState(el, Blockly.utils.aria.State.SELECTED, selected);
|
|
440
|
+
if (selected) {
|
|
441
|
+
var treeElement = /** @type {!Element} */ (this.getTree().getElement());
|
|
442
|
+
Blockly.utils.aria.setState(treeElement,
|
|
443
|
+
Blockly.utils.aria.State.ACTIVEDESCENDANT, this.getId());
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Sets the node to be expanded.
|
|
450
|
+
* @param {boolean} expanded Whether to expand or close the node.
|
|
451
|
+
* @package
|
|
452
|
+
*/
|
|
453
|
+
Blockly.tree.BaseNode.prototype.setExpanded = function(expanded) {
|
|
454
|
+
var isStateChange = expanded != this.expanded_;
|
|
455
|
+
var ce;
|
|
456
|
+
this.expanded_ = expanded;
|
|
457
|
+
var tree = this.getTree();
|
|
458
|
+
var el = this.getElement();
|
|
459
|
+
|
|
460
|
+
if (this.hasChildren()) {
|
|
461
|
+
if (!expanded && tree && this.contains(tree.getSelectedItem())) {
|
|
462
|
+
this.select();
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (el) {
|
|
466
|
+
ce = this.getChildrenElement();
|
|
467
|
+
if (ce) {
|
|
468
|
+
Blockly.utils.style.setElementShown(ce, expanded);
|
|
469
|
+
Blockly.utils.aria.setState(el, Blockly.utils.aria.State.EXPANDED, expanded);
|
|
470
|
+
|
|
471
|
+
// Make sure we have the HTML for the children here.
|
|
472
|
+
if (expanded && this.isInDocument() && !ce.hasChildNodes()) {
|
|
473
|
+
this.forEachChild(function(child) {
|
|
474
|
+
ce.appendChild(child.toDom());
|
|
475
|
+
});
|
|
476
|
+
this.forEachChild(function(child) { child.enterDocument(); });
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
this.updateExpandIcon();
|
|
480
|
+
}
|
|
481
|
+
} else {
|
|
482
|
+
ce = this.getChildrenElement();
|
|
483
|
+
if (ce) {
|
|
484
|
+
Blockly.utils.style.setElementShown(ce, false);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
if (el) {
|
|
488
|
+
this.updateIcon_();
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (isStateChange) {
|
|
492
|
+
if (expanded) {
|
|
493
|
+
this.doNodeExpanded();
|
|
494
|
+
} else {
|
|
495
|
+
this.doNodeCollapsed();
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Used to notify a node of that we have expanded it.
|
|
502
|
+
* Can be overridden by subclasses, see Blockly.tree.TreeNode.
|
|
503
|
+
* @protected
|
|
504
|
+
*/
|
|
505
|
+
Blockly.tree.BaseNode.prototype.doNodeExpanded = function() {
|
|
506
|
+
// NOP
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Used to notify a node that we have collapsed it.
|
|
511
|
+
* Can be overridden by subclasses, see Blockly.tree.TreeNode.
|
|
512
|
+
* @protected
|
|
513
|
+
*/
|
|
514
|
+
Blockly.tree.BaseNode.prototype.doNodeCollapsed = function() {
|
|
515
|
+
// NOP
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Toggles the expanded state of the node.
|
|
520
|
+
* @protected
|
|
521
|
+
*/
|
|
522
|
+
Blockly.tree.BaseNode.prototype.toggle = function() {
|
|
523
|
+
this.setExpanded(!this.expanded_);
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Creates HTML Element for the node.
|
|
528
|
+
* @return {!Element} HTML element
|
|
529
|
+
* @protected
|
|
530
|
+
*/
|
|
531
|
+
Blockly.tree.BaseNode.prototype.toDom = function() {
|
|
532
|
+
var nonEmptyAndExpanded = this.expanded_ && this.hasChildren();
|
|
533
|
+
|
|
534
|
+
var children = document.createElement('div');
|
|
535
|
+
children.style.backgroundPosition = this.getBackgroundPosition();
|
|
536
|
+
if (!nonEmptyAndExpanded) {
|
|
537
|
+
children.style.display = 'none';
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (nonEmptyAndExpanded) {
|
|
541
|
+
// children
|
|
542
|
+
this.forEachChild(function(child) { children.appendChild(child.toDom()); });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
var node = document.createElement('div');
|
|
546
|
+
node.id = this.getId();
|
|
547
|
+
|
|
548
|
+
node.appendChild(this.getRowDom());
|
|
549
|
+
node.appendChild(children);
|
|
550
|
+
|
|
551
|
+
return node;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Calculates correct padding for each row. Nested categories are indented more.
|
|
556
|
+
* @return {number} The pixel indent of the row.
|
|
557
|
+
* @private
|
|
558
|
+
*/
|
|
559
|
+
Blockly.tree.BaseNode.prototype.getPixelIndent_ = function() {
|
|
560
|
+
return Math.max(0, (this.getDepth() - 1) * this.config_.indentWidth);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Creates row with icon and label dom.
|
|
565
|
+
* @return {!Element} The HTML element for the row.
|
|
566
|
+
* @protected
|
|
567
|
+
*/
|
|
568
|
+
Blockly.tree.BaseNode.prototype.getRowDom = function() {
|
|
569
|
+
var row = document.createElement('div');
|
|
570
|
+
row.className = this.getRowClassName();
|
|
571
|
+
row.style['padding-' + (this.rightToLeft_ ? 'right' : 'left')] =
|
|
572
|
+
this.getPixelIndent_() + 'px';
|
|
573
|
+
|
|
574
|
+
row.appendChild(this.getIconDom());
|
|
575
|
+
row.appendChild(this.getLabelDom());
|
|
576
|
+
|
|
577
|
+
return row;
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Adds the selected class name to the default row class name if node is
|
|
582
|
+
* selected.
|
|
583
|
+
* @return {string} The class name for the row.
|
|
584
|
+
* @protected
|
|
585
|
+
*/
|
|
586
|
+
Blockly.tree.BaseNode.prototype.getRowClassName = function() {
|
|
587
|
+
var selectedClass = '';
|
|
588
|
+
if (this.isSelected()) {
|
|
589
|
+
selectedClass = ' ' + (this.config_.cssSelectedRow || '');
|
|
590
|
+
}
|
|
591
|
+
return this.config_.cssTreeRow + selectedClass;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* @return {!Element} The HTML element for the label.
|
|
596
|
+
* @protected
|
|
597
|
+
*/
|
|
598
|
+
Blockly.tree.BaseNode.prototype.getLabelDom = function() {
|
|
599
|
+
var label = document.createElement('span');
|
|
600
|
+
label.className = this.config_.cssItemLabel || '';
|
|
601
|
+
label.textContent = this.content;
|
|
602
|
+
return label;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* @return {!Element} The HTML for the icon.
|
|
607
|
+
* @protected
|
|
608
|
+
*/
|
|
609
|
+
Blockly.tree.BaseNode.prototype.getIconDom = function() {
|
|
610
|
+
var icon = document.createElement('span');
|
|
611
|
+
icon.style.display = 'inline-block';
|
|
612
|
+
icon.className = this.getCalculatedIconClass();
|
|
613
|
+
return icon;
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Gets the calculated icon class.
|
|
618
|
+
* @protected
|
|
619
|
+
*/
|
|
620
|
+
Blockly.tree.BaseNode.prototype.getCalculatedIconClass = function() {
|
|
621
|
+
throw Error(Blockly.Component.Error.ABSTRACT_METHOD);
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Gets a string containing the x and y position of the node's background.
|
|
626
|
+
* @return {string} The background position style value.
|
|
627
|
+
* @protected
|
|
628
|
+
*/
|
|
629
|
+
Blockly.tree.BaseNode.prototype.getBackgroundPosition = function() {
|
|
630
|
+
return (this.isLastSibling() ? '-100' : (this.getDepth() - 1) *
|
|
631
|
+
this.config_.indentWidth) + 'px 0';
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* @return {HTMLElement} The element for the tree node.
|
|
636
|
+
* @override
|
|
637
|
+
*/
|
|
638
|
+
Blockly.tree.BaseNode.prototype.getElement = function() {
|
|
639
|
+
var el = Blockly.tree.BaseNode.superClass_.getElement.call(this);
|
|
640
|
+
if (!el) {
|
|
641
|
+
el = document.getElementById(this.getId());
|
|
642
|
+
this.setElementInternal(el);
|
|
643
|
+
}
|
|
644
|
+
return /** @type {!HTMLElement} */ (el);
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* @return {Element} The row is the div that is used to draw the node without
|
|
649
|
+
* the children.
|
|
650
|
+
* @package
|
|
651
|
+
*/
|
|
652
|
+
Blockly.tree.BaseNode.prototype.getRowElement = function() {
|
|
653
|
+
var el = this.getElement();
|
|
654
|
+
return el ? /** @type {Element} */ (el.firstChild) : null;
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* @return {Element} The icon element.
|
|
659
|
+
* @protected
|
|
660
|
+
*/
|
|
661
|
+
Blockly.tree.BaseNode.prototype.getIconElement = function() {
|
|
662
|
+
var el = this.getRowElement();
|
|
663
|
+
return el ? /** @type {Element} */ (el.firstChild) : null;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* @return {Element} The label element.
|
|
668
|
+
* @protected
|
|
669
|
+
*/
|
|
670
|
+
Blockly.tree.BaseNode.prototype.getLabelElement = function() {
|
|
671
|
+
var el = this.getRowElement();
|
|
672
|
+
return el && el.lastChild ?
|
|
673
|
+
/** @type {Element} */ (el.lastChild.previousSibling) :
|
|
674
|
+
null;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @return {Element} The div containing the children.
|
|
679
|
+
* @protected
|
|
680
|
+
*/
|
|
681
|
+
Blockly.tree.BaseNode.prototype.getChildrenElement = function() {
|
|
682
|
+
var el = this.getElement();
|
|
683
|
+
return el ? /** @type {Element} */ (el.lastChild) : null;
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Updates the row styles.
|
|
688
|
+
* @protected
|
|
689
|
+
*/
|
|
690
|
+
Blockly.tree.BaseNode.prototype.updateRow = function() {
|
|
691
|
+
var rowEl = this.getRowElement();
|
|
692
|
+
if (rowEl) {
|
|
693
|
+
rowEl.className = this.getRowClassName();
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Updates the expand icon of the node.
|
|
699
|
+
* @protected
|
|
700
|
+
*/
|
|
701
|
+
Blockly.tree.BaseNode.prototype.updateExpandIcon = function() {
|
|
702
|
+
var cel = this.getChildrenElement();
|
|
703
|
+
if (cel) {
|
|
704
|
+
cel.style.backgroundPosition = this.getBackgroundPosition();
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Updates the icon of the node. Assumes that this.getElement() is created.
|
|
710
|
+
* @private
|
|
711
|
+
*/
|
|
712
|
+
Blockly.tree.BaseNode.prototype.updateIcon_ = function() {
|
|
713
|
+
this.getIconElement().className = this.getCalculatedIconClass();
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Handles a click event.
|
|
718
|
+
* @param {!Event} e The browser event.
|
|
719
|
+
* @protected
|
|
720
|
+
*/
|
|
721
|
+
Blockly.tree.BaseNode.prototype.onClick_ = function(e) {
|
|
722
|
+
e.preventDefault();
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Handles a key down event.
|
|
727
|
+
* @param {!Event} e The browser event.
|
|
728
|
+
* @return {boolean} The handled value.
|
|
729
|
+
* @protected
|
|
730
|
+
*/
|
|
731
|
+
Blockly.tree.BaseNode.prototype.onKeyDown = function(e) {
|
|
732
|
+
var handled = true;
|
|
733
|
+
switch (e.keyCode) {
|
|
734
|
+
case Blockly.utils.KeyCodes.RIGHT:
|
|
735
|
+
handled = this.selectChild();
|
|
736
|
+
break;
|
|
737
|
+
|
|
738
|
+
case Blockly.utils.KeyCodes.LEFT:
|
|
739
|
+
handled = this.selectParent();
|
|
740
|
+
break;
|
|
741
|
+
|
|
742
|
+
case Blockly.utils.KeyCodes.DOWN:
|
|
743
|
+
handled = this.selectNext();
|
|
744
|
+
break;
|
|
745
|
+
|
|
746
|
+
case Blockly.utils.KeyCodes.UP:
|
|
747
|
+
handled = this.selectPrevious();
|
|
748
|
+
break;
|
|
749
|
+
|
|
750
|
+
case Blockly.utils.KeyCodes.ENTER:
|
|
751
|
+
case Blockly.utils.KeyCodes.SPACE:
|
|
752
|
+
this.toggle();
|
|
753
|
+
handled = true;
|
|
754
|
+
break;
|
|
755
|
+
|
|
756
|
+
default:
|
|
757
|
+
handled = false;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
if (handled) {
|
|
761
|
+
e.preventDefault();
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return handled;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Select the next node.
|
|
770
|
+
* @return {boolean} True if the action has been handled, false otherwise.
|
|
771
|
+
* @package
|
|
772
|
+
*/
|
|
773
|
+
Blockly.tree.BaseNode.prototype.selectNext = function() {
|
|
774
|
+
var nextNode = this.getNextShownNode();
|
|
775
|
+
if (nextNode) {
|
|
776
|
+
nextNode.select();
|
|
777
|
+
}
|
|
778
|
+
return true;
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Select the previous node.
|
|
783
|
+
* @return {boolean} True if the action has been handled, false otherwise.
|
|
784
|
+
* @package
|
|
785
|
+
*/
|
|
786
|
+
Blockly.tree.BaseNode.prototype.selectPrevious = function() {
|
|
787
|
+
var previousNode = this.getPreviousShownNode();
|
|
788
|
+
if (previousNode) {
|
|
789
|
+
previousNode.select();
|
|
790
|
+
}
|
|
791
|
+
return true;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Select the parent node or collapse the current node.
|
|
796
|
+
* @return {boolean} True if the action has been handled, false otherwise.
|
|
797
|
+
* @package
|
|
798
|
+
*/
|
|
799
|
+
Blockly.tree.BaseNode.prototype.selectParent = function() {
|
|
800
|
+
if (this.hasChildren() && this.expanded_) {
|
|
801
|
+
this.setExpanded(false);
|
|
802
|
+
} else {
|
|
803
|
+
var parent = this.getParent();
|
|
804
|
+
var tree = this.getTree();
|
|
805
|
+
// don't go to root if hidden
|
|
806
|
+
if (parent && (parent != tree)) {
|
|
807
|
+
parent.select();
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return true;
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Expand the current node if it's not already expanded, or select the
|
|
815
|
+
* child node.
|
|
816
|
+
* @return {boolean} True if the action has been handled, false otherwise.
|
|
817
|
+
* @package
|
|
818
|
+
*/
|
|
819
|
+
Blockly.tree.BaseNode.prototype.selectChild = function() {
|
|
820
|
+
if (this.hasChildren()) {
|
|
821
|
+
if (!this.expanded_) {
|
|
822
|
+
this.setExpanded(true);
|
|
823
|
+
} else {
|
|
824
|
+
this.getChildAt(0).select();
|
|
825
|
+
}
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
return false;
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* @return {Blockly.tree.BaseNode} The last shown descendant.
|
|
833
|
+
* @protected
|
|
834
|
+
*/
|
|
835
|
+
Blockly.tree.BaseNode.prototype.getLastShownDescendant = function() {
|
|
836
|
+
if (!this.expanded_ || !this.hasChildren()) {
|
|
837
|
+
return this;
|
|
838
|
+
}
|
|
839
|
+
// we know there is at least 1 child
|
|
840
|
+
return this.getChildAt(this.getChildCount() - 1).getLastShownDescendant();
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* @return {Blockly.tree.BaseNode} The next node to show or null if there isn't
|
|
845
|
+
* a next node to show.
|
|
846
|
+
* @protected
|
|
847
|
+
*/
|
|
848
|
+
Blockly.tree.BaseNode.prototype.getNextShownNode = function() {
|
|
849
|
+
if (this.hasChildren() && this.expanded_) {
|
|
850
|
+
return this.getChildAt(0);
|
|
851
|
+
}
|
|
852
|
+
var parent = this;
|
|
853
|
+
var next;
|
|
854
|
+
while (parent != this.getTree()) {
|
|
855
|
+
next = parent.getNextSibling();
|
|
856
|
+
if (next != null) {
|
|
857
|
+
return next;
|
|
858
|
+
}
|
|
859
|
+
parent = parent.getParent();
|
|
860
|
+
}
|
|
861
|
+
return null;
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* @return {Blockly.tree.BaseNode} The previous node to show.
|
|
866
|
+
* @protected
|
|
867
|
+
*/
|
|
868
|
+
Blockly.tree.BaseNode.prototype.getPreviousShownNode = function() {
|
|
869
|
+
var ps = this.getPreviousSibling();
|
|
870
|
+
if (ps != null) {
|
|
871
|
+
return ps.getLastShownDescendant();
|
|
872
|
+
}
|
|
873
|
+
var parent = this.getParent();
|
|
874
|
+
var tree = this.getTree();
|
|
875
|
+
if (parent == tree) {
|
|
876
|
+
return null;
|
|
877
|
+
}
|
|
878
|
+
// The root is the first node.
|
|
879
|
+
if (this == tree) {
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
return /** @type {Blockly.tree.BaseNode} */ (parent);
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Internal method that is used to set the tree control on the node.
|
|
887
|
+
* @param {Blockly.tree.TreeControl} tree The tree control.
|
|
888
|
+
* @protected
|
|
889
|
+
*/
|
|
890
|
+
Blockly.tree.BaseNode.prototype.setTreeInternal = function(tree) {
|
|
891
|
+
if (this.tree != tree) {
|
|
892
|
+
this.tree = tree;
|
|
893
|
+
this.forEachChild(function(child) { child.setTreeInternal(tree); });
|
|
894
|
+
}
|
|
895
|
+
};
|