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,616 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2012 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Text input field.
|
|
9
|
+
* @author fraser@google.com (Neil Fraser)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.FieldTextInput');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.Events');
|
|
16
|
+
goog.require('Blockly.Events.BlockChange');
|
|
17
|
+
goog.require('Blockly.Field');
|
|
18
|
+
goog.require('Blockly.fieldRegistry');
|
|
19
|
+
goog.require('Blockly.Msg');
|
|
20
|
+
goog.require('Blockly.utils');
|
|
21
|
+
goog.require('Blockly.utils.aria');
|
|
22
|
+
goog.require('Blockly.utils.Coordinate');
|
|
23
|
+
goog.require('Blockly.utils.dom');
|
|
24
|
+
goog.require('Blockly.utils.KeyCodes');
|
|
25
|
+
goog.require('Blockly.utils.object');
|
|
26
|
+
goog.require('Blockly.utils.Size');
|
|
27
|
+
goog.require('Blockly.utils.userAgent');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Class for an editable text field.
|
|
32
|
+
* @param {string=} opt_value The initial value of the field. Should cast to a
|
|
33
|
+
* string. Defaults to an empty string if null or undefined.
|
|
34
|
+
* @param {?Function=} opt_validator A function that is called to validate
|
|
35
|
+
* changes to the field's value. Takes in a string & returns a validated
|
|
36
|
+
* string, or null to abort the change.
|
|
37
|
+
* @param {Object=} opt_config A map of options used to configure the field.
|
|
38
|
+
* See the [field creation documentation]{@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/text-input#creation}
|
|
39
|
+
* for a list of properties this parameter supports.
|
|
40
|
+
* @extends {Blockly.Field}
|
|
41
|
+
* @constructor
|
|
42
|
+
*/
|
|
43
|
+
Blockly.FieldTextInput = function(opt_value, opt_validator, opt_config) {
|
|
44
|
+
/**
|
|
45
|
+
* Allow browser to spellcheck this field.
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @protected
|
|
48
|
+
*/
|
|
49
|
+
this.spellcheck_ = true;
|
|
50
|
+
|
|
51
|
+
Blockly.FieldTextInput.superClass_.constructor.call(this,
|
|
52
|
+
opt_value, opt_validator, opt_config);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The HTML input element.
|
|
56
|
+
* @type {HTMLElement}
|
|
57
|
+
*/
|
|
58
|
+
this.htmlInput_ = null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Key down event data.
|
|
62
|
+
* @type {?Blockly.EventData}
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
this.onKeyDownWrapper_ = null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Key input event data.
|
|
69
|
+
* @type {?Blockly.EventData}
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
this.onKeyInputWrapper_ = null;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Whether the field should consider the whole parent block to be its click
|
|
76
|
+
* target.
|
|
77
|
+
* @type {?boolean}
|
|
78
|
+
*/
|
|
79
|
+
this.fullBlockClickTarget_ = false;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The workspace that this field belongs to.
|
|
83
|
+
* @type {?Blockly.WorkspaceSvg}
|
|
84
|
+
* @protected
|
|
85
|
+
*/
|
|
86
|
+
this.workspace_ = null;
|
|
87
|
+
};
|
|
88
|
+
Blockly.utils.object.inherits(Blockly.FieldTextInput, Blockly.Field);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The default value for this field.
|
|
92
|
+
* @type {*}
|
|
93
|
+
* @protected
|
|
94
|
+
*/
|
|
95
|
+
Blockly.FieldTextInput.prototype.DEFAULT_VALUE = '';
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Construct a FieldTextInput from a JSON arg object,
|
|
99
|
+
* dereferencing any string table references.
|
|
100
|
+
* @param {!Object} options A JSON object with options (text, and spellcheck).
|
|
101
|
+
* @return {!Blockly.FieldTextInput} The new field instance.
|
|
102
|
+
* @package
|
|
103
|
+
* @nocollapse
|
|
104
|
+
*/
|
|
105
|
+
Blockly.FieldTextInput.fromJson = function(options) {
|
|
106
|
+
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
|
107
|
+
return new Blockly.FieldTextInput(text, undefined, options);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Serializable fields are saved by the XML renderer, non-serializable fields
|
|
112
|
+
* are not. Editable fields should also be serializable.
|
|
113
|
+
* @type {boolean}
|
|
114
|
+
*/
|
|
115
|
+
Blockly.FieldTextInput.prototype.SERIALIZABLE = true;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Pixel size of input border radius.
|
|
119
|
+
* Should match blocklyText's border-radius in CSS.
|
|
120
|
+
*/
|
|
121
|
+
Blockly.FieldTextInput.BORDERRADIUS = 4;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Mouse cursor style when over the hotspot that initiates the editor.
|
|
125
|
+
*/
|
|
126
|
+
Blockly.FieldTextInput.prototype.CURSOR = 'text';
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @override
|
|
130
|
+
*/
|
|
131
|
+
Blockly.FieldTextInput.prototype.configure_ = function(config) {
|
|
132
|
+
Blockly.FieldTextInput.superClass_.configure_.call(this, config);
|
|
133
|
+
if (typeof config['spellcheck'] == 'boolean') {
|
|
134
|
+
this.spellcheck_ = config['spellcheck'];
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @override
|
|
140
|
+
*/
|
|
141
|
+
Blockly.FieldTextInput.prototype.initView = function() {
|
|
142
|
+
if (this.getConstants().FULL_BLOCK_FIELDS) {
|
|
143
|
+
// Step one: figure out if this is the only field on this block.
|
|
144
|
+
// Rendering is quite different in that case.
|
|
145
|
+
var nFields = 0;
|
|
146
|
+
var nConnections = 0;
|
|
147
|
+
|
|
148
|
+
// Count the number of fields, excluding text fields
|
|
149
|
+
for (var i = 0, input; (input = this.sourceBlock_.inputList[i]); i++) {
|
|
150
|
+
for (var j = 0; (input.fieldRow[j]); j++) {
|
|
151
|
+
nFields ++;
|
|
152
|
+
}
|
|
153
|
+
if (input.connection) {
|
|
154
|
+
nConnections++;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// The special case is when this is the only non-label field on the block
|
|
158
|
+
// and it has an output but no inputs.
|
|
159
|
+
this.fullBlockClickTarget_ =
|
|
160
|
+
nFields <= 1 && this.sourceBlock_.outputConnection && !nConnections;
|
|
161
|
+
} else {
|
|
162
|
+
this.fullBlockClickTarget_ = false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (this.fullBlockClickTarget_) {
|
|
166
|
+
this.clickTarget_ = this.sourceBlock_.getSvgRoot();
|
|
167
|
+
} else {
|
|
168
|
+
this.createBorderRect_();
|
|
169
|
+
}
|
|
170
|
+
this.createTextElement_();
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Ensure that the input value casts to a valid string.
|
|
175
|
+
* @param {*=} opt_newValue The input value.
|
|
176
|
+
* @return {*} A valid string, or null if invalid.
|
|
177
|
+
* @protected
|
|
178
|
+
*/
|
|
179
|
+
Blockly.FieldTextInput.prototype.doClassValidation_ = function(opt_newValue) {
|
|
180
|
+
if (opt_newValue === null || opt_newValue === undefined) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return String(opt_newValue);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Called by setValue if the text input is not valid. If the field is
|
|
188
|
+
* currently being edited it reverts value of the field to the previous
|
|
189
|
+
* value while allowing the display text to be handled by the htmlInput_.
|
|
190
|
+
* @param {*} _invalidValue The input value that was determined to be invalid.
|
|
191
|
+
* This is not used by the text input because its display value is stored on
|
|
192
|
+
* the htmlInput_.
|
|
193
|
+
* @protected
|
|
194
|
+
*/
|
|
195
|
+
Blockly.FieldTextInput.prototype.doValueInvalid_ = function(_invalidValue) {
|
|
196
|
+
if (this.isBeingEdited_) {
|
|
197
|
+
this.isTextValid_ = false;
|
|
198
|
+
var oldValue = this.value_;
|
|
199
|
+
// Revert value when the text becomes invalid.
|
|
200
|
+
this.value_ = this.htmlInput_.untypedDefaultValue_;
|
|
201
|
+
if (this.sourceBlock_ && Blockly.Events.isEnabled()) {
|
|
202
|
+
Blockly.Events.fire(new Blockly.Events.BlockChange(
|
|
203
|
+
this.sourceBlock_, 'field', this.name || null, oldValue, this.value_));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Called by setValue if the text input is valid. Updates the value of the
|
|
210
|
+
* field, and updates the text of the field if it is not currently being
|
|
211
|
+
* edited (i.e. handled by the htmlInput_).
|
|
212
|
+
* @param {*} newValue The value to be saved. The default validator guarantees
|
|
213
|
+
* that this is a string.
|
|
214
|
+
* @protected
|
|
215
|
+
*/
|
|
216
|
+
Blockly.FieldTextInput.prototype.doValueUpdate_ = function(newValue) {
|
|
217
|
+
this.isTextValid_ = true;
|
|
218
|
+
this.value_ = newValue;
|
|
219
|
+
if (!this.isBeingEdited_) {
|
|
220
|
+
// This should only occur if setValue is triggered programmatically.
|
|
221
|
+
this.isDirty_ = true;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Updates text field to match the colour/style of the block.
|
|
227
|
+
* @package
|
|
228
|
+
*/
|
|
229
|
+
Blockly.FieldTextInput.prototype.applyColour = function() {
|
|
230
|
+
if (this.sourceBlock_ && this.getConstants().FULL_BLOCK_FIELDS) {
|
|
231
|
+
if (this.borderRect_) {
|
|
232
|
+
this.borderRect_.setAttribute('stroke',
|
|
233
|
+
this.sourceBlock_.style.colourTertiary);
|
|
234
|
+
} else {
|
|
235
|
+
this.sourceBlock_.pathObject.svgPath.setAttribute('fill',
|
|
236
|
+
this.getConstants().FIELD_BORDER_RECT_COLOUR);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Updates the colour of the htmlInput given the current validity of the
|
|
243
|
+
* field's value.
|
|
244
|
+
* @protected
|
|
245
|
+
*/
|
|
246
|
+
Blockly.FieldTextInput.prototype.render_ = function() {
|
|
247
|
+
Blockly.FieldTextInput.superClass_.render_.call(this);
|
|
248
|
+
// This logic is done in render_ rather than doValueInvalid_ or
|
|
249
|
+
// doValueUpdate_ so that the code is more centralized.
|
|
250
|
+
if (this.isBeingEdited_) {
|
|
251
|
+
this.resizeEditor_();
|
|
252
|
+
var htmlInput = /** @type {!HTMLElement} */(this.htmlInput_);
|
|
253
|
+
if (!this.isTextValid_) {
|
|
254
|
+
Blockly.utils.dom.addClass(htmlInput, 'blocklyInvalidInput');
|
|
255
|
+
Blockly.utils.aria.setState(htmlInput,
|
|
256
|
+
Blockly.utils.aria.State.INVALID, true);
|
|
257
|
+
} else {
|
|
258
|
+
Blockly.utils.dom.removeClass(htmlInput, 'blocklyInvalidInput');
|
|
259
|
+
Blockly.utils.aria.setState(htmlInput,
|
|
260
|
+
Blockly.utils.aria.State.INVALID, false);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Set whether this field is spellchecked by the browser.
|
|
267
|
+
* @param {boolean} check True if checked.
|
|
268
|
+
*/
|
|
269
|
+
Blockly.FieldTextInput.prototype.setSpellcheck = function(check) {
|
|
270
|
+
if (check == this.spellcheck_) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
this.spellcheck_ = check;
|
|
274
|
+
if (this.htmlInput_) {
|
|
275
|
+
this.htmlInput_.setAttribute('spellcheck', this.spellcheck_);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Show the inline free-text editor on top of the text.
|
|
281
|
+
* @param {Event=} _opt_e Optional mouse event that triggered the field to open,
|
|
282
|
+
* or undefined if triggered programmatically.
|
|
283
|
+
* @param {boolean=} opt_quietInput True if editor should be created without
|
|
284
|
+
* focus. Defaults to false.
|
|
285
|
+
* @protected
|
|
286
|
+
*/
|
|
287
|
+
Blockly.FieldTextInput.prototype.showEditor_ = function(_opt_e,
|
|
288
|
+
opt_quietInput) {
|
|
289
|
+
this.workspace_ =
|
|
290
|
+
(/** @type {!Blockly.BlockSvg} */ (this.sourceBlock_)).workspace;
|
|
291
|
+
var quietInput = opt_quietInput || false;
|
|
292
|
+
if (!quietInput && (Blockly.utils.userAgent.MOBILE ||
|
|
293
|
+
Blockly.utils.userAgent.ANDROID ||
|
|
294
|
+
Blockly.utils.userAgent.IPAD)) {
|
|
295
|
+
this.showPromptEditor_();
|
|
296
|
+
} else {
|
|
297
|
+
this.showInlineEditor_(quietInput);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Create and show a text input editor that is a prompt (usually a popup).
|
|
303
|
+
* Mobile browsers have issues with in-line textareas (focus and keyboards).
|
|
304
|
+
* @private
|
|
305
|
+
*/
|
|
306
|
+
Blockly.FieldTextInput.prototype.showPromptEditor_ = function() {
|
|
307
|
+
var fieldText = this;
|
|
308
|
+
Blockly.prompt(Blockly.Msg['CHANGE_VALUE_TITLE'], this.getText(),
|
|
309
|
+
function(newValue) {
|
|
310
|
+
fieldText.setValue(newValue);
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Create and show a text input editor that sits directly over the text input.
|
|
316
|
+
* @param {boolean} quietInput True if editor should be created without
|
|
317
|
+
* focus.
|
|
318
|
+
* @private
|
|
319
|
+
*/
|
|
320
|
+
Blockly.FieldTextInput.prototype.showInlineEditor_ = function(quietInput) {
|
|
321
|
+
Blockly.WidgetDiv.show(
|
|
322
|
+
this, this.sourceBlock_.RTL, this.widgetDispose_.bind(this));
|
|
323
|
+
this.htmlInput_ = this.widgetCreate_();
|
|
324
|
+
this.isBeingEdited_ = true;
|
|
325
|
+
|
|
326
|
+
if (!quietInput) {
|
|
327
|
+
this.htmlInput_.focus({preventScroll:true});
|
|
328
|
+
this.htmlInput_.select();
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Create the text input editor widget.
|
|
334
|
+
* @return {!HTMLElement} The newly created text input editor.
|
|
335
|
+
* @protected
|
|
336
|
+
*/
|
|
337
|
+
Blockly.FieldTextInput.prototype.widgetCreate_ = function() {
|
|
338
|
+
var div = Blockly.WidgetDiv.DIV;
|
|
339
|
+
|
|
340
|
+
Blockly.utils.dom.addClass(this.getClickTarget_(), 'editing');
|
|
341
|
+
|
|
342
|
+
var htmlInput = /** @type {HTMLInputElement} */ (document.createElement('input'));
|
|
343
|
+
htmlInput.className = 'blocklyHtmlInput';
|
|
344
|
+
htmlInput.setAttribute('spellcheck', this.spellcheck_);
|
|
345
|
+
var scale = this.workspace_.getScale();
|
|
346
|
+
var fontSize =
|
|
347
|
+
(this.getConstants().FIELD_TEXT_FONTSIZE * scale) + 'pt';
|
|
348
|
+
div.style.fontSize = fontSize;
|
|
349
|
+
htmlInput.style.fontSize = fontSize;
|
|
350
|
+
var borderRadius =
|
|
351
|
+
(Blockly.FieldTextInput.BORDERRADIUS * scale) + 'px';
|
|
352
|
+
|
|
353
|
+
if (this.fullBlockClickTarget_) {
|
|
354
|
+
var bBox = this.getScaledBBox();
|
|
355
|
+
|
|
356
|
+
// Override border radius.
|
|
357
|
+
borderRadius = (bBox.bottom - bBox.top) / 2 + 'px';
|
|
358
|
+
// Pull stroke colour from the existing shadow block
|
|
359
|
+
var strokeColour = this.sourceBlock_.getParent() ?
|
|
360
|
+
this.sourceBlock_.getParent().style.colourTertiary :
|
|
361
|
+
this.sourceBlock_.style.colourTertiary;
|
|
362
|
+
htmlInput.style.border = (1 * scale) + 'px solid ' + strokeColour;
|
|
363
|
+
div.style.borderRadius = borderRadius;
|
|
364
|
+
div.style.transition = 'box-shadow 0.25s ease 0s';
|
|
365
|
+
if (this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW) {
|
|
366
|
+
div.style.boxShadow = 'rgba(255, 255, 255, 0.3) 0px 0px 0px ' +
|
|
367
|
+
4 * scale + 'px';
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
htmlInput.style.borderRadius = borderRadius;
|
|
371
|
+
|
|
372
|
+
div.appendChild(htmlInput);
|
|
373
|
+
|
|
374
|
+
htmlInput.value = htmlInput.defaultValue = this.getEditorText_(this.value_);
|
|
375
|
+
htmlInput.untypedDefaultValue_ = this.value_;
|
|
376
|
+
htmlInput.oldValue_ = null;
|
|
377
|
+
|
|
378
|
+
this.resizeEditor_();
|
|
379
|
+
|
|
380
|
+
this.bindInputEvents_(htmlInput);
|
|
381
|
+
|
|
382
|
+
return htmlInput;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Closes the editor, saves the results, and disposes of any events or
|
|
387
|
+
* dom-references belonging to the editor.
|
|
388
|
+
* @private
|
|
389
|
+
*/
|
|
390
|
+
Blockly.FieldTextInput.prototype.widgetDispose_ = function() {
|
|
391
|
+
// Non-disposal related things that we do when the editor closes.
|
|
392
|
+
this.isBeingEdited_ = false;
|
|
393
|
+
this.isTextValid_ = true;
|
|
394
|
+
// Make sure the field's node matches the field's internal value.
|
|
395
|
+
this.forceRerender();
|
|
396
|
+
// TODO(#2496): Make this less of a hack.
|
|
397
|
+
if (this.onFinishEditing_) {
|
|
398
|
+
this.onFinishEditing_(this.value_);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Actual disposal.
|
|
402
|
+
this.unbindInputEvents_();
|
|
403
|
+
var style = Blockly.WidgetDiv.DIV.style;
|
|
404
|
+
style.width = 'auto';
|
|
405
|
+
style.height = 'auto';
|
|
406
|
+
style.fontSize = '';
|
|
407
|
+
style.transition = '';
|
|
408
|
+
style.boxShadow = '';
|
|
409
|
+
this.htmlInput_ = null;
|
|
410
|
+
|
|
411
|
+
Blockly.utils.dom.removeClass(this.getClickTarget_(), 'editing');
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Bind handlers for user input on the text input field's editor.
|
|
416
|
+
* @param {!HTMLElement} htmlInput The htmlInput to which event
|
|
417
|
+
* handlers will be bound.
|
|
418
|
+
* @protected
|
|
419
|
+
*/
|
|
420
|
+
Blockly.FieldTextInput.prototype.bindInputEvents_ = function(htmlInput) {
|
|
421
|
+
// Trap Enter without IME and Esc to hide.
|
|
422
|
+
this.onKeyDownWrapper_ =
|
|
423
|
+
Blockly.bindEventWithChecks_(
|
|
424
|
+
htmlInput, 'keydown', this, this.onHtmlInputKeyDown_);
|
|
425
|
+
// Resize after every input change.
|
|
426
|
+
this.onKeyInputWrapper_ =
|
|
427
|
+
Blockly.bindEventWithChecks_(
|
|
428
|
+
htmlInput, 'input', this, this.onHtmlInputChange_);
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Unbind handlers for user input and workspace size changes.
|
|
433
|
+
* @private
|
|
434
|
+
*/
|
|
435
|
+
Blockly.FieldTextInput.prototype.unbindInputEvents_ = function() {
|
|
436
|
+
if (this.onKeyDownWrapper_) {
|
|
437
|
+
Blockly.unbindEvent_(this.onKeyDownWrapper_);
|
|
438
|
+
this.onKeyDownWrapper_ = null;
|
|
439
|
+
}
|
|
440
|
+
if (this.onKeyInputWrapper_) {
|
|
441
|
+
Blockly.unbindEvent_(this.onKeyInputWrapper_);
|
|
442
|
+
this.onKeyInputWrapper_ = null;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Handle key down to the editor.
|
|
448
|
+
* @param {!Event} e Keyboard event.
|
|
449
|
+
* @protected
|
|
450
|
+
*/
|
|
451
|
+
Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_ = function(e) {
|
|
452
|
+
if (e.keyCode == Blockly.utils.KeyCodes.ENTER) {
|
|
453
|
+
Blockly.WidgetDiv.hide();
|
|
454
|
+
Blockly.DropDownDiv.hideWithoutAnimation();
|
|
455
|
+
} else if (e.keyCode == Blockly.utils.KeyCodes.ESC) {
|
|
456
|
+
this.htmlInput_.value = this.htmlInput_.defaultValue;
|
|
457
|
+
Blockly.WidgetDiv.hide();
|
|
458
|
+
Blockly.DropDownDiv.hideWithoutAnimation();
|
|
459
|
+
} else if (e.keyCode == Blockly.utils.KeyCodes.TAB) {
|
|
460
|
+
Blockly.WidgetDiv.hide();
|
|
461
|
+
Blockly.DropDownDiv.hideWithoutAnimation();
|
|
462
|
+
this.sourceBlock_.tab(this, !e.shiftKey);
|
|
463
|
+
e.preventDefault();
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Handle a change to the editor.
|
|
469
|
+
* @param {!Event} _e Keyboard event.
|
|
470
|
+
* @private
|
|
471
|
+
*/
|
|
472
|
+
Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) {
|
|
473
|
+
var text = this.htmlInput_.value;
|
|
474
|
+
if (text !== this.htmlInput_.oldValue_) {
|
|
475
|
+
this.htmlInput_.oldValue_ = text;
|
|
476
|
+
|
|
477
|
+
// TODO(#2169): Once issue is fixed the setGroup functionality could be
|
|
478
|
+
// moved up to the Field setValue method. This would create a
|
|
479
|
+
// broader fix for all field types.
|
|
480
|
+
Blockly.Events.setGroup(true);
|
|
481
|
+
var value = this.getValueFromEditorText_(text);
|
|
482
|
+
this.setValue(value);
|
|
483
|
+
this.forceRerender();
|
|
484
|
+
this.resizeEditor_();
|
|
485
|
+
Blockly.Events.setGroup(false);
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Set the html input value and the field's internal value. The difference
|
|
491
|
+
* between this and ``setValue`` is that this also updates the html input
|
|
492
|
+
* value whilst editing.
|
|
493
|
+
* @param {*} newValue New value.
|
|
494
|
+
* @protected
|
|
495
|
+
*/
|
|
496
|
+
Blockly.FieldTextInput.prototype.setEditorValue_ = function(newValue) {
|
|
497
|
+
this.isDirty_ = true;
|
|
498
|
+
if (this.isBeingEdited_) {
|
|
499
|
+
// In the case this method is passed an invalid value, we still
|
|
500
|
+
// pass it through the transformation method `getEditorText` to deal
|
|
501
|
+
// with. Otherwise, the internal field's state will be inconsistent
|
|
502
|
+
// with what's shown to the user.
|
|
503
|
+
this.htmlInput_.value = this.getEditorText_(newValue);
|
|
504
|
+
}
|
|
505
|
+
this.setValue(newValue);
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Resize the editor to fit the text.
|
|
510
|
+
* @protected
|
|
511
|
+
*/
|
|
512
|
+
Blockly.FieldTextInput.prototype.resizeEditor_ = function() {
|
|
513
|
+
var div = Blockly.WidgetDiv.DIV;
|
|
514
|
+
var bBox = this.getScaledBBox();
|
|
515
|
+
div.style.width = bBox.right - bBox.left + 'px';
|
|
516
|
+
div.style.height = bBox.bottom - bBox.top + 'px';
|
|
517
|
+
|
|
518
|
+
// In RTL mode block fields and LTR input fields the left edge moves,
|
|
519
|
+
// whereas the right edge is fixed. Reposition the editor.
|
|
520
|
+
var x = this.sourceBlock_.RTL ? bBox.right - div.offsetWidth : bBox.left;
|
|
521
|
+
var xy = new Blockly.utils.Coordinate(x, bBox.top);
|
|
522
|
+
|
|
523
|
+
div.style.left = xy.x + 'px';
|
|
524
|
+
div.style.top = xy.y + 'px';
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Ensure that only a number may be entered.
|
|
529
|
+
* @param {string} text The user's text.
|
|
530
|
+
* @return {?string} A string representing a valid number, or null if invalid.
|
|
531
|
+
* @deprecated
|
|
532
|
+
*/
|
|
533
|
+
Blockly.FieldTextInput.numberValidator = function(text) {
|
|
534
|
+
console.warn('Blockly.FieldTextInput.numberValidator is deprecated. ' +
|
|
535
|
+
'Use Blockly.FieldNumber instead.');
|
|
536
|
+
if (text === null) {
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
text = String(text);
|
|
540
|
+
// TODO: Handle cases like 'ten', '1.203,14', etc.
|
|
541
|
+
// 'O' is sometimes mistaken for '0' by inexperienced users.
|
|
542
|
+
text = text.replace(/O/ig, '0');
|
|
543
|
+
// Strip out thousands separators.
|
|
544
|
+
text = text.replace(/,/g, '');
|
|
545
|
+
var n = Number(text || 0);
|
|
546
|
+
return isNaN(n) ? null : String(n);
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Ensure that only a non-negative integer may be entered.
|
|
551
|
+
* @param {string} text The user's text.
|
|
552
|
+
* @return {?string} A string representing a valid int, or null if invalid.
|
|
553
|
+
* @deprecated
|
|
554
|
+
*/
|
|
555
|
+
Blockly.FieldTextInput.nonnegativeIntegerValidator = function(text) {
|
|
556
|
+
var n = Blockly.FieldTextInput.numberValidator(text);
|
|
557
|
+
if (n) {
|
|
558
|
+
n = String(Math.max(0, Math.floor(n)));
|
|
559
|
+
}
|
|
560
|
+
return n;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Returns whether or not the field is tab navigable.
|
|
565
|
+
* @return {boolean} True if the field is tab navigable.
|
|
566
|
+
* @override
|
|
567
|
+
*/
|
|
568
|
+
Blockly.FieldTextInput.prototype.isTabNavigable = function() {
|
|
569
|
+
return true;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Use the `getText_` developer hook to override the field's text representation.
|
|
574
|
+
* When we're currently editing, return the current html value instead.
|
|
575
|
+
* Otherwise, return null which tells the field to use the default behaviour
|
|
576
|
+
* (which is a string cast of the field's value).
|
|
577
|
+
* @return {?string} The html value if we're editing, otherwise null.
|
|
578
|
+
* @protected
|
|
579
|
+
* @override
|
|
580
|
+
*/
|
|
581
|
+
Blockly.FieldTextInput.prototype.getText_ = function() {
|
|
582
|
+
if (this.isBeingEdited_ && this.htmlInput_) {
|
|
583
|
+
// We are currently editing, return the html input value instead.
|
|
584
|
+
return this.htmlInput_.value;
|
|
585
|
+
}
|
|
586
|
+
return null;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Transform the provided value into a text to show in the html input.
|
|
591
|
+
* Override this method if the field's html input representation is different
|
|
592
|
+
* than the field's value. This should be coupled with an override of
|
|
593
|
+
* `getValueFromEditorText_`.
|
|
594
|
+
* @param {*} value The value stored in this field.
|
|
595
|
+
* @return {string} The text to show on the html input.
|
|
596
|
+
* @protected
|
|
597
|
+
*/
|
|
598
|
+
Blockly.FieldTextInput.prototype.getEditorText_ = function(value) {
|
|
599
|
+
return String(value);
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Transform the text received from the html input into a value to store
|
|
604
|
+
* in this field.
|
|
605
|
+
* Override this method if the field's html input representation is different
|
|
606
|
+
* than the field's value. This should be coupled with an override of
|
|
607
|
+
* `getEditorText_`.
|
|
608
|
+
* @param {string} text Text received from the html input.
|
|
609
|
+
* @return {*} The value to store.
|
|
610
|
+
* @protected
|
|
611
|
+
*/
|
|
612
|
+
Blockly.FieldTextInput.prototype.getValueFromEditorText_ = function(text) {
|
|
613
|
+
return text;
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
Blockly.fieldRegistry.register('field_input', Blockly.FieldTextInput);
|