blockly 11.0.0-beta.2 → 11.0.0-beta.4

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.
Files changed (107) hide show
  1. package/blockly.min.js +365 -399
  2. package/blockly_compressed.js +333 -330
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks_compressed.js +18 -20
  5. package/blocks_compressed.js.map +1 -1
  6. package/core/block.d.ts +2 -2
  7. package/core/block_dragger.d.ts +66 -4
  8. package/core/blockly.d.ts +6 -6
  9. package/core/comments/comment_view.d.ts +200 -0
  10. package/core/comments/workspace_comment.d.ts +94 -0
  11. package/core/comments.d.ts +8 -0
  12. package/core/events/events_click.d.ts +1 -1
  13. package/core/field_dropdown.d.ts +1 -0
  14. package/core/field_image.d.ts +1 -1
  15. package/core/generator.d.ts +1 -1
  16. package/core/grid.d.ts +29 -8
  17. package/core/icons/comment_icon.d.ts +1 -1
  18. package/core/icons/icon_types.d.ts +2 -2
  19. package/core/insertion_marker_manager.d.ts +2 -0
  20. package/core/insertion_marker_previewer.d.ts +56 -0
  21. package/core/interfaces/i_comment_icon.d.ts +17 -0
  22. package/core/interfaces/i_connection_previewer.d.ts +39 -0
  23. package/core/registry.d.ts +4 -2
  24. package/core/render_management.d.ts +4 -1
  25. package/core/rendered_connection.d.ts +3 -1
  26. package/core/renderers/common/constants.d.ts +6 -2
  27. package/core/renderers/common/drawer.d.ts +18 -0
  28. package/core/renderers/common/i_path_object.d.ts +6 -15
  29. package/core/renderers/common/info.d.ts +5 -2
  30. package/core/renderers/common/path_object.d.ts +13 -0
  31. package/core/renderers/common/renderer.d.ts +3 -0
  32. package/core/renderers/measurables/connection.d.ts +1 -0
  33. package/core/renderers/zelos/drawer.d.ts +4 -0
  34. package/core/renderers/zelos/renderer.d.ts +4 -2
  35. package/core/serialization/procedures.d.ts +8 -0
  36. package/core/utils/keycodes.d.ts +32 -32
  37. package/core/utils/size.d.ts +10 -0
  38. package/core/workspace_audio.d.ts +10 -0
  39. package/core/workspace_svg.d.ts +0 -1
  40. package/core-node.js +31 -0
  41. package/dart_compressed.js +18 -68
  42. package/dart_compressed.js.map +1 -1
  43. package/generators/dart/dart_generator.d.ts +17 -17
  44. package/generators/dart/text.d.ts +0 -1
  45. package/generators/javascript/javascript_generator.d.ts +34 -35
  46. package/generators/javascript/text.d.ts +0 -1
  47. package/generators/lua/lua_generator.d.ts +10 -10
  48. package/generators/lua/text.d.ts +0 -1
  49. package/generators/php/php_generator.d.ts +36 -36
  50. package/generators/php/text.d.ts +0 -1
  51. package/generators/python/python_generator.d.ts +20 -21
  52. package/generators/python/text.d.ts +0 -1
  53. package/index.js +19 -7
  54. package/javascript_compressed.js +14 -49
  55. package/javascript_compressed.js.map +1 -1
  56. package/lua_compressed.js +18 -40
  57. package/lua_compressed.js.map +1 -1
  58. package/media/arrow-dropdown.svg +1 -0
  59. package/media/resize-handle.svg +3 -0
  60. package/msg/ar.js +1 -1
  61. package/msg/be-tarask.js +8 -8
  62. package/msg/bn.js +5 -5
  63. package/msg/ce.d.ts +8 -0
  64. package/msg/da.js +4 -4
  65. package/msg/dtp.d.ts +8 -0
  66. package/msg/el.js +1 -1
  67. package/msg/he.js +1 -1
  68. package/msg/hsb.d.ts +8 -0
  69. package/msg/id.js +6 -6
  70. package/msg/inh.js +3 -3
  71. package/msg/ja.js +1 -1
  72. package/msg/nl.js +3 -3
  73. package/msg/pt.js +1 -1
  74. package/msg/ta.js +2 -2
  75. package/msg/tdd.d.ts +8 -0
  76. package/msg/tl.js +2 -2
  77. package/msg/ur.js +2 -2
  78. package/msg/zh-hant.js +14 -14
  79. package/package.json +44 -13
  80. package/php_compressed.js +10 -43
  81. package/php_compressed.js.map +1 -1
  82. package/python_compressed.js +18 -37
  83. package/python_compressed.js.map +1 -1
  84. package/blockly.js +0 -22
  85. package/blocks.js +0 -22
  86. package/browser.js +0 -30
  87. package/core/field_angle.d.ts +0 -208
  88. package/core/field_colour.d.ts +0 -243
  89. package/core/field_multilineinput.d.ts +0 -182
  90. package/core-browser.js +0 -26
  91. package/core.js +0 -26
  92. package/dart.js +0 -22
  93. package/generators/dart/colour.d.ts +0 -16
  94. package/generators/javascript/colour.d.ts +0 -16
  95. package/generators/lua/colour.d.ts +0 -16
  96. package/generators/php/colour.d.ts +0 -16
  97. package/generators/python/colour.d.ts +0 -16
  98. package/javascript.js +0 -23
  99. package/lua.js +0 -22
  100. package/msg/constants.d.ts +0 -14
  101. package/msg/msg.d.ts +0 -440
  102. package/msg/qqq.d.ts +0 -14
  103. package/msg/synonyms.d.ts +0 -14
  104. package/msg/yue.js +0 -441
  105. package/node.js +0 -21
  106. package/php.js +0 -22
  107. package/python.js +0 -23
