blockly 9.3.0-beta.0 → 9.3.1
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/blockly.min.js +1674 -1520
- package/blockly_compressed.js +1313 -1152
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +166 -173
- package/blocks_compressed.js.map +1 -1
- package/core/any_aliases.d.ts +5 -0
- package/core/block.d.ts +49 -17
- package/core/block_animations.d.ts +0 -4
- package/core/block_drag_surface.d.ts +135 -0
- package/core/block_dragger.d.ts +2 -7
- package/core/block_svg.d.ts +72 -9
- package/core/blockly.d.ts +29 -58
- package/core/blockly_options.d.ts +0 -2
- package/core/blocks.d.ts +0 -2
- package/core/browser_events.d.ts +0 -9
- package/core/bubble.d.ts +6 -4
- package/core/bubble_dragger.d.ts +2 -3
- package/core/bump_objects.d.ts +0 -3
- package/core/clipboard.d.ts +0 -3
- package/core/comment.d.ts +6 -10
- package/core/common.d.ts +0 -12
- package/core/component_manager.d.ts +0 -2
- package/core/connection.d.ts +19 -6
- package/core/connection_checker.d.ts +1 -3
- package/core/connection_db.d.ts +0 -2
- package/core/connection_type.d.ts +0 -2
- package/core/constants.d.ts +0 -4
- package/core/contextmenu.d.ts +0 -11
- package/core/contextmenu_items.d.ts +0 -27
- package/core/contextmenu_registry.d.ts +0 -2
- package/core/css.d.ts +0 -2
- package/core/delete_area.d.ts +0 -2
- package/core/dialog.d.ts +0 -6
- package/core/drag_target.d.ts +0 -2
- package/core/events/events_abstract.d.ts +0 -3
- package/core/events/events_block_base.d.ts +0 -2
- package/core/events/events_block_change.d.ts +0 -2
- package/core/events/events_block_create.d.ts +0 -2
- package/core/events/events_block_delete.d.ts +0 -2
- package/core/events/events_block_drag.d.ts +0 -2
- package/core/events/events_block_move.d.ts +0 -2
- package/core/events/events_bubble_open.d.ts +0 -2
- package/core/events/events_click.d.ts +0 -2
- package/core/events/events_comment_base.d.ts +0 -2
- package/core/events/events_comment_change.d.ts +0 -2
- package/core/events/events_comment_create.d.ts +0 -2
- package/core/events/events_comment_delete.d.ts +0 -2
- package/core/events/events_comment_move.d.ts +0 -2
- package/core/events/events_marker_move.d.ts +0 -2
- package/core/events/events_selected.d.ts +0 -2
- package/core/events/events_theme_change.d.ts +0 -2
- package/core/events/events_toolbox_item_select.d.ts +0 -2
- package/core/events/events_trashcan_open.d.ts +0 -2
- package/core/events/events_ui.d.ts +0 -1
- package/core/events/events_ui_base.d.ts +0 -2
- package/core/events/events_var_base.d.ts +0 -2
- package/core/events/events_var_create.d.ts +0 -2
- package/core/events/events_viewport.d.ts +0 -2
- package/core/events/utils.d.ts +0 -73
- package/core/events/workspace_events.d.ts +0 -2
- package/core/extensions.d.ts +0 -8
- package/core/field.d.ts +16 -15
- package/core/field_angle.d.ts +60 -50
- package/core/field_checkbox.d.ts +22 -10
- package/core/field_colour.d.ts +55 -42
- package/core/field_dropdown.d.ts +34 -18
- package/core/field_image.d.ts +9 -12
- package/core/field_input.d.ts +34 -11
- package/core/field_label.d.ts +7 -10
- package/core/field_label_serializable.d.ts +4 -6
- package/core/field_multilineinput.d.ts +34 -12
- package/core/field_number.d.ts +27 -19
- package/core/field_registry.d.ts +0 -3
- package/core/field_textinput.d.ts +28 -12
- package/core/field_variable.d.ts +28 -16
- package/core/flyout_base.d.ts +5 -6
- package/core/flyout_button.d.ts +2 -2
- package/core/flyout_horizontal.d.ts +0 -2
- package/core/flyout_metrics_manager.d.ts +0 -2
- package/core/flyout_vertical.d.ts +0 -2
- package/core/generator.d.ts +0 -1
- package/core/gesture.d.ts +4 -17
- package/core/grid.d.ts +0 -2
- package/core/icon.d.ts +0 -2
- package/core/inject.d.ts +0 -1
- package/core/input.d.ts +0 -3
- package/core/input_types.d.ts +0 -2
- package/core/insertion_marker_manager.d.ts +6 -6
- package/core/interfaces/i_ast_node_location.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_svg.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -2
- package/core/interfaces/i_autohideable.d.ts +0 -2
- package/core/interfaces/i_block_dragger.d.ts +1 -3
- package/core/interfaces/i_bounded_element.d.ts +0 -2
- package/core/interfaces/i_bubble.d.ts +6 -4
- package/core/interfaces/i_collapsible_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_component.d.ts +0 -2
- package/core/interfaces/i_connection_checker.d.ts +0 -2
- package/core/interfaces/i_contextmenu.d.ts +0 -1
- package/core/interfaces/i_copyable.d.ts +3 -2
- package/core/interfaces/i_deletable.d.ts +0 -2
- package/core/interfaces/i_delete_area.d.ts +0 -2
- package/core/interfaces/i_drag_target.d.ts +0 -2
- package/core/interfaces/i_draggable.d.ts +0 -2
- package/core/interfaces/i_flyout.d.ts +0 -2
- package/core/interfaces/i_keyboard_accessible.d.ts +0 -2
- package/core/interfaces/i_legacy_procedure_blocks.d.ts +34 -0
- package/core/interfaces/i_metrics_manager.d.ts +0 -2
- package/core/interfaces/i_movable.d.ts +0 -2
- package/core/interfaces/i_positionable.d.ts +0 -2
- package/core/interfaces/i_procedure_model.d.ts +0 -5
- package/core/interfaces/i_registrable.d.ts +0 -2
- package/core/interfaces/i_selectable.d.ts +0 -2
- package/core/interfaces/i_selectable_toolbox_item.d.ts +4 -2
- package/core/interfaces/i_serializer.d.ts +0 -2
- package/core/interfaces/i_styleable.d.ts +0 -2
- package/core/interfaces/i_toolbox.d.ts +0 -2
- package/core/interfaces/i_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_variable_backed_parameter_model.d.ts +17 -0
- package/core/internal_constants.d.ts +0 -5
- package/core/keyboard_nav/ast_node.d.ts +0 -3
- package/core/keyboard_nav/basic_cursor.d.ts +0 -3
- package/core/keyboard_nav/cursor.d.ts +0 -3
- package/core/keyboard_nav/marker.d.ts +0 -2
- package/core/keyboard_nav/tab_navigate_cursor.d.ts +0 -2
- package/core/marker_manager.d.ts +0 -2
- package/core/menu.d.ts +0 -2
- package/core/menuitem.d.ts +0 -2
- package/core/metrics_manager.d.ts +0 -2
- package/core/mutator.d.ts +0 -2
- package/core/names.d.ts +0 -3
- package/core/options.d.ts +0 -2
- package/core/positionable_helpers.d.ts +0 -7
- package/core/procedures.d.ts +2 -25
- package/core/registry.d.ts +0 -11
- package/core/render_management.d.ts +15 -0
- package/core/rendered_connection.d.ts +22 -9
- package/core/renderers/common/block_rendering.d.ts +0 -3
- package/core/renderers/common/constants.d.ts +6 -51
- package/core/renderers/common/debug.d.ts +0 -3
- package/core/renderers/common/debugger.d.ts +9 -23
- package/core/renderers/common/drawer.d.ts +0 -5
- package/core/renderers/common/i_path_object.d.ts +0 -17
- package/core/renderers/common/info.d.ts +2 -12
- package/core/renderers/common/marker_svg.d.ts +2 -4
- package/core/renderers/common/path_object.d.ts +0 -24
- package/core/renderers/common/renderer.d.ts +5 -20
- package/core/renderers/geras/constants.d.ts +0 -5
- package/core/renderers/geras/drawer.d.ts +2 -4
- package/core/renderers/geras/highlight_constants.d.ts +6 -17
- package/core/renderers/geras/highlighter.d.ts +0 -13
- package/core/renderers/geras/info.d.ts +2 -5
- package/core/renderers/geras/measurables/inline_input.d.ts +0 -3
- package/core/renderers/geras/measurables/statement_input.d.ts +0 -3
- package/core/renderers/geras/path_object.d.ts +0 -8
- package/core/renderers/geras/renderer.d.ts +5 -7
- package/core/renderers/measurables/base.d.ts +0 -3
- package/core/renderers/measurables/bottom_row.d.ts +0 -9
- package/core/renderers/measurables/connection.d.ts +0 -3
- package/core/renderers/measurables/external_value_input.d.ts +0 -3
- package/core/renderers/measurables/field.d.ts +0 -3
- package/core/renderers/measurables/hat.d.ts +0 -3
- package/core/renderers/measurables/icon.d.ts +2 -5
- package/core/renderers/measurables/in_row_spacer.d.ts +0 -3
- package/core/renderers/measurables/inline_input.d.ts +1 -4
- package/core/renderers/measurables/input_connection.d.ts +1 -4
- package/core/renderers/measurables/input_row.d.ts +0 -7
- package/core/renderers/measurables/jagged_edge.d.ts +2 -5
- package/core/renderers/measurables/next_connection.d.ts +0 -3
- package/core/renderers/measurables/output_connection.d.ts +0 -3
- package/core/renderers/measurables/previous_connection.d.ts +0 -3
- package/core/renderers/measurables/round_corner.d.ts +0 -3
- package/core/renderers/measurables/row.d.ts +0 -39
- package/core/renderers/measurables/spacer_row.d.ts +0 -3
- package/core/renderers/measurables/square_corner.d.ts +0 -3
- package/core/renderers/measurables/statement_input.d.ts +0 -3
- package/core/renderers/measurables/top_row.d.ts +0 -6
- package/core/renderers/measurables/types.d.ts +0 -31
- package/core/renderers/minimalist/constants.d.ts +2 -4
- package/core/renderers/minimalist/drawer.d.ts +0 -3
- package/core/renderers/minimalist/info.d.ts +0 -4
- package/core/renderers/minimalist/renderer.d.ts +0 -3
- package/core/renderers/thrasos/info.d.ts +0 -4
- package/core/renderers/thrasos/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +3 -17
- package/core/renderers/zelos/drawer.d.ts +0 -3
- package/core/renderers/zelos/info.d.ts +0 -4
- package/core/renderers/zelos/marker_svg.d.ts +0 -2
- package/core/renderers/zelos/measurables/bottom_row.d.ts +0 -3
- package/core/renderers/zelos/measurables/inputs.d.ts +0 -3
- package/core/renderers/zelos/measurables/row_elements.d.ts +0 -3
- package/core/renderers/zelos/measurables/top_row.d.ts +0 -3
- package/core/renderers/zelos/path_object.d.ts +0 -9
- package/core/renderers/zelos/renderer.d.ts +3 -5
- package/core/scrollbar.d.ts +0 -2
- package/core/scrollbar_pair.d.ts +0 -2
- package/core/serialization/blocks.d.ts +3 -9
- package/core/serialization/exceptions.d.ts +0 -8
- package/core/serialization/priorities.d.ts +0 -4
- package/core/serialization/registry.d.ts +0 -2
- package/core/serialization/variables.d.ts +0 -4
- package/core/serialization/workspaces.d.ts +0 -2
- package/core/shortcut_items.d.ts +0 -17
- package/core/shortcut_registry.d.ts +0 -2
- package/core/sprites.d.ts +0 -2
- package/core/theme/classic.d.ts +0 -2
- package/core/theme/zelos.d.ts +0 -2
- package/core/theme.d.ts +0 -2
- package/core/theme_manager.d.ts +3 -6
- package/core/toolbox/category.d.ts +5 -7
- package/core/toolbox/collapsible_category.d.ts +0 -4
- package/core/toolbox/separator.d.ts +0 -2
- package/core/toolbox/toolbox.d.ts +2 -5
- package/core/toolbox/toolbox_item.d.ts +0 -2
- package/core/tooltip.d.ts +0 -29
- package/core/touch.d.ts +0 -13
- package/core/trashcan.d.ts +0 -2
- package/core/utils/aria.d.ts +0 -6
- package/core/utils/array.d.ts +0 -1
- package/core/utils/colour.d.ts +0 -12
- package/core/utils/coordinate.d.ts +0 -2
- package/core/utils/deprecation.d.ts +0 -1
- package/core/utils/dom.d.ts +0 -25
- package/core/utils/idgenerator.d.ts +0 -2
- package/core/utils/keycodes.d.ts +0 -2
- package/core/utils/math.d.ts +0 -3
- package/core/utils/metrics.d.ts +0 -1
- package/core/utils/object.d.ts +0 -4
- package/core/utils/parsing.d.ts +0 -4
- package/core/utils/rect.d.ts +0 -2
- package/core/utils/size.d.ts +0 -2
- package/core/utils/string.d.ts +0 -6
- package/core/utils/style.d.ts +0 -8
- package/core/utils/svg.d.ts +0 -2
- package/core/utils/svg_math.d.ts +0 -6
- package/core/utils/svg_paths.d.ts +0 -8
- package/core/utils/toolbox.d.ts +2 -35
- package/core/utils/useragent.d.ts +0 -8
- package/core/utils/xml.d.ts +9 -8
- package/core/utils.d.ts +0 -12
- package/core/variable_map.d.ts +1 -3
- package/core/variable_model.d.ts +0 -1
- package/core/variables.d.ts +13 -17
- package/core/variables_dynamic.d.ts +0 -4
- package/core/warning.d.ts +0 -2
- package/core/widgetdiv.d.ts +0 -10
- package/core/workspace.d.ts +3 -3
- package/core/workspace_audio.d.ts +0 -2
- package/core/workspace_comment.d.ts +1 -3
- package/core/workspace_comment_svg.d.ts +16 -5
- package/core/workspace_drag_surface_svg.d.ts +74 -0
- package/core/workspace_dragger.d.ts +3 -2
- package/core/workspace_svg.d.ts +48 -8
- package/core/xml.d.ts +1 -13
- package/core/zoom_controls.d.ts +4 -15
- package/dart_compressed.js +199 -199
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +168 -168
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +211 -211
- package/lua_compressed.js.map +1 -1
- package/msg/bn.js +2 -2
- package/msg/bs.js +7 -7
- package/msg/de.js +1 -1
- package/msg/fi.js +1 -1
- package/msg/fr.js +3 -3
- package/msg/ia.js +5 -5
- package/msg/kn.js +5 -5
- package/msg/ko.js +1 -1
- package/msg/lb.js +22 -22
- package/msg/sd.js +9 -9
- package/msg/skr-arab.js +2 -2
- package/msg/sl.js +18 -18
- package/msg/sw.js +1 -1
- package/msg/zh-hans.js +6 -6
- package/msg/zh-hant.js +2 -2
- package/package.json +6 -6
- package/php_compressed.js +185 -185
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +138 -138
- package/python_compressed.js.map +1 -1
- package/core/utils/sentinel.d.ts +0 -18
package/dart_compressed.js
CHANGED
|
@@ -24,94 +24,150 @@ module$exports$Blockly$Dart.dartGenerator.finish=function(a){a&&(a=this.prefixLi
|
|
|
24
24
|
module$exports$Blockly$Dart.dartGenerator.scrubNakedValue=function(a){return a+";\n"};module$exports$Blockly$Dart.dartGenerator.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\$/g,"\\$").replace(/'/g,"\\'");return"'"+a+"'"};module$exports$Blockly$Dart.dartGenerator.multiline_quote_=function(a){return a.split(/\n/g).map(this.quote_).join(" + '\\n' + \n")};
|
|
25
25
|
module$exports$Blockly$Dart.dartGenerator.scrub_=function(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.module$build$src$core$utils$string.wrap(e,this.COMMENT_WRAP-3),d=a.getProcedureDef?d+this.prefixLines(e+"\n","/// "):d+this.prefixLines(e+"\n","// "));for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.module$build$src$core$input_types.inputTypes.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&
|
|
26
26
|
(d+=this.prefixLines(e,"// "))}a=a.nextConnection&&a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c};
|
|
27
|
-
module$exports$Blockly$Dart.dartGenerator.getAdjusted=function(a,b,c,d,e){c=c||0;e=e||this.ORDER_NONE;a.workspace.options.oneBasedIndex&&c--;const f=a.workspace.options.oneBasedIndex?"1":"0";let g,h;c?h=g=this.ORDER_ADDITIVE:d?h=g=this.ORDER_UNARY_PREFIX:g=e;a=this.valueToCode(a,b,g)||f;$.module$build$src$core$utils$string.isNumber(a)?(a=parseInt(a,10)+c,d&&(a=-a)):(0<c?a=a+" + "+c:0>c&&(a=a+" - "+-c),d&&(a=c?"-("+a+")":"-"+a),h=Math.floor(h),e=Math.floor(e),h&&e>=h&&(a="("+a+")"));return a};var module$exports$Blockly$Dart$
|
|
28
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
module$exports$Blockly$Dart.dartGenerator.getAdjusted=function(a,b,c,d,e){c=c||0;e=e||this.ORDER_NONE;a.workspace.options.oneBasedIndex&&c--;const f=a.workspace.options.oneBasedIndex?"1":"0";let g,h;c?h=g=this.ORDER_ADDITIVE:d?h=g=this.ORDER_UNARY_PREFIX:g=e;a=this.valueToCode(a,b,g)||f;$.module$build$src$core$utils$string.isNumber(a)?(a=parseInt(a,10)+c,d&&(a=-a)):(0<c?a=a+" + "+c:0>c&&(a=a+" - "+-c),d&&(a=c?"-("+a+")":"-"+a),h=Math.floor(h),e=Math.floor(e),h&&e>=h&&(a="("+a+")"));return a};var module$exports$Blockly$Dart$colour={};module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.colour_picker=function(a){return[module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("COLOUR")),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
28
|
+
module$exports$Blockly$Dart.dartGenerator.colour_random=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_random",`
|
|
29
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
30
|
+
String hex = '0123456789abcdef';
|
|
31
|
+
var rnd = new Math.Random();
|
|
32
|
+
return '#\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
|
33
|
+
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
|
34
|
+
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}';
|
|
35
|
+
}
|
|
36
|
+
`)+"()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
37
|
+
module$exports$Blockly$Dart.dartGenerator.colour_rgb=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"RED",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0,c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"GREEN",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0;a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BLUE",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||0;module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
|
38
|
+
"import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_rgb",`
|
|
39
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(num r, num g, num b) {
|
|
40
|
+
num rn = (Math.max(Math.min(r, 100), 0) * 2.55).round();
|
|
41
|
+
String rs = rn.toInt().toRadixString(16);
|
|
42
|
+
rs = '0$rs';
|
|
43
|
+
rs = rs.substring(rs.length - 2);
|
|
44
|
+
num gn = (Math.max(Math.min(g, 100), 0) * 2.55).round();
|
|
45
|
+
String gs = gn.toInt().toRadixString(16);
|
|
46
|
+
gs = '0$gs';
|
|
47
|
+
gs = gs.substring(gs.length - 2);
|
|
48
|
+
num bn = (Math.max(Math.min(b, 100), 0) * 2.55).round();
|
|
49
|
+
String bs = bn.toInt().toRadixString(16);
|
|
50
|
+
bs = '0$bs';
|
|
51
|
+
bs = bs.substring(bs.length - 2);
|
|
52
|
+
return '#$rs$gs$bs';
|
|
53
|
+
}
|
|
54
|
+
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
55
|
+
module$exports$Blockly$Dart.dartGenerator.colour_blend=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"COLOUR1",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"'#000000'",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"COLOUR2",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"'#000000'";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"RATIO",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||.5;module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
|
56
|
+
"import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_blend",`
|
|
57
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String c1, String c2, num ratio) {
|
|
58
|
+
ratio = Math.max(Math.min(ratio, 1), 0);
|
|
59
|
+
int r1 = int.parse('0x\${c1.substring(1, 3)}');
|
|
60
|
+
int g1 = int.parse('0x\${c1.substring(3, 5)}');
|
|
61
|
+
int b1 = int.parse('0x\${c1.substring(5, 7)}');
|
|
62
|
+
int r2 = int.parse('0x\${c2.substring(1, 3)}');
|
|
63
|
+
int g2 = int.parse('0x\${c2.substring(3, 5)}');
|
|
64
|
+
int b2 = int.parse('0x\${c2.substring(5, 7)}');
|
|
65
|
+
num rn = (r1 * (1 - ratio) + r2 * ratio).round();
|
|
66
|
+
String rs = rn.toInt().toRadixString(16);
|
|
67
|
+
num gn = (g1 * (1 - ratio) + g2 * ratio).round();
|
|
68
|
+
String gs = gn.toInt().toRadixString(16);
|
|
69
|
+
num bn = (b1 * (1 - ratio) + b2 * ratio).round();
|
|
70
|
+
String bs = bn.toInt().toRadixString(16);
|
|
71
|
+
rs = '0$rs';
|
|
72
|
+
rs = rs.substring(rs.length - 2);
|
|
73
|
+
gs = '0$gs';
|
|
74
|
+
gs = gs.substring(gs.length - 2);
|
|
75
|
+
bs = '0$bs';
|
|
76
|
+
bs = bs.substring(bs.length - 2);
|
|
77
|
+
return '#$rs$gs$bs';
|
|
78
|
+
}
|
|
79
|
+
`)+"("+b+", "+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};var module$exports$Blockly$Dart$lists={},module$contents$Blockly$Dart$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.lists_create_empty=function(a){return["[]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
80
|
+
module$exports$Blockly$Dart.dartGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["["+b.join(", ")+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
81
|
+
module$exports$Blockly$Dart.dartGenerator.lists_repeat=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ITEM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["new List.filled("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
82
|
+
module$exports$Blockly$Dart.dartGenerator.lists_length=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".length",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
83
|
+
module$exports$Blockly$Dart.dartGenerator.lists_isEmpty=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".isEmpty",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
84
|
+
module$exports$Blockly$Dart.dartGenerator.lists_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FIND",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?[b+" + 1",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE]:
|
|
36
85
|
[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
37
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
86
|
+
module$exports$Blockly$Dart.dartGenerator.lists_getIndex=function(a){function b(){const f=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_list",$.NameType$$module$build$src$core$names.VARIABLE),g="List "+f+" = "+e+";\n";e=f;return g}var c=a.getFieldValue("MODE")||"GET";const d=a.getFieldValue("WHERE")||"FROM_START";let e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE","RANDOM"===d||"FROM_END"===d?module$exports$Blockly$Dart.dartGenerator.ORDER_NONE:module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||
|
|
87
|
+
"[]";if(("RANDOM"!==d||"REMOVE"!==c)&&"FROM_END"!==d||e.match(/^\w+$/))switch(d){case "FIRST":if("GET"===c)return[e+".first",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeAt(0)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return e+".removeAt(0);\n";break;case "LAST":if("GET"===c)return[e+".last",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeLast()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];
|
|
88
|
+
if("REMOVE"===c)return e+".removeLast();\n";break;case "FROM_START":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT");if("GET"===c)return[e+"["+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[e+".removeAt("+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return e+".removeAt("+a+");\n";break;case "FROM_END":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);
|
|
89
|
+
if("GET"===c)return[e+"["+e+".length - "+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c||"REMOVE"===c){a=e+".removeAt("+e+".length - "+a+")";if("GET_REMOVE"===c)return[a,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("REMOVE"===c)return a+";\n"}break;case "RANDOM":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";if("REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",
|
|
90
|
+
$.NameType$$module$build$src$core$names.VARIABLE),"int "+c+" = new Math.Random().nextInt("+e+".length);\n"+(e+".removeAt("+c+");\n");if("GET"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_random_item",`
|
|
91
|
+
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
|
92
|
+
int x = new Math.Random().nextInt(my_list.length);
|
|
93
|
+
return my_list[x];
|
|
41
94
|
}
|
|
42
|
-
`)+"("+
|
|
43
|
-
|
|
44
|
-
int x = new Math.Random().nextInt(
|
|
45
|
-
return
|
|
95
|
+
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_remove_random_item",`
|
|
96
|
+
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
|
97
|
+
int x = new Math.Random().nextInt(my_list.length);
|
|
98
|
+
return my_list.removeAt(x);
|
|
46
99
|
}
|
|
47
|
-
`)+"("+
|
|
48
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
100
|
+
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}else{if("RANDOM"===d)return module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",c=b(),a=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",$.NameType$$module$build$src$core$names.VARIABLE),c+("int "+a+" = new Math.Random().nextInt("+e+".length);\n")+(e+".removeAt("+a+");\n");if("REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
|
101
|
+
"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE),b()+(e+".removeAt("+e+".length - "+c+");\n");if("GET"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_from_end",`
|
|
102
|
+
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list, num x) {
|
|
103
|
+
x = my_list.length - x;
|
|
104
|
+
return my_list[x];
|
|
105
|
+
}
|
|
106
|
+
`)+"("+e+", "+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_remove_from_end",`
|
|
107
|
+
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list, num x) {
|
|
108
|
+
x = my_list.length - x;
|
|
109
|
+
return my_list.removeAt(x);
|
|
110
|
+
}
|
|
111
|
+
`)+"("+e+", "+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}throw Error("Unhandled combination (lists_getIndex).");};
|
|
112
|
+
module$exports$Blockly$Dart.dartGenerator.lists_setIndex=function(a){function b(){if(e.match(/^\w+$/))return"";const g=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_list",$.NameType$$module$build$src$core$names.VARIABLE),h="List "+g+" = "+e+";\n";e=g;return h}const c=a.getFieldValue("MODE")||"GET";var d=a.getFieldValue("WHERE")||"FROM_START";let e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||
|
|
113
|
+
"[]";const f=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"null";switch(d){case "FIRST":if("SET"===c)return e+"[0] = "+f+";\n";if("INSERT"===c)return e+".insert(0, "+f+");\n";break;case "LAST":if("SET"===c)return b()+(e+"["+e+".length - 1] = "+f+";\n");if("INSERT"===c)return e+".add("+f+");\n";break;case "FROM_START":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT");if("SET"===c)return e+"["+a+"] = "+f+";\n";
|
|
114
|
+
if("INSERT"===c)return e+".insert("+a+", "+f+");\n";break;case "FROM_END":a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);d=b();if("SET"===c)return d+(e+"["+e+".length - "+a+"] = "+f+";\n");if("INSERT"===c)return d+(e+".insert("+e+".length - "+a+", "+f+");\n");break;case "RANDOM":module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";a=b();d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",
|
|
115
|
+
$.NameType$$module$build$src$core$names.VARIABLE);a+="int "+d+" = new Math.Random().nextInt("+e+".length);\n";if("SET"===c)return a+(e+"["+d+"] = "+f+";\n");if("INSERT"===c)return a+(e+".insert("+d+", "+f+");\n")}throw Error("Unhandled combination (lists_setIndex).");};
|
|
116
|
+
module$exports$Blockly$Dart.dartGenerator.lists_getSublist=function(a){var b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]",c=a.getFieldValue("WHERE1");const d=a.getFieldValue("WHERE2");if(b.match(/^\w+$/)||"FROM_END"!==c&&"FROM_START"===d){switch(c){case "FROM_START":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1");break;case "FROM_END":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1",
|
|
117
|
+
1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);c=b+".length - "+c;break;case "FIRST":c="0";break;default:throw Error("Unhandled option (lists_getSublist).");}switch(d){case "FROM_START":var e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",0,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);e=b+".length - "+e;break;case "LAST":break;default:throw Error("Unhandled option (lists_getSublist).");
|
|
118
|
+
}b="LAST"===d?b+".sublist("+c+")":b+".sublist("+c+", "+e+")"}else e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1"),a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2"),b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_sublist",`
|
|
119
|
+
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String where1, num at1, String where2, num at2) {
|
|
52
120
|
int getAt(String where, num at) {
|
|
53
121
|
if (where == 'FROM_END') {
|
|
54
|
-
at =
|
|
122
|
+
at = list.length - 1 - at;
|
|
55
123
|
} else if (where == 'FIRST') {
|
|
56
124
|
at = 0;
|
|
57
125
|
} else if (where == 'LAST') {
|
|
58
|
-
at =
|
|
126
|
+
at = list.length - 1;
|
|
59
127
|
} else if (where != 'FROM_START') {
|
|
60
|
-
throw 'Unhandled option (
|
|
128
|
+
throw 'Unhandled option (lists_getSublist).';
|
|
61
129
|
}
|
|
62
130
|
return at;
|
|
63
131
|
}
|
|
64
132
|
at1 = getAt(where1, at1);
|
|
65
133
|
at2 = getAt(where2, at2) + 1;
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
`)+"("+e+", '"+b+"', "+f+", '"+c+"', "+a+")";return[c,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
69
|
-
module$exports$Blockly$Dart.dartGenerator.text_changeCase=function(a){const b={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[b?a+b:module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_toTitleCase",`
|
|
70
|
-
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String str) {
|
|
71
|
-
RegExp exp = new RegExp(r'\\b');
|
|
72
|
-
List<String> list = str.split(exp);
|
|
73
|
-
final title = new StringBuffer();
|
|
74
|
-
for (String part in list) {
|
|
75
|
-
if (part.length > 0) {
|
|
76
|
-
title.write(part[0].toUpperCase());
|
|
77
|
-
if (part.length > 0) {
|
|
78
|
-
title.write(part.substring(1).toLowerCase());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return title.toString();
|
|
134
|
+
return list.sublist(at1, at2);
|
|
83
135
|
}
|
|
84
|
-
`)+"("+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (index != -1) {
|
|
98
|
-
count++;
|
|
99
|
-
index += needle.length;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return count;
|
|
136
|
+
`)+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")";return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.lists_sort=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_sort",`
|
|
137
|
+
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
|
138
|
+
var compareFuncs = {
|
|
139
|
+
'NUMERIC': (a, b) => (direction * a.compareTo(b)).toInt(),
|
|
140
|
+
'TEXT': (a, b) => direction * a.toString().compareTo(b.toString()),
|
|
141
|
+
'IGNORE_CASE':
|
|
142
|
+
(a, b) => direction *
|
|
143
|
+
a.toString().toLowerCase().compareTo(b.toString().toLowerCase())
|
|
144
|
+
};
|
|
145
|
+
list = new List.from(list);
|
|
146
|
+
var compare = compareFuncs[type];
|
|
147
|
+
list.sort(compare);
|
|
148
|
+
return list;
|
|
103
149
|
}
|
|
104
|
-
`)+"("+b+
|
|
105
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
106
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
107
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
b]=
|
|
111
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
112
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
113
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
114
|
-
a.
|
|
150
|
+
`)+"("+b+', "'+a+'", '+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
151
|
+
module$exports$Blockly$Dart.dartGenerator.lists_split=function(a){let b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"INPUT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX);const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DELIM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)b||(b="''"),a="split";else if("JOIN"===a)b||(b="[]"),a="join";else throw Error("Unknown mode: "+a);return[b+"."+a+"("+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
152
|
+
module$exports$Blockly$Dart.dartGenerator.lists_reverse=function(a){return["new List.from("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]")+".reversed)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};var module$exports$Blockly$Dart$logic={};
|
|
153
|
+
module$exports$Blockly$Dart.dartGenerator.controls_if=function(a){let b=0,c="",d,e;module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));do e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"IF"+b,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO"+b),module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&
|
|
154
|
+
(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT)+d),c+=(0<b?"else ":"")+"if ("+e+") {\n"+d+"}",b++;while(a.getInput("IF"+b));if(a.getInput("ELSE")||module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX)d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"ELSE"),module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&
|
|
155
|
+
(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT)+d),c+=" else {\n"+d+"}";return c+"\n"};module$exports$Blockly$Dart.dartGenerator.controls_ifelse=module$exports$Blockly$Dart.dartGenerator.controls_if;
|
|
156
|
+
module$exports$Blockly$Dart.dartGenerator.logic_compare=function(a){const b={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c="=="===b||"!="===b?module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY:module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL,d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"A",c)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]};
|
|
157
|
+
module$exports$Blockly$Dart.dartGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"&&":"||",c="&&"===b?module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_AND:module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_OR;let d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",c);if(d||a){const e="&&"===b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};
|
|
158
|
+
module$exports$Blockly$Dart.dartGenerator.logic_negate=function(a){const b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX;return["!"+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BOOL",b)||"true"),b]};module$exports$Blockly$Dart.dartGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};module$exports$Blockly$Dart.dartGenerator.logic_null=function(a){return["null",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
159
|
+
module$exports$Blockly$Dart.dartGenerator.logic_ternary=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"IF",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"false",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"THEN",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ELSE",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";return[b+" ? "+c+" : "+a,module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL]};var module$exports$Blockly$Dart$loops={},module$contents$Blockly$Dart$loops_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Dart$loops_NameType=$.NameType$$module$build$src$core$names;
|
|
160
|
+
module$exports$Blockly$Dart.dartGenerator.controls_repeat_ext=function(a){let b;b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TIMES",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";let c=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");c=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(c,a);a="";const d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE);
|
|
161
|
+
let e=b;b.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(b)||(e=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("repeat_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+e+" = "+b+";\n");return a+("for (int "+d+" = 0; "+d+" < "+e+"; "+d+"++) {\n"+c+"}\n")};module$exports$Blockly$Dart.dartGenerator.controls_repeat=module$exports$Blockly$Dart.dartGenerator.controls_repeat_ext;
|
|
162
|
+
module$exports$Blockly$Dart.dartGenerator.controls_whileUntil=function(a){const b="UNTIL"===a.getFieldValue("MODE");let c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BOOL",b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(d,a);b&&(c="!"+c);return"while ("+c+") {\n"+d+"}\n"};
|
|
163
|
+
module$exports$Blockly$Dart.dartGenerator.controls_for=function(a){var b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FROM",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0",d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";const e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
|
164
|
+
"BY",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"1";let f=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");f=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(f,a);if($.module$build$src$core$utils$string.isNumber(c)&&$.module$build$src$core$utils$string.isNumber(d)&&$.module$build$src$core$utils$string.isNumber(e)){var g=Number(c)<=Number(d);a="for ("+b+" = "+c+"; "+b+(g?" <= ":" >= ")+d+"; "+b;b=Math.abs(Number(e));a=1===b?a+(g?"++":"--"):a+((g?" += ":" -= ")+
|
|
165
|
+
b);a+=") {\n"+f+"}\n"}else a="",g=c,c.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(c)||(g=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+"_start",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||$.module$build$src$core$utils$string.isNumber(d)||(c=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+"_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+c+" = "+d+";\n"),d=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName(b+
|
|
166
|
+
"_inc",$.NameType$$module$build$src$core$names.VARIABLE),a+="num "+d+" = ",a=$.module$build$src$core$utils$string.isNumber(e)?a+(Math.abs(e)+";\n"):a+("("+e+").abs();\n"),a+="if ("+g+" > "+c+") {\n",a+=module$exports$Blockly$Dart.dartGenerator.INDENT+d+" = -"+d+";\n",a=a+"}\nfor ("+(b+" = "+g+"; "+d+" >= 0 ? "+b+" <= "+c+" : "+b+" >= "+c+"; "+b+" += "+d+") {\n"+f+"}\n");return a};
|
|
167
|
+
module$exports$Blockly$Dart.dartGenerator.controls_forEach=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"[]";let d=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Dart.dartGenerator.addLoopTrap(d,a);return"for (var "+b+" in "+
|
|
168
|
+
c+") {\n"+d+"}\n"};
|
|
169
|
+
module$exports$Blockly$Dart.dartGenerator.controls_flow_statements=function(a){let b="";module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a));if(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX){const c=a.getSurroundLoop();
|
|
170
|
+
c&&!c.suppressPrefixSuffix&&(b+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,c))}switch(a.getFieldValue("FLOW")){case "BREAK":return b+"break;\n";case "CONTINUE":return b+"continue;\n"}throw Error("Unknown flow statement.");};var module$exports$Blockly$Dart$math={},module$contents$Blockly$Dart$math_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");
|
|
115
171
|
module$exports$Blockly$Dart.dartGenerator.math_number=function(a){a=Number(a.getFieldValue("NUM"));let b;Infinity===a?(a="double.infinity",b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX):-Infinity===a?(a="-double.infinity",b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX):b=0>a?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC;return[a,b]};
|
|
116
172
|
module$exports$Blockly$Dart.dartGenerator.math_arithmetic=function(a){var b={ADD:[" + ",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE],MINUS:[" - ",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE],MULTIPLY:[" * ",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE],POWER:[null,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE]}[a.getFieldValue("OP")];const c=b[0];b=b[1];const d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
|
117
173
|
"A",b)||"0";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",b)||"0";return c?[d+c+a,b]:(module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",["Math.pow("+d+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX])};
|
|
@@ -253,150 +309,94 @@ int ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(num
|
|
|
253
309
|
return new Math.Random().nextInt(b - a + 1) + a;
|
|
254
310
|
}
|
|
255
311
|
`)+"("+b+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.math_random_float=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";return["new Math.Random().nextDouble()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
256
|
-
module$exports$Blockly$Dart.dartGenerator.math_atan2=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"X",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";return["Math.atan2("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"Y",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+") / Math.pi * 180",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE]};var module$exports$Blockly$Dart$
|
|
257
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
258
|
-
|
|
259
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
265
|
-
|
|
266
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
267
|
-
c
|
|
268
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
272
|
-
module$exports$Blockly$Dart.dartGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"&&":"||",c="&&"===b?module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_AND:module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_OR;let d=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"B",c);if(d||a){const e="&&"===b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};
|
|
273
|
-
module$exports$Blockly$Dart.dartGenerator.logic_negate=function(a){const b=module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX;return["!"+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"BOOL",b)||"true"),b]};module$exports$Blockly$Dart.dartGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};module$exports$Blockly$Dart.dartGenerator.logic_null=function(a){return["null",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
274
|
-
module$exports$Blockly$Dart.dartGenerator.logic_ternary=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"IF",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"false",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"THEN",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ELSE",module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL)||"null";return[b+" ? "+c+" : "+a,module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL]};var module$exports$Blockly$Dart$lists={},module$contents$Blockly$Dart$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.lists_create_empty=function(a){return["[]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
275
|
-
module$exports$Blockly$Dart.dartGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ADD"+c,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["["+b.join(", ")+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
276
|
-
module$exports$Blockly$Dart.dartGenerator.lists_repeat=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ITEM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return["new List.filled("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"NUM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
277
|
-
module$exports$Blockly$Dart.dartGenerator.lists_length=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".length",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
278
|
-
module$exports$Blockly$Dart.dartGenerator.lists_isEmpty=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+".isEmpty",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
279
|
-
module$exports$Blockly$Dart.dartGenerator.lists_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FIND",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?[b+" + 1",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE]:
|
|
312
|
+
module$exports$Blockly$Dart.dartGenerator.math_atan2=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"X",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0";return["Math.atan2("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"Y",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"0")+", "+b+") / Math.pi * 180",module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE]};var module$exports$Blockly$Dart$procedures={},module$contents$Blockly$Dart$procedures_NameType=$.NameType$$module$build$src$core$names;
|
|
313
|
+
module$exports$Blockly$Dart.dartGenerator.procedures_defreturn=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE);var c="";module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(c+=module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,
|
|
314
|
+
a));c&&(c=module$exports$Blockly$Dart.dartGenerator.prefixLines(c,module$exports$Blockly$Dart.dartGenerator.INDENT));let d="";module$exports$Blockly$Dart.dartGenerator.INFINITE_LOOP_TRAP&&(d=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.INFINITE_LOOP_TRAP,a),module$exports$Blockly$Dart.dartGenerator.INDENT));const e=module$exports$Blockly$Dart.dartGenerator.statementToCode(a,"STACK");let f=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
|
315
|
+
"RETURN",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"",g="";e&&f&&(g=c);f&&(f=module$exports$Blockly$Dart.dartGenerator.INDENT+"return "+f+";\n");const h=f?"dynamic":"void",k=[],l=a.getVars();for(let m=0;m<l.length;m++)k[m]=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(l[m],$.NameType$$module$build$src$core$names.VARIABLE);c=h+" "+b+"("+k.join(", ")+") {\n"+c+d+e+g+f+"}";c=module$exports$Blockly$Dart.dartGenerator.scrub_(a,c);module$exports$Blockly$Dart.dartGenerator.definitions_["%"+
|
|
316
|
+
b]=c;return null};module$exports$Blockly$Dart.dartGenerator.procedures_defnoreturn=module$exports$Blockly$Dart.dartGenerator.procedures_defreturn;
|
|
317
|
+
module$exports$Blockly$Dart.dartGenerator.procedures_callreturn=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE),c=[],d=a.getVars();for(let e=0;e<d.length;e++)c[e]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ARG"+e,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null";return[b+"("+c.join(", ")+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
318
|
+
module$exports$Blockly$Dart.dartGenerator.procedures_callnoreturn=function(a){return module$exports$Blockly$Dart.dartGenerator.procedures_callreturn(a)[0]+";\n"};
|
|
319
|
+
module$exports$Blockly$Dart.dartGenerator.procedures_ifreturn=function(a){let b="if ("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"CONDITION",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"false")+") {\n";module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Dart.dartGenerator.prefixLines(module$exports$Blockly$Dart.dartGenerator.injectId(module$exports$Blockly$Dart.dartGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Dart.dartGenerator.INDENT));
|
|
320
|
+
a.hasReturnValue_?(a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"null",b+=module$exports$Blockly$Dart.dartGenerator.INDENT+"return "+a+";\n"):b+=module$exports$Blockly$Dart.dartGenerator.INDENT+"return;\n";return b+"}\n"};var module$exports$Blockly$Dart$texts={},module$contents$Blockly$Dart$texts_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.addReservedWords("Html,Math");module$exports$Blockly$Dart.dartGenerator.text=function(a){return[module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("TEXT")),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
321
|
+
module$exports$Blockly$Dart.dartGenerator.text_multiline=function(a){a=module$exports$Blockly$Dart.dartGenerator.multiline_quote_(a.getFieldValue("TEXT"));const b=-1!==a.indexOf("+")?module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE:module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC;return[a,b]};
|
|
322
|
+
module$exports$Blockly$Dart.dartGenerator.text_join=function(a){switch(a.itemCount_){case 0:return["''",module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC];case 1:return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"ADD0",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".toString()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];default:const b=Array(a.itemCount_);for(let c=0;c<a.itemCount_;c++)b[c]=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,
|
|
323
|
+
"ADD"+c,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return["["+b.join(",")+"].join()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}};
|
|
324
|
+
module$exports$Blockly$Dart.dartGenerator.text_append=function(a){const b=module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return b+" = ["+b+", "+a+"].join();\n"};
|
|
325
|
+
module$exports$Blockly$Dart.dartGenerator.text_length=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".length",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
326
|
+
module$exports$Blockly$Dart.dartGenerator.text_isEmpty=function(a){return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".isEmpty",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
327
|
+
module$exports$Blockly$Dart.dartGenerator.text_indexOf=function(a){var b="FIRST"===a.getFieldValue("END")?"indexOf":"lastIndexOf";const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FIND",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";b=(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+"."+b+"("+c+")";return a.workspace.options.oneBasedIndex?[b+" + 1",module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE]:
|
|
280
328
|
[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
281
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
282
|
-
"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
$.NameType$$module$build$src$core$names.VARIABLE),"int "+c+" = new Math.Random().nextInt("+e+".length);\n"+(e+".removeAt("+c+");\n");if("GET"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_random_item",`
|
|
286
|
-
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
|
287
|
-
int x = new Math.Random().nextInt(my_list.length);
|
|
288
|
-
return my_list[x];
|
|
289
|
-
}
|
|
290
|
-
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];if("GET_REMOVE"===c)return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_remove_random_item",`
|
|
291
|
-
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list) {
|
|
292
|
-
int x = new Math.Random().nextInt(my_list.length);
|
|
293
|
-
return my_list.removeAt(x);
|
|
294
|
-
}
|
|
295
|
-
`)+"("+e+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}else{if("RANDOM"===d)return module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",c=b(),a=module$exports$Blockly$Dart.dartGenerator.nameDB_.getDistinctName("tmp_x",$.NameType$$module$build$src$core$names.VARIABLE),c+("int "+a+" = new Math.Random().nextInt("+e+".length);\n")+(e+".removeAt("+a+");\n");if("REMOVE"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
|
296
|
-
"AT",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE),b()+(e+".removeAt("+e+".length - "+c+");\n");if("GET"===c)return c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_from_end",`
|
|
297
|
-
dynamic ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List my_list, num x) {
|
|
298
|
-
x = my_list.length - x;
|
|
299
|
-
return my_list[x];
|
|
329
|
+
module$exports$Blockly$Dart.dartGenerator.text_charAt=function(a){const b=a.getFieldValue("WHERE")||"FROM_START",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE","FIRST"===b||"FROM_START"===b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";switch(b){case "FIRST":return[c+"[0]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "FROM_START":return a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
|
330
|
+
"AT"),[c+"["+a+"]",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "LAST":case "FROM_END":return a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT",1),[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_get_from_end",`
|
|
331
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text, num x) {
|
|
332
|
+
return text[text.length - x];
|
|
300
333
|
}
|
|
301
|
-
`)+"("+
|
|
302
|
-
|
|
303
|
-
x =
|
|
304
|
-
return
|
|
334
|
+
`)+"("+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX];case "RANDOM":return module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;",[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_random_letter",`
|
|
335
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text) {
|
|
336
|
+
int x = new Math.Random().nextInt(text.length);
|
|
337
|
+
return text[x];
|
|
305
338
|
}
|
|
306
|
-
`)+"("+
|
|
307
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
308
|
-
"
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
module$exports$Blockly$Dart.dartGenerator.lists_getSublist=function(a){var b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"[]",c=a.getFieldValue("WHERE1");const d=a.getFieldValue("WHERE2");if(b.match(/^\w+$/)||"FROM_END"!==c&&"FROM_START"===d){switch(c){case "FROM_START":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1");break;case "FROM_END":c=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1",
|
|
312
|
-
1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);c=b+".length - "+c;break;case "FIRST":c="0";break;default:throw Error("Unhandled option (lists_getSublist).");}switch(d){case "FROM_START":var e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",0,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);e=b+".length - "+e;break;case "LAST":break;default:throw Error("Unhandled option (lists_getSublist).");
|
|
313
|
-
}b="LAST"===d?b+".sublist("+c+")":b+".sublist("+c+", "+e+")"}else e=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1"),a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2"),b=module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_get_sublist",`
|
|
314
|
-
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String where1, num at1, String where2, num at2) {
|
|
339
|
+
`)+"("+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]}throw Error("Unhandled option (text_charAt).");};
|
|
340
|
+
module$exports$Blockly$Dart.dartGenerator.text_getSubstring=function(a){var b=a.getFieldValue("WHERE1"),c=a.getFieldValue("WHERE2");const d="FROM_END"!==b&&"FROM_START"===c,e=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"STRING",d?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";if("FIRST"===b&&"LAST"===c)return[e,module$exports$Blockly$Dart.dartGenerator.ORDER_NONE];if(e.match(/^'?\w+'?$/)||d){switch(b){case "FROM_START":b=
|
|
341
|
+
module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1");break;case "FROM_END":b=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1",1,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);b=e+".length - "+b;break;case "FIRST":b="0";break;default:throw Error("Unhandled option (text_getSubstring).");}switch(c){case "FROM_START":var f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2",1);break;case "FROM_END":f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,
|
|
342
|
+
"AT2",0,!1,module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE);f=e+".length - "+f;break;case "LAST":break;default:throw Error("Unhandled option (text_getSubstring).");}c="LAST"===c?e+".substring("+b+")":e+".substring("+b+", "+f+")"}else f=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT1"),a=module$exports$Blockly$Dart.dartGenerator.getAdjusted(a,"AT2"),c=module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_get_substring",`
|
|
343
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String text, String where1, num at1, String where2, num at2) {
|
|
315
344
|
int getAt(String where, num at) {
|
|
316
345
|
if (where == 'FROM_END') {
|
|
317
|
-
at =
|
|
346
|
+
at = text.length - 1 - at;
|
|
318
347
|
} else if (where == 'FIRST') {
|
|
319
348
|
at = 0;
|
|
320
349
|
} else if (where == 'LAST') {
|
|
321
|
-
at =
|
|
350
|
+
at = text.length - 1;
|
|
322
351
|
} else if (where != 'FROM_START') {
|
|
323
|
-
throw 'Unhandled option (
|
|
352
|
+
throw 'Unhandled option (text_getSubstring).';
|
|
324
353
|
}
|
|
325
354
|
return at;
|
|
326
355
|
}
|
|
327
356
|
at1 = getAt(where1, at1);
|
|
328
357
|
at2 = getAt(where2, at2) + 1;
|
|
329
|
-
return
|
|
330
|
-
}
|
|
331
|
-
`)+"("+b+", '"+c+"', "+e+", '"+d+"', "+a+")";return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.lists_sort=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]",c="1"===a.getFieldValue("DIRECTION")?1:-1;a=a.getFieldValue("TYPE");return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("lists_sort",`
|
|
332
|
-
List ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
|
333
|
-
var compareFuncs = {
|
|
334
|
-
'NUMERIC': (a, b) => (direction * a.compareTo(b)).toInt(),
|
|
335
|
-
'TEXT': (a, b) => direction * a.toString().compareTo(b.toString()),
|
|
336
|
-
'IGNORE_CASE':
|
|
337
|
-
(a, b) => direction *
|
|
338
|
-
a.toString().toLowerCase().compareTo(b.toString().toLowerCase())
|
|
339
|
-
};
|
|
340
|
-
list = new List.from(list);
|
|
341
|
-
var compare = compareFuncs[type];
|
|
342
|
-
list.sort(compare);
|
|
343
|
-
return list;
|
|
344
|
-
}
|
|
345
|
-
`)+"("+b+', "'+a+'", '+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
346
|
-
module$exports$Blockly$Dart.dartGenerator.lists_split=function(a){let b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"INPUT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX);const c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"DELIM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)b||(b="''"),a="split";else if("JOIN"===a)b||(b="[]"),a="join";else throw Error("Unknown mode: "+a);return[b+"."+a+"("+c+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
347
|
-
module$exports$Blockly$Dart.dartGenerator.lists_reverse=function(a){return["new List.from("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"LIST",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"[]")+".reversed)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};var module$exports$Blockly$Dart$colour={};module$exports$Blockly$Dart.dartGenerator.addReservedWords("Math");module$exports$Blockly$Dart.dartGenerator.colour_picker=function(a){return[module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("COLOUR")),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
348
|
-
module$exports$Blockly$Dart.dartGenerator.colour_random=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math="import 'dart:math' as Math;";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("colour_random",`
|
|
349
|
-
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
350
|
-
String hex = '0123456789abcdef';
|
|
351
|
-
var rnd = new Math.Random();
|
|
352
|
-
return '#\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
|
353
|
-
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}'
|
|
354
|
-
'\${hex[rnd.nextInt(16)]}\${hex[rnd.nextInt(16)]}';
|
|
358
|
+
return text.substring(at1, at2);
|
|
355
359
|
}
|
|
356
|
-
`)+"()",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
357
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
bs = bs.substring(bs.length - 2);
|
|
372
|
-
return '#$rs$gs$bs';
|
|
360
|
+
`)+"("+e+", '"+b+"', "+f+", '"+c+"', "+a+")";return[c,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
361
|
+
module$exports$Blockly$Dart.dartGenerator.text_changeCase=function(a){const b={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",b?module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX:module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[b?a+b:module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_toTitleCase",`
|
|
362
|
+
String ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String str) {
|
|
363
|
+
RegExp exp = new RegExp(r'\\b');
|
|
364
|
+
List<String> list = str.split(exp);
|
|
365
|
+
final title = new StringBuffer();
|
|
366
|
+
for (String part in list) {
|
|
367
|
+
if (part.length > 0) {
|
|
368
|
+
title.write(part[0].toUpperCase());
|
|
369
|
+
if (part.length > 0) {
|
|
370
|
+
title.write(part.substring(1).toLowerCase());
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return title.toString();
|
|
373
375
|
}
|
|
374
|
-
`)+"("+
|
|
375
|
-
module$exports$Blockly$Dart.dartGenerator.
|
|
376
|
-
"import 'dart:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
int
|
|
384
|
-
int
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
gs = '0$gs';
|
|
394
|
-
gs = gs.substring(gs.length - 2);
|
|
395
|
-
bs = '0$bs';
|
|
396
|
-
bs = bs.substring(bs.length - 2);
|
|
397
|
-
return '#$rs$gs$bs';
|
|
376
|
+
`)+"("+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.text_trim=function(a){const b={LEFT:".replaceFirst(new RegExp(r'^\\s+'), '')",RIGHT:".replaceFirst(new RegExp(r'\\s+$'), '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
377
|
+
module$exports$Blockly$Dart.dartGenerator.text_print=function(a){return"print("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''")+");\n"};
|
|
378
|
+
module$exports$Blockly$Dart.dartGenerator.text_prompt_ext=function(a){module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_html="import 'dart:html' as Html;";let b="Html.window.prompt("+(a.getField("TEXT")?module$exports$Blockly$Dart.dartGenerator.quote_(a.getFieldValue("TEXT")):module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''")+", '')";"NUMBER"===a.getFieldValue("TYPE")&&(module$exports$Blockly$Dart.dartGenerator.definitions_.import_dart_math=
|
|
379
|
+
"import 'dart:math' as Math;",b="Math.parseDouble("+b+")");return[b,module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};module$exports$Blockly$Dart.dartGenerator.text_prompt=module$exports$Blockly$Dart.dartGenerator.text_prompt_ext;
|
|
380
|
+
module$exports$Blockly$Dart.dartGenerator.text_count=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"SUB",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[module$exports$Blockly$Dart.dartGenerator.provideFunction_("text_count",`
|
|
381
|
+
int ${module$exports$Blockly$Dart.dartGenerator.FUNCTION_NAME_PLACEHOLDER_}(String haystack, String needle) {
|
|
382
|
+
if (needle.length == 0) {
|
|
383
|
+
return haystack.length + 1;
|
|
384
|
+
}
|
|
385
|
+
int index = 0;
|
|
386
|
+
int count = 0;
|
|
387
|
+
while (index != -1) {
|
|
388
|
+
index = haystack.indexOf(needle, index);
|
|
389
|
+
if (index != -1) {
|
|
390
|
+
count++;
|
|
391
|
+
index += needle.length;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return count;
|
|
398
395
|
}
|
|
399
|
-
`)+"("+b+", "+
|
|
396
|
+
`)+"("+b+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
397
|
+
module$exports$Blockly$Dart.dartGenerator.text_replace=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''",c=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"FROM",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";a=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TO",module$exports$Blockly$Dart.dartGenerator.ORDER_NONE)||"''";return[b+".replaceAll("+c+", "+a+")",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX]};
|
|
398
|
+
module$exports$Blockly$Dart.dartGenerator.text_reverse=function(a){return["new String.fromCharCodes("+(module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"TEXT",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX)||"''")+".runes.toList().reversed)",module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX]};var module$exports$Blockly$Dart$variables={},module$contents$Blockly$Dart$variables_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Dart.dartGenerator.variables_get=function(a){return[module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC]};
|
|
399
|
+
module$exports$Blockly$Dart.dartGenerator.variables_set=function(a){const b=module$exports$Blockly$Dart.dartGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT)||"0";return module$exports$Blockly$Dart.dartGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE)+" = "+b+";\n"};var module$exports$Blockly$Dart$variablesDynamic={};module$exports$Blockly$Dart.dartGenerator.variables_get_dynamic=module$exports$Blockly$Dart.dartGenerator.variables_get;module$exports$Blockly$Dart.dartGenerator.variables_set_dynamic=module$exports$Blockly$Dart.dartGenerator.variables_set;var module$exports$Blockly$Dart$all=module$exports$Blockly$Dart;
|
|
400
400
|
module$exports$Blockly$Dart.__namespace__=$;
|
|
401
401
|
return module$exports$Blockly$Dart;
|
|
402
402
|
}));
|