nodeskini 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +4 -3
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2012 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Variable input field.
|
|
9
|
+
* @author fraser@google.com (Neil Fraser)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.FieldVariable');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.Events');
|
|
16
|
+
goog.require('Blockly.Events.BlockChange');
|
|
17
|
+
goog.require('Blockly.FieldDropdown');
|
|
18
|
+
goog.require('Blockly.fieldRegistry');
|
|
19
|
+
goog.require('Blockly.Msg');
|
|
20
|
+
goog.require('Blockly.utils');
|
|
21
|
+
goog.require('Blockly.utils.object');
|
|
22
|
+
goog.require('Blockly.utils.Size');
|
|
23
|
+
goog.require('Blockly.VariableModel');
|
|
24
|
+
goog.require('Blockly.Variables');
|
|
25
|
+
goog.require('Blockly.Xml');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Class for a variable's dropdown field.
|
|
31
|
+
* @param {?string} varName The default name for the variable. If null,
|
|
32
|
+
* a unique variable name will be generated.
|
|
33
|
+
* @param {Function=} opt_validator A function that is called to validate
|
|
34
|
+
* changes to the field's value. Takes in a variable ID & returns a
|
|
35
|
+
* validated variable ID, or null to abort the change.
|
|
36
|
+
* @param {Array.<string>=} opt_variableTypes A list of the types of variables
|
|
37
|
+
* to include in the dropdown.
|
|
38
|
+
* @param {string=} opt_defaultType The type of variable to create if this
|
|
39
|
+
* field's value is not explicitly set. Defaults to ''.
|
|
40
|
+
* @param {Object=} opt_config A map of options used to configure the field.
|
|
41
|
+
* See the [field creation documentation]{@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/variable#creation}
|
|
42
|
+
* for a list of properties this parameter supports.
|
|
43
|
+
* @extends {Blockly.FieldDropdown}
|
|
44
|
+
* @constructor
|
|
45
|
+
*/
|
|
46
|
+
Blockly.FieldVariable = function(varName, opt_validator, opt_variableTypes,
|
|
47
|
+
opt_defaultType, opt_config) {
|
|
48
|
+
// The FieldDropdown constructor expects the field's initial value to be
|
|
49
|
+
// the first entry in the menu generator, which it may or may not be.
|
|
50
|
+
// Just do the relevant parts of the constructor.
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* An array of options for a dropdown list,
|
|
54
|
+
* or a function which generates these options.
|
|
55
|
+
* @type {(!Array.<!Array>|
|
|
56
|
+
* !function(this:Blockly.FieldDropdown): !Array.<!Array>)}
|
|
57
|
+
* @protected
|
|
58
|
+
*/
|
|
59
|
+
this.menuGenerator_ = Blockly.FieldVariable.dropdownCreate;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The initial variable name passed to this field's constructor, or an
|
|
63
|
+
* empty string if a name wasn't provided. Used to create the initial
|
|
64
|
+
* variable.
|
|
65
|
+
* @type {string}
|
|
66
|
+
*/
|
|
67
|
+
this.defaultVariableName = varName || '';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The size of the area rendered by the field.
|
|
71
|
+
* @type {Blockly.utils.Size}
|
|
72
|
+
* @protected
|
|
73
|
+
* @override
|
|
74
|
+
*/
|
|
75
|
+
this.size_ = new Blockly.utils.Size(0, 0);
|
|
76
|
+
|
|
77
|
+
opt_config && this.configure_(opt_config);
|
|
78
|
+
opt_validator && this.setValidator(opt_validator);
|
|
79
|
+
|
|
80
|
+
if (!opt_config) { // Only do one kind of configuration or the other.
|
|
81
|
+
this.setTypes_(opt_variableTypes, opt_defaultType);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
Blockly.utils.object.inherits(Blockly.FieldVariable, Blockly.FieldDropdown);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Construct a FieldVariable from a JSON arg object,
|
|
88
|
+
* dereferencing any string table references.
|
|
89
|
+
* @param {!Object} options A JSON object with options (variable,
|
|
90
|
+
* variableTypes, and defaultType).
|
|
91
|
+
* @return {!Blockly.FieldVariable} The new field instance.
|
|
92
|
+
* @package
|
|
93
|
+
* @nocollapse
|
|
94
|
+
*/
|
|
95
|
+
Blockly.FieldVariable.fromJson = function(options) {
|
|
96
|
+
var varName = Blockly.utils.replaceMessageReferences(options['variable']);
|
|
97
|
+
return new Blockly.FieldVariable(
|
|
98
|
+
varName, undefined, undefined, undefined, options);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Serializable fields are saved by the XML renderer, non-serializable fields
|
|
103
|
+
* are not. Editable fields should also be serializable.
|
|
104
|
+
* @type {boolean}
|
|
105
|
+
*/
|
|
106
|
+
Blockly.FieldVariable.prototype.SERIALIZABLE = true;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Configure the field based on the given map of options.
|
|
110
|
+
* @param {!Object} config A map of options to configure the field based on.
|
|
111
|
+
* @protected
|
|
112
|
+
*/
|
|
113
|
+
Blockly.FieldVariable.prototype.configure_ = function(config) {
|
|
114
|
+
Blockly.FieldVariable.superClass_.configure_.call(this, config);
|
|
115
|
+
this.setTypes_(config['variableTypes'], config['defaultType']);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Initialize the model for this field if it has not already been initialized.
|
|
120
|
+
* If the value has not been set to a variable by the first render, we make up a
|
|
121
|
+
* variable rather than let the value be invalid.
|
|
122
|
+
* @package
|
|
123
|
+
*/
|
|
124
|
+
Blockly.FieldVariable.prototype.initModel = function() {
|
|
125
|
+
if (this.variable_) {
|
|
126
|
+
return; // Initialization already happened.
|
|
127
|
+
}
|
|
128
|
+
var variable = Blockly.Variables.getOrCreateVariablePackage(
|
|
129
|
+
this.sourceBlock_.workspace, null,
|
|
130
|
+
this.defaultVariableName, this.defaultType_);
|
|
131
|
+
|
|
132
|
+
// Don't call setValue because we don't want to cause a rerender.
|
|
133
|
+
this.doValueUpdate_(variable.getId());
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @override
|
|
138
|
+
*/
|
|
139
|
+
Blockly.FieldVariable.prototype.shouldAddBorderRect_ = function() {
|
|
140
|
+
return Blockly.FieldVariable.superClass_.shouldAddBorderRect_.call(this) &&
|
|
141
|
+
(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW ||
|
|
142
|
+
this.sourceBlock_.type != 'variables_get');
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Initialize this field based on the given XML.
|
|
147
|
+
* @param {!Element} fieldElement The element containing information about the
|
|
148
|
+
* variable field's state.
|
|
149
|
+
*/
|
|
150
|
+
Blockly.FieldVariable.prototype.fromXml = function(fieldElement) {
|
|
151
|
+
var id = fieldElement.getAttribute('id');
|
|
152
|
+
var variableName = fieldElement.textContent;
|
|
153
|
+
// 'variabletype' should be lowercase, but until July 2019 it was sometimes
|
|
154
|
+
// recorded as 'variableType'. Thus we need to check for both.
|
|
155
|
+
var variableType = fieldElement.getAttribute('variabletype') ||
|
|
156
|
+
fieldElement.getAttribute('variableType') || '';
|
|
157
|
+
|
|
158
|
+
var variable = Blockly.Variables.getOrCreateVariablePackage(
|
|
159
|
+
this.sourceBlock_.workspace, id, variableName, variableType);
|
|
160
|
+
|
|
161
|
+
// This should never happen :)
|
|
162
|
+
if (variableType != null && variableType !== variable.type) {
|
|
163
|
+
throw Error('Serialized variable type with id \'' +
|
|
164
|
+
variable.getId() + '\' had type ' + variable.type + ', and ' +
|
|
165
|
+
'does not match variable field that references it: ' +
|
|
166
|
+
Blockly.Xml.domToText(fieldElement) + '.');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.setValue(variable.getId());
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Serialize this field to XML.
|
|
174
|
+
* @param {!Element} fieldElement The element to populate with info about the
|
|
175
|
+
* field's state.
|
|
176
|
+
* @return {!Element} The element containing info about the field's state.
|
|
177
|
+
*/
|
|
178
|
+
Blockly.FieldVariable.prototype.toXml = function(fieldElement) {
|
|
179
|
+
// Make sure the variable is initialized.
|
|
180
|
+
this.initModel();
|
|
181
|
+
|
|
182
|
+
fieldElement.id = this.variable_.getId();
|
|
183
|
+
fieldElement.textContent = this.variable_.name;
|
|
184
|
+
if (this.variable_.type) {
|
|
185
|
+
fieldElement.setAttribute('variabletype', this.variable_.type);
|
|
186
|
+
}
|
|
187
|
+
return fieldElement;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Attach this field to a block.
|
|
192
|
+
* @param {!Blockly.Block} block The block containing this field.
|
|
193
|
+
*/
|
|
194
|
+
Blockly.FieldVariable.prototype.setSourceBlock = function(block) {
|
|
195
|
+
if (block.isShadow()) {
|
|
196
|
+
throw Error('Variable fields are not allowed to exist on shadow blocks.');
|
|
197
|
+
}
|
|
198
|
+
Blockly.FieldVariable.superClass_.setSourceBlock.call(this, block);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Get the variable's ID.
|
|
203
|
+
* @return {string} Current variable's ID.
|
|
204
|
+
*/
|
|
205
|
+
Blockly.FieldVariable.prototype.getValue = function() {
|
|
206
|
+
return this.variable_ ? this.variable_.getId() : null;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Get the text from this field, which is the selected variable's name.
|
|
211
|
+
* @return {string} The selected variable's name, or the empty string if no
|
|
212
|
+
* variable is selected.
|
|
213
|
+
*/
|
|
214
|
+
Blockly.FieldVariable.prototype.getText = function() {
|
|
215
|
+
return this.variable_ ? this.variable_.name : '';
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Get the variable model for the selected variable.
|
|
220
|
+
* Not guaranteed to be in the variable map on the workspace (e.g. if accessed
|
|
221
|
+
* after the variable has been deleted).
|
|
222
|
+
* @return {Blockly.VariableModel} The selected variable, or null if none was
|
|
223
|
+
* selected.
|
|
224
|
+
* @package
|
|
225
|
+
*/
|
|
226
|
+
Blockly.FieldVariable.prototype.getVariable = function() {
|
|
227
|
+
return this.variable_;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Gets the validation function for this field, or null if not set.
|
|
232
|
+
* Returns null if the variable is not set, because validators should not
|
|
233
|
+
* run on the initial setValue call, because the field won't be attached to
|
|
234
|
+
* a block and workspace at that point.
|
|
235
|
+
* @return {Function} Validation function, or null.
|
|
236
|
+
*/
|
|
237
|
+
Blockly.FieldVariable.prototype.getValidator = function() {
|
|
238
|
+
// Validators shouldn't operate on the initial setValue call.
|
|
239
|
+
// Normally this is achieved by calling setValidator after setValue, but
|
|
240
|
+
// this is not a possibility with variable fields.
|
|
241
|
+
if (this.variable_) {
|
|
242
|
+
return this.validator_;
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Ensure that the id belongs to a valid variable of an allowed type.
|
|
249
|
+
* @param {*=} opt_newValue The id of the new variable to set.
|
|
250
|
+
* @return {?string} The validated id, or null if invalid.
|
|
251
|
+
* @protected
|
|
252
|
+
*/
|
|
253
|
+
Blockly.FieldVariable.prototype.doClassValidation_ = function(opt_newValue) {
|
|
254
|
+
if (opt_newValue === null) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
var newId = /** @type {string} */ (opt_newValue);
|
|
258
|
+
var variable = Blockly.Variables.getVariable(
|
|
259
|
+
this.sourceBlock_.workspace, newId);
|
|
260
|
+
if (!variable) {
|
|
261
|
+
console.warn('Variable id doesn\'t point to a real variable! ' +
|
|
262
|
+
'ID was ' + newId);
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
// Type Checks.
|
|
266
|
+
var type = variable.type;
|
|
267
|
+
if (!this.typeIsAllowed_(type)) {
|
|
268
|
+
console.warn('Variable type doesn\'t match this field! Type was ' + type);
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
return newId;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Update the value of this variable field, as well as its variable and text.
|
|
276
|
+
*
|
|
277
|
+
* The variable ID should be valid at this point, but if a variable field
|
|
278
|
+
* validator returns a bad ID, this could break.
|
|
279
|
+
* @param {*} newId The value to be saved.
|
|
280
|
+
* @protected
|
|
281
|
+
*/
|
|
282
|
+
Blockly.FieldVariable.prototype.doValueUpdate_ = function(newId) {
|
|
283
|
+
this.variable_ = Blockly.Variables.getVariable(
|
|
284
|
+
this.sourceBlock_.workspace, /** @type {string} */ (newId));
|
|
285
|
+
Blockly.FieldVariable.superClass_.doValueUpdate_.call(this, newId);
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Check whether the given variable type is allowed on this field.
|
|
290
|
+
* @param {string} type The type to check.
|
|
291
|
+
* @return {boolean} True if the type is in the list of allowed types.
|
|
292
|
+
* @private
|
|
293
|
+
*/
|
|
294
|
+
Blockly.FieldVariable.prototype.typeIsAllowed_ = function(type) {
|
|
295
|
+
var typeList = this.getVariableTypes_();
|
|
296
|
+
if (!typeList) {
|
|
297
|
+
return true; // If it's null, all types are valid.
|
|
298
|
+
}
|
|
299
|
+
for (var i = 0; i < typeList.length; i++) {
|
|
300
|
+
if (type == typeList[i]) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return false;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Return a list of variable types to include in the dropdown.
|
|
309
|
+
* @return {!Array.<string>} Array of variable types.
|
|
310
|
+
* @throws {Error} if variableTypes is an empty array.
|
|
311
|
+
* @private
|
|
312
|
+
*/
|
|
313
|
+
Blockly.FieldVariable.prototype.getVariableTypes_ = function() {
|
|
314
|
+
// TODO (#1513): Try to avoid calling this every time the field is edited.
|
|
315
|
+
var variableTypes = this.variableTypes;
|
|
316
|
+
if (variableTypes === null) {
|
|
317
|
+
// If variableTypes is null, return all variable types.
|
|
318
|
+
if (this.sourceBlock_ && this.sourceBlock_.workspace) {
|
|
319
|
+
return this.sourceBlock_.workspace.getVariableTypes();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
variableTypes = variableTypes || [''];
|
|
323
|
+
if (variableTypes.length == 0) {
|
|
324
|
+
// Throw an error if variableTypes is an empty list.
|
|
325
|
+
var name = this.getText();
|
|
326
|
+
throw Error('\'variableTypes\' of field variable ' +
|
|
327
|
+
name + ' was an empty list');
|
|
328
|
+
}
|
|
329
|
+
return variableTypes;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Parse the optional arguments representing the allowed variable types and the
|
|
334
|
+
* default variable type.
|
|
335
|
+
* @param {Array.<string>=} opt_variableTypes A list of the types of variables
|
|
336
|
+
* to include in the dropdown. If null or undefined, variables of all types
|
|
337
|
+
* will be displayed in the dropdown.
|
|
338
|
+
* @param {string=} opt_defaultType The type of the variable to create if this
|
|
339
|
+
* field's value is not explicitly set. Defaults to ''.
|
|
340
|
+
* @private
|
|
341
|
+
*/
|
|
342
|
+
Blockly.FieldVariable.prototype.setTypes_ = function(opt_variableTypes,
|
|
343
|
+
opt_defaultType) {
|
|
344
|
+
// If you expected that the default type would be the same as the only entry
|
|
345
|
+
// in the variable types array, tell the Blockly team by commenting on #1499.
|
|
346
|
+
var defaultType = opt_defaultType || '';
|
|
347
|
+
// Set the allowable variable types. Null means all types on the workspace.
|
|
348
|
+
if (opt_variableTypes == null || opt_variableTypes == undefined) {
|
|
349
|
+
var variableTypes = null;
|
|
350
|
+
} else if (Array.isArray(opt_variableTypes)) {
|
|
351
|
+
var variableTypes = opt_variableTypes;
|
|
352
|
+
// Make sure the default type is valid.
|
|
353
|
+
var isInArray = false;
|
|
354
|
+
for (var i = 0; i < variableTypes.length; i++) {
|
|
355
|
+
if (variableTypes[i] == defaultType) {
|
|
356
|
+
isInArray = true;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (!isInArray) {
|
|
360
|
+
throw Error('Invalid default type \'' + defaultType + '\' in ' +
|
|
361
|
+
'the definition of a FieldVariable');
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
throw Error('\'variableTypes\' was not an array in the definition of ' +
|
|
365
|
+
'a FieldVariable');
|
|
366
|
+
}
|
|
367
|
+
// Only update the field once all checks pass.
|
|
368
|
+
this.defaultType_ = defaultType;
|
|
369
|
+
this.variableTypes = variableTypes;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Refreshes the name of the variable by grabbing the name of the model.
|
|
374
|
+
* Used when a variable gets renamed, but the ID stays the same. Should only
|
|
375
|
+
* be called by the block.
|
|
376
|
+
* @package
|
|
377
|
+
*/
|
|
378
|
+
Blockly.FieldVariable.prototype.refreshVariableName = function() {
|
|
379
|
+
this.forceRerender();
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Return a sorted list of variable names for variable dropdown menus.
|
|
384
|
+
* Include a special option at the end for creating a new variable name.
|
|
385
|
+
* @return {!Array.<!Array>} Array of variable names/id tuples.
|
|
386
|
+
* @this {Blockly.FieldVariable}
|
|
387
|
+
*/
|
|
388
|
+
Blockly.FieldVariable.dropdownCreate = function() {
|
|
389
|
+
if (!this.variable_) {
|
|
390
|
+
throw Error('Tried to call dropdownCreate on a variable field with no' +
|
|
391
|
+
' variable selected.');
|
|
392
|
+
}
|
|
393
|
+
var name = this.getText();
|
|
394
|
+
var variableModelList = [];
|
|
395
|
+
if (this.sourceBlock_ && this.sourceBlock_.workspace) {
|
|
396
|
+
var variableTypes = this.getVariableTypes_();
|
|
397
|
+
// Get a copy of the list, so that adding rename and new variable options
|
|
398
|
+
// doesn't modify the workspace's list.
|
|
399
|
+
for (var i = 0; i < variableTypes.length; i++) {
|
|
400
|
+
var variableType = variableTypes[i];
|
|
401
|
+
var variables =
|
|
402
|
+
this.sourceBlock_.workspace.getVariablesOfType(variableType);
|
|
403
|
+
variableModelList = variableModelList.concat(variables);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
variableModelList.sort(Blockly.VariableModel.compareByName);
|
|
407
|
+
|
|
408
|
+
var options = [];
|
|
409
|
+
for (var i = 0; i < variableModelList.length; i++) {
|
|
410
|
+
// Set the UUID as the internal representation of the variable.
|
|
411
|
+
options[i] = [variableModelList[i].name, variableModelList[i].getId()];
|
|
412
|
+
}
|
|
413
|
+
options.push([Blockly.Msg['RENAME_VARIABLE'], Blockly.RENAME_VARIABLE_ID]);
|
|
414
|
+
if (Blockly.Msg['DELETE_VARIABLE']) {
|
|
415
|
+
options.push(
|
|
416
|
+
[
|
|
417
|
+
Blockly.Msg['DELETE_VARIABLE'].replace('%1', name),
|
|
418
|
+
Blockly.DELETE_VARIABLE_ID
|
|
419
|
+
]
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return options;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Handle the selection of an item in the variable dropdown menu.
|
|
428
|
+
* Special case the 'Rename variable...' and 'Delete variable...' options.
|
|
429
|
+
* In the rename case, prompt the user for a new name.
|
|
430
|
+
* @param {!Blockly.Menu} menu The Menu component clicked.
|
|
431
|
+
* @param {!Blockly.MenuItem} menuItem The MenuItem selected within menu.
|
|
432
|
+
* @protected
|
|
433
|
+
*/
|
|
434
|
+
Blockly.FieldVariable.prototype.onItemSelected_ = function(menu, menuItem) {
|
|
435
|
+
var id = menuItem.getValue();
|
|
436
|
+
// Handle special cases.
|
|
437
|
+
if (this.sourceBlock_ && this.sourceBlock_.workspace) {
|
|
438
|
+
if (id == Blockly.RENAME_VARIABLE_ID) {
|
|
439
|
+
// Rename variable.
|
|
440
|
+
Blockly.Variables.renameVariable(
|
|
441
|
+
this.sourceBlock_.workspace, this.variable_);
|
|
442
|
+
return;
|
|
443
|
+
} else if (id == Blockly.DELETE_VARIABLE_ID) {
|
|
444
|
+
// Delete variable.
|
|
445
|
+
this.sourceBlock_.workspace.deleteVariableById(this.variable_.getId());
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
// Handle unspecial case.
|
|
450
|
+
this.setValue(id);
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Overrides referencesVariables(), indicating this field refers to a variable.
|
|
455
|
+
* @return {boolean} True.
|
|
456
|
+
* @package
|
|
457
|
+
* @override
|
|
458
|
+
*/
|
|
459
|
+
Blockly.FieldVariable.prototype.referencesVariables = function() {
|
|
460
|
+
return true;
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
Blockly.fieldRegistry.register('field_variable', Blockly.FieldVariable);
|