nodeskini 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklySkini/archive/blocklyControleur.js +87 -0
- package/blocklySkini/archive/blocklySkini.js +84 -0
- package/blocklySkini/archive/blocklyhop.js +75 -0
- package/blocklySkini/archive/clientControleurBlocly.js +170 -0
- package/blocklySkini/archive/index.html +76 -0
- package/blocklySkini/archive/testHHsuspend.txt +89 -0
- package/blocklySkini/archive/testHHtrap.txt +262 -0
- package/blocklySkini/archive/testOrchestration.txt +177 -0
- package/blocklySkini/archive/testOrchestration.xml +447 -0
- package/blocklySkini/archive/testOrchestration2.xml +456 -0
- package/blocklySkini/blockly/README.md +77 -0
- package/blocklySkini/blockly/blockly.d.ts +21480 -0
- package/blocklySkini/blockly/blockly.js +25 -0
- package/blocklySkini/blockly/blockly.min.js +2188 -0
- package/blocklySkini/blockly/blockly_compressed.js +1455 -0
- package/blocklySkini/blockly/blockly_compressed.js.map +1 -0
- package/blocklySkini/blockly/blocks/colour.js +122 -0
- package/blocklySkini/blockly/blocks/lists.js +862 -0
- package/blocklySkini/blockly/blocks/logic.js +635 -0
- package/blocklySkini/blockly/blocks/loops.js +357 -0
- package/blocklySkini/blockly/blocks/math.js +566 -0
- package/blocklySkini/blockly/blocks/procedures.js +1072 -0
- package/blocklySkini/blockly/blocks/text.js +923 -0
- package/blocklySkini/blockly/blocks/variables.js +163 -0
- package/blocklySkini/blockly/blocks/variables_dynamic.js +180 -0
- package/blocklySkini/blockly/blocks.d.ts +15 -0
- package/blocklySkini/blockly/blocks.js +27 -0
- package/blocklySkini/blockly/blocks_compressed.js +182 -0
- package/blocklySkini/blockly/blocks_compressed.js.map +1 -0
- package/blocklySkini/blockly/browser.js +36 -0
- package/blocklySkini/blockly/core/block.js +2010 -0
- package/blocklySkini/blockly/core/block_animations.js +203 -0
- package/blocklySkini/blockly/core/block_drag_surface.js +212 -0
- package/blocklySkini/blockly/core/block_dragger.js +378 -0
- package/blocklySkini/blockly/core/block_events.js +548 -0
- package/blocklySkini/blockly/core/block_svg.js +1763 -0
- package/blocklySkini/blockly/core/blockly.js +674 -0
- package/blocklySkini/blockly/core/blocks.js +23 -0
- package/blocklySkini/blockly/core/bubble.js +880 -0
- package/blocklySkini/blockly/core/bubble_dragger.js +274 -0
- package/blocklySkini/blockly/core/comment.js +439 -0
- package/blocklySkini/blockly/core/components/component.js +554 -0
- package/blocklySkini/blockly/core/components/tree/basenode.js +895 -0
- package/blocklySkini/blockly/core/components/tree/treecontrol.js +332 -0
- package/blocklySkini/blockly/core/components/tree/treenode.js +172 -0
- package/blocklySkini/blockly/core/connection.js +682 -0
- package/blocklySkini/blockly/core/connection_checker.js +285 -0
- package/blocklySkini/blockly/core/connection_db.js +295 -0
- package/blocklySkini/blockly/core/constants.js +277 -0
- package/blocklySkini/blockly/core/contextmenu.js +307 -0
- package/blocklySkini/blockly/core/contextmenu_items.js +534 -0
- package/blocklySkini/blockly/core/contextmenu_registry.js +165 -0
- package/blocklySkini/blockly/core/css.js +549 -0
- package/blocklySkini/blockly/core/dropdowndiv.js +776 -0
- package/blocklySkini/blockly/core/events.js +387 -0
- package/blocklySkini/blockly/core/events_abstract.js +106 -0
- package/blocklySkini/blockly/core/extensions.js +450 -0
- package/blocklySkini/blockly/core/field.js +1162 -0
- package/blocklySkini/blockly/core/field_angle.js +562 -0
- package/blocklySkini/blockly/core/field_checkbox.js +220 -0
- package/blocklySkini/blockly/core/field_colour.js +664 -0
- package/blocklySkini/blockly/core/field_dropdown.js +760 -0
- package/blocklySkini/blockly/core/field_image.js +286 -0
- package/blocklySkini/blockly/core/field_label.js +130 -0
- package/blocklySkini/blockly/core/field_label_serializable.js +69 -0
- package/blocklySkini/blockly/core/field_multilineinput.js +299 -0
- package/blocklySkini/blockly/core/field_number.js +317 -0
- package/blocklySkini/blockly/core/field_registry.js +66 -0
- package/blocklySkini/blockly/core/field_textinput.js +616 -0
- package/blocklySkini/blockly/core/field_variable.js +463 -0
- package/blocklySkini/blockly/core/flyout_base.js +1071 -0
- package/blocklySkini/blockly/core/flyout_button.js +325 -0
- package/blocklySkini/blockly/core/flyout_dragger.js +76 -0
- package/blocklySkini/blockly/core/flyout_horizontal.js +388 -0
- package/blocklySkini/blockly/core/flyout_vertical.js +397 -0
- package/blocklySkini/blockly/core/generator.js +482 -0
- package/blocklySkini/blockly/core/gesture.js +993 -0
- package/blocklySkini/blockly/core/grid.js +222 -0
- package/blocklySkini/blockly/core/icon.js +206 -0
- package/blocklySkini/blockly/core/inject.js +487 -0
- package/blocklySkini/blockly/core/input.js +296 -0
- package/blocklySkini/blockly/core/insertion_marker_manager.js +700 -0
- package/blocklySkini/blockly/core/interfaces/i_accessibility.js +72 -0
- package/blocklySkini/blockly/core/interfaces/i_bounded_element.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_bubble.js +83 -0
- package/blocklySkini/blockly/core/interfaces/i_connection_checker.js +94 -0
- package/blocklySkini/blockly/core/interfaces/i_contextmenu.js +26 -0
- package/blocklySkini/blockly/core/interfaces/i_copyable.js +40 -0
- package/blocklySkini/blockly/core/interfaces/i_deletable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_deletearea.js +28 -0
- package/blocklySkini/blockly/core/interfaces/i_flyout.js +178 -0
- package/blocklySkini/blockly/core/interfaces/i_movable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable.js +22 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable_field.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_selectable.js +43 -0
- package/blocklySkini/blockly/core/interfaces/i_styleable.js +33 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox.js +131 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox_item.js +148 -0
- package/blocklySkini/blockly/core/keyboard_nav/action.js +26 -0
- package/blocklySkini/blockly/core/keyboard_nav/ast_node.js +684 -0
- package/blocklySkini/blockly/core/keyboard_nav/basic_cursor.js +208 -0
- package/blocklySkini/blockly/core/keyboard_nav/cursor.js +170 -0
- package/blocklySkini/blockly/core/keyboard_nav/flyout_cursor.js +106 -0
- package/blocklySkini/blockly/core/keyboard_nav/key_map.js +190 -0
- package/blocklySkini/blockly/core/keyboard_nav/marker.js +120 -0
- package/blocklySkini/blockly/core/keyboard_nav/navigation.js +1084 -0
- package/blocklySkini/blockly/core/keyboard_nav/tab_navigate_cursor.js +48 -0
- package/blocklySkini/blockly/core/marker_manager.js +183 -0
- package/blocklySkini/blockly/core/menu.js +465 -0
- package/blocklySkini/blockly/core/menuitem.js +280 -0
- package/blocklySkini/blockly/core/msg.js +31 -0
- package/blocklySkini/blockly/core/mutator.js +555 -0
- package/blocklySkini/blockly/core/names.js +186 -0
- package/blocklySkini/blockly/core/options.js +365 -0
- package/blocklySkini/blockly/core/procedures.js +404 -0
- package/blocklySkini/blockly/core/registry.js +265 -0
- package/blocklySkini/blockly/core/rendered_connection.js +565 -0
- package/blocklySkini/blockly/core/renderers/common/block_rendering.js +81 -0
- package/blocklySkini/blockly/core/renderers/common/constants.js +1256 -0
- package/blocklySkini/blockly/core/renderers/common/debugger.js +431 -0
- package/blocklySkini/blockly/core/renderers/common/drawer.js +468 -0
- package/blocklySkini/blockly/core/renderers/common/i_path_object.js +151 -0
- package/blocklySkini/blockly/core/renderers/common/info.js +775 -0
- package/blocklySkini/blockly/core/renderers/common/marker_svg.js +687 -0
- package/blocklySkini/blockly/core/renderers/common/path_object.js +279 -0
- package/blocklySkini/blockly/core/renderers/common/renderer.js +301 -0
- package/blocklySkini/blockly/core/renderers/geras/constants.js +64 -0
- package/blocklySkini/blockly/core/renderers/geras/drawer.js +205 -0
- package/blocklySkini/blockly/core/renderers/geras/highlight_constants.js +311 -0
- package/blocklySkini/blockly/core/renderers/geras/highlighter.js +256 -0
- package/blocklySkini/blockly/core/renderers/geras/info.js +483 -0
- package/blocklySkini/blockly/core/renderers/geras/measurables/inputs.js +67 -0
- package/blocklySkini/blockly/core/renderers/geras/path_object.js +177 -0
- package/blocklySkini/blockly/core/renderers/geras/renderer.js +138 -0
- package/blocklySkini/blockly/core/renderers/measurables/base.js +44 -0
- package/blocklySkini/blockly/core/renderers/measurables/connections.js +114 -0
- package/blocklySkini/blockly/core/renderers/measurables/inputs.js +160 -0
- package/blocklySkini/blockly/core/renderers/measurables/row_elements.js +185 -0
- package/blocklySkini/blockly/core/renderers/measurables/rows.js +532 -0
- package/blocklySkini/blockly/core/renderers/measurables/types.js +349 -0
- package/blocklySkini/blockly/core/renderers/minimalist/constants.js +29 -0
- package/blocklySkini/blockly/core/renderers/minimalist/drawer.js +32 -0
- package/blocklySkini/blockly/core/renderers/minimalist/info.js +45 -0
- package/blocklySkini/blockly/core/renderers/minimalist/renderer.js +70 -0
- package/blocklySkini/blockly/core/renderers/thrasos/info.js +338 -0
- package/blocklySkini/blockly/core/renderers/thrasos/renderer.js +45 -0
- package/blocklySkini/blockly/core/renderers/zelos/constants.js +1002 -0
- package/blocklySkini/blockly/core/renderers/zelos/drawer.js +233 -0
- package/blocklySkini/blockly/core/renderers/zelos/info.js +587 -0
- package/blocklySkini/blockly/core/renderers/zelos/marker_svg.js +148 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/inputs.js +47 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/row_elements.js +37 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/rows.js +108 -0
- package/blocklySkini/blockly/core/renderers/zelos/path_object.js +244 -0
- package/blocklySkini/blockly/core/renderers/zelos/renderer.js +130 -0
- package/blocklySkini/blockly/core/requires.js +84 -0
- package/blocklySkini/blockly/core/scrollbar.js +880 -0
- package/blocklySkini/blockly/core/theme/classic.js +87 -0
- package/blocklySkini/blockly/core/theme/dark.js +33 -0
- package/blocklySkini/blockly/core/theme/deuteranopia.js +104 -0
- package/blocklySkini/blockly/core/theme/highcontrast.js +119 -0
- package/blocklySkini/blockly/core/theme/modern.js +108 -0
- package/blocklySkini/blockly/core/theme/tritanopia.js +103 -0
- package/blocklySkini/blockly/core/theme/zelos.js +106 -0
- package/blocklySkini/blockly/core/theme.js +236 -0
- package/blocklySkini/blockly/core/theme_manager.js +197 -0
- package/blocklySkini/blockly/core/toolbox/category.js +690 -0
- package/blocklySkini/blockly/core/toolbox/collapsible_category.js +294 -0
- package/blocklySkini/blockly/core/toolbox/separator.js +123 -0
- package/blocklySkini/blockly/core/toolbox/toolbox.js +984 -0
- package/blocklySkini/blockly/core/toolbox/toolbox_item.js +145 -0
- package/blocklySkini/blockly/core/toolbox.js +943 -0
- package/blocklySkini/blockly/core/tooltip.js +387 -0
- package/blocklySkini/blockly/core/touch.js +255 -0
- package/blocklySkini/blockly/core/touch_gesture.js +325 -0
- package/blocklySkini/blockly/core/trashcan.js +661 -0
- package/blocklySkini/blockly/core/ui_events.js +85 -0
- package/blocklySkini/blockly/core/utils/aria.js +167 -0
- package/blocklySkini/blockly/core/utils/colour.js +208 -0
- package/blocklySkini/blockly/core/utils/coordinate.js +125 -0
- package/blocklySkini/blockly/core/utils/deprecation.js +34 -0
- package/blocklySkini/blockly/core/utils/dom.js +391 -0
- package/blocklySkini/blockly/core/utils/global.js +37 -0
- package/blocklySkini/blockly/core/utils/idgenerator.js +33 -0
- package/blocklySkini/blockly/core/utils/keycodes.js +164 -0
- package/blocklySkini/blockly/core/utils/math.js +56 -0
- package/blocklySkini/blockly/core/utils/metrics.js +124 -0
- package/blocklySkini/blockly/core/utils/object.js +73 -0
- package/blocklySkini/blockly/core/utils/rect.js +54 -0
- package/blocklySkini/blockly/core/utils/size.js +58 -0
- package/blocklySkini/blockly/core/utils/string.js +284 -0
- package/blocklySkini/blockly/core/utils/style.js +281 -0
- package/blocklySkini/blockly/core/utils/svg.js +181 -0
- package/blocklySkini/blockly/core/utils/svg_paths.js +142 -0
- package/blocklySkini/blockly/core/utils/toolbox.js +401 -0
- package/blocklySkini/blockly/core/utils/useragent.js +110 -0
- package/blocklySkini/blockly/core/utils/xml.js +79 -0
- package/blocklySkini/blockly/core/utils.js +652 -0
- package/blocklySkini/blockly/core/variable_events.js +248 -0
- package/blocklySkini/blockly/core/variable_map.js +414 -0
- package/blocklySkini/blockly/core/variable_model.js +95 -0
- package/blocklySkini/blockly/core/variables.js +571 -0
- package/blocklySkini/blockly/core/variables_dynamic.js +100 -0
- package/blocklySkini/blockly/core/warning.js +200 -0
- package/blocklySkini/blockly/core/widgetdiv.js +241 -0
- package/blocklySkini/blockly/core/workspace.js +786 -0
- package/blocklySkini/blockly/core/workspace_audio.js +153 -0
- package/blocklySkini/blockly/core/workspace_comment.js +373 -0
- package/blocklySkini/blockly/core/workspace_comment_render_svg.js +461 -0
- package/blocklySkini/blockly/core/workspace_comment_svg.js +701 -0
- package/blocklySkini/blockly/core/workspace_drag_surface_svg.js +176 -0
- package/blocklySkini/blockly/core/workspace_dragger.js +85 -0
- package/blocklySkini/blockly/core/workspace_events.js +93 -0
- package/blocklySkini/blockly/core/workspace_svg.js +2661 -0
- package/blocklySkini/blockly/core/ws_comment_events.js +417 -0
- package/blocklySkini/blockly/core/xml.js +827 -0
- package/blocklySkini/blockly/core/zoom_controls.js +449 -0
- package/blocklySkini/blockly/core-browser.js +34 -0
- package/blocklySkini/blockly/core.d.ts +15 -0
- package/blocklySkini/blockly/core.js +38 -0
- package/blocklySkini/blockly/dart.d.ts +15 -0
- package/blocklySkini/blockly/dart.js +27 -0
- package/blocklySkini/blockly/dart_compressed.js +114 -0
- package/blocklySkini/blockly/dart_compressed.js.map +1 -0
- package/blocklySkini/blockly/generators/dart/colour.js +114 -0
- package/blocklySkini/blockly/generators/dart/lists.js +447 -0
- package/blocklySkini/blockly/generators/dart/logic.js +127 -0
- package/blocklySkini/blockly/generators/dart/loops.js +169 -0
- package/blocklySkini/blockly/generators/dart/math.js +485 -0
- package/blocklySkini/blockly/generators/dart/procedures.js +111 -0
- package/blocklySkini/blockly/generators/dart/text.js +339 -0
- package/blocklySkini/blockly/generators/dart/variables.js +32 -0
- package/blocklySkini/blockly/generators/dart/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/dart.js +290 -0
- package/blocklySkini/blockly/generators/javascript/colour.js +89 -0
- package/blocklySkini/blockly/generators/javascript/lists.js +388 -0
- package/blocklySkini/blockly/generators/javascript/logic.js +129 -0
- package/blocklySkini/blockly/generators/javascript/loops.js +184 -0
- package/blocklySkini/blockly/generators/javascript/math.js +409 -0
- package/blocklySkini/blockly/generators/javascript/procedures.js +113 -0
- package/blocklySkini/blockly/generators/javascript/text.js +367 -0
- package/blocklySkini/blockly/generators/javascript/variables.js +32 -0
- package/blocklySkini/blockly/generators/javascript/variables_dynamic.js +23 -0
- package/blocklySkini/blockly/generators/javascript.js +317 -0
- package/blocklySkini/blockly/generators/lua/colour.js +76 -0
- package/blocklySkini/blockly/generators/lua/lists.js +368 -0
- package/blocklySkini/blockly/generators/lua/logic.js +127 -0
- package/blocklySkini/blockly/generators/lua/loops.js +173 -0
- package/blocklySkini/blockly/generators/lua/math.js +423 -0
- package/blocklySkini/blockly/generators/lua/procedures.js +113 -0
- package/blocklySkini/blockly/generators/lua/text.js +353 -0
- package/blocklySkini/blockly/generators/lua/variables.js +32 -0
- package/blocklySkini/blockly/generators/lua/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/lua.js +198 -0
- package/blocklySkini/blockly/generators/php/colour.js +91 -0
- package/blocklySkini/blockly/generators/php/lists.js +498 -0
- package/blocklySkini/blockly/generators/php/logic.js +128 -0
- package/blocklySkini/blockly/generators/php/loops.js +170 -0
- package/blocklySkini/blockly/generators/php/math.js +370 -0
- package/blocklySkini/blockly/generators/php/procedures.js +132 -0
- package/blocklySkini/blockly/generators/php/text.js +271 -0
- package/blocklySkini/blockly/generators/php/variables.js +32 -0
- package/blocklySkini/blockly/generators/php/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/php.js +318 -0
- package/blocklySkini/blockly/generators/python/colour.js +72 -0
- package/blocklySkini/blockly/generators/python/lists.js +349 -0
- package/blocklySkini/blockly/generators/python/logic.js +127 -0
- package/blocklySkini/blockly/generators/python/loops.js +214 -0
- package/blocklySkini/blockly/generators/python/math.js +385 -0
- package/blocklySkini/blockly/generators/python/procedures.js +134 -0
- package/blocklySkini/blockly/generators/python/text.js +293 -0
- package/blocklySkini/blockly/generators/python/variables.js +32 -0
- package/blocklySkini/blockly/generators/python/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/python.js +322 -0
- package/blocklySkini/blockly/index.d.ts +22 -0
- package/blocklySkini/blockly/index.js +24 -0
- package/blocklySkini/blockly/javascript.d.ts +15 -0
- package/blocklySkini/blockly/javascript.js +27 -0
- package/blocklySkini/blockly/javascript_compressed.js +115 -0
- package/blocklySkini/blockly/javascript_compressed.js.map +1 -0
- package/blocklySkini/blockly/lua.d.ts +15 -0
- package/blocklySkini/blockly/lua.js +27 -0
- package/blocklySkini/blockly/lua_compressed.js +94 -0
- package/blocklySkini/blockly/lua_compressed.js.map +1 -0
- package/blocklySkini/blockly/media/1x1.gif +0 -0
- package/blocklySkini/blockly/media/click.mp3 +0 -0
- package/blocklySkini/blockly/media/click.ogg +0 -0
- package/blocklySkini/blockly/media/click.wav +0 -0
- package/blocklySkini/blockly/media/delete.mp3 +0 -0
- package/blocklySkini/blockly/media/delete.ogg +0 -0
- package/blocklySkini/blockly/media/delete.wav +0 -0
- package/blocklySkini/blockly/media/disconnect.mp3 +0 -0
- package/blocklySkini/blockly/media/disconnect.ogg +0 -0
- package/blocklySkini/blockly/media/disconnect.wav +0 -0
- package/blocklySkini/blockly/media/dropdown-arrow.svg +1 -0
- package/blocklySkini/blockly/media/handclosed.cur +0 -0
- package/blocklySkini/blockly/media/handdelete.cur +0 -0
- package/blocklySkini/blockly/media/handopen.cur +0 -0
- package/blocklySkini/blockly/media/pilcrow.png +0 -0
- package/blocklySkini/blockly/media/quote0.png +0 -0
- package/blocklySkini/blockly/media/quote1.png +0 -0
- package/blocklySkini/blockly/media/sprites.png +0 -0
- package/blocklySkini/blockly/media/sprites.svg +74 -0
- package/blocklySkini/blockly/msg/ab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ab.js +447 -0
- package/blocklySkini/blockly/msg/ar.d.ts +16 -0
- package/blocklySkini/blockly/msg/ar.js +447 -0
- package/blocklySkini/blockly/msg/az.d.ts +16 -0
- package/blocklySkini/blockly/msg/az.js +447 -0
- package/blocklySkini/blockly/msg/ba.d.ts +16 -0
- package/blocklySkini/blockly/msg/ba.js +447 -0
- package/blocklySkini/blockly/msg/bcc.d.ts +16 -0
- package/blocklySkini/blockly/msg/bcc.js +447 -0
- package/blocklySkini/blockly/msg/be-tarask.d.ts +16 -0
- package/blocklySkini/blockly/msg/be-tarask.js +447 -0
- package/blocklySkini/blockly/msg/be.d.ts +16 -0
- package/blocklySkini/blockly/msg/be.js +447 -0
- package/blocklySkini/blockly/msg/bg.d.ts +16 -0
- package/blocklySkini/blockly/msg/bg.js +447 -0
- package/blocklySkini/blockly/msg/bn.d.ts +16 -0
- package/blocklySkini/blockly/msg/bn.js +447 -0
- package/blocklySkini/blockly/msg/br.d.ts +16 -0
- package/blocklySkini/blockly/msg/br.js +447 -0
- package/blocklySkini/blockly/msg/ca.d.ts +16 -0
- package/blocklySkini/blockly/msg/ca.js +447 -0
- package/blocklySkini/blockly/msg/constants.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.js +447 -0
- package/blocklySkini/blockly/msg/da.d.ts +16 -0
- package/blocklySkini/blockly/msg/da.js +447 -0
- package/blocklySkini/blockly/msg/de.d.ts +16 -0
- package/blocklySkini/blockly/msg/de.js +447 -0
- package/blocklySkini/blockly/msg/diq.d.ts +16 -0
- package/blocklySkini/blockly/msg/diq.js +447 -0
- package/blocklySkini/blockly/msg/dty.d.ts +16 -0
- package/blocklySkini/blockly/msg/dty.js +447 -0
- package/blocklySkini/blockly/msg/ee.d.ts +16 -0
- package/blocklySkini/blockly/msg/ee.js +447 -0
- package/blocklySkini/blockly/msg/el.d.ts +16 -0
- package/blocklySkini/blockly/msg/el.js +447 -0
- package/blocklySkini/blockly/msg/en-gb.d.ts +16 -0
- package/blocklySkini/blockly/msg/en-gb.js +447 -0
- package/blocklySkini/blockly/msg/en.d.ts +16 -0
- package/blocklySkini/blockly/msg/en.js +447 -0
- package/blocklySkini/blockly/msg/eo.d.ts +16 -0
- package/blocklySkini/blockly/msg/eo.js +447 -0
- package/blocklySkini/blockly/msg/es.d.ts +16 -0
- package/blocklySkini/blockly/msg/es.js +447 -0
- package/blocklySkini/blockly/msg/et.d.ts +16 -0
- package/blocklySkini/blockly/msg/et.js +447 -0
- package/blocklySkini/blockly/msg/eu.d.ts +16 -0
- package/blocklySkini/blockly/msg/eu.js +447 -0
- package/blocklySkini/blockly/msg/fa.d.ts +16 -0
- package/blocklySkini/blockly/msg/fa.js +447 -0
- package/blocklySkini/blockly/msg/fi.d.ts +16 -0
- package/blocklySkini/blockly/msg/fi.js +447 -0
- package/blocklySkini/blockly/msg/fr.d.ts +16 -0
- package/blocklySkini/blockly/msg/fr.js +447 -0
- package/blocklySkini/blockly/msg/gl.d.ts +16 -0
- package/blocklySkini/blockly/msg/gl.js +447 -0
- package/blocklySkini/blockly/msg/gor.d.ts +16 -0
- package/blocklySkini/blockly/msg/gor.js +447 -0
- package/blocklySkini/blockly/msg/ha.d.ts +16 -0
- package/blocklySkini/blockly/msg/ha.js +447 -0
- package/blocklySkini/blockly/msg/he.d.ts +16 -0
- package/blocklySkini/blockly/msg/he.js +447 -0
- package/blocklySkini/blockly/msg/hi.d.ts +16 -0
- package/blocklySkini/blockly/msg/hi.js +447 -0
- package/blocklySkini/blockly/msg/hrx.d.ts +16 -0
- package/blocklySkini/blockly/msg/hrx.js +447 -0
- package/blocklySkini/blockly/msg/hu.d.ts +16 -0
- package/blocklySkini/blockly/msg/hu.js +447 -0
- package/blocklySkini/blockly/msg/hy.d.ts +16 -0
- package/blocklySkini/blockly/msg/hy.js +447 -0
- package/blocklySkini/blockly/msg/ia.d.ts +16 -0
- package/blocklySkini/blockly/msg/ia.js +447 -0
- package/blocklySkini/blockly/msg/id.d.ts +16 -0
- package/blocklySkini/blockly/msg/id.js +447 -0
- package/blocklySkini/blockly/msg/ig.d.ts +16 -0
- package/blocklySkini/blockly/msg/ig.js +447 -0
- package/blocklySkini/blockly/msg/is.d.ts +16 -0
- package/blocklySkini/blockly/msg/is.js +447 -0
- package/blocklySkini/blockly/msg/it.d.ts +16 -0
- package/blocklySkini/blockly/msg/it.js +447 -0
- package/blocklySkini/blockly/msg/ja.d.ts +16 -0
- package/blocklySkini/blockly/msg/ja.js +447 -0
- package/blocklySkini/blockly/msg/kab.d.ts +16 -0
- package/blocklySkini/blockly/msg/kab.js +447 -0
- package/blocklySkini/blockly/msg/kn.d.ts +16 -0
- package/blocklySkini/blockly/msg/kn.js +447 -0
- package/blocklySkini/blockly/msg/ko.d.ts +16 -0
- package/blocklySkini/blockly/msg/ko.js +447 -0
- package/blocklySkini/blockly/msg/lb.d.ts +16 -0
- package/blocklySkini/blockly/msg/lb.js +447 -0
- package/blocklySkini/blockly/msg/lki.d.ts +16 -0
- package/blocklySkini/blockly/msg/lki.js +447 -0
- package/blocklySkini/blockly/msg/lo.d.ts +16 -0
- package/blocklySkini/blockly/msg/lo.js +447 -0
- package/blocklySkini/blockly/msg/lrc.d.ts +16 -0
- package/blocklySkini/blockly/msg/lrc.js +447 -0
- package/blocklySkini/blockly/msg/lt.d.ts +16 -0
- package/blocklySkini/blockly/msg/lt.js +447 -0
- package/blocklySkini/blockly/msg/lv.d.ts +16 -0
- package/blocklySkini/blockly/msg/lv.js +447 -0
- package/blocklySkini/blockly/msg/mk.d.ts +16 -0
- package/blocklySkini/blockly/msg/mk.js +447 -0
- package/blocklySkini/blockly/msg/mnw.d.ts +16 -0
- package/blocklySkini/blockly/msg/mnw.js +447 -0
- package/blocklySkini/blockly/msg/ms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ms.js +447 -0
- package/blocklySkini/blockly/msg/msg.d.ts +444 -0
- package/blocklySkini/blockly/msg/nb.d.ts +16 -0
- package/blocklySkini/blockly/msg/nb.js +447 -0
- package/blocklySkini/blockly/msg/nl.d.ts +16 -0
- package/blocklySkini/blockly/msg/nl.js +447 -0
- package/blocklySkini/blockly/msg/oc.d.ts +16 -0
- package/blocklySkini/blockly/msg/oc.js +447 -0
- package/blocklySkini/blockly/msg/pl.d.ts +16 -0
- package/blocklySkini/blockly/msg/pl.js +447 -0
- package/blocklySkini/blockly/msg/pms.d.ts +16 -0
- package/blocklySkini/blockly/msg/pms.js +447 -0
- package/blocklySkini/blockly/msg/pt-br.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt-br.js +447 -0
- package/blocklySkini/blockly/msg/pt.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt.js +447 -0
- package/blocklySkini/blockly/msg/qqq.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.js +447 -0
- package/blocklySkini/blockly/msg/ru.d.ts +16 -0
- package/blocklySkini/blockly/msg/ru.js +447 -0
- package/blocklySkini/blockly/msg/sc.d.ts +16 -0
- package/blocklySkini/blockly/msg/sc.js +447 -0
- package/blocklySkini/blockly/msg/sd.d.ts +16 -0
- package/blocklySkini/blockly/msg/sd.js +447 -0
- package/blocklySkini/blockly/msg/shn.d.ts +16 -0
- package/blocklySkini/blockly/msg/shn.js +447 -0
- package/blocklySkini/blockly/msg/sk.d.ts +16 -0
- package/blocklySkini/blockly/msg/sk.js +447 -0
- package/blocklySkini/blockly/msg/skr-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/skr-arab.js +447 -0
- package/blocklySkini/blockly/msg/sl.d.ts +16 -0
- package/blocklySkini/blockly/msg/sl.js +447 -0
- package/blocklySkini/blockly/msg/sq.d.ts +16 -0
- package/blocklySkini/blockly/msg/sq.js +447 -0
- package/blocklySkini/blockly/msg/sr-latn.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr-latn.js +447 -0
- package/blocklySkini/blockly/msg/sr.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr.js +447 -0
- package/blocklySkini/blockly/msg/sv.d.ts +16 -0
- package/blocklySkini/blockly/msg/sv.js +447 -0
- package/blocklySkini/blockly/msg/synonyms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.js +447 -0
- package/blocklySkini/blockly/msg/tcy.d.ts +16 -0
- package/blocklySkini/blockly/msg/tcy.js +447 -0
- package/blocklySkini/blockly/msg/te.d.ts +16 -0
- package/blocklySkini/blockly/msg/te.js +447 -0
- package/blocklySkini/blockly/msg/th.d.ts +16 -0
- package/blocklySkini/blockly/msg/th.js +447 -0
- package/blocklySkini/blockly/msg/tl.d.ts +16 -0
- package/blocklySkini/blockly/msg/tl.js +447 -0
- package/blocklySkini/blockly/msg/tlh.d.ts +16 -0
- package/blocklySkini/blockly/msg/tlh.js +447 -0
- package/blocklySkini/blockly/msg/tr.d.ts +16 -0
- package/blocklySkini/blockly/msg/tr.js +447 -0
- package/blocklySkini/blockly/msg/ug-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ug-arab.js +447 -0
- package/blocklySkini/blockly/msg/uk.d.ts +16 -0
- package/blocklySkini/blockly/msg/uk.js +447 -0
- package/blocklySkini/blockly/msg/ur.d.ts +16 -0
- package/blocklySkini/blockly/msg/ur.js +447 -0
- package/blocklySkini/blockly/msg/vi.d.ts +16 -0
- package/blocklySkini/blockly/msg/vi.js +447 -0
- package/blocklySkini/blockly/msg/xmf.d.ts +16 -0
- package/blocklySkini/blockly/msg/xmf.js +447 -0
- package/blocklySkini/blockly/msg/yo.d.ts +16 -0
- package/blocklySkini/blockly/msg/yo.js +447 -0
- package/blocklySkini/blockly/msg/zh-hans.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hans.js +447 -0
- package/blocklySkini/blockly/msg/zh-hant.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hant.js +447 -0
- package/blocklySkini/blockly/node.js +35 -0
- package/blocklySkini/blockly/package.json +84 -0
- package/blocklySkini/blockly/php.d.ts +15 -0
- package/blocklySkini/blockly/php.js +27 -0
- package/blocklySkini/blockly/php_compressed.js +103 -0
- package/blocklySkini/blockly/php_compressed.js.map +1 -0
- package/blocklySkini/blockly/python.d.ts +15 -0
- package/blocklySkini/blockly/python.js +27 -0
- package/blocklySkini/blockly/python_compressed.js +98 -0
- package/blocklySkini/blockly/python_compressed.js.map +1 -0
- package/blocklySkini/blocklySkini.html +81 -0
- package/blocklySkini/orchestrations/.xml +1 -0
- package/blocklySkini/orchestrations/BluesSkini-1.xml +231 -0
- package/blocklySkini/orchestrations/BluesSkini-2.xml +741 -0
- package/blocklySkini/orchestrations/BluesSkini-3.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini-4.xml +695 -0
- package/blocklySkini/orchestrations/BluesSkini-5.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini.xml +704 -0
- package/blocklySkini/orchestrations/FunkBitwig-1.xml +778 -0
- package/blocklySkini/orchestrations/FunkBitwig-2.xml +471 -0
- package/blocklySkini/orchestrations/JouerLeBonInstrument1-1.xml +784 -0
- package/blocklySkini/orchestrations/MajeurMineur-1.xml +638 -0
- package/blocklySkini/orchestrations/Opus5-3 - Copie.xml +1041 -0
- package/blocklySkini/orchestrations/Opus5-3.xml +1128 -0
- package/blocklySkini/orchestrations/Quatuor1-1.xml +357 -0
- package/blocklySkini/orchestrations/TechnoBitwig-1.xml +221 -0
- package/blocklySkini/orchestrations/TestBlockly.xml +497 -0
- package/blocklySkini/orchestrations/TestBlockly1.xml +500 -0
- package/blocklySkini/orchestrations/TestBlockly2.xml +792 -0
- package/blocklySkini/orchestrations/TestBlockly3-1.xml +1182 -0
- package/blocklySkini/orchestrations/TestBlockly3.xml +1251 -0
- package/blocklySkini/orchestrations/TestFunction.xml +143 -0
- package/blocklySkini/orchestrations/TestIf.xml +80 -0
- package/blocklySkini/orchestrations/TestLoop.xml +127 -0
- package/blocklySkini/orchestrations/TestOrchestration2.xml +460 -0
- package/blocklySkini/orchestrations/TestPrint.xml +70 -0
- package/blocklySkini/orchestrations/TestSubMod.xml +81 -0
- package/blocklySkini/orchestrations/Testlogic.xml +113 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-1.xml +813 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-2.xml +813 -0
- package/blocklySkini/orchestrations/bar.xml +496 -0
- package/blocklySkini/orchestrations/bar2.xml +496 -0
- package/blocklySkini/orchestrations/foo.xml +500 -0
- package/blocklySkini/orchestrations/opus5Blockly - Copie.xml +496 -0
- package/blocklySkini/orchestrations/opus5Blockly-3.xml +868 -0
- package/blocklySkini/orchestrations/opus5Blockly.xml +496 -0
- package/blocklySkini/orchestrations/testOrchestration3.xml +483 -0
- package/blocklySkini/orchestrations/testOrchestration4.xml +487 -0
- package/blocklySkini/scripts/hiphop_blocks.js +6104 -0
- package/blocklySkini/scripts/main2.js +801 -0
- package/blocklySkini/styles/index.css +320 -0
- package/blocklySkini/styles/material.css +11552 -0
- package/package.json +5 -5
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Classes for all types of variable events.
|
|
9
|
+
* @author fenichel@google.com (Rachel Fenichel)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.Events.VarBase');
|
|
14
|
+
goog.provide('Blockly.Events.VarCreate');
|
|
15
|
+
goog.provide('Blockly.Events.VarDelete');
|
|
16
|
+
goog.provide('Blockly.Events.VarRename');
|
|
17
|
+
|
|
18
|
+
goog.require('Blockly.Events');
|
|
19
|
+
goog.require('Blockly.Events.Abstract');
|
|
20
|
+
goog.require('Blockly.registry');
|
|
21
|
+
goog.require('Blockly.utils.object');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Abstract class for a variable event.
|
|
26
|
+
* @param {!Blockly.VariableModel=} opt_variable The variable this event
|
|
27
|
+
* corresponds to. Undefined for a blank event.
|
|
28
|
+
* @extends {Blockly.Events.Abstract}
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
Blockly.Events.VarBase = function(opt_variable) {
|
|
32
|
+
Blockly.Events.VarBase.superClass_.constructor.call(this);
|
|
33
|
+
this.isBlank = typeof opt_variable == 'undefined';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The variable id for the variable this event pertains to.
|
|
37
|
+
* @type {string}
|
|
38
|
+
*/
|
|
39
|
+
this.varId = this.isBlank ? '' : opt_variable.getId();
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The workspace identifier for this event.
|
|
43
|
+
* @type {string}
|
|
44
|
+
*/
|
|
45
|
+
this.workspaceId = this.isBlank ? '' : opt_variable.workspace.id;
|
|
46
|
+
};
|
|
47
|
+
Blockly.utils.object.inherits(Blockly.Events.VarBase, Blockly.Events.Abstract);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Encode the event as JSON.
|
|
51
|
+
* @return {!Object} JSON representation.
|
|
52
|
+
*/
|
|
53
|
+
Blockly.Events.VarBase.prototype.toJson = function() {
|
|
54
|
+
var json = Blockly.Events.VarBase.superClass_.toJson.call(this);
|
|
55
|
+
json['varId'] = this.varId;
|
|
56
|
+
return json;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Decode the JSON event.
|
|
61
|
+
* @param {!Object} json JSON representation.
|
|
62
|
+
*/
|
|
63
|
+
Blockly.Events.VarBase.prototype.fromJson = function(json) {
|
|
64
|
+
Blockly.Events.VarBase.superClass_.toJson.call(this);
|
|
65
|
+
this.varId = json['varId'];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Class for a variable creation event.
|
|
70
|
+
* @param {!Blockly.VariableModel=} opt_variable The created variable. Undefined
|
|
71
|
+
* for a blank event.
|
|
72
|
+
* @extends {Blockly.Events.VarBase}
|
|
73
|
+
* @constructor
|
|
74
|
+
*/
|
|
75
|
+
Blockly.Events.VarCreate = function(opt_variable) {
|
|
76
|
+
Blockly.Events.VarCreate.superClass_.constructor.call(this, opt_variable);
|
|
77
|
+
if (!opt_variable) {
|
|
78
|
+
return; // Blank event to be populated by fromJson.
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.varType = opt_variable.type;
|
|
82
|
+
this.varName = opt_variable.name;
|
|
83
|
+
};
|
|
84
|
+
Blockly.utils.object.inherits(Blockly.Events.VarCreate, Blockly.Events.VarBase);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Type of this event.
|
|
88
|
+
* @type {string}
|
|
89
|
+
*/
|
|
90
|
+
Blockly.Events.VarCreate.prototype.type = Blockly.Events.VAR_CREATE;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Encode the event as JSON.
|
|
94
|
+
* @return {!Object} JSON representation.
|
|
95
|
+
*/
|
|
96
|
+
Blockly.Events.VarCreate.prototype.toJson = function() {
|
|
97
|
+
var json = Blockly.Events.VarCreate.superClass_.toJson.call(this);
|
|
98
|
+
json['varType'] = this.varType;
|
|
99
|
+
json['varName'] = this.varName;
|
|
100
|
+
return json;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Decode the JSON event.
|
|
105
|
+
* @param {!Object} json JSON representation.
|
|
106
|
+
*/
|
|
107
|
+
Blockly.Events.VarCreate.prototype.fromJson = function(json) {
|
|
108
|
+
Blockly.Events.VarCreate.superClass_.fromJson.call(this, json);
|
|
109
|
+
this.varType = json['varType'];
|
|
110
|
+
this.varName = json['varName'];
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Run a variable creation event.
|
|
115
|
+
* @param {boolean} forward True if run forward, false if run backward (undo).
|
|
116
|
+
*/
|
|
117
|
+
Blockly.Events.VarCreate.prototype.run = function(forward) {
|
|
118
|
+
var workspace = this.getEventWorkspace_();
|
|
119
|
+
if (forward) {
|
|
120
|
+
workspace.createVariable(this.varName, this.varType, this.varId);
|
|
121
|
+
} else {
|
|
122
|
+
workspace.deleteVariableById(this.varId);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Class for a variable deletion event.
|
|
128
|
+
* @param {!Blockly.VariableModel=} opt_variable The deleted variable. Undefined
|
|
129
|
+
* for a blank event.
|
|
130
|
+
* @extends {Blockly.Events.VarBase}
|
|
131
|
+
* @constructor
|
|
132
|
+
*/
|
|
133
|
+
Blockly.Events.VarDelete = function(opt_variable) {
|
|
134
|
+
Blockly.Events.VarDelete.superClass_.constructor.call(this, opt_variable);
|
|
135
|
+
if (!opt_variable) {
|
|
136
|
+
return; // Blank event to be populated by fromJson.
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
this.varType = opt_variable.type;
|
|
140
|
+
this.varName = opt_variable.name;
|
|
141
|
+
};
|
|
142
|
+
Blockly.utils.object.inherits(Blockly.Events.VarDelete, Blockly.Events.VarBase);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Type of this event.
|
|
146
|
+
* @type {string}
|
|
147
|
+
*/
|
|
148
|
+
Blockly.Events.VarDelete.prototype.type = Blockly.Events.VAR_DELETE;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Encode the event as JSON.
|
|
152
|
+
* @return {!Object} JSON representation.
|
|
153
|
+
*/
|
|
154
|
+
Blockly.Events.VarDelete.prototype.toJson = function() {
|
|
155
|
+
var json = Blockly.Events.VarDelete.superClass_.toJson.call(this);
|
|
156
|
+
json['varType'] = this.varType;
|
|
157
|
+
json['varName'] = this.varName;
|
|
158
|
+
return json;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Decode the JSON event.
|
|
163
|
+
* @param {!Object} json JSON representation.
|
|
164
|
+
*/
|
|
165
|
+
Blockly.Events.VarDelete.prototype.fromJson = function(json) {
|
|
166
|
+
Blockly.Events.VarDelete.superClass_.fromJson.call(this, json);
|
|
167
|
+
this.varType = json['varType'];
|
|
168
|
+
this.varName = json['varName'];
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Run a variable deletion event.
|
|
173
|
+
* @param {boolean} forward True if run forward, false if run backward (undo).
|
|
174
|
+
*/
|
|
175
|
+
Blockly.Events.VarDelete.prototype.run = function(forward) {
|
|
176
|
+
var workspace = this.getEventWorkspace_();
|
|
177
|
+
if (forward) {
|
|
178
|
+
workspace.deleteVariableById(this.varId);
|
|
179
|
+
} else {
|
|
180
|
+
workspace.createVariable(this.varName, this.varType, this.varId);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Class for a variable rename event.
|
|
186
|
+
* @param {!Blockly.VariableModel=} opt_variable The renamed variable. Undefined
|
|
187
|
+
* for a blank event.
|
|
188
|
+
* @param {string=} newName The new name the variable will be changed to.
|
|
189
|
+
* @extends {Blockly.Events.VarBase}
|
|
190
|
+
* @constructor
|
|
191
|
+
*/
|
|
192
|
+
Blockly.Events.VarRename = function(opt_variable, newName) {
|
|
193
|
+
Blockly.Events.VarRename.superClass_.constructor.call(this, opt_variable);
|
|
194
|
+
if (!opt_variable) {
|
|
195
|
+
return; // Blank event to be populated by fromJson.
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
this.oldName = opt_variable.name;
|
|
199
|
+
this.newName = typeof newName == 'undefined' ? '' : newName;
|
|
200
|
+
};
|
|
201
|
+
Blockly.utils.object.inherits(Blockly.Events.VarRename, Blockly.Events.VarBase);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Type of this event.
|
|
205
|
+
* @type {string}
|
|
206
|
+
*/
|
|
207
|
+
Blockly.Events.VarRename.prototype.type = Blockly.Events.VAR_RENAME;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Encode the event as JSON.
|
|
211
|
+
* @return {!Object} JSON representation.
|
|
212
|
+
*/
|
|
213
|
+
Blockly.Events.VarRename.prototype.toJson = function() {
|
|
214
|
+
var json = Blockly.Events.VarRename.superClass_.toJson.call(this);
|
|
215
|
+
json['oldName'] = this.oldName;
|
|
216
|
+
json['newName'] = this.newName;
|
|
217
|
+
return json;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Decode the JSON event.
|
|
222
|
+
* @param {!Object} json JSON representation.
|
|
223
|
+
*/
|
|
224
|
+
Blockly.Events.VarRename.prototype.fromJson = function(json) {
|
|
225
|
+
Blockly.Events.VarRename.superClass_.fromJson.call(this, json);
|
|
226
|
+
this.oldName = json['oldName'];
|
|
227
|
+
this.newName = json['newName'];
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Run a variable rename event.
|
|
232
|
+
* @param {boolean} forward True if run forward, false if run backward (undo).
|
|
233
|
+
*/
|
|
234
|
+
Blockly.Events.VarRename.prototype.run = function(forward) {
|
|
235
|
+
var workspace = this.getEventWorkspace_();
|
|
236
|
+
if (forward) {
|
|
237
|
+
workspace.renameVariableById(this.varId, this.newName);
|
|
238
|
+
} else {
|
|
239
|
+
workspace.renameVariableById(this.varId, this.oldName);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
Blockly.registry.register(Blockly.registry.Type.EVENT,
|
|
244
|
+
Blockly.Events.VAR_CREATE, Blockly.Events.VarCreate);
|
|
245
|
+
Blockly.registry.register(Blockly.registry.Type.EVENT,
|
|
246
|
+
Blockly.Events.VAR_DELETE, Blockly.Events.VarDelete);
|
|
247
|
+
Blockly.registry.register(Blockly.registry.Type.EVENT,
|
|
248
|
+
Blockly.Events.VAR_RENAME, Blockly.Events.VarRename);
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Object representing a map of variables and their types.
|
|
9
|
+
* @author marisaleung@google.com (Marisa Leung)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.VariableMap');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.Events');
|
|
16
|
+
goog.require('Blockly.Events.VarDelete');
|
|
17
|
+
goog.require('Blockly.Events.VarRename');
|
|
18
|
+
goog.require('Blockly.Msg');
|
|
19
|
+
goog.require('Blockly.utils');
|
|
20
|
+
goog.require('Blockly.utils.object');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Class for a variable map. This contains a dictionary data structure with
|
|
25
|
+
* variable types as keys and lists of variables as values. The list of
|
|
26
|
+
* variables are the type indicated by the key.
|
|
27
|
+
* @param {!Blockly.Workspace} workspace The workspace this map belongs to.
|
|
28
|
+
* @constructor
|
|
29
|
+
*/
|
|
30
|
+
Blockly.VariableMap = function(workspace) {
|
|
31
|
+
/**
|
|
32
|
+
* A map from variable type to list of variable names. The lists contain all
|
|
33
|
+
* of the named variables in the workspace, including variables
|
|
34
|
+
* that are not currently in use.
|
|
35
|
+
* @type {!Object.<string, !Array.<Blockly.VariableModel>>}
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
this.variableMap_ = Object.create(null);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The workspace this map belongs to.
|
|
42
|
+
* @type {!Blockly.Workspace}
|
|
43
|
+
*/
|
|
44
|
+
this.workspace = workspace;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Clear the variable map.
|
|
49
|
+
*/
|
|
50
|
+
Blockly.VariableMap.prototype.clear = function() {
|
|
51
|
+
this.variableMap_ = Object.create(null);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/* Begin functions for renaming variables. */
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Rename the given variable by updating its name in the variable map.
|
|
58
|
+
* @param {!Blockly.VariableModel} variable Variable to rename.
|
|
59
|
+
* @param {string} newName New variable name.
|
|
60
|
+
* @package
|
|
61
|
+
*/
|
|
62
|
+
Blockly.VariableMap.prototype.renameVariable = function(variable, newName) {
|
|
63
|
+
var type = variable.type;
|
|
64
|
+
var conflictVar = this.getVariable(newName, type);
|
|
65
|
+
var blocks = this.workspace.getAllBlocks(false);
|
|
66
|
+
Blockly.Events.setGroup(true);
|
|
67
|
+
try {
|
|
68
|
+
// The IDs may match if the rename is a simple case change (name1 -> Name1).
|
|
69
|
+
if (!conflictVar || conflictVar.getId() == variable.getId()) {
|
|
70
|
+
this.renameVariableAndUses_(variable, newName, blocks);
|
|
71
|
+
} else {
|
|
72
|
+
this.renameVariableWithConflict_(variable, newName, conflictVar, blocks);
|
|
73
|
+
}
|
|
74
|
+
} finally {
|
|
75
|
+
Blockly.Events.setGroup(false);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Rename a variable by updating its name in the variable map. Identify the
|
|
81
|
+
* variable to rename with the given ID.
|
|
82
|
+
* @param {string} id ID of the variable to rename.
|
|
83
|
+
* @param {string} newName New variable name.
|
|
84
|
+
*/
|
|
85
|
+
Blockly.VariableMap.prototype.renameVariableById = function(id, newName) {
|
|
86
|
+
var variable = this.getVariableById(id);
|
|
87
|
+
if (!variable) {
|
|
88
|
+
throw Error('Tried to rename a variable that didn\'t exist. ID: ' + id);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.renameVariable(variable, newName);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Update the name of the given variable and refresh all references to it.
|
|
96
|
+
* The new name must not conflict with any existing variable names.
|
|
97
|
+
* @param {!Blockly.VariableModel} variable Variable to rename.
|
|
98
|
+
* @param {string} newName New variable name.
|
|
99
|
+
* @param {!Array.<!Blockly.Block>} blocks The list of all blocks in the
|
|
100
|
+
* workspace.
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
Blockly.VariableMap.prototype.renameVariableAndUses_ = function(variable,
|
|
104
|
+
newName, blocks) {
|
|
105
|
+
Blockly.Events.fire(new Blockly.Events.VarRename(variable, newName));
|
|
106
|
+
variable.name = newName;
|
|
107
|
+
for (var i = 0; i < blocks.length; i++) {
|
|
108
|
+
blocks[i].updateVarName(variable);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Update the name of the given variable to the same name as an existing
|
|
114
|
+
* variable. The two variables are coalesced into a single variable with the ID
|
|
115
|
+
* of the existing variable that was already using newName.
|
|
116
|
+
* Refresh all references to the variable.
|
|
117
|
+
* @param {!Blockly.VariableModel} variable Variable to rename.
|
|
118
|
+
* @param {string} newName New variable name.
|
|
119
|
+
* @param {!Blockly.VariableModel} conflictVar The variable that was already
|
|
120
|
+
* using newName.
|
|
121
|
+
* @param {!Array.<!Blockly.Block>} blocks The list of all blocks in the
|
|
122
|
+
* workspace.
|
|
123
|
+
* @private
|
|
124
|
+
*/
|
|
125
|
+
Blockly.VariableMap.prototype.renameVariableWithConflict_ = function(variable,
|
|
126
|
+
newName, conflictVar, blocks) {
|
|
127
|
+
var type = variable.type;
|
|
128
|
+
var oldCase = conflictVar.name;
|
|
129
|
+
|
|
130
|
+
if (newName != oldCase) {
|
|
131
|
+
// Simple rename to change the case and update references.
|
|
132
|
+
this.renameVariableAndUses_(conflictVar, newName, blocks);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// These blocks now refer to a different variable.
|
|
136
|
+
// These will fire change events.
|
|
137
|
+
for (var i = 0; i < blocks.length; i++) {
|
|
138
|
+
blocks[i].renameVarById(variable.getId(), conflictVar.getId());
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Finally delete the original variable, which is now unreferenced.
|
|
142
|
+
Blockly.Events.fire(new Blockly.Events.VarDelete(variable));
|
|
143
|
+
// And remove it from the list.
|
|
144
|
+
var variableList = this.getVariablesOfType(type);
|
|
145
|
+
var variableIndex = variableList.indexOf(variable);
|
|
146
|
+
this.variableMap_[type].splice(variableIndex, 1);
|
|
147
|
+
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/* End functions for renaming variables. */
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Create a variable with a given name, optional type, and optional ID.
|
|
154
|
+
* @param {string} name The name of the variable. This must be unique across
|
|
155
|
+
* variables and procedures.
|
|
156
|
+
* @param {?string=} opt_type The type of the variable like 'int' or 'string'.
|
|
157
|
+
* Does not need to be unique. Field_variable can filter variables based on
|
|
158
|
+
* their type. This will default to '' which is a specific type.
|
|
159
|
+
* @param {?string=} opt_id The unique ID of the variable. This will default to
|
|
160
|
+
* a UUID.
|
|
161
|
+
* @return {!Blockly.VariableModel} The newly created variable.
|
|
162
|
+
*/
|
|
163
|
+
Blockly.VariableMap.prototype.createVariable = function(name,
|
|
164
|
+
opt_type, opt_id) {
|
|
165
|
+
var variable = this.getVariable(name, opt_type);
|
|
166
|
+
if (variable) {
|
|
167
|
+
if (opt_id && variable.getId() != opt_id) {
|
|
168
|
+
throw Error('Variable "' + name + '" is already in use and its id is "' +
|
|
169
|
+
variable.getId() + '" which conflicts with the passed in ' +
|
|
170
|
+
'id, "' + opt_id + '".');
|
|
171
|
+
}
|
|
172
|
+
// The variable already exists and has the same ID.
|
|
173
|
+
return variable;
|
|
174
|
+
}
|
|
175
|
+
if (opt_id && this.getVariableById(opt_id)) {
|
|
176
|
+
throw Error('Variable id, "' + opt_id + '", is already in use.');
|
|
177
|
+
}
|
|
178
|
+
var id = opt_id || Blockly.utils.genUid();
|
|
179
|
+
var type = opt_type || '';
|
|
180
|
+
variable = new Blockly.VariableModel(this.workspace, name, type, id);
|
|
181
|
+
|
|
182
|
+
var variables = this.variableMap_[type] || [];
|
|
183
|
+
variables.push(variable);
|
|
184
|
+
// Delete the list of variables of this type, and re-add it so that
|
|
185
|
+
// the most recent addition is at the end.
|
|
186
|
+
// This is used so the toolbox's set block is set to the most recent variable.
|
|
187
|
+
delete this.variableMap_[type];
|
|
188
|
+
this.variableMap_[type] = variables;
|
|
189
|
+
|
|
190
|
+
return variable;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/* Begin functions for variable deletion. */
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Delete a variable.
|
|
197
|
+
* @param {!Blockly.VariableModel} variable Variable to delete.
|
|
198
|
+
*/
|
|
199
|
+
Blockly.VariableMap.prototype.deleteVariable = function(variable) {
|
|
200
|
+
var variableList = this.variableMap_[variable.type];
|
|
201
|
+
for (var i = 0, tempVar; (tempVar = variableList[i]); i++) {
|
|
202
|
+
if (tempVar.getId() == variable.getId()) {
|
|
203
|
+
variableList.splice(i, 1);
|
|
204
|
+
Blockly.Events.fire(new Blockly.Events.VarDelete(variable));
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Delete a variables by the passed in ID and all of its uses from this
|
|
212
|
+
* workspace. May prompt the user for confirmation.
|
|
213
|
+
* @param {string} id ID of variable to delete.
|
|
214
|
+
*/
|
|
215
|
+
Blockly.VariableMap.prototype.deleteVariableById = function(id) {
|
|
216
|
+
var variable = this.getVariableById(id);
|
|
217
|
+
if (variable) {
|
|
218
|
+
// Check whether this variable is a function parameter before deleting.
|
|
219
|
+
var variableName = variable.name;
|
|
220
|
+
var uses = this.getVariableUsesById(id);
|
|
221
|
+
for (var i = 0, block; (block = uses[i]); i++) {
|
|
222
|
+
if (block.type == 'procedures_defnoreturn' ||
|
|
223
|
+
block.type == 'procedures_defreturn') {
|
|
224
|
+
var procedureName = block.getFieldValue('NAME');
|
|
225
|
+
var deleteText = Blockly.Msg['CANNOT_DELETE_VARIABLE_PROCEDURE'].
|
|
226
|
+
replace('%1', variableName).
|
|
227
|
+
replace('%2', procedureName);
|
|
228
|
+
Blockly.alert(deleteText);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
var map = this;
|
|
234
|
+
if (uses.length > 1) {
|
|
235
|
+
// Confirm before deleting multiple blocks.
|
|
236
|
+
var confirmText = Blockly.Msg['DELETE_VARIABLE_CONFIRMATION'].
|
|
237
|
+
replace('%1', String(uses.length)).
|
|
238
|
+
replace('%2', variableName);
|
|
239
|
+
Blockly.confirm(confirmText,
|
|
240
|
+
function(ok) {
|
|
241
|
+
if (ok && variable) {
|
|
242
|
+
map.deleteVariableInternal(variable, uses);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
// No confirmation necessary for a single block.
|
|
247
|
+
map.deleteVariableInternal(variable, uses);
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
console.warn("Can't delete non-existent variable: " + id);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Deletes a variable and all of its uses from this workspace without asking the
|
|
256
|
+
* user for confirmation.
|
|
257
|
+
* @param {!Blockly.VariableModel} variable Variable to delete.
|
|
258
|
+
* @param {!Array.<!Blockly.Block>} uses An array of uses of the variable.
|
|
259
|
+
* @package
|
|
260
|
+
*/
|
|
261
|
+
Blockly.VariableMap.prototype.deleteVariableInternal = function(variable,
|
|
262
|
+
uses) {
|
|
263
|
+
var existingGroup = Blockly.Events.getGroup();
|
|
264
|
+
if (!existingGroup) {
|
|
265
|
+
Blockly.Events.setGroup(true);
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
for (var i = 0; i < uses.length; i++) {
|
|
269
|
+
uses[i].dispose(true);
|
|
270
|
+
}
|
|
271
|
+
this.deleteVariable(variable);
|
|
272
|
+
} finally {
|
|
273
|
+
if (!existingGroup) {
|
|
274
|
+
Blockly.Events.setGroup(false);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/* End functions for variable deletion. */
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Find the variable by the given name and type and return it. Return null if
|
|
283
|
+
* it is not found.
|
|
284
|
+
* @param {string} name The name to check for.
|
|
285
|
+
* @param {?string=} opt_type The type of the variable. If not provided it
|
|
286
|
+
* defaults to the empty string, which is a specific type.
|
|
287
|
+
* @return {Blockly.VariableModel} The variable with the given name, or null if
|
|
288
|
+
* it was not found.
|
|
289
|
+
*/
|
|
290
|
+
Blockly.VariableMap.prototype.getVariable = function(name, opt_type) {
|
|
291
|
+
var type = opt_type || '';
|
|
292
|
+
var list = this.variableMap_[type];
|
|
293
|
+
if (list) {
|
|
294
|
+
for (var j = 0, variable; (variable = list[j]); j++) {
|
|
295
|
+
if (Blockly.Names.equals(variable.name, name)) {
|
|
296
|
+
return variable;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Find the variable by the given ID and return it. Return null if it is not
|
|
305
|
+
* found.
|
|
306
|
+
* @param {string} id The ID to check for.
|
|
307
|
+
* @return {Blockly.VariableModel} The variable with the given ID.
|
|
308
|
+
*/
|
|
309
|
+
Blockly.VariableMap.prototype.getVariableById = function(id) {
|
|
310
|
+
var keys = Object.keys(this.variableMap_);
|
|
311
|
+
for (var i = 0; i < keys.length; i++ ) {
|
|
312
|
+
var key = keys[i];
|
|
313
|
+
for (var j = 0, variable; (variable = this.variableMap_[key][j]); j++) {
|
|
314
|
+
if (variable.getId() == id) {
|
|
315
|
+
return variable;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return null;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Get a list containing all of the variables of a specified type. If type is
|
|
324
|
+
* null, return list of variables with empty string type.
|
|
325
|
+
* @param {?string} type Type of the variables to find.
|
|
326
|
+
* @return {!Array.<!Blockly.VariableModel>} The sought after variables of the
|
|
327
|
+
* passed in type. An empty array if none are found.
|
|
328
|
+
*/
|
|
329
|
+
Blockly.VariableMap.prototype.getVariablesOfType = function(type) {
|
|
330
|
+
type = type || '';
|
|
331
|
+
var variable_list = this.variableMap_[type];
|
|
332
|
+
if (variable_list) {
|
|
333
|
+
return variable_list.slice();
|
|
334
|
+
}
|
|
335
|
+
return [];
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Return all variable and potential variable types. This list always contains
|
|
340
|
+
* the empty string.
|
|
341
|
+
* @param {?Blockly.Workspace} ws The workspace used to look for potential
|
|
342
|
+
* variables. This can be different than the workspace stored on this object
|
|
343
|
+
* if the passed in ws is a flyout workspace.
|
|
344
|
+
* @return {!Array.<string>} List of variable types.
|
|
345
|
+
* @package
|
|
346
|
+
*/
|
|
347
|
+
Blockly.VariableMap.prototype.getVariableTypes = function(ws) {
|
|
348
|
+
var variableMap = {};
|
|
349
|
+
Blockly.utils.object.mixin(variableMap, this.variableMap_);
|
|
350
|
+
if (ws && ws.getPotentialVariableMap()) {
|
|
351
|
+
Blockly.utils.object.mixin(variableMap,
|
|
352
|
+
ws.getPotentialVariableMap().variableMap_);
|
|
353
|
+
}
|
|
354
|
+
var types = Object.keys(variableMap);
|
|
355
|
+
var hasEmpty = false;
|
|
356
|
+
for (var i = 0; i < types.length; i++) {
|
|
357
|
+
if (types[i] == '') {
|
|
358
|
+
hasEmpty = true;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (!hasEmpty) {
|
|
362
|
+
types.push('');
|
|
363
|
+
}
|
|
364
|
+
return types;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Return all variables of all types.
|
|
369
|
+
* @return {!Array.<!Blockly.VariableModel>} List of variable models.
|
|
370
|
+
*/
|
|
371
|
+
Blockly.VariableMap.prototype.getAllVariables = function() {
|
|
372
|
+
var all_variables = [];
|
|
373
|
+
for (var key in this.variableMap_) {
|
|
374
|
+
all_variables = all_variables.concat(this.variableMap_[key]);
|
|
375
|
+
}
|
|
376
|
+
return all_variables;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Returns all of the variable names of all types.
|
|
381
|
+
* @return {!Array.<string>} All of the variable names of all types.
|
|
382
|
+
*/
|
|
383
|
+
Blockly.VariableMap.prototype.getAllVariableNames = function() {
|
|
384
|
+
var allNames = [];
|
|
385
|
+
for (var key in this.variableMap_) {
|
|
386
|
+
var variables = this.variableMap_[key];
|
|
387
|
+
for (var i = 0, variable; (variable = variables[i]); i++) {
|
|
388
|
+
allNames.push(variable.name);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return allNames;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Find all the uses of a named variable.
|
|
396
|
+
* @param {string} id ID of the variable to find.
|
|
397
|
+
* @return {!Array.<!Blockly.Block>} Array of block usages.
|
|
398
|
+
*/
|
|
399
|
+
Blockly.VariableMap.prototype.getVariableUsesById = function(id) {
|
|
400
|
+
var uses = [];
|
|
401
|
+
var blocks = this.workspace.getAllBlocks(false);
|
|
402
|
+
// Iterate through every block and check the name.
|
|
403
|
+
for (var i = 0; i < blocks.length; i++) {
|
|
404
|
+
var blockVariables = blocks[i].getVarModels();
|
|
405
|
+
if (blockVariables) {
|
|
406
|
+
for (var j = 0; j < blockVariables.length; j++) {
|
|
407
|
+
if (blockVariables[j].getId() == id) {
|
|
408
|
+
uses.push(blocks[i]);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return uses;
|
|
414
|
+
};
|