blockly 11.0.0-beta.4 → 11.0.0-beta.5
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.js +22 -0
- package/blockly.min.js +572 -508
- package/blockly_compressed.js +494 -467
- package/blockly_compressed.js.map +1 -1
- package/blocks.js +22 -0
- package/blocks_compressed.js +29 -27
- package/blocks_compressed.js.map +1 -1
- package/browser.js +30 -0
- package/core/block.d.ts +3 -10
- package/core/block_dragger.d.ts +10 -10
- package/core/block_svg.d.ts +32 -5
- package/core/blockly.d.ts +38 -3
- package/core/clipboard.d.ts +19 -0
- package/core/{insertion_marker_previewer.d.ts → connection_previewers/insertion_marker_previewer.d.ts} +3 -3
- package/core/events/events_click.d.ts +1 -1
- package/core/field_angle.d.ts +208 -0
- package/core/field_colour.d.ts +243 -0
- package/core/field_dropdown.d.ts +0 -1
- package/core/field_image.d.ts +1 -1
- package/core/field_multilineinput.d.ts +182 -0
- package/core/generator.d.ts +1 -1
- package/core/gesture.d.ts +0 -2
- package/core/grid.d.ts +9 -9
- package/core/icons/comment_icon.d.ts +3 -3
- package/core/icons/icon.d.ts +6 -0
- package/core/icons/icon_types.d.ts +2 -2
- package/core/icons/mutator_icon.d.ts +16 -1
- package/core/icons/warning_icon.d.ts +1 -1
- package/core/inputs/input.d.ts +19 -10
- package/core/interfaces/i_has_bubble.d.ts +1 -1
- package/core/interfaces/i_parameter_model.d.ts +0 -7
- package/core/interfaces/i_procedure_model.d.ts +0 -7
- package/core/options.d.ts +0 -1
- package/core/renderers/common/drawer.d.ts +7 -0
- package/core/renderers/measurables/icon.d.ts +5 -0
- package/core/renderers/minimalist/constants.d.ts +21 -0
- package/core/renderers/minimalist/drawer.d.ts +26 -0
- package/core/renderers/minimalist/info.d.ts +35 -0
- package/core/renderers/minimalist/minimalist.d.ts +12 -0
- package/core/renderers/minimalist/renderer.d.ts +48 -0
- package/core/serialization/procedures.d.ts +26 -28
- package/core/utils/dom.d.ts +9 -0
- package/core/utils/keycodes.d.ts +32 -32
- package/core/utils/size.d.ts +0 -10
- package/core/utils/string.d.ts +10 -0
- package/core/workspace_svg.d.ts +27 -0
- package/core-browser.js +26 -0
- package/core.js +26 -0
- package/dart.d.ts +24 -1
- package/dart.js +22 -0
- package/dart_compressed.js +68 -18
- package/dart_compressed.js.map +1 -1
- package/generators/dart/colour.d.ts +16 -0
- package/generators/dart/dart_generator.d.ts +17 -17
- package/generators/dart/text.d.ts +1 -0
- package/generators/javascript/colour.d.ts +16 -0
- package/generators/javascript/javascript_generator.d.ts +35 -34
- package/generators/javascript/text.d.ts +1 -0
- package/generators/lua/colour.d.ts +16 -0
- package/generators/lua/lua_generator.d.ts +10 -10
- package/generators/lua/text.d.ts +1 -0
- package/generators/php/colour.d.ts +16 -0
- package/generators/php/php_generator.d.ts +36 -36
- package/generators/php/text.d.ts +1 -0
- package/generators/python/colour.d.ts +16 -0
- package/generators/python/python_generator.d.ts +21 -20
- package/generators/python/text.d.ts +1 -0
- package/index.js +7 -19
- package/javascript.d.ts +41 -1
- package/javascript.js +23 -0
- package/javascript_compressed.js +49 -14
- package/javascript_compressed.js.map +1 -1
- package/lua.d.ts +18 -1
- package/lua.js +22 -0
- package/lua_compressed.js +40 -18
- package/lua_compressed.js.map +1 -1
- package/msg/constants.d.ts +14 -0
- package/msg/msg.d.ts +440 -0
- package/msg/qqq.d.ts +14 -0
- package/msg/synonyms.d.ts +14 -0
- package/node.js +21 -0
- package/package.json +11 -45
- package/php.d.ts +43 -1
- package/php.js +22 -0
- package/php_compressed.js +43 -10
- package/php_compressed.js.map +1 -1
- package/python.d.ts +27 -1
- package/python.js +23 -0
- package/python_compressed.js +37 -18
- package/python_compressed.js.map +1 -1
- package/core/comments/comment_view.d.ts +0 -200
- package/core/comments/workspace_comment.d.ts +0 -94
- package/core/comments.d.ts +0 -8
- package/core/interfaces/i_comment_icon.d.ts +0 -17
- package/core-node.js +0 -31
- package/media/arrow-dropdown.svg +0 -1
- package/media/resize-handle.svg +0 -3
- package/msg/ce.d.ts +0 -8
- package/msg/dtp.d.ts +0 -8
- package/msg/hsb.d.ts +0 -8
- package/msg/tdd.d.ts +0 -8
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2014 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @file Generating Dart for colour blocks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Block } from '../../core/block.js';
|
|
10
|
+
import type { DartGenerator } from './dart_generator.js';
|
|
11
|
+
import { Order } from './dart_generator.js';
|
|
12
|
+
export declare function colour_picker(block: Block, generator: DartGenerator): [string, Order];
|
|
13
|
+
export declare function colour_random(block: Block, generator: DartGenerator): [string, Order];
|
|
14
|
+
export declare function colour_rgb(block: Block, generator: DartGenerator): [string, Order];
|
|
15
|
+
export declare function colour_blend(block: Block, generator: DartGenerator): [string, Order];
|
|
16
|
+
//# sourceMappingURL=colour.d.ts.map
|
|
@@ -11,23 +11,23 @@ import type { Workspace } from '../../core/workspace.js';
|
|
|
11
11
|
* https://dart.dev/guides/language/language-tour#operators
|
|
12
12
|
*/
|
|
13
13
|
export declare enum Order {
|
|
14
|
-
ATOMIC = 0
|
|
15
|
-
UNARY_POSTFIX = 1
|
|
16
|
-
UNARY_PREFIX = 2
|
|
17
|
-
MULTIPLICATIVE = 3
|
|
18
|
-
ADDITIVE = 4
|
|
19
|
-
SHIFT = 5
|
|
20
|
-
BITWISE_AND = 6
|
|
21
|
-
BITWISE_XOR = 7
|
|
22
|
-
BITWISE_OR = 8
|
|
23
|
-
RELATIONAL = 9
|
|
24
|
-
EQUALITY = 10
|
|
25
|
-
LOGICAL_AND = 11
|
|
26
|
-
LOGICAL_OR = 12
|
|
27
|
-
IF_NULL = 13
|
|
28
|
-
CONDITIONAL = 14
|
|
29
|
-
CASCADE = 15
|
|
30
|
-
ASSIGNMENT = 16
|
|
14
|
+
ATOMIC = 0,
|
|
15
|
+
UNARY_POSTFIX = 1,
|
|
16
|
+
UNARY_PREFIX = 2,
|
|
17
|
+
MULTIPLICATIVE = 3,
|
|
18
|
+
ADDITIVE = 4,
|
|
19
|
+
SHIFT = 5,
|
|
20
|
+
BITWISE_AND = 6,
|
|
21
|
+
BITWISE_XOR = 7,
|
|
22
|
+
BITWISE_OR = 8,
|
|
23
|
+
RELATIONAL = 9,
|
|
24
|
+
EQUALITY = 10,
|
|
25
|
+
LOGICAL_AND = 11,
|
|
26
|
+
LOGICAL_OR = 12,
|
|
27
|
+
IF_NULL = 13,
|
|
28
|
+
CONDITIONAL = 14,
|
|
29
|
+
CASCADE = 15,
|
|
30
|
+
ASSIGNMENT = 16,
|
|
31
31
|
NONE = 99
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -10,6 +10,7 @@ import type { Block } from '../../core/block.js';
|
|
|
10
10
|
import type { DartGenerator } from './dart_generator.js';
|
|
11
11
|
import { Order } from './dart_generator.js';
|
|
12
12
|
export declare function text(block: Block, generator: DartGenerator): [string, Order];
|
|
13
|
+
export declare function text_multiline(block: Block, generator: DartGenerator): [string, Order];
|
|
13
14
|
export declare function text_join(block: Block, generator: DartGenerator): [string, Order];
|
|
14
15
|
export declare function text_append(block: Block, generator: DartGenerator): string;
|
|
15
16
|
export declare function text_length(block: Block, generator: DartGenerator): [string, Order];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2012 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @file Generating JavaScript for colour blocks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Block } from '../../core/block.js';
|
|
10
|
+
import type { JavascriptGenerator } from './javascript_generator.js';
|
|
11
|
+
import { Order } from './javascript_generator.js';
|
|
12
|
+
export declare function colour_picker(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
13
|
+
export declare function colour_random(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
14
|
+
export declare function colour_rgb(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
15
|
+
export declare function colour_blend(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
16
|
+
//# sourceMappingURL=colour.d.ts.map
|
|
@@ -11,40 +11,40 @@ import type { Workspace } from '../../core/workspace.js';
|
|
|
11
11
|
* https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence
|
|
12
12
|
*/
|
|
13
13
|
export declare enum Order {
|
|
14
|
-
ATOMIC = 0
|
|
15
|
-
NEW = 1.1
|
|
16
|
-
MEMBER = 1.2
|
|
17
|
-
FUNCTION_CALL = 2
|
|
18
|
-
INCREMENT = 3
|
|
19
|
-
DECREMENT = 3
|
|
20
|
-
BITWISE_NOT = 4.1
|
|
21
|
-
UNARY_PLUS = 4.2
|
|
22
|
-
UNARY_NEGATION = 4.3
|
|
23
|
-
LOGICAL_NOT = 4.4
|
|
24
|
-
TYPEOF = 4.5
|
|
25
|
-
VOID = 4.6
|
|
26
|
-
DELETE = 4.7
|
|
27
|
-
AWAIT = 4.8
|
|
28
|
-
EXPONENTIATION = 5
|
|
29
|
-
MULTIPLICATION = 5.1
|
|
30
|
-
DIVISION = 5.2
|
|
31
|
-
MODULUS = 5.3
|
|
32
|
-
SUBTRACTION = 6.1
|
|
33
|
-
ADDITION = 6.2
|
|
34
|
-
BITWISE_SHIFT = 7
|
|
35
|
-
RELATIONAL = 8
|
|
36
|
-
IN = 8
|
|
37
|
-
INSTANCEOF = 8
|
|
38
|
-
EQUALITY = 9
|
|
39
|
-
BITWISE_AND = 10
|
|
40
|
-
BITWISE_XOR = 11
|
|
41
|
-
BITWISE_OR = 12
|
|
42
|
-
LOGICAL_AND = 13
|
|
43
|
-
LOGICAL_OR = 14
|
|
44
|
-
CONDITIONAL = 15
|
|
45
|
-
ASSIGNMENT = 16
|
|
46
|
-
YIELD = 17
|
|
47
|
-
COMMA = 18
|
|
14
|
+
ATOMIC = 0,
|
|
15
|
+
NEW = 1.1,
|
|
16
|
+
MEMBER = 1.2,
|
|
17
|
+
FUNCTION_CALL = 2,
|
|
18
|
+
INCREMENT = 3,
|
|
19
|
+
DECREMENT = 3,
|
|
20
|
+
BITWISE_NOT = 4.1,
|
|
21
|
+
UNARY_PLUS = 4.2,
|
|
22
|
+
UNARY_NEGATION = 4.3,
|
|
23
|
+
LOGICAL_NOT = 4.4,
|
|
24
|
+
TYPEOF = 4.5,
|
|
25
|
+
VOID = 4.6,
|
|
26
|
+
DELETE = 4.7,
|
|
27
|
+
AWAIT = 4.8,
|
|
28
|
+
EXPONENTIATION = 5,
|
|
29
|
+
MULTIPLICATION = 5.1,
|
|
30
|
+
DIVISION = 5.2,
|
|
31
|
+
MODULUS = 5.3,
|
|
32
|
+
SUBTRACTION = 6.1,
|
|
33
|
+
ADDITION = 6.2,
|
|
34
|
+
BITWISE_SHIFT = 7,
|
|
35
|
+
RELATIONAL = 8,
|
|
36
|
+
IN = 8,
|
|
37
|
+
INSTANCEOF = 8,
|
|
38
|
+
EQUALITY = 9,
|
|
39
|
+
BITWISE_AND = 10,
|
|
40
|
+
BITWISE_XOR = 11,
|
|
41
|
+
BITWISE_OR = 12,
|
|
42
|
+
LOGICAL_AND = 13,
|
|
43
|
+
LOGICAL_OR = 14,
|
|
44
|
+
CONDITIONAL = 15,
|
|
45
|
+
ASSIGNMENT = 16,
|
|
46
|
+
YIELD = 17,
|
|
47
|
+
COMMA = 18,
|
|
48
48
|
NONE = 99
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -100,6 +100,7 @@ export declare class JavascriptGenerator extends CodeGenerator {
|
|
|
100
100
|
* @param code The JavaScript code created for this block.
|
|
101
101
|
* @param thisOnly True to generate code for only this statement.
|
|
102
102
|
* @returns JavaScript code with comments and subsequent blocks added.
|
|
103
|
+
* @protected
|
|
103
104
|
*/
|
|
104
105
|
scrub_(block: Block, code: string, thisOnly?: boolean): string;
|
|
105
106
|
/**
|
|
@@ -10,6 +10,7 @@ import type { Block } from '../../core/block.js';
|
|
|
10
10
|
import type { JavascriptGenerator } from './javascript_generator.js';
|
|
11
11
|
import { Order } from './javascript_generator.js';
|
|
12
12
|
export declare function text(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
13
|
+
export declare function text_multiline(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
13
14
|
export declare function text_join(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
14
15
|
export declare function text_append(block: Block, generator: JavascriptGenerator): string;
|
|
15
16
|
export declare function text_length(block: Block, generator: JavascriptGenerator): [string, Order];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @file Generating Lua for colour blocks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Block } from '../../core/block.js';
|
|
10
|
+
import type { LuaGenerator } from './lua_generator.js';
|
|
11
|
+
import { Order } from './lua_generator.js';
|
|
12
|
+
export declare function colour_picker(block: Block, generator: LuaGenerator): [string, Order];
|
|
13
|
+
export declare function colour_random(block: Block, generator: LuaGenerator): [string, Order];
|
|
14
|
+
export declare function colour_rgb(block: Block, generator: LuaGenerator): [string, Order];
|
|
15
|
+
export declare function colour_blend(block: Block, generator: LuaGenerator): [string, Order];
|
|
16
|
+
//# sourceMappingURL=colour.d.ts.map
|
|
@@ -11,16 +11,16 @@ import type { Workspace } from '../../core/workspace.js';
|
|
|
11
11
|
* http://www.lua.org/manual/5.3/manual.html#3.4.8
|
|
12
12
|
*/
|
|
13
13
|
export declare enum Order {
|
|
14
|
-
ATOMIC = 0
|
|
15
|
-
HIGH = 1
|
|
16
|
-
EXPONENTIATION = 2
|
|
17
|
-
UNARY = 3
|
|
18
|
-
MULTIPLICATIVE = 4
|
|
19
|
-
ADDITIVE = 5
|
|
20
|
-
CONCATENATION = 6
|
|
21
|
-
RELATIONAL = 7
|
|
22
|
-
AND = 8
|
|
23
|
-
OR = 9
|
|
14
|
+
ATOMIC = 0,
|
|
15
|
+
HIGH = 1,
|
|
16
|
+
EXPONENTIATION = 2,
|
|
17
|
+
UNARY = 3,
|
|
18
|
+
MULTIPLICATIVE = 4,
|
|
19
|
+
ADDITIVE = 5,
|
|
20
|
+
CONCATENATION = 6,
|
|
21
|
+
RELATIONAL = 7,
|
|
22
|
+
AND = 8,
|
|
23
|
+
OR = 9,
|
|
24
24
|
NONE = 99
|
|
25
25
|
}
|
|
26
26
|
/**
|
package/generators/lua/text.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { Block } from '../../core/block.js';
|
|
|
10
10
|
import type { LuaGenerator } from './lua_generator.js';
|
|
11
11
|
import { Order } from './lua_generator.js';
|
|
12
12
|
export declare function text(block: Block, generator: LuaGenerator): [string, Order];
|
|
13
|
+
export declare function text_multiline(block: Block, generator: LuaGenerator): [string, Order];
|
|
13
14
|
export declare function text_join(block: Block, generator: LuaGenerator): [string, Order];
|
|
14
15
|
export declare function text_append(block: Block, generator: LuaGenerator): string;
|
|
15
16
|
export declare function text_length(block: Block, generator: LuaGenerator): [string, Order];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2015 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @file Generating PHP for colour blocks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Block } from '../../core/block.js';
|
|
10
|
+
import { Order } from './php_generator.js';
|
|
11
|
+
import type { PhpGenerator } from './php_generator.js';
|
|
12
|
+
export declare function colour_picker(block: Block, generator: PhpGenerator): [string, Order];
|
|
13
|
+
export declare function colour_random(block: Block, generator: PhpGenerator): [string, Order];
|
|
14
|
+
export declare function colour_rgb(block: Block, generator: PhpGenerator): [string, Order];
|
|
15
|
+
export declare function colour_blend(block: Block, generator: PhpGenerator): [string, Order];
|
|
16
|
+
//# sourceMappingURL=colour.d.ts.map
|
|
@@ -11,42 +11,42 @@ import type { Workspace } from '../../core/workspace.js';
|
|
|
11
11
|
* http://php.net/manual/en/language.operators.precedence.php
|
|
12
12
|
*/
|
|
13
13
|
export declare enum Order {
|
|
14
|
-
ATOMIC = 0
|
|
15
|
-
CLONE = 1
|
|
16
|
-
NEW = 1
|
|
17
|
-
MEMBER = 2.1
|
|
18
|
-
FUNCTION_CALL = 2.2
|
|
19
|
-
POWER = 3
|
|
20
|
-
INCREMENT = 4
|
|
21
|
-
DECREMENT = 4
|
|
22
|
-
BITWISE_NOT = 4
|
|
23
|
-
CAST = 4
|
|
24
|
-
SUPPRESS_ERROR = 4
|
|
25
|
-
INSTANCEOF = 5
|
|
26
|
-
LOGICAL_NOT = 6
|
|
27
|
-
UNARY_PLUS = 7.1
|
|
28
|
-
UNARY_NEGATION = 7.2
|
|
29
|
-
MULTIPLICATION = 8.1
|
|
30
|
-
DIVISION = 8.2
|
|
31
|
-
MODULUS = 8.3
|
|
32
|
-
ADDITION = 9.1
|
|
33
|
-
SUBTRACTION = 9.2
|
|
34
|
-
STRING_CONCAT = 9.3
|
|
35
|
-
BITWISE_SHIFT = 10
|
|
36
|
-
RELATIONAL = 11
|
|
37
|
-
EQUALITY = 12
|
|
38
|
-
REFERENCE = 13
|
|
39
|
-
BITWISE_AND = 13
|
|
40
|
-
BITWISE_XOR = 14
|
|
41
|
-
BITWISE_OR = 15
|
|
42
|
-
LOGICAL_AND = 16
|
|
43
|
-
LOGICAL_OR = 17
|
|
44
|
-
IF_NULL = 18
|
|
45
|
-
CONDITIONAL = 19
|
|
46
|
-
ASSIGNMENT = 20
|
|
47
|
-
LOGICAL_AND_WEAK = 21
|
|
48
|
-
LOGICAL_XOR = 22
|
|
49
|
-
LOGICAL_OR_WEAK = 23
|
|
14
|
+
ATOMIC = 0,
|
|
15
|
+
CLONE = 1,
|
|
16
|
+
NEW = 1,
|
|
17
|
+
MEMBER = 2.1,
|
|
18
|
+
FUNCTION_CALL = 2.2,
|
|
19
|
+
POWER = 3,
|
|
20
|
+
INCREMENT = 4,
|
|
21
|
+
DECREMENT = 4,
|
|
22
|
+
BITWISE_NOT = 4,
|
|
23
|
+
CAST = 4,
|
|
24
|
+
SUPPRESS_ERROR = 4,
|
|
25
|
+
INSTANCEOF = 5,
|
|
26
|
+
LOGICAL_NOT = 6,
|
|
27
|
+
UNARY_PLUS = 7.1,
|
|
28
|
+
UNARY_NEGATION = 7.2,
|
|
29
|
+
MULTIPLICATION = 8.1,
|
|
30
|
+
DIVISION = 8.2,
|
|
31
|
+
MODULUS = 8.3,
|
|
32
|
+
ADDITION = 9.1,
|
|
33
|
+
SUBTRACTION = 9.2,
|
|
34
|
+
STRING_CONCAT = 9.3,
|
|
35
|
+
BITWISE_SHIFT = 10,
|
|
36
|
+
RELATIONAL = 11,
|
|
37
|
+
EQUALITY = 12,
|
|
38
|
+
REFERENCE = 13,
|
|
39
|
+
BITWISE_AND = 13,
|
|
40
|
+
BITWISE_XOR = 14,
|
|
41
|
+
BITWISE_OR = 15,
|
|
42
|
+
LOGICAL_AND = 16,
|
|
43
|
+
LOGICAL_OR = 17,
|
|
44
|
+
IF_NULL = 18,
|
|
45
|
+
CONDITIONAL = 19,
|
|
46
|
+
ASSIGNMENT = 20,
|
|
47
|
+
LOGICAL_AND_WEAK = 21,
|
|
48
|
+
LOGICAL_XOR = 22,
|
|
49
|
+
LOGICAL_OR_WEAK = 23,
|
|
50
50
|
NONE = 99
|
|
51
51
|
}
|
|
52
52
|
export declare class PhpGenerator extends CodeGenerator {
|
package/generators/php/text.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { Block } from '../../core/block.js';
|
|
|
10
10
|
import { Order } from './php_generator.js';
|
|
11
11
|
import type { PhpGenerator } from './php_generator.js';
|
|
12
12
|
export declare function text(block: Block, generator: PhpGenerator): [string, Order];
|
|
13
|
+
export declare function text_multiline(block: Block, generator: PhpGenerator): [string, Order];
|
|
13
14
|
export declare function text_join(block: Block, generator: PhpGenerator): [string, Order];
|
|
14
15
|
export declare function text_append(block: Block, generator: PhpGenerator): string;
|
|
15
16
|
export declare function text_length(block: Block, generator: PhpGenerator): [string, Order];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2012 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @file Generating Python for colour blocks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Block } from '../../core/block.js';
|
|
10
|
+
import type { PythonGenerator } from './python_generator.js';
|
|
11
|
+
import { Order } from './python_generator.js';
|
|
12
|
+
export declare function colour_picker(block: Block, generator: PythonGenerator): [string, Order];
|
|
13
|
+
export declare function colour_random(block: Block, generator: PythonGenerator): [string, Order];
|
|
14
|
+
export declare function colour_rgb(block: Block, generator: PythonGenerator): [string, Order];
|
|
15
|
+
export declare function colour_blend(block: Block, generator: PythonGenerator): [string, Order];
|
|
16
|
+
//# sourceMappingURL=colour.d.ts.map
|
|
@@ -11,26 +11,26 @@ import type { Workspace } from '../../core/workspace.js';
|
|
|
11
11
|
* http://docs.python.org/reference/expressions.html#summary
|
|
12
12
|
*/
|
|
13
13
|
export declare enum Order {
|
|
14
|
-
ATOMIC = 0
|
|
15
|
-
COLLECTION = 1
|
|
16
|
-
STRING_CONVERSION = 1
|
|
17
|
-
MEMBER = 2.1
|
|
18
|
-
FUNCTION_CALL = 2.2
|
|
19
|
-
EXPONENTIATION = 3
|
|
20
|
-
UNARY_SIGN = 4
|
|
21
|
-
BITWISE_NOT = 4
|
|
22
|
-
MULTIPLICATIVE = 5
|
|
23
|
-
ADDITIVE = 6
|
|
24
|
-
BITWISE_SHIFT = 7
|
|
25
|
-
BITWISE_AND = 8
|
|
26
|
-
BITWISE_XOR = 9
|
|
27
|
-
BITWISE_OR = 10
|
|
28
|
-
RELATIONAL = 11
|
|
29
|
-
LOGICAL_NOT = 12
|
|
30
|
-
LOGICAL_AND = 13
|
|
31
|
-
LOGICAL_OR = 14
|
|
32
|
-
CONDITIONAL = 15
|
|
33
|
-
LAMBDA = 16
|
|
14
|
+
ATOMIC = 0,
|
|
15
|
+
COLLECTION = 1,
|
|
16
|
+
STRING_CONVERSION = 1,
|
|
17
|
+
MEMBER = 2.1,
|
|
18
|
+
FUNCTION_CALL = 2.2,
|
|
19
|
+
EXPONENTIATION = 3,
|
|
20
|
+
UNARY_SIGN = 4,
|
|
21
|
+
BITWISE_NOT = 4,
|
|
22
|
+
MULTIPLICATIVE = 5,
|
|
23
|
+
ADDITIVE = 6,
|
|
24
|
+
BITWISE_SHIFT = 7,
|
|
25
|
+
BITWISE_AND = 8,
|
|
26
|
+
BITWISE_XOR = 9,
|
|
27
|
+
BITWISE_OR = 10,
|
|
28
|
+
RELATIONAL = 11,
|
|
29
|
+
LOGICAL_NOT = 12,
|
|
30
|
+
LOGICAL_AND = 13,
|
|
31
|
+
LOGICAL_OR = 14,
|
|
32
|
+
CONDITIONAL = 15,
|
|
33
|
+
LAMBDA = 16,
|
|
34
34
|
NONE = 99
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -90,6 +90,7 @@ export declare class PythonGenerator extends CodeGenerator {
|
|
|
90
90
|
* @param code The Python code created for this block.
|
|
91
91
|
* @param thisOnly True to generate code for only this statement.
|
|
92
92
|
* @returns Python code with comments and subsequent blocks added.
|
|
93
|
+
|
|
93
94
|
*/
|
|
94
95
|
scrub_(block: Block, code: string, thisOnly?: boolean): string;
|
|
95
96
|
/**
|
|
@@ -7,6 +7,7 @@ import type { Block } from '../../core/block.js';
|
|
|
7
7
|
import { Order } from './python_generator.js';
|
|
8
8
|
import type { PythonGenerator } from './python_generator.js';
|
|
9
9
|
export declare function text(block: Block, generator: PythonGenerator): [string, Order];
|
|
10
|
+
export declare function text_multiline(block: Block, generator: PythonGenerator): [string, Order];
|
|
10
11
|
export declare function text_join(block: Block, generator: PythonGenerator): [string, Order];
|
|
11
12
|
export declare function text_append(block: Block, generator: PythonGenerator): string;
|
|
12
13
|
export declare function text_length(block: Block, generator: PythonGenerator): [string, Order];
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
;(function(root, factory) {
|
|
3
3
|
if (typeof define === 'function' && define.amd) { // AMD
|
|
4
|
-
define(['
|
|
4
|
+
define(['./browser'], factory);
|
|
5
5
|
} else if (typeof exports === 'object') { // Node.js
|
|
6
|
-
module.exports = factory(require('
|
|
6
|
+
module.exports = factory(require('./node'));
|
|
7
7
|
} else { // Browser
|
|
8
|
-
root.Blockly = factory(root.Blockly
|
|
8
|
+
root.Blockly = factory(root.Blockly);
|
|
9
9
|
}
|
|
10
|
-
}(this, function(Blockly
|
|
10
|
+
}(this, function(Blockly) {
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2019 Google LLC
|
|
@@ -15,22 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* This entrypoint previously also loaded one or more generators
|
|
23
|
-
* (JavaScript in browser, all five in node.js environments) but it no
|
|
24
|
-
* longer makes sense to do so because of changes to generators
|
|
25
|
-
* exports (they no longer have the side effect of defining
|
|
26
|
-
* Blockly.JavaScript, etc., when loaded as modules).
|
|
18
|
+
* @fileoverview Blockly module; this is a wrapper which selects
|
|
19
|
+
* either browser.js or node.js, depending on which environment we
|
|
20
|
+
* are running in.
|
|
27
21
|
*/
|
|
28
22
|
|
|
29
|
-
/* eslint-disable */
|
|
30
|
-
'use strict';
|
|
31
|
-
|
|
32
|
-
// Include the EN Locale by default.
|
|
33
|
-
Blockly.setLocale(en);
|
|
34
|
-
|
|
35
23
|
return Blockly;
|
|
36
24
|
}));
|
package/javascript.d.ts
CHANGED
|
@@ -4,4 +4,44 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export enum Order {
|
|
8
|
+
ATOMIC = 0, // 0 "" ...
|
|
9
|
+
NEW = 1.1, // new
|
|
10
|
+
MEMBER = 1.2, // . []
|
|
11
|
+
FUNCTION_CALL = 2, // ()
|
|
12
|
+
INCREMENT = 3, // ++
|
|
13
|
+
DECREMENT = 3, // --
|
|
14
|
+
BITWISE_NOT = 4.1, // ~
|
|
15
|
+
UNARY_PLUS = 4.2, // +
|
|
16
|
+
UNARY_NEGATION = 4.3, // -
|
|
17
|
+
LOGICAL_NOT = 4.4, // !
|
|
18
|
+
TYPEOF = 4.5, // typeof
|
|
19
|
+
VOID = 4.6, // void
|
|
20
|
+
DELETE = 4.7, // delete
|
|
21
|
+
AWAIT = 4.8, // await
|
|
22
|
+
EXPONENTIATION = 5.0, // **
|
|
23
|
+
MULTIPLICATION = 5.1, // *
|
|
24
|
+
DIVISION = 5.2, // /
|
|
25
|
+
MODULUS = 5.3, // %
|
|
26
|
+
SUBTRACTION = 6.1, // -
|
|
27
|
+
ADDITION = 6.2, // +
|
|
28
|
+
BITWISE_SHIFT = 7, // << >> >>>
|
|
29
|
+
RELATIONAL = 8, // < <= > >=
|
|
30
|
+
IN = 8, // in
|
|
31
|
+
INSTANCEOF = 8, // instanceof
|
|
32
|
+
EQUALITY = 9, // == != === !==
|
|
33
|
+
BITWISE_AND = 10, // &
|
|
34
|
+
BITWISE_XOR = 11, // ^
|
|
35
|
+
BITWISE_OR = 12, // |
|
|
36
|
+
LOGICAL_AND = 13, // &&
|
|
37
|
+
LOGICAL_OR = 14, // ||
|
|
38
|
+
CONDITIONAL = 15, // ?:
|
|
39
|
+
ASSIGNMENT = 16, // = += -= **= *= /= %= <<= >>= ...
|
|
40
|
+
YIELD = 17, // yield
|
|
41
|
+
COMMA = 18, // ,
|
|
42
|
+
NONE = 99, // (...)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare const javascriptGenerator: any;
|
|
46
|
+
|
|
47
|
+
export {JavascriptGenerator} from './generators/javascript';
|
package/javascript.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
;(function(root, factory) {
|
|
3
|
+
if (typeof define === 'function' && define.amd) { // AMD
|
|
4
|
+
define(['./core', './javascript_compressed.js'], factory);
|
|
5
|
+
} else if (typeof exports === 'object') { // Node.js
|
|
6
|
+
module.exports = factory(require('./core'), require('./javascript_compressed.js'));
|
|
7
|
+
} else { // Browser
|
|
8
|
+
root.BlocklyJavaScript = factory(root.Blockly, root.BlocklyJavaScript);
|
|
9
|
+
}
|
|
10
|
+
}(this, function(Blockly, BlocklyJavaScript) {
|
|
11
|
+
/**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright 2020 Google LLC
|
|
14
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @fileoverview JavaScript Generator module; just a wrapper for
|
|
19
|
+
* javascript_compressed.js.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
return BlocklyJavaScript;
|
|
23
|
+
}));
|