blockly 12.0.0-beta.1 → 12.0.0-beta.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/blockly.min.js +178 -178
- package/blockly_compressed.js +163 -163
- package/blockly_compressed.js.map +1 -1
- package/core/block_flyout_inflater.d.ts +5 -6
- package/core/blockly.d.ts +3 -1
- package/core/bubbles/text_bubble.d.ts +5 -5
- package/core/button_flyout_inflater.d.ts +3 -3
- package/core/comments/comment_view.d.ts +3 -3
- package/core/contextmenu_registry.d.ts +51 -11
- package/core/dragging/block_drag_strategy.d.ts +2 -2
- package/core/dragging/bubble_drag_strategy.d.ts +0 -2
- package/core/dragging/comment_drag_strategy.d.ts +0 -2
- package/core/field.d.ts +0 -2
- package/core/field_dropdown.d.ts +7 -9
- package/core/interfaces/i_flyout_inflater.d.ts +3 -3
- package/core/interfaces/i_focusable_node.d.ts +34 -0
- package/core/interfaces/i_focusable_tree.d.ts +48 -0
- package/core/keyboard_nav/marker.d.ts +4 -8
- package/core/label_flyout_inflater.d.ts +3 -3
- package/core/menu.d.ts +29 -23
- package/core/menu_separator.d.ts +25 -0
- package/core/menuitem.d.ts +7 -0
- package/core/renderers/common/marker_svg.d.ts +2 -2
- package/core/separator_flyout_inflater.d.ts +3 -3
- package/core/utils/aria.d.ts +2 -1
- package/core/utils/toolbox.d.ts +0 -2
- package/core/workspace.d.ts +13 -0
- package/core/workspace_svg.d.ts +1 -0
- package/dart_compressed.js +1 -1
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +15 -15
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +1 -1
- package/lua_compressed.js.map +1 -1
- package/package.json +2 -2
- package/php_compressed.js +1 -1
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +3 -3
- package/python_compressed.js.map +1 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { FlyoutItem } from './flyout_item.js';
|
|
7
|
+
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
7
8
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
8
|
-
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
@@ -29,10 +29,10 @@ export declare class SeparatorFlyoutInflater implements IFlyoutInflater {
|
|
|
29
29
|
* returned by gapForElement, which knows the default gap, unlike this method.
|
|
30
30
|
*
|
|
31
31
|
* @param _state A JSON representation of a flyout separator.
|
|
32
|
-
* @param
|
|
32
|
+
* @param flyout The flyout to create the separator for.
|
|
33
33
|
* @returns A newly created FlyoutSeparator.
|
|
34
34
|
*/
|
|
35
|
-
load(_state: object,
|
|
35
|
+
load(_state: object, flyout: IFlyout): FlyoutItem;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the size of the separator. See `load` for more details.
|
|
38
38
|
*
|
package/core/utils/aria.d.ts
CHANGED
package/core/utils/toolbox.d.ts
CHANGED
package/core/workspace.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
82
82
|
private readonly typedBlocksDB;
|
|
83
83
|
private variableMap;
|
|
84
84
|
private procedureMap;
|
|
85
|
+
private readOnly;
|
|
85
86
|
/**
|
|
86
87
|
* Blocks in the flyout can refer to variables that don't exist in the main
|
|
87
88
|
* workspace. For instance, the "get item in list" block refers to an
|
|
@@ -456,5 +457,17 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
456
457
|
*/
|
|
457
458
|
static getAll(): Workspace[];
|
|
458
459
|
protected getVariableMapClass(): new (...p1: any[]) => IVariableMap<IVariableModel<IVariableState>>;
|
|
460
|
+
/**
|
|
461
|
+
* Returns whether or not this workspace is in readonly mode.
|
|
462
|
+
*
|
|
463
|
+
* @returns True if the workspace is readonly, otherwise false.
|
|
464
|
+
*/
|
|
465
|
+
isReadOnly(): boolean;
|
|
466
|
+
/**
|
|
467
|
+
* Sets whether or not this workspace is in readonly mode.
|
|
468
|
+
*
|
|
469
|
+
* @param readOnly True to make the workspace readonly, otherwise false.
|
|
470
|
+
*/
|
|
471
|
+
setIsReadOnly(readOnly: boolean): void;
|
|
459
472
|
}
|
|
460
473
|
//# sourceMappingURL=workspace.d.ts.map
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -1003,6 +1003,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
1003
1003
|
* @param className Name of class to remove.
|
|
1004
1004
|
*/
|
|
1005
1005
|
removeClass(className: string): void;
|
|
1006
|
+
setIsReadOnly(readOnly: boolean): void;
|
|
1006
1007
|
}
|
|
1007
1008
|
/**
|
|
1008
1009
|
* Size the workspace when the contents change. This also updates
|
package/dart_compressed.js
CHANGED
|
@@ -79,7 +79,7 @@ List ${b.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
|
|
79
79
|
}
|
|
80
80
|
`)+"("+c+', "'+a+'", '+d+")",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},lists_split$$module$build$src$generators$dart$lists=function(a,b){let c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX);b=b.valueToCode(a,"DELIM",Order$$module$build$src$generators$dart$dart_generator.NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)c||(c="''"),a="split";else if("JOIN"===a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+
|
|
81
81
|
"."+a+"("+b+")",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},lists_reverse$$module$build$src$generators$dart$lists=function(a,b){return["new List.from("+(b.valueToCode(a,"LIST",Order$$module$build$src$generators$dart$dart_generator.NONE)||"[]")+".reversed)",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},controls_if$$module$build$src$generators$dart$logic=function(a,b){let c=0,d="",e,f;b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do f=
|
|
82
|
-
b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$dart$dart_generator.NONE)||"false",e=b.statementToCode(a,"DO"+c),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0<c?"else ":"")+"if ("+f+") {\n"+e+"}",c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=b.statementToCode(a,"ELSE"),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=" else {\n"+e+"}";return d+"\n"},logic_compare$$module$build$src$generators$dart$logic=
|
|
82
|
+
b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$dart$dart_generator.NONE)||"false",e=b.statementToCode(a,"DO"+c),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0<c?"else ":"")+"if ("+f+") {\n"+e+"}",c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=a.getInput("ELSE")?b.statementToCode(a,"ELSE"):"",b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=" else {\n"+e+"}";return d+"\n"},logic_compare$$module$build$src$generators$dart$logic=
|
|
83
83
|
function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d="=="===c||"!="===c?Order$$module$build$src$generators$dart$dart_generator.EQUALITY:Order$$module$build$src$generators$dart$dart_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+c+" "+a,d]},logic_operation$$module$build$src$generators$dart$logic=function(a,b){const c="AND"===a.getFieldValue("OP")?"&&":"||",d="&&"===c?Order$$module$build$src$generators$dart$dart_generator.LOGICAL_AND:
|
|
84
84
|
Order$$module$build$src$generators$dart$dart_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b="&&"===c?"true":"false",e||(e=b),a||(a=b)):a=e="false";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$dart$logic=function(a,b){const c=Order$$module$build$src$generators$dart$dart_generator.UNARY_PREFIX;return["!"+(b.valueToCode(a,"BOOL",c)||"true"),c]},logic_boolean$$module$build$src$generators$dart$logic=function(a,b){return["TRUE"===a.getFieldValue("BOOL")?
|
|
85
85
|
"true":"false",Order$$module$build$src$generators$dart$dart_generator.ATOMIC]},logic_null$$module$build$src$generators$dart$logic=function(a,b){return["null",Order$$module$build$src$generators$dart$dart_generator.ATOMIC]},logic_ternary$$module$build$src$generators$dart$logic=function(a,b){const c=b.valueToCode(a,"IF",Order$$module$build$src$generators$dart$dart_generator.CONDITIONAL)||"false",d=b.valueToCode(a,"THEN",Order$$module$build$src$generators$dart$dart_generator.CONDITIONAL)||"null";a=b.valueToCode(a,
|