scratch-blocks 2.0.2 → 2.0.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.
- package/.nvmrc +1 -1
- package/commitlint.config.js +2 -2
- package/dist/main.mjs +1 -2
- package/dist/types/msg/scratch_msgs.d.ts.map +1 -1
- package/dist/types/src/block_reporting.d.ts.map +1 -1
- package/dist/types/src/blocks/colour.d.ts +0 -19
- package/dist/types/src/blocks/colour.d.ts.map +1 -1
- package/dist/types/src/blocks/control.d.ts +0 -19
- package/dist/types/src/blocks/control.d.ts.map +1 -1
- package/dist/types/src/blocks/data.d.ts +0 -19
- package/dist/types/src/blocks/data.d.ts.map +1 -1
- package/dist/types/src/blocks/event.d.ts +0 -19
- package/dist/types/src/blocks/event.d.ts.map +1 -1
- package/dist/types/src/blocks/looks.d.ts +0 -19
- package/dist/types/src/blocks/looks.d.ts.map +1 -1
- package/dist/types/src/blocks/math.d.ts +0 -19
- package/dist/types/src/blocks/math.d.ts.map +1 -1
- package/dist/types/src/blocks/matrix.d.ts +0 -19
- package/dist/types/src/blocks/matrix.d.ts.map +1 -1
- package/dist/types/src/blocks/motion.d.ts +0 -19
- package/dist/types/src/blocks/motion.d.ts.map +1 -1
- package/dist/types/src/blocks/note.d.ts +0 -19
- package/dist/types/src/blocks/note.d.ts.map +1 -1
- package/dist/types/src/blocks/operators.d.ts +0 -19
- package/dist/types/src/blocks/operators.d.ts.map +1 -1
- package/dist/types/src/blocks/procedures.d.ts +7 -10
- package/dist/types/src/blocks/procedures.d.ts.map +1 -1
- package/dist/types/src/blocks/sensing.d.ts +0 -19
- package/dist/types/src/blocks/sensing.d.ts.map +1 -1
- package/dist/types/src/blocks/sound.d.ts +0 -19
- package/dist/types/src/blocks/sound.d.ts.map +1 -1
- package/dist/types/src/blocks/text.d.ts +0 -19
- package/dist/types/src/blocks/text.d.ts.map +1 -1
- package/dist/types/src/blocks/vertical_extensions.d.ts +0 -19
- package/dist/types/src/blocks/vertical_extensions.d.ts.map +1 -1
- package/dist/types/src/checkable_continuous_flyout.d.ts +2 -7
- package/dist/types/src/checkable_continuous_flyout.d.ts.map +1 -1
- package/dist/types/src/checkbox_bubble.d.ts +13 -12
- package/dist/types/src/checkbox_bubble.d.ts.map +1 -1
- package/dist/types/src/colours.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +0 -7
- package/dist/types/src/constants.d.ts.map +1 -1
- package/dist/types/src/context_menu_items.d.ts +0 -5
- package/dist/types/src/context_menu_items.d.ts.map +1 -1
- package/dist/types/src/data_category.d.ts +2 -4
- package/dist/types/src/data_category.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_base.d.ts +2 -3
- package/dist/types/src/events/events_block_comment_base.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_change.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_change.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_collapse.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_collapse.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_create.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_create.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_delete.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_delete.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_move.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_move.d.ts.map +1 -1
- package/dist/types/src/events/events_block_comment_resize.d.ts +0 -5
- package/dist/types/src/events/events_block_comment_resize.d.ts.map +1 -1
- package/dist/types/src/events/events_block_drag_end.d.ts +1 -2
- package/dist/types/src/events/events_block_drag_end.d.ts.map +1 -1
- package/dist/types/src/events/events_block_drag_outside.d.ts +1 -2
- package/dist/types/src/events/events_block_drag_outside.d.ts.map +1 -1
- package/dist/types/src/events/events_scratch_variable_create.d.ts +0 -5
- package/dist/types/src/events/events_scratch_variable_create.d.ts.map +1 -1
- package/dist/types/src/fields/field_colour_slider.d.ts +7 -9
- package/dist/types/src/fields/field_colour_slider.d.ts.map +1 -1
- package/dist/types/src/fields/field_matrix.d.ts +0 -19
- package/dist/types/src/fields/field_matrix.d.ts.map +1 -1
- package/dist/types/src/fields/field_note.d.ts +8 -23
- package/dist/types/src/fields/field_note.d.ts.map +1 -1
- package/dist/types/src/fields/field_textinput_removable.d.ts +2 -4
- package/dist/types/src/fields/field_textinput_removable.d.ts.map +1 -1
- package/dist/types/src/fields/field_variable_getter.d.ts +0 -19
- package/dist/types/src/fields/field_variable_getter.d.ts.map +1 -1
- package/dist/types/src/fields/field_vertical_separator.d.ts +0 -19
- package/dist/types/src/fields/field_vertical_separator.d.ts.map +1 -1
- package/dist/types/src/fields/scratch_field_angle.d.ts +0 -19
- package/dist/types/src/fields/scratch_field_angle.d.ts.map +1 -1
- package/dist/types/src/fields/scratch_field_dropdown.d.ts +0 -5
- package/dist/types/src/fields/scratch_field_dropdown.d.ts.map +1 -1
- package/dist/types/src/fields/scratch_field_number.d.ts +0 -19
- package/dist/types/src/fields/scratch_field_number.d.ts.map +1 -1
- package/dist/types/src/fields/scratch_field_variable.d.ts +4 -7
- package/dist/types/src/fields/scratch_field_variable.d.ts.map +1 -1
- package/dist/types/src/flyout_checkbox_icon.d.ts +2 -3
- package/dist/types/src/flyout_checkbox_icon.d.ts.map +1 -1
- package/dist/types/src/glows.d.ts +1 -3
- package/dist/types/src/glows.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +50 -55
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/procedures.d.ts +6 -8
- package/dist/types/src/procedures.d.ts.map +1 -1
- package/dist/types/src/recyclable_block_flyout_inflater.d.ts +3 -5
- package/dist/types/src/recyclable_block_flyout_inflater.d.ts.map +1 -1
- package/dist/types/src/renderer/bowler_hat.d.ts +2 -3
- package/dist/types/src/renderer/bowler_hat.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/cat_face.d.ts +6 -5
- package/dist/types/src/renderer/cat/cat_face.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/constants.d.ts +2 -2
- package/dist/types/src/renderer/cat/constants.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/drawer.d.ts +3 -4
- package/dist/types/src/renderer/cat/drawer.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/path_object.d.ts +2 -3
- package/dist/types/src/renderer/cat/path_object.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/render_info.d.ts +3 -4
- package/dist/types/src/renderer/cat/render_info.d.ts.map +1 -1
- package/dist/types/src/renderer/cat/renderer.d.ts +6 -7
- package/dist/types/src/renderer/cat/renderer.d.ts.map +1 -1
- package/dist/types/src/renderer/constants.d.ts +4 -4
- package/dist/types/src/renderer/constants.d.ts.map +1 -1
- package/dist/types/src/renderer/drawer.d.ts +5 -4
- package/dist/types/src/renderer/drawer.d.ts.map +1 -1
- package/dist/types/src/renderer/path_object.d.ts +1 -3
- package/dist/types/src/renderer/path_object.d.ts.map +1 -1
- package/dist/types/src/renderer/render_info.d.ts +3 -4
- package/dist/types/src/renderer/render_info.d.ts.map +1 -1
- package/dist/types/src/renderer/renderer.d.ts +8 -15
- package/dist/types/src/renderer/renderer.d.ts.map +1 -1
- package/dist/types/src/scratch_block_paster.d.ts +0 -5
- package/dist/types/src/scratch_block_paster.d.ts.map +1 -1
- package/dist/types/src/scratch_blocks_utils.d.ts +0 -20
- package/dist/types/src/scratch_blocks_utils.d.ts.map +1 -1
- package/dist/types/src/scratch_comment_bubble.d.ts +1 -4
- package/dist/types/src/scratch_comment_bubble.d.ts.map +1 -1
- package/dist/types/src/scratch_comment_icon.d.ts +2 -3
- package/dist/types/src/scratch_comment_icon.d.ts.map +1 -1
- package/dist/types/src/scratch_connection_checker.d.ts +0 -5
- package/dist/types/src/scratch_connection_checker.d.ts.map +1 -1
- package/dist/types/src/scratch_continuous_category.d.ts +5 -5
- package/dist/types/src/scratch_continuous_category.d.ts.map +1 -1
- package/dist/types/src/scratch_continuous_toolbox.d.ts +3 -6
- package/dist/types/src/scratch_continuous_toolbox.d.ts.map +1 -1
- package/dist/types/src/scratch_dragger.d.ts +3 -12
- package/dist/types/src/scratch_dragger.d.ts.map +1 -1
- package/dist/types/src/scratch_insertion_marker_previewer.d.ts +0 -5
- package/dist/types/src/scratch_insertion_marker_previewer.d.ts.map +1 -1
- package/dist/types/src/scratch_variable_map.d.ts +0 -5
- package/dist/types/src/scratch_variable_map.d.ts.map +1 -1
- package/dist/types/src/scratch_variable_model.d.ts +1 -2
- package/dist/types/src/scratch_variable_model.d.ts.map +1 -1
- package/dist/types/src/scratch_zoom_controls.d.ts +4 -6
- package/dist/types/src/scratch_zoom_controls.d.ts.map +1 -1
- package/dist/types/src/shadows.d.ts +2 -2
- package/dist/types/src/shadows.d.ts.map +1 -1
- package/dist/types/src/status_indicator_label.d.ts +4 -6
- package/dist/types/src/status_indicator_label.d.ts.map +1 -1
- package/dist/types/src/status_indicator_label_flyout_inflater.d.ts +1 -6
- package/dist/types/src/status_indicator_label_flyout_inflater.d.ts.map +1 -1
- package/dist/types/src/variables.d.ts +4 -8
- package/dist/types/src/variables.d.ts.map +1 -1
- package/dist/types/src/xml.d.ts +2 -3
- package/dist/types/src/xml.d.ts.map +1 -1
- package/dist/types/tests/jsunit/block_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/connection_db_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/connection_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/event_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/extensions_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/field_number_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/field_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/field_variable_getter_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/field_variable_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/gesture_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/input_test.d.ts +1 -0
- package/dist/types/tests/jsunit/input_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/json_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/names_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/procedure_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/scratch_block_comment_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/svg_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/test_utilities.d.ts.map +1 -1
- package/dist/types/tests/jsunit/utils_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/variable_map_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/variable_model_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/widget_div_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/workspace_comment_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/workspace_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/workspace_undo_redo_test.d.ts.map +1 -1
- package/dist/types/tests/jsunit/xml_test.d.ts.map +1 -1
- package/dist/types/tests/workspace_svg/workspace_svg_test.d.ts.map +1 -1
- package/eslint.config.mjs +69 -0
- package/i18n/create_scratch_msgs.js +44 -45
- package/i18n/js_to_json.js +40 -32
- package/i18n/json_to_js.js +37 -37
- package/i18n/sync_tx_translations.js +64 -65
- package/i18n/test_scratch_msgs.js +66 -63
- package/msg/js/en.js +289 -287
- package/msg/json/en.json +284 -284
- package/msg/messages.js +289 -287
- package/msg/scratch_msgs.js +22959 -22970
- package/package.json +13 -10
- package/prettier.config.mjs +3 -0
- package/release.config.js +7 -7
- package/renovate.json5 +7 -9
- package/src/block_reporting.ts +15 -18
- package/src/blocks/colour.ts +12 -15
- package/src/blocks/control.ts +167 -177
- package/src/blocks/data.ts +225 -292
- package/src/blocks/event.ts +121 -123
- package/src/blocks/looks.ts +165 -167
- package/src/blocks/math.ts +44 -46
- package/src/blocks/matrix.ts +11 -13
- package/src/blocks/motion.ts +151 -153
- package/src/blocks/note.ts +11 -13
- package/src/blocks/operators.ts +158 -160
- package/src/blocks/procedures.ts +488 -536
- package/src/blocks/sensing.ts +163 -165
- package/src/blocks/sound.ts +58 -60
- package/src/blocks/text.ts +10 -12
- package/src/blocks/vertical_extensions.ts +86 -102
- package/src/checkable_continuous_flyout.ts +25 -42
- package/src/checkbox_bubble.ts +83 -100
- package/src/colours.ts +35 -37
- package/src/constants.ts +22 -29
- package/src/context_menu_items.ts +56 -81
- package/src/css.ts +3 -4
- package/src/data_category.ts +136 -250
- package/src/events/events_block_comment_base.ts +21 -31
- package/src/events/events_block_comment_change.ts +21 -42
- package/src/events/events_block_comment_collapse.ts +22 -43
- package/src/events/events_block_comment_create.ts +29 -46
- package/src/events/events_block_comment_delete.ts +10 -19
- package/src/events/events_block_comment_move.ts +27 -52
- package/src/events/events_block_comment_resize.ts +28 -55
- package/src/events/events_block_drag_end.ts +16 -26
- package/src/events/events_block_drag_outside.ts +12 -22
- package/src/events/events_scratch_variable_create.ts +33 -56
- package/src/fields/field_colour_slider.ts +173 -228
- package/src/fields/field_matrix.ts +200 -269
- package/src/fields/field_note.ts +272 -377
- package/src/fields/field_textinput_removable.ts +25 -40
- package/src/fields/field_variable_getter.ts +26 -31
- package/src/fields/field_vertical_separator.ts +19 -24
- package/src/fields/scratch_field_angle.ts +150 -186
- package/src/fields/scratch_field_dropdown.ts +15 -19
- package/src/fields/scratch_field_number.ts +123 -180
- package/src/fields/scratch_field_variable.ts +52 -73
- package/src/flyout_checkbox_icon.ts +18 -28
- package/src/glows.ts +51 -58
- package/src/index.ts +119 -133
- package/src/procedures.ts +144 -211
- package/src/recyclable_block_flyout_inflater.ts +14 -25
- package/src/renderer/bowler_hat.ts +6 -8
- package/src/renderer/cat/cat_face.ts +98 -99
- package/src/renderer/cat/constants.ts +67 -87
- package/src/renderer/cat/drawer.ts +21 -27
- package/src/renderer/cat/path_object.ts +3 -5
- package/src/renderer/cat/render_info.ts +5 -8
- package/src/renderer/cat/renderer.ts +11 -15
- package/src/renderer/constants.ts +34 -49
- package/src/renderer/drawer.ts +35 -51
- package/src/renderer/path_object.ts +13 -15
- package/src/renderer/render_info.ts +36 -56
- package/src/renderer/renderer.ts +16 -29
- package/src/scratch_block_paster.ts +12 -20
- package/src/scratch_blocks_utils.ts +4 -7
- package/src/scratch_comment_bubble.ts +70 -101
- package/src/scratch_comment_icon.ts +74 -123
- package/src/scratch_connection_checker.ts +22 -17
- package/src/scratch_continuous_category.ts +24 -28
- package/src/scratch_continuous_toolbox.ts +20 -27
- package/src/scratch_dragger.ts +54 -86
- package/src/scratch_insertion_marker_previewer.ts +6 -11
- package/src/scratch_variable_map.ts +5 -12
- package/src/scratch_variable_model.ts +4 -11
- package/src/scratch_zoom_controls.ts +101 -156
- package/src/shadows.ts +32 -37
- package/src/status_indicator_label.ts +54 -67
- package/src/status_indicator_label_flyout_inflater.ts +11 -21
- package/src/variables.ts +89 -138
- package/src/xml.ts +21 -35
- package/tsconfig.json +2 -6
- package/types/continuous-toolbox.d.ts +1 -1
- package/dist/main.mjs.LICENSE.txt +0 -163
package/src/variables.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license
|
|
3
2
|
* Visual Blocks Editor
|
|
4
3
|
*
|
|
5
4
|
* Copyright 2012 Google Inc.
|
|
@@ -17,26 +16,22 @@
|
|
|
17
16
|
* See the License for the specific language governing permissions and
|
|
18
17
|
* limitations under the License.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
19
|
/**
|
|
22
|
-
* @
|
|
20
|
+
* @file Utility functions for handling variables.
|
|
23
21
|
* @author fraser@google.com (Neil Fraser)
|
|
24
22
|
*/
|
|
25
|
-
import * as Blockly from
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from
|
|
30
|
-
import { ScratchVariableModel } from "./scratch_variable_model";
|
|
31
|
-
import { ScratchContinuousToolbox } from "./scratch_continuous_toolbox";
|
|
32
|
-
import { CheckableContinuousFlyout } from "./checkable_continuous_flyout";
|
|
23
|
+
import * as Blockly from 'blockly/core'
|
|
24
|
+
import { CheckableContinuousFlyout } from './checkable_continuous_flyout'
|
|
25
|
+
import { LIST_VARIABLE_TYPE, BROADCAST_MESSAGE_VARIABLE_TYPE } from './constants'
|
|
26
|
+
import { ScratchContinuousToolbox } from './scratch_continuous_toolbox'
|
|
27
|
+
import { ScratchVariableModel } from './scratch_variable_model'
|
|
33
28
|
|
|
34
29
|
/**
|
|
35
30
|
* Constant prefix to differentiate cloud variable names from other types of
|
|
36
31
|
* variables.
|
|
37
32
|
* This is the \u2601 cloud unicode character followed by a space.
|
|
38
33
|
*/
|
|
39
|
-
const CLOUD_PREFIX =
|
|
34
|
+
const CLOUD_PREFIX = '☁ '
|
|
40
35
|
|
|
41
36
|
type PromptType = (
|
|
42
37
|
message: string,
|
|
@@ -44,26 +39,24 @@ type PromptType = (
|
|
|
44
39
|
callback: (
|
|
45
40
|
variableName: string,
|
|
46
41
|
additionalVars: string[],
|
|
47
|
-
variableOptions?: { scope?: string; isCloud?: boolean }
|
|
42
|
+
variableOptions?: { scope?: string; isCloud?: boolean },
|
|
48
43
|
) => void,
|
|
49
44
|
title?: string,
|
|
50
|
-
varType?: string
|
|
51
|
-
) => void
|
|
45
|
+
varType?: string,
|
|
46
|
+
) => void
|
|
52
47
|
|
|
53
|
-
let prompt: PromptType | undefined = undefined
|
|
48
|
+
let prompt: PromptType | undefined = undefined
|
|
54
49
|
|
|
55
50
|
/**
|
|
56
51
|
* Sets the handler for calls to prompt().
|
|
57
|
-
*
|
|
58
52
|
* @param handler The new prompt function.
|
|
59
53
|
*/
|
|
60
54
|
export function setPromptHandler(handler: PromptType) {
|
|
61
|
-
prompt = handler
|
|
55
|
+
prompt = handler
|
|
62
56
|
}
|
|
63
57
|
|
|
64
58
|
/**
|
|
65
59
|
* Create a new variable on the given workspace.
|
|
66
|
-
*
|
|
67
60
|
* @param workspace The workspace on which to create the variable.
|
|
68
61
|
* @param opt_callback An optional callback function to act on the id of the
|
|
69
62
|
* variable that is created from the user's input, or null if the change is
|
|
@@ -74,93 +67,71 @@ export function setPromptHandler(handler: PromptType) {
|
|
|
74
67
|
export function createVariable(
|
|
75
68
|
workspace: Blockly.WorkspaceSvg,
|
|
76
69
|
opt_callback?: (id?: string) => void,
|
|
77
|
-
opt_type?: string
|
|
70
|
+
opt_type?: string,
|
|
78
71
|
) {
|
|
79
72
|
// Decide on a modal message based on the opt_type. If opt_type was not
|
|
80
73
|
// provided, default to the original message for scalar variables.
|
|
81
|
-
let newMsg, modalTitle
|
|
74
|
+
let newMsg, modalTitle
|
|
82
75
|
if (opt_type === BROADCAST_MESSAGE_VARIABLE_TYPE) {
|
|
83
|
-
newMsg = Blockly.Msg.NEW_BROADCAST_MESSAGE_TITLE
|
|
84
|
-
modalTitle = Blockly.Msg.BROADCAST_MODAL_TITLE
|
|
76
|
+
newMsg = Blockly.Msg.NEW_BROADCAST_MESSAGE_TITLE
|
|
77
|
+
modalTitle = Blockly.Msg.BROADCAST_MODAL_TITLE
|
|
85
78
|
} else if (opt_type === LIST_VARIABLE_TYPE) {
|
|
86
|
-
newMsg = Blockly.Msg.NEW_LIST_TITLE
|
|
87
|
-
modalTitle = Blockly.Msg.LIST_MODAL_TITLE
|
|
79
|
+
newMsg = Blockly.Msg.NEW_LIST_TITLE
|
|
80
|
+
modalTitle = Blockly.Msg.LIST_MODAL_TITLE
|
|
88
81
|
} else {
|
|
89
82
|
// Note: this case covers 1) scalar variables, 2) any new type of
|
|
90
83
|
// variable not explicitly checked for above, and 3) a null or undefined
|
|
91
84
|
// opt_type -- turns a falsey opt_type into ''
|
|
92
85
|
// TODO (#1251) Warn developers that they didn't provide an opt_type/
|
|
93
86
|
// provided a falsey opt_type
|
|
94
|
-
opt_type = opt_type ? opt_type :
|
|
95
|
-
newMsg = Blockly.Msg.NEW_VARIABLE_TITLE
|
|
96
|
-
modalTitle = Blockly.Msg.VARIABLE_MODAL_TITLE
|
|
87
|
+
opt_type = opt_type ? opt_type : ''
|
|
88
|
+
newMsg = Blockly.Msg.NEW_VARIABLE_TITLE
|
|
89
|
+
modalTitle = Blockly.Msg.VARIABLE_MODAL_TITLE
|
|
97
90
|
}
|
|
98
|
-
const validate = nameValidator.bind(null, opt_type)
|
|
91
|
+
const validate = nameValidator.bind(null, opt_type)
|
|
99
92
|
|
|
100
93
|
// Prompt the user to enter a name for the variable
|
|
101
94
|
prompt!(
|
|
102
95
|
newMsg,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
variableOptions = variableOptions || {};
|
|
110
|
-
const scope = variableOptions.scope;
|
|
111
|
-
const isLocal = scope === "local" || false;
|
|
112
|
-
const isCloud = variableOptions.isCloud || false;
|
|
96
|
+
'',
|
|
97
|
+
(text: string, additionalVars: string[], variableOptions?: { scope?: string; isCloud?: boolean }) => {
|
|
98
|
+
variableOptions = variableOptions || {}
|
|
99
|
+
const scope = variableOptions.scope
|
|
100
|
+
const isLocal = scope === 'local' || false
|
|
101
|
+
const isCloud = variableOptions.isCloud || false
|
|
113
102
|
// Default to [] if additionalVars is not provided
|
|
114
|
-
additionalVars = additionalVars || []
|
|
103
|
+
additionalVars = additionalVars || []
|
|
115
104
|
// Only use additionalVars for global variable creation.
|
|
116
|
-
const additionalVarNames = isLocal ? [] : additionalVars
|
|
105
|
+
const additionalVarNames = isLocal ? [] : additionalVars
|
|
117
106
|
|
|
118
|
-
const validatedText = validate(
|
|
119
|
-
text,
|
|
120
|
-
workspace,
|
|
121
|
-
additionalVarNames,
|
|
122
|
-
isCloud,
|
|
123
|
-
opt_callback
|
|
124
|
-
);
|
|
107
|
+
const validatedText = validate(text, workspace, additionalVarNames, isCloud, opt_callback)
|
|
125
108
|
if (validatedText) {
|
|
126
|
-
const variable = new ScratchVariableModel(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
opt_type,
|
|
130
|
-
undefined,
|
|
131
|
-
isLocal,
|
|
132
|
-
isCloud
|
|
133
|
-
);
|
|
134
|
-
workspace.getVariableMap().addVariable(variable);
|
|
135
|
-
Blockly.Events.fire(
|
|
136
|
-
new (Blockly.Events.get(Blockly.Events.VAR_CREATE))(variable)
|
|
137
|
-
);
|
|
109
|
+
const variable = new ScratchVariableModel(workspace, validatedText, opt_type, undefined, isLocal, isCloud)
|
|
110
|
+
workspace.getVariableMap().addVariable(variable)
|
|
111
|
+
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_CREATE))(variable))
|
|
138
112
|
|
|
139
|
-
const toolbox = workspace.getToolbox()
|
|
140
|
-
const flyout = toolbox?.getFlyout()
|
|
141
|
-
const variableBlockId = variable.getId()
|
|
142
|
-
if (
|
|
143
|
-
toolbox instanceof ScratchContinuousToolbox &&
|
|
144
|
-
flyout instanceof CheckableContinuousFlyout
|
|
145
|
-
) {
|
|
113
|
+
const toolbox = workspace.getToolbox()
|
|
114
|
+
const flyout = toolbox?.getFlyout()
|
|
115
|
+
const variableBlockId = variable.getId()
|
|
116
|
+
if (toolbox instanceof ScratchContinuousToolbox && flyout instanceof CheckableContinuousFlyout) {
|
|
146
117
|
toolbox.runAfterRerender(() => {
|
|
147
|
-
flyout.setCheckboxState(variableBlockId, true)
|
|
148
|
-
})
|
|
118
|
+
flyout.setCheckboxState(variableBlockId, true)
|
|
119
|
+
})
|
|
149
120
|
}
|
|
150
121
|
|
|
151
122
|
if (opt_callback) {
|
|
152
|
-
opt_callback(variableBlockId)
|
|
123
|
+
opt_callback(variableBlockId)
|
|
153
124
|
}
|
|
154
125
|
} else {
|
|
155
126
|
// User canceled prompt without a value.
|
|
156
127
|
if (opt_callback) {
|
|
157
|
-
opt_callback(undefined)
|
|
128
|
+
opt_callback(undefined)
|
|
158
129
|
}
|
|
159
130
|
}
|
|
160
131
|
},
|
|
161
132
|
modalTitle,
|
|
162
|
-
opt_type
|
|
163
|
-
)
|
|
133
|
+
opt_type,
|
|
134
|
+
)
|
|
164
135
|
}
|
|
165
136
|
|
|
166
137
|
/**
|
|
@@ -168,7 +139,6 @@ export function createVariable(
|
|
|
168
139
|
* agnostic of type. This is so that functions like createVariable and
|
|
169
140
|
* renameVariable can call a single function (with a single type signature) to
|
|
170
141
|
* validate the user-provided name for a variable.
|
|
171
|
-
*
|
|
172
142
|
* @param type The type of the variable for which the provided name should be
|
|
173
143
|
* validated.
|
|
174
144
|
* @param text The user-provided text that should be validated as a variable
|
|
@@ -192,7 +162,7 @@ function nameValidator(
|
|
|
192
162
|
workspace: Blockly.WorkspaceSvg,
|
|
193
163
|
additionalVars: string[],
|
|
194
164
|
isCloud: boolean,
|
|
195
|
-
opt_callback?: (id?: string) => void
|
|
165
|
+
opt_callback?: (id?: string) => void,
|
|
196
166
|
): string | null {
|
|
197
167
|
// The validators for the different variable types require slightly different
|
|
198
168
|
// arguments. For broadcast messages, if a broadcast message of the provided
|
|
@@ -204,16 +174,9 @@ function nameValidator(
|
|
|
204
174
|
// a variable of the given name and type already exists.
|
|
205
175
|
|
|
206
176
|
if (type === BROADCAST_MESSAGE_VARIABLE_TYPE) {
|
|
207
|
-
return validateBroadcastMessageName(text, workspace, opt_callback)
|
|
177
|
+
return validateBroadcastMessageName(text, workspace, opt_callback)
|
|
208
178
|
} else if (type === LIST_VARIABLE_TYPE) {
|
|
209
|
-
return validateScalarVarOrListName(
|
|
210
|
-
text,
|
|
211
|
-
workspace,
|
|
212
|
-
additionalVars,
|
|
213
|
-
false,
|
|
214
|
-
type,
|
|
215
|
-
Blockly.Msg.LIST_ALREADY_EXISTS
|
|
216
|
-
);
|
|
179
|
+
return validateScalarVarOrListName(text, workspace, additionalVars, false, type, Blockly.Msg.LIST_ALREADY_EXISTS)
|
|
217
180
|
} else {
|
|
218
181
|
return validateScalarVarOrListName(
|
|
219
182
|
text,
|
|
@@ -221,14 +184,13 @@ function nameValidator(
|
|
|
221
184
|
additionalVars,
|
|
222
185
|
isCloud,
|
|
223
186
|
type,
|
|
224
|
-
Blockly.Msg.VARIABLE_ALREADY_EXISTS
|
|
225
|
-
)
|
|
187
|
+
Blockly.Msg.VARIABLE_ALREADY_EXISTS,
|
|
188
|
+
)
|
|
226
189
|
}
|
|
227
190
|
}
|
|
228
191
|
|
|
229
192
|
/**
|
|
230
193
|
* Validate the given name as a broadcast message type.
|
|
231
|
-
*
|
|
232
194
|
* @param name The name to validate
|
|
233
195
|
* @param workspace The workspace the name should be validated against.
|
|
234
196
|
* @param opt_callback An optional function to call if a broadcast message
|
|
@@ -239,35 +201,34 @@ function nameValidator(
|
|
|
239
201
|
function validateBroadcastMessageName(
|
|
240
202
|
name: string,
|
|
241
203
|
workspace: Blockly.WorkspaceSvg,
|
|
242
|
-
opt_callback?: (id?: string) => void
|
|
204
|
+
opt_callback?: (id?: string) => void,
|
|
243
205
|
): string | null {
|
|
244
206
|
if (!name) {
|
|
245
207
|
// no name was provided or the user cancelled the prompt
|
|
246
|
-
return null
|
|
208
|
+
return null
|
|
247
209
|
}
|
|
248
|
-
const variable = workspace.getVariable(name, BROADCAST_MESSAGE_VARIABLE_TYPE)
|
|
210
|
+
const variable = workspace.getVariable(name, BROADCAST_MESSAGE_VARIABLE_TYPE)
|
|
249
211
|
if (variable) {
|
|
250
212
|
// If the user provided a name for a broadcast message that already exists,
|
|
251
213
|
// use the provided callback function to update the selected option in
|
|
252
214
|
// the field of the block that was used to create
|
|
253
215
|
// this message.
|
|
254
216
|
if (opt_callback) {
|
|
255
|
-
opt_callback(variable.getId())
|
|
217
|
+
opt_callback(variable.getId())
|
|
256
218
|
}
|
|
257
219
|
// Return null to signal to the calling function that we do not want to create
|
|
258
220
|
// a new variable since one already exists.
|
|
259
|
-
return null
|
|
221
|
+
return null
|
|
260
222
|
} else {
|
|
261
223
|
// The name provided is actually a new name, so the calling
|
|
262
224
|
// function should go ahead and create it as a new variable.
|
|
263
|
-
return name
|
|
225
|
+
return name
|
|
264
226
|
}
|
|
265
227
|
}
|
|
266
228
|
|
|
267
229
|
/**
|
|
268
230
|
* Validate the given name as a scalar variable or list type.
|
|
269
231
|
* This function is also responsible for any user facing error-handling.
|
|
270
|
-
*
|
|
271
232
|
* @param name The name to validate
|
|
272
233
|
* @param workspace The workspace the name should be validated against.
|
|
273
234
|
* @param additionalVars A list of additional variable names to check for
|
|
@@ -285,29 +246,28 @@ function validateScalarVarOrListName(
|
|
|
285
246
|
additionalVars: string[],
|
|
286
247
|
isCloud: boolean,
|
|
287
248
|
type: string,
|
|
288
|
-
errorMsg: string
|
|
249
|
+
errorMsg: string,
|
|
289
250
|
): string | null {
|
|
290
251
|
// For scalar variables, we don't want leading or trailing white space
|
|
291
|
-
name = name.trim()
|
|
252
|
+
name = name.trim()
|
|
292
253
|
if (!name) {
|
|
293
|
-
return null
|
|
254
|
+
return null
|
|
294
255
|
}
|
|
295
256
|
if (isCloud) {
|
|
296
|
-
name = CLOUD_PREFIX + name
|
|
257
|
+
name = CLOUD_PREFIX + name
|
|
297
258
|
}
|
|
298
|
-
if (workspace.getVariable(name, type) || additionalVars.
|
|
259
|
+
if (workspace.getVariable(name, type) || additionalVars.includes(name)) {
|
|
299
260
|
// error
|
|
300
|
-
Blockly.dialog.alert(errorMsg.replace(
|
|
301
|
-
return null
|
|
261
|
+
Blockly.dialog.alert(errorMsg.replace('%1', name))
|
|
262
|
+
return null
|
|
302
263
|
} else {
|
|
303
264
|
// trimmed name is valid
|
|
304
|
-
return name
|
|
265
|
+
return name
|
|
305
266
|
}
|
|
306
267
|
}
|
|
307
268
|
|
|
308
269
|
/**
|
|
309
270
|
* Rename a variable with the given workspace, variableType, and oldName.
|
|
310
|
-
*
|
|
311
271
|
* @param workspace The workspace on which to rename the variable.
|
|
312
272
|
* @param variable Variable to rename.
|
|
313
273
|
* @param opt_callback A callback. It will be passed an acceptable new variable
|
|
@@ -317,69 +277,60 @@ function validateScalarVarOrListName(
|
|
|
317
277
|
export function renameVariable(
|
|
318
278
|
workspace: Blockly.WorkspaceSvg,
|
|
319
279
|
variable: ScratchVariableModel,
|
|
320
|
-
opt_callback?: (id?: string) => void
|
|
280
|
+
opt_callback?: (id?: string) => void,
|
|
321
281
|
) {
|
|
322
282
|
// Validation and modal message/title depends on the variable type
|
|
323
|
-
let promptMsg, modalTitle
|
|
324
|
-
const varType = variable.getType()
|
|
283
|
+
let promptMsg, modalTitle
|
|
284
|
+
const varType = variable.getType()
|
|
325
285
|
if (varType === BROADCAST_MESSAGE_VARIABLE_TYPE) {
|
|
326
286
|
console.warn(
|
|
327
287
|
`Unexpected attempt to rename a broadcast message with
|
|
328
|
-
id: "${variable.getId()} and name: ${variable.getName()}
|
|
329
|
-
)
|
|
330
|
-
return
|
|
288
|
+
id: "${variable.getId()} and name: ${variable.getName()}`,
|
|
289
|
+
)
|
|
290
|
+
return
|
|
331
291
|
}
|
|
332
292
|
if (varType === LIST_VARIABLE_TYPE) {
|
|
333
|
-
promptMsg = Blockly.Msg.RENAME_LIST_TITLE
|
|
334
|
-
modalTitle = Blockly.Msg.RENAME_LIST_MODAL_TITLE
|
|
293
|
+
promptMsg = Blockly.Msg.RENAME_LIST_TITLE
|
|
294
|
+
modalTitle = Blockly.Msg.RENAME_LIST_MODAL_TITLE
|
|
335
295
|
} else {
|
|
336
296
|
// Default for all other types of variables
|
|
337
|
-
promptMsg = Blockly.Msg.RENAME_VARIABLE_TITLE
|
|
338
|
-
modalTitle = Blockly.Msg.RENAME_VARIABLE_MODAL_TITLE
|
|
297
|
+
promptMsg = Blockly.Msg.RENAME_VARIABLE_TITLE
|
|
298
|
+
modalTitle = Blockly.Msg.RENAME_VARIABLE_MODAL_TITLE
|
|
339
299
|
}
|
|
340
|
-
const validate = nameValidator.bind(null, varType)
|
|
300
|
+
const validate = nameValidator.bind(null, varType)
|
|
341
301
|
|
|
342
|
-
const promptText = promptMsg.replace(
|
|
343
|
-
let promptDefaultText = variable.getName()
|
|
344
|
-
if (variable.isCloud && variable.getName().
|
|
345
|
-
promptDefaultText = promptDefaultText.substring(CLOUD_PREFIX.length)
|
|
302
|
+
const promptText = promptMsg.replace('%1', variable.getName())
|
|
303
|
+
let promptDefaultText = variable.getName()
|
|
304
|
+
if (variable.isCloud && variable.getName().startsWith(CLOUD_PREFIX)) {
|
|
305
|
+
promptDefaultText = promptDefaultText.substring(CLOUD_PREFIX.length)
|
|
346
306
|
}
|
|
347
307
|
|
|
348
308
|
prompt!(
|
|
349
309
|
promptText,
|
|
350
310
|
promptDefaultText,
|
|
351
311
|
(newName: string, additionalVars: string[]) => {
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
newName.length > 0 &&
|
|
355
|
-
newName.indexOf(CLOUD_PREFIX) == 0
|
|
356
|
-
) {
|
|
357
|
-
newName = newName.substring(CLOUD_PREFIX.length);
|
|
312
|
+
if (variable.isCloud && newName.length > 0 && newName.startsWith(CLOUD_PREFIX)) {
|
|
313
|
+
newName = newName.substring(CLOUD_PREFIX.length)
|
|
358
314
|
// The name validator will add the prefix back
|
|
359
315
|
}
|
|
360
|
-
additionalVars = additionalVars || []
|
|
361
|
-
const additionalVarNames = variable.isLocal ? [] : additionalVars
|
|
362
|
-
const validatedText = validate(
|
|
363
|
-
newName,
|
|
364
|
-
workspace,
|
|
365
|
-
additionalVarNames,
|
|
366
|
-
variable.isCloud
|
|
367
|
-
);
|
|
316
|
+
additionalVars = additionalVars || []
|
|
317
|
+
const additionalVarNames = variable.isLocal ? [] : additionalVars
|
|
318
|
+
const validatedText = validate(newName, workspace, additionalVarNames, variable.isCloud)
|
|
368
319
|
if (validatedText) {
|
|
369
|
-
workspace.renameVariableById(variable.getId(), validatedText)
|
|
320
|
+
workspace.renameVariableById(variable.getId(), validatedText)
|
|
370
321
|
if (opt_callback) {
|
|
371
|
-
opt_callback(newName)
|
|
322
|
+
opt_callback(newName)
|
|
372
323
|
}
|
|
373
324
|
} else {
|
|
374
325
|
// User canceled prompt without a value.
|
|
375
326
|
if (opt_callback) {
|
|
376
|
-
opt_callback(undefined)
|
|
327
|
+
opt_callback(undefined)
|
|
377
328
|
}
|
|
378
329
|
}
|
|
379
330
|
},
|
|
380
331
|
modalTitle,
|
|
381
|
-
varType
|
|
382
|
-
)
|
|
332
|
+
varType,
|
|
333
|
+
)
|
|
383
334
|
}
|
|
384
335
|
|
|
385
|
-
export { getVariablesCategory } from
|
|
336
|
+
export { getVariablesCategory } from './data_category'
|
package/src/xml.ts
CHANGED
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license
|
|
3
2
|
* Copyright 2025 Google LLC
|
|
4
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import { ScratchVariableModel } from "./scratch_variable_model";
|
|
5
|
+
import * as Blockly from 'blockly/core'
|
|
6
|
+
import { ScratchVariableModel } from './scratch_variable_model'
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Clears the workspace and loads the given serialized state.
|
|
12
|
-
*
|
|
13
10
|
* @param xml XML representation of a Blockly workspace.
|
|
14
11
|
* @param workspace The workspace to load the serialized data onto.
|
|
12
|
+
* @returns An array of variable IDs created during loading.
|
|
15
13
|
*/
|
|
16
|
-
export function clearWorkspaceAndLoadFromXml(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
workspace.setResizesEnabled(false);
|
|
21
|
-
Blockly.Events.setGroup(true);
|
|
22
|
-
workspace.clear();
|
|
14
|
+
export function clearWorkspaceAndLoadFromXml(xml: Element, workspace: Blockly.WorkspaceSvg): string[] {
|
|
15
|
+
workspace.setResizesEnabled(false)
|
|
16
|
+
Blockly.Events.setGroup(true)
|
|
17
|
+
workspace.clear()
|
|
23
18
|
|
|
24
19
|
// Manually load variables to include the cloud and local properties that core
|
|
25
20
|
// Blockly is unaware of.
|
|
26
|
-
for (const variable of xml.querySelectorAll(
|
|
27
|
-
const id = variable.getAttribute(
|
|
28
|
-
if (!id) continue
|
|
29
|
-
const type = variable.getAttribute(
|
|
30
|
-
const name = variable.textContent ??
|
|
31
|
-
const isLocal = variable.getAttribute(
|
|
32
|
-
const isCloud = variable.getAttribute(
|
|
21
|
+
for (const variable of xml.querySelectorAll('variables variable')) {
|
|
22
|
+
const id = variable.getAttribute('id')
|
|
23
|
+
if (!id) continue
|
|
24
|
+
const type = variable.getAttribute('type') ?? ''
|
|
25
|
+
const name = variable.textContent ?? ''
|
|
26
|
+
const isLocal = variable.getAttribute('islocal') === 'true'
|
|
27
|
+
const isCloud = variable.getAttribute('iscloud') === 'true'
|
|
33
28
|
|
|
34
|
-
const variableModel = new ScratchVariableModel(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type,
|
|
38
|
-
id,
|
|
39
|
-
isLocal,
|
|
40
|
-
isCloud
|
|
41
|
-
);
|
|
42
|
-
Blockly.Events.fire(
|
|
43
|
-
new (Blockly.Events.get(Blockly.Events.VAR_CREATE))(variableModel)
|
|
44
|
-
);
|
|
45
|
-
workspace.getVariableMap().addVariable(variableModel);
|
|
29
|
+
const variableModel = new ScratchVariableModel(workspace, name, type, id, isLocal, isCloud)
|
|
30
|
+
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_CREATE))(variableModel))
|
|
31
|
+
workspace.getVariableMap().addVariable(variableModel)
|
|
46
32
|
}
|
|
47
33
|
|
|
48
34
|
// Remove the `variables` element from the XML to prevent Blockly from
|
|
49
35
|
// throwing or stomping on the variables we created.
|
|
50
|
-
xml.querySelector(
|
|
36
|
+
xml.querySelector('variables')?.remove()
|
|
51
37
|
|
|
52
38
|
// Defer to core for the rest of the deserialization.
|
|
53
|
-
const blockIds = Blockly.Xml.domToWorkspace(xml, workspace)
|
|
39
|
+
const blockIds = Blockly.Xml.domToWorkspace(xml, workspace)
|
|
54
40
|
|
|
55
|
-
workspace.setResizesEnabled(true)
|
|
56
|
-
return blockIds
|
|
41
|
+
workspace.setResizesEnabled(true)
|
|
42
|
+
return blockIds
|
|
57
43
|
}
|
package/tsconfig.json
CHANGED
|
@@ -22,11 +22,7 @@
|
|
|
22
22
|
"forceConsistentCasingInFileNames": true,
|
|
23
23
|
|
|
24
24
|
/* Language and Environment */
|
|
25
|
-
"target": "es2020"
|
|
25
|
+
"target": "es2020"
|
|
26
26
|
},
|
|
27
|
-
"include": [
|
|
28
|
-
"./src/",
|
|
29
|
-
"./tests/",
|
|
30
|
-
"./types/",
|
|
31
|
-
]
|
|
27
|
+
"include": ["./src/", "./tests/", "./types/"]
|
|
32
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare module
|
|
1
|
+
declare module '@blockly/continuous-toolbox'
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2024 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2025 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2026 Scratch Foundation
|
|
22
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @license
|
|
27
|
-
* Visual Blocks Editor
|
|
28
|
-
*
|
|
29
|
-
* Copyright 2012 Google Inc.
|
|
30
|
-
* https://developers.google.com/blockly/
|
|
31
|
-
*
|
|
32
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33
|
-
* you may not use this file except in compliance with the License.
|
|
34
|
-
* You may obtain a copy of the License at
|
|
35
|
-
*
|
|
36
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
-
*
|
|
38
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
40
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
-
* See the License for the specific language governing permissions and
|
|
42
|
-
* limitations under the License.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @license
|
|
47
|
-
* Visual Blocks Editor
|
|
48
|
-
*
|
|
49
|
-
* Copyright 2013 Google Inc.
|
|
50
|
-
* https://developers.google.com/blockly/
|
|
51
|
-
*
|
|
52
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
53
|
-
* you may not use this file except in compliance with the License.
|
|
54
|
-
* You may obtain a copy of the License at
|
|
55
|
-
*
|
|
56
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
57
|
-
*
|
|
58
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
59
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
60
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
61
|
-
* See the License for the specific language governing permissions and
|
|
62
|
-
* limitations under the License.
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @license
|
|
67
|
-
* Visual Blocks Editor
|
|
68
|
-
*
|
|
69
|
-
* Copyright 2016 Massachusetts Institute of Technology
|
|
70
|
-
* All rights reserved.
|
|
71
|
-
*
|
|
72
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
73
|
-
* you may not use this file except in compliance with the License.
|
|
74
|
-
* You may obtain a copy of the License at
|
|
75
|
-
*
|
|
76
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
77
|
-
*
|
|
78
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
79
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
80
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
81
|
-
* See the License for the specific language governing permissions and
|
|
82
|
-
* limitations under the License.
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @license
|
|
87
|
-
* Visual Blocks Editor
|
|
88
|
-
*
|
|
89
|
-
* Copyright 2017 Google Inc.
|
|
90
|
-
* https://developers.google.com/blockly/
|
|
91
|
-
*
|
|
92
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
93
|
-
* you may not use this file except in compliance with the License.
|
|
94
|
-
* You may obtain a copy of the License at
|
|
95
|
-
*
|
|
96
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
97
|
-
*
|
|
98
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
99
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
100
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
101
|
-
* See the License for the specific language governing permissions and
|
|
102
|
-
* limitations under the License.
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @license
|
|
107
|
-
* Visual Blocks Editor
|
|
108
|
-
*
|
|
109
|
-
* Copyright 2017 Massachusetts Institute of Technology
|
|
110
|
-
* https://developers.google.com/blockly/
|
|
111
|
-
*
|
|
112
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
113
|
-
* you may not use this file except in compliance with the License.
|
|
114
|
-
* You may obtain a copy of the License at
|
|
115
|
-
*
|
|
116
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
117
|
-
*
|
|
118
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
119
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
120
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
121
|
-
* See the License for the specific language governing permissions and
|
|
122
|
-
* limitations under the License.
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @license
|
|
127
|
-
* Visual Blocks Editor
|
|
128
|
-
*
|
|
129
|
-
* Copyright 2018 Google Inc.
|
|
130
|
-
* https://developers.google.com/blockly/
|
|
131
|
-
*
|
|
132
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
133
|
-
* you may not use this file except in compliance with the License.
|
|
134
|
-
* You may obtain a copy of the License at
|
|
135
|
-
*
|
|
136
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
137
|
-
*
|
|
138
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
139
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
140
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
141
|
-
* See the License for the specific language governing permissions and
|
|
142
|
-
* limitations under the License.
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @license
|
|
147
|
-
* Visual Blocks Editor
|
|
148
|
-
*
|
|
149
|
-
* Copyright 2018 Massachusetts Institute of Technology
|
|
150
|
-
* All rights reserved.
|
|
151
|
-
*
|
|
152
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
153
|
-
* you may not use this file except in compliance with the License.
|
|
154
|
-
* You may obtain a copy of the License at
|
|
155
|
-
*
|
|
156
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
157
|
-
*
|
|
158
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
159
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
160
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
161
|
-
* See the License for the specific language governing permissions and
|
|
162
|
-
* limitations under the License.
|
|
163
|
-
*/
|