nodeskini 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklySkini/archive/blocklyControleur.js +87 -0
- package/blocklySkini/archive/blocklySkini.js +84 -0
- package/blocklySkini/archive/blocklyhop.js +75 -0
- package/blocklySkini/archive/clientControleurBlocly.js +170 -0
- package/blocklySkini/archive/index.html +76 -0
- package/blocklySkini/archive/testHHsuspend.txt +89 -0
- package/blocklySkini/archive/testHHtrap.txt +262 -0
- package/blocklySkini/archive/testOrchestration.txt +177 -0
- package/blocklySkini/archive/testOrchestration.xml +447 -0
- package/blocklySkini/archive/testOrchestration2.xml +456 -0
- package/blocklySkini/blockly/README.md +77 -0
- package/blocklySkini/blockly/blockly.d.ts +21480 -0
- package/blocklySkini/blockly/blockly.js +25 -0
- package/blocklySkini/blockly/blockly.min.js +2188 -0
- package/blocklySkini/blockly/blockly_compressed.js +1455 -0
- package/blocklySkini/blockly/blockly_compressed.js.map +1 -0
- package/blocklySkini/blockly/blocks/colour.js +122 -0
- package/blocklySkini/blockly/blocks/lists.js +862 -0
- package/blocklySkini/blockly/blocks/logic.js +635 -0
- package/blocklySkini/blockly/blocks/loops.js +357 -0
- package/blocklySkini/blockly/blocks/math.js +566 -0
- package/blocklySkini/blockly/blocks/procedures.js +1072 -0
- package/blocklySkini/blockly/blocks/text.js +923 -0
- package/blocklySkini/blockly/blocks/variables.js +163 -0
- package/blocklySkini/blockly/blocks/variables_dynamic.js +180 -0
- package/blocklySkini/blockly/blocks.d.ts +15 -0
- package/blocklySkini/blockly/blocks.js +27 -0
- package/blocklySkini/blockly/blocks_compressed.js +182 -0
- package/blocklySkini/blockly/blocks_compressed.js.map +1 -0
- package/blocklySkini/blockly/browser.js +36 -0
- package/blocklySkini/blockly/core/block.js +2010 -0
- package/blocklySkini/blockly/core/block_animations.js +203 -0
- package/blocklySkini/blockly/core/block_drag_surface.js +212 -0
- package/blocklySkini/blockly/core/block_dragger.js +378 -0
- package/blocklySkini/blockly/core/block_events.js +548 -0
- package/blocklySkini/blockly/core/block_svg.js +1763 -0
- package/blocklySkini/blockly/core/blockly.js +674 -0
- package/blocklySkini/blockly/core/blocks.js +23 -0
- package/blocklySkini/blockly/core/bubble.js +880 -0
- package/blocklySkini/blockly/core/bubble_dragger.js +274 -0
- package/blocklySkini/blockly/core/comment.js +439 -0
- package/blocklySkini/blockly/core/components/component.js +554 -0
- package/blocklySkini/blockly/core/components/tree/basenode.js +895 -0
- package/blocklySkini/blockly/core/components/tree/treecontrol.js +332 -0
- package/blocklySkini/blockly/core/components/tree/treenode.js +172 -0
- package/blocklySkini/blockly/core/connection.js +682 -0
- package/blocklySkini/blockly/core/connection_checker.js +285 -0
- package/blocklySkini/blockly/core/connection_db.js +295 -0
- package/blocklySkini/blockly/core/constants.js +277 -0
- package/blocklySkini/blockly/core/contextmenu.js +307 -0
- package/blocklySkini/blockly/core/contextmenu_items.js +534 -0
- package/blocklySkini/blockly/core/contextmenu_registry.js +165 -0
- package/blocklySkini/blockly/core/css.js +549 -0
- package/blocklySkini/blockly/core/dropdowndiv.js +776 -0
- package/blocklySkini/blockly/core/events.js +387 -0
- package/blocklySkini/blockly/core/events_abstract.js +106 -0
- package/blocklySkini/blockly/core/extensions.js +450 -0
- package/blocklySkini/blockly/core/field.js +1162 -0
- package/blocklySkini/blockly/core/field_angle.js +562 -0
- package/blocklySkini/blockly/core/field_checkbox.js +220 -0
- package/blocklySkini/blockly/core/field_colour.js +664 -0
- package/blocklySkini/blockly/core/field_dropdown.js +760 -0
- package/blocklySkini/blockly/core/field_image.js +286 -0
- package/blocklySkini/blockly/core/field_label.js +130 -0
- package/blocklySkini/blockly/core/field_label_serializable.js +69 -0
- package/blocklySkini/blockly/core/field_multilineinput.js +299 -0
- package/blocklySkini/blockly/core/field_number.js +317 -0
- package/blocklySkini/blockly/core/field_registry.js +66 -0
- package/blocklySkini/blockly/core/field_textinput.js +616 -0
- package/blocklySkini/blockly/core/field_variable.js +463 -0
- package/blocklySkini/blockly/core/flyout_base.js +1071 -0
- package/blocklySkini/blockly/core/flyout_button.js +325 -0
- package/blocklySkini/blockly/core/flyout_dragger.js +76 -0
- package/blocklySkini/blockly/core/flyout_horizontal.js +388 -0
- package/blocklySkini/blockly/core/flyout_vertical.js +397 -0
- package/blocklySkini/blockly/core/generator.js +482 -0
- package/blocklySkini/blockly/core/gesture.js +993 -0
- package/blocklySkini/blockly/core/grid.js +222 -0
- package/blocklySkini/blockly/core/icon.js +206 -0
- package/blocklySkini/blockly/core/inject.js +487 -0
- package/blocklySkini/blockly/core/input.js +296 -0
- package/blocklySkini/blockly/core/insertion_marker_manager.js +700 -0
- package/blocklySkini/blockly/core/interfaces/i_accessibility.js +72 -0
- package/blocklySkini/blockly/core/interfaces/i_bounded_element.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_bubble.js +83 -0
- package/blocklySkini/blockly/core/interfaces/i_connection_checker.js +94 -0
- package/blocklySkini/blockly/core/interfaces/i_contextmenu.js +26 -0
- package/blocklySkini/blockly/core/interfaces/i_copyable.js +40 -0
- package/blocklySkini/blockly/core/interfaces/i_deletable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_deletearea.js +28 -0
- package/blocklySkini/blockly/core/interfaces/i_flyout.js +178 -0
- package/blocklySkini/blockly/core/interfaces/i_movable.js +27 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable.js +22 -0
- package/blocklySkini/blockly/core/interfaces/i_registrable_field.js +31 -0
- package/blocklySkini/blockly/core/interfaces/i_selectable.js +43 -0
- package/blocklySkini/blockly/core/interfaces/i_styleable.js +33 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox.js +131 -0
- package/blocklySkini/blockly/core/interfaces/i_toolbox_item.js +148 -0
- package/blocklySkini/blockly/core/keyboard_nav/action.js +26 -0
- package/blocklySkini/blockly/core/keyboard_nav/ast_node.js +684 -0
- package/blocklySkini/blockly/core/keyboard_nav/basic_cursor.js +208 -0
- package/blocklySkini/blockly/core/keyboard_nav/cursor.js +170 -0
- package/blocklySkini/blockly/core/keyboard_nav/flyout_cursor.js +106 -0
- package/blocklySkini/blockly/core/keyboard_nav/key_map.js +190 -0
- package/blocklySkini/blockly/core/keyboard_nav/marker.js +120 -0
- package/blocklySkini/blockly/core/keyboard_nav/navigation.js +1084 -0
- package/blocklySkini/blockly/core/keyboard_nav/tab_navigate_cursor.js +48 -0
- package/blocklySkini/blockly/core/marker_manager.js +183 -0
- package/blocklySkini/blockly/core/menu.js +465 -0
- package/blocklySkini/blockly/core/menuitem.js +280 -0
- package/blocklySkini/blockly/core/msg.js +31 -0
- package/blocklySkini/blockly/core/mutator.js +555 -0
- package/blocklySkini/blockly/core/names.js +186 -0
- package/blocklySkini/blockly/core/options.js +365 -0
- package/blocklySkini/blockly/core/procedures.js +404 -0
- package/blocklySkini/blockly/core/registry.js +265 -0
- package/blocklySkini/blockly/core/rendered_connection.js +565 -0
- package/blocklySkini/blockly/core/renderers/common/block_rendering.js +81 -0
- package/blocklySkini/blockly/core/renderers/common/constants.js +1256 -0
- package/blocklySkini/blockly/core/renderers/common/debugger.js +431 -0
- package/blocklySkini/blockly/core/renderers/common/drawer.js +468 -0
- package/blocklySkini/blockly/core/renderers/common/i_path_object.js +151 -0
- package/blocklySkini/blockly/core/renderers/common/info.js +775 -0
- package/blocklySkini/blockly/core/renderers/common/marker_svg.js +687 -0
- package/blocklySkini/blockly/core/renderers/common/path_object.js +279 -0
- package/blocklySkini/blockly/core/renderers/common/renderer.js +301 -0
- package/blocklySkini/blockly/core/renderers/geras/constants.js +64 -0
- package/blocklySkini/blockly/core/renderers/geras/drawer.js +205 -0
- package/blocklySkini/blockly/core/renderers/geras/highlight_constants.js +311 -0
- package/blocklySkini/blockly/core/renderers/geras/highlighter.js +256 -0
- package/blocklySkini/blockly/core/renderers/geras/info.js +483 -0
- package/blocklySkini/blockly/core/renderers/geras/measurables/inputs.js +67 -0
- package/blocklySkini/blockly/core/renderers/geras/path_object.js +177 -0
- package/blocklySkini/blockly/core/renderers/geras/renderer.js +138 -0
- package/blocklySkini/blockly/core/renderers/measurables/base.js +44 -0
- package/blocklySkini/blockly/core/renderers/measurables/connections.js +114 -0
- package/blocklySkini/blockly/core/renderers/measurables/inputs.js +160 -0
- package/blocklySkini/blockly/core/renderers/measurables/row_elements.js +185 -0
- package/blocklySkini/blockly/core/renderers/measurables/rows.js +532 -0
- package/blocklySkini/blockly/core/renderers/measurables/types.js +349 -0
- package/blocklySkini/blockly/core/renderers/minimalist/constants.js +29 -0
- package/blocklySkini/blockly/core/renderers/minimalist/drawer.js +32 -0
- package/blocklySkini/blockly/core/renderers/minimalist/info.js +45 -0
- package/blocklySkini/blockly/core/renderers/minimalist/renderer.js +70 -0
- package/blocklySkini/blockly/core/renderers/thrasos/info.js +338 -0
- package/blocklySkini/blockly/core/renderers/thrasos/renderer.js +45 -0
- package/blocklySkini/blockly/core/renderers/zelos/constants.js +1002 -0
- package/blocklySkini/blockly/core/renderers/zelos/drawer.js +233 -0
- package/blocklySkini/blockly/core/renderers/zelos/info.js +587 -0
- package/blocklySkini/blockly/core/renderers/zelos/marker_svg.js +148 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/inputs.js +47 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/row_elements.js +37 -0
- package/blocklySkini/blockly/core/renderers/zelos/measurables/rows.js +108 -0
- package/blocklySkini/blockly/core/renderers/zelos/path_object.js +244 -0
- package/blocklySkini/blockly/core/renderers/zelos/renderer.js +130 -0
- package/blocklySkini/blockly/core/requires.js +84 -0
- package/blocklySkini/blockly/core/scrollbar.js +880 -0
- package/blocklySkini/blockly/core/theme/classic.js +87 -0
- package/blocklySkini/blockly/core/theme/dark.js +33 -0
- package/blocklySkini/blockly/core/theme/deuteranopia.js +104 -0
- package/blocklySkini/blockly/core/theme/highcontrast.js +119 -0
- package/blocklySkini/blockly/core/theme/modern.js +108 -0
- package/blocklySkini/blockly/core/theme/tritanopia.js +103 -0
- package/blocklySkini/blockly/core/theme/zelos.js +106 -0
- package/blocklySkini/blockly/core/theme.js +236 -0
- package/blocklySkini/blockly/core/theme_manager.js +197 -0
- package/blocklySkini/blockly/core/toolbox/category.js +690 -0
- package/blocklySkini/blockly/core/toolbox/collapsible_category.js +294 -0
- package/blocklySkini/blockly/core/toolbox/separator.js +123 -0
- package/blocklySkini/blockly/core/toolbox/toolbox.js +984 -0
- package/blocklySkini/blockly/core/toolbox/toolbox_item.js +145 -0
- package/blocklySkini/blockly/core/toolbox.js +943 -0
- package/blocklySkini/blockly/core/tooltip.js +387 -0
- package/blocklySkini/blockly/core/touch.js +255 -0
- package/blocklySkini/blockly/core/touch_gesture.js +325 -0
- package/blocklySkini/blockly/core/trashcan.js +661 -0
- package/blocklySkini/blockly/core/ui_events.js +85 -0
- package/blocklySkini/blockly/core/utils/aria.js +167 -0
- package/blocklySkini/blockly/core/utils/colour.js +208 -0
- package/blocklySkini/blockly/core/utils/coordinate.js +125 -0
- package/blocklySkini/blockly/core/utils/deprecation.js +34 -0
- package/blocklySkini/blockly/core/utils/dom.js +391 -0
- package/blocklySkini/blockly/core/utils/global.js +37 -0
- package/blocklySkini/blockly/core/utils/idgenerator.js +33 -0
- package/blocklySkini/blockly/core/utils/keycodes.js +164 -0
- package/blocklySkini/blockly/core/utils/math.js +56 -0
- package/blocklySkini/blockly/core/utils/metrics.js +124 -0
- package/blocklySkini/blockly/core/utils/object.js +73 -0
- package/blocklySkini/blockly/core/utils/rect.js +54 -0
- package/blocklySkini/blockly/core/utils/size.js +58 -0
- package/blocklySkini/blockly/core/utils/string.js +284 -0
- package/blocklySkini/blockly/core/utils/style.js +281 -0
- package/blocklySkini/blockly/core/utils/svg.js +181 -0
- package/blocklySkini/blockly/core/utils/svg_paths.js +142 -0
- package/blocklySkini/blockly/core/utils/toolbox.js +401 -0
- package/blocklySkini/blockly/core/utils/useragent.js +110 -0
- package/blocklySkini/blockly/core/utils/xml.js +79 -0
- package/blocklySkini/blockly/core/utils.js +652 -0
- package/blocklySkini/blockly/core/variable_events.js +248 -0
- package/blocklySkini/blockly/core/variable_map.js +414 -0
- package/blocklySkini/blockly/core/variable_model.js +95 -0
- package/blocklySkini/blockly/core/variables.js +571 -0
- package/blocklySkini/blockly/core/variables_dynamic.js +100 -0
- package/blocklySkini/blockly/core/warning.js +200 -0
- package/blocklySkini/blockly/core/widgetdiv.js +241 -0
- package/blocklySkini/blockly/core/workspace.js +786 -0
- package/blocklySkini/blockly/core/workspace_audio.js +153 -0
- package/blocklySkini/blockly/core/workspace_comment.js +373 -0
- package/blocklySkini/blockly/core/workspace_comment_render_svg.js +461 -0
- package/blocklySkini/blockly/core/workspace_comment_svg.js +701 -0
- package/blocklySkini/blockly/core/workspace_drag_surface_svg.js +176 -0
- package/blocklySkini/blockly/core/workspace_dragger.js +85 -0
- package/blocklySkini/blockly/core/workspace_events.js +93 -0
- package/blocklySkini/blockly/core/workspace_svg.js +2661 -0
- package/blocklySkini/blockly/core/ws_comment_events.js +417 -0
- package/blocklySkini/blockly/core/xml.js +827 -0
- package/blocklySkini/blockly/core/zoom_controls.js +449 -0
- package/blocklySkini/blockly/core-browser.js +34 -0
- package/blocklySkini/blockly/core.d.ts +15 -0
- package/blocklySkini/blockly/core.js +38 -0
- package/blocklySkini/blockly/dart.d.ts +15 -0
- package/blocklySkini/blockly/dart.js +27 -0
- package/blocklySkini/blockly/dart_compressed.js +114 -0
- package/blocklySkini/blockly/dart_compressed.js.map +1 -0
- package/blocklySkini/blockly/generators/dart/colour.js +114 -0
- package/blocklySkini/blockly/generators/dart/lists.js +447 -0
- package/blocklySkini/blockly/generators/dart/logic.js +127 -0
- package/blocklySkini/blockly/generators/dart/loops.js +169 -0
- package/blocklySkini/blockly/generators/dart/math.js +485 -0
- package/blocklySkini/blockly/generators/dart/procedures.js +111 -0
- package/blocklySkini/blockly/generators/dart/text.js +339 -0
- package/blocklySkini/blockly/generators/dart/variables.js +32 -0
- package/blocklySkini/blockly/generators/dart/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/dart.js +290 -0
- package/blocklySkini/blockly/generators/javascript/colour.js +89 -0
- package/blocklySkini/blockly/generators/javascript/lists.js +388 -0
- package/blocklySkini/blockly/generators/javascript/logic.js +129 -0
- package/blocklySkini/blockly/generators/javascript/loops.js +184 -0
- package/blocklySkini/blockly/generators/javascript/math.js +409 -0
- package/blocklySkini/blockly/generators/javascript/procedures.js +113 -0
- package/blocklySkini/blockly/generators/javascript/text.js +367 -0
- package/blocklySkini/blockly/generators/javascript/variables.js +32 -0
- package/blocklySkini/blockly/generators/javascript/variables_dynamic.js +23 -0
- package/blocklySkini/blockly/generators/javascript.js +317 -0
- package/blocklySkini/blockly/generators/lua/colour.js +76 -0
- package/blocklySkini/blockly/generators/lua/lists.js +368 -0
- package/blocklySkini/blockly/generators/lua/logic.js +127 -0
- package/blocklySkini/blockly/generators/lua/loops.js +173 -0
- package/blocklySkini/blockly/generators/lua/math.js +423 -0
- package/blocklySkini/blockly/generators/lua/procedures.js +113 -0
- package/blocklySkini/blockly/generators/lua/text.js +353 -0
- package/blocklySkini/blockly/generators/lua/variables.js +32 -0
- package/blocklySkini/blockly/generators/lua/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/lua.js +198 -0
- package/blocklySkini/blockly/generators/php/colour.js +91 -0
- package/blocklySkini/blockly/generators/php/lists.js +498 -0
- package/blocklySkini/blockly/generators/php/logic.js +128 -0
- package/blocklySkini/blockly/generators/php/loops.js +170 -0
- package/blocklySkini/blockly/generators/php/math.js +370 -0
- package/blocklySkini/blockly/generators/php/procedures.js +132 -0
- package/blocklySkini/blockly/generators/php/text.js +271 -0
- package/blocklySkini/blockly/generators/php/variables.js +32 -0
- package/blocklySkini/blockly/generators/php/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/php.js +318 -0
- package/blocklySkini/blockly/generators/python/colour.js +72 -0
- package/blocklySkini/blockly/generators/python/lists.js +349 -0
- package/blocklySkini/blockly/generators/python/logic.js +127 -0
- package/blocklySkini/blockly/generators/python/loops.js +214 -0
- package/blocklySkini/blockly/generators/python/math.js +385 -0
- package/blocklySkini/blockly/generators/python/procedures.js +134 -0
- package/blocklySkini/blockly/generators/python/text.js +293 -0
- package/blocklySkini/blockly/generators/python/variables.js +32 -0
- package/blocklySkini/blockly/generators/python/variables_dynamic.js +21 -0
- package/blocklySkini/blockly/generators/python.js +322 -0
- package/blocklySkini/blockly/index.d.ts +22 -0
- package/blocklySkini/blockly/index.js +24 -0
- package/blocklySkini/blockly/javascript.d.ts +15 -0
- package/blocklySkini/blockly/javascript.js +27 -0
- package/blocklySkini/blockly/javascript_compressed.js +115 -0
- package/blocklySkini/blockly/javascript_compressed.js.map +1 -0
- package/blocklySkini/blockly/lua.d.ts +15 -0
- package/blocklySkini/blockly/lua.js +27 -0
- package/blocklySkini/blockly/lua_compressed.js +94 -0
- package/blocklySkini/blockly/lua_compressed.js.map +1 -0
- package/blocklySkini/blockly/media/1x1.gif +0 -0
- package/blocklySkini/blockly/media/click.mp3 +0 -0
- package/blocklySkini/blockly/media/click.ogg +0 -0
- package/blocklySkini/blockly/media/click.wav +0 -0
- package/blocklySkini/blockly/media/delete.mp3 +0 -0
- package/blocklySkini/blockly/media/delete.ogg +0 -0
- package/blocklySkini/blockly/media/delete.wav +0 -0
- package/blocklySkini/blockly/media/disconnect.mp3 +0 -0
- package/blocklySkini/blockly/media/disconnect.ogg +0 -0
- package/blocklySkini/blockly/media/disconnect.wav +0 -0
- package/blocklySkini/blockly/media/dropdown-arrow.svg +1 -0
- package/blocklySkini/blockly/media/handclosed.cur +0 -0
- package/blocklySkini/blockly/media/handdelete.cur +0 -0
- package/blocklySkini/blockly/media/handopen.cur +0 -0
- package/blocklySkini/blockly/media/pilcrow.png +0 -0
- package/blocklySkini/blockly/media/quote0.png +0 -0
- package/blocklySkini/blockly/media/quote1.png +0 -0
- package/blocklySkini/blockly/media/sprites.png +0 -0
- package/blocklySkini/blockly/media/sprites.svg +74 -0
- package/blocklySkini/blockly/msg/ab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ab.js +447 -0
- package/blocklySkini/blockly/msg/ar.d.ts +16 -0
- package/blocklySkini/blockly/msg/ar.js +447 -0
- package/blocklySkini/blockly/msg/az.d.ts +16 -0
- package/blocklySkini/blockly/msg/az.js +447 -0
- package/blocklySkini/blockly/msg/ba.d.ts +16 -0
- package/blocklySkini/blockly/msg/ba.js +447 -0
- package/blocklySkini/blockly/msg/bcc.d.ts +16 -0
- package/blocklySkini/blockly/msg/bcc.js +447 -0
- package/blocklySkini/blockly/msg/be-tarask.d.ts +16 -0
- package/blocklySkini/blockly/msg/be-tarask.js +447 -0
- package/blocklySkini/blockly/msg/be.d.ts +16 -0
- package/blocklySkini/blockly/msg/be.js +447 -0
- package/blocklySkini/blockly/msg/bg.d.ts +16 -0
- package/blocklySkini/blockly/msg/bg.js +447 -0
- package/blocklySkini/blockly/msg/bn.d.ts +16 -0
- package/blocklySkini/blockly/msg/bn.js +447 -0
- package/blocklySkini/blockly/msg/br.d.ts +16 -0
- package/blocklySkini/blockly/msg/br.js +447 -0
- package/blocklySkini/blockly/msg/ca.d.ts +16 -0
- package/blocklySkini/blockly/msg/ca.js +447 -0
- package/blocklySkini/blockly/msg/constants.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.d.ts +16 -0
- package/blocklySkini/blockly/msg/cs.js +447 -0
- package/blocklySkini/blockly/msg/da.d.ts +16 -0
- package/blocklySkini/blockly/msg/da.js +447 -0
- package/blocklySkini/blockly/msg/de.d.ts +16 -0
- package/blocklySkini/blockly/msg/de.js +447 -0
- package/blocklySkini/blockly/msg/diq.d.ts +16 -0
- package/blocklySkini/blockly/msg/diq.js +447 -0
- package/blocklySkini/blockly/msg/dty.d.ts +16 -0
- package/blocklySkini/blockly/msg/dty.js +447 -0
- package/blocklySkini/blockly/msg/ee.d.ts +16 -0
- package/blocklySkini/blockly/msg/ee.js +447 -0
- package/blocklySkini/blockly/msg/el.d.ts +16 -0
- package/blocklySkini/blockly/msg/el.js +447 -0
- package/blocklySkini/blockly/msg/en-gb.d.ts +16 -0
- package/blocklySkini/blockly/msg/en-gb.js +447 -0
- package/blocklySkini/blockly/msg/en.d.ts +16 -0
- package/blocklySkini/blockly/msg/en.js +447 -0
- package/blocklySkini/blockly/msg/eo.d.ts +16 -0
- package/blocklySkini/blockly/msg/eo.js +447 -0
- package/blocklySkini/blockly/msg/es.d.ts +16 -0
- package/blocklySkini/blockly/msg/es.js +447 -0
- package/blocklySkini/blockly/msg/et.d.ts +16 -0
- package/blocklySkini/blockly/msg/et.js +447 -0
- package/blocklySkini/blockly/msg/eu.d.ts +16 -0
- package/blocklySkini/blockly/msg/eu.js +447 -0
- package/blocklySkini/blockly/msg/fa.d.ts +16 -0
- package/blocklySkini/blockly/msg/fa.js +447 -0
- package/blocklySkini/blockly/msg/fi.d.ts +16 -0
- package/blocklySkini/blockly/msg/fi.js +447 -0
- package/blocklySkini/blockly/msg/fr.d.ts +16 -0
- package/blocklySkini/blockly/msg/fr.js +447 -0
- package/blocklySkini/blockly/msg/gl.d.ts +16 -0
- package/blocklySkini/blockly/msg/gl.js +447 -0
- package/blocklySkini/blockly/msg/gor.d.ts +16 -0
- package/blocklySkini/blockly/msg/gor.js +447 -0
- package/blocklySkini/blockly/msg/ha.d.ts +16 -0
- package/blocklySkini/blockly/msg/ha.js +447 -0
- package/blocklySkini/blockly/msg/he.d.ts +16 -0
- package/blocklySkini/blockly/msg/he.js +447 -0
- package/blocklySkini/blockly/msg/hi.d.ts +16 -0
- package/blocklySkini/blockly/msg/hi.js +447 -0
- package/blocklySkini/blockly/msg/hrx.d.ts +16 -0
- package/blocklySkini/blockly/msg/hrx.js +447 -0
- package/blocklySkini/blockly/msg/hu.d.ts +16 -0
- package/blocklySkini/blockly/msg/hu.js +447 -0
- package/blocklySkini/blockly/msg/hy.d.ts +16 -0
- package/blocklySkini/blockly/msg/hy.js +447 -0
- package/blocklySkini/blockly/msg/ia.d.ts +16 -0
- package/blocklySkini/blockly/msg/ia.js +447 -0
- package/blocklySkini/blockly/msg/id.d.ts +16 -0
- package/blocklySkini/blockly/msg/id.js +447 -0
- package/blocklySkini/blockly/msg/ig.d.ts +16 -0
- package/blocklySkini/blockly/msg/ig.js +447 -0
- package/blocklySkini/blockly/msg/is.d.ts +16 -0
- package/blocklySkini/blockly/msg/is.js +447 -0
- package/blocklySkini/blockly/msg/it.d.ts +16 -0
- package/blocklySkini/blockly/msg/it.js +447 -0
- package/blocklySkini/blockly/msg/ja.d.ts +16 -0
- package/blocklySkini/blockly/msg/ja.js +447 -0
- package/blocklySkini/blockly/msg/kab.d.ts +16 -0
- package/blocklySkini/blockly/msg/kab.js +447 -0
- package/blocklySkini/blockly/msg/kn.d.ts +16 -0
- package/blocklySkini/blockly/msg/kn.js +447 -0
- package/blocklySkini/blockly/msg/ko.d.ts +16 -0
- package/blocklySkini/blockly/msg/ko.js +447 -0
- package/blocklySkini/blockly/msg/lb.d.ts +16 -0
- package/blocklySkini/blockly/msg/lb.js +447 -0
- package/blocklySkini/blockly/msg/lki.d.ts +16 -0
- package/blocklySkini/blockly/msg/lki.js +447 -0
- package/blocklySkini/blockly/msg/lo.d.ts +16 -0
- package/blocklySkini/blockly/msg/lo.js +447 -0
- package/blocklySkini/blockly/msg/lrc.d.ts +16 -0
- package/blocklySkini/blockly/msg/lrc.js +447 -0
- package/blocklySkini/blockly/msg/lt.d.ts +16 -0
- package/blocklySkini/blockly/msg/lt.js +447 -0
- package/blocklySkini/blockly/msg/lv.d.ts +16 -0
- package/blocklySkini/blockly/msg/lv.js +447 -0
- package/blocklySkini/blockly/msg/mk.d.ts +16 -0
- package/blocklySkini/blockly/msg/mk.js +447 -0
- package/blocklySkini/blockly/msg/mnw.d.ts +16 -0
- package/blocklySkini/blockly/msg/mnw.js +447 -0
- package/blocklySkini/blockly/msg/ms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ms.js +447 -0
- package/blocklySkini/blockly/msg/msg.d.ts +444 -0
- package/blocklySkini/blockly/msg/nb.d.ts +16 -0
- package/blocklySkini/blockly/msg/nb.js +447 -0
- package/blocklySkini/blockly/msg/nl.d.ts +16 -0
- package/blocklySkini/blockly/msg/nl.js +447 -0
- package/blocklySkini/blockly/msg/oc.d.ts +16 -0
- package/blocklySkini/blockly/msg/oc.js +447 -0
- package/blocklySkini/blockly/msg/pl.d.ts +16 -0
- package/blocklySkini/blockly/msg/pl.js +447 -0
- package/blocklySkini/blockly/msg/pms.d.ts +16 -0
- package/blocklySkini/blockly/msg/pms.js +447 -0
- package/blocklySkini/blockly/msg/pt-br.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt-br.js +447 -0
- package/blocklySkini/blockly/msg/pt.d.ts +16 -0
- package/blocklySkini/blockly/msg/pt.js +447 -0
- package/blocklySkini/blockly/msg/qqq.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.d.ts +16 -0
- package/blocklySkini/blockly/msg/ro.js +447 -0
- package/blocklySkini/blockly/msg/ru.d.ts +16 -0
- package/blocklySkini/blockly/msg/ru.js +447 -0
- package/blocklySkini/blockly/msg/sc.d.ts +16 -0
- package/blocklySkini/blockly/msg/sc.js +447 -0
- package/blocklySkini/blockly/msg/sd.d.ts +16 -0
- package/blocklySkini/blockly/msg/sd.js +447 -0
- package/blocklySkini/blockly/msg/shn.d.ts +16 -0
- package/blocklySkini/blockly/msg/shn.js +447 -0
- package/blocklySkini/blockly/msg/sk.d.ts +16 -0
- package/blocklySkini/blockly/msg/sk.js +447 -0
- package/blocklySkini/blockly/msg/skr-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/skr-arab.js +447 -0
- package/blocklySkini/blockly/msg/sl.d.ts +16 -0
- package/blocklySkini/blockly/msg/sl.js +447 -0
- package/blocklySkini/blockly/msg/sq.d.ts +16 -0
- package/blocklySkini/blockly/msg/sq.js +447 -0
- package/blocklySkini/blockly/msg/sr-latn.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr-latn.js +447 -0
- package/blocklySkini/blockly/msg/sr.d.ts +16 -0
- package/blocklySkini/blockly/msg/sr.js +447 -0
- package/blocklySkini/blockly/msg/sv.d.ts +16 -0
- package/blocklySkini/blockly/msg/sv.js +447 -0
- package/blocklySkini/blockly/msg/synonyms.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.d.ts +16 -0
- package/blocklySkini/blockly/msg/ta.js +447 -0
- package/blocklySkini/blockly/msg/tcy.d.ts +16 -0
- package/blocklySkini/blockly/msg/tcy.js +447 -0
- package/blocklySkini/blockly/msg/te.d.ts +16 -0
- package/blocklySkini/blockly/msg/te.js +447 -0
- package/blocklySkini/blockly/msg/th.d.ts +16 -0
- package/blocklySkini/blockly/msg/th.js +447 -0
- package/blocklySkini/blockly/msg/tl.d.ts +16 -0
- package/blocklySkini/blockly/msg/tl.js +447 -0
- package/blocklySkini/blockly/msg/tlh.d.ts +16 -0
- package/blocklySkini/blockly/msg/tlh.js +447 -0
- package/blocklySkini/blockly/msg/tr.d.ts +16 -0
- package/blocklySkini/blockly/msg/tr.js +447 -0
- package/blocklySkini/blockly/msg/ug-arab.d.ts +16 -0
- package/blocklySkini/blockly/msg/ug-arab.js +447 -0
- package/blocklySkini/blockly/msg/uk.d.ts +16 -0
- package/blocklySkini/blockly/msg/uk.js +447 -0
- package/blocklySkini/blockly/msg/ur.d.ts +16 -0
- package/blocklySkini/blockly/msg/ur.js +447 -0
- package/blocklySkini/blockly/msg/vi.d.ts +16 -0
- package/blocklySkini/blockly/msg/vi.js +447 -0
- package/blocklySkini/blockly/msg/xmf.d.ts +16 -0
- package/blocklySkini/blockly/msg/xmf.js +447 -0
- package/blocklySkini/blockly/msg/yo.d.ts +16 -0
- package/blocklySkini/blockly/msg/yo.js +447 -0
- package/blocklySkini/blockly/msg/zh-hans.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hans.js +447 -0
- package/blocklySkini/blockly/msg/zh-hant.d.ts +16 -0
- package/blocklySkini/blockly/msg/zh-hant.js +447 -0
- package/blocklySkini/blockly/node.js +35 -0
- package/blocklySkini/blockly/package.json +84 -0
- package/blocklySkini/blockly/php.d.ts +15 -0
- package/blocklySkini/blockly/php.js +27 -0
- package/blocklySkini/blockly/php_compressed.js +103 -0
- package/blocklySkini/blockly/php_compressed.js.map +1 -0
- package/blocklySkini/blockly/python.d.ts +15 -0
- package/blocklySkini/blockly/python.js +27 -0
- package/blocklySkini/blockly/python_compressed.js +98 -0
- package/blocklySkini/blockly/python_compressed.js.map +1 -0
- package/blocklySkini/blocklySkini.html +81 -0
- package/blocklySkini/orchestrations/.xml +1 -0
- package/blocklySkini/orchestrations/BluesSkini-1.xml +231 -0
- package/blocklySkini/orchestrations/BluesSkini-2.xml +741 -0
- package/blocklySkini/orchestrations/BluesSkini-3.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini-4.xml +695 -0
- package/blocklySkini/orchestrations/BluesSkini-5.xml +731 -0
- package/blocklySkini/orchestrations/BluesSkini.xml +704 -0
- package/blocklySkini/orchestrations/FunkBitwig-1.xml +778 -0
- package/blocklySkini/orchestrations/FunkBitwig-2.xml +471 -0
- package/blocklySkini/orchestrations/JouerLeBonInstrument1-1.xml +784 -0
- package/blocklySkini/orchestrations/MajeurMineur-1.xml +638 -0
- package/blocklySkini/orchestrations/Opus5-3 - Copie.xml +1041 -0
- package/blocklySkini/orchestrations/Opus5-3.xml +1128 -0
- package/blocklySkini/orchestrations/Quatuor1-1.xml +357 -0
- package/blocklySkini/orchestrations/TechnoBitwig-1.xml +221 -0
- package/blocklySkini/orchestrations/TestBlockly.xml +497 -0
- package/blocklySkini/orchestrations/TestBlockly1.xml +500 -0
- package/blocklySkini/orchestrations/TestBlockly2.xml +792 -0
- package/blocklySkini/orchestrations/TestBlockly3-1.xml +1182 -0
- package/blocklySkini/orchestrations/TestBlockly3.xml +1251 -0
- package/blocklySkini/orchestrations/TestFunction.xml +143 -0
- package/blocklySkini/orchestrations/TestIf.xml +80 -0
- package/blocklySkini/orchestrations/TestLoop.xml +127 -0
- package/blocklySkini/orchestrations/TestOrchestration2.xml +460 -0
- package/blocklySkini/orchestrations/TestPrint.xml +70 -0
- package/blocklySkini/orchestrations/TestSubMod.xml +81 -0
- package/blocklySkini/orchestrations/Testlogic.xml +113 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-1.xml +813 -0
- package/blocklySkini/orchestrations/TrouveLaPercu-2.xml +813 -0
- package/blocklySkini/orchestrations/bar.xml +496 -0
- package/blocklySkini/orchestrations/bar2.xml +496 -0
- package/blocklySkini/orchestrations/foo.xml +500 -0
- package/blocklySkini/orchestrations/opus5Blockly - Copie.xml +496 -0
- package/blocklySkini/orchestrations/opus5Blockly-3.xml +868 -0
- package/blocklySkini/orchestrations/opus5Blockly.xml +496 -0
- package/blocklySkini/orchestrations/testOrchestration3.xml +483 -0
- package/blocklySkini/orchestrations/testOrchestration4.xml +487 -0
- package/blocklySkini/scripts/hiphop_blocks.js +6104 -0
- package/blocklySkini/scripts/main2.js +801 -0
- package/blocklySkini/styles/index.css +320 -0
- package/blocklySkini/styles/material.css +11552 -0
- package/package.json +3 -3
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Methods for dragging a bubble visually.
|
|
9
|
+
* @author fenichel@google.com (Rachel Fenichel)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.BubbleDragger');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.Bubble');
|
|
16
|
+
goog.require('Blockly.Events');
|
|
17
|
+
goog.require('Blockly.Events.CommentMove');
|
|
18
|
+
goog.require('Blockly.utils');
|
|
19
|
+
goog.require('Blockly.utils.Coordinate');
|
|
20
|
+
|
|
21
|
+
goog.requireType('Blockly.IBubble');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Class for a bubble dragger. It moves things on the bubble canvas around the
|
|
26
|
+
* workspace when they are being dragged by a mouse or touch. These can be
|
|
27
|
+
* block comments, mutators, warnings, or workspace comments.
|
|
28
|
+
* @param {!Blockly.IBubble} bubble The item on the bubble canvas to drag.
|
|
29
|
+
* @param {!Blockly.WorkspaceSvg} workspace The workspace to drag on.
|
|
30
|
+
* @constructor
|
|
31
|
+
*/
|
|
32
|
+
Blockly.BubbleDragger = function(bubble, workspace) {
|
|
33
|
+
/**
|
|
34
|
+
* The item on the bubble canvas that is being dragged.
|
|
35
|
+
* @type {!Blockly.IBubble}
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
this.draggingBubble_ = bubble;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The workspace on which the bubble is being dragged.
|
|
42
|
+
* @type {!Blockly.WorkspaceSvg}
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
this.workspace_ = workspace;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Which delete area the mouse pointer is over, if any.
|
|
49
|
+
* One of {@link Blockly.DELETE_AREA_TRASH},
|
|
50
|
+
* {@link Blockly.DELETE_AREA_TOOLBOX}, or {@link Blockly.DELETE_AREA_NONE}.
|
|
51
|
+
* @type {?number}
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
this.deleteArea_ = null;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Whether the bubble would be deleted if dropped immediately.
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
this.wouldDeleteBubble_ = false;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The location of the top left corner of the dragging bubble's body at the
|
|
65
|
+
* beginning of the drag, in workspace coordinates.
|
|
66
|
+
* @type {!Blockly.utils.Coordinate}
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
this.startXY_ = this.draggingBubble_.getRelativeToSurfaceXY();
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The drag surface to move bubbles to during a drag, or null if none should
|
|
73
|
+
* be used. Block dragging and bubble dragging use the same surface.
|
|
74
|
+
* @type {Blockly.BlockDragSurfaceSvg}
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
this.dragSurface_ =
|
|
78
|
+
Blockly.utils.is3dSupported() && !!workspace.getBlockDragSurface() ?
|
|
79
|
+
workspace.getBlockDragSurface() :
|
|
80
|
+
null;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Sever all links from this object.
|
|
85
|
+
* @package
|
|
86
|
+
* @suppress {checkTypes}
|
|
87
|
+
*/
|
|
88
|
+
Blockly.BubbleDragger.prototype.dispose = function() {
|
|
89
|
+
this.draggingBubble_ = null;
|
|
90
|
+
this.workspace_ = null;
|
|
91
|
+
this.dragSurface_ = null;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Start dragging a bubble. This includes moving it to the drag surface.
|
|
96
|
+
* @package
|
|
97
|
+
*/
|
|
98
|
+
Blockly.BubbleDragger.prototype.startBubbleDrag = function() {
|
|
99
|
+
if (!Blockly.Events.getGroup()) {
|
|
100
|
+
Blockly.Events.setGroup(true);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.workspace_.setResizesEnabled(false);
|
|
104
|
+
this.draggingBubble_.setAutoLayout(false);
|
|
105
|
+
if (this.dragSurface_) {
|
|
106
|
+
this.moveToDragSurface_();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.draggingBubble_.setDragging && this.draggingBubble_.setDragging(true);
|
|
110
|
+
|
|
111
|
+
var toolbox = this.workspace_.getToolbox();
|
|
112
|
+
if (toolbox && typeof toolbox.addStyle == 'function') {
|
|
113
|
+
var style = this.draggingBubble_.isDeletable() ? 'blocklyToolboxDelete' :
|
|
114
|
+
'blocklyToolboxGrab';
|
|
115
|
+
toolbox.addStyle(style);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Execute a step of bubble dragging, based on the given event. Update the
|
|
121
|
+
* display accordingly.
|
|
122
|
+
* @param {!Event} e The most recent move event.
|
|
123
|
+
* @param {!Blockly.utils.Coordinate} currentDragDeltaXY How far the pointer has
|
|
124
|
+
* moved from the position at the start of the drag, in pixel units.
|
|
125
|
+
* @package
|
|
126
|
+
*/
|
|
127
|
+
Blockly.BubbleDragger.prototype.dragBubble = function(e, currentDragDeltaXY) {
|
|
128
|
+
var delta = this.pixelsToWorkspaceUnits_(currentDragDeltaXY);
|
|
129
|
+
var newLoc = Blockly.utils.Coordinate.sum(this.startXY_, delta);
|
|
130
|
+
|
|
131
|
+
this.draggingBubble_.moveDuringDrag(this.dragSurface_, newLoc);
|
|
132
|
+
|
|
133
|
+
if (this.draggingBubble_.isDeletable()) {
|
|
134
|
+
this.deleteArea_ = this.workspace_.isDeleteArea(e);
|
|
135
|
+
this.updateCursorDuringBubbleDrag_();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Shut the trash can and, if necessary, delete the dragging bubble.
|
|
141
|
+
* Should be called at the end of a bubble drag.
|
|
142
|
+
* @return {boolean} Whether the bubble was deleted.
|
|
143
|
+
* @private
|
|
144
|
+
*/
|
|
145
|
+
Blockly.BubbleDragger.prototype.maybeDeleteBubble_ = function() {
|
|
146
|
+
var trashcan = this.workspace_.trashcan;
|
|
147
|
+
|
|
148
|
+
if (this.wouldDeleteBubble_) {
|
|
149
|
+
if (trashcan) {
|
|
150
|
+
setTimeout(trashcan.closeLid.bind(trashcan), 100);
|
|
151
|
+
}
|
|
152
|
+
// Fire a move event, so we know where to go back to for an undo.
|
|
153
|
+
this.fireMoveEvent_();
|
|
154
|
+
this.draggingBubble_.dispose(false, true);
|
|
155
|
+
} else if (trashcan) {
|
|
156
|
+
// Make sure the trash can lid is closed.
|
|
157
|
+
trashcan.closeLid();
|
|
158
|
+
}
|
|
159
|
+
return this.wouldDeleteBubble_;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Update the cursor (and possibly the trash can lid) to reflect whether the
|
|
164
|
+
* dragging bubble would be deleted if released immediately.
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
Blockly.BubbleDragger.prototype.updateCursorDuringBubbleDrag_ = function() {
|
|
168
|
+
this.wouldDeleteBubble_ = this.deleteArea_ != Blockly.DELETE_AREA_NONE;
|
|
169
|
+
var trashcan = this.workspace_.trashcan;
|
|
170
|
+
if (this.wouldDeleteBubble_) {
|
|
171
|
+
this.draggingBubble_.setDeleteStyle(true);
|
|
172
|
+
if (this.deleteArea_ == Blockly.DELETE_AREA_TRASH && trashcan) {
|
|
173
|
+
trashcan.setLidOpen(true);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
this.draggingBubble_.setDeleteStyle(false);
|
|
177
|
+
if (trashcan) {
|
|
178
|
+
trashcan.setLidOpen(false);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Finish a bubble drag and put the bubble back on the workspace.
|
|
185
|
+
* @param {!Event} e The mouseup/touchend event.
|
|
186
|
+
* @param {!Blockly.utils.Coordinate} currentDragDeltaXY How far the pointer has
|
|
187
|
+
* moved from the position at the start of the drag, in pixel units.
|
|
188
|
+
* @package
|
|
189
|
+
*/
|
|
190
|
+
Blockly.BubbleDragger.prototype.endBubbleDrag = function(
|
|
191
|
+
e, currentDragDeltaXY) {
|
|
192
|
+
// Make sure internal state is fresh.
|
|
193
|
+
this.dragBubble(e, currentDragDeltaXY);
|
|
194
|
+
|
|
195
|
+
var delta = this.pixelsToWorkspaceUnits_(currentDragDeltaXY);
|
|
196
|
+
var newLoc = Blockly.utils.Coordinate.sum(this.startXY_, delta);
|
|
197
|
+
|
|
198
|
+
// Move the bubble to its final location.
|
|
199
|
+
this.draggingBubble_.moveTo(newLoc.x, newLoc.y);
|
|
200
|
+
var deleted = this.maybeDeleteBubble_();
|
|
201
|
+
|
|
202
|
+
if (!deleted) {
|
|
203
|
+
// Put everything back onto the bubble canvas.
|
|
204
|
+
if (this.dragSurface_) {
|
|
205
|
+
this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas());
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
this.draggingBubble_.setDragging && this.draggingBubble_.setDragging(false);
|
|
209
|
+
this.fireMoveEvent_();
|
|
210
|
+
}
|
|
211
|
+
this.workspace_.setResizesEnabled(true);
|
|
212
|
+
|
|
213
|
+
var toolbox = this.workspace_.getToolbox();
|
|
214
|
+
if (toolbox && typeof toolbox.removeStyle == 'function') {
|
|
215
|
+
var style = this.draggingBubble_.isDeletable() ? 'blocklyToolboxDelete' :
|
|
216
|
+
'blocklyToolboxGrab';
|
|
217
|
+
toolbox.removeStyle(style);
|
|
218
|
+
}
|
|
219
|
+
Blockly.Events.setGroup(false);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Fire a move event at the end of a bubble drag.
|
|
224
|
+
* @private
|
|
225
|
+
*/
|
|
226
|
+
Blockly.BubbleDragger.prototype.fireMoveEvent_ = function() {
|
|
227
|
+
if (this.draggingBubble_.isComment) {
|
|
228
|
+
var event = new Blockly.Events.CommentMove(
|
|
229
|
+
/** @type {!Blockly.WorkspaceCommentSvg} */ (this.draggingBubble_));
|
|
230
|
+
event.setOldCoordinate(this.startXY_);
|
|
231
|
+
event.recordNew();
|
|
232
|
+
Blockly.Events.fire(event);
|
|
233
|
+
}
|
|
234
|
+
// TODO (fenichel): move events for comments.
|
|
235
|
+
return;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Convert a coordinate object from pixels to workspace units, including a
|
|
240
|
+
* correction for mutator workspaces.
|
|
241
|
+
* This function does not consider differing origins. It simply scales the
|
|
242
|
+
* input's x and y values.
|
|
243
|
+
* @param {!Blockly.utils.Coordinate} pixelCoord A coordinate with x and y
|
|
244
|
+
* values in CSS pixel units.
|
|
245
|
+
* @return {!Blockly.utils.Coordinate} The input coordinate divided by the
|
|
246
|
+
* workspace scale.
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
249
|
+
Blockly.BubbleDragger.prototype.pixelsToWorkspaceUnits_ = function(pixelCoord) {
|
|
250
|
+
var result = new Blockly.utils.Coordinate(
|
|
251
|
+
pixelCoord.x / this.workspace_.scale,
|
|
252
|
+
pixelCoord.y / this.workspace_.scale);
|
|
253
|
+
if (this.workspace_.isMutator) {
|
|
254
|
+
// If we're in a mutator, its scale is always 1, purely because of some
|
|
255
|
+
// oddities in our rendering optimizations. The actual scale is the same as
|
|
256
|
+
// the scale on the parent workspace.
|
|
257
|
+
// Fix that for dragging.
|
|
258
|
+
var mainScale = this.workspace_.options.parentWorkspace.scale;
|
|
259
|
+
result.scale(1 / mainScale);
|
|
260
|
+
}
|
|
261
|
+
return result;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Move the bubble onto the drag surface at the beginning of a drag. Move the
|
|
266
|
+
* drag surface to preserve the apparent location of the bubble.
|
|
267
|
+
* @private
|
|
268
|
+
*/
|
|
269
|
+
Blockly.BubbleDragger.prototype.moveToDragSurface_ = function() {
|
|
270
|
+
this.draggingBubble_.moveTo(0, 0);
|
|
271
|
+
this.dragSurface_.translateSurface(this.startXY_.x, this.startXY_.y);
|
|
272
|
+
// Execute the move on the top-level SVG component.
|
|
273
|
+
this.dragSurface_.setBlocksAndShow(this.draggingBubble_.getSvgRoot());
|
|
274
|
+
};
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2011 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Object representing a code comment.
|
|
9
|
+
* @author fraser@google.com (Neil Fraser)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.Comment');
|
|
14
|
+
|
|
15
|
+
goog.require('Blockly.Bubble');
|
|
16
|
+
goog.require('Blockly.Css');
|
|
17
|
+
goog.require('Blockly.Events');
|
|
18
|
+
goog.require('Blockly.Events.BlockChange');
|
|
19
|
+
goog.require('Blockly.Events.Ui');
|
|
20
|
+
goog.require('Blockly.Icon');
|
|
21
|
+
goog.require('Blockly.utils.deprecation');
|
|
22
|
+
goog.require('Blockly.utils.dom');
|
|
23
|
+
goog.require('Blockly.utils.object');
|
|
24
|
+
goog.require('Blockly.utils.Svg');
|
|
25
|
+
goog.require('Blockly.utils.userAgent');
|
|
26
|
+
goog.require('Blockly.Warning');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Class for a comment.
|
|
31
|
+
* @param {!Blockly.Block} block The block associated with this comment.
|
|
32
|
+
* @extends {Blockly.Icon}
|
|
33
|
+
* @constructor
|
|
34
|
+
*/
|
|
35
|
+
Blockly.Comment = function(block) {
|
|
36
|
+
Blockly.Comment.superClass_.constructor.call(this, block);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The model for this comment.
|
|
40
|
+
* @type {!Blockly.Block.CommentModel}
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
this.model_ = block.commentModel;
|
|
44
|
+
// If someone creates the comment directly instead of calling
|
|
45
|
+
// block.setCommentText we want to make sure the text is non-null;
|
|
46
|
+
this.model_.text = this.model_.text || '';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The model's text value at the start of an edit.
|
|
50
|
+
* Used to tell if an event should be fired at the end of an edit.
|
|
51
|
+
* @type {?string}
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
this.cachedText_ = '';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Mouse up event data.
|
|
58
|
+
* @type {?Blockly.EventData}
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
this.onMouseUpWrapper_ = null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Wheel event data.
|
|
65
|
+
* @type {?Blockly.EventData}
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
this.onWheelWrapper_ = null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Change event data.
|
|
72
|
+
* @type {?Blockly.EventData}
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
this.onChangeWrapper_ = null;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Input event data.
|
|
79
|
+
* @type {?Blockly.EventData}
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
this.onInputWrapper_ = null;
|
|
83
|
+
|
|
84
|
+
this.createIcon();
|
|
85
|
+
};
|
|
86
|
+
Blockly.utils.object.inherits(Blockly.Comment, Blockly.Icon);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Draw the comment icon.
|
|
90
|
+
* @param {!Element} group The icon group.
|
|
91
|
+
* @protected
|
|
92
|
+
*/
|
|
93
|
+
Blockly.Comment.prototype.drawIcon_ = function(group) {
|
|
94
|
+
// Circle.
|
|
95
|
+
Blockly.utils.dom.createSvgElement(
|
|
96
|
+
Blockly.utils.Svg.CIRCLE,
|
|
97
|
+
{'class': 'blocklyIconShape', 'r': '8', 'cx': '8', 'cy': '8'},
|
|
98
|
+
group);
|
|
99
|
+
// Can't use a real '?' text character since different browsers and operating
|
|
100
|
+
// systems render it differently.
|
|
101
|
+
// Body of question mark.
|
|
102
|
+
Blockly.utils.dom.createSvgElement(
|
|
103
|
+
Blockly.utils.Svg.PATH,
|
|
104
|
+
{
|
|
105
|
+
'class': 'blocklyIconSymbol',
|
|
106
|
+
'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405' +
|
|
107
|
+
'0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25' +
|
|
108
|
+
'-1.201,0.998 -1.201,1.528 -1.204,2.19z'},
|
|
109
|
+
group);
|
|
110
|
+
// Dot of question mark.
|
|
111
|
+
Blockly.utils.dom.createSvgElement(
|
|
112
|
+
Blockly.utils.Svg.RECT,
|
|
113
|
+
{
|
|
114
|
+
'class': 'blocklyIconSymbol',
|
|
115
|
+
'x': '6.8',
|
|
116
|
+
'y': '10.78',
|
|
117
|
+
'height': '2',
|
|
118
|
+
'width': '2'
|
|
119
|
+
},
|
|
120
|
+
group);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Create the editor for the comment's bubble.
|
|
125
|
+
* @return {!SVGElement} The top-level node of the editor.
|
|
126
|
+
* @private
|
|
127
|
+
*/
|
|
128
|
+
Blockly.Comment.prototype.createEditor_ = function() {
|
|
129
|
+
/* Create the editor. Here's the markup that will be generated in
|
|
130
|
+
* editable mode:
|
|
131
|
+
<foreignObject x="8" y="8" width="164" height="164">
|
|
132
|
+
<body xmlns="http://www.w3.org/1999/xhtml" class="blocklyMinimalBody">
|
|
133
|
+
<textarea xmlns="http://www.w3.org/1999/xhtml"
|
|
134
|
+
class="blocklyCommentTextarea"
|
|
135
|
+
style="height: 164px; width: 164px;"></textarea>
|
|
136
|
+
</body>
|
|
137
|
+
</foreignObject>
|
|
138
|
+
* For non-editable mode see Warning.textToDom_.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
this.foreignObject_ = Blockly.utils.dom.createSvgElement(
|
|
142
|
+
Blockly.utils.Svg.FOREIGNOBJECT,
|
|
143
|
+
{'x': Blockly.Bubble.BORDER_WIDTH, 'y': Blockly.Bubble.BORDER_WIDTH},
|
|
144
|
+
null);
|
|
145
|
+
|
|
146
|
+
var body = document.createElementNS(Blockly.utils.dom.HTML_NS, 'body');
|
|
147
|
+
body.setAttribute('xmlns', Blockly.utils.dom.HTML_NS);
|
|
148
|
+
body.className = 'blocklyMinimalBody';
|
|
149
|
+
|
|
150
|
+
this.textarea_ = document.createElementNS(
|
|
151
|
+
Blockly.utils.dom.HTML_NS, 'textarea');
|
|
152
|
+
var textarea = this.textarea_;
|
|
153
|
+
textarea.className = 'blocklyCommentTextarea';
|
|
154
|
+
textarea.setAttribute('dir', this.block_.RTL ? 'RTL' : 'LTR');
|
|
155
|
+
textarea.value = this.model_.text;
|
|
156
|
+
this.resizeTextarea_();
|
|
157
|
+
|
|
158
|
+
body.appendChild(textarea);
|
|
159
|
+
this.foreignObject_.appendChild(body);
|
|
160
|
+
|
|
161
|
+
// Ideally this would be hooked to the focus event for the comment.
|
|
162
|
+
// However doing so in Firefox swallows the cursor for unknown reasons.
|
|
163
|
+
// So this is hooked to mouseup instead. No big deal.
|
|
164
|
+
this.onMouseUpWrapper_ = Blockly.bindEventWithChecks_(
|
|
165
|
+
textarea, 'mouseup', this, this.startEdit_, true, true);
|
|
166
|
+
// Don't zoom with mousewheel.
|
|
167
|
+
this.onWheelWrapper_ = Blockly.bindEventWithChecks_(
|
|
168
|
+
textarea, 'wheel', this, function(e) {
|
|
169
|
+
e.stopPropagation();
|
|
170
|
+
});
|
|
171
|
+
this.onChangeWrapper_ = Blockly.bindEventWithChecks_(
|
|
172
|
+
textarea, 'change', this, function(_e) {
|
|
173
|
+
if (this.cachedText_ != this.model_.text) {
|
|
174
|
+
Blockly.Events.fire(new Blockly.Events.BlockChange(
|
|
175
|
+
this.block_, 'comment', null, this.cachedText_, this.model_.text));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
this.onInputWrapper_ = Blockly.bindEventWithChecks_(
|
|
179
|
+
textarea, 'input', this, function(_e) {
|
|
180
|
+
this.model_.text = textarea.value;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
setTimeout(textarea.focus.bind(textarea), 0);
|
|
184
|
+
|
|
185
|
+
return this.foreignObject_;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Add or remove editability of the comment.
|
|
190
|
+
* @override
|
|
191
|
+
*/
|
|
192
|
+
Blockly.Comment.prototype.updateEditable = function() {
|
|
193
|
+
Blockly.Comment.superClass_.updateEditable.call(this);
|
|
194
|
+
if (this.isVisible()) {
|
|
195
|
+
// Recreate the bubble with the correct UI.
|
|
196
|
+
this.disposeBubble_();
|
|
197
|
+
this.createBubble_();
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Callback function triggered when the bubble has resized.
|
|
203
|
+
* Resize the text area accordingly.
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
206
|
+
Blockly.Comment.prototype.onBubbleResize_ = function() {
|
|
207
|
+
if (!this.isVisible()) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.model_.size = this.bubble_.getBubbleSize();
|
|
211
|
+
this.resizeTextarea_();
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Resizes the text area to match the size defined on the model (which is
|
|
216
|
+
* the size of the bubble).
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
Blockly.Comment.prototype.resizeTextarea_ = function() {
|
|
220
|
+
var size = this.model_.size;
|
|
221
|
+
var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH;
|
|
222
|
+
var widthMinusBorder = size.width - doubleBorderWidth;
|
|
223
|
+
var heightMinusBorder = size.height - doubleBorderWidth;
|
|
224
|
+
this.foreignObject_.setAttribute('width', widthMinusBorder);
|
|
225
|
+
this.foreignObject_.setAttribute('height', heightMinusBorder);
|
|
226
|
+
this.textarea_.style.width = (widthMinusBorder - 4) + 'px';
|
|
227
|
+
this.textarea_.style.height = (heightMinusBorder - 4) + 'px';
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Show or hide the comment bubble.
|
|
232
|
+
* @param {boolean} visible True if the bubble should be visible.
|
|
233
|
+
*/
|
|
234
|
+
Blockly.Comment.prototype.setVisible = function(visible) {
|
|
235
|
+
if (visible == this.isVisible()) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
Blockly.Events.fire(
|
|
239
|
+
new Blockly.Events.Ui(this.block_, 'commentOpen', !visible, visible));
|
|
240
|
+
this.model_.pinned = visible;
|
|
241
|
+
if (visible) {
|
|
242
|
+
this.createBubble_();
|
|
243
|
+
} else {
|
|
244
|
+
this.disposeBubble_();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Show the bubble. Handles deciding if it should be editable or not.
|
|
250
|
+
* @private
|
|
251
|
+
*/
|
|
252
|
+
Blockly.Comment.prototype.createBubble_ = function() {
|
|
253
|
+
if (!this.block_.isEditable() || Blockly.utils.userAgent.IE) {
|
|
254
|
+
// Steal the code from warnings to make an uneditable text bubble.
|
|
255
|
+
// MSIE does not support foreignobject; textareas are impossible.
|
|
256
|
+
// https://docs.microsoft.com/en-us/openspecs/ie_standards/ms-svg/56e6e04c-7c8c-44dd-8100-bd745ee42034
|
|
257
|
+
// Always treat comments in IE as uneditable.
|
|
258
|
+
this.createNonEditableBubble_();
|
|
259
|
+
} else {
|
|
260
|
+
this.createEditableBubble_();
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Show an editable bubble.
|
|
266
|
+
* @private
|
|
267
|
+
*/
|
|
268
|
+
Blockly.Comment.prototype.createEditableBubble_ = function() {
|
|
269
|
+
this.bubble_ = new Blockly.Bubble(
|
|
270
|
+
/** @type {!Blockly.WorkspaceSvg} */ (this.block_.workspace),
|
|
271
|
+
this.createEditor_(), this.block_.pathObject.svgPath,
|
|
272
|
+
/** @type {!Blockly.utils.Coordinate} */ (this.iconXY_),
|
|
273
|
+
this.model_.size.width, this.model_.size.height);
|
|
274
|
+
// Expose this comment's block's ID on its top-level SVG group.
|
|
275
|
+
this.bubble_.setSvgId(this.block_.id);
|
|
276
|
+
this.bubble_.registerResizeEvent(this.onBubbleResize_.bind(this));
|
|
277
|
+
this.applyColour();
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Show a non-editable bubble.
|
|
282
|
+
* @private
|
|
283
|
+
* @suppress {checkTypes} Suppress `this` type mismatch.
|
|
284
|
+
*/
|
|
285
|
+
Blockly.Comment.prototype.createNonEditableBubble_ = function() {
|
|
286
|
+
// TODO (#2917): It would be great if the comment could support line breaks.
|
|
287
|
+
Blockly.Warning.prototype.createBubble.call(this);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Dispose of the bubble.
|
|
292
|
+
* @private
|
|
293
|
+
* @suppress {checkTypes} Suppress `this` type mismatch.
|
|
294
|
+
*/
|
|
295
|
+
Blockly.Comment.prototype.disposeBubble_ = function() {
|
|
296
|
+
if (this.paragraphElement_) {
|
|
297
|
+
// We're using the warning UI so we have to let it dispose.
|
|
298
|
+
Blockly.Warning.prototype.disposeBubble.call(this);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (this.onMouseUpWrapper_) {
|
|
302
|
+
Blockly.unbindEvent_(this.onMouseUpWrapper_);
|
|
303
|
+
this.onMouseUpWrapper_ = null;
|
|
304
|
+
}
|
|
305
|
+
if (this.onWheelWrapper_) {
|
|
306
|
+
Blockly.unbindEvent_(this.onWheelWrapper_);
|
|
307
|
+
this.onWheelWrapper_ = null;
|
|
308
|
+
}
|
|
309
|
+
if (this.onChangeWrapper_) {
|
|
310
|
+
Blockly.unbindEvent_(this.onChangeWrapper_);
|
|
311
|
+
this.onChangeWrapper_ = null;
|
|
312
|
+
}
|
|
313
|
+
if (this.onInputWrapper_) {
|
|
314
|
+
Blockly.unbindEvent_(this.onInputWrapper_);
|
|
315
|
+
this.onInputWrapper_ = null;
|
|
316
|
+
}
|
|
317
|
+
this.bubble_.dispose();
|
|
318
|
+
this.bubble_ = null;
|
|
319
|
+
this.textarea_ = null;
|
|
320
|
+
this.foreignObject_ = null;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Callback fired when an edit starts.
|
|
325
|
+
*
|
|
326
|
+
* Bring the comment to the top of the stack when clicked on. Also cache the
|
|
327
|
+
* current text so it can be used to fire a change event.
|
|
328
|
+
* @param {!Event} _e Mouse up event.
|
|
329
|
+
* @private
|
|
330
|
+
*/
|
|
331
|
+
Blockly.Comment.prototype.startEdit_ = function(_e) {
|
|
332
|
+
if (this.bubble_.promote()) {
|
|
333
|
+
// Since the act of moving this node within the DOM causes a loss of focus,
|
|
334
|
+
// we need to reapply the focus.
|
|
335
|
+
this.textarea_.focus();
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
this.cachedText_ = this.model_.text;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Get the dimensions of this comment's bubble.
|
|
343
|
+
* @return {Blockly.utils.Size} Object with width and height properties.
|
|
344
|
+
*/
|
|
345
|
+
Blockly.Comment.prototype.getBubbleSize = function() {
|
|
346
|
+
return this.model_.size;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Size this comment's bubble.
|
|
351
|
+
* @param {number} width Width of the bubble.
|
|
352
|
+
* @param {number} height Height of the bubble.
|
|
353
|
+
*/
|
|
354
|
+
Blockly.Comment.prototype.setBubbleSize = function(width, height) {
|
|
355
|
+
if (this.bubble_) {
|
|
356
|
+
this.bubble_.setBubbleSize(width, height);
|
|
357
|
+
} else {
|
|
358
|
+
this.model_.size.width = width;
|
|
359
|
+
this.model_.size.height = height;
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Returns this comment's text.
|
|
365
|
+
* @return {string} Comment text.
|
|
366
|
+
* @deprecated August 2019 Use block.getCommentText() instead.
|
|
367
|
+
*/
|
|
368
|
+
Blockly.Comment.prototype.getText = function() {
|
|
369
|
+
Blockly.utils.deprecation.warn(
|
|
370
|
+
'Comment.prototype.getText',
|
|
371
|
+
'August 2019',
|
|
372
|
+
'December 2020',
|
|
373
|
+
'block.getCommentText');
|
|
374
|
+
return this.model_.text || '';
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Set this comment's text.
|
|
379
|
+
*
|
|
380
|
+
* If you want to receive a comment change event, then this should not be called
|
|
381
|
+
* directly. Instead call block.setCommentText();
|
|
382
|
+
* @param {string} text Comment text.
|
|
383
|
+
* @deprecated August 2019 Use block.setCommentText() instead.
|
|
384
|
+
*/
|
|
385
|
+
Blockly.Comment.prototype.setText = function(text) {
|
|
386
|
+
Blockly.utils.deprecation.warn(
|
|
387
|
+
'Comment.prototype.setText',
|
|
388
|
+
'August 2019',
|
|
389
|
+
'December 2020',
|
|
390
|
+
'block.setCommentText');
|
|
391
|
+
if (this.model_.text == text) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
this.model_.text = text;
|
|
395
|
+
this.updateText();
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Update the comment's view to match the model.
|
|
400
|
+
* @package
|
|
401
|
+
*/
|
|
402
|
+
Blockly.Comment.prototype.updateText = function() {
|
|
403
|
+
if (this.textarea_) {
|
|
404
|
+
this.textarea_.value = this.model_.text;
|
|
405
|
+
} else if (this.paragraphElement_) {
|
|
406
|
+
// Non-Editable mode.
|
|
407
|
+
// TODO (#2917): If 2917 gets added this will probably need to be updated.
|
|
408
|
+
this.paragraphElement_.firstChild.textContent = this.model_.text;
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Dispose of this comment.
|
|
414
|
+
*
|
|
415
|
+
* If you want to receive a comment "delete" event (newValue: null), then this
|
|
416
|
+
* should not be called directly. Instead call block.setCommentText(null);
|
|
417
|
+
*/
|
|
418
|
+
Blockly.Comment.prototype.dispose = function() {
|
|
419
|
+
this.block_.comment = null;
|
|
420
|
+
Blockly.Icon.prototype.dispose.call(this);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* CSS for block comment. See css.js for use.
|
|
425
|
+
*/
|
|
426
|
+
Blockly.Css.register([
|
|
427
|
+
/* eslint-disable indent */
|
|
428
|
+
'.blocklyCommentTextarea {',
|
|
429
|
+
'background-color: #fef49c;',
|
|
430
|
+
'border: 0;',
|
|
431
|
+
'outline: 0;',
|
|
432
|
+
'margin: 0;',
|
|
433
|
+
'padding: 3px;',
|
|
434
|
+
'resize: none;',
|
|
435
|
+
'display: block;',
|
|
436
|
+
'overflow: hidden;',
|
|
437
|
+
'}'
|
|
438
|
+
/* eslint-enable indent */
|
|
439
|
+
]);
|