blockly 10.1.2 → 10.2.0-beta.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 +277 -269
- package/blockly_compressed.js +266 -257
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +10 -11
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +22 -7
- package/core/block_svg.d.ts +6 -6
- package/core/blockly.d.ts +4 -2
- package/core/clipboard/block_paster.d.ts +32 -0
- package/core/clipboard/registry.d.ts +21 -0
- package/core/clipboard/workspace_comment_paster.d.ts +18 -0
- package/core/clipboard.d.ts +33 -15
- package/core/common.d.ts +3 -3
- package/core/field.d.ts +3 -0
- package/core/inputs/end_row_input.d.ts +25 -0
- package/core/inputs/input_types.d.ts +2 -1
- package/core/inputs.d.ts +2 -1
- package/core/interfaces/i_copyable.d.ts +7 -11
- package/core/interfaces/i_paster.d.ts +15 -0
- package/core/registry.d.ts +4 -0
- package/core/renderers/common/block_rendering.d.ts +1 -2
- package/core/renderers/measurables/row.d.ts +1 -1
- package/core/shortcut_registry.d.ts +4 -4
- package/core/utils/parsing.d.ts +2 -1
- package/core/workspace_comment_svg.d.ts +4 -4
- package/core/workspace_svg.d.ts +4 -2
- package/dart_compressed.js +1 -1
- package/javascript_compressed.js +1 -1
- package/lua_compressed.js +1 -1
- package/package.json +3 -3
- package/php_compressed.js +4 -4
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +8 -8
- package/python_compressed.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blockly",
|
|
3
|
-
"version": "10.1
|
|
3
|
+
"version": "10.2.0-beta.1",
|
|
4
4
|
"description": "Blockly is a library for building visual programming editors.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blockly"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint-config-google": "^0.14.0",
|
|
44
44
|
"eslint-config-prettier": "^8.8.0",
|
|
45
45
|
"eslint-plugin-jsdoc": "^46.2.6",
|
|
46
|
-
"google-closure-compiler": "^
|
|
46
|
+
"google-closure-compiler": "^20230802.0.0",
|
|
47
47
|
"google-closure-deps": "^20230502.0.0",
|
|
48
48
|
"gulp": "^4.0.2",
|
|
49
49
|
"gulp-concat": "^2.6.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"json5": "^2.2.0",
|
|
61
61
|
"markdown-tables-to-json": "^0.1.7",
|
|
62
62
|
"mocha": "^10.0.0",
|
|
63
|
-
"patch-package": "^
|
|
63
|
+
"patch-package": "^8.0.0",
|
|
64
64
|
"prettier": "3.0.0",
|
|
65
65
|
"readline-sync": "^1.4.10",
|
|
66
66
|
"rimraf": "^5.0.0",
|
package/php_compressed.js
CHANGED
|
@@ -233,9 +233,9 @@ function ${b.FUNCTION_NAME_PLACEHOLDER_}($a, $b) {
|
|
|
233
233
|
return rand($a, $b);
|
|
234
234
|
}
|
|
235
235
|
`)+"("+c+", "+a+")",Order$$module$build$src$generators$php$php_generator.FUNCTION_CALL]},math_random_float$$module$build$src$generators$php$math=function(a,b){return["(float)rand()/(float)getrandmax()",Order$$module$build$src$generators$php$php_generator.FUNCTION_CALL]},math_atan2$$module$build$src$generators$php$math=function(a,b){const c=b.valueToCode(a,"X",Order$$module$build$src$generators$php$php_generator.NONE)||"0";return["atan2("+(b.valueToCode(a,"Y",Order$$module$build$src$generators$php$php_generator.NONE)||
|
|
236
|
-
"0")+", "+c+") / pi() * 180",Order$$module$build$src$generators$php$php_generator.DIVISION]},procedures_defreturn$$module$build$src$generators$php$procedures=function(a,b){var c=[],d=a.workspace,e=$.allUsedVarModels$$module$build$src$core$variables(d)||[];for(let
|
|
236
|
+
"0")+", "+c+") / pi() * 180",Order$$module$build$src$generators$php$php_generator.DIVISION]},procedures_defreturn$$module$build$src$generators$php$procedures=function(a,b){var c=[],d=a.workspace,e=$.allUsedVarModels$$module$build$src$core$variables(d)||[];for(let n=0,p;p=e[n];n++){var f=p.name;-1===a.getVars().indexOf(f)&&c.push(b.nameDB_.getName(f,$.NameType$$module$build$src$core$names.VARIABLE))}d=$.allDeveloperVariables$$module$build$src$core$variables(d);for(e=0;e<d.length;e++)c.push(b.nameDB_.getName(d[e],
|
|
237
237
|
$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));d=c.length?b.INDENT+"global "+c.join(", ")+";\n":"";c=b.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE);e="";b.STATEMENT_PREFIX&&(e+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(e+=b.injectId(b.STATEMENT_SUFFIX,a));e&&(e=b.prefixLines(e,b.INDENT));f="";b.INFINITE_LOOP_TRAP&&(f=b.prefixLines(b.injectId(b.INFINITE_LOOP_TRAP,a),b.INDENT));const g=b.statementToCode(a,"STACK");let h=b.valueToCode(a,
|
|
238
|
-
"RETURN",Order$$module$build$src$generators$php$php_generator.NONE)||"",k="";g&&h&&(k=e);h&&(h=b.INDENT+"return "+h+";\n");const l=[],
|
|
238
|
+
"RETURN",Order$$module$build$src$generators$php$php_generator.NONE)||"",k="";g&&h&&(k=e);h&&(h=b.INDENT+"return "+h+";\n");const l=[],m=a.getVars();for(let n=0;n<m.length;n++)l[n]=b.nameDB_.getName(m[n],$.NameType$$module$build$src$core$names.VARIABLE);d="function "+c+"("+l.join(", ")+") {\n"+d+e+f+g+k+h+"}";d=b.scrub_(a,d);b.definitions_["%"+c]=d;return null},procedures_callreturn$$module$build$src$generators$php$procedures=function(a,b){const c=b.nameDB_.getName(a.getFieldValue("NAME"),$.NameType$$module$build$src$core$names.PROCEDURE),
|
|
239
239
|
d=[],e=a.getVars();for(let f=0;f<e.length;f++)d[f]=b.valueToCode(a,"ARG"+f,Order$$module$build$src$generators$php$php_generator.NONE)||"null";return[c+"("+d.join(", ")+")",Order$$module$build$src$generators$php$php_generator.FUNCTION_CALL]},procedures_callnoreturn$$module$build$src$generators$php$procedures=function(a,b){return b.forBlock.procedures_callreturn(a,b)[0]+";\n"},procedures_ifreturn$$module$build$src$generators$php$procedures=function(a,b){let c="if ("+(b.valueToCode(a,"CONDITION",Order$$module$build$src$generators$php$php_generator.NONE)||
|
|
240
240
|
"false")+") {\n";b.STATEMENT_SUFFIX&&(c+=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT));a.hasReturnValue_?(a=b.valueToCode(a,"VALUE",Order$$module$build$src$generators$php$php_generator.NONE)||"null",c+=b.INDENT+"return "+a+";\n"):c+=b.INDENT+"return;\n";return c+"}\n"},text$$module$build$src$generators$php$text=function(a,b){return[b.quote_(a.getFieldValue("TEXT")),Order$$module$build$src$generators$php$php_generator.ATOMIC]},text_multiline$$module$build$src$generators$php$text=function(a,
|
|
241
241
|
b){a=b.multiline_quote_(a.getFieldValue("TEXT"));b=-1!==a.indexOf(".")?Order$$module$build$src$generators$php$php_generator.STRING_CONCAT:Order$$module$build$src$generators$php$php_generator.ATOMIC;return[a,b]},text_join$$module$build$src$generators$php$text=function(a,b){if(0===a.itemCount_)return["''",Order$$module$build$src$generators$php$php_generator.ATOMIC];if(1===a.itemCount_)return[b.valueToCode(a,"ADD0",Order$$module$build$src$generators$php$php_generator.NONE)||"''",Order$$module$build$src$generators$php$php_generator.NONE];
|
|
@@ -293,7 +293,7 @@ this.addReservedWords("__halt_compiler,abstract,and,array,as,break,callable,case
|
|
|
293
293
|
this.nameDB_?this.nameDB_.reset():this.nameDB_=new $.Names$$module$build$src$core$names(this.RESERVED_WORDS_,"$");this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);this.isInitialized=!0}finish(a){const b=Object.values(this.definitions_);a=super.finish(a);this.isInitialized=!1;this.nameDB_.reset();return b.join("\n\n")+"\n\n\n"+a}scrubNakedValue(a){return a+";\n"}quote_(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,
|
|
294
294
|
"\\'");return"'"+a+"'"}multiline_quote_(a){return a.split(/\n/g).map(this.quote_).join(' . "\\n" .\n')}scrub_(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.wrap$$module$build$src$core$utils$string(e,this.COMMENT_WRAP-3),d+=this.prefixLines(e,"// ")+"\n");for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.inputTypes$$module$build$src$core$inputs$input_types.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&
|
|
295
295
|
(d+=this.prefixLines(e,"// "))}a=a.nextConnection&&a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c}getAdjusted(a,b,c,d,e){c=c||0;e=e||this.ORDER_NONE;a.workspace.options.oneBasedIndex&&c--;let f=a.workspace.options.oneBasedIndex?"1":"0",g=e,h;0<c?h=g=this.ORDER_ADDITION:0>c?h=g=this.ORDER_SUBTRACTION:d&&(h=g=this.ORDER_UNARY_NEGATION);a=this.valueToCode(a,b,g)||f;$.isNumber$$module$build$src$core$utils$string(a)?(a=Number(a)+c,d&&(a=-a)):(0<c?a=a+" + "+c:0>c&&(a=a+" - "+-c),
|
|
296
|
-
d&&(a=c?"-("+a+")":"-"+a),h=Math.floor(h),e=Math.floor(e),h&&e>=h&&(a="("+a+")"));return a}},module$build$src$generators$php$php_generator={
|
|
296
|
+
d&&(a=c?"-("+a+")":"-"+a),h=Math.floor(h),e=Math.floor(e),h&&e>=h&&(a="("+a+")"));return a}},module$build$src$generators$php$php_generator={Order:Order$$module$build$src$generators$php$php_generator};module$build$src$generators$php$php_generator.PhpGenerator=PhpGenerator$$module$build$src$generators$php$php_generator;var module$build$src$generators$php$colour={};module$build$src$generators$php$colour.colour_blend=colour_blend$$module$build$src$generators$php$colour;module$build$src$generators$php$colour.colour_picker=colour_picker$$module$build$src$generators$php$colour;module$build$src$generators$php$colour.colour_random=colour_random$$module$build$src$generators$php$colour;module$build$src$generators$php$colour.colour_rgb=colour_rgb$$module$build$src$generators$php$colour;var module$build$src$generators$php$lists={};module$build$src$generators$php$lists.lists_create_empty=lists_create_empty$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_create_with=lists_create_with$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_getIndex=lists_getIndex$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_getSublist=lists_getSublist$$module$build$src$generators$php$lists;
|
|
297
297
|
module$build$src$generators$php$lists.lists_indexOf=lists_indexOf$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_isEmpty=lists_isEmpty$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_length=lists_length$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_repeat=lists_repeat$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_reverse=lists_reverse$$module$build$src$generators$php$lists;
|
|
298
298
|
module$build$src$generators$php$lists.lists_setIndex=lists_setIndex$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_sort=lists_sort$$module$build$src$generators$php$lists;module$build$src$generators$php$lists.lists_split=lists_split$$module$build$src$generators$php$lists;var controls_ifelse$$module$build$src$generators$php$logic=controls_if$$module$build$src$generators$php$logic,module$build$src$generators$php$logic={};module$build$src$generators$php$logic.controls_if=controls_if$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.controls_ifelse=controls_if$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.logic_boolean=logic_boolean$$module$build$src$generators$php$logic;
|
|
299
299
|
module$build$src$generators$php$logic.logic_compare=logic_compare$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.logic_negate=logic_negate$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.logic_null=logic_null$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.logic_operation=logic_operation$$module$build$src$generators$php$logic;module$build$src$generators$php$logic.logic_ternary=logic_ternary$$module$build$src$generators$php$logic;var controls_repeat$$module$build$src$generators$php$loops=controls_repeat_ext$$module$build$src$generators$php$loops,module$build$src$generators$php$loops={};module$build$src$generators$php$loops.controls_flow_statements=controls_flow_statements$$module$build$src$generators$php$loops;module$build$src$generators$php$loops.controls_for=controls_for$$module$build$src$generators$php$loops;module$build$src$generators$php$loops.controls_forEach=controls_forEach$$module$build$src$generators$php$loops;
|
|
@@ -305,7 +305,7 @@ module$build$src$generators$php$procedures.procedures_defnoreturn=procedures_def
|
|
|
305
305
|
module$build$src$generators$php$text.text_count=text_count$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_getSubstring=text_getSubstring$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_indexOf=text_indexOf$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_isEmpty=text_isEmpty$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_join=text_join$$module$build$src$generators$php$text;
|
|
306
306
|
module$build$src$generators$php$text.text_length=text_length$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_multiline=text_multiline$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_print=text_print$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_prompt=text_prompt_ext$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_prompt_ext=text_prompt_ext$$module$build$src$generators$php$text;
|
|
307
307
|
module$build$src$generators$php$text.text_replace=text_replace$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_reverse=text_reverse$$module$build$src$generators$php$text;module$build$src$generators$php$text.text_trim=text_trim$$module$build$src$generators$php$text;var module$build$src$generators$php$variables={};module$build$src$generators$php$variables.variables_get=variables_get$$module$build$src$generators$php$variables;module$build$src$generators$php$variables.variables_set=variables_set$$module$build$src$generators$php$variables;var module$build$src$generators$php$variables_dynamic={};module$build$src$generators$php$variables_dynamic.variables_get_dynamic=variables_get$$module$build$src$generators$php$variables;module$build$src$generators$php$variables_dynamic.variables_set_dynamic=variables_set$$module$build$src$generators$php$variables;var phpGenerator$$module$build$src$generators$php=new PhpGenerator$$module$build$src$generators$php$php_generator;Object.assign(phpGenerator$$module$build$src$generators$php.forBlock,module$build$src$generators$php$colour,module$build$src$generators$php$lists,module$build$src$generators$php$logic,module$build$src$generators$php$loops,module$build$src$generators$php$math,module$build$src$generators$php$procedures,module$build$src$generators$php$text,module$build$src$generators$php$variables,module$build$src$generators$php$variables_dynamic);
|
|
308
|
-
var module$build$src$generators$php={
|
|
308
|
+
var module$build$src$generators$php={Order:Order$$module$build$src$generators$php$php_generator};module$build$src$generators$php.PhpGenerator=PhpGenerator$$module$build$src$generators$php$php_generator;module$build$src$generators$php.phpGenerator=phpGenerator$$module$build$src$generators$php;
|
|
309
309
|
module$build$src$generators$php.__namespace__=$;
|
|
310
310
|
return module$build$src$generators$php;
|
|
311
311
|
}));
|