@@ -1,182 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { Field } from './field.js';
7
- import { FieldTextInput, FieldTextInputConfig, FieldTextInputValidator } from './field_textinput.js';
8
- /**
9
- * Class for an editable text area field.
10
- */
11
- export declare class FieldMultilineInput extends FieldTextInput {
12
- /**
13
- * The SVG group element that will contain a text element for each text row
14
- * when initialized.
15
- */
16
- textGroup: SVGGElement | null;
17
- /**
18
- * Defines the maximum number of lines of field.
19
- * If exceeded, scrolling functionality is enabled.
20
- */
21
- protected maxLines_: number;
22
- /** Whether Y overflow is currently occurring. */
23
- protected isOverflowedY_: boolean;
24
- /**
25
- * @param value The initial content of the field. Should cast to a string.
26
- * Defaults to an empty string if null or undefined. Also accepts
27
- * Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
28
- * that want to handle configuration and setting the field value after
29
- * their own constructors have run).
30
- * @param validator An optional function that is called to validate any
31
- * constraints on what the user entered. Takes the new text as an
32
- * argument and returns either the accepted text, a replacement text, or
33
- * null to abort the change.
34
- * @param config A map of options used to configure the field.
35
- * See the [field creation documentation]{@link
36
- * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/multiline-text-input#creation}
37
- * for a list of properties this parameter supports.
38
- */
39
- constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldMultilineInputValidator, config?: FieldMultilineInputConfig);
40
- /**
41
- * Configure the field based on the given map of options.
42
- *
43
- * @param config A map of options to configure the field based on.
44
- */
45
- protected configure_(config: FieldMultilineInputConfig): void;
46
- /**
47
- * Serializes this field's value to XML. Should only be called by Blockly.Xml.
48
- *
49
- * @param fieldElement The element to populate with info about the field's
50
- * state.
51
- * @returns The element containing info about the field's state.
52
- * @internal
53
- */
54
- toXml(fieldElement: Element): Element;
55
- /**
56
- * Sets the field's value based on the given XML element. Should only be
57
- * called by Blockly.Xml.
58
- *
59
- * @param fieldElement The element containing info about the field's state.
60
- * @internal
61
- */
62
- fromXml(fieldElement: Element): void;
63
- /**
64
- * Saves this field's value.
65
- * This function only exists for subclasses of FieldMultilineInput which
66
- * predate the load/saveState API and only define to/fromXml.
67
- *
68
- * @returns The state of this field.
69
- * @internal
70
- */
71
- saveState(): any;
72
- /**
73
- * Sets the field's value based on the given state.
74
- * This function only exists for subclasses of FieldMultilineInput which
75
- * predate the load/saveState API and only define to/fromXml.
76
- *
77
- * @param state The state of the variable to assign to this variable field.
78
- * @internal
79
- */
80
- loadState(state: any): void;
81
- /**
82
- * Create the block UI for this field.
83
- */
84
- initView(): void;
85
- /**
86
- * Get the text from this field as displayed on screen. May differ from
87
- * getText due to ellipsis, and other formatting.
88
- *
89
- * @returns Currently displayed text.
90
- */
91
- protected getDisplayText_(): string;
92
- /**
93
- * Called by setValue if the text input is valid. Updates the value of the
94
- * field, and updates the text of the field if it is not currently being
95
- * edited (i.e. handled by the htmlInput_). Is being redefined here to update
96
- * overflow state of the field.
97
- *
98
- * @param newValue The value to be saved. The default validator guarantees
99
- * that this is a string.
100
- */
101
- protected doValueUpdate_(newValue: string): void;
102
- /** Updates the text of the textElement. */
103
- protected render_(): void;
104
- /** Updates the size of the field based on the text. */
105
- protected updateSize_(): void;
106
- /**
107
- * Show the inline free-text editor on top of the text.
108
- * Overrides the default behaviour to force rerender in order to
109
- * correct block size, based on editor text.
110
- *
111
- * @param e Optional mouse event that triggered the field to open, or
112
- * undefined if triggered programmatically.
113
- * @param quietInput True if editor should be created without focus.
114
- * Defaults to false.
115
- */
116
- showEditor_(e?: Event, quietInput?: boolean): void;
117
- /**
118
- * Create the text input editor widget.
119
- *
120
- * @returns The newly created text input editor.
121
- */
122
- protected widgetCreate_(): HTMLTextAreaElement;
123
- /**
124
- * Sets the maxLines config for this field.
125
- *
126
- * @param maxLines Defines the maximum number of lines allowed, before
127
- * scrolling functionality is enabled.
128
- */
129
- setMaxLines(maxLines: number): void;
130
- /**
131
- * Returns the maxLines config of this field.
132
- *
133
- * @returns The maxLines config value.
134
- */
135
- getMaxLines(): number;
136
- /**
137
- * Handle key down to the editor. Override the text input definition of this
138
- * so as to not close the editor when enter is typed in.
139
- *
140
- * @param e Keyboard event.
141
- */
142
- protected onHtmlInputKeyDown_(e: KeyboardEvent): void;
143
- /**
144
- * Construct a FieldMultilineInput from a JSON arg object,
145
- * dereferencing any string table references.
146
- *
147
- * @param options A JSON object with options (text, and spellcheck).
148
- * @returns The new field instance.
149
- * @nocollapse
150
- * @internal
151
- */
152
- static fromJson(options: FieldMultilineInputFromJsonConfig): FieldMultilineInput;
153
- }
154
- /**
155
- * Config options for the multiline input field.
156
- */
157
- export interface FieldMultilineInputConfig extends FieldTextInputConfig {
158
- maxLines?: number;
159
- }
160
- /**
161
- * fromJson config options for the multiline input field.
162
- */
163
- export interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputConfig {
164
- text?: string;
165
- }
166
- /**
167
- * A function that is called to validate changes to the field's value before
168
- * they are set.
169
- *
170
- * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
171
- * @param newValue The value to be validated.
172
- * @returns One of three instructions for setting the new value: `T`, `null`,
173
- * or `undefined`.
174
- *
175
- * - `T` to set this function's returned value instead of `newValue`.
176
- *
177
- * - `null` to invoke `doValueInvalid_` and not set a value.
178
- *
179
- * - `undefined` to set `newValue` as is.
180
- */
181
- export type FieldMultilineInputValidator = FieldTextInputValidator;
182
- //# sourceMappingURL=field_multilineinput.d.ts.map
package/core-browser.js DELETED
@@ -1,26 +0,0 @@
1
- /* eslint-disable */
2
- ;(function(root, factory) {
3
- if (typeof define === 'function' && define.amd) { // AMD
4
- define(['./blockly'], factory);
5
- } else if (typeof exports === 'object') { // Node.js
6
- module.exports = factory(require('./blockly'));
7
- } else { // Browser
8
- root.Blockly = factory(root.Blockly);
9
- }
10
- }(this, function(Blockly) {
11
- /**
12
- * @license
13
- * Copyright 2019 Google LLC
14
- * SPDX-License-Identifier: Apache-2.0
15
- */
16
-
17
- /**
18
- * @fileoverview Blockly core module for the browser. It includes blockly.js
19
- * and adds a helper method for setting the locale.
20
- */
21
-
22
- /* eslint-disable */
23
- 'use strict';
24
-
25
- return Blockly;
26
- }));
package/core.js DELETED
@@ -1,26 +0,0 @@
1
- /* eslint-disable */
2
- (function (Blockly){
3
- /**
4
- * @license
5
- * Copyright 2019 Google LLC
6
- * SPDX-License-Identifier: Apache-2.0
7
- */
8
-
9
- /**
10
- * @fileoverview Blockly core module for Node. It includes blockly-node.js
11
- * and adds a helper method for setting the locale.
12
- */
13
-
14
- /* eslint-disable */
15
- 'use strict';
16
-
17
- // Override textToDomDocument and provide Node.js alternatives to DOMParser and
18
- // XMLSerializer.
19
- if (typeof globalThis.document !== 'object') {
20
- const {JSDOM} = require('jsdom');
21
- const {window} = new JSDOM(`<!DOCTYPE html>`);
22
- Blockly.utils.xml.injectDependencies(window);
23
- }
24
-
25
- module.exports = Blockly;
26
- })(require('./blockly'));
package/dart.js DELETED
@@ -1,22 +0,0 @@
1
- /* eslint-disable */
2
- ;(function(root, factory) {
3
- if (typeof define === 'function' && define.amd) { // AMD
4
- define(['./core', './dart_compressed.js'], factory);
5
- } else if (typeof exports === 'object') { // Node.js
6
- module.exports = factory(require('./core'), require('./dart_compressed.js'));
7
- } else { // Browser
8
- root.BlocklyDart = factory(root.Blockly, root.BlocklyDart);
9
- }
10
- }(this, function(Blockly, BlocklyDart) {
11
- /**
12
- * @license
13
- * Copyright 2020 Google LLC
14
- * SPDX-License-Identifier: Apache-2.0
15
- */
16
-
17
- /**
18
- * @fileoverview Dart generator module; just a wrapper for dart_compressed.js.
19
- */
20
-
21
- return BlocklyDart;
22
- }));
@@ -1,16 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,16 +0,0 @@
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
package/javascript.js DELETED
@@ -1,23 +0,0 @@
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
- }));
package/lua.js DELETED
@@ -1,22 +0,0 @@
1
- /* eslint-disable */
2
- ;(function(root, factory) {
3
- if (typeof define === 'function' && define.amd) { // AMD
4
- define(['./core', './lua_compressed.js'], factory);
5
- } else if (typeof exports === 'object') { // Node.js
6
- module.exports = factory(require('./core'), require('./lua_compressed.js'));
7
- } else { // Browser
8
- root.BlocklyLua = factory(root.Blockly, root.BlocklyLua);
9
- }
10
- }(this, function(Blockly, BlocklyLua) {
11
- /**
12
- * @license
13
- * Copyright 2020 Google LLC
14
- * SPDX-License-Identifier: Apache-2.0
15
- */
16
-
17
- /**
18
- * @fileoverview Lua generator module; just a wrapper for lua_compressed.js.
19
- */
20
-
21
- return BlocklyLua;
22
- }));
@@ -1,14 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- /**
8
- * Type definitions for the Blockly constants locale.
9
- */
10
-
11
- /// <reference path="msg.d.ts" />
12
-
13
- import BlocklyMsg = Blockly.Msg;
14
- export = BlocklyMsg;