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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Workspace metrics definitions.
|
|
9
|
+
* @author samelh@google.com (Sam El-Husseini)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.utils.Metrics');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @record
|
|
18
|
+
*/
|
|
19
|
+
Blockly.utils.Metrics = function() {};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Height of the visible portion of the workspace.
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
Blockly.utils.Metrics.prototype.viewHeight;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Width of the visible portion of the workspace.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
Blockly.utils.Metrics.prototype.viewWidth;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Height of the content.
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
Blockly.utils.Metrics.prototype.contentHeight;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Width of the content.
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
Blockly.utils.Metrics.prototype.contentWidth;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Top-edge of the visible portion of the workspace, relative to the workspace
|
|
47
|
+
* origin.
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
Blockly.utils.Metrics.prototype.viewTop;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Left-edge of the visible portion of the workspace, relative to the workspace
|
|
54
|
+
* origin.
|
|
55
|
+
* @type {number}
|
|
56
|
+
*/
|
|
57
|
+
Blockly.utils.Metrics.prototype.viewLeft;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Top-edge of the content, relative to the workspace origin.
|
|
61
|
+
* @type {number}
|
|
62
|
+
*/
|
|
63
|
+
Blockly.utils.Metrics.prototype.contentTop;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Left-edge of the content relative to the workspace origin.
|
|
67
|
+
* @type {number}
|
|
68
|
+
*/
|
|
69
|
+
Blockly.utils.Metrics.prototype.contentLeft;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Top-edge of the visible portion of the workspace, relative to the blocklyDiv.
|
|
73
|
+
* @type {number}
|
|
74
|
+
*/
|
|
75
|
+
Blockly.utils.Metrics.prototype.absoluteTop;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Left-edge of the visible portion of the workspace, relative to the
|
|
79
|
+
* blocklyDiv.
|
|
80
|
+
* @type {number}
|
|
81
|
+
*/
|
|
82
|
+
Blockly.utils.Metrics.prototype.absoluteLeft;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Height of the Blockly div (the view + the toolbox, simple of otherwise).
|
|
86
|
+
* @type {number|undefined}
|
|
87
|
+
*/
|
|
88
|
+
Blockly.utils.Metrics.prototype.svgHeight;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Width of the Blockly div (the view + the toolbox, simple or otherwise).
|
|
92
|
+
* @type {number|undefined}
|
|
93
|
+
*/
|
|
94
|
+
Blockly.utils.Metrics.prototype.svgWidth;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Width of the toolbox, if it exists. Otherwise zero.
|
|
98
|
+
* @type {number|undefined}
|
|
99
|
+
*/
|
|
100
|
+
Blockly.utils.Metrics.prototype.toolboxWidth;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Height of the toolbox, if it exists. Otherwise zero.
|
|
104
|
+
* @type {number|undefined}
|
|
105
|
+
*/
|
|
106
|
+
Blockly.utils.Metrics.prototype.toolboxHeight;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Top, bottom, left or right. Use TOOLBOX_AT constants to compare.
|
|
110
|
+
* @type {number|undefined}
|
|
111
|
+
*/
|
|
112
|
+
Blockly.utils.Metrics.prototype.toolboxPosition;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Width of the flyout if it is always open. Otherwise zero.
|
|
116
|
+
* @type {number|undefined}
|
|
117
|
+
*/
|
|
118
|
+
Blockly.utils.Metrics.prototype.flyoutWidth;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Height of the flyout if it is always open. Otherwise zero.
|
|
122
|
+
* @type {number|undefined}
|
|
123
|
+
*/
|
|
124
|
+
Blockly.utils.Metrics.prototype.flyoutHeight;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Utility methods for objects.
|
|
9
|
+
* @author samelh@google.com (Sam El-Husseini)
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
goog.provide('Blockly.utils.object');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Inherit the prototype methods from one constructor into another.
|
|
18
|
+
*
|
|
19
|
+
* @param {!Function} childCtor Child class.
|
|
20
|
+
* @param {!Function} parentCtor Parent class.
|
|
21
|
+
* @suppress {strictMissingProperties} superClass_ is not defined on Function.
|
|
22
|
+
*/
|
|
23
|
+
Blockly.utils.object.inherits = function(childCtor, parentCtor) {
|
|
24
|
+
childCtor.superClass_ = parentCtor.prototype;
|
|
25
|
+
childCtor.prototype = Object.create(parentCtor.prototype);
|
|
26
|
+
childCtor.prototype.constructor = childCtor;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Copies all the members of a source object to a target object.
|
|
31
|
+
* @param {!Object} target Target.
|
|
32
|
+
* @param {!Object} source Source.
|
|
33
|
+
*/
|
|
34
|
+
Blockly.utils.object.mixin = function(target, source) {
|
|
35
|
+
for (var x in source) {
|
|
36
|
+
target[x] = source[x];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Complete a deep merge of all members of a source object with a target object.
|
|
42
|
+
* @param {!Object} target Target.
|
|
43
|
+
* @param {!Object} source Source.
|
|
44
|
+
* @return {!Object} The resulting object.
|
|
45
|
+
*/
|
|
46
|
+
Blockly.utils.object.deepMerge = function(target, source) {
|
|
47
|
+
for (var x in source) {
|
|
48
|
+
if (source[x] != null && typeof source[x] === 'object') {
|
|
49
|
+
target[x] = Blockly.utils.object.deepMerge(
|
|
50
|
+
target[x] || Object.create(null), source[x]);
|
|
51
|
+
} else {
|
|
52
|
+
target[x] = source[x];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return target;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns an array of a given object's own enumerable property values.
|
|
60
|
+
* @param {!Object} obj Object containing values.
|
|
61
|
+
* @return {!Array} Array of values.
|
|
62
|
+
*/
|
|
63
|
+
Blockly.utils.object.values = function(obj) {
|
|
64
|
+
if (Object.values) {
|
|
65
|
+
/* eslint-disable es5/no-es6-methods */
|
|
66
|
+
return Object.values(obj);
|
|
67
|
+
/* eslint-enable es5/no-es6-methods */
|
|
68
|
+
}
|
|
69
|
+
// Fallback for IE.
|
|
70
|
+
return Object.keys(obj).map(function(e) {
|
|
71
|
+
return obj[e];
|
|
72
|
+
});
|
|
73
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Utility methods for rectangle manipulation.
|
|
9
|
+
* These methods are not specific to Blockly, and could be factored out into
|
|
10
|
+
* a JavaScript framework such as Closure.
|
|
11
|
+
* @author fraser@google.com (Neil Fraser)
|
|
12
|
+
*/
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name Blockly.utils.Rect
|
|
17
|
+
* @namespace
|
|
18
|
+
*/
|
|
19
|
+
goog.provide('Blockly.utils.Rect');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Class for representing rectangular regions.
|
|
24
|
+
* @param {number} top Top.
|
|
25
|
+
* @param {number} bottom Bottom.
|
|
26
|
+
* @param {number} left Left.
|
|
27
|
+
* @param {number} right Right.
|
|
28
|
+
* @struct
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
Blockly.utils.Rect = function(top, bottom, left, right) {
|
|
32
|
+
/** @type {number} */
|
|
33
|
+
this.top = top;
|
|
34
|
+
|
|
35
|
+
/** @type {number} */
|
|
36
|
+
this.bottom = bottom;
|
|
37
|
+
|
|
38
|
+
/** @type {number} */
|
|
39
|
+
this.left = left;
|
|
40
|
+
|
|
41
|
+
/** @type {number} */
|
|
42
|
+
this.right = right;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Tests whether this rectangle contains a x/y coordinate.
|
|
47
|
+
*
|
|
48
|
+
* @param {number} x The x coordinate to test for containment.
|
|
49
|
+
* @param {number} y The y coordinate to test for containment.
|
|
50
|
+
* @return {boolean} Whether this rectangle contains given coordinate.
|
|
51
|
+
*/
|
|
52
|
+
Blockly.utils.Rect.prototype.contains = function(x, y) {
|
|
53
|
+
return x >= this.left && x <= this.right && y >= this.top && y <= this.bottom;
|
|
54
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Utility methods for size calculation.
|
|
9
|
+
* These methods are not specific to Blockly, and could be factored out into
|
|
10
|
+
* a JavaScript framework such as Closure.
|
|
11
|
+
* @author samelh@google.com (Sam El-Husseini)
|
|
12
|
+
*/
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name Blockly.utils.Size
|
|
17
|
+
* @namespace
|
|
18
|
+
*/
|
|
19
|
+
goog.provide('Blockly.utils.Size');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Class for representing sizes consisting of a width and height.
|
|
24
|
+
* @param {number} width Width.
|
|
25
|
+
* @param {number} height Height.
|
|
26
|
+
* @struct
|
|
27
|
+
* @constructor
|
|
28
|
+
*/
|
|
29
|
+
Blockly.utils.Size = function(width, height) {
|
|
30
|
+
/**
|
|
31
|
+
* Width
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
this.width = width;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Height
|
|
38
|
+
* @type {number}
|
|
39
|
+
*/
|
|
40
|
+
this.height = height;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Compares sizes for equality.
|
|
45
|
+
* @param {Blockly.utils.Size} a A Size.
|
|
46
|
+
* @param {Blockly.utils.Size} b A Size.
|
|
47
|
+
* @return {boolean} True iff the sizes have equal widths and equal
|
|
48
|
+
* heights, or if both are null.
|
|
49
|
+
*/
|
|
50
|
+
Blockly.utils.Size.equals = function(a, b) {
|
|
51
|
+
if (a == b) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (!a || !b) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return a.width == b.width && a.height == b.height;
|
|
58
|
+
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Utility methods for string manipulation.
|
|
9
|
+
* These methods are not specific to Blockly, and could be factored out into
|
|
10
|
+
* a JavaScript framework such as Closure.
|
|
11
|
+
* @author fraser@google.com (Neil Fraser)
|
|
12
|
+
*/
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name Blockly.utils.string
|
|
17
|
+
* @namespace
|
|
18
|
+
*/
|
|
19
|
+
goog.provide('Blockly.utils.string');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Fast prefix-checker.
|
|
24
|
+
* Copied from Closure's goog.string.startsWith.
|
|
25
|
+
* @param {string} str The string to check.
|
|
26
|
+
* @param {string} prefix A string to look for at the start of `str`.
|
|
27
|
+
* @return {boolean} True if `str` begins with `prefix`.
|
|
28
|
+
*/
|
|
29
|
+
Blockly.utils.string.startsWith = function(str, prefix) {
|
|
30
|
+
return str.lastIndexOf(prefix, 0) == 0;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Given an array of strings, return the length of the shortest one.
|
|
35
|
+
* @param {!Array.<string>} array Array of strings.
|
|
36
|
+
* @return {number} Length of shortest string.
|
|
37
|
+
*/
|
|
38
|
+
Blockly.utils.string.shortestStringLength = function(array) {
|
|
39
|
+
if (!array.length) {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
return array.reduce(function(a, b) {
|
|
43
|
+
return a.length < b.length ? a : b;
|
|
44
|
+
}).length;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Given an array of strings, return the length of the common prefix.
|
|
49
|
+
* Words may not be split. Any space after a word is included in the length.
|
|
50
|
+
* @param {!Array.<string>} array Array of strings.
|
|
51
|
+
* @param {number=} opt_shortest Length of shortest string.
|
|
52
|
+
* @return {number} Length of common prefix.
|
|
53
|
+
*/
|
|
54
|
+
Blockly.utils.string.commonWordPrefix = function(array, opt_shortest) {
|
|
55
|
+
if (!array.length) {
|
|
56
|
+
return 0;
|
|
57
|
+
} else if (array.length == 1) {
|
|
58
|
+
return array[0].length;
|
|
59
|
+
}
|
|
60
|
+
var wordPrefix = 0;
|
|
61
|
+
var max = opt_shortest || Blockly.utils.string.shortestStringLength(array);
|
|
62
|
+
for (var len = 0; len < max; len++) {
|
|
63
|
+
var letter = array[0][len];
|
|
64
|
+
for (var i = 1; i < array.length; i++) {
|
|
65
|
+
if (letter != array[i][len]) {
|
|
66
|
+
return wordPrefix;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (letter == ' ') {
|
|
70
|
+
wordPrefix = len + 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (var i = 1; i < array.length; i++) {
|
|
74
|
+
var letter = array[i][len];
|
|
75
|
+
if (letter && letter != ' ') {
|
|
76
|
+
return wordPrefix;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return max;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Given an array of strings, return the length of the common suffix.
|
|
84
|
+
* Words may not be split. Any space after a word is included in the length.
|
|
85
|
+
* @param {!Array.<string>} array Array of strings.
|
|
86
|
+
* @param {number=} opt_shortest Length of shortest string.
|
|
87
|
+
* @return {number} Length of common suffix.
|
|
88
|
+
*/
|
|
89
|
+
Blockly.utils.string.commonWordSuffix = function(array, opt_shortest) {
|
|
90
|
+
if (!array.length) {
|
|
91
|
+
return 0;
|
|
92
|
+
} else if (array.length == 1) {
|
|
93
|
+
return array[0].length;
|
|
94
|
+
}
|
|
95
|
+
var wordPrefix = 0;
|
|
96
|
+
var max = opt_shortest || Blockly.utils.string.shortestStringLength(array);
|
|
97
|
+
for (var len = 0; len < max; len++) {
|
|
98
|
+
var letter = array[0].substr(-len - 1, 1);
|
|
99
|
+
for (var i = 1; i < array.length; i++) {
|
|
100
|
+
if (letter != array[i].substr(-len - 1, 1)) {
|
|
101
|
+
return wordPrefix;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (letter == ' ') {
|
|
105
|
+
wordPrefix = len + 1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (var i = 1; i < array.length; i++) {
|
|
109
|
+
var letter = array[i].charAt(array[i].length - len - 1);
|
|
110
|
+
if (letter && letter != ' ') {
|
|
111
|
+
return wordPrefix;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return max;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Wrap text to the specified width.
|
|
119
|
+
* @param {string} text Text to wrap.
|
|
120
|
+
* @param {number} limit Width to wrap each line.
|
|
121
|
+
* @return {string} Wrapped text.
|
|
122
|
+
*/
|
|
123
|
+
Blockly.utils.string.wrap = function(text, limit) {
|
|
124
|
+
var lines = text.split('\n');
|
|
125
|
+
for (var i = 0; i < lines.length; i++) {
|
|
126
|
+
lines[i] = Blockly.utils.string.wrapLine_(lines[i], limit);
|
|
127
|
+
}
|
|
128
|
+
return lines.join('\n');
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Wrap single line of text to the specified width.
|
|
133
|
+
* @param {string} text Text to wrap.
|
|
134
|
+
* @param {number} limit Width to wrap each line.
|
|
135
|
+
* @return {string} Wrapped text.
|
|
136
|
+
* @private
|
|
137
|
+
*/
|
|
138
|
+
Blockly.utils.string.wrapLine_ = function(text, limit) {
|
|
139
|
+
if (text.length <= limit) {
|
|
140
|
+
// Short text, no need to wrap.
|
|
141
|
+
return text;
|
|
142
|
+
}
|
|
143
|
+
// Split the text into words.
|
|
144
|
+
var words = text.trim().split(/\s+/);
|
|
145
|
+
// Set limit to be the length of the largest word.
|
|
146
|
+
for (var i = 0; i < words.length; i++) {
|
|
147
|
+
if (words[i].length > limit) {
|
|
148
|
+
limit = words[i].length;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var lastScore;
|
|
153
|
+
var score = -Infinity;
|
|
154
|
+
var lastText;
|
|
155
|
+
var lineCount = 1;
|
|
156
|
+
do {
|
|
157
|
+
lastScore = score;
|
|
158
|
+
lastText = text;
|
|
159
|
+
// Create a list of booleans representing if a space (false) or
|
|
160
|
+
// a break (true) appears after each word.
|
|
161
|
+
var wordBreaks = [];
|
|
162
|
+
// Seed the list with evenly spaced linebreaks.
|
|
163
|
+
var steps = words.length / lineCount;
|
|
164
|
+
var insertedBreaks = 1;
|
|
165
|
+
for (var i = 0; i < words.length - 1; i++) {
|
|
166
|
+
if (insertedBreaks < (i + 1.5) / steps) {
|
|
167
|
+
insertedBreaks++;
|
|
168
|
+
wordBreaks[i] = true;
|
|
169
|
+
} else {
|
|
170
|
+
wordBreaks[i] = false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
wordBreaks = Blockly.utils.string.wrapMutate_(words, wordBreaks, limit);
|
|
174
|
+
score = Blockly.utils.string.wrapScore_(words, wordBreaks, limit);
|
|
175
|
+
text = Blockly.utils.string.wrapToText_(words, wordBreaks);
|
|
176
|
+
lineCount++;
|
|
177
|
+
} while (score > lastScore);
|
|
178
|
+
return lastText;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Compute a score for how good the wrapping is.
|
|
183
|
+
* @param {!Array.<string>} words Array of each word.
|
|
184
|
+
* @param {!Array.<boolean>} wordBreaks Array of line breaks.
|
|
185
|
+
* @param {number} limit Width to wrap each line.
|
|
186
|
+
* @return {number} Larger the better.
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
Blockly.utils.string.wrapScore_ = function(words, wordBreaks, limit) {
|
|
190
|
+
// If this function becomes a performance liability, add caching.
|
|
191
|
+
// Compute the length of each line.
|
|
192
|
+
var lineLengths = [0];
|
|
193
|
+
var linePunctuation = [];
|
|
194
|
+
for (var i = 0; i < words.length; i++) {
|
|
195
|
+
lineLengths[lineLengths.length - 1] += words[i].length;
|
|
196
|
+
if (wordBreaks[i] === true) {
|
|
197
|
+
lineLengths.push(0);
|
|
198
|
+
linePunctuation.push(words[i].charAt(words[i].length - 1));
|
|
199
|
+
} else if (wordBreaks[i] === false) {
|
|
200
|
+
lineLengths[lineLengths.length - 1]++;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
var maxLength = Math.max.apply(Math, lineLengths);
|
|
204
|
+
|
|
205
|
+
var score = 0;
|
|
206
|
+
for (var i = 0; i < lineLengths.length; i++) {
|
|
207
|
+
// Optimize for width.
|
|
208
|
+
// -2 points per char over limit (scaled to the power of 1.5).
|
|
209
|
+
score -= Math.pow(Math.abs(limit - lineLengths[i]), 1.5) * 2;
|
|
210
|
+
// Optimize for even lines.
|
|
211
|
+
// -1 point per char smaller than max (scaled to the power of 1.5).
|
|
212
|
+
score -= Math.pow(maxLength - lineLengths[i], 1.5);
|
|
213
|
+
// Optimize for structure.
|
|
214
|
+
// Add score to line endings after punctuation.
|
|
215
|
+
if ('.?!'.indexOf(linePunctuation[i]) != -1) {
|
|
216
|
+
score += limit / 3;
|
|
217
|
+
} else if (',;)]}'.indexOf(linePunctuation[i]) != -1) {
|
|
218
|
+
score += limit / 4;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// All else being equal, the last line should not be longer than the
|
|
222
|
+
// previous line. For example, this looks wrong:
|
|
223
|
+
// aaa bbb
|
|
224
|
+
// ccc ddd eee
|
|
225
|
+
if (lineLengths.length > 1 && lineLengths[lineLengths.length - 1] <=
|
|
226
|
+
lineLengths[lineLengths.length - 2]) {
|
|
227
|
+
score += 0.5;
|
|
228
|
+
}
|
|
229
|
+
return score;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Mutate the array of line break locations until an optimal solution is found.
|
|
234
|
+
* No line breaks are added or deleted, they are simply moved around.
|
|
235
|
+
* @param {!Array.<string>} words Array of each word.
|
|
236
|
+
* @param {!Array.<boolean>} wordBreaks Array of line breaks.
|
|
237
|
+
* @param {number} limit Width to wrap each line.
|
|
238
|
+
* @return {!Array.<boolean>} New array of optimal line breaks.
|
|
239
|
+
* @private
|
|
240
|
+
*/
|
|
241
|
+
Blockly.utils.string.wrapMutate_ = function(words, wordBreaks, limit) {
|
|
242
|
+
var bestScore = Blockly.utils.string.wrapScore_(words, wordBreaks, limit);
|
|
243
|
+
var bestBreaks;
|
|
244
|
+
// Try shifting every line break forward or backward.
|
|
245
|
+
for (var i = 0; i < wordBreaks.length - 1; i++) {
|
|
246
|
+
if (wordBreaks[i] == wordBreaks[i + 1]) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
var mutatedWordBreaks = [].concat(wordBreaks);
|
|
250
|
+
mutatedWordBreaks[i] = !mutatedWordBreaks[i];
|
|
251
|
+
mutatedWordBreaks[i + 1] = !mutatedWordBreaks[i + 1];
|
|
252
|
+
var mutatedScore =
|
|
253
|
+
Blockly.utils.string.wrapScore_(words, mutatedWordBreaks, limit);
|
|
254
|
+
if (mutatedScore > bestScore) {
|
|
255
|
+
bestScore = mutatedScore;
|
|
256
|
+
bestBreaks = mutatedWordBreaks;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (bestBreaks) {
|
|
260
|
+
// Found an improvement. See if it may be improved further.
|
|
261
|
+
return Blockly.utils.string.wrapMutate_(words, bestBreaks, limit);
|
|
262
|
+
}
|
|
263
|
+
// No improvements found. Done.
|
|
264
|
+
return wordBreaks;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Reassemble the array of words into text, with the specified line breaks.
|
|
269
|
+
* @param {!Array.<string>} words Array of each word.
|
|
270
|
+
* @param {!Array.<boolean>} wordBreaks Array of line breaks.
|
|
271
|
+
* @return {string} Plain text.
|
|
272
|
+
* @private
|
|
273
|
+
*/
|
|
274
|
+
Blockly.utils.string.wrapToText_ = function(words, wordBreaks) {
|
|
275
|
+
var text = [];
|
|
276
|
+
for (var i = 0; i < words.length; i++) {
|
|
277
|
+
text.push(words[i]);
|
|
278
|
+
if (wordBreaks[i] !== undefined) {
|
|
279
|
+
text.push(wordBreaks[i] ? '\n' : ' ');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return text.join('');
|
|
283
|
+
};
|
|
284
|
+
|