blockly 13.2.2-beta.1 → 13.3.0
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/README.md +1 -1
- package/blockly.min.js +725 -693
- package/blockly_compressed.js +625 -611
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +57 -57
- package/core/block_svg.d.ts +0 -1
- package/core/comments/collapse_comment_bar_button.d.ts +0 -4
- package/core/comments/comment_bar_button.d.ts +1 -1
- package/core/comments/delete_comment_bar_button.d.ts +0 -4
- package/core/dragging/block_drag_strategy.d.ts +25 -7
- package/core/dragging/dragger.d.ts +2 -1
- package/core/field.d.ts +3 -3
- package/core/field_checkbox.d.ts +2 -2
- package/core/field_dropdown.d.ts +2 -2
- package/core/field_image.d.ts +1 -1
- package/core/field_input.d.ts +4 -4
- package/core/field_label.d.ts +1 -1
- package/core/field_label_serializable.d.ts +1 -1
- package/core/field_number.d.ts +2 -2
- package/core/field_textinput.d.ts +2 -2
- package/core/field_variable.d.ts +2 -2
- package/core/generator.d.ts +1 -1
- package/core/grid.d.ts +1 -1
- package/core/keyboard_nav/keyboard_mover.d.ts +2 -0
- package/core/keyboard_nav/navigators/navigator.d.ts +12 -0
- package/core/options.d.ts +4 -4
- package/core/shortcut_items.d.ts +25 -2
- package/core/shortcut_registry.d.ts +1 -1
- package/core/tooltip.d.ts +3 -2
- package/core/trashcan.d.ts +7 -8
- package/core/utils/aria.d.ts +2 -0
- package/core/utils/focusable_tree_traverser.d.ts +2 -2
- package/core/workspace_svg.d.ts +2 -1
- package/dart_compressed.js +20 -20
- package/javascript_compressed.js +25 -25
- package/lua_compressed.js +24 -24
- package/msg/ab.js +18 -0
- package/msg/ab.mjs +18 -0
- package/msg/ace.js +18 -0
- package/msg/ace.mjs +18 -0
- package/msg/af.js +18 -0
- package/msg/af.mjs +18 -0
- package/msg/am.js +18 -0
- package/msg/am.mjs +18 -0
- package/msg/ar.js +18 -0
- package/msg/ar.mjs +18 -0
- package/msg/ast.js +18 -0
- package/msg/ast.mjs +18 -0
- package/msg/az.js +18 -0
- package/msg/az.mjs +18 -0
- package/msg/ba.js +18 -0
- package/msg/ba.mjs +18 -0
- package/msg/bcc.js +18 -0
- package/msg/bcc.mjs +18 -0
- package/msg/be-tarask.js +35 -17
- package/msg/be-tarask.mjs +18 -0
- package/msg/be.js +18 -0
- package/msg/be.mjs +18 -0
- package/msg/bg.js +18 -0
- package/msg/bg.mjs +18 -0
- package/msg/bn.js +18 -0
- package/msg/bn.mjs +18 -0
- package/msg/br.js +18 -0
- package/msg/br.mjs +18 -0
- package/msg/bs.js +18 -0
- package/msg/bs.mjs +18 -0
- package/msg/ca.js +18 -0
- package/msg/ca.mjs +18 -0
- package/msg/ce.js +18 -0
- package/msg/ce.mjs +18 -0
- package/msg/cs.js +18 -0
- package/msg/cs.mjs +18 -0
- package/msg/csb.js +18 -0
- package/msg/csb.mjs +18 -0
- package/msg/da.js +44 -26
- package/msg/da.mjs +18 -0
- package/msg/de.js +18 -0
- package/msg/de.mjs +18 -0
- package/msg/diq.js +19 -1
- package/msg/diq.mjs +18 -0
- package/msg/dtp.js +18 -0
- package/msg/dtp.mjs +18 -0
- package/msg/dty.js +18 -0
- package/msg/dty.mjs +18 -0
- package/msg/ee.js +18 -0
- package/msg/ee.mjs +18 -0
- package/msg/el.js +18 -0
- package/msg/el.mjs +18 -0
- package/msg/en-gb.js +21 -3
- package/msg/en-gb.mjs +18 -0
- package/msg/en.js +18 -0
- package/msg/en.mjs +18 -0
- package/msg/eo.js +18 -0
- package/msg/eo.mjs +18 -0
- package/msg/es.js +18 -0
- package/msg/es.mjs +18 -0
- package/msg/et.js +18 -0
- package/msg/et.mjs +18 -0
- package/msg/eu.js +18 -0
- package/msg/eu.mjs +18 -0
- package/msg/fa.js +18 -0
- package/msg/fa.mjs +18 -0
- package/msg/fi.js +18 -0
- package/msg/fi.mjs +18 -0
- package/msg/fo.js +18 -0
- package/msg/fo.mjs +18 -0
- package/msg/fr.js +18 -0
- package/msg/fr.mjs +18 -0
- package/msg/frr.js +18 -0
- package/msg/frr.mjs +18 -0
- package/msg/ga.js +45 -27
- package/msg/ga.mjs +18 -0
- package/msg/gl.js +18 -0
- package/msg/gl.mjs +18 -0
- package/msg/gn.js +18 -0
- package/msg/gn.mjs +18 -0
- package/msg/gor.js +18 -0
- package/msg/gor.mjs +18 -0
- package/msg/ha.js +18 -0
- package/msg/ha.mjs +18 -0
- package/msg/he.js +18 -0
- package/msg/he.mjs +18 -0
- package/msg/hi.js +18 -0
- package/msg/hi.mjs +18 -0
- package/msg/hr.js +18 -0
- package/msg/hr.mjs +18 -0
- package/msg/hrx.js +18 -0
- package/msg/hrx.mjs +18 -0
- package/msg/hsb.js +18 -0
- package/msg/hsb.mjs +18 -0
- package/msg/hu.js +19 -1
- package/msg/hu.mjs +18 -0
- package/msg/hy.js +18 -0
- package/msg/hy.mjs +18 -0
- package/msg/ia.js +18 -0
- package/msg/ia.mjs +18 -0
- package/msg/id.js +18 -0
- package/msg/id.mjs +18 -0
- package/msg/ig.js +18 -0
- package/msg/ig.mjs +18 -0
- package/msg/inh.js +18 -0
- package/msg/inh.mjs +18 -0
- package/msg/is.js +18 -0
- package/msg/is.mjs +18 -0
- package/msg/it.js +18 -0
- package/msg/it.mjs +18 -0
- package/msg/ja.js +264 -246
- package/msg/ja.mjs +18 -0
- package/msg/ka.js +18 -0
- package/msg/ka.mjs +18 -0
- package/msg/kab.js +18 -0
- package/msg/kab.mjs +18 -0
- package/msg/kbd-cyrl.js +18 -0
- package/msg/kbd-cyrl.mjs +18 -0
- package/msg/km.js +18 -0
- package/msg/km.mjs +18 -0
- package/msg/kn.js +18 -0
- package/msg/kn.mjs +18 -0
- package/msg/ko.js +18 -0
- package/msg/ko.mjs +18 -0
- package/msg/krc.js +18 -0
- package/msg/krc.mjs +18 -0
- package/msg/ksh.js +18 -0
- package/msg/ksh.mjs +18 -0
- package/msg/ku-latn.js +18 -0
- package/msg/ku-latn.mjs +18 -0
- package/msg/ky.js +18 -0
- package/msg/ky.mjs +18 -0
- package/msg/la.js +18 -0
- package/msg/la.mjs +18 -0
- package/msg/lb.js +20 -2
- package/msg/lb.mjs +18 -0
- package/msg/lki.js +18 -0
- package/msg/lki.mjs +18 -0
- package/msg/lo.js +18 -0
- package/msg/lo.mjs +18 -0
- package/msg/lrc.js +18 -0
- package/msg/lrc.mjs +18 -0
- package/msg/lt.js +18 -0
- package/msg/lt.mjs +18 -0
- package/msg/lv.js +18 -0
- package/msg/lv.mjs +18 -0
- package/msg/mg.js +18 -0
- package/msg/mg.mjs +18 -0
- package/msg/mk.js +18 -0
- package/msg/mk.mjs +18 -0
- package/msg/ml.js +18 -0
- package/msg/ml.mjs +18 -0
- package/msg/mnw.js +18 -0
- package/msg/mnw.mjs +18 -0
- package/msg/ms.js +18 -0
- package/msg/ms.mjs +18 -0
- package/msg/mt.js +18 -0
- package/msg/mt.mjs +18 -0
- package/msg/my.js +18 -0
- package/msg/my.mjs +18 -0
- package/msg/mzn.js +18 -0
- package/msg/mzn.mjs +18 -0
- package/msg/nb.js +18 -0
- package/msg/nb.mjs +18 -0
- package/msg/ne.js +18 -0
- package/msg/ne.mjs +18 -0
- package/msg/nl.js +18 -0
- package/msg/nl.mjs +18 -0
- package/msg/oc.js +18 -0
- package/msg/oc.mjs +18 -0
- package/msg/olo.js +18 -0
- package/msg/olo.mjs +18 -0
- package/msg/pa.js +18 -0
- package/msg/pa.mjs +18 -0
- package/msg/pl.js +18 -0
- package/msg/pl.mjs +18 -0
- package/msg/pms.js +18 -0
- package/msg/pms.mjs +18 -0
- package/msg/ps.js +34 -16
- package/msg/ps.mjs +18 -0
- package/msg/pt-br.js +18 -0
- package/msg/pt-br.mjs +18 -0
- package/msg/pt.js +18 -0
- package/msg/pt.mjs +18 -0
- package/msg/ro.js +18 -0
- package/msg/ro.mjs +18 -0
- package/msg/ru.js +18 -0
- package/msg/ru.mjs +18 -0
- package/msg/sc.js +18 -0
- package/msg/sc.mjs +18 -0
- package/msg/sco.js +18 -0
- package/msg/sco.mjs +18 -0
- package/msg/sd.js +18 -0
- package/msg/sd.mjs +18 -0
- package/msg/shn.js +18 -0
- package/msg/shn.mjs +18 -0
- package/msg/si.js +18 -0
- package/msg/si.mjs +18 -0
- package/msg/sk.js +18 -0
- package/msg/sk.mjs +18 -0
- package/msg/skr-arab.js +18 -0
- package/msg/skr-arab.mjs +18 -0
- package/msg/sl.js +18 -0
- package/msg/sl.mjs +18 -0
- package/msg/smn.js +18 -0
- package/msg/smn.mjs +18 -0
- package/msg/sq.js +18 -0
- package/msg/sq.mjs +18 -0
- package/msg/sr-latn.js +18 -0
- package/msg/sr-latn.mjs +18 -0
- package/msg/sr.js +18 -0
- package/msg/sr.mjs +18 -0
- package/msg/sv.js +18 -0
- package/msg/sv.mjs +18 -0
- package/msg/sw.js +18 -0
- package/msg/sw.mjs +18 -0
- package/msg/ta.js +18 -0
- package/msg/ta.mjs +18 -0
- package/msg/tcy.js +18 -0
- package/msg/tcy.mjs +18 -0
- package/msg/tdd.js +18 -0
- package/msg/tdd.mjs +18 -0
- package/msg/te.js +18 -0
- package/msg/te.mjs +18 -0
- package/msg/th.js +18 -0
- package/msg/th.mjs +18 -0
- package/msg/ti.js +18 -0
- package/msg/ti.mjs +18 -0
- package/msg/tl.js +18 -0
- package/msg/tl.mjs +18 -0
- package/msg/tlh.js +18 -0
- package/msg/tlh.mjs +18 -0
- package/msg/tr.js +18 -0
- package/msg/tr.mjs +18 -0
- package/msg/ug-arab.js +18 -0
- package/msg/ug-arab.mjs +18 -0
- package/msg/uk.js +18 -0
- package/msg/uk.mjs +18 -0
- package/msg/ur.js +18 -0
- package/msg/ur.mjs +18 -0
- package/msg/uz.js +18 -0
- package/msg/uz.mjs +18 -0
- package/msg/vi.js +19 -1
- package/msg/vi.mjs +18 -0
- package/msg/xmf.js +18 -0
- package/msg/xmf.mjs +18 -0
- package/msg/yo.js +18 -0
- package/msg/yo.mjs +18 -0
- package/msg/zgh.js +18 -0
- package/msg/zgh.mjs +18 -0
- package/msg/zh-hans.js +18 -0
- package/msg/zh-hans.mjs +18 -0
- package/msg/zh-hant.js +18 -0
- package/msg/zh-hant.mjs +18 -0
- package/package.json +24 -18
- package/php_compressed.js +16 -16
- package/python_compressed.js +40 -40
- package/python_compressed.js.map +1 -1
package/core/field_dropdown.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
73
73
|
* change.
|
|
74
74
|
* @param config A map of options used to configure the field.
|
|
75
75
|
* See the [field creation documentation]{@link
|
|
76
|
-
* https://
|
|
76
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/dropdown/#creation}
|
|
77
77
|
* for a list of properties this parameter supports.
|
|
78
78
|
* @throws {TypeError} If `menuGenerator` options are incorrectly structured.
|
|
79
79
|
*/
|
|
@@ -343,7 +343,7 @@ export interface FieldDropdownFromJsonConfig extends FieldDropdownConfig {
|
|
|
343
343
|
* A function that is called to validate changes to the field's value before
|
|
344
344
|
* they are set.
|
|
345
345
|
*
|
|
346
|
-
* @see {@link https://
|
|
346
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
347
347
|
* @param newValue The value to be validated.
|
|
348
348
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
349
349
|
* or `undefined`.
|
package/core/field_image.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare class FieldImage extends Field<string> {
|
|
|
51
51
|
* @param flipRtl Whether to flip the icon in RTL.
|
|
52
52
|
* @param config A map of options used to configure the field.
|
|
53
53
|
* See the [field creation documentation]{@link
|
|
54
|
-
* https://
|
|
54
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/image/#creation}
|
|
55
55
|
* for a list of properties this parameter supports.
|
|
56
56
|
*/
|
|
57
57
|
constructor(src: string | typeof Field.SKIP_SETUP, width: string | number, height: string | number, alt?: string, onClick?: (p1: FieldImage) => void, flipRtl?: boolean, config?: FieldImageConfig);
|
package/core/field_input.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
76
76
|
* to abort the change.
|
|
77
77
|
* @param config A map of options used to configure the field.
|
|
78
78
|
* See the [field creation documentation]{@link
|
|
79
|
-
* https://
|
|
79
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/text-input/#creation}
|
|
80
80
|
* for a list of properties this parameter supports.
|
|
81
81
|
*/
|
|
82
82
|
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldInputValidator<T> | null, config?: FieldInputConfig);
|
|
@@ -219,8 +219,8 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
219
219
|
protected resizeEditor_(): void;
|
|
220
220
|
/**
|
|
221
221
|
* Handles repositioning the WidgetDiv used for input fields when the
|
|
222
|
-
* workspace is resized.
|
|
223
|
-
* position of the text input
|
|
222
|
+
* workspace is resized. Scrolls this field into view, then updates the
|
|
223
|
+
* position of the text input.
|
|
224
224
|
*
|
|
225
225
|
* @returns True for rendered workspaces, as we never want to hide the widget
|
|
226
226
|
* div.
|
|
@@ -300,7 +300,7 @@ export interface FieldInputConfig extends FieldConfig {
|
|
|
300
300
|
* A function that is called to validate changes to the field's value before
|
|
301
301
|
* they are set.
|
|
302
302
|
*
|
|
303
|
-
* @see {@link https://
|
|
303
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
304
304
|
* @param newValue The value to be validated.
|
|
305
305
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
306
306
|
* or `undefined`.
|
package/core/field_label.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare class FieldLabel extends Field<string> {
|
|
|
33
33
|
* @param textClass Optional CSS class for the field's text.
|
|
34
34
|
* @param config A map of options used to configure the field.
|
|
35
35
|
* See the [field creation documentation]{@link
|
|
36
|
-
* https://
|
|
36
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/label/#creation}
|
|
37
37
|
* for a list of properties this parameter supports.
|
|
38
38
|
*/
|
|
39
39
|
constructor(value?: string | typeof Field.SKIP_SETUP, textClass?: string, config?: FieldLabelConfig);
|
|
@@ -32,7 +32,7 @@ export declare class FieldLabelSerializable extends FieldLabel {
|
|
|
32
32
|
* @param textClass Optional CSS class for the field's text.
|
|
33
33
|
* @param config A map of options used to configure the field.
|
|
34
34
|
* See the [field creation documentation]{@link
|
|
35
|
-
* https://
|
|
35
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/label-serializable/#creation}
|
|
36
36
|
* for a list of properties this parameter supports.
|
|
37
37
|
*/
|
|
38
38
|
constructor(value?: string, textClass?: string, config?: FieldLabelConfig);
|
package/core/field_number.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class FieldNumber extends FieldInput<number> {
|
|
|
43
43
|
* to abort the change.
|
|
44
44
|
* @param config A map of options used to configure the field.
|
|
45
45
|
* See the [field creation documentation]{@link
|
|
46
|
-
* https://
|
|
46
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/number/#creation}
|
|
47
47
|
* for a list of properties this parameter supports.
|
|
48
48
|
*/
|
|
49
49
|
constructor(value?: string | number | typeof Field.SKIP_SETUP, min?: string | number | null, max?: string | number | null, precision?: string | number | null, validator?: FieldNumberValidator | null, config?: FieldNumberConfig);
|
|
@@ -189,7 +189,7 @@ export interface FieldNumberFromJsonConfig extends FieldNumberConfig {
|
|
|
189
189
|
* A function that is called to validate changes to the field's value before
|
|
190
190
|
* they are set.
|
|
191
191
|
*
|
|
192
|
-
* @see {@link https://
|
|
192
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
193
193
|
* @param newValue The value to be validated.
|
|
194
194
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
195
195
|
* or `undefined`.
|
|
@@ -25,7 +25,7 @@ export declare class FieldTextInput extends FieldInput<string> {
|
|
|
25
25
|
* to abort the change.
|
|
26
26
|
* @param config A map of options used to configure the field.
|
|
27
27
|
* See the [field creation documentation]{@link
|
|
28
|
-
* https://
|
|
28
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/text-input/#creation}
|
|
29
29
|
* for a list of properties this parameter supports.
|
|
30
30
|
*/
|
|
31
31
|
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldTextInputValidator | null, config?: FieldTextInputConfig);
|
|
@@ -72,7 +72,7 @@ export interface FieldTextInputFromJsonConfig extends FieldTextInputConfig {
|
|
|
72
72
|
* A function that is called to validate changes to the field's value before
|
|
73
73
|
* they are set.
|
|
74
74
|
*
|
|
75
|
-
* @see {@link https://
|
|
75
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
76
76
|
* @param newValue The value to be validated.
|
|
77
77
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
78
78
|
* or `undefined`.
|
package/core/field_variable.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare class FieldVariable extends FieldDropdown {
|
|
|
51
51
|
* is not provided.
|
|
52
52
|
* @param config A map of options used to configure the field.
|
|
53
53
|
* See the [field creation documentation]{@link
|
|
54
|
-
* https://
|
|
54
|
+
* https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/variable/#creation}
|
|
55
55
|
* for a list of properties this parameter supports.
|
|
56
56
|
*/
|
|
57
57
|
constructor(varName: string | null | typeof Field.SKIP_SETUP, validator?: FieldVariableValidator, variableTypes?: string[] | null, defaultType?: string, config?: FieldVariableConfig);
|
|
@@ -254,7 +254,7 @@ export interface FieldVariableFromJsonConfig extends FieldVariableConfig {
|
|
|
254
254
|
* A function that is called to validate changes to the field's value before
|
|
255
255
|
* they are set.
|
|
256
256
|
*
|
|
257
|
-
* @see {@link https://
|
|
257
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
258
258
|
* @param newValue The value to be validated.
|
|
259
259
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
260
260
|
* or `undefined`.
|
package/core/generator.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { Workspace } from './workspace.js';
|
|
|
17
17
|
* functions.
|
|
18
18
|
*
|
|
19
19
|
* @deprecated
|
|
20
|
-
* @see {@link https://
|
|
20
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/code-generation/overview/#block-code-generators}
|
|
21
21
|
* @param block The Block instance to generate code for.
|
|
22
22
|
* @param generator The CodeGenerator calling the function.
|
|
23
23
|
* @returns A string containing the generated code (for statement blocks),
|
package/core/grid.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class Grid {
|
|
|
26
26
|
* @param pattern The grid's SVG pattern, created during injection.
|
|
27
27
|
* @param options A dictionary of normalized options for the grid.
|
|
28
28
|
* See grid documentation:
|
|
29
|
-
* https://
|
|
29
|
+
* https://docs.blockly.com/guides/configure/grid/
|
|
30
30
|
*/
|
|
31
31
|
constructor(pattern: SVGElement, options: GridOptions);
|
|
32
32
|
/**
|
|
@@ -43,6 +43,8 @@ export declare class KeyboardMover {
|
|
|
43
43
|
private allowedShortcuts;
|
|
44
44
|
private readonly blurListener;
|
|
45
45
|
static mover: KeyboardMover;
|
|
46
|
+
/** Whether or not something is currently being moved. */
|
|
47
|
+
private moving;
|
|
46
48
|
private constructor();
|
|
47
49
|
/**
|
|
48
50
|
* Returns true iff the given draggable is allowed to be moved.
|
|
@@ -145,6 +145,18 @@ export declare class Navigator {
|
|
|
145
145
|
* the workspace.
|
|
146
146
|
*/
|
|
147
147
|
getNavigationLoops(): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the navigable top-level items of a tree, in navigation order.
|
|
150
|
+
*
|
|
151
|
+
* For a workspace these are its stacks and comments; for a toolbox its
|
|
152
|
+
* categories; for a flyout its blocks, buttons and labels.
|
|
153
|
+
*
|
|
154
|
+
* @param root The root node of the tree to list, defaulting to the root of
|
|
155
|
+
* the currently focused tree.
|
|
156
|
+
* @returns The navigable top-level items, or an empty list if there is no
|
|
157
|
+
* tree to list.
|
|
158
|
+
*/
|
|
159
|
+
getNavigableItems(root?: IFocusableNode | undefined): IFocusableNode[];
|
|
148
160
|
/**
|
|
149
161
|
* Get the first navigable node on the workspace, or null if none exist.
|
|
150
162
|
*
|
package/core/options.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare class Options {
|
|
|
76
76
|
/**
|
|
77
77
|
* @param options Dictionary of options.
|
|
78
78
|
* Specification:
|
|
79
|
-
* https://
|
|
79
|
+
* https://docs.blockly.com/guides/configure/configuration_struct/#the-options-dictionary
|
|
80
80
|
*/
|
|
81
81
|
constructor(options: BlocklyOptions);
|
|
82
82
|
/**
|
|
@@ -91,7 +91,7 @@ export declare class Options {
|
|
|
91
91
|
/**
|
|
92
92
|
* Parse the user-specified zoom options, using reasonable defaults where
|
|
93
93
|
* behaviour is unspecified. See zoom documentation:
|
|
94
|
-
* https://
|
|
94
|
+
* https://docs.blockly.com/guides/configure/zoom/
|
|
95
95
|
*
|
|
96
96
|
* @param options Dictionary of options.
|
|
97
97
|
* @returns Normalized zoom options.
|
|
@@ -100,7 +100,7 @@ export declare class Options {
|
|
|
100
100
|
/**
|
|
101
101
|
* Parse the user-specified grid options, using reasonable defaults where
|
|
102
102
|
* behaviour is unspecified. See grid documentation:
|
|
103
|
-
* https://
|
|
103
|
+
* https://docs.blockly.com/guides/configure/grid/
|
|
104
104
|
*
|
|
105
105
|
* @param options Dictionary of options.
|
|
106
106
|
* @returns Normalized grid options.
|
|
@@ -108,7 +108,7 @@ export declare class Options {
|
|
|
108
108
|
private static parseGridOptions;
|
|
109
109
|
/**
|
|
110
110
|
* Parse the user-specified theme options, using the classic theme as a
|
|
111
|
-
* default. https://
|
|
111
|
+
* default. https://docs.blockly.com/guides/configure/appearance/themes/
|
|
112
112
|
*
|
|
113
113
|
* @param options Dictionary of options.
|
|
114
114
|
* @returns A Blockly Theme.
|
package/core/shortcut_items.d.ts
CHANGED
|
@@ -46,7 +46,13 @@ export declare enum names {
|
|
|
46
46
|
JUMP_BLOCK_START = "jump_to_block_start",
|
|
47
47
|
JUMP_BLOCK_END = "jump_to_block_end",
|
|
48
48
|
JUMP_FIRST_BLOCK = "jump_to_first_block",
|
|
49
|
-
JUMP_LAST_BLOCK = "jump_to_last_block"
|
|
49
|
+
JUMP_LAST_BLOCK = "jump_to_last_block",
|
|
50
|
+
JUMP_PREVIOUS_PAGE = "jump_to_previous_page",
|
|
51
|
+
JUMP_NEXT_PAGE = "jump_to_next_page",
|
|
52
|
+
SCROLL_LEFT = "scroll_left",
|
|
53
|
+
SCROLL_RIGHT = "scroll_right",
|
|
54
|
+
SCROLL_UP = "scroll_up",
|
|
55
|
+
SCROLL_DOWN = "scroll_down"
|
|
50
56
|
}
|
|
51
57
|
/**
|
|
52
58
|
* Keyboard shortcut to hide chaff on escape.
|
|
@@ -177,6 +183,21 @@ export declare function registerJumpFirstBlock(): void;
|
|
|
177
183
|
* block in the workspace.
|
|
178
184
|
*/
|
|
179
185
|
export declare function registerJumpLastBlock(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Registers a keyboard shortcut that pages backwards through the items of the
|
|
188
|
+
* focused toolbox or flyout.
|
|
189
|
+
*/
|
|
190
|
+
export declare function registerJumpPreviousPage(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Registers a keyboard shortcut that pages forwards through the items of the
|
|
193
|
+
* focused toolbox or flyout.
|
|
194
|
+
*/
|
|
195
|
+
export declare function registerJumpNextPage(): void;
|
|
196
|
+
/**
|
|
197
|
+
* Registers keyboard shortcuts to scroll the focused workspace or flyout with
|
|
198
|
+
* Ctrl/Cmd + arrow keys.
|
|
199
|
+
*/
|
|
200
|
+
export declare function registerWorkspaceScrollShortcuts(): void;
|
|
180
201
|
/**
|
|
181
202
|
* Registers all default keyboard shortcut item. This should be called once per
|
|
182
203
|
* instance of KeyboardShortcutRegistry.
|
|
@@ -194,7 +215,9 @@ export declare function registerKeyboardNavigationShortcuts(): void;
|
|
|
194
215
|
*/
|
|
195
216
|
export declare function registerScreenReaderShortcuts(): void;
|
|
196
217
|
/**
|
|
197
|
-
* Registers keyboard shortcuts used to jump between blocks and stacks in the
|
|
218
|
+
* Registers keyboard shortcuts used to jump between blocks and stacks in the
|
|
219
|
+
* workspace, between items in the toolbox and flyout, and to scroll the
|
|
220
|
+
* workspace or flyout.
|
|
198
221
|
* Note these are not registered by default, so call this function to enable them if desired.
|
|
199
222
|
*/
|
|
200
223
|
export declare function registerNavigationShortcuts(): void;
|
|
@@ -21,7 +21,7 @@ export declare class ShortcutRegistry {
|
|
|
21
21
|
static readonly registry: ShortcutRegistry;
|
|
22
22
|
/** Registry of all keyboard shortcuts, keyed by name of shortcut. */
|
|
23
23
|
private shortcuts;
|
|
24
|
-
/** Map of key codes to
|
|
24
|
+
/** Map of key codes to a set of shortcut names. */
|
|
25
25
|
private keyMap;
|
|
26
26
|
/** Resets the existing ShortcutRegistry singleton. */
|
|
27
27
|
private constructor();
|
package/core/tooltip.d.ts
CHANGED
|
@@ -25,9 +25,10 @@ export type CustomTooltip = (p1: Element, p2: Element) => any;
|
|
|
25
25
|
* Sets a custom function that will be called if present instead of the default
|
|
26
26
|
* tooltip UI.
|
|
27
27
|
*
|
|
28
|
-
* @param customFn A custom tooltip used to render an alternate tooltip UI
|
|
28
|
+
* @param customFn A custom tooltip used to render an alternate tooltip UI, or
|
|
29
|
+
* undefined to use the default implementation.
|
|
29
30
|
*/
|
|
30
|
-
export declare function setCustomTooltip(customFn: CustomTooltip): void;
|
|
31
|
+
export declare function setCustomTooltip(customFn: CustomTooltip | undefined): void;
|
|
31
32
|
/**
|
|
32
33
|
* Gets the custom tooltip function.
|
|
33
34
|
*
|
package/core/trashcan.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type { IAutoHideable } from './interfaces/i_autohideable.js';
|
|
|
9
9
|
import type { IComponent } from './interfaces/i_component';
|
|
10
10
|
import type { IDraggable } from './interfaces/i_draggable.js';
|
|
11
11
|
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
12
|
-
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
13
12
|
import type { IPositionable } from './interfaces/i_positionable.js';
|
|
14
13
|
import type { UiMetrics } from './metrics_manager.js';
|
|
15
14
|
import { Rect } from './utils/rect.js';
|
|
@@ -17,7 +16,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
17
16
|
/**
|
|
18
17
|
* Class for a trash can.
|
|
19
18
|
*/
|
|
20
|
-
export declare class Trashcan extends DeleteArea implements IAutoHideable, IPositionable,
|
|
19
|
+
export declare class Trashcan extends DeleteArea implements IAutoHideable, IPositionable, IComponent {
|
|
21
20
|
private workspace;
|
|
22
21
|
/**
|
|
23
22
|
* The id for this component that is used to register with the
|
|
@@ -153,6 +152,12 @@ export declare class Trashcan extends DeleteArea implements IAutoHideable, IPosi
|
|
|
153
152
|
closeLid(): void;
|
|
154
153
|
/** Inspect the contents of the trash. */
|
|
155
154
|
click(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Activates the trashcan when Enter or Space is pressed.
|
|
157
|
+
*
|
|
158
|
+
* @param e A keydown event.
|
|
159
|
+
*/
|
|
160
|
+
private onKeyDown;
|
|
156
161
|
/**
|
|
157
162
|
* Fires a UI event for trashcan flyout open or close.
|
|
158
163
|
*
|
|
@@ -181,11 +186,5 @@ export declare class Trashcan extends DeleteArea implements IAutoHideable, IPosi
|
|
|
181
186
|
* unnecessary attributes.
|
|
182
187
|
*/
|
|
183
188
|
private cleanBlockJson;
|
|
184
|
-
getFocusableElement(): SVGElement;
|
|
185
|
-
getFocusableTree(): WorkspaceSvg;
|
|
186
|
-
onNodeFocus(): void;
|
|
187
|
-
onNodeBlur(): void;
|
|
188
|
-
canBeFocused(): boolean;
|
|
189
|
-
performAction(): void;
|
|
190
189
|
}
|
|
191
190
|
//# sourceMappingURL=trashcan.d.ts.map
|
package/core/utils/aria.d.ts
CHANGED
|
@@ -69,6 +69,8 @@ export declare enum Role {
|
|
|
69
69
|
REGION = "region",
|
|
70
70
|
/** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/row_role. */
|
|
71
71
|
ROW = "row",
|
|
72
|
+
/** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/search_role. */
|
|
73
|
+
SEARCH = "search",
|
|
72
74
|
/** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/separator_role. */
|
|
73
75
|
SEPARATOR = "separator",
|
|
74
76
|
/** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/status_role. */
|
|
@@ -34,8 +34,8 @@ export declare class FocusableTreeTraverser {
|
|
|
34
34
|
* the specified IFocusableTree.
|
|
35
35
|
*
|
|
36
36
|
* If the element exists within the specified tree's DOM structure but does
|
|
37
|
-
* not directly correspond to a node
|
|
38
|
-
* root) will be returned to represent the provided element.
|
|
37
|
+
* not directly correspond to a node and is not a tab stop, the nearest parent
|
|
38
|
+
* node (or the tree's root) will be returned to represent the provided element.
|
|
39
39
|
*
|
|
40
40
|
* If the tree contains another nested IFocusableTree, the nested tree may be
|
|
41
41
|
* traversed but its nodes will never be returned here per the contract of
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -801,8 +801,9 @@ export declare class WorkspaceSvg extends Workspace implements IContextMenu, IFo
|
|
|
801
801
|
*
|
|
802
802
|
* @param x Target X to scroll to.
|
|
803
803
|
* @param y Target Y to scroll to.
|
|
804
|
+
* @param shouldHidePopups Whether to hide popups. Defaults to true.
|
|
804
805
|
*/
|
|
805
|
-
scroll(x: number, y: number): void;
|
|
806
|
+
scroll(x: number, y: number, shouldHidePopups?: boolean): void;
|
|
806
807
|
/**
|
|
807
808
|
* Find the block on this workspace with the specified ID.
|
|
808
809
|
*
|
package/dart_compressed.js
CHANGED
|
@@ -12,25 +12,25 @@
|
|
|
12
12
|
}
|
|
13
13
|
}(this, function(__parent__) {
|
|
14
14
|
var $=__parent__.__namespace__;
|
|
15
|
-
var
|
|
16
|
-
f),d+=" else {\n"+f+"}";return d+"\n"},
|
|
15
|
+
var kt=function(a,b){var c=0,d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do{var e=b.valueToCode(a,"IF"+c,Z.NONE)||"false";var f=b.statementToCode(a,"DO"+c);b.STATEMENT_SUFFIX&&(f=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+f);d+=(c>0?"else ":"")+"if ("+e+") {\n"+f+"}";c++}while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)f=a.getInput("ELSE")?b.statementToCode(a,"ELSE"):"",b.STATEMENT_SUFFIX&&(f=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+
|
|
16
|
+
f),d+=" else {\n"+f+"}";return d+"\n"},lt=function(a,b){var c=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):b.valueToCode(a,"TIMES",Z.ASSIGNMENT)||"0";var d=b.statementToCode(a,"DO");d=b.addLoopTrap(d,a);a="";var e=b.nameDB_.getDistinctName("count",$.P.VARIABLE),f=c;c.match(/^\w+$/)||$.zf(c)||(f=b.nameDB_.getDistinctName("repeat_end",$.P.VARIABLE),a+="var "+f+" = "+c+";\n");return a+("for (int "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")},mt=function(a,b){var c=a.getFieldValue("OP");
|
|
17
17
|
if(c==="NEG")return a=b.valueToCode(a,"NUM",Z.UNARY_PREFIX)||"0",a[0]==="-"&&(a=" "+a),["-"+a,Z.UNARY_PREFIX];b.definitions_.import_dart_math="import 'dart:math' as Math;";a=c==="ABS"||c.substring(0,5)==="ROUND"?b.valueToCode(a,"NUM",Z.UNARY_POSTFIX)||"0":c==="SIN"||c==="COS"||c==="TAN"?b.valueToCode(a,"NUM",Z.MULTIPLICATIVE)||"0":b.valueToCode(a,"NUM",Z.NONE)||"0";switch(c){case "ABS":var d=a+".abs()";break;case "ROOT":d="Math.sqrt("+a+")";break;case "LN":d="Math.log("+a+")";break;case "EXP":d="Math.exp("+
|
|
18
18
|
a+")";break;case "POW10":d="Math.pow(10,"+a+")";break;case "ROUND":d=a+".round()";break;case "ROUNDUP":d=a+".ceil()";break;case "ROUNDDOWN":d=a+".floor()";break;case "SIN":d="Math.sin("+a+" / 180 * Math.pi)";break;case "COS":d="Math.cos("+a+" / 180 * Math.pi)";break;case "TAN":d="Math.tan("+a+" / 180 * Math.pi)"}if(d)return[d,Z.UNARY_POSTFIX];switch(c){case "LOG10":d="Math.log("+a+") / Math.log(10)";break;case "ASIN":d="Math.asin("+a+") / Math.pi * 180";break;case "ACOS":d="Math.acos("+a+") / Math.pi * 180";
|
|
19
|
-
break;case "ATAN":d="Math.atan("+a+") / Math.pi * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,Z.MULTIPLICATIVE]},
|
|
20
|
-
"STACK"));var g="";a.getInput("RETURN")&&(g=b.valueToCode(a,"RETURN",Z.NONE)||"");var h="";f&&g&&(h=d);g&&(g=b.INDENT+"return "+g+";\n");var m=g?"dynamic":"void",z=[],
|
|
21
|
-
b.valueToCode(a,"TEXT",Z.NONE)||"''")+", '')";a.getFieldValue("TYPE")==="NUMBER"&&(b.definitions_.import_dart_math="import 'dart:math' as Math;",c="Math.parseDouble("+c+")");return[c,Z.UNARY_POSTFIX]},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
this.nameDB_.reset():this.nameDB_=new $.
|
|
19
|
+
break;case "ATAN":d="Math.atan("+a+") / Math.pi * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,Z.MULTIPLICATIVE]},nt=function(a,b){var c=b.getProcedureName(a.getFieldValue("NAME")),d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(d+=b.injectId(b.STATEMENT_SUFFIX,a));d&&(d=b.prefixLines(d,b.INDENT));var e="";b.INFINITE_LOOP_TRAP&&(e=b.prefixLines(b.injectId(b.INFINITE_LOOP_TRAP,a),b.INDENT));var f="";a.getInput("STACK")&&(f=b.statementToCode(a,
|
|
20
|
+
"STACK"));var g="";a.getInput("RETURN")&&(g=b.valueToCode(a,"RETURN",Z.NONE)||"");var h="";f&&g&&(h=d);g&&(g=b.INDENT+"return "+g+";\n");var m=g?"dynamic":"void",z=[],F=a.getVarModels();for(let J=0;J<F.length;J++)z[J]=b.getVariableName(F[J].getId());d=m+" "+c+"("+z.join(", ")+") {\n"+d+e+f+h+g+"}";d=b.scrub_(a,d);b.definitions_["%"+c]=d;return null},ot=function(a,b){b.definitions_.import_dart_html="import 'dart:html' as Html;";var c="Html.window.prompt("+(a.getField("TEXT")?b.quote_(a.getFieldValue("TEXT")):
|
|
21
|
+
b.valueToCode(a,"TEXT",Z.NONE)||"''")+", '')";a.getFieldValue("TYPE")==="NUMBER"&&(b.definitions_.import_dart_math="import 'dart:math' as Math;",c="Math.parseDouble("+c+")");return[c,Z.UNARY_POSTFIX]},pt=function(a,b){return[b.getVariableName(a.getFieldValue("VAR")),Z.ATOMIC]},qt=function(a,b){var c=b.valueToCode(a,"VALUE",Z.ASSIGNMENT)||"0";return b.getVariableName(a.getFieldValue("VAR"))+" = "+c+";\n"},Z,rt=Z||(Z={});rt[rt.ATOMIC=0]="ATOMIC";rt[rt.UNARY_POSTFIX=1]="UNARY_POSTFIX";
|
|
22
|
+
rt[rt.UNARY_PREFIX=2]="UNARY_PREFIX";rt[rt.MULTIPLICATIVE=3]="MULTIPLICATIVE";rt[rt.ADDITIVE=4]="ADDITIVE";rt[rt.SHIFT=5]="SHIFT";rt[rt.BITWISE_AND=6]="BITWISE_AND";rt[rt.BITWISE_XOR=7]="BITWISE_XOR";rt[rt.BITWISE_OR=8]="BITWISE_OR";rt[rt.RELATIONAL=9]="RELATIONAL";rt[rt.EQUALITY=10]="EQUALITY";rt[rt.LOGICAL_AND=11]="LOGICAL_AND";rt[rt.LOGICAL_OR=12]="LOGICAL_OR";rt[rt.IF_NULL=13]="IF_NULL";rt[rt.CONDITIONAL=14]="CONDITIONAL";rt[rt.CASCADE=15]="CASCADE";rt[rt.ASSIGNMENT=16]="ASSIGNMENT";
|
|
23
|
+
rt[rt.NONE=99]="NONE";
|
|
24
|
+
var st=class extends $.zq{constructor(a="Dart"){super(a);this.isInitialized=!1;for(let b in Z)a=Z[b],typeof a!=="string"&&(this["ORDER_"+b]=a);this.addReservedWords("assert,break,case,catch,class,const,continue,default,do,else,enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,switch,this,throw,true,try,var,void,while,with,print,identityHashCode,identical,BidirectionalIterator,Comparable,double,Function,int,Invocation,Iterable,Iterator,List,Map,Match,num,Pattern,RegExp,Set,StackTrace,String,StringSink,Type,bool,DateTime,Deprecated,Duration,Expando,Null,Object,RuneIterator,Runes,Stopwatch,StringBuffer,Symbol,Uri,Comparator,AbstractClassInstantiationError,ArgumentError,AssertionError,CastError,ConcurrentModificationError,CyclicInitializationError,Error,Exception,FallThroughError,FormatException,IntegerDivisionByZeroException,NoSuchMethodError,NullThrownError,OutOfMemoryError,RangeError,StackOverflowError,StateError,TypeError,UnimplementedError,UnsupportedError")}init(a){super.init(a);this.nameDB_?
|
|
25
|
+
this.nameDB_.reset():this.nameDB_=new $.Cj(this.RESERVED_WORDS_);this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);var b=[],c=$.Cd(a);for(let d=0;d<c.length;d++)b.push(this.nameDB_.getName(c[d],$.P.DEVELOPER_VARIABLE));a=$.Bd(a);for(c=0;c<a.length;c++)b.push(this.nameDB_.getName(a[c].getId(),$.P.VARIABLE));b.length&&(this.definitions_.variables="var "+b.join(", ")+";");this.isInitialized=!0}finish(a){a&&(a=this.prefixLines(a,this.INDENT));
|
|
26
26
|
a="main() {\n"+a+"}";var b=[],c=[];for(let d in this.definitions_){let e=this.definitions_[d];e.match(/^import\s/)?b.push(e):c.push(e)}a=super.finish(a);this.isInitialized=!1;this.nameDB_.reset();return(b.join("\n")+"\n\n"+c.join("\n\n")).replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n\n\n")+a}scrubNakedValue(a){return a+";\n"}quote_(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\$/g,"\\$").replace(/'/g,"\\'");return"'"+a+"'"}multiline_quote_(a){return a.split(/\n/g).map(this.quote_).join(" + '\\n' + \n")}scrub_(a,
|
|
27
27
|
b,c=!1){var d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.yf(e,this.COMMENT_WRAP-3),d="getProcedureDef"in a?d+this.prefixLines(e+"\n","/// "):d+this.prefixLines(e+"\n","// "));for(let f=0;f<a.inputList.length;f++)a.inputList[f].type===$.je.VALUE&&(e=a.inputList[f].connection.targetBlock())&&(e=this.allNestedComments(e))&&(d+=this.prefixLines(e,"// "))}a=a.nextConnection&&a.nextConnection.targetBlock();c=c?"":this.blockToCode(a);return d+b+c}getAdjusted(a,
|
|
28
|
-
b,c=0,d=!1,e=Z.NONE){a.workspace.options.oneBasedIndex&&c--;var f=a.workspace.options.oneBasedIndex?"1":"0",g=e;c?g=Z.ADDITIVE:d&&(g=Z.UNARY_PREFIX);a=this.valueToCode(a,b,g)||f;if(c===0&&!d)return a;if($.zf(a))return a=String(Number(a)+c),d&&(a=String(-Number(a))),a;c>0?a=`${a} + ${c}`:c<0&&(a=`${a} - ${-c}`);d&&(a=c?`-(${a})`:`-${a}`);Math.floor(e)>=Math.floor(g)&&(a=`(${a})`);return a}};var
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
b,c=0,d=!1,e=Z.NONE){a.workspace.options.oneBasedIndex&&c--;var f=a.workspace.options.oneBasedIndex?"1":"0",g=e;c?g=Z.ADDITIVE:d&&(g=Z.UNARY_PREFIX);a=this.valueToCode(a,b,g)||f;if(c===0&&!d)return a;if($.zf(a))return a=String(Number(a)+c),d&&(a=String(-Number(a))),a;c>0?a=`${a} + ${c}`:c<0&&(a=`${a} - ${-c}`);d&&(a=c?`-(${a})`:`-${a}`);Math.floor(e)>=Math.floor(g)&&(a=`(${a})`);return a}};var tt={};tt.controls_if=kt;tt.controls_ifelse=kt;tt.logic_boolean=function(a){return[a.getFieldValue("BOOL")==="TRUE"?"true":"false",Z.ATOMIC]};tt.logic_compare=function(a,b){var c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d=c==="=="||c==="!="?Z.EQUALITY:Z.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+c+" "+a,d]};tt.logic_negate=function(a,b){var c=Z.UNARY_PREFIX;return["!"+(b.valueToCode(a,"BOOL",c)||"true"),c]};
|
|
29
|
+
tt.logic_null=function(){return["null",Z.ATOMIC]};tt.logic_operation=function(a,b){var c=a.getFieldValue("OP")==="AND"?"&&":"||",d=c==="&&"?Z.LOGICAL_AND:Z.LOGICAL_OR,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]};
|
|
30
|
+
tt.logic_ternary=function(a,b){var c=b.valueToCode(a,"IF",Z.CONDITIONAL)||"false",d=b.valueToCode(a,"THEN",Z.CONDITIONAL)||"null";a=b.valueToCode(a,"ELSE",Z.CONDITIONAL)||"null";return[c+" ? "+d+" : "+a,Z.CONDITIONAL]};var ut={controls_flow_statements:function(a,b){var c="";b.STATEMENT_PREFIX&&(c+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(c+=b.injectId(b.STATEMENT_SUFFIX,a));if(b.STATEMENT_PREFIX){let d=a.getSurroundLoop();d&&!d.suppressPrefixSuffix&&(c+=b.injectId(b.STATEMENT_PREFIX,d))}switch(a.getFieldValue("FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");},controls_for:function(a,b){var c=b.getVariableName(a.getFieldValue("VAR")),
|
|
31
31
|
d=b.valueToCode(a,"FROM",Z.ASSIGNMENT)||"0",e=b.valueToCode(a,"TO",Z.ASSIGNMENT)||"0",f=b.valueToCode(a,"BY",Z.ASSIGNMENT)||"1",g=b.statementToCode(a,"DO");g=b.addLoopTrap(g,a);if($.zf(d)&&$.zf(e)&&$.zf(f))b=Number(d)<=Number(e),a="for ("+c+" = "+d+"; "+c+(b?" <= ":" >= ")+e+"; "+c,c=Math.abs(Number(f)),a=c===1?a+(b?"++":"--"):a+((b?" += ":" -= ")+c),a+=") {\n"+g+"}\n";else{a="";let h=d;d.match(/^\w+$/)||$.zf(d)||(h=b.nameDB_.getDistinctName(c+"_start",$.P.VARIABLE),a+="var "+h+" = "+d+";\n");d=e;
|
|
32
32
|
e.match(/^\w+$/)||$.zf(e)||(d=b.nameDB_.getDistinctName(c+"_end",$.P.VARIABLE),a+="var "+d+" = "+e+";\n");e=b.nameDB_.getDistinctName(c+"_inc",$.P.VARIABLE);a+="num "+e+" = ";a=$.zf(f)?a+(Math.abs(Number(f))+";\n"):a+("("+f+").abs();\n");a+="if ("+h+" > "+d+") {\n";a+=b.INDENT+e+" = -"+e+";\n";a=a+"}\nfor ("+(c+" = "+h+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+g+"}\n")}return a},controls_forEach:function(a,b){var c=b.getVariableName(a.getFieldValue("VAR")),d=b.valueToCode(a,
|
|
33
|
-
"LIST",Z.ASSIGNMENT)||"[]",e=b.statementToCode(a,"DO");e=b.addLoopTrap(e,a);return"for (var "+c+" in "+d+") {\n"+e+"}\n"}};
|
|
33
|
+
"LIST",Z.ASSIGNMENT)||"[]",e=b.statementToCode(a,"DO");e=b.addLoopTrap(e,a);return"for (var "+c+" in "+d+") {\n"+e+"}\n"}};ut.controls_repeat=lt;ut.controls_repeat_ext=lt;ut.controls_whileUntil=function(a,b){var c=a.getFieldValue("MODE")==="UNTIL",d=b.valueToCode(a,"BOOL",c?Z.UNARY_PREFIX:Z.NONE)||"false",e=b.statementToCode(a,"DO");e=b.addLoopTrap(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"};var vt={math_arithmetic:function(a,b){var c={ADD:[" + ",Z.ADDITIVE],MINUS:[" - ",Z.ADDITIVE],MULTIPLY:[" * ",Z.MULTIPLICATIVE],DIVIDE:[" / ",Z.MULTIPLICATIVE],POWER:[null,Z.NONE]}[a.getFieldValue("OP")],d=c[0];c=c[1];var e=b.valueToCode(a,"A",c)||"0";a=b.valueToCode(a,"B",c)||"0";return d?[e+d+a,c]:(b.definitions_.import_dart_math="import 'dart:math' as Math;",["Math.pow("+e+", "+a+")",Z.UNARY_POSTFIX])},math_atan2:function(a,b){b.definitions_.import_dart_math="import 'dart:math' as Math;";var c=
|
|
34
34
|
b.valueToCode(a,"X",Z.NONE)||"0";return["Math.atan2("+(b.valueToCode(a,"Y",Z.NONE)||"0")+", "+c+") / Math.pi * 180",Z.MULTIPLICATIVE]},math_change:function(a,b){var c=b.valueToCode(a,"DELTA",Z.ADDITIVE)||"0";a=b.getVariableName(a.getFieldValue("VAR"));return a+" = ("+a+" is num ? "+a+" : 0) + "+c+";\n"},math_constant:function(a,b){var c={PI:["Math.pi",Z.UNARY_POSTFIX],E:["Math.e",Z.UNARY_POSTFIX],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",Z.MULTIPLICATIVE],SQRT2:["Math.sqrt2",Z.UNARY_POSTFIX],SQRT1_2:["Math.sqrt1_2",
|
|
35
35
|
Z.UNARY_POSTFIX],INFINITY:["double.infinity",Z.ATOMIC]};a=a.getFieldValue("CONSTANT");a!=="INFINITY"&&(b.definitions_.import_dart_math="import 'dart:math' as Math;");return c[a]},math_constrain:function(a,b){b.definitions_.import_dart_math="import 'dart:math' as Math;";var c=b.valueToCode(a,"VALUE",Z.NONE)||"0",d=b.valueToCode(a,"LOW",Z.NONE)||"0";a=b.valueToCode(a,"HIGH",Z.NONE)||"double.infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",Z.UNARY_POSTFIX]},math_modulo:function(a,b){var c=
|
|
36
36
|
b.valueToCode(a,"DIVIDEND",Z.MULTIPLICATIVE)||"0";a=b.valueToCode(a,"DIVISOR",Z.MULTIPLICATIVE)||"0";return[c+" % "+a,Z.MULTIPLICATIVE]},math_number:function(a){a=Number(a.getFieldValue("NUM"));return a===Infinity?["double.infinity",Z.UNARY_POSTFIX]:a===-Infinity?["-double.infinity",Z.UNARY_PREFIX]:[String(a),a<0?Z.UNARY_PREFIX:Z.ATOMIC]},math_number_property:function(a,b){var c={EVEN:[" % 2 == 0",Z.MULTIPLICATIVE,Z.EQUALITY],ODD:[" % 2 == 1",Z.MULTIPLICATIVE,Z.EQUALITY],WHOLE:[" % 1 == 0",Z.MULTIPLICATIVE,
|
|
@@ -156,8 +156,8 @@ int ${b.FUNCTION_NAME_PLACEHOLDER_}(num a, num b) {
|
|
|
156
156
|
}
|
|
157
157
|
return new Math.Random().nextInt(b - a + 1) + a;
|
|
158
158
|
}
|
|
159
|
-
`)+"("+c+", "+a+")",Z.UNARY_POSTFIX]}}
|
|
160
|
-
|
|
159
|
+
`)+"("+c+", "+a+")",Z.UNARY_POSTFIX]}};vt.math_round=mt;vt.math_single=mt;vt.math_trig=mt;var wt={procedures_callnoreturn:function(a,b){return b.forBlock.procedures_callreturn(a,b)[0]+";\n"},procedures_callreturn:function(a,b){var c=b.getProcedureName(a.getFieldValue("NAME")),d=[],e=a.getVarModels();for(let f=0;f<e.length;f++)d[f]=b.valueToCode(a,"ARG"+f,Z.NONE)||"null";return[c+"("+d.join(", ")+")",Z.UNARY_POSTFIX]}};wt.procedures_defnoreturn=nt;wt.procedures_defreturn=nt;
|
|
160
|
+
wt.procedures_ifreturn=function(a,b){var c="if ("+(b.valueToCode(a,"CONDITION",Z.NONE)||"false")+") {\n";b.STATEMENT_SUFFIX&&(c+=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT));a.hasReturnValue_?(a=b.valueToCode(a,"VALUE",Z.NONE)||"null",c+=b.INDENT+"return "+a+";\n"):c+=b.INDENT+"return;\n";return c+"}\n"};var xt={text:function(a,b){return[b.quote_(a.getFieldValue("TEXT")),Z.ATOMIC]},text_append:function(a,b){var c=b.getVariableName(a.getFieldValue("VAR"));a=b.valueToCode(a,"TEXT",Z.NONE)||"''";return c+" = ["+c+", "+a+"].join();\n"},text_changeCase:function(a,b){var c={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[a.getFieldValue("CASE")];a=b.valueToCode(a,"TEXT",c?Z.UNARY_POSTFIX:Z.NONE)||"''";return[c?a+c:b.provideFunction_("text_toTitleCase",`
|
|
161
161
|
String ${b.FUNCTION_NAME_PLACEHOLDER_}(String str) {
|
|
162
162
|
RegExp exp = new RegExp(r'\\b');
|
|
163
163
|
List<String> list = str.split(exp);
|
|
@@ -217,10 +217,10 @@ String ${b.FUNCTION_NAME_PLACEHOLDER_}(String text, String where1, num at1, Stri
|
|
|
217
217
|
return text.substring(at1, at2);
|
|
218
218
|
}
|
|
219
219
|
`)+"("+f+", '"+c+"', "+g+", '"+d+"', "+a+")";return[b,Z.UNARY_POSTFIX]},text_indexOf:function(a,b){var c=a.getFieldValue("END")==="FIRST"?"indexOf":"lastIndexOf",d=b.valueToCode(a,"FIND",Z.NONE)||"''";b=(b.valueToCode(a,"VALUE",Z.UNARY_POSTFIX)||"''")+"."+c+"("+d+")";return a.workspace.options.oneBasedIndex?[b+" + 1",Z.ADDITIVE]:[b,Z.UNARY_POSTFIX]},text_isEmpty:function(a,b){return[(b.valueToCode(a,"VALUE",Z.UNARY_POSTFIX)||"''")+".isEmpty",Z.UNARY_POSTFIX]},text_join:function(a,b){switch(a.itemCount_){case 0:return["''",
|
|
220
|
-
Z.ATOMIC];case 1:return[(b.valueToCode(a,"ADD0",Z.UNARY_POSTFIX)||"''")+".toString()",Z.UNARY_POSTFIX];default:let c=Array(a.itemCount_);for(let d=0;d<a.itemCount_;d++)c[d]=b.valueToCode(a,"ADD"+d,Z.NONE)||"''";return["["+c.join(",")+"].join()",Z.UNARY_POSTFIX]}},text_length:function(a,b){return[(b.valueToCode(a,"VALUE",Z.UNARY_POSTFIX)||"''")+".length",Z.UNARY_POSTFIX]},text_print:function(a,b){return"print("+(b.valueToCode(a,"TEXT",Z.NONE)||"''")+");\n"}};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
var
|
|
220
|
+
Z.ATOMIC];case 1:return[(b.valueToCode(a,"ADD0",Z.UNARY_POSTFIX)||"''")+".toString()",Z.UNARY_POSTFIX];default:let c=Array(a.itemCount_);for(let d=0;d<a.itemCount_;d++)c[d]=b.valueToCode(a,"ADD"+d,Z.NONE)||"''";return["["+c.join(",")+"].join()",Z.UNARY_POSTFIX]}},text_length:function(a,b){return[(b.valueToCode(a,"VALUE",Z.UNARY_POSTFIX)||"''")+".length",Z.UNARY_POSTFIX]},text_print:function(a,b){return"print("+(b.valueToCode(a,"TEXT",Z.NONE)||"''")+");\n"}};xt.text_prompt=ot;xt.text_prompt_ext=ot;
|
|
221
|
+
xt.text_replace=function(a,b){var c=b.valueToCode(a,"TEXT",Z.UNARY_POSTFIX)||"''",d=b.valueToCode(a,"FROM",Z.NONE)||"''";a=b.valueToCode(a,"TO",Z.NONE)||"''";return[c+".replaceAll("+d+", "+a+")",Z.UNARY_POSTFIX]};xt.text_reverse=function(a,b){return["new String.fromCharCodes("+(b.valueToCode(a,"TEXT",Z.UNARY_POSTFIX)||"''")+".runes.toList().reversed)",Z.UNARY_PREFIX]};
|
|
222
|
+
xt.text_trim=function(a,b){var c={LEFT:".replaceFirst(new RegExp(r'^\\s+'), '')",RIGHT:".replaceFirst(new RegExp(r'\\s+$'), '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(b.valueToCode(a,"TEXT",Z.UNARY_POSTFIX)||"''")+c,Z.UNARY_POSTFIX]};var yt={};yt.variables_get=pt;yt.variables_set=qt;var zt={};zt.variables_get_dynamic=pt;zt.variables_set_dynamic=qt;var At=new st;At.addReservedWords("Html,Math");
|
|
223
|
+
var Bt=Object.assign({},{lists_create_empty:function(){return["[]",Z.ATOMIC]},lists_create_with:function(a,b){var c=Array(a.itemCount_);for(let d=0;d<a.itemCount_;d++)c[d]=b.valueToCode(a,"ADD"+d,Z.NONE)||"null";return["["+c.join(", ")+"]",Z.ATOMIC]},lists_getIndex:function(a,b){function c(){var g=b.nameDB_.getDistinctName("tmp_list",$.P.VARIABLE),h="List "+g+" = "+f+";\n";f=g;return h}var d=a.getFieldValue("MODE")||"GET",e=a.getFieldValue("WHERE")||"FROM_START",f=b.valueToCode(a,"VALUE",e==="RANDOM"||
|
|
224
224
|
e==="FROM_END"?Z.NONE:Z.UNARY_POSTFIX)||"[]";if((e!=="RANDOM"||d!=="REMOVE")&&e!=="FROM_END"||f.match(/^\w+$/))switch(e){case "FIRST":if(d==="GET")return[f+".first",Z.UNARY_POSTFIX];if(d==="GET_REMOVE")return[f+".removeAt(0)",Z.UNARY_POSTFIX];if(d==="REMOVE")return f+".removeAt(0);\n";break;case "LAST":if(d==="GET")return[f+".last",Z.UNARY_POSTFIX];if(d==="GET_REMOVE")return[f+".removeLast()",Z.UNARY_POSTFIX];if(d==="REMOVE")return f+".removeLast();\n";break;case "FROM_START":a=b.getAdjusted(a,"AT");
|
|
225
225
|
if(d==="GET")return[f+"["+a+"]",Z.UNARY_POSTFIX];if(d==="GET_REMOVE")return[f+".removeAt("+a+")",Z.UNARY_POSTFIX];if(d==="REMOVE")return f+".removeAt("+a+");\n";break;case "FROM_END":a=b.getAdjusted(a,"AT",1,!1,Z.ADDITIVE);if(d==="GET")return[f+"["+f+".length - "+a+"]",Z.UNARY_POSTFIX];if(d==="GET_REMOVE"||d==="REMOVE"){a=f+".removeAt("+f+".length - "+a+")";if(d==="GET_REMOVE")return[a,Z.UNARY_POSTFIX];if(d==="REMOVE")return a+";\n"}break;case "RANDOM":b.definitions_.import_dart_math="import 'dart:math' as Math;";
|
|
226
226
|
if(d==="REMOVE")return d=b.nameDB_.getDistinctName("tmp_x",$.P.VARIABLE),"int "+d+" = new Math.Random().nextInt("+f+".length);\n"+(f+".removeAt("+d+");\n");if(d==="GET")return[b.provideFunction_("lists_get_random_item",`
|
|
@@ -280,7 +280,7 @@ List ${b.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
|
|
280
280
|
list.sort(compare);
|
|
281
281
|
return list;
|
|
282
282
|
}
|
|
283
|
-
`)+"("+c+', "'+a+'", '+d+")",Z.UNARY_POSTFIX]},lists_split:function(a,b){var c=b.valueToCode(a,"INPUT",Z.UNARY_POSTFIX);b=b.valueToCode(a,"DELIM",Z.NONE)||"''";a=a.getFieldValue("MODE");if(a==="SPLIT")c||(c="''"),a="split";else if(a==="JOIN")c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+b+")",Z.UNARY_POSTFIX]}},
|
|
283
|
+
`)+"("+c+', "'+a+'", '+d+")",Z.UNARY_POSTFIX]},lists_split:function(a,b){var c=b.valueToCode(a,"INPUT",Z.UNARY_POSTFIX);b=b.valueToCode(a,"DELIM",Z.NONE)||"''";a=a.getFieldValue("MODE");if(a==="SPLIT")c||(c="''"),a="split";else if(a==="JOIN")c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+b+")",Z.UNARY_POSTFIX]}},tt,ut,vt,wt,xt,yt,zt);for(let a in Bt)At.forBlock[a]=Bt[a];var Ct={};Ct.DartGenerator=st;Ct.Order=Z;Ct.dartGenerator=At;$.__chunk_dart=Ct;
|
|
284
284
|
$.__chunk_dart.__namespace__=$;
|
|
285
285
|
return $.__chunk_dart;
|
|
286
286
|
}));
|