From 4efb917fc4a3ffc13d6c1c9643e5e7add5630b23 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Tue, 21 Jan 2020 17:06:06 -0800 Subject: [PATCH 001/105] Fix broken field demos (#3625) --- demos/custom-fields/pitch/field_pitch.js | 5 ++--- demos/custom-fields/turtle/field_turtle.js | 9 +++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/demos/custom-fields/pitch/field_pitch.js b/demos/custom-fields/pitch/field_pitch.js index 3d3621030..cf3b9fd7f 100644 --- a/demos/custom-fields/pitch/field_pitch.js +++ b/demos/custom-fields/pitch/field_pitch.js @@ -88,9 +88,8 @@ CustomFields.FieldPitch.prototype.showEditor_ = function() { var editor = this.dropdownCreate_(); Blockly.DropDownDiv.getContentDiv().appendChild(editor); - var border = this.sourceBlock_.getColourBorder(); - border = border.colourBorder || border.colourLight; - Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(), border); + Blockly.DropDownDiv.setColour(this.sourceBlock_.style.colourPrimary, + this.sourceBlock_.style.colourTertiary); Blockly.DropDownDiv.showPositionedByField( this, this.dropdownDispose_.bind(this)); diff --git a/demos/custom-fields/turtle/field_turtle.js b/demos/custom-fields/turtle/field_turtle.js index ddce28417..374ba5b6c 100644 --- a/demos/custom-fields/turtle/field_turtle.js +++ b/demos/custom-fields/turtle/field_turtle.js @@ -337,10 +337,8 @@ CustomFields.FieldTurtle.prototype.showEditor_ = function() { // These allow us to have the editor match the block's colour. var fillColour = this.sourceBlock_.getColour(); - // This is technically a package function, meaning it could change. - var borderColours = this.sourceBlock_.getColourBorder(); - var borderColour = borderColours.colourBorder || borderColours.colourDark; - Blockly.DropDownDiv.setColour(fillColour, borderColour); + Blockly.DropDownDiv.setColour(fillColour, + this.sourceBlock_.style.colourTertiary); // Always pass the dropdown div a dispose function so that you can clean // up event listeners when the editor closes. @@ -483,9 +481,8 @@ CustomFields.FieldTurtle.prototype.updateColour = function() { var fillColour = isShadow ? this.sourceBlock_.getColourShadow() : this.sourceBlock_.getColour(); // This is technically a package function, meaning it could change. - var borderColours = this.sourceBlock_.getColourBorder(); var borderColour = isShadow ? fillColour : - borderColours.colourBorder || borderColours.colourDark; + this.sourceBlock_.style.colourTertiary; var child = this.turtleGroup_.firstChild; while(child) { From 130297f795958bea516c250f957fb1daf7725653 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Wed, 22 Jan 2020 07:34:46 -0800 Subject: [PATCH 002/105] Add colour methods back to blockSvg (#3626) * Add colour methods back to blockSvg --- core/block_svg.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/core/block_svg.js b/core/block_svg.js index 338db0d15..d42f5018c 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -218,6 +218,49 @@ Blockly.BlockSvg.prototype.initSvg = function() { } }; +/** + * Get the secondary colour of a block. + * @return {?string} #RRGGBB string. + */ +Blockly.BlockSvg.prototype.getColourSecondary = function() { + return this.style.colourSecondary; +}; + +/** + * Get the tertiary colour of a block. + * @return {?string} #RRGGBB string. + */ +Blockly.BlockSvg.prototype.getColourTertiary = function() { + return this.style.colourTertiary; +}; + +/** + * Get the shadow colour of a block. + * @return {?string} #RRGGBB string. + * @deprecated Use style.colourSecondary. (2020 January 21) + */ +Blockly.BlockSvg.prototype.getColourShadow = function() { + return this.getColourSecondary(); +}; + +/** + * Get the border colour(s) of a block. + * @return {{colourDark, colourLight, colourBorder}} An object containing + * colour values for the border(s) of the block. If the block is using a + * style the colourBorder will be defined and equal to the tertiary colour + * of the style (#RRGGBB string). Otherwise the colourDark and colourLight + * attributes will be defined (#RRGGBB strings). + * @deprecated Use style.colourTertiary. (2020 January 21) + */ +Blockly.BlockSvg.prototype.getColourBorder = function() { + var colourTertiary = this.getColourTertiary(); + return { + colourBorder: colourTertiary, + colourLight: null, + colourDark: null + }; +}; + /** * Select this block. Highlight it visually. */ From 639218e883df46cf3a1f4ca1f25246ea926f3495 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 22 Jan 2020 11:07:28 -0800 Subject: [PATCH 003/105] Add renderer into typings options (#3631) --- typings/parts/blockly-interfaces.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typings/parts/blockly-interfaces.d.ts b/typings/parts/blockly-interfaces.d.ts index 760f97fcb..31fa80fbb 100644 --- a/typings/parts/blockly-interfaces.d.ts +++ b/typings/parts/blockly-interfaces.d.ts @@ -36,6 +36,7 @@ declare module Blockly { minScale?: number; scaleSpeed?: number; }; + renderer?: string; } interface BlocklyThemeOptions { From af84e6a40c4bc43f404dd9b6c0d670da7f015348 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 22 Jan 2020 11:07:45 -0800 Subject: [PATCH 004/105] Zelos rename highlightfilter (#3630) * Rename highlight filter to selected filter * Update comment --- core/renderers/zelos/constants.js | 36 ++++++++++++++--------------- core/renderers/zelos/path_object.js | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index f4ca8189d..460a86842 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -359,22 +359,22 @@ Blockly.zelos.ConstantProvider = function() { this.FIELD_CHECKBOX_DEFAULT_WIDTH = 6 * this.GRID_UNIT; /** - * The ID of the highlight glow filter, or the empty string if no filter is + * The ID of the selected glow filter, or the empty string if no filter is * set. * @type {string} * @package */ - this.highlightGlowFilterId = ''; + this.selectedGlowFilterId = ''; /** - * The element to use for a higlight glow, or null if not set. + * The element to use for a selected glow, or null if not set. * @type {SVGElement} * @private */ - this.highlightGlowFilter_ = null; + this.selectedGlowFilter_ = null; /** - * The ID of the highlight glow filter, or the empty string if no filter is + * The ID of the replacement glow filter, or the empty string if no filter is * set. * @type {string} * @package @@ -382,7 +382,7 @@ Blockly.zelos.ConstantProvider = function() { this.replacementGlowFilterId = ''; /** - * The element to use for a higlight glow, or null if not set. + * The element to use for a replacement glow, or null if not set. * @type {SVGElement} * @private */ @@ -408,8 +408,8 @@ Blockly.zelos.ConstantProvider.prototype.init = function() { */ Blockly.zelos.ConstantProvider.prototype.dispose = function() { Blockly.zelos.ConstantProvider.superClass_.dispose.call(this); - if (this.highlightGlowFilter_) { - Blockly.utils.dom.removeNode(this.highlightGlowFilter_); + if (this.selectedGlowFilter_) { + Blockly.utils.dom.removeNode(this.selectedGlowFilter_); } }; @@ -757,9 +757,9 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg) { var defs = Blockly.utils.dom.createSvgElement('defs', {}, svg); // Using a dilate distorts the block shape. // Instead use a gaussian blur, and then set all alpha to 1 with a transfer. - var highlightGlowFilter = Blockly.utils.dom.createSvgElement('filter', + var selectedGlowFilter = Blockly.utils.dom.createSvgElement('filter', { - 'id': 'blocklyHighlightGlowFilter' + this.randomIdentifier_, + 'id': 'blocklySelectedGlowFilter' + this.randomIdentifier_, 'height': '160%', 'width': '180%', y: '-30%', @@ -771,15 +771,15 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg) { 'in': 'SourceGraphic', 'stdDeviation': 0.5 // TODO: configure size in theme. }, - highlightGlowFilter); + selectedGlowFilter); // Set all gaussian blur pixels to 1 opacity before applying flood - var highlightComponentTransfer = Blockly.utils.dom.createSvgElement( - 'feComponentTransfer', {'result': 'outBlur'}, highlightGlowFilter); + var selectedComponentTransfer = Blockly.utils.dom.createSvgElement( + 'feComponentTransfer', {'result': 'outBlur'}, selectedGlowFilter); Blockly.utils.dom.createSvgElement('feFuncA', { 'type': 'table', 'tableValues': '0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1' }, - highlightComponentTransfer); + selectedComponentTransfer); // Color the highlight Blockly.utils.dom.createSvgElement('feFlood', { @@ -787,15 +787,15 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg) { 'flood-opacity': 1, 'result': 'outColor' }, - highlightGlowFilter); + selectedGlowFilter); Blockly.utils.dom.createSvgElement('feComposite', { 'in': 'outColor', 'in2': 'outBlur', 'operator': 'in', 'result': 'outGlow' }, - highlightGlowFilter); - this.highlightGlowFilterId = highlightGlowFilter.id; - this.highlightGlowFilter_ = highlightGlowFilter; + selectedGlowFilter); + this.selectedGlowFilterId = selectedGlowFilter.id; + this.selectedGlowFilter_ = selectedGlowFilter; // Using a dilate distorts the block shape. // Instead use a gaussian blur, and then set all alpha to 1 with a transfer. diff --git a/core/renderers/zelos/path_object.js b/core/renderers/zelos/path_object.js index 70ced53b9..c3b64a1bb 100644 --- a/core/renderers/zelos/path_object.js +++ b/core/renderers/zelos/path_object.js @@ -135,7 +135,7 @@ Blockly.zelos.PathObject.prototype.updateSelected = function(enable) { /** @type {!SVGElement} */ (this.svgPath.cloneNode(true)); this.svgPathSelected_.setAttribute('fill', 'none'); this.svgPathSelected_.setAttribute('filter', - 'url(#' + this.constants_.highlightGlowFilterId + ')'); + 'url(#' + this.constants_.selectedGlowFilterId + ')'); this.svgRoot.appendChild(this.svgPathSelected_); } } else { From 58b690728dde330c47141ace9bb38fcb71f13f6a Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 22 Jan 2020 11:07:59 -0800 Subject: [PATCH 005/105] Fix rtl placement of arrow in non-borderbox dropdown fields (#3629) --- core/field_dropdown.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 32b1beb78..4a42c3429 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -288,8 +288,10 @@ Blockly.FieldDropdown.prototype.showEditor_ = function(opt_e) { var primaryColour = (this.sourceBlock_.isShadow()) ? this.sourceBlock_.getParent().getColour() : this.sourceBlock_.getColour(); - Blockly.DropDownDiv.setColour(primaryColour, - this.sourceBlock_.style.colourTertiary); + var borderColour = (this.sourceBlock_.isShadow()) ? + this.sourceBlock_.getParent().style.colourTertiary : + this.sourceBlock_.style.colourTertiary; + Blockly.DropDownDiv.setColour(primaryColour, borderColour); } Blockly.DropDownDiv.showPositionedByField( @@ -680,12 +682,14 @@ Blockly.FieldDropdown.prototype.positionSVGArrow_ = function(x, y) { if (!this.svgArrow_) { return 0; } - var padding = this.constants_.FIELD_DROPDOWN_SVG_ARROW_PADDING; + var hasBorder = !!this.borderRect_; + var xPadding = hasBorder ? this.constants_.FIELD_BORDER_RECT_X_PADDING : 0; + var textPadding = this.constants_.FIELD_DROPDOWN_SVG_ARROW_PADDING; var svgArrowSize = this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE; - var arrowX = this.sourceBlock_.RTL ? padding : x + padding; + var arrowX = this.sourceBlock_.RTL ? xPadding : x + textPadding; this.svgArrow_.setAttribute('transform', 'translate(' + arrowX + ',' + y + ')'); - return svgArrowSize + padding; + return svgArrowSize + textPadding; }; /** From cf90154b2336ade199dc1ae9d8b30bb9cd2cd315 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 22 Jan 2020 11:10:35 -0800 Subject: [PATCH 006/105] Support for closure library option in uncompressed local build (#3633) * Support for closure library option in uncompressed local build * Refactor into maybeAddClosureLibrary method --- gulpfile.js | 66 ++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a77c68f50..ef9fb4148 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -161,16 +161,13 @@ function compile(compilerOptions, opt_verbose, opt_warnings_as_error) { } /** - * This task builds Blockly's core files. - * blockly_compressed.js + * Helper method for possibly adding the closure library into a sources array. + * @param {Array.} srcs */ -gulp.task('build-compressed', function (cb) { - const defines = 'Blockly.VERSION="' + packageJson.version + '"'; - const srcs = ['core/**/**/*.js']; +function maybeAddClosureLibrary(srcs) { if (argv.closureLibrary) { // If you require the google closure library, you can include it in your - // build by running: - // gulp build-compressed --closure-library + // build by adding the --closure-library flag. // You will also need to include the "google-closure-library" in your list // of devDependencies. console.log('Including the google-closure-library in your build.'); @@ -178,9 +175,18 @@ gulp.task('build-compressed', function (cb) { throw Error('You must add the google-closure-library to your ' + 'devDependencies in package.json, and run `npm install`.'); } - srcs.push('./node_modules/google-closure-library/closure/goog/**/*.js'); + srcs.push('./node_modules/google-closure-library/closure/goog/**/**/*.js'); } - return gulp.src(srcs, {base: './'}) + return srcs; +} + +/** + * This task builds Blockly's core files. + * blockly_compressed.js + */ +gulp.task('build-compressed', function (cb) { + const defines = 'Blockly.VERSION="' + packageJson.version + '"'; + return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'}) // Directories in Blockly are used to group similar files together // but are not used to limit access with @package, instead the // method means something is internal to Blockly and not a public @@ -229,7 +235,7 @@ goog.provide('Blockly.FieldTextInput'); goog.provide('Blockly.FieldVariable'); goog.provide('Blockly.Mutator'); goog.provide('Blockly.Warning');`; - return gulp.src('blocks/*.js', {base: './'}) + return gulp.src(maybeAddClosureLibrary(['blocks/*.js']), {base: './'}) // Add Blockly.Blocks to be compatible with the compiler. .pipe(gulp.replace(`goog.provide('Blockly.Constants.Colour');`, `${provides}goog.provide('Blockly.Constants.Colour');`)) @@ -338,6 +344,9 @@ gulp.task('build-generators', gulp.parallel( * blockly_uncompressed.js */ gulp.task('build-uncompressed', function() { + const closurePath = argv.closureLibrary ? + 'node_modules/google-closure-library/closure/goog' : + 'closure/goog'; const header = `// Do not edit this file; automatically generated by gulp. 'use strict'; @@ -373,42 +382,37 @@ if (this.IS_NODE_JS) { module.exports = Blockly; } else { document.write(''); + '/${closurePath}/base.js">'); document.write(''); } `; let deps = []; -return gulp.src('core/**/**/*.js') +return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js'])) .pipe(through2.obj((file, _enc, cb) => { - deps.push(closureDeps.parser.parseFile(file.path).dependencies[0]); + const result = closureDeps.parser.parseFile(file.path); + for (const dep of result.dependencies) { + deps.push(dep); + } cb(null); })) .on('end', () => { - const graph = new closureDeps.depGraph.Graph(deps); - let addDependency = []; - graph.depsByPath.forEach(dep => { - addDependency.push('goog.addDependency(' + [ - '"' + path.relative('./closure/goog', dep.path) + '"', - '[' + dep.closureSymbols - .map(s => `'${s}'`).join(', ') + ']', - '[' + dep.imports - .map(i => i.symOrPath) - .filter(i => i !== 'goog') - .sort() - .map(i => `'${i}'`).join(', ') + ']', - ].join(', ') + ');'); - }); - const requires = ` -goog.addDependency("base.js", [], []); + // Update the path to closure for any files that we don't know the full path + // of (parsed from a goog.addDependency call). + for (const dep of deps) { + dep.setClosurePath(closurePath); + } + + const addDependency = closureDeps.depFile.getDepFileText(closurePath, deps); + + const requires = `goog.addDependency("base.js", [], []); // Load Blockly. goog.require('Blockly.requires') `; fs.writeFileSync('blockly_uncompressed.js', header + - addDependency.sort((a, b) => - a.localeCompare(b, undefined, {sensitivity: 'base'})).join('\n') + + addDependency + requires + footer); }); From 5727a62c62e6eca05b3081e1dbeb4ca7b64d54f9 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 22 Jan 2020 11:23:33 -0800 Subject: [PATCH 007/105] Revert on blur for text input fields as it interferes with combo boxes (#3634) --- core/field_textinput.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/core/field_textinput.js b/core/field_textinput.js index 34a5a0e9a..69b20bc54 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -85,13 +85,6 @@ Blockly.FieldTextInput = function(opt_value, opt_validator, opt_config) { */ this.onKeyInputWrapper_ = null; - /** - * Blur input event data. - * @type {?Blockly.EventData} - * @private - */ - this.onBlurInputWrapper_ = null; - /** * Whether the field should consider the whole parent block to be its click * target. @@ -432,9 +425,6 @@ Blockly.FieldTextInput.prototype.bindInputEvents_ = function(htmlInput) { this.onKeyInputWrapper_ = Blockly.bindEventWithChecks_( htmlInput, 'input', this, this.onHtmlInputChange_); - this.onBlurInputWrapper_ = - Blockly.bindEventWithChecks_( - htmlInput, 'blur', this, this.onHtmlInputBlur_); }; /** @@ -450,10 +440,6 @@ Blockly.FieldTextInput.prototype.unbindInputEvents_ = function() { Blockly.unbindEvent_(this.onKeyInputWrapper_); this.onKeyInputWrapper_ = null; } - if (this.onBlurInputWrapper_) { - Blockly.unbindEvent_(this.onBlurInputWrapper_); - this.onBlurInputWrapper_ = null; - } }; /** @@ -499,16 +485,6 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) { } }; -/** - * Handle blur for the editor. - * @param {!Event} _e Focus event. - * @protected - */ -Blockly.FieldTextInput.prototype.onHtmlInputBlur_ = function(_e) { - Blockly.WidgetDiv.hide(); - Blockly.DropDownDiv.hideWithoutAnimation(); -}; - /** * Set the html input value and the field's internal value. The difference * between this and ``setValue`` is that this also updates the html input From 26a11faf4974441418306e519a5d006e1edb387f Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Wed, 22 Jan 2020 11:41:59 -0800 Subject: [PATCH 008/105] Update CSS rules for cursor. (#3627) --- core/css.js | 4 ++++ core/renderers/common/constants.js | 1 - core/renderers/zelos/constants.js | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/css.js b/core/css.js index 44a1c14a5..d62eaea51 100644 --- a/core/css.js +++ b/core/css.js @@ -340,6 +340,10 @@ Blockly.Css.CONTENT = [ 'z-index: 20;', '}', + '.blocklyText text {', + 'cursor: default;', + '}', + /* Don't allow users to select text. It gets annoying when trying to drag a block and selected text moves instead. diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index dbfd4a6dd..654208612 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -1041,7 +1041,6 @@ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(name) { /* eslint-disable indent */ // Fields. selector + ' .blocklyText {', - 'cursor: default;', 'fill: #fff;', 'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';', 'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;', diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index 460a86842..72458852e 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -855,7 +855,6 @@ Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(name) { /* eslint-disable indent */ // Fields. selector + ' .blocklyText {', - 'cursor: default;', 'fill: #fff;', 'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';', 'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;', From ea591b367c0f3d4129712ec2f1c9f1cd03a7271e Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 23 Jan 2020 16:06:35 +0100 Subject: [PATCH 009/105] Localisation updates from https://translatewiki.net. --- msg/json/qqq.json | 9 +++++++++ msg/json/sl.json | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/msg/json/qqq.json b/msg/json/qqq.json index f2b7d1723..596ea55ad 100644 --- a/msg/json/qqq.json +++ b/msg/json/qqq.json @@ -1,4 +1,13 @@ { + "@metadata": { + "authors": [ + "Espertus", + "Liuxinyu970226", + "Metalhead64", + "Robby", + "Shirayuki" + ] + }, "VARIABLES_DEFAULT_NAME": "default name - A simple, general default name for a variable, preferably short. For more context, see [[Translating:Blockly#infrequent_message_types]].\n{{Identical|Item}}", "UNNAMED_KEY": "default name - A simple, default name for an unnamed function or variable. Preferably indicates that the item is unnamed.", "TODAY": "button text - Button that sets a calendar to today's date.\n{{Identical|Today}}", diff --git a/msg/json/sl.json b/msg/json/sl.json index 297fbdb80..07c990a65 100644 --- a/msg/json/sl.json +++ b/msg/json/sl.json @@ -99,7 +99,7 @@ "IOS_ERROR": "Napaka", "IOS_PROCEDURES_INPUTS": "VNOSI", "IOS_PROCEDURES_ADD_INPUT": "+ Dodaj vnos", - "IOS_PROCEDURES_ALLOW_STATEMENTS": "Dovoli izjave", + "IOS_PROCEDURES_ALLOW_STATEMENTS": "Vsebuje delčke", "IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR": "Ta funkcija ima podvojene vnose", "IOS_VARIABLES_ADD_VARIABLE": "+ Dodaj spremenljivko", "IOS_VARIABLES_ADD_BUTTON": "Dodaj", @@ -380,7 +380,7 @@ "PROCEDURES_DEFRETURN_HELPURL": "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29", "PROCEDURES_DEFRETURN_RETURN": "vrni", "PROCEDURES_DEFRETURN_TOOLTIP": "Ustvari funkcijo z izhodom.", - "PROCEDURES_ALLOW_STATEMENTS": "dovoli korake", + "PROCEDURES_ALLOW_STATEMENTS": "vsebuje delčke", "PROCEDURES_DEF_DUPLICATE_WARNING": "Pozor: Ta funkcija ima podvojene parametre.", "PROCEDURES_CALLNORETURN_HELPURL": "https://en.wikipedia.org/wiki/Subroutine", "PROCEDURES_CALLNORETURN_TOOLTIP": "Izvede uporabniško funkcijo '%1'.", From f0e4d44ff94a730c2f80a1acd9448e8015edb4c1 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Thu, 23 Jan 2020 11:31:14 -0800 Subject: [PATCH 010/105] Fixing custom fields turtle demo. (#3641) --- demos/custom-fields/turtle/field_turtle.js | 38 ++++++++++++---------- demos/custom-fields/turtle/turtle.css | 4 +-- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/demos/custom-fields/turtle/field_turtle.js b/demos/custom-fields/turtle/field_turtle.js index 374ba5b6c..9a787e478 100644 --- a/demos/custom-fields/turtle/field_turtle.js +++ b/demos/custom-fields/turtle/field_turtle.js @@ -471,8 +471,8 @@ CustomFields.FieldTurtle.prototype.dropdownDispose_ = function() { }; // Updates the field's colour based on the colour of the block. Called by -// block.updateColour. -CustomFields.FieldTurtle.prototype.updateColour = function() { +// block.applyColour. +CustomFields.FieldTurtle.prototype.applyColour = function() { if (!this.sourceBlock_) { return; } @@ -484,23 +484,25 @@ CustomFields.FieldTurtle.prototype.updateColour = function() { var borderColour = isShadow ? fillColour : this.sourceBlock_.style.colourTertiary; - var child = this.turtleGroup_.firstChild; - while(child) { - // If it is a text node, continue. - if (child.nodeType == 3) { - child = child.nextSibling; - continue; - } - // Or if it is a non-turtle node, continue. - var className = child.getAttribute('class'); - if (!className || className.indexOf('turtleBody') == -1) { - child = child.nextSibling; - continue; - } + if (this.turtleGroup_) { + var child = this.turtleGroup_.firstChild; + while(child) { + // If it is a text node, continue. + if (child.nodeType == 3) { + child = child.nextSibling; + continue; + } + // Or if it is a non-turtle node, continue. + var className = child.getAttribute('class'); + if (!className || className.indexOf('turtleBody') == -1) { + child = child.nextSibling; + continue; + } - child.style.fill = fillColour; - child.style.stroke = borderColour; - child = child.nextSibling; + child.style.fill = fillColour; + child.style.stroke = borderColour; + child = child.nextSibling; + } } }; diff --git a/demos/custom-fields/turtle/turtle.css b/demos/custom-fields/turtle/turtle.css index c5e5e589a..99ab0d4c1 100644 --- a/demos/custom-fields/turtle/turtle.css +++ b/demos/custom-fields/turtle/turtle.css @@ -53,7 +53,7 @@ width: 100%; } -.blocklyNonEditableText text, -.blocklyEditableText text { +.blocklySvg .blocklyNonEditableText text, +.blocklySvg .blocklyEditableText text { fill: #000; } From fdb1d71e886a302c7c85c2ab43caeea20ba365e8 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Thu, 23 Jan 2020 13:10:33 -0800 Subject: [PATCH 011/105] Editable field spacing (#3635) * Substituting checks for isEditable. * Add isField checks. * Add parentheses for casting. * Update value of isEditable and use for spacing. * Changing to double equals. --- core/renderers/geras/info.js | 20 ++++++++++++-------- core/renderers/measurables/row_elements.js | 2 +- core/renderers/thrasos/info.js | 20 ++++++++++++-------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/core/renderers/geras/info.js b/core/renderers/geras/info.js index 2058e874e..7fe68853d 100644 --- a/core/renderers/geras/info.js +++ b/core/renderers/geras/info.js @@ -172,7 +172,8 @@ Blockly.geras.RenderInfo.prototype.addElemSpacing_ = function() { Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!prev) { // Between an editable field and the beginning of the row. - if (next && Blockly.blockRendering.Types.isField(next) && next.isEditable) { + if (next && Blockly.blockRendering.Types.isField(next) && + (/** @type Blockly.blockRendering.Field */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Inline input at the beginning of the row. @@ -190,7 +191,8 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!Blockly.blockRendering.Types.isInput(prev) && (!next || Blockly.blockRendering.Types.isStatementInput(next))) { // Between an editable field and the end of the row. - if (Blockly.blockRendering.Types.isField(prev) && prev.isEditable) { + if (Blockly.blockRendering.Types.isField(prev) && + (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Padding at the end of an icon-only row to make the block shape clearer. @@ -231,7 +233,8 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!Blockly.blockRendering.Types.isInput(prev) && next && Blockly.blockRendering.Types.isInput(next)) { // Between an editable field and an input. - if (prev.isEditable) { + if (Blockly.blockRendering.Types.isField(prev) && + (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { if (Blockly.blockRendering.Types.isInlineInput(next)) { return this.constants_.SMALL_PADDING; } else if (Blockly.blockRendering.Types.isExternalInput(next)) { @@ -257,9 +260,9 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // Spacing between an inline input and a field. if (Blockly.blockRendering.Types.isInlineInput(prev) && - next && !Blockly.blockRendering.Types.isInput(next)) { + next && Blockly.blockRendering.Types.isField(next)) { // Editable field after inline input. - if (next.isEditable) { + if ((/** @type Blockly.blockRendering.Field */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } else { // Noneditable field after inline input. @@ -298,9 +301,10 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { } // Spacing between two fields of the same editability. - if (!Blockly.blockRendering.Types.isInput(prev) && - next && !Blockly.blockRendering.Types.isInput(next) && - (prev.isEditable == next.isEditable)) { + if (Blockly.blockRendering.Types.isField(prev) && + next && Blockly.blockRendering.Types.isField(next) && + ((/** @type Blockly.blockRendering.Field */ (prev)).isEditable == + (/** @type Blockly.blockRendering.Field */ (next)).isEditable)) { return this.constants_.LARGE_PADDING; } diff --git a/core/renderers/measurables/row_elements.js b/core/renderers/measurables/row_elements.js index c445ce6b0..095449c05 100644 --- a/core/renderers/measurables/row_elements.js +++ b/core/renderers/measurables/row_elements.js @@ -91,7 +91,7 @@ Blockly.utils.object.inherits(Blockly.blockRendering.JaggedEdge, Blockly.blockRendering.Field = function(constants, field, parentInput) { Blockly.blockRendering.Field.superClass_.constructor.call(this, constants); this.field = field; - this.isEditable = field.isCurrentlyEditable(); + this.isEditable = field.EDITABLE; this.flipRtl = field.getFlipRtl(); this.type |= Blockly.blockRendering.Types.FIELD; diff --git a/core/renderers/thrasos/info.js b/core/renderers/thrasos/info.js index 9589ef27f..25014a805 100644 --- a/core/renderers/thrasos/info.js +++ b/core/renderers/thrasos/info.js @@ -114,7 +114,8 @@ Blockly.thrasos.RenderInfo.prototype.addElemSpacing_ = function() { Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!prev) { // Between an editable field and the beginning of the row. - if (next && Blockly.blockRendering.Types.isField(next) && next.isEditable) { + if (next && Blockly.blockRendering.Types.isField(next) && + (/** @type Blockly.blockRendering.Field */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Inline input at the beginning of the row. @@ -131,7 +132,8 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // Spacing between a non-input and the end of the row. if (!Blockly.blockRendering.Types.isInput(prev) && !next) { // Between an editable field and the end of the row. - if (Blockly.blockRendering.Types.isField(prev) && prev.isEditable) { + if (Blockly.blockRendering.Types.isField(prev) && + (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { return this.constants_.MEDIUM_PADDING; } // Padding at the end of an icon-only row to make the block shape clearer. @@ -172,7 +174,8 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!Blockly.blockRendering.Types.isInput(prev) && next && Blockly.blockRendering.Types.isInput(next)) { // Between an editable field and an input. - if (prev.isEditable) { + if (Blockly.blockRendering.Types.isField(prev) && + (/** @type Blockly.blockRendering.Field */ (prev)).isEditable) { if (Blockly.blockRendering.Types.isInlineInput(next)) { return this.constants_.SMALL_PADDING; } else if (Blockly.blockRendering.Types.isExternalInput(next)) { @@ -198,9 +201,9 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // Spacing between an inline input and a field. if (Blockly.blockRendering.Types.isInlineInput(prev) && - next && !Blockly.blockRendering.Types.isInput(next)) { + next && Blockly.blockRendering.Types.isField(next)) { // Editable field after inline input. - if (next.isEditable) { + if ((/** @type Blockly.blockRendering.Field */ (next)).isEditable) { return this.constants_.MEDIUM_PADDING; } else { // Noneditable field after inline input. @@ -226,9 +229,10 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { } // Spacing between two fields of the same editability. - if (!Blockly.blockRendering.Types.isInput(prev) && - next && !Blockly.blockRendering.Types.isInput(next) && - (prev.isEditable == next.isEditable)) { + if (Blockly.blockRendering.Types.isField(prev) && + next && Blockly.blockRendering.Types.isField(next) && + ((/** @type Blockly.blockRendering.Field */ (prev)).isEditable == + (/** @type Blockly.blockRendering.Field */ (next)).isEditable)) { return this.constants_.LARGE_PADDING; } From 46df648200d05bf5fe5adc56cc9bcc01681b05ee Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Thu, 23 Jan 2020 13:35:51 -0800 Subject: [PATCH 012/105] Fix test align block. (#3643) --- tests/blocks/test_blocks.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/blocks/test_blocks.js b/tests/blocks/test_blocks.js index 1a32d4208..ff9b8a08b 100644 --- a/tests/blocks/test_blocks.js +++ b/tests/blocks/test_blocks.js @@ -164,8 +164,11 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT }, { "type": "test_align_all", - "message0": "text %1 long text left %2 text centre %3 much longer text right", + "message0": "text %1 long text left %2 text centre %3 much longer text right %4", "args0": [ + { + "type": "input_dummy", + }, { "type": "input_dummy", "align": "LEFT", From ee9a55ec79baeb529219b517a7e525bb8eebdf95 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 23 Jan 2020 14:23:25 -0800 Subject: [PATCH 013/105] Fix flyouts (#3645) * Set toolboxPosition after options have been parsed * Final toolbox position update --- core/mutator.js | 4 ++-- core/toolbox.js | 2 +- core/workspace_svg.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/mutator.js b/core/mutator.js index 0d2e31f7b..9971f26be 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -170,11 +170,11 @@ Blockly.Mutator.prototype.createEditor_ = function() { 'parentWorkspace': this.block_.workspace, 'media': this.block_.workspace.options.pathToMedia, 'rtl': this.block_.RTL, - 'toolboxPosition': this.block_.RTL ? Blockly.TOOLBOX_AT_RIGHT : - Blockly.TOOLBOX_AT_LEFT, 'horizontalLayout': false, 'renderer': this.block_.workspace.options.renderer })); + workspaceOptions.toolboxPosition = this.block_.RTL ? Blockly.TOOLBOX_AT_RIGHT : + Blockly.TOOLBOX_AT_LEFT; workspaceOptions.languageTree = quarkXml; workspaceOptions.getMetrics = this.getFlyoutMetrics_.bind(this); this.workspace_ = new Blockly.WorkspaceSvg(workspaceOptions); diff --git a/core/toolbox.js b/core/toolbox.js index 5cfbef845..c0a82d8ea 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -186,9 +186,9 @@ Blockly.Toolbox.prototype.init = function() { 'rtl': workspace.RTL, 'oneBasedIndex': workspace.options.oneBasedIndex, 'horizontalLayout': workspace.horizontalLayout, - 'toolboxPosition': workspace.options.toolboxPosition, 'renderer': workspace.options.renderer })); + workspaceOptions.toolboxPosition = workspace.options.toolboxPosition; if (workspace.horizontalLayout) { if (!Blockly.HorizontalFlyout) { diff --git a/core/workspace_svg.js b/core/workspace_svg.js index e0eb6b7e6..5e72f231a 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -899,9 +899,9 @@ Blockly.WorkspaceSvg.prototype.addFlyout = function(tagName) { 'rtl': this.RTL, 'oneBasedIndex': this.options.oneBasedIndex, 'horizontalLayout': this.horizontalLayout, - 'toolboxPosition': this.options.toolboxPosition, 'renderer': this.options.renderer })); + workspaceOptions.toolboxPosition = this.options.toolboxPosition; if (this.horizontalLayout) { if (!Blockly.HorizontalFlyout) { throw Error('Missing require for Blockly.HorizontalFlyout'); From 3bde571daf0be059f84bd159cf547022109ee305 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 23 Jan 2020 14:46:29 -0800 Subject: [PATCH 014/105] Bump version for January 2020 release (#3646) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4710ed3ed..bf38464f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20191014.0-develop", + "version": "3.20200123.0-develop", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From f6b5e9ebb4d91505fbcd28349e61a58248cca1e6 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 23 Jan 2020 16:19:24 -0800 Subject: [PATCH 015/105] Add test block for field image with a click handler (#3642) --- core/field_image.js | 4 ++++ tests/blocks/test_blocks.js | 14 ++++++++++++++ tests/playground.html | 1 + 3 files changed, 19 insertions(+) diff --git a/core/field_image.js b/core/field_image.js index f60c40a92..96a2d272a 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -191,6 +191,10 @@ Blockly.FieldImage.prototype.initView = function() { this.fieldGroup_)); this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href', /** @type {string} */ (this.value_)); + + if (this.clickHandler_) { + this.imageElement_.style.cursor = 'pointer'; + } }; /** diff --git a/tests/blocks/test_blocks.js b/tests/blocks/test_blocks.js index ff9b8a08b..bb1da03f9 100644 --- a/tests/blocks/test_blocks.js +++ b/tests/blocks/test_blocks.js @@ -1340,6 +1340,20 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT } ]); // END JSON EXTRACT (Do not delete this comment.) +Blockly.Blocks['test_images_clickhandler'] = { + init: function() { + this.appendDummyInput() + .appendField("Image click handler") + .appendField(new Blockly.FieldImage( + "https://blockly-demo.appspot.com/static/tests/media/a.png", 32, 32, + "image with click handlder", this.onClick_), "IMAGE"); + this.setStyle('text_blocks'); + }, + onClick_: function() { + alert('Image clicked'); + } +}; + Blockly.Blocks['test_validators_text_null'] = { init: function() { this.appendDummyInput() diff --git a/tests/playground.html b/tests/playground.html index 3523caa67..3f4362eba 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -1608,6 +1608,7 @@ var spaghettiXml = [ + From 7ef5fe8cecd307412a980b19b377615c850a43fe Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 23 Jan 2020 16:23:52 -0800 Subject: [PATCH 016/105] Update gulp task for package-json to remove scripts. (#3650) --- gulpfile.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ef9fb4148..33b0e09ef 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -867,9 +867,15 @@ gulp.task('package-media', function() { /** * This task copies the package.json file into the distribution directory. */ -gulp.task('package-json', function() { - return gulp.src('./package.json') - .pipe(gulp.dest(`${packageDistribution}`)) +gulp.task('package-json', function(cb) { + const json = Object.assign({}, packageJson); + delete json['scripts']; + if (!fs.existsSync(packageDistribution)) { + fs.mkdirSync(packageDistribution); + } + fs.writeFileSync(`${packageDistribution}/package.json`, + JSON.stringify(json, null, 2)); + cb(); }); /** From 025d087e6a9e81dbc5987e17a7b3441168e64ee8 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 24 Jan 2020 07:49:31 -0800 Subject: [PATCH 017/105] fix: Fixed insertion preview logic. And fixed markers not handling typed statements. (#3526) * Added planned functions. * Added default getConnectionPreviewMethod method. * Moved show preview logic into their new functions. * Fixed default getConnectinPreviewMethod logic. * Reverted to lastConnectionInRow call (for output connections) for behavioral backwards-compat. * Added zelos logic. * Removed unused functions, and added docs. --- core/block_svg.js | 4 +- core/insertion_marker_manager.js | 225 ++++++++++++------------- core/renderers/common/i_path_object.js | 2 +- core/renderers/common/path_object.js | 2 +- core/renderers/common/renderer.js | 73 ++++++-- core/renderers/zelos/path_object.js | 2 +- core/renderers/zelos/renderer.js | 22 ++- 7 files changed, 191 insertions(+), 139 deletions(-) diff --git a/core/block_svg.js b/core/block_svg.js index d42f5018c..491d8ff44 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -1760,8 +1760,8 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() { * @param {boolean} add True if highlighting should be added. * @package */ -Blockly.BlockSvg.prototype.highlightForReplacement = function(add) { - this.pathObject.updateReplacementHighlight(add); +Blockly.BlockSvg.prototype.fadeForReplacement = function(add) { + this.pathObject.updateReplacementFade(add); }; /** diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 92860e643..8a5a5f6b9 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -116,20 +116,19 @@ Blockly.InsertionMarkerManager = function(block) { this.markerConnection_ = null; /** - * Whether we are currently highlighting the block (shadow or real) that would - * be replaced if the drag were released immediately. - * @type {boolean} - * @private - */ - this.highlightingBlock_ = false; - - /** - * The block that is being highlighted for replacement, or null. + * The block that currently has an input being highlighted, or null. * @type {Blockly.BlockSvg} * @private */ this.highlightedBlock_ = null; + /** + * The block being faded to indicate replacement, or null. + * @type {Blockly.BlockSvg} + * @private + */ + this.fadedBlock_ = null; + /** * The connections on the dragging blocks that are available to connect to * other blocks. This includes all open connections on the top block, as well @@ -141,6 +140,17 @@ Blockly.InsertionMarkerManager = function(block) { this.availableConnections_ = this.initAvailableConnections_(); }; +/** + * An enum describing different kinds of previews the InsertionMarkerManager + * could display. + * @enum {number} + */ +Blockly.InsertionMarkerManager.PREVIEW_TYPE = { + INSERTION_MARKER: 0, + INPUT_OUTLINE: 1, + REPLACEMENT_FADE: 2, +}; + /** * Sever all links from this object. * @package @@ -210,7 +220,7 @@ Blockly.InsertionMarkerManager.prototype.applyConnections = function() { }; /** - * Update highlighted connections based on the most recent move location. + * Update connections based on the most recent move location. * @param {!Blockly.utils.Coordinate} dxy Position relative to drag start, * in workspace units. * @param {?number} deleteArea One of {@link Blockly.DELETE_AREA_TRASH}, @@ -394,48 +404,6 @@ Blockly.InsertionMarkerManager.prototype.getStartRadius_ = function() { return Blockly.SNAP_RADIUS; }; -/** - * Whether ending the drag would replace a block or insert a block. - * @return {boolean} True if dropping the block immediately would replace - * another block. False if dropping the block immediately would result in - * the block being inserted in a block stack. - * @private - */ -Blockly.InsertionMarkerManager.prototype.shouldReplace_ = function() { - var closest = this.closestConnection_; - var local = this.localConnection_; - - // Dragging a block over an existing block in an input. - if (local.type == Blockly.OUTPUT_VALUE) { - // Insert the dragged block into the stack if possible. - if (closest && - this.workspace_.getRenderer() - .shouldInsertDraggedBlock(this.topBlock_, closest)) { - return false; // Insert. - } - // Otherwise replace the existing block and bump it out. - return true; // Replace. - } - - // Connecting to a statement input of c-block is an insertion, even if that - // c-block is terminal (e.g. forever). - if (local == local.getSourceBlock().getFirstStatementConnection()) { - return false; // Insert. - } - - // Dragging a terminal block over another (connected) terminal block will - // replace, not insert. - var isTerminalBlock = !this.topBlock_.nextConnection; - var isConnectedTerminal = isTerminalBlock && - local.type == Blockly.PREVIOUS_STATEMENT && closest.isConnected(); - if (isConnectedTerminal) { - return true; // Replace. - } - - // Otherwise it's an insertion. - return false; -}; - /** * Whether ending the drag would delete the block. * @param {!Object} candidate An object containing a local connection, a closest @@ -498,16 +466,28 @@ Blockly.InsertionMarkerManager.prototype.maybeShowPreview_ = function(candidate) * @private */ Blockly.InsertionMarkerManager.prototype.showPreview_ = function() { - if (this.shouldReplace_()) { - this.highlightBlock_(); - } else { // Should insert - this.connectMarker_(); + var closest = this.closestConnection_; + var renderer = this.workspace_.getRenderer(); + var method = renderer.getConnectionPreviewMethod( + /** @type {!Blockly.RenderedConnection} */ (closest), + /** @type {!Blockly.RenderedConnection} */ (this.localConnection_), + this.topBlock_); + + switch (method) { + case Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE: + this.showInsertionInputOutline_(); + break; + case Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER: + this.showInsertionMarker_(); + break; + case Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE: + this.showReplacementFade_(); + break; } - // Also highlight the actual connection, as a nod to previous behaviour. - if (this.closestConnection_ && this.closestConnection_.targetBlock() && - this.workspace_.getRenderer() - .shouldHighlightConnection(this.closestConnection_)) { - this.closestConnection_.highlight(); + + // Optionally highlight the actual connection, as a nod to previous behaviour. + if (closest && renderer.shouldHighlightConnection(closest)) { + closest.highlight(); } }; @@ -555,53 +535,57 @@ Blockly.InsertionMarkerManager.prototype.hidePreview_ = function() { .shouldHighlightConnection(this.closestConnection_)) { this.closestConnection_.unhighlight(); } - if (this.highlightingBlock_) { - this.unhighlightBlock_(); + if (this.fadedBlock_) { + this.hideReplacementFade_(); + } else if (this.highlightedBlock_) { + this.hideInsertionInputOutline_(); } else if (this.markerConnection_) { - this.disconnectMarker_(); + this.hideInsertionMarker_(); } }; /** - * Add highlighting showing which block will be replaced. + * Shows an insertion marker connected to the appropriate blocks (based on + * manager state). * @private */ -Blockly.InsertionMarkerManager.prototype.highlightBlock_ = function() { - var closest = this.closestConnection_; +Blockly.InsertionMarkerManager.prototype.showInsertionMarker_ = function() { var local = this.localConnection_; - if (closest.targetBlock()) { - this.highlightedBlock_ = closest.targetBlock(); - closest.targetBlock().highlightForReplacement(true); - } else if (local.type == Blockly.OUTPUT_VALUE) { - this.highlightedBlock_ = closest.getSourceBlock(); - closest.getSourceBlock().highlightShapeForInput(closest, true); - } - this.highlightingBlock_ = true; -}; - -/** - * Get rid of the highlighting marking the block that will be replaced. - * @private - */ -Blockly.InsertionMarkerManager.prototype.unhighlightBlock_ = function() { var closest = this.closestConnection_; - // If there's no block in place, but we're still connecting to a value input, - // then we must have been highlighting an input shape. - if (closest.type == Blockly.INPUT_VALUE && !closest.isConnected()) { - this.highlightedBlock_.highlightShapeForInput(closest, false); - } else { - this.highlightedBlock_.highlightForReplacement(false); + + var isLastInStack = this.lastOnStack_ && local == this.lastOnStack_; + var imBlock = isLastInStack ? this.lastMarker_ : this.firstMarker_; + var imConn = imBlock.getMatchingConnection(local.getSourceBlock(), local); + + if (imConn == this.markerConnection_) { + throw Error('Made it to showInsertionMarker_ even though the marker isn\'t ' + + 'changing'); } - this.highlightedBlock_ = null; - this.highlightingBlock_ = false; + + // Render disconnected from everything else so that we have a valid + // connection location. + imBlock.render(); + imBlock.rendered = true; + imBlock.getSvgRoot().setAttribute('visibility', 'visible'); + + if (imConn && closest) { + // Position so that the existing block doesn't move. + imBlock.positionNearConnection(imConn, closest); + } + if (closest) { + // Connect() also renders the insertion marker. + imConn.connect(closest); + } + + this.markerConnection_ = imConn; }; /** - * Disconnect the insertion marker block in a manner that returns the stack to - * original state. + * Disconnects and hides the current insertion marker. Should return the blocks + * to their original state. * @private */ -Blockly.InsertionMarkerManager.prototype.disconnectMarker_ = function() { +Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() { if (!this.markerConnection_) { console.log('No insertion marker connection to disconnect'); return; @@ -649,38 +633,41 @@ Blockly.InsertionMarkerManager.prototype.disconnectMarker_ = function() { }; /** - * Add an insertion marker connected to the appropriate blocks. + * Shows an outline around the input the closest connection belongs to. * @private */ -Blockly.InsertionMarkerManager.prototype.connectMarker_ = function() { - var local = this.localConnection_; +Blockly.InsertionMarkerManager.prototype.showInsertionInputOutline_ = function() { var closest = this.closestConnection_; + this.highlightedBlock_ = closest.getSourceBlock(); + this.highlightedBlock_.highlightShapeForInput(closest, true); +}; - var isLastInStack = this.lastOnStack_ && local == this.lastOnStack_; - var imBlock = isLastInStack ? this.lastMarker_ : this.firstMarker_; - var imConn = imBlock.getMatchingConnection(local.getSourceBlock(), local); +/** + * Hides any visible input outlines. + * @private + */ +Blockly.InsertionMarkerManager.prototype.hideInsertionInputOutline_ = function() { + this.highlightedBlock_.highlightShapeForInput(this.closestConnection_, false); + this.highlightedBlock_ = null; +}; - if (imConn == this.markerConnection_) { - throw Error('Made it to connectMarker_ even though the marker isn\'t ' + - 'changing'); - } +/** + * Shows a replacement fade affect on the closest connection's target block + * (the block that is currently connected to it). + * @private + */ +Blockly.InsertionMarkerManager.prototype.showReplacementFade_ = function() { + this.fadedBlock_ = this.closestConnection_.targetBlock(); + this.fadedBlock_.fadeForReplacement(true); +}; - // Render disconnected from everything else so that we have a valid - // connection location. - imBlock.render(); - imBlock.rendered = true; - imBlock.getSvgRoot().setAttribute('visibility', 'visible'); - - if (imConn && closest) { - // Position so that the existing block doesn't move. - imBlock.positionNearConnection(imConn, closest); - } - if (closest) { - // Connect() also renders the insertion marker. - imConn.connect(closest); - } - - this.markerConnection_ = imConn; +/** + * Hides/Removes any visible fade affects. + * @private + */ +Blockly.InsertionMarkerManager.prototype.hideReplacementFade_ = function() { + this.fadedBlock_.fadeForReplacement(false); + this.fadedBlock_ = null; }; /** diff --git a/core/renderers/common/i_path_object.js b/core/renderers/common/i_path_object.js index 12454e41d..4680ca83a 100644 --- a/core/renderers/common/i_path_object.js +++ b/core/renderers/common/i_path_object.js @@ -127,4 +127,4 @@ Blockly.blockRendering.IPathObject.prototype.updateMovable; * @param {boolean} enable True if styling should be added. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateReplacementHighlight; +Blockly.blockRendering.IPathObject.prototype.updateReplacementFade; diff --git a/core/renderers/common/path_object.js b/core/renderers/common/path_object.js index c52996638..bb926115d 100644 --- a/core/renderers/common/path_object.js +++ b/core/renderers/common/path_object.js @@ -268,7 +268,7 @@ Blockly.blockRendering.PathObject.prototype.updateMovable = function(enable) { * @param {boolean} enable True if styling should be added. * @package */ -Blockly.blockRendering.PathObject.prototype.updateReplacementHighlight = +Blockly.blockRendering.PathObject.prototype.updateReplacementFade = function(enable) { /* eslint-disable indent */ this.setClass_('blocklyReplaceable', enable); diff --git a/core/renderers/common/renderer.js b/core/renderers/common/renderer.js index 3ec261e2a..9c3df5bf5 100644 --- a/core/renderers/common/renderer.js +++ b/core/renderers/common/renderer.js @@ -29,6 +29,7 @@ goog.require('Blockly.blockRendering.Drawer'); goog.require('Blockly.blockRendering.IPathObject'); goog.require('Blockly.blockRendering.PathObject'); goog.require('Blockly.blockRendering.RenderInfo'); +goog.require('Blockly.InsertionMarkerManager'); goog.requireType('Blockly.blockRendering.Debug'); @@ -163,19 +164,69 @@ Blockly.blockRendering.Renderer.prototype.shouldHighlightConnection = }; /* eslint-enable indent */ /** - * Determine whether or not to insert a dragged block into a stack. - * @param {!Blockly.Block} block The target block. - * @param {!Blockly.Connection} conn The closest connection. - * @return {boolean} True if we should insert the dragged block into the stack. + * Checks if an orphaned block can connect to the "end" of the topBlock's + * block-clump. If the clump is a row the end is the last input. If the clump + * is a stack, the end is the last next connection. If the clump is neither, + * then this returns false. + * @param {!Blockly.BlockSvg} topBlock The top block of the block clump we want to try and + * connect to. + * @param {!Blockly.BlockSvg} orphanBlock The orphan block that wants to find + * a home. + * @param {number} localType The type of the connection being dragged. + * @return {boolean} Whether there is a home for the orphan or not. * @package */ -Blockly.blockRendering.Renderer.prototype.shouldInsertDraggedBlock = - function(block, conn) { - /* eslint-disable indent */ - return !conn.isConnected() || - !!Blockly.Connection.lastConnectionInRow(block, - conn.targetConnection.getSourceBlock()); -}; /* eslint-enable indent */ +Blockly.blockRendering.Renderer.prototype.orphanCanConnectAtEnd = + function(topBlock, orphanBlock, localType) { + var orphanConnection = null; + var lastConnection = null; + if (localType == Blockly.OUTPUT_VALUE) { // We are replacing an output. + orphanConnection = orphanBlock.outputConnection; + // TODO: I don't think this function necessarily has the correct logic, + // but for now it is being kept for behavioral backwards-compat. + lastConnection = Blockly.Connection + .lastConnectionInRow( + /** @type {!Blockly.Block} **/ (topBlock), orphanBlock); + } else { // We are replacing a previous. + orphanConnection = orphanBlock.previousConnection; + // TODO: This lives on the block while lastConnectionInRow lives on + // on the connection. Something is fishy. + lastConnection = topBlock.lastConnectionInStack(); + } + + if (!lastConnection) { + return false; + } + return orphanConnection.checkType(lastConnection); + }; + +/** + * Chooses a connection preview method based on the available connection, the + * current dragged connection, and the block being dragged. + * @param {!Blockly.RenderedConnection} closest The available connection. + * @param {!Blockly.RenderedConnection} local The connection currently being + * dragged. + * @param {!Blockly.BlockSvg} topBlock The block currently being dragged. + * @return {!Blockly.InsertionMarkerManager.PREVIEW_TYPE} The preview type + * to display. + * @package + */ +Blockly.blockRendering.Renderer.prototype.getConnectionPreviewMethod = + function(closest, local, topBlock) { + if (local.type == Blockly.OUTPUT_VALUE || + local.type == Blockly.PREVIOUS_STATEMENT) { + if (!closest.isConnected() || + this.orphanCanConnectAtEnd( + topBlock, + /** @type {!Blockly.BlockSvg} */ (closest.targetBlock()), + local.type)) { + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER; + } + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; + } + + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER; + }; /** * Render the block. diff --git a/core/renderers/zelos/path_object.js b/core/renderers/zelos/path_object.js index c3b64a1bb..4a84cb63a 100644 --- a/core/renderers/zelos/path_object.js +++ b/core/renderers/zelos/path_object.js @@ -149,7 +149,7 @@ Blockly.zelos.PathObject.prototype.updateSelected = function(enable) { /** * @override */ -Blockly.zelos.PathObject.prototype.updateReplacementHighlight = function( +Blockly.zelos.PathObject.prototype.updateReplacementFade = function( enable) { this.setClass_('blocklyReplaceable', enable); if (enable) { diff --git a/core/renderers/zelos/renderer.js b/core/renderers/zelos/renderer.js index 5f805baf8..9e33753c5 100644 --- a/core/renderers/zelos/renderer.js +++ b/core/renderers/zelos/renderer.js @@ -25,6 +25,7 @@ goog.provide('Blockly.zelos.Renderer'); goog.require('Blockly.blockRendering'); goog.require('Blockly.blockRendering.Renderer'); +goog.require('Blockly.InsertionMarkerManager'); goog.require('Blockly.utils.object'); goog.require('Blockly.zelos.ConstantProvider'); goog.require('Blockly.zelos.Drawer'); @@ -119,9 +120,22 @@ Blockly.zelos.Renderer.prototype.shouldHighlightConnection = function(conn) { /** * @override */ -Blockly.zelos.Renderer.prototype.shouldInsertDraggedBlock = function(_block, - _conn) { - return false; -}; +Blockly.zelos.Renderer.prototype.getConnectionPreviewMethod = + function(closest, local, topBlock) { + if (local.type == Blockly.OUTPUT_VALUE) { + if (!closest.isConnected()) { + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE; + } + // TODO: Returning this is a total hack, because we don't want to show + // a replacement fade, we want to show an outline affect. + // Sadly zelos does not support showing an outline around filled + // inputs, so we have to pretend like the connected block is getting + // replaced. + return Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE; + } + + return Blockly.zelos.Renderer.superClass_ + .getConnectionPreviewMethod(closest, local, topBlock); + }; Blockly.blockRendering.register('zelos', Blockly.zelos.Renderer); From 8475976103f39f37be5223a99cafb0d9132d6fe9 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 24 Jan 2020 13:02:27 -0800 Subject: [PATCH 018/105] Fix start hats (#3651) --- core/renderers/common/info.js | 2 +- core/renderers/measurables/rows.js | 2 +- core/renderers/zelos/measurables/rows.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/renderers/common/info.js b/core/renderers/common/info.js index ec63bce6c..0e20b9b24 100644 --- a/core/renderers/common/info.js +++ b/core/renderers/common/info.js @@ -262,7 +262,7 @@ Blockly.blockRendering.RenderInfo.prototype.createRows_ = function() { */ Blockly.blockRendering.RenderInfo.prototype.populateTopRow_ = function() { var hasPrevious = !!this.block_.previousConnection; - var hasHat = (typeof this.block_.hat !== 'undefined' ? + var hasHat = (this.block_.hat ? this.block_.hat === 'cap' : this.constants_.ADD_START_HATS) && !this.outputConnection && !hasPrevious; var leftSquareCorner = this.topRow.hasLeftSquareCorner(this.block_); diff --git a/core/renderers/measurables/rows.js b/core/renderers/measurables/rows.js index 6a86f3fa4..254b31e95 100644 --- a/core/renderers/measurables/rows.js +++ b/core/renderers/measurables/rows.js @@ -290,7 +290,7 @@ Blockly.utils.object.inherits(Blockly.blockRendering.TopRow, * @return {boolean} Whether or not the top row has a left square corner. */ Blockly.blockRendering.TopRow.prototype.hasLeftSquareCorner = function(block) { - var hasHat = (typeof block.hat !== 'undefined' ? + var hasHat = (block.hat ? block.hat === 'cap' : this.constants_.ADD_START_HATS) && !block.outputConnection && !block.previousConnection; var prevBlock = block.getPreviousBlock(); diff --git a/core/renderers/zelos/measurables/rows.js b/core/renderers/zelos/measurables/rows.js index 64c5836b8..5b025eda2 100644 --- a/core/renderers/zelos/measurables/rows.js +++ b/core/renderers/zelos/measurables/rows.js @@ -62,7 +62,7 @@ Blockly.zelos.TopRow.prototype.endsWithElemSpacer = function() { * @override */ Blockly.zelos.TopRow.prototype.hasLeftSquareCorner = function(block) { - var hasHat = (typeof block.hat !== 'undefined' ? + var hasHat = (block.hat ? block.hat === 'cap' : this.constants_.ADD_START_HATS) && !block.outputConnection && !block.previousConnection; return !!block.outputConnection || hasHat; From e2b510662cf60e4dba1e228f3b83549ea694e951 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Fri, 24 Jan 2020 15:10:22 -0800 Subject: [PATCH 019/105] Fixing typo on "programmatically". (#3654) --- blocks/procedures.js | 2 +- core/field.js | 4 ++-- core/field_angle.js | 2 +- core/field_dropdown.js | 2 +- core/field_textinput.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blocks/procedures.js b/blocks/procedures.js index bd1d0179c..cdca990d6 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -898,7 +898,7 @@ Blockly.Blocks['procedures_callnoreturn'] = { // in most cases the old group should be '' var oldGroup = Blockly.Events.getGroup(); if (oldGroup) { - // This should only be possible programatically and may indicate a problem + // This should only be possible programmatically and may indicate a problem // with event grouping. If you see this message please investigate. If the // use ends up being valid we may need to reorder events in the undo stack. console.log('Saw an existing group while responding to a definition change'); diff --git a/core/field.js b/core/field.js index 09507898d..7d0007f62 100644 --- a/core/field.js +++ b/core/field.js @@ -205,7 +205,7 @@ Blockly.Field.prototype.getText_; * clicked. Blockly will automatically set the field as clickable if this * method is defined. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @return {void} * @protected */ @@ -605,7 +605,7 @@ Blockly.Field.prototype.render_ = function() { /** * Show an editor when the field is clicked only if the field is clickable. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @package */ Blockly.Field.prototype.showEditor = function(opt_e) { diff --git a/core/field_angle.js b/core/field_angle.js index 131adce28..8220c274a 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -257,7 +257,7 @@ Blockly.FieldAngle.prototype.render_ = function() { /** * Create and show the angle field's editor. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @private */ Blockly.FieldAngle.prototype.showEditor_ = function(opt_e) { diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 4a42c3429..3b3bc8b6a 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -268,7 +268,7 @@ Blockly.FieldDropdown.prototype.createSVGArrow_ = function() { /** * Create a dropdown menu under the text. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @private */ Blockly.FieldDropdown.prototype.showEditor_ = function(opt_e) { diff --git a/core/field_textinput.js b/core/field_textinput.js index 69b20bc54..b485de13b 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -279,7 +279,7 @@ Blockly.FieldTextInput.prototype.setSpellcheck = function(check) { /** * Show the inline free-text editor on top of the text. * @param {Event=} _opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @param {boolean=} opt_quietInput True if editor should be created without * focus. Defaults to false. * @protected From a03ded59f78828f9c471908c323129e8d48a0cef Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 27 Jan 2020 17:36:01 +0100 Subject: [PATCH 020/105] Localisation updates from https://translatewiki.net. --- msg/json/kn.json | 123 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 msg/json/kn.json diff --git a/msg/json/kn.json b/msg/json/kn.json new file mode 100644 index 000000000..80c01985d --- /dev/null +++ b/msg/json/kn.json @@ -0,0 +1,123 @@ +{ + "@metadata": { + "authors": [ + "Ananth subray", + "Nayvik", + "Niekiran", + "VASANTH S.N." + ] + }, + "VARIABLES_DEFAULT_NAME": "ವಸ್ತು", + "TODAY": "ಇಂದು", + "DUPLICATE_BLOCK": "ನಕಲಿಸು", + "ADD_COMMENT": "ಟಿಪ್ಪಣಿ ಸೇರಿಸು", + "REMOVE_COMMENT": "ಟಿಪ್ಪಣಿ ಅಳಿಸು", + "DUPLICATE_COMMENT": "ಟಿಪ್ಪಣಿ ನಕಲಿಸು", + "EXTERNAL_INPUTS": "ಬಾಹ್ಯ ಒಳಾಂಶಗಳು", + "INLINE_INPUTS": "ಇನ್ಲೈನ್ ಒಳಾಂಶಗಳು", + "DELETE_BLOCK": "ಬ್ಲಾಕ್ ಅಳಿಸು", + "DELETE_X_BLOCKS": "%1 ಬ್ಲಾಕ್‍ಗಳನ್ನು ಅಳಿಸು", + "DELETE_ALL_BLOCKS": "ಎಲ್ಲ %1 ಬ್ಲಾಕ್‍ಗಳನ್ನು ಅಳಿಸುವುದೇ ?", + "CLEAN_UP": "ಬ್ಲಾಕ್‍ಗಳನ್ನು ಸ್ವಚ್ಛಗೊಳಿಸು", + "COLLAPSE_BLOCK": "ಬ್ಲಾಕ್ ಮುಚ್ಚು", + "COLLAPSE_ALL": "ಬ್ಲಾಕ್‍ಗಳನ್ನು ಮುಚ್ಚು", + "EXPAND_BLOCK": "ಬ್ಲಾಕ್ ವಿಸ್ತರಿಸು", + "EXPAND_ALL": "ಬ್ಲಾಕ್‍ಗಳನ್ನು ವಿಸ್ತರಿಸು", + "DISABLE_BLOCK": "ಬ್ಲಾಕ್ ನಿಷ್ಕ್ರಿಯಗೊಳಿಸು", + "ENABLE_BLOCK": "ಬ್ಲಾಕ್ ಸಕ್ರಿಯಗೊಳಿಸು", + "HELP": "ಸಹಾಯ", + "UNDO": "ಹಿಂದಿದ್ದ ಸ್ಥಿತಿಗೆ ಮರಳಿಸು", + "REDO": "ಮುಂದಿದ್ದ ಸ್ಥಿತಿಗೆ ಮರಳಿಸು", + "CHANGE_VALUE_TITLE": "ಮೌಲ್ಯ ಬದಲಾಯಿಸು:", + "RENAME_VARIABLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಮರುಹೆಸರಿಸು...", + "RENAME_VARIABLE_TITLE": "ಎಲ್ಲ '%1' ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶಗಳನ್ನು ಮರುಹೆಸರಿಸು:", + "NEW_VARIABLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಸೃಷ್ಟಿಸು ...", + "NEW_STRING_VARIABLE": "ಅಕ್ಷರ ಮಾಲೆ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಸೃಷ್ಟಿಸು...", + "NEW_NUMBER_VARIABLE": "ಸಂಖ್ಯೆ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಸೃಷ್ಟಿಸು ...", + "NEW_COLOUR_VARIABLE": "ಬಣ್ಣ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಸೃಷ್ಟಿಸು ...", + "NEW_VARIABLE_TYPE_TITLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಬಗೆ:", + "NEW_VARIABLE_TITLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರು:", + "VARIABLE_ALREADY_EXISTS": "'%1' ಎನ್ನುವ ಹೆಸರಿನ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಈಗಾಗಲೇ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ.", + "VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE": "'%1' ಎನ್ನುವ ಹೆಸರಿನ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಈಗಾಗಲೇ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ.", + "COLOUR_PICKER_HELPURL": "https://en.wikipedia.org/wiki/Color", + "COLOUR_PICKER_TOOLTIP": "ಪೆಲೆಟ್‍ನಿಂದ ಒಂದು ಬಣ್ಣವನ್ನು ಆರಿಸಿ.", + "COLOUR_RANDOM_TITLE": "ಯಾವುದೊ ಒಂದು ಬಣ್ಣ", + "COLOUR_RANDOM_TOOLTIP": "ಯಾವುದೋ ಒಂದು ಬಣ್ಣವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.", + "COLOUR_RGB_TITLE": "ಬಣ್ಣದ", + "COLOUR_RGB_RED": "ಕೆಂಪು", + "COLOUR_RGB_GREEN": "ಹಸಿರು", + "COLOUR_RGB_BLUE": "ನೀಲಿ", + "COLOUR_BLEND_TITLE": "ಮಿಶ್ರಣ ಮಾಡು", + "COLOUR_BLEND_COLOUR1": "ಬಣ್ಣ ೧", + "COLOUR_BLEND_COLOUR2": "ಬಣ್ಣ ೨", + "COLOUR_BLEND_RATIO": "ಅನುಪಾತ", + "COLOUR_BLEND_TOOLTIP": "ಕೊಟ್ಟಿರುವ ಅನುಪಾತದ (0.0 - 1.0) ಪ್ರಕಾರ ಎರಡು ಬಣ್ಣವನ್ನು ಮಿಶ್ರಣ ಮಾಡುತ್ತದೆ.", + "CONTROLS_REPEAT_HELPURL": "https://en.wikipedia.org/wiki/For_loop", + "CONTROLS_REPEAT_TITLE": "%1 ಬಾರಿ ಪುನರಾವರ್ತಿಸು", + "CONTROLS_REPEAT_INPUT_DO": "ಮಾಡು", + "CONTROLS_REPEAT_TOOLTIP": "ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಹಲವಾರು ಬಾರಿ ಮಾಡಿ.", + "CONTROLS_WHILEUNTIL_OPERATOR_WHILE": "ಪುನರಾವರ್ತಿಸು ಇ ಸಮಯದಲ್ಲಿ", + "CONTROLS_WHILEUNTIL_OPERATOR_UNTIL": "ಪುನರಾವರ್ತಿಸು ಇ ತನಕ", + "CONTROLS_WHILEUNTIL_TOOLTIP_WHILE": "ಮೌಲ್ಯವು ನಿಜವಾಗಿರುವ ಸಮಯದಲ್ಲಿ, ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡಿ.", + "CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL": "ಮೌಲ್ಯವು ಸುಳ್ಳಾಗಿರುವ ಸಮಯದಲ್ಲಿ, ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡಿ.", + "CONTROLS_FOR_TOOLTIP": "'%1' ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶವು ಆರಂಭದ ಸಂಖ್ಯೆಯಿಂದ ಕೊನೆಯ ಸಂಖ್ಯೆಯ ತನಕ ಒಂದು ಮೌಲ್ಯವನ್ನು ಹೊಂದಿರಲಿ, ನಿಗದಿತ ಪ್ರಮಾಣದಲ್ಲಿ ಎಣಿಸುವುದನ್ನು ನಿರ್ಧರಿಸಿ, ನಿಗದಿಪಡಿಸಿದ ಬ್ಲಾಕ್‍ಗಳನ್ನು ಮಾಡಿ.", + "CONTROLS_FOR_TITLE": "%1 ಜೊತೆ ಎಣಿಸು %2 ಇಂದ %3 ತನಕ %4 ಪ್ರಮಾಣದಲ್ಲಿ", + "CONTROLS_FOREACH_TITLE": "ಪ್ರತಿ ವಸ್ತುವಿಗೆ %1 ಇ ಪಟ್ಟಿಯಲ್ಲಿ %2", + "CONTROLS_FOREACH_TOOLTIP": "ಪಟ್ಟಿಯಲ್ಲಿರುವ ಪ್ರತಿ ವಸ್ತುವಿಗೆ, ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ '%1' ಅನ್ನು ವಸ್ತುವಿನೊಂದಿಗೆ ಹೊಂದಿಸಿ , ಆಮೇಲೆ ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡಿ.", + "CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK": "ಸುತ್ತುವಿಕೆಯಿಂದ ಹೊರ ಬಾ", + "CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE": "ಸುತ್ತುವಿಕೆಯ ಮುಂದಿನ ಪುನರಾವರ್ತನೆಯೊಂದಿಗೆ ಮುಂದುವರಿಯಿರಿ", + "CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK": "ಒಳಗೊಂಡಿರುವ ಸುತ್ತುವಿಕೆಯಿಂದ ಹೊರಬನ್ನಿ.", + "CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE": "ಉಳಿದ ಸುತ್ತುವಿಕೆ ಬಿಟ್ಟು ಮುಂದೆ ಹೋಗಿ, ಮತ್ತು ಮುಂದಿನ ಪುನರಾವರ್ತನೆಯೊಂದಿಗೆ ಮುಂದುವರಿಯಿರಿ.", + "CONTROLS_FLOW_STATEMENTS_WARNING": "ಎಚ್ಚರಿಕೆ: ಈ ಬ್ಲಾಕ್ ಅನ್ನು ಸುತ್ತುವಿಕೆ ಒಳಗಡೆ ಮಾತ್ರ ಬಳಸಬಹುದಾಗಿದೆ.", + "CONTROLS_IF_TOOLTIP_1": "ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ , ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", + "CONTROLS_IF_TOOLTIP_2": "ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ, ಮೊದಲನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು, ಇಲ್ಲವಾದರೆ, ಎರಡನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", + "CONTROLS_IF_TOOLTIP_3": "ಮೊದಲನೆಯ ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ, ಮೊದಲ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು. ಇಲ್ಲವಾದರೆ, ಎರಡನೇ ಮೌಲ್ಯವು ನಿಜವಾಗಿದ್ದರೆ, ಎರಡನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", + "CONTROLS_IF_TOOLTIP_4": "ಮೊದಲನೆಯ ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ, ಮೊದಲ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು. ಇಲ್ಲವಾದರೆ, ಎರಡನೇ ಮೌಲ್ಯವು ನಿಜವಾಗಿದ್ದರೆ, ಎರಡನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು. ಒಂದುವೇಳೆ ಯಾವುದೇ ಮೌಲ್ಯವು ನಿಜವಾಗಿರದಿದ್ದರೆ, ಕೊನೆಯ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", + "CONTROLS_IF_MSG_IF": "ಆಗಿದ್ದರೆ", + "CONTROLS_IF_MSG_ELSEIF": "ಆಗಿರದಿದ್ದರೆ ಆಗಿದ್ದರೆ", + "CONTROLS_IF_MSG_ELSE": "ಆಗಿರದಿದ್ದರೆ", + "CONTROLS_IF_IF_TOOLTIP": "ಆಗಿದ್ದರೆ ಬ್ಲಾಕ್ ಅನ್ನು ಮರುವಿನ್ಯಾಸ ಗೊಳಿಸಲು ಅದರ ಭಾಗಗಳನ್ನು ಸೇರಿಸು, ತೆಗೆ, ಅಥವಾ ಮರುಕ್ರಮಗೊಳಿಸು.", + "CONTROLS_IF_ELSEIF_TOOLTIP": "'ಆಗಿದ್ದರೆ' ಬ್ಲಾಕ್ ಗೆ ಒಂದು ನಿಯಮವನ್ನು ಸೇರಿಸು.", + "CONTROLS_IF_ELSE_TOOLTIP": "ಕೊನೆಯ, ಎಲ್ಲ-ಹಿಡಿ ನಿಯಮವನ್ನು 'ಆಗಿದ್ದರೆ' ಬ್ಲಾಕ್ ಗೆ ಸೇರಿಸು.", + "IOS_OK": "ಸರಿ", + "IOS_CANCEL": "ರದ್ದುಮಾಡು", + "IOS_ERROR": "ತಪ್ಪು", + "IOS_PROCEDURES_INPUTS": "ಒಳಾಂಶಗಳು", + "IOS_PROCEDURES_ADD_INPUT": "+ ಒಳಾಂಶವನ್ನು ಸೇರಿಸು", + "IOS_PROCEDURES_ALLOW_STATEMENTS": "ಹೇಳಿಕೆಗಳನ್ನು ಅನುಮತಿಸಿ", + "IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR": "ಈ ಕೆಲಸವು ನಕಲಿ ಒಳಾಂಶಗಳನ್ನು ಒಳಗೊಂಡಿರುತ್ತದೆ.", + "IOS_VARIABLES_ADD_VARIABLE": "+ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶವನ್ನು ಸೇರಿಸು", + "IOS_VARIABLES_ADD_BUTTON": "ಸೇರಿಸು", + "IOS_VARIABLES_RENAME_BUTTON": "ಹೆಸರು ಬದಲಾಯಿಸು", + "IOS_VARIABLES_DELETE_BUTTON": "ಅಳಿಸು", + "IOS_VARIABLES_VARIABLE_NAME": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರು", + "IOS_VARIABLES_EMPTY_NAME_ERROR": "ನೀವು ಖಾಲಿ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರನ್ನು ಬಳಸಲು ಬರುವುದಿಲ್ಲ.", + "LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)", + "LOGIC_OPERATION_AND": "ಮತ್ತು", + "LOGIC_OPERATION_OR": "ಅಥವಾ", + "LOGIC_BOOLEAN_TRUE": "ನಿಜ", + "LOGIC_BOOLEAN_FALSE": "ತಪ್ಪು", + "LOGIC_NULL": "ಶೂನ್ಯ", + "LOGIC_TERNARY_CONDITION": "ಟೆಸ್ಟ್", + "MATH_NUMBER_TOOLTIP": "ಹಲವಾರು", + "MATH_SINGLE_OP_ROOT": "ವರ್ಗಮೂಲ", + "MATH_SINGLE_TOOLTIP_ROOT": "ಸಂಖ್ಯೆಯ ವರ್ಗಮೂಲ ಮರಳಿಸು.", + "MATH_SINGLE_OP_ABSOLUTE": "ಸಂಪೂರ್ಣ", + "MATH_SINGLE_TOOLTIP_ABS": "ಸಂಖ್ಯೆಯ ಪರಿಪೂರ್ಣ ಮೌಲ್ಯ ಮರಳಿಸು", + "MATH_ROUND_OPERATOR_ROUND": "ಸುತ್ತು", + "MATH_RANDOM_INT_HELPURL": "https://en.wikipedia.org/wiki/Random_number_generation", + "MATH_RANDOM_FLOAT_HELPURL": "https://en.wikipedia.org/wiki/Random_number_generation", + "TEXT_CREATE_JOIN_TITLE_JOIN": "ಸೇರಿಸಿ", + "TEXT_GET_SUBSTRING_INPUT_IN_TEXT": "ಪಠ್ಯದಲ್ಲಿ", + "TEXT_PRINT_TITLE": "ಮುದ್ರಣ %1", + "LISTS_CREATE_WITH_CONTAINER_TITLE_ADD": "ಪಟ್ಟಿ", + "LISTS_INLIST": "ಪಟ್ಟಿಯಲ್ಲಿ", + "LISTS_GET_INDEX_GET": "ಪಡೆಯಲು", + "LISTS_GET_INDEX_GET_REMOVE": "ಪಡೆಯಲು ಮತ್ತು ತೆಗೆಯಲು", + "LISTS_GET_INDEX_REMOVE": "ತೆಗೆ", + "LISTS_GET_INDEX_FROM_END": "ಕೊನೆಯಿಂದ", + "LISTS_GET_INDEX_FIRST": "ಮೊದಲ", + "LISTS_GET_INDEX_LAST": "ಕೊನೆಯ", + "PROCEDURES_BEFORE_PARAMS": "ಜೊತೆ:", + "PROCEDURES_CALL_BEFORE_PARAMS": "ಜೊತೆ:" +} From 6dbb023a1df451fd82d55c6bd4a3574c553948b6 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Mon, 27 Jan 2020 11:19:21 -0800 Subject: [PATCH 021/105] Fixing path typo. (#3663) --- core/options.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/options.js b/core/options.js index cf0d8dba2..ed6a7e89e 100644 --- a/core/options.js +++ b/core/options.js @@ -160,7 +160,8 @@ Blockly.Options = function(options) { /** * Blockly options. - * This interface is further described in `typings/blockly-interfaces.d.ts`. + * This interface is further described in + * `typings/parts/blockly-interfaces.d.ts`. * @interface */ Blockly.BlocklyOptions = function() {}; From 4a94dc8a85b90b61d678977849250ac29eb5d627 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 27 Jan 2020 15:32:12 -0800 Subject: [PATCH 022/105] Unpack self-closing tags when converting domToText (#3665) * Unpack self-closing tags when converting domToText --- core/xml.js | 4 +++- demos/blockfactory/workspacefactory/wfactory_controller.js | 4 ---- tests/jsunit/xml_test.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/xml.js b/core/xml.js index a1a4dd970..86d60b1c3 100644 --- a/core/xml.js +++ b/core/xml.js @@ -303,7 +303,9 @@ Blockly.Xml.domToText = function(dom) { oldText = text; text = text.replace(regexp, '$1 $2'); } while (text != oldText); - return text; + // Unpack self-closing tags. These tags fail when embedded in HTML. + // -> + return text.replace(/<(\w+)([^<]*)\/>/g, '<$1$2>'); }; /** diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index 30f032eae..b3a6ecbbe 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -340,10 +340,6 @@ WorkspaceFactoryController.prototype.exportXmlFile = function(exportMode) { throw Error(msg); } - // Unpack self-closing tags. These tags fail when embedded in HTML. - // -> - configXml = configXml.replace(/<(\w+)([^<]*)\/>/g, '<$1$2>'); - // Download file. var data = new Blob([configXml], {type: 'text/xml'}); this.view.createAndDownloadFile(fileName, data); diff --git a/tests/jsunit/xml_test.js b/tests/jsunit/xml_test.js index afd3dc9c7..2baff16c4 100644 --- a/tests/jsunit/xml_test.js +++ b/tests/jsunit/xml_test.js @@ -29,7 +29,7 @@ var XML_TEXT = ['', ' ', ' item', ' ', - ' ', + ' ', ' ', ' ', ' ', From 513e85bf4a202edb0785755363d7d62cf76b3cd0 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 30 Jan 2020 14:11:47 -0800 Subject: [PATCH 023/105] Checks keyboardAccessibility flag before rendering (#3671) --- core/block_svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/block_svg.js b/core/block_svg.js index 491d8ff44..fce6d3721 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -1672,7 +1672,7 @@ Blockly.BlockSvg.prototype.render = function(opt_bubble) { Blockly.utils.dom.stopTextWidthCache(); var cursor = this.workspace.getCursor(); - if (this.pathObject.cursorSvg_) { + if (Blockly.navigation.keyboardAccessibilityMode && this.pathObject.cursorSvg_) { cursor.draw(); } }; From 97d00015121e4ff33dd9d5b8ea8fc38e51a72167 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 30 Jan 2020 16:04:21 -0800 Subject: [PATCH 024/105] Unhighlight current item when hovering over disabled menu items (#3655) --- core/components/menu/menu.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/components/menu/menu.js b/core/components/menu/menu.js index 40f517469..e4b8c83ea 100644 --- a/core/components/menu/menu.js +++ b/core/components/menu/menu.js @@ -431,6 +431,8 @@ Blockly.Menu.prototype.handleMouseOver_ = function(e) { this.unhighlightCurrent(); this.setHighlighted(menuItem); + } else { + this.unhighlightCurrent(); } } }; From 88ad660c51b8690c49a87d05af0b222711db247c Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 30 Jan 2020 16:05:24 -0800 Subject: [PATCH 025/105] Remove check for same theme when refreshing (#3672) * Remove check for same theme when refreshing --- core/theme.js | 2 -- core/theme_manager.js | 5 ----- 2 files changed, 7 deletions(-) diff --git a/core/theme.js b/core/theme.js index 70aa6fba2..802a91f3a 100644 --- a/core/theme.js +++ b/core/theme.js @@ -51,14 +51,12 @@ Blockly.Theme = function(name, blockStyles, categoryStyles, /** * The block styles map. * @type {!Object.} - * @package */ this.blockStyles = blockStyles; /** * The category styles map. * @type {!Object.} - * @package */ this.categoryStyles = categoryStyles; diff --git a/core/theme_manager.js b/core/theme_manager.js index 48003911e..23d011adc 100644 --- a/core/theme_manager.js +++ b/core/theme_manager.js @@ -90,11 +90,6 @@ Blockly.ThemeManager.prototype.getTheme = function() { * @package */ Blockly.ThemeManager.prototype.setTheme = function(theme) { - if (this.theme_ === theme) { - // No change. - return; - } - var prevTheme = this.theme_; this.theme_ = theme; From 0bc8960d792a1cbfe42ddd547c173528495186ab Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 30 Jan 2020 17:05:00 -0800 Subject: [PATCH 026/105] Update list and text create block to right align its value inputs (#3667) --- blocks/lists.js | 3 ++- blocks/text.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blocks/lists.js b/blocks/lists.js index 2e123341d..c99f281ae 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -237,7 +237,8 @@ Blockly.Blocks['lists_create_with'] = { // Add new inputs. for (var i = 0; i < this.itemCount_; i++) { if (!this.getInput('ADD' + i)) { - var input = this.appendValueInput('ADD' + i); + var input = this.appendValueInput('ADD' + i) + .setAlign(Blockly.ALIGN_RIGHT); if (i == 0) { input.appendField(Blockly.Msg['LISTS_CREATE_WITH_INPUT_WITH']); } diff --git a/blocks/text.js b/blocks/text.js index fe4b9c97f..6498c1715 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -784,7 +784,8 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = { // Add new inputs. for (var i = 0; i < this.itemCount_; i++) { if (!this.getInput('ADD' + i)) { - var input = this.appendValueInput('ADD' + i); + var input = this.appendValueInput('ADD' + i) + .setAlign(Blockly.ALIGN_RIGHT); if (i == 0) { input.appendField(Blockly.Msg['TEXT_JOIN_TITLE_CREATEWITH']); } From c02f70362916a6b19d0fe199e5950dd064d25abc Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 31 Jan 2020 13:14:39 -0800 Subject: [PATCH 027/105] Added constants to animation code. --- core/trashcan.js | 67 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/core/trashcan.js b/core/trashcan.js index fde748787..f2ee3bf41 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -154,6 +154,37 @@ Blockly.Trashcan.prototype.SPRITE_TOP_ = 32; */ Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE = 0.1; +/** + * The length of the open/close animation in milliseconds. + * @type {number} + */ +Blockly.Trashcan.ANIMATION_LENGTH = 80; + +/** + * The number of frames in the animation. + * @type {number} + */ +Blockly.Trashcan.ANIMATION_FRAMES = 4; + +/** + * The minimum (resting) opacity of the trashcan and lid. + * @type {number} + */ +Blockly.Trashcan.OPACITY_MIN = 0.4; + +/** + * The maximum (hovered) opacity of the trashcan and lid. + * @type {number} + */ +Blockly.Trashcan.OPACITY_MAX = 0.8; + +/** + * The maximum angle the trashcan lid can opens to. At the end of the open + * animation the lid will be open to this angle. + * @type {number} + */ +Blockly.Trashcan.MAX_LID_ANGLE = 45; + /** * Current open/close state of the lid. * @type {boolean} @@ -389,14 +420,23 @@ Blockly.Trashcan.prototype.setOpen = function(state) { * @private */ Blockly.Trashcan.prototype.animateLid_ = function() { - this.lidOpen_ += this.isOpen ? 0.2 : -0.2; + var frames = Blockly.Trashcan.ANIMATION_FRAMES; + + var delta = 1 / (frames + 1); + this.lidOpen_ += this.isOpen ? delta : -delta; this.lidOpen_ = Math.min(Math.max(this.lidOpen_, this.minOpenness_), 1); - this.setLidAngle_(this.lidOpen_ * 45); - // Linear interpolation between 0.4 and 0.8. - var opacity = 0.4 + this.lidOpen_ * (0.8 - 0.4); + + this.setLidAngle_(this.lidOpen_ * Blockly.Trashcan.MAX_LID_ANGLE); + + var minOpacity = Blockly.Trashcan.OPACITY_MIN; + var maxOpacity = Blockly.Trashcan.OPACITY_MAX; + // Linear interpolation between min and max. + var opacity = minOpacity + this.lidOpen_ * (maxOpacity - minOpacity); this.svgGroup_.style.opacity = opacity; + if (this.lidOpen_ > this.minOpenness_ && this.lidOpen_ < 1) { - this.lidTask_ = setTimeout(this.animateLid_.bind(this), 20); + this.lidTask_ = setTimeout(this.animateLid_.bind(this), + Blockly.Trashcan.ANIMATION_LENGTH / frames); } }; @@ -414,6 +454,20 @@ Blockly.Trashcan.prototype.setLidAngle_ = function(lidAngle) { (this.LID_HEIGHT_ - 2) + ')'); }; +/** + * Sets the minimum openness of the trashcan lid. If the lid is currently + * closed, this will update lid's position. + * @param {number} newMin The new minimum openness of the lid. Should be between + * 0 and 1. + * @private + */ +Blockly.Trashcan.prototype.setMinOpenness_ = function(newMin) { + this.minOpenness_ = newMin; + if (!this.isOpen) { + this.setLidAngle_(newMin * Blockly.Trashcan.MAX_LID_ANGLE); + } +}; + /** * Flip the lid shut. * Called externally after a drag. @@ -479,8 +533,7 @@ Blockly.Trashcan.prototype.onDelete_ = function(event) { this.contents_.pop(); } - this.minOpenness_ = this.HAS_BLOCKS_LID_ANGLE; - this.setLidAngle_(this.minOpenness_ * 45); + this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE); } }; From b0cd8032119c817f955d56e7c415fb9000436751 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 31 Jan 2020 13:15:03 -0800 Subject: [PATCH 028/105] Added empty trashcan function. --- core/trashcan.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/trashcan.js b/core/trashcan.js index f2ee3bf41..1534b92e7 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -347,6 +347,29 @@ Blockly.Trashcan.prototype.dispose = function() { clearTimeout(this.lidTask_); }; +/** + * Returns true if the trashcan contents-flyout is currently open. + * @return {boolean} True if the trashcan contents-flyout is currently open. + */ +Blockly.Trashcan.prototype.contentsIsOpen = function() { + return this.flyout.isVisible(); +}; + +/** + * Empties the trashcan's contents. If the contents-flyout is currently open + * it will be closed. + */ +Blockly.Trashcan.prototype.emptyContents = function() { + if (!this.contents_.length) { + return; + } + this.contents_.length = 0; + this.setMinOpenness_(0); + if (this.contentsIsOpen()) { + this.flyout.hide(); + } +}; + /** * Position the trashcan. * It is positioned in the opposite corner to the corner the From 819ed243c4afb62f78419e5e4d6fd81acd6031c7 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 3 Feb 2020 15:38:27 +0100 Subject: [PATCH 029/105] Localisation updates from https://translatewiki.net. --- msg/json/de.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/msg/json/de.json b/msg/json/de.json index 14e38dbff..cfe5f95a6 100644 --- a/msg/json/de.json +++ b/msg/json/de.json @@ -9,10 +9,12 @@ "Cvanca", "THINK", "Zgtm", - "Sushi" + "Sushi", + "Tiin" ] }, "VARIABLES_DEFAULT_NAME": "Element", + "UNNAMED_KEY": "unbenannt", "TODAY": "Heute", "DUPLICATE_BLOCK": "Kopieren", "ADD_COMMENT": "Kommentar hinzufügen", From 85641fd1fbc9631f9b68f7fb455ac90801d512c9 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 3 Feb 2020 14:33:59 -0800 Subject: [PATCH 030/105] =?UTF-8?q?=E2=80=98Upgrade=E2=80=99=20from=20Pyth?= =?UTF-8?q?on=202.7=20to=20Python=203.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python is a non-issue. But App Engine took the opportunity to change everything. --- appengine/.gcloudignore | 23 ++++++++++++ appengine/app.yaml | 54 +++++---------------------- appengine/deploy | 16 ++++++++ appengine/index_redirect.py | 3 -- appengine/main.py | 43 ++++++++++++++++++++++ appengine/requirements.txt | 1 + appengine/storage.py | 73 ++++++++++++++++++++----------------- 7 files changed, 132 insertions(+), 81 deletions(-) create mode 100644 appengine/.gcloudignore create mode 100755 appengine/deploy delete mode 100644 appengine/index_redirect.py create mode 100644 appengine/main.py create mode 100644 appengine/requirements.txt diff --git a/appengine/.gcloudignore b/appengine/.gcloudignore new file mode 100644 index 000000000..83d812a47 --- /dev/null +++ b/appengine/.gcloudignore @@ -0,0 +1,23 @@ +# Do not upload these files. +.* +deploy +*.soy +static/appengine/ +static/closure/ +static/demos/plane/soy/*.jar +static/demos/plane/xlf/ +static/externs/ +static/i18n/ +static/msg/json/ +static/node_modules/ +static/package/ +static/theme_scripts/ +static/typings/ + +static/build.py +static/gulpfile.js +static/jsconfig.json +static/LICENSE +static/package-lock.json +static/package.json +static/README.md diff --git a/appengine/app.yaml b/appengine/app.yaml index 3cb448844..2fd93c494 100644 --- a/appengine/app.yaml +++ b/appengine/app.yaml @@ -1,8 +1,4 @@ -application: blockly-demo -version: 20200123 -runtime: python27 -api_version: 1 -threadsafe: no +runtime: python37 handlers: # Redirect obsolete URLs. @@ -19,29 +15,15 @@ handlers: static_files: redirect.html upload: redirect.html - -# Storage API. -- url: /storage - script: storage.py - secure: always -- url: /storage\.js - static_files: storage.js - upload: storage\.js - secure: always - # Blockly files. - url: /static static_dir: static secure: always -# Closure library for uncompressed Blockly. -- url: /closure-library - static_dir: closure-library - secure: always - -# Redirect for root directory. -- url: / - script: index_redirect.py +# Storage API. +- url: /storage\.js + static_files: storage.js + upload: storage\.js secure: always # Favicon. @@ -64,24 +46,8 @@ handlers: upload: robots\.txt secure: always - -skip_files: -# App Engine default patterns. -- ^(.*/)?#.*#$ -- ^(.*/)?.*~$ -- ^(.*/)?.*\.py[co]$ -- ^(.*/)?.*/RCS/.*$ -- ^(.*/)?\..*$ -# Custom skip patterns. -- ^static/appengine/.*$ -- ^static/demos/plane/soy/.+\.jar$ -- ^static/demos/plane/template.soy$ -- ^static/demos/plane/xlf/.*$ -- ^static/i18n/.*$ -- ^static/msg/json/.*$ -- ^.+\.soy$ -- ^closure-library/.*_test.html$ -- ^closure-library/.*_test.js$ -- ^closure-library/closure/bin/.*$ -- ^closure-library/doc/.*$ -- ^closure-library/scripts/.*$ +# Dynamic content. +- url: /.* + script: auto + secure: always + \ No newline at end of file diff --git a/appengine/deploy b/appengine/deploy new file mode 100755 index 000000000..7fb5e6c0c --- /dev/null +++ b/appengine/deploy @@ -0,0 +1,16 @@ +#!/bin/bash + +# Script to deploy on GAE. + +APP=./app.yaml +if ! [ -f $APP ] ; then + echo $APP not found 1>&2 + exit 1 +fi + +PROJECT=blockly-demo +VERSION=37 + +echo 'Beginning deployment...' +gcloud app deploy --project $PROJECT --version $VERSION --no-promote +echo 'Deployment finished.' diff --git a/appengine/index_redirect.py b/appengine/index_redirect.py deleted file mode 100644 index 94cc26226..000000000 --- a/appengine/index_redirect.py +++ /dev/null @@ -1,3 +0,0 @@ -print("Status: 301") -print("Location: /static/demos/index.html") -print("") diff --git a/appengine/main.py b/appengine/main.py new file mode 100644 index 000000000..533552a43 --- /dev/null +++ b/appengine/main.py @@ -0,0 +1,43 @@ +""" +Copyright 2020 Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import cgi +import storage +from google.cloud import ndb + + +# Datastore model. +class Grid(ndb.Model): + data = ndb.StringProperty(required=True) + + +# Route to requested handler. +def app(environ, start_response): + if environ["PATH_INFO"] == "/": + return redirect(environ, start_response) + if environ["PATH_INFO"] == "/storage.py": + return storage.app(environ, start_response) + start_response("404 Not Found", []) + return [b"Page not found."] + + +# Redirect for root directory. +def redirect(environ, start_response): + headers = [ + ("Location", "static/demos/index.html") + ] + start_response("301 Found", headers) + return [] diff --git a/appengine/requirements.txt b/appengine/requirements.txt new file mode 100644 index 000000000..99d5d110e --- /dev/null +++ b/appengine/requirements.txt @@ -0,0 +1 @@ +google-cloud-ndb diff --git a/appengine/storage.py b/appengine/storage.py index dc4ee89e6..92c5a7f14 100644 --- a/appengine/storage.py +++ b/appengine/storage.py @@ -23,8 +23,7 @@ __author__ = "q.neutron@gmail.com (Quynh Neutron)" import cgi import hashlib from random import randint -from google.appengine.api import memcache -from google.appengine.ext import ndb +from google.cloud import ndb def keyGen(): @@ -41,46 +40,52 @@ class Xml(ndb.Model): def xmlToKey(xml_content): # Store XML and return a generated key. - xml_hash = long(hashlib.sha1(xml_content).hexdigest(), 16) + xml_hash = int(hashlib.sha1(xml_content.encode("utf-8")).hexdigest(), 16) xml_hash = int(xml_hash % (2 ** 64) - (2 ** 63)) lookup_query = Xml.query(Xml.xml_hash == xml_hash) - lookup_result = lookup_query.get() - if lookup_result: - xml_key = lookup_result.key.string_id() - else: - trials = 0 - result = True - while result: - trials += 1 - if trials == 100: - raise Exception("Sorry, the generator failed to get a key for you.") - xml_key = keyGen() - result = Xml.get_by_id(xml_key) - row = Xml(id = xml_key, xml_hash = xml_hash, xml_content = xml_content) - row.put() + client = ndb.Client() + with client.context(): + lookup_result = lookup_query.get() + if lookup_result: + xml_key = lookup_result.key.string_id() + else: + trials = 0 + result = True + while result: + trials += 1 + if trials == 100: + raise Exception("Sorry, the generator failed to get a key for you.") + xml_key = keyGen() + result = Xml.get_by_id(xml_key) + row = Xml(id = xml_key, xml_hash = xml_hash, xml_content = xml_content) + row.put() return xml_key def keyToXml(key_provided): # Retrieve stored XML based on the provided key. # Normalize the string. key_provided = key_provided.lower().strip() - # Check memcache for a quick match. - xml = memcache.get("XML_" + key_provided) - if xml is None: - # Check datastore for a definitive match. + # Check datastore for a match. + client = ndb.Client() + with client.context(): result = Xml.get_by_id(key_provided) - if not result: - xml = "" - else: - xml = result.xml_content - # Save to memcache for next hit. - memcache.add("XML_" + key_provided, xml, 3600) - return xml.encode("utf-8") + if not result: + xml = "" + else: + xml = result.xml_content + return xml -if __name__ == "__main__": - print("Content-Type: text/plain\n") - forms = cgi.FieldStorage() +def app(environ, start_response): + forms = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) if "xml" in forms: - print(xmlToKey(forms["xml"].value)) - if "key" in forms: - print(keyToXml(forms["key"].value)) + out = xmlToKey(forms["xml"].value) + elif "key" in forms: + out = keyToXml(forms["key"].value) + else: + out = "" + + headers = [ + ("Content-Type", "text/plain") + ] + start_response("200 OK", headers) + return [out.encode("utf-8")] From 7dad4c48f6c22efcc3ab11c5ab5aff4f34e1c086 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 3 Feb 2020 16:00:49 -0800 Subject: [PATCH 031/105] Delete unneeded code. --- appengine/main.py | 7 ------- appengine/storage.py | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/appengine/main.py b/appengine/main.py index 533552a43..f804c120b 100644 --- a/appengine/main.py +++ b/appengine/main.py @@ -14,14 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -import cgi import storage -from google.cloud import ndb - - -# Datastore model. -class Grid(ndb.Model): - data = ndb.StringProperty(required=True) # Route to requested handler. diff --git a/appengine/storage.py b/appengine/storage.py index 92c5a7f14..a3d351c32 100644 --- a/appengine/storage.py +++ b/appengine/storage.py @@ -26,6 +26,12 @@ from random import randint from google.cloud import ndb +class Xml(ndb.Model): + # A row in the database. + xml_hash = ndb.IntegerProperty() + xml_content = ndb.TextProperty() + + def keyGen(): # Generate a random string of length KEY_LEN. KEY_LEN = 6 @@ -33,10 +39,6 @@ def keyGen(): max_index = len(CHARS) - 1 return "".join([CHARS[randint(0, max_index)] for x in range(KEY_LEN)]) -class Xml(ndb.Model): - # A row in the database. - xml_hash = ndb.IntegerProperty() - xml_content = ndb.TextProperty() def xmlToKey(xml_content): # Store XML and return a generated key. @@ -61,6 +63,7 @@ def xmlToKey(xml_content): row.put() return xml_key + def keyToXml(key_provided): # Retrieve stored XML based on the provided key. # Normalize the string. @@ -75,6 +78,7 @@ def keyToXml(key_provided): xml = result.xml_content return xml + def app(environ, start_response): forms = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) if "xml" in forms: From 3182b6ec668b962225df7ff77a65bdb74b3cc44c Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Mon, 3 Feb 2020 16:49:13 -0800 Subject: [PATCH 032/105] Fix main.py redirect. (#3680) --- appengine/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine/main.py b/appengine/main.py index f804c120b..349c4f0c1 100644 --- a/appengine/main.py +++ b/appengine/main.py @@ -21,7 +21,7 @@ import storage def app(environ, start_response): if environ["PATH_INFO"] == "/": return redirect(environ, start_response) - if environ["PATH_INFO"] == "/storage.py": + if environ["PATH_INFO"] == "/storage": return storage.app(environ, start_response) start_response("404 Not Found", []) return [b"Page not found."] From d3f8278c393966253f290397747fd83812b663de Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 6 Feb 2020 14:53:08 +0100 Subject: [PATCH 033/105] Localisation updates from https://translatewiki.net. --- msg/json/lv.json | 1 + 1 file changed, 1 insertion(+) diff --git a/msg/json/lv.json b/msg/json/lv.json index 65859303a..e3ed010a9 100644 --- a/msg/json/lv.json +++ b/msg/json/lv.json @@ -9,6 +9,7 @@ ] }, "VARIABLES_DEFAULT_NAME": "vienums", + "UNNAMED_KEY": "nenosaukts", "TODAY": "Šodiena", "DUPLICATE_BLOCK": "Dublēt", "ADD_COMMENT": "Pievienot komentāru", From e1bb1d667ea32cac9f817e7a994d04fbb0fd40aa Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Fri, 7 Feb 2020 09:20:21 -0800 Subject: [PATCH 034/105] Add back setters for theme (#3674) --- core/theme.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core/theme.js b/core/theme.js index 802a91f3a..af6d4946a 100644 --- a/core/theme.js +++ b/core/theme.js @@ -51,12 +51,14 @@ Blockly.Theme = function(name, blockStyles, categoryStyles, /** * The block styles map. * @type {!Object.} + * @package */ this.blockStyles = blockStyles; /** * The category styles map. * @type {!Object.} + * @package */ this.categoryStyles = categoryStyles; @@ -87,6 +89,25 @@ Blockly.Theme.BlockStyle; */ Blockly.Theme.CategoryStyle; +/** + * Overrides or adds a style to the blockStyles map. + * @param {string} blockStyleName The name of the block style. + * @param {Blockly.Theme.BlockStyle} blockStyle The block style. +*/ +Blockly.Theme.prototype.setBlockStyle = function(blockStyleName, blockStyle) { + this.blockStyles[blockStyleName] = blockStyle; +}; + +/** + * Overrides or adds a style to the categoryStyles map. + * @param {string} categoryStyleName The name of the category style. + * @param {Blockly.Theme.CategoryStyle} categoryStyle The category style. +*/ +Blockly.Theme.prototype.setCategoryStyle = function(categoryStyleName, + categoryStyle) { + this.categoryStyles[categoryStyleName] = categoryStyle; +}; + /** * Gets the style for a given Blockly UI component. If the style value is a * string, we attempt to find the value of any named references. From 4416be2a30ff12f104499d03ee087921796a1620 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 7 Feb 2020 13:34:09 -0800 Subject: [PATCH 035/105] Added const tags and fixed visibility. --- core/trashcan.js | 59 ++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/core/trashcan.js b/core/trashcan.js index 1534b92e7..bc718fce6 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -92,56 +92,56 @@ Blockly.Trashcan = function(workspace) { /** * Width of both the trash can and lid images. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.WIDTH_ = 47; /** * Height of the trashcan image (minus lid). - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.BODY_HEIGHT_ = 44; /** * Height of the lid image. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.LID_HEIGHT_ = 16; /** * Distance between trashcan and bottom edge of workspace. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.MARGIN_BOTTOM_ = 20; /** * Distance between trashcan and right edge of workspace. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.MARGIN_SIDE_ = 20; /** * Extent of hotspot on all sides beyond the size of the image. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.MARGIN_HOTSPOT_ = 10; /** * Location of trashcan in sprite image. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.SPRITE_LEFT_ = 0; /** * Location of trashcan in sprite image. - * @type {number} + * @const {number} * @private */ Blockly.Trashcan.prototype.SPRITE_TOP_ = 32; @@ -149,41 +149,46 @@ Blockly.Trashcan.prototype.SPRITE_TOP_ = 32; /** * The openness of the lid when the trashcan contains blocks. * (0.0 = closed, 1.0 = open) - * @type {number} + * @const {number} * @private */ -Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE = 0.1; +Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_ = 0.1; /** * The length of the open/close animation in milliseconds. - * @type {number} + * @const {number} + * @private */ -Blockly.Trashcan.ANIMATION_LENGTH = 80; +Blockly.Trashcan.ANIMATION_LENGTH_ = 80; /** * The number of frames in the animation. - * @type {number} + * @const {number} + * @private */ -Blockly.Trashcan.ANIMATION_FRAMES = 4; +Blockly.Trashcan.ANIMATION_FRAMES_ = 4; /** * The minimum (resting) opacity of the trashcan and lid. - * @type {number} + * @const {number} + * @private */ -Blockly.Trashcan.OPACITY_MIN = 0.4; +Blockly.Trashcan.OPACITY_MIN_ = 0.4; /** * The maximum (hovered) opacity of the trashcan and lid. - * @type {number} + * @const {number} + * @private */ -Blockly.Trashcan.OPACITY_MAX = 0.8; +Blockly.Trashcan.OPACITY_MAX_ = 0.8; /** * The maximum angle the trashcan lid can opens to. At the end of the open * animation the lid will be open to this angle. - * @type {number} + * @const {number} + * @private */ -Blockly.Trashcan.MAX_LID_ANGLE = 45; +Blockly.Trashcan.MAX_LID_ANGLE_ = 45; /** * Current open/close state of the lid. @@ -443,23 +448,23 @@ Blockly.Trashcan.prototype.setOpen = function(state) { * @private */ Blockly.Trashcan.prototype.animateLid_ = function() { - var frames = Blockly.Trashcan.ANIMATION_FRAMES; + var frames = Blockly.Trashcan.ANIMATION_FRAMES_; var delta = 1 / (frames + 1); this.lidOpen_ += this.isOpen ? delta : -delta; this.lidOpen_ = Math.min(Math.max(this.lidOpen_, this.minOpenness_), 1); - this.setLidAngle_(this.lidOpen_ * Blockly.Trashcan.MAX_LID_ANGLE); + this.setLidAngle_(this.lidOpen_ * Blockly.Trashcan.MAX_LID_ANGLE_); - var minOpacity = Blockly.Trashcan.OPACITY_MIN; - var maxOpacity = Blockly.Trashcan.OPACITY_MAX; + var minOpacity = Blockly.Trashcan.OPACITY_MIN_; + var maxOpacity = Blockly.Trashcan.OPACITY_MAX_; // Linear interpolation between min and max. var opacity = minOpacity + this.lidOpen_ * (maxOpacity - minOpacity); this.svgGroup_.style.opacity = opacity; if (this.lidOpen_ > this.minOpenness_ && this.lidOpen_ < 1) { this.lidTask_ = setTimeout(this.animateLid_.bind(this), - Blockly.Trashcan.ANIMATION_LENGTH / frames); + Blockly.Trashcan.ANIMATION_LENGTH_ / frames); } }; @@ -487,7 +492,7 @@ Blockly.Trashcan.prototype.setLidAngle_ = function(lidAngle) { Blockly.Trashcan.prototype.setMinOpenness_ = function(newMin) { this.minOpenness_ = newMin; if (!this.isOpen) { - this.setLidAngle_(newMin * Blockly.Trashcan.MAX_LID_ANGLE); + this.setLidAngle_(newMin * Blockly.Trashcan.MAX_LID_ANGLE_); } }; @@ -556,7 +561,7 @@ Blockly.Trashcan.prototype.onDelete_ = function(event) { this.contents_.pop(); } - this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE); + this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_); } }; From 95aadbffb1f0f098877e0e31d4ae4a0e7d60f5ea Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 7 Feb 2020 15:13:51 -0800 Subject: [PATCH 036/105] [zelos] Set a maximum width for dynamic connection shapes. (#3685) * Set a maximum width for dynamic connection shapes. * Only render the left side connection if a block has a statement input --- core/renderers/common/info.js | 10 +++--- core/renderers/zelos/constants.js | 41 ++++++++++++++++++------ core/renderers/zelos/drawer.js | 15 ++++++++- core/renderers/zelos/info.js | 31 ++++++++++++------ core/renderers/zelos/measurables/rows.js | 8 ++--- 5 files changed, 76 insertions(+), 29 deletions(-) diff --git a/core/renderers/common/info.js b/core/renderers/common/info.js index 0e20b9b24..f034da0ce 100644 --- a/core/renderers/common/info.js +++ b/core/renderers/common/info.js @@ -139,11 +139,10 @@ Blockly.blockRendering.RenderInfo = function(renderer, block) { this.rows = []; /** - * The total number of input rows added onto the block. - * @type {number} - * @protected + * An array of input rows on the block. + * @type {!Array.} */ - this.inputRowNum_ = 1; + this.inputRows = []; /** * An array of measurable objects containing hidden icons. @@ -206,6 +205,7 @@ Blockly.blockRendering.RenderInfo.prototype.createRows_ = function() { this.populateTopRow_(); this.rows.push(this.topRow); var activeRow = new Blockly.blockRendering.InputRow(this.constants_); + this.inputRows.push(activeRow); // Icons always go on the first row, before anything else. var icons = this.block_.getIcons(); @@ -231,7 +231,7 @@ Blockly.blockRendering.RenderInfo.prototype.createRows_ = function() { // Finish this row and create a new one. this.rows.push(activeRow); activeRow = new Blockly.blockRendering.InputRow(this.constants_); - this.inputRowNum_ ++; + this.inputRows.push(activeRow); } // All of the fields in an input go on the same row. diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index 72458852e..d3c485286 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -358,6 +358,13 @@ Blockly.zelos.ConstantProvider = function() { */ this.FIELD_CHECKBOX_DEFAULT_WIDTH = 6 * this.GRID_UNIT; + + /** + * The maximum width of a dynamic connection shape. + * @type {number} + */ + this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH = 12 * this.GRID_UNIT; + /** * The ID of the selected glow filter, or the empty string if no filter is * set. @@ -441,13 +448,16 @@ Blockly.zelos.ConstantProvider.prototype.makeStartHat = function() { * @package */ Blockly.zelos.ConstantProvider.prototype.makeHexagonal = function() { + var maxWidth = this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; + // The main path for the hexagonal connection shape is made out of two lines. // The lines are defined with relative positons and require the block height. // The 'up' and 'down' versions of the paths are the same, but the Y sign // flips. The 'left' and 'right' versions of the path are also the same, but // the X sign flips. function makeMainPath(height, up, right) { - var width = height / 2; + var halfHeight = height / 2; + var width = halfHeight > maxWidth ? maxWidth : halfHeight; var forward = up ? -1 : 1; var direction = right ? -1 : 1; var dy = forward * height / 2; @@ -459,7 +469,8 @@ Blockly.zelos.ConstantProvider.prototype.makeHexagonal = function() { type: this.SHAPES.HEXAGONAL, isDynamic: true, width: function(height) { - return height / 2; + var halfHeight = height / 2; + return halfHeight > maxWidth ? maxWidth : halfHeight; }, height: function(height) { return height; @@ -492,22 +503,34 @@ Blockly.zelos.ConstantProvider.prototype.makeHexagonal = function() { * @package */ Blockly.zelos.ConstantProvider.prototype.makeRounded = function() { - // The main path for the rounded connection shape is made out of a single arc. - // The arc is defined with relative positions and requires the block height. + var maxWidth = this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; + var maxHeight = maxWidth * 2; + + // The main path for the rounded connection shape is made out of two arcs and + // a line that joins them. The arcs are defined with relative positions. + // Usually, the height of the block is split between the two arcs. In the case + // where the height of the block exceeds the maximum height, a line is drawn + // in between the two arcs. // The 'up' and 'down' versions of the paths are the same, but the Y sign // flips. The 'up' and 'right' versions of the path flip the sweep-flag // which moves the arc at negative angles. - function makeMainPath(height, up, right) { - var edgeWidth = height / 2; - return Blockly.utils.svgPaths.arc('a', '0 0 ' + (up || right ? 1 : 0), edgeWidth, - Blockly.utils.svgPaths.point(0, (up ? -1 : 1) * edgeWidth * 2)); + function makeMainPath(blockHeight, up, right) { + var remainingHeight = blockHeight > maxHeight ? blockHeight - maxHeight : 0; + var height = blockHeight > maxHeight ? maxHeight : blockHeight; + var radius = height / 2; + return Blockly.utils.svgPaths.arc('a', '0 0,1', radius, + Blockly.utils.svgPaths.point((up ? -1 : 1) * radius, (up ? -1 : 1) * radius)) + + Blockly.utils.svgPaths.lineOnAxis('v', (right ? 1 : -1) * remainingHeight) + + Blockly.utils.svgPaths.arc('a', '0 0,1', radius, + Blockly.utils.svgPaths.point((up ? 1 : -1) * radius, (up ? -1 : 1) * radius)); } return { type: this.SHAPES.ROUND, isDynamic: true, width: function(height) { - return height / 2; + var halfHeight = height / 2; + return halfHeight > maxWidth ? maxWidth : halfHeight; }, height: function(height) { return height; diff --git a/core/renderers/zelos/drawer.js b/core/renderers/zelos/drawer.js index 22580d233..7377595f4 100644 --- a/core/renderers/zelos/drawer.js +++ b/core/renderers/zelos/drawer.js @@ -80,7 +80,8 @@ Blockly.zelos.Drawer.prototype.draw = function() { */ Blockly.zelos.Drawer.prototype.drawOutline_ = function() { if (this.info_.outputConnection && - this.info_.outputConnection.isDynamicShape) { + this.info_.outputConnection.isDynamicShape && + !this.info_.hasStatementInput) { this.drawFlatTop_(); this.drawRightDynamicConnection_(); this.drawFlatBottom_(); @@ -90,6 +91,18 @@ Blockly.zelos.Drawer.prototype.drawOutline_ = function() { } }; +/** + * @override + */ +Blockly.zelos.Drawer.prototype.drawLeft_ = function() { + if (this.info_.outputConnection && + this.info_.outputConnection.isDynamicShape) { + this.drawLeftDynamicConnection_(); + } else { + Blockly.zelos.Drawer.superClass_.drawLeft_.call(this); + } +}; + /** * Add steps for the right side of a row that does not have value or * statement input connections. diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index c80c6b5f3..90f606c6c 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -89,6 +89,12 @@ Blockly.zelos.RenderInfo = function(renderer, block) { */ this.isMultiRow = !block.getInputsInline() || block.isCollapsed(); + /** + * Whether or not the block has a statement input in one of its rows. + * @type {boolean} + */ + this.hasStatementInput = false; + /** * An object with rendering information about the right connection shape. * @type {Blockly.zelos.RightConnectionShape} @@ -164,7 +170,8 @@ Blockly.zelos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { if (!prev || !next) { // No need for padding at the beginning or end of the row if the // output shape is dynamic. - if (this.outputConnection && this.outputConnection.isDynamicShape) { + if (this.outputConnection && this.outputConnection.isDynamicShape && + !this.hasStatementInput) { return this.constants_.NO_PADDING; } } @@ -270,6 +277,7 @@ Blockly.zelos.RenderInfo.prototype.addInput_ = function(input, activeRow) { activeRow.elements.push( new Blockly.zelos.StatementInput(this.constants_, input)); activeRow.hasStatement = true; + this.hasStatementInput = true; } else if (input.type == Blockly.INPUT_VALUE) { activeRow.elements.push( new Blockly.blockRendering.ExternalValueInput(this.constants_, input)); @@ -397,10 +405,12 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { this.outputConnection.shape.connectionOffsetX(connectionWidth); // Adjust right side measurable. - this.rightSide.height = connectionHeight; - this.rightSide.width = connectionWidth; - this.rightSide.centerline = connectionHeight / 2; - this.rightSide.xPos = this.width + connectionWidth; + if (!this.hasStatementInput) { + this.rightSide.height = connectionHeight; + this.rightSide.width = connectionWidth; + this.rightSide.centerline = connectionHeight / 2; + this.rightSide.xPos = this.width + connectionWidth; + } this.startX = connectionWidth; this.width += connectionWidth * 2; @@ -415,7 +425,7 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { * @protected */ Blockly.zelos.RenderInfo.prototype.finalizeHorizontalAlignment_ = function() { - if (!this.outputConnection) { + if (!this.outputConnection || this.hasStatementInput) { return; } var totalNegativeSpacing = 0; @@ -474,14 +484,15 @@ Blockly.zelos.RenderInfo.prototype.getNegativeSpacing_ = function(elem) { var outerShape = this.outputConnection.shape.type; var constants = /** @type {!Blockly.zelos.ConstantProvider} */ (this.constants_); - if (this.isMultiRow && this.inputRowNum_ > 1) { + if (this.isMultiRow && this.inputRows.length > 1) { switch (outerShape) { case constants.SHAPES.ROUND: // Special case for multi-row round reporter blocks. - var radius = this.height / 2; + var maxWidth = this.constants_.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; + var width = this.height / 2 > maxWidth ? maxWidth : this.height / 2; var topPadding = this.constants_.SMALL_PADDING; - var roundPadding = radius * - (1 - Math.sin(Math.acos((radius - topPadding) / radius))); + var roundPadding = width * + (1 - Math.sin(Math.acos((width - topPadding) / width))); return connectionWidth - roundPadding; default: return 0; diff --git a/core/renderers/zelos/measurables/rows.js b/core/renderers/zelos/measurables/rows.js index 5b025eda2..a42703ee1 100644 --- a/core/renderers/zelos/measurables/rows.js +++ b/core/renderers/zelos/measurables/rows.js @@ -72,8 +72,8 @@ Blockly.zelos.TopRow.prototype.hasLeftSquareCorner = function(block) { * Render a round corner unless the block has an output connection. * @override */ -Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(block) { - return !!block.outputConnection; +Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(_block) { + return false; }; /** @@ -112,6 +112,6 @@ Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner = function(block) { * Render a round corner unless the block has an output connection. * @override */ -Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(block) { - return !!block.outputConnection; +Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(_block) { + return false; }; From 55241d7d96263979105100873efb3bfd2e9c770a Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 10 Feb 2020 14:49:26 +0100 Subject: [PATCH 037/105] Localisation updates from https://translatewiki.net. --- msg/json/nl.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/msg/json/nl.json b/msg/json/nl.json index 3e4892af5..f60798e0f 100644 --- a/msg/json/nl.json +++ b/msg/json/nl.json @@ -15,7 +15,8 @@ "Patio", "KlaasZ4usV", "Marcelhospers", - "Elroy" + "Elroy", + "Klaas van Buiten" ] }, "VARIABLES_DEFAULT_NAME": "item", From 33e082414d4a9633eb4cd63f4f3bbd12e63cd556 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 10 Feb 2020 08:58:08 -0800 Subject: [PATCH 038/105] Adjust what the spacers at after the top and before the bottom rows depend on. Make them depend on the top row's minHeight and desired height. (#3686) --- core/renderers/zelos/constants.js | 4 ++-- core/renderers/zelos/info.js | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index d3c485286..57ad6b32a 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -109,7 +109,7 @@ Blockly.zelos.ConstantProvider = function() { /** * @override */ - this.TOP_ROW_MIN_HEIGHT = this.GRID_UNIT; + this.TOP_ROW_MIN_HEIGHT = this.CORNER_RADIUS; /** * @override @@ -119,7 +119,7 @@ Blockly.zelos.ConstantProvider = function() { /** * @override */ - this.BOTTOM_ROW_MIN_HEIGHT = this.GRID_UNIT; + this.BOTTOM_ROW_MIN_HEIGHT = this.CORNER_RADIUS; /** * @override diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index 90f606c6c..1ab34115e 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -212,21 +212,28 @@ Blockly.zelos.RenderInfo.prototype.getSpacerRowHeight_ = function( Blockly.blockRendering.Types.isInputRow(next) && next.hasStatement; if (precedesStatement || followsStatement) { var cornerHeight = this.constants_.INSIDE_CORNERS.rightHeight || 0; - var height = Math.max(this.constants_.MEDIUM_PADDING, - Math.max(this.constants_.NOTCH_HEIGHT, cornerHeight)); + var height = Math.max(this.constants_.NOTCH_HEIGHT, cornerHeight); return precedesStatement && followsStatement ? Math.max(height, this.constants_.DUMMY_INPUT_MIN_HEIGHT) : height; } // Top and bottom rows act as a spacer so we don't need any extra padding. if ((Blockly.blockRendering.Types.isTopRow(prev))) { - if (!prev.hasPreviousConnection && !this.outputConnection) { - return this.constants_.SMALL_PADDING; + if (!prev.hasPreviousConnection && + (!this.outputConnection || this.hasStatementInput)) { + return Math.abs(this.constants_.NOTCH_HEIGHT - + this.constants_.CORNER_RADIUS); } return this.constants_.NO_PADDING; } if ((Blockly.blockRendering.Types.isBottomRow(next))) { if (!this.outputConnection) { - return this.constants_.SMALL_PADDING; + var topHeight = Math.max(this.topRow.minHeight, + Math.max(this.constants_.NOTCH_HEIGHT, + this.constants_.CORNER_RADIUS)) - this.constants_.CORNER_RADIUS; + return topHeight; + } else if (!next.hasNextConnection && this.hasStatementInput) { + return Math.abs(this.constants_.NOTCH_HEIGHT - + this.constants_.CORNER_RADIUS); } return this.constants_.NO_PADDING; } From 4e2f8e6e02b0473a86330eb7414794e6bfea430e Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 11 Feb 2020 13:27:20 -0800 Subject: [PATCH 039/105] Use SPDX licences. This is a followup to #3127. At the time, SPDX licenses were pending approval by Google. --- appengine/storage.js | 13 +- blockly_compressed.js | 976 +++++++++--------- blockly_uncompressed.js | 322 +++--- blocks/colour.js | 13 +- blocks/lists.js | 13 +- blocks/logic.js | 13 +- blocks/loops.js | 13 +- blocks/math.js | 13 +- blocks/procedures.js | 13 +- blocks/text.js | 13 +- blocks/variables.js | 13 +- blocks/variables_dynamic.js | 13 +- blocks_compressed.js | 99 +- build.py | 13 +- core/block.js | 13 +- core/block_animations.js | 13 +- core/block_drag_surface.js | 13 +- core/block_dragger.js | 13 +- core/block_events.js | 13 +- core/block_svg.js | 13 +- core/blockly.js | 13 +- core/blocks.js | 13 +- core/bubble.js | 13 +- core/bubble_dragger.js | 13 +- core/comment.js | 13 +- core/components/component.js | 13 +- core/components/menu/menu.js | 13 +- core/components/menu/menuitem.js | 13 +- core/components/tree/basenode.js | 13 +- core/components/tree/treecontrol.js | 13 +- core/components/tree/treenode.js | 13 +- core/connection.js | 13 +- core/connection_db.js | 13 +- core/constants.js | 13 +- core/contextmenu.js | 13 +- core/css.js | 13 +- core/dropdowndiv.js | 13 +- core/events.js | 13 +- core/events_abstract.js | 13 +- core/extensions.js | 13 +- core/field.js | 13 +- core/field_angle.js | 13 +- core/field_checkbox.js | 13 +- core/field_colour.js | 13 +- core/field_date.js | 13 +- core/field_dropdown.js | 13 +- core/field_image.js | 13 +- core/field_label.js | 13 +- core/field_label_serializable.js | 13 +- core/field_multilineinput.js | 13 +- core/field_number.js | 13 +- core/field_registry.js | 13 +- core/field_textinput.js | 13 +- core/field_variable.js | 13 +- core/flyout_base.js | 13 +- core/flyout_button.js | 13 +- core/flyout_dragger.js | 13 +- core/flyout_horizontal.js | 13 +- core/flyout_vertical.js | 13 +- core/generator.js | 13 +- core/gesture.js | 13 +- core/grid.js | 13 +- core/icon.js | 13 +- core/inject.js | 13 +- core/input.js | 13 +- core/insertion_marker_manager.js | 13 +- core/keyboard_nav/action.js | 13 +- core/keyboard_nav/ast_node.js | 13 +- core/keyboard_nav/basic_cursor.js | 13 +- core/keyboard_nav/cursor.js | 13 +- core/keyboard_nav/flyout_cursor.js | 13 +- core/keyboard_nav/key_map.js | 13 +- core/keyboard_nav/marker.js | 13 +- core/keyboard_nav/navigation.js | 13 +- core/keyboard_nav/tab_navigate_cursor.js | 13 +- core/marker_manager.js | 13 +- core/msg.js | 13 +- core/mutator.js | 13 +- core/names.js | 13 +- core/options.js | 13 +- core/procedures.js | 13 +- core/rendered_connection.js | 13 +- core/renderers/common/block_rendering.js | 13 +- core/renderers/common/constants.js | 13 +- core/renderers/common/debugger.js | 13 +- core/renderers/common/drawer.js | 13 +- core/renderers/common/i_path_object.js | 13 +- core/renderers/common/info.js | 13 +- core/renderers/common/marker_svg.js | 13 +- core/renderers/common/path_object.js | 13 +- core/renderers/common/renderer.js | 13 +- core/renderers/geras/constants.js | 13 +- core/renderers/geras/drawer.js | 13 +- core/renderers/geras/highlight_constants.js | 13 +- core/renderers/geras/highlighter.js | 13 +- core/renderers/geras/info.js | 13 +- core/renderers/geras/measurables/inputs.js | 13 +- core/renderers/geras/path_object.js | 13 +- core/renderers/geras/renderer.js | 13 +- core/renderers/measurables/base.js | 13 +- core/renderers/measurables/connections.js | 13 +- core/renderers/measurables/inputs.js | 13 +- core/renderers/measurables/row_elements.js | 13 +- core/renderers/measurables/rows.js | 13 +- core/renderers/measurables/types.js | 13 +- core/renderers/minimalist/constants.js | 13 +- core/renderers/minimalist/drawer.js | 13 +- core/renderers/minimalist/info.js | 13 +- core/renderers/minimalist/renderer.js | 13 +- core/renderers/thrasos/info.js | 13 +- core/renderers/thrasos/renderer.js | 13 +- core/renderers/zelos/constants.js | 13 +- core/renderers/zelos/drawer.js | 13 +- core/renderers/zelos/info.js | 13 +- core/renderers/zelos/marker_svg.js | 13 +- core/renderers/zelos/measurables/inputs.js | 13 +- .../zelos/measurables/row_elements.js | 13 +- core/renderers/zelos/measurables/rows.js | 13 +- core/renderers/zelos/path_object.js | 13 +- core/renderers/zelos/renderer.js | 13 +- core/requires.js | 15 +- core/scrollbar.js | 13 +- core/theme.js | 13 +- core/theme/classic.js | 13 +- core/theme/dark.js | 13 +- core/theme/deuteranopia.js | 17 +- core/theme/highcontrast.js | 13 +- core/theme/modern.js | 13 +- core/theme/tritanopia.js | 13 +- core/theme/zelos.js | 13 +- core/theme_manager.js | 13 +- core/toolbox.js | 13 +- core/tooltip.js | 13 +- core/touch.js | 13 +- core/touch_gesture.js | 13 +- core/trashcan.js | 13 +- core/ui_events.js | 13 +- core/ui_menu_utils.js | 13 +- core/utils.js | 13 +- core/utils/aria.js | 13 +- core/utils/colour.js | 13 +- core/utils/coordinate.js | 13 +- core/utils/dom.js | 13 +- core/utils/global.js | 13 +- core/utils/idgenerator.js | 13 +- core/utils/keycodes.js | 13 +- core/utils/math.js | 13 +- core/utils/object.js | 13 +- core/utils/rect.js | 13 +- core/utils/size.js | 13 +- core/utils/string.js | 13 +- core/utils/style.js | 13 +- core/utils/svg_paths.js | 13 +- core/utils/useragent.js | 13 +- core/utils/xml.js | 13 +- core/variable_events.js | 13 +- core/variable_map.js | 13 +- core/variable_model.js | 13 +- core/variables.js | 13 +- core/variables_dynamic.js | 13 +- core/warning.js | 13 +- core/widgetdiv.js | 13 +- core/workspace.js | 13 +- core/workspace_audio.js | 13 +- core/workspace_comment.js | 13 +- core/workspace_comment_render_svg.js | 13 +- core/workspace_comment_svg.js | 13 +- core/workspace_drag_surface_svg.js | 13 +- core/workspace_dragger.js | 13 +- core/workspace_events.js | 13 +- core/workspace_svg.js | 13 +- core/ws_comment_events.js | 13 +- core/xml.js | 13 +- core/zoom_controls.js | 13 +- dart_compressed.js | 5 +- demos/blockfactory/analytics.js | 13 +- demos/blockfactory/app_controller.js | 13 +- .../blockfactory/block_exporter_controller.js | 13 +- demos/blockfactory/block_exporter_tools.js | 13 +- demos/blockfactory/block_exporter_view.js | 13 +- .../blockfactory/block_library_controller.js | 13 +- demos/blockfactory/block_library_storage.js | 13 +- demos/blockfactory/block_library_view.js | 13 +- demos/blockfactory/block_option.js | 13 +- demos/blockfactory/blocks.js | 15 +- demos/blockfactory/cp.js | 13 +- demos/blockfactory/factory.css | 13 +- demos/blockfactory/factory.js | 13 +- demos/blockfactory/factory_utils.js | 13 +- demos/blockfactory/standard_categories.js | 13 +- .../workspacefactory/wfactory_controller.js | 13 +- .../workspacefactory/wfactory_generator.js | 13 +- .../workspacefactory/wfactory_init.js | 13 +- .../workspacefactory/wfactory_model.js | 13 +- .../workspacefactory/wfactory_view.js | 13 +- demos/blockfactory_old/blocks.js | 13 +- demos/blockfactory_old/factory.js | 13 +- demos/code/code.js | 13 +- demos/codelab/app-complete/scripts/main.js | 13 +- .../app-complete/scripts/music_maker.js | 13 +- .../app-complete/scripts/sound_blocks.js | 13 +- demos/codelab/app/scripts/main.js | 13 +- demos/codelab/app/scripts/music_maker.js | 13 +- demos/custom-dialogs/custom-dialog.js | 13 +- demos/custom-fields/pitch/blocks.js | 13 +- demos/custom-fields/pitch/field_pitch.js | 13 +- demos/custom-fields/pitch/pitch.css | 13 +- demos/custom-fields/turtle/blocks.js | 15 +- demos/custom-fields/turtle/field_turtle.js | 13 +- demos/custom-fields/turtle/turtle.css | 13 +- demos/interpreter/wait_block.js | 13 +- demos/keyboard_nav/line_cursor.js | 13 +- demos/minimap/minimap.js | 13 +- demos/plane/blocks.js | 13 +- demos/plane/plane.js | 13 +- demos/plane/slider.js | 13 +- externs/goog-externs.js | 13 +- externs/svg-externs.js | 13 +- generators/dart.js | 13 +- generators/dart/colour.js | 13 +- generators/dart/lists.js | 13 +- generators/dart/logic.js | 13 +- generators/dart/loops.js | 13 +- generators/dart/math.js | 13 +- generators/dart/procedures.js | 13 +- generators/dart/text.js | 13 +- generators/dart/variables.js | 13 +- generators/dart/variables_dynamic.js | 13 +- generators/javascript.js | 13 +- generators/javascript/colour.js | 13 +- generators/javascript/lists.js | 13 +- generators/javascript/logic.js | 13 +- generators/javascript/loops.js | 13 +- generators/javascript/math.js | 13 +- generators/javascript/procedures.js | 13 +- generators/javascript/text.js | 13 +- generators/javascript/variables.js | 13 +- generators/javascript/variables_dynamic.js | 13 +- generators/lua.js | 13 +- generators/lua/colour.js | 13 +- generators/lua/lists.js | 13 +- generators/lua/logic.js | 13 +- generators/lua/loops.js | 13 +- generators/lua/math.js | 13 +- generators/lua/procedures.js | 13 +- generators/lua/text.js | 13 +- generators/lua/variables.js | 13 +- generators/lua/variables_dynamic.js | 13 +- generators/php.js | 13 +- generators/php/colour.js | 13 +- generators/php/lists.js | 13 +- generators/php/logic.js | 13 +- generators/php/loops.js | 13 +- generators/php/math.js | 13 +- generators/php/procedures.js | 13 +- generators/php/text.js | 13 +- generators/php/variables.js | 13 +- generators/php/variables_dynamic.js | 13 +- generators/python.js | 13 +- generators/python/colour.js | 13 +- generators/python/lists.js | 13 +- generators/python/logic.js | 13 +- generators/python/loops.js | 13 +- generators/python/math.js | 13 +- generators/python/procedures.js | 13 +- generators/python/text.js | 13 +- generators/python/variables.js | 13 +- generators/python/variables_dynamic.js | 13 +- gulpfile.js | 32 +- javascript_compressed.js | 13 +- lua_compressed.js | 5 +- msg/js/de.js | 2 +- msg/js/kn.js | 434 ++++++++ msg/js/lv.js | 2 +- msg/js/sl.js | 4 +- msg/messages.js | 13 +- package/browser/core.js | 13 +- package/browser/index.js | 13 +- package/index.js | 13 +- package/node/core.js | 13 +- package/node/index.js | 13 +- php_compressed.js | 5 +- python_compressed.js | 9 +- tests/blocks/logic_ternary_test.js | 13 +- tests/blocks/test_blocks.js | 13 +- tests/compile/main.js | 13 +- tests/generators/run_generators_in_browser.js | 13 +- tests/generators/unittest.js | 13 +- tests/generators/unittest_dart.js | 13 +- tests/generators/unittest_javascript.js | 13 +- tests/generators/unittest_lua.js | 13 +- tests/generators/unittest_php.js | 13 +- tests/generators/unittest_python.js | 13 +- tests/jsunit/block_test.js | 13 +- tests/jsunit/event_test.js | 13 +- tests/jsunit/extensions_test.js | 13 +- tests/jsunit/generator_test.js | 13 +- tests/jsunit/json_test.js | 13 +- tests/jsunit/mocha_jsunit_test_runner.js | 13 +- tests/jsunit/run_jsunit_tests_in_browser.js | 13 +- tests/jsunit/test_utilities.js | 13 +- tests/jsunit/utils_dom_test.js | 13 +- tests/jsunit/utils_math_test.js | 13 +- tests/jsunit/utils_string_test.js | 13 +- tests/jsunit/utils_test.js | 13 +- tests/jsunit/variable_map_test.js | 13 +- tests/jsunit/variable_model_test.js | 13 +- tests/jsunit/variables_test.js | 13 +- tests/jsunit/widget_div_test.js | 13 +- tests/jsunit/workspace_comment_test.js | 13 +- tests/jsunit/workspace_test.js | 13 +- tests/jsunit/workspace_undo_redo_test.js | 13 +- tests/jsunit/xml_test.js | 13 +- tests/mocha/astnode_test.js | 13 +- tests/mocha/block_test.js | 13 +- tests/mocha/comment_test.js | 13 +- tests/mocha/connection_db_test.js | 13 +- tests/mocha/connection_test.js | 13 +- tests/mocha/cursor_test.js | 13 +- tests/mocha/dropdowndiv_test.js | 13 +- tests/mocha/event_test.js | 13 +- tests/mocha/field_angle_test.js | 13 +- tests/mocha/field_checkbox_test.js | 13 +- tests/mocha/field_colour_test.js | 13 +- tests/mocha/field_date_test.js | 13 +- tests/mocha/field_dropdown_test.js | 13 +- tests/mocha/field_image_test.js | 13 +- tests/mocha/field_label_serializable_test.js | 13 +- tests/mocha/field_label_test.js | 13 +- tests/mocha/field_number_test.js | 13 +- tests/mocha/field_registry_test.js | 13 +- tests/mocha/field_test.js | 13 +- tests/mocha/field_textinput_test.js | 13 +- tests/mocha/field_variable_test.js | 13 +- tests/mocha/gesture_test.js | 13 +- tests/mocha/input_test.js | 13 +- tests/mocha/key_map_test.js | 13 +- tests/mocha/metrics_test.js | 13 +- tests/mocha/names_test.js | 13 +- tests/mocha/navigation_modify_test.js | 13 +- tests/mocha/navigation_test.js | 13 +- tests/mocha/procedures_test.js | 13 +- tests/mocha/run_mocha_tests_in_browser.js | 13 +- tests/mocha/test_helpers.js | 13 +- tests/mocha/theme_test.js | 13 +- tests/mocha/trashcan_test.js | 13 +- tests/mocha/utils_test.js | 13 +- tests/mocha/xml_procedures_test.js | 13 +- tests/mocha/xml_test.js | 13 +- tests/node/run_node_test.js | 13 +- tests/playgrounds/screenshot.js | 13 +- tests/screenshot/diff-reporter.js | 13 +- tests/screenshot/diff_screenshots.js | 13 +- tests/screenshot/gen_screenshots.js | 13 +- tests/workspace_svg/event_svg_test.js | 13 +- tests/workspace_svg/procedure_svg_test.js | 13 +- tests/workspace_svg/workspace_svg_test.js | 13 +- typings/blockly.d.ts | 13 +- typings/parts/blockly-header.d.ts | 13 +- 359 files changed, 1523 insertions(+), 4893 deletions(-) create mode 100644 msg/js/kn.js diff --git a/appengine/storage.js b/appengine/storage.js index dc62a0035..82a74052a 100644 --- a/appengine/storage.js +++ b/appengine/storage.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blockly_compressed.js b/blockly_compressed.js index c21c79d82..20c4ffc23 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -1,20 +1,25 @@ -// Do not edit this file; automatically generated by gulp. -'use strict';var Blockly={constants:{},LINE_MODE_MULTIPLIER:40,PAGE_MODE_MULTIPLIER:125,DRAG_RADIUS:5,FLYOUT_DRAG_RADIUS:10,SNAP_RADIUS:28};Blockly.CONNECTING_SNAP_RADIUS=Blockly.SNAP_RADIUS;Blockly.CURRENT_CONNECTION_PREFERENCE=8;Blockly.INSERTION_MARKER_COLOUR="#000000";Blockly.BUMP_DELAY=250;Blockly.BUMP_RANDOMNESS=10;Blockly.COLLAPSE_CHARS=30;Blockly.LONGPRESS=750;Blockly.SOUND_LIMIT=100;Blockly.DRAG_STACK=!0;Blockly.HSV_SATURATION=.45;Blockly.HSV_VALUE=.65; +// Do not edit this file; automatically generated by build.py. +'use strict'; + + +var Blockly={};Blockly.Blocks=Object.create(null); +Blockly.utils={};Blockly.utils.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();Blockly.Msg={};Blockly.utils.global.Blockly||(Blockly.utils.global.Blockly={});Blockly.utils.global.Blockly.Msg||(Blockly.utils.global.Blockly.Msg=Blockly.Msg); +Blockly.constants={};Blockly.LINE_MODE_MULTIPLIER=40;Blockly.PAGE_MODE_MULTIPLIER=125;Blockly.DRAG_RADIUS=5;Blockly.FLYOUT_DRAG_RADIUS=10;Blockly.SNAP_RADIUS=28;Blockly.CONNECTING_SNAP_RADIUS=Blockly.SNAP_RADIUS;Blockly.CURRENT_CONNECTION_PREFERENCE=8;Blockly.INSERTION_MARKER_COLOUR="#000000";Blockly.BUMP_DELAY=250;Blockly.BUMP_RANDOMNESS=10;Blockly.COLLAPSE_CHARS=30;Blockly.LONGPRESS=750;Blockly.SOUND_LIMIT=100;Blockly.DRAG_STACK=!0;Blockly.HSV_SATURATION=.45;Blockly.HSV_VALUE=.65; Blockly.SPRITE={width:96,height:124,url:"sprites.png"};Blockly.INPUT_VALUE=1;Blockly.OUTPUT_VALUE=2;Blockly.NEXT_STATEMENT=3;Blockly.PREVIOUS_STATEMENT=4;Blockly.DUMMY_INPUT=5;Blockly.ALIGN_LEFT=-1;Blockly.ALIGN_CENTRE=0;Blockly.ALIGN_RIGHT=1;Blockly.DRAG_NONE=0;Blockly.DRAG_STICKY=1;Blockly.DRAG_BEGIN=1;Blockly.DRAG_FREE=2;Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE]=Blockly.INPUT_VALUE; Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT]=Blockly.PREVIOUS_STATEMENT;Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT]=Blockly.NEXT_STATEMENT;Blockly.TOOLBOX_AT_TOP=0;Blockly.TOOLBOX_AT_BOTTOM=1;Blockly.TOOLBOX_AT_LEFT=2;Blockly.TOOLBOX_AT_RIGHT=3;Blockly.DELETE_AREA_NONE=null;Blockly.DELETE_AREA_TRASH=1;Blockly.DELETE_AREA_TOOLBOX=2;Blockly.VARIABLE_CATEGORY_NAME="VARIABLE";Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME="VARIABLE_DYNAMIC";Blockly.PROCEDURE_CATEGORY_NAME="PROCEDURE"; -Blockly.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID";Blockly.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID";Blockly.utils={};Blockly.utils.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();Blockly.Msg={};Blockly.utils.global.Blockly||(Blockly.utils.global.Blockly={});Blockly.utils.global.Blockly.Msg||(Blockly.utils.global.Blockly.Msg=Blockly.Msg);Blockly.utils.colour={}; +Blockly.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID";Blockly.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID";Blockly.utils.colour={}; Blockly.utils.colour.parse=function(a){a=String(a).toLowerCase().trim();var b=Blockly.utils.colour.names[a];if(b)return b;b="0x"==a.substring(0,2)?"#"+a.substring(2):a;b="#"==b[0]?b:"#"+b;if(/^#[0-9a-f]{6}$/.test(b))return b;if(/^#[0-9a-f]{3}$/.test(b))return["#",b[1],b[1],b[2],b[2],b[3],b[3]].join("");var c=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return c&&(a=Number(c[1]),b=Number(c[2]),c=Number(c[3]),0<=a&&256>a&&0<=b&&256>b&&0<=c&&256>c)?Blockly.utils.colour.rgbToHex(a,b, c):null};Blockly.utils.colour.rgbToHex=function(a,b,c){b=a<<16|b<<8|c;return 16>a?"#"+(16777216|b).toString(16).substr(1):"#"+b.toString(16)};Blockly.utils.colour.hexToRgb=function(a){a=Blockly.utils.colour.parse(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; Blockly.utils.colour.hsvToHex=function(a,b,c){var d=0,e=0,f=0;if(0==b)f=e=d=c;else{var g=Math.floor(a/60),h=a/60-g;a=c*(1-b);var k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return Blockly.utils.colour.rgbToHex(Math.floor(d),Math.floor(e),Math.floor(f))}; Blockly.utils.colour.blend=function(a,b,c){a=Blockly.utils.colour.parse(a);if(!a)return null;b=Blockly.utils.colour.parse(b);if(!b)return null;a=Blockly.utils.colour.hexToRgb(a);b=Blockly.utils.colour.hexToRgb(b);return Blockly.utils.colour.rgbToHex(Math.round(b[0]+c*(a[0]-b[0])),Math.round(b[1]+c*(a[1]-b[1])),Math.round(b[2]+c*(a[2]-b[2])))}; -Blockly.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};Blockly.utils.Coordinate=function(a,b){this.x=a;this.y=b};Blockly.utils.Coordinate.equals=function(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1};Blockly.utils.Coordinate.distance=function(a,b){var c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)};Blockly.utils.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};Blockly.utils.Coordinate.difference=function(a,b){return new Blockly.utils.Coordinate(a.x-b.x,a.y-b.y)}; +Blockly.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};Blockly.utils.Coordinate=function(a,b){this.x=a;this.y=b};Blockly.utils.Coordinate.equals=function(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1};Blockly.utils.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};Blockly.utils.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};Blockly.utils.Coordinate.difference=function(a,b){return new Blockly.utils.Coordinate(a.x-b.x,a.y-b.y)}; Blockly.utils.Coordinate.sum=function(a,b){return new Blockly.utils.Coordinate(a.x+b.x,a.y+b.y)};Blockly.utils.Coordinate.prototype.scale=function(a){this.x*=a;this.y*=a;return this};Blockly.utils.Coordinate.prototype.translate=function(a,b){this.x+=a;this.y+=b;return this};Blockly.utils.string={};Blockly.utils.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};Blockly.utils.string.shortestStringLength=function(a){return a.length?a.reduce(function(a,c){return a.lengthb&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;a=[];var h=c.length/e,k=1;for(d=0;df);return g}; +Blockly.utils.string.commonWordPrefix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;for(var c=0,d=b||Blockly.utils.string.shortestStringLength(a),e=0;eb&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;var h=[],k=c.length/e,l=1;for(d=0;df);return g}; Blockly.utils.string.wrapScore_=function(a,b,c){for(var d=[0],e=[],f=0;fd&&(d=h,e=g)}return e?Blockly.utils.string.wrapMutate_(a,e,c):b};Blockly.utils.string.wrapToText_=function(a,b){for(var c=[],d=0;d=h?(e=2,f=h,(h=a.join(""))&&c.push(h),a.length=0):"{"==h?e=3:(a.push("%",h),e=0):2==e?"0"<=h&&"9">=h?f+=h:(c.push(parseInt(f,10)),g--,e=0):3==e&&(""==h?(a.splice(0,0,"%{"),g--,e=0):"}"!=h?a.push(h):(e=a.join(""),/[A-Z]\w*/i.test(e)?(h=e.toUpperCase(), -(h=Blockly.utils.string.startsWith(h,"BKY_")?h.substring(4):null)&&h in Blockly.Msg?(e=Blockly.Msg[h],"string"==typeof e?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=a.length=0))}(h=a.join(""))&&c.push(h);b=[];for(g=a.length=0;g=k?(e=2,g=k,(k=f.join(""))&&c.push(k),f.length=0):"{"==k?e=3:(f.push("%",k),e=0):2==e?"0"<=k&&"9">=k?g+=k:(c.push(parseInt(g,10)),h--,e=0):3==e&&(""==k?(f.splice(0,0,"%{"),h--,e=0):"}"!=k?f.push(k):(e=f.join(""),/[A-Z]\w*/i.test(e)?(k=e.toUpperCase(),(k= +Blockly.utils.string.startsWith(k,"BKY_")?k.substring(4):null)&&k in Blockly.Msg?(e=Blockly.Msg[k],"string"==typeof e?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=f.length=0))}(k=f.join(""))&&c.push(k);d=[];for(h=f.length=0;hc;c++)b[c]=Blockly.utils.genUid.soup_.charAt(Math.random()*a);return b.join("")};Blockly.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Blockly.utils.is3dSupported=function(){if(void 0!==Blockly.utils.is3dSupported.cached_)return Blockly.utils.is3dSupported.cached_;if(!Blockly.utils.global.getComputedStyle)return!1;var a=document.createElement("p"),b="none",c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,null);for(var d in c)if(void 0!==a.style[d]){a.style[d]="translate3d(1px,1px,1px)";b=Blockly.utils.global.getComputedStyle(a); if(!b)return document.body.removeChild(a),!1;b=b.getPropertyValue(c[d])}document.body.removeChild(a);Blockly.utils.is3dSupported.cached_="none"!==b;return Blockly.utils.is3dSupported.cached_};Blockly.utils.runAfterPageLoad=function(a){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)a();else var b=setInterval(function(){"complete"==document.readyState&&(clearInterval(b),a())},10)}; -Blockly.utils.getViewportBBox=function(){var a=Blockly.utils.style.getViewportPageOffset();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};Blockly.utils.arrayRemove=function(a,b){b=a.indexOf(b);if(-1==b)return!1;a.splice(b,1);return!0}; -Blockly.utils.getDocumentScroll=function(){var a=document.documentElement,b=window;return Blockly.utils.userAgent.IE&&b.pageYOffset!=a.scrollTop?new Blockly.utils.Coordinate(a.scrollLeft,a.scrollTop):new Blockly.utils.Coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)};Blockly.utils.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(a=0;b=d[a];a++)c[b.type]?c[b.type]++:c[b.type]=1;return c}; -Blockly.utils.screenToWsCoordinates=function(a,b){var c=b.x;b=b.y;var d=a.getInjectionDiv().getBoundingClientRect();c=new Blockly.utils.Coordinate(c-d.left,b-d.top);b=a.getOriginOffsetInPixels();return Blockly.utils.Coordinate.difference(c,b).scale(1/a.scale)}; +Blockly.utils.getViewportBBox=function(){var a=Blockly.utils.style.getViewportPageOffset();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};Blockly.utils.arrayRemove=function(a,b){var c=a.indexOf(b);if(-1==c)return!1;a.splice(c,1);return!0}; +Blockly.utils.getDocumentScroll=function(){var a=document.documentElement,b=window;return Blockly.utils.userAgent.IE&&b.pageYOffset!=a.scrollTop?new Blockly.utils.Coordinate(a.scrollLeft,a.scrollTop):new Blockly.utils.Coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}; +Blockly.utils.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);if(b){var e=a.getNextBlock();e&&(e=d.indexOf(e),d.splice(e,d.length-e))}e=0;for(var f;f=d[e];e++)c[f.type]?c[f.type]++:c[f.type]=1;return c};Blockly.utils.screenToWsCoordinates=function(a,b){var c=b.x,d=b.y,e=a.getInjectionDiv().getBoundingClientRect();c=new Blockly.utils.Coordinate(c-e.left,d-e.top);d=a.getOriginOffsetInPixels();return Blockly.utils.Coordinate.difference(c,d).scale(1/a.scale)}; Blockly.utils.parseBlockColour=function(a){var b="string"==typeof a?Blockly.utils.replaceMessageReferences(a):a,c=Number(b);if(!isNaN(c)&&0<=c&&360>=c)return{hue:c,hex:Blockly.utils.colour.hsvToHex(c,Blockly.HSV_SATURATION,255*Blockly.HSV_VALUE)};if(c=Blockly.utils.colour.parse(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!=b&&(c+=' (from "'+a+'")');throw Error(c);};Blockly.Events={};Blockly.Events.group_="";Blockly.Events.recordUndo=!0;Blockly.Events.disabled_=0;Blockly.Events.CREATE="create";Blockly.Events.BLOCK_CREATE=Blockly.Events.CREATE;Blockly.Events.DELETE="delete";Blockly.Events.BLOCK_DELETE=Blockly.Events.DELETE;Blockly.Events.CHANGE="change";Blockly.Events.BLOCK_CHANGE=Blockly.Events.CHANGE;Blockly.Events.MOVE="move";Blockly.Events.BLOCK_MOVE=Blockly.Events.MOVE;Blockly.Events.VAR_CREATE="var_create";Blockly.Events.VAR_DELETE="var_delete"; Blockly.Events.VAR_RENAME="var_rename";Blockly.Events.UI="ui";Blockly.Events.COMMENT_CREATE="comment_create";Blockly.Events.COMMENT_DELETE="comment_delete";Blockly.Events.COMMENT_CHANGE="comment_change";Blockly.Events.COMMENT_MOVE="comment_move";Blockly.Events.FINISHED_LOADING="finished_loading";Blockly.Events.BUMP_EVENTS=[Blockly.Events.BLOCK_CREATE,Blockly.Events.BLOCK_MOVE,Blockly.Events.COMMENT_CREATE,Blockly.Events.COMMENT_MOVE];Blockly.Events.FIRE_QUEUE_=[]; Blockly.Events.fire=function(a){Blockly.Events.isEnabled()&&(Blockly.Events.FIRE_QUEUE_.length||setTimeout(Blockly.Events.fireNow_,0),Blockly.Events.FIRE_QUEUE_.push(a))};Blockly.Events.fireNow_=function(){for(var a=Blockly.Events.filter(Blockly.Events.FIRE_QUEUE_,!0),b=Blockly.Events.FIRE_QUEUE_.length=0,c;c=a[b];b++)if(c.workspaceId){var d=Blockly.Workspace.getById(c.workspaceId);d&&d.fireChangeListener(c)}}; -Blockly.Events.filter=function(a,b){a=a.slice();b||a.reverse();for(var c=[],d=Object.create(null),e=0,f;f=a[e];e++)if(!f.isNull()){var g=[f.type,f.blockId,f.workspaceId].join(" "),h=d[g],k=h?h.event:null;if(!h)d[g]={event:f,index:e},c.push(f);else if(f.type==Blockly.Events.MOVE&&h.index==e-1)k.newParentId=f.newParentId,k.newInputName=f.newInputName,k.newCoordinate=f.newCoordinate,h.index=e;else if(f.type==Blockly.Events.CHANGE&&f.element==k.element&&f.name==k.name)k.newValue=f.newValue;else if(f.type!= -Blockly.Events.UI||"click"!=f.element||"commentOpen"!=k.element&&"mutatorOpen"!=k.element&&"warningOpen"!=k.element)d[g]={event:f,index:1},c.push(f)}a=c.filter(function(a){return!a.isNull()});b||a.reverse();for(e=1;f=a[e];e++)f.type==Blockly.Events.CHANGE&&"mutation"==f.element&&a.unshift(a.splice(e,1)[0]);return a};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++}; +Blockly.Events.filter=function(a,b){var c=a.slice();b||c.reverse();for(var d=[],e=Object.create(null),f=0,g;g=c[f];f++)if(!g.isNull()){var h=[g.type,g.blockId,g.workspaceId].join(" "),k=e[h],l=k?k.event:null;if(!k)e[h]={event:g,index:f},d.push(g);else if(g.type==Blockly.Events.MOVE&&k.index==f-1)l.newParentId=g.newParentId,l.newInputName=g.newInputName,l.newCoordinate=g.newCoordinate,k.index=f;else if(g.type==Blockly.Events.CHANGE&&g.element==l.element&&g.name==l.name)l.newValue=g.newValue;else if(g.type!= +Blockly.Events.UI||"click"!=g.element||"commentOpen"!=l.element&&"mutatorOpen"!=l.element&&"warningOpen"!=l.element)e[h]={event:g,index:1},d.push(g)}c=d.filter(function(a){return!a.isNull()});b||c.reverse();for(f=1;g=c[f];f++)g.type==Blockly.Events.CHANGE&&"mutation"==g.element&&c.unshift(c.splice(f,1)[0]);return c};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++}; Blockly.Events.enable=function(){Blockly.Events.disabled_--};Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds=function(a){var b=[];a=a.getDescendants(!1);for(var c=0,d;d=a[c];c++)b[c]=d.id;return b}; Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null,"","","","");break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c= new Blockly.Events.VarRename(null,"");break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null,"","","");break;case Blockly.Events.COMMENT_CREATE:c=new Blockly.Events.CommentCreate(null);break;case Blockly.Events.COMMENT_CHANGE:c=new Blockly.Events.CommentChange(null,"","");break;case Blockly.Events.COMMENT_MOVE:c=new Blockly.Events.CommentMove(null);break;case Blockly.Events.COMMENT_DELETE:c=new Blockly.Events.CommentDelete(null);break;case Blockly.Events.FINISHED_LOADING:c=new Blockly.Events.FinishedLoading(b); break;default:throw Error("Unknown event type.");}c.fromJson(a);c.workspaceId=b.id;return c}; -Blockly.Events.disableOrphans=function(a){if((a.type==Blockly.Events.MOVE||a.type==Blockly.Events.CREATE)&&a.workspaceId){var b=Blockly.Workspace.getById(a.workspaceId);if(a=b.getBlockById(a.blockId)){var c=a.getParent();if(c&&c.isEnabled())for(b=a.getDescendants(!1),a=0;c=b[a];a++)c.setEnabled(!0);else if((a.outputConnection||a.previousConnection)&&!b.isDragging()){do a.setEnabled(!1),a=a.getNextBlock();while(a)}}}};Blockly.Events.Abstract=function(){this.workspaceId=void 0;this.group=Blockly.Events.getGroup();this.recordUndo=Blockly.Events.recordUndo};Blockly.Events.Abstract.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};Blockly.Events.Abstract.prototype.fromJson=function(a){this.group=a.group};Blockly.Events.Abstract.prototype.isNull=function(){return!1};Blockly.Events.Abstract.prototype.run=function(a){}; -Blockly.Events.Abstract.prototype.getEventWorkspace_=function(){if(this.workspaceId)var a=Blockly.Workspace.getById(this.workspaceId);if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};Blockly.utils.object={};Blockly.utils.object.inherits=function(a,b){a.superClass_=b.prototype;a.prototype=Object.create(b.prototype);a.prototype.constructor=a};Blockly.utils.object.mixin=function(a,b){for(var c in b)a[c]=b[c]};Blockly.utils.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(b){return a[b]})};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this);this.blockId=a?a.id:null;this.workspaceId=a?a.workspace.id:void 0;this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};Blockly.utils.object.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI; -Blockly.Events.Ui.prototype.toJson=function(){var a=Blockly.Events.Ui.superClass_.toJson.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.blockId&&(a.blockId=this.blockId);return a};Blockly.Events.Ui.prototype.fromJson=function(a){Blockly.Events.Ui.superClass_.fromJson.call(this,a);this.element=a.element;this.newValue=a.newValue;this.blockId=a.blockId};Blockly.utils.dom={};Blockly.utils.dom.SVG_NS="http://www.w3.org/2000/svg";Blockly.utils.dom.HTML_NS="http://www.w3.org/1999/xhtml";Blockly.utils.dom.XLINK_NS="http://www.w3.org/1999/xlink";Blockly.utils.dom.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};Blockly.utils.dom.cacheWidths_=null;Blockly.utils.dom.cacheReference_=0;Blockly.utils.dom.canvasContext_=null; -Blockly.utils.dom.createSvgElement=function(a,b,c){a=document.createElementNS(Blockly.utils.dom.SVG_NS,a);for(var d in b)a.setAttribute(d,b[d]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);c&&c.appendChild(a);return a};Blockly.utils.dom.addClass=function(a,b){var c=a.getAttribute("class")||"";if(-1!=(" "+c+" ").indexOf(" "+b+" "))return!1;c&&(c+=" ");a.setAttribute("class",c+b);return!0}; -Blockly.utils.dom.removeClass=function(a,b){var c=a.getAttribute("class");if(-1==(" "+c+" ").indexOf(" "+b+" "))return!1;c=c.split(/\s+/);for(var d=0;db||b>this.getChildCount())throw Error(Blockly.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);this.childIndex_[a.getId()]=a;if(a.getParent()==this){var d=this.children_.indexOf(a);-1>>/g,a),a=document.createElement("style"),a.id="blockly-common-style",c=document.createTextNode(c),a.appendChild(c),document.head.insertBefore(a,document.head.firstChild))}};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; -Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;", -"left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);", -"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {", -"max-height: 300px;","overflow: auto;","overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;", -"border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {", -"fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {", -'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {", -"display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text, .blocklyBlockDragSurface text {", -"user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;", -"}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {", -"z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,", -".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {", -"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;", -"border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;', -"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {", -"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font-family: Arial, sans-serif;","font-size: 13px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {", -"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {", -"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,", -".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}",".blocklyComputeCanvas {", -"position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}"];Blockly.utils.math={};Blockly.utils.math.toRadians=function(a){return a*Math.PI/180};Blockly.utils.math.toDegrees=function(a){return 180*a/Math.PI};Blockly.utils.math.clamp=function(a,b,c){if(ce.top?Blockly.DropDownDiv.getPositionAboveMetrics_(c,d,e,f):b+f.heightdocument.documentElement.clientTop?Blockly.DropDownDiv.getPositionAboveMetrics_(c, -d,e,f):Blockly.DropDownDiv.getPositionTopOfPageMetrics_(a,e,f)};Blockly.DropDownDiv.getPositionBelowMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(Blockly.DropDownDiv.ARROW_SIZE/2+Blockly.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}}; -Blockly.DropDownDiv.getPositionAboveMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*Blockly.DropDownDiv.BORDER_SIZE-Blockly.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}}; -Blockly.DropDownDiv.getPositionTopOfPageMetrics_=function(a,b,c){a=Blockly.DropDownDiv.getPositionX(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowVisible:!1}};Blockly.DropDownDiv.getPositionX=function(a,b,c,d){var e=a;a=Blockly.utils.math.clamp(b,a-d/2,c-d);e-=Blockly.DropDownDiv.ARROW_SIZE/2;b=Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING;d=Blockly.utils.math.clamp(b,e-a,d-b-Blockly.DropDownDiv.ARROW_SIZE);return{arrowX:d,divX:a}}; -Blockly.DropDownDiv.isVisible=function(){return!!Blockly.DropDownDiv.owner_};Blockly.DropDownDiv.hideIfOwner=function(a,b){return Blockly.DropDownDiv.owner_===a?(b?Blockly.DropDownDiv.hideWithoutAnimation():Blockly.DropDownDiv.hide(),!0):!1}; -Blockly.DropDownDiv.hide=function(){var a=Blockly.DropDownDiv.DIV_;a.style.transform="translate(0, 0)";a.style.opacity=0;Blockly.DropDownDiv.animateOutTimer_=setTimeout(function(){Blockly.DropDownDiv.hideWithoutAnimation()},1E3*Blockly.DropDownDiv.ANIMATION_TIME);Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null)}; -Blockly.DropDownDiv.hideWithoutAnimation=function(){if(Blockly.DropDownDiv.isVisible()){Blockly.DropDownDiv.animateOutTimer_&&clearTimeout(Blockly.DropDownDiv.animateOutTimer_);var a=Blockly.DropDownDiv.DIV_;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null);Blockly.DropDownDiv.clearContent();Blockly.DropDownDiv.owner_= -null;Blockly.DropDownDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.rendererClassName_),Blockly.DropDownDiv.rendererClassName_=null);Blockly.DropDownDiv.themeClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.themeClassName_),Blockly.DropDownDiv.themeClassName_=null);Blockly.getMainWorkspace().markFocused()}}; -Blockly.DropDownDiv.positionInternal_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionMetrics_(a,b,c,d);a.arrowVisible?(Blockly.DropDownDiv.arrow_.style.display="",Blockly.DropDownDiv.arrow_.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",Blockly.DropDownDiv.arrow_.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):Blockly.DropDownDiv.arrow_.style.display="none";b=Math.floor(a.initialX);c=Math.floor(a.initialY); -d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=Blockly.DropDownDiv.DIV_;f.style.left=b+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return a.arrowAtTop}; -Blockly.DropDownDiv.repositionForWindowResize=function(){if(Blockly.DropDownDiv.owner_){var a=Blockly.DropDownDiv.owner_,b=Blockly.DropDownDiv.owner_.getSourceBlock();a=Blockly.DropDownDiv.positionToField_?Blockly.DropDownDiv.getScaledBboxOfField_(a):Blockly.DropDownDiv.getScaledBboxOfBlock_(b);b=a.left+(a.right-a.left)/2;Blockly.DropDownDiv.positionInternal_(b,a.bottom,b,a.top)}else Blockly.DropDownDiv.hide()};Blockly.Grid=function(a,b){this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap};Blockly.Grid.prototype.scale_=1;Blockly.Grid.prototype.dispose=function(){this.gridPattern_=null};Blockly.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};Blockly.Grid.prototype.getSpacing=function(){return this.spacing_};Blockly.Grid.prototype.getPatternId=function(){return this.gridPattern_.id}; -Blockly.Grid.prototype.update=function(a){this.scale_=a;var b=this.spacing_*a||100;this.gridPattern_.setAttribute("width",b);this.gridPattern_.setAttribute("height",b);b=Math.floor(this.spacing_/2)+.5;var c=b-this.length_/2,d=b+this.length_/2;b*=a;c*=a;d*=a;this.setLineAttributes_(this.line1_,a,c,d,b,b);this.setLineAttributes_(this.line2_,a,b,b,c,d)}; -Blockly.Grid.prototype.setLineAttributes_=function(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",b),a.setAttribute("x1",c),a.setAttribute("y1",e),a.setAttribute("x2",d),a.setAttribute("y2",f))};Blockly.Grid.prototype.moveTo=function(a,b){this.gridPattern_.setAttribute("x",a);this.gridPattern_.setAttribute("y",b);(Blockly.utils.userAgent.IE||Blockly.utils.userAgent.EDGE)&&this.update(this.scale_)}; -Blockly.Grid.createDom=function(a,b,c){a=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);0b.indexOf(d))throw Error(d+" is not a valid modifier key.");};Blockly.user.keyMap.createSerializedKey=function(a,b){var c="",d=Blockly.utils.object.values(Blockly.user.keyMap.modifierKeys);Blockly.user.keyMap.checkModifiers_(b,d);for(var e=0,f;f=d[e];e++)-1]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var c=a;a=a.replace(b,"$1 $2")}while(a!=c);return a};Blockly.Xml.domToPrettyText=function(a){a=Blockly.Xml.domToText(a).split("<");for(var b="",c=1;c"!=d.slice(-2)&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; -Blockly.Xml.textToDom=function(a){var b=Blockly.utils.xml.textToDomDocument(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};Blockly.Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();a=Blockly.Xml.domToWorkspace(a,b);b.setResizesEnabled(!0);return a}; +Blockly.Xml.domToText=function(a){a=Blockly.utils.xml.domToText(a);var b=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var c=a;a=a.replace(b,"$1 $2")}while(a!=c);return a.replace(/<(\w+)([^<]*)\/>/g,"<$1$2>")}; +Blockly.Xml.domToPrettyText=function(a){a=Blockly.Xml.domToText(a).split("<");for(var b="",c=1;c"!=d.slice(-2)&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +Blockly.Xml.textToDom=function(a){var b=Blockly.utils.xml.textToDomDocument(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};Blockly.Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();var c=Blockly.Xml.domToWorkspace(a,b);b.setResizesEnabled(!0);return c}; Blockly.Xml.domToWorkspace=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var d;b.RTL&&(d=b.getWidth());c=[];Blockly.utils.dom.startTextWidthCache();var e=Blockly.Events.getGroup();e||Blockly.Events.setGroup(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(var g=0,h;h=a.childNodes[g];g++){var k=h.nodeName.toLowerCase(),l=h;if("block"==k||"shadow"==k&&!Blockly.Events.recordUndo){var m= Blockly.Xml.domToBlock(l,b);c.push(m.id);var n=l.hasAttribute("x")?parseInt(l.getAttribute("x"),10):10,p=l.hasAttribute("y")?parseInt(l.getAttribute("y"),10):10;isNaN(n)||isNaN(p)||m.moveBy(b.RTL?d-n:n,p);f=!1}else{if("shadow"==k)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==k)b.rendered?Blockly.WorkspaceCommentSvg?Blockly.WorkspaceCommentSvg.fromXml(l,b,d):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):Blockly.WorkspaceComment? Blockly.WorkspaceComment.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==k){if(f)Blockly.Xml.domToVariables(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");f=!1}}}}finally{e||Blockly.Events.setGroup(!1),Blockly.utils.dom.stopTextWidthCache()}b.setResizesEnabled&&b.setResizesEnabled(!0);Blockly.Events.fire(new Blockly.Events.FinishedLoading(b)); -return c};Blockly.Xml.appendDomToWorkspace=function(a,b){var c;b.hasOwnProperty("scale")&&(c=b.getBlocksBoundingBox());a=Blockly.Xml.domToWorkspace(a,b);if(c&&c.top!=c.bottom){var d=c.bottom;var e=b.RTL?c.right:c.left;var f=Infinity,g=-Infinity,h=Infinity;for(c=0;cg&&(g=k.x)}d=d-h+10;e=b.RTL?e-g:e-f;for(c=0;ch&&(h=l.x)}e=e-k+10;f=b.RTL?f-h:f-g;for(c=0;c document.");}else a=null;return a};Blockly.Touch={};Blockly.Touch.TOUCH_ENABLED="ontouchstart"in Blockly.utils.global||!!(Blockly.utils.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!Blockly.utils.global.navigator||!Blockly.utils.global.navigator.maxTouchPoints&&!Blockly.utils.global.navigator.msMaxTouchPoints);Blockly.Touch.touchIdentifier_=null;Blockly.Touch.TOUCH_MAP={}; +c.setInputsInline("true"==e);(e=a.getAttribute("disabled"))&&c.setEnabled("true"!=e&&"disabled"!=e);(e=a.getAttribute("deletable"))&&c.setDeletable("true"==e);(e=a.getAttribute("movable"))&&c.setMovable("true"==e);(e=a.getAttribute("editable"))&&c.setEditable("true"==e);(e=a.getAttribute("collapsed"))&&c.setCollapsed("true"==e);if("shadow"==a.nodeName.toLowerCase()){d=c.getChildren(!1);for(e=0;f=d[e];e++)if(!f.isShadow())throw TypeError("Shadow block not allowed non-shadow child.");if(c.getVarModels().length)throw TypeError("Shadow blocks cannot have variable references."); +c.setShadow(!0)}return c};Blockly.Xml.domToField_=function(a,b,c){var d=a.getField(b);d?d.fromXml(c):console.warn("Ignoring non-existent field "+b+" in block "+a.type)};Blockly.Xml.deleteNext=function(a){for(var b=0,c;c=a.childNodes[b];b++)if("next"==c.nodeName.toLowerCase()){a.removeChild(c);break}}; +Blockly.Connection=function(a,b){this.sourceBlock_=a;this.type=b};Blockly.Connection.CAN_CONNECT=0;Blockly.Connection.REASON_SELF_CONNECTION=1;Blockly.Connection.REASON_WRONG_TYPE=2;Blockly.Connection.REASON_TARGET_NULL=3;Blockly.Connection.REASON_CHECKS_FAILED=4;Blockly.Connection.REASON_DIFFERENT_WORKSPACES=5;Blockly.Connection.REASON_SHADOW_PARENT=6;Blockly.Connection.prototype.targetConnection=null;Blockly.Connection.prototype.disposed=!1;Blockly.Connection.prototype.check_=null; +Blockly.Connection.prototype.shadowDom_=null;Blockly.Connection.prototype.x=0;Blockly.Connection.prototype.y=0; +Blockly.Connection.prototype.connect_=function(a){var b=this,c=b.getSourceBlock(),d=a.getSourceBlock();a.isConnected()&&a.disconnect();if(b.isConnected()){var e=b.targetBlock(),f=b.getShadowDom();b.setShadowDom(null);if(e.isShadow())f=Blockly.Xml.blockToDom(e),e.dispose(!1),e=null;else if(b.type==Blockly.INPUT_VALUE){if(!e.outputConnection)throw Error("Orphan block does not have an output connection.");var g=Blockly.Connection.lastConnectionInRow(d,e);g&&(e.outputConnection.connect(g),e=null)}else if(b.type== +Blockly.NEXT_STATEMENT){if(!e.previousConnection)throw Error("Orphan block does not have a previous connection.");for(g=d;g.nextConnection;){var h=g.getNextBlock();if(h&&!h.isShadow())g=h;else{e.previousConnection.checkType(g.nextConnection)&&(g.nextConnection.connect(e.previousConnection),e=null);break}}}if(e&&(b.disconnect(),Blockly.Events.recordUndo)){var k=Blockly.Events.getGroup();setTimeout(function(){if(e.workspace&&!e.getParent()){Blockly.Events.setGroup(k);if(e.outputConnection)e.outputConnection.onFailedConnect(b); +else if(e.previousConnection)e.previousConnection.onFailedConnect(b);Blockly.Events.setGroup(!1)}},Blockly.BUMP_DELAY)}b.setShadowDom(f)}var l;Blockly.Events.isEnabled()&&(l=new Blockly.Events.BlockMove(d));Blockly.Connection.connectReciprocally_(b,a);d.setParent(c);l&&(l.recordNew(),Blockly.Events.fire(l))};Blockly.Connection.prototype.dispose=function(){if(this.isConnected()){this.setShadowDom(null);var a=this.targetBlock();a.isShadow()?a.dispose(!1):a.unplug()}this.disposed=!0}; +Blockly.Connection.prototype.getSourceBlock=function(){return this.sourceBlock_};Blockly.Connection.prototype.isSuperior=function(){return this.type==Blockly.INPUT_VALUE||this.type==Blockly.NEXT_STATEMENT};Blockly.Connection.prototype.isConnected=function(){return!!this.targetConnection}; +Blockly.Connection.prototype.canConnectWithReason=function(a){if(!a)return Blockly.Connection.REASON_TARGET_NULL;if(this.isSuperior())var b=this.sourceBlock_,c=a.getSourceBlock();else c=this.sourceBlock_,b=a.getSourceBlock();return b&&b==c?Blockly.Connection.REASON_SELF_CONNECTION:a.type!=Blockly.OPPOSITE_TYPE[this.type]?Blockly.Connection.REASON_WRONG_TYPE:b&&c&&b.workspace!==c.workspace?Blockly.Connection.REASON_DIFFERENT_WORKSPACES:this.checkType(a)?b.isShadow()&&!c.isShadow()?Blockly.Connection.REASON_SHADOW_PARENT: +Blockly.Connection.CAN_CONNECT:Blockly.Connection.REASON_CHECKS_FAILED}; +Blockly.Connection.prototype.checkConnection=function(a){switch(this.canConnectWithReason(a)){case Blockly.Connection.CAN_CONNECT:break;case Blockly.Connection.REASON_SELF_CONNECTION:throw Error("Attempted to connect a block to itself.");case Blockly.Connection.REASON_DIFFERENT_WORKSPACES:throw Error("Blocks not on same workspace.");case Blockly.Connection.REASON_WRONG_TYPE:throw Error("Attempt to connect incompatible types.");case Blockly.Connection.REASON_TARGET_NULL:throw Error("Target connection is null."); +case Blockly.Connection.REASON_CHECKS_FAILED:throw Error("Connection checks failed. "+(this+" expected "+this.check_+", found "+a.check_));case Blockly.Connection.REASON_SHADOW_PARENT:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!");}}; +Blockly.Connection.prototype.canConnectToPrevious_=function(a){if(this.targetConnection||-1!=Blockly.draggingConnections.indexOf(a))return!1;if(!a.targetConnection)return!0;a=a.targetBlock();return a.isInsertionMarker()?!a.getPreviousBlock():!1}; +Blockly.Connection.prototype.isConnectionAllowed=function(a){if(a.sourceBlock_.isInsertionMarker()||this.canConnectWithReason(a)!=Blockly.Connection.CAN_CONNECT)return!1;switch(a.type){case Blockly.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(a);case Blockly.OUTPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isInsertionMarker()||this.isConnected())return!1;break;case Blockly.INPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow())return!1;break;case Blockly.NEXT_STATEMENT:if(a.isConnected()&& +!this.sourceBlock_.nextConnection&&!a.targetBlock().isShadow()&&a.targetBlock().nextConnection)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=Blockly.draggingConnections.indexOf(a)?!1:!0};Blockly.Connection.prototype.onFailedConnect=function(a){}; +Blockly.Connection.prototype.connect=function(a){if(this.targetConnection!=a){this.checkConnection(a);var b=Blockly.Events.getGroup();b||Blockly.Events.setGroup(!0);this.isSuperior()?this.connect_(a):a.connect_(this);b||Blockly.Events.setGroup(!1)}};Blockly.Connection.connectReciprocally_=function(a,b){if(!a||!b)throw Error("Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a}; +Blockly.Connection.singleConnection_=function(a,b){for(var c=null,d=0;dc)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);a=Blockly.utils.dom.createSvgElement("circle",{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());Blockly.blockAnimations.connectionUiStep_(a,new Date,c)}}; +Blockly.blockAnimations.connectionUiStep_=function(a,b,c){var d=(new Date-b)/150;1a.workspace.scale)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);Blockly.blockAnimations.disconnectUiStep_(a.getSvgRoot(),b,new Date)}}; +Blockly.blockAnimations.disconnectUiStep_=function(a,b,c){var d=(new Date-c)/200;1c-Blockly.CURRENT_CONNECTION_PREFERENCE)}if(this.localConnection_||this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set."); +else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0};Blockly.InsertionMarkerManager.prototype.getCandidate_=function(a){for(var b=this.getStartRadius_(),c=null,d=null,e=0;e=a||isNaN(a)||this.scrollViewSize_Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=setTimeout(Blockly.Tooltip.show_, -Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1}; -Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){Blockly.Tooltip.DIV.innerHTML="";for(var a=Blockly.Tooltip.element_.tooltip;"function"==typeof a;)a=a();a=Blockly.utils.string.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;bc+window.scrollY&&(e-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?d=Math.max(Blockly.Tooltip.MARGINS-window.scrollX, -d):d+Blockly.Tooltip.DIV.offsetWidth>b+window.scrollX-2*Blockly.Tooltip.MARGINS&&(d=b-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=e+"px";Blockly.Tooltip.DIV.style.left=d+"px"}};Blockly.WorkspaceDragSurfaceSvg=function(a){this.container_=a;this.createDom()};Blockly.WorkspaceDragSurfaceSvg.prototype.SVG_=null;Blockly.WorkspaceDragSurfaceSvg.prototype.dragGroup_=null;Blockly.WorkspaceDragSurfaceSvg.prototype.container_=null; -Blockly.WorkspaceDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.container_.appendChild(this.SVG_))}; -Blockly.WorkspaceDragSurfaceSvg.prototype.translateSurface=function(a,b){a=a.toFixed(0);b=b.toFixed(0);this.SVG_.style.display="block";Blockly.utils.dom.setCssTransform(this.SVG_,"translate3d("+a+"px, "+b+"px, 0px)")};Blockly.WorkspaceDragSurfaceSvg.prototype.getSurfaceTranslation=function(){return Blockly.utils.getRelativeXY(this.SVG_)}; -Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var b=this.SVG_.childNodes[0],c=this.SVG_.childNodes[1];if(!(b&&c&&Blockly.utils.dom.hasClass(b,"blocklyBlockCanvas")&&Blockly.utils.dom.hasClass(c,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.previousSibling_?Blockly.utils.dom.insertAfter(b,this.previousSibling_):a.insertBefore(b,a.firstChild); -Blockly.utils.dom.insertAfter(c,b);this.SVG_.style.display="none";if(this.SVG_.childNodes.length)throw Error("Drag surface was not cleared.");Blockly.utils.dom.setCssTransform(this.SVG_,"");this.previousSibling_=null}; -Blockly.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(a,b,c,d,e,f){if(this.SVG_.childNodes.length)throw Error("Already dragging a block.");this.previousSibling_=c;a.setAttribute("transform","translate(0, 0) scale("+f+")");b.setAttribute("transform","translate(0, 0) scale("+f+")");this.SVG_.setAttribute("width",d);this.SVG_.setAttribute("height",e);this.SVG_.appendChild(a);this.SVG_.appendChild(b);this.SVG_.style.display="block"};Blockly.ASTNode=function(a,b,c){if(!b)throw Error("Cannot create a node without a location.");this.type_=a;this.isConnection_=Blockly.ASTNode.isConnectionType_(a);this.location_=b;this.processParams_(c||null)};Blockly.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"};Blockly.ASTNode.NAVIGATE_ALL_FIELDS=!1;Blockly.ASTNode.DEFAULT_OFFSET_Y=-20;Blockly.ASTNode.isConnectionType_=function(a){switch(a){case Blockly.ASTNode.types.PREVIOUS:case Blockly.ASTNode.types.NEXT:case Blockly.ASTNode.types.INPUT:case Blockly.ASTNode.types.OUTPUT:return!0}return!1}; -Blockly.ASTNode.createFieldNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.FIELD,a):null}; -Blockly.ASTNode.createConnectionNode=function(a){return a?a.type==Blockly.INPUT_VALUE||a.type==Blockly.NEXT_STATEMENT&&a.getParentInput()?Blockly.ASTNode.createInputNode(a.getParentInput()):a.type==Blockly.NEXT_STATEMENT?new Blockly.ASTNode(Blockly.ASTNode.types.NEXT,a):a.type==Blockly.OUTPUT_VALUE?new Blockly.ASTNode(Blockly.ASTNode.types.OUTPUT,a):a.type==Blockly.PREVIOUS_STATEMENT?new Blockly.ASTNode(Blockly.ASTNode.types.PREVIOUS,a):null:null}; -Blockly.ASTNode.createInputNode=function(a){return a&&a.connection?new Blockly.ASTNode(Blockly.ASTNode.types.INPUT,a.connection):null};Blockly.ASTNode.createBlockNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.BLOCK,a):null};Blockly.ASTNode.createStackNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.STACK,a):null};Blockly.ASTNode.createWorkspaceNode=function(a,b){return b&&a?new Blockly.ASTNode(Blockly.ASTNode.types.WORKSPACE,a,{wsCoordinate:b}):null}; -Blockly.ASTNode.prototype.processParams_=function(a){a&&a.wsCoordinate&&(this.wsCoordinate_=a.wsCoordinate)};Blockly.ASTNode.prototype.getLocation=function(){return this.location_};Blockly.ASTNode.prototype.getType=function(){return this.type_};Blockly.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_};Blockly.ASTNode.prototype.isConnection=function(){return this.isConnection_}; -Blockly.ASTNode.prototype.findNextForInput_=function(){var a=this.location_.getParentInput(),b=a.getSourceBlock();a=b.inputList.indexOf(a)+1;for(var c;c=b.inputList[a];a++){for(var d=c.fieldRow,e=0,f;f=d[e];e++)if(f.isClickable()||Blockly.ASTNode.NAVIGATE_ALL_FIELDS)return Blockly.ASTNode.createFieldNode(f);if(c.connection)return Blockly.ASTNode.createInputNode(c)}return null}; -Blockly.ASTNode.prototype.findNextForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;b=c.inputList[d];d++){for(var e=b.fieldRow;ac)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);a=Blockly.utils.dom.createSvgElement("circle",{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());Blockly.blockAnimations.connectionUiStep_(a,new Date,c)}}; -Blockly.blockAnimations.connectionUiStep_=function(a,b,c){var d=(new Date-b)/150;1a.workspace.scale)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);Blockly.blockAnimations.disconnectUiStep_(a.getSvgRoot(),b,new Date)}}; -Blockly.blockAnimations.disconnectUiStep_=function(a,b,c){var d=(new Date-c)/200;1b-Blockly.CURRENT_CONNECTION_PREFERENCE)}if(this.localConnection_||this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set."); -else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0};Blockly.InsertionMarkerManager.prototype.getCandidate_=function(a){for(var b=this.getStartRadius_(),c=null,d=null,e=0;eb.indexOf(d))throw Error(d+" is not a valid modifier key.");};Blockly.user.keyMap.createSerializedKey=function(a,b){var c="",d=Blockly.utils.object.values(Blockly.user.keyMap.modifierKeys);Blockly.user.keyMap.checkModifiers_(b,d);for(var e=0,f;f=d[e];e++)-1 document.");}else a=null;return a};Blockly.VariableMap=function(a){this.variableMap_=Object.create(null);this.workspace=a};Blockly.VariableMap.prototype.clear=function(){this.variableMap_=Object.create(null)};Blockly.VariableMap.prototype.renameVariable=function(a,b){var c=this.getVariable(b,a.type),d=this.workspace.getAllBlocks(!1);Blockly.Events.setGroup(!0);try{c&&c.getId()!=a.getId()?this.renameVariableWithConflict_(a,b,c,d):this.renameVariableAndUses_(a,b,d)}finally{Blockly.Events.setGroup(!1)}}; Blockly.VariableMap.prototype.renameVariableById=function(a,b){var c=this.getVariableById(a);if(!c)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.renameVariable(c,b)};Blockly.VariableMap.prototype.renameVariableAndUses_=function(a,b,c){Blockly.Events.fire(new Blockly.Events.VarRename(a,b));a.name=b;for(b=0;ba.viewWidth)return b;if(this.workspace_.RTL)var c=this.anchorXY_.x-b,d=c-this.width_,e=a.viewLeft+a.viewWidth,f=a.viewLeft+Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;else d=b+this.anchorXY_.x,c=d+this.width_,f=a.viewLeft,e=a.viewLeft+a.viewWidth-Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;this.workspace_.RTL?de&&(b=-(e-this.anchorXY_.x)): de&&(b=e-this.anchorXY_.x-this.width_);return b};Blockly.Bubble.prototype.getOptimalRelativeTop_=function(a){var b=-this.height_/4;if(this.height_>a.viewHeight)return b;var c=this.anchorXY_.y+b,d=c+this.height_,e=a.viewTop;a=a.viewTop+a.viewHeight-Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;var f=this.anchorXY_.y;ca&&(b=a-f-this.height_);return b}; Blockly.Bubble.prototype.positionBubble_=function(){var a=this.anchorXY_.x;a=this.workspace_.RTL?a-(this.relativeLeft_+this.width_):a+this.relativeLeft_;this.moveTo(a,this.relativeTop_+this.anchorXY_.y)};Blockly.Bubble.prototype.moveTo=function(a,b){this.bubbleGroup_.setAttribute("transform","translate("+a+","+b+")")};Blockly.Bubble.prototype.setDragging=function(a){!a&&this.moveCallback_&&this.moveCallback_()}; @@ -362,18 +304,18 @@ Blockly.Events.CommentBase.prototype.fromJson=function(a){Blockly.Events.Comment Blockly.Events.CommentChange.prototype.toJson=function(){var a=Blockly.Events.CommentChange.superClass_.toJson.call(this);a.newContents=this.newContents_;return a};Blockly.Events.CommentChange.prototype.fromJson=function(a){Blockly.Events.CommentChange.superClass_.fromJson.call(this,a);this.newContents_=a.newValue};Blockly.Events.CommentChange.prototype.isNull=function(){return this.oldContents_==this.newContents_}; Blockly.Events.CommentChange.prototype.run=function(a){var b=this.getEventWorkspace_().getCommentById(this.commentId);b?b.setContent(a?this.newContents_:this.oldContents_):console.warn("Can't change non-existent comment: "+this.commentId)};Blockly.Events.CommentCreate=function(a){a&&(Blockly.Events.CommentCreate.superClass_.constructor.call(this,a),this.xml=a.toXmlWithXY())};Blockly.utils.object.inherits(Blockly.Events.CommentCreate,Blockly.Events.CommentBase); Blockly.Events.CommentCreate.prototype.type=Blockly.Events.COMMENT_CREATE;Blockly.Events.CommentCreate.prototype.toJson=function(){var a=Blockly.Events.CommentCreate.superClass_.toJson.call(this);a.xml=Blockly.Xml.domToText(this.xml);return a};Blockly.Events.CommentCreate.prototype.fromJson=function(a){Blockly.Events.CommentCreate.superClass_.fromJson.call(this,a);this.xml=Blockly.Xml.textToDom(a.xml)}; -Blockly.Events.CommentCreate.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,a)};Blockly.Events.CommentCreateDeleteHelper=function(a,b){var c=a.getEventWorkspace_();b?(b=Blockly.utils.xml.createElement("xml"),b.appendChild(a.xml),Blockly.Xml.domToWorkspace(b,c)):(c=c.getCommentById(a.commentId))?c.dispose(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.commentId)}; +Blockly.Events.CommentCreate.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,a)};Blockly.Events.CommentCreateDeleteHelper=function(a,b){var c=a.getEventWorkspace_();if(b){var d=Blockly.utils.xml.createElement("xml");d.appendChild(a.xml);Blockly.Xml.domToWorkspace(d,c)}else(c=c.getCommentById(a.commentId))?c.dispose(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.commentId)}; Blockly.Events.CommentDelete=function(a){a&&(Blockly.Events.CommentDelete.superClass_.constructor.call(this,a),this.xml=a.toXmlWithXY())};Blockly.utils.object.inherits(Blockly.Events.CommentDelete,Blockly.Events.CommentBase);Blockly.Events.CommentDelete.prototype.type=Blockly.Events.COMMENT_DELETE;Blockly.Events.CommentDelete.prototype.toJson=function(){return Blockly.Events.CommentDelete.superClass_.toJson.call(this)}; Blockly.Events.CommentDelete.prototype.fromJson=function(a){Blockly.Events.CommentDelete.superClass_.fromJson.call(this,a)};Blockly.Events.CommentDelete.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,!a)};Blockly.Events.CommentMove=function(a){a&&(Blockly.Events.CommentMove.superClass_.constructor.call(this,a),this.comment_=a,this.oldCoordinate_=a.getXY(),this.newCoordinate_=null)};Blockly.utils.object.inherits(Blockly.Events.CommentMove,Blockly.Events.CommentBase); Blockly.Events.CommentMove.prototype.recordNew=function(){if(!this.comment_)throw Error("Tried to record the new position of a comment on the same event twice.");this.newCoordinate_=this.comment_.getXY();this.comment_=null};Blockly.Events.CommentMove.prototype.type=Blockly.Events.COMMENT_MOVE;Blockly.Events.CommentMove.prototype.setOldCoordinate=function(a){this.oldCoordinate_=a}; Blockly.Events.CommentMove.prototype.toJson=function(){var a=Blockly.Events.CommentMove.superClass_.toJson.call(this);this.newCoordinate_&&(a.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y));return a};Blockly.Events.CommentMove.prototype.fromJson=function(a){Blockly.Events.CommentMove.superClass_.fromJson.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.newCoordinate_=new Blockly.utils.Coordinate(Number(a[0]),Number(a[1])))}; Blockly.Events.CommentMove.prototype.isNull=function(){return Blockly.utils.Coordinate.equals(this.oldCoordinate_,this.newCoordinate_)};Blockly.Events.CommentMove.prototype.run=function(a){var b=this.getEventWorkspace_().getCommentById(this.commentId);if(b){a=a?this.newCoordinate_:this.oldCoordinate_;var c=b.getXY();b.moveBy(a.x-c.x,a.y-c.y)}else console.warn("Can't move non-existent comment: "+this.commentId)};Blockly.BubbleDragger=function(a,b){this.draggingBubble_=a;this.workspace_=b;this.deleteArea_=null;this.wouldDeleteBubble_=!1;this.startXY_=this.draggingBubble_.getRelativeToSurfaceXY();this.dragSurface_=Blockly.utils.is3dSupported()&&b.getBlockDragSurface()?b.getBlockDragSurface():null};Blockly.BubbleDragger.prototype.dispose=function(){this.dragSurface_=this.workspace_=this.draggingBubble_=null}; Blockly.BubbleDragger.prototype.startBubbleDrag=function(){Blockly.Events.getGroup()||Blockly.Events.setGroup(!0);this.workspace_.setResizesEnabled(!1);this.draggingBubble_.setAutoLayout(!1);this.dragSurface_&&this.moveToDragSurface_();this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!0);var a=this.workspace_.getToolbox();if(a){var b=this.draggingBubble_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";a.addStyle(b)}}; -Blockly.BubbleDragger.prototype.dragBubble=function(a,b){b=this.pixelsToWorkspaceUnits_(b);b=Blockly.utils.Coordinate.sum(this.startXY_,b);this.draggingBubble_.moveDuringDrag(this.dragSurface_,b);this.draggingBubble_.isDeletable()&&(this.deleteArea_=this.workspace_.isDeleteArea(a),this.updateCursorDuringBubbleDrag_())}; +Blockly.BubbleDragger.prototype.dragBubble=function(a,b){var c=this.pixelsToWorkspaceUnits_(b);c=Blockly.utils.Coordinate.sum(this.startXY_,c);this.draggingBubble_.moveDuringDrag(this.dragSurface_,c);this.draggingBubble_.isDeletable()&&(this.deleteArea_=this.workspace_.isDeleteArea(a),this.updateCursorDuringBubbleDrag_())}; Blockly.BubbleDragger.prototype.maybeDeleteBubble_=function(){var a=this.workspace_.trashcan;this.wouldDeleteBubble_?(a&&setTimeout(a.close.bind(a),100),this.fireMoveEvent_(),this.draggingBubble_.dispose(!1,!0)):a&&a.close();return this.wouldDeleteBubble_}; Blockly.BubbleDragger.prototype.updateCursorDuringBubbleDrag_=function(){this.wouldDeleteBubble_=this.deleteArea_!=Blockly.DELETE_AREA_NONE;var a=this.workspace_.trashcan;this.wouldDeleteBubble_?(this.draggingBubble_.setDeleteStyle(!0),this.deleteArea_==Blockly.DELETE_AREA_TRASH&&a&&a.setOpen(!0)):(this.draggingBubble_.setDeleteStyle(!1),a&&a.setOpen(!1))}; -Blockly.BubbleDragger.prototype.endBubbleDrag=function(a,b){this.dragBubble(a,b);a=this.pixelsToWorkspaceUnits_(b);a=Blockly.utils.Coordinate.sum(this.startXY_,a);this.draggingBubble_.moveTo(a.x,a.y);this.maybeDeleteBubble_()||(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_());this.workspace_.setResizesEnabled(!0);this.workspace_.getToolbox()&&(a=this.draggingBubble_.isDeletable()? -"blocklyToolboxDelete":"blocklyToolboxGrab",this.workspace_.getToolbox().removeStyle(a));Blockly.Events.setGroup(!1)};Blockly.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var a=new Blockly.Events.CommentMove(this.draggingBubble_);a.setOldCoordinate(this.startXY_);a.recordNew();Blockly.Events.fire(a)}}; +Blockly.BubbleDragger.prototype.endBubbleDrag=function(a,b){this.dragBubble(a,b);var c=this.pixelsToWorkspaceUnits_(b);c=Blockly.utils.Coordinate.sum(this.startXY_,c);this.draggingBubble_.moveTo(c.x,c.y);this.maybeDeleteBubble_()||(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_());this.workspace_.setResizesEnabled(!0);this.workspace_.getToolbox()&&(c=this.draggingBubble_.isDeletable()? +"blocklyToolboxDelete":"blocklyToolboxGrab",this.workspace_.getToolbox().removeStyle(c));Blockly.Events.setGroup(!1)};Blockly.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var a=new Blockly.Events.CommentMove(this.draggingBubble_);a.setOldCoordinate(this.startXY_);a.recordNew();Blockly.Events.fire(a)}}; Blockly.BubbleDragger.prototype.pixelsToWorkspaceUnits_=function(a){a=new Blockly.utils.Coordinate(a.x/this.workspace_.scale,a.y/this.workspace_.scale);this.workspace_.isMutator&&a.scale(1/this.workspace_.options.parentWorkspace.scale);return a};Blockly.BubbleDragger.prototype.moveToDragSurface_=function(){this.draggingBubble_.moveTo(0,0);this.dragSurface_.translateSurface(this.startXY_.x,this.startXY_.y);this.dragSurface_.setBlocksAndShow(this.draggingBubble_.getSvgRoot())};Blockly.WorkspaceDragger=function(a){this.workspace_=a;this.startScrollXY_=new Blockly.utils.Coordinate(a.scrollX,a.scrollY)};Blockly.WorkspaceDragger.prototype.dispose=function(){this.workspace_=null};Blockly.WorkspaceDragger.prototype.startDrag=function(){Blockly.selected&&Blockly.selected.unselect();this.workspace_.setupDragSurface()};Blockly.WorkspaceDragger.prototype.endDrag=function(a){this.drag(a);this.workspace_.resetDragSurface()}; Blockly.WorkspaceDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.workspace_.scroll(a.x,a.y)};Blockly.FlyoutDragger=function(a){Blockly.FlyoutDragger.superClass_.constructor.call(this,a.getWorkspace());this.scrollbar_=a.scrollbar_;this.horizontalLayout_=a.horizontalLayout_};Blockly.utils.object.inherits(Blockly.FlyoutDragger,Blockly.WorkspaceDragger);Blockly.FlyoutDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.horizontalLayout_?this.scrollbar_.set(-a.x):this.scrollbar_.set(-a.y)};Blockly.Action=function(a,b){this.name=a;this.desc=b};Blockly.navigation={};Blockly.navigation.loggingCallback=null;Blockly.navigation.STATE_FLYOUT=1;Blockly.navigation.STATE_WS=2;Blockly.navigation.STATE_TOOLBOX=3;Blockly.navigation.WS_MOVE_DISTANCE=40;Blockly.navigation.currentState_=Blockly.navigation.STATE_WS; Blockly.navigation.actionNames={PREVIOUS:"previous",NEXT:"next",IN:"in",OUT:"out",INSERT:"insert",MARK:"mark",DISCONNECT:"disconnect",TOOLBOX:"toolbox",EXIT:"exit",TOGGLE_KEYBOARD_NAV:"toggle_keyboard_nav",MOVE_WS_CURSOR_UP:"move workspace cursor up",MOVE_WS_CURSOR_DOWN:"move workspace cursor down",MOVE_WS_CURSOR_LEFT:"move workspace cursor left",MOVE_WS_CURSOR_RIGHT:"move workspace cursor right"};Blockly.navigation.MARKER_NAME="local_marker_1";Blockly.navigation.getMarker=function(){return Blockly.getMainWorkspace().getMarker(Blockly.navigation.MARKER_NAME)}; @@ -403,7 +345,7 @@ Blockly.navigation.onBlocklyAction=function(a){var b=Blockly.getMainWorkspace(). Blockly.navigation.handleActions_=function(a){return a.name==Blockly.navigation.actionNames.TOOLBOX||Blockly.navigation.currentState_==Blockly.navigation.STATE_TOOLBOX?Blockly.navigation.toolboxOnAction_(a):a.name==Blockly.navigation.actionNames.TOGGLE_KEYBOARD_NAV?(Blockly.navigation.disableKeyboardAccessibility(),!0):Blockly.navigation.currentState_==Blockly.navigation.STATE_WS?Blockly.navigation.workspaceOnAction_(a):Blockly.navigation.currentState_==Blockly.navigation.STATE_FLYOUT?Blockly.navigation.flyoutOnAction_(a): !1};Blockly.navigation.flyoutOnAction_=function(a){var b=Blockly.getMainWorkspace(),c=b.getToolbox();if((b=c?c.flyout_:b.getFlyout())&&b.onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.OUT:return Blockly.navigation.focusToolbox_(),!0;case Blockly.navigation.actionNames.MARK:return Blockly.navigation.insertFromFlyout(),!0;case Blockly.navigation.actionNames.EXIT:return Blockly.navigation.focusWorkspace_(),!0;default:return!1}}; Blockly.navigation.toolboxOnAction_=function(a){var b=Blockly.getMainWorkspace(),c=b.getToolbox();return c&&c.onBlocklyAction(a)?!0:a.name===Blockly.navigation.actionNames.TOOLBOX?(b.getToolbox()?Blockly.navigation.focusToolbox_():Blockly.navigation.focusFlyout_(),!0):a.name===Blockly.navigation.actionNames.IN?(Blockly.navigation.focusFlyout_(),!0):a.name===Blockly.navigation.actionNames.EXIT?(Blockly.navigation.focusWorkspace_(),!0):!1}; -Blockly.navigation.moveWSCursor_=function(a,b){var c=Blockly.getMainWorkspace().getCursor(),d=Blockly.getMainWorkspace().getCursor().getCurNode();if(d.getType()!==Blockly.ASTNode.types.WORKSPACE)return!1;d=d.getWsCoordinate();a=a*Blockly.navigation.WS_MOVE_DISTANCE+d.x;b=b*Blockly.navigation.WS_MOVE_DISTANCE+d.y;c.setCurNode(Blockly.ASTNode.createWorkspaceNode(Blockly.getMainWorkspace(),new Blockly.utils.Coordinate(a,b)));return!0}; +Blockly.navigation.moveWSCursor_=function(a,b){var c=Blockly.getMainWorkspace().getCursor(),d=Blockly.getMainWorkspace().getCursor().getCurNode();if(d.getType()!==Blockly.ASTNode.types.WORKSPACE)return!1;var e=d.getWsCoordinate();d=a*Blockly.navigation.WS_MOVE_DISTANCE+e.x;e=b*Blockly.navigation.WS_MOVE_DISTANCE+e.y;c.setCurNode(Blockly.ASTNode.createWorkspaceNode(Blockly.getMainWorkspace(),new Blockly.utils.Coordinate(d,e)));return!0}; Blockly.navigation.workspaceOnAction_=function(a){if(Blockly.getMainWorkspace().getCursor().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.INSERT:return Blockly.navigation.modify_(),!0;case Blockly.navigation.actionNames.MARK:return Blockly.navigation.handleEnterForWS_(),!0;case Blockly.navigation.actionNames.DISCONNECT:return Blockly.navigation.disconnectBlocks_(),!0;case Blockly.navigation.actionNames.MOVE_WS_CURSOR_UP:return Blockly.navigation.moveWSCursor_(0,-1); case Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN:return Blockly.navigation.moveWSCursor_(0,1);case Blockly.navigation.actionNames.MOVE_WS_CURSOR_LEFT:return Blockly.navigation.moveWSCursor_(-1,0);case Blockly.navigation.actionNames.MOVE_WS_CURSOR_RIGHT:return Blockly.navigation.moveWSCursor_(1,0);default:return!1}}; Blockly.navigation.handleEnterForWS_=function(){var a=Blockly.getMainWorkspace().getCursor().getCurNode(),b=a.getType();b==Blockly.ASTNode.types.FIELD?a.getLocation().showEditor():a.isConnection()||b==Blockly.ASTNode.types.WORKSPACE?Blockly.navigation.markAtCursor_():b==Blockly.ASTNode.types.BLOCK?Blockly.navigation.warn_("Cannot mark a block."):b==Blockly.ASTNode.types.STACK&&Blockly.navigation.warn_("Cannot mark a stack.")}; @@ -411,7 +353,15 @@ Blockly.navigation.ACTION_PREVIOUS=new Blockly.Action(Blockly.navigation.actionN Blockly.navigation.ACTION_INSERT=new Blockly.Action(Blockly.navigation.actionNames.INSERT,"Connect the current location to the marked location.");Blockly.navigation.ACTION_MARK=new Blockly.Action(Blockly.navigation.actionNames.MARK,"Mark the current location.");Blockly.navigation.ACTION_DISCONNECT=new Blockly.Action(Blockly.navigation.actionNames.DISCONNECT,"Disconnect the block at the current location from its parent."); Blockly.navigation.ACTION_TOOLBOX=new Blockly.Action(Blockly.navigation.actionNames.TOOLBOX,"Open the toolbox.");Blockly.navigation.ACTION_EXIT=new Blockly.Action(Blockly.navigation.actionNames.EXIT,"Close the current modal, such as a toolbox or field editor.");Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV=new Blockly.Action(Blockly.navigation.actionNames.TOGGLE_KEYBOARD_NAV,"Turns on and off keyboard navigation."); Blockly.navigation.ACTION_MOVE_WS_CURSOR_LEFT=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_LEFT,"Move the workspace cursor to the lefts.");Blockly.navigation.ACTION_MOVE_WS_CURSOR_RIGHT=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_RIGHT,"Move the workspace cursor to the right.");Blockly.navigation.ACTION_MOVE_WS_CURSOR_UP=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_UP,"Move the workspace cursor up."); -Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN,"Move the workspace cursor down.");Blockly.navigation.READONLY_ACTION_LIST=[Blockly.navigation.ACTION_PREVIOUS,Blockly.navigation.ACTION_OUT,Blockly.navigation.ACTION_IN,Blockly.navigation.ACTION_NEXT,Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV];Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=new Blockly.utils.Coordinate(0,0);this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null;this.creatorWorkspace_=b;this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_= +Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN,"Move the workspace cursor down.");Blockly.navigation.READONLY_ACTION_LIST=[Blockly.navigation.ACTION_PREVIOUS,Blockly.navigation.ACTION_OUT,Blockly.navigation.ACTION_IN,Blockly.navigation.ACTION_NEXT,Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV];Blockly.Tooltip={};Blockly.Tooltip.visible=!1;Blockly.Tooltip.blocked_=!1;Blockly.Tooltip.LIMIT=50;Blockly.Tooltip.mouseOutPid_=0;Blockly.Tooltip.showPid_=0;Blockly.Tooltip.lastX_=0;Blockly.Tooltip.lastY_=0;Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.OFFSET_X=0;Blockly.Tooltip.OFFSET_Y=10;Blockly.Tooltip.RADIUS_OK=10;Blockly.Tooltip.HOVER_MS=750;Blockly.Tooltip.MARGINS=5;Blockly.Tooltip.DIV=null; +Blockly.Tooltip.createDom=function(){Blockly.Tooltip.DIV||(Blockly.Tooltip.DIV=document.createElement("div"),Blockly.Tooltip.DIV.className="blocklyTooltipDiv",document.body.appendChild(Blockly.Tooltip.DIV))};Blockly.Tooltip.bindMouseEvents=function(a){Blockly.bindEvent_(a,"mouseover",null,Blockly.Tooltip.onMouseOver_);Blockly.bindEvent_(a,"mouseout",null,Blockly.Tooltip.onMouseOut_);a.addEventListener("mousemove",Blockly.Tooltip.onMouseMove_,!1)}; +Blockly.Tooltip.onMouseOver_=function(a){if(!Blockly.Tooltip.blocked_){for(a=a.currentTarget;"string"!=typeof a.tooltip&&"function"!=typeof a.tooltip;)a=a.tooltip;Blockly.Tooltip.element_!=a&&(Blockly.Tooltip.hide(),Blockly.Tooltip.poisonedElement_=null,Blockly.Tooltip.element_=a);clearTimeout(Blockly.Tooltip.mouseOutPid_)}}; +Blockly.Tooltip.onMouseOut_=function(a){Blockly.Tooltip.blocked_||(Blockly.Tooltip.mouseOutPid_=setTimeout(function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()},1),clearTimeout(Blockly.Tooltip.showPid_))}; +Blockly.Tooltip.onMouseMove_=function(a){if(Blockly.Tooltip.element_&&Blockly.Tooltip.element_.tooltip&&!Blockly.Tooltip.blocked_)if(Blockly.Tooltip.visible){var b=Blockly.Tooltip.lastX_-a.pageX;a=Blockly.Tooltip.lastY_-a.pageY;Math.sqrt(b*b+a*a)>Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=setTimeout(Blockly.Tooltip.show_, +Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1}; +Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){Blockly.Tooltip.DIV.innerHTML="";for(var a=Blockly.Tooltip.element_.tooltip;"function"==typeof a;)a=a();a=Blockly.utils.string.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;bc+window.scrollY&&(e-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?d=Math.max(Blockly.Tooltip.MARGINS-window.scrollX, +d):d+Blockly.Tooltip.DIV.offsetWidth>b+window.scrollX-2*Blockly.Tooltip.MARGINS&&(d=b-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=e+"px";Blockly.Tooltip.DIV.style.left=d+"px"}};Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=new Blockly.utils.Coordinate(0,0);this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null;this.creatorWorkspace_=b;this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_= this.calledUpdateIsDragging_=!1;this.healStack_=!Blockly.DRAG_STACK};Blockly.Gesture.prototype.dispose=function(){Blockly.Touch.clearTouchIdentifier();Blockly.Tooltip.unblock();this.creatorWorkspace_.clearGesture();this.onMoveWrapper_&&Blockly.unbindEvent_(this.onMoveWrapper_);this.onUpWrapper_&&Blockly.unbindEvent_(this.onUpWrapper_);this.blockDragger_&&this.blockDragger_.dispose();this.workspaceDragger_&&this.workspaceDragger_.dispose();this.bubbleDragger_&&this.bubbleDragger_.dispose()}; Blockly.Gesture.prototype.updateFromEvent_=function(a){var b=new Blockly.utils.Coordinate(a.clientX,a.clientY);this.updateDragDelta_(b)&&(this.updateIsDragging_(),Blockly.longStop_());this.mostRecentEvent_=a}; Blockly.Gesture.prototype.updateDragDelta_=function(a){this.currentDragDeltaXY_=Blockly.utils.Coordinate.difference(a,this.mouseDownXY_);return this.hasExceededDragRadius_?!1:this.hasExceededDragRadius_=Blockly.utils.Coordinate.magnitude(this.currentDragDeltaXY_)>(this.flyout_?Blockly.FLYOUT_DRAG_RADIUS:Blockly.DRAG_RADIUS)}; @@ -484,7 +434,7 @@ Blockly.Block.prototype.setParent=function(a){if(a!=this.parentBlock_){if(this.p Blockly.Block.prototype.getDescendants=function(a){for(var b=[this],c=this.getChildren(a),d,e=0;d=c[e];e++)b.push.apply(b,d.getDescendants(a));return b};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setDeletable=function(a){this.deletable_=a};Blockly.Block.prototype.isMovable=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)}; Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isDuplicatable=function(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(Blockly.utils.getBlockTypeCounts(this,!0)):!0};Blockly.Block.prototype.isShadow=function(){return this.isShadow_};Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isInsertionMarker=function(){return this.isInsertionMarker_}; Blockly.Block.prototype.setInsertionMarker=function(a){this.isInsertionMarker_=a};Blockly.Block.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setEditable=function(a){this.editable_=a;a=0;for(var b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.updateEditable()};Blockly.Block.prototype.isDisposed=function(){return this.disposed}; -Blockly.Block.prototype.getMatchingConnection=function(a,b){var c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!=a.length)throw Error("Connection lists did not match in length.");for(var d=0;d=k||k>b.length)throw Error('Block "'+this.type+'": Message index %'+k+" out of range.");if(f[k])throw Error('Block "'+this.type+'": Message index %'+k+" duplicated.");f[k]=!0;g++;a.push(b[k-1])}else(k=k.trim())&&a.push(k)}if(g!=b.length)throw Error('Block "'+this.type+'": Message does not reference all '+b.length+" arg(s)."); a.length&&("string"==typeof a[a.length-1]||Blockly.utils.string.startsWith(a[a.length-1].type,"field_"))&&(h={type:"input_dummy"},c&&(h.align=c),a.push(h));c={LEFT:Blockly.ALIGN_LEFT,RIGHT:Blockly.ALIGN_RIGHT,CENTRE:Blockly.ALIGN_CENTRE,CENTER:Blockly.ALIGN_CENTRE};b=[];for(h=0;h=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);ab||b>this.getChildCount())throw Error(Blockly.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);this.childIndex_[a.getId()]=a;if(a.getParent()==this){var d=this.children_.indexOf(a);-1a?b-1:a},this.highlightedIndex_)}; -Blockly.Menu.prototype.highlightHelper=function(a,b){b=0>b?-1:b;var c=this.getChildCount();b=a.call(this,b,c);for(var d=0;d<=c;){var e=this.getChildAt(b);if(e&&this.canHighlightItem(e))return this.setHighlightedIndex(b),!0;d++;b=a.call(this,b,c)}return!1};Blockly.Menu.prototype.canHighlightItem=function(a){return a.isEnabled()};Blockly.Menu.prototype.handleMouseOver_=function(a){(a=this.getMenuItem(a.target))&&a.isEnabled()&&this.getHighlighted()!==a&&(this.unhighlightCurrent(),this.setHighlighted(a))}; -Blockly.Menu.prototype.handleClick_=function(a){var b=this.openingCoords;this.openingCoords=null;if(b&&"number"===typeof a.clientX){var c=new Blockly.utils.Coordinate(a.clientX,a.clientY);if(1>Blockly.utils.Coordinate.distance(b,c))return}(b=this.getMenuItem(a.target))&&b.handleClick(a)&&a.preventDefault()};Blockly.Menu.prototype.handleMouseEnter_=function(a){this.focus()};Blockly.Menu.prototype.handleMouseLeave_=function(a){this.getElement()&&(this.blur(),this.clearHighlighted())}; -Blockly.Menu.prototype.handleKeyEvent=function(a){return 0!=this.getChildCount()&&this.handleKeyEventInternal(a)?(a.preventDefault(),a.stopPropagation(),!0):!1}; +Blockly.Menu.prototype.highlightHelper=function(a,b){var c=0>b?-1:b,d=this.getChildCount();c=a.call(this,c,d);for(var e=0;e<=d;){var f=this.getChildAt(c);if(f&&this.canHighlightItem(f))return this.setHighlightedIndex(c),!0;e++;c=a.call(this,c,d)}return!1};Blockly.Menu.prototype.canHighlightItem=function(a){return a.isEnabled()}; +Blockly.Menu.prototype.handleMouseOver_=function(a){if(a=this.getMenuItem(a.target))a.isEnabled()?this.getHighlighted()!==a&&(this.unhighlightCurrent(),this.setHighlighted(a)):this.unhighlightCurrent()};Blockly.Menu.prototype.handleClick_=function(a){var b=this.openingCoords;this.openingCoords=null;if(b&&"number"===typeof a.clientX){var c=new Blockly.utils.Coordinate(a.clientX,a.clientY);if(1>Blockly.utils.Coordinate.distance(b,c))return}(b=this.getMenuItem(a.target))&&b.handleClick(a)&&a.preventDefault()}; +Blockly.Menu.prototype.handleMouseEnter_=function(a){this.focus()};Blockly.Menu.prototype.handleMouseLeave_=function(a){this.getElement()&&(this.blur(),this.clearHighlighted())};Blockly.Menu.prototype.handleKeyEvent=function(a){return 0!=this.getChildCount()&&this.handleKeyEventInternal(a)?(a.preventDefault(),a.stopPropagation(),!0):!1}; Blockly.Menu.prototype.handleKeyEventInternal=function(a){var b=this.getHighlighted();if(b&&"function"==typeof b.handleKeyEvent&&b.handleKeyEvent(a))return!0;if(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return!1;switch(a.keyCode){case Blockly.utils.KeyCodes.ENTER:b&&b.performActionInternal(a);break;case Blockly.utils.KeyCodes.UP:this.highlightPrevious();break;case Blockly.utils.KeyCodes.DOWN:this.highlightNext();break;default:return!1}return!0};Blockly.MenuItem=function(a,b){Blockly.Component.call(this);this.setContentInternal(a);this.setValue(b);this.enabled_=!0};Blockly.utils.object.inherits(Blockly.MenuItem,Blockly.Component); Blockly.MenuItem.prototype.createDom=function(){var a=document.createElement("div");a.id=this.getId();this.setElementInternal(a);a.className="goog-menuitem goog-option "+(this.enabled_?"":"goog-menuitem-disabled ")+(this.checked_?"goog-option-selected ":"")+(this.isRightToLeft()?"goog-menuitem-rtl ":"");var b=this.getContentWrapperDom();a.appendChild(b);var c=this.getCheckboxDom();c&&b.appendChild(c);b.appendChild(this.getContentDom());Blockly.utils.aria.setRole(a,this.roleName_||(this.checkable_? Blockly.utils.aria.Role.MENUITEMCHECKBOX:Blockly.utils.aria.Role.MENUITEM));Blockly.utils.aria.setState(a,Blockly.utils.aria.State.SELECTED,this.checkable_&&this.checked_||!1)};Blockly.MenuItem.prototype.getCheckboxDom=function(){if(!this.checkable_)return null;var a=document.createElement("div");a.className="goog-menuitem-checkbox";return a};Blockly.MenuItem.prototype.getContentDom=function(){var a=this.content_;"string"===typeof a&&(a=document.createTextNode(a));return a}; @@ -562,12 +526,12 @@ Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSou Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())}; Blockly.RenderedConnection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.checkType(this.targetConnection)||((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours())};Blockly.Marker=function(){this.drawer_=this.curNode_=this.colour=null;this.type="marker"};Blockly.Marker.prototype.setDrawer=function(a){this.drawer_=a};Blockly.Marker.prototype.getDrawer=function(){return this.drawer_};Blockly.Marker.prototype.getCurNode=function(){return this.curNode_};Blockly.Marker.prototype.setCurNode=function(a){var b=this.curNode_;this.curNode_=a;this.drawer_&&this.drawer_.draw(b,this.curNode_)}; Blockly.Marker.prototype.draw=function(){this.drawer_&&this.drawer_.draw(this.curNode_,this.curNode_)};Blockly.Marker.prototype.hide=function(){this.drawer_&&this.drawer_.hide()};Blockly.Marker.prototype.dispose=function(){this.getDrawer()&&this.getDrawer().dispose()};Blockly.Cursor=function(){Blockly.Cursor.superClass_.constructor.call(this);this.type="cursor"};Blockly.utils.object.inherits(Blockly.Cursor,Blockly.Marker);Blockly.Cursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;for(a=a.next();a&&a.next()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.next();a&&this.setCurNode(a);return a}; -Blockly.Cursor.prototype.in=function(){var a=this.getCurNode();if(!a)return null;if(a.getType()==Blockly.ASTNode.types.PREVIOUS||a.getType()==Blockly.ASTNode.types.OUTPUT)a=a.next();(a=a.in())&&this.setCurNode(a);return a};Blockly.Cursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;for(a=a.prev();a&&a.prev()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.prev();a&&this.setCurNode(a);return a}; +Blockly.Cursor.prototype["in"]=function(){var a=this.getCurNode();if(!a)return null;if(a.getType()==Blockly.ASTNode.types.PREVIOUS||a.getType()==Blockly.ASTNode.types.OUTPUT)a=a.next();(a=a["in"]())&&this.setCurNode(a);return a};Blockly.Cursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;for(a=a.prev();a&&a.prev()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.prev();a&&this.setCurNode(a);return a}; Blockly.Cursor.prototype.out=function(){var a=this.getCurNode();if(!a)return null;(a=a.out())&&a.getType()==Blockly.ASTNode.types.BLOCK&&(a=a.prev()||a);a&&this.setCurNode(a);return a}; -Blockly.Cursor.prototype.onBlocklyAction=function(a){if(this.getCurNode()&&this.getCurNode().getType()===Blockly.ASTNode.types.FIELD&&this.getCurNode().getLocation().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.OUT:return this.out(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;case Blockly.navigation.actionNames.IN:return this.in(),!0;default:return!1}};Blockly.BasicCursor=function(){Blockly.BasicCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.BasicCursor,Blockly.Cursor);Blockly.BasicCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.in=function(){return this.next()}; -Blockly.BasicCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.out=function(){return this.prev()};Blockly.BasicCursor.prototype.getNextNode_=function(a,b){if(!a)return null;var c=a.in()||a.next();if(b(c))return c;if(c)return this.getNextNode_(c,b);a=this.findSiblingOrParent_(a.out());return b(a)?a:a?this.getNextNode_(a,b):null}; +Blockly.Cursor.prototype.onBlocklyAction=function(a){if(this.getCurNode()&&this.getCurNode().getType()===Blockly.ASTNode.types.FIELD&&this.getCurNode().getLocation().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.OUT:return this.out(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;case Blockly.navigation.actionNames.IN:return this["in"](),!0;default:return!1}};Blockly.BasicCursor=function(){Blockly.BasicCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.BasicCursor,Blockly.Cursor);Blockly.BasicCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype["in"]=function(){return this.next()}; +Blockly.BasicCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.out=function(){return this.prev()};Blockly.BasicCursor.prototype.getNextNode_=function(a,b){if(!a)return null;var c=a["in"]()||a.next();if(b(c))return c;if(c)return this.getNextNode_(c,b);c=this.findSiblingOrParent_(a.out());return b(c)?c:c?this.getNextNode_(c,b):null}; Blockly.BasicCursor.prototype.getPreviousNode_=function(a,b){if(!a)return null;var c=a.prev();c=c?this.getRightMostChild_(c):a.out();return b(c)?c:c?this.getPreviousNode_(c,b):null};Blockly.BasicCursor.prototype.validNode_=function(a){var b=!1;a=a&&a.getType();if(a==Blockly.ASTNode.types.OUTPUT||a==Blockly.ASTNode.types.INPUT||a==Blockly.ASTNode.types.FIELD||a==Blockly.ASTNode.types.NEXT||a==Blockly.ASTNode.types.PREVIOUS||a==Blockly.ASTNode.types.WORKSPACE)b=!0;return b}; -Blockly.BasicCursor.prototype.findSiblingOrParent_=function(a){if(!a)return null;var b=a.next();return b?b:this.findSiblingOrParent_(a.out())};Blockly.BasicCursor.prototype.getRightMostChild_=function(a){if(!a.in())return a;for(a=a.in();a.next();)a=a.next();return this.getRightMostChild_(a)};Blockly.TabNavigateCursor=function(){Blockly.TabNavigateCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.TabNavigateCursor,Blockly.BasicCursor);Blockly.TabNavigateCursor.prototype.validNode_=function(a){var b=!1,c=a&&a.getType();a&&(a=a.getLocation(),c==Blockly.ASTNode.types.FIELD&&a&&a.isTabNavigable()&&a.isClickable()&&(b=!0));return b};Blockly.utils.Rect=function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d};Blockly.utils.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup_,this.style);this.rendered=!1;this.workspace=a;this.previousConnection=this.nextConnection=this.outputConnection=null;this.useDragSurface_=Blockly.utils.is3dSupported()&&!!a.getBlockDragSurface();var d=this.pathObject.svgPath;d.tooltip=this;Blockly.Tooltip.bindMouseEvents(d); +Blockly.BasicCursor.prototype.findSiblingOrParent_=function(a){if(!a)return null;var b=a.next();return b?b:this.findSiblingOrParent_(a.out())};Blockly.BasicCursor.prototype.getRightMostChild_=function(a){if(!a["in"]())return a;for(a=a["in"]();a.next();)a=a.next();return this.getRightMostChild_(a)};Blockly.TabNavigateCursor=function(){Blockly.TabNavigateCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.TabNavigateCursor,Blockly.BasicCursor);Blockly.TabNavigateCursor.prototype.validNode_=function(a){var b=!1,c=a&&a.getType();a&&(a=a.getLocation(),c==Blockly.ASTNode.types.FIELD&&a&&a.isTabNavigable()&&a.isClickable()&&(b=!0));return b};Blockly.utils.Rect=function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d};Blockly.utils.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup_,this.style);this.rendered=!1;this.workspace=a;this.previousConnection=this.nextConnection=this.outputConnection=null;this.useDragSurface_=Blockly.utils.is3dSupported()&&!!a.getBlockDragSurface();var d=this.pathObject.svgPath;d.tooltip=this;Blockly.Tooltip.bindMouseEvents(d); Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c);this.svgGroup_.dataset&&(this.svgGroup_.dataset.id=this.id)};Blockly.utils.object.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.prototype.warningTextDb_=null;Blockly.BlockSvg.INLINE=-1;Blockly.BlockSvg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_"; Blockly.BlockSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();b=this.getIcons();for(a=0;a>>/g,d);d=document.createElement("style");d.id="blockly-common-style";c=document.createTextNode(c);d.appendChild(c);document.head.insertBefore(d,document.head.firstChild)}}};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;", +"left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);", +"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {", +"max-height: 300px;","overflow: auto;","overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;", +"border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {", +"fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {", +'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {", +"display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text, .blocklyBlockDragSurface text {", +"user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;", +"}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {", +"z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,", +".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {", +"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;", +"border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;', +"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {", +"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font-family: Arial, sans-serif;","font-size: 13px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {", +"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {", +"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,", +".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}",".blocklyComputeCanvas {", +"position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}"]; +Blockly.DropDownDiv=function(){};Blockly.DropDownDiv.boundsElement_=null;Blockly.DropDownDiv.owner_=null;Blockly.DropDownDiv.positionToField_=null;Blockly.DropDownDiv.ARROW_SIZE=16;Blockly.DropDownDiv.BORDER_SIZE=1;Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING=12;Blockly.DropDownDiv.PADDING_Y=16;Blockly.DropDownDiv.ANIMATION_TIME=.25;Blockly.DropDownDiv.animateOutTimer_=null;Blockly.DropDownDiv.onHide_=null;Blockly.DropDownDiv.rendererClassName_=null;Blockly.DropDownDiv.themeClassName_=null; +Blockly.DropDownDiv.createDom=function(){if(!Blockly.DropDownDiv.DIV_){var a=document.createElement("div");a.className="blocklyDropDownDiv";document.body.appendChild(a);Blockly.DropDownDiv.DIV_=a;var b=document.createElement("div");b.className="blocklyDropDownContent";a.appendChild(b);Blockly.DropDownDiv.content_=b;b=document.createElement("div");b.className="blocklyDropDownArrow";a.appendChild(b);Blockly.DropDownDiv.arrow_=b;Blockly.DropDownDiv.DIV_.style.opacity=0;Blockly.DropDownDiv.DIV_.style.transition= +"transform "+Blockly.DropDownDiv.ANIMATION_TIME+"s, opacity "+Blockly.DropDownDiv.ANIMATION_TIME+"s";a.addEventListener("focusin",function(){Blockly.utils.dom.addClass(a,"focused")});a.addEventListener("focusout",function(){Blockly.utils.dom.removeClass(a,"focused")})}};Blockly.DropDownDiv.setBoundsElement=function(a){Blockly.DropDownDiv.boundsElement_=a};Blockly.DropDownDiv.getContentDiv=function(){return Blockly.DropDownDiv.content_}; +Blockly.DropDownDiv.clearContent=function(){Blockly.DropDownDiv.content_.innerHTML="";Blockly.DropDownDiv.content_.style.width=""};Blockly.DropDownDiv.setColour=function(a,b){Blockly.DropDownDiv.DIV_.style.backgroundColor=a;Blockly.DropDownDiv.DIV_.style.borderColor=b};Blockly.DropDownDiv.showPositionedByBlock=function(a,b,c,d){return Blockly.DropDownDiv.showPositionedByRect_(Blockly.DropDownDiv.getScaledBboxOfBlock_(b),a,c,d)}; +Blockly.DropDownDiv.showPositionedByField=function(a,b,c){Blockly.DropDownDiv.positionToField_=!0;return Blockly.DropDownDiv.showPositionedByRect_(Blockly.DropDownDiv.getScaledBboxOfField_(a),a,b,c)};Blockly.DropDownDiv.getScaledBboxOfBlock_=function(a){var b=a.getSvgRoot(),c=b.getBBox(),d=a.workspace.scale;a=c.height*d;c=c.width*d;b=Blockly.utils.style.getPageOffset(b);return new Blockly.utils.Rect(b.y,b.y+a,b.x,b.x+c)}; +Blockly.DropDownDiv.getScaledBboxOfField_=function(a){a=a.getScaledBBox();return new Blockly.utils.Rect(a.top,a.bottom,a.left,a.right)};Blockly.DropDownDiv.showPositionedByRect_=function(a,b,c,d){var e=a.left+(a.right-a.left)/2,f=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();Blockly.DropDownDiv.setBoundsElement(d.workspace.getParentSvg().parentNode);return Blockly.DropDownDiv.show(b,d.RTL,e,f,e,a,c)}; +Blockly.DropDownDiv.show=function(a,b,c,d,e,f,g){Blockly.DropDownDiv.owner_=a;Blockly.DropDownDiv.onHide_=g||null;a=Blockly.DropDownDiv.DIV_;a.style.direction=b?"rtl":"ltr";Blockly.DropDownDiv.rendererClassName_=Blockly.getMainWorkspace().getRenderer().name+"-renderer";Blockly.DropDownDiv.themeClassName_=Blockly.getMainWorkspace().getTheme().name+"-theme";Blockly.utils.dom.addClass(a,Blockly.DropDownDiv.rendererClassName_);Blockly.utils.dom.addClass(a,Blockly.DropDownDiv.themeClassName_);return Blockly.DropDownDiv.positionInternal_(c, +d,e,f)};Blockly.DropDownDiv.getBoundsInfo_=function(){var a=Blockly.utils.style.getPageOffset(Blockly.DropDownDiv.boundsElement_),b=Blockly.utils.style.getSize(Blockly.DropDownDiv.boundsElement_);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}}; +Blockly.DropDownDiv.getPositionMetrics_=function(a,b,c,d){var e=Blockly.DropDownDiv.getBoundsInfo_(),f=Blockly.utils.style.getSize(Blockly.DropDownDiv.DIV_);return b+f.heighte.top?Blockly.DropDownDiv.getPositionAboveMetrics_(c,d,e,f):b+f.heightdocument.documentElement.clientTop?Blockly.DropDownDiv.getPositionAboveMetrics_(c, +d,e,f):Blockly.DropDownDiv.getPositionTopOfPageMetrics_(a,e,f)};Blockly.DropDownDiv.getPositionBelowMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(Blockly.DropDownDiv.ARROW_SIZE/2+Blockly.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}}; +Blockly.DropDownDiv.getPositionAboveMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*Blockly.DropDownDiv.BORDER_SIZE-Blockly.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}}; +Blockly.DropDownDiv.getPositionTopOfPageMetrics_=function(a,b,c){a=Blockly.DropDownDiv.getPositionX(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowVisible:!1}};Blockly.DropDownDiv.getPositionX=function(a,b,c,d){var e=a;a=Blockly.utils.math.clamp(b,a-d/2,c-d);e-=Blockly.DropDownDiv.ARROW_SIZE/2;b=Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING;d=Blockly.utils.math.clamp(b,e-a,d-b-Blockly.DropDownDiv.ARROW_SIZE);return{arrowX:d,divX:a}}; +Blockly.DropDownDiv.isVisible=function(){return!!Blockly.DropDownDiv.owner_};Blockly.DropDownDiv.hideIfOwner=function(a,b){return Blockly.DropDownDiv.owner_===a?(b?Blockly.DropDownDiv.hideWithoutAnimation():Blockly.DropDownDiv.hide(),!0):!1}; +Blockly.DropDownDiv.hide=function(){var a=Blockly.DropDownDiv.DIV_;a.style.transform="translate(0, 0)";a.style.opacity=0;Blockly.DropDownDiv.animateOutTimer_=setTimeout(function(){Blockly.DropDownDiv.hideWithoutAnimation()},1E3*Blockly.DropDownDiv.ANIMATION_TIME);Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null)}; +Blockly.DropDownDiv.hideWithoutAnimation=function(){if(Blockly.DropDownDiv.isVisible()){Blockly.DropDownDiv.animateOutTimer_&&clearTimeout(Blockly.DropDownDiv.animateOutTimer_);var a=Blockly.DropDownDiv.DIV_;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null);Blockly.DropDownDiv.clearContent();Blockly.DropDownDiv.owner_= +null;Blockly.DropDownDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.rendererClassName_),Blockly.DropDownDiv.rendererClassName_=null);Blockly.DropDownDiv.themeClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.themeClassName_),Blockly.DropDownDiv.themeClassName_=null);Blockly.getMainWorkspace().markFocused()}}; +Blockly.DropDownDiv.positionInternal_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionMetrics_(a,b,c,d);a.arrowVisible?(Blockly.DropDownDiv.arrow_.style.display="",Blockly.DropDownDiv.arrow_.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",Blockly.DropDownDiv.arrow_.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):Blockly.DropDownDiv.arrow_.style.display="none";b=Math.floor(a.initialX);c=Math.floor(a.initialY); +d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=Blockly.DropDownDiv.DIV_;f.style.left=b+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return a.arrowAtTop}; +Blockly.DropDownDiv.repositionForWindowResize=function(){if(Blockly.DropDownDiv.owner_){var a=Blockly.DropDownDiv.owner_,b=Blockly.DropDownDiv.owner_.getSourceBlock();a=Blockly.DropDownDiv.positionToField_?Blockly.DropDownDiv.getScaledBboxOfField_(a):Blockly.DropDownDiv.getScaledBboxOfBlock_(b);b=a.left+(a.right-a.left)/2;Blockly.DropDownDiv.positionInternal_(b,a.bottom,b,a.top)}else Blockly.DropDownDiv.hide()};Blockly.Grid=function(a,b){this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap};Blockly.Grid.prototype.scale_=1;Blockly.Grid.prototype.dispose=function(){this.gridPattern_=null};Blockly.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};Blockly.Grid.prototype.getSpacing=function(){return this.spacing_};Blockly.Grid.prototype.getPatternId=function(){return this.gridPattern_.id}; +Blockly.Grid.prototype.update=function(a){this.scale_=a;var b=this.spacing_*a||100;this.gridPattern_.setAttribute("width",b);this.gridPattern_.setAttribute("height",b);b=Math.floor(this.spacing_/2)+.5;var c=b-this.length_/2,d=b+this.length_/2;b*=a;c*=a;d*=a;this.setLineAttributes_(this.line1_,a,c,d,b,b);this.setLineAttributes_(this.line2_,a,b,b,c,d)}; +Blockly.Grid.prototype.setLineAttributes_=function(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",b),a.setAttribute("x1",c),a.setAttribute("y1",e),a.setAttribute("x2",d),a.setAttribute("y2",f))};Blockly.Grid.prototype.moveTo=function(a,b){this.gridPattern_.setAttribute("x",a);this.gridPattern_.setAttribute("y",b);(Blockly.utils.userAgent.IE||Blockly.utils.userAgent.EDGE)&&this.update(this.scale_)}; +Blockly.Grid.createDom=function(a,b,c){a=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);0=this.connections_.length)return-1;b=a.y;for(var d=c;0<=d&&this.connections_[d].y==b;){if(this.connections_[d]==a)return d;d--}for(;ca)c=d;else{b=d;break}}return b};Blockly.ConnectionDB.prototype.removeConnection=function(a,b){a=this.findIndexOfConnection_(a,b);if(-1==a)throw Error("Unable to find connection in connectionDB.");this.connections_.splice(a,1)}; -Blockly.ConnectionDB.prototype.getNeighbours=function(a,b){function c(a){var c=e-d[a].x,g=f-d[a].y;Math.sqrt(c*c+g*g)<=b&&k.push(d[a]);return ga)c=d;else{b=d;break}}return b};Blockly.ConnectionDB.prototype.removeConnection=function(a,b){var c=this.findIndexOfConnection_(a,b);if(-1==c)throw Error("Unable to find connection in connectionDB.");this.connections_.splice(c,1)}; +Blockly.ConnectionDB.prototype.getNeighbours=function(a,b){function c(a){var c=e-d[a].x,g=f-d[a].y;Math.sqrt(c*c+g*g)<=b&&l.push(d[a]);return ga)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");this.subscribedWorkspaces_.splice(a,1)}; +Blockly.ThemeManager.prototype.setTheme=function(a){var b=this.theme_;this.theme_=a;if(a=this.workspace_.getInjectionDiv())b&&Blockly.utils.dom.removeClass(a,b.name+"-theme"),Blockly.utils.dom.addClass(a,this.theme_.name+"-theme");for(b=0;a=this.subscribedWorkspaces_[b];b++)a.refreshTheme();b=0;a=Object.keys(this.componentDB_);for(var c;c=a[b];b++)for(var d=0,e;e=this.componentDB_[c][d];d++){var f=e.element;e=e.propertyName;var g=this.theme_&&this.theme_.getComponentStyle(c);f.style[e]=g||""}Blockly.hideChaff()}; +Blockly.ThemeManager.prototype.subscribeWorkspace=function(a){this.subscribedWorkspaces_.push(a)};Blockly.ThemeManager.prototype.unsubscribeWorkspace=function(a){a=this.subscribedWorkspaces_.indexOf(a);if(0>a)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");this.subscribedWorkspaces_.splice(a,1)}; Blockly.ThemeManager.prototype.subscribe=function(a,b,c){this.componentDB_[b]||(this.componentDB_[b]=[]);this.componentDB_[b].push({element:a,propertyName:c});b=this.theme_&&this.theme_.getComponentStyle(b);a.style[c]=b||""};Blockly.ThemeManager.prototype.unsubscribe=function(a){if(a)for(var b=Object.keys(this.componentDB_),c=0,d;d=b[c];c++){for(var e=this.componentDB_[d],f=e.length-1;0<=f;f--)e[f].element===a&&e.splice(f,1);this.componentDB_[d].length||delete this.componentDB_[d]}}; Blockly.ThemeManager.prototype.dispose=function(){this.componentDB_=this.subscribedWorkspaces_=this.theme_=this.owner_=null};Blockly.TouchGesture=function(a,b){Blockly.TouchGesture.superClass_.constructor.call(this,a,b);this.isMultiTouch_=!1;this.cachedPoints_=Object.create(null);this.startDistance_=this.previousScale_=0;this.isPinchZoomEnabled_=this.onStartWrapper_=null};Blockly.utils.object.inherits(Blockly.TouchGesture,Blockly.Gesture);Blockly.TouchGesture.ZOOM_IN_MULTIPLIER=5;Blockly.TouchGesture.ZOOM_OUT_MULTIPLIER=6; Blockly.TouchGesture.prototype.doStart=function(a){this.isPinchZoomEnabled_=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch;Blockly.TouchGesture.superClass_.doStart.call(this,a);!this.isEnding_&&Blockly.Touch.isTouchEvent(a)&&this.handleTouchStart(a)}; @@ -638,8 +650,9 @@ Blockly.TouchGesture.prototype.handleTouchMove=function(a){var b=Blockly.Touch.g Blockly.TouchGesture.prototype.handlePinch_=function(a){var b=Object.keys(this.cachedPoints_);b=Blockly.utils.Coordinate.distance(this.cachedPoints_[b[0]],this.cachedPoints_[b[1]])/this.startDistance_;if(0this.previousScale_){var c=b-this.previousScale_;c=0Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)};Blockly.TouchGesture.prototype.getTouchPoint=function(a){return this.startWorkspace_?new Blockly.utils.Coordinate(a.pageX?a.pageX:a.changedTouches[0].pageX,a.pageY?a.pageY:a.changedTouches[0].pageY):null};Blockly.WorkspaceAudio=function(a){this.parentWorkspace_=a;this.SOUNDS_=Object.create(null)};Blockly.WorkspaceAudio.prototype.lastSound_=null;Blockly.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null}; Blockly.WorkspaceAudio.prototype.load=function(a,b){if(a.length){try{var c=new Blockly.utils.global.Audio}catch(h){return}for(var d,e=0;e=this.remainingCapacity()||(this.currentGesture_&&this.currentGesture_.cancel(),"comment"==a.tagName.toLowerCase()?this.pasteWorkspaceComment_(a):this.pasteBlock_(a))}; Blockly.WorkspaceSvg.prototype.pasteBlock_=function(a){Blockly.Events.disable();try{var b=Blockly.Xml.domToBlock(a,this),c=this.getMarker(Blockly.navigation.MARKER_NAME).getCurNode();if(this.keyboardAccessibilityMode&&c&&c.isConnection()){var d=c.getLocation();Blockly.navigation.insertBlock(b,d);return}var e=parseInt(a.getAttribute("x"),10),f=parseInt(a.getAttribute("y"),10);if(!isNaN(e)&&!isNaN(f)){this.RTL&&(e=-e);do{a=!1;var g=this.getAllBlocks(!1);c=0;for(var h;h=g[c];c++){var k=h.getRelativeToSurfaceXY(); if(1>=Math.abs(e-k.x)&&1>=Math.abs(f-k.y)){a=!0;break}}if(!a){var l=b.getConnections_(!1);c=0;for(var m;m=l[c];c++)if(m.closest(Blockly.SNAP_RADIUS,new Blockly.utils.Coordinate(e,f)).connection){a=!0;break}}a&&(e=this.RTL?e-Blockly.SNAP_RADIUS:e+Blockly.SNAP_RADIUS,f+=2*Blockly.SNAP_RADIUS)}while(a);b.moveBy(e,f)}}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!b.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(b));b.select()}; @@ -678,7 +691,7 @@ Blockly.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(a){Blockly.Events Blockly.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.getFlyout()&&a.toolbox_.refreshSelection()};Blockly.WorkspaceSvg.prototype.renameVariableById=function(a,b){Blockly.WorkspaceSvg.superClass_.renameVariableById.call(this,a,b);this.refreshToolboxSelection()};Blockly.WorkspaceSvg.prototype.deleteVariableById=function(a){Blockly.WorkspaceSvg.superClass_.deleteVariableById.call(this,a);this.refreshToolboxSelection()}; Blockly.WorkspaceSvg.prototype.createVariable=function(a,b,c){a=Blockly.WorkspaceSvg.superClass_.createVariable.call(this,a,b,c);this.refreshToolboxSelection();return a};Blockly.WorkspaceSvg.prototype.recordDeleteAreas=function(){this.deleteAreaTrash_=this.trashcan&&this.svgGroup_.parentNode?this.trashcan.getClientRect():null;this.deleteAreaToolbox_=this.flyout_?this.flyout_.getClientRect():this.toolbox_?this.toolbox_.getClientRect():null}; Blockly.WorkspaceSvg.prototype.isDeleteArea=function(a){return this.deleteAreaTrash_&&this.deleteAreaTrash_.contains(a.clientX,a.clientY)?Blockly.DELETE_AREA_TRASH:this.deleteAreaToolbox_&&this.deleteAreaToolbox_.contains(a.clientX,a.clientY)?Blockly.DELETE_AREA_TOOLBOX:Blockly.DELETE_AREA_NONE};Blockly.WorkspaceSvg.prototype.onMouseDown_=function(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)}; -Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;this.dragDeltaXY_=Blockly.utils.Coordinate.difference(b,a)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return Blockly.utils.Coordinate.sum(this.dragDeltaXY_,a)}; +Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){var c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());c.x/=this.scale;c.y/=this.scale;this.dragDeltaXY_=Blockly.utils.Coordinate.difference(b,c)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return Blockly.utils.Coordinate.sum(this.dragDeltaXY_,a)}; Blockly.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag}; Blockly.WorkspaceSvg.prototype.isContentBounded=function(){return this.options.moveOptions&&this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.controls||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}; Blockly.WorkspaceSvg.prototype.isMovable=function(){return this.options.moveOptions&&this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}; @@ -702,7 +715,7 @@ a.viewTop+=a.absoluteTop;this.scroll(this.scrollX,this.scrollY);this.scrollbar&& Blockly.WorkspaceSvg.prototype.scroll=function(a,b){Blockly.hideChaff(!0);var c=this.getMetrics(),d=c.contentWidth+c.contentLeft-c.viewWidth,e=c.contentHeight+c.contentTop-c.viewHeight;a=Math.min(a,-c.contentLeft);b=Math.min(b,-c.contentTop);a=Math.max(a,-d);b=Math.max(b,-e);this.scrollX=a;this.scrollY=b;this.scrollbar&&(this.scrollbar.hScroll.setHandlePosition(-(a+c.contentLeft)*this.scrollbar.hScroll.ratio_),this.scrollbar.vScroll.setHandlePosition(-(b+c.contentTop)*this.scrollbar.vScroll.ratio_)); a+=c.absoluteLeft;b+=c.absoluteTop;this.translate(a,b)};Blockly.WorkspaceSvg.getDimensionsPx_=function(a){var b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return{width:b,height:c}};Blockly.WorkspaceSvg.getContentDimensions_=function(a,b){return a.isContentBounded()?Blockly.WorkspaceSvg.getContentDimensionsBounded_(a,b):Blockly.WorkspaceSvg.getContentDimensionsExact_(a)}; Blockly.WorkspaceSvg.getContentDimensionsExact_=function(a){var b=a.getBlocksBoundingBox(),c=a.scale;a=b.top*c;var d=b.bottom*c,e=b.left*c;b=b.right*c;return{top:a,bottom:d,left:e,right:b,width:b-e,height:d-a}}; -Blockly.WorkspaceSvg.getContentDimensionsBounded_=function(a,b){a=Blockly.WorkspaceSvg.getContentDimensionsExact_(a);var c=b.width;b=b.height;var d=c/2,e=b/2,f=Math.min(a.left-d,a.right-c),g=Math.min(a.top-e,a.bottom-b);return{left:f,top:g,height:Math.max(a.bottom+e,a.top+b)-g,width:Math.max(a.right+d,a.left+c)-f}}; +Blockly.WorkspaceSvg.getContentDimensionsBounded_=function(a,b){var c=Blockly.WorkspaceSvg.getContentDimensionsExact_(a),d=b.width,e=b.height,f=d/2,g=e/2,h=Math.min(c.left-f,c.right-d),k=Math.min(c.top-g,c.bottom-e);return{left:h,top:k,height:Math.max(c.bottom+g,c.top+e)-k,width:Math.max(c.right+f,c.left+d)-h}}; Blockly.WorkspaceSvg.getTopLevelWorkspaceMetrics_=function(){var a=Blockly.WorkspaceSvg.getDimensionsPx_(this.toolbox_),b=Blockly.WorkspaceSvg.getDimensionsPx_(this.flyout_),c=Blockly.svgSize(this.getParentSvg()),d={height:c.height,width:c.width};if(this.toolbox_)if(this.toolboxPosition==Blockly.TOOLBOX_AT_TOP||this.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM)d.height-=a.height;else{if(this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT||this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT)d.width-=a.width}else if(this.flyout_)if(this.toolboxPosition== Blockly.TOOLBOX_AT_TOP||this.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM)d.height-=b.height;else if(this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT||this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT)d.width-=b.width;var e=Blockly.WorkspaceSvg.getContentDimensions_(this,d),f=0;this.toolbox_&&this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?f=a.width:this.flyout_&&this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT&&(f=b.width);var g=0;this.toolbox_&&this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?g=a.height:this.flyout_&& this.toolboxPosition==Blockly.TOOLBOX_AT_TOP&&(g=b.height);return{contentHeight:e.height,contentWidth:e.width,contentTop:e.top,contentLeft:e.left,viewHeight:d.height,viewWidth:d.width,viewTop:-this.scrollY,viewLeft:-this.scrollX,absoluteTop:g,absoluteLeft:f,svgHeight:c.height,svgWidth:c.width,toolboxWidth:a.width,toolboxHeight:a.height,flyoutWidth:b.width,flyoutHeight:b.height,toolboxPosition:this.toolboxPosition}}; @@ -711,10 +724,10 @@ Blockly.WorkspaceSvg.prototype.getTopBlocks=function(a){return Blockly.Workspace Blockly.WorkspaceSvg.prototype.registerButtonCallback=function(a,b){if("function"!=typeof b)throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks_[a]=b};Blockly.WorkspaceSvg.prototype.getButtonCallback=function(a){return(a=this.flyoutButtonCallbacks_[a])?a:null};Blockly.WorkspaceSvg.prototype.removeButtonCallback=function(a){this.flyoutButtonCallbacks_[a]=null}; Blockly.WorkspaceSvg.prototype.registerToolboxCategoryCallback=function(a,b){if("function"!=typeof b)throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks_[a]=b};Blockly.WorkspaceSvg.prototype.getToolboxCategoryCallback=function(a){return this.toolboxCategoryCallbacks_[a]||null};Blockly.WorkspaceSvg.prototype.removeToolboxCategoryCallback=function(a){this.toolboxCategoryCallbacks_[a]=null}; Blockly.WorkspaceSvg.prototype.getGesture=function(a){var b="mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type,c=this.currentGesture_;return c?b&&c.hasStarted()?(console.warn("Tried to start the same gesture twice."),c.cancel(),null):c:b?this.currentGesture_=new Blockly.TouchGesture(a,this):null};Blockly.WorkspaceSvg.prototype.clearGesture=function(){this.currentGesture_=null};Blockly.WorkspaceSvg.prototype.cancelCurrentGesture=function(){this.currentGesture_&&this.currentGesture_.cancel()}; -Blockly.WorkspaceSvg.prototype.getAudioManager=function(){return this.audioManager_};Blockly.WorkspaceSvg.prototype.getGrid=function(){return this.grid_};Blockly.inject=function(a,b){Blockly.checkBlockColourConstants();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!a||!Blockly.utils.dom.containsNode(document,a))throw Error("Error: container is not in current document.");b=new Blockly.Options(b||{});var c=document.createElement("div");c.className="injectionDiv";c.tabIndex=0;Blockly.utils.aria.setState(c,Blockly.utils.aria.State.LABEL,Blockly.Msg.WORKSPACE_ARIA_LABEL);a.appendChild(c);a=Blockly.createDom_(c,b);var d= -new Blockly.BlockDragSurfaceSvg(c),e=new Blockly.WorkspaceDragSurfaceSvg(c),f=Blockly.createMainWorkspace_(a,b,d,e);Blockly.user.keyMap.setKeyMap(b.keyMap);Blockly.init_(f);Blockly.mainWorkspace=f;Blockly.svgResize(f);c.addEventListener("focusin",function(){Blockly.mainWorkspace=f});return f}; -Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");Blockly.Component.defaultRightToLeft=b.RTL;Blockly.Css.inject(b.hasCss,b.pathToMedia);a=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklySvg",tabindex:"0"},a);var c=Blockly.utils.dom.createSvgElement("defs",{},a),d=String(Math.random()).substring(2);b.gridPattern=Blockly.Grid.createDom(d,b.gridOptions,c); -return a}; +Blockly.WorkspaceSvg.prototype.getAudioManager=function(){return this.audioManager_};Blockly.WorkspaceSvg.prototype.getGrid=function(){return this.grid_};Blockly.inject=function(a,b){Blockly.checkBlockColourConstants();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!a||!Blockly.utils.dom.containsNode(document,a))throw Error("Error: container is not in current document.");var c=new Blockly.Options(b||{}),d=document.createElement("div");d.className="injectionDiv";d.tabIndex=0;Blockly.utils.aria.setState(d,Blockly.utils.aria.State.LABEL,Blockly.Msg.WORKSPACE_ARIA_LABEL);a.appendChild(d);var e=Blockly.createDom_(d,c), +f=new Blockly.BlockDragSurfaceSvg(d),g=new Blockly.WorkspaceDragSurfaceSvg(d),h=Blockly.createMainWorkspace_(e,c,f,g);Blockly.user.keyMap.setKeyMap(c.keyMap);Blockly.init_(h);Blockly.mainWorkspace=h;Blockly.svgResize(h);d.addEventListener("focusin",function(){Blockly.mainWorkspace=h});return h}; +Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");Blockly.Component.defaultRightToLeft=b.RTL;Blockly.Css.inject(b.hasCss,b.pathToMedia);var c=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklySvg",tabindex:"0"},a),d=Blockly.utils.dom.createSvgElement("defs",{},c),e=String(Math.random()).substring(2);b.gridPattern=Blockly.Grid.createDom(e,b.gridOptions,d); +return c}; Blockly.createMainWorkspace_=function(a,b,c,d){b.parentWorkspace=null;var e=new Blockly.WorkspaceSvg(b,c,d);b=e.options;e.scale=b.zoomOptions.startScale;a.appendChild(e.createDom("blocklyMainBackground"));Blockly.utils.dom.addClass(e.getInjectionDiv(),(b.renderer||"geras")+"-renderer");Blockly.utils.dom.addClass(e.getInjectionDiv(),e.getTheme().name+"-theme");!b.hasCategories&&b.languageTree&&(c=e.addFlyout("svg"),Blockly.utils.dom.insertAfter(c,a));b.hasTrashcan&&e.addTrashcan();b.zoomOptions&&b.zoomOptions.controls&& e.addZoomControls();e.getThemeManager().subscribe(a,"workspaceBackgroundColour","background-color");e.translate(0,0);b.readOnly||e.isMovable()||e.addChangeListener(function(a){if(!e.isDragging()&&!e.isMovable()&&-1!=Blockly.Events.BUMP_EVENTS.indexOf(a.type)){var b=Object.create(null),c=e.getMetrics(),d=e.scale;b.RTL=e.RTL;b.viewLeft=c.viewLeft/d;b.viewTop=c.viewTop/d;b.viewRight=(c.viewLeft+c.viewWidth)/d;b.viewBottom=(c.viewTop+c.viewHeight)/d;e.isContentBounded()?(c=e.getBlocksBoundingBox(),b.contentLeft= c.left,b.contentTop=c.top,b.contentRight=c.right,b.contentBottom=c.bottom):(b.contentLeft=c.contentLeft/d,b.contentTop=c.contentTop/d,b.contentRight=(c.contentLeft+c.contentWidth)/d,b.contentBottom=(c.contentTop+c.contentHeight)/d);if(b.contentTopb.viewBottom||b.contentLeftb.viewRight){c=null;a&&(c=Blockly.Events.getGroup(),Blockly.Events.setGroup(a.group));switch(a.type){case Blockly.Events.BLOCK_CREATE:case Blockly.Events.BLOCK_MOVE:var f= @@ -724,10 +737,10 @@ Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEventWi b.hasTrashcan&&(c=a.trashcan.init(c));b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init(c);b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new Blockly.ScrollbarPair(a),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)}; Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEventWithChecks_(document,"scroll",null,function(){for(var a=Blockly.Workspace.getAll(),b=0,c;c=a[b];b++)c.updateInverseScreenCTM&&c.updateInverseScreenCTM()}),Blockly.bindEventWithChecks_(document,"keydown",null,Blockly.onKeyDown),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),Blockly.utils.userAgent.IPAD&&Blockly.bindEventWithChecks_(window, "orientationchange",document,function(){Blockly.svgResize(Blockly.getMainWorkspace())}));Blockly.documentEventsBound_=!0}; -Blockly.inject.loadSounds_=function(a,b){var c=b.getAudioManager();c.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");c.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");c.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var d=[];a=function(){for(;d.length;)Blockly.unbindEvent_(d.pop());c.preload()};d.push(Blockly.bindEventWithChecks_(document,"mousemove",null,a,!0));d.push(Blockly.bindEventWithChecks_(document,"touchstart",null,a,!0))};Blockly.Names=function(a,b){this.variablePrefix_=b||"";this.reservedDict_=Object.create(null);if(a)for(a=a.split(","),b=0;b1'),d.appendChild(c),b.push(d));if(Blockly.Blocks.variables_get){a.sort(Blockly.VariableModel.compareByName);c=0;for(var e;e=a[c];c++)d=Blockly.utils.xml.createElement("block"),d.setAttribute("type","variables_get"),d.setAttribute("gap",8),d.appendChild(Blockly.Variables.generateVariableFieldDom(e)),b.push(d)}}return b}; Blockly.Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh";Blockly.Variables.generateUniqueName=function(a){return Blockly.Variables.generateUniqueNameFromOptions(Blockly.Variables.VAR_LETTER_OPTIONS.charAt(0),a.getAllVariableNames())}; -Blockly.Variables.generateUniqueNameFromOptions=function(a,b){if(!b.length)return a;for(var c=Blockly.Variables.VAR_LETTER_OPTIONS,d="",e=c.indexOf(a);;){for(var f=!1,g=0;ge?Blockly.WidgetDiv.positionInternal_(a,0,c.height+e):Blockly.WidgetDiv.positionInternal_(a,e,c.height)};Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)}; -Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200123.1";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; +Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200123.0-develop";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth;c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))if(b.options.readOnly)Blockly.navigation.onKeyPress(a);else{var c=!1;if(a.keyCode==Blockly.utils.KeyCodes.ESC)Blockly.hideChaff(),Blockly.navigation.onBlocklyAction(Blockly.navigation.ACTION_EXIT);else{if(Blockly.navigation.onKeyPress(a))return;if(a.keyCode==Blockly.utils.KeyCodes.BACKSPACE||a.keyCode==Blockly.utils.KeyCodes.DELETE){a.preventDefault();if(Blockly.Gesture.inProgress())return; Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(a.keyCode==Blockly.utils.KeyCodes.C?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):a.keyCode!=Blockly.utils.KeyCodes.X||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0));a.keyCode==Blockly.utils.KeyCodes.V?Blockly.clipboardXml_&&(a=Blockly.clipboardSource_, @@ -795,74 +808,12 @@ Blockly.Comment.prototype.createBubble_=function(){!this.block_.isEditable()||Bl Blockly.Comment.prototype.createNonEditableBubble_=function(){Blockly.Warning.prototype.createBubble.call(this)}; Blockly.Comment.prototype.disposeBubble_=function(){this.paragraphElement_?Blockly.Warning.prototype.disposeBubble.call(this):(this.onMouseUpWrapper_&&(Blockly.unbindEvent_(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onWheelWrapper_&&(Blockly.unbindEvent_(this.onWheelWrapper_),this.onWheelWrapper_=null),this.onChangeWrapper_&&(Blockly.unbindEvent_(this.onChangeWrapper_),this.onChangeWrapper_=null),this.onInputWrapper_&&(Blockly.unbindEvent_(this.onInputWrapper_),this.onInputWrapper_= null),this.bubble_.dispose(),this.foreignObject_=this.textarea_=this.bubble_=null)};Blockly.Comment.prototype.startEdit_=function(a){this.bubble_.promote()&&this.textarea_.focus();this.cachedText_=this.model_.text};Blockly.Comment.prototype.getBubbleSize=function(){return this.model_.size};Blockly.Comment.prototype.setBubbleSize=function(a,b){this.bubble_?this.bubble_.setBubbleSize(a,b):(this.model_.size.width=a,this.model_.size.height=b)}; -Blockly.Comment.prototype.getText=function(){return this.model_.text||""};Blockly.Comment.prototype.setText=function(a){this.model_.text!=a&&(this.model_.text=a,this.updateText())};Blockly.Comment.prototype.updateText=function(){this.textarea_?this.textarea_.value=this.model_.text:this.paragraphElement_&&(this.paragraphElement_.firstChild.textContent=this.model_.text)};Blockly.Comment.prototype.dispose=function(){this.block_.comment=null;Blockly.Icon.prototype.dispose.call(this)};Blockly.Css.register(".blocklyCommentTextarea {,background-color: #fef49c;,border: 0;,outline: 0;,margin: 0;,padding: 3px;,resize: none;,display: block;,overflow: hidden;,}".split(","));Blockly.FlyoutCursor=function(){Blockly.FlyoutCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.FlyoutCursor,Blockly.Cursor);Blockly.FlyoutCursor.prototype.onBlocklyAction=function(a){switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;default:return!1}}; -Blockly.FlyoutCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=a.next())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.in=function(){return null};Blockly.FlyoutCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=a.prev())&&this.setCurNode(a);return a};Blockly.FlyoutCursor.prototype.out=function(){return null};Blockly.Flyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(a);this.workspace_.isFlyout=!0;this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[];this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH};Blockly.Flyout.prototype.autoClose=!0;Blockly.Flyout.prototype.isVisible_=!1; -Blockly.Flyout.prototype.containerVisible_=!0;Blockly.Flyout.prototype.CORNER_RADIUS=8;Blockly.Flyout.prototype.MARGIN=Blockly.Flyout.prototype.CORNER_RADIUS;Blockly.Flyout.prototype.GAP_X=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.GAP_Y=3*Blockly.Flyout.prototype.MARGIN;Blockly.Flyout.prototype.SCROLLBAR_PADDING=2;Blockly.Flyout.prototype.width_=0;Blockly.Flyout.prototype.height_=0;Blockly.Flyout.prototype.dragAngleRange_=70; -Blockly.Flyout.prototype.createDom=function(a){this.svgGroup_=Blockly.utils.dom.createSvgElement(a,{"class":"blocklyFlyout",style:"display: none"},null);this.svgBackground_=Blockly.utils.dom.createSvgElement("path",{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"); -this.workspace_.getMarkerManager().setCursor(new Blockly.FlyoutCursor);return this.svgGroup_}; -Blockly.Flyout.prototype.init=function(a){this.targetWorkspace_=a;this.workspace_.targetWorkspace=a;this.scrollbar_=new Blockly.Scrollbar(this.workspace_,this.horizontalLayout_,!1,"blocklyFlyoutScrollbar");this.hide();Array.prototype.push.apply(this.eventWrappers_,Blockly.bindEventWithChecks_(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),this.targetWorkspace_.addChangeListener(this.filterWrapper_));Array.prototype.push.apply(this.eventWrappers_, -Blockly.bindEventWithChecks_(this.svgBackground_,"mousedown",this,this.onMouseDown_));this.workspace_.getGesture=this.targetWorkspace_.getGesture.bind(this.targetWorkspace_);this.workspace_.setVariableMap(this.targetWorkspace_.getVariableMap());this.workspace_.createPotentialVariableMap()}; -Blockly.Flyout.prototype.dispose=function(){this.hide();Blockly.unbindEvent_(this.eventWrappers_);this.filterWrapper_&&(this.targetWorkspace_.removeChangeListener(this.filterWrapper_),this.filterWrapper_=null);this.scrollbar_&&(this.scrollbar_.dispose(),this.scrollbar_=null);this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.targetWorkspace=null,this.workspace_.dispose(),this.workspace_=null);this.svgGroup_&&(Blockly.utils.dom.removeNode(this.svgGroup_), -this.svgGroup_=null);this.targetWorkspace_=this.svgBackground_=null};Blockly.Flyout.prototype.getWidth=function(){return this.width_};Blockly.Flyout.prototype.getHeight=function(){return this.height_};Blockly.Flyout.prototype.getWorkspace=function(){return this.workspace_};Blockly.Flyout.prototype.isVisible=function(){return this.isVisible_};Blockly.Flyout.prototype.setVisible=function(a){var b=a!=this.isVisible();this.isVisible_=a;b&&this.updateDisplay_()}; -Blockly.Flyout.prototype.setContainerVisible=function(a){var b=a!=this.containerVisible_;this.containerVisible_=a;b&&this.updateDisplay_()};Blockly.Flyout.prototype.updateDisplay_=function(){var a=this.containerVisible_?this.isVisible():!1;this.svgGroup_.style.display=a?"block":"none";this.scrollbar_.setContainerVisible(a)}; -Blockly.Flyout.prototype.positionAt_=function(a,b,c,d){this.svgGroup_.setAttribute("width",a);this.svgGroup_.setAttribute("height",b);"svg"==this.svgGroup_.tagName?Blockly.utils.dom.setCssTransform(this.svgGroup_,"translate("+c+"px,"+d+"px)"):this.svgGroup_.setAttribute("transform","translate("+c+","+d+")");this.scrollbar_&&(this.scrollbar_.setOrigin(c,d),this.scrollbar_.resize(),this.scrollbar_.setPosition_(this.scrollbar_.position_.x,this.scrollbar_.position_.y))}; -Blockly.Flyout.prototype.hide=function(){if(this.isVisible()){this.setVisible(!1);for(var a=0,b;b=this.listeners_[a];a++)Blockly.unbindEvent_(b);this.listeners_.length=0;this.reflowWrapper_&&(this.workspace_.removeChangeListener(this.reflowWrapper_),this.reflowWrapper_=null)}}; -Blockly.Flyout.prototype.show=function(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldBlocks_();if("string"==typeof a){a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a);if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.workspace_.targetWorkspace);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.setVisible(!0);var b=[],c=[];this.permanentlyDisabled_.length= -0;for(var d=this.horizontalLayout_?this.GAP_X:this.GAP_Y,e=0,f;f=a[e];e++)if(f.tagName)switch(f.tagName.toUpperCase()){case "BLOCK":var g=Blockly.Xml.domToBlock(f,this.workspace_);g.isEnabled()||this.permanentlyDisabled_.push(g);b.push({type:"block",block:g});f=parseInt(f.getAttribute("gap"),10);c.push(isNaN(f)?d:f);break;case "SEP":f=parseInt(f.getAttribute("gap"),10);!isNaN(f)&&090-b||a>-90-b&&a<-90+b?!0:!1}; -Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,1E9,-1E9,1E9)}; -Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};Blockly.utils.object.inherits(Blockly.VerticalFlyout,Blockly.Flyout); -Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX, -contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))}; -Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_== -Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth+a.absoluteLeft-this.width_,0))}}; -Blockly.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d", -d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scrollbar_.set(0)};Blockly.VerticalFlyout.prototype.wheel_=function(a){var b=Blockly.utils.getScrollDeltaPixels(a);if(b.y){var c=this.getMetrics_();b=c.viewTop-c.contentTop+b.y;b=Math.min(b,c.contentHeight-c.viewHeight);b=Math.max(b,0);this.scrollbar_.set(b);Blockly.WidgetDiv.hide()}a.preventDefault();a.stopPropagation()}; -Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button, -d,c),c+=f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a-b||a<-180+b||a>180-b?!0:!1};Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E9,1E9,-1E9,b+a.width):new Blockly.utils.Rect(-1E9,1E9,b,1E9)}; -Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f= -a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a/this.workspace_.scale-d.width-this.MARGIN-this.tabWidth_,b);this.width_=a;this.position()}};Blockly.FlyoutButton=function(a,b,c,d){this.workspace_=a;this.targetWorkspace_=b;this.text_=c.getAttribute("text");this.position_=new Blockly.utils.Coordinate(0,0);this.isLabel_=d;this.callbackKey_=c.getAttribute("callbackKey")||c.getAttribute("callbackkey");this.cssClass_=c.getAttribute("web-class")||null;this.onMouseUpWrapper_=null};Blockly.FlyoutButton.MARGIN=5;Blockly.FlyoutButton.prototype.width=0;Blockly.FlyoutButton.prototype.height=0; -Blockly.FlyoutButton.prototype.createDom=function(){var a=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(a+=" "+this.cssClass_);this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":a},this.workspace_.getCanvas());if(!this.isLabel_)var b=Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);a=Blockly.utils.dom.createSvgElement("rect",{"class":this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground", -rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.dom.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),d=Blockly.utils.replaceMessageReferences(this.text_);this.workspace_.RTL&&(d+="\u200f");c.textContent=d;this.isLabel_&&(this.svgText_=c,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));this.width=Blockly.utils.dom.getTextWidth(c);this.height=20;this.isLabel_||(this.width+= -2*Blockly.FlyoutButton.MARGIN,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",this.height-Blockly.FlyoutButton.MARGIN);this.updateTransform_();this.onMouseUpWrapper_=Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.onMouseUp_);return this.svgGroup_}; -Blockly.FlyoutButton.prototype.show=function(){this.updateTransform_();this.svgGroup_.setAttribute("display","block")};Blockly.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")};Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getPosition=function(){return this.position_}; -Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&Blockly.utils.dom.removeNode(this.svgGroup_);this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)}; -Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.isLabel_&&this.callbackKey_?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||this.callbackKey_&&this.targetWorkspace_.getButtonCallback(this.callbackKey_)?this.isLabel_||this.targetWorkspace_.getButtonCallback(this.callbackKey_)(this):console.warn("Buttons should have callbacks. Button text: "+this.text_)};Blockly.Css.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,},.blocklyFlyoutLabelText {,fill: #000;,}".split(","));Blockly.Generator=function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")};Blockly.Generator.NAME_TYPE="generated_function";Blockly.Generator.prototype.INFINITE_LOOP_TRAP=null;Blockly.Generator.prototype.STATEMENT_PREFIX=null;Blockly.Generator.prototype.STATEMENT_SUFFIX=null;Blockly.Generator.prototype.INDENT=" ";Blockly.Generator.prototype.COMMENT_WRAP=60;Blockly.Generator.prototype.ORDER_OVERRIDES=[]; -Blockly.Generator.prototype.workspaceToCode=function(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=Blockly.getMainWorkspace());var b=[];this.init(a);a=a.getTopBlocks(!0);for(var c=0,d;d=a[c];c++){var e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX, -d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")};Blockly.Generator.prototype.prefixLines=function(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)};Blockly.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;ca&&(a=this.computeDepth_(),this.setDepth_(a));return a};Blockly.tree.BaseNode.prototype.computeDepth_=function(){var a=this.getParent();return a?a.getDepth()+1:0};Blockly.tree.BaseNode.prototype.setDepth_=function(a){if(a!=this.depth_){this.depth_=a;var b=this.getRowElement();if(b){var c=this.getPixelIndent_()+"px";this.isRightToLeft()?b.style.paddingRight=c:b.style.paddingLeft=c}this.forEachChild(function(b){b.setDepth_(a+1)})}}; Blockly.tree.BaseNode.prototype.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};Blockly.tree.BaseNode.prototype.getChildren=function(){var a=[];this.forEachChild(function(b){a.push(b)});return a};Blockly.tree.BaseNode.prototype.getFirstChild=function(){return this.getChildAt(0)};Blockly.tree.BaseNode.prototype.getLastChild=function(){return this.getChildAt(this.getChildCount()-1)};Blockly.tree.BaseNode.prototype.getPreviousSibling=function(){return this.previousSibling_}; Blockly.tree.BaseNode.prototype.getNextSibling=function(){return this.nextSibling_};Blockly.tree.BaseNode.prototype.isLastSibling=function(){return!this.nextSibling_};Blockly.tree.BaseNode.prototype.isSelected=function(){return this.selected_};Blockly.tree.BaseNode.prototype.select=function(){var a=this.getTree();a&&a.setSelectedItem(this)};Blockly.tree.BaseNode.prototype.selectFirst=function(){var a=this.getTree();a&&this.firstChild_&&a.setSelectedItem(this.firstChild_)}; @@ -894,82 +845,13 @@ Blockly.tree.TreeControl.prototype.enterDocument=function(){Blockly.tree.TreeCon Blockly.tree.TreeControl.prototype.attachEvents_=function(){var a=this.getElement();a.tabIndex=0;this.onFocusWrapper_=Blockly.bindEvent_(a,"focus",this,this.handleFocus_);this.onBlurWrapper_=Blockly.bindEvent_(a,"blur",this,this.handleBlur_);this.onClickWrapper_=Blockly.bindEventWithChecks_(a,"click",this,this.handleMouseEvent_);this.onKeydownWrapper_=Blockly.bindEvent_(a,"keydown",this,this.handleKeyEvent_)}; Blockly.tree.TreeControl.prototype.detachEvents_=function(){this.onFocusWrapper_&&(Blockly.unbindEvent_(this.onFocusWrapper_),this.onFocusWrapper_=null);this.onBlurWrapper_&&(Blockly.unbindEvent_(this.onBlurWrapper_),this.onBlurWrapper_=null);this.onClickWrapper_&&(Blockly.unbindEvent_(this.onClickWrapper_),this.onClickWrapper_=null);this.onKeydownWrapper_&&(Blockly.unbindEvent_(this.onKeydownWrapper_),this.onKeydownWrapper_=null)}; Blockly.tree.TreeControl.prototype.handleMouseEvent_=function(a){var b=this.getNodeFromEvent_(a);if(b)switch(a.type){case "mousedown":b.onMouseDown(a);break;case "click":b.onClick_(a)}};Blockly.tree.TreeControl.prototype.handleKeyEvent_=function(a){var b=!1;if(b=this.selectedItem_&&this.selectedItem_.onKeyDown(a)||b)Blockly.utils.style.scrollIntoContainerView(this.selectedItem_.getElement(),this.getElement().parentNode),a.preventDefault();return b}; -Blockly.tree.TreeControl.prototype.getNodeFromEvent_=function(a){for(var b=a.target;null!=b;){if(a=Blockly.tree.BaseNode.allNodes[b.id])return a;if(b==this.getElement())break;b=b.parentNode}return null};Blockly.tree.TreeControl.prototype.createNode=function(a){return new Blockly.tree.TreeNode(this.toolbox_,a||"",this.getConfig())};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"}; -this.horizontalLayout_&&(this.config_.cssTreeRow+=a.RTL?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.treeSeparatorConfig_.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.RTL?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),this.config_.cssTreeIcon="");this.flyout_=null};Blockly.Toolbox.prototype.width=0;Blockly.Toolbox.prototype.height=0;Blockly.Toolbox.prototype.selectedOption_=null;Blockly.Toolbox.prototype.lastCategory_=null; -Blockly.Toolbox.prototype.init=function(){var a=this.workspace_,b=this.workspace_.getParentSvg();this.HtmlDiv=document.createElement("div");this.HtmlDiv.className="blocklyToolboxDiv blocklyNonSelectable";this.HtmlDiv.setAttribute("dir",a.RTL?"RTL":"LTR");b.parentNode.insertBefore(this.HtmlDiv,b);var c=a.getThemeManager();c.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");c.subscribe(this.HtmlDiv,"toolboxForegroundColour","color");Blockly.bindEventWithChecks_(this.HtmlDiv,"mousedown", -this,function(a){Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0);Blockly.Touch.clearTouchIdentifier()},!1,!0);c=new Blockly.Options({parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,renderer:a.options.renderer});c.toolboxPosition=a.options.toolboxPosition;if(a.horizontalLayout){if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout");this.flyout_=new Blockly.HorizontalFlyout(c)}else{if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout"); -this.flyout_=new Blockly.VerticalFlyout(c)}if(!this.flyout_)throw Error("One of Blockly.VerticalFlyout or Blockly.Horizontal must berequired.");Blockly.utils.dom.insertAfter(this.flyout_.createDom("svg"),b);this.flyout_.init(a);this.config_.cleardotPath=a.options.pathToMedia+"1x1.gif";this.config_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.RTL?"Rtl":"Ltr");this.renderTree(a.options.languageTree)}; -Blockly.Toolbox.prototype.renderTree=function(a){this.tree_&&(this.tree_.dispose(),this.lastCategory_=null);var b=new Blockly.tree.TreeControl(this,this.config_);this.tree_=b;b.setSelectedItem(null);b.onBeforeSelected(this.handleBeforeTreeSelected_);b.onAfterSelected(this.handleAfterTreeSelected_);var c=null;if(a){this.tree_.blocks=[];this.hasColours_=!1;c=this.syncTrees_(a,this.tree_,this.workspace_.options.pathToMedia);if(this.tree_.blocks.length)throw Error("Toolbox cannot have both blocks and categories in the root level."); -this.workspace_.resizeContents()}b.render(this.HtmlDiv);c&&b.setSelectedItem(c);this.addColour_();this.position();this.horizontalLayout_&&Blockly.utils.aria.setState(this.tree_.getElement(),Blockly.utils.aria.State.ORIENTATION,"horizontal")};Blockly.Toolbox.prototype.handleBeforeTreeSelected_=function(a){if(a==this.tree_)return!1;this.lastCategory_&&(this.lastCategory_.getRowElement().style.backgroundColor="");if(a){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}return!0}; -Blockly.Toolbox.prototype.handleAfterTreeSelected_=function(a,b){b&&b.blocks&&b.blocks.length?(this.flyout_.show(b.blocks),this.lastCategory_!=b&&this.flyout_.scrollToStart(),this.workspace_.keyboardAccessibilityMode&&Blockly.navigation.setState(Blockly.navigation.STATE_TOOLBOX)):(this.flyout_.hide(),!this.workspace_.keyboardAccessibilityMode||b instanceof Blockly.Toolbox.TreeSeparator||Blockly.navigation.setState(Blockly.navigation.STATE_WS));a!=b&&a!=this&&(a=new Blockly.Events.Ui(null,"category", -a&&a.getText(),b&&b.getText()),a.workspaceId=this.workspace_.id,Blockly.Events.fire(a));b&&(this.lastCategory_=b)};Blockly.Toolbox.prototype.handleNodeSizeChanged_=function(){Blockly.svgResize(this.workspace_)}; -Blockly.Toolbox.prototype.onBlocklyAction=function(a){var b=this.tree_.getSelectedItem();if(!b)return!1;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return b.selectPrevious();case Blockly.navigation.actionNames.OUT:return b.selectParent();case Blockly.navigation.actionNames.NEXT:return b.selectNext();case Blockly.navigation.actionNames.IN:return b.selectChild();default:return!1}}; -Blockly.Toolbox.prototype.dispose=function(){this.flyout_.dispose();this.tree_.dispose();this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv);Blockly.utils.dom.removeNode(this.HtmlDiv);this.lastCategory_=null};Blockly.Toolbox.prototype.getWidth=function(){return this.width};Blockly.Toolbox.prototype.getHeight=function(){return this.height};Blockly.Toolbox.prototype.getFlyout=function(){return this.flyout_}; -Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;if(a){var b=Blockly.svgSize(this.workspace_.getParentSvg());this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width=b.width+"px",this.height=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height=b.height+"px",this.width=a.offsetWidth);this.flyout_.position()}}; -Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));var h=this.tree_.createNode(e);h.onSizeChanged(this.handleNodeSizeChanged_);h.blocks=[];b.add(h);var k=g.getAttribute("custom");k?h.blocks=k:(k=this.syncTrees_(g,h,c))&&(d=k);k=g.getAttribute("categorystyle");var l=g.getAttribute("colour");l&&k?(h.hexColour="",console.warn('Toolbox category "'+ -e+'" can not have both a style and a colour')):k?this.setColourFromStyle_(k,h,e):this.setColour_(l,h,e);"true"==g.getAttribute("expanded")?(h.blocks.length&&(d=h),h.setExpanded(!0)):h.setExpanded(!1);e=g;break;case "SEP":if(e&&"CATEGORY"==e.tagName.toUpperCase()){b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d}; -Blockly.Toolbox.prototype.setColour_=function(a,b,c){a=Blockly.utils.replaceMessageReferences(a);if(null===a||""===a)b.hexColour="";else{var d=Number(a);isNaN(d)?(d=Blockly.utils.colour.parse(a))?(b.hexColour=d,this.hasColours_=!0):(b.hexColour="",console.warn('Toolbox category "'+c+'" has unrecognized colour attribute: '+a)):(b.hexColour=Blockly.hueToHex(d),this.hasColours_=!0)}}; -Blockly.Toolbox.prototype.setColourFromStyle_=function(a,b,c){b.styleName=a;var d=this.workspace_.getTheme();a&&d&&((d=d.categoryStyles[a])&&d.colour?this.setColour_(d.colour,b,c):console.warn('Style "'+a+'" must exist and contain a colour value'))};Blockly.Toolbox.prototype.updateColourFromTheme_=function(a){if(a=a||this.tree_){a=a.getChildren(!1);for(var b=0,c;c=a[b];b++)c.styleName&&(this.setColourFromStyle_(c.styleName,c,""),this.addColour_()),this.updateColourFromTheme_(c)}}; -Blockly.Toolbox.prototype.updateColourFromTheme=function(){var a=this.tree_;a&&(this.updateColourFromTheme_(a),this.updateSelectedItemColour_(a))};Blockly.Toolbox.prototype.updateSelectedItemColour_=function(a){if(a=a.getSelectedItem()){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}}; -Blockly.Toolbox.prototype.addColour_=function(a){a=(a||this.tree_).getChildren(!1);for(var b=0,c;c=a[b];b++){var d=c.getRowElement();if(d){var e=this.hasColours_?"8px solid "+(c.hexColour||"#ddd"):"none";this.workspace_.RTL?d.style.borderRight=e:d.style.borderLeft=e}this.addColour_(c)}};Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)};Blockly.Toolbox.prototype.addStyle=function(a){Blockly.utils.dom.addClass(this.HtmlDiv,a)}; -Blockly.Toolbox.prototype.removeStyle=function(a){Blockly.utils.dom.removeClass(this.HtmlDiv,a)}; -Blockly.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv)return null;var a=this.HtmlDiv.getBoundingClientRect(),b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E7,c,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM?new Blockly.utils.Rect(b,1E7,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E7,1E7,-1E7,a):new Blockly.utils.Rect(-1E7,1E7,d,1E7)}; -Blockly.Toolbox.prototype.refreshSelection=function(){var a=this.tree_.getSelectedItem();a&&a.blocks&&this.flyout_.show(a.blocks)};Blockly.Toolbox.prototype.selectFirstCategory=function(){this.tree_.getSelectedItem()||this.tree_.selectFirst()};Blockly.Toolbox.TreeSeparator=function(a){Blockly.tree.TreeNode.call(this,null,"",a)};Blockly.utils.object.inherits(Blockly.Toolbox.TreeSeparator,Blockly.tree.TreeNode); -Blockly.Css.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", -"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", -"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", -"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", -'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);Blockly.Trashcan=function(a){this.workspace_=a;this.contents_=[];this.flyout=null;if(!(0>=this.workspace_.options.maxTrashcanContents)){a=new Blockly.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex,renderer:this.workspace_.options.renderer});if(this.workspace_.horizontalLayout){a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_TOP?Blockly.TOOLBOX_AT_BOTTOM:Blockly.TOOLBOX_AT_TOP;if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout"); -this.flyout=new Blockly.HorizontalFlyout(a)}else{a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?Blockly.TOOLBOX_AT_LEFT:Blockly.TOOLBOX_AT_RIGHT;if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");this.flyout=new Blockly.VerticalFlyout(a)}this.workspace_.addChangeListener(this.onDelete_.bind(this))}};Blockly.Trashcan.prototype.WIDTH_=47;Blockly.Trashcan.prototype.BODY_HEIGHT_=44;Blockly.Trashcan.prototype.LID_HEIGHT_=16; -Blockly.Trashcan.prototype.MARGIN_BOTTOM_=20;Blockly.Trashcan.prototype.MARGIN_SIDE_=20;Blockly.Trashcan.prototype.MARGIN_HOTSPOT_=10;Blockly.Trashcan.prototype.SPRITE_LEFT_=0;Blockly.Trashcan.prototype.SPRITE_TOP_=32;Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE=.1;Blockly.Trashcan.prototype.isOpen=!1;Blockly.Trashcan.prototype.minOpenness_=0;Blockly.Trashcan.prototype.svgGroup_=null;Blockly.Trashcan.prototype.svgLid_=null;Blockly.Trashcan.prototype.lidTask_=0; -Blockly.Trashcan.prototype.lidOpen_=0;Blockly.Trashcan.prototype.left_=0;Blockly.Trashcan.prototype.top_=0; -Blockly.Trashcan.prototype.createDom=function(){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},b);var c=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, -y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup_);c.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashLidClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.LID_HEIGHT_},b);this.svgLid_=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, -y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup_);this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.click);Blockly.bindEvent_(c,"mouseover",this,this.mouseOver_);Blockly.bindEvent_(c,"mouseout",this,this.mouseOut_);this.animateLid_();return this.svgGroup_}; -Blockly.Trashcan.prototype.init=function(a){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),20))}; -Blockly.Trashcan.prototype.setLidAngle_=function(a){var b=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")};Blockly.Trashcan.prototype.close=function(){this.setOpen(!1)};Blockly.Trashcan.prototype.click=function(){if(this.contents_.length){for(var a=[],b=0,c;c=this.contents_[b];b++)a[b]=Blockly.Xml.textToDom(c);this.flyout.show(a)}}; -Blockly.Trashcan.prototype.mouseOver_=function(){this.contents_.length&&this.setOpen(!0)};Blockly.Trashcan.prototype.mouseOut_=function(){this.setOpen(!1)}; -Blockly.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents)&&a.type==Blockly.Events.BLOCK_DELETE&&"shadow"!=a.oldXml.tagName.toLowerCase()&&(a=this.cleanBlockXML_(a.oldXml),-1==this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.minOpenness_=this.HAS_BLOCKS_LID_ANGLE;this.setLidAngle_(45*this.minOpenness_)}}; -Blockly.Trashcan.prototype.cleanBlockXML_=function(a){for(var b=a=a.cloneNode(!0);b;){b.removeAttribute&&(b.removeAttribute("x"),b.removeAttribute("y"),b.removeAttribute("id"),b.removeAttribute("disabled"),"comment"==b.nodeName&&(b.removeAttribute("h"),b.removeAttribute("w"),b.removeAttribute("pinned")));var c=b.firstChild||b.nextSibling;if(!c)for(c=b.parentNode;c;){if(c.nextSibling){c=c.nextSibling;break}c=c.parentNode}b=c}return Blockly.Xml.domToText(a)};Blockly.VariablesDynamic={};Blockly.VariablesDynamic.onCreateVariableButtonClick_String=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"String")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Number=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Number")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Colour")}; -Blockly.VariablesDynamic.flyoutCategory=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_COLOUR_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"); -b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",Blockly.VariablesDynamic.onCreateVariableButtonClick_String);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",Blockly.VariablesDynamic.onCreateVariableButtonClick_Number);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour);a=Blockly.VariablesDynamic.flyoutCategoryBlocks(a);return b=b.concat(a)}; -Blockly.VariablesDynamic.flyoutCategoryBlocks=function(a){a=a.getAllVariables();var b=[];if(0image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);Blockly.Mutator=function(a){Blockly.Mutator.superClass_.constructor.call(this,null);this.quarkNames_=a};Blockly.utils.object.inherits(Blockly.Mutator,Blockly.Icon);Blockly.Mutator.prototype.workspaceWidth_=0;Blockly.Mutator.prototype.workspaceHeight_=0;Blockly.Mutator.prototype.setBlock=function(a){this.block_=a};Blockly.Mutator.prototype.getWorkspace=function(){return this.workspace_}; -Blockly.Mutator.prototype.drawIcon_=function(a){Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);Blockly.utils.dom.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"}, -a);Blockly.utils.dom.createSvgElement("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};Blockly.Mutator.prototype.iconClick_=function(a){this.block_.isEditable()&&Blockly.Icon.prototype.iconClick_.call(this,a)}; -Blockly.Mutator.prototype.createEditor_=function(){this.svgDialog_=Blockly.utils.dom.createSvgElement("svg",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);if(this.quarkNames_.length)for(var a=Blockly.utils.xml.createElement("xml"),b=0,c;c=this.quarkNames_[b];b++){var d=Blockly.utils.xml.createElement("block");d.setAttribute("type",c);a.appendChild(d)}else a=null;b=new Blockly.Options({disable:!1,parentWorkspace:this.block_.workspace,media:this.block_.workspace.options.pathToMedia, -rtl:this.block_.RTL,horizontalLayout:!1,renderer:this.block_.workspace.options.renderer});b.toolboxPosition=this.block_.RTL?Blockly.TOOLBOX_AT_RIGHT:Blockly.TOOLBOX_AT_LEFT;b.languageTree=a;b.getMetrics=this.getFlyoutMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(b);this.workspace_.isMutator=!0;this.workspace_.addChangeListener(Blockly.Events.disableOrphans);a=this.workspace_.addFlyout("g");b=this.workspace_.createDom("blocklyMutatorBackground");b.insertBefore(a,this.workspace_.svgBlockCanvas_); -this.svgDialog_.appendChild(b);return this.svgDialog_};Blockly.Mutator.prototype.updateEditable=function(){Blockly.Mutator.superClass_.updateEditable.call(this);this.block_.isInFlyout||(this.block_.isEditable()?this.iconGroup_&&Blockly.utils.dom.removeClass(this.iconGroup_,"blocklyIconGroupReadonly"):(this.setVisible(!1),this.iconGroup_&&Blockly.utils.dom.addClass(this.iconGroup_,"blocklyIconGroupReadonly")))}; -Blockly.Mutator.prototype.resizeBubble_=function(){var a=2*Blockly.Bubble.BORDER_WIDTH,b=this.workspace_.getCanvas().getBBox();var c=this.block_.RTL?-b.x:b.width+b.x;b=b.height+3*a;var d=this.workspace_.getFlyout();d&&(d=d.getMetrics_(),b=Math.max(b,d.contentHeight+20));c+=3*a;if(Math.abs(this.workspaceWidth_-c)>a||Math.abs(this.workspaceHeight_-b)>a)this.workspaceWidth_=c,this.workspaceHeight_=b,this.bubble_.setBubbleSize(c+a,b+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height", -this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};Blockly.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDeleteAreas()}; -Blockly.Mutator.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"mutatorOpen",!a,a)),a){this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));var b=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();b&&(a.init(this.workspace_),a.show(b.childNodes)); -this.rootBlock_=this.block_.decompose(this.workspace_);b=this.rootBlock_.getDescendants(!1);for(var c=0,d;d=b[c];c++)d.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(b=2*a.CORNER_RADIUS,a=a.getWidth()+b):a=b=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,b);if(this.block_.saveConnections){var e=this,f=this.block_;f.saveConnections(this.rootBlock_);this.sourceListener_=function(){f.saveConnections(e.rootBlock_)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(); -this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),this.sourceListener_=null)}; -Blockly.Mutator.prototype.workspaceChanged_=function(a){if(a.type!=Blockly.Events.UI&&(a.type!=Blockly.Events.CHANGE||"disabled"!=a.element)){if(!this.workspace_.isDragging()){a=this.workspace_.getTopBlocks(!1);for(var b=0,c;c=a[b];b++){var d=c.getRelativeToSurfaceXY(),e=c.getHeightWidth();20>d.y+e.height&&c.moveBy(0,20-e.height-d.y)}}if(this.rootBlock_.workspace==this.workspace_){Blockly.Events.setGroup(!0);c=this.block_;a=(a=c.mutationToDom())&&Blockly.Xml.domToText(a);c.compose(this.rootBlock_); -c.initSvg();c.render();Blockly.getMainWorkspace().keyboardAccessibilityMode&&Blockly.navigation.moveCursorOnBlockMutation(c);b=(b=c.mutationToDom())&&Blockly.Xml.domToText(b);if(a!=b){Blockly.Events.fire(new Blockly.Events.BlockChange(c,"mutation",null,a,b));var f=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(f);c.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_();Blockly.Events.setGroup(!1)}}}; -Blockly.Mutator.prototype.getFlyoutMetrics_=function(){return{viewHeight:this.workspaceHeight_,viewWidth:this.workspaceWidth_-this.workspace_.getFlyout().getWidth(),absoluteTop:0,absoluteLeft:this.workspace_.RTL?0:this.workspace_.getFlyout().getWidth()}};Blockly.Mutator.prototype.dispose=function(){this.block_.mutator=null;Blockly.Icon.prototype.dispose.call(this)}; -Blockly.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0;c=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}; Blockly.FieldTextInput.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:String(a)};Blockly.FieldTextInput.prototype.doValueInvalid_=function(a){this.isBeingEdited_&&(this.isTextValid_=!1,a=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"field",this.name||null,a,this.value_)))}; Blockly.FieldTextInput.prototype.doValueUpdate_=function(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||(this.isDirty_=!0)};Blockly.FieldTextInput.prototype.applyColour=function(){this.sourceBlock_&&this.constants_.FULL_BLOCK_FIELDS&&(this.borderRect_?this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary):this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.constants_.FIELD_BORDER_RECT_COLOUR))}; Blockly.FieldTextInput.prototype.render_=function(){Blockly.FieldTextInput.superClass_.render_.call(this);if(this.isBeingEdited_){this.resizeEditor_();var a=this.htmlInput_;this.isTextValid_?(Blockly.utils.dom.removeClass(a,"blocklyInvalidInput"),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.INVALID,!1)):(Blockly.utils.dom.addClass(a,"blocklyInvalidInput"),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.INVALID,!0))}}; -Blockly.FieldTextInput.prototype.setSpellcheck=function(a){a!=this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))};Blockly.FieldTextInput.prototype.showEditor_=function(a,b){this.workspace_=this.sourceBlock_.workspace;a=b||!1;!a&&(Blockly.utils.userAgent.MOBILE||Blockly.utils.userAgent.ANDROID||Blockly.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(a)}; +Blockly.FieldTextInput.prototype.setSpellcheck=function(a){a!=this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))};Blockly.FieldTextInput.prototype.showEditor_=function(a,b){this.workspace_=this.sourceBlock_.workspace;var c=b||!1;!c&&(Blockly.utils.userAgent.MOBILE||Blockly.utils.userAgent.ANDROID||Blockly.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(c)}; Blockly.FieldTextInput.prototype.showPromptEditor_=function(){var a=this;Blockly.prompt(Blockly.Msg.CHANGE_VALUE_TITLE,this.getText(),function(b){a.setValue(b)})};Blockly.FieldTextInput.prototype.showInlineEditor_=function(a){Blockly.WidgetDiv.show(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this));this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}; Blockly.FieldTextInput.prototype.widgetCreate_=function(){var a=Blockly.WidgetDiv.DIV;Blockly.utils.dom.addClass(this.getClickTarget_(),"editing");var b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",this.spellcheck_);var c=this.workspace_.scale,d=this.constants_.FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=d;d=Blockly.FieldTextInput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+"px";var e= this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition="box-shadow 0.25s ease 0s";this.constants_.FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0px 0px 0px "+4*c+"px")}b.style.borderRadius=d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.untypedDefaultValue_=this.value_;b.oldValue_=null;this.resizeEditor_(); @@ -1047,13 +929,13 @@ Blockly.FieldDropdown.prototype.positionSVGArrow_=function(a,b){if(!this.svgArro Blockly.FieldDropdown.prototype.getText_=function(){if(!this.selectedOption_)return null;var a=this.selectedOption_[0];return"object"==typeof a?a.alt:a}; Blockly.FieldDropdown.validateOptions_=function(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var b=!1,c=0;c=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1;this.altText_="";Blockly.FieldImage.superClass_.constructor.call(this, +Blockly.FieldDropdown.prototype.onBlocklyAction=function(a){if(this.menu_){if(a===Blockly.navigation.ACTION_PREVIOUS)return this.menu_.highlightPrevious(),!0;if(a===Blockly.navigation.ACTION_NEXT)return this.menu_.highlightNext(),!0}return Blockly.FieldDropdown.superClass_.onBlocklyAction.call(this,a)};Blockly.fieldRegistry.register("field_dropdown",Blockly.FieldDropdown);Blockly.FieldImage=function(a,b,c,d,e,f,g){if(!a)throw Error("Src value of an image field is required");a=Blockly.utils.replaceMessageReferences(a);c=Number(Blockly.utils.replaceMessageReferences(c));b=Number(Blockly.utils.replaceMessageReferences(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers.");if(0>=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1;this.altText_="";Blockly.FieldImage.superClass_.constructor.call(this, a||"",null,g);g||(this.flipRtl_=!!f,this.altText_=Blockly.utils.replaceMessageReferences(d)||"");this.size_=new Blockly.utils.Size(b,c+Blockly.FieldImage.Y_PADDING);this.imageHeight_=c;this.clickHandler_=null;"function"==typeof e&&(this.clickHandler_=e);this.imageElement_=null};Blockly.utils.object.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.fromJson=function(a){return new Blockly.FieldImage(a.src,a.width,a.height,void 0,void 0,void 0,a)};Blockly.FieldImage.Y_PADDING=1; Blockly.FieldImage.prototype.EDITABLE=!1;Blockly.FieldImage.prototype.isDirty_=!1;Blockly.FieldImage.prototype.configure_=function(a){Blockly.FieldImage.superClass_.configure_.call(this,a);this.flipRtl_=!!a.flipRtl;this.altText_=Blockly.utils.replaceMessageReferences(a.alt)||""}; -Blockly.FieldImage.prototype.initView=function(){this.imageElement_=Blockly.utils.dom.createSvgElement("image",{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_);this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.value_)};Blockly.FieldImage.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:a}; +Blockly.FieldImage.prototype.initView=function(){this.imageElement_=Blockly.utils.dom.createSvgElement("image",{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_);this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.value_);this.clickHandler_&&(this.imageElement_.style.cursor="pointer")};Blockly.FieldImage.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:a}; Blockly.FieldImage.prototype.doValueUpdate_=function(a){this.value_=a;this.imageElement_&&this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",String(this.value_))};Blockly.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_};Blockly.FieldImage.prototype.setAlt=function(a){a!=this.altText_&&(this.altText_=a||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))};Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)}; -Blockly.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};Blockly.FieldImage.prototype.getText_=function(){return this.altText_};Blockly.fieldRegistry.register("field_image",Blockly.FieldImage);Blockly.FieldMultilineInput=function(a,b,c){null==a&&(a="");Blockly.FieldMultilineInput.superClass_.constructor.call(this,a,b,c);this.textGroup_=null};Blockly.utils.object.inherits(Blockly.FieldMultilineInput,Blockly.FieldTextInput);Blockly.FieldMultilineInput.LINE_HEIGHT=20;Blockly.FieldMultilineInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldMultilineInput(b,void 0,a)}; +Blockly.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};Blockly.FieldImage.prototype.getText_=function(){return this.altText_};Blockly.fieldRegistry.register("field_image",Blockly.FieldImage);Blockly.FieldLabelSerializable=function(a,b,c){Blockly.FieldLabelSerializable.superClass_.constructor.call(this,a,b,c)};Blockly.utils.object.inherits(Blockly.FieldLabelSerializable,Blockly.FieldLabel);Blockly.FieldLabelSerializable.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldLabelSerializable(b,void 0,a)};Blockly.FieldLabelSerializable.prototype.EDITABLE=!1;Blockly.FieldLabelSerializable.prototype.SERIALIZABLE=!0; +Blockly.fieldRegistry.register("field_label_serializable",Blockly.FieldLabelSerializable);Blockly.FieldMultilineInput=function(a,b,c){null==a&&(a="");Blockly.FieldMultilineInput.superClass_.constructor.call(this,a,b,c);this.textGroup_=null};Blockly.utils.object.inherits(Blockly.FieldMultilineInput,Blockly.FieldTextInput);Blockly.FieldMultilineInput.LINE_HEIGHT=20;Blockly.FieldMultilineInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldMultilineInput(b,void 0,a)}; Blockly.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_();this.textGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyEditableText"},this.fieldGroup_)}; Blockly.FieldMultilineInput.prototype.getDisplayText_=function(){var a=this.value_;if(!a)return Blockly.Field.NBSP;var b=a.split("\n");a="";for(var c=0;cthis.maxDisplayLength&&(d=d.substring(0,this.maxDisplayLength-4)+"...");d=d.replace(/\s/g,Blockly.Field.NBSP);a+=d;c!==b.length-1&&(a+="\n")}this.sourceBlock_.RTL&&(a+="\u200f");return a}; Blockly.FieldMultilineInput.prototype.render_=function(){for(var a;a=this.textGroup_.firstChild;)this.textGroup_.removeChild(a);a=this.getDisplayText_().split("\n");for(var b=0,c=0;c90-b||a>-90-b&&a<-90+b?!0:!1}; +Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,1E9,-1E9,1E9)}; +Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};Blockly.utils.object.inherits(Blockly.VerticalFlyout,Blockly.Flyout); +Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX, +contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))}; +Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_== +Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth+a.absoluteLeft-this.width_,0))}}; +Blockly.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d", +d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scrollbar_.set(0)};Blockly.VerticalFlyout.prototype.wheel_=function(a){var b=Blockly.utils.getScrollDeltaPixels(a);if(b.y){var c=this.getMetrics_();b=c.viewTop-c.contentTop+b.y;b=Math.min(b,c.contentHeight-c.viewHeight);b=Math.max(b,0);this.scrollbar_.set(b);Blockly.WidgetDiv.hide()}a.preventDefault();a.stopPropagation()}; +Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button, +d,c),c+=f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a-b||a<-180+b||a>180-b?!0:!1};Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E9,1E9,-1E9,b+a.width):new Blockly.utils.Rect(-1E9,1E9,b,1E9)}; +Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f= +a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a/this.workspace_.scale-d.width-this.MARGIN-this.tabWidth_,b);this.width_=a;this.position()}};Blockly.Generator=function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")};Blockly.Generator.NAME_TYPE="generated_function";Blockly.Generator.prototype.INFINITE_LOOP_TRAP=null;Blockly.Generator.prototype.STATEMENT_PREFIX=null;Blockly.Generator.prototype.STATEMENT_SUFFIX=null;Blockly.Generator.prototype.INDENT=" ";Blockly.Generator.prototype.COMMENT_WRAP=60;Blockly.Generator.prototype.ORDER_OVERRIDES=[]; +Blockly.Generator.prototype.workspaceToCode=function(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=Blockly.getMainWorkspace());var b=[];this.init(a);a=a.getTopBlocks(!0);for(var c=0,d;d=a[c];c++){var e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX, +d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")};Blockly.Generator.prototype.prefixLines=function(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)};Blockly.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;ca||Math.abs(this.workspaceHeight_-b)>a)this.workspaceWidth_=c,this.workspaceHeight_=b,this.bubble_.setBubbleSize(c+a,b+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height", +this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};Blockly.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDeleteAreas()}; +Blockly.Mutator.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"mutatorOpen",!a,a)),a){this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));var b=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();b&&(a.init(this.workspace_),a.show(b.childNodes)); +this.rootBlock_=this.block_.decompose(this.workspace_);b=this.rootBlock_.getDescendants(!1);for(var c=0,d;d=b[c];c++)d.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(b=2*a.CORNER_RADIUS,a=a.getWidth()+b):a=b=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,b);if(this.block_.saveConnections){var e=this,f=this.block_;f.saveConnections(this.rootBlock_);this.sourceListener_=function(){f.saveConnections(e.rootBlock_)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(); +this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),this.sourceListener_=null)}; +Blockly.Mutator.prototype.workspaceChanged_=function(a){if(a.type!=Blockly.Events.UI&&(a.type!=Blockly.Events.CHANGE||"disabled"!=a.element)){if(!this.workspace_.isDragging()){a=this.workspace_.getTopBlocks(!1);for(var b=0,c;c=a[b];b++){var d=c.getRelativeToSurfaceXY(),e=c.getHeightWidth();20>d.y+e.height&&c.moveBy(0,20-e.height-d.y)}}if(this.rootBlock_.workspace==this.workspace_){Blockly.Events.setGroup(!0);c=this.block_;a=(a=c.mutationToDom())&&Blockly.Xml.domToText(a);c.compose(this.rootBlock_); +c.initSvg();c.render();Blockly.getMainWorkspace().keyboardAccessibilityMode&&Blockly.navigation.moveCursorOnBlockMutation(c);b=(b=c.mutationToDom())&&Blockly.Xml.domToText(b);if(a!=b){Blockly.Events.fire(new Blockly.Events.BlockChange(c,"mutation",null,a,b));var f=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(f);c.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_();Blockly.Events.setGroup(!1)}}}; +Blockly.Mutator.prototype.getFlyoutMetrics_=function(){return{viewHeight:this.workspaceHeight_,viewWidth:this.workspaceWidth_-this.workspace_.getFlyout().getWidth(),absoluteTop:0,absoluteLeft:this.workspace_.RTL?0:this.workspace_.getFlyout().getWidth()}};Blockly.Mutator.prototype.dispose=function(){this.block_.mutator=null;Blockly.Icon.prototype.dispose.call(this)}; +Blockly.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0;crect,",a+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text {","fill: #000;", "}",a+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",a+" .blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {", -"display: none;","}"]};Blockly.blockRendering.MarkerSvg=function(a,b,c){this.workspace_=a;this.marker_=c;this.parent_=null;this.constants_=b;this.currentMarkerSvg=null;a=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=c.colour||a};Blockly.blockRendering.MarkerSvg.CURSOR_CLASS="blocklyCursor";Blockly.blockRendering.MarkerSvg.MARKER_CLASS="blocklyMarker";Blockly.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER=.75;Blockly.blockRendering.MarkerSvg.prototype.getSvgRoot=function(){return this.svgGroup_}; -Blockly.blockRendering.MarkerSvg.prototype.isCursor=function(){return"cursor"==this.marker_.type};Blockly.blockRendering.MarkerSvg.prototype.createDom=function(){var a=this.isCursor()?Blockly.blockRendering.MarkerSvg.CURSOR_CLASS:Blockly.blockRendering.MarkerSvg.MARKER_CLASS;this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":a},null);this.createDomInternal_();return this.svgGroup_}; -Blockly.blockRendering.MarkerSvg.prototype.setParent_=function(a){this.isCursor()?(this.parent_&&this.parent_.setCursorSvg(null),a.setCursorSvg(this.getSvgRoot())):(this.parent_&&this.parent_.setMarkerSvg(null),a.setMarkerSvg(this.getSvgRoot()));this.parent_=a}; -Blockly.blockRendering.MarkerSvg.prototype.showWithBlockPrevOutput_=function(a){if(a){var b=a.width,c=a.height,d=c*Blockly.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER,e=this.constants_.CURSOR_BLOCK_PADDING;if(a.previousConnection){var f=this.constants_.shapeFor(a.previousConnection);this.positionPrevious_(b,e,d,f)}else a.outputConnection?(f=this.constants_.shapeFor(a.outputConnection),this.positionOutput_(b,c,f)):this.positionBlock_(b,e,d);this.setParent_(a);this.showCurrent_()}}; -Blockly.blockRendering.MarkerSvg.prototype.showWithCoordinates_=function(a){var b=a.getWsCoordinate();a=b.x;b=b.y;this.workspace_.RTL&&(a-=this.constants_.CURSOR_WS_WIDTH);this.positionLine_(a,b,this.constants_.CURSOR_WS_WIDTH);this.setParent_(this.workspace_);this.showCurrent_()};Blockly.blockRendering.MarkerSvg.prototype.showWithField_=function(a){a=a.getLocation();var b=a.getSize().width,c=a.getSize().height;this.positionRect_(0,0,b,c);this.setParent_(a);this.showCurrent_()}; -Blockly.blockRendering.MarkerSvg.prototype.showWithInput_=function(a){a=a.getLocation();var b=a.getSourceBlock();this.positionInput_(a);this.setParent_(b);this.showCurrent_()};Blockly.blockRendering.MarkerSvg.prototype.showWithNext_=function(a){var b=a.getLocation();a=b.getSourceBlock();var c=0;b=b.getOffsetInBlock().y;var d=a.getHeightWidth().width;this.workspace_.RTL&&(c=-d);this.positionLine_(c,b,d);this.setParent_(a);this.showCurrent_()}; -Blockly.blockRendering.MarkerSvg.prototype.showWithStack_=function(a){a=a.getLocation();var b=a.getHeightWidth(),c=b.width+this.constants_.CURSOR_STACK_PADDING;b=b.height+this.constants_.CURSOR_STACK_PADDING;var d=-this.constants_.CURSOR_STACK_PADDING/2,e=-this.constants_.CURSOR_STACK_PADDING/2,f=d;this.workspace_.RTL&&(f=-(c+d));this.positionRect_(f,e,c,b);this.setParent_(a);this.showCurrent_()}; -Blockly.blockRendering.MarkerSvg.prototype.showCurrent_=function(){this.hide();this.currentMarkerSvg.style.display=""};Blockly.blockRendering.MarkerSvg.prototype.positionBlock_=function(a,b,c){a=Blockly.utils.svgPaths.moveBy(-b,c)+Blockly.utils.svgPaths.lineOnAxis("V",-b)+Blockly.utils.svgPaths.lineOnAxis("H",a+2*b)+Blockly.utils.svgPaths.lineOnAxis("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; -Blockly.blockRendering.MarkerSvg.prototype.positionInput_=function(a){var b=a.getOffsetInBlock().x,c=a.getOffsetInBlock().y;a=Blockly.utils.svgPaths.moveTo(0,0)+this.constants_.shapeFor(a).pathDown;this.markerInput_.setAttribute("d",a);this.markerInput_.setAttribute("transform","translate("+b+","+c+")"+(this.workspace_.RTL?" scale(-1 1)":""));this.currentMarkerSvg=this.markerInput_}; -Blockly.blockRendering.MarkerSvg.prototype.positionLine_=function(a,b,c){this.markerSvgLine_.setAttribute("x",a);this.markerSvgLine_.setAttribute("y",b);this.markerSvgLine_.setAttribute("width",c);this.currentMarkerSvg=this.markerSvgLine_}; -Blockly.blockRendering.MarkerSvg.prototype.positionOutput_=function(a,b,c){a=Blockly.utils.svgPaths.moveBy(a,0)+Blockly.utils.svgPaths.lineOnAxis("h",-(a-c.width))+Blockly.utils.svgPaths.lineOnAxis("v",this.constants_.TAB_OFFSET_FROM_TOP)+c.pathDown+Blockly.utils.svgPaths.lineOnAxis("V",b)+Blockly.utils.svgPaths.lineOnAxis("H",a);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; -Blockly.blockRendering.MarkerSvg.prototype.positionPrevious_=function(a,b,c,d){a=Blockly.utils.svgPaths.moveBy(-b,c)+Blockly.utils.svgPaths.lineOnAxis("V",-b)+Blockly.utils.svgPaths.lineOnAxis("H",this.constants_.NOTCH_OFFSET_LEFT)+d.pathLeft+Blockly.utils.svgPaths.lineOnAxis("H",a+2*b)+Blockly.utils.svgPaths.lineOnAxis("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; -Blockly.blockRendering.MarkerSvg.prototype.positionRect_=function(a,b,c,d){this.markerSvgRect_.setAttribute("x",a);this.markerSvgRect_.setAttribute("y",b);this.markerSvgRect_.setAttribute("width",c);this.markerSvgRect_.setAttribute("height",d);this.currentMarkerSvg=this.markerSvgRect_};Blockly.blockRendering.MarkerSvg.prototype.flipRtl_=function(a){a.setAttribute("transform","scale(-1 1)")}; -Blockly.blockRendering.MarkerSvg.prototype.hide=function(){this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"};Blockly.blockRendering.MarkerSvg.prototype.draw=function(a,b){b?(this.showAtLocation_(b),this.firemarkerEvent_(a,b),a=this.currentMarkerSvg.childNodes[0],void 0!==a&&a.beginElement&&a.beginElement()):this.hide()}; -Blockly.blockRendering.MarkerSvg.prototype.showAtLocation_=function(a){a.getType()==Blockly.ASTNode.types.BLOCK?(a=a.getLocation(),this.showWithBlockPrevOutput_(a)):a.getType()==Blockly.ASTNode.types.OUTPUT?(a=a.getLocation().getSourceBlock(),this.showWithBlockPrevOutput_(a)):a.getLocation().type==Blockly.INPUT_VALUE?this.showWithInput_(a):a.getLocation().type==Blockly.NEXT_STATEMENT?this.showWithNext_(a):a.getType()==Blockly.ASTNode.types.PREVIOUS?(a=a.getLocation().getSourceBlock(),this.showWithBlockPrevOutput_(a)): -a.getType()==Blockly.ASTNode.types.FIELD?this.showWithField_(a):a.getType()==Blockly.ASTNode.types.WORKSPACE?this.showWithCoordinates_(a):a.getType()==Blockly.ASTNode.types.STACK&&this.showWithStack_(a)};Blockly.blockRendering.MarkerSvg.prototype.firemarkerEvent_=function(a,b){var c=b.getSourceBlock(),d=this.isCursor()?"cursorMove":"markerMove";a=new Blockly.Events.Ui(c,d,a,b);b.getType()==Blockly.ASTNode.types.WORKSPACE&&(a.workspaceId=b.getLocation().id);Blockly.Events.fire(a)}; -Blockly.blockRendering.MarkerSvg.prototype.getBlinkProperties_=function(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}; -Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_=function(){this.markerSvg_=Blockly.utils.dom.createSvgElement("g",{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_);this.markerSvgLine_=Blockly.utils.dom.createSvgElement("rect",{fill:this.colour_,width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},this.markerSvg_);this.markerSvgRect_=Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyVerticalMarker", -rx:10,ry:10,style:"display: none",stroke:this.colour_},this.markerSvg_);this.markerInput_=Blockly.utils.dom.createSvgElement("path",{transform:"",style:"display: none",fill:this.colour_},this.markerSvg_);this.markerBlock_=Blockly.utils.dom.createSvgElement("path",{transform:"",style:"display: none",fill:"none",stroke:this.colour_,"stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();Blockly.utils.dom.createSvgElement("animate",this.getBlinkProperties_(), -this.markerSvgLine_);Blockly.utils.dom.createSvgElement("animate",a,this.markerInput_);a.attributeName="stroke";Blockly.utils.dom.createSvgElement("animate",a,this.markerBlock_)}return this.markerSvg_};Blockly.blockRendering.MarkerSvg.prototype.dispose=function(){this.svgGroup_&&Blockly.utils.dom.removeNode(this.svgGroup_)};Blockly.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608}; +"display: none;","}"]};Blockly.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608}; Blockly.blockRendering.Types.LEFT_CORNER=Blockly.blockRendering.Types.LEFT_SQUARE_CORNER|Blockly.blockRendering.Types.LEFT_ROUND_CORNER;Blockly.blockRendering.Types.RIGHT_CORNER=Blockly.blockRendering.Types.RIGHT_SQUARE_CORNER|Blockly.blockRendering.Types.RIGHT_ROUND_CORNER;Blockly.blockRendering.Types.nextTypeValue_=16777216; Blockly.blockRendering.Types.getType=function(a){Blockly.blockRendering.Types.hasOwnProperty(a)||(Blockly.blockRendering.Types[a]=Blockly.blockRendering.Types.nextTypeValue_,Blockly.blockRendering.Types.nextTypeValue_<<=1);return Blockly.blockRendering.Types[a]};Blockly.blockRendering.Types.isField=function(a){return a.type&Blockly.blockRendering.Types.FIELD};Blockly.blockRendering.Types.isHat=function(a){return a.type&Blockly.blockRendering.Types.HAT}; Blockly.blockRendering.Types.isIcon=function(a){return a.type&Blockly.blockRendering.Types.ICON};Blockly.blockRendering.Types.isSpacer=function(a){return a.type&Blockly.blockRendering.Types.SPACER};Blockly.blockRendering.Types.isInRowSpacer=function(a){return a.type&Blockly.blockRendering.Types.IN_ROW_SPACER};Blockly.blockRendering.Types.isInput=function(a){return a.type&Blockly.blockRendering.Types.INPUT};Blockly.blockRendering.Types.isExternalInput=function(a){return a.type&Blockly.blockRendering.Types.EXTERNAL_VALUE_INPUT}; @@ -1134,13 +1074,13 @@ Blockly.blockRendering.Types.isRow=function(a){return a.type&Blockly.blockRender Blockly.blockRendering.Types.isTopOrBottomRow=function(a){return a.type&(Blockly.blockRendering.Types.TOP_ROW|Blockly.blockRendering.Types.BOTTOM_ROW)};Blockly.blockRendering.Types.isInputRow=function(a){return a.type&Blockly.blockRendering.Types.INPUT_ROW};Blockly.blockRendering.Measurable=function(a){this.height=this.width=0;this.type=Blockly.blockRendering.Types.NONE;this.centerline=this.xPos=0;this.constants_=a;this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT};Blockly.blockRendering.Connection=function(a,b){Blockly.blockRendering.Connection.superClass_.constructor.call(this,a);this.connectionModel=b;this.shape=this.constants_.shapeFor(b);this.isDynamicShape=!!this.shape.isDynamic;this.type|=Blockly.blockRendering.Types.CONNECTION};Blockly.utils.object.inherits(Blockly.blockRendering.Connection,Blockly.blockRendering.Measurable); Blockly.blockRendering.OutputConnection=function(a,b){Blockly.blockRendering.OutputConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.OUTPUT_CONNECTION;this.height=this.isDynamicShape?0:this.shape.height;this.startX=this.width=this.isDynamicShape?0:this.shape.width;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=0};Blockly.utils.object.inherits(Blockly.blockRendering.OutputConnection,Blockly.blockRendering.Connection); Blockly.blockRendering.PreviousConnection=function(a,b){Blockly.blockRendering.PreviousConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.PREVIOUS_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.PreviousConnection,Blockly.blockRendering.Connection); -Blockly.blockRendering.NextConnection=function(a,b){Blockly.blockRendering.NextConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.NextConnection,Blockly.blockRendering.Connection);Blockly.blockRendering.InputConnection=function(a,b){Blockly.blockRendering.InputConnection.superClass_.constructor.call(this,a,b.connection);this.type|=Blockly.blockRendering.Types.INPUT;this.input=b;this.align=b.align;(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null)?(a=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=a.width,this.connectedBlockHeight=a.height):this.connectedBlockHeight=this.connectedBlockWidth=0;this.connectionOffsetY=this.connectionOffsetX= -0};Blockly.utils.object.inherits(Blockly.blockRendering.InputConnection,Blockly.blockRendering.Connection); +Blockly.blockRendering.NextConnection=function(a,b){Blockly.blockRendering.NextConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.NextConnection,Blockly.blockRendering.Connection);Blockly.blockRendering.InputConnection=function(a,b){Blockly.blockRendering.InputConnection.superClass_.constructor.call(this,a,b.connection);this.type|=Blockly.blockRendering.Types.INPUT;this.input=b;this.align=b.align;if(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null){var c=this.connectedBlock.getHeightWidth();this.connectedBlockWidth=c.width;this.connectedBlockHeight=c.height}else this.connectedBlockHeight=this.connectedBlockWidth=0;this.connectionOffsetY= +this.connectionOffsetX=0};Blockly.utils.object.inherits(Blockly.blockRendering.InputConnection,Blockly.blockRendering.Connection); Blockly.blockRendering.InlineInput=function(a,b){Blockly.blockRendering.InlineInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.INLINE_INPUT;this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING);this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):this.shape.height;this.connectionWidth=this.isDynamicShape? this.shape.width(this.height):this.shape.width;this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1));this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0};Blockly.utils.object.inherits(Blockly.blockRendering.InlineInput,Blockly.blockRendering.InputConnection); Blockly.blockRendering.StatementInput=function(a,b){Blockly.blockRendering.StatementInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.STATEMENT_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT;this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.StatementInput,Blockly.blockRendering.InputConnection); Blockly.blockRendering.ExternalValueInput=function(a,b){Blockly.blockRendering.ExternalValueInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.EXTERNAL_VALUE_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height;this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionHeight=this.shape.height; -this.connectionWidth=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.ExternalValueInput,Blockly.blockRendering.InputConnection);Blockly.blockRendering.Icon=function(a,b){Blockly.blockRendering.Icon.superClass_.constructor.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=Blockly.blockRendering.Types.ICON;a=b.getCorrectedSize();this.height=a.height;this.width=a.width};Blockly.utils.object.inherits(Blockly.blockRendering.Icon,Blockly.blockRendering.Measurable); +this.connectionWidth=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.ExternalValueInput,Blockly.blockRendering.InputConnection);Blockly.blockRendering.Icon=function(a,b){Blockly.blockRendering.Icon.superClass_.constructor.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=Blockly.blockRendering.Types.ICON;var c=b.getCorrectedSize();this.height=c.height;this.width=c.width};Blockly.utils.object.inherits(Blockly.blockRendering.Icon,Blockly.blockRendering.Measurable); Blockly.blockRendering.JaggedEdge=function(a){Blockly.blockRendering.JaggedEdge.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.JAGGED_EDGE;this.height=this.constants_.JAGGED_TEETH.height;this.width=this.constants_.JAGGED_TEETH.width};Blockly.utils.object.inherits(Blockly.blockRendering.JaggedEdge,Blockly.blockRendering.Measurable); Blockly.blockRendering.Field=function(a,b,c){Blockly.blockRendering.Field.superClass_.constructor.call(this,a);this.field=b;this.isEditable=b.EDITABLE;this.flipRtl=b.getFlipRtl();this.type|=Blockly.blockRendering.Types.FIELD;a=this.field.getSize();this.height=a.height;this.width=a.width;this.parentInput=c};Blockly.utils.object.inherits(Blockly.blockRendering.Field,Blockly.blockRendering.Measurable); Blockly.blockRendering.Hat=function(a){Blockly.blockRendering.Hat.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.HAT;this.height=this.constants_.START_HAT.height;this.width=this.constants_.START_HAT.width;this.ascenderHeight=this.height};Blockly.utils.object.inherits(Blockly.blockRendering.Hat,Blockly.blockRendering.Measurable); @@ -1158,10 +1098,10 @@ Blockly.blockRendering.BottomRow.prototype.measure=function(){for(var a=0,b=0,c= Blockly.blockRendering.BottomRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.blockRendering.SpacerRow=function(a,b,c){Blockly.blockRendering.SpacerRow.superClass_.constructor.call(this,a);this.type=this.type|Blockly.blockRendering.Types.SPACER|Blockly.blockRendering.Types.BETWEEN_ROW_SPACER;this.width=c;this.height=b;this.followsStatement=!1;this.widthWithConnectedBlocks=0;this.elements=[new Blockly.blockRendering.InRowSpacer(this.constants_,c)]}; Blockly.utils.object.inherits(Blockly.blockRendering.SpacerRow,Blockly.blockRendering.Row);Blockly.blockRendering.SpacerRow.prototype.measure=function(){};Blockly.blockRendering.InputRow=function(a){Blockly.blockRendering.InputRow.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.INPUT_ROW;this.connectedBlockWidths=0};Blockly.utils.object.inherits(Blockly.blockRendering.InputRow,Blockly.blockRendering.Row); Blockly.blockRendering.InputRow.prototype.measure=function(){this.width=this.minWidth;this.height=this.minHeight;for(var a=0,b=0,c;c=this.elements[b];b++)this.width+=c.width,Blockly.blockRendering.Types.isInput(c)&&(Blockly.blockRendering.Types.isStatementInput(c)?a+=c.connectedBlockWidth:Blockly.blockRendering.Types.isExternalInput(c)&&0!=c.connectedBlockWidth&&(a+=c.connectedBlockWidth-c.connectionWidth)),Blockly.blockRendering.Types.isSpacer(c)||(this.height=Math.max(this.height,c.height));this.connectedBlockWidths= -a;this.widthWithConnectedBlocks=this.width+a};Blockly.blockRendering.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement};Blockly.blockRendering.RenderInfo=function(a,b){this.block_=b;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.outputConnection=b.outputConnection?new Blockly.blockRendering.OutputConnection(this.constants_,b.outputConnection):null;this.isInline=b.getInputsInline()&&!b.isCollapsed();this.isCollapsed=b.isCollapsed();this.isInsertionMarker=b.isInsertionMarker();this.RTL=b.RTL;this.statementEdge=this.width=this.widthWithChildren=this.height=0;this.rows=[];this.inputRowNum_=1;this.hiddenIcons= +a;this.widthWithConnectedBlocks=this.width+a};Blockly.blockRendering.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement};Blockly.blockRendering.RenderInfo=function(a,b){this.block_=b;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.outputConnection=b.outputConnection?new Blockly.blockRendering.OutputConnection(this.constants_,b.outputConnection):null;this.isInline=b.getInputsInline()&&!b.isCollapsed();this.isCollapsed=b.isCollapsed();this.isInsertionMarker=b.isInsertionMarker();this.RTL=b.RTL;this.statementEdge=this.width=this.widthWithChildren=this.height=0;this.rows=[];this.inputRows=[];this.hiddenIcons= [];this.topRow=new Blockly.blockRendering.TopRow(this.constants_);this.bottomRow=new Blockly.blockRendering.BottomRow(this.constants_);this.startY=this.startX=0};Blockly.blockRendering.RenderInfo.prototype.getRenderer=function(){return this.renderer_};Blockly.blockRendering.RenderInfo.prototype.measure=function(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.computeBounds_();this.alignRowElements_();this.finalize_()}; -Blockly.blockRendering.RenderInfo.prototype.createRows_=function(){this.populateTopRow_();this.rows.push(this.topRow);var a=new Blockly.blockRendering.InputRow(this.constants_),b=this.block_.getIcons();if(b.length)for(var c=0,d;d=b[c];c++){var e=new Blockly.blockRendering.Icon(this.constants_,d);this.isCollapsed&&d.collapseHidden?this.hiddenIcons.push(e):a.elements.push(e)}d=null;for(c=0;b=this.block_.inputList[c];c++)if(b.isVisible()){this.shouldStartNewRow_(b,d)&&(this.rows.push(a),a=new Blockly.blockRendering.InputRow(this.constants_), -this.inputRowNum_++);for(d=0;e=b.fieldRow[d];d++)a.elements.push(new Blockly.blockRendering.Field(this.constants_,e,b));this.addInput_(b,a);d=b}this.isCollapsed&&(a.hasJaggedEdge=!0,a.elements.push(new Blockly.blockRendering.JaggedEdge(this.constants_)));(a.elements.length||a.hasDummyInput)&&this.rows.push(a);this.populateBottomRow_();this.rows.push(this.bottomRow)}; +Blockly.blockRendering.RenderInfo.prototype.createRows_=function(){this.populateTopRow_();this.rows.push(this.topRow);var a=new Blockly.blockRendering.InputRow(this.constants_);this.inputRows.push(a);var b=this.block_.getIcons();if(b.length)for(var c=0,d;d=b[c];c++){var e=new Blockly.blockRendering.Icon(this.constants_,d);this.isCollapsed&&d.collapseHidden?this.hiddenIcons.push(e):a.elements.push(e)}d=null;for(c=0;b=this.block_.inputList[c];c++)if(b.isVisible()){this.shouldStartNewRow_(b,d)&&(this.rows.push(a), +a=new Blockly.blockRendering.InputRow(this.constants_),this.inputRows.push(a));for(d=0;e=b.fieldRow[d];d++)a.elements.push(new Blockly.blockRendering.Field(this.constants_,e,b));this.addInput_(b,a);d=b}this.isCollapsed&&(a.hasJaggedEdge=!0,a.elements.push(new Blockly.blockRendering.JaggedEdge(this.constants_)));(a.elements.length||a.hasDummyInput)&&this.rows.push(a);this.populateBottomRow_();this.rows.push(this.bottomRow)}; Blockly.blockRendering.RenderInfo.prototype.populateTopRow_=function(){var a=!!this.block_.previousConnection,b=(this.block_.hat?"cap"===this.block_.hat:this.constants_.ADD_START_HATS)&&!this.outputConnection&&!a;this.topRow.hasLeftSquareCorner(this.block_)?this.topRow.elements.push(new Blockly.blockRendering.SquareCorner(this.constants_)):this.topRow.elements.push(new Blockly.blockRendering.RoundCorner(this.constants_));b?(a=new Blockly.blockRendering.Hat(this.constants_),this.topRow.elements.push(a), this.topRow.capline=a.ascenderHeight):a&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new Blockly.blockRendering.PreviousConnection(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection));this.block_.inputList.length&&this.block_.inputList[0].type==Blockly.NEXT_STATEMENT&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT;this.topRow.hasRightSquareCorner(this.block_)? this.topRow.elements.push(new Blockly.blockRendering.SquareCorner(this.constants_,"right")):this.topRow.elements.push(new Blockly.blockRendering.RoundCorner(this.constants_,"right"))}; @@ -1180,7 +1120,7 @@ Blockly.blockRendering.RenderInfo.prototype.addAlignmentPadding_=function(a,b){v Blockly.blockRendering.RenderInfo.prototype.alignStatementRow_=function(a){var b=a.getLastInput(),c=a.width-b.width,d=this.statementEdge;c=d-c;0b?b:c;e=e?-1:1;a=(d?-1:1)*a/2;return Blockly.utils.svgPaths.lineTo(-e*c,a)+Blockly.utils.svgPaths.lineTo(e*c,a)}var b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(a){a/=2;return a>b?b:a},height:function(a){return a},connectionOffsetY:function(a){return a/2},connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b, +!0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}}; +Blockly.zelos.ConstantProvider.prototype.makeRounded=function(){function a(a,b,f){var d=a>c?a-c:0;a=(a>c?c:a)/2;return Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point((b?-1:1)*a,(b?-1:1)*a))+Blockly.utils.svgPaths.lineOnAxis("v",(f?1:-1)*d)+Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point((b?1:-1)*a,(b?-1:1)*a))}var b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,c=2*b;return{type:this.SHAPES.ROUND,isDynamic:!0,width:function(a){a/=2;return a>b?b:a},height:function(a){return a}, +connectionOffsetY:function(a){return a/2},connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b,!0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}}; Blockly.zelos.ConstantProvider.prototype.makeSquared=function(){function a(a,d,e){a-=2*b;return Blockly.utils.svgPaths.arc("a","0 0,1",b,Blockly.utils.svgPaths.point((d?-1:1)*b,(d?-1:1)*b))+Blockly.utils.svgPaths.lineOnAxis("v",(e?1:-1)*a)+Blockly.utils.svgPaths.arc("a","0 0,1",b,Blockly.utils.svgPaths.point((d?1:-1)*b,(d?-1:1)*b))}var b=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width:function(a){return b},height:function(a){return a},connectionOffsetY:function(a){return a/2}, connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b,!0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}}; Blockly.zelos.ConstantProvider.prototype.shapeFor=function(a){var b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case Blockly.INPUT_VALUE:case Blockly.OUTPUT_VALUE:a=a.getSourceBlock().getOutputShape();if(null!=a)switch(a){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}if(b&&-1!=b.indexOf("Boolean"))return this.HEXAGONAL;if(b&&-1!=b.indexOf("Number"))return this.ROUNDED; @@ -1299,56 +1260,113 @@ Blockly.zelos.ConstantProvider.prototype.makeNotch=function(){function a(a){retu [Blockly.utils.svgPaths.point(a*e/2,0),Blockly.utils.svgPaths.point(a*e*3/4,-(g/2)),Blockly.utils.svgPaths.point(a*e,-g)])+Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*e,-f)])+Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(a*e/4,-(g/2)),Blockly.utils.svgPaths.point(a*e/2,-g),Blockly.utils.svgPaths.point(a*e,-g)])}var b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}}; Blockly.zelos.ConstantProvider.prototype.makeInsideCorners=function(){var a=this.CORNER_RADIUS,b=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(-a,a)),c=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(-a,a)),d=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(a,a)),e=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(a,a));return{width:a,height:a,pathTop:b,pathBottom:d,rightWidth:a,rightHeight:a,pathTopRight:c,pathBottomRight:e}}; Blockly.zelos.ConstantProvider.prototype.generateSecondaryColour_=function(a){return Blockly.utils.colour.blend("#000",a,.15)||a};Blockly.zelos.ConstantProvider.prototype.generateTertiaryColour_=function(a){return Blockly.utils.colour.blend("#000",a,.25)||a}; -Blockly.zelos.ConstantProvider.prototype.createDom=function(a){Blockly.zelos.ConstantProvider.superClass_.createDom.call(this,a);a=Blockly.utils.dom.createSvgElement("defs",{},a);var b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyHighlightGlowFilter"+this.randomIdentifier_,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:.5},b);var c=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"}, -b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#fff200","flood-opacity":1,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.highlightGlowFilterId=b.id;this.highlightGlowFilter_=b;a=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyReplacementGlowFilter"+this.randomIdentifier_, +Blockly.zelos.ConstantProvider.prototype.createDom=function(a){Blockly.zelos.ConstantProvider.superClass_.createDom.call(this,a);a=Blockly.utils.dom.createSvgElement("defs",{},a);var b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklySelectedGlowFilter"+this.randomIdentifier_,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:.5},b);var c=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"}, +b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#fff200","flood-opacity":1,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.selectedGlowFilterId=b.id;this.selectedGlowFilter_=b;a=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyReplacementGlowFilter"+this.randomIdentifier_, height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:2},a);b=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"},a);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#fff200","flood-opacity":1,result:"outColor"},a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor", in2:"outBlur",operator:"in",result:"outGlow"},a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"outGlow",operator:"over"},a);this.replacementGlowFilterId=a.id;this.replacementGlowFilter_=a}; Blockly.zelos.ConstantProvider.prototype.getCSS_=function(a){a="."+a+"-renderer";return[a+" .blocklyText {","fill: #fff;","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-size: "+this.FIELD_TEXT_FONTSIZE+"pt;","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklyNonEditableText>rect:not(.blocklyDropdownRect),",a+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text,",a+ " .blocklyNonEditableText>g>text,",a+" .blocklyEditableText>g>text {","fill: #575E75;","}",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect ,",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",a+" .blocklyDropdownText {","fill: #fff !important;", -"}",a+".blocklyWidgetDiv .goog-menuitem,",a+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",a+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fff200;","}",a+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier_+")","}"]};Blockly.zelos.TopRow=function(a){Blockly.zelos.TopRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.TopRow,Blockly.blockRendering.TopRow);Blockly.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b};Blockly.zelos.TopRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection}; -Blockly.zelos.BottomRow=function(a){Blockly.zelos.BottomRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.BottomRow,Blockly.blockRendering.BottomRow);Blockly.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection};Blockly.zelos.BottomRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection};Blockly.zelos.RightConnectionShape=function(a){Blockly.zelos.RightConnectionShape.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.getType("RIGHT_CONNECTION");this.width=this.height=0};Blockly.utils.object.inherits(Blockly.zelos.RightConnectionShape,Blockly.blockRendering.Measurable);Blockly.zelos.StatementInput=function(a,b){Blockly.zelos.StatementInput.superClass_.constructor.call(this,a,b);if(this.connectedBlock){for(a=this.connectedBlock;a.getNextBlock();)a=a.getNextBlock();a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}};Blockly.utils.object.inherits(Blockly.zelos.StatementInput,Blockly.blockRendering.StatementInput);Blockly.zelos.RenderInfo=function(a,b){Blockly.zelos.RenderInfo.superClass_.constructor.call(this,a,b);this.topRow=new Blockly.zelos.TopRow(this.constants_);this.bottomRow=new Blockly.zelos.BottomRow(this.constants_);this.isInline=!0;this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.rightSide=this.outputConnection?new Blockly.zelos.RightConnectionShape(this.constants_):null};Blockly.utils.object.inherits(Blockly.zelos.RenderInfo,Blockly.blockRendering.RenderInfo); +"}",a+".blocklyWidgetDiv .goog-menuitem,",a+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",a+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fff200;","}",a+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier_+")","}"]};Blockly.zelos.TopRow=function(a){Blockly.zelos.TopRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.TopRow,Blockly.blockRendering.TopRow);Blockly.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b};Blockly.zelos.TopRow.prototype.hasRightSquareCorner=function(a){return!1}; +Blockly.zelos.BottomRow=function(a){Blockly.zelos.BottomRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.BottomRow,Blockly.blockRendering.BottomRow);Blockly.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection};Blockly.zelos.BottomRow.prototype.hasRightSquareCorner=function(a){return!1};Blockly.zelos.RightConnectionShape=function(a){Blockly.zelos.RightConnectionShape.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.getType("RIGHT_CONNECTION");this.width=this.height=0};Blockly.utils.object.inherits(Blockly.zelos.RightConnectionShape,Blockly.blockRendering.Measurable); +Blockly.zelos.StatementInput=function(a,b){Blockly.zelos.StatementInput.superClass_.constructor.call(this,a,b);if(this.connectedBlock){for(var c=this.connectedBlock;c.getNextBlock();)c=c.getNextBlock();c.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}};Blockly.utils.object.inherits(Blockly.zelos.StatementInput,Blockly.blockRendering.StatementInput);Blockly.zelos.RenderInfo=function(a,b){Blockly.zelos.RenderInfo.superClass_.constructor.call(this,a,b);this.topRow=new Blockly.zelos.TopRow(this.constants_);this.bottomRow=new Blockly.zelos.BottomRow(this.constants_);this.isInline=!0;this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=!1;this.rightSide=this.outputConnection?new Blockly.zelos.RightConnectionShape(this.constants_):null};Blockly.utils.object.inherits(Blockly.zelos.RenderInfo,Blockly.blockRendering.RenderInfo); Blockly.zelos.RenderInfo.prototype.getRenderer=function(){return this.renderer_};Blockly.zelos.RenderInfo.prototype.measure=function(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.adjustXPosition_();this.computeBounds_();this.alignRowElements_();this.finalize_()}; Blockly.zelos.RenderInfo.prototype.shouldStartNewRow_=function(a,b){return b?a.type==Blockly.NEXT_STATEMENT||b.type==Blockly.NEXT_STATEMENT?!0:a.type==Blockly.INPUT_VALUE||a.type==Blockly.DUMMY_INPUT?!this.isInline||this.isMultiRow:!1:!1};Blockly.zelos.RenderInfo.prototype.getDesiredRowWidth_=function(a){return a.hasStatement?this.width-this.startX-(this.constants_.INSIDE_CORNERS.rightWidth||0):Blockly.zelos.RenderInfo.superClass_.getDesiredRowWidth_.call(this,a)}; -Blockly.zelos.RenderInfo.prototype.getInRowSpacing_=function(a,b){return a&&b||!this.outputConnection||!this.outputConnection.isDynamicShape?!a&&b&&Blockly.blockRendering.Types.isStatementInput(b)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:a&&Blockly.blockRendering.Types.isLeftRoundedCorner(a)&&b&&(Blockly.blockRendering.Types.isPreviousConnection(b)||Blockly.blockRendering.Types.isNextConnection(b))?b.notchOffset-this.constants_.CORNER_RADIUS:a&&Blockly.blockRendering.Types.isLeftSquareCorner(a)&& +Blockly.zelos.RenderInfo.prototype.getInRowSpacing_=function(a,b){return a&&b||!this.outputConnection||!this.outputConnection.isDynamicShape||this.hasStatementInput?!a&&b&&Blockly.blockRendering.Types.isStatementInput(b)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:a&&Blockly.blockRendering.Types.isLeftRoundedCorner(a)&&b&&(Blockly.blockRendering.Types.isPreviousConnection(b)||Blockly.blockRendering.Types.isNextConnection(b))?b.notchOffset-this.constants_.CORNER_RADIUS:a&&Blockly.blockRendering.Types.isLeftSquareCorner(a)&& b&&Blockly.blockRendering.Types.isHat(b)?this.constants_.NO_PADDING:this.constants_.MEDIUM_PADDING:this.constants_.NO_PADDING}; -Blockly.zelos.RenderInfo.prototype.getSpacerRowHeight_=function(a,b){if(Blockly.blockRendering.Types.isTopRow(a)&&Blockly.blockRendering.Types.isBottomRow(b))return this.constants_.EMPTY_BLOCK_SPACER_HEIGHT;var c=Blockly.blockRendering.Types.isInputRow(a)&&a.hasStatement,d=Blockly.blockRendering.Types.isInputRow(b)&&b.hasStatement;return d||c?(a=Math.max(this.constants_.MEDIUM_PADDING,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.INSIDE_CORNERS.rightHeight||0)),d&&c?Math.max(a,this.constants_.DUMMY_INPUT_MIN_HEIGHT): -a):Blockly.blockRendering.Types.isTopRow(a)?a.hasPreviousConnection||this.outputConnection?this.constants_.NO_PADDING:this.constants_.SMALL_PADDING:Blockly.blockRendering.Types.isBottomRow(b)?this.outputConnection?this.constants_.NO_PADDING:this.constants_.SMALL_PADDING:this.constants_.MEDIUM_PADDING}; -Blockly.zelos.RenderInfo.prototype.getSpacerRowWidth_=function(a,b){var c=this.width-this.startX;return Blockly.blockRendering.Types.isInputRow(a)&&a.hasStatement||Blockly.blockRendering.Types.isInputRow(b)&&b.hasStatement?Math.max(c,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):c}; +Blockly.zelos.RenderInfo.prototype.getSpacerRowHeight_=function(a,b){if(Blockly.blockRendering.Types.isTopRow(a)&&Blockly.blockRendering.Types.isBottomRow(b))return this.constants_.EMPTY_BLOCK_SPACER_HEIGHT;var c=Blockly.blockRendering.Types.isInputRow(a)&&a.hasStatement,d=Blockly.blockRendering.Types.isInputRow(b)&&b.hasStatement;if(d||c){var e=Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.INSIDE_CORNERS.rightHeight||0);return d&&c?Math.max(e,this.constants_.DUMMY_INPUT_MIN_HEIGHT):e}return Blockly.blockRendering.Types.isTopRow(a)? +a.hasPreviousConnection||this.outputConnection&&!this.hasStatementInput?this.constants_.NO_PADDING:Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):Blockly.blockRendering.Types.isBottomRow(b)?this.outputConnection?!b.hasNextConnection&&this.hasStatementInput?Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):this.constants_.NO_PADDING:Math.max(this.topRow.minHeight,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.CORNER_RADIUS))-this.constants_.CORNER_RADIUS: +this.constants_.MEDIUM_PADDING};Blockly.zelos.RenderInfo.prototype.getSpacerRowWidth_=function(a,b){var c=this.width-this.startX;return Blockly.blockRendering.Types.isInputRow(a)&&a.hasStatement||Blockly.blockRendering.Types.isInputRow(b)&&b.hasStatement?Math.max(c,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):c}; Blockly.zelos.RenderInfo.prototype.getElemCenterline_=function(a,b){return a.hasStatement&&!Blockly.blockRendering.Types.isSpacer(b)?a.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/2:Blockly.zelos.RenderInfo.superClass_.getElemCenterline_.call(this,a,b)}; -Blockly.zelos.RenderInfo.prototype.addInput_=function(a,b){a.type==Blockly.DUMMY_INPUT&&b.hasDummyInput&&b.align==Blockly.ALIGN_LEFT&&a.align==Blockly.ALIGN_RIGHT&&(b.rightAlignedDummyInput=a);this.isInline&&a.type==Blockly.INPUT_VALUE?(b.elements.push(new Blockly.blockRendering.InlineInput(this.constants_,a)),b.hasInlineInput=!0):a.type==Blockly.NEXT_STATEMENT?(b.elements.push(new Blockly.zelos.StatementInput(this.constants_,a)),b.hasStatement=!0):a.type==Blockly.INPUT_VALUE?(b.elements.push(new Blockly.blockRendering.ExternalValueInput(this.constants_, -a)),b.hasExternalInput=!0):a.type==Blockly.DUMMY_INPUT&&(b.minHeight=Math.max(b.minHeight,a.getSourceBlock()&&a.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),b.hasDummyInput=!0);null==b.align&&(b.align=a.align)}; +Blockly.zelos.RenderInfo.prototype.addInput_=function(a,b){a.type==Blockly.DUMMY_INPUT&&b.hasDummyInput&&b.align==Blockly.ALIGN_LEFT&&a.align==Blockly.ALIGN_RIGHT&&(b.rightAlignedDummyInput=a);this.isInline&&a.type==Blockly.INPUT_VALUE?(b.elements.push(new Blockly.blockRendering.InlineInput(this.constants_,a)),b.hasInlineInput=!0):a.type==Blockly.NEXT_STATEMENT?(b.elements.push(new Blockly.zelos.StatementInput(this.constants_,a)),this.hasStatementInput=b.hasStatement=!0):a.type==Blockly.INPUT_VALUE? +(b.elements.push(new Blockly.blockRendering.ExternalValueInput(this.constants_,a)),b.hasExternalInput=!0):a.type==Blockly.DUMMY_INPUT&&(b.minHeight=Math.max(b.minHeight,a.getSourceBlock()&&a.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),b.hasDummyInput=!0);null==b.align&&(b.align=a.align)}; Blockly.zelos.RenderInfo.prototype.addAlignmentPadding_=function(a,b){if(a.rightAlignedDummyInput){for(var c,d=0,e;(e=a.elements[d])&&(Blockly.blockRendering.Types.isSpacer(e)&&(c=e),!Blockly.blockRendering.Types.isField(e)||e.parentInput!=a.rightAlignedDummyInput);d++);if(c){c.width+=b;a.width+=b;return}}Blockly.zelos.RenderInfo.superClass_.addAlignmentPadding_.call(this,a,b)}; Blockly.zelos.RenderInfo.prototype.adjustXPosition_=function(){for(var a=this.constants_.NOTCH_OFFSET_LEFT+this.constants_.NOTCH_WIDTH,b=a,c=2;c=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!f.precedesStatement;if(Blockly.blockRendering.Types.isInputRow(e)&&e.hasStatement)e.measure(),b=e.width-e.getLastInput().width+a;else if(d&&(2==c||f)&& Blockly.blockRendering.Types.isInputRow(e)&&!e.hasStatement){f=e.xPos;d=null;for(var g=0,h;h=e.elements[g];g++)Blockly.blockRendering.Types.isSpacer(h)&&(d=h),!(d&&(Blockly.blockRendering.Types.isField(h)||Blockly.blockRendering.Types.isInput(h))&&fc?c:this.height/2,b-c*(1-Math.sin(Math.acos((c-this.constants_.SMALL_PADDING)/c)));default:return 0}return Blockly.blockRendering.Types.isInlineInput(a)?(a=a.connectedBlock?a.connectedBlock.pathObject.outputShapeType: +a.shape.type,c==d.SHAPES.HEXAGONAL&&c!=a?0:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][a]):Blockly.blockRendering.Types.isField(a)?c==d.SHAPES.ROUND&&a.field instanceof Blockly.FieldTextInput?b-2.75*d.GRID_UNIT:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][0]:Blockly.blockRendering.Types.isIcon(a)?this.constants_.SMALL_PADDING:0}; Blockly.zelos.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var a=2;a=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!d.precedesStatement;if(e?this.topRow.hasPreviousConnection:b.followsStatement){var g=3==c.elements.length&&(c.elements[1].field instanceof Blockly.FieldLabel||c.elements[1].field instanceof Blockly.FieldImage);if(!e&&g)b.height-=this.constants_.SMALL_PADDING, d.height-=this.constants_.SMALL_PADDING,c.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!f)b.height+=this.constants_.SMALL_PADDING;else if(f){e=!1;for(f=0;g=c.elements[f];f++)if(Blockly.blockRendering.Types.isInlineInput(g)&&g.connectedBlock&&!g.connectedBlock.isShadow()&&40<=g.connectedBlock.getHeightWidth().height){e=!0;break}e&&(b.height-=this.constants_.SMALL_PADDING,d.height-=this.constants_.SMALL_PADDING)}}}}; Blockly.zelos.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();Blockly.zelos.RenderInfo.superClass_.finalize_.call(this)};Blockly.zelos.Drawer=function(a,b){Blockly.zelos.Drawer.superClass_.constructor.call(this,a,b)};Blockly.utils.object.inherits(Blockly.zelos.Drawer,Blockly.blockRendering.Drawer); Blockly.zelos.Drawer.prototype.draw=function(){var a=this.block_.pathObject;a.beginDrawing();this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();Blockly.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_);this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);a.endDrawing()}; -Blockly.zelos.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):Blockly.zelos.Drawer.superClass_.drawOutline_.call(this)}; +Blockly.zelos.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):Blockly.zelos.Drawer.superClass_.drawOutline_.call(this)};Blockly.zelos.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():Blockly.zelos.Drawer.superClass_.drawLeft_.call(this)}; Blockly.zelos.Drawer.prototype.drawRightSideRow_=function(a){if(!(0>=a.height))if(a.precedesStatement||a.followsStatement){var b=this.constants_.INSIDE_CORNERS.rightHeight;b=a.height-(a.precedesStatement?b:0);this.outlinePath_+=(a.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", +"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);Blockly.Trashcan=function(a){this.workspace_=a;this.contents_=[];this.flyout=null;if(!(0>=this.workspace_.options.maxTrashcanContents)){a=new Blockly.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex,renderer:this.workspace_.options.renderer});if(this.workspace_.horizontalLayout){a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_TOP?Blockly.TOOLBOX_AT_BOTTOM:Blockly.TOOLBOX_AT_TOP;if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout"); +this.flyout=new Blockly.HorizontalFlyout(a)}else{a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?Blockly.TOOLBOX_AT_LEFT:Blockly.TOOLBOX_AT_RIGHT;if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");this.flyout=new Blockly.VerticalFlyout(a)}this.workspace_.addChangeListener(this.onDelete_.bind(this))}};Blockly.Trashcan.prototype.WIDTH_=47;Blockly.Trashcan.prototype.BODY_HEIGHT_=44;Blockly.Trashcan.prototype.LID_HEIGHT_=16; +Blockly.Trashcan.prototype.MARGIN_BOTTOM_=20;Blockly.Trashcan.prototype.MARGIN_SIDE_=20;Blockly.Trashcan.prototype.MARGIN_HOTSPOT_=10;Blockly.Trashcan.prototype.SPRITE_LEFT_=0;Blockly.Trashcan.prototype.SPRITE_TOP_=32;Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_=.1;Blockly.Trashcan.ANIMATION_LENGTH_=80;Blockly.Trashcan.ANIMATION_FRAMES_=4;Blockly.Trashcan.OPACITY_MIN_=.4;Blockly.Trashcan.OPACITY_MAX_=.8;Blockly.Trashcan.MAX_LID_ANGLE_=45;Blockly.Trashcan.prototype.isOpen=!1; +Blockly.Trashcan.prototype.minOpenness_=0;Blockly.Trashcan.prototype.svgGroup_=null;Blockly.Trashcan.prototype.svgLid_=null;Blockly.Trashcan.prototype.lidTask_=0;Blockly.Trashcan.prototype.lidOpen_=0;Blockly.Trashcan.prototype.left_=0;Blockly.Trashcan.prototype.top_=0; +Blockly.Trashcan.prototype.createDom=function(){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},b);var c=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, +y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup_);c.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashLidClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.LID_HEIGHT_},b);this.svgLid_=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, +y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup_);this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.click);Blockly.bindEvent_(c,"mouseover",this,this.mouseOver_);Blockly.bindEvent_(c,"mouseout",this,this.mouseOut_);this.animateLid_();return this.svgGroup_}; +Blockly.Trashcan.prototype.init=function(a){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),Blockly.Trashcan.ANIMATION_LENGTH_/ +a))};Blockly.Trashcan.prototype.setLidAngle_=function(a){var b=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")};Blockly.Trashcan.prototype.setMinOpenness_=function(a){this.minOpenness_=a;this.isOpen||this.setLidAngle_(a*Blockly.Trashcan.MAX_LID_ANGLE_)};Blockly.Trashcan.prototype.close=function(){this.setOpen(!1)}; +Blockly.Trashcan.prototype.click=function(){if(this.contents_.length){for(var a=[],b=0,c;c=this.contents_[b];b++)a[b]=Blockly.Xml.textToDom(c);this.flyout.show(a)}};Blockly.Trashcan.prototype.mouseOver_=function(){this.contents_.length&&this.setOpen(!0)};Blockly.Trashcan.prototype.mouseOut_=function(){this.setOpen(!1)}; +Blockly.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents)&&a.type==Blockly.Events.BLOCK_DELETE&&"shadow"!=a.oldXml.tagName.toLowerCase()&&(a=this.cleanBlockXML_(a.oldXml),-1==this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_)}}; +Blockly.Trashcan.prototype.cleanBlockXML_=function(a){for(var b=a=a.cloneNode(!0);b;){b.removeAttribute&&(b.removeAttribute("x"),b.removeAttribute("y"),b.removeAttribute("id"),b.removeAttribute("disabled"),"comment"==b.nodeName&&(b.removeAttribute("h"),b.removeAttribute("w"),b.removeAttribute("pinned")));var c=b.firstChild||b.nextSibling;if(!c)for(c=b.parentNode;c;){if(c.nextSibling){c=c.nextSibling;break}c=c.parentNode}b=c}return Blockly.Xml.domToText(a)};Blockly.VariablesDynamic={};Blockly.VariablesDynamic.onCreateVariableButtonClick_String=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"String")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Number=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Number")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Colour")}; +Blockly.VariablesDynamic.flyoutCategory=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_COLOUR_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"); +b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",Blockly.VariablesDynamic.onCreateVariableButtonClick_String);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",Blockly.VariablesDynamic.onCreateVariableButtonClick_Number);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour);a=Blockly.VariablesDynamic.flyoutCategoryBlocks(a);return b=b.concat(a)}; +Blockly.VariablesDynamic.flyoutCategoryBlocks=function(a){a=a.getAllVariables();var b=[];if(0image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);Blockly.Themes.Dark={}; Blockly.Themes.Dark.defaultBlockStyles={colour_blocks:{colourPrimary:"#a5745b",colourSecondary:"#dbc7bd",colourTertiary:"#845d49"},list_blocks:{colourPrimary:"#745ba5",colourSecondary:"#c7bddb",colourTertiary:"#5d4984"},logic_blocks:{colourPrimary:"#5b80a5",colourSecondary:"#bdccdb",colourTertiary:"#496684"},loop_blocks:{colourPrimary:"#5ba55b",colourSecondary:"#bddbbd",colourTertiary:"#498449"},math_blocks:{colourPrimary:"#5b67a5",colourSecondary:"#bdc2db",colourTertiary:"#495284"},procedure_blocks:{colourPrimary:"#995ba5", colourSecondary:"#d6bddb",colourTertiary:"#7a4984"},text_blocks:{colourPrimary:"#5ba58c",colourSecondary:"#bddbd1",colourTertiary:"#498470"},variable_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a"},variable_dynamic_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a"},hat_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a",hat:"cap"}}; Blockly.Themes.Dark.categoryStyles={colour_category:{colour:"#a5745b"},list_category:{colour:"#745ba5"},logic_category:{colour:"#5b80a5"},loop_category:{colour:"#5ba55b"},math_category:{colour:"#5b67a5"},procedure_category:{colour:"#995ba5"},text_category:{colour:"#5ba58c"},variable_category:{colour:"#a55b99"},variable_dynamic_category:{colour:"#a55b99"}};Blockly.Themes.Dark=new Blockly.Theme("dark",Blockly.Themes.Dark.defaultBlockStyles,Blockly.Themes.Dark.categoryStyles); @@ -1364,4 +1382,4 @@ colourSecondary:"#77E6EE",colourTertiary:"#CFECEE"},text_blocks:{colourPrimary:" Blockly.Themes.HighContrast.categoryStyles={colour_category:{colour:"#a52714"},list_category:{colour:"#4a148c"},logic_category:{colour:"#01579b"},loop_category:{colour:"#33691e"},math_category:{colour:"#1a237e"},procedure_category:{colour:"#006064"},text_category:{colour:"#004d40"},variable_category:{colour:"#880e4f"},variable_dynamic_category:{colour:"#880e4f"}};Blockly.Themes.HighContrast=new Blockly.Theme("highcontrast",Blockly.Themes.HighContrast.defaultBlockStyles,Blockly.Themes.HighContrast.categoryStyles);Blockly.Themes.Tritanopia={}; Blockly.Themes.Tritanopia.defaultBlockStyles={colour_blocks:{colourPrimary:"#05427f",colourSecondary:"#2974c0",colourTertiary:"#2d74bb"},list_blocks:{colourPrimary:"#b69ce8",colourSecondary:"#ccbaef",colourTertiary:"#9176c5"},logic_blocks:{colourPrimary:"#9fd2f1",colourSecondary:"#c0e0f4",colourTertiary:"#74bae5"},loop_blocks:{colourPrimary:"#aa1846",colourSecondary:"#d36185",colourTertiary:"#7c1636"},math_blocks:{colourPrimary:"#e6da39",colourSecondary:"#f3ec8e",colourTertiary:"#f2eeb7"},procedure_blocks:{colourPrimary:"#590721", colourSecondary:"#8c475d",colourTertiary:"#885464"},text_blocks:{colourPrimary:"#058863",colourSecondary:"#5ecfaf",colourTertiary:"#04684c"},variable_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"},variable_dynamic_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"}}; -Blockly.Themes.Tritanopia.categoryStyles={colour_category:{colour:"#05427f"},list_category:{colour:"#b69ce8"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#aa1846"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#4b2d84"},variable_dynamic_category:{colour:"#4b2d84"}};Blockly.Themes.Tritanopia=new Blockly.Theme("tritanopia",Blockly.Themes.Tritanopia.defaultBlockStyles,Blockly.Themes.Tritanopia.categoryStyles);Blockly.requires={}; +Blockly.Themes.Tritanopia.categoryStyles={colour_category:{colour:"#05427f"},list_category:{colour:"#b69ce8"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#aa1846"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#4b2d84"},variable_dynamic_category:{colour:"#4b2d84"}};Blockly.Themes.Tritanopia=new Blockly.Theme("tritanopia",Blockly.Themes.Tritanopia.defaultBlockStyles,Blockly.Themes.Tritanopia.categoryStyles);Blockly.requires={}; \ No newline at end of file diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index 433f6ebc4..0acc427fe 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by gulp. +// Do not edit this file; automatically generated by build.py. 'use strict'; this.IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports); @@ -21,166 +21,166 @@ this.BLOCKLY_DIR = (function(root) { this.BLOCKLY_BOOT = function(root) { // Execute after Closure has loaded. -goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Workspace', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.string'], {}); -goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.dom'], {}); -goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/block_events.js', ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ContextMenu', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Procedures', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.constants', 'Blockly.inject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.colour'], {}); -goog.addDependency('../../core/blocks.js', ['Blockly.Blocks'], [], {}); -goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/components/component.js', ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.IdGenerator', 'Blockly.utils.dom', 'Blockly.utils.style'], {}); -goog.addDependency('../../core/components/menu/menu.js', ['Blockly.Menu'], ['Blockly.Component', 'Blockly.utils.Coordinate', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/components/menu/menuitem.js', ['Blockly.MenuItem'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/components/tree/basenode.js', ['Blockly.tree.BaseNode'], ['Blockly.Component', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style'], {}); -goog.addDependency('../../core/components/tree/treecontrol.js', ['Blockly.tree.TreeControl'], ['Blockly.tree.BaseNode', 'Blockly.tree.TreeNode', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style'], {}); -goog.addDependency('../../core/components/tree/treenode.js', ['Blockly.tree.TreeNode'], ['Blockly.tree.BaseNode', 'Blockly.utils.KeyCodes', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml'], {}); -goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection'], {}); -goog.addDependency('../../core/constants.js', ['Blockly.constants'], [], {}); -goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.Xml', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.uiMenu', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/css.js', ['Blockly.Css'], [], {'lang': 'es5'}); -goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style'], {}); -goog.addDependency('../../core/events.js', ['Blockly.Events'], ['Blockly.utils'], {}); -goog.addDependency('../../core/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {}); -goog.addDependency('../../core/extensions.js', ['Blockly.Extensions'], ['Blockly.utils'], {}); -goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/field_checkbox.js', ['Blockly.FieldCheckbox'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_colour.js', ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils.IdGenerator', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_date.js', ['Blockly.FieldDate'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'goog.date', 'goog.date.DateTime', 'goog.events', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_he', 'goog.ui.DatePicker'], {}); -goog.addDependency('../../core/field_dropdown.js', ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/field_image.js', ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_label.js', ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_label_serializable.js', ['Blockly.FieldLabelSerializable'], ['Blockly.FieldLabel', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/field_number.js', ['Blockly.FieldNumber'], ['Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.aria', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/field_registry.js', ['Blockly.fieldRegistry'], [], {}); -goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/field_variable.js', ['Blockly.FieldVariable'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/flyout_dragger.js', ['Blockly.FlyoutDragger'], ['Blockly.WorkspaceDragger', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/flyout_horizontal.js', ['Blockly.HorizontalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/flyout_vertical.js', ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/generator.js', ['Blockly.Generator'], ['Blockly.Block'], {}); -goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.ASTNode', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.constants', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel'], {}); -goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.Events', 'Blockly.blockAnimations'], {}); -goog.addDependency('../../core/keyboard_nav/action.js', ['Blockly.Action'], [], {}); -goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.utils.Coordinate'], {'lang': 'es5'}); -goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor'], {'lang': 'es5'}); -goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Action', 'Blockly.Marker', 'Blockly.navigation', 'Blockly.utils.object'], {'lang': 'es5'}); -goog.addDependency('../../core/keyboard_nav/flyout_cursor.js', ['Blockly.FlyoutCursor'], ['Blockly.Cursor', 'Blockly.navigation', 'Blockly.utils.object'], {'lang': 'es5'}); -goog.addDependency('../../core/keyboard_nav/key_map.js', ['Blockly.user.keyMap'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/keyboard_nav/marker.js', ['Blockly.Marker'], ['Blockly.ASTNode', 'Blockly.navigation'], {}); -goog.addDependency('../../core/keyboard_nav/navigation.js', ['Blockly.navigation'], ['Blockly.ASTNode', 'Blockly.Action', 'Blockly.user.keyMap', 'Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/keyboard_nav/tab_navigate_cursor.js', ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], ['Blockly.Cursor', 'Blockly.Marker'], {}); -goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {}); -goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg'], {}); -goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.Xml', 'Blockly.user.keyMap', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.constants', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); -goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {}); -goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {}); -goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode'], {}); -goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo'], {}); -goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/geras/drawer.js', ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {}); -goog.addDependency('../../core/renderers/geras/highlight_constants.js', ['Blockly.geras.HighlightConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/geras/highlighter.js', ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); -goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/geras/measurables/inputs.js', ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/geras/renderer.js', ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/measurables/base.js', ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types'], {}); -goog.addDependency('../../core/renderers/measurables/connections.js', ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/measurables/inputs.js', ['Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.StatementInput'], ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/measurables/row_elements.js', ['Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SquareCorner'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/measurables/rows.js', ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow'], ['Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/measurables/types.js', ['Blockly.blockRendering.Types'], [], {}); -goog.addDependency('../../core/renderers/minimalist/constants.js', ['Blockly.minimalist.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/minimalist/drawer.js', ['Blockly.minimalist.Drawer'], ['Blockly.blockRendering.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/minimalist/info.js', ['Blockly.minimalist', 'Blockly.minimalist.RenderInfo'], ['Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/minimalist/renderer.js', ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/thrasos/info.js', ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/thrasos/renderer.js', ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); -goog.addDependency('../../core/renderers/zelos/drawer.js', ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.RenderInfo'], {}); -goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {}); -goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg'], {}); -goog.addDependency('../../core/renderers/zelos/measurables/inputs.js', ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/measurables/row_elements.js', ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/measurables/rows.js', ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider'], {}); -goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {}); -goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer'], {}); -goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/theme.js', ['Blockly.Theme'], ['Blockly.utils', 'Blockly.utils.colour'], {}); -goog.addDependency('../../core/theme/classic.js', ['Blockly.Themes.Classic'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme/dark.js', ['Blockly.Themes.Dark'], ['Blockly.Css', 'Blockly.Theme'], {'lang': 'es5'}); -goog.addDependency('../../core/theme/deuteranopia.js', ['Blockly.Themes.Deuteranopia'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme/highcontrast.js', ['Blockly.Themes.HighContrast'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme/modern.js', ['Blockly.Themes.Modern'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme/tritanopia.js', ['Blockly.Themes.Tritanopia'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme/zelos.js', ['Blockly.Themes.Zelos'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/theme_manager.js', ['Blockly.ThemeManager'], ['Blockly.Theme'], {}); -goog.addDependency('../../core/toolbox.js', ['Blockly.Toolbox'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Touch', 'Blockly.navigation', 'Blockly.tree.TreeControl', 'Blockly.tree.TreeNode', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.utils.string'], {}); -goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string'], {}); -goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.utils.Rect', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/ui_events.js', ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/ui_menu_utils.js', ['Blockly.utils.uiMenu'], ['Blockly.utils.style'], {}); -goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.Coordinate', 'Blockly.utils.colour', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {}); -goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], [], {}); -goog.addDependency('../../core/utils/coordinate.js', ['Blockly.utils.Coordinate'], [], {}); -goog.addDependency('../../core/utils/dom.js', ['Blockly.utils.dom'], ['Blockly.utils.userAgent'], {}); -goog.addDependency('../../core/utils/global.js', ['Blockly.utils.global'], [], {}); -goog.addDependency('../../core/utils/idgenerator.js', ['Blockly.utils.IdGenerator'], [], {}); -goog.addDependency('../../core/utils/keycodes.js', ['Blockly.utils.KeyCodes'], [], {}); -goog.addDependency('../../core/utils/math.js', ['Blockly.utils.math'], [], {}); -goog.addDependency('../../core/utils/object.js', ['Blockly.utils.object'], [], {}); -goog.addDependency('../../core/utils/rect.js', ['Blockly.utils.Rect'], [], {}); -goog.addDependency('../../core/utils/size.js', ['Blockly.utils.Size'], [], {}); -goog.addDependency('../../core/utils/string.js', ['Blockly.utils.string'], [], {}); -goog.addDependency('../../core/utils/style.js', ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size'], {}); -goog.addDependency('../../core/utils/svg_paths.js', ['Blockly.utils.svgPaths'], [], {}); -goog.addDependency('../../core/utils/useragent.js', ['Blockly.utils.userAgent'], ['Blockly.utils.global'], {}); -goog.addDependency('../../core/utils/xml.js', ['Blockly.utils.xml'], [], {}); -goog.addDependency('../../core/variable_events.js', ['Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils'], {}); -goog.addDependency('../../core/variables.js', ['Blockly.Variables'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Xml', 'Blockly.utils', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/variables_dynamic.js', ['Blockly.VariablesDynamic'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/widgetdiv.js', ['Blockly.WidgetDiv'], ['Blockly.utils.style'], {}); -goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.Events', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.utils', 'Blockly.utils.math'], {}); -goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es5'}); -goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/workspace_comment_render_svg.js', ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.WorkspaceComment', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.dom'], {}); -goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate'], {}); -goog.addDependency('../../core/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.utils.object'], {'lang': 'es5'}); -goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.constants', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); -goog.addDependency('../../core/ws_comment_events.js', ['Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.VarCreate', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml'], {}); -goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency("../../core/block.js", ['Blockly.Block'], ['Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.fieldRegistry', 'Blockly.Input', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.Workspace']); +goog.addDependency("../../core/block_animations.js", ['Blockly.blockAnimations'], ['Blockly.utils.dom']); +goog.addDependency("../../core/block_drag_surface.js", ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); +goog.addDependency("../../core/block_dragger.js", ['Blockly.BlockDragger'], ['Blockly.blockAnimations', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.InsertionMarkerManager', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); +goog.addDependency("../../core/block_events.js", ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml']); +goog.addDependency("../../core/block_svg.js", ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.ContextMenu', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Events.BlockMove', 'Blockly.Msg', 'Blockly.navigation', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect']); +goog.addDependency("../../core/blockly.js", ['Blockly'], ['Blockly.constants', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.inject', 'Blockly.navigation', 'Blockly.Procedures', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.colour', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); +goog.addDependency("../../core/blocks.js", ['Blockly.Blocks'], []); +goog.addDependency("../../core/bubble.js", ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent', 'Blockly.Workspace']); +goog.addDependency("../../core/bubble_dragger.js", ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate']); +goog.addDependency("../../core/comment.js", ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent', 'Blockly.Warning']); +goog.addDependency("../../core/components/component.js", ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.dom', 'Blockly.utils.IdGenerator', 'Blockly.utils.style']); +goog.addDependency("../../core/components/menu/menu.js", ['Blockly.Menu'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/components/menu/menuitem.js", ['Blockly.MenuItem'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/components/tree/basenode.js", ['Blockly.tree.BaseNode'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.KeyCodes', 'Blockly.utils.style']); +goog.addDependency("../../core/components/tree/treecontrol.js", ['Blockly.tree.TreeControl'], ['Blockly.tree.TreeNode', 'Blockly.tree.BaseNode', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style']); +goog.addDependency("../../core/components/tree/treenode.js", ['Blockly.tree.TreeNode'], ['Blockly.tree.BaseNode', 'Blockly.utils.object', 'Blockly.utils.KeyCodes']); +goog.addDependency("../../core/connection.js", ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml']); +goog.addDependency("../../core/connection_db.js", ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection']); +goog.addDependency("../../core/constants.js", ['Blockly.constants'], []); +goog.addDependency("../../core/contextmenu.js", ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.uiMenu', 'Blockly.utils.userAgent', 'Blockly.Xml']); +goog.addDependency("../../core/css.js", ['Blockly.Css'], []); +goog.addDependency("../../core/dropdowndiv.js", ['Blockly.DropDownDiv'], ['Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style']); +goog.addDependency("../../core/events.js", ['Blockly.Events'], ['Blockly.utils']); +goog.addDependency("../../core/events_abstract.js", ['Blockly.Events.Abstract'], ['Blockly.Events']); +goog.addDependency("../../core/extensions.js", ['Blockly.Extensions'], ['Blockly.utils']); +goog.addDependency("../../core/field.js", ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.Size', 'Blockly.utils.style', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/field_angle.js", ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.fieldRegistry', 'Blockly.FieldTextInput', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/field_checkbox.js", ['Blockly.FieldCheckbox'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); +goog.addDependency("../../core/field_colour.js", ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.IdGenerator', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.Size']); +goog.addDependency("../../core/field_date.js", ['Blockly.FieldDate'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'goog.date', 'goog.date.DateTime', 'goog.events', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_he', 'goog.ui.DatePicker']); +goog.addDependency("../../core/field_dropdown.js", ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.utils.string', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/field_image.js", ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); +goog.addDependency("../../core/field_label.js", ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); +goog.addDependency("../../core/field_label_serializable.js", ['Blockly.FieldLabelSerializable'], ['Blockly.FieldLabel', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.object']); +goog.addDependency("../../core/field_multilineinput.js", ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/field_number.js", ['Blockly.FieldNumber'], ['Blockly.fieldRegistry', 'Blockly.FieldTextInput', 'Blockly.utils.aria', 'Blockly.utils.object']); +goog.addDependency("../../core/field_registry.js", ['Blockly.fieldRegistry'], []); +goog.addDependency("../../core/field_textinput.js", ['Blockly.FieldTextInput'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/field_variable.js", ['Blockly.FieldVariable'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.fieldRegistry', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml']); +goog.addDependency("../../core/flyout_base.js", ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.blockRendering', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); +goog.addDependency("../../core/flyout_button.js", ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); +goog.addDependency("../../core/flyout_dragger.js", ['Blockly.FlyoutDragger'], ['Blockly.utils.object', 'Blockly.WorkspaceDragger']); +goog.addDependency("../../core/flyout_horizontal.js", ['Blockly.HorizontalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.WidgetDiv']); +goog.addDependency("../../core/flyout_vertical.js", ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.utils.userAgent', 'Blockly.WidgetDiv']); +goog.addDependency("../../core/generator.js", ['Blockly.Generator'], ['Blockly.Block']); +goog.addDependency("../../core/gesture.js", ['Blockly.Gesture'], ['Blockly.ASTNode', 'Blockly.blockAnimations', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.navigation', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.WorkspaceDragger']); +goog.addDependency("../../core/grid.js", ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/icon.js", ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.Size']); +goog.addDependency("../../core/inject.js", ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg']); +goog.addDependency("../../core/input.js", ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel']); +goog.addDependency("../../core/insertion_marker_manager.js", ['Blockly.InsertionMarkerManager'], ['Blockly.blockAnimations', 'Blockly.Events']); +goog.addDependency("../../core/keyboard_nav/action.js", ['Blockly.Action'], []); +goog.addDependency("../../core/keyboard_nav/ast_node.js", ['Blockly.ASTNode'], ['Blockly.utils.Coordinate']); +goog.addDependency("../../core/keyboard_nav/basic_cursor.js", ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor']); +goog.addDependency("../../core/keyboard_nav/cursor.js", ['Blockly.Cursor'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.Marker', 'Blockly.navigation', 'Blockly.utils.object']); +goog.addDependency("../../core/keyboard_nav/flyout_cursor.js", ['Blockly.FlyoutCursor'], ['Blockly.Cursor', 'Blockly.navigation', 'Blockly.utils.object']); +goog.addDependency("../../core/keyboard_nav/key_map.js", ['Blockly.user.keyMap'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object']); +goog.addDependency("../../core/keyboard_nav/marker.js", ['Blockly.Marker'], ['Blockly.ASTNode', 'Blockly.navigation']); +goog.addDependency("../../core/keyboard_nav/navigation.js", ['Blockly.navigation'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.utils.Coordinate', 'Blockly.user.keyMap']); +goog.addDependency("../../core/keyboard_nav/tab_navigate_cursor.js", ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object']); +goog.addDependency("../../core/marker_manager.js", ['Blockly.MarkerManager'], ['Blockly.Cursor', 'Blockly.Marker']); +goog.addDependency("../../core/msg.js", ['Blockly.Msg'], ['Blockly.utils.global']); +goog.addDependency("../../core/mutator.js", ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.xml', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); +goog.addDependency("../../core/names.js", ['Blockly.Names'], ['Blockly.Msg']); +goog.addDependency("../../core/options.js", ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.user.keyMap', 'Blockly.utils.userAgent', 'Blockly.Xml']); +goog.addDependency("../../core/procedures.js", ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.utils.xml', 'Blockly.Workspace', 'Blockly.Xml']); +goog.addDependency("../../core/rendered_connection.js", ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/common/block_rendering.js", ['Blockly.blockRendering'], ['Blockly.utils.object']); +goog.addDependency("../../core/renderers/common/constants.js", ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/renderers/common/debugger.js", ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types']); +goog.addDependency("../../core/renderers/common/drawer.js", ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths']); +goog.addDependency("../../core/renderers/common/i_path_object.js", ['Blockly.blockRendering.IPathObject'], []); +goog.addDependency("../../core/renderers/common/info.js", ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types']); +goog.addDependency("../../core/renderers/common/marker_svg.js", ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode']); +goog.addDependency("../../core/renderers/common/path_object.js", ['Blockly.blockRendering.PathObject'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.Theme', 'Blockly.utils.dom']); +goog.addDependency("../../core/renderers/common/renderer.js", ['Blockly.blockRendering.Renderer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.InsertionMarkerManager']); +goog.addDependency("../../core/renderers/geras/constants.js", ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/geras/drawer.js", ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths']); +goog.addDependency("../../core/renderers/geras/highlight_constants.js", ['Blockly.geras.HighlightConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.svgPaths']); +goog.addDependency("../../core/renderers/geras/highlighter.js", ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths']); +goog.addDependency("../../core/renderers/geras/info.js", ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/geras/measurables/inputs.js", ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.utils.object']); +goog.addDependency("../../core/renderers/geras/path_object.js", ['Blockly.geras.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.Theme', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/geras/renderer.js", ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/measurables/base.js", ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types']); +goog.addDependency("../../core/renderers/measurables/connections.js", ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/measurables/inputs.js", ['Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.StatementInput'], ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/measurables/row_elements.js", ['Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SquareCorner'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/measurables/rows.js", ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow'], ['Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/measurables/types.js", ['Blockly.blockRendering.Types'], []); +goog.addDependency("../../core/renderers/minimalist/constants.js", ['Blockly.minimalist.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/minimalist/drawer.js", ['Blockly.minimalist.Drawer'], ['Blockly.blockRendering.Drawer', 'Blockly.utils.object', 'Blockly.minimalist.RenderInfo']); +goog.addDependency("../../core/renderers/minimalist/info.js", ['Blockly.minimalist', 'Blockly.minimalist.RenderInfo'], ['Blockly.utils.object']); +goog.addDependency("../../core/renderers/minimalist/renderer.js", ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.utils.object', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo']); +goog.addDependency("../../core/renderers/thrasos/info.js", ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/thrasos/renderer.js", ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/zelos/constants.js", ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths']); +goog.addDependency("../../core/renderers/zelos/drawer.js", ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.RenderInfo']); +goog.addDependency("../../core/renderers/zelos/info.js", ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow']); +goog.addDependency("../../core/renderers/zelos/marker_svg.js", ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg']); +goog.addDependency("../../core/renderers/zelos/measurables/inputs.js", ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/zelos/measurables/row_elements.js", ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/zelos/measurables/rows.js", ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/zelos/path_object.js", ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.zelos.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/renderers/zelos/renderer.js", ['Blockly.zelos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.InsertionMarkerManager', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo', 'Blockly.zelos.MarkerSvg']); +goog.addDependency("../../core/requires.js", ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.HorizontalFlyout', 'Blockly.VerticalFlyout', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.ZoomControls', 'Blockly.Mutator', 'Blockly.Warning', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldLabelSerializable', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia']); +goog.addDependency("../../core/scrollbar.js", ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); +goog.addDependency("../../core/theme.js", ['Blockly.Theme'], ['Blockly.utils', 'Blockly.utils.colour']); +goog.addDependency("../../core/theme/classic.js", ['Blockly.Themes.Classic'], ['Blockly.Theme']); +goog.addDependency("../../core/theme/dark.js", ['Blockly.Themes.Dark'], ['Blockly.Css', 'Blockly.Theme']); +goog.addDependency("../../core/theme/deuteranopia.js", ['Blockly.Themes.Deuteranopia'], ['Blockly.Theme']); +goog.addDependency("../../core/theme/highcontrast.js", ['Blockly.Themes.HighContrast'], ['Blockly.Theme']); +goog.addDependency("../../core/theme/modern.js", ['Blockly.Themes.Modern'], ['Blockly.Theme']); +goog.addDependency("../../core/theme/tritanopia.js", ['Blockly.Themes.Tritanopia'], ['Blockly.Theme']); +goog.addDependency("../../core/theme/zelos.js", ['Blockly.Themes.Zelos'], ['Blockly.Theme']); +goog.addDependency("../../core/theme_manager.js", ['Blockly.ThemeManager'], ['Blockly.Theme']); +goog.addDependency("../../core/toolbox.js", ['Blockly.Toolbox'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.navigation', 'Blockly.Touch', 'Blockly.tree.TreeControl', 'Blockly.tree.TreeNode', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect']); +goog.addDependency("../../core/tooltip.js", ['Blockly.Tooltip'], ['Blockly.utils.string']); +goog.addDependency("../../core/touch.js", ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string']); +goog.addDependency("../../core/touch_gesture.js", ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object']); +goog.addDependency("../../core/trashcan.js", ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.utils.dom', 'Blockly.utils.Rect', 'Blockly.Xml']); +goog.addDependency("../../core/ui_events.js", ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object']); +goog.addDependency("../../core/ui_menu_utils.js", ['Blockly.utils.uiMenu'], ['Blockly.utils.style']); +goog.addDependency("../../core/utils.js", ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.colour', 'Blockly.utils.Coordinate', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/utils/aria.js", ['Blockly.utils.aria'], []); +goog.addDependency("../../core/utils/colour.js", ['Blockly.utils.colour'], []); +goog.addDependency("../../core/utils/coordinate.js", ['Blockly.utils.Coordinate'], []); +goog.addDependency("../../core/utils/dom.js", ['Blockly.utils.dom'], ['Blockly.utils.userAgent']); +goog.addDependency("../../core/utils/global.js", ['Blockly.utils.global'], []); +goog.addDependency("../../core/utils/idgenerator.js", ['Blockly.utils.IdGenerator'], []); +goog.addDependency("../../core/utils/keycodes.js", ['Blockly.utils.KeyCodes'], []); +goog.addDependency("../../core/utils/math.js", ['Blockly.utils.math'], []); +goog.addDependency("../../core/utils/object.js", ['Blockly.utils.object'], []); +goog.addDependency("../../core/utils/rect.js", ['Blockly.utils.Rect'], []); +goog.addDependency("../../core/utils/size.js", ['Blockly.utils.Size'], []); +goog.addDependency("../../core/utils/string.js", ['Blockly.utils.string'], []); +goog.addDependency("../../core/utils/style.js", ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size']); +goog.addDependency("../../core/utils/svg_paths.js", ['Blockly.utils.svgPaths'], []); +goog.addDependency("../../core/utils/useragent.js", ['Blockly.utils.userAgent'], ['Blockly.utils.global']); +goog.addDependency("../../core/utils/xml.js", ['Blockly.utils.xml'], []); +goog.addDependency("../../core/variable_events.js", ['Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object']); +goog.addDependency("../../core/variable_map.js", ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object']); +goog.addDependency("../../core/variable_model.js", ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils']); +goog.addDependency("../../core/variables.js", ['Blockly.Variables'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.xml', 'Blockly.VariableModel', 'Blockly.Xml']); +goog.addDependency("../../core/variables_dynamic.js", ['Blockly.VariablesDynamic'], ['Blockly.Variables', 'Blockly.Blocks', 'Blockly.Msg', 'Blockly.utils.xml', 'Blockly.VariableModel']); +goog.addDependency("../../core/warning.js", ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object']); +goog.addDependency("../../core/widgetdiv.js", ['Blockly.WidgetDiv'], ['Blockly.utils.style']); +goog.addDependency("../../core/workspace.js", ['Blockly.Workspace'], ['Blockly.Events', 'Blockly.Options', 'Blockly.utils', 'Blockly.utils.math', 'Blockly.VariableMap']); +goog.addDependency("../../core/workspace_audio.js", ['Blockly.WorkspaceAudio'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.userAgent']); +goog.addDependency("../../core/workspace_comment.js", ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml']); +goog.addDependency("../../core/workspace_comment_render_svg.js", ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); +goog.addDependency("../../core/workspace_comment_svg.js", ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.WorkspaceComment']); +goog.addDependency("../../core/workspace_drag_surface_svg.js", ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.dom']); +goog.addDependency("../../core/workspace_dragger.js", ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate']); +goog.addDependency("../../core/workspace_events.js", ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.utils.object']); +goog.addDependency("../../core/workspace_svg.js", ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.blockRendering', 'Blockly.ConnectionDB', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.navigation', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml']); +goog.addDependency("../../core/ws_comment_events.js", ['Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml']); +goog.addDependency("../../core/xml.js", ['Blockly.Xml'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.VarCreate', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml']); +goog.addDependency("../../core/zoom_controls.js", ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.dom']); goog.addDependency("base.js", [], []); // Load Blockly. diff --git a/blocks/colour.js b/blocks/colour.js index fdd196630..9ab3acb95 100644 --- a/blocks/colour.js +++ b/blocks/colour.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/lists.js b/blocks/lists.js index c99f281ae..b995b40f1 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/logic.js b/blocks/logic.js index 813e8f747..f473c040b 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/loops.js b/blocks/loops.js index 6ec71900b..57ef12aac 100644 --- a/blocks/loops.js +++ b/blocks/loops.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/math.js b/blocks/math.js index 56ccc6afb..e772edfb4 100644 --- a/blocks/math.js +++ b/blocks/math.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/procedures.js b/blocks/procedures.js index cdca990d6..2954f463a 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/text.js b/blocks/text.js index 6498c1715..5f04063e6 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/variables.js b/blocks/variables.js index f97b18118..65967f921 100644 --- a/blocks/variables.js +++ b/blocks/variables.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks/variables_dynamic.js b/blocks/variables_dynamic.js index ca236af1e..de9a364fd 100644 --- a/blocks/variables_dynamic.js +++ b/blocks/variables_dynamic.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/blocks_compressed.js b/blocks_compressed.js index b3b29bfbc..3f38be573 100644 --- a/blocks_compressed.js +++ b/blocks_compressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by gulp. +// Do not edit this file; automatically generated by build.py. 'use strict'; @@ -10,30 +10,30 @@ Blockly.defineBlocksWithJsonArray([{type:"lists_create_empty",message0:"%{BKY_LI message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}", args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]); Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new Blockly.Mutator(["lists_create_with_item"]));this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"), -10);this.updateShape_()},decompose:function(a){var b=a.newBlock("lists_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;ed;d++){var f=1==d?b:c;f&&!f.outputConnection.checkType(e)&&(Blockly.Events.setGroup(a.group),e===this.prevParentConnection_?(this.unplug(),e.getSourceBlock().bumpNeighbours()):(f.unplug(),f.bumpNeighbours()),Blockly.Events.setGroup(!1))}this.prevParentConnection_= -e}};Blockly.Extensions.registerMixin("logic_ternary",Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN);Blockly.Blocks.loops={};Blockly.Constants.Loops={};Blockly.Constants.Loops.HUE=120; +Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(a){var b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(var e=0;2>e;e++){var f=1==e?b:c;f&&!f.outputConnection.checkType(d)&&(Blockly.Events.setGroup(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours()):(f.unplug(),f.bumpNeighbours()),Blockly.Events.setGroup(!1))}this.prevParentConnection_= +d}};Blockly.Extensions.registerMixin("logic_ternary",Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN);Blockly.Blocks.loops={};Blockly.Constants.Loops={};Blockly.Constants.Loops.HUE=120; Blockly.defineBlocksWithJsonArray([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10, min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}], message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY", @@ -66,7 +66,7 @@ check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",arg args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}", extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]);Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};Blockly.Extensions.register("controls_whileUntil_tooltip",Blockly.Extensions.buildTooltipForDropdown("MODE",Blockly.Constants.Loops.WHILE_UNTIL_TOOLTIPS));Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"}; Blockly.Extensions.register("controls_flow_tooltip",Blockly.Extensions.buildTooltipForDropdown("FLOW",Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS)); -Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var e={enabled:!0};e.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=Blockly.Variables.generateVariableFieldDom(b);c=Blockly.utils.xml.createElement("block");c.setAttribute("type","variables_get");c.appendChild(b);e.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(e)}}}}; +Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var d={enabled:!0};d.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=Blockly.Variables.generateVariableFieldDom(b);c=Blockly.utils.xml.createElement("block");c.setAttribute("type","variables_get");c.appendChild(b);d.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(d)}}}}; Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR")); Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){this.workspace.isDragging&&!this.workspace.isDragging()&&(Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this)? (this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1)))}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230; @@ -90,34 +90,34 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN={updateType_:function(a){"MODE"= Blockly.Extensions.registerMutator("math_modes_of_list_mutator",Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN,Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION);Blockly.Blocks.procedures={}; Blockly.Blocks.procedures_defnoreturn={init:function(){var a=new Blockly.FieldTextInput("",Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT); this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_= -a)},updateParams_:function(){var a="";this.arguments_.length&&(a=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", "));Blockly.Events.disable();try{this.setFieldValue(a,"PARAMS")}finally{Blockly.Events.enable()}},mutationToDom:function(a){var b=Blockly.utils.xml.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(var c=0;c} srcs + * Helper method for possibly adding the Closure library into a sources array. + * @param {Array.} srcs */ function maybeAddClosureLibrary(srcs) { if (argv.closureLibrary) { - // If you require the google closure library, you can include it in your + // If you require Google's Closure library, you can include it in your // build by adding the --closure-library flag. // You will also need to include the "google-closure-library" in your list // of devDependencies. diff --git a/javascript_compressed.js b/javascript_compressed.js index f57f7c723..2fd9dc3c6 100644 --- a/javascript_compressed.js +++ b/javascript_compressed.js @@ -1,11 +1,11 @@ -// Do not edit this file; automatically generated by gulp. +// Do not edit this file; automatically generated by build.py. 'use strict'; -Blockly.JavaScript=new Blockly.Generator("JavaScript");Blockly.JavaScript.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(Blockly.utils.global).join(",")); -Blockly.JavaScript.ORDER_ATOMIC=0;Blockly.JavaScript.ORDER_NEW=1.1;Blockly.JavaScript.ORDER_MEMBER=1.2;Blockly.JavaScript.ORDER_FUNCTION_CALL=2;Blockly.JavaScript.ORDER_INCREMENT=3;Blockly.JavaScript.ORDER_DECREMENT=3;Blockly.JavaScript.ORDER_BITWISE_NOT=4.1;Blockly.JavaScript.ORDER_UNARY_PLUS=4.2;Blockly.JavaScript.ORDER_UNARY_NEGATION=4.3;Blockly.JavaScript.ORDER_LOGICAL_NOT=4.4;Blockly.JavaScript.ORDER_TYPEOF=4.5;Blockly.JavaScript.ORDER_VOID=4.6;Blockly.JavaScript.ORDER_DELETE=4.7; -Blockly.JavaScript.ORDER_AWAIT=4.8;Blockly.JavaScript.ORDER_EXPONENTIATION=5;Blockly.JavaScript.ORDER_MULTIPLICATION=5.1;Blockly.JavaScript.ORDER_DIVISION=5.2;Blockly.JavaScript.ORDER_MODULUS=5.3;Blockly.JavaScript.ORDER_SUBTRACTION=6.1;Blockly.JavaScript.ORDER_ADDITION=6.2;Blockly.JavaScript.ORDER_BITWISE_SHIFT=7;Blockly.JavaScript.ORDER_RELATIONAL=8;Blockly.JavaScript.ORDER_IN=8;Blockly.JavaScript.ORDER_INSTANCEOF=8;Blockly.JavaScript.ORDER_EQUALITY=9;Blockly.JavaScript.ORDER_BITWISE_AND=10; -Blockly.JavaScript.ORDER_BITWISE_XOR=11;Blockly.JavaScript.ORDER_BITWISE_OR=12;Blockly.JavaScript.ORDER_LOGICAL_AND=13;Blockly.JavaScript.ORDER_LOGICAL_OR=14;Blockly.JavaScript.ORDER_CONDITIONAL=15;Blockly.JavaScript.ORDER_ASSIGNMENT=16;Blockly.JavaScript.ORDER_YIELD=17;Blockly.JavaScript.ORDER_COMMA=18;Blockly.JavaScript.ORDER_NONE=99; +Blockly.JavaScript=new Blockly.Generator("JavaScript");Blockly.JavaScript.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(Blockly.utils.global).join(","));Blockly.JavaScript.ORDER_ATOMIC=0; +Blockly.JavaScript.ORDER_NEW=1.1;Blockly.JavaScript.ORDER_MEMBER=1.2;Blockly.JavaScript.ORDER_FUNCTION_CALL=2;Blockly.JavaScript.ORDER_INCREMENT=3;Blockly.JavaScript.ORDER_DECREMENT=3;Blockly.JavaScript.ORDER_BITWISE_NOT=4.1;Blockly.JavaScript.ORDER_UNARY_PLUS=4.2;Blockly.JavaScript.ORDER_UNARY_NEGATION=4.3;Blockly.JavaScript.ORDER_LOGICAL_NOT=4.4;Blockly.JavaScript.ORDER_TYPEOF=4.5;Blockly.JavaScript.ORDER_VOID=4.6;Blockly.JavaScript.ORDER_DELETE=4.7;Blockly.JavaScript.ORDER_AWAIT=4.8; +Blockly.JavaScript.ORDER_EXPONENTIATION=5;Blockly.JavaScript.ORDER_MULTIPLICATION=5.1;Blockly.JavaScript.ORDER_DIVISION=5.2;Blockly.JavaScript.ORDER_MODULUS=5.3;Blockly.JavaScript.ORDER_SUBTRACTION=6.1;Blockly.JavaScript.ORDER_ADDITION=6.2;Blockly.JavaScript.ORDER_BITWISE_SHIFT=7;Blockly.JavaScript.ORDER_RELATIONAL=8;Blockly.JavaScript.ORDER_IN=8;Blockly.JavaScript.ORDER_INSTANCEOF=8;Blockly.JavaScript.ORDER_EQUALITY=9;Blockly.JavaScript.ORDER_BITWISE_AND=10;Blockly.JavaScript.ORDER_BITWISE_XOR=11; +Blockly.JavaScript.ORDER_BITWISE_OR=12;Blockly.JavaScript.ORDER_LOGICAL_AND=13;Blockly.JavaScript.ORDER_LOGICAL_OR=14;Blockly.JavaScript.ORDER_CONDITIONAL=15;Blockly.JavaScript.ORDER_ASSIGNMENT=16;Blockly.JavaScript.ORDER_YIELD=17;Blockly.JavaScript.ORDER_COMMA=18;Blockly.JavaScript.ORDER_NONE=99; Blockly.JavaScript.ORDER_OVERRIDES=[[Blockly.JavaScript.ORDER_FUNCTION_CALL,Blockly.JavaScript.ORDER_MEMBER],[Blockly.JavaScript.ORDER_FUNCTION_CALL,Blockly.JavaScript.ORDER_FUNCTION_CALL],[Blockly.JavaScript.ORDER_MEMBER,Blockly.JavaScript.ORDER_MEMBER],[Blockly.JavaScript.ORDER_MEMBER,Blockly.JavaScript.ORDER_FUNCTION_CALL],[Blockly.JavaScript.ORDER_LOGICAL_NOT,Blockly.JavaScript.ORDER_LOGICAL_NOT],[Blockly.JavaScript.ORDER_MULTIPLICATION,Blockly.JavaScript.ORDER_MULTIPLICATION],[Blockly.JavaScript.ORDER_ADDITION, Blockly.JavaScript.ORDER_ADDITION],[Blockly.JavaScript.ORDER_LOGICAL_AND,Blockly.JavaScript.ORDER_LOGICAL_AND],[Blockly.JavaScript.ORDER_LOGICAL_OR,Blockly.JavaScript.ORDER_LOGICAL_OR]]; Blockly.JavaScript.init=function(a){Blockly.JavaScript.definitions_=Object.create(null);Blockly.JavaScript.functionNames_=Object.create(null);Blockly.JavaScript.variableDB_?Blockly.JavaScript.variableDB_.reset():Blockly.JavaScript.variableDB_=new Blockly.Names(Blockly.JavaScript.RESERVED_WORDS_);Blockly.JavaScript.variableDB_.setVariableMap(a.getVariableMap());for(var b=[],c=Blockly.Variables.allDeveloperVariables(a),d=0;d= stop:"," yield start"," start -= abs(step)"])};a=function(a,b,c){return"("+a+" <= "+b+") and "+g()+"("+a+", "+b+", "+c+") or "+k()+"("+a+", "+b+", "+c+")"};if(Blockly.isNumber(c)&&Blockly.isNumber(d)&& -Blockly.isNumber(e))c=Number(c),d=Number(d),e=Math.abs(Number(e)),0===c%1&&0===d%1&&0===e%1?(c<=d?(d++,a=0==c&&1==e?d:c+", "+d,1!=e&&(a+=", "+e)):(d--,a=c+", "+d+", -"+e),a="range("+a+")"):(a=ca?Blockly.Python.ORDER_UNARY_SIGN:Blockly.Python.ORDER_ATOMIC;return[a,b]}; Blockly.Python.math_arithmetic=function(a){var b={ADD:[" + ",Blockly.Python.ORDER_ADDITIVE],MINUS:[" - ",Blockly.Python.ORDER_ADDITIVE],MULTIPLY:[" * ",Blockly.Python.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",Blockly.Python.ORDER_MULTIPLICATIVE],POWER:[" ** ",Blockly.Python.ORDER_EXPONENTIATION]}[a.getFieldValue("OP")],c=b[0];b=b[1];var d=Blockly.Python.valueToCode(a,"A",b)||"0";a=Blockly.Python.valueToCode(a,"B",b)||"0";return[d+c+a,b]}; @@ -82,4 +82,5 @@ Blockly.Python.text_changeCase=function(a){var b={UPPERCASE:".upper()",LOWERCASE Blockly.Python.text_print=function(a){return"print("+(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_NONE)||"''")+")\n"}; Blockly.Python.text_prompt_ext=function(a){var b=Blockly.Python.provideFunction_("text_prompt",["def "+Blockly.Python.FUNCTION_NAME_PLACEHOLDER_+"(msg):"," try:"," return raw_input(msg)"," except NameError:"," return input(msg)"]),c=a.getField("TEXT")?Blockly.Python.quote_(a.getFieldValue("TEXT")):Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_NONE)||"''";b=b+"("+c+")";"NUMBER"==a.getFieldValue("TYPE")&&(b="float("+b+")");return[b,Blockly.Python.ORDER_FUNCTION_CALL]}; Blockly.Python.text_prompt=Blockly.Python.text_prompt_ext;Blockly.Python.text_count=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''";a=Blockly.Python.valueToCode(a,"SUB",Blockly.Python.ORDER_NONE)||"''";return[b+".count("+a+")",Blockly.Python.ORDER_MEMBER]}; -Blockly.Python.text_replace=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''",c=Blockly.Python.valueToCode(a,"FROM",Blockly.Python.ORDER_NONE)||"''";a=Blockly.Python.valueToCode(a,"TO",Blockly.Python.ORDER_NONE)||"''";return[b+".replace("+c+", "+a+")",Blockly.Python.ORDER_MEMBER]};Blockly.Python.text_reverse=function(a){return[(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''")+"[::-1]",Blockly.Python.ORDER_MEMBER]};Blockly.Python.variables={};Blockly.Python.variables_get=function(a){return[Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.Python.ORDER_ATOMIC]};Blockly.Python.variables_set=function(a){var b=Blockly.Python.valueToCode(a,"VALUE",Blockly.Python.ORDER_NONE)||"0";return Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+"\n"};Blockly.Python.variablesDynamic={};Blockly.Python.variables_get_dynamic=Blockly.Python.variables_get;Blockly.Python.variables_set_dynamic=Blockly.Python.variables_set; +Blockly.Python.text_replace=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''",c=Blockly.Python.valueToCode(a,"FROM",Blockly.Python.ORDER_NONE)||"''";a=Blockly.Python.valueToCode(a,"TO",Blockly.Python.ORDER_NONE)||"''";return[b+".replace("+c+", "+a+")",Blockly.Python.ORDER_MEMBER]};Blockly.Python.text_reverse=function(a){return[(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''")+"[::-1]",Blockly.Python.ORDER_MEMBER]};Blockly.Python.variables={};Blockly.Python.variables_get=function(a){return[Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.Python.ORDER_ATOMIC]};Blockly.Python.variables_set=function(a){var b=Blockly.Python.valueToCode(a,"VALUE",Blockly.Python.ORDER_NONE)||"0";return Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+"\n"}; +Blockly.Python.variablesDynamic={};Blockly.Python.variables_get_dynamic=Blockly.Python.variables_get;Blockly.Python.variables_set_dynamic=Blockly.Python.variables_set; \ No newline at end of file diff --git a/tests/blocks/logic_ternary_test.js b/tests/blocks/logic_ternary_test.js index 9e28c137b..81142c349 100644 --- a/tests/blocks/logic_ternary_test.js +++ b/tests/blocks/logic_ternary_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/blocks/test_blocks.js b/tests/blocks/test_blocks.js index bb1da03f9..c14ee2544 100644 --- a/tests/blocks/test_blocks.js +++ b/tests/blocks/test_blocks.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/compile/main.js b/tests/compile/main.js index 3f0ec2235..d15932c44 100644 --- a/tests/compile/main.js +++ b/tests/compile/main.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ goog.provide('Main'); diff --git a/tests/generators/run_generators_in_browser.js b/tests/generators/run_generators_in_browser.js index 02c6e7827..eb1504082 100644 --- a/tests/generators/run_generators_in_browser.js +++ b/tests/generators/run_generators_in_browser.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest.js b/tests/generators/unittest.js index 8e318a881..0c7c0319c 100644 --- a/tests/generators/unittest.js +++ b/tests/generators/unittest.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest_dart.js b/tests/generators/unittest_dart.js index 12c5892dd..7b8861351 100644 --- a/tests/generators/unittest_dart.js +++ b/tests/generators/unittest_dart.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2014 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest_javascript.js b/tests/generators/unittest_javascript.js index 4791fa2a7..f9a64bf9c 100644 --- a/tests/generators/unittest_javascript.js +++ b/tests/generators/unittest_javascript.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest_lua.js b/tests/generators/unittest_lua.js index 4f2532630..e72563f72 100644 --- a/tests/generators/unittest_lua.js +++ b/tests/generators/unittest_lua.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2016 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest_php.js b/tests/generators/unittest_php.js index d208045fc..e0685a9cf 100644 --- a/tests/generators/unittest_php.js +++ b/tests/generators/unittest_php.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2015 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/generators/unittest_python.js b/tests/generators/unittest_python.js index bafcb93d9..e00dc1b6f 100644 --- a/tests/generators/unittest_python.js +++ b/tests/generators/unittest_python.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/block_test.js b/tests/jsunit/block_test.js index 603b4fd14..3dff5d20e 100644 --- a/tests/jsunit/block_test.js +++ b/tests/jsunit/block_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/event_test.js b/tests/jsunit/event_test.js index d6452e009..1e2414a91 100644 --- a/tests/jsunit/event_test.js +++ b/tests/jsunit/event_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/extensions_test.js b/tests/jsunit/extensions_test.js index a465b4f8b..43bb66deb 100644 --- a/tests/jsunit/extensions_test.js +++ b/tests/jsunit/extensions_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/generator_test.js b/tests/jsunit/generator_test.js index 4cdae64fc..b7187991b 100644 --- a/tests/jsunit/generator_test.js +++ b/tests/jsunit/generator_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/json_test.js b/tests/jsunit/json_test.js index f6127e23d..197b8b620 100644 --- a/tests/jsunit/json_test.js +++ b/tests/jsunit/json_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/mocha_jsunit_test_runner.js b/tests/jsunit/mocha_jsunit_test_runner.js index 7de2401be..91a8e81c2 100644 --- a/tests/jsunit/mocha_jsunit_test_runner.js +++ b/tests/jsunit/mocha_jsunit_test_runner.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/run_jsunit_tests_in_browser.js b/tests/jsunit/run_jsunit_tests_in_browser.js index 90babadf7..fd291cae5 100644 --- a/tests/jsunit/run_jsunit_tests_in_browser.js +++ b/tests/jsunit/run_jsunit_tests_in_browser.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/test_utilities.js b/tests/jsunit/test_utilities.js index b47f341e4..81f78b23c 100644 --- a/tests/jsunit/test_utilities.js +++ b/tests/jsunit/test_utilities.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/utils_dom_test.js b/tests/jsunit/utils_dom_test.js index 8cb8d28a1..90c58a8a8 100644 --- a/tests/jsunit/utils_dom_test.js +++ b/tests/jsunit/utils_dom_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/utils_math_test.js b/tests/jsunit/utils_math_test.js index 6e4f4a36d..6f56ec8b1 100644 --- a/tests/jsunit/utils_math_test.js +++ b/tests/jsunit/utils_math_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/utils_string_test.js b/tests/jsunit/utils_string_test.js index bdd2a65c8..507368b8b 100644 --- a/tests/jsunit/utils_string_test.js +++ b/tests/jsunit/utils_string_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/utils_test.js b/tests/jsunit/utils_test.js index 1edc696f5..6e701a385 100644 --- a/tests/jsunit/utils_test.js +++ b/tests/jsunit/utils_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2011 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/variable_map_test.js b/tests/jsunit/variable_map_test.js index dc24abd3c..8f5b2f6ff 100644 --- a/tests/jsunit/variable_map_test.js +++ b/tests/jsunit/variable_map_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/variable_model_test.js b/tests/jsunit/variable_model_test.js index 4eb4cb046..58e32c9b6 100644 --- a/tests/jsunit/variable_model_test.js +++ b/tests/jsunit/variable_model_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/variables_test.js b/tests/jsunit/variables_test.js index 6d6515ff8..7041f3174 100644 --- a/tests/jsunit/variables_test.js +++ b/tests/jsunit/variables_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/widget_div_test.js b/tests/jsunit/widget_div_test.js index c064b5f71..db15dbe37 100644 --- a/tests/jsunit/widget_div_test.js +++ b/tests/jsunit/widget_div_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/workspace_comment_test.js b/tests/jsunit/workspace_comment_test.js index e746dfa7d..9bb630252 100644 --- a/tests/jsunit/workspace_comment_test.js +++ b/tests/jsunit/workspace_comment_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/workspace_test.js b/tests/jsunit/workspace_test.js index 916cbeead..6576f0346 100644 --- a/tests/jsunit/workspace_test.js +++ b/tests/jsunit/workspace_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2012 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/jsunit/workspace_undo_redo_test.js b/tests/jsunit/workspace_undo_redo_test.js index 9fc06d114..d9745d700 100644 --- a/tests/jsunit/workspace_undo_redo_test.js +++ b/tests/jsunit/workspace_undo_redo_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/jsunit/xml_test.js b/tests/jsunit/xml_test.js index 2baff16c4..117cd4ed6 100644 --- a/tests/jsunit/xml_test.js +++ b/tests/jsunit/xml_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2014 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index b172de82f..2d0b111a7 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('ASTNode', function() { diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 80dca0974..69a00b96e 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Blocks', function() { diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index 901edd69e..a24f68c95 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Comments', function() { diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 9c9c1a242..99aabcda9 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Connection Database', function() { diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 5ea5d99f0..f78584cfa 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Connections', function() { diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index 0afad6888..bc367e09b 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Cursor', function() { diff --git a/tests/mocha/dropdowndiv_test.js b/tests/mocha/dropdowndiv_test.js index 0f7c89bb0..13880a11c 100644 --- a/tests/mocha/dropdowndiv_test.js +++ b/tests/mocha/dropdowndiv_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('DropDownDiv', function() { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index cf8676971..4b157925f 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Events', function() { diff --git a/tests/mocha/field_angle_test.js b/tests/mocha/field_angle_test.js index 08141c428..6bbc838a4 100644 --- a/tests/mocha/field_angle_test.js +++ b/tests/mocha/field_angle_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Angle Fields', function() { diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index d9c3aa899..b8542df46 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Checkbox Fields', function() { diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index d28620e82..16878c47e 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Colour Fields', function() { diff --git a/tests/mocha/field_date_test.js b/tests/mocha/field_date_test.js index 852eed5f0..50fd781f5 100644 --- a/tests/mocha/field_date_test.js +++ b/tests/mocha/field_date_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /* If you want to run date tests add the date picker here: diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index 896e2ef55..0bbc36724 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Dropdown Fields', function() { diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index 415faf8e0..e5113de1a 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Image Fields', function() { diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index 911198038..fb490a6ee 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Label Serializable Fields', function() { diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index 1e3578eb0..b2cf8be95 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Label Fields', function() { diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 081cfa737..91edca652 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Number Fields', function() { diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index 574e6dfee..c8ea3bb2f 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index f700fa19e..553122fce 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Abstract Fields', function() { diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 6598b0854..b68033fbc 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Text Input Fields', function() { diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 0c6474289..c3f6bf3c0 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Variable Fields', function() { diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index d3bcd1faa..974c7ec0e 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/input_test.js b/tests/mocha/input_test.js index e2d181509..001c06969 100644 --- a/tests/mocha/input_test.js +++ b/tests/mocha/input_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Inputs', function() { diff --git a/tests/mocha/key_map_test.js b/tests/mocha/key_map_test.js index 4de012986..6683f9fc9 100644 --- a/tests/mocha/key_map_test.js +++ b/tests/mocha/key_map_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Key Map Tests', function() { diff --git a/tests/mocha/metrics_test.js b/tests/mocha/metrics_test.js index 486946817..1a646b3cd 100644 --- a/tests/mocha/metrics_test.js +++ b/tests/mocha/metrics_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/names_test.js b/tests/mocha/names_test.js index 5ec208ec3..18b1e5503 100644 --- a/tests/mocha/names_test.js +++ b/tests/mocha/names_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/navigation_modify_test.js b/tests/mocha/navigation_modify_test.js index 18e146c88..3cd5fdaf1 100644 --- a/tests/mocha/navigation_modify_test.js +++ b/tests/mocha/navigation_modify_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Insert/Modify', function() { diff --git a/tests/mocha/navigation_test.js b/tests/mocha/navigation_test.js index 9e04831b1..b8f2fb14f 100644 --- a/tests/mocha/navigation_test.js +++ b/tests/mocha/navigation_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/procedures_test.js b/tests/mocha/procedures_test.js index 3bbb5cf80..8c6ce0e02 100644 --- a/tests/mocha/procedures_test.js +++ b/tests/mocha/procedures_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ goog.require('Blockly.Blocks.procedures'); diff --git a/tests/mocha/run_mocha_tests_in_browser.js b/tests/mocha/run_mocha_tests_in_browser.js index f7a2cb191..ed0c82943 100644 --- a/tests/mocha/run_mocha_tests_in_browser.js +++ b/tests/mocha/run_mocha_tests_in_browser.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/test_helpers.js b/tests/mocha/test_helpers.js index b65430e63..6ff98c327 100644 --- a/tests/mocha/test_helpers.js +++ b/tests/mocha/test_helpers.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /* exported assertEquals, assertNotEquals, assertArrayEquals, assertTrue, assertFalse, diff --git a/tests/mocha/theme_test.js b/tests/mocha/theme_test.js index 0676dbc87..cfe9aa376 100644 --- a/tests/mocha/theme_test.js +++ b/tests/mocha/theme_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 7e0a0fd39..388e33405 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite("Trashcan", function() { diff --git a/tests/mocha/utils_test.js b/tests/mocha/utils_test.js index eb22c28d8..9db5443ac 100644 --- a/tests/mocha/utils_test.js +++ b/tests/mocha/utils_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('Utils', function() { diff --git a/tests/mocha/xml_procedures_test.js b/tests/mocha/xml_procedures_test.js index fefa72aef..09d526362 100644 --- a/tests/mocha/xml_procedures_test.js +++ b/tests/mocha/xml_procedures_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ goog.require('Blockly.Blocks.procedures'); diff --git a/tests/mocha/xml_test.js b/tests/mocha/xml_test.js index 4d37a2872..51b39e684 100644 --- a/tests/mocha/xml_test.js +++ b/tests/mocha/xml_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ suite('XML', function() { diff --git a/tests/node/run_node_test.js b/tests/node/run_node_test.js index 2c3890348..930d83a4a 100644 --- a/tests/node/run_node_test.js +++ b/tests/node/run_node_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/playgrounds/screenshot.js b/tests/playgrounds/screenshot.js index 4282cdec2..07521b310 100644 --- a/tests/playgrounds/screenshot.js +++ b/tests/playgrounds/screenshot.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/screenshot/diff-reporter.js b/tests/screenshot/diff-reporter.js index b8abced17..25a4b6929 100644 --- a/tests/screenshot/diff-reporter.js +++ b/tests/screenshot/diff-reporter.js @@ -3,18 +3,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/screenshot/diff_screenshots.js b/tests/screenshot/diff_screenshots.js index 512f34a4a..d4df57ad2 100644 --- a/tests/screenshot/diff_screenshots.js +++ b/tests/screenshot/diff_screenshots.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/screenshot/gen_screenshots.js b/tests/screenshot/gen_screenshots.js index fc938ea60..48af66d12 100644 --- a/tests/screenshot/gen_screenshots.js +++ b/tests/screenshot/gen_screenshots.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/tests/workspace_svg/event_svg_test.js b/tests/workspace_svg/event_svg_test.js index 46d48f98e..698a6fffe 100644 --- a/tests/workspace_svg/event_svg_test.js +++ b/tests/workspace_svg/event_svg_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/workspace_svg/procedure_svg_test.js b/tests/workspace_svg/procedure_svg_test.js index 730deb22c..7d7051280 100644 --- a/tests/workspace_svg/procedure_svg_test.js +++ b/tests/workspace_svg/procedure_svg_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/tests/workspace_svg/workspace_svg_test.js b/tests/workspace_svg/workspace_svg_test.js index 56eccb64a..1a5e9fa4b 100644 --- a/tests/workspace_svg/workspace_svg_test.js +++ b/tests/workspace_svg/workspace_svg_test.js @@ -1,18 +1,7 @@ /** * @license * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; diff --git a/typings/blockly.d.ts b/typings/blockly.d.ts index da6ebfd59..1a43c08b8 100644 --- a/typings/blockly.d.ts +++ b/typings/blockly.d.ts @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** diff --git a/typings/parts/blockly-header.d.ts b/typings/parts/blockly-header.d.ts index df410339e..15bcf14dd 100644 --- a/typings/parts/blockly-header.d.ts +++ b/typings/parts/blockly-header.d.ts @@ -1,18 +1,7 @@ /** * @license * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ /** From 633fa9a5e24274f2e9f02c57763a911636eb2ccd Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 13 Feb 2020 16:11:34 -0800 Subject: [PATCH 040/105] Update gulpfile to use exports instead of gulp.task syntax --- gulpfile.js | 322 ++++++++++++++++++++++++++------------------------- package.json | 18 +-- 2 files changed, 176 insertions(+), 164 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 84ce5e520..8f54c12ce 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -162,7 +162,7 @@ function maybeAddClosureLibrary(srcs) { * This task builds Blockly's core files. * blockly_compressed.js */ -gulp.task('build-compressed', function (cb) { +function buildCompressed(cb) { const defines = 'Blockly.VERSION="' + packageJson.version + '"'; return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'}) // Directories in Blockly are used to group similar files together @@ -188,13 +188,13 @@ gulp.task('build-compressed', function (cb) { }, argv.verbose, argv.strict)) .pipe(prependHeader()) .pipe(gulp.dest('./')); -}); +}; /** * This task builds the Blockly's built in blocks. * blocks_compressed.js */ -gulp.task('build-blocks', function () { +function buildBlocks() { // Add provides used throughout blocks/ in order to be compatible with the // compiler. Anything added to this list must be removed from the compiled // result using the remove regex steps below. @@ -232,7 +232,7 @@ goog.provide('Blockly.Warning');`; .pipe(gulp.replace(/Blockly\.(Comment|Warning|Mutator)=\{[^;]*\};/g, '')) .pipe(prependHeader()) .pipe(gulp.dest('./')); -}); +}; /** * A helper method for building a Blockly code generator. @@ -265,41 +265,41 @@ goog.provide('Blockly.utils.string');`; * This task builds the javascript generator. * javascript_compressed.js */ -gulp.task('build-javascript', function() { +function buildJavascript() { return buildGenerator('javascript', 'JavaScript'); -}); +}; /** * This task builds the python generator. * python_compressed.js */ -gulp.task('build-python', function() { +function buildPython() { return buildGenerator('python', 'Python'); -}); +}; /** * This task builds the php generator. * php_compressed.js */ -gulp.task('build-php', function() { +function buildPHP() { return buildGenerator('php', 'PHP'); -}); +}; /** * This task builds the lua generator. * lua_compressed.js */ -gulp.task('build-lua', function() { +function buildLua() { return buildGenerator('lua', 'Lua'); -}); +}; /** * This task builds the dart generator: * dart_compressed.js */ -gulp.task('build-dart', function() { +function buildDart() { return buildGenerator('dart', 'Dart'); -}); +}; /** * This tasks builds all the generators: @@ -309,19 +309,19 @@ gulp.task('build-dart', function() { * lua_compressed.js * dart_compressed.js */ -gulp.task('build-generators', gulp.parallel( - 'build-javascript', - 'build-python', - 'build-php', - 'build-lua', - 'build-dart' -)); +const buildGenerators = gulp.parallel( + buildJavascript, + buildPython, + buildPHP, + buildLua, + buildDart +); /** * This task builds Blockly's uncompressed file. * blockly_uncompressed.js */ -gulp.task('build-uncompressed', function() { +function buildUncompressed() { const closurePath = argv.closureLibrary ? 'node_modules/google-closure-library/closure/goog' : 'closure/goog'; @@ -394,13 +394,13 @@ goog.require('Blockly.requires') requires + footer); }); -}); +}; /** * This task builds Blockly's lang files. * msg/*.js */ -gulp.task('build-langfiles', function(done) { +function buildLangfiles(done) { // Run js_to_json.py const jsToJsonCmd = `python ./i18n/js_to_json.py \ --input_file ${path.join('msg', 'messages.js')} \ @@ -423,7 +423,7 @@ gulp.task('build-langfiles', function(done) { execSync(createMessagesCmd, { stdio: 'inherit' }); done(); -}); +}; /** * This tasks builds Blockly's core files: @@ -431,11 +431,11 @@ gulp.task('build-langfiles', function(done) { * blocks_compressed.js * blockly_uncompressed.js */ -gulp.task('build-core', gulp.parallel( - 'build-compressed', - 'build-blocks', - 'build-uncompressed' -)); +const buildCore = gulp.parallel( + buildCompressed, + buildBlocks, + buildUncompressed +); /** * This task builds all of Blockly: @@ -449,11 +449,11 @@ gulp.task('build-core', gulp.parallel( * blockly_uncompressed.js * msg/json/*.js */ -gulp.task('build', gulp.parallel( - 'build-core', - 'build-generators', - 'build-langfiles' -)); +const build = gulp.parallel( + buildCore, + buildGenerators, + buildLangfiles +); //////////////////////////////////////////////////////////// // Typings // @@ -464,7 +464,7 @@ gulp.task('build', gulp.parallel( // the script also pulls in a number of part files from typings/parts. // This includes the header (incl License), additional useful interfaces // including Blockly Options and Google Closure typings. -gulp.task('typings', function (cb) { +function typings() { const tmpDir = './typings/tmp'; const blocklySrcs = [ "core/", @@ -526,7 +526,7 @@ gulp.task('typings', function (cb) { rimraf.sync(tmpDir); } }); -}); +}; //////////////////////////////////////////////////////////// // NPM packaging tasks // @@ -567,19 +567,19 @@ function packageCommonJS(namespace, dependencies) { * This task wraps blockly_compressed.js into a UMD module. * @example import 'blockly/blockly'; */ -gulp.task('package-blockly', function() { +function packageBlockly() { return gulp.src('blockly_compressed.js') .pipe(packageUMD('Blockly', [])) .pipe(gulp.rename('blockly.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps blocks_compressed.js into a CommonJS module for Node.js. * This is an equivelant task to package-blockly but for Node.js. * @example import 'blockly/blockly-node'; */ -gulp.task('package-blockly-node', function() { +function packageBlocklyNode() { // Override textToDomDocument, providing a Node.js alternative to DOMParser. return gulp.src('blockly_compressed.js') .pipe(gulp.insert.append(` @@ -595,13 +595,13 @@ gulp.task('package-blockly-node', function() { .pipe(packageCommonJS('Blockly', [])) .pipe(gulp.rename('blockly-node.js')) .pipe(gulp.dest(packageDistribution)); -}) +}; /** * This task wraps blocks_compressed.js into a UMD module. * @example import 'blockly/blocks'; */ -gulp.task('package-blocks', function() { +function packageBlocks() { return gulp.src('blocks_compressed.js') .pipe(gulp.insert.prepend(` Blockly.Blocks={};`)) @@ -612,7 +612,7 @@ gulp.task('package-blocks', function() { }])) .pipe(gulp.rename('blocks.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps package/index.js into a UMD module. @@ -620,7 +620,7 @@ gulp.task('package-blocks', function() { * and the Browser entry point for AMD environments. * @example import * as Blockly from 'blockly'; */ -gulp.task('package-index', function() { +function packageIndex() { return gulp.src('package/index.js') .pipe(packageUMD('Blockly', [{ name: 'Blockly', @@ -629,7 +629,7 @@ gulp.task('package-index', function() { }])) .pipe(gulp.rename('index.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps package/browser/index.js into a UMD module. @@ -640,7 +640,7 @@ gulp.task('package-index', function() { * built by package-node in browser environments. * @example import * as Blockly from 'blockly/browser'; */ -gulp.task('package-browser', function() { +function packageBrowser() { return gulp.src('package/browser/index.js') .pipe(packageUMD('Blockly', [{ name: 'Blockly', @@ -661,7 +661,7 @@ gulp.task('package-browser', function() { }])) .pipe(gulp.rename('browser.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps package/browser/core.js into a UMD module. @@ -671,7 +671,7 @@ gulp.task('package-browser', function() { * built by package-node-core in browser environments. * @example import * as Blockly from 'blockly/core'; */ -gulp.task('package-core', function() { +function packageCore() { return gulp.src('package/browser/core.js') .pipe(packageUMD('Blockly', [{ name: 'Blockly', @@ -680,7 +680,7 @@ gulp.task('package-core', function() { }])) .pipe(gulp.rename('core-browser.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps package/node/index.js into a CommonJS module for Node.js. @@ -690,7 +690,7 @@ gulp.task('package-core', function() { * built by package-browser in browser environments. * @example import * as Blockly from 'blockly/node'; */ -gulp.task('package-node', function() { +function packageNode() { return gulp.src('package/node/index.js') .pipe(packageCommonJS('Blockly', [{ name: 'Blockly', @@ -719,7 +719,7 @@ gulp.task('package-node', function() { }])) .pipe(gulp.rename('node.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * This task wraps package/node/core.js into a CommonJS module for Node.js. @@ -729,7 +729,7 @@ gulp.task('package-node', function() { * built by package-core in browser environments. * @example import * as Blockly from 'blockly/core'; */ -gulp.task('package-node-core', function() { +function packageNodeCore() { return gulp.src('package/node/core.js') .pipe(packageCommonJS('Blockly', [{ name: 'Blockly', @@ -738,7 +738,7 @@ gulp.task('package-node-core', function() { }])) .pipe(gulp.rename('core.js')) .pipe(gulp.dest(packageDistribution)); -}); +}; /** * A helper method for packaging a Blockly code generator into a UMD module. @@ -761,47 +761,47 @@ function packageGenerator(file, rename, generator) { * This task wraps javascript_compressed.js into a UMD module. * @example import 'blockly/javascript'; */ -gulp.task('package-javascript', function() { +function packageJavascript() { return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript'); -}); +}; /** * This task wraps python_compressed.js into a UMD module. * @example import 'blockly/python'; */ -gulp.task('package-python', function() { +function packagePython() { return packageGenerator('python_compressed.js', 'python.js', 'Blockly.Python'); -}); +}; /** * This task wraps lua_compressed.js into a UMD module. * @example import 'blockly/lua'; */ -gulp.task('package-lua', function() { +function packageLua() { return packageGenerator('lua_compressed.js', 'lua.js', 'Blockly.Lua'); -}); +}; /** * This task wraps dart_compressed.js into a UMD module. * @example import 'blockly/dart'; */ -gulp.task('package-dart', function() { +function packageDart() { return packageGenerator('dart_compressed.js', 'dart.js', 'Blockly.Dart'); -}); +}; /** * This task wraps php_compressed.js into a UMD module. * @example import 'blockly/php'; */ -gulp.task('package-php', function() { +function packagePHP() { return packageGenerator('php_compressed.js', 'php.js', 'Blockly.PHP'); -}); +}; /** * This task wraps each of the msg/js/* files into a UMD module. * @example import * as En from 'blockly/msg/en'; */ -gulp.task('package-locales', function() { +function packageLocales() { // Remove references to goog.provide and goog.require. return gulp.src('msg/js/*.js') .pipe(gulp.replace(/goog\.[^\n]+/g, '')) @@ -813,7 +813,7 @@ gulp.task('package-locales', function() { cjs: '../core', }])) .pipe(gulp.dest(`${packageDistribution}/msg`)); -}); +}; /** * This task creates a UMD bundle of Blockly which includes the Blockly @@ -821,7 +821,7 @@ gulp.task('package-locales', function() { * English localization files. * @example */ -gulp.task('package-umd-bundle', function() { +function packageUMDBundle() { var srcs = [ 'blockly_compressed.js', 'msg/js/en.js', @@ -832,20 +832,20 @@ gulp.task('package-umd-bundle', function() { .pipe(gulp.concat('blockly.min.js')) .pipe(packageUMD('Blockly', [])) .pipe(gulp.dest(`${packageDistribution}`)) -}); +}; /** * This task copies all the media/* files into the distribution directory. */ -gulp.task('package-media', function() { +function packageMedia() { return gulp.src('./media/*') .pipe(gulp.dest(`${packageDistribution}/media`)); -}); +}; /** * This task copies the package.json file into the distribution directory. */ -gulp.task('package-json', function(cb) { +function packageJSON(cb) { const json = Object.assign({}, packageJson); delete json['scripts']; if (!fs.existsSync(packageDistribution)) { @@ -854,55 +854,51 @@ gulp.task('package-json', function(cb) { fs.writeFileSync(`${packageDistribution}/package.json`, JSON.stringify(json, null, 2)); cb(); -}); +}; /** * This task copies the package/README.md file into the distribution directory. * This file is what developers will see at https://www.npmjs.com/package/blockly. */ -gulp.task('package-readme', function() { +function packageReadme() { return gulp.src('./package/README.md') - .pipe(gulp.dest(`${packageDistribution}`)) -}); + .pipe(gulp.dest(`${packageDistribution}`)); +}; /** * This task copies the typings/blockly.d.ts TypeScript definition file into the * distribution directory. * The bundled declaration file is referenced in package.json in the types property. */ -gulp.task('package-dts', function() { +function packageDTS() { return gulp.src('./typings/blockly.d.ts') - .pipe(gulp.dest(`${packageDistribution}`)) -}); + .pipe(gulp.dest(`${packageDistribution}`)); +}; /** * This task prepares the NPM distribution files under the /dist directory. */ -gulp.task('package', gulp.parallel( - 'package-index', - 'package-browser', - 'package-node', - 'package-core', - 'package-node-core', - 'package-blockly', - 'package-blockly-node', - 'package-blocks', - 'package-javascript', - 'package-python', - 'package-lua', - 'package-dart', - 'package-php', - 'package-locales', - 'package-media', - 'package-umd-bundle', - 'package-json', - 'package-readme', - 'package-dts' - )); - -// The default task builds Blockly. -gulp.task('default', gulp.series(['build'])); - +const package = gulp.parallel( + packageIndex, + packageBrowser, + packageNode, + packageCore, + packageNodeCore, + packageBlockly, + packageBlocklyNode, + packageBlocks, + packageJavascript, + packagePython, + packageLua, + packageDart, + packagePHP, + packageLocales, + packageMedia, + packageUMDBundle, + packageJSON, + packageReadme, + packageDTS +); // Stash current state, check out the named branch, and sync with // google/blockly. @@ -918,10 +914,14 @@ function syncBranch(branchName) { } // Stash current state, check out develop, and sync with google/blockly. -gulp.task('git-sync-develop', syncBranch('develop')); +function syncDevelop() { + return syncBranch('develop'); +}; // Stash current state, check out master, and sync with google/blockly. -gulp.task('git-sync-master', syncBranch('master')); +function syncMaster() { + return syncBranch('master'); +}; // Helper function: get a name for a rebuild branch. Format: rebuild_mm_dd_yyyy. function getRebuildBranchName() { @@ -941,65 +941,77 @@ function getRCBranchName() { }; // Recompile and push to origin. -gulp.task('git-recompile', gulp.series([ - 'git-sync-develop', - function(done) { - var branchName = getRebuildBranchName(); - console.log('make-rebuild-branch: creating branch ' + branchName); - execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); - done(); - }, - 'build', - 'typings', - function(done) { - console.log('push-rebuild-branch: committing rebuild'); - execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); - var branchName = getRebuildBranchName(); - execSync('git push origin ' + branchName, { stdio: 'inherit' }); - console.log('Branch ' + branchName + ' pushed to GitHub.'); - console.log('Next step: create a pull request against develop.'); - done(); +const recompile = gulp.series( + syncDevelop, + function(done) { + var branchName = getRebuildBranchName(); + console.log('make-rebuild-branch: creating branch ' + branchName); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + done(); + }, + build, + typings, + function(done) { + console.log('push-rebuild-branch: committing rebuild'); + execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); + var branchName = getRebuildBranchName(); + execSync('git push origin ' + branchName, { stdio: 'inherit' }); + console.log('Branch ' + branchName + ' pushed to GitHub.'); + console.log('Next step: create a pull request against develop.'); + done(); } - ]) ); // Create and push an RC branch. // Note that this pushes to google/blockly. -gulp.task('git-create-rc', gulp.series([ - 'git-sync-develop', - function(done) { - var branchName = getRCBranchName(); - execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); - execSync('git push ' + upstream_url + ' ' + branchName, - { stdio: 'inherit' }); - execSync('git checkout -b gh-pages'); - execSync('git push ' + upstream_url + ' gh-pages'); - done(); - }, - ]) +const createRC = gulp.series( + syncDevelop, + function(done) { + var branchName = getRCBranchName(); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + execSync('git push ' + upstream_url + ' ' + branchName, + { stdio: 'inherit' }); + execSync('git checkout -b gh-pages'); + execSync('git push ' + upstream_url + ' gh-pages'); + done(); + }, ); // See https://docs.npmjs.com/cli/version. -gulp.task('preversion', gulp.series([ - 'git-sync-master', - function(done) { - // Create a branch named bump_version for the bump and rebuild. - execSync('git checkout -b bump_version', { stdio: 'inherit' }); - done(); - }, - ]) +const preversion = gulp.series( + syncMaster, + function(done) { + // Create a branch named bump_version for the bump and rebuild. + execSync('git checkout -b bump_version', { stdio: 'inherit' }); + done(); + }, ); // See https://docs.npmjs.com/cli/version -gulp.task('postversion', gulp.series([ - function(done) { - // Push both the branch and tag to google/blockly. - execSync('git push ' + upstream_url + ' bump_version', - { stdio: 'inherit' }); - var tagName = 'v' + packageJson.version; - execSync('git push ' + upstream_url + ' ' + tagName, - { stdio: 'inherit' }); - done(); - } - ]) -); +function postversion(done) { + // Push both the branch and tag to google/blockly. + execSync('git push ' + upstream_url + ' bump_version', + { stdio: 'inherit' }); + var tagName = 'v' + packageJson.version; + execSync('git push ' + upstream_url + ' ' + tagName, + { stdio: 'inherit' }); + done(); +}; + +module.exports = { + default: build, + build: build, + buildCore: buildCore, + buildBlocks: buildBlocks, + buildLangfiles: buildLangfiles, + buildUncompressed: buildUncompressed, + buildCompressed: buildCompressed, + buildGenerators: buildGenerators, + gitSyncDevelop: syncDevelop, + gitSyncMaster: syncMaster, + preversion: preversion, + postversion: postversion, + gitCreateRC: createRC, + gitRecompile: recompile, + typings: typings +}; diff --git a/package.json b/package.json index bf38464f2..dfe151a6d 100644 --- a/package.json +++ b/package.json @@ -18,22 +18,22 @@ }, "scripts": { "build": "gulp build", - "build:blocks": "gulp build-blocks", - "build:compressed": "gulp build-compressed", - "build:core": "gulp build-core", - "build:debug": "gulp build-compressed --verbose --strict", + "build:blocks": "gulp buildBlocks", + "build:compressed": "gulp buildCompressed", + "build:core": "gulp buildCore", + "build:debug": "gulp buildCompressed --verbose --strict", "build:debug:log": "npm run build:debug > build-debug.log 2>&1 && tail -3 build-debug.log", - "build:generators": "gulp build-generators", - "build:langfiles": "gulp build-langfiles", - "build:uncompressed": "gulp build-uncompressed", + "build:generators": "gulp buildGenerators", + "build:langfiles": "gulp buildLangfiles", + "build:uncompressed": "gulp buildUncompressed", "bump": "npm version 3.$(date +'%Y%m%d').0", "lint": "eslint .", "package": "gulp package", "postversion": "gulp postversion", "prepare": "npm run package", "preversion": "gulp preversion", - "prerelease": "gulp git-recompile", - "release": "gulp git-create-rc", + "prerelease": "gulp gitRecompile", + "release": "gulp gitCreateRC", "test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'", "test:prepare": "npm run test:setupselenium && npm run test:startselenium", "test:run": "tests/run_all_tests.sh", From 9f356fa27d404db7216427aebc59632cf7d9d75b Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 13 Feb 2020 16:29:03 -0800 Subject: [PATCH 041/105] Add package to exports --- gulpfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 8f54c12ce..27bed372d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1013,5 +1013,6 @@ module.exports = { postversion: postversion, gitCreateRC: createRC, gitRecompile: recompile, - typings: typings + typings: typings, + package: package }; From 199db7e8af1968039d20255b1c98e229ae7f1eba Mon Sep 17 00:00:00 2001 From: vhermecz Date: Fri, 14 Feb 2020 17:42:45 +0100 Subject: [PATCH 042/105] #3613 fixing off-by-one error on compiler errors (#3692) As both the python filename array and the Input_X indexing is 0 based, the `-1` operation is not needed. fromFileArray in closure-compiler uses 0 based indexing. see: https://github.com/google/closure-compiler/blob/09cca3b536923dfb86d4e2ea34c8ee97d3ab471c/src/com/google/javascript/jscomp/gwt/client/JsRunnerMain.java#L816 --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 8a56ab6ae..89c5134f8 100755 --- a/build.py +++ b/build.py @@ -309,7 +309,7 @@ goog.provide('Blockly.utils.string'); def file_lookup(name): if not name.startswith("Input_"): return "???" - n = int(name[6:]) - 1 + n = int(name[6:]) return filenames[n] if "serverErrors" in json_data: From e78a87a1e593012f6bbb95cfca6f55f0a682058c Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 14 Feb 2020 13:42:38 -0800 Subject: [PATCH 043/105] Break gulpfile into multiple subfiles --- .eslintignore | 1 + gulpfile.js | 981 +---------------------------- scripts/gulpfiles/build_tasks.js | 460 ++++++++++++++ scripts/gulpfiles/git_tasks.js | 101 +++ scripts/gulpfiles/package_tasks.js | 399 ++++++++++++ scripts/gulpfiles/typings.js | 91 +++ 6 files changed, 1071 insertions(+), 962 deletions(-) create mode 100644 scripts/gulpfiles/build_tasks.js create mode 100644 scripts/gulpfiles/git_tasks.js create mode 100644 scripts/gulpfiles/package_tasks.js create mode 100644 scripts/gulpfiles/typings.js diff --git a/.eslintignore b/.eslintignore index c884c6b9e..bcf2a79fb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -16,3 +16,4 @@ gulpfile.js /appengine/* /externs/* /closure/* +/scripts/gulpfiles/* diff --git a/gulpfile.js b/gulpfile.js index 27bed372d..a902eadaf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,958 +28,15 @@ var closureDeps = require('google-closure-deps'); var packageJson = require('./package.json'); var argv = require('yargs').argv; -const upstream_url = "https://github.com/google/blockly.git"; +var typings = require('./scripts/gulpfiles/typings'); +var buildTasks = require('./scripts/gulpfiles/build_tasks'); +var packageTasks = require('./scripts/gulpfiles/package_tasks'); +var gitTasks = require('./scripts/gulpfiles/git_tasks'); -//////////////////////////////////////////////////////////// -// Build // -//////////////////////////////////////////////////////////// - -const licenseRegex = `\\/\\*\\* - \\* @license - \\* (Copyright \\d+ (Google LLC|Massachusetts Institute of Technology)) -( \\* All rights reserved. -)? \\* SPDX-License-Identifier: Apache-2.0 - \\*\\/`; - -/** - * Helper method for stripping the Google's and MIT's Apache Licenses. - */ -function stripApacheLicense() { - // Strip out Google's and MIT's Apache licences. - // Closure Compiler preserves dozens of Apache licences in the Blockly code. - // Remove these if they belong to Google or MIT. - // MIT's permission to do this is logged in Blockly issue #2412. - return gulp.replace(new RegExp(licenseRegex, "g"), ''); -} - -/** - * Helper method for prepending the auto-generated header text. - */ -function prependHeader() { - return gulp.insert.prepend(`// Do not edit this file; automatically generated by gulp.\n`); -} - -/** - * Closure compiler warning groups used to treat warnings as errors. - * For a full list of closure compiler groups, consult: - * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/DiagnosticGroups.java#L113 - */ -var JSCOMP_ERROR = [ - 'accessControls', - 'checkPrototypalTypes', - 'checkRegExp', - 'checkTypes', - 'checkVars', - 'conformanceViolations', - 'const', - 'constantProperty', - 'deprecated', - 'deprecatedAnnotations', - 'duplicateMessage', - 'es5Strict', - 'externsValidation', - 'functionParams', - 'globalThis', - 'invalidCasts', - 'misplacedTypeAnnotation', - 'missingGetCssName', - // 'missingOverride', - 'missingPolyfill', - 'missingProperties', - 'missingProvide', - 'missingRequire', - 'missingReturn', - // 'missingSourcesWarnings', - 'moduleLoad', - 'msgDescriptions', - 'nonStandardJsDocs', - // 'polymer', - // 'reportUnknownTypes', - // 'strictCheckTypes', - // 'strictMissingProperties', - 'strictModuleDepCheck', - // 'strictPrimitiveOperators', - 'suspiciousCode', - 'typeInvalidation', - 'undefinedNames', - 'undefinedVars', - 'underscore', - 'unknownDefines', - 'unusedLocalVariables', - // 'unusedPrivateMembers', - 'useOfGoogBase', - 'uselessCode', - 'untranspilableFeatures', - 'visibility' -]; - -/** - * Helper method for calling the Closure compiler. - * @param {*} compilerOptions - * @param {boolean=} opt_verbose Optional option for verbose logging - * @param {boolean=} opt_warnings_as_error Optional option for treating warnings - * as errors. - */ -function compile(compilerOptions, opt_verbose, opt_warnings_as_error) { - compilerOptions = compilerOptions || {}; - compilerOptions.compilation_level = 'SIMPLE_OPTIMIZATIONS'; - compilerOptions.warning_level = opt_verbose ? 'VERBOSE' : 'DEFAULT'; - compilerOptions.language_in = - compilerOptions.language_in || 'ECMASCRIPT5_STRICT'; - compilerOptions.language_out = 'ECMASCRIPT5_STRICT'; - compilerOptions.rewrite_polyfills = false; - compilerOptions.hide_warnings_for = 'node_modules'; - if (opt_warnings_as_error) { - compilerOptions.jscomp_error = JSCOMP_ERROR; - } - - const platform = ['native', 'java', 'javascript']; - - return closureCompiler(compilerOptions, { platform }); -} - -/** - * Helper method for possibly adding the Closure library into a sources array. - * @param {Array.} srcs - */ -function maybeAddClosureLibrary(srcs) { - if (argv.closureLibrary) { - // If you require Google's Closure library, you can include it in your - // build by adding the --closure-library flag. - // You will also need to include the "google-closure-library" in your list - // of devDependencies. - console.log('Including the google-closure-library in your build.'); - if (!fs.existsSync('./node_modules/google-closure-library')) { - throw Error('You must add the google-closure-library to your ' + - 'devDependencies in package.json, and run `npm install`.'); - } - srcs.push('./node_modules/google-closure-library/closure/goog/**/**/*.js'); - } - return srcs; -} - -/** - * This task builds Blockly's core files. - * blockly_compressed.js - */ -function buildCompressed(cb) { - const defines = 'Blockly.VERSION="' + packageJson.version + '"'; - return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'}) - // Directories in Blockly are used to group similar files together - // but are not used to limit access with @package, instead the - // method means something is internal to Blockly and not a public - // API. - // Flatten all files so they're in the same directory, but ensure that - // files with the same name don't conflict. - .pipe(gulp.rename(function (p) { - var dirname = p.dirname.replace(new RegExp(path.sep, "g"), "-"); - p.dirname = ""; - p.basename = dirname + "-" + p.basename; - })) - .pipe(stripApacheLicense()) - .pipe(compile({ - dependency_mode: 'PRUNE', - entry_point: './core-requires.js', - js_output_file: 'blockly_compressed.js', - externs: ['./externs/svg-externs.js', './externs/goog-externs.js'], - define: defines, - language_in: - argv.closureLibrary ? 'ECMASCRIPT_2015' : 'ECMASCRIPT5_STRICT' - }, argv.verbose, argv.strict)) - .pipe(prependHeader()) - .pipe(gulp.dest('./')); -}; - -/** - * This task builds the Blockly's built in blocks. - * blocks_compressed.js - */ -function buildBlocks() { - // Add provides used throughout blocks/ in order to be compatible with the - // compiler. Anything added to this list must be removed from the compiled - // result using the remove regex steps below. - const provides = ` -goog.provide('Blockly'); -goog.provide('Blockly.Blocks'); -goog.provide('Blockly.Comment'); -goog.provide('Blockly.FieldCheckbox'); -goog.provide('Blockly.FieldColour'); -goog.provide('Blockly.FieldDropdown'); -goog.provide('Blockly.FieldImage'); -goog.provide('Blockly.FieldLabel'); -goog.provide('Blockly.FieldMultilineInput'); -goog.provide('Blockly.FieldNumber'); -goog.provide('Blockly.FieldTextInput'); -goog.provide('Blockly.FieldVariable'); -goog.provide('Blockly.Mutator'); -goog.provide('Blockly.Warning');`; - return gulp.src(maybeAddClosureLibrary(['blocks/*.js']), {base: './'}) - // Add Blockly.Blocks to be compatible with the compiler. - .pipe(gulp.replace(`goog.provide('Blockly.Constants.Colour');`, - `${provides}goog.provide('Blockly.Constants.Colour');`)) - .pipe(stripApacheLicense()) - .pipe(compile({ - dependency_mode: 'NONE', - externs: ['./externs/goog-externs.js'], - js_output_file: 'blocks_compressed.js' - }, argv.verbose, argv.strict)) - .pipe(gulp.replace('\'use strict\';', '\'use strict\';\n\n\n')) - // Remove Blockly.Blocks to be compatible with Blockly. - .pipe(gulp.replace(/var Blockly=\{[^;]*\};\n?/, '')) - // Remove Blockly Fields to be compatible with Blockly. - .pipe(gulp.replace(/Blockly\.Field[^=\(]+=\{[^;]*\};/g, '')) - // Remove Blockly Warning, Comment & Mutator to be compatible with Blockly. - .pipe(gulp.replace(/Blockly\.(Comment|Warning|Mutator)=\{[^;]*\};/g, '')) - .pipe(prependHeader()) - .pipe(gulp.dest('./')); -}; - -/** - * A helper method for building a Blockly code generator. - * @param {string} language Generator language. - * @param {string} namespace Language namespace. - */ -function buildGenerator(language, namespace) { - var provides = ` -goog.provide('Blockly.Generator'); -goog.provide('Blockly.utils.global'); -goog.provide('Blockly.utils.string');`; - return gulp.src([`generators/${language}.js`, `generators/${language}/*.js`], {base: './'}) - .pipe(stripApacheLicense()) - // Add Blockly.Generator and Blockly.utils.string to be compatible with the compiler. - .pipe(gulp.replace(`goog.provide('Blockly.${namespace}');`, - `${provides}goog.provide('Blockly.${namespace}');`)) - .pipe(compile({ - dependency_mode: 'NONE', - externs: ['./externs/goog-externs.js'], - js_output_file: `${language}_compressed.js` - }, argv.verbose, argv.strict)) - .pipe(gulp.replace('\'use strict\';', '\'use strict\';\n\n\n')) - // Remove Blockly.Generator and Blockly.utils.string to be compatible with Blockly. - .pipe(gulp.replace(/var Blockly=\{[^;]*\};\s*Blockly.utils.global={};\s*Blockly.utils.string={};\n?/, '')) - .pipe(prependHeader()) - .pipe(gulp.dest('./')); -}; - -/** - * This task builds the javascript generator. - * javascript_compressed.js - */ -function buildJavascript() { - return buildGenerator('javascript', 'JavaScript'); -}; - -/** - * This task builds the python generator. - * python_compressed.js - */ -function buildPython() { - return buildGenerator('python', 'Python'); -}; - -/** - * This task builds the php generator. - * php_compressed.js - */ -function buildPHP() { - return buildGenerator('php', 'PHP'); -}; - -/** - * This task builds the lua generator. - * lua_compressed.js - */ -function buildLua() { - return buildGenerator('lua', 'Lua'); -}; - -/** - * This task builds the dart generator: - * dart_compressed.js - */ -function buildDart() { - return buildGenerator('dart', 'Dart'); -}; - -/** - * This tasks builds all the generators: - * javascript_compressed.js - * python_compressed.js - * php_compressed.js - * lua_compressed.js - * dart_compressed.js - */ -const buildGenerators = gulp.parallel( - buildJavascript, - buildPython, - buildPHP, - buildLua, - buildDart -); - -/** - * This task builds Blockly's uncompressed file. - * blockly_uncompressed.js - */ -function buildUncompressed() { - const closurePath = argv.closureLibrary ? - 'node_modules/google-closure-library/closure/goog' : - 'closure/goog'; - const header = `// Do not edit this file; automatically generated by gulp. -'use strict'; - -this.IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports); - -this.BLOCKLY_DIR = (function(root) { - if (!root.IS_NODE_JS) { - // Find name of current directory. - var scripts = document.getElementsByTagName('script'); - var re = new RegExp('(.+)[\\\/]blockly_(.*)uncompressed\\\.js$'); - for (var i = 0, script; script = scripts[i]; i++) { - var match = re.exec(script.src); - if (match) { - return match[1]; - } - } - alert('Could not detect Blockly\\'s directory name.'); - } - return ''; -})(this); - -this.BLOCKLY_BOOT = function(root) { - // Execute after Closure has loaded. -`; - const footer = ` -delete root.BLOCKLY_DIR; -delete root.BLOCKLY_BOOT; -delete root.IS_NODE_JS; -}; - -if (this.IS_NODE_JS) { - this.BLOCKLY_BOOT(this); - module.exports = Blockly; -} else { - document.write(''); - document.write(''); -} -`; - -let deps = []; -return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js'])) - .pipe(through2.obj((file, _enc, cb) => { - const result = closureDeps.parser.parseFile(file.path); - for (const dep of result.dependencies) { - deps.push(dep); - } - cb(null); - })) - .on('end', () => { - // Update the path to closure for any files that we don't know the full path - // of (parsed from a goog.addDependency call). - for (const dep of deps) { - dep.setClosurePath(closurePath); - } - - const addDependency = closureDeps.depFile.getDepFileText(closurePath, deps); - - const requires = `goog.addDependency("base.js", [], []); - -// Load Blockly. -goog.require('Blockly.requires') -`; - fs.writeFileSync('blockly_uncompressed.js', - header + - addDependency + - requires + - footer); - }); -}; - -/** - * This task builds Blockly's lang files. - * msg/*.js - */ -function buildLangfiles(done) { - // Run js_to_json.py - const jsToJsonCmd = `python ./i18n/js_to_json.py \ ---input_file ${path.join('msg', 'messages.js')} \ ---output_dir ${path.join('msg', 'json')} \ ---quiet`; - execSync(jsToJsonCmd, { stdio: 'inherit' }); - - // Run create_messages.py - let json_files = fs.readdirSync(path.join('msg', 'json')); - json_files = json_files.filter(file => file.endsWith('json') && - !(new RegExp(/(keys|synonyms|qqq|constants)\.json$/).test(file))); - json_files = json_files.map(file => path.join('msg', 'json', file)); - const createMessagesCmd = `python ./i18n/create_messages.py \ - --source_lang_file ${path.join('msg', 'json', 'en.json')} \ - --source_synonym_file ${path.join('msg', 'json', 'synonyms.json')} \ - --source_constants_file ${path.join('msg', 'json', 'constants.json')} \ - --key_file ${path.join('msg', 'json', 'keys.json')} \ - --output_dir ${path.join('msg', 'js')} \ - --quiet ${json_files.join(' ')}`; - execSync(createMessagesCmd, { stdio: 'inherit' }); - - done(); -}; - -/** - * This tasks builds Blockly's core files: - * blockly_compressed.js - * blocks_compressed.js - * blockly_uncompressed.js - */ -const buildCore = gulp.parallel( - buildCompressed, - buildBlocks, - buildUncompressed -); - -/** - * This task builds all of Blockly: - * blockly_compressed.js - * blocks_compressed.js - * javascript_compressed.js - * python_compressed.js - * php_compressed.js - * lua_compressed.js - * dart_compressed.js - * blockly_uncompressed.js - * msg/json/*.js - */ -const build = gulp.parallel( - buildCore, - buildGenerators, - buildLangfiles -); - -//////////////////////////////////////////////////////////// -// Typings // -//////////////////////////////////////////////////////////// - -// Generates the TypeScript definition file (d.ts) for Blockly. -// As well as generating the typings of each of the files under core/ and msg/, -// the script also pulls in a number of part files from typings/parts. -// This includes the header (incl License), additional useful interfaces -// including Blockly Options and Google Closure typings. -function typings() { - const tmpDir = './typings/tmp'; - const blocklySrcs = [ - "core/", - "core/components", - "core/components/tree", - "core/components/menu", - "core/keyboard_nav", - "core/renderers/common", - "core/renderers/measurables", - "core/theme", - "core/utils", - "msg/" - ]; - // Clean directory if exists. - if (fs.existsSync(tmpDir)) { - rimraf.sync(tmpDir); - } - fs.mkdirSync(tmpDir); - - // Find all files that will be included in the typings file. - let files = []; - blocklySrcs.forEach((src) => { - files = files.concat(fs.readdirSync(src) - .filter(fn => fn.endsWith('.js')) - .map(fn => path.join(src, fn))); - }); - - // Generate typings file for each file. - files.forEach((file) => { - const typescriptFileName = `${path.join(tmpDir, file)}.d.ts`; - if (file.indexOf('core/msg.js') > -1) { - return; - } - const cmd = `node ./node_modules/typescript-closure-tools/definition-generator/src/main.js ${file} ${typescriptFileName}`; - console.log(`Generating typings for ${file}`); - execSync(cmd, { stdio: 'inherit' }); - }); - - const srcs = [ - 'typings/parts/blockly-header.d.ts', - 'typings/parts/blockly-interfaces.d.ts', - `${tmpDir}/core/**`, - `${tmpDir}/core/components/**`, - `${tmpDir}/core/components/tree/**`, - `${tmpDir}/core/components/menu/**`, - `${tmpDir}/core/keyboard_nav/**`, - `${tmpDir}/core/renderers/common/**`, - `${tmpDir}/core/renderers/measurables/**`, - `${tmpDir}/core/utils/**`, - `${tmpDir}/core/theme/**`, - `${tmpDir}/msg/**` - ]; - return gulp.src(srcs) - .pipe(gulp.concat('blockly.d.ts')) - .pipe(gulp.dest('typings')) - .on('end', function () { - // Clean up tmp directory. - if (fs.existsSync(tmpDir)) { - rimraf.sync(tmpDir); - } - }); -}; - -//////////////////////////////////////////////////////////// -// NPM packaging tasks // -//////////////////////////////////////////////////////////// - -// The destination path where all the NPM distribution files will go. -const packageDistribution = './dist'; - -/** - * A helper method for wrapping a file into a Universal Module Definition. - * @param {string} namespace The export namespace. - * @param {Array} dependencies An array of dependencies to inject. - */ -function packageUMD(namespace, dependencies) { - return gulp.umd({ - dependencies: function () { return dependencies; }, - namespace: function () { return namespace; }, - exports: function () { return namespace; }, - template: path.join(__dirname, 'package/templates/umd.template') - }); -}; - -/** - * A helper method for wrapping a file into a CommonJS module for Node.js. - * @param {string} namespace The export namespace. - * @param {Array} dependencies An array of dependencies to inject. - */ -function packageCommonJS(namespace, dependencies) { - return gulp.umd({ - dependencies: function () { return dependencies; }, - namespace: function () { return namespace; }, - exports: function () { return namespace; }, - template: path.join(__dirname, 'package/templates/node.template') - }); -}; - -/** - * This task wraps blockly_compressed.js into a UMD module. - * @example import 'blockly/blockly'; - */ -function packageBlockly() { - return gulp.src('blockly_compressed.js') - .pipe(packageUMD('Blockly', [])) - .pipe(gulp.rename('blockly.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps blocks_compressed.js into a CommonJS module for Node.js. - * This is an equivelant task to package-blockly but for Node.js. - * @example import 'blockly/blockly-node'; - */ -function packageBlocklyNode() { - // Override textToDomDocument, providing a Node.js alternative to DOMParser. - return gulp.src('blockly_compressed.js') - .pipe(gulp.insert.append(` - if (typeof DOMParser !== 'function') { - var DOMParser = require("jsdom/lib/jsdom/living").DOMParser; - var XMLSerializer = require("jsdom/lib/jsdom/living").XMLSerializer; - var doc = Blockly.utils.xml.textToDomDocument( - ''); - Blockly.utils.xml.document = function() { - return doc; - }; - }`)) - .pipe(packageCommonJS('Blockly', [])) - .pipe(gulp.rename('blockly-node.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps blocks_compressed.js into a UMD module. - * @example import 'blockly/blocks'; - */ -function packageBlocks() { - return gulp.src('blocks_compressed.js') - .pipe(gulp.insert.prepend(` - Blockly.Blocks={};`)) - .pipe(packageUMD('Blockly.Blocks', [{ - name: 'Blockly', - amd: './core', - cjs: './core', - }])) - .pipe(gulp.rename('blocks.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps package/index.js into a UMD module. - * We implicitly require the Node entry point in CommonJS environments, - * and the Browser entry point for AMD environments. - * @example import * as Blockly from 'blockly'; - */ -function packageIndex() { - return gulp.src('package/index.js') - .pipe(packageUMD('Blockly', [{ - name: 'Blockly', - amd: './browser', - cjs: './node', - }])) - .pipe(gulp.rename('index.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps package/browser/index.js into a UMD module. - * By default, the module includes Blockly core and built-in blocks, - * as well as the JavaScript code generator and the English block - * localization files. - * This module is configured (in package.json) to replaces the module - * built by package-node in browser environments. - * @example import * as Blockly from 'blockly/browser'; - */ -function packageBrowser() { - return gulp.src('package/browser/index.js') - .pipe(packageUMD('Blockly', [{ - name: 'Blockly', - amd: './core-browser', - cjs: './core-browser', - },{ - name: 'En', - amd: './msg/en', - cjs: './msg/en', - },{ - name: 'BlocklyBlocks', - amd: './blocks', - cjs: './blocks', - },{ - name: 'BlocklyJS', - amd: './javascript', - cjs: './javascript', - }])) - .pipe(gulp.rename('browser.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps package/browser/core.js into a UMD module. - * By default, the module includes the Blockly core package and a - * helper method to set the locale. - * This module is configured (in package.json) to replaces the module - * built by package-node-core in browser environments. - * @example import * as Blockly from 'blockly/core'; - */ -function packageCore() { - return gulp.src('package/browser/core.js') - .pipe(packageUMD('Blockly', [{ - name: 'Blockly', - amd: './blockly', - cjs: './blockly', - }])) - .pipe(gulp.rename('core-browser.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps package/node/index.js into a CommonJS module for Node.js. - * By default, the module includes Blockly core and built-in blocks, - * as well as all the code generators and the English block localization files. - * This module is configured (in package.json) to be replaced by the module - * built by package-browser in browser environments. - * @example import * as Blockly from 'blockly/node'; - */ -function packageNode() { - return gulp.src('package/node/index.js') - .pipe(packageCommonJS('Blockly', [{ - name: 'Blockly', - cjs: './core', - },{ - name: 'En', - cjs: './msg/en', - },{ - name: 'BlocklyBlocks', - cjs: './blocks', - },{ - name: 'BlocklyJS', - cjs: './javascript', - },{ - name: 'BlocklyPython', - cjs: './python', - },{ - name: 'BlocklyPHP', - cjs: './php', - },{ - name: 'BlocklyLua', - cjs: './lua', - }, { - name: 'BlocklyDart', - cjs: './dart', - }])) - .pipe(gulp.rename('node.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps package/node/core.js into a CommonJS module for Node.js. - * By default, the module includes the Blockly core package for Node.js - * and a helper method to set the locale. - * This module is configured (in package.json) to be replaced by the module - * built by package-core in browser environments. - * @example import * as Blockly from 'blockly/core'; - */ -function packageNodeCore() { - return gulp.src('package/node/core.js') - .pipe(packageCommonJS('Blockly', [{ - name: 'Blockly', - amd: './blockly-node', - cjs: './blockly-node', - }])) - .pipe(gulp.rename('core.js')) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * A helper method for packaging a Blockly code generator into a UMD module. - * @param {string} file Source file name. - * @param {string} rename Destination file name. - * @param {string} generator Generator export namespace. - */ -function packageGenerator(file, rename, generator) { - return gulp.src(file) - .pipe(packageUMD(generator, [{ - name: 'Blockly', - amd: './core', - cjs: './core', - }])) - .pipe(gulp.rename(rename)) - .pipe(gulp.dest(packageDistribution)); -}; - -/** - * This task wraps javascript_compressed.js into a UMD module. - * @example import 'blockly/javascript'; - */ -function packageJavascript() { - return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript'); -}; - -/** - * This task wraps python_compressed.js into a UMD module. - * @example import 'blockly/python'; - */ -function packagePython() { - return packageGenerator('python_compressed.js', 'python.js', 'Blockly.Python'); -}; - -/** - * This task wraps lua_compressed.js into a UMD module. - * @example import 'blockly/lua'; - */ -function packageLua() { - return packageGenerator('lua_compressed.js', 'lua.js', 'Blockly.Lua'); -}; - -/** - * This task wraps dart_compressed.js into a UMD module. - * @example import 'blockly/dart'; - */ -function packageDart() { - return packageGenerator('dart_compressed.js', 'dart.js', 'Blockly.Dart'); -}; - -/** - * This task wraps php_compressed.js into a UMD module. - * @example import 'blockly/php'; - */ -function packagePHP() { - return packageGenerator('php_compressed.js', 'php.js', 'Blockly.PHP'); -}; - -/** - * This task wraps each of the msg/js/* files into a UMD module. - * @example import * as En from 'blockly/msg/en'; - */ -function packageLocales() { - // Remove references to goog.provide and goog.require. - return gulp.src('msg/js/*.js') - .pipe(gulp.replace(/goog\.[^\n]+/g, '')) - .pipe(gulp.insert.prepend(` - var Blockly = {};Blockly.Msg={};`)) - .pipe(packageUMD('Blockly.Msg', [{ - name: 'Blockly', - amd: '../core', - cjs: '../core', - }])) - .pipe(gulp.dest(`${packageDistribution}/msg`)); -}; - -/** - * This task creates a UMD bundle of Blockly which includes the Blockly - * core files, the built-in blocks, the JavaScript code generator and the - * English localization files. - * @example - */ -function packageUMDBundle() { - var srcs = [ - 'blockly_compressed.js', - 'msg/js/en.js', - 'blocks_compressed.js', - 'javascript_compressed.js' - ]; - return gulp.src(srcs) - .pipe(gulp.concat('blockly.min.js')) - .pipe(packageUMD('Blockly', [])) - .pipe(gulp.dest(`${packageDistribution}`)) -}; - -/** - * This task copies all the media/* files into the distribution directory. - */ -function packageMedia() { - return gulp.src('./media/*') - .pipe(gulp.dest(`${packageDistribution}/media`)); -}; - -/** - * This task copies the package.json file into the distribution directory. - */ -function packageJSON(cb) { - const json = Object.assign({}, packageJson); - delete json['scripts']; - if (!fs.existsSync(packageDistribution)) { - fs.mkdirSync(packageDistribution); - } - fs.writeFileSync(`${packageDistribution}/package.json`, - JSON.stringify(json, null, 2)); - cb(); -}; - -/** - * This task copies the package/README.md file into the distribution directory. - * This file is what developers will see at https://www.npmjs.com/package/blockly. - */ -function packageReadme() { - return gulp.src('./package/README.md') - .pipe(gulp.dest(`${packageDistribution}`)); -}; - -/** - * This task copies the typings/blockly.d.ts TypeScript definition file into the - * distribution directory. - * The bundled declaration file is referenced in package.json in the types property. - */ -function packageDTS() { - return gulp.src('./typings/blockly.d.ts') - .pipe(gulp.dest(`${packageDistribution}`)); -}; - -/** - * This task prepares the NPM distribution files under the /dist directory. - */ -const package = gulp.parallel( - packageIndex, - packageBrowser, - packageNode, - packageCore, - packageNodeCore, - packageBlockly, - packageBlocklyNode, - packageBlocks, - packageJavascript, - packagePython, - packageLua, - packageDart, - packagePHP, - packageLocales, - packageMedia, - packageUMDBundle, - packageJSON, - packageReadme, - packageDTS -); - -// Stash current state, check out the named branch, and sync with -// google/blockly. -function syncBranch(branchName) { - return function(done) { - execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' }); - execSync('git checkout ' + branchName, { stdio: 'inherit' }); - execSync('git pull ' + upstream_url + ' ' + branchName, - { stdio: 'inherit' }); - execSync('git push origin ' + branchName, { stdio: 'inherit' }); - done(); - } -} - -// Stash current state, check out develop, and sync with google/blockly. -function syncDevelop() { - return syncBranch('develop'); -}; - -// Stash current state, check out master, and sync with google/blockly. -function syncMaster() { - return syncBranch('master'); -}; - -// Helper function: get a name for a rebuild branch. Format: rebuild_mm_dd_yyyy. -function getRebuildBranchName() { - var date = new Date(); - var mm = date.getMonth() + 1; // Month, 0-11 - var dd = date.getDate(); // Day of the month, 1-31 - var yyyy = date.getFullYear(); - return 'rebuild_' + mm + '_' + dd + '_' + yyyy; -}; - -// Helper function: get a name for a rebuild branch. Format: rebuild_yyyy_mm. -function getRCBranchName() { - var date = new Date(); - var mm = date.getMonth() + 1; // Month, 0-11 - var yyyy = date.getFullYear(); - return 'rc_' + yyyy + '_' + mm; -}; - -// Recompile and push to origin. -const recompile = gulp.series( - syncDevelop, - function(done) { - var branchName = getRebuildBranchName(); - console.log('make-rebuild-branch: creating branch ' + branchName); - execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); - done(); - }, - build, - typings, - function(done) { - console.log('push-rebuild-branch: committing rebuild'); - execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); - var branchName = getRebuildBranchName(); - execSync('git push origin ' + branchName, { stdio: 'inherit' }); - console.log('Branch ' + branchName + ' pushed to GitHub.'); - console.log('Next step: create a pull request against develop.'); - done(); - } -); - -// Create and push an RC branch. -// Note that this pushes to google/blockly. -const createRC = gulp.series( - syncDevelop, - function(done) { - var branchName = getRCBranchName(); - execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); - execSync('git push ' + upstream_url + ' ' + branchName, - { stdio: 'inherit' }); - execSync('git checkout -b gh-pages'); - execSync('git push ' + upstream_url + ' gh-pages'); - done(); - }, -); // See https://docs.npmjs.com/cli/version. const preversion = gulp.series( - syncMaster, + gitTasks.syncMaster, function(done) { // Create a branch named bump_version for the bump and rebuild. execSync('git checkout -b bump_version', { stdio: 'inherit' }); @@ -999,20 +56,20 @@ function postversion(done) { }; module.exports = { - default: build, - build: build, - buildCore: buildCore, - buildBlocks: buildBlocks, - buildLangfiles: buildLangfiles, - buildUncompressed: buildUncompressed, - buildCompressed: buildCompressed, - buildGenerators: buildGenerators, - gitSyncDevelop: syncDevelop, - gitSyncMaster: syncMaster, + default: buildTasks.build, + build: buildTasks.build, + buildCore: buildTasks.core, + buildBlocks: buildTasks.blocks, + buildLangfiles: buildTasks.langfiles, + buildUncompressed: buildTasks.uncompressed, + buildCompressed: buildTasks.compressed, + buildGenerators: buildTasks.generators, preversion: preversion, postversion: postversion, - gitCreateRC: createRC, - gitRecompile: recompile, - typings: typings, - package: package + gitSyncDevelop: gitTasks.syncDevelop, + gitSyncMaster: gitTasks.syncMaster, + gitCreateRC: gitTasks.createRC, + gitRecompile: gitTasks.recompile, + typings: typings.typings, + package: packageTasks.package }; diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js new file mode 100644 index 000000000..3435c33de --- /dev/null +++ b/scripts/gulpfiles/build_tasks.js @@ -0,0 +1,460 @@ +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Gulp script to build Blockly for Node & NPM. + */ + +var gulp = require('gulp'); +gulp.replace = require('gulp-replace'); +gulp.rename = require('gulp-rename'); +gulp.insert = require('gulp-insert'); + +var path = require('path'); +var fs = require('fs'); +var execSync = require('child_process').execSync; +var through2 = require('through2'); + +var closureCompiler = require('google-closure-compiler').gulp(); +var closureDeps = require('google-closure-deps'); +var packageJson = require('../../package.json'); +var argv = require('yargs').argv; + + +//////////////////////////////////////////////////////////// +// Build // +//////////////////////////////////////////////////////////// + +const licenseRegex = `\\/\\*\\* + \\* @license + \\* (Copyright \\d+ (Google LLC|Massachusetts Institute of Technology)) +( \\* All rights reserved. +)? \\* SPDX-License-Identifier: Apache-2.0 + \\*\\/`; + +/** + * Helper method for stripping the Google's and MIT's Apache Licenses. + */ +function stripApacheLicense() { + // Strip out Google's and MIT's Apache licences. + // Closure Compiler preserves dozens of Apache licences in the Blockly code. + // Remove these if they belong to Google or MIT. + // MIT's permission to do this is logged in Blockly issue #2412. + return gulp.replace(new RegExp(licenseRegex, "g"), ''); +} + +/** + * Helper method for prepending the auto-generated header text. + */ +function prependHeader() { + return gulp.insert.prepend(`// Do not edit this file; automatically generated by gulp.\n`); +} + +/** + * Closure compiler warning groups used to treat warnings as errors. + * For a full list of closure compiler groups, consult: + * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/DiagnosticGroups.java#L113 + */ +var JSCOMP_ERROR = [ + 'accessControls', + 'checkPrototypalTypes', + 'checkRegExp', + 'checkTypes', + 'checkVars', + 'conformanceViolations', + 'const', + 'constantProperty', + 'deprecated', + 'deprecatedAnnotations', + 'duplicateMessage', + 'es5Strict', + 'externsValidation', + 'functionParams', + 'globalThis', + 'invalidCasts', + 'misplacedTypeAnnotation', + 'missingGetCssName', + // 'missingOverride', + 'missingPolyfill', + 'missingProperties', + 'missingProvide', + 'missingRequire', + 'missingReturn', + // 'missingSourcesWarnings', + 'moduleLoad', + 'msgDescriptions', + 'nonStandardJsDocs', + // 'polymer', + // 'reportUnknownTypes', + // 'strictCheckTypes', + // 'strictMissingProperties', + 'strictModuleDepCheck', + // 'strictPrimitiveOperators', + 'suspiciousCode', + 'typeInvalidation', + 'undefinedNames', + 'undefinedVars', + 'underscore', + 'unknownDefines', + 'unusedLocalVariables', + // 'unusedPrivateMembers', + 'useOfGoogBase', + 'uselessCode', + 'untranspilableFeatures', + 'visibility' +]; + +/** + * Helper method for calling the Closure compiler. + * @param {*} compilerOptions + * @param {boolean=} opt_verbose Optional option for verbose logging + * @param {boolean=} opt_warnings_as_error Optional option for treating warnings + * as errors. + */ +function compile(compilerOptions, opt_verbose, opt_warnings_as_error) { + compilerOptions = compilerOptions || {}; + compilerOptions.compilation_level = 'SIMPLE_OPTIMIZATIONS'; + compilerOptions.warning_level = opt_verbose ? 'VERBOSE' : 'DEFAULT'; + compilerOptions.language_in = + compilerOptions.language_in || 'ECMASCRIPT5_STRICT'; + compilerOptions.language_out = 'ECMASCRIPT5_STRICT'; + compilerOptions.rewrite_polyfills = false; + compilerOptions.hide_warnings_for = 'node_modules'; + if (opt_warnings_as_error) { + compilerOptions.jscomp_error = JSCOMP_ERROR; + } + + const platform = ['native', 'java', 'javascript']; + + return closureCompiler(compilerOptions, { platform }); +} + +/** + * Helper method for possibly adding the Closure library into a sources array. + * @param {Array.} srcs + */ +function maybeAddClosureLibrary(srcs) { + if (argv.closureLibrary) { + // If you require Google's Closure library, you can include it in your + // build by adding the --closure-library flag. + // You will also need to include the "google-closure-library" in your list + // of devDependencies. + console.log('Including the google-closure-library in your build.'); + if (!fs.existsSync('./node_modules/google-closure-library')) { + throw Error('You must add the google-closure-library to your ' + + 'devDependencies in package.json, and run `npm install`.'); + } + srcs.push('./node_modules/google-closure-library/closure/goog/**/**/*.js'); + } + return srcs; +} + +/** + * This task builds Blockly's core files. + * blockly_compressed.js + */ +function buildCompressed(cb) { + const defines = 'Blockly.VERSION="' + packageJson.version + '"'; + return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'}) + // Directories in Blockly are used to group similar files together + // but are not used to limit access with @package, instead the + // method means something is internal to Blockly and not a public + // API. + // Flatten all files so they're in the same directory, but ensure that + // files with the same name don't conflict. + .pipe(gulp.rename(function (p) { + var dirname = p.dirname.replace(new RegExp(path.sep, "g"), "-"); + p.dirname = ""; + p.basename = dirname + "-" + p.basename; + })) + .pipe(stripApacheLicense()) + .pipe(compile({ + dependency_mode: 'PRUNE', + entry_point: './core-requires.js', + js_output_file: 'blockly_compressed.js', + externs: ['./externs/svg-externs.js', './externs/goog-externs.js'], + define: defines, + language_in: + argv.closureLibrary ? 'ECMASCRIPT_2015' : 'ECMASCRIPT5_STRICT' + }, argv.verbose, argv.strict)) + .pipe(prependHeader()) + .pipe(gulp.dest('./')); +}; + +/** + * This task builds the Blockly's built in blocks. + * blocks_compressed.js + */ +function buildBlocks() { + // Add provides used throughout blocks/ in order to be compatible with the + // compiler. Anything added to this list must be removed from the compiled + // result using the remove regex steps below. + const provides = ` +goog.provide('Blockly'); +goog.provide('Blockly.Blocks'); +goog.provide('Blockly.Comment'); +goog.provide('Blockly.FieldCheckbox'); +goog.provide('Blockly.FieldColour'); +goog.provide('Blockly.FieldDropdown'); +goog.provide('Blockly.FieldImage'); +goog.provide('Blockly.FieldLabel'); +goog.provide('Blockly.FieldMultilineInput'); +goog.provide('Blockly.FieldNumber'); +goog.provide('Blockly.FieldTextInput'); +goog.provide('Blockly.FieldVariable'); +goog.provide('Blockly.Mutator'); +goog.provide('Blockly.Warning');`; + return gulp.src(maybeAddClosureLibrary(['blocks/*.js']), {base: './'}) + // Add Blockly.Blocks to be compatible with the compiler. + .pipe(gulp.replace(`goog.provide('Blockly.Constants.Colour');`, + `${provides}goog.provide('Blockly.Constants.Colour');`)) + .pipe(stripApacheLicense()) + .pipe(compile({ + dependency_mode: 'NONE', + externs: ['./externs/goog-externs.js'], + js_output_file: 'blocks_compressed.js' + }, argv.verbose, argv.strict)) + .pipe(gulp.replace('\'use strict\';', '\'use strict\';\n\n\n')) + // Remove Blockly.Blocks to be compatible with Blockly. + .pipe(gulp.replace(/var Blockly=\{[^;]*\};\n?/, '')) + // Remove Blockly Fields to be compatible with Blockly. + .pipe(gulp.replace(/Blockly\.Field[^=\(]+=\{[^;]*\};/g, '')) + // Remove Blockly Warning, Comment & Mutator to be compatible with Blockly. + .pipe(gulp.replace(/Blockly\.(Comment|Warning|Mutator)=\{[^;]*\};/g, '')) + .pipe(prependHeader()) + .pipe(gulp.dest('./')); +}; + +/** + * A helper method for building a Blockly code generator. + * @param {string} language Generator language. + * @param {string} namespace Language namespace. + */ +function buildGenerator(language, namespace) { + var provides = ` +goog.provide('Blockly.Generator'); +goog.provide('Blockly.utils.global'); +goog.provide('Blockly.utils.string');`; + return gulp.src([`generators/${language}.js`, `generators/${language}/*.js`], {base: './'}) + .pipe(stripApacheLicense()) + // Add Blockly.Generator and Blockly.utils.string to be compatible with the compiler. + .pipe(gulp.replace(`goog.provide('Blockly.${namespace}');`, + `${provides}goog.provide('Blockly.${namespace}');`)) + .pipe(compile({ + dependency_mode: 'NONE', + externs: ['./externs/goog-externs.js'], + js_output_file: `${language}_compressed.js` + }, argv.verbose, argv.strict)) + .pipe(gulp.replace('\'use strict\';', '\'use strict\';\n\n\n')) + // Remove Blockly.Generator and Blockly.utils.string to be compatible with Blockly. + .pipe(gulp.replace(/var Blockly=\{[^;]*\};\s*Blockly.utils.global={};\s*Blockly.utils.string={};\n?/, '')) + .pipe(prependHeader()) + .pipe(gulp.dest('./')); +}; + +/** + * This task builds the javascript generator. + * javascript_compressed.js + */ +function buildJavascript() { + return buildGenerator('javascript', 'JavaScript'); +}; + +/** + * This task builds the python generator. + * python_compressed.js + */ +function buildPython() { + return buildGenerator('python', 'Python'); +}; + +/** + * This task builds the php generator. + * php_compressed.js + */ +function buildPHP() { + return buildGenerator('php', 'PHP'); +}; + +/** + * This task builds the lua generator. + * lua_compressed.js + */ +function buildLua() { + return buildGenerator('lua', 'Lua'); +}; + +/** + * This task builds the dart generator: + * dart_compressed.js + */ +function buildDart() { + return buildGenerator('dart', 'Dart'); +}; + +/** + * This tasks builds all the generators: + * javascript_compressed.js + * python_compressed.js + * php_compressed.js + * lua_compressed.js + * dart_compressed.js + */ +const buildGenerators = gulp.parallel( + buildJavascript, + buildPython, + buildPHP, + buildLua, + buildDart +); + +/** + * This task builds Blockly's uncompressed file. + * blockly_uncompressed.js + */ +function buildUncompressed() { + const closurePath = argv.closureLibrary ? + 'node_modules/google-closure-library/closure/goog' : + 'closure/goog'; + const header = `// Do not edit this file; automatically generated by gulp. +'use strict'; + +this.IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports); + +this.BLOCKLY_DIR = (function(root) { + if (!root.IS_NODE_JS) { + // Find name of current directory. + var scripts = document.getElementsByTagName('script'); + var re = new RegExp('(.+)[\\\/]blockly_(.*)uncompressed\\\.js$'); + for (var i = 0, script; script = scripts[i]; i++) { + var match = re.exec(script.src); + if (match) { + return match[1]; + } + } + alert('Could not detect Blockly\\'s directory name.'); + } + return ''; +})(this); + +this.BLOCKLY_BOOT = function(root) { + // Execute after Closure has loaded. +`; + const footer = ` +delete root.BLOCKLY_DIR; +delete root.BLOCKLY_BOOT; +delete root.IS_NODE_JS; +}; + +if (this.IS_NODE_JS) { + this.BLOCKLY_BOOT(this); + module.exports = Blockly; +} else { + document.write(''); + document.write(''); +} +`; + +let deps = []; +return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js'])) + .pipe(through2.obj((file, _enc, cb) => { + const result = closureDeps.parser.parseFile(file.path); + for (const dep of result.dependencies) { + deps.push(dep); + } + cb(null); + })) + .on('end', () => { + // Update the path to closure for any files that we don't know the full path + // of (parsed from a goog.addDependency call). + for (const dep of deps) { + dep.setClosurePath(closurePath); + } + + const addDependency = closureDeps.depFile.getDepFileText(closurePath, deps); + + const requires = `goog.addDependency("base.js", [], []); + +// Load Blockly. +goog.require('Blockly.requires') +`; + fs.writeFileSync('blockly_uncompressed.js', + header + + addDependency + + requires + + footer); + }); +}; + +/** + * This task builds Blockly's lang files. + * msg/*.js + */ +function buildLangfiles(done) { + // Run js_to_json.py + const jsToJsonCmd = `python ./i18n/js_to_json.py \ +--input_file ${path.join('msg', 'messages.js')} \ +--output_dir ${path.join('msg', 'json')} \ +--quiet`; + execSync(jsToJsonCmd, { stdio: 'inherit' }); + + // Run create_messages.py + let json_files = fs.readdirSync(path.join('msg', 'json')); + json_files = json_files.filter(file => file.endsWith('json') && + !(new RegExp(/(keys|synonyms|qqq|constants)\.json$/).test(file))); + json_files = json_files.map(file => path.join('msg', 'json', file)); + const createMessagesCmd = `python ./i18n/create_messages.py \ + --source_lang_file ${path.join('msg', 'json', 'en.json')} \ + --source_synonym_file ${path.join('msg', 'json', 'synonyms.json')} \ + --source_constants_file ${path.join('msg', 'json', 'constants.json')} \ + --key_file ${path.join('msg', 'json', 'keys.json')} \ + --output_dir ${path.join('msg', 'js')} \ + --quiet ${json_files.join(' ')}`; + execSync(createMessagesCmd, { stdio: 'inherit' }); + + done(); +}; + +/** + * This tasks builds Blockly's core files: + * blockly_compressed.js + * blocks_compressed.js + * blockly_uncompressed.js + */ +const buildCore = gulp.parallel( + buildCompressed, + buildBlocks, + buildUncompressed +); + +/** + * This task builds all of Blockly: + * blockly_compressed.js + * blocks_compressed.js + * javascript_compressed.js + * python_compressed.js + * php_compressed.js + * lua_compressed.js + * dart_compressed.js + * blockly_uncompressed.js + * msg/json/*.js + */ +const build = gulp.parallel( + buildCore, + buildGenerators, + buildLangfiles +); + +module.exports = { + build: build, + core: buildCore, + blocks: buildBlocks, + langfiles: buildLangfiles, + uncompressed: buildUncompressed, + compressed: buildCompressed, + generators: buildGenerators, +} diff --git a/scripts/gulpfiles/git_tasks.js b/scripts/gulpfiles/git_tasks.js new file mode 100644 index 000000000..a0262cebc --- /dev/null +++ b/scripts/gulpfiles/git_tasks.js @@ -0,0 +1,101 @@ +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Git-related gulp tasks for Blockly. + */ + +var gulp = require('gulp'); +var execSync = require('child_process').execSync; + +var typings = require('./typings'); +var buildTasks = require('./build_tasks'); + +const upstream_url = "https://github.com/google/blockly.git"; + +// Stash current state, check out the named branch, and sync with +// google/blockly. +function syncBranch(branchName) { + return function(done) { + execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' }); + execSync('git checkout ' + branchName, { stdio: 'inherit' }); + execSync('git pull ' + upstream_url + ' ' + branchName, + { stdio: 'inherit' }); + execSync('git push origin ' + branchName, { stdio: 'inherit' }); + done(); + } +} + +// Stash current state, check out develop, and sync with google/blockly. +function syncDevelop() { + return syncBranch('develop'); +}; + +// Stash current state, check out master, and sync with google/blockly. +function syncMaster() { + return syncBranch('master'); +}; + +// Helper function: get a name for a rebuild branch. Format: rebuild_mm_dd_yyyy. +function getRebuildBranchName() { + var date = new Date(); + var mm = date.getMonth() + 1; // Month, 0-11 + var dd = date.getDate(); // Day of the month, 1-31 + var yyyy = date.getFullYear(); + return 'rebuild_' + mm + '_' + dd + '_' + yyyy; +}; + +// Helper function: get a name for a rebuild branch. Format: rebuild_yyyy_mm. +function getRCBranchName() { + var date = new Date(); + var mm = date.getMonth() + 1; // Month, 0-11 + var yyyy = date.getFullYear(); + return 'rc_' + yyyy + '_' + mm; +}; + +// Recompile and push to origin. +const recompile = gulp.series( + syncDevelop, + function(done) { + var branchName = getRebuildBranchName(); + console.log('make-rebuild-branch: creating branch ' + branchName); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + done(); + }, + buildTasks.build, + typings.typings, + function(done) { + console.log('push-rebuild-branch: committing rebuild'); + execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); + var branchName = getRebuildBranchName(); + execSync('git push origin ' + branchName, { stdio: 'inherit' }); + console.log('Branch ' + branchName + ' pushed to GitHub.'); + console.log('Next step: create a pull request against develop.'); + done(); + } +); + +// Create and push an RC branch. +// Note that this pushes to google/blockly. +const createRC = gulp.series( + syncDevelop, + function(done) { + var branchName = getRCBranchName(); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + execSync('git push ' + upstream_url + ' ' + branchName, + { stdio: 'inherit' }); + execSync('git checkout -b gh-pages'); + execSync('git push ' + upstream_url + ' gh-pages'); + done(); + }, +); + +module.exports = { + syncDevelop: syncDevelop, + syncMaster: syncMaster, + createRC: createRC, + recompile: recompile +} diff --git a/scripts/gulpfiles/package_tasks.js b/scripts/gulpfiles/package_tasks.js new file mode 100644 index 000000000..604ce4aba --- /dev/null +++ b/scripts/gulpfiles/package_tasks.js @@ -0,0 +1,399 @@ +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Gulp tasks to package Blockly for distribution on NPM. + */ + +var gulp = require('gulp'); +gulp.concat = require('gulp-concat'); +gulp.replace = require('gulp-replace'); +gulp.rename = require('gulp-rename'); +gulp.insert = require('gulp-insert'); +gulp.umd = require('gulp-umd'); + +var path = require('path'); +var fs = require('fs'); + +var packageJson = require('../../package.json'); +var argv = require('yargs').argv; + +const upstream_url = "https://github.com/google/blockly.git"; + +const blocklyRoot = '../../'; + +// The destination path where all the NPM distribution files will go. +const packageDistribution = blocklyRoot + 'dist'; + + +/** + * A helper method for wrapping a file into a Universal Module Definition. + * @param {string} namespace The export namespace. + * @param {Array} dependencies An array of dependencies to inject. + */ +function packageUMD(namespace, dependencies) { + return gulp.umd({ + dependencies: function () { return dependencies; }, + namespace: function () { return namespace; }, + exports: function () { return namespace; }, + template: path.join(__dirname, `${blocklyRoot}/package/templates/umd.template`) + }); +}; + +/** + * A helper method for wrapping a file into a CommonJS module for Node.js. + * @param {string} namespace The export namespace. + * @param {Array} dependencies An array of dependencies to inject. + */ +function packageCommonJS(namespace, dependencies) { + return gulp.umd({ + dependencies: function () { return dependencies; }, + namespace: function () { return namespace; }, + exports: function () { return namespace; }, + template: path.join(__dirname, `${blocklyRoot}/package/templates/node.template`) + }); +}; + +/** + * This task wraps blockly_compressed.js into a UMD module. + * @example import 'blockly/blockly'; + */ +function packageBlockly() { + return gulp.src('blockly_compressed.js') + .pipe(packageUMD('Blockly', [])) + .pipe(gulp.rename('blockly.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps blocks_compressed.js into a CommonJS module for Node.js. + * This is an equivelant task to package-blockly but for Node.js. + * @example import 'blockly/blockly-node'; + */ +function packageBlocklyNode() { + // Override textToDomDocument, providing a Node.js alternative to DOMParser. + return gulp.src('blockly_compressed.js') + .pipe(gulp.insert.append(` + if (typeof DOMParser !== 'function') { + var DOMParser = require("jsdom/lib/jsdom/living").DOMParser; + var XMLSerializer = require("jsdom/lib/jsdom/living").XMLSerializer; + var doc = Blockly.utils.xml.textToDomDocument( + ''); + Blockly.utils.xml.document = function() { + return doc; + }; + }`)) + .pipe(packageCommonJS('Blockly', [])) + .pipe(gulp.rename('blockly-node.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps blocks_compressed.js into a UMD module. + * @example import 'blockly/blocks'; + */ +function packageBlocks() { + return gulp.src('blocks_compressed.js') + .pipe(gulp.insert.prepend(` + Blockly.Blocks={};`)) + .pipe(packageUMD('Blockly.Blocks', [{ + name: 'Blockly', + amd: './core', + cjs: './core', + }])) + .pipe(gulp.rename('blocks.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps package/index.js into a UMD module. + * We implicitly require the Node entry point in CommonJS environments, + * and the Browser entry point for AMD environments. + * @example import * as Blockly from 'blockly'; + */ +function packageIndex() { + return gulp.src('package/index.js') + .pipe(packageUMD('Blockly', [{ + name: 'Blockly', + amd: './browser', + cjs: './node', + }])) + .pipe(gulp.rename('index.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps package/browser/index.js into a UMD module. + * By default, the module includes Blockly core and built-in blocks, + * as well as the JavaScript code generator and the English block + * localization files. + * This module is configured (in package.json) to replaces the module + * built by package-node in browser environments. + * @example import * as Blockly from 'blockly/browser'; + */ +function packageBrowser() { + return gulp.src('package/browser/index.js') + .pipe(packageUMD('Blockly', [{ + name: 'Blockly', + amd: './core-browser', + cjs: './core-browser', + },{ + name: 'En', + amd: './msg/en', + cjs: './msg/en', + },{ + name: 'BlocklyBlocks', + amd: './blocks', + cjs: './blocks', + },{ + name: 'BlocklyJS', + amd: './javascript', + cjs: './javascript', + }])) + .pipe(gulp.rename('browser.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps package/browser/core.js into a UMD module. + * By default, the module includes the Blockly core package and a + * helper method to set the locale. + * This module is configured (in package.json) to replaces the module + * built by package-node-core in browser environments. + * @example import * as Blockly from 'blockly/core'; + */ +function packageCore() { + return gulp.src('package/browser/core.js') + .pipe(packageUMD('Blockly', [{ + name: 'Blockly', + amd: './blockly', + cjs: './blockly', + }])) + .pipe(gulp.rename('core-browser.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps package/node/index.js into a CommonJS module for Node.js. + * By default, the module includes Blockly core and built-in blocks, + * as well as all the code generators and the English block localization files. + * This module is configured (in package.json) to be replaced by the module + * built by package-browser in browser environments. + * @example import * as Blockly from 'blockly/node'; + */ +function packageNode() { + return gulp.src('package/node/index.js') + .pipe(packageCommonJS('Blockly', [{ + name: 'Blockly', + cjs: './core', + },{ + name: 'En', + cjs: './msg/en', + },{ + name: 'BlocklyBlocks', + cjs: './blocks', + },{ + name: 'BlocklyJS', + cjs: './javascript', + },{ + name: 'BlocklyPython', + cjs: './python', + },{ + name: 'BlocklyPHP', + cjs: './php', + },{ + name: 'BlocklyLua', + cjs: './lua', + }, { + name: 'BlocklyDart', + cjs: './dart', + }])) + .pipe(gulp.rename('node.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps package/node/core.js into a CommonJS module for Node.js. + * By default, the module includes the Blockly core package for Node.js + * and a helper method to set the locale. + * This module is configured (in package.json) to be replaced by the module + * built by package-core in browser environments. + * @example import * as Blockly from 'blockly/core'; + */ +function packageNodeCore() { + return gulp.src('package/node/core.js') + .pipe(packageCommonJS('Blockly', [{ + name: 'Blockly', + amd: './blockly-node', + cjs: './blockly-node', + }])) + .pipe(gulp.rename('core.js')) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * A helper method for packaging a Blockly code generator into a UMD module. + * @param {string} file Source file name. + * @param {string} rename Destination file name. + * @param {string} generator Generator export namespace. + */ +function packageGenerator(file, rename, generator) { + return gulp.src(file) + .pipe(packageUMD(generator, [{ + name: 'Blockly', + amd: './core', + cjs: './core', + }])) + .pipe(gulp.rename(rename)) + .pipe(gulp.dest(packageDistribution)); +}; + +/** + * This task wraps javascript_compressed.js into a UMD module. + * @example import 'blockly/javascript'; + */ +function packageJavascript() { + return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript'); +}; + +/** + * This task wraps python_compressed.js into a UMD module. + * @example import 'blockly/python'; + */ +function packagePython() { + return packageGenerator('python_compressed.js', 'python.js', 'Blockly.Python'); +}; + +/** + * This task wraps lua_compressed.js into a UMD module. + * @example import 'blockly/lua'; + */ +function packageLua() { + return packageGenerator('lua_compressed.js', 'lua.js', 'Blockly.Lua'); +}; + +/** + * This task wraps dart_compressed.js into a UMD module. + * @example import 'blockly/dart'; + */ +function packageDart() { + return packageGenerator('dart_compressed.js', 'dart.js', 'Blockly.Dart'); +}; + +/** + * This task wraps php_compressed.js into a UMD module. + * @example import 'blockly/php'; + */ +function packagePHP() { + return packageGenerator('php_compressed.js', 'php.js', 'Blockly.PHP'); +}; + +/** + * This task wraps each of the msg/js/* files into a UMD module. + * @example import * as En from 'blockly/msg/en'; + */ +function packageLocales() { + // Remove references to goog.provide and goog.require. + return gulp.src('msg/js/*.js') + .pipe(gulp.replace(/goog\.[^\n]+/g, '')) + .pipe(gulp.insert.prepend(` + var Blockly = {};Blockly.Msg={};`)) + .pipe(packageUMD('Blockly.Msg', [{ + name: 'Blockly', + amd: '../core', + cjs: '../core', + }])) + .pipe(gulp.dest(`${packageDistribution}/msg`)); +}; + +/** + * This task creates a UMD bundle of Blockly which includes the Blockly + * core files, the built-in blocks, the JavaScript code generator and the + * English localization files. + * @example + */ +function packageUMDBundle() { + var srcs = [ + 'blockly_compressed.js', + 'msg/js/en.js', + 'blocks_compressed.js', + 'javascript_compressed.js' + ]; + return gulp.src(srcs) + .pipe(gulp.concat('blockly.min.js')) + .pipe(packageUMD('Blockly', [])) + .pipe(gulp.dest(`${packageDistribution}`)) +}; + +/** + * This task copies all the media/* files into the distribution directory. + */ +function packageMedia() { + return gulp.src('./media/*') + .pipe(gulp.dest(`${packageDistribution}/media`)); +}; + +/** + * This task copies the package.json file into the distribution directory. + */ +function packageJSON(cb) { + const json = Object.assign({}, packageJson); + delete json['scripts']; + if (!fs.existsSync(packageDistribution)) { + fs.mkdirSync(packageDistribution); + } + fs.writeFileSync(`${packageDistribution}/package.json`, + JSON.stringify(json, null, 2)); + cb(); +}; + +/** + * This task copies the package/README.md file into the distribution directory. + * This file is what developers will see at https://www.npmjs.com/package/blockly. + */ +function packageReadme() { + return gulp.src('./package/README.md') + .pipe(gulp.dest(`${packageDistribution}`)); +}; + +/** + * This task copies the typings/blockly.d.ts TypeScript definition file into the + * distribution directory. + * The bundled declaration file is referenced in package.json in the types property. + */ +function packageDTS() { + return gulp.src('./typings/blockly.d.ts') + .pipe(gulp.dest(`${packageDistribution}`)); +}; + +/** + * This task prepares the NPM distribution files under the /dist directory. + */ +const package = gulp.parallel( + packageIndex, + packageBrowser, + packageNode, + packageCore, + packageNodeCore, + packageBlockly, + packageBlocklyNode, + packageBlocks, + packageJavascript, + packagePython, + packageLua, + packageDart, + packagePHP, + packageLocales, + packageMedia, + packageUMDBundle, + packageJSON, + packageReadme, + packageDTS +); + +module.exports = { + package: package +}; diff --git a/scripts/gulpfiles/typings.js b/scripts/gulpfiles/typings.js new file mode 100644 index 000000000..86ba78b38 --- /dev/null +++ b/scripts/gulpfiles/typings.js @@ -0,0 +1,91 @@ +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Gulp script to generate the Typescript definition file (d.ts) + * for Blockly. + */ + +var gulp = require('gulp'); +gulp.concat = require('gulp-concat'); + +var path = require('path'); +var fs = require('fs'); +var rimraf = require('rimraf'); +var execSync = require('child_process').execSync; + +// Generates the TypeScript definition file (d.ts) for Blockly. +// As well as generating the typings of each of the files under core/ and msg/, +// the script also pulls in a number of part files from typings/parts. +// This includes the header (incl License), additional useful interfaces +// including Blockly Options and Google Closure typings. +function typings() { + const tmpDir = './typings/tmp'; + const blocklySrcs = [ + "core/", + "core/components", + "core/components/tree", + "core/components/menu", + "core/keyboard_nav", + "core/renderers/common", + "core/renderers/measurables", + "core/theme", + "core/utils", + "msg/" + ]; + // Clean directory if exists. + if (fs.existsSync(tmpDir)) { + rimraf.sync(tmpDir); + } + fs.mkdirSync(tmpDir); + + // Find all files that will be included in the typings file. + let files = []; + blocklySrcs.forEach((src) => { + files = files.concat(fs.readdirSync(src) + .filter(fn => fn.endsWith('.js')) + .map(fn => path.join(src, fn))); + }); + + // Generate typings file for each file. + files.forEach((file) => { + const typescriptFileName = `${path.join(tmpDir, file)}.d.ts`; + if (file.indexOf('core/msg.js') > -1) { + return; + } + const cmd = `node ./node_modules/typescript-closure-tools/definition-generator/src/main.js ${file} ${typescriptFileName}`; + console.log(`Generating typings for ${file}`); + execSync(cmd, { stdio: 'inherit' }); + }); + + const srcs = [ + 'typings/parts/blockly-header.d.ts', + 'typings/parts/blockly-interfaces.d.ts', + `${tmpDir}/core/**`, + `${tmpDir}/core/components/**`, + `${tmpDir}/core/components/tree/**`, + `${tmpDir}/core/components/menu/**`, + `${tmpDir}/core/keyboard_nav/**`, + `${tmpDir}/core/renderers/common/**`, + `${tmpDir}/core/renderers/measurables/**`, + `${tmpDir}/core/utils/**`, + `${tmpDir}/core/theme/**`, + `${tmpDir}/msg/**` + ]; + return gulp.src(srcs) + .pipe(gulp.concat('blockly.d.ts')) + .pipe(gulp.dest('typings')) + .on('end', function () { + // Clean up tmp directory. + if (fs.existsSync(tmpDir)) { + rimraf.sync(tmpDir); + } + }); +}; + +module.exports = { + typings: typings +}; From ba6e93a564481345982217b53fd527f9b9e85144 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 17 Feb 2020 14:53:03 +0100 Subject: [PATCH 044/105] Localisation updates from https://translatewiki.net. --- msg/json/ca.json | 34 +++++++++++++++++++++++++++++++--- msg/json/kn.json | 27 ++++++++++++++++----------- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/msg/json/ca.json b/msg/json/ca.json index bfa0663a2..2034d5e2f 100644 --- a/msg/json/ca.json +++ b/msg/json/ca.json @@ -7,10 +7,12 @@ "Jaumeortola", "Fitoschido", "Quel.soler", - "Micobu" + "Micobu", + "Lluís Batlle" ] }, "VARIABLES_DEFAULT_NAME": "element", + "UNNAMED_KEY": "sense nom", "TODAY": "Avui", "DUPLICATE_BLOCK": "Duplica", "ADD_COMMENT": "Afegeix un comentari", @@ -97,6 +99,8 @@ "IOS_VARIABLES_ADD_BUTTON": "Afegir", "IOS_VARIABLES_RENAME_BUTTON": "Reanomena", "IOS_VARIABLES_DELETE_BUTTON": "Esborrar", + "IOS_VARIABLES_VARIABLE_NAME": "Nom de la variable", + "IOS_VARIABLES_EMPTY_NAME_ERROR": "No es pot fer servir un nom de variable buit.", "LOGIC_COMPARE_HELPURL": "https://ca.wikipedia.org/wiki/Inequaci%C3%B3", "LOGIC_COMPARE_TOOLTIP_EQ": "Retorna cert si totes dues entrades són iguals.", "LOGIC_COMPARE_TOOLTIP_NEQ": "Retorna cert si totes dues entrades són diferents.", @@ -189,6 +193,9 @@ "MATH_RANDOM_FLOAT_HELPURL": "https://ca.wikipedia.org/wiki/Generaci%C3%B3_de_nombres_aleatoris", "MATH_RANDOM_FLOAT_TITLE_RANDOM": "fracció aleatòria", "MATH_RANDOM_FLOAT_TOOLTIP": "Retorna una fracció aleatòria entre 0,0 (inclòs) i 1,0 (exclòs).", + "MATH_ATAN2_HELPURL": "https://ca.wikipedia.org/wiki/Inverses_de_les_funcions_trigonom%C3%A8triques#L'arctangent_amb_dos_arguments", + "MATH_ATAN2_TITLE": "atan2 de X:%1 Y:%2", + "MATH_ATAN2_TOOLTIP": "Torna l'arctangent del punt (X,Y) en graus de -180 a 180.", "TEXT_TEXT_HELPURL": "https://ca.wikipedia.org/wiki/Cadena_%28inform%C3%A0tica%29", "TEXT_TEXT_TOOLTIP": "Una lletra, paraula o línia de text.", "TEXT_JOIN_TITLE_CREATEWITH": "crear text amb", @@ -206,6 +213,7 @@ "TEXT_INDEXOF_TITLE": "en el text %1 %2 %3", "TEXT_INDEXOF_OPERATOR_FIRST": "trobar la primera aparició del text", "TEXT_INDEXOF_OPERATOR_LAST": "trobar l'última aparició del text", + "TEXT_CHARAT_TITLE": "en el text %1 %2", "TEXT_CHARAT_FROM_START": "recupera la lletra núm.#", "TEXT_CHARAT_FROM_END": "recupera la lletra núm.# des del final", "TEXT_CHARAT_FIRST": "recupera la primera lletra", @@ -234,6 +242,12 @@ "TEXT_PROMPT_TYPE_NUMBER": "demanar un nombre amb el missatge", "TEXT_PROMPT_TOOLTIP_NUMBER": "Demana que l'usuari introdueixi un nombre.", "TEXT_PROMPT_TOOLTIP_TEXT": "Demana que l'usuari introdueixi un text.", + "TEXT_COUNT_MESSAGE0": "comptar %1 en %2", + "TEXT_COUNT_TOOLTIP": "Compta quantes vegades hi ha un text dins d'un altre text.", + "TEXT_REPLACE_MESSAGE0": "substituir %1 amb %2 en %3", + "TEXT_REPLACE_TOOLTIP": "Substitueix totes les aparicions d'un text dins d'un altre text.", + "TEXT_REVERSE_MESSAGE0": "invertir %1", + "TEXT_REVERSE_TOOLTIP": "Inverteix l'ordre dels caràcters en el text.", "LISTS_CREATE_EMPTY_TITLE": "crear llista buida", "LISTS_CREATE_EMPTY_TOOLTIP": "Retorna una llista, de longitud 0, que no conté cap dada.", "LISTS_CREATE_WITH_TOOLTIP": "Crea una llista amb qualsevol nombre d'elements.", @@ -250,7 +264,7 @@ "LISTS_INLIST": "en la llista", "LISTS_INDEX_OF_FIRST": "buscar primera aparició d'un element", "LISTS_INDEX_OF_LAST": "buscar última aparició d'un element", - "LISTS_INDEX_OF_TOOLTIP": "Retorna l'índex de la primera/última aparició d'un element a la llista. Retorna %1 si no s'hi troba el text.", + "LISTS_INDEX_OF_TOOLTIP": "Retorna l'índex de la primera/última aparició d'un element a la llista. Retorna %1 si no s'hi troba l'element.", "LISTS_GET_INDEX_GET": "recupera", "LISTS_GET_INDEX_GET_REMOVE": "recupera i esborra", "LISTS_GET_INDEX_REMOVE": "esborra", @@ -290,8 +304,20 @@ "LISTS_GET_SUBLIST_END_FROM_END": "fins # des del final", "LISTS_GET_SUBLIST_END_LAST": "fins l'últim", "LISTS_GET_SUBLIST_TOOLTIP": "Crea una còpia de la part especificada d'una llista.", + "LISTS_SORT_TITLE": "ordenar %1 %2 %3", + "LISTS_SORT_TOOLTIP": "Ordena la còpia d'una llista.", + "LISTS_SORT_ORDER_ASCENDING": "ascendent", + "LISTS_SORT_ORDER_DESCENDING": "descendent", + "LISTS_SORT_TYPE_NUMERIC": "numèric", "LISTS_SORT_TYPE_TEXT": "alfabètic", + "LISTS_SORT_TYPE_IGNORECASE": "alfabètic, ignorant majúscules", + "LISTS_SPLIT_LIST_FROM_TEXT": "fer una llista d'un text", + "LISTS_SPLIT_TEXT_FROM_LIST": "fer un text d'una llista", "LISTS_SPLIT_WITH_DELIMITER": "amb delimitador", + "LISTS_SPLIT_TOOLTIP_SPLIT": "Parteix el text en una llista de textos, trencant-lo a cada delimitador.", + "LISTS_SPLIT_TOOLTIP_JOIN": "Ajunta una llista de textos en un text, separats per un delimitador.", + "LISTS_REVERSE_MESSAGE0": "invertir %1", + "LISTS_REVERSE_TOOLTIP": "Invertir la còpia d'una llista.", "VARIABLES_GET_TOOLTIP": "Retorna el valor d'aquesta variable.", "VARIABLES_GET_CREATE_SET": "Crea 'modifica %1'", "VARIABLES_SET": "modifica %1 a %2", @@ -319,5 +345,7 @@ "PROCEDURES_CREATE_DO": "Crear '%1'", "PROCEDURES_IFRETURN_TOOLTIP": "Si el valor és cert, llavors retorna un segon valor.", "PROCEDURES_IFRETURN_WARNING": "Advertència: Aquest bloc només es pot utilitzar dins de la definició d'una funció.", - "WORKSPACE_COMMENT_DEFAULT_TEXT": "Digues alguna cosa..." + "WORKSPACE_COMMENT_DEFAULT_TEXT": "Digues alguna cosa...", + "WORKSPACE_ARIA_LABEL": "Espai de treball Blockly", + "COLLAPSED_WARNINGS_WARNING": "Els blocs plegats contenen avisos." } diff --git a/msg/json/kn.json b/msg/json/kn.json index 80c01985d..2be5097a2 100644 --- a/msg/json/kn.json +++ b/msg/json/kn.json @@ -8,6 +8,7 @@ ] }, "VARIABLES_DEFAULT_NAME": "ವಸ್ತು", + "UNNAMED_KEY": "ಹೆಸರಿಸದ", "TODAY": "ಇಂದು", "DUPLICATE_BLOCK": "ನಕಲಿಸು", "ADD_COMMENT": "ಟಿಪ್ಪಣಿ ಸೇರಿಸು", @@ -38,24 +39,28 @@ "NEW_VARIABLE_TYPE_TITLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಬಗೆ:", "NEW_VARIABLE_TITLE": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರು:", "VARIABLE_ALREADY_EXISTS": "'%1' ಎನ್ನುವ ಹೆಸರಿನ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಈಗಾಗಲೇ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ.", - "VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE": "'%1' ಎನ್ನುವ ಹೆಸರಿನ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶ ಈಗಾಗಲೇ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ.", + "VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE": "%1' ಎನ್ನುವ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶವು ಈಗಾಗಲೇ '%2' ಬಗೆಯಲ್ಲಿ ಅಸ್ತಿತ್ವದಲ್ಲಿದೆ.", + "DELETE_VARIABLE_CONFIRMATION": "'%2' ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ '%1' ಉಪಯೋಗಗಳನ್ನು ಅಳಿಸುವುದೇ ?", + "CANNOT_DELETE_VARIABLE_PROCEDURE": "%1' ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶವನ್ನು ಅಳಿಸಲು ಬರುವುದಿಲ್ಲ. ಏಕೆಂದರೆ ಅದು '%2' ಕೆಲಸದಲ್ಲಿ ಉಪಯೋಗಿಸಲ್ಪಟ್ಟಿದೆ", + "DELETE_VARIABLE": "'%1' ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶವನ್ನು ಅಳಿಸು", "COLOUR_PICKER_HELPURL": "https://en.wikipedia.org/wiki/Color", - "COLOUR_PICKER_TOOLTIP": "ಪೆಲೆಟ್‍ನಿಂದ ಒಂದು ಬಣ್ಣವನ್ನು ಆರಿಸಿ.", - "COLOUR_RANDOM_TITLE": "ಯಾವುದೊ ಒಂದು ಬಣ್ಣ", - "COLOUR_RANDOM_TOOLTIP": "ಯಾವುದೋ ಒಂದು ಬಣ್ಣವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.", - "COLOUR_RGB_TITLE": "ಬಣ್ಣದ", + "COLOUR_PICKER_TOOLTIP": "ವರ್ಣಫಲಕದಿಂದ ಬಣ್ಣವನು ಆರಿಸು.", + "COLOUR_RANDOM_TITLE": "ಅಸಂಬದ್ದ ಬಣ್ಣ", + "COLOUR_RANDOM_TOOLTIP": "ಯಾವುದಾದರೂ ಒಂದು ಬಣ್ಣವನ್ನು ಆರಿಸು.", + "COLOUR_RGB_TITLE": "ಬಣ್ಣದೊಂದಿಗೆ", "COLOUR_RGB_RED": "ಕೆಂಪು", "COLOUR_RGB_GREEN": "ಹಸಿರು", "COLOUR_RGB_BLUE": "ನೀಲಿ", - "COLOUR_BLEND_TITLE": "ಮಿಶ್ರಣ ಮಾಡು", - "COLOUR_BLEND_COLOUR1": "ಬಣ್ಣ ೧", - "COLOUR_BLEND_COLOUR2": "ಬಣ್ಣ ೨", + "COLOUR_RGB_TOOLTIP": "ನಿರ್ಧಿಷ್ಟವಾದ ಪ್ರಮಾಣದಲ್ಲಿ ಕೆಂಪು, ಹಸಿರು, ಮತ್ತು ನೀಲಿ ಯನ್ನು ಹೊಂದಿದ ಒಂದು ಬಣ್ಣವನ್ನು ರಚಿಸಿ. ಎಲ್ಲಾ ಮೌಲ್ಯಗಳು 0 ಮತ್ತು 100 ರ ನಡುವೆ ಇರಬೇಕು.", + "COLOUR_BLEND_TITLE": "ಮಿಶ್ರಣ", + "COLOUR_BLEND_COLOUR1": "ಬಣ್ಣ 1", + "COLOUR_BLEND_COLOUR2": "ಬಣ್ಣ 2", "COLOUR_BLEND_RATIO": "ಅನುಪಾತ", "COLOUR_BLEND_TOOLTIP": "ಕೊಟ್ಟಿರುವ ಅನುಪಾತದ (0.0 - 1.0) ಪ್ರಕಾರ ಎರಡು ಬಣ್ಣವನ್ನು ಮಿಶ್ರಣ ಮಾಡುತ್ತದೆ.", "CONTROLS_REPEAT_HELPURL": "https://en.wikipedia.org/wiki/For_loop", "CONTROLS_REPEAT_TITLE": "%1 ಬಾರಿ ಪುನರಾವರ್ತಿಸು", "CONTROLS_REPEAT_INPUT_DO": "ಮಾಡು", - "CONTROLS_REPEAT_TOOLTIP": "ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಹಲವಾರು ಬಾರಿ ಮಾಡಿ.", + "CONTROLS_REPEAT_TOOLTIP": "ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಹಲವಾರು ಬಾರಿ ಮಾಡು.", "CONTROLS_WHILEUNTIL_OPERATOR_WHILE": "ಪುನರಾವರ್ತಿಸು ಇ ಸಮಯದಲ್ಲಿ", "CONTROLS_WHILEUNTIL_OPERATOR_UNTIL": "ಪುನರಾವರ್ತಿಸು ಇ ತನಕ", "CONTROLS_WHILEUNTIL_TOOLTIP_WHILE": "ಮೌಲ್ಯವು ನಿಜವಾಗಿರುವ ಸಮಯದಲ್ಲಿ, ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡಿ.", @@ -68,7 +73,7 @@ "CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE": "ಸುತ್ತುವಿಕೆಯ ಮುಂದಿನ ಪುನರಾವರ್ತನೆಯೊಂದಿಗೆ ಮುಂದುವರಿಯಿರಿ", "CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK": "ಒಳಗೊಂಡಿರುವ ಸುತ್ತುವಿಕೆಯಿಂದ ಹೊರಬನ್ನಿ.", "CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE": "ಉಳಿದ ಸುತ್ತುವಿಕೆ ಬಿಟ್ಟು ಮುಂದೆ ಹೋಗಿ, ಮತ್ತು ಮುಂದಿನ ಪುನರಾವರ್ತನೆಯೊಂದಿಗೆ ಮುಂದುವರಿಯಿರಿ.", - "CONTROLS_FLOW_STATEMENTS_WARNING": "ಎಚ್ಚರಿಕೆ: ಈ ಬ್ಲಾಕ್ ಅನ್ನು ಸುತ್ತುವಿಕೆ ಒಳಗಡೆ ಮಾತ್ರ ಬಳಸಬಹುದಾಗಿದೆ.", + "CONTROLS_FLOW_STATEMENTS_WARNING": "ಎಚ್ಚರಿಕೆ: ಈ ಬ್ಲಾಕ್ ಅನ್ನು ಸುತ್ತುವಿಕೆ ಒಳಗಡೆ ಮಾತ್ರ ಬಳಸಬಹುದಾಗಿದೆ.", "CONTROLS_IF_TOOLTIP_1": "ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ , ಕೆಲವು ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", "CONTROLS_IF_TOOLTIP_2": "ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ, ಮೊದಲನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು, ಇಲ್ಲವಾದರೆ, ಎರಡನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", "CONTROLS_IF_TOOLTIP_3": "ಮೊದಲನೆಯ ಮೌಲ್ಯವು ನಿಜ ಆಗಿದ್ದರೆ, ಮೊದಲ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು. ಇಲ್ಲವಾದರೆ, ಎರಡನೇ ಮೌಲ್ಯವು ನಿಜವಾಗಿದ್ದರೆ, ಎರಡನೇ ವಿಭಾಗದ ಹೇಳಿಕೆಗಳನ್ನು ಮಾಡು.", @@ -91,7 +96,7 @@ "IOS_VARIABLES_RENAME_BUTTON": "ಹೆಸರು ಬದಲಾಯಿಸು", "IOS_VARIABLES_DELETE_BUTTON": "ಅಳಿಸು", "IOS_VARIABLES_VARIABLE_NAME": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರು", - "IOS_VARIABLES_EMPTY_NAME_ERROR": "ನೀವು ಖಾಲಿ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರನ್ನು ಬಳಸಲು ಬರುವುದಿಲ್ಲ.", + "IOS_VARIABLES_EMPTY_NAME_ERROR": "ನೀವು ಖಾಲಿ ಇರುವ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರನ್ನು ಬಳಸಲು ಬರುವುದಿಲ್ಲ.", "LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)", "LOGIC_OPERATION_AND": "ಮತ್ತು", "LOGIC_OPERATION_OR": "ಅಥವಾ", From 0c60c119a25e68c2c9633fba1dccd40d84c5cca7 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 17 Feb 2020 14:08:27 -0800 Subject: [PATCH 045/105] Update to use knew variable (#3694) --- core/block_svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/block_svg.js b/core/block_svg.js index f8d93a288..65741cfe4 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -1661,7 +1661,7 @@ Blockly.BlockSvg.prototype.render = function(opt_bubble) { Blockly.utils.dom.stopTextWidthCache(); var cursor = this.workspace.getCursor(); - if (Blockly.navigation.keyboardAccessibilityMode && this.pathObject.cursorSvg_) { + if (this.workspace.keyboardAccessibilityMode && this.pathObject.cursorSvg_) { cursor.draw(); } }; From 392d25eb39bda1d7ff2993500115dbd2173484cf Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 18 Feb 2020 16:01:18 -0800 Subject: [PATCH 046/105] fix: Break breaking undo. --- blocks/loops.js | 27 +++++++++++++-------------- core/block_svg.js | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/blocks/loops.js b/blocks/loops.js index 57ef12aac..0163350d5 100644 --- a/blocks/loops.js +++ b/blocks/loops.js @@ -327,24 +327,23 @@ Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = { /** * Called whenever anything on the workspace changes. * Add warning if this flow block is not nested inside a loop. - * @param {!Blockly.Events.Abstract} _e Change event. + * @param {!Blockly.Events.Abstract} e Change event. * @this {Blockly.Block} */ - onchange: function(_e) { - if (!this.workspace.isDragging || this.workspace.isDragging()) { + onchange: function(e) { + if (!this.workspace.isDragging || this.workspace.isDragging() || + e.type != Blockly.Events.BLOCK_MOVE || e.blockId != this.id) { return; // Don't change state at the start of a drag. } - if (Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN - .getSurroundLoop(this)) { - this.setWarningText(null); - if (!this.isInFlyout) { - this.setEnabled(true); - } - } else { - this.setWarningText(Blockly.Msg['CONTROLS_FLOW_STATEMENTS_WARNING']); - if (!this.isInFlyout && !this.getInheritedDisabled()) { - this.setEnabled(false); - } + var enabled = Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN + .getSurroundLoop(this); + this.setWarningText(enabled ? null : + Blockly.Msg['CONTROLS_FLOW_STATEMENTS_WARNING']); + if (!this.isInFlyout) { + var group = Blockly.Events.getGroup(); + Blockly.Events.setGroup(e.group); + this.setEnabled(enabled); + Blockly.Events.setGroup(group); } } }; diff --git a/core/block_svg.js b/core/block_svg.js index 65741cfe4..fe9815d6b 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -1180,7 +1180,7 @@ Blockly.BlockSvg.prototype.setDisabled = function(disabled) { Blockly.BlockSvg.prototype.setEnabled = function(enabled) { if (this.isEnabled() != enabled) { Blockly.BlockSvg.superClass_.setEnabled.call(this, enabled); - if (this.rendered) { + if (this.rendered && !this.getInheritedDisabled()) { this.updateDisabled(); } } From 3ba6fec6a1d7e69541065330aa1057e25f258020 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 18 Feb 2020 12:03:05 -0800 Subject: [PATCH 047/105] Security update to JS-Interpreter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The past week has been ‘exciting’ over in the JS-Interpreter repo. --- demos/interpreter/acorn_interpreter.js | 202 +++++++++++++------------ demos/interpreter/async-execution.html | 10 +- demos/interpreter/index.html | 2 +- demos/interpreter/step-execution.html | 8 +- demos/interpreter/wait_block.js | 6 +- 5 files changed, 115 insertions(+), 113 deletions(-) diff --git a/demos/interpreter/acorn_interpreter.js b/demos/interpreter/acorn_interpreter.js index 249bc6cdd..19db1c3ef 100644 --- a/demos/interpreter/acorn_interpreter.js +++ b/demos/interpreter/acorn_interpreter.js @@ -38,104 +38,106 @@ Pb=RegExp("[\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02 na=/[\n\r\u2028\u2029]/,Y=/\r\n|[\n\r\u2028\u2029]/g,la=a.isIdentifierStart=function(a){return 65>a?36===a:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Za.test(String.fromCharCode(a))},ab=a.isIdentifierChar=function(a){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Pb.test(String.fromCharCode(a))},ca,Ia={kind:"loop"},Ob={kind:"switch"}}; "object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={})); // JS-Interpreter: Copyright 2013 Google LLC, Apache 2.0 -function u(a,b){"string"===typeof a&&(a=acorn.parse(a,ha));this.ha=a;this.ib=b;this.ya=!1;this.V=[];this.Da=0;this.nb=Object.create(null);var c=/^step([A-Z]\w*)$/,d,e;for(e in this)"function"===typeof this[e]&&(d=e.match(c))&&(this.nb[d[1]]=this[e].bind(this));this.global=ia(this,this.ha,null);this.ha=acorn.parse(this.V.join("\n"),ha);this.V=void 0;ra(this,this.ha,void 0,void 0);c=new y(this.ha,this.global);c.done=!1;this.j=[c];this.lb();this.value=void 0;this.ha=a;c=new y(this.ha,this.global);c.done= -!1;this.j.length=0;this.j[0]=c;this.Ra=c.node.constructor;this.stateStack=this.j} -var ha={Ca:5},sa={configurable:!0,enumerable:!0,writable:!1},A={configurable:!0,enumerable:!1,writable:!0},E={configurable:!0,enumerable:!1,writable:!1},za={configurable:!1,enumerable:!0,writable:!0},Aa={STEP_ERROR:!0},Ba={SCOPE_REFERENCE:!0},Ha={VALUE_IN_DESCRIPTOR:!0},Ia={REGEXP_TIMEOUT:!0},Ja=[],Ka=null,La=["onmessage = function(e) {","var result;","var data = e.data;","switch (data[0]) {","case 'split':","result = data[1].split(data[2], data[3]);","break;","case 'match':","result = data[1].match(data[2]);", -"break;","case 'search':","result = data[1].search(data[2]);","break;","case 'replace':","result = data[1].replace(data[2], data[3]);","break;","case 'exec':","var regexp = data[1];","regexp.lastIndex = data[2];","result = [regexp.exec(data[3]), data[1].lastIndex];","break;","default:","throw 'Unknown RegExp operation: ' + data[0];","}","postMessage(result);","};"];u.prototype.REGEXP_MODE=2;u.prototype.REGEXP_THREAD_TIMEOUT=1E3; -u.prototype.sb=function(a){var b=this.j[0];if(!b||"Program"!==b.node.type)throw Error("Expecting original AST to start with a Program node.");"string"===typeof a&&(a=acorn.parse(a,ha));if(!a||"Program"!==a.type)throw Error("Expecting new AST to start with a Program node.");Ma(this,a,b.scope);for(var c=0,d;d=a.body[c];c++)b.node.body.push(d);b.done=!1}; -u.prototype.step=function(){var a=this.j,b=a[a.length-1];if(!b)return!1;var c=b.node,d=c.type;if("Program"===d&&b.done)return!1;if(this.ya)return!0;try{var e=this.nb[d](a,b,c)}catch(g){if(g!==Aa)throw g;}e&&a.push(e);return c.end?!0:this.step()};u.prototype.lb=function(){for(;!this.ya&&this.step(););return this.ya}; -function Na(a,b){a.setProperty(b,"NaN",NaN,sa);a.setProperty(b,"Infinity",Infinity,sa);a.setProperty(b,"undefined",void 0,sa);a.setProperty(b,"window",b,sa);a.setProperty(b,"this",b,sa);a.setProperty(b,"self",b);a.G=new Oa(null);a.I=new Oa(a.G);Pa(a,b);cb(a,b);b.oa=a.G;a.setProperty(b,"constructor",a.m,A);db(a,b);Eb(a,b);Fb(a,b);Gb(a,b);Hb(a,b);Ib(a,b);Jb(a,b);Kb(a,b);Lb(a,b);var c=a.b(function(){throw EvalError("Can't happen");},!1);c.eval=!0;a.setProperty(b,"eval",c);a.setProperty(b,"parseInt", -a.b(parseInt,!1));a.setProperty(b,"parseFloat",a.b(parseFloat,!1));a.setProperty(b,"isNaN",a.b(isNaN,!1));a.setProperty(b,"isFinite",a.b(isFinite,!1));c=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]];for(var d=0;d>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;", -"}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}", -"});","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'map',","{configurable: true, writable: true, value:","function(callback, thisArg) {", -"if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();", -"var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {", -"if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',", -"{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;","Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {", -"return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {", -"out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")} -function Eb(a,b){var c=function(e){e=String(e);return vc(a)?(this.data=e,this):e};a.A=a.b(c,!0);a.setProperty(b,"String",a.A);a.setProperty(a.A,"fromCharCode",a.b(String.fromCharCode,!1),A);c="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" ");for(var d=0;d>>0;return b===Number(a)?b:NaN}function Oa(a){var b=a>>>0;return String(b)===String(a)&&4294967295!==b?b:NaN} +function ra(a,b,c){b?a.start=b:delete a.start;c?a.end=c:delete a.end;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];e&&"object"===typeof e&&ra(e,b,c)}}u.prototype.REGEXP_MODE=2;u.prototype.REGEXP_THREAD_TIMEOUT=1E3;q=u.prototype;q.I=!1;q.ya=!1; +q.ub=function(a){var b=this.j[0];if(!b||"Program"!==b.node.type)throw Error("Expecting original AST to start with a Program node.");"string"===typeof a&&(a=acorn.parse(a,ha));if(!a||"Program"!==a.type)throw Error("Expecting new AST to start with a Program node.");Pa(this,a,b.scope);Array.prototype.push.apply(b.node.body,a.body);b.done=!1}; +q.step=function(){var a=this.j;do{var b=a[a.length-1];if(!b)return!1;var c=b.node,d=c.type;if("Program"===d&&b.done)return!1;if(this.wa)break;try{var e=this.pb[d](a,b,c)}catch(g){if(g!==Aa)throw g;}e&&a.push(e);if(this.I)throw Error("Getter not supported in this context");if(this.ya)throw Error("Setter not supported in this context");}while(!c.end);return!0};q.nb=function(){for(;!this.wa&&this.step(););return this.wa}; +function Qa(a,b){a.setProperty(b,"NaN",NaN,ya);a.setProperty(b,"Infinity",Infinity,ya);a.setProperty(b,"undefined",void 0,ya);a.setProperty(b,"window",b,ya);a.setProperty(b,"this",b,ya);a.setProperty(b,"self",b);a.B=new F(null);a.W=new F(a.B);db(a,b);eb(a,b);b.la=a.B;a.setProperty(b,"constructor",a.m,B);Fb(a,b);Gb(a,b);Hb(a,b);Ib(a,b);Jb(a,b);Kb(a,b);Lb(a,b);Mb(a,b);Nb(a,b);var c=a.b(function(){throw EvalError("Can't happen");},!1);c.eval=!0;a.setProperty(b,"eval",c);a.setProperty(b,"parseInt",a.b(parseInt, +!1));a.setProperty(b,"parseFloat",a.b(parseFloat,!1));a.setProperty(b,"isNaN",a.b(isNaN,!1));a.setProperty(b,"isFinite",a.b(isFinite,!1));c=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]];for(var d=0;d>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;", +"while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {", +"var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'map',", +"{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {", +"if (!this || typeof callback !== 'function') throw TypeError();","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',", +"{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);", +"}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;", +"Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {","return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:", +"function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")} +function Gb(a,b){var c=function(e){e=arguments.length?String(e):"";return zc(a)?(this.data=e,this):e};a.w=a.b(c,!0);a.setProperty(b,"String",a.w);a.setProperty(a.w,"fromCharCode",a.b(String.fromCharCode,!1),B);c="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" ");for(var d=0;d= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);", -"}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","")}function Fb(a,b){a.Wa=a.b(function(c){c=!!c;return vc(a)?(this.data=c,this):c},!0);a.setProperty(b,"Boolean",a.Wa)} -function Gb(a,b){var c=function(e){e=Number(e);return vc(a)?(this.data=e,this):e};a.T=a.b(c,!0);a.setProperty(b,"Number",a.T);c=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"];for(var d=0;d>>0;return b===Number(a)?b:NaN}function Tc(a){var b=a>>>0;return String(b)===String(a)&&4294967295!==b?b:NaN}function Oa(a){this.O=Object.create(null);this.R=Object.create(null);this.a=Object.create(null);this.oa=a}p=Oa.prototype;p.oa=null;p.o=!0;p.K="Object";p.data=null; -p.toString=function(){if("Array"===this.K){var a=Ja;a.push(this);try{for(var b=[],c=0;cb.charCodeAt(0)&&T(this,a,this.A)){var c=Tc(b);if(!isNaN(c)&&c>=":d>>=e;break;case ">>>=":d>>>=e;break;case "&=":d&=e;break;case "^=":d^=e;break;case "|=":d|=e;break;default:throw SyntaxError("Unknown assignment expression: "+c.operator);}if(c=Zc(this,b.ua,d))return b.ka=!0,b.Ua=d,bd(this,c,b.ua,d);a.pop();a[a.length-1].value=d}}; -u.prototype.stepBinaryExpression=function(a,b,c){if(!b.Y)return b.Y=!0,new y(c.left,b.scope);if(!b.sa)return b.sa=!0,b.$=b.value,new y(c.right,b.scope);a.pop();var d=b.$;b=b.value;switch(c.operator){case "==":c=d==b;break;case "!=":c=d!=b;break;case "===":c=d===b;break;case "!==":c=d!==b;break;case ">":c=d>b;break;case ">=":c=d>=b;break;case "<":c=d>":c=d>>b;break;case ">>>":c=d>>>b;break;case "in":b&&b.o||J(this,this.h,"'in' expects an object, not '"+b+"'");c=xc(this,b,d);break;case "instanceof":T(this,b,this.C)||J(this,this.h,"Right-hand side of instanceof is not an object");c=d.o?T(this,d,b):!1;break;default:throw SyntaxError("Unknown binary operator: "+c.operator);}a[a.length-1].value=c}; -u.prototype.stepBlockStatement=function(a,b,c){var d=b.s||0;if(c=c.body[d])return b.s=d+1,new y(c,b.scope);a.pop()};u.prototype.stepBreakStatement=function(a,b,c){$c(this,1,void 0,c.label&&c.label.name)}; -u.prototype.stepCallExpression=function(a,b,c){if(!b.ja){b.ja=1;var d=new y(c.callee,b.scope);d.ia=!0;return d}if(1===b.ja){b.ja=2;d=b.value;if(Array.isArray(d)){if(b.Z=Yc(this,d),d[0]===Ba?b.wb="eval"===d[1]:b.J=d[0],(d=b.Z)&&"object"===typeof d&&d.L)return d.L=!1,b.ja=1,ad(this,d,b.value)}else b.Z=d;b.B=[];b.s=0}d=b.Z;if(!b.Oa){0!==b.s&&b.B.push(b.value);if(c.arguments[b.s])return new y(c.arguments[b.s++],b.scope);if("NewExpression"===c.type){d.Fb&&J(this,this.h,d+" is not a constructor");var e= -d.a.prototype;if("object"!==typeof e||null===e)e=this.G;b.J=this.g(e);b.isConstructor=!0}else void 0===b.J&&(b.J=b.scope.H?void 0:this.global);b.Oa=!0}if(b.Pa)a.pop(),a[a.length-1].value=b.isConstructor&&"object"!==typeof b.value?b.J:b.value;else{b.Pa=!0;d&&d.o||J(this,this.h,d+" is not a function");if(a=d.node){c=ia(this,a.body,d.ca);for(var g=0;gg?b.B[g]:void 0);e=this.g(this.ea);for(g=0;gb.charCodeAt(0)&&U(this,a,this.w)){var c=Oa(b);if(!isNaN(c)&&c>=":d>>=e;break;case ">>>=":d>>>=e;break;case "&=":d&=e;break;case "^=":d^=e;break;case "|=":d|=e;break;default:throw SyntaxError("Unknown assignment expression: "+c.operator);}if(c=cd(this,b.ra,d))return b.ia=!0,b.Wa=d,fd(this,c,b.ra,d);a.pop();a[a.length-1].value=d}}; +u.prototype.stepBinaryExpression=function(a,b,c){if(!b.Y)return b.Y=!0,new v(c.left,b.scope);if(!b.pa)return b.pa=!0,b.$=b.value,new v(c.right,b.scope);a.pop();var d=b.$;b=b.value;switch(c.operator){case "==":c=d==b;break;case "!=":c=d!=b;break;case "===":c=d===b;break;case "!==":c=d!==b;break;case ">":c=d>b;break;case ">=":c=d>=b;break;case "<":c=d>":c=d>>b;break;case ">>>":c=d>>>b;break;case "in":b instanceof F||I(this,this.g,"'in' expects an object, not '"+b+"'");c=Bc(this,b,d);break;case "instanceof":U(this,b,this.H)||I(this,this.g,"Right-hand side of instanceof is not an object");c=d instanceof F?U(this,d,b):!1;break;default:throw SyntaxError("Unknown binary operator: "+c.operator);}a[a.length-1].value=c}; +u.prototype.stepBlockStatement=function(a,b,c){var d=b.o||0;if(c=c.body[d])return b.o=d+1,new v(c,b.scope);a.pop()};u.prototype.stepBreakStatement=function(a,b,c){dd(this,1,void 0,c.label&&c.label.name)}; +u.prototype.stepCallExpression=function(a,b,c){if(!b.ha){b.ha=1;var d=new v(c.callee,b.scope);d.ga=!0;return d}if(1===b.ha){b.ha=2;d=b.value;if(Array.isArray(d)){if(b.Z=bd(this,d),d[0]===Ba?b.yb="eval"===d[1]:b.G=d[0],d=b.Z,this.I)return b.ha=1,ed(this,d,b.value)}else b.Z=d;b.A=[];b.o=0}d=b.Z;if(!b.Qa){0!==b.o&&b.A.push(b.value);if(c.arguments[b.o])return new v(c.arguments[b.o++],b.scope);if("NewExpression"===c.type){d.Hb&&I(this,this.g,d+" is not a constructor");if(d===this.l)b.G=Ac(this);else{var e= +d.a.prototype;if("object"!==typeof e||null===e)e=this.B;b.G=this.h(e)}b.isConstructor=!0}else void 0===b.G&&(b.G=b.scope.P?void 0:this.Da);b.Qa=!0}if(b.Ra)a.pop(),a[a.length-1].value=b.isConstructor&&"object"!==typeof b.value?b.G:b.value;else{b.Ra=!0;d instanceof F||I(this,this.g,d+" is not a function");if(a=d.node){c=ia(this,a.body,d.va);for(var g=0;gg?b.A[g]:void 0);e=Ac(this);for(g=0;g -Redirecting to step execution jsinterpreter demo. +Redirecting to step execution JS-Interpreter demo. diff --git a/demos/interpreter/step-execution.html b/demos/interpreter/step-execution.html index f3f411947..03e62aed6 100644 --- a/demos/interpreter/step-execution.html +++ b/demos/interpreter/step-execution.html @@ -149,9 +149,9 @@ var stepButton = document.getElementById('stepButton'); var myInterpreter = null; - function initApi(interpreter, scope) { + function initApi(interpreter, globalObject) { // Add an API function for the alert() block, generated for "text_print" blocks. - interpreter.setProperty(scope, 'alert', + interpreter.setProperty(globalObject, 'alert', interpreter.createNativeFunction(function(text) { text = arguments.length ? text : ''; outputArea.value += '\n' + text; @@ -161,7 +161,7 @@ var wrapper = function(text) { return interpreter.createPrimitive(prompt(text)); }; - interpreter.setProperty(scope, 'prompt', + interpreter.setProperty(globalObject, 'prompt', interpreter.createNativeFunction(wrapper)); // Add an API function for highlighting blocks. @@ -169,7 +169,7 @@ id = String(id || ''); return interpreter.createPrimitive(highlightBlock(id)); }; - interpreter.setProperty(scope, 'highlightBlock', + interpreter.setProperty(globalObject, 'highlightBlock', interpreter.createNativeFunction(wrapper)); } diff --git a/demos/interpreter/wait_block.js b/demos/interpreter/wait_block.js index e355925c1..10a57b482 100644 --- a/demos/interpreter/wait_block.js +++ b/demos/interpreter/wait_block.js @@ -40,7 +40,7 @@ Blockly.JavaScript['wait_seconds'] = function(block) { * Register the interpreter asynchronous function * waitForSeconds(). */ -function initInterpreterWaitForSeconds(interpreter, scope) { +function initInterpreterWaitForSeconds(interpreter, globalObject) { // Ensure function name does not conflict with variable names. Blockly.JavaScript.addReservedWords('waitForSeconds'); @@ -49,5 +49,5 @@ function initInterpreterWaitForSeconds(interpreter, scope) { // Delay the call to the callback. setTimeout(callback, timeInSeconds * 1000); }); - interpreter.setProperty(scope, 'waitForSeconds', wrapper); -} \ No newline at end of file + interpreter.setProperty(globalObject, 'waitForSeconds', wrapper); +} From 5445cf4cf823a8dbbcae5f356776733ae5e6193e Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 19 Feb 2020 14:40:28 -0800 Subject: [PATCH 048/105] Add comments to break block change listener. --- blocks/loops.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blocks/loops.js b/blocks/loops.js index 0163350d5..d6fb2f2f6 100644 --- a/blocks/loops.js +++ b/blocks/loops.js @@ -331,9 +331,13 @@ Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = { * @this {Blockly.Block} */ onchange: function(e) { + // Don't change state if: + // * It's at the start of a drag. + // * It's not a move event. + // * Or the moving block is not this block. if (!this.workspace.isDragging || this.workspace.isDragging() || e.type != Blockly.Events.BLOCK_MOVE || e.blockId != this.id) { - return; // Don't change state at the start of a drag. + return; } var enabled = Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN .getSurroundLoop(this); @@ -341,6 +345,7 @@ Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = { Blockly.Msg['CONTROLS_FLOW_STATEMENTS_WARNING']); if (!this.isInFlyout) { var group = Blockly.Events.getGroup(); + // Makes it so the move and the disable event get undone together. Blockly.Events.setGroup(e.group); this.setEnabled(enabled); Blockly.Events.setGroup(group); From 9c4c58246ea710335812d7d486556b28741b64f4 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 20 Feb 2020 15:56:50 +0100 Subject: [PATCH 049/105] Localisation updates from https://translatewiki.net. --- msg/json/kn.json | 7 ++++--- msg/json/pl.json | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/msg/json/kn.json b/msg/json/kn.json index 2be5097a2..f1b46a905 100644 --- a/msg/json/kn.json +++ b/msg/json/kn.json @@ -4,11 +4,12 @@ "Ananth subray", "Nayvik", "Niekiran", - "VASANTH S.N." + "VASANTH S.N.", + "Anoop rao" ] }, "VARIABLES_DEFAULT_NAME": "ವಸ್ತು", - "UNNAMED_KEY": "ಹೆಸರಿಸದ", + "UNNAMED_KEY": "ಹೆಸರಿಡದ", "TODAY": "ಇಂದು", "DUPLICATE_BLOCK": "ನಕಲಿಸು", "ADD_COMMENT": "ಟಿಪ್ಪಣಿ ಸೇರಿಸು", @@ -96,7 +97,7 @@ "IOS_VARIABLES_RENAME_BUTTON": "ಹೆಸರು ಬದಲಾಯಿಸು", "IOS_VARIABLES_DELETE_BUTTON": "ಅಳಿಸು", "IOS_VARIABLES_VARIABLE_NAME": "ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರು", - "IOS_VARIABLES_EMPTY_NAME_ERROR": "ನೀವು ಖಾಲಿ ಇರುವ ಮಾರ್ಪಡಿಸಬಹುದಾದ ಮೂಲಾಂಶದ ಹೆಸರನ್ನು ಬಳಸಲು ಬರುವುದಿಲ್ಲ.", + "IOS_VARIABLES_EMPTY_NAME_ERROR": "ನೀವು ಖಾಲಿ ಮೂಲಾಂಶದ ಹೆಸರನ್ನು ಬಳಸಲಾಗುವುದಿಲ್ಲ.", "LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)", "LOGIC_OPERATION_AND": "ಮತ್ತು", "LOGIC_OPERATION_OR": "ಅಥವಾ", diff --git a/msg/json/pl.json b/msg/json/pl.json index 9791bfa93..34d93bb82 100644 --- a/msg/json/pl.json +++ b/msg/json/pl.json @@ -20,7 +20,8 @@ "InternerowyGołąb", "Wojtas", "Stojex", - "Rail" + "Rail", + "Krzyz23" ] }, "VARIABLES_DEFAULT_NAME": "element", @@ -221,6 +222,7 @@ "MATH_RANDOM_FLOAT_HELPURL": "https://en.wikipedia.org/wiki/Random_number_generation", "MATH_RANDOM_FLOAT_TITLE_RANDOM": "losowy ułamek", "MATH_RANDOM_FLOAT_TOOLTIP": "Zwróć losowy ułamek między 0.0 (włącznie), a 1.0 (wyłącznie).", + "MATH_ATAN2_HELPURL": "https://en.wikipedia.org/wiki/Atan2", "TEXT_TEXT_HELPURL": "https://pl.wikipedia.org/wiki/Tekstowy_typ_danych", "TEXT_TEXT_TOOLTIP": "Litera, wyraz lub linia tekstu.", "TEXT_JOIN_TITLE_CREATEWITH": "utwórz tekst z", From 8524da903b1a7fde8e6b824531ab07ff16d29003 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 20 Feb 2020 15:03:24 -0800 Subject: [PATCH 050/105] Support renderers that are ES6 classes (#3702) --- core/renderers/common/block_rendering.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/core/renderers/common/block_rendering.js b/core/renderers/common/block_rendering.js index e94d7d426..d92218196 100644 --- a/core/renderers/common/block_rendering.js +++ b/core/renderers/common/block_rendering.js @@ -87,19 +87,8 @@ Blockly.blockRendering.init = function(name) { if (!Blockly.blockRendering.rendererMap_[name]) { throw Error('Renderer not registered: ', name); } - /** - * Wrap the renderer constructor into a temporary constructor - * function so the closure compiler treats it as a constructor. - * @param {string} name The renderer name. - * @constructor - * @extends {Blockly.blockRendering.Renderer} - */ - var rendererCtor = function(name) { - rendererCtor.superClass_.constructor.call(this, name); - }; - Blockly.utils.object.inherits(rendererCtor, - Blockly.blockRendering.rendererMap_[name]); - var renderer = new rendererCtor(name); + var renderer = (/** @type {!Blockly.blockRendering.Renderer} */ ( + new Blockly.blockRendering.rendererMap_[name](name))); renderer.init(); return renderer; }; From eb40ca44baca051db8c937b03d5f8a208ff938b4 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 20 Feb 2020 17:16:01 -0800 Subject: [PATCH 051/105] Dynamic fonts (#3698) * Piping themes into the renderer and ensuring fields update their size information when constants change. --- core/field.js | 91 ++++++++---- core/field_checkbox.js | 36 ++--- core/field_dropdown.js | 38 ++--- core/field_image.js | 7 + core/field_multilineinput.js | 51 +++---- core/flyout_base.js | 2 + core/flyout_button.js | 27 +++- core/renderers/common/block_rendering.js | 5 +- core/renderers/common/constants.js | 153 +++++++++++++++----- core/renderers/common/debugger.js | 28 +++- core/renderers/common/renderer.js | 20 ++- core/renderers/geras/highlight_constants.js | 8 + core/renderers/geras/renderer.js | 13 +- core/renderers/zelos/constants.js | 81 ++++------- core/theme.js | 42 ++++-- core/theme/highcontrast.js | 6 + core/theme_manager.js | 4 + core/utils/dom.js | 58 +++++++- core/workspace_svg.js | 20 ++- tests/mocha/field_checkbox_test.js | 4 + tests/playground.html | 25 ++++ 21 files changed, 495 insertions(+), 224 deletions(-) diff --git a/core/field.js b/core/field.js index 32c239275..c51ec65e8 100644 --- a/core/field.js +++ b/core/field.js @@ -310,10 +310,6 @@ Blockly.Field.prototype.initModel = function() { * @protected */ Blockly.Field.prototype.createBorderRect_ = function() { - this.size_.height = - Math.max(this.size_.height, this.constants_.FIELD_BORDER_RECT_HEIGHT); - this.size_.width = - Math.max(this.size_.width, this.constants_.FIELD_BORDER_RECT_X_PADDING * 2); this.borderRect_ = /** @type {!SVGRectElement} **/ (Blockly.utils.dom.createSvgElement('rect', { @@ -334,24 +330,12 @@ Blockly.Field.prototype.createBorderRect_ = function() { * @protected */ Blockly.Field.prototype.createTextElement_ = function() { - var xOffset = this.borderRect_ ? - this.constants_.FIELD_BORDER_RECT_X_PADDING : 0; - var baselineCenter = this.constants_.FIELD_TEXT_BASELINE_CENTER; - var baselineY = this.constants_.FIELD_TEXT_BASELINE_Y; - this.size_.height = Math.max(this.size_.height, baselineCenter ? - this.constants_.FIELD_TEXT_HEIGHT : baselineY); - if (this.size_.height > this.constants_.FIELD_TEXT_HEIGHT) { - baselineY += (this.size_.height - baselineY) / 2; - } this.textElement_ = /** @type {!SVGTextElement} **/ (Blockly.utils.dom.createSvgElement('text', { 'class': 'blocklyText', - 'y': baselineCenter ? this.size_.height / 2 : baselineY, - 'dy': this.constants_.FIELD_TEXT_Y_OFFSET, - 'x': xOffset }, this.fieldGroup_)); - if (baselineCenter) { + if (this.constants_.FIELD_TEXT_BASELINE_CENTER) { this.textElement_.setAttribute('dominant-baseline', 'central'); } this.textContent_ = document.createTextNode(''); @@ -587,8 +571,8 @@ Blockly.Field.prototype.applyColour = function() { Blockly.Field.prototype.render_ = function() { if (this.textContent_) { this.textContent_.nodeValue = this.getDisplayText_(); - this.updateSize_(); } + this.updateSize_(); }; /** @@ -619,22 +603,73 @@ Blockly.Field.prototype.updateWidth = function() { /** * Updates the size of the field based on the text. + * @param {number=} opt_margin margin to use when positioning the text element. * @protected */ -Blockly.Field.prototype.updateSize_ = function() { - var textWidth = Blockly.utils.dom.getFastTextWidth( - /** @type {!SVGTextElement} */ (this.textElement_), - this.constants_.FIELD_TEXT_FONTSIZE, - this.constants_.FIELD_TEXT_FONTWEIGHT, - this.constants_.FIELD_TEXT_FONTFAMILY); - var totalWidth = textWidth; - if (this.borderRect_) { - totalWidth += this.constants_.FIELD_BORDER_RECT_X_PADDING * 2; - this.borderRect_.setAttribute('width', totalWidth); +Blockly.Field.prototype.updateSize_ = function(opt_margin) { + var constants = this.constants_; + var xOffset = opt_margin != undefined ? opt_margin : + (this.borderRect_ ? this.constants_.FIELD_BORDER_RECT_X_PADDING : 0); + var totalWidth = xOffset * 2; + var totalHeight = constants.FIELD_TEXT_HEIGHT; + + var contentWidth = 0; + if (this.textElement_) { + contentWidth = Blockly.utils.dom.getFastTextWidth(this.textElement_, + constants.FIELD_TEXT_FONTSIZE, + constants.FIELD_TEXT_FONTWEIGHT, + constants.FIELD_TEXT_FONTFAMILY); + totalWidth += contentWidth; } + if (this.borderRect_) { + totalHeight = Math.max(totalHeight, constants.FIELD_BORDER_RECT_HEIGHT); + } + + this.size_.height = totalHeight; this.size_.width = totalWidth; + + this.positionTextElement_(xOffset, contentWidth); + this.positionBorderRect_(); }; +/** + * Position a field's text element after a size change. This handles both LTR + * and RTL positioning. + * @param {number} xOffset x offset to use when positioning the text element. + * @param {number} contentWidth The content width. + * @protected + */ +Blockly.Field.prototype.positionTextElement_ = function(xOffset, contentWidth) { + if (!this.textElement_) { + return; + } + var constants = this.constants_; + var halfHeight = this.size_.height / 2; + + this.textElement_.setAttribute('x', this.sourceBlock_.RTL ? + this.size_.width - contentWidth - xOffset : xOffset); + this.textElement_.setAttribute('y', constants.FIELD_TEXT_BASELINE_CENTER ? + halfHeight : halfHeight - constants.FIELD_TEXT_HEIGHT / 2 + + constants.FIELD_TEXT_BASELINE); +}; + +/** + * Position a field's border rect after a size change. + * @protected + */ +Blockly.Field.prototype.positionBorderRect_ = function() { + if (!this.borderRect_) { + return; + } + this.borderRect_.setAttribute('width', this.size_.width); + this.borderRect_.setAttribute('height', this.size_.height); + this.borderRect_.setAttribute('rx', + this.constants_.FIELD_BORDER_RECT_RADIUS); + this.borderRect_.setAttribute('ry', + this.constants_.FIELD_BORDER_RECT_RADIUS); +}; + + /** * Returns the height and width of the field. * diff --git a/core/field_checkbox.js b/core/field_checkbox.js index c770c0e47..be599c7d8 100644 --- a/core/field_checkbox.js +++ b/core/field_checkbox.js @@ -82,15 +82,6 @@ Blockly.FieldCheckbox.prototype.SERIALIZABLE = true; */ Blockly.FieldCheckbox.prototype.CURSOR = 'default'; -/** - * Used to tell if the field needs to be rendered the next time the block is - * rendered. Checkbox fields are statically sized, and only need to be - * rendered at initialization. - * @type {boolean} - * @protected - */ -Blockly.FieldCheckbox.prototype.isDirty_ = false; - /** * Configure the field based on the given map of options. * @param {!Object} config A map of options to configure the field based on. @@ -108,19 +99,30 @@ Blockly.FieldCheckbox.prototype.configure_ = function(config) { * @package */ Blockly.FieldCheckbox.prototype.initView = function() { - this.size_.width = this.constants_.FIELD_CHECKBOX_DEFAULT_WIDTH; Blockly.FieldCheckbox.superClass_.initView.call(this); - this.textElement_.setAttribute('x', this.constants_.FIELD_CHECKBOX_X_OFFSET); - this.textElement_.setAttribute('y', this.constants_.FIELD_CHECKBOX_Y_OFFSET); - this.textElement_.removeAttribute('dominant-baseline'); - Blockly.utils.dom.addClass(this.textElement_, 'blocklyCheckbox'); - - this.textContent_.nodeValue = - this.checkChar_ || Blockly.FieldCheckbox.CHECK_CHAR; + Blockly.utils.dom.addClass( + /** @type {!SVGTextElement} **/ (this.textElement_), 'blocklyCheckbox'); this.textElement_.style.display = this.value_ ? 'block' : 'none'; }; +/** + * @override + */ +Blockly.FieldCheckbox.prototype.render_ = function() { + if (this.textContent_) { + this.textContent_.nodeValue = this.getDisplayText_(); + } + this.updateSize_(this.constants_.FIELD_CHECKBOX_X_OFFSET); +}; + +/** + * @override + */ +Blockly.FieldCheckbox.prototype.getDisplayText_ = function() { + return this.checkChar_ || Blockly.FieldCheckbox.CHECK_CHAR; +}; + /** * Set the character used for the check mark. * @param {?string} character The character to use for the check mark, or diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 00b8a06a4..b50340d60 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -564,10 +564,8 @@ Blockly.FieldDropdown.prototype.render_ = function() { } else { this.renderSelectedText_(); } - if (this.borderRect_) { - this.borderRect_.setAttribute('height', this.size_.height); - this.borderRect_.setAttribute('width', this.size_.width); - } + + this.positionBorderRect_(); }; /** @@ -588,14 +586,13 @@ Blockly.FieldDropdown.prototype.renderSelectedImage_ = function(imageJson) { // Height and width include the border rect. var hasBorder = !!this.borderRect_; - this.size_.height = Math.max( + var height = Math.max( hasBorder ? this.constants_.FIELD_DROPDOWN_BORDER_RECT_HEIGHT : 0, imageHeight + Blockly.FieldDropdown.IMAGE_Y_PADDING); - var halfHeight = this.size_.height / 2; var xPadding = hasBorder ? this.constants_.FIELD_BORDER_RECT_X_PADDING : 0; var arrowWidth = 0; if (this.svgArrow_) { - arrowWidth = this.positionSVGArrow_(imageWidth + xPadding, halfHeight - + arrowWidth = this.positionSVGArrow_(imageWidth + xPadding, height / 2 - this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE / 2); } else { arrowWidth = Blockly.utils.dom.getFastTextWidth( @@ -605,19 +602,20 @@ Blockly.FieldDropdown.prototype.renderSelectedImage_ = function(imageJson) { this.constants_.FIELD_TEXT_FONTFAMILY); } this.size_.width = imageWidth + arrowWidth + xPadding * 2; + this.size_.height = height; + var arrowX = 0; if (this.sourceBlock_.RTL) { var imageX = xPadding + arrowWidth; - var arrowX = xPadding - 1; this.imageElement_.setAttribute('x', imageX); - this.textElement_.setAttribute('x', arrowX); } else { - var arrowX = imageWidth + arrowWidth + xPadding + 1; + arrowX = imageWidth + arrowWidth; this.textElement_.setAttribute('text-anchor', 'end'); - this.textElement_.setAttribute('x', arrowX); this.imageElement_.setAttribute('x', xPadding); } - this.imageElement_.setAttribute('y', halfHeight - imageHeight / 2); + this.imageElement_.setAttribute('y', height / 2 - imageHeight / 2); + + this.positionTextElement_(arrowX + xPadding, imageWidth + arrowWidth); }; /** @@ -633,10 +631,9 @@ Blockly.FieldDropdown.prototype.renderSelectedText_ = function() { // Height and width include the border rect. var hasBorder = !!this.borderRect_; - this.size_.height = Math.max( + var height = Math.max( hasBorder ? this.constants_.FIELD_DROPDOWN_BORDER_RECT_HEIGHT : 0, this.constants_.FIELD_TEXT_HEIGHT); - var halfHeight = this.size_.height / 2; var textWidth = Blockly.utils.dom.getFastTextWidth(this.textElement_, this.constants_.FIELD_TEXT_FONTSIZE, this.constants_.FIELD_TEXT_FONTWEIGHT, @@ -644,20 +641,13 @@ Blockly.FieldDropdown.prototype.renderSelectedText_ = function() { var xPadding = hasBorder ? this.constants_.FIELD_BORDER_RECT_X_PADDING : 0; var arrowWidth = 0; if (this.svgArrow_) { - arrowWidth = this.positionSVGArrow_(textWidth + xPadding, halfHeight - + arrowWidth = this.positionSVGArrow_(textWidth + xPadding, height / 2 - this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE / 2); } this.size_.width = textWidth + arrowWidth + xPadding * 2; + this.size_.height = height; - this.textElement_.setAttribute('x', this.sourceBlock_.RTL ? - this.size_.width - textWidth - xPadding : xPadding); - this.textElement_.setAttribute('y', halfHeight); - if (!this.constants_.FIELD_TEXT_BASELINE_CENTER) { - this.textElement_.setAttribute('dy', - this.constants_.FIELD_TEXT_BASELINE_Y - - this.constants_.FIELD_TEXT_HEIGHT / 2 + - this.constants_.FIELD_TEXT_Y_OFFSET); - } + this.positionTextElement_(xPadding, textWidth); }; /** diff --git a/core/field_image.js b/core/field_image.js index 7b8215103..32af8adca 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -186,6 +186,13 @@ Blockly.FieldImage.prototype.initView = function() { } }; +/** + * @override + */ +Blockly.FieldImage.prototype.updateSize_ = function() { + // NOP +}; + /** * Ensure that the input value (the source URL) is a string. * @param {*=} opt_newValue The input value. diff --git a/core/field_multilineinput.js b/core/field_multilineinput.js index 0b641e6ea..5cb9b8e2b 100644 --- a/core/field_multilineinput.js +++ b/core/field_multilineinput.js @@ -60,13 +60,6 @@ Blockly.utils.object.inherits(Blockly.FieldMultilineInput, Blockly.FieldTextInput); -/** - * The default height of a single line of text. - * @type {number} - * @const - */ -Blockly.FieldMultilineInput.LINE_HEIGHT = 20; - /** * Construct a FieldMultilineInput from a JSON arg object, * dereferencing any string table references. @@ -143,14 +136,16 @@ Blockly.FieldMultilineInput.prototype.render_ = function() { var lines = this.getDisplayText_().split('\n'); var y = 0; for (var i = 0; i < lines.length; i++) { + var lineHeight = this.constants_.FIELD_TEXT_HEIGHT + + this.constants_.FIELD_BORDER_RECT_Y_PADDING; var span = Blockly.utils.dom.createSvgElement('text', { 'class': 'blocklyText blocklyMultilineText', x: this.constants_.FIELD_BORDER_RECT_X_PADDING, y: y + this.constants_.FIELD_BORDER_RECT_Y_PADDING, - dy: Blockly.FieldMultilineInput.LINE_HEIGHT / 2 + dy: this.constants_.FIELD_TEXT_BASELINE }, this.textGroup_); span.appendChild(document.createTextNode(lines[i])); - y += Blockly.FieldMultilineInput.LINE_HEIGHT; + y += lineHeight; } this.updateSize_(); @@ -191,34 +186,19 @@ Blockly.FieldMultilineInput.prototype.updateSize_ = function() { if (textWidth > totalWidth) { totalWidth = textWidth; } - totalHeight += Blockly.FieldMultilineInput.LINE_HEIGHT; + totalHeight += this.constants_.FIELD_TEXT_HEIGHT + + (i > 0 ? this.constants_.FIELD_BORDER_RECT_Y_PADDING : 0); } if (this.borderRect_) { + totalHeight += this.constants_.FIELD_BORDER_RECT_Y_PADDING * 2; totalWidth += this.constants_.FIELD_BORDER_RECT_X_PADDING * 2; this.borderRect_.setAttribute('width', totalWidth); this.borderRect_.setAttribute('height', totalHeight); } this.size_.width = totalWidth; this.size_.height = totalHeight; -}; -/** - * Resize the editor to fit the text. - * @protected - */ -Blockly.FieldMultilineInput.prototype.resizeEditor_ = function() { - var div = Blockly.WidgetDiv.DIV; - var bBox = this.getScaledBBox(); - div.style.width = bBox.right - bBox.left + 'px'; - div.style.height = bBox.bottom - bBox.top + 'px'; - - // In RTL mode block fields and LTR input fields the left edge moves, - // whereas the right edge is fixed. Reposition the editor. - var x = this.sourceBlock_.RTL ? bBox.right - div.offsetWidth : bBox.left; - var xy = new Blockly.utils.Coordinate(x, bBox.top); - - div.style.left = xy.x + 'px'; - div.style.top = xy.y + 'px'; + this.positionBorderRect_(); }; /** @@ -230,7 +210,8 @@ Blockly.FieldMultilineInput.prototype.widgetCreate_ = function() { var div = Blockly.WidgetDiv.DIV; var scale = this.workspace_.scale; - var htmlInput = /** @type {HTMLTextAreaElement} */ (document.createElement('textarea')); + var htmlInput = + /** @type {HTMLTextAreaElement} */ (document.createElement('textarea')); htmlInput.className = 'blocklyHtmlInput blocklyHtmlTextAreaInput'; htmlInput.setAttribute('spellcheck', this.spellcheck_); var fontSize = (this.constants_.FIELD_TEXT_FONTSIZE * scale) + 'pt'; @@ -238,11 +219,13 @@ Blockly.FieldMultilineInput.prototype.widgetCreate_ = function() { htmlInput.style.fontSize = fontSize; var borderRadius = (Blockly.FieldTextInput.BORDERRADIUS * scale) + 'px'; htmlInput.style.borderRadius = borderRadius; - var padding = this.constants_.FIELD_BORDER_RECT_X_PADDING * scale; - htmlInput.style.paddingLeft = padding + 'px'; - htmlInput.style.width = 'calc(100% - ' + padding + 'px)'; - htmlInput.style.lineHeight = - (Blockly.FieldMultilineInput.LINE_HEIGHT * scale) + 'px'; + var paddingX = this.constants_.FIELD_BORDER_RECT_X_PADDING * scale; + var paddingY = this.constants_.FIELD_BORDER_RECT_Y_PADDING * scale / 2; + htmlInput.style.padding = paddingY + 'px ' + paddingX + 'px ' + paddingY + + 'px ' + paddingX + 'px'; + var lineHeight = this.constants_.FIELD_TEXT_HEIGHT + + this.constants_.FIELD_BORDER_RECT_Y_PADDING; + htmlInput.style.lineHeight = (lineHeight * scale) + 'px'; div.appendChild(htmlInput); diff --git a/core/flyout_base.js b/core/flyout_base.js index 2fa4207fe..afd197fc8 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -46,6 +46,8 @@ Blockly.Flyout = function(workspaceOptions) { */ this.workspace_ = new Blockly.WorkspaceSvg(workspaceOptions); this.workspace_.isFlyout = true; + // Keep the workspace visibility consistent with the flyout's visibility. + this.workspace_.setVisible(this.isVisible_); /** * Is RTL vs LTR. diff --git a/core/flyout_button.js b/core/flyout_button.js index b5a2a5452..51173c917 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -86,9 +86,14 @@ Blockly.FlyoutButton = function(workspace, targetWorkspace, xml, isLabel) { }; /** - * The margin around the text in the button. + * The horizontal margin around the text in the button. */ -Blockly.FlyoutButton.MARGIN = 5; +Blockly.FlyoutButton.MARGIN_X = 5; + +/** + * The vertical margin around the text in the button. + */ +Blockly.FlyoutButton.MARGIN_Y = 2; /** * The width of the button's rect. @@ -153,11 +158,18 @@ Blockly.FlyoutButton.prototype.createDom = function() { 'flyoutForegroundColour', 'fill'); } - this.width = Blockly.utils.dom.getTextWidth(svgText); - this.height = 20; // Can't compute it :( - + var fontSize = Blockly.utils.style.getComputedStyle(svgText, 'fontSize'); + var fontWeight = Blockly.utils.style.getComputedStyle(svgText, 'fontWeight'); + var fontFamily = Blockly.utils.style.getComputedStyle(svgText, 'fontFamily'); + this.width = Blockly.utils.dom.getFastTextWidthWithSizeString(svgText, + fontSize, fontWeight, fontFamily); + var fontMetrics = Blockly.utils.dom.measureFontMetrics(text, fontSize, + fontWeight, fontFamily); + this.height = fontMetrics.height; + if (!this.isLabel_) { - this.width += 2 * Blockly.FlyoutButton.MARGIN; + this.width += 2 * Blockly.FlyoutButton.MARGIN_X; + this.height += 2 * Blockly.FlyoutButton.MARGIN_Y; shadow.setAttribute('width', this.width); shadow.setAttribute('height', this.height); } @@ -165,7 +177,8 @@ Blockly.FlyoutButton.prototype.createDom = function() { rect.setAttribute('height', this.height); svgText.setAttribute('x', this.width / 2); - svgText.setAttribute('y', this.height - Blockly.FlyoutButton.MARGIN); + svgText.setAttribute('y', this.height / 2 - fontMetrics.height / 2 + + fontMetrics.baseline); this.updateTransform_(); diff --git a/core/renderers/common/block_rendering.js b/core/renderers/common/block_rendering.js index d92218196..5c2a091f0 100644 --- a/core/renderers/common/block_rendering.js +++ b/core/renderers/common/block_rendering.js @@ -79,16 +79,17 @@ Blockly.blockRendering.stopDebugger = function() { /** * Initialize anything needed for rendering (constants, etc). * @param {!string} name Name of the renderer to initialize. + * @param {!Blockly.Theme} theme The workspace theme object. * @return {!Blockly.blockRendering.Renderer} The new instance of a renderer. * Already initialized. * @package */ -Blockly.blockRendering.init = function(name) { +Blockly.blockRendering.init = function(name, theme) { if (!Blockly.blockRendering.rendererMap_[name]) { throw Error('Renderer not registered: ', name); } var renderer = (/** @type {!Blockly.blockRendering.Renderer} */ ( new Blockly.blockRendering.rendererMap_[name](name))); - renderer.init(); + renderer.init(theme); return renderer; }; diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 46e4c66a4..727b601fd 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -26,6 +26,20 @@ goog.require('Blockly.utils.userAgent'); */ Blockly.blockRendering.ConstantProvider = function() { + /** + * A placeholder value for number constants that are dynamically set. + * @type {number} + * @protected + */ + this.DYNAMICALLY_SET_ = -1; + + /** + * A placeholder value for string constants that are dynamically set. + * @type {string} + * @protected + */ + this.DYNAMICALLY_SET_STRING_ = ''; + /** * The size of an empty spacer. * @type {number} @@ -231,28 +245,39 @@ Blockly.blockRendering.ConstantProvider = function() { this.JAGGED_TEETH_WIDTH = 6; /** - * Point size of text. + * Point size of text. This constant is dynamically set in + * ``setFontConstants_`` to the size of the font used by the renderer/theme. * @type {number} */ - this.FIELD_TEXT_FONTSIZE = 11; + this.FIELD_TEXT_FONTSIZE = this.DYNAMICALLY_SET_; /** - * Height of text. + * Height of text. This constant is dynamically set in ``setFontConstants_`` + * to be the height of the text based on the font used. * @type {number} */ - this.FIELD_TEXT_HEIGHT = 16; + this.FIELD_TEXT_HEIGHT = this.DYNAMICALLY_SET_; /** - * Text font weight. - * @type {string} + * Text baseline. This constant is dynamically set in ``setFontConstants_`` + * to be the baseline of the text based on the font used. + * @type {number} */ - this.FIELD_TEXT_FONTWEIGHT = 'normal'; + this.FIELD_TEXT_BASELINE = this.DYNAMICALLY_SET_; /** - * Text font family. + * Text font weight. This constant is dynamically set in + * ``setFontConstants_`` to the weight of the font used by the renderer/theme. * @type {string} */ - this.FIELD_TEXT_FONTFAMILY = 'sans-serif'; + this.FIELD_TEXT_FONTWEIGHT = this.DYNAMICALLY_SET_STRING_; + + /** + * Text font family. This constant is dynamically set in + * ``setFontConstants_`` to the family of the font used by the renderer/theme. + * @type {string} + */ + this.FIELD_TEXT_FONTFAMILY = this.DYNAMICALLY_SET_STRING_; /** * A field's border rect corner radius. @@ -285,19 +310,6 @@ Blockly.blockRendering.ConstantProvider = function() { */ this.FIELD_BORDER_RECT_COLOUR = '#fff'; - /** - * Field text baseline. - * This is only used if `FIELD_TEXT_BASELINE_CENTER` is false. - * @type {number} - */ - this.FIELD_TEXT_BASELINE_Y = Blockly.utils.userAgent.GECKO ? 12 : 13.09; - - /** - * An text offset adjusting the Y position of text after positioning. - * @type {number} - */ - this.FIELD_TEXT_Y_OFFSET = 0; - /** * A field's text element's dominant baseline. * @type {boolean} @@ -392,18 +404,6 @@ Blockly.blockRendering.ConstantProvider = function() { */ this.FIELD_CHECKBOX_X_OFFSET = this.FIELD_BORDER_RECT_X_PADDING - 3; - /** - * A checkbox field's Y offset. - * @type {number} - */ - this.FIELD_CHECKBOX_Y_OFFSET = 14; - - /** - * A checkbox field's default width. - * @type {number} - */ - this.FIELD_CHECKBOX_DEFAULT_WIDTH = 15; - /** * A random identifier used to ensure a unique ID is used for each * filter/pattern for the case of multiple Blockly instances on a page. @@ -440,6 +440,13 @@ Blockly.blockRendering.ConstantProvider = function() { */ this.disabledPattern_ = null; + /** + * The @@ -631,6 +647,15 @@ var spaghettiXml = [

+

+ Rendering:   + + +

  • From b4a448c632edbc221032e38583a5a8b51f39d6e2 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 20 Feb 2020 17:44:29 -0800 Subject: [PATCH 052/105] Update task names in another file --- tests/scripts/check_metadata.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scripts/check_metadata.sh b/tests/scripts/check_metadata.sh index 9b36c4447..243b1f17d 100755 --- a/tests/scripts/check_metadata.sh +++ b/tests/scripts/check_metadata.sh @@ -21,8 +21,8 @@ ANSI_RESET='\033[0m' # Build the compressed files for core and blocks echo "Building files" npm install -gulp build-compressed -gulp build-blocks +gulp buildCompressed +gulp buildBlocks # GZip them for additional size comparisons echo "Zipping the compressed files" From adeed59fed0740dbde053a195d825003010eeaaa Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 20 Feb 2020 17:54:21 -0800 Subject: [PATCH 053/105] Fix package output location --- scripts/gulpfiles/package_tasks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gulpfiles/package_tasks.js b/scripts/gulpfiles/package_tasks.js index 604ce4aba..7ba3b4146 100644 --- a/scripts/gulpfiles/package_tasks.js +++ b/scripts/gulpfiles/package_tasks.js @@ -26,7 +26,7 @@ const upstream_url = "https://github.com/google/blockly.git"; const blocklyRoot = '../../'; // The destination path where all the NPM distribution files will go. -const packageDistribution = blocklyRoot + 'dist'; +const packageDistribution = 'dist'; /** From 56ca1e433017e9e0b08c7eaaa1f23f1e2c215a24 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 21 Feb 2020 12:03:28 -0800 Subject: [PATCH 054/105] [zelos] Fix centered textinputs (#3703) * Fix bug in centering text inputs. Shouldn't add right corner element for output only blocks. --- core/block.js | 13 +++++++++++ core/renderers/zelos/info.js | 29 ++---------------------- core/renderers/zelos/measurables/rows.js | 8 +++---- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/core/block.js b/core/block.js index d0a7d4d8d..029677857 100644 --- a/core/block.js +++ b/core/block.js @@ -170,6 +170,13 @@ Blockly.Block = function(workspace, prototypeName, opt_id) { */ this.hat = undefined; + /** + * A count of statement inputs on the block. + * @type {number} + * @package + */ + this.statementInputCount = 0; + // Copy the type-specific functions and data from the prototype. if (prototypeName) { /** @type {string} */ @@ -1635,6 +1642,9 @@ Blockly.Block.prototype.appendInput_ = function(type, name) { if (type == Blockly.INPUT_VALUE || type == Blockly.NEXT_STATEMENT) { connection = this.makeConnection_(type); } + if (type == Blockly.NEXT_STATEMENT) { + this.statementInputCount++; + } var input = new Blockly.Input(type, name, this, connection); // Append input to list. this.inputList.push(input); @@ -1712,6 +1722,9 @@ Blockly.Block.prototype.moveNumberedInputBefore = function( Blockly.Block.prototype.removeInput = function(name, opt_quiet) { for (var i = 0, input; (input = this.inputList[i]); i++) { if (input.name == name) { + if (input.type == Blockly.NEXT_STATEMENT) { + this.statementInputCount--; + } input.dispose(); this.inputList.splice(i, 1); return; diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index 4aafefe33..cf0ff7aae 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -82,7 +82,7 @@ Blockly.zelos.RenderInfo = function(renderer, block) { * Whether or not the block has a statement input in one of its rows. * @type {boolean} */ - this.hasStatementInput = false; + this.hasStatementInput = block.statementInputCount > 0; /** * An object with rendering information about the right connection shape. @@ -264,32 +264,7 @@ Blockly.zelos.RenderInfo.prototype.addInput_ = function(input, activeRow) { input.align == Blockly.ALIGN_RIGHT) { activeRow.rightAlignedDummyInput = input; } - // Non-dummy inputs have visual representations onscreen. - if (this.isInline && input.type == Blockly.INPUT_VALUE) { - activeRow.elements.push( - new Blockly.blockRendering.InlineInput(this.constants_, input)); - activeRow.hasInlineInput = true; - } else if (input.type == Blockly.NEXT_STATEMENT) { - activeRow.elements.push( - new Blockly.zelos.StatementInput(this.constants_, input)); - activeRow.hasStatement = true; - this.hasStatementInput = true; - } else if (input.type == Blockly.INPUT_VALUE) { - activeRow.elements.push( - new Blockly.blockRendering.ExternalValueInput(this.constants_, input)); - activeRow.hasExternalInput = true; - } else if (input.type == Blockly.DUMMY_INPUT) { - // Dummy inputs have no visual representation, but the information is still - // important. - activeRow.minHeight = Math.max(activeRow.minHeight, - input.getSourceBlock() && input.getSourceBlock().isShadow() ? - this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT : - this.constants_.DUMMY_INPUT_MIN_HEIGHT); - activeRow.hasDummyInput = true; - } - if (activeRow.align == null) { - activeRow.align = input.align; - } + Blockly.zelos.RenderInfo.superClass_.addInput_.call(this, input, activeRow); }; /** diff --git a/core/renderers/zelos/measurables/rows.js b/core/renderers/zelos/measurables/rows.js index 922ebc6c8..9d983c71c 100644 --- a/core/renderers/zelos/measurables/rows.js +++ b/core/renderers/zelos/measurables/rows.js @@ -61,8 +61,8 @@ Blockly.zelos.TopRow.prototype.hasLeftSquareCorner = function(block) { * Render a round corner unless the block has an output connection. * @override */ -Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(_block) { - return false; +Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(block) { + return !!block.outputConnection && !block.statementInputCount; }; /** @@ -101,6 +101,6 @@ Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner = function(block) { * Render a round corner unless the block has an output connection. * @override */ -Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(_block) { - return false; +Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(block) { + return !!block.outputConnection && !block.statementInputCount; }; From fabb8c44b13e37b27a8a691eb439100bb2fa4874 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Sun, 23 Feb 2020 10:12:08 -0800 Subject: [PATCH 055/105] Fix procedure args handling case incorrectly --- blocks/procedures.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blocks/procedures.js b/blocks/procedures.js index 2954f463a..c309a2516 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -531,11 +531,14 @@ Blockly.Blocks['procedures_mutatorarg'] = { var workspace = sourceBlock.workspace.targetWorkspace || sourceBlock.workspace; var blocks = workspace.getAllBlocks(false); + var caselessName = varName.toLowerCase(); for (var i = 0; i < blocks.length; i++) { if (blocks[i].id == this.getSourceBlock().id) { continue; } - if (blocks[i].getFieldValue('NAME') == varName) { + // Other blocks values may not be set yet when this is loaded. + var otherVar = blocks[i].getFieldValue('NAME'); + if (otherVar && otherVar.toLowerCase() == caselessName) { return null; } } From 868d3cf30fead1dcc99350f6b82aaba34b5db267 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 24 Feb 2020 11:13:05 -0800 Subject: [PATCH 056/105] Fix geras collapsed rendering incorrect in RTL (#3709) --- core/renderers/geras/highlight_constants.js | 6 ++++-- core/renderers/geras/highlighter.js | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/renderers/geras/highlight_constants.js b/core/renderers/geras/highlight_constants.js index a8502a9d2..a986c9e35 100644 --- a/core/renderers/geras/highlight_constants.js +++ b/core/renderers/geras/highlight_constants.js @@ -53,7 +53,7 @@ Blockly.geras.HighlightConstantProvider = function(constants) { * @package */ Blockly.geras.HighlightConstantProvider.prototype.init = function() { - + /** * An object containing sizing and path information about inside corner * highlights. @@ -273,7 +273,9 @@ Blockly.geras.HighlightConstantProvider.prototype.makeJaggedTeeth = function() { Blockly.utils.svgPaths.moveBy(-10.2, 6.8) + Blockly.utils.svgPaths.lineTo(5.1, 2.6); return { - pathLeft: pathLeft + pathLeft: pathLeft, + height: 12, + width: 10.2 }; }; diff --git a/core/renderers/geras/highlighter.js b/core/renderers/geras/highlighter.js index b496b4897..811c0e16b 100644 --- a/core/renderers/geras/highlighter.js +++ b/core/renderers/geras/highlighter.js @@ -110,11 +110,10 @@ Blockly.geras.Highlighter.prototype.drawTopCorner = function(row) { Blockly.geras.Highlighter.prototype.drawJaggedEdge_ = function(row) { if (this.info_.RTL) { - this.steps_ += Blockly.utils.svgPaths.lineOnAxis('H', row.width - this.highlightOffset_); - this.steps_ += this.jaggedTeethPaths_.pathLeft; var remainder = row.height - this.jaggedTeethPaths_.height - this.highlightOffset_; - this.steps_ += Blockly.utils.svgPaths.lineOnAxis('v', remainder); + this.steps_ += this.jaggedTeethPaths_.pathLeft + + Blockly.utils.svgPaths.lineOnAxis('v', remainder); } }; From 981c0b5d126f4769906f5e6e162fb5d078b3d1c4 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 24 Feb 2020 11:13:48 -0800 Subject: [PATCH 057/105] Fix checkbox field rerendering on setCheckChar (#3704) * Fix checkbox field rerendering on setCheckChar --- core/field_checkbox.js | 4 +--- tests/mocha/field_checkbox_test.js | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/field_checkbox.js b/core/field_checkbox.js index be599c7d8..14736be32 100644 --- a/core/field_checkbox.js +++ b/core/field_checkbox.js @@ -130,9 +130,7 @@ Blockly.FieldCheckbox.prototype.getDisplayText_ = function() { */ Blockly.FieldCheckbox.prototype.setCheckCharacter = function(character) { this.checkChar_ = character; - if (this.textContent_) { - this.textContent_.nodeValue = character || Blockly.FieldCheckbox.CHECK_CHAR; - } + this.forceRerender(); }; /** diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 3eb4c0496..0e6fd27a0 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -165,7 +165,10 @@ suite('Checkbox Fields', function() { function assertCharacter(field, char) { field.fieldGroup_ = Blockly.utils.dom.createSvgElement('g', {}, null); field.sourceBlock_ = { - RTL: false + RTL: false, + rendered: true, + render: function() { field.render_(); }, + bumpNeighbours: function() {} }; field.constants_ = { FIELD_CHECKBOX_X_OFFSET: 2, From 4432ca2e9312f292857143c779dc49751a2029a8 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Mon, 24 Feb 2020 13:35:36 -0800 Subject: [PATCH 058/105] Cleanup centerOnBlock. (#3699) --- core/workspace_svg.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 0c41274f9..202b23969 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -2075,31 +2075,26 @@ Blockly.WorkspaceSvg.prototype.centerOnBlock = function(id) { // Workspace scale, used to convert from workspace coordinates to pixels. var scale = this.scale; - // Center in pixels. 0, 0 is at the workspace origin. These numbers may - // be negative. + // Center of block in pixels, relative to workspace origin (center 0,0). + // Scrolling to here would put the block in the top-left corner of the + // visible workspace. var pixelX = blockCenterX * scale; var pixelY = blockCenterY * scale; var metrics = this.getMetrics(); - // Scrolling to here would put the block in the top-left corner of the - // visible workspace. - var scrollToBlockX = pixelX - metrics.contentLeft; - var scrollToBlockY = pixelY - metrics.contentTop; - // viewHeight and viewWidth are in pixels. var halfViewWidth = metrics.viewWidth / 2; var halfViewHeight = metrics.viewHeight / 2; // Put the block in the center of the visible workspace instead. - var scrollToCenterX = scrollToBlockX - halfViewWidth; - var scrollToCenterY = scrollToBlockY - halfViewHeight; + var scrollToCenterX = pixelX - halfViewWidth; + var scrollToCenterY = pixelY - halfViewHeight; // Convert from workspace directions to canvas directions. - var x = -scrollToCenterX - metrics.contentLeft; - var y = -scrollToCenterY - metrics.contentTop; + var x = -scrollToCenterX; + var y = -scrollToCenterY; - Blockly.hideChaff(); this.scroll(x, y); }; From 60db399a8da126b7cdb516885eefdf9ce9ecd78d Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 24 Feb 2020 17:36:01 -0800 Subject: [PATCH 059/105] Use flex to compute measure font metrics (#3714) * Use flexbox to compute font dimensions instead of inline-block --- core/utils/dom.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/utils/dom.js b/core/utils/dom.js index 2d470a2eb..c68f98778 100644 --- a/core/utils/dom.js +++ b/core/utils/dom.js @@ -347,25 +347,24 @@ Blockly.utils.dom.measureFontMetrics = function(text, fontSize, fontWeight, fontFamily) { var span = document.createElement('span'); - span.setAttribute('style', 'display: inline-block;'); span.style.font = fontWeight + ' ' + fontSize + ' ' + fontFamily; span.textContent = text; var block = document.createElement('div'); - block.setAttribute('style', - 'display: inline-block; width: 1px; height: 0px;'); - + block.style.width = '1px'; + block.style.height = '0px'; + var div = document.createElement('div'); - div.setAttribute('style', 'line-height: 0;'); + div.setAttribute('style', 'position: fixed; top: 0; left: 0; display: flex;'); div.appendChild(span); div.appendChild(block); document.body.appendChild(div); try { var result = {}; - block.style.verticalAlign = 'baseline'; + div.style.alignItems = 'baseline'; result.baseline = block.offsetTop - span.offsetTop; - block.style.verticalAlign = 'bottom'; + div.style.alignItems = 'flex-end'; result.height = block.offsetTop - span.offsetTop; } finally { document.body.removeChild(div); From 97eb86f9885ed8defb9440ee7ae1cb236de9192f Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Tue, 25 Feb 2020 14:29:45 -0800 Subject: [PATCH 060/105] Configure zelos selected glow properties in theme (#3715) * Configure selected and replacement glow size and colour in zelos from the theme. --- core/renderers/zelos/constants.js | 61 ++++++++++++++++++++++++++++--- core/theme/highcontrast.js | 4 ++ 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index 52930aae4..cdd09750f 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -310,6 +310,30 @@ Blockly.zelos.ConstantProvider = function() { */ this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH = 12 * this.GRID_UNIT; + /** + * The selected glow colour. + * @type {string} + */ + this.SELECTED_GLOW_COLOUR = '#fff200'; + + /** + * The size of the selected glow. + * @type {number} + */ + this.SELECTED_GLOW_SIZE = 0.5; + + /** + * The replacement glow colour. + * @type {string} + */ + this.REPLACEMENT_GLOW_COLOUR = '#fff200'; + + /** + * The size of the selected glow. + * @type {number} + */ + this.REPLACEMENT_GLOW_SIZE = 2; + /** * The ID of the selected glow filter, or the empty string if no filter is * set. @@ -380,6 +404,30 @@ Blockly.zelos.ConstantProvider.prototype.init = function() { this.INSIDE_CORNERS.rightWidth; }; +/** + * @override + */ +Blockly.zelos.ConstantProvider.prototype.setTheme = function(theme) { + Blockly.zelos.ConstantProvider.superClass_.setTheme.call(this, theme); + + this.SELECTED_GLOW_COLOUR = + theme.getComponentStyle('selectedGlowColour') || + this.SELECTED_GLOW_COLOUR; + var selectedGlowSize = + Number(theme.getComponentStyle('selectedGlowSize')); + this.SELECTED_GLOW_SIZE = + selectedGlowSize && !isNaN(selectedGlowSize) ? + selectedGlowSize : this.SELECTED_GLOW_SIZE; + this.REPLACEMENT_GLOW_COLOUR = + theme.getComponentStyle('replacementGlowColour') || + this.REPLACEMENT_GLOW_COLOUR; + var replacementGlowSize = + Number(theme.getComponentStyle('replacementGlowSize')); + this.REPLACEMENT_GLOW_SIZE = + replacementGlowSize && !isNaN(replacementGlowSize) ? + replacementGlowSize : this.REPLACEMENT_GLOW_SIZE; +}; + /** * @override */ @@ -388,6 +436,9 @@ Blockly.zelos.ConstantProvider.prototype.dispose = function() { if (this.selectedGlowFilter_) { Blockly.utils.dom.removeNode(this.selectedGlowFilter_); } + if (this.replacementGlowFilter_) { + Blockly.utils.dom.removeNode(this.replacementGlowFilter_); + } }; /** @@ -764,7 +815,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, Blockly.utils.dom.createSvgElement('feGaussianBlur', { 'in': 'SourceGraphic', - 'stdDeviation': 0.5 // TODO: configure size in theme. + 'stdDeviation': this.SELECTED_GLOW_SIZE }, selectedGlowFilter); // Set all gaussian blur pixels to 1 opacity before applying flood @@ -778,7 +829,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, // Color the highlight Blockly.utils.dom.createSvgElement('feFlood', { - 'flood-color': '#fff200', // TODO: configure colour in theme. + 'flood-color': this.SELECTED_GLOW_COLOUR, 'flood-opacity': 1, 'result': 'outColor' }, @@ -806,7 +857,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, Blockly.utils.dom.createSvgElement('feGaussianBlur', { 'in': 'SourceGraphic', - 'stdDeviation': 2 // TODO: configure size in theme. + 'stdDeviation': this.REPLACEMENT_GLOW_SIZE }, replacementGlowFilter); // Set all gaussian blur pixels to 1 opacity before applying flood @@ -820,7 +871,7 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, // Color the highlight Blockly.utils.dom.createSvgElement('feFlood', { - 'flood-color': '#fff200', // TODO: configure colour in theme. + 'flood-color': this.REPLACEMENT_GLOW_COLOUR, 'flood-opacity': 1, 'result': 'outColor' }, @@ -897,7 +948,7 @@ Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(name) { // Connection highlight. selector + ' .blocklyHighlightedConnectionPath {', - 'stroke: #fff200;', + 'stroke: ' + this.SELECTED_GLOW_COLOUR + ';', '}', // Disabled outline paths. diff --git a/core/theme/highcontrast.js b/core/theme/highcontrast.js index c132e33b3..bd1084354 100644 --- a/core/theme/highcontrast.js +++ b/core/theme/highcontrast.js @@ -108,6 +108,10 @@ Blockly.Themes.HighContrast = Blockly.Themes.HighContrast.defaultBlockStyles, Blockly.Themes.HighContrast.categoryStyles); +Blockly.Themes.HighContrast.setComponentStyle('selectedGlowColour', '#000000'); +Blockly.Themes.HighContrast.setComponentStyle('selectedGlowSize', 1); +Blockly.Themes.HighContrast.setComponentStyle('replacementGlowColour', '#000000'); + Blockly.Themes.HighContrast.setFontStyle({ 'family': null, // Use default font-family 'weight': null, // Use default font-weight From ec8d76f143691e838d3f5163d19a41859e44a50b Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 25 Feb 2020 14:32:51 -0800 Subject: [PATCH 061/105] Add workspace comment context menu option to playground (#3708) * Add WScomment context menu option to playground --- core/workspace_svg.js | 3 ++- tests/playground.html | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 202b23969..0b748763f 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -395,6 +395,7 @@ Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {}; * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu options. * @param {!Array.} options List of menu options to add to. + * @param {!Event} e The right-click event that triggered the context menu. */ Blockly.WorkspaceSvg.prototype.configureContextMenu; @@ -1800,7 +1801,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu = function(e) { // Allow the developer to add or modify menuOptions. if (this.configureContextMenu) { - this.configureContextMenu(menuOptions); + this.configureContextMenu(menuOptions, e); } Blockly.ContextMenu.show(e, menuOptions, this.RTL); diff --git a/tests/playground.html b/tests/playground.html index 6290f937c..7a4379346 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -69,12 +69,18 @@ + - - @@ -34,10 +14,6 @@ goog.require('Blockly.zelos.Renderer'); // Blockly.blockRendering.startDebugger(); - // This stub is a workaround in order to load pxt-blockly blocks, as they - // rely on a setOutputShape method on the block. - Blockly.BlockSvg.prototype.setOutputShape = function() { }; - var blocklyDiv = document.getElementById('blocklyDiv'); var workspace; window.addEventListener('message', function (msg) { @@ -56,6 +32,11 @@ workspace = Blockly.inject(blocklyDiv, { renderer: 'zelos', + rendererOverrides: { + 'FIELD_TEXT_FONTFAMILY': '"Helvetica Neue", "Segoe UI", Helvetica, sans-serif', + 'FIELD_TEXT_FONTWEIGHT': 'bold', + 'FIELD_TEXT_FONTSIZE': 12 + }, move: { scrollbars: true, drag: true, @@ -66,10 +47,6 @@ startScale: 2, } }); - var constants = workspace.getRenderer().getConstants(); - constants.FIELD_TEXT_FONTSIZE = 12; - constants.FIELD_TEXT_FONTWEIGHT = 'bold'; - constants.FIELD_TEXT_FONTFAMILY = 'Helvetica Neue'; Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(xml), workspace); @@ -82,7 +59,7 @@ from: 'zelos', text: datauri }, '*'); - }, document.getElementById('blocklycss').innerText); + }); } catch (err) { console.error(err); } diff --git a/tests/rendering/zelos/scratchblocks/zelos.html b/tests/rendering/zelos/scratchblocks/zelos.html index 3cc6810a9..877c4f4cb 100644 --- a/tests/rendering/zelos/scratchblocks/zelos.html +++ b/tests/rendering/zelos/scratchblocks/zelos.html @@ -7,31 +7,6 @@ - - - - - - @@ -34,10 +14,6 @@ goog.require('Blockly.zelos.Renderer'); // Blockly.blockRendering.startDebugger(); - // This stub is a workaround in order to load pxt-blockly blocks, as they - // rely on a setOutputShape method on the block. - Blockly.BlockSvg.prototype.setOutputShape = function() { }; - var blocklyDiv = document.getElementById('blocklyDiv'); var workspace; window.addEventListener('message', function (msg) { @@ -56,6 +32,11 @@ workspace = Blockly.inject(blocklyDiv, { renderer: 'zelos', + rendererOverrides: { + 'FIELD_TEXT_FONTFAMILY': '"Helvetica Neue", "Segoe UI", Helvetica, sans-serif', + 'FIELD_TEXT_FONTWEIGHT': 'bold', + 'FIELD_TEXT_FONTSIZE': 12 + }, move: { scrollbars: true, drag: true, @@ -66,10 +47,6 @@ startScale: 2, } }); - var constants = workspace.getRenderer().getConstants(); - constants.FIELD_TEXT_FONTSIZE = 12; - constants.FIELD_TEXT_FONTWEIGHT = 'bold'; - constants.FIELD_TEXT_FONTFAMILY = 'Helvetica Neue'; Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(xml), workspace); @@ -82,7 +59,7 @@ from: 'zelos', text: datauri }, '*'); - }, document.getElementById('blocklycss').innerText); + }); } catch (err) { console.error(err); } From 9b071ff7f72380b8ad40cb13c3e0c284a630876c Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 12 Mar 2020 11:47:47 -0700 Subject: [PATCH 082/105] [Zelos] Value to stack block support (#3741) * Zelos value to stack block support --- core/renderers/zelos/drawer.js | 3 ++- core/renderers/zelos/info.js | 31 ++++++++++++++++++------ core/renderers/zelos/measurables/rows.js | 6 +++-- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/core/renderers/zelos/drawer.js b/core/renderers/zelos/drawer.js index d32238355..4e15bfd01 100644 --- a/core/renderers/zelos/drawer.js +++ b/core/renderers/zelos/drawer.js @@ -70,7 +70,8 @@ Blockly.zelos.Drawer.prototype.draw = function() { Blockly.zelos.Drawer.prototype.drawOutline_ = function() { if (this.info_.outputConnection && this.info_.outputConnection.isDynamicShape && - !this.info_.hasStatementInput) { + !this.info_.hasStatementInput && + !this.info_.bottomRow.hasNextConnection) { this.drawFlatTop_(); this.drawRightDynamicConnection_(); this.drawFlatBottom_(); diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index ea59f1987..0996cf505 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -160,7 +160,7 @@ Blockly.zelos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) { // No need for padding at the beginning or end of the row if the // output shape is dynamic. if (this.outputConnection && this.outputConnection.isDynamicShape && - !this.hasStatementInput) { + !this.hasStatementInput && !this.bottomRow.hasNextConnection) { return this.constants_.NO_PADDING; } } @@ -249,6 +249,13 @@ Blockly.zelos.RenderInfo.prototype.getElemCenterline_ = function(row, elem) { !Blockly.blockRendering.Types.isStatementInput(elem)) { return row.yPos + this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT / 2; } + if (Blockly.blockRendering.Types.isInlineInput(elem)) { + var connectedBlock = elem.connectedBlock; + if (connectedBlock && connectedBlock.outputConnection && + connectedBlock.nextConnection) { + return row.yPos + connectedBlock.height / 2; + } + } return Blockly.zelos.RenderInfo.superClass_.getElemCenterline_.call(this, row, elem); }; @@ -365,8 +372,10 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { this.height = yCursor; // Adjust the height of the output connection. - var connectionHeight = this.outputConnection.shape.height(yCursor); - var connectionWidth = this.outputConnection.shape.width(yCursor); + var blockHeight = this.bottomRow.hasNextConnection ? + this.height - this.bottomRow.descenderHeight : this.height; + var connectionHeight = this.outputConnection.shape.height(blockHeight); + var connectionWidth = this.outputConnection.shape.width(blockHeight); this.outputConnection.height = connectionHeight; this.outputConnection.width = connectionWidth; @@ -377,8 +386,9 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { this.outputConnection.shape.connectionOffsetX(connectionWidth); // Add the right connection measurable. + // Don't add it if we have a value-to-statament or a value-to-stack block. var rightConnectionWidth = 0; - if (!this.hasStatementInput) { + if (!this.hasStatementInput && !this.bottomRow.hasNextConnection) { rightConnectionWidth = connectionWidth; this.rightSide.height = connectionHeight; this.rightSide.width = rightConnectionWidth; @@ -398,7 +408,8 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { * @protected */ Blockly.zelos.RenderInfo.prototype.finalizeHorizontalAlignment_ = function() { - if (!this.outputConnection || this.hasStatementInput) { + if (!this.outputConnection || this.hasStatementInput || + this.bottomRow.hasNextConnection) { return; } var totalNegativeSpacing = 0; @@ -472,9 +483,15 @@ Blockly.zelos.RenderInfo.prototype.getNegativeSpacing_ = function(elem) { } } if (Blockly.blockRendering.Types.isInlineInput(elem)) { - var innerShape = elem.connectedBlock ? - elem.connectedBlock.pathObject.outputShapeType : + var connectedBlock = elem.connectedBlock; + var innerShape = connectedBlock ? + connectedBlock.pathObject.outputShapeType : elem.shape.type; + // Special case for value to stack / value to statement blocks. + if (connectedBlock && connectedBlock.outputConnection && + (connectedBlock.statementInputCount || connectedBlock.nextConnection)) { + return 0; + } // Special case for hexagonal output. if (outerShape == constants.SHAPES.HEXAGONAL && outerShape != innerShape) { diff --git a/core/renderers/zelos/measurables/rows.js b/core/renderers/zelos/measurables/rows.js index 9d983c71c..2c9437edf 100644 --- a/core/renderers/zelos/measurables/rows.js +++ b/core/renderers/zelos/measurables/rows.js @@ -62,7 +62,8 @@ Blockly.zelos.TopRow.prototype.hasLeftSquareCorner = function(block) { * @override */ Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(block) { - return !!block.outputConnection && !block.statementInputCount; + return !!block.outputConnection && !block.statementInputCount && + !block.nextConnection; }; /** @@ -102,5 +103,6 @@ Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner = function(block) { * @override */ Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(block) { - return !!block.outputConnection && !block.statementInputCount; + return !!block.outputConnection && !block.statementInputCount && + !block.nextConnection; }; From 877063b5bdb89a36936c9516e0330144709b40cb Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 12 Mar 2020 15:03:02 -0700 Subject: [PATCH 083/105] Fix marker css (#3745) * Fix marker css * Move to css.js file --- core/css.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/css.js b/core/css.js index cce336ab2..8a29f4b6a 100644 --- a/core/css.js +++ b/core/css.js @@ -477,6 +477,7 @@ Blockly.Css.CONTENT = [ '.blocklyVerticalMarker {', 'stroke-width: 3px;', 'fill: rgba(255,255,255,.5);', + 'pointer-events: none', '}', '.blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,', From 14428a0da40a32e72d3e1dc9ff8f6728d9c4f2fc Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 13 Mar 2020 14:49:08 -0700 Subject: [PATCH 084/105] Fix two memory leaks (#3747) * Fix two memory leaks --- core/block_dragger.js | 1 + core/block_svg.js | 3 ++- core/field.js | 1 + core/flyout_base.js | 1 + core/tooltip.js | 27 +++++++++++++++++++++++++-- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/core/block_dragger.js b/core/block_dragger.js index 3fff73363..1a8b9ea36 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -291,6 +291,7 @@ Blockly.BlockDragger.prototype.maybeDeleteBlock_ = function() { // Fire a move event, so we know where to go back to for an undo. this.fireMoveEvent_(); this.draggingBlock_.dispose(false, true); + Blockly.draggingConnections = []; } else if (trashcan) { // Make sure the trash can is closed. trashcan.close(); diff --git a/core/block_svg.js b/core/block_svg.js index 90fce83c5..cb20b8797 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -943,7 +943,8 @@ Blockly.BlockSvg.prototype.dispose = function(healStack, animate) { // The block has already been deleted. return; } - Blockly.Tooltip.hide(); + Blockly.Tooltip.dispose(); + Blockly.Tooltip.unbindMouseEvents(this.pathObject.svgPath); Blockly.utils.dom.startTextWidthCache(); // Save the block's workspace temporarily so we can resize the // contents once the block is disposed. diff --git a/core/field.js b/core/field.js index 6070682a7..fdfc8e4c0 100644 --- a/core/field.js +++ b/core/field.js @@ -394,6 +394,7 @@ Blockly.Field.prototype.toXml = function(fieldElement) { Blockly.Field.prototype.dispose = function() { Blockly.DropDownDiv.hideIfOwner(this); Blockly.WidgetDiv.hideIfOwner(this); + Blockly.Tooltip.unbindMouseEvents(this.getClickTarget_()); if (this.mouseDownWrapper_) { Blockly.unbindEvent_(this.mouseDownWrapper_); diff --git a/core/flyout_base.js b/core/flyout_base.js index afd197fc8..6d175bcf8 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -548,6 +548,7 @@ Blockly.Flyout.prototype.clearOldBlocks_ = function() { for (var j = 0; j < this.mats_.length; j++) { var rect = this.mats_[j]; if (rect) { + Blockly.Tooltip.unbindMouseEvents(rect); Blockly.utils.dom.removeNode(rect); } } diff --git a/core/tooltip.js b/core/tooltip.js index a900b4059..f2e8a9075 100644 --- a/core/tooltip.js +++ b/core/tooltip.js @@ -129,9 +129,9 @@ Blockly.Tooltip.createDom = function() { * @param {!Element} element SVG element onto which tooltip is to be bound. */ Blockly.Tooltip.bindMouseEvents = function(element) { - Blockly.bindEvent_(element, 'mouseover', null, + element.mouseOverWrapper_ = Blockly.bindEvent_(element, 'mouseover', null, Blockly.Tooltip.onMouseOver_); - Blockly.bindEvent_(element, 'mouseout', null, + element.mouseOutWrapper_ = Blockly.bindEvent_(element, 'mouseout', null, Blockly.Tooltip.onMouseOut_); // Don't use bindEvent_ for mousemove since that would create a @@ -140,6 +140,19 @@ Blockly.Tooltip.bindMouseEvents = function(element) { element.addEventListener('mousemove', Blockly.Tooltip.onMouseMove_, false); }; +/** + * Unbinds tooltip mouse events from the SVG element. + * @param {!Element} element SVG element onto which tooltip is bound. + */ +Blockly.Tooltip.unbindMouseEvents = function(element) { + if (!element) { + return; + } + Blockly.unbindEvent_(element.mouseOverWrapper_); + Blockly.unbindEvent_(element.mouseOutWrapper_); + element.removeEventListener('mousemove', Blockly.Tooltip.onMouseMove_); +}; + /** * Hide the tooltip if the mouse is over a different object. * Initialize the tooltip to potentially appear for this object. @@ -223,6 +236,16 @@ Blockly.Tooltip.onMouseMove_ = function(e) { } }; +/** + * Dispose of the tooltip. + * @package + */ +Blockly.Tooltip.dispose = function() { + Blockly.Tooltip.element_ = null; + Blockly.Tooltip.poisonedElement_ = null; + Blockly.Tooltip.hide(); +}; + /** * Hide the tooltip. */ From 00bb99e0ffe2520b4a7d6a56961ef51ee44dd6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Vr=C3=A1na?= Date: Mon, 16 Mar 2020 16:14:47 +0100 Subject: [PATCH 085/105] Add non-nullable modifier to return type of functions never returning null (#3742) --- blocks/lists.js | 6 +++--- blocks/math.js | 4 ++-- core/extensions.js | 4 ++-- core/flyout_base.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blocks/lists.js b/blocks/lists.js index b995b40f1..44167685e 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -401,7 +401,7 @@ Blockly.Blocks['lists_getIndex'] = { /** * Create XML to represent whether the block is a statement or a value. * Also represent whether there is an 'AT' input. - * @return {Element} XML storage element. + * @return {!Element} XML storage element. * @this {Blockly.Block} */ mutationToDom: function() { @@ -565,7 +565,7 @@ Blockly.Blocks['lists_setIndex'] = { }, /** * Create XML to represent whether there is an 'AT' input. - * @return {Element} XML storage element. + * @return {!Element} XML storage element. * @this {Blockly.Block} */ mutationToDom: function() { @@ -663,7 +663,7 @@ Blockly.Blocks['lists_getSublist'] = { }, /** * Create XML to represent whether there are 'AT' inputs. - * @return {Element} XML storage element. + * @return {!Element} XML storage element. * @this {Blockly.Block} */ mutationToDom: function() { diff --git a/blocks/math.js b/blocks/math.js index e772edfb4..3583d8d23 100644 --- a/blocks/math.js +++ b/blocks/math.js @@ -446,7 +446,7 @@ Blockly.Extensions.register('math_op_tooltip', Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = { /** * Create XML to represent whether the 'divisorInput' should be present. - * @return {Element} XML storage element. + * @return {!Element} XML storage element. * @this {Blockly.Block} */ mutationToDom: function() { @@ -531,7 +531,7 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN = { }, /** * Create XML to represent the output type. - * @return {Element} XML storage element. + * @return {!Element} XML storage element. * @this {Blockly.Block} */ mutationToDom: function() { diff --git a/core/extensions.js b/core/extensions.js index 6edd7483d..df76c6f91 100644 --- a/core/extensions.js +++ b/core/extensions.js @@ -317,7 +317,7 @@ Blockly.Extensions.mutatorPropertiesMatch_ = function(oldProperties, block) { * to the lookup table. * @param {!Object.} lookupTable The table of field values to * tooltip text. - * @return {Function} The extension function. + * @return {!Function} The extension function. */ Blockly.Extensions.buildTooltipForDropdown = function(dropdownName, lookupTable) { @@ -401,7 +401,7 @@ Blockly.Extensions.checkDropdownOptionsInTable_ = function(block, dropdownName, * @param {string} msgTemplate The template form to of the message text, with * %1 placeholder. * @param {string} fieldName The field with the replacement text. - * @return {Function} The extension function. + * @return {!Function} The extension function. */ Blockly.Extensions.buildTooltipWithFieldText = function(msgTemplate, fieldName) { diff --git a/core/flyout_base.js b/core/flyout_base.js index 6d175bcf8..3c7729b05 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -630,7 +630,7 @@ Blockly.Flyout.prototype.isBlockCreatable_ = function(block) { /** * Create a copy of this block on the workspace. * @param {!Blockly.BlockSvg} originalBlock The block to copy from the flyout. - * @return {Blockly.BlockSvg} The newly created block, or null if something + * @return {!Blockly.BlockSvg} The newly created block, or null if something * went wrong with deserialization. * @package */ From 2d169eabd39ca535477d19509a7f9baa968be309 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 16 Mar 2020 08:45:22 -0700 Subject: [PATCH 086/105] Fix flyout createBlock annotation (#3749) --- core/flyout_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/flyout_base.js b/core/flyout_base.js index 3c7729b05..5d0628700 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -630,8 +630,8 @@ Blockly.Flyout.prototype.isBlockCreatable_ = function(block) { /** * Create a copy of this block on the workspace. * @param {!Blockly.BlockSvg} originalBlock The block to copy from the flyout. - * @return {!Blockly.BlockSvg} The newly created block, or null if something - * went wrong with deserialization. + * @return {!Blockly.BlockSvg} The newly created block. + * @throws {Error} if something went wrong with deserialization. * @package */ Blockly.Flyout.prototype.createBlock = function(originalBlock) { From 7d5dcf65622902d2491397c69034a5342274ce5c Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Tue, 17 Mar 2020 13:57:10 -0700 Subject: [PATCH 087/105] Move registering objects to constructor (#3753) --- core/workspace_svg.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index e0f95f057..b94fcf9c5 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -105,6 +105,22 @@ Blockly.WorkspaceSvg = function(options, */ this.markerManager_ = new Blockly.MarkerManager(this); + /** + * Map from function names to callbacks, for deciding what to do when a custom + * toolbox category is opened. + * @type {!Object.>} + * @private + */ + this.toolboxCategoryCallbacks_ = {}; + + /** + * Map from function names to callbacks, for deciding what to do when a button + * is clicked. + * @type {!Object.} + * @private + */ + this.flyoutButtonCallbacks_ = {}; + if (Blockly.Variables && Blockly.Variables.flyoutCategory) { this.registerToolboxCategoryCallback(Blockly.VARIABLE_CATEGORY_NAME, Blockly.Variables.flyoutCategory); @@ -374,22 +390,6 @@ Blockly.WorkspaceSvg.prototype.injectionDiv_ = null; */ Blockly.WorkspaceSvg.prototype.lastRecordedPageScroll_ = null; -/** - * Map from function names to callbacks, for deciding what to do when a button - * is clicked. - * @type {!Object.} - * @private - */ -Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {}; - -/** - * Map from function names to callbacks, for deciding what to do when a custom - * toolbox category is opened. - * @type {!Object.>} - * @private - */ -Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {}; - /** * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu options. From 7e1f81cf115b0d73353da1bde7da54d447a06445 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 18 Mar 2020 10:15:30 -0700 Subject: [PATCH 088/105] Insertion marker properties in theme (#3752) * Pipe inseriton marker colour and opacity from theme --- core/block_svg.js | 3 ++- core/constants.js | 6 ----- core/insertion_marker_manager.js | 18 +++++++------- core/renderers/common/constants.js | 38 ++++++++++++++++++++++++++---- core/renderers/geras/constants.js | 18 ++++++++++++++ core/renderers/zelos/constants.js | 6 +++++ core/theme.js | 9 ++++++- core/theme/dark.js | 2 ++ 8 files changed, 79 insertions(+), 21 deletions(-) diff --git a/core/block_svg.js b/core/block_svg.js index cb20b8797..b0cff9c7e 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -917,7 +917,8 @@ Blockly.BlockSvg.prototype.setInsertionMarker = function(insertionMarker) { } this.isInsertionMarker_ = insertionMarker; if (this.isInsertionMarker_) { - this.setColour(Blockly.INSERTION_MARKER_COLOUR); + this.setColour(this.workspace.getRenderer().getConstants(). + INSERTION_MARKER_COLOUR); this.pathObject.updateInsertionMarker(true); } }; diff --git a/core/constants.js b/core/constants.js index 3abb87520..8914bd140 100644 --- a/core/constants.js +++ b/core/constants.js @@ -54,12 +54,6 @@ Blockly.CONNECTING_SNAP_RADIUS = Blockly.SNAP_RADIUS; */ Blockly.CURRENT_CONNECTION_PREFERENCE = 8; -/** - * The main colour of insertion markers, in hex. The block is rendered a - * transparent grey by changing the fill opacity in CSS. - */ -Blockly.INSERTION_MARKER_COLOUR = '#000000'; - /** * Delay in ms between trigger and bumping unconnected block out of alignment. */ diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 60fffb284..49f264e72 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -255,16 +255,18 @@ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlo } result.setCollapsed(sourceBlock.isCollapsed()); result.setInputsInline(sourceBlock.getInputsInline()); - // Copy field values from the other block. These values may impact the - // rendered size of the insertion marker. Note that we do not care about - // child blocks here. + // Copy visible field values from the other block. These values may impact + // the rendered size of the insertion marker. Note that we do not care + // about child blocks here. for (var i = 0; i < sourceBlock.inputList.length; i++) { var sourceInput = sourceBlock.inputList[i]; - var resultInput = result.inputList[i]; - for (var j = 0; j < sourceInput.fieldRow.length; j++) { - var sourceField = sourceInput.fieldRow[j]; - var resultField = resultInput.fieldRow[j]; - resultField.setValue(sourceField.getValue()); + if (sourceInput.isVisible()) { + var resultInput = result.inputList[i]; + for (var j = 0; j < sourceInput.fieldRow.length; j++) { + var sourceField = sourceInput.fieldRow[j]; + var resultField = resultInput.fieldRow[j]; + resultField.setValue(sourceField.getValue()); + } } } diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 5120411de..343bcfd31 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -502,6 +502,21 @@ Blockly.blockRendering.ConstantProvider = function() { */ this.FULL_BLOCK_FIELDS = false; + /** + * The main colour of insertion markers, in hex. The block is rendered a + * transparent grey by changing the fill opacity in CSS. + * @type {string} + * @package + */ + this.INSERTION_MARKER_COLOUR = '#000000'; + + /** + * The insertion marker opacity. + * @type {number} + * @package + */ + this.INSERTION_MARKER_OPACITY = 0.2; + /** * Enum for connection shapes. * @enum {number} @@ -588,7 +603,7 @@ Blockly.blockRendering.ConstantProvider.prototype.setDynamicProperties_ = function(theme) { /* eslint-disable indent */ this.setFontConstants_(theme); - this.setAccessibilityConstants_(theme); + this.setComponentConstants_(theme); this.ADD_START_HATS = theme.startHats != null ? theme.startHats : this.ADD_START_HATS; @@ -621,17 +636,23 @@ Blockly.blockRendering.ConstantProvider.prototype.setFontConstants_ = function( }; /** - * Set constants related to accessibility. + * Set constants from a theme's component styles. * @param {!Blockly.Theme} theme The current workspace theme. * @protected */ -Blockly.blockRendering.ConstantProvider.prototype.setAccessibilityConstants_ = +Blockly.blockRendering.ConstantProvider.prototype.setComponentConstants_ = function(theme) { /* eslint-disable indent */ this.CURSOR_COLOUR = theme.getComponentStyle('cursorColour') || this.CURSOR_COLOUR; this.MARKER_COLOUR = theme.getComponentStyle('markerColour') || this.MARKER_COLOUR; + this.INSERTION_MARKER_COLOUR = + theme.getComponentStyle('insertionMarkerColour') || + this.INSERTION_MARKER_COLOUR; + this.INSERTION_MARKER_OPACITY = + Number(theme.getComponentStyle('insertionMarkerOpacity')) || + this.INSERTION_MARKER_OPACITY; }; /* eslint-enable indent */ /** @@ -1119,11 +1140,12 @@ Blockly.blockRendering.ConstantProvider.prototype.injectCSS_ = function( var cssNodeId = 'blockly-renderer-style-' + tagName; this.cssNode_ = /** @type {!HTMLStyleElement} */ (document.getElementById(cssNodeId)); + var text = cssArray.join('\n'); if (this.cssNode_) { - // Already injected. + // Already injected, update if the theme changed. + this.cssNode_.firstChild.textContent = text; return; } - var text = cssArray.join('\n'); // Inject CSS tag at start of head. var cssNode = /** @type {!HTMLStyleElement} */ (document.createElement('style')); @@ -1197,6 +1219,12 @@ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) { selector + ' .blocklyReplaceable .blocklyPathDark {', 'display: none;', '}', + + // Insertion marker. + selector + ' .blocklyInsertionMarker>.blocklyPath {', + 'fill-opacity: ' + this.INSERTION_MARKER_OPACITY + ';', + 'stroke: none', + '}', /* eslint-enable indent */ ]; }; diff --git a/core/renderers/geras/constants.js b/core/renderers/geras/constants.js index 5234cfa83..0499a135b 100644 --- a/core/renderers/geras/constants.js +++ b/core/renderers/geras/constants.js @@ -44,3 +44,21 @@ Blockly.geras.ConstantProvider = function() { }; Blockly.utils.object.inherits(Blockly.geras.ConstantProvider, Blockly.blockRendering.ConstantProvider); + + +/** + * @override + */ +Blockly.geras.ConstantProvider.prototype.getCSS_ = function(selector) { + return Blockly.geras.ConstantProvider.superClass_.getCSS_.call(this, selector) + .concat([ + /* eslint-disable indent */ + // Insertion marker. + selector + ' .blocklyInsertionMarker>.blocklyPathLight,', + selector + ' .blocklyInsertionMarker>.blocklyPathDark {', + 'fill-opacity: ' + this.INSERTION_MARKER_OPACITY + ';', + 'stroke: none', + '}', + /* eslint-enable indent */ + ]); +}; diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index e30dfaa73..f37c37b87 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -965,6 +965,12 @@ Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(selector) { selector + ' .blocklyDisabled > .blocklyOutlinePath {', 'fill: url(#blocklyDisabledPattern' + this.randomIdentifier + ')', '}', + + // Insertion marker. + selector + ' .blocklyInsertionMarker>.blocklyPath {', + 'fill-opacity: ' + this.INSERTION_MARKER_OPACITY + ';', + 'stroke: none', + '}', /* eslint-enable indent */ ]; }; diff --git a/core/theme.js b/core/theme.js index dfa2ed12b..311782f55 100644 --- a/core/theme.js +++ b/core/theme.js @@ -105,8 +105,14 @@ Blockly.Theme.CategoryStyle; * flyoutOpacity:number?, * scrollbarColour:string?, * scrollbarOpacity:number?, + * insertionMarkerColour:string?, + * insertionMarkerOpacity:number?, * markerColour:string?, - * cursorColour:string? + * cursorColour:string?, + * selectedGlowColour:string?, + * selectedGlowOpacity:number?, + * replacementGlowColour:string?, + * replacementGlowOpacity:number? * }} */ Blockly.Theme.ComponentStyle; @@ -202,6 +208,7 @@ Blockly.Theme.defineTheme = function(name, themeObj) { var base = themeObj['base']; if (base && base instanceof Blockly.Theme) { Blockly.utils.object.deepMerge(theme, base); + theme.name = name; } Blockly.utils.object.deepMerge(theme.blockStyles, diff --git a/core/theme/dark.js b/core/theme/dark.js index 7badcde66..c8cc976a4 100644 --- a/core/theme/dark.js +++ b/core/theme/dark.js @@ -24,6 +24,8 @@ Blockly.Themes.Dark = Blockly.Theme.defineTheme('dark', { 'flyoutForegroundColour': '#ccc', 'flyoutOpacity': 1, 'scrollbarColour': '#797979', + 'insertionMarkerColour': '#fff', + 'insertionMarkerOpacity': 0.3, 'scrollbarOpacity': 0.4, 'cursorColour': '#d0d0d0' } From a6e3f78425e3b118bf611c5214e0f2e88465069e Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 18 Mar 2020 12:08:24 -0700 Subject: [PATCH 089/105] Cleanup build (#3756) --- gulpfile.js | 14 -------------- scripts/gulpfiles/build_tasks.js | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a902eadaf..71dc97111 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,23 +10,9 @@ */ var gulp = require('gulp'); -gulp.shell = require('gulp-shell'); -gulp.concat = require('gulp-concat'); -gulp.replace = require('gulp-replace'); -gulp.rename = require('gulp-rename'); -gulp.insert = require('gulp-insert'); -gulp.umd = require('gulp-umd'); - -var path = require('path'); -var fs = require('fs'); -var rimraf = require('rimraf'); var execSync = require('child_process').execSync; -var through2 = require('through2'); -var closureCompiler = require('google-closure-compiler').gulp(); -var closureDeps = require('google-closure-deps'); var packageJson = require('./package.json'); -var argv = require('yargs').argv; var typings = require('./scripts/gulpfiles/typings'); var buildTasks = require('./scripts/gulpfiles/build_tasks'); diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 3435c33de..e03731a8e 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -207,7 +207,7 @@ goog.provide('Blockly.FieldTextInput'); goog.provide('Blockly.FieldVariable'); goog.provide('Blockly.Mutator'); goog.provide('Blockly.Warning');`; - return gulp.src(maybeAddClosureLibrary(['blocks/*.js']), {base: './'}) + return gulp.src(['blocks/*.js'], {base: './'}) // Add Blockly.Blocks to be compatible with the compiler. .pipe(gulp.replace(`goog.provide('Blockly.Constants.Colour');`, `${provides}goog.provide('Blockly.Constants.Colour');`)) From d838778a4abb84c1f9037f3ded0bc29669ba0355 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 19 Mar 2020 10:53:29 -0700 Subject: [PATCH 090/105] Script to check licenses (#3757) * Add script task to check licenses of all dependenies --- gulpfile.js | 5 +- package-lock.json | 404 ++++++++++++++++++++++++++++- package.json | 3 +- scripts/gulpfiles/license_tasks.js | 21 ++ 4 files changed, 423 insertions(+), 10 deletions(-) create mode 100644 scripts/gulpfiles/license_tasks.js diff --git a/gulpfile.js b/gulpfile.js index 71dc97111..c02d71840 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,7 +18,7 @@ var typings = require('./scripts/gulpfiles/typings'); var buildTasks = require('./scripts/gulpfiles/build_tasks'); var packageTasks = require('./scripts/gulpfiles/package_tasks'); var gitTasks = require('./scripts/gulpfiles/git_tasks'); - +var licenseTasks = require('./scripts/gulpfiles/license_tasks'); // See https://docs.npmjs.com/cli/version. const preversion = gulp.series( @@ -57,5 +57,6 @@ module.exports = { gitCreateRC: gitTasks.createRC, gitRecompile: gitTasks.recompile, typings: typings.typings, - package: packageTasks.package + package: packageTasks.package, + checkLicenses: licenseTasks.checkLicenses }; diff --git a/package-lock.json b/package-lock.json index 937808514..5172d6e9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20200123.1", + "version": "3.20200123.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -30,6 +30,21 @@ "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==", "dev": true }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, "@wdio/config": { "version": "5.13.0-alpha.0", "resolved": "https://registry.npmjs.org/@wdio/config/-/config-5.13.0-alpha.0.tgz", @@ -100,6 +115,15 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.1.tgz", "integrity": "sha512-1zSbbCuoIjafKZ3mblY5ikvAb0ODUbqBnFuUb7f6uLeQhhGJ0vEV4ntmtxKLT2WgXCO94E07BjunsIw1jOMPZw==" }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, "acorn": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", @@ -125,6 +149,15 @@ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==" }, + "agent-base": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", + "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", + "dev": true, + "requires": { + "debug": "4" + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -338,6 +371,12 @@ "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, "array-initial": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", @@ -695,6 +734,12 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -712,6 +757,38 @@ "unset-value": "^1.0.0" } }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -885,6 +962,15 @@ "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", "dev": true }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, "clone-stats": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", @@ -1234,6 +1320,15 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -1243,6 +1338,12 @@ "type-detect": "^4.0.0" } }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1277,6 +1378,12 @@ "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", "dev": true }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1410,6 +1517,12 @@ "domelementtype": "1" } }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -1687,6 +1800,12 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true + }, "execa": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", @@ -2085,12 +2204,6 @@ "map-cache": "^0.2.2" } }, - "fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", - "dev": true - }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -2685,6 +2798,27 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "gaxios": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.3.2.tgz", + "integrity": "sha512-K/+py7UvKRDaEwEKlLiRKrFr+wjGjsMz5qH7Vs549QJS7cpSCOT/BbWL7pzqECflc46FcNPipjSfB+V1m8PAhw==", + "dev": true, + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + } + } + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -2917,6 +3051,25 @@ } } }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", @@ -3367,6 +3520,12 @@ } } }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -3377,6 +3536,16 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3759,6 +3928,29 @@ "textextensions": "2" } }, + "js-green-licenses": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/js-green-licenses/-/js-green-licenses-1.1.0.tgz", + "integrity": "sha512-y2qezlUzR5p5BElSjJS3KqE+W91oEdCYDlRUm8WxlhGB9uxZatcLm7qy6zu1GJ0LNJItMyRTqjhHcfJrcvMIPw==", + "dev": true, + "requires": { + "argparse": "^1.0.10", + "gaxios": "^2.0.1", + "npm-package-arg": "^6.1.0", + "package-json": "^6.0.0", + "spdx-correct": "^3.0.0", + "spdx-satisfies": "^5.0.0", + "strip-json-comments": "^3.0.0" + }, + "dependencies": { + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + } + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3890,6 +4082,12 @@ } } }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -3934,6 +4132,15 @@ "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", "dev": true }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -4170,6 +4377,12 @@ "integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==", "dev": true }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, "make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -4328,6 +4541,12 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -4589,6 +4808,12 @@ "semver": "^5.7.0" } }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -4610,6 +4835,12 @@ "remove-trailing-separator": "^1.0.1" } }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, "now-and-later": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", @@ -4619,6 +4850,18 @@ "once": "^1.3.2" } }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -4813,6 +5056,12 @@ "readable-stream": "^2.0.1" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, "os-locale": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", @@ -4830,6 +5079,22 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -4872,6 +5137,26 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5076,6 +5361,12 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -5142,6 +5433,26 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, "read-pkg": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", @@ -5254,6 +5565,24 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "registry-auth-token": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", + "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, "remove-bom-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", @@ -5466,6 +5795,15 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "resq": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/resq/-/resq-1.6.0.tgz", @@ -5835,6 +6173,17 @@ "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", "dev": true }, + "spdx-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", + "integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", + "dev": true, + "requires": { + "array-find-index": "^1.0.2", + "spdx-expression-parse": "^3.0.0", + "spdx-ranges": "^2.0.0" + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -5867,6 +6216,23 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "spdx-ranges": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", + "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", + "dev": true + }, + "spdx-satisfies": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.0.tgz", + "integrity": "sha512-/hGhwh20BeGmkA+P/lm06RvXD94JduwNxtx/oX3B5ClPt1/u/m5MCaDNo1tV3Y9laLkQr/NRde63b9lLMhlNfw==", + "dev": true, + "requires": { + "spdx-compare": "^1.0.0", + "spdx-expression-parse": "^3.0.0", + "spdx-ranges": "^2.0.0" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -6252,6 +6618,12 @@ } } }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", @@ -6520,6 +6892,15 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -6556,6 +6937,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, "value-or-function": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", diff --git a/package.json b/package.json index dfe151a6d..b55186cf8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "build:langfiles": "gulp buildLangfiles", "build:uncompressed": "gulp buildUncompressed", "bump": "npm version 3.$(date +'%Y%m%d').0", + "license": "gulp checkLicenses", "lint": "eslint .", "package": "gulp package", "postversion": "gulp postversion", @@ -57,7 +58,6 @@ "concurrently": "^4.1.2", "eslint": "^5.13.0", "eslint-plugin-es5": "^1.4.1", - "fs": "0.0.1-security", "google-closure-compiler": "^20200101.0.0", "google-closure-deps": "^20200101.0.0", "gulp": "^4.0.2", @@ -69,6 +69,7 @@ "gulp-replace": "^1.0.0", "gulp-umd": "^2.0.0", "jshint": "^2.10.2", + "js-green-licenses": "^1.1.0", "mocha": "^6.1.4", "pixelmatch": "^4.0.2", "pngjs": "^3.4.0", diff --git a/scripts/gulpfiles/license_tasks.js b/scripts/gulpfiles/license_tasks.js new file mode 100644 index 000000000..9d4fd785d --- /dev/null +++ b/scripts/gulpfiles/license_tasks.js @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Gulp tasks to check the licenses of Blockly depenedencies. + */ + +const jsgl = require('js-green-licenses'); + +function checkLicenses() { + const checker = new jsgl.LicenseChecker(); + checker.setDefaultHandlers(); + return checker.checkLocalDirectory('.'); +}; + +module.exports = { + checkLicenses: checkLicenses +}; From 7f9539e64b06c2f7d33cea571b5991e5b226d1fc Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Fri, 20 Mar 2020 13:46:59 -0700 Subject: [PATCH 091/105] Fix inner html (#3759) * Fix ie11 bug by switching from innerHtml to innerText * Change to textContent --- core/dropdowndiv.js | 2 +- core/tooltip.js | 2 +- core/widgetdiv.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dropdowndiv.js b/core/dropdowndiv.js index e75bc73e1..3a6240ee9 100644 --- a/core/dropdowndiv.js +++ b/core/dropdowndiv.js @@ -193,7 +193,7 @@ Blockly.DropDownDiv.getContentDiv = function() { * Clear the content of the drop-down. */ Blockly.DropDownDiv.clearContent = function() { - Blockly.DropDownDiv.content_.innerHTML = ''; + Blockly.DropDownDiv.content_.textContent = ''; Blockly.DropDownDiv.content_.style.width = ''; }; diff --git a/core/tooltip.js b/core/tooltip.js index f2e8a9075..3bb20270d 100644 --- a/core/tooltip.js +++ b/core/tooltip.js @@ -294,7 +294,7 @@ Blockly.Tooltip.show_ = function() { return; } // Erase all existing text. - Blockly.Tooltip.DIV.innerHTML = ''; + Blockly.Tooltip.DIV.textContent = ''; // Get the new text. var tip = Blockly.Tooltip.element_.tooltip; while (typeof tip == 'function') { diff --git a/core/widgetdiv.js b/core/widgetdiv.js index b9504dab6..633021e78 100644 --- a/core/widgetdiv.js +++ b/core/widgetdiv.js @@ -102,7 +102,7 @@ Blockly.WidgetDiv.hide = function() { div.style.top = ''; Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_(); Blockly.WidgetDiv.dispose_ = null; - div.innerHTML = ''; + div.textContent = ''; if (Blockly.WidgetDiv.rendererClassName_) { Blockly.utils.dom.removeClass(div, Blockly.WidgetDiv.rendererClassName_); From c7620bc3fc4874d224f46aeb44f5039d9e3af331 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 23 Mar 2020 16:32:27 -0700 Subject: [PATCH 092/105] Fix issue #714 bubbling event when hitting a tree control group (#3761) --- core/components/tree/treecontrol.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/components/tree/treecontrol.js b/core/components/tree/treecontrol.js index 0c559c97d..3ec32654a 100644 --- a/core/components/tree/treecontrol.js +++ b/core/components/tree/treecontrol.js @@ -372,6 +372,10 @@ Blockly.tree.TreeControl.prototype.getNodeFromEvent_ = function(e) { if (target == this.getElement()) { break; } + // Don't bubble if we hit a group. See issue #714. + if (target.getAttribute('role') == Blockly.utils.aria.Role.GROUP) { + return null; + } target = target.parentNode; } return null; From 40d39fd0c5dbd9affd520f9ef67cea0a4a7b1ea4 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 23 Mar 2020 16:49:03 -0700 Subject: [PATCH 093/105] Update gh pages task (#3762) * Add task for updating github pages from develop --- gulpfile.js | 1 + package.json | 1 + scripts/gulpfiles/git_tasks.js | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c02d71840..a7e26ee47 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -56,6 +56,7 @@ module.exports = { gitSyncMaster: gitTasks.syncMaster, gitCreateRC: gitTasks.createRC, gitRecompile: gitTasks.recompile, + gitUpdateGithubPages: gitTasks.updateGithubPages, typings: typings.typings, package: packageTasks.package, checkLicenses: licenseTasks.checkLicenses diff --git a/package.json b/package.json index b55186cf8..42858ffb2 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "test:setupselenium": "selenium-standalone install --config=./tests/scripts/selenium-config.js", "test:startselenium": "selenium-standalone start --config=./tests/scripts/selenium-config.js", "typings": "gulp typings", + "updateGithubPages": "gulp gitUpdateGithubPages", "version": "gulp build && git add -A" }, "main": "./index.js", diff --git a/scripts/gulpfiles/git_tasks.js b/scripts/gulpfiles/git_tasks.js index a0262cebc..63cbef780 100644 --- a/scripts/gulpfiles/git_tasks.js +++ b/scripts/gulpfiles/git_tasks.js @@ -21,7 +21,7 @@ const upstream_url = "https://github.com/google/blockly.git"; function syncBranch(branchName) { return function(done) { execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' }); - execSync('git checkout ' + branchName, { stdio: 'inherit' }); + checkoutBranch(branchName); execSync('git pull ' + upstream_url + ' ' + branchName, { stdio: 'inherit' }); execSync('git push origin ' + branchName, { stdio: 'inherit' }); @@ -56,6 +56,13 @@ function getRCBranchName() { return 'rc_' + yyyy + '_' + mm; }; +// If branch does not exist then create the branch. +// If branch exists switch to branch. +function checkoutBranch(branchName) { + execSync('git checkout ' + branchName + ' || git checkout -b ' + branchName, + { stdio: 'inherit' }); +} + // Recompile and push to origin. const recompile = gulp.series( syncDevelop, @@ -93,9 +100,20 @@ const createRC = gulp.series( }, ); +// Update github pages with what is currently in develop. +const updateGithubPages = gulp.series( + syncBranch('gh-pages'), + function(done) { + execSync('git pull ' + upstream_url + ' develop', { stdio: 'inherit' }); + execSync('git push ' + upstream_url + ' gh-pages', { stdio: 'inherit' }); + done(); + } +); + module.exports = { syncDevelop: syncDevelop, syncMaster: syncMaster, createRC: createRC, - recompile: recompile + recompile: recompile, + updateGithubPages: updateGithubPages } From 71f72853339af288bf2491970589849ca792b3fd Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 23 Mar 2020 17:34:12 -0700 Subject: [PATCH 094/105] Fix mutator field scale (#3763) * Fix mutator zoom scale --- core/field_multilineinput.js | 2 +- core/field_textinput.js | 2 +- core/workspace_svg.js | 13 +++++++++++++ tests/mocha/field_textinput_test.js | 4 +++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core/field_multilineinput.js b/core/field_multilineinput.js index 4e2f7dfc2..734f4135a 100644 --- a/core/field_multilineinput.js +++ b/core/field_multilineinput.js @@ -208,7 +208,7 @@ Blockly.FieldMultilineInput.prototype.updateSize_ = function() { */ Blockly.FieldMultilineInput.prototype.widgetCreate_ = function() { var div = Blockly.WidgetDiv.DIV; - var scale = this.workspace_.scale; + var scale = this.workspace_.getScale(); var htmlInput = /** @type {HTMLTextAreaElement} */ (document.createElement('textarea')); diff --git a/core/field_textinput.js b/core/field_textinput.js index b2c4d7ce6..2343a2232 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -330,7 +330,7 @@ Blockly.FieldTextInput.prototype.widgetCreate_ = function() { var htmlInput = /** @type {HTMLInputElement} */ (document.createElement('input')); htmlInput.className = 'blocklyHtmlInput'; htmlInput.setAttribute('spellcheck', this.spellcheck_); - var scale = this.workspace_.scale; + var scale = this.workspace_.getScale(); var fontSize = (this.getConstants().FIELD_TEXT_FONTSIZE * scale) + 'pt'; div.style.fontSize = fontSize; diff --git a/core/workspace_svg.js b/core/workspace_svg.js index b94fcf9c5..5896fb4ad 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -2152,6 +2152,19 @@ Blockly.WorkspaceSvg.prototype.setScale = function(newScale) { } }; + +/** + * Get the workspace's zoom factor. If the workspace has a parent, we call into + * the parent to get the workspace scale. + * @return {number} The workspace zoom factor. Units: (pixels / workspaceUnit). + */ +Blockly.WorkspaceSvg.prototype.getScale = function() { + if (this.options.parentWorkspace) { + return this.options.parentWorkspace.getScale(); + } + return this.scale; +}; + /** * Scroll the workspace to a specified offset (in pixels), keeping in the * workspace bounds. See comment on workspaceSvg.scrollX for more detail on diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index cb19004b4..a3acdec61 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -217,7 +217,9 @@ suite('Text Input Fields', function() { setup(function() { this.prepField = function(field) { var workspace = { - scale: 1, + getScale: function() { + return 1; + }, getRenderer: function() { return { getClassName: function() { return ''; } }; }, From d6abf4798eee105ff231a3f22dc52b6802263c89 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Wed, 25 Mar 2020 14:34:07 -0700 Subject: [PATCH 095/105] Fixing operator precedence in Lua and and adding test. (#3765) * Fixing operator precedence in Lua and and adding test. * Updating golden files. --- generators/lua/lists.js | 6 +- tests/generators/golden/generated.dart | 23 +- tests/generators/golden/generated.js | 13 + tests/generators/golden/generated.lua | 28 +- tests/generators/golden/generated.php | 14 + tests/generators/golden/generated.py | 13 + tests/generators/lists.xml | 466 +++++++++++++++++++++++-- 7 files changed, 510 insertions(+), 53 deletions(-) diff --git a/generators/lua/lists.js b/generators/lua/lists.js index a122c9f2e..5c3831a02 100644 --- a/generators/lua/lists.js +++ b/generators/lua/lists.js @@ -17,7 +17,7 @@ goog.require('Blockly.Lua'); Blockly.Lua['lists_create_empty'] = function(block) { // Create an empty list. - return ['{}', Blockly.Lua.ORDER_ATOMIC]; + return ['{}', Blockly.Lua.ORDER_HIGH]; }; Blockly.Lua['lists_create_with'] = function(block) { @@ -28,7 +28,7 @@ Blockly.Lua['lists_create_with'] = function(block) { Blockly.Lua.ORDER_NONE) || 'None'; } var code = '{' + elements.join(', ') + '}'; - return [code, Blockly.Lua.ORDER_ATOMIC]; + return [code, Blockly.Lua.ORDER_HIGH]; }; Blockly.Lua['lists_repeat'] = function(block) { @@ -126,7 +126,7 @@ Blockly.Lua['lists_getIndex'] = function(block) { var mode = block.getFieldValue('MODE') || 'GET'; var where = block.getFieldValue('WHERE') || 'FROM_START'; var list = Blockly.Lua.valueToCode(block, 'VALUE', Blockly.Lua.ORDER_HIGH) || - '{}'; + '({})'; var getIndex_ = Blockly.Lua.lists.getIndex_; // If `list` would be evaluated more than once (which is the case for LAST, diff --git a/tests/generators/golden/generated.dart b/tests/generators/golden/generated.dart index 6a1311cbd..4d438a074 100644 --- a/tests/generators/golden/generated.dart +++ b/tests/generators/golden/generated.dart @@ -1027,17 +1027,29 @@ void test_get_lists_simple() { unittest_assertequals(list[list.length - (0 + 3)], 'Kirk', 'get #-end order simple'); } +dynamic lists_get_from_end(List my_list, num x) { + x = my_list.length - x; + return my_list[x]; +} + +/// Tests the "get" block with create list call. +void test_get_lists_create_list() { + unittest_assertequals(['Kirk', 'Spock', 'McCoy'].first, 'Kirk', 'get first create list'); + unittest_assertequals(['Kirk', 'Spock', 'McCoy'].last, 'McCoy', 'get last simple'); + unittest_assertequals(['Kirk', 'Spock', 'McCoy'].indexOf(lists_get_random_item(['Kirk', 'Spock', 'McCoy'])) + 1 > 0, true, 'get random simple'); + unittest_assertequals(['Kirk', 'Spock', 'McCoy'][1], 'Spock', 'get # simple'); + unittest_assertequals(['Kirk', 'Spock', 'McCoy'][((true ? 2 : null) - 1)], 'Spock', 'get # order simple'); + unittest_assertequals(lists_get_from_end(['Kirk', 'Spock', 'McCoy'], 3), 'Kirk', 'get #-end simple'); + // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + unittest_assertequals(lists_get_from_end(['Kirk', 'Spock', 'McCoy'], 0 + 3), 'Kirk', 'get #-end order simple'); +} + /// Creates a list for use with the get test. dynamic get_star_wars() { number_of_calls = (number_of_calls is num ? number_of_calls : 0) + 1; return ['Kirk', 'Spock', 'McCoy']; } -dynamic lists_get_from_end(List my_list, num x) { - x = my_list.length - x; - return my_list[x]; -} - /// Tests the "get" block with a function call. void test_get_lists_complex() { list = ['Kirk', 'Spock', 'McCoy']; @@ -1623,6 +1635,7 @@ main() { test_find_lists_simple(); test_find_lists_complex(); test_get_lists_simple(); + test_get_lists_create_list(); test_get_lists_complex(); test_getRemove(); test_remove(); diff --git a/tests/generators/golden/generated.js b/tests/generators/golden/generated.js index c9b80a7a7..424793112 100644 --- a/tests/generators/golden/generated.js +++ b/tests/generators/golden/generated.js @@ -1018,6 +1018,18 @@ function test_get_lists_simple() { assertEquals(list.slice((-(0 + 3)))[0], 'Kirk', 'get #-end order simple'); } +// Tests the "get" block with create list call. +function test_get_lists_create_list() { + assertEquals(['Kirk', 'Spock', 'McCoy'][0], 'Kirk', 'get first create list'); + assertEquals(['Kirk', 'Spock', 'McCoy'].slice(-1)[0], 'McCoy', 'get last simple'); + assertEquals(['Kirk', 'Spock', 'McCoy'].indexOf(listsGetRandomItem(['Kirk', 'Spock', 'McCoy'], false)) + 1 > 0, true, 'get random simple'); + assertEquals(['Kirk', 'Spock', 'McCoy'][1], 'Spock', 'get # simple'); + assertEquals(['Kirk', 'Spock', 'McCoy'][((true ? 2 : null) - 1)], 'Spock', 'get # order simple'); + assertEquals(['Kirk', 'Spock', 'McCoy'].slice(-3)[0], 'Kirk', 'get #-end simple'); + // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + assertEquals(['Kirk', 'Spock', 'McCoy'].slice((-(0 + 3)))[0], 'Kirk', 'get #-end order simple'); +} + // Creates a list for use with the get test. function get_star_wars() { number_of_calls = (typeof number_of_calls == 'number' ? number_of_calls : 0) + 1; @@ -1557,6 +1569,7 @@ test_lists_length(); test_find_lists_simple(); test_find_lists_complex(); test_get_lists_simple(); +test_get_lists_create_list(); test_get_lists_complex(); test_getRemove(); test_remove(); diff --git a/tests/generators/golden/generated.lua b/tests/generators/golden/generated.lua index 9b6acfa8b..d96ad64a9 100644 --- a/tests/generators/golden/generated.lua +++ b/tests/generators/golden/generated.lua @@ -1123,13 +1123,6 @@ function test_get_lists_simple() end --- Creates a list for use with the get test. -function get_star_wars() - number_of_calls = number_of_calls + 1 - return {'Kirk', 'Spock', 'McCoy'} -end - - function list_get_last(t) return t[#t] end @@ -1142,6 +1135,26 @@ function list_get_from_end(t, at) return t[#t + 1 - at] end +-- Tests the "get" block with create list call. +function test_get_lists_create_list() + assertEquals(({'Kirk', 'Spock', 'McCoy'})[1], 'Kirk', 'get first create list') + assertEquals(list_get_last(({'Kirk', 'Spock', 'McCoy'})), 'McCoy', 'get last simple') + assertEquals(first_index({'Kirk', 'Spock', 'McCoy'}, list_get_random(({'Kirk', 'Spock', 'McCoy'}))) > 0, true, 'get random simple') + assertEquals(({'Kirk', 'Spock', 'McCoy'})[2], 'Spock', 'get # simple') + assertEquals(({'Kirk', 'Spock', 'McCoy'})[true and 2 or nil], 'Spock', 'get # order simple') + assertEquals(list_get_from_end(({'Kirk', 'Spock', 'McCoy'}), 3), 'Kirk', 'get #-end simple') + -- The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + assertEquals(list_get_from_end(({'Kirk', 'Spock', 'McCoy'}), 0 + 3), 'Kirk', 'get #-end order simple') +end + + +-- Creates a list for use with the get test. +function get_star_wars() + number_of_calls = number_of_calls + 1 + return {'Kirk', 'Spock', 'McCoy'} +end + + -- Tests the "get" block with a function call. function test_get_lists_complex() list = {'Kirk', 'Spock', 'McCoy'} @@ -1826,6 +1839,7 @@ test_lists_length() test_find_lists_simple() test_find_lists_complex() test_get_lists_simple() +test_get_lists_create_list() test_get_lists_complex() test_getRemove() test_remove() diff --git a/tests/generators/golden/generated.php b/tests/generators/golden/generated.php index a2d470de4..1b968b90d 100644 --- a/tests/generators/golden/generated.php +++ b/tests/generators/golden/generated.php @@ -1039,6 +1039,19 @@ function test_get_lists_simple() { assertEquals(array_slice($list2, (-(0 + 3)), 1)[0], 'Kirk', 'get #-end order simple'); } +// Tests the "get" block with create list call. +function test_get_lists_create_list() { + global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; + assertEquals(array('Kirk', 'Spock', 'McCoy')[0], 'Kirk', 'get first create list'); + assertEquals(end(array('Kirk', 'Spock', 'McCoy')), 'McCoy', 'get last simple'); + assertEquals(indexOf(array('Kirk', 'Spock', 'McCoy'), lists_get_random_item(array('Kirk', 'Spock', 'McCoy'))) > 0, true, 'get random simple'); + assertEquals(array('Kirk', 'Spock', 'McCoy')[1], 'Spock', 'get # simple'); + assertEquals(array('Kirk', 'Spock', 'McCoy')[((true ? 2 : null) - 1)], 'Spock', 'get # order simple'); + assertEquals(array_slice(array('Kirk', 'Spock', 'McCoy'), -3, 1)[0], 'Kirk', 'get #-end simple'); + // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + assertEquals(array_slice(array('Kirk', 'Spock', 'McCoy'), (-(0 + 3)), 1)[0], 'Kirk', 'get #-end order simple'); +} + // Creates a list for use with the get test. function get_star_wars() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; @@ -1650,6 +1663,7 @@ test_lists_length(); test_find_lists_simple(); test_find_lists_complex(); test_get_lists_simple(); +test_get_lists_create_list(); test_get_lists_complex(); test_getRemove(); test_remove(); diff --git a/tests/generators/golden/generated.py b/tests/generators/golden/generated.py index b20142bb6..8120ae899 100644 --- a/tests/generators/golden/generated.py +++ b/tests/generators/golden/generated.py @@ -872,6 +872,18 @@ def test_get_lists_simple(): # The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(list2[-int(0 + 3)], 'Kirk', 'get #-end order simple') +# Tests the "get" block with create list call. +def test_get_lists_create_list(): + global test_name, naked, proc_x, proc_y, func_x, func_y, func_a, n, ok, log, count, varToChange, rand, item, text, number_of_calls, list2, proc_z, func_z, x, proc_w, func_c, if2, i, loglist, changing_list, list_copy, unittestResults + assertEquals(['Kirk', 'Spock', 'McCoy'][0], 'Kirk', 'get first create list') + assertEquals(['Kirk', 'Spock', 'McCoy'][-1], 'McCoy', 'get last simple') + assertEquals(first_index(['Kirk', 'Spock', 'McCoy'], random.choice(['Kirk', 'Spock', 'McCoy'])) > 0, True, 'get random simple') + assertEquals(['Kirk', 'Spock', 'McCoy'][1], 'Spock', 'get # simple') + assertEquals(['Kirk', 'Spock', 'McCoy'][int((2 if True else None) - 1)], 'Spock', 'get # order simple') + assertEquals(['Kirk', 'Spock', 'McCoy'][-3], 'Kirk', 'get #-end simple') + # The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + assertEquals(['Kirk', 'Spock', 'McCoy'][-int(0 + 3)], 'Kirk', 'get #-end order simple') + # Creates a list for use with the get test. def get_star_wars(): global test_name, naked, proc_x, proc_y, func_x, func_y, func_a, n, ok, log, count, varToChange, rand, item, text, number_of_calls, list2, proc_z, func_z, x, proc_w, func_c, if2, i, loglist, changing_list, list_copy, unittestResults @@ -1395,6 +1407,7 @@ test_lists_length() test_find_lists_simple() test_find_lists_complex() test_get_lists_simple() +test_get_lists_create_list() test_get_lists_complex() test_getRemove() test_remove() diff --git a/tests/generators/lists.xml b/tests/generators/lists.xml index ccb76a946..ce8a14369 100644 --- a/tests/generators/lists.xml +++ b/tests/generators/lists.xml @@ -21,43 +21,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + @@ -97,7 +102,7 @@ - + @@ -133,7 +138,7 @@ - + test create lists Tests the "create list with" and "create empty list" blocks. @@ -289,7 +294,7 @@ - + get empty list Creates an empty list for use with the empty test. @@ -297,7 +302,7 @@ - + test lists empty Tests the "is empty" block. @@ -390,7 +395,7 @@ - + test lists length Tests the "length" block. @@ -524,7 +529,7 @@ - + test find lists simple Tests the "find" block with a variable. @@ -657,7 +662,7 @@ - + get names Creates a list for use with the find test. @@ -696,7 +701,7 @@ - + test find lists complex Tests the "find" block with a function call. @@ -1066,7 +1071,7 @@ - + test get lists simple Tests the "get" block with a variable. @@ -1356,7 +1361,392 @@ - + + test get lists create list + Tests the "get" block with create list call. + + + + + get first create list + + + + + + GET + FIRST + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + Kirk + + + + + + + get last simple + + + + + + GET + LAST + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + McCoy + + + + + TRUE + + + get random simple + + + + + GT + + + FIRST + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + GET + RANDOM + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + + + + + -1 + + + + + + + + + + + get # simple + + + + + + GET + FROM_START + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + 1 + + + + + + + + + Spock + + + + + + + get # order simple + + + + + + GET + FROM_START + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + TRUE + + + + + + + 1 + + + + + + + + + + + + + + Spock + + + + + + + get #-end simple + + + + + + GET + FROM_END + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + + + 2 + + + + + + + + + Kirk + + + + + + + get #-end order simple + + + + + + GET + FROM_END + The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. + + + + + + Kirk + + + + + Spock + + + + + McCoy + + + + + + + ADD + + + 0 + + + + + + + 2 + + + + + + + + + + + Kirk + + + + + + + + + + + + + + + + + + get star wars Creates a list for use with the get test. @@ -1390,7 +1780,7 @@ - + test get lists complex Tests the "get" block with a function call. @@ -2058,7 +2448,7 @@ - + test getRemove Tests the "get and remove" block. @@ -3009,7 +3399,7 @@ - + test remove Tests the "remove" block. @@ -3780,7 +4170,7 @@ - + test set Tests the "set" block. @@ -4641,7 +5031,7 @@ - + test insert Tests the "insert" block. @@ -5542,7 +5932,7 @@ - + test sublist simple Tests the "get sub-list" block with a variable. @@ -6417,7 +6807,7 @@ - + get space shuttles Creates a list for use with the sublist test. @@ -6461,7 +6851,7 @@ - + test sublist complex Tests the "get sub-list" block with a function call. @@ -7557,7 +7947,7 @@ - + test join Tests the "join" block. @@ -7658,7 +8048,7 @@ - + test split Tests the "split" block. @@ -7774,7 +8164,7 @@ - + test sort alphabetic Tests the "alphabetic sort" block. @@ -7895,7 +8285,7 @@ - + test sort ignoreCase Tests the "alphabetic sort ignore case" block. @@ -8016,7 +8406,7 @@ - + test sort numeric Tests the "numeric sort" block. @@ -8137,7 +8527,7 @@ - + test lists reverse Tests the "list reverse" block. @@ -8282,4 +8672,4 @@ - + \ No newline at end of file From a9223b0b2231ac4c7f081bd664e831d8f2d53b10 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Wed, 25 Mar 2020 15:47:27 -0700 Subject: [PATCH 096/105] Typo fixes. (#3769) --- .travis.yml | 2 +- blocks/math.js | 2 +- blocks/text.js | 2 +- core/block.js | 2 +- core/block_svg.js | 2 +- core/components/tree/basenode.js | 4 ++-- core/components/tree/treenode.js | 2 +- core/connection.js | 2 +- core/field.js | 2 +- core/grid.js | 2 +- core/keyboard_nav/ast_node.js | 2 +- core/keyboard_nav/basic_cursor.js | 2 +- core/keyboard_nav/navigation.js | 10 +++++----- core/mutator.js | 2 +- core/names.js | 2 +- core/renderers/common/constants.js | 4 ++-- core/renderers/measurables/types.js | 2 +- core/renderers/zelos/constants.js | 4 ++-- core/renderers/zelos/info.js | 4 ++-- core/renderers/zelos/path_object.js | 2 +- core/theme/tritanopia.js | 2 +- core/utils.js | 2 +- core/utils/svg_paths.js | 2 +- core/workspace_svg.js | 2 +- demos/blockfactory/app_controller.js | 2 +- demos/blockfactory/block_definition_extractor.js | 6 +++--- demos/blockfactory/block_exporter_view.js | 2 +- demos/blockfactory/blocks.js | 2 +- demos/blockfactory/factory_utils.js | 4 ++-- demos/blockfactory_old/blocks.js | 2 +- demos/blockfactory_old/factory.js | 6 +++--- demos/interpreter/async-execution.html | 2 +- demos/keyboard_nav/line_cursor.js | 2 +- demos/mobile/README.md | 2 +- demos/plane/soy/soyutils.js | 4 ++-- demos/storage/index.html | 2 +- scripts/gulpfiles/license_tasks.js | 2 +- scripts/gulpfiles/package_tasks.js | 2 +- tests/blocks/test_blocks.js | 6 +++--- 39 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.travis.yml b/.travis.yml index 643c96a63..287cf1f5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ node_js: addons: chrome: stable firefox: latest - # TODO (#2114): reenable osx build. + # TODO (#2114): re-enable osx build. # - os: osx # node_js: stable # osx_image: xcode8.3 diff --git a/blocks/math.js b/blocks/math.js index 3583d8d23..b6827c5b1 100644 --- a/blocks/math.js +++ b/blocks/math.js @@ -487,7 +487,7 @@ Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = { /** * 'math_is_divisibleby_mutator' extension to the 'math_property' block that * can update the block shape (add/remove divisor input) based on whether - * property is "divisble by". + * property is "divisible by". * @this {Blockly.Block} * @package */ diff --git a/blocks/text.js b/blocks/text.js index 5f04063e6..65710f1aa 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -285,7 +285,7 @@ Blockly.Blocks['text_getSubstring'] = { }, /** * Create or delete an input for a numeric index. - * This block has two such inputs, independant of each other. + * This block has two such inputs, independent of each other. * @param {number} n Specify first or second input (1 or 2). * @param {boolean} isAt True if the input should exist. * @private diff --git a/core/block.js b/core/block.js index 029677857..724e76777 100644 --- a/core/block.js +++ b/core/block.js @@ -939,7 +939,7 @@ Blockly.Block.prototype.setStyle = function(blockStyleName) { * initializer function. * @param {function(Blockly.Events.Abstract)} onchangeFn The callback to call * when the block's workspace changes. - * @throws {Error} if onchangeFn is not falsey or a function. + * @throws {Error} if onchangeFn is not falsey and not a function. */ Blockly.Block.prototype.setOnChange = function(onchangeFn) { if (onchangeFn && typeof onchangeFn != 'function') { diff --git a/core/block_svg.js b/core/block_svg.js index b0cff9c7e..bebf725b3 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -583,7 +583,7 @@ Blockly.BlockSvg.prototype.getBoundingRectangle = function() { /** * Notify every input on this block to mark its fields as dirty. - * A dirty field is a field that needs to be re-rendererd. + * A dirty field is a field that needs to be re-rendered. */ Blockly.BlockSvg.prototype.markDirty = function() { this.pathObject.constants = diff --git a/core/components/tree/basenode.js b/core/components/tree/basenode.js index a2ae42c20..1a9c8ca1c 100644 --- a/core/components/tree/basenode.js +++ b/core/components/tree/basenode.js @@ -498,7 +498,7 @@ Blockly.tree.BaseNode.prototype.setExpanded = function(expanded) { /** * Used to notify a node of that we have expanded it. - * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * Can be overridden by subclasses, see Blockly.tree.TreeNode. * @protected */ Blockly.tree.BaseNode.prototype.doNodeExpanded = function() { @@ -507,7 +507,7 @@ Blockly.tree.BaseNode.prototype.doNodeExpanded = function() { /** * Used to notify a node that we have collapsed it. - * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * Can be overridden by subclasses, see Blockly.tree.TreeNode. * @protected */ Blockly.tree.BaseNode.prototype.doNodeCollapsed = function() { diff --git a/core/components/tree/treenode.js b/core/components/tree/treenode.js index 30f72bfd5..612dcb4f4 100644 --- a/core/components/tree/treenode.js +++ b/core/components/tree/treenode.js @@ -167,7 +167,7 @@ Blockly.tree.TreeNode.prototype.doNodeExpanded = Blockly.tree.TreeNode.prototype.resizeToolbox_; /** - * Resize the toolbox when a node is collased. + * Resize the toolbox when a node is collapsed. * @override */ Blockly.tree.TreeNode.prototype.doNodeCollapsed = diff --git a/core/connection.js b/core/connection.js index 1a0d921d8..88d183157 100644 --- a/core/connection.js +++ b/core/connection.js @@ -158,7 +158,7 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { // Bump it off to the side after a moment. var group = Blockly.Events.getGroup(); setTimeout(function() { - // Verify orphan hasn't been deleted or reconnected (user on meth). + // Verify orphan hasn't been deleted or reconnected. if (orphanBlock.workspace && !orphanBlock.getParent()) { Blockly.Events.setGroup(group); if (orphanBlock.outputConnection) { diff --git a/core/field.js b/core/field.js index fdfc8e4c0..2c6328fc8 100644 --- a/core/field.js +++ b/core/field.js @@ -935,7 +935,7 @@ Blockly.Field.prototype.doValueUpdate_ = function(newValue) { }; /** - * Used to notify the field an invalid value was input. Can be overidden by + * Used to notify the field an invalid value was input. Can be overridden by * subclasses, see FieldTextInput. * No-op by default. * @param {*} _invalidValue The input value that was determined to be invalid. diff --git a/core/grid.js b/core/grid.js index b687dbb7d..89b1a4ca8 100644 --- a/core/grid.js +++ b/core/grid.js @@ -167,7 +167,7 @@ Blockly.Grid.prototype.setLineAttributes_ = function(line, width, * Move the grid to a new x and y position, and make sure that change is * visible. * @param {number} x The new x position of the grid (in px). - * @param {number} y The new y position ofthe grid (in px). + * @param {number} y The new y position of the grid (in px). * @package */ Blockly.Grid.prototype.moveTo = function(x, y) { diff --git a/core/keyboard_nav/ast_node.js b/core/keyboard_nav/ast_node.js index e85614766..4f111b84c 100644 --- a/core/keyboard_nav/ast_node.js +++ b/core/keyboard_nav/ast_node.js @@ -20,7 +20,7 @@ goog.require('Blockly.utils.Coordinate'); * It is recommended that you use one of the createNode methods instead of * creating a node directly. * @param {string} type The type of the location. - * Must be in Bockly.ASTNode.types. + * Must be in Blockly.ASTNode.types. * @param {!(Blockly.Block|Blockly.Connection|Blockly.Field|Blockly.Workspace)} * location The position in the AST. * @param {!Object=} opt_params Optional dictionary of options. diff --git a/core/keyboard_nav/basic_cursor.js b/core/keyboard_nav/basic_cursor.js index cb5e017c7..981c8cc89 100644 --- a/core/keyboard_nav/basic_cursor.js +++ b/core/keyboard_nav/basic_cursor.js @@ -79,7 +79,7 @@ Blockly.BasicCursor.prototype.prev = function() { }; /** - * For a basic cursor we only have the ability to go next and previou, so + * For a basic cursor we only have the ability to go next and previous, so * out will allow the user to get to the previous node in the pre order traversal. * @return {Blockly.ASTNode} The previous node, or null if the current node is * not set or there is no previous value. diff --git a/core/keyboard_nav/navigation.js b/core/keyboard_nav/navigation.js index 6738af1a0..385ef676a 100644 --- a/core/keyboard_nav/navigation.js +++ b/core/keyboard_nav/navigation.js @@ -782,7 +782,7 @@ Blockly.navigation.onBlocklyAction = function(action) { } else if (Blockly.navigation.READONLY_ACTION_LIST.indexOf(action) > -1) { actionHandled = Blockly.navigation.handleActions_(action); } - // If not in accessibility mode only hanlde turning on keyboard navigation. + // If not in accessibility mode only handle turning on keyboard navigation. } else if (action.name === Blockly.navigation.actionNames.TOGGLE_KEYBOARD_NAV) { Blockly.navigation.enableKeyboardAccessibility(); actionHandled = true; @@ -1031,7 +1031,7 @@ Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV = new Blockly.Action( 'Turns on and off keyboard navigation.'); /** - * The action to move the cursor to the keft on a worksapce. + * The action to move the cursor to the left on a workspace. * @type {!Blockly.Action} */ Blockly.navigation.ACTION_MOVE_WS_CURSOR_LEFT = new Blockly.Action( @@ -1039,7 +1039,7 @@ Blockly.navigation.ACTION_MOVE_WS_CURSOR_LEFT = new Blockly.Action( 'Move the workspace cursor to the lefts.'); /** - * The action to move the cursor to the right on a worksapce. + * The action to move the cursor to the right on a workspace. * @type {!Blockly.Action} */ Blockly.navigation.ACTION_MOVE_WS_CURSOR_RIGHT = new Blockly.Action( @@ -1047,7 +1047,7 @@ Blockly.navigation.ACTION_MOVE_WS_CURSOR_RIGHT = new Blockly.Action( 'Move the workspace cursor to the right.'); /** - * The action to move the cursor up on a worksapce. + * The action to move the cursor up on a workspace. * @type {!Blockly.Action} */ Blockly.navigation.ACTION_MOVE_WS_CURSOR_UP = new Blockly.Action( @@ -1055,7 +1055,7 @@ Blockly.navigation.ACTION_MOVE_WS_CURSOR_UP = new Blockly.Action( 'Move the workspace cursor up.'); /** - * The action to move the cursor down on a worksapce. + * The action to move the cursor down on a workspace. * @type {!Blockly.Action} */ Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN = new Blockly.Action( diff --git a/core/mutator.js b/core/mutator.js index 00e996a84..313e3f101 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -294,7 +294,7 @@ Blockly.Mutator.prototype.setVisible = function(visible) { for (var i = 0, child; (child = blocks[i]); i++) { child.render(); } - // The root block should not be dragable or deletable. + // The root block should not be draggable or deletable. this.rootBlock_.setMovable(false); this.rootBlock_.setDeletable(false); if (flyout) { diff --git a/core/names.js b/core/names.js index 877bb8f2f..8772f1e41 100644 --- a/core/names.js +++ b/core/names.js @@ -82,7 +82,7 @@ Blockly.Names.prototype.setVariableMap = function(map) { Blockly.Names.prototype.getNameForUserVariable_ = function(id) { if (!this.variableMap_) { console.log('Deprecated call to Blockly.Names.prototype.getName without ' + - 'defining a variable map. To fix, add the folowing code in your ' + + 'defining a variable map. To fix, add the following code in your ' + 'generator\'s init() function:\n' + 'Blockly.YourGeneratorName.variableDB_.setVariableMap(' + 'workspace.getVariableMap());'); diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 343bcfd31..6708c09f4 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -595,7 +595,7 @@ Blockly.blockRendering.ConstantProvider.prototype.setTheme = function( }; /** - * Sets dynamic properties that depent on other values or theme properties. + * Sets dynamic properties that depend on other values or theme properties. * @param {!Blockly.Theme} theme The current workspace theme. * @protected */ @@ -1211,7 +1211,7 @@ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) { 'stroke: #fc3;', '}', - // Replacable highlight. + // Replaceable highlight. selector + ' .blocklyReplaceable .blocklyPath {', 'fill-opacity: .5;', '}', diff --git a/core/renderers/measurables/types.js b/core/renderers/measurables/types.js index 9e94ebf08..02e5b9a9a 100644 --- a/core/renderers/measurables/types.js +++ b/core/renderers/measurables/types.js @@ -79,7 +79,7 @@ Blockly.blockRendering.Types.nextTypeValue_ = 1 << 24; /** * Get the enum flag value of an existing type or register a new type. * @param {!string} type The name of the type. - * @return {!number} The enum flag value assosiated with that type. + * @return {!number} The enum flag value associated with that type. * @package */ Blockly.blockRendering.Types.getType = function(type) { diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index f37c37b87..cac9a0545 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -478,7 +478,7 @@ Blockly.zelos.ConstantProvider.prototype.makeHexagonal = function() { var maxWidth = this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; // The main path for the hexagonal connection shape is made out of two lines. - // The lines are defined with relative positons and require the block height. + // The lines are defined with relative positions and require the block height. // The 'up' and 'down' versions of the paths are the same, but the Y sign // flips. The 'left' and 'right' versions of the path are also the same, but // the X sign flips. @@ -650,7 +650,7 @@ Blockly.zelos.ConstantProvider.prototype.shapeFor = function( case Blockly.INPUT_VALUE: case Blockly.OUTPUT_VALUE: var outputShape = connection.getSourceBlock().getOutputShape(); - // If the block has an ouput shape set, use that instead. + // If the block has an output shape set, use that instead. if (outputShape != null) { switch (outputShape) { case this.SHAPES.HEXAGONAL: return this.HEXAGONAL; diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index 0996cf505..ac822772b 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -107,7 +107,7 @@ Blockly.zelos.RenderInfo.prototype.getRenderer = function() { * @override */ Blockly.zelos.RenderInfo.prototype.measure = function() { - // Modifing parent measure method to add `adjustXPosition_`. + // Modifying parent measure method to add `adjustXPosition_`. this.createRows_(); this.addElemSpacing_(); this.addRowSpacing_(); @@ -386,7 +386,7 @@ Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_ = function() { this.outputConnection.shape.connectionOffsetX(connectionWidth); // Add the right connection measurable. - // Don't add it if we have a value-to-statament or a value-to-stack block. + // Don't add it if we have a value-to-statement or a value-to-stack block. var rightConnectionWidth = 0; if (!this.hasStatementInput && !this.bottomRow.hasNextConnection) { rightConnectionWidth = connectionWidth; diff --git a/core/renderers/zelos/path_object.js b/core/renderers/zelos/path_object.js index 3bca20b0f..360f329af 100644 --- a/core/renderers/zelos/path_object.js +++ b/core/renderers/zelos/path_object.js @@ -57,7 +57,7 @@ Blockly.zelos.PathObject = function(root, style, constants) { /** * A set used to determine which outlines were used during a draw pass. The * set is initialized with a reference to all the outlines in - * `this.outlines_`. Everytime we use an outline during the draw pass, the + * `this.outlines_`. Every time we use an outline during the draw pass, the * reference is removed from this set. * @type {Object.} * @private diff --git a/core/theme/tritanopia.js b/core/theme/tritanopia.js index 1087af788..544e10600 100644 --- a/core/theme/tritanopia.js +++ b/core/theme/tritanopia.js @@ -6,7 +6,7 @@ /** * @fileoverview Tritanopia theme. - * A color palette for people that have tritanopia(the inability to perceive + * A color palette for people that have tritanopia (the inability to perceive * blue light). */ 'use strict'; diff --git a/core/utils.js b/core/utils.js index e03337b3a..cfd047ca1 100644 --- a/core/utils.js +++ b/core/utils.js @@ -579,7 +579,7 @@ Blockly.utils.getBlockTypeCounts = function(block, opt_stripFollowing) { * Converts screen coordinates to workspace coordinates. * @param {Blockly.WorkspaceSvg} ws The workspace to find the coordinates on. * @param {Blockly.utils.Coordinate} screenCoordinates The screen coordinates to - * be converted to workspace coordintaes + * be converted to workspace coordinates * @return {Blockly.utils.Coordinate} The workspace coordinates. * @package */ diff --git a/core/utils/svg_paths.js b/core/utils/svg_paths.js index 8ef77ca07..d2066599a 100644 --- a/core/utils/svg_paths.js +++ b/core/utils/svg_paths.js @@ -33,7 +33,7 @@ Blockly.utils.svgPaths.point = function(x, y) { }; /** - * Draw a curbic or quadratic curve. See + * Draw a cubic or quadratic curve. See * developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Cubic_B%C3%A9zier_Curve * These coordinates are unitless and hence in the user coordinate system. * @param {string} command The command to use. diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 5896fb4ad..060ec942c 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -2310,7 +2310,7 @@ Blockly.WorkspaceSvg.getContentDimensionsBounded_ = function(ws, svgSize) { var halfWidth = viewWidth / 2; var halfHeight = viewHeight / 2; - // Add a border around the content that is at least half a screenful wide. + // Add a border around the content that is at least half a screen wide. // Ensure border is wide enough that blocks can scroll over entire screen. var left = Math.min(content.left - halfWidth, content.right - viewWidth); var right = Math.max(content.right + halfWidth, content.left + viewWidth); diff --git a/demos/blockfactory/app_controller.js b/demos/blockfactory/app_controller.js index 49e0ec0a3..911d3ae95 100644 --- a/demos/blockfactory/app_controller.js +++ b/demos/blockfactory/app_controller.js @@ -162,7 +162,7 @@ AppController.prototype.formatBlockLibraryForImport_ = function(xmlText) { // since the addition to editorWorkspaceXml below removes it from inputXml. var inputChildren = Array.from(inputXml.children); - // Create empty map. The line below creates a truly empy object. It doesn't + // Create empty map. The line below creates a truly empty object. It doesn't // have built-in attributes/functions such as length or toString. var blockXmlTextMap = Object.create(null); diff --git a/demos/blockfactory/block_definition_extractor.js b/demos/blockfactory/block_definition_extractor.js index f684c75df..10d9d0f7b 100644 --- a/demos/blockfactory/block_definition_extractor.js +++ b/demos/blockfactory/block_definition_extractor.js @@ -556,7 +556,7 @@ BlockDefinitionExtractor.buildFieldColour_ = }; /** - * Creates a element representing a FieldVaraible definition. + * Creates a element representing a FieldVariable definition. * * @param {string} fieldName The identifying name of the field. * @param {string} varName The variables @@ -579,7 +579,7 @@ BlockDefinitionExtractor.buildFieldVariable_ = function(fieldName, varName) { * @param {string} src The URL of the field image. * @param {number} width The pixel width of the source image * @param {number} height The pixel height of the source image. - * @param {string} alt Alterante text to describe image. + * @param {string} alt Alternate text to describe image. * @private */ BlockDefinitionExtractor.buildFieldImage_ = @@ -693,7 +693,7 @@ BlockDefinitionExtractor.typeList_ = function() { * Creates a element representing the given custom connection * constraint type name. * - * @param {string} type The connection constratin type name. + * @param {string} type The connection constraint type name. * @return {Element} The element representing a custom input type * constraint. * @private diff --git a/demos/blockfactory/block_exporter_view.js b/demos/blockfactory/block_exporter_view.js index 6fae78f35..f505438a7 100644 --- a/demos/blockfactory/block_exporter_view.js +++ b/demos/blockfactory/block_exporter_view.js @@ -51,7 +51,7 @@ BlockExporterView.prototype.select = function(blockType) { /** * Deselects a block in the selector. - * @param {!Blockly.Block} block Type of block to add to selector workspce. + * @param {!Blockly.Block} block Type of block to add to selector workspace. */ BlockExporterView.prototype.deselect = function(blockType) { this.blockOptions[blockType].setSelected(false); diff --git a/demos/blockfactory/blocks.js b/demos/blockfactory/blocks.js index c29032b9b..c7253cc67 100644 --- a/demos/blockfactory/blocks.js +++ b/demos/blockfactory/blocks.js @@ -64,7 +64,7 @@ Blockly.Blocks['factory_base'] = { }, spawnOutputShadow_: function(option) { // Helper method for deciding which type of outputs this block needs - // to attach shaddow blocks to. + // to attach shadow blocks to. switch (option) { case 'LEFT': this.connectOutputShadow_('OUTPUTTYPE'); diff --git a/demos/blockfactory/factory_utils.js b/demos/blockfactory/factory_utils.js index 40ed6b998..8c1941d10 100644 --- a/demos/blockfactory/factory_utils.js +++ b/demos/blockfactory/factory_utils.js @@ -163,7 +163,7 @@ FactoryUtils.getGeneratorStub = function(block, generatorLanguage) { * Update the language code as JSON. * @param {string} blockType Name of block. * @param {!Blockly.Block} rootBlock Factory_base block. - * @return {string} Generanted language code. + * @return {string} Generated language code. * @private */ FactoryUtils.formatJson_ = function(blockType, rootBlock) { @@ -830,7 +830,7 @@ FactoryUtils.parseJsonBlockDefinitions = function(blockDefsString) { else if (currentChar == '}') { unbalancedBracketCount--; if (unbalancedBracketCount == 0 && i > 0) { - // The brackets are balanced. We've got a complete block defintion. + // The brackets are balanced. We've got a complete block definition. var blockDef = blockDefsString.substring(defStart, i + 1); blockDefArray.push(blockDef); defStart = i + 1; diff --git a/demos/blockfactory_old/blocks.js b/demos/blockfactory_old/blocks.js index 2f66b519b..050e53147 100644 --- a/demos/blockfactory_old/blocks.js +++ b/demos/blockfactory_old/blocks.js @@ -58,7 +58,7 @@ Blockly.Blocks['factory_base'] = { }, spawnOutputShadow_: function(option) { // Helper method for deciding which type of outputs this block needs - // to attach shaddow blocks to. + // to attach shadow blocks to. switch (option) { case 'LEFT': this.connectOutputShadow_('OUTPUTTYPE'); diff --git a/demos/blockfactory_old/factory.js b/demos/blockfactory_old/factory.js index 723650c79..967d2a440 100644 --- a/demos/blockfactory_old/factory.js +++ b/demos/blockfactory_old/factory.js @@ -81,7 +81,7 @@ function updateLanguage() { * Update the language code as JSON. * @param {string} blockType Name of block. * @param {!Blockly.Block} rootBlock Factory_base block. - * @return {string} Generanted language code. + * @return {string} Generated language code. * @private */ function formatJson_(blockType, rootBlock) { @@ -183,7 +183,7 @@ function formatJson_(blockType, rootBlock) { * Update the language code as JavaScript. * @param {string} blockType Name of block. * @param {!Blockly.Block} rootBlock Factory_base block. - * @return {string} Generanted language code. + * @return {string} Generated language code. * @private */ function formatJavaScript_(blockType, rootBlock) { @@ -487,7 +487,7 @@ function getFieldsJson_(block) { /** * Escape a string. * @param {string} string String to escape. - * @return {string} Escaped string surrouned by quotes. + * @return {string} Escaped string surrounded by quotes. */ function escapeString(string) { return JSON.stringify(string); diff --git a/demos/interpreter/async-execution.html b/demos/interpreter/async-execution.html index 52024275e..70f2492d2 100644 --- a/demos/interpreter/async-execution.html +++ b/demos/interpreter/async-execution.html @@ -24,7 +24,7 @@

    Blockly > Demos > Asynchronous Execution with JS Interpreter

    -

    This is a demo of executing code asychronously (e.g., waiting for delays or user input) using the JavaScript interpreter.

    +

    This is a demo of executing code asynchronously (e.g., waiting for delays or user input) using the JavaScript interpreter.

    More info on running code with JS Interpreter

    diff --git a/demos/keyboard_nav/line_cursor.js b/demos/keyboard_nav/line_cursor.js index 85de8300e..d9cb80689 100644 --- a/demos/keyboard_nav/line_cursor.js +++ b/demos/keyboard_nav/line_cursor.js @@ -99,7 +99,7 @@ Blockly.LineCursor.prototype.prev = function() { }; /** - * For a basic cursor we only have the ability to go next and previou, so + * For a basic cursor we only have the ability to go next and previous, so * out will allow the user to get to the previous node in the pre order traversal. * @return {Blockly.ASTNode} The previous node, or null if the current node is * not set or there is no previous value. diff --git a/demos/mobile/README.md b/demos/mobile/README.md index bab09606b..168690e55 100644 --- a/demos/mobile/README.md +++ b/demos/mobile/README.md @@ -15,7 +15,7 @@ see changes in both the Android and iOS native apps. Before running the mobile HTML demo, you need to create some symbolic links in your local file system. Run the `mobile/html/ln_resources.sh` file from -the `mobile/html/` directory. This mimicks the relative locations of the +the `mobile/html/` directory. This mimics the relative locations of the Blockly files seen when loading the page in a native app's embedded WebView. After doing this, opening `mobile/html/index.html` should open normally, diff --git a/demos/plane/soy/soyutils.js b/demos/plane/soy/soyutils.js index 861c81f9f..949777cb9 100644 --- a/demos/plane/soy/soyutils.js +++ b/demos/plane/soy/soyutils.js @@ -1469,7 +1469,7 @@ soydata.VERY_UNSAFE.ordainSanitizedJs = // finally printed. /** * Takes a leap of faith that the provided content can be safely embedded in - * a Javascript string without re-esacping. + * a Javascript string without re-escaping. * * @param {*} content Content that can be safely inserted as part of a * single- or double-quoted string without terminating the string. @@ -2479,7 +2479,7 @@ soy.$$changeNewlineToBr = function(value) { /** * Inserts word breaks ('wbr' tags) into a HTML string at a given interval. The * counter is reset if a space is encountered. Word breaks aren't inserted into - * HTML tags or entities. Entites count towards the character count; HTML tags + * HTML tags or entities. Entities count towards the character count; HTML tags * do not. * * @param {*} value The HTML string to insert word breaks into. Can be other diff --git a/demos/storage/index.html b/demos/storage/index.html index 759dc2b83..41462e295 100644 --- a/demos/storage/index.html +++ b/demos/storage/index.html @@ -86,7 +86,7 @@ {media: '../../media/', toolbox: document.getElementById('toolbox')}); - // An href with #key trigers an AJAX call to retrieve saved blocks. + // An href with #key triggers an AJAX call to retrieve saved blocks. if ('BlocklyStorage' in window && window.location.hash.length > 1) { BlocklyStorage.retrieveXml(window.location.hash.substring(1)); } diff --git a/scripts/gulpfiles/license_tasks.js b/scripts/gulpfiles/license_tasks.js index 9d4fd785d..3e6b93efb 100644 --- a/scripts/gulpfiles/license_tasks.js +++ b/scripts/gulpfiles/license_tasks.js @@ -5,7 +5,7 @@ */ /** - * @fileoverview Gulp tasks to check the licenses of Blockly depenedencies. + * @fileoverview Gulp tasks to check the licenses of Blockly dependencies. */ const jsgl = require('js-green-licenses'); diff --git a/scripts/gulpfiles/package_tasks.js b/scripts/gulpfiles/package_tasks.js index 7ba3b4146..c711231af 100644 --- a/scripts/gulpfiles/package_tasks.js +++ b/scripts/gulpfiles/package_tasks.js @@ -70,7 +70,7 @@ function packageBlockly() { /** * This task wraps blocks_compressed.js into a CommonJS module for Node.js. - * This is an equivelant task to package-blockly but for Node.js. + * This is an equivalent task to package-blockly but for Node.js. * @example import 'blockly/blockly-node'; */ function packageBlocklyNode() { diff --git a/tests/blocks/test_blocks.js b/tests/blocks/test_blocks.js index c14ee2544..47b44317d 100644 --- a/tests/blocks/test_blocks.js +++ b/tests/blocks/test_blocks.js @@ -1335,7 +1335,7 @@ Blockly.Blocks['test_images_clickhandler'] = { .appendField("Image click handler") .appendField(new Blockly.FieldImage( "https://blockly-demo.appspot.com/static/tests/media/a.png", 32, 32, - "image with click handlder", this.onClick_), "IMAGE"); + "image with click handler", this.onClick_), "IMAGE"); this.setStyle('text_blocks'); }, onClick_: function() { @@ -1489,7 +1489,7 @@ Blockly.Blocks['test_validators_checkbox_not_match_null'] = { this.setCommentText('The validator for this block only works on the' + ' end-most checkbox. If the new value does not match the value of the' + ' start-most checkbox, it will return null (invalid), which means the' + - ' field value should not change. Therfore they should always match.'); + ' field value should not change. Therefore they should always match.'); }, validate: function(newValue) { @@ -1635,7 +1635,7 @@ Blockly.Blocks['test_validators_number_mult10_force'] = { .appendField("force mult of 10") .appendField(new Blockly.FieldNumber(123, null, null, null, this.validate), "INPUT"); this.setColour(230); - this.setCommentText('Theinput value will be rounded to the nearest' + + this.setCommentText('The input value will be rounded to the nearest' + ' multiple of 10. The field will display the input while the field is' + ' being edited, but the value should be the validated (rounded) value.' + ' Note: If you want to do rounding this is not the proper way, use the' + From ce6dd329a80b30754d38c8d7dfe8430f9746e962 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Fri, 27 Mar 2020 09:29:20 -0700 Subject: [PATCH 097/105] Fix plane demo bug. (#3774) * Fix plane demo bug. --- demos/plane/blocks.js | 18 ++++++++++++------ demos/plane/plane.js | 19 +++++++++---------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/demos/plane/blocks.js b/demos/plane/blocks.js index b4b378c40..d5f80a321 100644 --- a/demos/plane/blocks.js +++ b/demos/plane/blocks.js @@ -35,12 +35,14 @@ Blockly.Blocks['plane_get_rows'] = { this.setHelpUrl(Blockly.Msg['VARIABLES_GET_HELPURL']); this.setColour(330); this.appendDummyInput() - .appendField(Plane.getMsg('Plane_getRows'), 'title'); + .appendField(Plane.getMsg('Plane_getRows') + .replace('%1', Plane.rows1st), 'title'); this.setOutput(true, 'Number'); }, customUpdate: function() { this.setFieldValue( - Plane.getMsg('Plane_getRows').replace('%1', Plane.rows1st), 'title'); + Plane.getMsg('Plane_getRows') + .replace('%1', Plane.rows1st), 'title'); } }; @@ -55,12 +57,14 @@ Blockly.Blocks['plane_get_rows1st'] = { this.setHelpUrl(Blockly.Msg['VARIABLES_GET_HELPURL']); this.setColour(330); this.appendDummyInput() - .appendField(Plane.getMsg('Plane_getRows1'), 'title'); + .appendField(Plane.getMsg('Plane_getRows1') + .replace('%1', Plane.rows1st), 'title'); this.setOutput(true, 'Number'); }, customUpdate: function() { this.setFieldValue( - Plane.getMsg('Plane_getRows1').replace('%1', Plane.rows1st), 'title'); + Plane.getMsg('Plane_getRows1') + .replace('%1', Plane.rows1st), 'title'); } }; @@ -75,12 +79,14 @@ Blockly.Blocks['plane_get_rows2nd'] = { this.setHelpUrl(Blockly.Msg['VARIABLES_GET_HELPURL']); this.setColour(330); this.appendDummyInput() - .appendField(Plane.getMsg('Plane_getRows2'), 'title'); + .appendField(Plane.getMsg('Plane_getRows2') + .replace('%1', Plane.rows2nd), 'title'); this.setOutput(true, 'Number'); }, customUpdate: function() { this.setFieldValue( - Plane.getMsg('Plane_getRows2').replace('%1', Plane.rows2nd), 'title'); + Plane.getMsg('Plane_getRows2') + .replace('%1', Plane.rows2nd), 'title'); } }; diff --git a/demos/plane/plane.js b/demos/plane/plane.js index d6f02ef36..bc5cf512c 100644 --- a/demos/plane/plane.js +++ b/demos/plane/plane.js @@ -200,12 +200,20 @@ Plane.rows1st = 0; Plane.rows2nd = 0; /** - * Redraw the rows when the slider has moved. + * Redraw the rows and update blocks when the slider has moved. * @param {number} value New slider position. */ Plane.sliderChange = function(value) { var newRows = Math.round(value * 410 / 20); Plane.redraw(newRows); + + function updateBlocks(blocks) { + for (var i = 0, block; block = blocks[i]; i++) { + block.customUpdate && block.customUpdate(); + } + } + updateBlocks(Plane.workspace.getAllBlocks(false), true); + updateBlocks(Plane.workspace.flyout_.workspace_.getAllBlocks(false)); }; /** @@ -340,15 +348,6 @@ Plane.recalculate = function() { Plane.getMsg('Plane_seats').replace( '%1', isNaN(seats) ? '?' : seats)); Plane.setCorrect(isNaN(seats) ? null : (Plane.answer() == seats)); - - // Update blocks to show values. - function updateBlocks(blocks) { - for (var i = 0, block; block = blocks[i]; i++) { - block.customUpdate && block.customUpdate(); - } - } - updateBlocks(Plane.workspace.getAllBlocks(false)); - updateBlocks(Plane.workspace.flyout_.workspace_.getAllBlocks(false)); }; /** From e1e99fd2fefe388756135fdf709136365bb7e5ed Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 27 Mar 2020 16:05:53 -0700 Subject: [PATCH 098/105] Ran npm update and npm audit fix (#3776) --- package-lock.json | 901 +++++++++++++++++++++++++++++++--------------- package.json | 18 +- 2 files changed, 615 insertions(+), 304 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5172d6e9c..fd5c471c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,75 +45,174 @@ "defer-to-connect": "^1.0.1" } }, - "@wdio/config": { - "version": "5.13.0-alpha.0", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-5.13.0-alpha.0.tgz", - "integrity": "sha512-rcwtVtvmvN/F0HXhxVVv5YxPdJrrOODIZDmk/ftkwbwzpmPyIuP787YSGNgrVflLdXaDy0yIoew0rb5hPAq3bw==", + "@types/caseless": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", + "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", + "dev": true + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/node": { + "version": "13.9.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.5.tgz", + "integrity": "sha512-hkzMMD3xu6BrJpGVLeQ3htQQNAcOrJjX7WFmtK8zWQpz2UJf13LCFF2ALA7c9OVdvc2vQJeDdjfR35M0sBCxvw==", + "dev": true + }, + "@types/request": { + "version": "2.48.4", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.4.tgz", + "integrity": "sha512-W1t1MTKYR8PxICH+A4HgEIPuAC3sbljoEVfyZbeFJJDbr30guDspJri2XOaM2E+Un7ZjrihaDi7cf6fPa2tbgw==", "dev": true, "requires": { - "@wdio/logger": "^5.12.1", + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + }, + "dependencies": { + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } + } + }, + "@types/tough-cookie": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.6.tgz", + "integrity": "sha512-wHNBMnkoEBiRAd3s8KTKwIuO9biFtTf0LehITzBhSco+HQI0xkXZbLOD55SW3Aqw3oUkHstkm5SPv58yaAdFPQ==", + "dev": true + }, + "@wdio/config": { + "version": "5.22.4", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-5.22.4.tgz", + "integrity": "sha512-i5dJQWb80darcRA//tfG0guMeQCeRUXroZNnHjGNb1qzvTRZmcIIhdxaD+DbK/5dWEx6aoMfoi6wjVp/CXwdAg==", + "dev": true, + "requires": { + "@wdio/logger": "5.16.10", "deepmerge": "^4.0.0", "glob": "^7.1.2" } }, "@wdio/logger": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-5.12.1.tgz", - "integrity": "sha512-KUmdS0Scj0T5UQGtcWFiQRqc0NpFLQ/vSvRxlDzzkoeGwwPINqTRkLT103KL7Lyitlm9uLfaFfYc2KSzynTung==", + "version": "5.16.10", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-5.16.10.tgz", + "integrity": "sha512-hRKhxgd9uB48Dtj2xe2ckxU4KwI/RO8IwguySuaI2SLFj6EDbdonwzpVkq111/fjBuq7R1NauAaNcm3AMEbIFA==", "dev": true, "requires": { - "chalk": "^2.3.0", + "chalk": "^3.0.0", "loglevel": "^1.6.0", "loglevel-plugin-prefix": "^0.8.4", - "strip-ansi": "^5.2.0" + "strip-ansi": "^6.0.0" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" } } } }, "@wdio/protocols": { - "version": "5.13.0-alpha.0", - "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-5.13.0-alpha.0.tgz", - "integrity": "sha512-1/7PhkRv3dCB8P+/yVVMXubus3xVcLh30wPcxSJS//rvcu9EU6hU4XEzJro3Ja0ixCFP4WIqnKda7Vre5EaOoQ==", + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-5.22.1.tgz", + "integrity": "sha512-GdoWb/HTrb09Qb0S/7sLp1NU94LAhTsF1NnFj5sEFSUpecrl0S07pnhVg54pUImectN/woaqSl7uJGjlSGZcdQ==", "dev": true }, "@wdio/repl": { - "version": "5.13.0-alpha.0", - "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-5.13.0-alpha.0.tgz", - "integrity": "sha512-yjMMhfqX58Drha6OsQuFUGdRwx58F4E42zp8M4DLJU1sD9Mg0uqRjmF8TPSUoYn3QqUNCclhL+UHU5lEuAWlSg==", + "version": "5.18.6", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-5.18.6.tgz", + "integrity": "sha512-z9UPBk/Uee0l9g0ijnOatU3WP7TcpIyNtRj9AGsJVbYZFwqMWBqPkO4nblldyNQIuqdgXAPsDo8lPGDno12/oA==", "dev": true, "requires": { - "@wdio/config": "^5.13.0-alpha.0" + "@wdio/utils": "5.18.6" } }, "@wdio/utils": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-5.13.0.tgz", - "integrity": "sha512-SUzI694Vu8a8IMRgVpglyOlJ2JzSSrZT+YnbSgk+A1QpT/Azv1xnGJ6t48bpK3XrxpYBGOajADdOWoOydO86pg==", + "version": "5.18.6", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-5.18.6.tgz", + "integrity": "sha512-OVdK7P9Gne9tR6dl1GEKucwX4mtS47F26g4lH8r0HURvMegZLGtcchI1cqF6hjK7EpP737b+C3q4ooZSBdH9XQ==", "dev": true, "requires": { - "@wdio/logger": "^5.12.1", + "@wdio/logger": "5.16.10", "deepmerge": "^4.0.0" } }, "abab": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.1.tgz", - "integrity": "sha512-1zSbbCuoIjafKZ3mblY5ikvAb0ODUbqBnFuUb7f6uLeQhhGJ0vEV4ntmtxKLT2WgXCO94E07BjunsIw1jOMPZw==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", + "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==" }, "abort-controller": { "version": "3.0.0", @@ -125,9 +224,9 @@ } }, "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "acorn-globals": { "version": "4.3.4", @@ -249,18 +348,20 @@ }, "dependencies": { "bl": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", - "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", + "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", "dev": true, "requires": { - "readable-stream": "^3.0.1" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -269,12 +370,12 @@ } }, "tar-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", - "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz", + "integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==", "dev": true, "requires": { - "bl": "^3.0.0", + "bl": "^4.0.1", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", @@ -501,11 +602,6 @@ "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, "async-settle": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", @@ -532,9 +628,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" }, "bach": { "version": "1.2.0", @@ -696,9 +792,9 @@ } }, "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" }, "browser-stdout": { "version": "1.3.1", @@ -707,9 +803,9 @@ "dev": true }, "buffer": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", - "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", "dev": true, "requires": { "base64-js": "^1.0.2", @@ -1051,9 +1147,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "component-emitter": { @@ -1215,9 +1311,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -1247,16 +1343,23 @@ "dev": true }, "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==" }, "cssstyle": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", - "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.2.0.tgz", + "integrity": "sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA==", "requires": { - "cssom": "0.3.x" + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" + } } }, "d": { @@ -1350,9 +1453,9 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, "deepmerge": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.0.0.tgz", - "integrity": "sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, "default-compare": { @@ -1461,9 +1564,9 @@ } }, "dom-serializer": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.1.tgz", - "integrity": "sha512-sK3ujri04WyjwQXVoK4PU3y8ula1stq10GJZpqHIUgoGZdsGzAGu65BnU3d08aTVSvO7mGPZUc0wTEDL+qGE0Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, "requires": { "domelementtype": "^2.0.1", @@ -1591,27 +1694,36 @@ } }, "es-abstract": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz", - "integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.0", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-inspect": "^1.6.0", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", "object-keys": "^1.1.1", - "string.prototype.trimleft": "^2.0.0", - "string.prototype.trimright": "^2.0.0" + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", @@ -1723,12 +1835,29 @@ "strip-json-comments": "^2.0.1", "table": "^5.2.3", "text-table": "^0.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "eslint-plugin-es5": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es5/-/eslint-plugin-es5-1.4.1.tgz", - "integrity": "sha512-kktkmkF2O7pnSZYgrMiYMbt3wCKRIiXePwILv8USDG95YgP0PzhIxSIROLLKmiQQ/Z6LuhDGWTHK04gnbXBvkg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es5/-/eslint-plugin-es5-1.5.0.tgz", + "integrity": "sha512-Qxmfo7v2B7SGAEURJo0dpBweFf+JU15kSyALfiB2rXWcBuJ96r6X9kFHXFnhdopPHCaHjoQs1xQPUJVbGMb1AA==", "dev": true }, "eslint-scope": { @@ -2120,9 +2249,9 @@ }, "dependencies": { "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", "dev": true } } @@ -2978,9 +3107,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true } } @@ -3711,9 +3840,9 @@ "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", "dev": true }, "is-data-descriptor": { @@ -3737,9 +3866,9 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-descriptor": { @@ -3830,12 +3959,12 @@ "dev": true }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-relative": { @@ -3854,12 +3983,20 @@ "dev": true }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } } }, "is-typedarray": { @@ -4017,6 +4154,21 @@ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "strip-json-comments": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", @@ -4026,21 +4178,21 @@ } }, "jsdom": { - "version": "15.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.1.1.tgz", - "integrity": "sha512-cQZRBB33arrDAeCrAEWn1U3SvrvC8XysBua9Oqg1yWrsY/gYcusloJC3RZJXuY5eehSCmws8f2YeliCqGSkrtQ==", + "version": "15.2.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.2.1.tgz", + "integrity": "sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g==", "requires": { "abab": "^2.0.0", - "acorn": "^6.1.1", + "acorn": "^7.1.0", "acorn-globals": "^4.3.2", "array-equal": "^1.0.0", - "cssom": "^0.3.6", - "cssstyle": "^1.2.2", + "cssom": "^0.4.1", + "cssstyle": "^2.0.0", "data-urls": "^1.1.0", "domexception": "^1.0.1", "escodegen": "^1.11.1", "html-encoding-sniffer": "^1.0.2", - "nwsapi": "^2.1.4", + "nwsapi": "^2.2.0", "parse5": "5.1.0", "pn": "^1.1.0", "request": "^2.88.0", @@ -4056,12 +4208,19 @@ "whatwg-url": "^7.0.0", "ws": "^7.0.0", "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" + } } }, "jshint": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz", - "integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.0.tgz", + "integrity": "sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q==", "dev": true, "requires": { "cli": "~1.0.0", @@ -4142,9 +4301,9 @@ } }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "klaw": { @@ -4366,9 +4525,9 @@ } }, "loglevel": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.4.tgz", - "integrity": "sha512-p0b6mOGKcGa+7nnmKbpzR6qloPbrgLcnio++E+14Vo/XffOGwZtRpUhr8dTH/x2oCMmEoIU0Zwm3ZauhvYD17g==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.7.tgz", + "integrity": "sha512-cY2eLFrQSAfVPhCgH1s7JI73tMbg9YC3v3+ZHVW67sBS7UxWzNEk/ZBbSfLykBWHp33dqqtOv82gjhKEi81T/A==", "dev": true }, "loglevel-plugin-prefix": { @@ -4523,16 +4682,16 @@ } }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "requires": { - "mime-db": "1.40.0" + "mime-db": "1.43.0" } }, "mimic-fn": { @@ -4557,9 +4716,9 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mixin-deep": { @@ -4584,18 +4743,15 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.3.tgz", + "integrity": "sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==", + "dev": true }, "mocha": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", - "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.3.tgz", + "integrity": "sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -4610,7 +4766,7 @@ "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", + "mkdirp": "0.5.4", "ms": "2.1.1", "node-environment-flags": "1.0.5", "object.assign": "4.1.0", @@ -4618,9 +4774,9 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" }, "dependencies": { "ansi-colors": { @@ -4635,6 +4791,17 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -4664,6 +4831,15 @@ "path-is-absolute": "^1.0.0" } }, + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -4705,29 +4881,39 @@ "has-flag": "^3.0.0" } }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "cliui": "^4.0.0", + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "yargs-parser": "^13.1.2" } }, "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -4878,9 +5064,9 @@ "dev": true }, "nwsapi": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", - "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" }, "oauth-sign": { "version": "0.9.0", @@ -4925,9 +5111,9 @@ } }, "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", "dev": true }, "object-keys": { @@ -4970,13 +5156,13 @@ } }, "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "object.map": { @@ -5386,9 +5572,9 @@ "dev": true }, "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, "pump": { "version": "3.0.0", @@ -5663,9 +5849,9 @@ } }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -5674,7 +5860,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -5684,41 +5870,36 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } } } }, "request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", "requires": { - "lodash": "^4.17.11" + "lodash": "^4.17.15" } }, "request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", "requires": { - "request-promise-core": "1.1.2", + "request-promise-core": "1.1.3", "stealthy-require": "^1.1.1", "tough-cookie": "^2.3.3" }, @@ -5805,9 +5986,9 @@ } }, "resq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/resq/-/resq-1.6.0.tgz", - "integrity": "sha512-8A4CsNY52RoSU4rpSfnEGPK2mkMO9kz0hi+SYhbKnSq7AFYxZFPTb2C7u6aEchD3vzFjotuCLnDfS81K/UsAmg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resq/-/resq-1.7.1.tgz", + "integrity": "sha512-09u9Q5SAuJfAW5UoVAmvRtLvCOMaKP+djiixTXsZvPaojGKhuvc0Nfvp84U1rIfopJWEOXi5ywpCFwCk7mj8Xw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1" @@ -5830,9 +6011,9 @@ "dev": true }, "rgb2hex": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.1.9.tgz", - "integrity": "sha512-32iuQzhOjyT+cv9aAFRBJ19JgHwzQwbjUhH3Fj2sWW2EEGAW8fpFrDFP5ndoKDxJaLO06x1hE3kyuIFrUQtybQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.1.10.tgz", + "integrity": "sha512-vKz+kzolWbL3rke/xeTE2+6vHmZnNxGyDnaVW4OckntAIcc7DcZzWkQSfxMDwqHS8vhgySnIFyBUH7lIk6PxvQ==", "dev": true }, "rimraf": { @@ -5890,9 +6071,9 @@ } }, "selenium-standalone": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/selenium-standalone/-/selenium-standalone-6.16.0.tgz", - "integrity": "sha512-tl7HFH2FOxJD1is7Pzzsl0pY4vuePSdSWiJdPn+6ETBkpeJDiuzou8hBjvWYWpD+eIVcOrmy3L0R3GzkdHLzDw==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/selenium-standalone/-/selenium-standalone-6.17.0.tgz", + "integrity": "sha512-5PSnDHwMiq+OCiAGlhwQ8BM9xuwFfvBOZ7Tfbw+ifkTnOy0PWbZmI1B9gPGuyGHpbQ/3J3CzIK7BYwrQ7EjtWQ==", "dev": true, "requires": { "async": "^2.6.2", @@ -5910,11 +6091,58 @@ "yauzl": "^2.10.0" }, "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } } } }, @@ -5934,12 +6162,12 @@ } }, "serialize-error": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-4.1.0.tgz", - "integrity": "sha512-5j9GgyGsP9vV9Uj1S0lDCvlsd+gc2LEPVK7HHHte7IyPwOD4lVQFeaX143gx3U5AnoCi+wbcb3mvaxVysjpxEw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-5.0.0.tgz", + "integrity": "sha512-/VtpuyzYf82mHYTtI4QKtwHa79vAdU5OQpNPAmE/0UDdlGT0ZxHwC+J6gXkw29wwoVI8fMPsfcVHOwXtUQYYQA==", "dev": true, "requires": { - "type-fest": "^0.3.0" + "type-fest": "^0.8.0" } }, "set-blocking": { @@ -6354,9 +6582,9 @@ } }, "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -6364,9 +6592,9 @@ } }, "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "dev": true, "requires": { "define-properties": "^1.1.3", @@ -6512,9 +6740,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -6731,9 +6959,9 @@ "dev": true }, "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, "typedarray": { @@ -6881,9 +7109,9 @@ } }, "urijs": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.1.tgz", - "integrity": "sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.2.tgz", + "integrity": "sha512-s/UIq9ap4JPZ7H1EB5ULo/aOUbWqfDi7FKzMC2Nz+0Si8GiT1rIEaprt8hy3Vy2Ex2aJPpOQv4P4DuOZ+K1c6w==", "dev": true }, "urix": { @@ -6914,9 +7142,9 @@ "dev": true }, "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "v8flags": { "version": "3.1.3", @@ -7046,11 +7274,11 @@ } }, "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "requires": { - "browser-process-hrtime": "^0.1.2" + "browser-process-hrtime": "^1.0.0" } }, "w3c-xmlserializer": { @@ -7064,29 +7292,30 @@ } }, "webdriver": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-5.13.1.tgz", - "integrity": "sha512-Gvsf2o8jrfZMgLWIC9C9bcT5T0OZvNHq7WO5PhNSB2pbg3ypSj4kk4zJZSyP331FTgib+qxneRtg7r/3Ea7mLw==", + "version": "5.22.4", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-5.22.4.tgz", + "integrity": "sha512-IrSb8UUt6MDgBIDaSWyh/kP4VJsHyqnubCTxKi2cEZjOQdxPwnxUfvbSQlMDCHXrcgsPaXwAPjRJVTEt6PzArQ==", "dev": true, "requires": { - "@wdio/config": "^5.13.0-alpha.0", - "@wdio/logger": "^5.12.1", - "@wdio/protocols": "^5.13.0-alpha.0", - "@wdio/utils": "^5.13.0", + "@types/request": "^2.48.4", + "@wdio/config": "5.22.4", + "@wdio/logger": "5.16.10", + "@wdio/protocols": "5.22.1", + "@wdio/utils": "5.18.6", "lodash.merge": "^4.6.1", "request": "^2.83.0" } }, "webdriverio": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-5.13.1.tgz", - "integrity": "sha512-Orx521tRUPqGGJH5fPbZLZ7ipm6RRpCg9s/puaFkl79cIQoNaO7wcbDCktr6jGNGbihNxwj8f6qaSmDYNE6Ang==", + "version": "5.22.4", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-5.22.4.tgz", + "integrity": "sha512-6/Qi1/N8wK5r7Mp2aEwB+1FkDQiyiuwQn8lm+dfYhrfWs3kLOKKt3MPeM4I6j2Yv2/mGpYf7WKu2xTj/vkJzBA==", "dev": true, "requires": { - "@wdio/config": "^5.13.0-alpha.0", - "@wdio/logger": "^5.12.1", - "@wdio/repl": "^5.13.0-alpha.0", - "@wdio/utils": "^5.13.0", + "@wdio/config": "5.22.4", + "@wdio/logger": "5.16.10", + "@wdio/repl": "5.18.6", + "@wdio/utils": "5.18.6", "archiver": "^3.0.0", "css-value": "^0.0.1", "grapheme-splitter": "^1.0.2", @@ -7096,8 +7325,8 @@ "lodash.zip": "^4.2.0", "resq": "^1.6.0", "rgb2hex": "^0.1.0", - "serialize-error": "^4.1.0", - "webdriver": "^5.13.1" + "serialize-error": "^5.0.0", + "webdriver": "5.22.4" } }, "webidl-conversions": { @@ -7119,9 +7348,9 @@ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==" }, "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "requires": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -7217,15 +7446,29 @@ "dev": true, "requires": { "mkdirp": "^0.5.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "ws": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.2.tgz", - "integrity": "sha512-gftXq3XI81cJCgkUiAVixA0raD9IVmXqsylCrjRygw4+UOOGzPoxnQ6r/CnVL9i+mDncJo94tSkyrtuuQVBmrg==", - "requires": { - "async-limiter": "^1.0.0" - } + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" }, "xml-name-validator": { "version": "3.0.0", @@ -7256,9 +7499,9 @@ "dev": true }, "yargs": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.0.0.tgz", - "integrity": "sha512-ssa5JuRjMeZEUjg7bEL99AwpitxU/zWGAGpdj0di41pOEmJti8NR6kyUIJBkR78DTYNPZOU08luUo0GTHuB+ow==", + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -7271,7 +7514,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^15.0.1" }, "dependencies": { "ansi-regex": { @@ -7335,9 +7578,9 @@ } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -7357,34 +7600,102 @@ } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" }, "dependencies": { - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -7400,9 +7711,9 @@ } }, "zip-stream": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz", - "integrity": "sha512-ykebHGa2+uzth/R4HZLkZh3XFJzivhVsjJt8bN3GvBzLaqqrUdRacu+c4QtnUgjkkQfsOuNE1JgLKMCPNmkKgg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.3.tgz", + "integrity": "sha512-EkXc2JGcKhO5N5aZ7TmuNo45budRaFGHOmz24wtJR7znbNqDPmdZtUauKX6et8KAVseAMBOyWJqEpXcHTBsh7Q==", "dev": true, "requires": { "archiver-utils": "^2.1.0", @@ -7411,9 +7722,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", diff --git a/package.json b/package.json index 42858ffb2..7b5b15553 100644 --- a/package.json +++ b/package.json @@ -58,28 +58,28 @@ "chai": "^4.2.0", "concurrently": "^4.1.2", "eslint": "^5.13.0", - "eslint-plugin-es5": "^1.4.1", + "eslint-plugin-es5": "^1.5.0", "google-closure-compiler": "^20200101.0.0", "google-closure-deps": "^20200101.0.0", "gulp": "^4.0.2", "gulp-concat": "^2.6.1", "gulp-insert": "^0.5.0", - "gulp-series": "^1.0.2", - "gulp-shell": "^0.7.1", "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", + "gulp-series": "^1.0.2", + "gulp-shell": "^0.7.1", "gulp-umd": "^2.0.0", - "jshint": "^2.10.2", "js-green-licenses": "^1.1.0", - "mocha": "^6.1.4", + "jshint": "^2.11.0", + "mocha": "^6.2.3", "pixelmatch": "^4.0.2", "pngjs": "^3.4.0", - "selenium-standalone": "^6.16.0", "rimraf": "^2.6.3", + "selenium-standalone": "^6.17.0", "through2": "^3.0.1", "typescript-closure-tools": "^0.0.7", - "webdriverio": "^5.11.5", - "yargs": "^14.0.0" + "webdriverio": "^5.22.4", + "yargs": "^14.2.3" }, "jshintConfig": { "globalstrict": true, @@ -96,6 +96,6 @@ "unused": true }, "dependencies": { - "jsdom": "^15.1.1" + "jsdom": "^15.2.1" } } From a3dbbfd7abf01d842a342c02e18c17e9fc77c4b0 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 27 Mar 2020 17:13:46 -0700 Subject: [PATCH 099/105] Support a custom container element for the dropdowndiv, widgetdiv and tooltip. (#3772) * Support a custom container element for the dropdowndiv, widgetdiv and tooltip --- core/blockly.js | 18 ++++++++++++++++++ core/dropdowndiv.js | 3 ++- core/tooltip.js | 3 ++- core/widgetdiv.js | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/blockly.js b/core/blockly.js index b415ab082..209c22e96 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -90,6 +90,13 @@ Blockly.clipboardTypeCounts_ = null; */ Blockly.cache3dSupported_ = null; +/** + * Container element to render the WidgetDiv, DropDownDiv and Tooltip. + * @type {?Element} + * @package + */ +Blockly.parentContainer = null; + /** * Blockly opaque event data used to unbind events when using * `Blockly.bindEvent_` and `Blockly.bindEventWithChecks_`. @@ -661,3 +668,14 @@ Blockly.checkBlockColourConstant_ = function( console.warn(warning); } }; + +/** + * Set the parent container. This is the container element that the WidgetDiv, + * DropDownDiv, and Tooltip are rendered into the first time `Blockly.inject` + * is called. + * This method is a NOP if called after the first ``Blockly.inject``. + * @param {!Element} container The container element. + */ +Blockly.setParentContainer = function(container) { + Blockly.parentContainer = container; +}; diff --git a/core/dropdowndiv.js b/core/dropdowndiv.js index 3a6240ee9..4c8c3fe2a 100644 --- a/core/dropdowndiv.js +++ b/core/dropdowndiv.js @@ -127,7 +127,8 @@ Blockly.DropDownDiv.createDom = function() { } var div = document.createElement('div'); div.className = 'blocklyDropDownDiv'; - document.body.appendChild(div); + var container = Blockly.parentContainer || document.body; + container.appendChild(div); /** * The div element. * @type {!Element} diff --git a/core/tooltip.js b/core/tooltip.js index 3bb20270d..966807dc7 100644 --- a/core/tooltip.js +++ b/core/tooltip.js @@ -121,7 +121,8 @@ Blockly.Tooltip.createDom = function() { // Create an HTML container for popup overlays (e.g. editor widgets). Blockly.Tooltip.DIV = document.createElement('div'); Blockly.Tooltip.DIV.className = 'blocklyTooltipDiv'; - document.body.appendChild(Blockly.Tooltip.DIV); + var container = Blockly.parentContainer || document.body; + container.appendChild(Blockly.Tooltip.DIV); }; /** diff --git a/core/widgetdiv.js b/core/widgetdiv.js index 633021e78..3529a4400 100644 --- a/core/widgetdiv.js +++ b/core/widgetdiv.js @@ -62,7 +62,8 @@ Blockly.WidgetDiv.createDom = function() { */ Blockly.WidgetDiv.DIV = document.createElement('div'); Blockly.WidgetDiv.DIV.className = 'blocklyWidgetDiv'; - document.body.appendChild(Blockly.WidgetDiv.DIV); + var container = Blockly.parentContainer || document.body; + container.appendChild(Blockly.WidgetDiv.DIV); }; /** From f05faffd7a6e4ecefb30e631232ca34ca6b80dae Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Tue, 31 Mar 2020 15:49:58 +0200 Subject: [PATCH 100/105] Localisation updates from https://translatewiki.net. --- msg/json/ar.json | 4 ++-- msg/json/kab.json | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/msg/json/ar.json b/msg/json/ar.json index 0d059ac6b..bd3386e41 100644 --- a/msg/json/ar.json +++ b/msg/json/ar.json @@ -53,13 +53,13 @@ "COLOUR_PICKER_TOOLTIP": "اختر لون من اللوحة.", "COLOUR_RANDOM_TITLE": "لون عشوائي", "COLOUR_RANDOM_TOOLTIP": "اختر لون بشكل عشوائي.", - "COLOUR_RGB_HELPURL": "http://www.december.com/html/spec/colorper.html", + "COLOUR_RGB_HELPURL": "https://www.december.com/html/spec/colorpercompact.html", "COLOUR_RGB_TITLE": "لون مع", "COLOUR_RGB_RED": "أحمر", "COLOUR_RGB_GREEN": "أخضر", "COLOUR_RGB_BLUE": "أزرق", "COLOUR_RGB_TOOLTIP": "إنشئ لون بالكمية المحددة من الأحمر, الأخضر والأزرق. بحيث يجب تكون كافة القيم بين 0 و 100.", - "COLOUR_BLEND_HELPURL": "http://meyerweb.com/eric/tools/color-blend/", + "COLOUR_BLEND_HELPURL": "https://meyerweb.com/eric/tools/color-blend/#:::rgbp", "COLOUR_BLEND_TITLE": "دمج", "COLOUR_BLEND_COLOUR1": "اللون 1", "COLOUR_BLEND_COLOUR2": "اللون 2", diff --git a/msg/json/kab.json b/msg/json/kab.json index 522454452..ce5ccf9b4 100644 --- a/msg/json/kab.json +++ b/msg/json/kab.json @@ -4,7 +4,8 @@ "Amaziɣ maziɣ", "Belkacem77", "Alem", - "YubaWissin" + "YubaWissin", + "SlimaneAmiri" ] }, "VARIABLES_DEFAULT_NAME": "aferdis", @@ -343,5 +344,6 @@ "PROCEDURES_IFRETURN_TOOLTIP": "ma yella azal d idetti, ad d-yerr azal-nniḍen wis sin.", "PROCEDURES_IFRETURN_WARNING": "Ɣur-k: Iḥder-agi yezmer ur yettwaseqdac ara ala di tebadut n twuri-agi.", "WORKSPACE_COMMENT_DEFAULT_TEXT": "Ini kra...", + "WORKSPACE_ARIA_LABEL": "Tallunt n umahel Blockly", "COLLAPSED_WARNINGS_WARNING": "Iḥedran yettin gebren ilɣa." } From acb5d895f871ffff8e6196e5e9ddcf13f2042ebc Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 1 Apr 2020 15:29:34 -0700 Subject: [PATCH 101/105] Move flyout label css into the renderer (#3780) * Move flyout label css into the renderer and add theme options --- core/flyout_button.js | 4 ---- core/renderers/common/constants.js | 16 +++++++++++++--- core/renderers/zelos/constants.js | 16 +++++++++++++--- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/core/flyout_button.js b/core/flyout_button.js index 51173c917..f4cead8af 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -294,9 +294,5 @@ Blockly.Css.register([ '.blocklyFlyoutLabelBackground {', 'opacity: 0;', '}', - - '.blocklyFlyoutLabelText {', - 'fill: #000;', - '}' /* eslint-enable indent */ ]); diff --git a/core/renderers/common/constants.js b/core/renderers/common/constants.js index 6708c09f4..8a5b19cff 100644 --- a/core/renderers/common/constants.js +++ b/core/renderers/common/constants.js @@ -1165,13 +1165,18 @@ Blockly.blockRendering.ConstantProvider.prototype.injectCSS_ = function( Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) { return [ /* eslint-disable indent */ - // Fields. - selector + ' .blocklyText {', - 'fill: #fff;', + // Text. + selector + ' .blocklyText, ', + selector + ' .blocklyFlyoutLabelText {', 'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';', 'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;', 'font-weight: ' + this.FIELD_TEXT_FONTWEIGHT + ';', '}', + + // Fields. + selector + ' .blocklyText {', + 'fill: #fff;', + '}', selector + ' .blocklyNonEditableText>rect,', selector + ' .blocklyEditableText>rect {', 'fill: ' + this.FIELD_BORDER_RECT_COLOUR + ';', @@ -1183,6 +1188,11 @@ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) { 'fill: #000;', '}', + // Flyout labels. + selector + ' .blocklyFlyoutLabelText {', + 'fill: #000;', + '}', + // Bubbles. selector + ' .blocklyText.blocklyBubbleText {', 'fill: #000;', diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index cac9a0545..57ebdca11 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -904,13 +904,18 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg, Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(selector) { return [ /* eslint-disable indent */ - // Fields. - selector + ' .blocklyText {', - 'fill: #fff;', + // Text. + selector + ' .blocklyText, ', + selector + ' .blocklyFlyoutLabelText {', 'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';', 'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;', 'font-weight: ' + this.FIELD_TEXT_FONTWEIGHT + ';', '}', + + // Fields. + selector + ' .blocklyText {', + 'fill: #fff;', + '}', selector + ' .blocklyNonEditableText>rect:not(.blocklyDropdownRect),', selector + ' .blocklyEditableText>rect:not(.blocklyDropdownRect) {', 'fill: ' + this.FIELD_BORDER_RECT_COLOUR + ';', @@ -921,6 +926,11 @@ Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(selector) { selector + ' .blocklyEditableText>g>text {', 'fill: #575E75;', '}', + + // Flyout labels. + selector + ' .blocklyFlyoutLabelText {', + 'fill: #575E75;', + '}', // Bubbles. selector + ' .blocklyText.blocklyBubbleText {', From 5a92aff63e93dce884bbe2e715ba832244628501 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 2 Apr 2020 11:53:10 -0700 Subject: [PATCH 102/105] Update the keyboard navigation demo (#3785) --- demos/keyboard_nav/index.html | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/demos/keyboard_nav/index.html b/demos/keyboard_nav/index.html index b131bbeae..53408c57e 100644 --- a/demos/keyboard_nav/index.html +++ b/demos/keyboard_nav/index.html @@ -53,33 +53,26 @@ Demos > Keyboard Navigation

    Keyboard Navigation is our first step towards an accessible Blockly.
    - You can enter accessibility mode by shift clicking anywhere on the - workspace or on a block.
    Some basic commands for moving around are below. - More complete documentation is still in progress.

    - Workspace Navigation
    - W: Previous block/field/input at the same level
    - A: Up one level (Field (or input) -> Block -> Input (or field) -> Block -> - Stack -> Workspace)
    - S: Next block/field/input at the same level
    - D: Down one level (Workspace -> Stack -> Block -> Input (or field) -> Block - -> Field (or input))
    - T: Will open the toolbox. Once in there you can moving around using the WASD keys. And insert a block by hitting Enter
    - X: While on a connection hit X to disconnect the block after the cursor

    - + For more information on how the default keyboard navigation works please see + the documentation. +
    +
    Pre Order Traversal
    Feel free to just play around in accessibility mode or hit the button below to see the demo. The demo uses preorder tree traversal as an alternative way to navigate the blocks, connections, and fields on the workspace.

    - - - - Cursor
    + Cursors
    The cursor controls how the user navigates the blocks, inputs, fields and connections on a workspace. - This demo shows two different cursors:
    - Default Cursor: Allow the user to go to the previous, next, in or out location.
    - Basic Cursor: Using the pre order traversal allows the user to go to the next and previous location. + This demo shows three different cursors:
    + Default Cursor: Explained in documentation.
    + Basic Cursor: Uses pre order traversal to allow users to navigate + through everything using only the previous and next command.
    + Line Cursor: We tried to make this cursor mimic a text editor. Navigating + up and down will take the cursor to the next and previous "line" of code. + Navigating in and out will move the cursor through all the fields and inputs + in that "line" of code.

    From 66a47025b79cf127fed8633c78102f222c51fa1b Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 2 Apr 2020 13:10:19 -0700 Subject: [PATCH 103/105] Update build files in preparation for release (#3786) --- blockly_compressed.js | 1254 +++++++++++++++++++------------------- blockly_uncompressed.js | 322 +++++----- blocks_compressed.js | 25 +- dart_compressed.js | 5 +- javascript_compressed.js | 13 +- lua_compressed.js | 9 +- msg/js/ar.js | 4 +- msg/js/ca.js | 56 +- msg/js/diq.js | 36 +- msg/js/ia.js | 2 +- msg/js/it.js | 2 +- msg/js/kab.js | 2 +- msg/js/kn.js | 32 +- msg/js/pl.js | 2 +- msg/js/tr.js | 12 +- msg/json/en.json | 2 +- msg/json/qqq.json | 9 - php_compressed.js | 5 +- python_compressed.js | 9 +- typings/blockly.d.ts | 804 +++++++++++++++++------- 20 files changed, 1479 insertions(+), 1126 deletions(-) diff --git a/blockly_compressed.js b/blockly_compressed.js index 20c4ffc23..fc250ab91 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -1,25 +1,19 @@ -// Do not edit this file; automatically generated by build.py. -'use strict'; - - -var Blockly={};Blockly.Blocks=Object.create(null); -Blockly.utils={};Blockly.utils.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();Blockly.Msg={};Blockly.utils.global.Blockly||(Blockly.utils.global.Blockly={});Blockly.utils.global.Blockly.Msg||(Blockly.utils.global.Blockly.Msg=Blockly.Msg); -Blockly.constants={};Blockly.LINE_MODE_MULTIPLIER=40;Blockly.PAGE_MODE_MULTIPLIER=125;Blockly.DRAG_RADIUS=5;Blockly.FLYOUT_DRAG_RADIUS=10;Blockly.SNAP_RADIUS=28;Blockly.CONNECTING_SNAP_RADIUS=Blockly.SNAP_RADIUS;Blockly.CURRENT_CONNECTION_PREFERENCE=8;Blockly.INSERTION_MARKER_COLOUR="#000000";Blockly.BUMP_DELAY=250;Blockly.BUMP_RANDOMNESS=10;Blockly.COLLAPSE_CHARS=30;Blockly.LONGPRESS=750;Blockly.SOUND_LIMIT=100;Blockly.DRAG_STACK=!0;Blockly.HSV_SATURATION=.45;Blockly.HSV_VALUE=.65; -Blockly.SPRITE={width:96,height:124,url:"sprites.png"};Blockly.INPUT_VALUE=1;Blockly.OUTPUT_VALUE=2;Blockly.NEXT_STATEMENT=3;Blockly.PREVIOUS_STATEMENT=4;Blockly.DUMMY_INPUT=5;Blockly.ALIGN_LEFT=-1;Blockly.ALIGN_CENTRE=0;Blockly.ALIGN_RIGHT=1;Blockly.DRAG_NONE=0;Blockly.DRAG_STICKY=1;Blockly.DRAG_BEGIN=1;Blockly.DRAG_FREE=2;Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE]=Blockly.INPUT_VALUE; -Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT]=Blockly.PREVIOUS_STATEMENT;Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT]=Blockly.NEXT_STATEMENT;Blockly.TOOLBOX_AT_TOP=0;Blockly.TOOLBOX_AT_BOTTOM=1;Blockly.TOOLBOX_AT_LEFT=2;Blockly.TOOLBOX_AT_RIGHT=3;Blockly.DELETE_AREA_NONE=null;Blockly.DELETE_AREA_TRASH=1;Blockly.DELETE_AREA_TOOLBOX=2;Blockly.VARIABLE_CATEGORY_NAME="VARIABLE";Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME="VARIABLE_DYNAMIC";Blockly.PROCEDURE_CATEGORY_NAME="PROCEDURE"; -Blockly.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID";Blockly.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID";Blockly.utils.colour={}; +// Do not edit this file; automatically generated by gulp. +'use strict';var Blockly={constants:{},LINE_MODE_MULTIPLIER:40,PAGE_MODE_MULTIPLIER:125,DRAG_RADIUS:5,FLYOUT_DRAG_RADIUS:10,SNAP_RADIUS:28};Blockly.CONNECTING_SNAP_RADIUS=Blockly.SNAP_RADIUS;Blockly.CURRENT_CONNECTION_PREFERENCE=8;Blockly.BUMP_DELAY=250;Blockly.BUMP_RANDOMNESS=10;Blockly.COLLAPSE_CHARS=30;Blockly.LONGPRESS=750;Blockly.SOUND_LIMIT=100;Blockly.DRAG_STACK=!0;Blockly.HSV_SATURATION=.45;Blockly.HSV_VALUE=.65;Blockly.SPRITE={width:96,height:124,url:"sprites.png"};Blockly.INPUT_VALUE=1; +Blockly.OUTPUT_VALUE=2;Blockly.NEXT_STATEMENT=3;Blockly.PREVIOUS_STATEMENT=4;Blockly.DUMMY_INPUT=5;Blockly.ALIGN_LEFT=-1;Blockly.ALIGN_CENTRE=0;Blockly.ALIGN_RIGHT=1;Blockly.DRAG_NONE=0;Blockly.DRAG_STICKY=1;Blockly.DRAG_BEGIN=1;Blockly.DRAG_FREE=2;Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE]=Blockly.INPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT]=Blockly.PREVIOUS_STATEMENT; +Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT]=Blockly.NEXT_STATEMENT;Blockly.TOOLBOX_AT_TOP=0;Blockly.TOOLBOX_AT_BOTTOM=1;Blockly.TOOLBOX_AT_LEFT=2;Blockly.TOOLBOX_AT_RIGHT=3;Blockly.DELETE_AREA_NONE=null;Blockly.DELETE_AREA_TRASH=1;Blockly.DELETE_AREA_TOOLBOX=2;Blockly.VARIABLE_CATEGORY_NAME="VARIABLE";Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME="VARIABLE_DYNAMIC";Blockly.PROCEDURE_CATEGORY_NAME="PROCEDURE";Blockly.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID";Blockly.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID";Blockly.utils={};Blockly.utils.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();Blockly.Msg={};Blockly.utils.global.Blockly||(Blockly.utils.global.Blockly={});Blockly.utils.global.Blockly.Msg||(Blockly.utils.global.Blockly.Msg=Blockly.Msg);Blockly.utils.colour={}; Blockly.utils.colour.parse=function(a){a=String(a).toLowerCase().trim();var b=Blockly.utils.colour.names[a];if(b)return b;b="0x"==a.substring(0,2)?"#"+a.substring(2):a;b="#"==b[0]?b:"#"+b;if(/^#[0-9a-f]{6}$/.test(b))return b;if(/^#[0-9a-f]{3}$/.test(b))return["#",b[1],b[1],b[2],b[2],b[3],b[3]].join("");var c=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return c&&(a=Number(c[1]),b=Number(c[2]),c=Number(c[3]),0<=a&&256>a&&0<=b&&256>b&&0<=c&&256>c)?Blockly.utils.colour.rgbToHex(a,b, c):null};Blockly.utils.colour.rgbToHex=function(a,b,c){b=a<<16|b<<8|c;return 16>a?"#"+(16777216|b).toString(16).substr(1):"#"+b.toString(16)};Blockly.utils.colour.hexToRgb=function(a){a=Blockly.utils.colour.parse(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; Blockly.utils.colour.hsvToHex=function(a,b,c){var d=0,e=0,f=0;if(0==b)f=e=d=c;else{var g=Math.floor(a/60),h=a/60-g;a=c*(1-b);var k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return Blockly.utils.colour.rgbToHex(Math.floor(d),Math.floor(e),Math.floor(f))}; Blockly.utils.colour.blend=function(a,b,c){a=Blockly.utils.colour.parse(a);if(!a)return null;b=Blockly.utils.colour.parse(b);if(!b)return null;a=Blockly.utils.colour.hexToRgb(a);b=Blockly.utils.colour.hexToRgb(b);return Blockly.utils.colour.rgbToHex(Math.round(b[0]+c*(a[0]-b[0])),Math.round(b[1]+c*(a[1]-b[1])),Math.round(b[2]+c*(a[2]-b[2])))}; -Blockly.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};Blockly.utils.Coordinate=function(a,b){this.x=a;this.y=b};Blockly.utils.Coordinate.equals=function(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1};Blockly.utils.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};Blockly.utils.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};Blockly.utils.Coordinate.difference=function(a,b){return new Blockly.utils.Coordinate(a.x-b.x,a.y-b.y)}; +Blockly.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};Blockly.utils.Coordinate=function(a,b){this.x=a;this.y=b};Blockly.utils.Coordinate.equals=function(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1};Blockly.utils.Coordinate.distance=function(a,b){var c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)};Blockly.utils.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};Blockly.utils.Coordinate.difference=function(a,b){return new Blockly.utils.Coordinate(a.x-b.x,a.y-b.y)}; Blockly.utils.Coordinate.sum=function(a,b){return new Blockly.utils.Coordinate(a.x+b.x,a.y+b.y)};Blockly.utils.Coordinate.prototype.scale=function(a){this.x*=a;this.y*=a;return this};Blockly.utils.Coordinate.prototype.translate=function(a,b){this.x+=a;this.y+=b;return this};Blockly.utils.string={};Blockly.utils.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};Blockly.utils.string.shortestStringLength=function(a){return a.length?a.reduce(function(a,c){return a.lengthb&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;var h=[],k=c.length/e,l=1;for(d=0;df);return g}; +Blockly.utils.string.commonWordPrefix=function(a,b){if(!a.length)return 0;if(1==a.length)return a[0].length;var c=0;b=b||Blockly.utils.string.shortestStringLength(a);for(var d=0;db&&(b=c[d].length);d=-Infinity;var e=1;do{var f=d;var g=a;a=[];var h=c.length/e,k=1;for(d=0;df);return g}; Blockly.utils.string.wrapScore_=function(a,b,c){for(var d=[0],e=[],f=0;fd&&(d=h,e=g)}return e?Blockly.utils.string.wrapMutate_(a,e,c):b};Blockly.utils.string.wrapToText_=function(a,b){for(var c=[],d=0;d=k?(e=2,g=k,(k=f.join(""))&&c.push(k),f.length=0):"{"==k?e=3:(f.push("%",k),e=0):2==e?"0"<=k&&"9">=k?g+=k:(c.push(parseInt(g,10)),h--,e=0):3==e&&(""==k?(f.splice(0,0,"%{"),h--,e=0):"}"!=k?f.push(k):(e=f.join(""),/[A-Z]\w*/i.test(e)?(k=e.toUpperCase(),(k= -Blockly.utils.string.startsWith(k,"BKY_")?k.substring(4):null)&&k in Blockly.Msg?(e=Blockly.Msg[k],"string"==typeof e?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=f.length=0))}(k=f.join(""))&&c.push(k);d=[];for(h=f.length=0;h=h?(e=2,f=h,(h=a.join(""))&&c.push(h),a.length=0):"{"==h?e=3:(a.push("%",h),e=0):2==e?"0"<=h&&"9">=h?f+=h:(c.push(parseInt(f,10)),g--,e=0):3==e&&(""==h?(a.splice(0,0,"%{"),g--,e=0):"}"!=h?a.push(h):(e=a.join(""),/[A-Z]\w*/i.test(e)?(h=e.toUpperCase(), +(h=Blockly.utils.string.startsWith(h,"BKY_")?h.substring(4):null)&&h in Blockly.Msg?(e=Blockly.Msg[h],"string"==typeof e?Array.prototype.push.apply(c,Blockly.utils.tokenizeInterpolation_(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=a.length=0))}(h=a.join(""))&&c.push(h);b=[];for(g=a.length=0;gc;c++)b[c]=Blockly.utils.genUid.soup_.charAt(Math.random()*a);return b.join("")};Blockly.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Blockly.utils.is3dSupported=function(){if(void 0!==Blockly.utils.is3dSupported.cached_)return Blockly.utils.is3dSupported.cached_;if(!Blockly.utils.global.getComputedStyle)return!1;var a=document.createElement("p"),b="none",c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,null);for(var d in c)if(void 0!==a.style[d]){a.style[d]="translate3d(1px,1px,1px)";b=Blockly.utils.global.getComputedStyle(a); if(!b)return document.body.removeChild(a),!1;b=b.getPropertyValue(c[d])}document.body.removeChild(a);Blockly.utils.is3dSupported.cached_="none"!==b;return Blockly.utils.is3dSupported.cached_};Blockly.utils.runAfterPageLoad=function(a){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)a();else var b=setInterval(function(){"complete"==document.readyState&&(clearInterval(b),a())},10)}; -Blockly.utils.getViewportBBox=function(){var a=Blockly.utils.style.getViewportPageOffset();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};Blockly.utils.arrayRemove=function(a,b){var c=a.indexOf(b);if(-1==c)return!1;a.splice(c,1);return!0}; -Blockly.utils.getDocumentScroll=function(){var a=document.documentElement,b=window;return Blockly.utils.userAgent.IE&&b.pageYOffset!=a.scrollTop?new Blockly.utils.Coordinate(a.scrollLeft,a.scrollTop):new Blockly.utils.Coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}; -Blockly.utils.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);if(b){var e=a.getNextBlock();e&&(e=d.indexOf(e),d.splice(e,d.length-e))}e=0;for(var f;f=d[e];e++)c[f.type]?c[f.type]++:c[f.type]=1;return c};Blockly.utils.screenToWsCoordinates=function(a,b){var c=b.x,d=b.y,e=a.getInjectionDiv().getBoundingClientRect();c=new Blockly.utils.Coordinate(c-e.left,d-e.top);d=a.getOriginOffsetInPixels();return Blockly.utils.Coordinate.difference(c,d).scale(1/a.scale)}; +Blockly.utils.getViewportBBox=function(){var a=Blockly.utils.style.getViewportPageOffset();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};Blockly.utils.arrayRemove=function(a,b){b=a.indexOf(b);if(-1==b)return!1;a.splice(b,1);return!0}; +Blockly.utils.getDocumentScroll=function(){var a=document.documentElement,b=window;return Blockly.utils.userAgent.IE&&b.pageYOffset!=a.scrollTop?new Blockly.utils.Coordinate(a.scrollLeft,a.scrollTop):new Blockly.utils.Coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)};Blockly.utils.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(a=0;b=d[a];a++)c[b.type]?c[b.type]++:c[b.type]=1;return c}; +Blockly.utils.screenToWsCoordinates=function(a,b){var c=b.x;b=b.y;var d=a.getInjectionDiv().getBoundingClientRect();c=new Blockly.utils.Coordinate(c-d.left,b-d.top);b=a.getOriginOffsetInPixels();return Blockly.utils.Coordinate.difference(c,b).scale(1/a.scale)}; Blockly.utils.parseBlockColour=function(a){var b="string"==typeof a?Blockly.utils.replaceMessageReferences(a):a,c=Number(b);if(!isNaN(c)&&0<=c&&360>=c)return{hue:c,hex:Blockly.utils.colour.hsvToHex(c,Blockly.HSV_SATURATION,255*Blockly.HSV_VALUE)};if(c=Blockly.utils.colour.parse(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!=b&&(c+=' (from "'+a+'")');throw Error(c);};Blockly.Events={};Blockly.Events.group_="";Blockly.Events.recordUndo=!0;Blockly.Events.disabled_=0;Blockly.Events.CREATE="create";Blockly.Events.BLOCK_CREATE=Blockly.Events.CREATE;Blockly.Events.DELETE="delete";Blockly.Events.BLOCK_DELETE=Blockly.Events.DELETE;Blockly.Events.CHANGE="change";Blockly.Events.BLOCK_CHANGE=Blockly.Events.CHANGE;Blockly.Events.MOVE="move";Blockly.Events.BLOCK_MOVE=Blockly.Events.MOVE;Blockly.Events.VAR_CREATE="var_create";Blockly.Events.VAR_DELETE="var_delete"; Blockly.Events.VAR_RENAME="var_rename";Blockly.Events.UI="ui";Blockly.Events.COMMENT_CREATE="comment_create";Blockly.Events.COMMENT_DELETE="comment_delete";Blockly.Events.COMMENT_CHANGE="comment_change";Blockly.Events.COMMENT_MOVE="comment_move";Blockly.Events.FINISHED_LOADING="finished_loading";Blockly.Events.BUMP_EVENTS=[Blockly.Events.BLOCK_CREATE,Blockly.Events.BLOCK_MOVE,Blockly.Events.COMMENT_CREATE,Blockly.Events.COMMENT_MOVE];Blockly.Events.FIRE_QUEUE_=[]; Blockly.Events.fire=function(a){Blockly.Events.isEnabled()&&(Blockly.Events.FIRE_QUEUE_.length||setTimeout(Blockly.Events.fireNow_,0),Blockly.Events.FIRE_QUEUE_.push(a))};Blockly.Events.fireNow_=function(){for(var a=Blockly.Events.filter(Blockly.Events.FIRE_QUEUE_,!0),b=Blockly.Events.FIRE_QUEUE_.length=0,c;c=a[b];b++)if(c.workspaceId){var d=Blockly.Workspace.getById(c.workspaceId);d&&d.fireChangeListener(c)}}; -Blockly.Events.filter=function(a,b){var c=a.slice();b||c.reverse();for(var d=[],e=Object.create(null),f=0,g;g=c[f];f++)if(!g.isNull()){var h=[g.type,g.blockId,g.workspaceId].join(" "),k=e[h],l=k?k.event:null;if(!k)e[h]={event:g,index:f},d.push(g);else if(g.type==Blockly.Events.MOVE&&k.index==f-1)l.newParentId=g.newParentId,l.newInputName=g.newInputName,l.newCoordinate=g.newCoordinate,k.index=f;else if(g.type==Blockly.Events.CHANGE&&g.element==l.element&&g.name==l.name)l.newValue=g.newValue;else if(g.type!= -Blockly.Events.UI||"click"!=g.element||"commentOpen"!=l.element&&"mutatorOpen"!=l.element&&"warningOpen"!=l.element)e[h]={event:g,index:1},d.push(g)}c=d.filter(function(a){return!a.isNull()});b||c.reverse();for(f=1;g=c[f];f++)g.type==Blockly.Events.CHANGE&&"mutation"==g.element&&c.unshift(c.splice(f,1)[0]);return c};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++}; +Blockly.Events.filter=function(a,b){a=a.slice();b||a.reverse();for(var c=[],d=Object.create(null),e=0,f;f=a[e];e++)if(!f.isNull()){var g=[f.type,f.blockId,f.workspaceId].join(" "),h=d[g],k=h?h.event:null;if(!h)d[g]={event:f,index:e},c.push(f);else if(f.type==Blockly.Events.MOVE&&h.index==e-1)k.newParentId=f.newParentId,k.newInputName=f.newInputName,k.newCoordinate=f.newCoordinate,h.index=e;else if(f.type==Blockly.Events.CHANGE&&f.element==k.element&&f.name==k.name)k.newValue=f.newValue;else if(f.type!= +Blockly.Events.UI||"click"!=f.element||"commentOpen"!=k.element&&"mutatorOpen"!=k.element&&"warningOpen"!=k.element)d[g]={event:f,index:1},c.push(f)}a=c.filter(function(a){return!a.isNull()});b||a.reverse();for(e=1;f=a[e];e++)f.type==Blockly.Events.CHANGE&&"mutation"==f.element&&a.unshift(a.splice(e,1)[0]);return a};Blockly.Events.clearPendingUndo=function(){for(var a=0,b;b=Blockly.Events.FIRE_QUEUE_[a];a++)b.recordUndo=!1};Blockly.Events.disable=function(){Blockly.Events.disabled_++}; Blockly.Events.enable=function(){Blockly.Events.disabled_--};Blockly.Events.isEnabled=function(){return 0==Blockly.Events.disabled_};Blockly.Events.getGroup=function(){return Blockly.Events.group_};Blockly.Events.setGroup=function(a){Blockly.Events.group_="boolean"==typeof a?a?Blockly.utils.genUid():"":a};Blockly.Events.getDescendantIds=function(a){var b=[];a=a.getDescendants(!1);for(var c=0,d;d=a[c];c++)b[c]=d.id;return b}; Blockly.Events.fromJson=function(a,b){switch(a.type){case Blockly.Events.CREATE:var c=new Blockly.Events.Create(null);break;case Blockly.Events.DELETE:c=new Blockly.Events.Delete(null);break;case Blockly.Events.CHANGE:c=new Blockly.Events.Change(null,"","","","");break;case Blockly.Events.MOVE:c=new Blockly.Events.Move(null);break;case Blockly.Events.VAR_CREATE:c=new Blockly.Events.VarCreate(null);break;case Blockly.Events.VAR_DELETE:c=new Blockly.Events.VarDelete(null);break;case Blockly.Events.VAR_RENAME:c= new Blockly.Events.VarRename(null,"");break;case Blockly.Events.UI:c=new Blockly.Events.Ui(null,"","","");break;case Blockly.Events.COMMENT_CREATE:c=new Blockly.Events.CommentCreate(null);break;case Blockly.Events.COMMENT_CHANGE:c=new Blockly.Events.CommentChange(null,"","");break;case Blockly.Events.COMMENT_MOVE:c=new Blockly.Events.CommentMove(null);break;case Blockly.Events.COMMENT_DELETE:c=new Blockly.Events.CommentDelete(null);break;case Blockly.Events.FINISHED_LOADING:c=new Blockly.Events.FinishedLoading(b); break;default:throw Error("Unknown event type.");}c.fromJson(a);c.workspaceId=b.id;return c}; -Blockly.Events.disableOrphans=function(a){if((a.type==Blockly.Events.MOVE||a.type==Blockly.Events.CREATE)&&a.workspaceId){var b=Blockly.Workspace.getById(a.workspaceId);if(a=b.getBlockById(a.blockId)){var c=a.getParent();if(c&&c.isEnabled())for(b=a.getDescendants(!1),a=0;c=b[a];a++)c.setEnabled(!0);else if((a.outputConnection||a.previousConnection)&&!b.isDragging()){do a.setEnabled(!1),a=a.getNextBlock();while(a)}}}}; -Blockly.Events.Abstract=function(){this.workspaceId=void 0;this.group=Blockly.Events.getGroup();this.recordUndo=Blockly.Events.recordUndo};Blockly.Events.Abstract.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};Blockly.Events.Abstract.prototype.fromJson=function(a){this.group=a.group};Blockly.Events.Abstract.prototype.isNull=function(){return!1};Blockly.Events.Abstract.prototype.run=function(a){}; -Blockly.Events.Abstract.prototype.getEventWorkspace_=function(){if(this.workspaceId)var a=Blockly.Workspace.getById(this.workspaceId);if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};Blockly.utils.object={};Blockly.utils.object.inherits=function(a,b){a.superClass_=b.prototype;a.prototype=Object.create(b.prototype);a.prototype.constructor=a};Blockly.utils.object.mixin=function(a,b){for(var c in b)a[c]=b[c]};Blockly.utils.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(b){return a[b]})};Blockly.utils.xml={};Blockly.utils.xml.NAME_SPACE="https://developers.google.com/blockly/xml";Blockly.utils.xml.document=function(){return document};Blockly.utils.xml.createElement=function(a){return Blockly.utils.xml.document().createElementNS(Blockly.utils.xml.NAME_SPACE,a)};Blockly.utils.xml.createTextNode=function(a){return Blockly.utils.xml.document().createTextNode(a)};Blockly.utils.xml.textToDomDocument=function(a){return(new DOMParser).parseFromString(a,"text/xml")}; +Blockly.Events.disableOrphans=function(a){if((a.type==Blockly.Events.MOVE||a.type==Blockly.Events.CREATE)&&a.workspaceId){var b=Blockly.Workspace.getById(a.workspaceId);if(a=b.getBlockById(a.blockId)){var c=a.getParent();if(c&&c.isEnabled())for(b=a.getDescendants(!1),a=0;c=b[a];a++)c.setEnabled(!0);else if((a.outputConnection||a.previousConnection)&&!b.isDragging()){do a.setEnabled(!1),a=a.getNextBlock();while(a)}}}};Blockly.Events.Abstract=function(){this.workspaceId=void 0;this.group=Blockly.Events.getGroup();this.recordUndo=Blockly.Events.recordUndo};Blockly.Events.Abstract.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};Blockly.Events.Abstract.prototype.fromJson=function(a){this.group=a.group};Blockly.Events.Abstract.prototype.isNull=function(){return!1};Blockly.Events.Abstract.prototype.run=function(a){}; +Blockly.Events.Abstract.prototype.getEventWorkspace_=function(){if(this.workspaceId)var a=Blockly.Workspace.getById(this.workspaceId);if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};Blockly.utils.object={};Blockly.utils.object.inherits=function(a,b){a.superClass_=b.prototype;a.prototype=Object.create(b.prototype);a.prototype.constructor=a};Blockly.utils.object.mixin=function(a,b){for(var c in b)a[c]=b[c]};Blockly.utils.object.deepMerge=function(a,b){for(var c in b)a[c]="object"===typeof b[c]?Blockly.utils.object.deepMerge(a[c]||Object.create(null),b[c]):b[c];return a};Blockly.utils.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(b){return a[b]})};Blockly.Events.Ui=function(a,b,c,d){Blockly.Events.Ui.superClass_.constructor.call(this);this.blockId=a?a.id:null;this.workspaceId=a?a.workspace.id:void 0;this.element=b;this.oldValue=c;this.newValue=d;this.recordUndo=!1};Blockly.utils.object.inherits(Blockly.Events.Ui,Blockly.Events.Abstract);Blockly.Events.Ui.prototype.type=Blockly.Events.UI; +Blockly.Events.Ui.prototype.toJson=function(){var a=Blockly.Events.Ui.superClass_.toJson.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.blockId&&(a.blockId=this.blockId);return a};Blockly.Events.Ui.prototype.fromJson=function(a){Blockly.Events.Ui.superClass_.fromJson.call(this,a);this.element=a.element;this.newValue=a.newValue;this.blockId=a.blockId};Blockly.utils.dom={};Blockly.utils.dom.SVG_NS="http://www.w3.org/2000/svg";Blockly.utils.dom.HTML_NS="http://www.w3.org/1999/xhtml";Blockly.utils.dom.XLINK_NS="http://www.w3.org/1999/xlink";Blockly.utils.dom.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};Blockly.utils.dom.cacheWidths_=null;Blockly.utils.dom.cacheReference_=0;Blockly.utils.dom.canvasContext_=null; +Blockly.utils.dom.createSvgElement=function(a,b,c){a=document.createElementNS(Blockly.utils.dom.SVG_NS,a);for(var d in b)a.setAttribute(d,b[d]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);c&&c.appendChild(a);return a};Blockly.utils.dom.addClass=function(a,b){var c=a.getAttribute("class")||"";if(-1!=(" "+c+" ").indexOf(" "+b+" "))return!1;c&&(c+=" ");a.setAttribute("class",c+b);return!0}; +Blockly.utils.dom.removeClass=function(a,b){var c=a.getAttribute("class");if(-1==(" "+c+" ").indexOf(" "+b+" "))return!1;c=c.split(/\s+/);for(var d=0;db||b>this.getChildCount())throw Error(Blockly.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);this.childIndex_[a.getId()]=a;if(a.getParent()==this){var d=this.children_.indexOf(a);-1>>/g,a),a=document.createElement("style"),a.id="blockly-common-style",c=document.createTextNode(c),a.appendChild(c),document.head.insertBefore(a,document.head.firstChild))}};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; +Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;", +"left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);", +"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {", +"max-height: 300px;","overflow: auto;","overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;", +"border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {", +"fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {", +'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {", +"display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text, .blocklyBlockDragSurface text {","user-select: none;","-ms-user-select: none;", +"-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;", +"height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {","z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;", +"}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyFlyout .blocklyScrollbarHandle:hover {", +"fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {", +"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","pointer-events: none","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {", +"background: #fff;","border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;', +"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {", +"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font-family: Arial, sans-serif;","font-size: 13px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {", +"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {", +"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,", +".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}",".blocklyComputeCanvas {", +"position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}"];Blockly.utils.math={};Blockly.utils.math.toRadians=function(a){return a*Math.PI/180};Blockly.utils.math.toDegrees=function(a){return 180*a/Math.PI};Blockly.utils.math.clamp=function(a,b,c){if(ce.top?Blockly.DropDownDiv.getPositionAboveMetrics_(c,d,e,f):b+f.heightdocument.documentElement.clientTop?Blockly.DropDownDiv.getPositionAboveMetrics_(c, +d,e,f):Blockly.DropDownDiv.getPositionTopOfPageMetrics_(a,e,f)};Blockly.DropDownDiv.getPositionBelowMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(Blockly.DropDownDiv.ARROW_SIZE/2+Blockly.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}}; +Blockly.DropDownDiv.getPositionAboveMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*Blockly.DropDownDiv.BORDER_SIZE-Blockly.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}}; +Blockly.DropDownDiv.getPositionTopOfPageMetrics_=function(a,b,c){a=Blockly.DropDownDiv.getPositionX(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowVisible:!1}};Blockly.DropDownDiv.getPositionX=function(a,b,c,d){var e=a;a=Blockly.utils.math.clamp(b,a-d/2,c-d);e-=Blockly.DropDownDiv.ARROW_SIZE/2;b=Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING;d=Blockly.utils.math.clamp(b,e-a,d-b-Blockly.DropDownDiv.ARROW_SIZE);return{arrowX:d,divX:a}}; +Blockly.DropDownDiv.isVisible=function(){return!!Blockly.DropDownDiv.owner_};Blockly.DropDownDiv.hideIfOwner=function(a,b){return Blockly.DropDownDiv.owner_===a?(b?Blockly.DropDownDiv.hideWithoutAnimation():Blockly.DropDownDiv.hide(),!0):!1}; +Blockly.DropDownDiv.hide=function(){var a=Blockly.DropDownDiv.DIV_;a.style.transform="translate(0, 0)";a.style.opacity=0;Blockly.DropDownDiv.animateOutTimer_=setTimeout(function(){Blockly.DropDownDiv.hideWithoutAnimation()},1E3*Blockly.DropDownDiv.ANIMATION_TIME);Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null)}; +Blockly.DropDownDiv.hideWithoutAnimation=function(){if(Blockly.DropDownDiv.isVisible()){Blockly.DropDownDiv.animateOutTimer_&&clearTimeout(Blockly.DropDownDiv.animateOutTimer_);var a=Blockly.DropDownDiv.DIV_;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null);Blockly.DropDownDiv.clearContent();Blockly.DropDownDiv.owner_= +null;Blockly.DropDownDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.rendererClassName_),Blockly.DropDownDiv.rendererClassName_="");Blockly.DropDownDiv.themeClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.themeClassName_),Blockly.DropDownDiv.themeClassName_="");Blockly.getMainWorkspace().markFocused()}}; +Blockly.DropDownDiv.positionInternal_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionMetrics_(a,b,c,d);a.arrowVisible?(Blockly.DropDownDiv.arrow_.style.display="",Blockly.DropDownDiv.arrow_.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",Blockly.DropDownDiv.arrow_.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):Blockly.DropDownDiv.arrow_.style.display="none";b=Math.floor(a.initialX);c=Math.floor(a.initialY); +d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=Blockly.DropDownDiv.DIV_;f.style.left=b+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return a.arrowAtTop}; +Blockly.DropDownDiv.repositionForWindowResize=function(){if(Blockly.DropDownDiv.owner_){var a=Blockly.DropDownDiv.owner_,b=Blockly.DropDownDiv.owner_.getSourceBlock();a=Blockly.DropDownDiv.positionToField_?Blockly.DropDownDiv.getScaledBboxOfField_(a):Blockly.DropDownDiv.getScaledBboxOfBlock_(b);b=a.left+(a.right-a.left)/2;Blockly.DropDownDiv.positionInternal_(b,a.bottom,b,a.top)}else Blockly.DropDownDiv.hide()};Blockly.Grid=function(a,b){this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap};Blockly.Grid.prototype.scale_=1;Blockly.Grid.prototype.dispose=function(){this.gridPattern_=null};Blockly.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};Blockly.Grid.prototype.getSpacing=function(){return this.spacing_};Blockly.Grid.prototype.getPatternId=function(){return this.gridPattern_.id}; +Blockly.Grid.prototype.update=function(a){this.scale_=a;var b=this.spacing_*a||100;this.gridPattern_.setAttribute("width",b);this.gridPattern_.setAttribute("height",b);b=Math.floor(this.spacing_/2)+.5;var c=b-this.length_/2,d=b+this.length_/2;b*=a;c*=a;d*=a;this.setLineAttributes_(this.line1_,a,c,d,b,b);this.setLineAttributes_(this.line2_,a,b,b,c,d)}; +Blockly.Grid.prototype.setLineAttributes_=function(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",b),a.setAttribute("x1",c),a.setAttribute("y1",e),a.setAttribute("x2",d),a.setAttribute("y2",f))};Blockly.Grid.prototype.moveTo=function(a,b){this.gridPattern_.setAttribute("x",a);this.gridPattern_.setAttribute("y",b);(Blockly.utils.userAgent.IE||Blockly.utils.userAgent.EDGE)&&this.update(this.scale_)}; +Blockly.Grid.createDom=function(a,b,c){a=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);0b.indexOf(d))throw Error(d+" is not a valid modifier key.");};Blockly.user.keyMap.createSerializedKey=function(a,b){var c="",d=Blockly.utils.object.values(Blockly.user.keyMap.modifierKeys);Blockly.user.keyMap.checkModifiers_(b,d);for(var e=0,f;f=d[e];e++)-1]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var c=a;a=a.replace(b,"$1 $2")}while(a!=c);return a.replace(/<(\w+)([^<]*)\/>/g,"<$1$2>")}; Blockly.Xml.domToPrettyText=function(a){a=Blockly.Xml.domToText(a).split("<");for(var b="",c=1;c"!=d.slice(-2)&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; -Blockly.Xml.textToDom=function(a){var b=Blockly.utils.xml.textToDomDocument(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};Blockly.Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();var c=Blockly.Xml.domToWorkspace(a,b);b.setResizesEnabled(!0);return c}; +Blockly.Xml.textToDom=function(a){var b=Blockly.utils.xml.textToDomDocument(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};Blockly.Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();a=Blockly.Xml.domToWorkspace(a,b);b.setResizesEnabled(!0);return a}; Blockly.Xml.domToWorkspace=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var d;b.RTL&&(d=b.getWidth());c=[];Blockly.utils.dom.startTextWidthCache();var e=Blockly.Events.getGroup();e||Blockly.Events.setGroup(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(var g=0,h;h=a.childNodes[g];g++){var k=h.nodeName.toLowerCase(),l=h;if("block"==k||"shadow"==k&&!Blockly.Events.recordUndo){var m= Blockly.Xml.domToBlock(l,b);c.push(m.id);var n=l.hasAttribute("x")?parseInt(l.getAttribute("x"),10):10,p=l.hasAttribute("y")?parseInt(l.getAttribute("y"),10):10;isNaN(n)||isNaN(p)||m.moveBy(b.RTL?d-n:n,p);f=!1}else{if("shadow"==k)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==k)b.rendered?Blockly.WorkspaceCommentSvg?Blockly.WorkspaceCommentSvg.fromXml(l,b,d):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):Blockly.WorkspaceComment? Blockly.WorkspaceComment.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==k){if(f)Blockly.Xml.domToVariables(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");f=!1}}}}finally{e||Blockly.Events.setGroup(!1),Blockly.utils.dom.stopTextWidthCache()}b.setResizesEnabled&&b.setResizesEnabled(!0);Blockly.Events.fire(new Blockly.Events.FinishedLoading(b)); -return c};Blockly.Xml.appendDomToWorkspace=function(a,b){var c;b.hasOwnProperty("scale")&&(c=b.getBlocksBoundingBox());var d=Blockly.Xml.domToWorkspace(a,b);if(c&&c.top!=c.bottom){var e=c.bottom;var f=b.RTL?c.right:c.left;var g=Infinity,h=-Infinity,k=Infinity;for(c=0;ch&&(h=l.x)}e=e-k+10;f=b.RTL?f-h:f-g;for(c=0;cg&&(g=k.x)}d=d-h+10;e=b.RTL?e-g:e-f;for(c=0;cc)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);a=Blockly.utils.dom.createSvgElement("circle",{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());Blockly.blockAnimations.connectionUiStep_(a,new Date,c)}}; -Blockly.blockAnimations.connectionUiStep_=function(a,b,c){var d=(new Date-b)/150;1a.workspace.scale)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);Blockly.blockAnimations.disconnectUiStep_(a.getSvgRoot(),b,new Date)}}; -Blockly.blockAnimations.disconnectUiStep_=function(a,b,c){var d=(new Date-c)/200;1c-Blockly.CURRENT_CONNECTION_PREFERENCE)}if(this.localConnection_||this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set."); -else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0};Blockly.InsertionMarkerManager.prototype.getCandidate_=function(a){for(var b=this.getStartRadius_(),c=null,d=null,e=0;e document.");}else a=null;return a};Blockly.Touch={};Blockly.Touch.TOUCH_ENABLED="ontouchstart"in Blockly.utils.global||!!(Blockly.utils.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!Blockly.utils.global.navigator||!Blockly.utils.global.navigator.maxTouchPoints&&!Blockly.utils.global.navigator.msMaxTouchPoints);Blockly.Touch.touchIdentifier_=null;Blockly.Touch.TOUCH_MAP={}; Blockly.utils.global.PointerEvent?Blockly.Touch.TOUCH_MAP={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:Blockly.Touch.TOUCH_ENABLED&&(Blockly.Touch.TOUCH_MAP={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});Blockly.longPid_=0; Blockly.longStart=function(a,b){Blockly.longStop_();a.changedTouches&&1!=a.changedTouches.length||(Blockly.longPid_=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);b&&b.handleRightClick(a)},Blockly.LONGPRESS))};Blockly.longStop_=function(){Blockly.longPid_&&(clearTimeout(Blockly.longPid_),Blockly.longPid_=0)};Blockly.Touch.clearTouchIdentifier=function(){Blockly.Touch.touchIdentifier_=null}; Blockly.Touch.shouldHandleEvent=function(a){return!Blockly.Touch.isMouseOrTouchEvent(a)||Blockly.Touch.checkTouchIdentifier(a)};Blockly.Touch.getTouchIdentifierFromEvent=function(a){return void 0!=a.pointerId?a.pointerId:a.changedTouches&&a.changedTouches[0]&&void 0!==a.changedTouches[0].identifier&&null!==a.changedTouches[0].identifier?a.changedTouches[0].identifier:"mouse"}; @@ -209,7 +185,7 @@ Blockly.Touch.splitEventByTouches=function(a){var b=[];if(a.changedTouches)for(v Blockly.ScrollbarPair.prototype.oldHostMetrics_=null;Blockly.ScrollbarPair.prototype.dispose=function(){Blockly.utils.dom.removeNode(this.corner_);this.oldHostMetrics_=this.workspace_=this.corner_=null;this.hScroll.dispose();this.hScroll=null;this.vScroll.dispose();this.vScroll=null}; Blockly.ScrollbarPair.prototype.resize=function(){var a=this.workspace_.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==a.viewWidth&&this.oldHostMetrics_.viewHeight==a.viewHeight&&this.oldHostMetrics_.absoluteTop==a.absoluteTop&&this.oldHostMetrics_.absoluteLeft==a.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.contentWidth==a.contentWidth&&this.oldHostMetrics_.viewLeft==a.viewLeft&&this.oldHostMetrics_.contentLeft==a.contentLeft||(b=!0),this.oldHostMetrics_&& this.oldHostMetrics_.contentHeight==a.contentHeight&&this.oldHostMetrics_.viewTop==a.viewTop&&this.oldHostMetrics_.contentTop==a.contentTop||(c=!0)):c=b=!0;b&&this.hScroll.resize(a);c&&this.vScroll.resize(a);this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==a.viewWidth&&this.oldHostMetrics_.absoluteLeft==a.absoluteLeft||this.corner_.setAttribute("x",this.vScroll.position_.x);this.oldHostMetrics_&&this.oldHostMetrics_.viewHeight==a.viewHeight&&this.oldHostMetrics_.absoluteTop==a.absoluteTop||this.corner_.setAttribute("y", -this.hScroll.position_.y);this.oldHostMetrics_=a}};Blockly.ScrollbarPair.prototype.set=function(a,b){var c={},d=a*this.hScroll.ratio_,e=b*this.vScroll.ratio_,f=this.vScroll.scrollViewSize_;c.x=this.getRatio_(d,this.hScroll.scrollViewSize_);c.y=this.getRatio_(e,f);this.workspace_.setMetrics(c);this.hScroll.setHandlePosition(d);this.vScroll.setHandlePosition(e)};Blockly.ScrollbarPair.prototype.getRatio_=function(a,b){var c=a/b;return isNaN(c)?0:c}; +this.hScroll.position_.y);this.oldHostMetrics_=a}};Blockly.ScrollbarPair.prototype.set=function(a,b){var c={};a*=this.hScroll.ratio_;b*=this.vScroll.ratio_;var d=this.vScroll.scrollViewSize_;c.x=this.getRatio_(a,this.hScroll.scrollViewSize_);c.y=this.getRatio_(b,d);this.workspace_.setMetrics(c);this.hScroll.setHandlePosition(a);this.vScroll.setHandlePosition(b)};Blockly.ScrollbarPair.prototype.getRatio_=function(a,b){a/=b;return isNaN(a)?0:a}; Blockly.Scrollbar=function(a,b,c,d){this.workspace_=a;this.pair_=c||!1;this.horizontal_=b;this.oldHostMetrics_=null;this.createDom_(d);this.position_=new Blockly.utils.Coordinate(0,0);a=Blockly.Scrollbar.scrollbarThickness;b?(this.svgBackground_.setAttribute("height",a),this.outerSvg_.setAttribute("height",a),this.svgHandle_.setAttribute("height",a-5),this.svgHandle_.setAttribute("y",2.5),this.lengthAttribute_="width",this.positionAttribute_="x"):(this.svgBackground_.setAttribute("width",a),this.outerSvg_.setAttribute("width", a),this.svgHandle_.setAttribute("width",a-5),this.svgHandle_.setAttribute("x",2.5),this.lengthAttribute_="height",this.positionAttribute_="y");this.onMouseDownBarWrapper_=Blockly.bindEventWithChecks_(this.svgBackground_,"mousedown",this,this.onMouseDownBar_);this.onMouseDownHandleWrapper_=Blockly.bindEventWithChecks_(this.svgHandle_,"mousedown",this,this.onMouseDownHandle_)};Blockly.Scrollbar.prototype.origin_=new Blockly.utils.Coordinate(0,0);Blockly.Scrollbar.prototype.startDragMouse_=0; Blockly.Scrollbar.prototype.scrollViewSize_=0;Blockly.Scrollbar.prototype.handleLength_=0;Blockly.Scrollbar.prototype.handlePosition_=0;Blockly.Scrollbar.prototype.isVisible_=!0;Blockly.Scrollbar.prototype.containerVisible_=!0;Blockly.Scrollbar.scrollbarThickness=15;Blockly.Touch.TOUCH_ENABLED&&(Blockly.Scrollbar.scrollbarThickness=25); @@ -232,36 +208,124 @@ Blockly.Scrollbar.prototype.onMouseDownHandle_=function(a){this.workspace_.markF a.stopPropagation(),a.preventDefault())};Blockly.Scrollbar.prototype.onMouseMoveHandle_=function(a){this.setHandlePosition(this.constrainHandle_(this.startDragHandle+((this.horizontal_?a.clientX:a.clientY)-this.startDragMouse_)));this.onScroll_()};Blockly.Scrollbar.prototype.onMouseUpHandle_=function(){this.workspace_.resetDragSurface();Blockly.Touch.clearTouchIdentifier();this.cleanUp_()}; Blockly.Scrollbar.prototype.cleanUp_=function(){Blockly.hideChaff(!0);Blockly.Scrollbar.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseUpWrapper_),Blockly.Scrollbar.onMouseUpWrapper_=null);Blockly.Scrollbar.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.Scrollbar.onMouseMoveWrapper_),Blockly.Scrollbar.onMouseMoveWrapper_=null)}; Blockly.Scrollbar.prototype.constrainHandle_=function(a){return a=0>=a||isNaN(a)||this.scrollViewSize_b.indexOf(d))throw Error(d+" is not a valid modifier key.");};Blockly.user.keyMap.createSerializedKey=function(a,b){var c="",d=Blockly.utils.object.values(Blockly.user.keyMap.modifierKeys);Blockly.user.keyMap.checkModifiers_(b,d);for(var e=0,f;f=d[e];e++)-1 document.");}else a=null;return a};Blockly.VariableMap=function(a){this.variableMap_=Object.create(null);this.workspace=a};Blockly.VariableMap.prototype.clear=function(){this.variableMap_=Object.create(null)};Blockly.VariableMap.prototype.renameVariable=function(a,b){var c=this.getVariable(b,a.type),d=this.workspace.getAllBlocks(!1);Blockly.Events.setGroup(!0);try{c&&c.getId()!=a.getId()?this.renameVariableWithConflict_(a,b,c,d):this.renameVariableAndUses_(a,b,d)}finally{Blockly.Events.setGroup(!1)}}; +Blockly.Scrollbar.prototype.setOrigin=function(a,b){this.origin_=new Blockly.utils.Coordinate(a,b)};Blockly.Tooltip={};Blockly.Tooltip.visible=!1;Blockly.Tooltip.blocked_=!1;Blockly.Tooltip.LIMIT=50;Blockly.Tooltip.mouseOutPid_=0;Blockly.Tooltip.showPid_=0;Blockly.Tooltip.lastX_=0;Blockly.Tooltip.lastY_=0;Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.OFFSET_X=0;Blockly.Tooltip.OFFSET_Y=10;Blockly.Tooltip.RADIUS_OK=10;Blockly.Tooltip.HOVER_MS=750;Blockly.Tooltip.MARGINS=5;Blockly.Tooltip.DIV=null; +Blockly.Tooltip.createDom=function(){Blockly.Tooltip.DIV||(Blockly.Tooltip.DIV=document.createElement("div"),Blockly.Tooltip.DIV.className="blocklyTooltipDiv",(Blockly.parentContainer||document.body).appendChild(Blockly.Tooltip.DIV))}; +Blockly.Tooltip.bindMouseEvents=function(a){a.mouseOverWrapper_=Blockly.bindEvent_(a,"mouseover",null,Blockly.Tooltip.onMouseOver_);a.mouseOutWrapper_=Blockly.bindEvent_(a,"mouseout",null,Blockly.Tooltip.onMouseOut_);a.addEventListener("mousemove",Blockly.Tooltip.onMouseMove_,!1)};Blockly.Tooltip.unbindMouseEvents=function(a){a&&(Blockly.unbindEvent_(a.mouseOverWrapper_),Blockly.unbindEvent_(a.mouseOutWrapper_),a.removeEventListener("mousemove",Blockly.Tooltip.onMouseMove_))}; +Blockly.Tooltip.onMouseOver_=function(a){if(!Blockly.Tooltip.blocked_){for(a=a.currentTarget;"string"!=typeof a.tooltip&&"function"!=typeof a.tooltip;)a=a.tooltip;Blockly.Tooltip.element_!=a&&(Blockly.Tooltip.hide(),Blockly.Tooltip.poisonedElement_=null,Blockly.Tooltip.element_=a);clearTimeout(Blockly.Tooltip.mouseOutPid_)}}; +Blockly.Tooltip.onMouseOut_=function(a){Blockly.Tooltip.blocked_||(Blockly.Tooltip.mouseOutPid_=setTimeout(function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()},1),clearTimeout(Blockly.Tooltip.showPid_))}; +Blockly.Tooltip.onMouseMove_=function(a){if(Blockly.Tooltip.element_&&Blockly.Tooltip.element_.tooltip&&!Blockly.Tooltip.blocked_)if(Blockly.Tooltip.visible){var b=Blockly.Tooltip.lastX_-a.pageX;a=Blockly.Tooltip.lastY_-a.pageY;Math.sqrt(b*b+a*a)>Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=setTimeout(Blockly.Tooltip.show_, +Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.dispose=function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0}; +Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1}; +Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){Blockly.Tooltip.DIV.textContent="";for(var a=Blockly.Tooltip.element_.tooltip;"function"==typeof a;)a=a();a=Blockly.utils.string.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;bc+window.scrollY&&(e-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?d=Math.max(Blockly.Tooltip.MARGINS-window.scrollX, +d):d+Blockly.Tooltip.DIV.offsetWidth>b+window.scrollX-2*Blockly.Tooltip.MARGINS&&(d=b-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=e+"px";Blockly.Tooltip.DIV.style.left=d+"px"}};Blockly.WorkspaceDragSurfaceSvg=function(a){this.container_=a;this.createDom()};Blockly.WorkspaceDragSurfaceSvg.prototype.SVG_=null;Blockly.WorkspaceDragSurfaceSvg.prototype.dragGroup_=null;Blockly.WorkspaceDragSurfaceSvg.prototype.container_=null; +Blockly.WorkspaceDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.container_.appendChild(this.SVG_))}; +Blockly.WorkspaceDragSurfaceSvg.prototype.translateSurface=function(a,b){a=a.toFixed(0);b=b.toFixed(0);this.SVG_.style.display="block";Blockly.utils.dom.setCssTransform(this.SVG_,"translate3d("+a+"px, "+b+"px, 0px)")};Blockly.WorkspaceDragSurfaceSvg.prototype.getSurfaceTranslation=function(){return Blockly.utils.getRelativeXY(this.SVG_)}; +Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var b=this.SVG_.childNodes[0],c=this.SVG_.childNodes[1];if(!(b&&c&&Blockly.utils.dom.hasClass(b,"blocklyBlockCanvas")&&Blockly.utils.dom.hasClass(c,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.previousSibling_?Blockly.utils.dom.insertAfter(b,this.previousSibling_):a.insertBefore(b,a.firstChild); +Blockly.utils.dom.insertAfter(c,b);this.SVG_.style.display="none";if(this.SVG_.childNodes.length)throw Error("Drag surface was not cleared.");Blockly.utils.dom.setCssTransform(this.SVG_,"");this.previousSibling_=null}; +Blockly.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(a,b,c,d,e,f){if(this.SVG_.childNodes.length)throw Error("Already dragging a block.");this.previousSibling_=c;a.setAttribute("transform","translate(0, 0) scale("+f+")");b.setAttribute("transform","translate(0, 0) scale("+f+")");this.SVG_.setAttribute("width",d);this.SVG_.setAttribute("height",e);this.SVG_.appendChild(a);this.SVG_.appendChild(b);this.SVG_.style.display="block"};Blockly.ASTNode=function(a,b,c){if(!b)throw Error("Cannot create a node without a location.");this.type_=a;this.isConnection_=Blockly.ASTNode.isConnectionType_(a);this.location_=b;this.processParams_(c||null)};Blockly.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"};Blockly.ASTNode.NAVIGATE_ALL_FIELDS=!1;Blockly.ASTNode.DEFAULT_OFFSET_Y=-20;Blockly.ASTNode.isConnectionType_=function(a){switch(a){case Blockly.ASTNode.types.PREVIOUS:case Blockly.ASTNode.types.NEXT:case Blockly.ASTNode.types.INPUT:case Blockly.ASTNode.types.OUTPUT:return!0}return!1}; +Blockly.ASTNode.createFieldNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.FIELD,a):null}; +Blockly.ASTNode.createConnectionNode=function(a){return a?a.type==Blockly.INPUT_VALUE||a.type==Blockly.NEXT_STATEMENT&&a.getParentInput()?Blockly.ASTNode.createInputNode(a.getParentInput()):a.type==Blockly.NEXT_STATEMENT?new Blockly.ASTNode(Blockly.ASTNode.types.NEXT,a):a.type==Blockly.OUTPUT_VALUE?new Blockly.ASTNode(Blockly.ASTNode.types.OUTPUT,a):a.type==Blockly.PREVIOUS_STATEMENT?new Blockly.ASTNode(Blockly.ASTNode.types.PREVIOUS,a):null:null}; +Blockly.ASTNode.createInputNode=function(a){return a&&a.connection?new Blockly.ASTNode(Blockly.ASTNode.types.INPUT,a.connection):null};Blockly.ASTNode.createBlockNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.BLOCK,a):null};Blockly.ASTNode.createStackNode=function(a){return a?new Blockly.ASTNode(Blockly.ASTNode.types.STACK,a):null};Blockly.ASTNode.createWorkspaceNode=function(a,b){return b&&a?new Blockly.ASTNode(Blockly.ASTNode.types.WORKSPACE,a,{wsCoordinate:b}):null}; +Blockly.ASTNode.prototype.processParams_=function(a){a&&a.wsCoordinate&&(this.wsCoordinate_=a.wsCoordinate)};Blockly.ASTNode.prototype.getLocation=function(){return this.location_};Blockly.ASTNode.prototype.getType=function(){return this.type_};Blockly.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_};Blockly.ASTNode.prototype.isConnection=function(){return this.isConnection_}; +Blockly.ASTNode.prototype.findNextForInput_=function(){var a=this.location_.getParentInput(),b=a.getSourceBlock();a=b.inputList.indexOf(a)+1;for(var c;c=b.inputList[a];a++){for(var d=c.fieldRow,e=0,f;f=d[e];e++)if(f.isClickable()||Blockly.ASTNode.NAVIGATE_ALL_FIELDS)return Blockly.ASTNode.createFieldNode(f);if(c.connection)return Blockly.ASTNode.createInputNode(c)}return null}; +Blockly.ASTNode.prototype.findNextForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;b=c.inputList[d];d++){for(var e=b.fieldRow;ac)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);a=Blockly.utils.dom.createSvgElement("circle",{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());Blockly.blockAnimations.connectionUiStep_(a,new Date,c)}}; +Blockly.blockAnimations.connectionUiStep_=function(a,b,c){var d=(new Date-b)/150;1a.workspace.scale)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);Blockly.blockAnimations.disconnectUiStep_(a.getSvgRoot(),b,new Date)}}; +Blockly.blockAnimations.disconnectUiStep_=function(a,b,c){var d=(new Date-c)/200;1b-Blockly.CURRENT_CONNECTION_PREFERENCE)}if(this.localConnection_||this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set."); +else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0};Blockly.InsertionMarkerManager.prototype.getCandidate_=function(a){for(var b=this.getStartRadius_(),c=null,d=null,e=0;ea.viewWidth)return b;if(this.workspace_.RTL)var c=this.anchorXY_.x-b,d=c-this.width_,e=a.viewLeft+a.viewWidth,f=a.viewLeft+Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;else d=b+this.anchorXY_.x,c=d+this.width_,f=a.viewLeft,e=a.viewLeft+a.viewWidth-Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;this.workspace_.RTL?de&&(b=-(e-this.anchorXY_.x)): de&&(b=e-this.anchorXY_.x-this.width_);return b};Blockly.Bubble.prototype.getOptimalRelativeTop_=function(a){var b=-this.height_/4;if(this.height_>a.viewHeight)return b;var c=this.anchorXY_.y+b,d=c+this.height_,e=a.viewTop;a=a.viewTop+a.viewHeight-Blockly.Scrollbar.scrollbarThickness/this.workspace_.scale;var f=this.anchorXY_.y;ca&&(b=a-f-this.height_);return b}; Blockly.Bubble.prototype.positionBubble_=function(){var a=this.anchorXY_.x;a=this.workspace_.RTL?a-(this.relativeLeft_+this.width_):a+this.relativeLeft_;this.moveTo(a,this.relativeTop_+this.anchorXY_.y)};Blockly.Bubble.prototype.moveTo=function(a,b){this.bubbleGroup_.setAttribute("transform","translate("+a+","+b+")")};Blockly.Bubble.prototype.setDragging=function(a){!a&&this.moveCallback_&&this.moveCallback_()}; @@ -304,18 +368,18 @@ Blockly.Events.CommentBase.prototype.fromJson=function(a){Blockly.Events.Comment Blockly.Events.CommentChange.prototype.toJson=function(){var a=Blockly.Events.CommentChange.superClass_.toJson.call(this);a.newContents=this.newContents_;return a};Blockly.Events.CommentChange.prototype.fromJson=function(a){Blockly.Events.CommentChange.superClass_.fromJson.call(this,a);this.newContents_=a.newValue};Blockly.Events.CommentChange.prototype.isNull=function(){return this.oldContents_==this.newContents_}; Blockly.Events.CommentChange.prototype.run=function(a){var b=this.getEventWorkspace_().getCommentById(this.commentId);b?b.setContent(a?this.newContents_:this.oldContents_):console.warn("Can't change non-existent comment: "+this.commentId)};Blockly.Events.CommentCreate=function(a){a&&(Blockly.Events.CommentCreate.superClass_.constructor.call(this,a),this.xml=a.toXmlWithXY())};Blockly.utils.object.inherits(Blockly.Events.CommentCreate,Blockly.Events.CommentBase); Blockly.Events.CommentCreate.prototype.type=Blockly.Events.COMMENT_CREATE;Blockly.Events.CommentCreate.prototype.toJson=function(){var a=Blockly.Events.CommentCreate.superClass_.toJson.call(this);a.xml=Blockly.Xml.domToText(this.xml);return a};Blockly.Events.CommentCreate.prototype.fromJson=function(a){Blockly.Events.CommentCreate.superClass_.fromJson.call(this,a);this.xml=Blockly.Xml.textToDom(a.xml)}; -Blockly.Events.CommentCreate.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,a)};Blockly.Events.CommentCreateDeleteHelper=function(a,b){var c=a.getEventWorkspace_();if(b){var d=Blockly.utils.xml.createElement("xml");d.appendChild(a.xml);Blockly.Xml.domToWorkspace(d,c)}else(c=c.getCommentById(a.commentId))?c.dispose(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.commentId)}; +Blockly.Events.CommentCreate.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,a)};Blockly.Events.CommentCreateDeleteHelper=function(a,b){var c=a.getEventWorkspace_();b?(b=Blockly.utils.xml.createElement("xml"),b.appendChild(a.xml),Blockly.Xml.domToWorkspace(b,c)):(c=c.getCommentById(a.commentId))?c.dispose(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.commentId)}; Blockly.Events.CommentDelete=function(a){a&&(Blockly.Events.CommentDelete.superClass_.constructor.call(this,a),this.xml=a.toXmlWithXY())};Blockly.utils.object.inherits(Blockly.Events.CommentDelete,Blockly.Events.CommentBase);Blockly.Events.CommentDelete.prototype.type=Blockly.Events.COMMENT_DELETE;Blockly.Events.CommentDelete.prototype.toJson=function(){return Blockly.Events.CommentDelete.superClass_.toJson.call(this)}; Blockly.Events.CommentDelete.prototype.fromJson=function(a){Blockly.Events.CommentDelete.superClass_.fromJson.call(this,a)};Blockly.Events.CommentDelete.prototype.run=function(a){Blockly.Events.CommentCreateDeleteHelper(this,!a)};Blockly.Events.CommentMove=function(a){a&&(Blockly.Events.CommentMove.superClass_.constructor.call(this,a),this.comment_=a,this.oldCoordinate_=a.getXY(),this.newCoordinate_=null)};Blockly.utils.object.inherits(Blockly.Events.CommentMove,Blockly.Events.CommentBase); Blockly.Events.CommentMove.prototype.recordNew=function(){if(!this.comment_)throw Error("Tried to record the new position of a comment on the same event twice.");this.newCoordinate_=this.comment_.getXY();this.comment_=null};Blockly.Events.CommentMove.prototype.type=Blockly.Events.COMMENT_MOVE;Blockly.Events.CommentMove.prototype.setOldCoordinate=function(a){this.oldCoordinate_=a}; Blockly.Events.CommentMove.prototype.toJson=function(){var a=Blockly.Events.CommentMove.superClass_.toJson.call(this);this.newCoordinate_&&(a.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y));return a};Blockly.Events.CommentMove.prototype.fromJson=function(a){Blockly.Events.CommentMove.superClass_.fromJson.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.newCoordinate_=new Blockly.utils.Coordinate(Number(a[0]),Number(a[1])))}; Blockly.Events.CommentMove.prototype.isNull=function(){return Blockly.utils.Coordinate.equals(this.oldCoordinate_,this.newCoordinate_)};Blockly.Events.CommentMove.prototype.run=function(a){var b=this.getEventWorkspace_().getCommentById(this.commentId);if(b){a=a?this.newCoordinate_:this.oldCoordinate_;var c=b.getXY();b.moveBy(a.x-c.x,a.y-c.y)}else console.warn("Can't move non-existent comment: "+this.commentId)};Blockly.BubbleDragger=function(a,b){this.draggingBubble_=a;this.workspace_=b;this.deleteArea_=null;this.wouldDeleteBubble_=!1;this.startXY_=this.draggingBubble_.getRelativeToSurfaceXY();this.dragSurface_=Blockly.utils.is3dSupported()&&b.getBlockDragSurface()?b.getBlockDragSurface():null};Blockly.BubbleDragger.prototype.dispose=function(){this.dragSurface_=this.workspace_=this.draggingBubble_=null}; Blockly.BubbleDragger.prototype.startBubbleDrag=function(){Blockly.Events.getGroup()||Blockly.Events.setGroup(!0);this.workspace_.setResizesEnabled(!1);this.draggingBubble_.setAutoLayout(!1);this.dragSurface_&&this.moveToDragSurface_();this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!0);var a=this.workspace_.getToolbox();if(a){var b=this.draggingBubble_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";a.addStyle(b)}}; -Blockly.BubbleDragger.prototype.dragBubble=function(a,b){var c=this.pixelsToWorkspaceUnits_(b);c=Blockly.utils.Coordinate.sum(this.startXY_,c);this.draggingBubble_.moveDuringDrag(this.dragSurface_,c);this.draggingBubble_.isDeletable()&&(this.deleteArea_=this.workspace_.isDeleteArea(a),this.updateCursorDuringBubbleDrag_())}; +Blockly.BubbleDragger.prototype.dragBubble=function(a,b){b=this.pixelsToWorkspaceUnits_(b);b=Blockly.utils.Coordinate.sum(this.startXY_,b);this.draggingBubble_.moveDuringDrag(this.dragSurface_,b);this.draggingBubble_.isDeletable()&&(this.deleteArea_=this.workspace_.isDeleteArea(a),this.updateCursorDuringBubbleDrag_())}; Blockly.BubbleDragger.prototype.maybeDeleteBubble_=function(){var a=this.workspace_.trashcan;this.wouldDeleteBubble_?(a&&setTimeout(a.close.bind(a),100),this.fireMoveEvent_(),this.draggingBubble_.dispose(!1,!0)):a&&a.close();return this.wouldDeleteBubble_}; Blockly.BubbleDragger.prototype.updateCursorDuringBubbleDrag_=function(){this.wouldDeleteBubble_=this.deleteArea_!=Blockly.DELETE_AREA_NONE;var a=this.workspace_.trashcan;this.wouldDeleteBubble_?(this.draggingBubble_.setDeleteStyle(!0),this.deleteArea_==Blockly.DELETE_AREA_TRASH&&a&&a.setOpen(!0)):(this.draggingBubble_.setDeleteStyle(!1),a&&a.setOpen(!1))}; -Blockly.BubbleDragger.prototype.endBubbleDrag=function(a,b){this.dragBubble(a,b);var c=this.pixelsToWorkspaceUnits_(b);c=Blockly.utils.Coordinate.sum(this.startXY_,c);this.draggingBubble_.moveTo(c.x,c.y);this.maybeDeleteBubble_()||(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_());this.workspace_.setResizesEnabled(!0);this.workspace_.getToolbox()&&(c=this.draggingBubble_.isDeletable()? -"blocklyToolboxDelete":"blocklyToolboxGrab",this.workspace_.getToolbox().removeStyle(c));Blockly.Events.setGroup(!1)};Blockly.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var a=new Blockly.Events.CommentMove(this.draggingBubble_);a.setOldCoordinate(this.startXY_);a.recordNew();Blockly.Events.fire(a)}}; +Blockly.BubbleDragger.prototype.endBubbleDrag=function(a,b){this.dragBubble(a,b);a=this.pixelsToWorkspaceUnits_(b);a=Blockly.utils.Coordinate.sum(this.startXY_,a);this.draggingBubble_.moveTo(a.x,a.y);this.maybeDeleteBubble_()||(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_());this.workspace_.setResizesEnabled(!0);this.workspace_.getToolbox()&&(a=this.draggingBubble_.isDeletable()? +"blocklyToolboxDelete":"blocklyToolboxGrab",this.workspace_.getToolbox().removeStyle(a));Blockly.Events.setGroup(!1)};Blockly.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var a=new Blockly.Events.CommentMove(this.draggingBubble_);a.setOldCoordinate(this.startXY_);a.recordNew();Blockly.Events.fire(a)}}; Blockly.BubbleDragger.prototype.pixelsToWorkspaceUnits_=function(a){a=new Blockly.utils.Coordinate(a.x/this.workspace_.scale,a.y/this.workspace_.scale);this.workspace_.isMutator&&a.scale(1/this.workspace_.options.parentWorkspace.scale);return a};Blockly.BubbleDragger.prototype.moveToDragSurface_=function(){this.draggingBubble_.moveTo(0,0);this.dragSurface_.translateSurface(this.startXY_.x,this.startXY_.y);this.dragSurface_.setBlocksAndShow(this.draggingBubble_.getSvgRoot())};Blockly.WorkspaceDragger=function(a){this.workspace_=a;this.startScrollXY_=new Blockly.utils.Coordinate(a.scrollX,a.scrollY)};Blockly.WorkspaceDragger.prototype.dispose=function(){this.workspace_=null};Blockly.WorkspaceDragger.prototype.startDrag=function(){Blockly.selected&&Blockly.selected.unselect();this.workspace_.setupDragSurface()};Blockly.WorkspaceDragger.prototype.endDrag=function(a){this.drag(a);this.workspace_.resetDragSurface()}; Blockly.WorkspaceDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.workspace_.scroll(a.x,a.y)};Blockly.FlyoutDragger=function(a){Blockly.FlyoutDragger.superClass_.constructor.call(this,a.getWorkspace());this.scrollbar_=a.scrollbar_;this.horizontalLayout_=a.horizontalLayout_};Blockly.utils.object.inherits(Blockly.FlyoutDragger,Blockly.WorkspaceDragger);Blockly.FlyoutDragger.prototype.drag=function(a){a=Blockly.utils.Coordinate.sum(this.startScrollXY_,a);this.horizontalLayout_?this.scrollbar_.set(-a.x):this.scrollbar_.set(-a.y)};Blockly.Action=function(a,b){this.name=a;this.desc=b};Blockly.navigation={};Blockly.navigation.loggingCallback=null;Blockly.navigation.STATE_FLYOUT=1;Blockly.navigation.STATE_WS=2;Blockly.navigation.STATE_TOOLBOX=3;Blockly.navigation.WS_MOVE_DISTANCE=40;Blockly.navigation.currentState_=Blockly.navigation.STATE_WS; Blockly.navigation.actionNames={PREVIOUS:"previous",NEXT:"next",IN:"in",OUT:"out",INSERT:"insert",MARK:"mark",DISCONNECT:"disconnect",TOOLBOX:"toolbox",EXIT:"exit",TOGGLE_KEYBOARD_NAV:"toggle_keyboard_nav",MOVE_WS_CURSOR_UP:"move workspace cursor up",MOVE_WS_CURSOR_DOWN:"move workspace cursor down",MOVE_WS_CURSOR_LEFT:"move workspace cursor left",MOVE_WS_CURSOR_RIGHT:"move workspace cursor right"};Blockly.navigation.MARKER_NAME="local_marker_1";Blockly.navigation.getMarker=function(){return Blockly.getMainWorkspace().getMarker(Blockly.navigation.MARKER_NAME)}; @@ -345,7 +409,7 @@ Blockly.navigation.onBlocklyAction=function(a){var b=Blockly.getMainWorkspace(). Blockly.navigation.handleActions_=function(a){return a.name==Blockly.navigation.actionNames.TOOLBOX||Blockly.navigation.currentState_==Blockly.navigation.STATE_TOOLBOX?Blockly.navigation.toolboxOnAction_(a):a.name==Blockly.navigation.actionNames.TOGGLE_KEYBOARD_NAV?(Blockly.navigation.disableKeyboardAccessibility(),!0):Blockly.navigation.currentState_==Blockly.navigation.STATE_WS?Blockly.navigation.workspaceOnAction_(a):Blockly.navigation.currentState_==Blockly.navigation.STATE_FLYOUT?Blockly.navigation.flyoutOnAction_(a): !1};Blockly.navigation.flyoutOnAction_=function(a){var b=Blockly.getMainWorkspace(),c=b.getToolbox();if((b=c?c.flyout_:b.getFlyout())&&b.onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.OUT:return Blockly.navigation.focusToolbox_(),!0;case Blockly.navigation.actionNames.MARK:return Blockly.navigation.insertFromFlyout(),!0;case Blockly.navigation.actionNames.EXIT:return Blockly.navigation.focusWorkspace_(),!0;default:return!1}}; Blockly.navigation.toolboxOnAction_=function(a){var b=Blockly.getMainWorkspace(),c=b.getToolbox();return c&&c.onBlocklyAction(a)?!0:a.name===Blockly.navigation.actionNames.TOOLBOX?(b.getToolbox()?Blockly.navigation.focusToolbox_():Blockly.navigation.focusFlyout_(),!0):a.name===Blockly.navigation.actionNames.IN?(Blockly.navigation.focusFlyout_(),!0):a.name===Blockly.navigation.actionNames.EXIT?(Blockly.navigation.focusWorkspace_(),!0):!1}; -Blockly.navigation.moveWSCursor_=function(a,b){var c=Blockly.getMainWorkspace().getCursor(),d=Blockly.getMainWorkspace().getCursor().getCurNode();if(d.getType()!==Blockly.ASTNode.types.WORKSPACE)return!1;var e=d.getWsCoordinate();d=a*Blockly.navigation.WS_MOVE_DISTANCE+e.x;e=b*Blockly.navigation.WS_MOVE_DISTANCE+e.y;c.setCurNode(Blockly.ASTNode.createWorkspaceNode(Blockly.getMainWorkspace(),new Blockly.utils.Coordinate(d,e)));return!0}; +Blockly.navigation.moveWSCursor_=function(a,b){var c=Blockly.getMainWorkspace().getCursor(),d=Blockly.getMainWorkspace().getCursor().getCurNode();if(d.getType()!==Blockly.ASTNode.types.WORKSPACE)return!1;d=d.getWsCoordinate();a=a*Blockly.navigation.WS_MOVE_DISTANCE+d.x;b=b*Blockly.navigation.WS_MOVE_DISTANCE+d.y;c.setCurNode(Blockly.ASTNode.createWorkspaceNode(Blockly.getMainWorkspace(),new Blockly.utils.Coordinate(a,b)));return!0}; Blockly.navigation.workspaceOnAction_=function(a){if(Blockly.getMainWorkspace().getCursor().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.INSERT:return Blockly.navigation.modify_(),!0;case Blockly.navigation.actionNames.MARK:return Blockly.navigation.handleEnterForWS_(),!0;case Blockly.navigation.actionNames.DISCONNECT:return Blockly.navigation.disconnectBlocks_(),!0;case Blockly.navigation.actionNames.MOVE_WS_CURSOR_UP:return Blockly.navigation.moveWSCursor_(0,-1); case Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN:return Blockly.navigation.moveWSCursor_(0,1);case Blockly.navigation.actionNames.MOVE_WS_CURSOR_LEFT:return Blockly.navigation.moveWSCursor_(-1,0);case Blockly.navigation.actionNames.MOVE_WS_CURSOR_RIGHT:return Blockly.navigation.moveWSCursor_(1,0);default:return!1}}; Blockly.navigation.handleEnterForWS_=function(){var a=Blockly.getMainWorkspace().getCursor().getCurNode(),b=a.getType();b==Blockly.ASTNode.types.FIELD?a.getLocation().showEditor():a.isConnection()||b==Blockly.ASTNode.types.WORKSPACE?Blockly.navigation.markAtCursor_():b==Blockly.ASTNode.types.BLOCK?Blockly.navigation.warn_("Cannot mark a block."):b==Blockly.ASTNode.types.STACK&&Blockly.navigation.warn_("Cannot mark a stack.")}; @@ -353,15 +417,7 @@ Blockly.navigation.ACTION_PREVIOUS=new Blockly.Action(Blockly.navigation.actionN Blockly.navigation.ACTION_INSERT=new Blockly.Action(Blockly.navigation.actionNames.INSERT,"Connect the current location to the marked location.");Blockly.navigation.ACTION_MARK=new Blockly.Action(Blockly.navigation.actionNames.MARK,"Mark the current location.");Blockly.navigation.ACTION_DISCONNECT=new Blockly.Action(Blockly.navigation.actionNames.DISCONNECT,"Disconnect the block at the current location from its parent."); Blockly.navigation.ACTION_TOOLBOX=new Blockly.Action(Blockly.navigation.actionNames.TOOLBOX,"Open the toolbox.");Blockly.navigation.ACTION_EXIT=new Blockly.Action(Blockly.navigation.actionNames.EXIT,"Close the current modal, such as a toolbox or field editor.");Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV=new Blockly.Action(Blockly.navigation.actionNames.TOGGLE_KEYBOARD_NAV,"Turns on and off keyboard navigation."); Blockly.navigation.ACTION_MOVE_WS_CURSOR_LEFT=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_LEFT,"Move the workspace cursor to the lefts.");Blockly.navigation.ACTION_MOVE_WS_CURSOR_RIGHT=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_RIGHT,"Move the workspace cursor to the right.");Blockly.navigation.ACTION_MOVE_WS_CURSOR_UP=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_UP,"Move the workspace cursor up."); -Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN,"Move the workspace cursor down.");Blockly.navigation.READONLY_ACTION_LIST=[Blockly.navigation.ACTION_PREVIOUS,Blockly.navigation.ACTION_OUT,Blockly.navigation.ACTION_IN,Blockly.navigation.ACTION_NEXT,Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV];Blockly.Tooltip={};Blockly.Tooltip.visible=!1;Blockly.Tooltip.blocked_=!1;Blockly.Tooltip.LIMIT=50;Blockly.Tooltip.mouseOutPid_=0;Blockly.Tooltip.showPid_=0;Blockly.Tooltip.lastX_=0;Blockly.Tooltip.lastY_=0;Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.OFFSET_X=0;Blockly.Tooltip.OFFSET_Y=10;Blockly.Tooltip.RADIUS_OK=10;Blockly.Tooltip.HOVER_MS=750;Blockly.Tooltip.MARGINS=5;Blockly.Tooltip.DIV=null; -Blockly.Tooltip.createDom=function(){Blockly.Tooltip.DIV||(Blockly.Tooltip.DIV=document.createElement("div"),Blockly.Tooltip.DIV.className="blocklyTooltipDiv",document.body.appendChild(Blockly.Tooltip.DIV))};Blockly.Tooltip.bindMouseEvents=function(a){Blockly.bindEvent_(a,"mouseover",null,Blockly.Tooltip.onMouseOver_);Blockly.bindEvent_(a,"mouseout",null,Blockly.Tooltip.onMouseOut_);a.addEventListener("mousemove",Blockly.Tooltip.onMouseMove_,!1)}; -Blockly.Tooltip.onMouseOver_=function(a){if(!Blockly.Tooltip.blocked_){for(a=a.currentTarget;"string"!=typeof a.tooltip&&"function"!=typeof a.tooltip;)a=a.tooltip;Blockly.Tooltip.element_!=a&&(Blockly.Tooltip.hide(),Blockly.Tooltip.poisonedElement_=null,Blockly.Tooltip.element_=a);clearTimeout(Blockly.Tooltip.mouseOutPid_)}}; -Blockly.Tooltip.onMouseOut_=function(a){Blockly.Tooltip.blocked_||(Blockly.Tooltip.mouseOutPid_=setTimeout(function(){Blockly.Tooltip.element_=null;Blockly.Tooltip.poisonedElement_=null;Blockly.Tooltip.hide()},1),clearTimeout(Blockly.Tooltip.showPid_))}; -Blockly.Tooltip.onMouseMove_=function(a){if(Blockly.Tooltip.element_&&Blockly.Tooltip.element_.tooltip&&!Blockly.Tooltip.blocked_)if(Blockly.Tooltip.visible){var b=Blockly.Tooltip.lastX_-a.pageX;a=Blockly.Tooltip.lastY_-a.pageY;Math.sqrt(b*b+a*a)>Blockly.Tooltip.RADIUS_OK&&Blockly.Tooltip.hide()}else Blockly.Tooltip.poisonedElement_!=Blockly.Tooltip.element_&&(clearTimeout(Blockly.Tooltip.showPid_),Blockly.Tooltip.lastX_=a.pageX,Blockly.Tooltip.lastY_=a.pageY,Blockly.Tooltip.showPid_=setTimeout(Blockly.Tooltip.show_, -Blockly.Tooltip.HOVER_MS))};Blockly.Tooltip.hide=function(){Blockly.Tooltip.visible&&(Blockly.Tooltip.visible=!1,Blockly.Tooltip.DIV&&(Blockly.Tooltip.DIV.style.display="none"));Blockly.Tooltip.showPid_&&clearTimeout(Blockly.Tooltip.showPid_)};Blockly.Tooltip.block=function(){Blockly.Tooltip.hide();Blockly.Tooltip.blocked_=!0};Blockly.Tooltip.unblock=function(){Blockly.Tooltip.blocked_=!1}; -Blockly.Tooltip.show_=function(){if(!Blockly.Tooltip.blocked_&&(Blockly.Tooltip.poisonedElement_=Blockly.Tooltip.element_,Blockly.Tooltip.DIV)){Blockly.Tooltip.DIV.innerHTML="";for(var a=Blockly.Tooltip.element_.tooltip;"function"==typeof a;)a=a();a=Blockly.utils.string.wrap(a,Blockly.Tooltip.LIMIT);a=a.split("\n");for(var b=0;bc+window.scrollY&&(e-=Blockly.Tooltip.DIV.offsetHeight+2*Blockly.Tooltip.OFFSET_Y);a?d=Math.max(Blockly.Tooltip.MARGINS-window.scrollX, -d):d+Blockly.Tooltip.DIV.offsetWidth>b+window.scrollX-2*Blockly.Tooltip.MARGINS&&(d=b-Blockly.Tooltip.DIV.offsetWidth-2*Blockly.Tooltip.MARGINS);Blockly.Tooltip.DIV.style.top=e+"px";Blockly.Tooltip.DIV.style.left=d+"px"}};Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=new Blockly.utils.Coordinate(0,0);this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null;this.creatorWorkspace_=b;this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_= +Blockly.navigation.ACTION_MOVE_WS_CURSOR_DOWN=new Blockly.Action(Blockly.navigation.actionNames.MOVE_WS_CURSOR_DOWN,"Move the workspace cursor down.");Blockly.navigation.READONLY_ACTION_LIST=[Blockly.navigation.ACTION_PREVIOUS,Blockly.navigation.ACTION_OUT,Blockly.navigation.ACTION_IN,Blockly.navigation.ACTION_NEXT,Blockly.navigation.ACTION_TOGGLE_KEYBOARD_NAV];Blockly.Gesture=function(a,b){this.mouseDownXY_=null;this.currentDragDeltaXY_=new Blockly.utils.Coordinate(0,0);this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null;this.creatorWorkspace_=b;this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1;this.mostRecentEvent_=a;this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null;this.isEnding_=this.hasStarted_= this.calledUpdateIsDragging_=!1;this.healStack_=!Blockly.DRAG_STACK};Blockly.Gesture.prototype.dispose=function(){Blockly.Touch.clearTouchIdentifier();Blockly.Tooltip.unblock();this.creatorWorkspace_.clearGesture();this.onMoveWrapper_&&Blockly.unbindEvent_(this.onMoveWrapper_);this.onUpWrapper_&&Blockly.unbindEvent_(this.onUpWrapper_);this.blockDragger_&&this.blockDragger_.dispose();this.workspaceDragger_&&this.workspaceDragger_.dispose();this.bubbleDragger_&&this.bubbleDragger_.dispose()}; Blockly.Gesture.prototype.updateFromEvent_=function(a){var b=new Blockly.utils.Coordinate(a.clientX,a.clientY);this.updateDragDelta_(b)&&(this.updateIsDragging_(),Blockly.longStop_());this.mostRecentEvent_=a}; Blockly.Gesture.prototype.updateDragDelta_=function(a){this.currentDragDeltaXY_=Blockly.utils.Coordinate.difference(a,this.mouseDownXY_);return this.hasExceededDragRadius_?!1:this.hasExceededDragRadius_=Blockly.utils.Coordinate.magnitude(this.currentDragDeltaXY_)>(this.flyout_?Blockly.FLYOUT_DRAG_RADIUS:Blockly.DRAG_RADIUS)}; @@ -389,28 +445,30 @@ Blockly.Gesture.prototype.setTargetBlock_=function(a){a.isShadow()?this.setTarge Blockly.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()};Blockly.Gesture.prototype.isFieldClick_=function(){return(this.startField_?this.startField_.isClickable():!1)&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)};Blockly.Gesture.prototype.isWorkspaceClick_=function(){return!this.startBlock_&&!this.startBubble_&&!this.startField_&&!this.hasExceededDragRadius_}; Blockly.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_||this.isDraggingBubble_};Blockly.Gesture.prototype.hasStarted=function(){return this.hasStarted_};Blockly.Gesture.prototype.getInsertionMarkers=function(){return this.blockDragger_?this.blockDragger_.getInsertionMarkers():[]};Blockly.Gesture.inProgress=function(){for(var a=Blockly.Workspace.getAll(),b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1};Blockly.Field=function(a,b,c){this.tooltip_=this.validator_=this.value_=null;this.size_=new Blockly.utils.Size(0,0);this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null;c&&this.configure_(c);this.setValue(a);b&&this.setValidator(b)};Blockly.Field.prototype.name=void 0;Blockly.Field.prototype.disposed=!1;Blockly.Field.prototype.maxDisplayLength=50;Blockly.Field.prototype.sourceBlock_=null; Blockly.Field.prototype.isDirty_=!0;Blockly.Field.prototype.visible_=!0;Blockly.Field.prototype.clickTarget_=null;Blockly.Field.NBSP="\u00a0";Blockly.Field.prototype.EDITABLE=!0;Blockly.Field.prototype.SERIALIZABLE=!1;Blockly.Field.prototype.configure_=function(a){var b=a.tooltip;"string"==typeof b&&(b=Blockly.utils.replaceMessageReferences(a.tooltip));b&&this.setTooltip(b)}; -Blockly.Field.prototype.setSourceBlock=function(a){if(this.sourceBlock_)throw Error("Field already bound to a block.");this.sourceBlock_=a;a.workspace.rendered&&(this.constants_=a.workspace.getRenderer().getConstants())};Blockly.Field.prototype.getSourceBlock=function(){return this.sourceBlock_}; +Blockly.Field.prototype.setSourceBlock=function(a){if(this.sourceBlock_)throw Error("Field already bound to a block.");this.sourceBlock_=a};Blockly.Field.prototype.getConstants=function(){!this.constants_&&this.sourceBlock_&&this.sourceBlock_.workspace&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_};Blockly.Field.prototype.getSourceBlock=function(){return this.sourceBlock_}; Blockly.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=Blockly.utils.dom.createSvgElement("g",{},null),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())};Blockly.Field.prototype.initView=function(){this.createBorderRect_();this.createTextElement_()};Blockly.Field.prototype.initModel=function(){}; -Blockly.Field.prototype.createBorderRect_=function(){this.size_.height=Math.max(this.size_.height,this.constants_.FIELD_BORDER_RECT_HEIGHT);this.size_.width=Math.max(this.size_.width,2*this.constants_.FIELD_BORDER_RECT_X_PADDING);this.borderRect_=Blockly.utils.dom.createSvgElement("rect",{rx:this.constants_.FIELD_BORDER_RECT_RADIUS,ry:this.constants_.FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}; -Blockly.Field.prototype.createTextElement_=function(){var a=this.borderRect_?this.constants_.FIELD_BORDER_RECT_X_PADDING:0,b=this.constants_.FIELD_TEXT_BASELINE_CENTER,c=this.constants_.FIELD_TEXT_BASELINE_Y;this.size_.height=Math.max(this.size_.height,b?this.constants_.FIELD_TEXT_HEIGHT:c);this.size_.height>this.constants_.FIELD_TEXT_HEIGHT&&(c+=(this.size_.height-c)/2);this.textElement_=Blockly.utils.dom.createSvgElement("text",{"class":"blocklyText",y:b?this.size_.height/2:c,dy:this.constants_.FIELD_TEXT_Y_OFFSET, -x:a},this.fieldGroup_);b&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)};Blockly.Field.prototype.bindEvents_=function(){Blockly.Tooltip.bindMouseEvents(this.getClickTarget_());this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)};Blockly.Field.prototype.fromXml=function(a){this.setValue(a.textContent)}; -Blockly.Field.prototype.toXml=function(a){a.textContent=this.getValue();return a};Blockly.Field.prototype.dispose=function(){Blockly.DropDownDiv.hideIfOwner(this);Blockly.WidgetDiv.hideIfOwner(this);this.mouseDownWrapper_&&Blockly.unbindEvent_(this.mouseDownWrapper_);Blockly.utils.dom.removeNode(this.fieldGroup_);this.disposed=!0}; +Blockly.Field.prototype.createBorderRect_=function(){this.borderRect_=Blockly.utils.dom.createSvgElement("rect",{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}; +Blockly.Field.prototype.createTextElement_=function(){this.textElement_=Blockly.utils.dom.createSvgElement("text",{"class":"blocklyText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}; +Blockly.Field.prototype.bindEvents_=function(){Blockly.Tooltip.bindMouseEvents(this.getClickTarget_());this.mouseDownWrapper_=Blockly.bindEventWithChecks_(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)};Blockly.Field.prototype.fromXml=function(a){this.setValue(a.textContent)};Blockly.Field.prototype.toXml=function(a){a.textContent=this.getValue();return a}; +Blockly.Field.prototype.dispose=function(){Blockly.DropDownDiv.hideIfOwner(this);Blockly.WidgetDiv.hideIfOwner(this);Blockly.Tooltip.unbindMouseEvents(this.getClickTarget_());this.mouseDownWrapper_&&Blockly.unbindEvent_(this.mouseDownWrapper_);Blockly.utils.dom.removeNode(this.fieldGroup_);this.disposed=!0}; Blockly.Field.prototype.updateEditable=function(){var a=this.fieldGroup_;this.EDITABLE&&a&&(this.sourceBlock_.isEditable()?(Blockly.utils.dom.addClass(a,"blocklyEditableText"),Blockly.utils.dom.removeClass(a,"blocklyNonEditableText"),a.style.cursor=this.CURSOR):(Blockly.utils.dom.addClass(a,"blocklyNonEditableText"),Blockly.utils.dom.removeClass(a,"blocklyEditableText"),a.style.cursor=""))}; Blockly.Field.prototype.isClickable=function(){return!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&!!this.showEditor_&&"function"===typeof this.showEditor_};Blockly.Field.prototype.isCurrentlyEditable=function(){return this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}; Blockly.Field.prototype.isSerializable=function(){var a=!1;this.name&&(this.SERIALIZABLE?a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),a=!0));return a};Blockly.Field.prototype.isVisible=function(){return this.visible_}; Blockly.Field.prototype.setVisible=function(a){if(this.visible_!=a){this.visible_=a;var b=this.getSvgRoot();b&&(b.style.display=a?"block":"none")}};Blockly.Field.prototype.setValidator=function(a){this.validator_=a};Blockly.Field.prototype.getValidator=function(){return this.validator_};Blockly.Field.prototype.classValidator=function(a){return a}; -Blockly.Field.prototype.callValidator=function(a){var b=this.classValidator(a);if(null===b)return null;void 0!==b&&(a=b);if(b=this.getValidator()){b=b.call(this,a);if(null===b)return null;void 0!==b&&(a=b)}return a};Blockly.Field.prototype.getSvgRoot=function(){return this.fieldGroup_};Blockly.Field.prototype.applyColour=function(){};Blockly.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_(),this.updateSize_())}; +Blockly.Field.prototype.callValidator=function(a){var b=this.classValidator(a);if(null===b)return null;void 0!==b&&(a=b);if(b=this.getValidator()){b=b.call(this,a);if(null===b)return null;void 0!==b&&(a=b)}return a};Blockly.Field.prototype.getSvgRoot=function(){return this.fieldGroup_};Blockly.Field.prototype.applyColour=function(){};Blockly.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}; Blockly.Field.prototype.showEditor=function(a){this.isClickable()&&this.showEditor_(a)};Blockly.Field.prototype.updateWidth=function(){console.warn("Deprecated call to updateWidth, call Blockly.Field.updateSize_ to force an update to the size of the field, or Blockly.utils.dom.getTextWidth() to check the size of the field.");this.updateSize_()}; -Blockly.Field.prototype.updateSize_=function(){var a=Blockly.utils.dom.getFastTextWidth(this.textElement_,this.constants_.FIELD_TEXT_FONTSIZE,this.constants_.FIELD_TEXT_FONTWEIGHT,this.constants_.FIELD_TEXT_FONTFAMILY);this.borderRect_&&(a+=2*this.constants_.FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",a));this.size_.width=a}; +Blockly.Field.prototype.updateSize_=function(a){var b=this.getConstants();a=void 0!=a?a:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var c=2*a,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=Blockly.utils.dom.getFastTextWidth(this.textElement_,b.FIELD_TEXT_FONTSIZE,b.FIELD_TEXT_FONTWEIGHT,b.FIELD_TEXT_FONTFAMILY),c+=e);this.borderRect_&&(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_.height=d;this.size_.width=c;this.positionTextElement_(a,e);this.positionBorderRect_()}; +Blockly.Field.prototype.positionTextElement_=function(a,b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-b-a:a);this.textElement_.setAttribute("y",c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE)}}; +Blockly.Field.prototype.positionBorderRect_=function(){this.borderRect_&&(this.borderRect_.setAttribute("width",this.size_.width),this.borderRect_.setAttribute("height",this.size_.height),this.borderRect_.setAttribute("rx",this.getConstants().FIELD_BORDER_RECT_RADIUS),this.borderRect_.setAttribute("ry",this.getConstants().FIELD_BORDER_RECT_RADIUS))}; Blockly.Field.prototype.getSize=function(){if(!this.isVisible())return new Blockly.utils.Size(0,0);this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&0==this.size_.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.render_());return this.size_}; Blockly.Field.prototype.getScaledBBox=function(){if(this.borderRect_)a=this.borderRect_.getBoundingClientRect(),c=Blockly.utils.style.getPageOffset(this.borderRect_),d=a.width,a=a.height;else{var a=this.sourceBlock_.getHeightWidth(),b=this.sourceBlock_.workspace.scale,c=this.getAbsoluteXY_(),d=a.width*b;a=a.height*b;Blockly.utils.userAgent.GECKO?(c.x+=1.5*b,c.y+=1.5*b):Blockly.utils.userAgent.EDGE||Blockly.utils.userAgent.IE||(c.x-=.5*b,c.y-=.5*b);d+=1*b;a+=1*b}return{top:c.y,bottom:c.y+a,left:c.x, right:c.x+d}};Blockly.Field.prototype.getDisplayText_=function(){var a=this.getText();if(!a)return Blockly.Field.NBSP;a.length>this.maxDisplayLength&&(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");a=a.replace(/\s/g,Blockly.Field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");return a};Blockly.Field.prototype.getText=function(){if(this.getText_){var a=this.getText_.call(this);if(null!==a)return String(a)}return String(this.getValue())}; -Blockly.Field.prototype.setText=function(a){throw Error("setText method is deprecated");};Blockly.Field.prototype.markDirty=function(){this.isDirty_=!0};Blockly.Field.prototype.forceRerender=function(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours())}; +Blockly.Field.prototype.setText=function(a){throw Error("setText method is deprecated");};Blockly.Field.prototype.markDirty=function(){this.isDirty_=!0;this.constants_=null};Blockly.Field.prototype.forceRerender=function(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())}; Blockly.Field.prototype.setValue=function(a){if(null!==a){var b=this.doClassValidation_(a);a=this.processValidation_(a,b);if(!(a instanceof Error)){if(b=this.getValidator())if(b=b.call(this,a),a=this.processValidation_(a,b),a instanceof Error)return;b=this.getValue();b!==a&&(this.sourceBlock_&&Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"field",this.name||null,b,a)),this.doValueUpdate_(a),this.isDirty_&&this.forceRerender())}}}; Blockly.Field.prototype.processValidation_=function(a,b){if(null===b)return this.doValueInvalid_(a),this.isDirty_&&this.forceRerender(),Error();void 0!==b&&(a=b);return a};Blockly.Field.prototype.getValue=function(){return this.value_};Blockly.Field.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:a=this.classValidator(a)};Blockly.Field.prototype.doValueUpdate_=function(a){this.value_=a;this.isDirty_=!0};Blockly.Field.prototype.doValueInvalid_=function(a){}; Blockly.Field.prototype.onMouseDown_=function(a){this.sourceBlock_&&this.sourceBlock_.workspace&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)};Blockly.Field.prototype.setTooltip=function(a){var b=this.getClickTarget_();b?b.tooltip=a||""===a?a:this.sourceBlock_:this.tooltip_=a};Blockly.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()};Blockly.Field.prototype.getAbsoluteXY_=function(){return Blockly.utils.style.getPageOffset(this.getClickTarget_())}; Blockly.Field.prototype.referencesVariables=function(){return!1};Blockly.Field.prototype.getParentInput=function(){for(var a=null,b=this.sourceBlock_,c=b.inputList,d=0;da||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!(b||""==b&&c))return a;"string"==typeof b&&(b=new Blockly.FieldLabel(b));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&b.init();b.name=c;b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);++a;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()); @@ -418,9 +476,9 @@ return a};Blockly.Input.prototype.removeField=function(a){for(var b=0,c;c=this.f Blockly.Input.prototype.setVisible=function(a){var b=[];if(this.visible_==a)return b;for(var c=(this.visible_=a)?"block":"none",d=0,e;e=this.fieldRow[d];d++)e.setVisible(a);this.connection&&(a?b=this.connection.startTrackingAll():this.connection.stopTrackingAll(),d=this.connection.targetBlock())&&(d.getSvgRoot().style.display=c,a||(d.rendered=!1));return b};Blockly.Input.prototype.markDirty=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.markDirty()}; Blockly.Input.prototype.setCheck=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this};Blockly.Input.prototype.setAlign=function(a){this.align=a;this.sourceBlock_.rendered&&this.sourceBlock_.render();return this};Blockly.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var a=0;a=k||k>b.length)throw Error('Block "'+this.type+'": Message index %'+k+" out of range.");if(f[k])throw Error('Block "'+this.type+'": Message index %'+k+" duplicated.");f[k]=!0;g++;a.push(b[k-1])}else(k=k.trim())&&a.push(k)}if(g!=b.length)throw Error('Block "'+this.type+'": Message does not reference all '+b.length+" arg(s)."); a.length&&("string"==typeof a[a.length-1]||Blockly.utils.string.startsWith(a[a.length-1].type,"field_"))&&(h={type:"input_dummy"},c&&(h.align=c),a.push(h));c={LEFT:Blockly.ALIGN_LEFT,RIGHT:Blockly.ALIGN_RIGHT,CENTRE:Blockly.ALIGN_CENTRE,CENTER:Blockly.ALIGN_CENTRE};b=[];for(h=0;h=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);ab||b>this.getChildCount())throw Error(Blockly.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);this.childIndex_[a.getId()]=a;if(a.getParent()==this){var d=this.children_.indexOf(a);-1a?b-1:a},this.highlightedIndex_)}; -Blockly.Menu.prototype.highlightHelper=function(a,b){var c=0>b?-1:b,d=this.getChildCount();c=a.call(this,c,d);for(var e=0;e<=d;){var f=this.getChildAt(c);if(f&&this.canHighlightItem(f))return this.setHighlightedIndex(c),!0;e++;c=a.call(this,c,d)}return!1};Blockly.Menu.prototype.canHighlightItem=function(a){return a.isEnabled()}; +Blockly.Menu.prototype.highlightHelper=function(a,b){b=0>b?-1:b;var c=this.getChildCount();b=a.call(this,b,c);for(var d=0;d<=c;){var e=this.getChildAt(b);if(e&&this.canHighlightItem(e))return this.setHighlightedIndex(b),!0;d++;b=a.call(this,b,c)}return!1};Blockly.Menu.prototype.canHighlightItem=function(a){return a.isEnabled()}; Blockly.Menu.prototype.handleMouseOver_=function(a){if(a=this.getMenuItem(a.target))a.isEnabled()?this.getHighlighted()!==a&&(this.unhighlightCurrent(),this.setHighlighted(a)):this.unhighlightCurrent()};Blockly.Menu.prototype.handleClick_=function(a){var b=this.openingCoords;this.openingCoords=null;if(b&&"number"===typeof a.clientX){var c=new Blockly.utils.Coordinate(a.clientX,a.clientY);if(1>Blockly.utils.Coordinate.distance(b,c))return}(b=this.getMenuItem(a.target))&&b.handleClick(a)&&a.preventDefault()}; Blockly.Menu.prototype.handleMouseEnter_=function(a){this.focus()};Blockly.Menu.prototype.handleMouseLeave_=function(a){this.getElement()&&(this.blur(),this.clearHighlighted())};Blockly.Menu.prototype.handleKeyEvent=function(a){return 0!=this.getChildCount()&&this.handleKeyEventInternal(a)?(a.preventDefault(),a.stopPropagation(),!0):!1}; Blockly.Menu.prototype.handleKeyEventInternal=function(a){var b=this.getHighlighted();if(b&&"function"==typeof b.handleKeyEvent&&b.handleKeyEvent(a))return!0;if(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return!1;switch(a.keyCode){case Blockly.utils.KeyCodes.ENTER:b&&b.performActionInternal(a);break;case Blockly.utils.KeyCodes.UP:this.highlightPrevious();break;case Blockly.utils.KeyCodes.DOWN:this.highlightNext();break;default:return!1}return!0};Blockly.MenuItem=function(a,b){Blockly.Component.call(this);this.setContentInternal(a);this.setValue(b);this.enabled_=!0};Blockly.utils.object.inherits(Blockly.MenuItem,Blockly.Component); -Blockly.MenuItem.prototype.createDom=function(){var a=document.createElement("div");a.id=this.getId();this.setElementInternal(a);a.className="goog-menuitem goog-option "+(this.enabled_?"":"goog-menuitem-disabled ")+(this.checked_?"goog-option-selected ":"")+(this.isRightToLeft()?"goog-menuitem-rtl ":"");var b=this.getContentWrapperDom();a.appendChild(b);var c=this.getCheckboxDom();c&&b.appendChild(c);b.appendChild(this.getContentDom());Blockly.utils.aria.setRole(a,this.roleName_||(this.checkable_? -Blockly.utils.aria.Role.MENUITEMCHECKBOX:Blockly.utils.aria.Role.MENUITEM));Blockly.utils.aria.setState(a,Blockly.utils.aria.State.SELECTED,this.checkable_&&this.checked_||!1)};Blockly.MenuItem.prototype.getCheckboxDom=function(){if(!this.checkable_)return null;var a=document.createElement("div");a.className="goog-menuitem-checkbox";return a};Blockly.MenuItem.prototype.getContentDom=function(){var a=this.content_;"string"===typeof a&&(a=document.createTextNode(a));return a}; +Blockly.MenuItem.prototype.createDom=function(){var a=document.createElement("div");a.id=this.getId();this.setElementInternal(a);a.className="goog-menuitem goog-option "+(this.enabled_?"":"goog-menuitem-disabled ")+(this.checked_?"goog-option-selected ":"")+(this.rightToLeft_?"goog-menuitem-rtl ":"");var b=this.getContentWrapperDom();a.appendChild(b);var c=this.getCheckboxDom();c&&b.appendChild(c);b.appendChild(this.getContentDom());Blockly.utils.aria.setRole(a,this.roleName_||(this.checkable_?Blockly.utils.aria.Role.MENUITEMCHECKBOX: +Blockly.utils.aria.Role.MENUITEM));Blockly.utils.aria.setState(a,Blockly.utils.aria.State.SELECTED,this.checkable_&&this.checked_||!1)};Blockly.MenuItem.prototype.getCheckboxDom=function(){if(!this.checkable_)return null;var a=document.createElement("div");a.className="goog-menuitem-checkbox";return a};Blockly.MenuItem.prototype.getContentDom=function(){var a=this.content_;"string"===typeof a&&(a=document.createTextNode(a));return a}; Blockly.MenuItem.prototype.getContentWrapperDom=function(){var a=document.createElement("div");a.className="goog-menuitem-content";return a};Blockly.MenuItem.prototype.setContentInternal=function(a){this.content_=a};Blockly.MenuItem.prototype.setValue=function(a){this.value_=a};Blockly.MenuItem.prototype.getValue=function(){return this.value_};Blockly.MenuItem.prototype.setRole=function(a){this.roleName_=a};Blockly.MenuItem.prototype.setCheckable=function(a){this.checkable_=a}; Blockly.MenuItem.prototype.setChecked=function(a){if(this.checkable_){this.checked_=a;var b=this.getElement();b&&this.isEnabled()&&(a?(Blockly.utils.dom.addClass(b,"goog-option-selected"),Blockly.utils.aria.setState(b,Blockly.utils.aria.State.SELECTED,!0)):(Blockly.utils.dom.removeClass(b,"goog-option-selected"),Blockly.utils.aria.setState(b,Blockly.utils.aria.State.SELECTED,!1)))}}; Blockly.MenuItem.prototype.setHighlighted=function(a){this.highlight_=a;var b=this.getElement();b&&this.isEnabled()&&(a?Blockly.utils.dom.addClass(b,"goog-menuitem-highlight"):Blockly.utils.dom.removeClass(b,"goog-menuitem-highlight"))};Blockly.MenuItem.prototype.isEnabled=function(){return this.enabled_};Blockly.MenuItem.prototype.setEnabled=function(a){this.enabled_=a;(a=this.getElement())&&(this.enabled_?Blockly.utils.dom.removeClass(a,"goog-menuitem-disabled"):Blockly.utils.dom.addClass(a,"goog-menuitem-disabled"))}; @@ -526,12 +570,12 @@ Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSou Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())}; Blockly.RenderedConnection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.checkType(this.targetConnection)||((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours())};Blockly.Marker=function(){this.drawer_=this.curNode_=this.colour=null;this.type="marker"};Blockly.Marker.prototype.setDrawer=function(a){this.drawer_=a};Blockly.Marker.prototype.getDrawer=function(){return this.drawer_};Blockly.Marker.prototype.getCurNode=function(){return this.curNode_};Blockly.Marker.prototype.setCurNode=function(a){var b=this.curNode_;this.curNode_=a;this.drawer_&&this.drawer_.draw(b,this.curNode_)}; Blockly.Marker.prototype.draw=function(){this.drawer_&&this.drawer_.draw(this.curNode_,this.curNode_)};Blockly.Marker.prototype.hide=function(){this.drawer_&&this.drawer_.hide()};Blockly.Marker.prototype.dispose=function(){this.getDrawer()&&this.getDrawer().dispose()};Blockly.Cursor=function(){Blockly.Cursor.superClass_.constructor.call(this);this.type="cursor"};Blockly.utils.object.inherits(Blockly.Cursor,Blockly.Marker);Blockly.Cursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;for(a=a.next();a&&a.next()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.next();a&&this.setCurNode(a);return a}; -Blockly.Cursor.prototype["in"]=function(){var a=this.getCurNode();if(!a)return null;if(a.getType()==Blockly.ASTNode.types.PREVIOUS||a.getType()==Blockly.ASTNode.types.OUTPUT)a=a.next();(a=a["in"]())&&this.setCurNode(a);return a};Blockly.Cursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;for(a=a.prev();a&&a.prev()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.prev();a&&this.setCurNode(a);return a}; +Blockly.Cursor.prototype.in=function(){var a=this.getCurNode();if(!a)return null;if(a.getType()==Blockly.ASTNode.types.PREVIOUS||a.getType()==Blockly.ASTNode.types.OUTPUT)a=a.next();(a=a.in())&&this.setCurNode(a);return a};Blockly.Cursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;for(a=a.prev();a&&a.prev()&&(a.getType()==Blockly.ASTNode.types.NEXT||a.getType()==Blockly.ASTNode.types.BLOCK);)a=a.prev();a&&this.setCurNode(a);return a}; Blockly.Cursor.prototype.out=function(){var a=this.getCurNode();if(!a)return null;(a=a.out())&&a.getType()==Blockly.ASTNode.types.BLOCK&&(a=a.prev()||a);a&&this.setCurNode(a);return a}; -Blockly.Cursor.prototype.onBlocklyAction=function(a){if(this.getCurNode()&&this.getCurNode().getType()===Blockly.ASTNode.types.FIELD&&this.getCurNode().getLocation().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.OUT:return this.out(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;case Blockly.navigation.actionNames.IN:return this["in"](),!0;default:return!1}};Blockly.BasicCursor=function(){Blockly.BasicCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.BasicCursor,Blockly.Cursor);Blockly.BasicCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype["in"]=function(){return this.next()}; -Blockly.BasicCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.out=function(){return this.prev()};Blockly.BasicCursor.prototype.getNextNode_=function(a,b){if(!a)return null;var c=a["in"]()||a.next();if(b(c))return c;if(c)return this.getNextNode_(c,b);c=this.findSiblingOrParent_(a.out());return b(c)?c:c?this.getNextNode_(c,b):null}; +Blockly.Cursor.prototype.onBlocklyAction=function(a){if(this.getCurNode()&&this.getCurNode().getType()===Blockly.ASTNode.types.FIELD&&this.getCurNode().getLocation().onBlocklyAction(a))return!0;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return this.prev(),!0;case Blockly.navigation.actionNames.OUT:return this.out(),!0;case Blockly.navigation.actionNames.NEXT:return this.next(),!0;case Blockly.navigation.actionNames.IN:return this.in(),!0;default:return!1}};Blockly.BasicCursor=function(){Blockly.BasicCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.BasicCursor,Blockly.Cursor);Blockly.BasicCursor.prototype.next=function(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.in=function(){return this.next()}; +Blockly.BasicCursor.prototype.prev=function(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode_(a,this.validNode_))&&this.setCurNode(a);return a};Blockly.BasicCursor.prototype.out=function(){return this.prev()};Blockly.BasicCursor.prototype.getNextNode_=function(a,b){if(!a)return null;var c=a.in()||a.next();if(b(c))return c;if(c)return this.getNextNode_(c,b);a=this.findSiblingOrParent_(a.out());return b(a)?a:a?this.getNextNode_(a,b):null}; Blockly.BasicCursor.prototype.getPreviousNode_=function(a,b){if(!a)return null;var c=a.prev();c=c?this.getRightMostChild_(c):a.out();return b(c)?c:c?this.getPreviousNode_(c,b):null};Blockly.BasicCursor.prototype.validNode_=function(a){var b=!1;a=a&&a.getType();if(a==Blockly.ASTNode.types.OUTPUT||a==Blockly.ASTNode.types.INPUT||a==Blockly.ASTNode.types.FIELD||a==Blockly.ASTNode.types.NEXT||a==Blockly.ASTNode.types.PREVIOUS||a==Blockly.ASTNode.types.WORKSPACE)b=!0;return b}; -Blockly.BasicCursor.prototype.findSiblingOrParent_=function(a){if(!a)return null;var b=a.next();return b?b:this.findSiblingOrParent_(a.out())};Blockly.BasicCursor.prototype.getRightMostChild_=function(a){if(!a["in"]())return a;for(a=a["in"]();a.next();)a=a.next();return this.getRightMostChild_(a)};Blockly.TabNavigateCursor=function(){Blockly.TabNavigateCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.TabNavigateCursor,Blockly.BasicCursor);Blockly.TabNavigateCursor.prototype.validNode_=function(a){var b=!1,c=a&&a.getType();a&&(a=a.getLocation(),c==Blockly.ASTNode.types.FIELD&&a&&a.isTabNavigable()&&a.isClickable()&&(b=!0));return b};Blockly.utils.Rect=function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d};Blockly.utils.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup_,this.style);this.rendered=!1;this.workspace=a;this.previousConnection=this.nextConnection=this.outputConnection=null;this.useDragSurface_=Blockly.utils.is3dSupported()&&!!a.getBlockDragSurface();var d=this.pathObject.svgPath;d.tooltip=this;Blockly.Tooltip.bindMouseEvents(d); +Blockly.BasicCursor.prototype.findSiblingOrParent_=function(a){if(!a)return null;var b=a.next();return b?b:this.findSiblingOrParent_(a.out())};Blockly.BasicCursor.prototype.getRightMostChild_=function(a){if(!a.in())return a;for(a=a.in();a.next();)a=a.next();return this.getRightMostChild_(a)};Blockly.TabNavigateCursor=function(){Blockly.TabNavigateCursor.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.TabNavigateCursor,Blockly.BasicCursor);Blockly.TabNavigateCursor.prototype.validNode_=function(a){var b=!1,c=a&&a.getType();a&&(a=a.getLocation(),c==Blockly.ASTNode.types.FIELD&&a&&a.isTabNavigable()&&a.isClickable()&&(b=!0));return b};Blockly.utils.Rect=function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d};Blockly.utils.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};Blockly.BlockSvg=function(a,b,c){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{},null);this.svgGroup_.translate_="";this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup_,this.style);this.rendered=!1;this.workspace=a;this.previousConnection=this.nextConnection=this.outputConnection=null;this.useDragSurface_=Blockly.utils.is3dSupported()&&!!a.getBlockDragSurface();var d=this.pathObject.svgPath;d.tooltip=this;Blockly.Tooltip.bindMouseEvents(d); Blockly.BlockSvg.superClass_.constructor.call(this,a,b,c);this.svgGroup_.dataset&&(this.svgGroup_.dataset.id=this.id)};Blockly.utils.object.inherits(Blockly.BlockSvg,Blockly.Block);Blockly.BlockSvg.prototype.height=0;Blockly.BlockSvg.prototype.width=0;Blockly.BlockSvg.prototype.dragStartXY_=null;Blockly.BlockSvg.prototype.warningTextDb_=null;Blockly.BlockSvg.INLINE=-1;Blockly.BlockSvg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_"; Blockly.BlockSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();b=this.getIcons();for(a=0;a>>/g,d);d=document.createElement("style");d.id="blockly-common-style";c=document.createTextNode(c);d.appendChild(c);document.head.insertBefore(d,document.head.firstChild)}}};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; -Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;", -"left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);", -"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {", -"max-height: 300px;","overflow: auto;","overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;", -"border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {", -"fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {", -'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {", -"display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text, .blocklyBlockDragSurface text {", -"user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;", -"}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {", -"z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,", -".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {", -"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;", -"border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;', -"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {", -"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font-family: Arial, sans-serif;","font-size: 13px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {", -"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {", -"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,", -".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}",".blocklyComputeCanvas {", -"position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}"]; -Blockly.DropDownDiv=function(){};Blockly.DropDownDiv.boundsElement_=null;Blockly.DropDownDiv.owner_=null;Blockly.DropDownDiv.positionToField_=null;Blockly.DropDownDiv.ARROW_SIZE=16;Blockly.DropDownDiv.BORDER_SIZE=1;Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING=12;Blockly.DropDownDiv.PADDING_Y=16;Blockly.DropDownDiv.ANIMATION_TIME=.25;Blockly.DropDownDiv.animateOutTimer_=null;Blockly.DropDownDiv.onHide_=null;Blockly.DropDownDiv.rendererClassName_=null;Blockly.DropDownDiv.themeClassName_=null; -Blockly.DropDownDiv.createDom=function(){if(!Blockly.DropDownDiv.DIV_){var a=document.createElement("div");a.className="blocklyDropDownDiv";document.body.appendChild(a);Blockly.DropDownDiv.DIV_=a;var b=document.createElement("div");b.className="blocklyDropDownContent";a.appendChild(b);Blockly.DropDownDiv.content_=b;b=document.createElement("div");b.className="blocklyDropDownArrow";a.appendChild(b);Blockly.DropDownDiv.arrow_=b;Blockly.DropDownDiv.DIV_.style.opacity=0;Blockly.DropDownDiv.DIV_.style.transition= -"transform "+Blockly.DropDownDiv.ANIMATION_TIME+"s, opacity "+Blockly.DropDownDiv.ANIMATION_TIME+"s";a.addEventListener("focusin",function(){Blockly.utils.dom.addClass(a,"focused")});a.addEventListener("focusout",function(){Blockly.utils.dom.removeClass(a,"focused")})}};Blockly.DropDownDiv.setBoundsElement=function(a){Blockly.DropDownDiv.boundsElement_=a};Blockly.DropDownDiv.getContentDiv=function(){return Blockly.DropDownDiv.content_}; -Blockly.DropDownDiv.clearContent=function(){Blockly.DropDownDiv.content_.innerHTML="";Blockly.DropDownDiv.content_.style.width=""};Blockly.DropDownDiv.setColour=function(a,b){Blockly.DropDownDiv.DIV_.style.backgroundColor=a;Blockly.DropDownDiv.DIV_.style.borderColor=b};Blockly.DropDownDiv.showPositionedByBlock=function(a,b,c,d){return Blockly.DropDownDiv.showPositionedByRect_(Blockly.DropDownDiv.getScaledBboxOfBlock_(b),a,c,d)}; -Blockly.DropDownDiv.showPositionedByField=function(a,b,c){Blockly.DropDownDiv.positionToField_=!0;return Blockly.DropDownDiv.showPositionedByRect_(Blockly.DropDownDiv.getScaledBboxOfField_(a),a,b,c)};Blockly.DropDownDiv.getScaledBboxOfBlock_=function(a){var b=a.getSvgRoot(),c=b.getBBox(),d=a.workspace.scale;a=c.height*d;c=c.width*d;b=Blockly.utils.style.getPageOffset(b);return new Blockly.utils.Rect(b.y,b.y+a,b.x,b.x+c)}; -Blockly.DropDownDiv.getScaledBboxOfField_=function(a){a=a.getScaledBBox();return new Blockly.utils.Rect(a.top,a.bottom,a.left,a.right)};Blockly.DropDownDiv.showPositionedByRect_=function(a,b,c,d){var e=a.left+(a.right-a.left)/2,f=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();Blockly.DropDownDiv.setBoundsElement(d.workspace.getParentSvg().parentNode);return Blockly.DropDownDiv.show(b,d.RTL,e,f,e,a,c)}; -Blockly.DropDownDiv.show=function(a,b,c,d,e,f,g){Blockly.DropDownDiv.owner_=a;Blockly.DropDownDiv.onHide_=g||null;a=Blockly.DropDownDiv.DIV_;a.style.direction=b?"rtl":"ltr";Blockly.DropDownDiv.rendererClassName_=Blockly.getMainWorkspace().getRenderer().name+"-renderer";Blockly.DropDownDiv.themeClassName_=Blockly.getMainWorkspace().getTheme().name+"-theme";Blockly.utils.dom.addClass(a,Blockly.DropDownDiv.rendererClassName_);Blockly.utils.dom.addClass(a,Blockly.DropDownDiv.themeClassName_);return Blockly.DropDownDiv.positionInternal_(c, -d,e,f)};Blockly.DropDownDiv.getBoundsInfo_=function(){var a=Blockly.utils.style.getPageOffset(Blockly.DropDownDiv.boundsElement_),b=Blockly.utils.style.getSize(Blockly.DropDownDiv.boundsElement_);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}}; -Blockly.DropDownDiv.getPositionMetrics_=function(a,b,c,d){var e=Blockly.DropDownDiv.getBoundsInfo_(),f=Blockly.utils.style.getSize(Blockly.DropDownDiv.DIV_);return b+f.heighte.top?Blockly.DropDownDiv.getPositionAboveMetrics_(c,d,e,f):b+f.heightdocument.documentElement.clientTop?Blockly.DropDownDiv.getPositionAboveMetrics_(c, -d,e,f):Blockly.DropDownDiv.getPositionTopOfPageMetrics_(a,e,f)};Blockly.DropDownDiv.getPositionBelowMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(Blockly.DropDownDiv.ARROW_SIZE/2+Blockly.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}}; -Blockly.DropDownDiv.getPositionAboveMetrics_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-Blockly.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*Blockly.DropDownDiv.BORDER_SIZE-Blockly.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}}; -Blockly.DropDownDiv.getPositionTopOfPageMetrics_=function(a,b,c){a=Blockly.DropDownDiv.getPositionX(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowVisible:!1}};Blockly.DropDownDiv.getPositionX=function(a,b,c,d){var e=a;a=Blockly.utils.math.clamp(b,a-d/2,c-d);e-=Blockly.DropDownDiv.ARROW_SIZE/2;b=Blockly.DropDownDiv.ARROW_HORIZONTAL_PADDING;d=Blockly.utils.math.clamp(b,e-a,d-b-Blockly.DropDownDiv.ARROW_SIZE);return{arrowX:d,divX:a}}; -Blockly.DropDownDiv.isVisible=function(){return!!Blockly.DropDownDiv.owner_};Blockly.DropDownDiv.hideIfOwner=function(a,b){return Blockly.DropDownDiv.owner_===a?(b?Blockly.DropDownDiv.hideWithoutAnimation():Blockly.DropDownDiv.hide(),!0):!1}; -Blockly.DropDownDiv.hide=function(){var a=Blockly.DropDownDiv.DIV_;a.style.transform="translate(0, 0)";a.style.opacity=0;Blockly.DropDownDiv.animateOutTimer_=setTimeout(function(){Blockly.DropDownDiv.hideWithoutAnimation()},1E3*Blockly.DropDownDiv.ANIMATION_TIME);Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null)}; -Blockly.DropDownDiv.hideWithoutAnimation=function(){if(Blockly.DropDownDiv.isVisible()){Blockly.DropDownDiv.animateOutTimer_&&clearTimeout(Blockly.DropDownDiv.animateOutTimer_);var a=Blockly.DropDownDiv.DIV_;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";Blockly.DropDownDiv.onHide_&&(Blockly.DropDownDiv.onHide_(),Blockly.DropDownDiv.onHide_=null);Blockly.DropDownDiv.clearContent();Blockly.DropDownDiv.owner_= -null;Blockly.DropDownDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.rendererClassName_),Blockly.DropDownDiv.rendererClassName_=null);Blockly.DropDownDiv.themeClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.DropDownDiv.themeClassName_),Blockly.DropDownDiv.themeClassName_=null);Blockly.getMainWorkspace().markFocused()}}; -Blockly.DropDownDiv.positionInternal_=function(a,b,c,d){a=Blockly.DropDownDiv.getPositionMetrics_(a,b,c,d);a.arrowVisible?(Blockly.DropDownDiv.arrow_.style.display="",Blockly.DropDownDiv.arrow_.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",Blockly.DropDownDiv.arrow_.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):Blockly.DropDownDiv.arrow_.style.display="none";b=Math.floor(a.initialX);c=Math.floor(a.initialY); -d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=Blockly.DropDownDiv.DIV_;f.style.left=b+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return a.arrowAtTop}; -Blockly.DropDownDiv.repositionForWindowResize=function(){if(Blockly.DropDownDiv.owner_){var a=Blockly.DropDownDiv.owner_,b=Blockly.DropDownDiv.owner_.getSourceBlock();a=Blockly.DropDownDiv.positionToField_?Blockly.DropDownDiv.getScaledBboxOfField_(a):Blockly.DropDownDiv.getScaledBboxOfBlock_(b);b=a.left+(a.right-a.left)/2;Blockly.DropDownDiv.positionInternal_(b,a.bottom,b,a.top)}else Blockly.DropDownDiv.hide()};Blockly.Grid=function(a,b){this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap};Blockly.Grid.prototype.scale_=1;Blockly.Grid.prototype.dispose=function(){this.gridPattern_=null};Blockly.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};Blockly.Grid.prototype.getSpacing=function(){return this.spacing_};Blockly.Grid.prototype.getPatternId=function(){return this.gridPattern_.id}; -Blockly.Grid.prototype.update=function(a){this.scale_=a;var b=this.spacing_*a||100;this.gridPattern_.setAttribute("width",b);this.gridPattern_.setAttribute("height",b);b=Math.floor(this.spacing_/2)+.5;var c=b-this.length_/2,d=b+this.length_/2;b*=a;c*=a;d*=a;this.setLineAttributes_(this.line1_,a,c,d,b,b);this.setLineAttributes_(this.line2_,a,b,b,c,d)}; -Blockly.Grid.prototype.setLineAttributes_=function(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",b),a.setAttribute("x1",c),a.setAttribute("y1",e),a.setAttribute("x2",d),a.setAttribute("y2",f))};Blockly.Grid.prototype.moveTo=function(a,b){this.gridPattern_.setAttribute("x",a);this.gridPattern_.setAttribute("y",b);(Blockly.utils.userAgent.IE||Blockly.utils.userAgent.EDGE)&&this.update(this.scale_)}; -Blockly.Grid.createDom=function(a,b,c){a=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);0=this.connections_.length)return-1;b=a.y;for(var d=c;0<=d&&this.connections_[d].y==b;){if(this.connections_[d]==a)return d;d--}for(;ca)c=d;else{b=d;break}}return b};Blockly.ConnectionDB.prototype.removeConnection=function(a,b){var c=this.findIndexOfConnection_(a,b);if(-1==c)throw Error("Unable to find connection in connectionDB.");this.connections_.splice(c,1)}; -Blockly.ConnectionDB.prototype.getNeighbours=function(a,b){function c(a){var c=e-d[a].x,g=f-d[a].y;Math.sqrt(c*c+g*g)<=b&&l.push(d[a]);return ga)c=d;else{b=d;break}}return b};Blockly.ConnectionDB.prototype.removeConnection=function(a,b){a=this.findIndexOfConnection_(a,b);if(-1==a)throw Error("Unable to find connection in connectionDB.");this.connections_.splice(a,1)}; +Blockly.ConnectionDB.prototype.getNeighbours=function(a,b){function c(a){var c=e-d[a].x,g=f-d[a].y;Math.sqrt(c*c+g*g)<=b&&k.push(d[a]);return ga)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");this.subscribedWorkspaces_.splice(a,1)}; Blockly.ThemeManager.prototype.subscribe=function(a,b,c){this.componentDB_[b]||(this.componentDB_[b]=[]);this.componentDB_[b].push({element:a,propertyName:c});b=this.theme_&&this.theme_.getComponentStyle(b);a.style[c]=b||""};Blockly.ThemeManager.prototype.unsubscribe=function(a){if(a)for(var b=Object.keys(this.componentDB_),c=0,d;d=b[c];c++){for(var e=this.componentDB_[d],f=e.length-1;0<=f;f--)e[f].element===a&&e.splice(f,1);this.componentDB_[d].length||delete this.componentDB_[d]}}; Blockly.ThemeManager.prototype.dispose=function(){this.componentDB_=this.subscribedWorkspaces_=this.theme_=this.owner_=null};Blockly.TouchGesture=function(a,b){Blockly.TouchGesture.superClass_.constructor.call(this,a,b);this.isMultiTouch_=!1;this.cachedPoints_=Object.create(null);this.startDistance_=this.previousScale_=0;this.isPinchZoomEnabled_=this.onStartWrapper_=null};Blockly.utils.object.inherits(Blockly.TouchGesture,Blockly.Gesture);Blockly.TouchGesture.ZOOM_IN_MULTIPLIER=5;Blockly.TouchGesture.ZOOM_OUT_MULTIPLIER=6; @@ -650,30 +648,29 @@ Blockly.TouchGesture.prototype.handleTouchMove=function(a){var b=Blockly.Touch.g Blockly.TouchGesture.prototype.handlePinch_=function(a){var b=Object.keys(this.cachedPoints_);b=Blockly.utils.Coordinate.distance(this.cachedPoints_[b[0]],this.cachedPoints_[b[1]])/this.startDistance_;if(0this.previousScale_){var c=b-this.previousScale_;c=0Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)};Blockly.TouchGesture.prototype.getTouchPoint=function(a){return this.startWorkspace_?new Blockly.utils.Coordinate(a.pageX?a.pageX:a.changedTouches[0].pageX,a.pageY?a.pageY:a.changedTouches[0].pageY):null};Blockly.WorkspaceAudio=function(a){this.parentWorkspace_=a;this.SOUNDS_=Object.create(null)};Blockly.WorkspaceAudio.prototype.lastSound_=null;Blockly.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null}; Blockly.WorkspaceAudio.prototype.load=function(a,b){if(a.length){try{var c=new Blockly.utils.global.Audio}catch(h){return}for(var d,e=0;e=this.remainingCapacity()||(this.currentGesture_&&this.currentGesture_.cancel(),"comment"==a.tagName.toLowerCase()?this.pasteWorkspaceComment_(a):this.pasteBlock_(a))}; Blockly.WorkspaceSvg.prototype.pasteBlock_=function(a){Blockly.Events.disable();try{var b=Blockly.Xml.domToBlock(a,this),c=this.getMarker(Blockly.navigation.MARKER_NAME).getCurNode();if(this.keyboardAccessibilityMode&&c&&c.isConnection()){var d=c.getLocation();Blockly.navigation.insertBlock(b,d);return}var e=parseInt(a.getAttribute("x"),10),f=parseInt(a.getAttribute("y"),10);if(!isNaN(e)&&!isNaN(f)){this.RTL&&(e=-e);do{a=!1;var g=this.getAllBlocks(!1);c=0;for(var h;h=g[c];c++){var k=h.getRelativeToSurfaceXY(); if(1>=Math.abs(e-k.x)&&1>=Math.abs(f-k.y)){a=!0;break}}if(!a){var l=b.getConnections_(!1);c=0;for(var m;m=l[c];c++)if(m.closest(Blockly.SNAP_RADIUS,new Blockly.utils.Coordinate(e,f)).connection){a=!0;break}}a&&(e=this.RTL?e-Blockly.SNAP_RADIUS:e+Blockly.SNAP_RADIUS,f+=2*Blockly.SNAP_RADIUS)}while(a);b.moveBy(e,f)}}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!b.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(b));b.select()}; @@ -691,7 +688,7 @@ Blockly.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(a){Blockly.Events Blockly.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.getFlyout()&&a.toolbox_.refreshSelection()};Blockly.WorkspaceSvg.prototype.renameVariableById=function(a,b){Blockly.WorkspaceSvg.superClass_.renameVariableById.call(this,a,b);this.refreshToolboxSelection()};Blockly.WorkspaceSvg.prototype.deleteVariableById=function(a){Blockly.WorkspaceSvg.superClass_.deleteVariableById.call(this,a);this.refreshToolboxSelection()}; Blockly.WorkspaceSvg.prototype.createVariable=function(a,b,c){a=Blockly.WorkspaceSvg.superClass_.createVariable.call(this,a,b,c);this.refreshToolboxSelection();return a};Blockly.WorkspaceSvg.prototype.recordDeleteAreas=function(){this.deleteAreaTrash_=this.trashcan&&this.svgGroup_.parentNode?this.trashcan.getClientRect():null;this.deleteAreaToolbox_=this.flyout_?this.flyout_.getClientRect():this.toolbox_?this.toolbox_.getClientRect():null}; Blockly.WorkspaceSvg.prototype.isDeleteArea=function(a){return this.deleteAreaTrash_&&this.deleteAreaTrash_.contains(a.clientX,a.clientY)?Blockly.DELETE_AREA_TRASH:this.deleteAreaToolbox_&&this.deleteAreaToolbox_.contains(a.clientX,a.clientY)?Blockly.DELETE_AREA_TOOLBOX:Blockly.DELETE_AREA_NONE};Blockly.WorkspaceSvg.prototype.onMouseDown_=function(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)}; -Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){var c=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());c.x/=this.scale;c.y/=this.scale;this.dragDeltaXY_=Blockly.utils.Coordinate.difference(b,c)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return Blockly.utils.Coordinate.sum(this.dragDeltaXY_,a)}; +Blockly.WorkspaceSvg.prototype.startDrag=function(a,b){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;this.dragDeltaXY_=Blockly.utils.Coordinate.difference(b,a)};Blockly.WorkspaceSvg.prototype.moveDrag=function(a){a=Blockly.utils.mouseToSvg(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return Blockly.utils.Coordinate.sum(this.dragDeltaXY_,a)}; Blockly.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()};Blockly.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag}; Blockly.WorkspaceSvg.prototype.isContentBounded=function(){return this.options.moveOptions&&this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.controls||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}; Blockly.WorkspaceSvg.prototype.isMovable=function(){return this.options.moveOptions&&this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}; @@ -701,7 +698,7 @@ Blockly.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1);Blo Blockly.WorkspaceSvg.prototype.showContextMenu=function(a){function b(a){if(a.isDeletable())p=p.concat(a.getDescendants(!1));else{a=a.getChildren(!1);for(var c=0;cp.length?c():Blockly.confirm(Blockly.Msg.DELETE_ALL_BLOCKS.replace("%1",p.length),function(a){a&& -c()})}};d.push(h);this.configureContextMenu&&this.configureContextMenu(d);Blockly.ContextMenu.show(a,d,this.RTL)}}; +c()})}};d.push(h);this.configureContextMenu&&this.configureContextMenu(d,a);Blockly.ContextMenu.show(a,d,this.RTL)}}; Blockly.WorkspaceSvg.prototype.updateToolbox=function(a){if(a=Blockly.Options.parseToolboxTree(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(a.getElementsByTagName("category").length){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox_.renderTree(a)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree= a;this.flyout_.show(a.childNodes)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");};Blockly.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(Blockly.mainWorkspace=this,this.setBrowserFocus())};Blockly.WorkspaceSvg.prototype.setBrowserFocus=function(){document.activeElement&&document.activeElement.blur();try{this.getParentSvg().focus({preventScroll:!0})}catch(a){try{this.getParentSvg().parentNode.setActive()}catch(b){this.getParentSvg().parentNode.focus({preventScroll:!0})}}}; Blockly.WorkspaceSvg.prototype.zoom=function(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!=d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:dthis.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&ab.viewBottom||b.contentLeftb.viewRight){c=null;a&&(c=Blockly.Events.getGroup(),Blockly.Events.setGroup(a.group));switch(a.type){case Blockly.Events.BLOCK_CREATE:case Blockly.Events.BLOCK_MOVE:var f= e.getBlockById(a.blockId);f&&(f=f.getRootBlock());break;case Blockly.Events.COMMENT_CREATE:case Blockly.Events.COMMENT_MOVE:f=e.getCommentById(a.commentId)}if(f){d=f.getBoundingRectangle();d.height=d.bottom-d.top;d.width=d.right-d.left;var m=b.viewTop,n=b.viewBottom-d.height;n=Math.max(m,n);m=Blockly.utils.math.clamp(m,d.top,n)-d.top;n=b.viewLeft;var p=b.viewRight-d.width;b.RTL?n=Math.min(p,n):p=Math.max(n,p);b=Blockly.utils.math.clamp(n,d.left,p)-d.left;f.moveBy(b,m)}a&&(!a.group&&f&&console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."), @@ -737,10 +734,10 @@ Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEventWi b.hasTrashcan&&(c=a.trashcan.init(c));b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init(c);b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new Blockly.ScrollbarPair(a),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)}; Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEventWithChecks_(document,"scroll",null,function(){for(var a=Blockly.Workspace.getAll(),b=0,c;c=a[b];b++)c.updateInverseScreenCTM&&c.updateInverseScreenCTM()}),Blockly.bindEventWithChecks_(document,"keydown",null,Blockly.onKeyDown),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),Blockly.utils.userAgent.IPAD&&Blockly.bindEventWithChecks_(window, "orientationchange",document,function(){Blockly.svgResize(Blockly.getMainWorkspace())}));Blockly.documentEventsBound_=!0}; -Blockly.inject.loadSounds_=function(a,b){var c=b.getAudioManager();c.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");c.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");c.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var d=[],e=function(){for(;d.length;)Blockly.unbindEvent_(d.pop());c.preload()};d.push(Blockly.bindEventWithChecks_(document,"mousemove",null,e,!0));d.push(Blockly.bindEventWithChecks_(document,"touchstart",null,e,!0))};Blockly.Names=function(a,b){this.variablePrefix_=b||"";this.reservedDict_=Object.create(null);if(a)for(var c=a.split(","),d=0;d1'),d.appendChild(c),b.push(d));if(Blockly.Blocks.variables_get){a.sort(Blockly.VariableModel.compareByName);c=0;for(var e;e=a[c];c++)d=Blockly.utils.xml.createElement("block"),d.setAttribute("type","variables_get"),d.setAttribute("gap",8),d.appendChild(Blockly.Variables.generateVariableFieldDom(e)),b.push(d)}}return b}; Blockly.Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh";Blockly.Variables.generateUniqueName=function(a){return Blockly.Variables.generateUniqueNameFromOptions(Blockly.Variables.VAR_LETTER_OPTIONS.charAt(0),a.getAllVariableNames())}; -Blockly.Variables.generateUniqueNameFromOptions=function(a,b){if(!b.length)return a;for(var c=Blockly.Variables.VAR_LETTER_OPTIONS,d="",e=c.indexOf(a),f=a;;){for(var g=!1,h=0;he?Blockly.WidgetDiv.positionInternal_(a,0,c.height+e):Blockly.WidgetDiv.positionInternal_(a,e,c.height)};Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)}; -Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200123.0-develop";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; +Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200123.0-develop";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth;c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))if(b.options.readOnly)Blockly.navigation.onKeyPress(a);else{var c=!1;if(a.keyCode==Blockly.utils.KeyCodes.ESC)Blockly.hideChaff(),Blockly.navigation.onBlocklyAction(Blockly.navigation.ACTION_EXIT);else{if(Blockly.navigation.onKeyPress(a))return;if(a.keyCode==Blockly.utils.KeyCodes.BACKSPACE||a.keyCode==Blockly.utils.KeyCodes.DELETE){a.preventDefault();if(Blockly.Gesture.inProgress())return; Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(a.keyCode==Blockly.utils.KeyCodes.C?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):a.keyCode!=Blockly.utils.KeyCodes.X||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0));a.keyCode==Blockly.utils.KeyCodes.V?Blockly.clipboardXml_&&(a=Blockly.clipboardSource_, @@ -787,7 +784,7 @@ k,!1),f.push([a,h,k])}return f};Blockly.unbindEvent_=function(a){for(;a.length;) Blockly.checkBlockColourConstants=function(){Blockly.checkBlockColourConstant_("LOGIC_HUE",["Blocks","logic","HUE"],void 0);Blockly.checkBlockColourConstant_("LOGIC_HUE",["Constants","Logic","HUE"],210);Blockly.checkBlockColourConstant_("LOOPS_HUE",["Blocks","loops","HUE"],void 0);Blockly.checkBlockColourConstant_("LOOPS_HUE",["Constants","Loops","HUE"],120);Blockly.checkBlockColourConstant_("MATH_HUE",["Blocks","math","HUE"],void 0);Blockly.checkBlockColourConstant_("MATH_HUE",["Constants","Math", "HUE"],230);Blockly.checkBlockColourConstant_("TEXTS_HUE",["Blocks","texts","HUE"],void 0);Blockly.checkBlockColourConstant_("TEXTS_HUE",["Constants","Text","HUE"],160);Blockly.checkBlockColourConstant_("LISTS_HUE",["Blocks","lists","HUE"],void 0);Blockly.checkBlockColourConstant_("LISTS_HUE",["Constants","Lists","HUE"],260);Blockly.checkBlockColourConstant_("COLOUR_HUE",["Blocks","colour","HUE"],void 0);Blockly.checkBlockColourConstant_("COLOUR_HUE",["Constants","Colour","HUE"],20);Blockly.checkBlockColourConstant_("VARIABLES_HUE", ["Blocks","variables","HUE"],void 0);Blockly.checkBlockColourConstant_("VARIABLES_HUE",["Constants","Variables","HUE"],330);Blockly.checkBlockColourConstant_("VARIABLES_DYNAMIC_HUE",["Constants","VariablesDynamic","HUE"],310);Blockly.checkBlockColourConstant_("PROCEDURES_HUE",["Blocks","procedures","HUE"],void 0)}; -Blockly.checkBlockColourConstant_=function(a,b,c){for(var d="Blockly",e=Blockly,f=0;f90-b||a>-90-b&&a<-90+b?!0:!1}; +Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,1E9,-1E9,1E9)}; +Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};Blockly.utils.object.inherits(Blockly.VerticalFlyout,Blockly.Flyout); +Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX, +contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))}; +Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_== +Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth+a.absoluteLeft-this.width_,0))}}; +Blockly.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d", +d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scrollbar_.set(0)};Blockly.VerticalFlyout.prototype.wheel_=function(a){var b=Blockly.utils.getScrollDeltaPixels(a);if(b.y){var c=this.getMetrics_();b=c.viewTop-c.contentTop+b.y;b=Math.min(b,c.contentHeight-c.viewHeight);b=Math.max(b,0);this.scrollbar_.set(b);Blockly.WidgetDiv.hide()}a.preventDefault();a.stopPropagation()}; +Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button, +d,c),c+=f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a-b||a<-180+b||a>180-b?!0:!1};Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E9,1E9,-1E9,b+a.width):new Blockly.utils.Rect(-1E9,1E9,b,1E9)}; +Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f= +a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a/this.workspace_.scale-d.width-this.MARGIN-this.tabWidth_,b);this.width_=a;this.position()}};Blockly.FlyoutButton=function(a,b,c,d){this.workspace_=a;this.targetWorkspace_=b;this.text_=c.getAttribute("text");this.position_=new Blockly.utils.Coordinate(0,0);this.isLabel_=d;this.callbackKey_=c.getAttribute("callbackKey")||c.getAttribute("callbackkey");this.cssClass_=c.getAttribute("web-class")||null;this.onMouseUpWrapper_=null};Blockly.FlyoutButton.MARGIN_X=5;Blockly.FlyoutButton.MARGIN_Y=2;Blockly.FlyoutButton.prototype.width=0;Blockly.FlyoutButton.prototype.height=0; +Blockly.FlyoutButton.prototype.createDom=function(){var a=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(a+=" "+this.cssClass_);this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":a},this.workspace_.getCanvas());if(!this.isLabel_)var b=Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);a=Blockly.utils.dom.createSvgElement("rect",{"class":this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground", +rx:4,ry:4},this.svgGroup_);var c=Blockly.utils.dom.createSvgElement("text",{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),d=Blockly.utils.replaceMessageReferences(this.text_);this.workspace_.RTL&&(d+="\u200f");c.textContent=d;this.isLabel_&&(this.svgText_=c,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));var e=Blockly.utils.style.getComputedStyle(c,"fontSize"),f=Blockly.utils.style.getComputedStyle(c, +"fontWeight"),g=Blockly.utils.style.getComputedStyle(c,"fontFamily");this.width=Blockly.utils.dom.getFastTextWidthWithSizeString(c,e,f,g);d=Blockly.utils.dom.measureFontMetrics(d,e,f,g);this.height=d.height;this.isLabel_||(this.width+=2*Blockly.FlyoutButton.MARGIN_X,this.height+=2*Blockly.FlyoutButton.MARGIN_Y,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y", +this.height/2-d.height/2+d.baseline);this.updateTransform_();this.onMouseUpWrapper_=Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.onMouseUp_);return this.svgGroup_};Blockly.FlyoutButton.prototype.show=function(){this.updateTransform_();this.svgGroup_.setAttribute("display","block")};Blockly.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")}; +Blockly.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};Blockly.FlyoutButton.prototype.getPosition=function(){return this.position_};Blockly.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};Blockly.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&Blockly.unbindEvent_(this.onMouseUpWrapper_);this.svgGroup_&&Blockly.utils.dom.removeNode(this.svgGroup_);this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)}; +Blockly.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.isLabel_&&this.callbackKey_?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||this.callbackKey_&&this.targetWorkspace_.getButtonCallback(this.callbackKey_)?this.isLabel_||this.targetWorkspace_.getButtonCallback(this.callbackKey_)(this):console.warn("Buttons should have callbacks. Button text: "+this.text_)};Blockly.Css.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,}".split(","));Blockly.Generator=function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")};Blockly.Generator.NAME_TYPE="generated_function";Blockly.Generator.prototype.INFINITE_LOOP_TRAP=null;Blockly.Generator.prototype.STATEMENT_PREFIX=null;Blockly.Generator.prototype.STATEMENT_SUFFIX=null;Blockly.Generator.prototype.INDENT=" ";Blockly.Generator.prototype.COMMENT_WRAP=60;Blockly.Generator.prototype.ORDER_OVERRIDES=[]; +Blockly.Generator.prototype.workspaceToCode=function(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=Blockly.getMainWorkspace());var b=[];this.init(a);a=a.getTopBlocks(!0);for(var c=0,d;d=a[c];c++){var e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX, +d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")};Blockly.Generator.prototype.prefixLines=function(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)};Blockly.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;ca&&(a=this.computeDepth_(),this.setDepth_(a));return a};Blockly.tree.BaseNode.prototype.computeDepth_=function(){var a=this.getParent();return a?a.getDepth()+1:0};Blockly.tree.BaseNode.prototype.setDepth_=function(a){if(a!=this.depth_){this.depth_=a;var b=this.getRowElement();if(b){var c=this.getPixelIndent_()+"px";this.isRightToLeft()?b.style.paddingRight=c:b.style.paddingLeft=c}this.forEachChild(function(b){b.setDepth_(a+1)})}}; -Blockly.tree.BaseNode.prototype.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};Blockly.tree.BaseNode.prototype.getChildren=function(){var a=[];this.forEachChild(function(b){a.push(b)});return a};Blockly.tree.BaseNode.prototype.getFirstChild=function(){return this.getChildAt(0)};Blockly.tree.BaseNode.prototype.getLastChild=function(){return this.getChildAt(this.getChildCount()-1)};Blockly.tree.BaseNode.prototype.getPreviousSibling=function(){return this.previousSibling_}; -Blockly.tree.BaseNode.prototype.getNextSibling=function(){return this.nextSibling_};Blockly.tree.BaseNode.prototype.isLastSibling=function(){return!this.nextSibling_};Blockly.tree.BaseNode.prototype.isSelected=function(){return this.selected_};Blockly.tree.BaseNode.prototype.select=function(){var a=this.getTree();a&&a.setSelectedItem(this)};Blockly.tree.BaseNode.prototype.selectFirst=function(){var a=this.getTree();a&&this.firstChild_&&a.setSelectedItem(this.firstChild_)}; -Blockly.tree.BaseNode.prototype.setSelectedInternal=function(a){if(this.selected_!=a){this.selected_=a;this.updateRow();var b=this.getElement();b&&(Blockly.utils.aria.setState(b,Blockly.utils.aria.State.SELECTED,a),a&&(a=this.getTree().getElement(),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.ACTIVEDESCENDANT,this.getId())))}};Blockly.tree.BaseNode.prototype.getExpanded=function(){return this.expanded_};Blockly.tree.BaseNode.prototype.setExpandedInternal=function(a){this.expanded_=a}; +Blockly.tree.BaseNode.prototype.addChildAt=function(a,b){var c=this.getChildAt(b-1),d=this.getChildAt(b);Blockly.tree.BaseNode.superClass_.addChildAt.call(this,a,b);a.previousSibling_=c;a.nextSibling_=d;c&&(c.nextSibling_=a);d&&(d.previousSibling_=a);(b=this.getTree())&&a.setTreeInternal(b);a.setDepth_(this.getDepth()+1);if(b=this.getElement())if(this.updateExpandIcon(),Blockly.utils.aria.setState(b,Blockly.utils.aria.State.EXPANDED,this.expanded_),this.expanded_){b=this.getChildrenElement();a.getElement()|| +a.createDom();var e=a.getElement(),f=d&&d.getElement();b.insertBefore(e,f);this.isInDocument()&&a.enterDocument();d||(c?c.updateExpandIcon():(Blockly.utils.style.setElementShown(b,!0),this.setExpanded(this.expanded_)))}};Blockly.tree.BaseNode.prototype.add=function(a){if(a.getParent())throw Error(Blockly.Component.Error.PARENT_UNABLE_TO_BE_SET);this.addChildAt(a,this.getChildCount())};Blockly.tree.BaseNode.prototype.getTree=function(){return null}; +Blockly.tree.BaseNode.prototype.getDepth=function(){var a=this.depth_;0>a&&(a=(a=this.getParent())?a.getDepth()+1:0,this.setDepth_(a));return a};Blockly.tree.BaseNode.prototype.setDepth_=function(a){if(a!=this.depth_){this.depth_=a;var b=this.getRowElement();if(b){var c=this.getPixelIndent_()+"px";this.rightToLeft_?b.style.paddingRight=c:b.style.paddingLeft=c}this.forEachChild(function(b){b.setDepth_(a+1)})}};Blockly.tree.BaseNode.prototype.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1}; +Blockly.tree.BaseNode.prototype.getChildren=function(){var a=[];this.forEachChild(function(b){a.push(b)});return a};Blockly.tree.BaseNode.prototype.getPreviousSibling=function(){return this.previousSibling_};Blockly.tree.BaseNode.prototype.getNextSibling=function(){return this.nextSibling_};Blockly.tree.BaseNode.prototype.isLastSibling=function(){return!this.nextSibling_};Blockly.tree.BaseNode.prototype.isSelected=function(){return this.selected_}; +Blockly.tree.BaseNode.prototype.select=function(){var a=this.getTree();a&&a.setSelectedItem(this)};Blockly.tree.BaseNode.prototype.setSelected=function(a){if(this.selected_!=a){this.selected_=a;this.updateRow();var b=this.getElement();b&&(Blockly.utils.aria.setState(b,Blockly.utils.aria.State.SELECTED,a),a&&(a=this.getTree().getElement(),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.ACTIVEDESCENDANT,this.getId())))}}; Blockly.tree.BaseNode.prototype.setExpanded=function(a){var b=a!=this.expanded_,c;this.expanded_=a;var d=this.getTree(),e=this.getElement();if(this.hasChildren()){if(!a&&d&&this.contains(d.getSelectedItem())&&this.select(),e){if(c=this.getChildrenElement())Blockly.utils.style.setElementShown(c,a),Blockly.utils.aria.setState(e,Blockly.utils.aria.State.EXPANDED,a),a&&this.isInDocument()&&!c.hasChildNodes()&&(this.forEachChild(function(a){c.appendChild(a.toDom())}),this.forEachChild(function(a){a.enterDocument()})); -this.updateExpandIcon()}}else(c=this.getChildrenElement())&&Blockly.utils.style.setElementShown(c,!1);e&&this.updateIcon_();b&&(a?this.doNodeExpanded():this.doNodeCollapsed())};Blockly.tree.BaseNode.prototype.doNodeExpanded=function(){};Blockly.tree.BaseNode.prototype.doNodeCollapsed=function(){};Blockly.tree.BaseNode.prototype.toggle=function(){this.setExpanded(!this.getExpanded())};Blockly.tree.BaseNode.prototype.isUserCollapsible=function(){return this.isUserCollapsible_}; -Blockly.tree.BaseNode.prototype.toDom=function(){var a=this.getExpanded()&&this.hasChildren(),b=document.createElement("div");b.style.backgroundPosition=this.getBackgroundPosition();a||(b.style.display="none");a&&this.forEachChild(function(a){b.appendChild(a.toDom())});a=document.createElement("div");a.id=this.getId();a.appendChild(this.getRowDom());a.appendChild(b);return a};Blockly.tree.BaseNode.prototype.getPixelIndent_=function(){return Math.max(0,(this.getDepth()-1)*this.config_.indentWidth)}; -Blockly.tree.BaseNode.prototype.getRowDom=function(){var a=document.createElement("div");a.className=this.getRowClassName();a.style["padding-"+(this.isRightToLeft()?"right":"left")]=this.getPixelIndent_()+"px";a.appendChild(this.getIconDom());a.appendChild(this.getLabelDom());return a};Blockly.tree.BaseNode.prototype.getRowClassName=function(){var a="";this.isSelected()&&(a=" "+(this.config_.cssSelectedRow||""));return this.config_.cssTreeRow+a}; -Blockly.tree.BaseNode.prototype.getLabelDom=function(){var a=document.createElement("span");a.className=this.config_.cssItemLabel||"";a.textContent=this.getText();return a};Blockly.tree.BaseNode.prototype.getIconDom=function(){var a=document.createElement("span");a.style.display="inline-block";a.className=this.getCalculatedIconClass();return a};Blockly.tree.BaseNode.prototype.getCalculatedIconClass=function(){throw Error("unimplemented abstract method");}; +this.updateExpandIcon()}}else(c=this.getChildrenElement())&&Blockly.utils.style.setElementShown(c,!1);e&&this.updateIcon_();b&&(a?this.doNodeExpanded():this.doNodeCollapsed())};Blockly.tree.BaseNode.prototype.doNodeExpanded=function(){};Blockly.tree.BaseNode.prototype.doNodeCollapsed=function(){};Blockly.tree.BaseNode.prototype.toggle=function(){this.setExpanded(!this.expanded_)}; +Blockly.tree.BaseNode.prototype.toDom=function(){var a=this.expanded_&&this.hasChildren(),b=document.createElement("div");b.style.backgroundPosition=this.getBackgroundPosition();a||(b.style.display="none");a&&this.forEachChild(function(a){b.appendChild(a.toDom())});a=document.createElement("div");a.id=this.getId();a.appendChild(this.getRowDom());a.appendChild(b);return a};Blockly.tree.BaseNode.prototype.getPixelIndent_=function(){return Math.max(0,(this.getDepth()-1)*this.config_.indentWidth)}; +Blockly.tree.BaseNode.prototype.getRowDom=function(){var a=document.createElement("div");a.className=this.getRowClassName();a.style["padding-"+(this.rightToLeft_?"right":"left")]=this.getPixelIndent_()+"px";a.appendChild(this.getIconDom());a.appendChild(this.getLabelDom());return a};Blockly.tree.BaseNode.prototype.getRowClassName=function(){var a="";this.isSelected()&&(a=" "+(this.config_.cssSelectedRow||""));return this.config_.cssTreeRow+a}; +Blockly.tree.BaseNode.prototype.getLabelDom=function(){var a=document.createElement("span");a.className=this.config_.cssItemLabel||"";a.textContent=this.content;return a};Blockly.tree.BaseNode.prototype.getIconDom=function(){var a=document.createElement("span");a.style.display="inline-block";a.className=this.getCalculatedIconClass();return a};Blockly.tree.BaseNode.prototype.getCalculatedIconClass=function(){throw Error("unimplemented abstract method");}; Blockly.tree.BaseNode.prototype.getBackgroundPosition=function(){return(this.isLastSibling()?"-100":(this.getDepth()-1)*this.config_.indentWidth)+"px 0"};Blockly.tree.BaseNode.prototype.getElement=function(){var a=Blockly.tree.BaseNode.superClass_.getElement.call(this);a||(a=document.getElementById(this.getId()),this.setElementInternal(a));return a};Blockly.tree.BaseNode.prototype.getRowElement=function(){var a=this.getElement();return a?a.firstChild:null}; -Blockly.tree.BaseNode.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.BaseNode.prototype.getLabelElement=function(){var a=this.getRowElement();return a&&a.lastChild?a.lastChild.previousSibling:null};Blockly.tree.BaseNode.prototype.getChildrenElement=function(){var a=this.getElement();return a?a.lastChild:null};Blockly.tree.BaseNode.prototype.getIconClass=function(){return this.iconClass_}; -Blockly.tree.BaseNode.prototype.getExpandedIconClass=function(){return this.expandedIconClass_};Blockly.tree.BaseNode.prototype.setText=function(a){this.content_=a};Blockly.tree.BaseNode.prototype.getText=function(){return this.content_};Blockly.tree.BaseNode.prototype.updateRow=function(){var a=this.getRowElement();a&&(a.className=this.getRowClassName())};Blockly.tree.BaseNode.prototype.updateExpandIcon=function(){var a=this.getChildrenElement();a&&(a.style.backgroundPosition=this.getBackgroundPosition())}; -Blockly.tree.BaseNode.prototype.updateIcon_=function(){this.getIconElement().className=this.getCalculatedIconClass()};Blockly.tree.BaseNode.prototype.onMouseDown=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()?this.isUserCollapsible_&&this.toggle():(this.select(),this.updateRow())};Blockly.tree.BaseNode.prototype.onClick_=function(a){a.preventDefault()}; -Blockly.tree.BaseNode.prototype.onKeyDown=function(a){var b=!0;switch(a.keyCode){case Blockly.utils.KeyCodes.RIGHT:if(a.altKey)break;b=this.selectChild();break;case Blockly.utils.KeyCodes.LEFT:if(a.altKey)break;b=this.selectParent();break;case Blockly.utils.KeyCodes.DOWN:b=this.selectNext();break;case Blockly.utils.KeyCodes.UP:b=this.selectPrevious();break;default:b=!1}b&&a.preventDefault();return b}; -Blockly.tree.BaseNode.prototype.selectNext=function(){var a=this.getNextShownNode();a&&a.select();return!0};Blockly.tree.BaseNode.prototype.selectPrevious=function(){var a=this.getPreviousShownNode();a&&a.select();return!0};Blockly.tree.BaseNode.prototype.selectParent=function(){if(this.hasChildren()&&this.getExpanded()&&this.isUserCollapsible_)this.setExpanded(!1);else{var a=this.getParent(),b=this.getTree();a&&a!=b&&a.select()}return!0}; -Blockly.tree.BaseNode.prototype.selectChild=function(){return this.hasChildren()?(this.getExpanded()?this.getFirstChild().select():this.setExpanded(!0),!0):!1};Blockly.tree.BaseNode.prototype.getLastShownDescendant=function(){return this.getExpanded()&&this.hasChildren()?this.getLastChild().getLastShownDescendant():this}; -Blockly.tree.BaseNode.prototype.getNextShownNode=function(){if(this.hasChildren()&&this.getExpanded())return this.getFirstChild();for(var a=this,b;a!=this.getTree();){b=a.getNextSibling();if(null!=b)return b;a=a.getParent()}return null};Blockly.tree.BaseNode.prototype.getPreviousShownNode=function(){var a=this.getPreviousSibling();if(null!=a)return a.getLastShownDescendant();a=this.getParent();var b=this.getTree();return a==b||this==b?null:a};Blockly.tree.BaseNode.prototype.getConfig=function(){return this.config_}; +Blockly.tree.BaseNode.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.BaseNode.prototype.getLabelElement=function(){var a=this.getRowElement();return a&&a.lastChild?a.lastChild.previousSibling:null};Blockly.tree.BaseNode.prototype.getChildrenElement=function(){var a=this.getElement();return a?a.lastChild:null};Blockly.tree.BaseNode.prototype.updateRow=function(){var a=this.getRowElement();a&&(a.className=this.getRowClassName())}; +Blockly.tree.BaseNode.prototype.updateExpandIcon=function(){var a=this.getChildrenElement();a&&(a.style.backgroundPosition=this.getBackgroundPosition())};Blockly.tree.BaseNode.prototype.updateIcon_=function(){this.getIconElement().className=this.getCalculatedIconClass()};Blockly.tree.BaseNode.prototype.onMouseDown=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()?this.isUserCollapsible_&&this.toggle():(this.select(),this.updateRow())}; +Blockly.tree.BaseNode.prototype.onClick_=function(a){a.preventDefault()};Blockly.tree.BaseNode.prototype.onKeyDown=function(a){var b=!0;switch(a.keyCode){case Blockly.utils.KeyCodes.RIGHT:if(a.altKey)break;b=this.selectChild();break;case Blockly.utils.KeyCodes.LEFT:if(a.altKey)break;b=this.selectParent();break;case Blockly.utils.KeyCodes.DOWN:b=this.selectNext();break;case Blockly.utils.KeyCodes.UP:b=this.selectPrevious();break;default:b=!1}b&&a.preventDefault();return b}; +Blockly.tree.BaseNode.prototype.selectNext=function(){var a=this.getNextShownNode();a&&a.select();return!0};Blockly.tree.BaseNode.prototype.selectPrevious=function(){var a=this.getPreviousShownNode();a&&a.select();return!0};Blockly.tree.BaseNode.prototype.selectParent=function(){if(this.hasChildren()&&this.expanded_&&this.isUserCollapsible_)this.setExpanded(!1);else{var a=this.getParent(),b=this.getTree();a&&a!=b&&a.select()}return!0}; +Blockly.tree.BaseNode.prototype.selectChild=function(){return this.hasChildren()?(this.expanded_?this.getChildAt(0).select():this.setExpanded(!0),!0):!1};Blockly.tree.BaseNode.prototype.getLastShownDescendant=function(){return this.expanded_&&this.hasChildren()?this.getChildAt(this.getChildCount()-1).getLastShownDescendant():this}; +Blockly.tree.BaseNode.prototype.getNextShownNode=function(){if(this.hasChildren()&&this.expanded_)return this.getChildAt(0);for(var a=this,b;a!=this.getTree();){b=a.getNextSibling();if(null!=b)return b;a=a.getParent()}return null};Blockly.tree.BaseNode.prototype.getPreviousShownNode=function(){var a=this.getPreviousSibling();if(null!=a)return a.getLastShownDescendant();a=this.getParent();var b=this.getTree();return a==b||this==b?null:a}; Blockly.tree.BaseNode.prototype.setTreeInternal=function(a){this.tree!=a&&(this.tree=a,this.forEachChild(function(b){b.setTreeInternal(a)}))};Blockly.tree.TreeNode=function(a,b,c){this.toolbox_=a;Blockly.tree.BaseNode.call(this,b,c)};Blockly.utils.object.inherits(Blockly.tree.TreeNode,Blockly.tree.BaseNode);Blockly.tree.TreeNode.prototype.getTree=function(){if(this.tree)return this.tree;var a=this.getParent();return a&&(a=a.getTree())?(this.setTreeInternal(a),a):null}; -Blockly.tree.TreeNode.prototype.getCalculatedIconClass=function(){var a=this.getExpanded(),b=this.getExpandedIconClass();if(a&&b)return b;b=this.getIconClass();if(!a&&b)return b;b=this.getConfig();if(this.hasChildren()){if(a&&b.cssExpandedFolderIcon)return b.cssTreeIcon+" "+b.cssExpandedFolderIcon;if(!a&&b.cssCollapsedFolderIcon)return b.cssTreeIcon+" "+b.cssCollapsedFolderIcon}else if(b.cssFileIcon)return b.cssTreeIcon+" "+b.cssFileIcon;return""}; -Blockly.tree.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible()?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.tree.TreeNode.prototype.onMouseDown=function(a){}; -Blockly.tree.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=Blockly.utils.KeyCodes.DOWN,d=Blockly.utils.KeyCodes.UP;b[Blockly.utils.KeyCodes.RIGHT]=this.isRightToLeft()?d:c;b[Blockly.utils.KeyCodes.LEFT]=this.isRightToLeft()?c:d;b[Blockly.utils.KeyCodes.UP]=Blockly.utils.KeyCodes.LEFT;b[Blockly.utils.KeyCodes.DOWN]=Blockly.utils.KeyCodes.RIGHT;Object.defineProperties(a,{keyCode:{value:b[a.keyCode]||a.keyCode}})}return Blockly.tree.TreeNode.superClass_.onKeyDown.call(this, -a)};Blockly.tree.TreeNode.prototype.onSizeChanged=function(a){this.onSizeChanged_=a};Blockly.tree.TreeNode.prototype.resizeToolbox_=function(){this.onSizeChanged_&&this.onSizeChanged_.call(this.toolbox_)};Blockly.tree.TreeNode.prototype.doNodeExpanded=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeNode.prototype.doNodeCollapsed=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeControl=function(a,b){this.toolbox_=a;this.onKeydownWrapper_=this.onClickWrapper_=this.onBlurWrapper_=this.onFocusWrapper_=null;Blockly.tree.BaseNode.call(this,"",b);this.setExpandedInternal(!0);this.setSelectedInternal(!0);this.selectedItem_=this};Blockly.utils.object.inherits(Blockly.tree.TreeControl,Blockly.tree.BaseNode);Blockly.tree.TreeControl.prototype.getTree=function(){return this};Blockly.tree.TreeControl.prototype.getToolbox=function(){return this.toolbox_}; +Blockly.tree.TreeNode.prototype.getCalculatedIconClass=function(){var a=this.expanded_;if(a&&this.expandedIconClass)return this.expandedIconClass;var b=this.iconClass;if(!a&&b)return b;b=this.config_;if(this.hasChildren()){if(a&&b.cssExpandedFolderIcon)return b.cssTreeIcon+" "+b.cssExpandedFolderIcon;if(!a&&b.cssCollapsedFolderIcon)return b.cssTreeIcon+" "+b.cssCollapsedFolderIcon}else if(b.cssFileIcon)return b.cssTreeIcon+" "+b.cssFileIcon;return""}; +Blockly.tree.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.tree.TreeNode.prototype.onMouseDown=function(a){}; +Blockly.tree.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=Blockly.utils.KeyCodes.DOWN,d=Blockly.utils.KeyCodes.UP;b[Blockly.utils.KeyCodes.RIGHT]=this.rightToLeft_?d:c;b[Blockly.utils.KeyCodes.LEFT]=this.rightToLeft_?c:d;b[Blockly.utils.KeyCodes.UP]=Blockly.utils.KeyCodes.LEFT;b[Blockly.utils.KeyCodes.DOWN]=Blockly.utils.KeyCodes.RIGHT;Object.defineProperties(a,{keyCode:{value:b[a.keyCode]||a.keyCode}})}return Blockly.tree.TreeNode.superClass_.onKeyDown.call(this, +a)};Blockly.tree.TreeNode.prototype.onSizeChanged=function(a){this.onSizeChanged_=a};Blockly.tree.TreeNode.prototype.resizeToolbox_=function(){this.onSizeChanged_&&this.onSizeChanged_.call(this.toolbox_)};Blockly.tree.TreeNode.prototype.doNodeExpanded=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeNode.prototype.doNodeCollapsed=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeControl=function(a,b){this.toolbox_=a;this.onKeydownWrapper_=this.onClickWrapper_=this.onBlurWrapper_=this.onFocusWrapper_=null;Blockly.tree.BaseNode.call(this,"",b);this.selected_=this.expanded_=!0;this.selectedItem_=this};Blockly.utils.object.inherits(Blockly.tree.TreeControl,Blockly.tree.BaseNode);Blockly.tree.TreeControl.prototype.getTree=function(){return this};Blockly.tree.TreeControl.prototype.getToolbox=function(){return this.toolbox_}; Blockly.tree.TreeControl.prototype.getDepth=function(){return 0};Blockly.tree.TreeControl.prototype.handleFocus_=function(a){this.focused_=!0;a=this.getElement();Blockly.utils.dom.addClass(a,"focused");this.selectedItem_&&this.selectedItem_.select()};Blockly.tree.TreeControl.prototype.handleBlur_=function(a){this.focused_=!1;a=this.getElement();Blockly.utils.dom.removeClass(a,"focused")};Blockly.tree.TreeControl.prototype.hasFocus=function(){return this.focused_}; -Blockly.tree.TreeControl.prototype.getExpanded=function(){return!0};Blockly.tree.TreeControl.prototype.setExpanded=function(a){this.setExpandedInternal(a)};Blockly.tree.TreeControl.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.TreeControl.prototype.updateExpandIcon=function(){};Blockly.tree.TreeControl.prototype.getRowClassName=function(){return Blockly.tree.TreeControl.superClass_.getRowClassName.call(this)+" "+this.getConfig().cssHideRoot}; -Blockly.tree.TreeControl.prototype.getCalculatedIconClass=function(){var a=this.getExpanded(),b=this.getExpandedIconClass();if(a&&b)return b;b=this.getIconClass();if(!a&&b)return b;b=this.getConfig();return a&&b.cssExpandedRootIcon?b.cssTreeIcon+" "+b.cssExpandedRootIcon:""}; -Blockly.tree.TreeControl.prototype.setSelectedItem=function(a){if(a!=this.selectedItem_&&(!this.onBeforeSelected_||this.onBeforeSelected_.call(this.toolbox_,a))){var b=this.getSelectedItem();this.selectedItem_&&this.selectedItem_.setSelectedInternal(!1);(this.selectedItem_=a)&&a.setSelectedInternal(!0);this.onAfterSelected_&&this.onAfterSelected_.call(this.toolbox_,b,a)}};Blockly.tree.TreeControl.prototype.onBeforeSelected=function(a){this.onBeforeSelected_=a}; +Blockly.tree.TreeControl.prototype.setExpanded=function(a){this.expanded_=a};Blockly.tree.TreeControl.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.TreeControl.prototype.updateExpandIcon=function(){};Blockly.tree.TreeControl.prototype.getRowClassName=function(){return Blockly.tree.TreeControl.superClass_.getRowClassName.call(this)+" "+this.config_.cssHideRoot}; +Blockly.tree.TreeControl.prototype.getCalculatedIconClass=function(){var a=this.expanded_;if(a&&this.expandedIconClass)return this.expandedIconClass;var b=this.iconClass;return!a&&b?b:a&&this.config_.cssExpandedRootIcon?this.config_.cssTreeIcon+" "+this.config_.cssExpandedRootIcon:""}; +Blockly.tree.TreeControl.prototype.setSelectedItem=function(a){if(a!=this.selectedItem_&&(!this.onBeforeSelected_||this.onBeforeSelected_.call(this.toolbox_,a))){var b=this.getSelectedItem();this.selectedItem_&&this.selectedItem_.setSelected(!1);(this.selectedItem_=a)&&a.setSelected(!0);this.onAfterSelected_&&this.onAfterSelected_.call(this.toolbox_,b,a)}};Blockly.tree.TreeControl.prototype.onBeforeSelected=function(a){this.onBeforeSelected_=a}; Blockly.tree.TreeControl.prototype.onAfterSelected=function(a){this.onAfterSelected_=a};Blockly.tree.TreeControl.prototype.getSelectedItem=function(){return this.selectedItem_};Blockly.tree.TreeControl.prototype.initAccessibility=function(){Blockly.tree.TreeControl.superClass_.initAccessibility.call(this);var a=this.getElement();Blockly.utils.aria.setRole(a,Blockly.utils.aria.Role.TREE);Blockly.utils.aria.setState(a,Blockly.utils.aria.State.LABELLEDBY,this.getLabelElement().id)}; -Blockly.tree.TreeControl.prototype.enterDocument=function(){Blockly.tree.TreeControl.superClass_.enterDocument.call(this);var a=this.getElement();a.className=this.getConfig().cssRoot;a.setAttribute("hideFocus","true");this.attachEvents_();this.initAccessibility()};Blockly.tree.TreeControl.prototype.exitDocument=function(){Blockly.tree.TreeControl.superClass_.exitDocument.call(this);this.detachEvents_()}; +Blockly.tree.TreeControl.prototype.enterDocument=function(){Blockly.tree.TreeControl.superClass_.enterDocument.call(this);var a=this.getElement();a.className=this.config_.cssRoot;a.setAttribute("hideFocus","true");this.attachEvents_();this.initAccessibility()};Blockly.tree.TreeControl.prototype.exitDocument=function(){Blockly.tree.TreeControl.superClass_.exitDocument.call(this);this.detachEvents_()}; Blockly.tree.TreeControl.prototype.attachEvents_=function(){var a=this.getElement();a.tabIndex=0;this.onFocusWrapper_=Blockly.bindEvent_(a,"focus",this,this.handleFocus_);this.onBlurWrapper_=Blockly.bindEvent_(a,"blur",this,this.handleBlur_);this.onClickWrapper_=Blockly.bindEventWithChecks_(a,"click",this,this.handleMouseEvent_);this.onKeydownWrapper_=Blockly.bindEvent_(a,"keydown",this,this.handleKeyEvent_)}; Blockly.tree.TreeControl.prototype.detachEvents_=function(){this.onFocusWrapper_&&(Blockly.unbindEvent_(this.onFocusWrapper_),this.onFocusWrapper_=null);this.onBlurWrapper_&&(Blockly.unbindEvent_(this.onBlurWrapper_),this.onBlurWrapper_=null);this.onClickWrapper_&&(Blockly.unbindEvent_(this.onClickWrapper_),this.onClickWrapper_=null);this.onKeydownWrapper_&&(Blockly.unbindEvent_(this.onKeydownWrapper_),this.onKeydownWrapper_=null)}; Blockly.tree.TreeControl.prototype.handleMouseEvent_=function(a){var b=this.getNodeFromEvent_(a);if(b)switch(a.type){case "mousedown":b.onMouseDown(a);break;case "click":b.onClick_(a)}};Blockly.tree.TreeControl.prototype.handleKeyEvent_=function(a){var b=!1;if(b=this.selectedItem_&&this.selectedItem_.onKeyDown(a)||b)Blockly.utils.style.scrollIntoContainerView(this.selectedItem_.getElement(),this.getElement().parentNode),a.preventDefault();return b}; -Blockly.tree.TreeControl.prototype.getNodeFromEvent_=function(a){for(var b=a.target;null!=b;){if(a=Blockly.tree.BaseNode.allNodes[b.id])return a;if(b==this.getElement())break;b=b.parentNode}return null};Blockly.tree.TreeControl.prototype.createNode=function(a){return new Blockly.tree.TreeNode(this.toolbox_,a||"",this.getConfig())};Blockly.FieldTextInput=function(a,b,c){this.spellcheck_=!0;null==a&&(a="");Blockly.FieldTextInput.superClass_.constructor.call(this,a,b,c);this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.htmlInput_=null;this.fullBlockClickTarget_=!1};Blockly.utils.object.inherits(Blockly.FieldTextInput,Blockly.Field);Blockly.FieldTextInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldTextInput(b,void 0,a)};Blockly.FieldTextInput.prototype.SERIALIZABLE=!0; +Blockly.tree.TreeControl.prototype.getNodeFromEvent_=function(a){for(var b=a.target;null!=b;){if(a=Blockly.tree.BaseNode.allNodes[b.id])return a;if(b==this.getElement())break;if(b.getAttribute("role")==Blockly.utils.aria.Role.GROUP)break;b=b.parentNode}return null};Blockly.tree.TreeControl.prototype.createNode=function(a){return new Blockly.tree.TreeNode(this.toolbox_,a||"",this.config_)};Blockly.Toolbox=function(a){this.workspace_=a;this.RTL=a.options.RTL;this.horizontalLayout_=a.options.horizontalLayout;this.toolboxPosition=a.options.toolboxPosition;this.config_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"};this.treeSeparatorConfig_={cssTreeRow:"blocklyTreeSeparator"}; +this.horizontalLayout_&&(this.config_.cssTreeRow+=a.RTL?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.treeSeparatorConfig_.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.RTL?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),this.config_.cssTreeIcon="");this.flyout_=null};Blockly.Toolbox.prototype.width=0;Blockly.Toolbox.prototype.height=0;Blockly.Toolbox.prototype.selectedOption_=null;Blockly.Toolbox.prototype.lastCategory_=null; +Blockly.Toolbox.prototype.init=function(){var a=this.workspace_,b=this.workspace_.getParentSvg();this.HtmlDiv=document.createElement("div");this.HtmlDiv.className="blocklyToolboxDiv blocklyNonSelectable";this.HtmlDiv.setAttribute("dir",a.RTL?"RTL":"LTR");b.parentNode.insertBefore(this.HtmlDiv,b);var c=a.getThemeManager();c.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");c.subscribe(this.HtmlDiv,"toolboxForegroundColour","color");Blockly.bindEventWithChecks_(this.HtmlDiv,"mousedown", +this,function(a){Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0);Blockly.Touch.clearTouchIdentifier()},!1,!0);c=new Blockly.Options({parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,renderer:a.options.renderer,rendererOverrides:a.options.rendererOverrides});c.toolboxPosition=a.options.toolboxPosition;if(a.horizontalLayout){if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout"); +this.flyout_=new Blockly.HorizontalFlyout(c)}else{if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");this.flyout_=new Blockly.VerticalFlyout(c)}if(!this.flyout_)throw Error("One of Blockly.VerticalFlyout or Blockly.Horizontal must berequired.");Blockly.utils.dom.insertAfter(this.flyout_.createDom("svg"),b);this.flyout_.init(a);this.config_.cleardotPath=a.options.pathToMedia+"1x1.gif";this.config_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.RTL?"Rtl":"Ltr"); +this.renderTree(a.options.languageTree)}; +Blockly.Toolbox.prototype.renderTree=function(a){this.tree_&&(this.tree_.dispose(),this.lastCategory_=null);var b=new Blockly.tree.TreeControl(this,this.config_);this.tree_=b;b.setSelectedItem(null);b.onBeforeSelected(this.handleBeforeTreeSelected_);b.onAfterSelected(this.handleAfterTreeSelected_);var c=null;if(a){this.tree_.blocks=[];this.hasColours_=!1;c=this.syncTrees_(a,this.tree_,this.workspace_.options.pathToMedia);if(this.tree_.blocks.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");this.workspace_.resizeContents()}b.render(this.HtmlDiv); +c&&b.setSelectedItem(c);this.addColour_();this.position();this.horizontalLayout_&&Blockly.utils.aria.setState(this.tree_.getElement(),Blockly.utils.aria.State.ORIENTATION,"horizontal")};Blockly.Toolbox.prototype.handleBeforeTreeSelected_=function(a){if(a==this.tree_)return!1;this.lastCategory_&&(this.lastCategory_.getRowElement().style.backgroundColor="");if(a){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}return!0}; +Blockly.Toolbox.prototype.handleAfterTreeSelected_=function(a,b){b&&b.blocks&&b.blocks.length?(this.flyout_.show(b.blocks),this.lastCategory_!=b&&this.flyout_.scrollToStart(),this.workspace_.keyboardAccessibilityMode&&Blockly.navigation.setState(Blockly.navigation.STATE_TOOLBOX)):(this.flyout_.hide(),!this.workspace_.keyboardAccessibilityMode||b instanceof Blockly.Toolbox.TreeSeparator||Blockly.navigation.setState(Blockly.navigation.STATE_WS));a!=b&&a!=this&&(a=new Blockly.Events.Ui(null,"category", +a&&a.content,b&&b.content),a.workspaceId=this.workspace_.id,Blockly.Events.fire(a));b&&(this.lastCategory_=b)};Blockly.Toolbox.prototype.handleNodeSizeChanged_=function(){Blockly.svgResize(this.workspace_)}; +Blockly.Toolbox.prototype.onBlocklyAction=function(a){var b=this.tree_.getSelectedItem();if(!b)return!1;switch(a.name){case Blockly.navigation.actionNames.PREVIOUS:return b.selectPrevious();case Blockly.navigation.actionNames.OUT:return b.selectParent();case Blockly.navigation.actionNames.NEXT:return b.selectNext();case Blockly.navigation.actionNames.IN:return b.selectChild();default:return!1}}; +Blockly.Toolbox.prototype.dispose=function(){this.flyout_.dispose();this.tree_.dispose();this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv);Blockly.utils.dom.removeNode(this.HtmlDiv);this.lastCategory_=null};Blockly.Toolbox.prototype.getWidth=function(){return this.width};Blockly.Toolbox.prototype.getHeight=function(){return this.height};Blockly.Toolbox.prototype.getFlyout=function(){return this.flyout_}; +Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;if(a){var b=Blockly.svgSize(this.workspace_.getParentSvg());this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width=b.width+"px",this.height=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height=b.height+"px",this.width=a.offsetWidth);this.flyout_.position()}}; +Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));var h=this.tree_.createNode(e);h.onSizeChanged(this.handleNodeSizeChanged_);h.blocks=[];b.add(h);var k=g.getAttribute("custom");k?h.blocks=k:(k=this.syncTrees_(g,h,c))&&(d=k);k=g.getAttribute("categorystyle");var l=g.getAttribute("colour");l&&k?(h.hexColour="",console.warn('Toolbox category "'+ +e+'" can not have both a style and a colour')):k?this.setColourFromStyle_(k,h,e):this.setColour_(l,h,e);"true"==g.getAttribute("expanded")?(h.blocks.length&&(d=h),h.setExpanded(!0)):h.setExpanded(!1);e=g;break;case "SEP":if(e&&"CATEGORY"==e.tagName.toUpperCase()){b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d}; +Blockly.Toolbox.prototype.setColour_=function(a,b,c){a=Blockly.utils.replaceMessageReferences(a);if(null===a||""===a)b.hexColour="";else{var d=Number(a);isNaN(d)?(d=Blockly.utils.colour.parse(a))?(b.hexColour=d,this.hasColours_=!0):(b.hexColour="",console.warn('Toolbox category "'+c+'" has unrecognized colour attribute: '+a)):(b.hexColour=Blockly.hueToHex(d),this.hasColours_=!0)}}; +Blockly.Toolbox.prototype.setColourFromStyle_=function(a,b,c){b.styleName=a;var d=this.workspace_.getTheme();a&&d&&((d=d.categoryStyles[a])&&d.colour?this.setColour_(d.colour,b,c):console.warn('Style "'+a+'" must exist and contain a colour value'))};Blockly.Toolbox.prototype.updateColourFromTheme_=function(a){if(a=a||this.tree_){a=a.getChildren(!1);for(var b=0,c;c=a[b];b++)c.styleName&&(this.setColourFromStyle_(c.styleName,c,""),this.addColour_()),this.updateColourFromTheme_(c)}}; +Blockly.Toolbox.prototype.updateColourFromTheme=function(){var a=this.tree_;a&&(this.updateColourFromTheme_(a),this.updateSelectedItemColour_(a))};Blockly.Toolbox.prototype.updateSelectedItemColour_=function(a){if(a=a.getSelectedItem()){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}}; +Blockly.Toolbox.prototype.addColour_=function(a){a=(a||this.tree_).getChildren(!1);for(var b=0,c;c=a[b];b++){var d=c.getRowElement();if(d){var e=this.hasColours_?"8px solid "+(c.hexColour||"#ddd"):"none";this.workspace_.RTL?d.style.borderRight=e:d.style.borderLeft=e}this.addColour_(c)}};Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)};Blockly.Toolbox.prototype.addStyle=function(a){Blockly.utils.dom.addClass(this.HtmlDiv,a)}; +Blockly.Toolbox.prototype.removeStyle=function(a){Blockly.utils.dom.removeClass(this.HtmlDiv,a)}; +Blockly.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv)return null;var a=this.HtmlDiv.getBoundingClientRect(),b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E7,c,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM?new Blockly.utils.Rect(b,1E7,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E7,1E7,-1E7,a):new Blockly.utils.Rect(-1E7,1E7,d,1E7)}; +Blockly.Toolbox.prototype.refreshSelection=function(){var a=this.tree_.getSelectedItem();a&&a.blocks&&this.flyout_.show(a.blocks)};Blockly.Toolbox.prototype.selectFirstCategory=function(){this.tree_.getSelectedItem()||this.tree_.selectChild()};Blockly.Toolbox.TreeSeparator=function(a){Blockly.tree.TreeNode.call(this,null,"",a)};Blockly.utils.object.inherits(Blockly.Toolbox.TreeSeparator,Blockly.tree.TreeNode); +Blockly.Css.register([".blocklyToolboxDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", +"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: rgba(255, 255, 255, 0.2);","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;", +"margin: 5px 0;","}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", +"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", +'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);Blockly.Trashcan=function(a){this.workspace_=a;this.contents_=[];this.flyout=null;if(!(0>=this.workspace_.options.maxTrashcanContents)){a=new Blockly.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex,renderer:this.workspace_.options.renderer,rendererOverrides:this.workspace_.options.rendererOverrides});if(this.workspace_.horizontalLayout){a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_TOP?Blockly.TOOLBOX_AT_BOTTOM: +Blockly.TOOLBOX_AT_TOP;if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout");this.flyout=new Blockly.HorizontalFlyout(a)}else{a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?Blockly.TOOLBOX_AT_LEFT:Blockly.TOOLBOX_AT_RIGHT;if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");this.flyout=new Blockly.VerticalFlyout(a)}this.workspace_.addChangeListener(this.onDelete_.bind(this))}}; +Blockly.Trashcan.prototype.WIDTH_=47;Blockly.Trashcan.prototype.BODY_HEIGHT_=44;Blockly.Trashcan.prototype.LID_HEIGHT_=16;Blockly.Trashcan.prototype.MARGIN_BOTTOM_=20;Blockly.Trashcan.prototype.MARGIN_SIDE_=20;Blockly.Trashcan.prototype.MARGIN_HOTSPOT_=10;Blockly.Trashcan.prototype.SPRITE_LEFT_=0;Blockly.Trashcan.prototype.SPRITE_TOP_=32;Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_=.1;Blockly.Trashcan.ANIMATION_LENGTH_=80;Blockly.Trashcan.ANIMATION_FRAMES_=4;Blockly.Trashcan.OPACITY_MIN_=.4; +Blockly.Trashcan.OPACITY_MAX_=.8;Blockly.Trashcan.MAX_LID_ANGLE_=45;Blockly.Trashcan.prototype.isOpen=!1;Blockly.Trashcan.prototype.minOpenness_=0;Blockly.Trashcan.prototype.svgGroup_=null;Blockly.Trashcan.prototype.svgLid_=null;Blockly.Trashcan.prototype.lidTask_=0;Blockly.Trashcan.prototype.lidOpen_=0;Blockly.Trashcan.prototype.left_=0;Blockly.Trashcan.prototype.top_=0; +Blockly.Trashcan.prototype.createDom=function(){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},b);var c=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, +y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup_);c.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashLidClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.LID_HEIGHT_},b);this.svgLid_=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, +y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup_);this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.click);Blockly.bindEvent_(c,"mouseover",this,this.mouseOver_);Blockly.bindEvent_(c,"mouseout",this,this.mouseOut_);this.animateLid_();return this.svgGroup_}; +Blockly.Trashcan.prototype.init=function(a){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),Blockly.Trashcan.ANIMATION_LENGTH_/ +a))};Blockly.Trashcan.prototype.setLidAngle_=function(a){var b=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")};Blockly.Trashcan.prototype.setMinOpenness_=function(a){this.minOpenness_=a;this.isOpen||this.setLidAngle_(a*Blockly.Trashcan.MAX_LID_ANGLE_)};Blockly.Trashcan.prototype.close=function(){this.setOpen(!1)}; +Blockly.Trashcan.prototype.click=function(){if(this.contents_.length){for(var a=[],b=0,c;c=this.contents_[b];b++)a[b]=Blockly.Xml.textToDom(c);this.flyout.show(a)}};Blockly.Trashcan.prototype.mouseOver_=function(){this.contents_.length&&this.setOpen(!0)};Blockly.Trashcan.prototype.mouseOut_=function(){this.setOpen(!1)}; +Blockly.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents)&&a.type==Blockly.Events.BLOCK_DELETE&&"shadow"!=a.oldXml.tagName.toLowerCase()&&(a=this.cleanBlockXML_(a.oldXml),-1==this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_)}}; +Blockly.Trashcan.prototype.cleanBlockXML_=function(a){for(var b=a=a.cloneNode(!0);b;){b.removeAttribute&&(b.removeAttribute("x"),b.removeAttribute("y"),b.removeAttribute("id"),b.removeAttribute("disabled"),"comment"==b.nodeName&&(b.removeAttribute("h"),b.removeAttribute("w"),b.removeAttribute("pinned")));var c=b.firstChild||b.nextSibling;if(!c)for(c=b.parentNode;c;){if(c.nextSibling){c=c.nextSibling;break}c=c.parentNode}b=c}return Blockly.Xml.domToText(a)};Blockly.VariablesDynamic={};Blockly.VariablesDynamic.onCreateVariableButtonClick_String=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"String")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Number=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Number")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Colour")}; +Blockly.VariablesDynamic.flyoutCategory=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_COLOUR_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"); +b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",Blockly.VariablesDynamic.onCreateVariableButtonClick_String);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",Blockly.VariablesDynamic.onCreateVariableButtonClick_Number);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour);a=Blockly.VariablesDynamic.flyoutCategoryBlocks(a);return b=b.concat(a)}; +Blockly.VariablesDynamic.flyoutCategoryBlocks=function(a){a=a.getAllVariables();var b=[];if(0image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);Blockly.Mutator=function(a){Blockly.Mutator.superClass_.constructor.call(this,null);this.quarkNames_=a};Blockly.utils.object.inherits(Blockly.Mutator,Blockly.Icon);Blockly.Mutator.prototype.workspaceWidth_=0;Blockly.Mutator.prototype.workspaceHeight_=0;Blockly.Mutator.prototype.setBlock=function(a){this.block_=a};Blockly.Mutator.prototype.getWorkspace=function(){return this.workspace_}; +Blockly.Mutator.prototype.drawIcon_=function(a){Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);Blockly.utils.dom.createSvgElement("path",{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"}, +a);Blockly.utils.dom.createSvgElement("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};Blockly.Mutator.prototype.iconClick_=function(a){this.block_.isEditable()&&Blockly.Icon.prototype.iconClick_.call(this,a)}; +Blockly.Mutator.prototype.createEditor_=function(){this.svgDialog_=Blockly.utils.dom.createSvgElement("svg",{x:Blockly.Bubble.BORDER_WIDTH,y:Blockly.Bubble.BORDER_WIDTH},null);if(this.quarkNames_.length)for(var a=Blockly.utils.xml.createElement("xml"),b=0,c;c=this.quarkNames_[b];b++){var d=Blockly.utils.xml.createElement("block");d.setAttribute("type",c);a.appendChild(d)}else a=null;b=new Blockly.Options({disable:!1,parentWorkspace:this.block_.workspace,media:this.block_.workspace.options.pathToMedia, +rtl:this.block_.RTL,horizontalLayout:!1,renderer:this.block_.workspace.options.renderer,rendererOverrides:this.block_.workspace.options.rendererOverrides});b.toolboxPosition=this.block_.RTL?Blockly.TOOLBOX_AT_RIGHT:Blockly.TOOLBOX_AT_LEFT;b.languageTree=a;b.getMetrics=this.getFlyoutMetrics_.bind(this);this.workspace_=new Blockly.WorkspaceSvg(b);this.workspace_.isMutator=!0;this.workspace_.addChangeListener(Blockly.Events.disableOrphans);a=this.workspace_.addFlyout("g");b=this.workspace_.createDom("blocklyMutatorBackground"); +b.insertBefore(a,this.workspace_.svgBlockCanvas_);this.svgDialog_.appendChild(b);return this.svgDialog_};Blockly.Mutator.prototype.updateEditable=function(){Blockly.Mutator.superClass_.updateEditable.call(this);this.block_.isInFlyout||(this.block_.isEditable()?this.iconGroup_&&Blockly.utils.dom.removeClass(this.iconGroup_,"blocklyIconGroupReadonly"):(this.setVisible(!1),this.iconGroup_&&Blockly.utils.dom.addClass(this.iconGroup_,"blocklyIconGroupReadonly")))}; +Blockly.Mutator.prototype.resizeBubble_=function(){var a=2*Blockly.Bubble.BORDER_WIDTH,b=this.workspace_.getCanvas().getBBox();var c=this.block_.RTL?-b.x:b.width+b.x;b=b.height+3*a;var d=this.workspace_.getFlyout();d&&(d=d.getMetrics_(),b=Math.max(b,d.contentHeight+20));c+=3*a;if(Math.abs(this.workspaceWidth_-c)>a||Math.abs(this.workspaceHeight_-b)>a)this.workspaceWidth_=c,this.workspaceHeight_=b,this.bubble_.setBubbleSize(c+a,b+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height", +this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};Blockly.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDeleteAreas()}; +Blockly.Mutator.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"mutatorOpen",!a,a)),a){this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));var b=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();b&&(a.init(this.workspace_),a.show(b.childNodes)); +this.rootBlock_=this.block_.decompose(this.workspace_);b=this.rootBlock_.getDescendants(!1);for(var c=0,d;d=b[c];c++)d.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(b=2*a.CORNER_RADIUS,a=a.getWidth()+b):a=b=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,b);if(this.block_.saveConnections){var e=this,f=this.block_;f.saveConnections(this.rootBlock_);this.sourceListener_=function(){f.saveConnections(e.rootBlock_)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(); +this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),this.sourceListener_=null)}; +Blockly.Mutator.prototype.workspaceChanged_=function(a){if(a.type!=Blockly.Events.UI&&(a.type!=Blockly.Events.CHANGE||"disabled"!=a.element)){if(!this.workspace_.isDragging()){a=this.workspace_.getTopBlocks(!1);for(var b=0,c;c=a[b];b++){var d=c.getRelativeToSurfaceXY(),e=c.getHeightWidth();20>d.y+e.height&&c.moveBy(0,20-e.height-d.y)}}if(this.rootBlock_.workspace==this.workspace_){Blockly.Events.setGroup(!0);c=this.block_;a=(a=c.mutationToDom())&&Blockly.Xml.domToText(a);c.compose(this.rootBlock_); +c.initSvg();c.render();Blockly.getMainWorkspace().keyboardAccessibilityMode&&Blockly.navigation.moveCursorOnBlockMutation(c);b=(b=c.mutationToDom())&&Blockly.Xml.domToText(b);if(a!=b){Blockly.Events.fire(new Blockly.Events.BlockChange(c,"mutation",null,a,b));var f=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(f);c.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_();Blockly.Events.setGroup(!1)}}}; +Blockly.Mutator.prototype.getFlyoutMetrics_=function(){return{viewHeight:this.workspaceHeight_,viewWidth:this.workspaceWidth_-this.workspace_.getFlyout().getWidth(),absoluteTop:0,absoluteLeft:this.workspace_.RTL?0:this.workspace_.getFlyout().getWidth()}};Blockly.Mutator.prototype.dispose=function(){this.block_.mutator=null;Blockly.Icon.prototype.dispose.call(this)}; +Blockly.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0;c=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}; +Blockly.FieldTextInput.prototype.initView=function(){if(this.getConstants().FULL_BLOCK_FIELDS){for(var a=0,b=0,c=0,d;d=this.sourceBlock_.inputList[c];c++){for(var e=0;d.fieldRow[e];e++)a++;d.connection&&b++}this.fullBlockClickTarget_=1>=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}; Blockly.FieldTextInput.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:String(a)};Blockly.FieldTextInput.prototype.doValueInvalid_=function(a){this.isBeingEdited_&&(this.isTextValid_=!1,a=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"field",this.name||null,a,this.value_)))}; -Blockly.FieldTextInput.prototype.doValueUpdate_=function(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||(this.isDirty_=!0)};Blockly.FieldTextInput.prototype.applyColour=function(){this.sourceBlock_&&this.constants_.FULL_BLOCK_FIELDS&&(this.borderRect_?this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary):this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.constants_.FIELD_BORDER_RECT_COLOUR))}; +Blockly.FieldTextInput.prototype.doValueUpdate_=function(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||(this.isDirty_=!0)};Blockly.FieldTextInput.prototype.applyColour=function(){this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS&&(this.borderRect_?this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary):this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR))}; Blockly.FieldTextInput.prototype.render_=function(){Blockly.FieldTextInput.superClass_.render_.call(this);if(this.isBeingEdited_){this.resizeEditor_();var a=this.htmlInput_;this.isTextValid_?(Blockly.utils.dom.removeClass(a,"blocklyInvalidInput"),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.INVALID,!1)):(Blockly.utils.dom.addClass(a,"blocklyInvalidInput"),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.INVALID,!0))}}; -Blockly.FieldTextInput.prototype.setSpellcheck=function(a){a!=this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))};Blockly.FieldTextInput.prototype.showEditor_=function(a,b){this.workspace_=this.sourceBlock_.workspace;var c=b||!1;!c&&(Blockly.utils.userAgent.MOBILE||Blockly.utils.userAgent.ANDROID||Blockly.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(c)}; +Blockly.FieldTextInput.prototype.setSpellcheck=function(a){a!=this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))};Blockly.FieldTextInput.prototype.showEditor_=function(a,b){this.workspace_=this.sourceBlock_.workspace;a=b||!1;!a&&(Blockly.utils.userAgent.MOBILE||Blockly.utils.userAgent.ANDROID||Blockly.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(a)}; Blockly.FieldTextInput.prototype.showPromptEditor_=function(){var a=this;Blockly.prompt(Blockly.Msg.CHANGE_VALUE_TITLE,this.getText(),function(b){a.setValue(b)})};Blockly.FieldTextInput.prototype.showInlineEditor_=function(a){Blockly.WidgetDiv.show(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this));this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}; -Blockly.FieldTextInput.prototype.widgetCreate_=function(){var a=Blockly.WidgetDiv.DIV;Blockly.utils.dom.addClass(this.getClickTarget_(),"editing");var b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",this.spellcheck_);var c=this.workspace_.scale,d=this.constants_.FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=d;d=Blockly.FieldTextInput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+"px";var e= -this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition="box-shadow 0.25s ease 0s";this.constants_.FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0px 0px 0px "+4*c+"px")}b.style.borderRadius=d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.untypedDefaultValue_=this.value_;b.oldValue_=null;this.resizeEditor_(); +Blockly.FieldTextInput.prototype.widgetCreate_=function(){var a=Blockly.WidgetDiv.DIV;Blockly.utils.dom.addClass(this.getClickTarget_(),"editing");var b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",this.spellcheck_);var c=this.workspace_.getScale(),d=this.getConstants().FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=d;d=Blockly.FieldTextInput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+ +"px";var e=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition="box-shadow 0.25s ease 0s";this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0px 0px 0px "+4*c+"px")}b.style.borderRadius=d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.untypedDefaultValue_=this.value_;b.oldValue_=null;this.resizeEditor_(); this.bindInputEvents_(b);return b};Blockly.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();if(this.onFinishEditing_)this.onFinishEditing_(this.value_);this.unbindInputEvents_();var a=Blockly.WidgetDiv.DIV.style;a.width="auto";a.height="auto";a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;Blockly.utils.dom.removeClass(this.getClickTarget_(),"editing")}; Blockly.FieldTextInput.prototype.bindInputEvents_=function(a){this.onKeyDownWrapper_=Blockly.bindEventWithChecks_(a,"keydown",this,this.onHtmlInputKeyDown_);this.onKeyInputWrapper_=Blockly.bindEventWithChecks_(a,"input",this,this.onHtmlInputChange_)}; Blockly.FieldTextInput.prototype.unbindInputEvents_=function(){this.onKeyDownWrapper_&&(Blockly.unbindEvent_(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.onKeyInputWrapper_&&(Blockly.unbindEvent_(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}; @@ -877,15 +1005,14 @@ Blockly.FieldAngle.prototype.updateGraph_=function(){if(this.gauge_){var a=Numbe Blockly.FieldAngle.RADIUS;b=Math.abs(Math.floor((b-f)/Math.PI)%2);e&&(b=1-b);a.push(" l ",g,",",h," A ",Blockly.FieldAngle.RADIUS,",",Blockly.FieldAngle.RADIUS," 0 ",b," ",e," ",c,",",d," z")}this.gauge_.setAttribute("d",a.join(""));this.line_.setAttribute("x2",c);this.line_.setAttribute("y2",d)}}; Blockly.FieldAngle.prototype.onHtmlInputKeyDown_=function(a){Blockly.FieldAngle.superClass_.onHtmlInputKeyDown_.call(this,a);var b;a.keyCode===Blockly.utils.KeyCodes.LEFT?b=this.sourceBlock_.RTL?1:-1:a.keyCode===Blockly.utils.KeyCodes.RIGHT?b=this.sourceBlock_.RTL?-1:1:a.keyCode===Blockly.utils.KeyCodes.DOWN?b=-1:a.keyCode===Blockly.utils.KeyCodes.UP&&(b=1);if(b){var c=this.getValue();this.displayMouseOrKeyboardValue_(c+b*this.round_);a.preventDefault();a.stopPropagation()}}; Blockly.FieldAngle.prototype.doClassValidation_=function(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:this.wrapValue_(a)};Blockly.FieldAngle.prototype.wrapValue_=function(a){a%=360;0>a&&(a+=360);a>this.wrap_&&(a-=360);return a};Blockly.Css.register(".blocklyAngleCircle {,stroke: #444;,stroke-width: 1;,fill: #ddd;,fill-opacity: .8;,},.blocklyAngleMarks {,stroke: #444;,stroke-width: 1;,},.blocklyAngleGauge {,fill: #f88;,fill-opacity: .8;,pointer-events: none;,},.blocklyAngleLine {,stroke: #f00;,stroke-width: 2;,stroke-linecap: round;,pointer-events: none;,}".split(",")); -Blockly.fieldRegistry.register("field_angle",Blockly.FieldAngle);Blockly.FieldCheckbox=function(a,b,c){this.checkChar_=null;null==a&&(a="FALSE");Blockly.FieldCheckbox.superClass_.constructor.call(this,a,b,c)};Blockly.utils.object.inherits(Blockly.FieldCheckbox,Blockly.Field);Blockly.FieldCheckbox.fromJson=function(a){return new Blockly.FieldCheckbox(a.checked,void 0,a)};Blockly.FieldCheckbox.CHECK_CHAR="\u2713";Blockly.FieldCheckbox.prototype.SERIALIZABLE=!0;Blockly.FieldCheckbox.prototype.CURSOR="default";Blockly.FieldCheckbox.prototype.isDirty_=!1; -Blockly.FieldCheckbox.prototype.configure_=function(a){Blockly.FieldCheckbox.superClass_.configure_.call(this,a);a.checkCharacter&&(this.checkChar_=a.checkCharacter)}; -Blockly.FieldCheckbox.prototype.initView=function(){this.size_.width=this.constants_.FIELD_CHECKBOX_DEFAULT_WIDTH;Blockly.FieldCheckbox.superClass_.initView.call(this);this.textElement_.setAttribute("x",this.constants_.FIELD_CHECKBOX_X_OFFSET);this.textElement_.setAttribute("y",this.constants_.FIELD_CHECKBOX_Y_OFFSET);this.textElement_.removeAttribute("dominant-baseline");Blockly.utils.dom.addClass(this.textElement_,"blocklyCheckbox");this.textContent_.nodeValue=this.checkChar_||Blockly.FieldCheckbox.CHECK_CHAR; -this.textElement_.style.display=this.value_?"block":"none"};Blockly.FieldCheckbox.prototype.setCheckCharacter=function(a){this.checkChar_=a;this.textContent_&&(this.textContent_.nodeValue=a||Blockly.FieldCheckbox.CHECK_CHAR)};Blockly.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)};Blockly.FieldCheckbox.prototype.doClassValidation_=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null}; -Blockly.FieldCheckbox.prototype.doValueUpdate_=function(a){this.value_=this.convertValueToBool_(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")};Blockly.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"};Blockly.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_};Blockly.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))}; -Blockly.FieldCheckbox.prototype.convertValueToBool_=function(a){return"string"==typeof a?"TRUE"==a:!!a};Blockly.fieldRegistry.register("field_checkbox",Blockly.FieldCheckbox);Blockly.FieldColour=function(a,b,c){Blockly.FieldColour.superClass_.constructor.call(this,a||Blockly.FieldColour.COLOURS[0],b,c);this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null};Blockly.utils.object.inherits(Blockly.FieldColour,Blockly.Field);Blockly.FieldColour.fromJson=function(a){return new Blockly.FieldColour(a.colour,void 0,a)};Blockly.FieldColour.prototype.SERIALIZABLE=!0; +Blockly.fieldRegistry.register("field_angle",Blockly.FieldAngle);Blockly.FieldCheckbox=function(a,b,c){this.checkChar_=null;null==a&&(a="FALSE");Blockly.FieldCheckbox.superClass_.constructor.call(this,a,b,c)};Blockly.utils.object.inherits(Blockly.FieldCheckbox,Blockly.Field);Blockly.FieldCheckbox.fromJson=function(a){return new Blockly.FieldCheckbox(a.checked,void 0,a)};Blockly.FieldCheckbox.CHECK_CHAR="\u2713";Blockly.FieldCheckbox.prototype.SERIALIZABLE=!0;Blockly.FieldCheckbox.prototype.CURSOR="default"; +Blockly.FieldCheckbox.prototype.configure_=function(a){Blockly.FieldCheckbox.superClass_.configure_.call(this,a);a.checkCharacter&&(this.checkChar_=a.checkCharacter)};Blockly.FieldCheckbox.prototype.initView=function(){Blockly.FieldCheckbox.superClass_.initView.call(this);Blockly.utils.dom.addClass(this.textElement_,"blocklyCheckbox");this.textElement_.style.display=this.value_?"block":"none"}; +Blockly.FieldCheckbox.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)};Blockly.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_||Blockly.FieldCheckbox.CHECK_CHAR};Blockly.FieldCheckbox.prototype.setCheckCharacter=function(a){this.checkChar_=a;this.forceRerender()};Blockly.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)}; +Blockly.FieldCheckbox.prototype.doClassValidation_=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null};Blockly.FieldCheckbox.prototype.doValueUpdate_=function(a){this.value_=this.convertValueToBool_(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")};Blockly.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"};Blockly.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_}; +Blockly.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))};Blockly.FieldCheckbox.prototype.convertValueToBool_=function(a){return"string"==typeof a?"TRUE"==a:!!a};Blockly.fieldRegistry.register("field_checkbox",Blockly.FieldCheckbox);Blockly.FieldColour=function(a,b,c){Blockly.FieldColour.superClass_.constructor.call(this,a||Blockly.FieldColour.COLOURS[0],b,c);this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null};Blockly.utils.object.inherits(Blockly.FieldColour,Blockly.Field);Blockly.FieldColour.fromJson=function(a){return new Blockly.FieldColour(a.colour,void 0,a)};Blockly.FieldColour.prototype.SERIALIZABLE=!0; Blockly.FieldColour.prototype.CURSOR="default";Blockly.FieldColour.prototype.isDirty_=!1;Blockly.FieldColour.prototype.colours_=null;Blockly.FieldColour.prototype.titles_=null;Blockly.FieldColour.prototype.columns_=0;Blockly.FieldColour.prototype.configure_=function(a){Blockly.FieldColour.superClass_.configure_.call(this,a);a.colourOptions&&(this.colours_=a.colourOptions,this.titles_=a.colourTitles);a.columns&&(this.columns_=a.columns)}; -Blockly.FieldColour.prototype.initView=function(){this.size_=new Blockly.utils.Size(this.constants_.FIELD_COLOUR_DEFAULT_WIDTH,this.constants_.FIELD_COLOUR_DEFAULT_HEIGHT);this.constants_.FIELD_COLOUR_FULL_BLOCK?this.clickTarget_=this.sourceBlock_.getSvgRoot():(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")}; -Blockly.FieldColour.prototype.applyColour=function(){this.constants_.FIELD_COLOUR_FULL_BLOCK?(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())};Blockly.FieldColour.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:Blockly.utils.colour.parse(a)}; +Blockly.FieldColour.prototype.initView=function(){this.size_=new Blockly.utils.Size(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT);this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.clickTarget_=this.sourceBlock_.getSvgRoot():(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")}; +Blockly.FieldColour.prototype.applyColour=function(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())};Blockly.FieldColour.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:Blockly.utils.colour.parse(a)}; Blockly.FieldColour.prototype.doValueUpdate_=function(a){this.value_=a;this.borderRect_?this.borderRect_.style.fill=a:this.sourceBlock_&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",a),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))};Blockly.FieldColour.prototype.getText=function(){var a=this.value_;/^#(.)\1(.)\2(.)\3$/.test(a)&&(a="#"+a[1]+a[3]+a[5]);return a};Blockly.FieldColour.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "); Blockly.FieldColour.TITLES=[];Blockly.FieldColour.COLUMNS=7;Blockly.FieldColour.prototype.setColours=function(a,b){this.colours_=a;b&&(this.titles_=b);return this};Blockly.FieldColour.prototype.setColumns=function(a){this.columns_=a;return this};Blockly.FieldColour.prototype.showEditor_=function(){this.picker_=this.dropdownCreate_();Blockly.DropDownDiv.getContentDiv().appendChild(this.picker_);Blockly.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.picker_.focus({preventScroll:!0})}; Blockly.FieldColour.prototype.onClick_=function(a){a=(a=a.target)&&a.label;null!==a&&(this.setValue(a),Blockly.DropDownDiv.hideIfOwner(this))}; @@ -904,11 +1031,11 @@ this.onKeyDownWrapper_=null);this.highlightedIndex_=this.picker_=null}; Blockly.Css.register([".blocklyColourTable {","border-collapse: collapse;","display: block;","outline: none;","padding: 1px;","}",".blocklyColourTable>tr>td {","border: .5px solid #888;","box-sizing: border-box;","cursor: pointer;","display: inline-block;","height: 20px;","padding: 0;","width: 20px;","}",".blocklyColourTable>tr>td.blocklyColourHighlighted {","border-color: #eee;","box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);","position: relative;","}",".blocklyColourSelected, .blocklyColourSelected:hover {", "border-color: #eee !important;","outline: 1px solid #333;","position: relative;","}"]);Blockly.fieldRegistry.register("field_colour",Blockly.FieldColour);Blockly.FieldDropdown=function(a,b,c){"function"!=typeof a&&Blockly.FieldDropdown.validateOptions_(a);this.menuGenerator_=a;this.generatedOptions_=null;this.trimOptions_();this.selectedOption_=this.getOptions(!1)[0];Blockly.FieldDropdown.superClass_.constructor.call(this,this.selectedOption_[1],b,c);this.svgArrow_=this.arrow_=this.imageElement_=this.menu_=this.selectedMenuItem_=null};Blockly.utils.object.inherits(Blockly.FieldDropdown,Blockly.Field); Blockly.FieldDropdown.fromJson=function(a){return new Blockly.FieldDropdown(a.options,void 0,a)};Blockly.FieldDropdown.prototype.SERIALIZABLE=!0;Blockly.FieldDropdown.CHECKMARK_OVERHANG=25;Blockly.FieldDropdown.MAX_MENU_HEIGHT_VH=.45;Blockly.FieldDropdown.IMAGE_Y_OFFSET=5;Blockly.FieldDropdown.IMAGE_Y_PADDING=2*Blockly.FieldDropdown.IMAGE_Y_OFFSET;Blockly.FieldDropdown.ARROW_CHAR=Blockly.utils.userAgent.ANDROID?"\u25bc":"\u25be";Blockly.FieldDropdown.prototype.CURSOR="default"; -Blockly.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=Blockly.utils.dom.createSvgElement("image",{},this.fieldGroup_);this.constants_.FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&Blockly.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")}; -Blockly.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.constants_.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.constants_.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()}; +Blockly.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=Blockly.utils.dom.createSvgElement("image",{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&Blockly.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")}; +Blockly.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()}; Blockly.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=Blockly.utils.dom.createSvgElement("tspan",{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?Blockly.FieldDropdown.ARROW_CHAR+" ":" "+Blockly.FieldDropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)}; -Blockly.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=Blockly.utils.dom.createSvgElement("image",{height:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.constants_.FIELD_DROPDOWN_SVG_ARROW_DATAURI)}; -Blockly.FieldDropdown.prototype.showEditor_=function(a){this.menu_=this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new Blockly.utils.Coordinate(a.clientX,a.clientY):null;this.menu_.render(Blockly.DropDownDiv.getContentDiv());Blockly.utils.dom.addClass(this.menu_.getElement(),"blocklyDropdownMenu");if(this.constants_.FIELD_DROPDOWN_COLOURED_DIV){a=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()? +Blockly.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=Blockly.utils.dom.createSvgElement("image",{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}; +Blockly.FieldDropdown.prototype.showEditor_=function(a){this.menu_=this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new Blockly.utils.Coordinate(a.clientX,a.clientY):null;this.menu_.render(Blockly.DropDownDiv.getContentDiv());Blockly.utils.dom.addClass(this.menu_.getElement(),"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()? this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;Blockly.DropDownDiv.setColour(a,b)}Blockly.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&Blockly.utils.style.scrollIntoContainerView(this.selectedMenuItem_.getElement(),this.menu_.getElement());this.applyColour()}; Blockly.FieldDropdown.prototype.dropdownCreate_=function(){var a=new Blockly.Menu;a.setRightToLeft(this.sourceBlock_.RTL);a.setRole(Blockly.utils.aria.Role.LISTBOX);var b=this.getOptions(!1);this.selectedMenuItem_=null;for(var c=0;c=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1;this.altText_="";Blockly.FieldImage.superClass_.constructor.call(this, +Blockly.FieldDropdown.prototype.onBlocklyAction=function(a){if(this.menu_){if(a===Blockly.navigation.ACTION_PREVIOUS)return this.menu_.highlightPrevious(),!0;if(a===Blockly.navigation.ACTION_NEXT)return this.menu_.highlightNext(),!0}return Blockly.FieldDropdown.superClass_.onBlocklyAction.call(this,a)};Blockly.fieldRegistry.register("field_dropdown",Blockly.FieldDropdown);Blockly.FieldLabelSerializable=function(a,b,c){Blockly.FieldLabelSerializable.superClass_.constructor.call(this,a,b,c)};Blockly.utils.object.inherits(Blockly.FieldLabelSerializable,Blockly.FieldLabel);Blockly.FieldLabelSerializable.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldLabelSerializable(b,void 0,a)};Blockly.FieldLabelSerializable.prototype.EDITABLE=!1;Blockly.FieldLabelSerializable.prototype.SERIALIZABLE=!0; +Blockly.fieldRegistry.register("field_label_serializable",Blockly.FieldLabelSerializable);Blockly.FieldImage=function(a,b,c,d,e,f,g){if(!a)throw Error("Src value of an image field is required");a=Blockly.utils.replaceMessageReferences(a);c=Number(Blockly.utils.replaceMessageReferences(c));b=Number(Blockly.utils.replaceMessageReferences(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers.");if(0>=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1;this.altText_="";Blockly.FieldImage.superClass_.constructor.call(this, a||"",null,g);g||(this.flipRtl_=!!f,this.altText_=Blockly.utils.replaceMessageReferences(d)||"");this.size_=new Blockly.utils.Size(b,c+Blockly.FieldImage.Y_PADDING);this.imageHeight_=c;this.clickHandler_=null;"function"==typeof e&&(this.clickHandler_=e);this.imageElement_=null};Blockly.utils.object.inherits(Blockly.FieldImage,Blockly.Field);Blockly.FieldImage.fromJson=function(a){return new Blockly.FieldImage(a.src,a.width,a.height,void 0,void 0,void 0,a)};Blockly.FieldImage.Y_PADDING=1; Blockly.FieldImage.prototype.EDITABLE=!1;Blockly.FieldImage.prototype.isDirty_=!1;Blockly.FieldImage.prototype.configure_=function(a){Blockly.FieldImage.superClass_.configure_.call(this,a);this.flipRtl_=!!a.flipRtl;this.altText_=Blockly.utils.replaceMessageReferences(a.alt)||""}; -Blockly.FieldImage.prototype.initView=function(){this.imageElement_=Blockly.utils.dom.createSvgElement("image",{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_);this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.value_);this.clickHandler_&&(this.imageElement_.style.cursor="pointer")};Blockly.FieldImage.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:a}; -Blockly.FieldImage.prototype.doValueUpdate_=function(a){this.value_=a;this.imageElement_&&this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",String(this.value_))};Blockly.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_};Blockly.FieldImage.prototype.setAlt=function(a){a!=this.altText_&&(this.altText_=a||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))};Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)}; -Blockly.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};Blockly.FieldImage.prototype.getText_=function(){return this.altText_};Blockly.fieldRegistry.register("field_image",Blockly.FieldImage);Blockly.FieldLabelSerializable=function(a,b,c){Blockly.FieldLabelSerializable.superClass_.constructor.call(this,a,b,c)};Blockly.utils.object.inherits(Blockly.FieldLabelSerializable,Blockly.FieldLabel);Blockly.FieldLabelSerializable.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldLabelSerializable(b,void 0,a)};Blockly.FieldLabelSerializable.prototype.EDITABLE=!1;Blockly.FieldLabelSerializable.prototype.SERIALIZABLE=!0; -Blockly.fieldRegistry.register("field_label_serializable",Blockly.FieldLabelSerializable);Blockly.FieldMultilineInput=function(a,b,c){null==a&&(a="");Blockly.FieldMultilineInput.superClass_.constructor.call(this,a,b,c);this.textGroup_=null};Blockly.utils.object.inherits(Blockly.FieldMultilineInput,Blockly.FieldTextInput);Blockly.FieldMultilineInput.LINE_HEIGHT=20;Blockly.FieldMultilineInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldMultilineInput(b,void 0,a)}; +Blockly.FieldImage.prototype.initView=function(){this.imageElement_=Blockly.utils.dom.createSvgElement("image",{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_);this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.value_);this.clickHandler_&&(this.imageElement_.style.cursor="pointer")};Blockly.FieldImage.prototype.updateSize_=function(){}; +Blockly.FieldImage.prototype.doClassValidation_=function(a){return"string"!=typeof a?null:a};Blockly.FieldImage.prototype.doValueUpdate_=function(a){this.value_=a;this.imageElement_&&this.imageElement_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",String(this.value_))};Blockly.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_};Blockly.FieldImage.prototype.setAlt=function(a){a!=this.altText_&&(this.altText_=a||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))}; +Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)};Blockly.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};Blockly.FieldImage.prototype.getText_=function(){return this.altText_};Blockly.fieldRegistry.register("field_image",Blockly.FieldImage);Blockly.FieldMultilineInput=function(a,b,c){null==a&&(a="");Blockly.FieldMultilineInput.superClass_.constructor.call(this,a,b,c);this.textGroup_=null};Blockly.utils.object.inherits(Blockly.FieldMultilineInput,Blockly.FieldTextInput);Blockly.FieldMultilineInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldMultilineInput(b,void 0,a)}; Blockly.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_();this.textGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyEditableText"},this.fieldGroup_)}; Blockly.FieldMultilineInput.prototype.getDisplayText_=function(){var a=this.value_;if(!a)return Blockly.Field.NBSP;var b=a.split("\n");a="";for(var c=0;cthis.maxDisplayLength&&(d=d.substring(0,this.maxDisplayLength-4)+"...");d=d.replace(/\s/g,Blockly.Field.NBSP);a+=d;c!==b.length-1&&(a+="\n")}this.sourceBlock_.RTL&&(a+="\u200f");return a}; -Blockly.FieldMultilineInput.prototype.render_=function(){for(var a;a=this.textGroup_.firstChild;)this.textGroup_.removeChild(a);a=this.getDisplayText_().split("\n");for(var b=0,c=0;cb&&(b=e);c+=Blockly.FieldMultilineInput.LINE_HEIGHT}this.borderRect_&&(b+=2*this.constants_.FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",b),this.borderRect_.setAttribute("height",c));this.size_.width=b;this.size_.height=c}; -Blockly.FieldMultilineInput.prototype.resizeEditor_=function(){var a=Blockly.WidgetDiv.DIV,b=this.getScaledBBox();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";b=new Blockly.utils.Coordinate(this.sourceBlock_.RTL?b.right-a.offsetWidth:b.left,b.top);a.style.left=b.x+"px";a.style.top=b.y+"px"}; -Blockly.FieldMultilineInput.prototype.widgetCreate_=function(){var a=Blockly.WidgetDiv.DIV,b=this.workspace_.scale,c=document.createElement("textarea");c.className="blocklyHtmlInput blocklyHtmlTextAreaInput";c.setAttribute("spellcheck",this.spellcheck_);var d=this.constants_.FIELD_TEXT_FONTSIZE*b+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=Blockly.FieldTextInput.BORDERRADIUS*b+"px";d=this.constants_.FIELD_BORDER_RECT_X_PADDING*b;c.style.paddingLeft=d+"px";c.style.width="calc(100% - "+ -d+"px)";c.style.lineHeight=Blockly.FieldMultilineInput.LINE_HEIGHT*b+"px";a.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.untypedDefaultValue_=this.value_;c.oldValue_=null;Blockly.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_();this.bindInputEvents_(c);return c}; +Blockly.FieldMultilineInput.prototype.render_=function(){for(var a;a=this.textGroup_.firstChild;)this.textGroup_.removeChild(a);a=this.getDisplayText_().split("\n");for(var b=0,c=0;cb&&(b=e);c+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.max_&&Blockly.utils.aria.setState(a,Blockly.utils.aria.State.VALUEMAX,this.max_);return a};Blockly.fieldRegistry.register("field_number",Blockly.FieldNumber);Blockly.FieldVariable=function(a,b,c,d,e){this.menuGenerator_=Blockly.FieldVariable.dropdownCreate;this.defaultVariableName=a||"";this.size_=new Blockly.utils.Size(0,0);e&&this.configure_(e);b&&this.setValidator(b);e||this.setTypes_(c,d)};Blockly.utils.object.inherits(Blockly.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.variable);return new Blockly.FieldVariable(b,void 0,void 0,void 0,a)}; Blockly.FieldVariable.prototype.workspace_=null;Blockly.FieldVariable.prototype.SERIALIZABLE=!0;Blockly.FieldVariable.prototype.configure_=function(a){Blockly.FieldVariable.superClass_.configure_.call(this,a);this.setTypes_(a.variableTypes,a.defaultType)};Blockly.FieldVariable.prototype.initModel=function(){if(!this.variable_){var a=Blockly.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(a.getId())}}; -Blockly.FieldVariable.prototype.shouldAddBorderRect_=function(){return Blockly.FieldVariable.superClass_.shouldAddBorderRect_.call(this)&&(!this.constants_.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!=this.sourceBlock_.type)}; +Blockly.FieldVariable.prototype.shouldAddBorderRect_=function(){return Blockly.FieldVariable.superClass_.shouldAddBorderRect_.call(this)&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!=this.sourceBlock_.type)}; Blockly.FieldVariable.prototype.fromXml=function(a){var b=a.getAttribute("id"),c=a.textContent,d=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=Blockly.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,b,c,d);if(null!=d&&d!==b.type)throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(a)+".");this.setValue(b.getId())}; Blockly.FieldVariable.prototype.toXml=function(a){this.initModel();a.id=this.variable_.getId();a.textContent=this.variable_.name;this.variable_.type&&a.setAttribute("variabletype",this.variable_.type);return a};Blockly.FieldVariable.prototype.setSourceBlock=function(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");Blockly.FieldVariable.superClass_.setSourceBlock.call(this,a)}; Blockly.FieldVariable.prototype.getValue=function(){return this.variable_?this.variable_.getId():null};Blockly.FieldVariable.prototype.getText=function(){return this.variable_?this.variable_.name:""};Blockly.FieldVariable.prototype.getVariable=function(){return this.variable_};Blockly.FieldVariable.prototype.getValidator=function(){return this.variable_?this.validator_:null}; Blockly.FieldVariable.prototype.doClassValidation_=function(a){if(null===a)return null;var b=Blockly.Variables.getVariable(this.sourceBlock_.workspace,a);if(!b)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;b=b.type;return this.typeIsAllowed_(b)?a:(console.warn("Variable type doesn't match this field! Type was "+b),null)}; Blockly.FieldVariable.prototype.doValueUpdate_=function(a){this.variable_=Blockly.Variables.getVariable(this.sourceBlock_.workspace,a);Blockly.FieldVariable.superClass_.doValueUpdate_.call(this,a)};Blockly.FieldVariable.prototype.typeIsAllowed_=function(a){var b=this.getVariableTypes_();if(!b)return!0;for(var c=0;c90-b||a>-90-b&&a<-90+b?!0:!1}; -Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,1E9,-1E9,1E9)}; -Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};Blockly.utils.object.inherits(Blockly.VerticalFlyout,Blockly.Flyout); -Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX, -contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))}; -Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_== -Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth+a.absoluteLeft-this.width_,0))}}; -Blockly.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_==Blockly.TOOLBOX_AT_RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d", -d.join(" "))};Blockly.VerticalFlyout.prototype.scrollToStart=function(){this.scrollbar_.set(0)};Blockly.VerticalFlyout.prototype.wheel_=function(a){var b=Blockly.utils.getScrollDeltaPixels(a);if(b.y){var c=this.getMetrics_();b=c.viewTop-c.contentTop+b.y;b=Math.min(b,c.contentHeight-c.viewHeight);b=Math.max(b,0);this.scrollbar_.set(b);Blockly.WidgetDiv.hide()}a.preventDefault();a.stopPropagation()}; -Blockly.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace_.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"==f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"==f.type&&(this.initFlyoutButton_(f.button, -d,c),c+=f.button.height+b[e])};Blockly.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a-b||a<-180+b||a>180-b?!0:!1};Blockly.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E9,1E9,-1E9,b+a.width):new Blockly.utils.Rect(-1E9,1E9,b,1E9)}; -Blockly.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.width_!=a){for(c=0;d=b[c];c++){if(this.RTL){e=d.getRelativeToSurfaceXY().x;var f= -a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d)}if(this.RTL)for(c=0;d=this.buttons_[c];c++)b=d.getPosition().y,d.moveTo(a/this.workspace_.scale-d.width-this.MARGIN-this.tabWidth_,b);this.width_=a;this.position()}};Blockly.Generator=function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")};Blockly.Generator.NAME_TYPE="generated_function";Blockly.Generator.prototype.INFINITE_LOOP_TRAP=null;Blockly.Generator.prototype.STATEMENT_PREFIX=null;Blockly.Generator.prototype.STATEMENT_SUFFIX=null;Blockly.Generator.prototype.INDENT=" ";Blockly.Generator.prototype.COMMENT_WRAP=60;Blockly.Generator.prototype.ORDER_OVERRIDES=[]; -Blockly.Generator.prototype.workspaceToCode=function(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=Blockly.getMainWorkspace());var b=[];this.init(a);a=a.getTopBlocks(!0);for(var c=0,d;d=a[c];c++){var e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX, -d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")};Blockly.Generator.prototype.prefixLines=function(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)};Blockly.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;ca||Math.abs(this.workspaceHeight_-b)>a)this.workspaceWidth_=c,this.workspaceHeight_=b,this.bubble_.setBubbleSize(c+a,b+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height", -this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};Blockly.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDeleteAreas()}; -Blockly.Mutator.prototype.setVisible=function(a){if(a!=this.isVisible())if(Blockly.Events.fire(new Blockly.Events.Ui(this.block_,"mutatorOpen",!a,a)),a){this.bubble_=new Blockly.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));var b=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();b&&(a.init(this.workspace_),a.show(b.childNodes)); -this.rootBlock_=this.block_.decompose(this.workspace_);b=this.rootBlock_.getDescendants(!1);for(var c=0,d;d=b[c];c++)d.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(b=2*a.CORNER_RADIUS,a=a.getWidth()+b):a=b=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,b);if(this.block_.saveConnections){var e=this,f=this.block_;f.saveConnections(this.rootBlock_);this.sourceListener_=function(){f.saveConnections(e.rootBlock_)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(); -this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),this.sourceListener_=null)}; -Blockly.Mutator.prototype.workspaceChanged_=function(a){if(a.type!=Blockly.Events.UI&&(a.type!=Blockly.Events.CHANGE||"disabled"!=a.element)){if(!this.workspace_.isDragging()){a=this.workspace_.getTopBlocks(!1);for(var b=0,c;c=a[b];b++){var d=c.getRelativeToSurfaceXY(),e=c.getHeightWidth();20>d.y+e.height&&c.moveBy(0,20-e.height-d.y)}}if(this.rootBlock_.workspace==this.workspace_){Blockly.Events.setGroup(!0);c=this.block_;a=(a=c.mutationToDom())&&Blockly.Xml.domToText(a);c.compose(this.rootBlock_); -c.initSvg();c.render();Blockly.getMainWorkspace().keyboardAccessibilityMode&&Blockly.navigation.moveCursorOnBlockMutation(c);b=(b=c.mutationToDom())&&Blockly.Xml.domToText(b);if(a!=b){Blockly.Events.fire(new Blockly.Events.BlockChange(c,"mutation",null,a,b));var f=Blockly.Events.getGroup();setTimeout(function(){Blockly.Events.setGroup(f);c.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_();Blockly.Events.setGroup(!1)}}}; -Blockly.Mutator.prototype.getFlyoutMetrics_=function(){return{viewHeight:this.workspaceHeight_,viewWidth:this.workspaceWidth_-this.workspace_.getFlyout().getWidth(),absoluteTop:0,absoluteLeft:this.workspace_.RTL?0:this.workspace_.getFlyout().getWidth()}};Blockly.Mutator.prototype.dispose=function(){this.block_.mutator=null;Blockly.Icon.prototype.dispose.call(this)}; -Blockly.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0;crect,",a+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text {","fill: #000;", -"}",a+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",a+" .blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {", -"display: none;","}"]};Blockly.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608}; +Blockly.blockRendering.ConstantProvider.prototype.createDom=function(a,b,c){this.injectCSS_(b,c);a=Blockly.utils.dom.createSvgElement("defs",{},a);b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyEmbossFilter"+this.randomIdentifier},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},b);c=Blockly.utils.dom.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white", +result:"specOut"},b);Blockly.utils.dom.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},c);Blockly.utils.dom.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},b);this.embossFilterId=b.id;this.embossFilter_=b;b=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse", +width:10,height:10},a);Blockly.utils.dom.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},b);Blockly.utils.dom.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},b);this.disabledPatternId=b.id;this.disabledPattern_=b;Blockly.blockRendering.Debug&&(a=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a),b=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"},a),Blockly.utils.dom.createSvgElement("feFuncA", +{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b),Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},a),Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a),this.debugFilterId=a.id,this.debugFilter_=a)}; +Blockly.blockRendering.ConstantProvider.prototype.injectCSS_=function(a,b){b=this.getCSS_(b);a="blockly-renderer-style-"+a;this.cssNode_=document.getElementById(a);var c=b.join("\n");this.cssNode_?this.cssNode_.firstChild.textContent=c:(b=document.createElement("style"),b.id=a,a=document.createTextNode(c),b.appendChild(a),document.head.insertBefore(b,document.head.firstChild),this.cssNode_=b)}; +Blockly.blockRendering.ConstantProvider.prototype.getCSS_=function(a){return[a+" .blocklyText, ",a+" .blocklyFlyoutLabelText {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-size: "+this.FIELD_TEXT_FONTSIZE+"pt;","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklyText {","fill: #fff;","}",a+" .blocklyNonEditableText>rect,",a+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text {", +"fill: #000;","}",a+" .blocklyFlyoutLabelText {","fill: #000;","}",a+" .blocklyText.blocklyBubbleText {","fill: #000;","}",a+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",a+" .blocklyReplaceable .blocklyPath {", +"fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none","}"]};Blockly.blockRendering.MarkerSvg=function(a,b,c){this.workspace_=a;this.marker_=c;this.parent_=null;this.constants_=b;this.currentMarkerSvg=null;a=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=c.colour||a};Blockly.blockRendering.MarkerSvg.CURSOR_CLASS="blocklyCursor";Blockly.blockRendering.MarkerSvg.MARKER_CLASS="blocklyMarker";Blockly.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER=.75;Blockly.blockRendering.MarkerSvg.prototype.getSvgRoot=function(){return this.svgGroup_}; +Blockly.blockRendering.MarkerSvg.prototype.isCursor=function(){return"cursor"==this.marker_.type};Blockly.blockRendering.MarkerSvg.prototype.createDom=function(){var a=this.isCursor()?Blockly.blockRendering.MarkerSvg.CURSOR_CLASS:Blockly.blockRendering.MarkerSvg.MARKER_CLASS;this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":a},null);this.createDomInternal_();this.applyColour_();return this.svgGroup_}; +Blockly.blockRendering.MarkerSvg.prototype.setParent_=function(a){this.isCursor()?(this.parent_&&this.parent_.setCursorSvg(null),a.setCursorSvg(this.getSvgRoot())):(this.parent_&&this.parent_.setMarkerSvg(null),a.setMarkerSvg(this.getSvgRoot()));this.parent_=a}; +Blockly.blockRendering.MarkerSvg.prototype.showWithBlockPrevOutput_=function(a){if(a){var b=a.width,c=a.height,d=c*Blockly.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER,e=this.constants_.CURSOR_BLOCK_PADDING;if(a.previousConnection){var f=this.constants_.shapeFor(a.previousConnection);this.positionPrevious_(b,e,d,f)}else a.outputConnection?(f=this.constants_.shapeFor(a.outputConnection),this.positionOutput_(b,c,f)):this.positionBlock_(b,e,d);this.setParent_(a);this.showCurrent_()}}; +Blockly.blockRendering.MarkerSvg.prototype.showWithCoordinates_=function(a){var b=a.getWsCoordinate();a=b.x;b=b.y;this.workspace_.RTL&&(a-=this.constants_.CURSOR_WS_WIDTH);this.positionLine_(a,b,this.constants_.CURSOR_WS_WIDTH);this.setParent_(this.workspace_);this.showCurrent_()};Blockly.blockRendering.MarkerSvg.prototype.showWithField_=function(a){a=a.getLocation();var b=a.getSize().width,c=a.getSize().height;this.positionRect_(0,0,b,c);this.setParent_(a);this.showCurrent_()}; +Blockly.blockRendering.MarkerSvg.prototype.showWithInput_=function(a){a=a.getLocation();var b=a.getSourceBlock();this.positionInput_(a);this.setParent_(b);this.showCurrent_()};Blockly.blockRendering.MarkerSvg.prototype.showWithNext_=function(a){var b=a.getLocation();a=b.getSourceBlock();var c=0;b=b.getOffsetInBlock().y;var d=a.getHeightWidth().width;this.workspace_.RTL&&(c=-d);this.positionLine_(c,b,d);this.setParent_(a);this.showCurrent_()}; +Blockly.blockRendering.MarkerSvg.prototype.showWithStack_=function(a){a=a.getLocation();var b=a.getHeightWidth(),c=b.width+this.constants_.CURSOR_STACK_PADDING;b=b.height+this.constants_.CURSOR_STACK_PADDING;var d=-this.constants_.CURSOR_STACK_PADDING/2,e=-this.constants_.CURSOR_STACK_PADDING/2,f=d;this.workspace_.RTL&&(f=-(c+d));this.positionRect_(f,e,c,b);this.setParent_(a);this.showCurrent_()}; +Blockly.blockRendering.MarkerSvg.prototype.showCurrent_=function(){this.hide();this.currentMarkerSvg.style.display=""};Blockly.blockRendering.MarkerSvg.prototype.positionBlock_=function(a,b,c){a=Blockly.utils.svgPaths.moveBy(-b,c)+Blockly.utils.svgPaths.lineOnAxis("V",-b)+Blockly.utils.svgPaths.lineOnAxis("H",a+2*b)+Blockly.utils.svgPaths.lineOnAxis("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; +Blockly.blockRendering.MarkerSvg.prototype.positionInput_=function(a){var b=a.getOffsetInBlock().x,c=a.getOffsetInBlock().y;a=Blockly.utils.svgPaths.moveTo(0,0)+this.constants_.shapeFor(a).pathDown;this.markerInput_.setAttribute("d",a);this.markerInput_.setAttribute("transform","translate("+b+","+c+")"+(this.workspace_.RTL?" scale(-1 1)":""));this.currentMarkerSvg=this.markerInput_}; +Blockly.blockRendering.MarkerSvg.prototype.positionLine_=function(a,b,c){this.markerSvgLine_.setAttribute("x",a);this.markerSvgLine_.setAttribute("y",b);this.markerSvgLine_.setAttribute("width",c);this.currentMarkerSvg=this.markerSvgLine_}; +Blockly.blockRendering.MarkerSvg.prototype.positionOutput_=function(a,b,c){a=Blockly.utils.svgPaths.moveBy(a,0)+Blockly.utils.svgPaths.lineOnAxis("h",-(a-c.width))+Blockly.utils.svgPaths.lineOnAxis("v",this.constants_.TAB_OFFSET_FROM_TOP)+c.pathDown+Blockly.utils.svgPaths.lineOnAxis("V",b)+Blockly.utils.svgPaths.lineOnAxis("H",a);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; +Blockly.blockRendering.MarkerSvg.prototype.positionPrevious_=function(a,b,c,d){a=Blockly.utils.svgPaths.moveBy(-b,c)+Blockly.utils.svgPaths.lineOnAxis("V",-b)+Blockly.utils.svgPaths.lineOnAxis("H",this.constants_.NOTCH_OFFSET_LEFT)+d.pathLeft+Blockly.utils.svgPaths.lineOnAxis("H",a+2*b)+Blockly.utils.svgPaths.lineOnAxis("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}; +Blockly.blockRendering.MarkerSvg.prototype.positionRect_=function(a,b,c,d){this.markerSvgRect_.setAttribute("x",a);this.markerSvgRect_.setAttribute("y",b);this.markerSvgRect_.setAttribute("width",c);this.markerSvgRect_.setAttribute("height",d);this.currentMarkerSvg=this.markerSvgRect_};Blockly.blockRendering.MarkerSvg.prototype.flipRtl_=function(a){a.setAttribute("transform","scale(-1 1)")}; +Blockly.blockRendering.MarkerSvg.prototype.hide=function(){this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"}; +Blockly.blockRendering.MarkerSvg.prototype.draw=function(a,b){if(b){this.constants_=this.workspace_.getRenderer().getConstants();var c=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker_.colour||c;this.applyColour_();this.showAtLocation_(b);this.firemarkerEvent_(a,b);a=this.currentMarkerSvg.childNodes[0];void 0!==a&&a.beginElement&&a.beginElement()}else this.hide()}; +Blockly.blockRendering.MarkerSvg.prototype.showAtLocation_=function(a){a.getType()==Blockly.ASTNode.types.BLOCK?(a=a.getLocation(),this.showWithBlockPrevOutput_(a)):a.getType()==Blockly.ASTNode.types.OUTPUT?(a=a.getLocation().getSourceBlock(),this.showWithBlockPrevOutput_(a)):a.getLocation().type==Blockly.INPUT_VALUE?this.showWithInput_(a):a.getLocation().type==Blockly.NEXT_STATEMENT?this.showWithNext_(a):a.getType()==Blockly.ASTNode.types.PREVIOUS?(a=a.getLocation().getSourceBlock(),this.showWithBlockPrevOutput_(a)): +a.getType()==Blockly.ASTNode.types.FIELD?this.showWithField_(a):a.getType()==Blockly.ASTNode.types.WORKSPACE?this.showWithCoordinates_(a):a.getType()==Blockly.ASTNode.types.STACK&&this.showWithStack_(a)};Blockly.blockRendering.MarkerSvg.prototype.firemarkerEvent_=function(a,b){var c=b.getSourceBlock(),d=this.isCursor()?"cursorMove":"markerMove";a=new Blockly.Events.Ui(c,d,a,b);b.getType()==Blockly.ASTNode.types.WORKSPACE&&(a.workspaceId=b.getLocation().id);Blockly.Events.fire(a)}; +Blockly.blockRendering.MarkerSvg.prototype.getBlinkProperties_=function(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}; +Blockly.blockRendering.MarkerSvg.prototype.createDomInternal_=function(){this.markerSvg_=Blockly.utils.dom.createSvgElement("g",{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_);this.markerSvgLine_=Blockly.utils.dom.createSvgElement("rect",{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},this.markerSvg_);this.markerSvgRect_=Blockly.utils.dom.createSvgElement("rect",{"class":"blocklyVerticalMarker",rx:10, +ry:10,style:"display: none"},this.markerSvg_);this.markerInput_=Blockly.utils.dom.createSvgElement("path",{transform:"",style:"display: none"},this.markerSvg_);this.markerBlock_=Blockly.utils.dom.createSvgElement("path",{transform:"",style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();Blockly.utils.dom.createSvgElement("animate",a,this.markerSvgLine_);Blockly.utils.dom.createSvgElement("animate", +a,this.markerInput_);a.attributeName="stroke";Blockly.utils.dom.createSvgElement("animate",a,this.markerBlock_)}return this.markerSvg_}; +Blockly.blockRendering.MarkerSvg.prototype.applyColour_=function(){this.markerSvgLine_.setAttribute("fill",this.colour_);this.markerSvgRect_.setAttribute("stroke",this.colour_);this.markerInput_.setAttribute("fill",this.colour_);this.markerBlock_.setAttribute("stroke",this.colour_);if(this.isCursor()){var a=this.colour_+";transparent;transparent;";this.markerSvgLine_.firstChild.setAttribute("values",a);this.markerInput_.firstChild.setAttribute("values",a);this.markerBlock_.firstChild.setAttribute("values", +a)}};Blockly.blockRendering.MarkerSvg.prototype.dispose=function(){this.svgGroup_&&Blockly.utils.dom.removeNode(this.svgGroup_)};Blockly.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608}; Blockly.blockRendering.Types.LEFT_CORNER=Blockly.blockRendering.Types.LEFT_SQUARE_CORNER|Blockly.blockRendering.Types.LEFT_ROUND_CORNER;Blockly.blockRendering.Types.RIGHT_CORNER=Blockly.blockRendering.Types.RIGHT_SQUARE_CORNER|Blockly.blockRendering.Types.RIGHT_ROUND_CORNER;Blockly.blockRendering.Types.nextTypeValue_=16777216; Blockly.blockRendering.Types.getType=function(a){Blockly.blockRendering.Types.hasOwnProperty(a)||(Blockly.blockRendering.Types[a]=Blockly.blockRendering.Types.nextTypeValue_,Blockly.blockRendering.Types.nextTypeValue_<<=1);return Blockly.blockRendering.Types[a]};Blockly.blockRendering.Types.isField=function(a){return a.type&Blockly.blockRendering.Types.FIELD};Blockly.blockRendering.Types.isHat=function(a){return a.type&Blockly.blockRendering.Types.HAT}; Blockly.blockRendering.Types.isIcon=function(a){return a.type&Blockly.blockRendering.Types.ICON};Blockly.blockRendering.Types.isSpacer=function(a){return a.type&Blockly.blockRendering.Types.SPACER};Blockly.blockRendering.Types.isInRowSpacer=function(a){return a.type&Blockly.blockRendering.Types.IN_ROW_SPACER};Blockly.blockRendering.Types.isInput=function(a){return a.type&Blockly.blockRendering.Types.INPUT};Blockly.blockRendering.Types.isExternalInput=function(a){return a.type&Blockly.blockRendering.Types.EXTERNAL_VALUE_INPUT}; @@ -1074,13 +1152,13 @@ Blockly.blockRendering.Types.isRow=function(a){return a.type&Blockly.blockRender Blockly.blockRendering.Types.isTopOrBottomRow=function(a){return a.type&(Blockly.blockRendering.Types.TOP_ROW|Blockly.blockRendering.Types.BOTTOM_ROW)};Blockly.blockRendering.Types.isInputRow=function(a){return a.type&Blockly.blockRendering.Types.INPUT_ROW};Blockly.blockRendering.Measurable=function(a){this.height=this.width=0;this.type=Blockly.blockRendering.Types.NONE;this.centerline=this.xPos=0;this.constants_=a;this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT};Blockly.blockRendering.Connection=function(a,b){Blockly.blockRendering.Connection.superClass_.constructor.call(this,a);this.connectionModel=b;this.shape=this.constants_.shapeFor(b);this.isDynamicShape=!!this.shape.isDynamic;this.type|=Blockly.blockRendering.Types.CONNECTION};Blockly.utils.object.inherits(Blockly.blockRendering.Connection,Blockly.blockRendering.Measurable); Blockly.blockRendering.OutputConnection=function(a,b){Blockly.blockRendering.OutputConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.OUTPUT_CONNECTION;this.height=this.isDynamicShape?0:this.shape.height;this.startX=this.width=this.isDynamicShape?0:this.shape.width;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=0};Blockly.utils.object.inherits(Blockly.blockRendering.OutputConnection,Blockly.blockRendering.Connection); Blockly.blockRendering.PreviousConnection=function(a,b){Blockly.blockRendering.PreviousConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.PREVIOUS_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.PreviousConnection,Blockly.blockRendering.Connection); -Blockly.blockRendering.NextConnection=function(a,b){Blockly.blockRendering.NextConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.NextConnection,Blockly.blockRendering.Connection);Blockly.blockRendering.InputConnection=function(a,b){Blockly.blockRendering.InputConnection.superClass_.constructor.call(this,a,b.connection);this.type|=Blockly.blockRendering.Types.INPUT;this.input=b;this.align=b.align;if(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null){var c=this.connectedBlock.getHeightWidth();this.connectedBlockWidth=c.width;this.connectedBlockHeight=c.height}else this.connectedBlockHeight=this.connectedBlockWidth=0;this.connectionOffsetY= -this.connectionOffsetX=0};Blockly.utils.object.inherits(Blockly.blockRendering.InputConnection,Blockly.blockRendering.Connection); +Blockly.blockRendering.NextConnection=function(a,b){Blockly.blockRendering.NextConnection.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.NextConnection,Blockly.blockRendering.Connection);Blockly.blockRendering.InputConnection=function(a,b){Blockly.blockRendering.InputConnection.superClass_.constructor.call(this,a,b.connection);this.type|=Blockly.blockRendering.Types.INPUT;this.input=b;this.align=b.align;(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null)?(a=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=a.width,this.connectedBlockHeight=a.height):this.connectedBlockHeight=this.connectedBlockWidth=0;this.connectionOffsetY=this.connectionOffsetX= +0};Blockly.utils.object.inherits(Blockly.blockRendering.InputConnection,Blockly.blockRendering.Connection); Blockly.blockRendering.InlineInput=function(a,b){Blockly.blockRendering.InlineInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.INLINE_INPUT;this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING);this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):this.shape.height;this.connectionWidth=this.isDynamicShape? this.shape.width(this.height):this.shape.width;this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1));this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0};Blockly.utils.object.inherits(Blockly.blockRendering.InlineInput,Blockly.blockRendering.InputConnection); Blockly.blockRendering.StatementInput=function(a,b){Blockly.blockRendering.StatementInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.STATEMENT_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT;this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.StatementInput,Blockly.blockRendering.InputConnection); Blockly.blockRendering.ExternalValueInput=function(a,b){Blockly.blockRendering.ExternalValueInput.superClass_.constructor.call(this,a,b);this.type|=Blockly.blockRendering.Types.EXTERNAL_VALUE_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height;this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionHeight=this.shape.height; -this.connectionWidth=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.ExternalValueInput,Blockly.blockRendering.InputConnection);Blockly.blockRendering.Icon=function(a,b){Blockly.blockRendering.Icon.superClass_.constructor.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=Blockly.blockRendering.Types.ICON;var c=b.getCorrectedSize();this.height=c.height;this.width=c.width};Blockly.utils.object.inherits(Blockly.blockRendering.Icon,Blockly.blockRendering.Measurable); +this.connectionWidth=this.shape.width};Blockly.utils.object.inherits(Blockly.blockRendering.ExternalValueInput,Blockly.blockRendering.InputConnection);Blockly.blockRendering.Icon=function(a,b){Blockly.blockRendering.Icon.superClass_.constructor.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=Blockly.blockRendering.Types.ICON;a=b.getCorrectedSize();this.height=a.height;this.width=a.width};Blockly.utils.object.inherits(Blockly.blockRendering.Icon,Blockly.blockRendering.Measurable); Blockly.blockRendering.JaggedEdge=function(a){Blockly.blockRendering.JaggedEdge.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.JAGGED_EDGE;this.height=this.constants_.JAGGED_TEETH.height;this.width=this.constants_.JAGGED_TEETH.width};Blockly.utils.object.inherits(Blockly.blockRendering.JaggedEdge,Blockly.blockRendering.Measurable); Blockly.blockRendering.Field=function(a,b,c){Blockly.blockRendering.Field.superClass_.constructor.call(this,a);this.field=b;this.isEditable=b.EDITABLE;this.flipRtl=b.getFlipRtl();this.type|=Blockly.blockRendering.Types.FIELD;a=this.field.getSize();this.height=a.height;this.width=a.width;this.parentInput=c};Blockly.utils.object.inherits(Blockly.blockRendering.Field,Blockly.blockRendering.Measurable); Blockly.blockRendering.Hat=function(a){Blockly.blockRendering.Hat.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.HAT;this.height=this.constants_.START_HAT.height;this.width=this.constants_.START_HAT.width;this.ascenderHeight=this.height};Blockly.utils.object.inherits(Blockly.blockRendering.Hat,Blockly.blockRendering.Measurable); @@ -1115,15 +1193,14 @@ b.elements.push(new Blockly.blockRendering.InRowSpacer(this.constants_,this.getI Blockly.blockRendering.RenderInfo.prototype.getInRowSpacing_=function(a,b){if(!a&&b&&Blockly.blockRendering.Types.isStatementInput(b))return this.constants_.STATEMENT_INPUT_PADDING_LEFT;if(a&&Blockly.blockRendering.Types.isInput(a)&&!b){if(Blockly.blockRendering.Types.isExternalInput(a))return this.constants_.NO_PADDING;if(Blockly.blockRendering.Types.isInlineInput(a))return this.constants_.LARGE_PADDING;if(Blockly.blockRendering.Types.isStatementInput(a))return this.constants_.NO_PADDING}return a&& Blockly.blockRendering.Types.isLeftSquareCorner(a)&&b&&(Blockly.blockRendering.Types.isPreviousConnection(b)||Blockly.blockRendering.Types.isNextConnection(b))?b.notchOffset:a&&Blockly.blockRendering.Types.isLeftRoundedCorner(a)&&b&&(Blockly.blockRendering.Types.isPreviousConnection(b)||Blockly.blockRendering.Types.isNextConnection(b))?b.notchOffset-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING}; Blockly.blockRendering.RenderInfo.prototype.computeBounds_=function(){for(var a=0,b=0,c=0,d=0,e;e=this.rows[d];d++){e.measure();b=Math.max(b,e.width);if(e.hasStatement){var f=e.getLastInput();a=Math.max(a,e.width-f.width)}c=Math.max(c,e.widthWithConnectedBlocks)}this.statementEdge=a;this.width=b;for(d=0;e=this.rows[d];d++)e.hasStatement&&(e.statementEdge=this.statementEdge);this.widthWithChildren=Math.max(b,c);this.outputConnection&&(this.startX=this.outputConnection.width,this.width+=this.outputConnection.width, -this.widthWithChildren+=this.outputConnection.width)};Blockly.blockRendering.RenderInfo.prototype.alignRowElements_=function(){for(var a=0,b;b=this.rows[a];a++)if(b.hasStatement)this.alignStatementRow_(b);else{var c=b.width;c=this.getDesiredRowWidth_(b)-c;0.blocklyPathLight,",a+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none","}"])};Blockly.geras.Highlighter=function(a){this.info_=a;this.inlineSteps_=this.steps_="";this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset_=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_=this.highlightConstants_.NOTCH;this.startPaths_= this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH};Blockly.geras.Highlighter.prototype.getPath=function(){return this.steps_+"\n"+this.inlineSteps_}; Blockly.geras.Highlighter.prototype.drawTopCorner=function(a){this.steps_+=Blockly.utils.svgPaths.moveBy(a.xPos,this.info_.startY);for(var b=0,c;c=a.elements[b];b++)Blockly.blockRendering.Types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:Blockly.blockRendering.Types.isLeftRoundedCorner(c)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Blockly.blockRendering.Types.isPreviousConnection(c)?this.steps_+=this.notchPaths_.pathLeft:Blockly.blockRendering.Types.isHat(c)? -this.steps_+=this.startPaths_.path(this.RTL_):Blockly.blockRendering.Types.isSpacer(c)&&0!=c.width&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",c.xPos+c.width-this.highlightOffset_));this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",a.xPos+a.width-this.highlightOffset_)}; -Blockly.geras.Highlighter.prototype.drawJaggedEdge_=function(a){this.info_.RTL&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",a.width-this.highlightOffset_),this.steps_+=this.jaggedTeethPaths_.pathLeft,this.steps_+=Blockly.utils.svgPaths.lineOnAxis("v",a.height-this.jaggedTeethPaths_.height-this.highlightOffset_))}; +this.steps_+=this.startPaths_.path(this.RTL_):Blockly.blockRendering.Types.isSpacer(c)&&0!=c.width&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",c.xPos+c.width-this.highlightOffset_));this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",a.xPos+a.width-this.highlightOffset_)};Blockly.geras.Highlighter.prototype.drawJaggedEdge_=function(a){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+Blockly.utils.svgPaths.lineOnAxis("v",a.height-this.jaggedTeethPaths_.height-this.highlightOffset_))}; Blockly.geras.Highlighter.prototype.drawValueInput=function(a){var b=a.getLastInput();if(this.RTL_){var c=a.height-b.connectionHeight;this.steps_+=Blockly.utils.svgPaths.moveTo(b.xPos+b.width-this.highlightOffset_,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+Blockly.utils.svgPaths.lineOnAxis("v",c)}else this.steps_+=Blockly.utils.svgPaths.moveTo(b.xPos+b.width,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}; Blockly.geras.Highlighter.prototype.drawStatementInput=function(a){var b=a.getLastInput();if(this.RTL_){var c=a.height-2*this.insideCornerPaths_.height;this.steps_+=Blockly.utils.svgPaths.moveTo(b.xPos,a.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+Blockly.utils.svgPaths.lineOnAxis("v",c)+this.insideCornerPaths_.pathBottom(this.RTL_)+Blockly.utils.svgPaths.lineTo(a.width-b.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=Blockly.utils.svgPaths.moveTo(b.xPos,a.yPos+a.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+ Blockly.utils.svgPaths.lineTo(a.width-b.xPos-this.insideCornerPaths_.width,0)};Blockly.geras.Highlighter.prototype.drawRightSideRow=function(a){var b=a.xPos+a.width-this.highlightOffset_;a.followsStatement&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",b));this.RTL_&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("H",b),a.height>this.highlightOffset_&&(this.steps_+=Blockly.utils.svgPaths.lineOnAxis("V",a.yPos+a.height-this.highlightOffset_)))}; @@ -1194,11 +1253,11 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_=function(a,b){if(!a)return b a.isEditable?this.constants_.MEDIUM_PADDING:Blockly.blockRendering.Types.isIcon(a)?2*this.constants_.LARGE_PADDING+1:Blockly.blockRendering.Types.isHat(a)?this.constants_.NO_PADDING:Blockly.blockRendering.Types.isPreviousOrNextConnection(a)?this.constants_.LARGE_PADDING:Blockly.blockRendering.Types.isLeftRoundedCorner(a)?this.constants_.MIN_BLOCK_WIDTH:Blockly.blockRendering.Types.isJaggedEdge(a)?this.constants_.NO_PADDING:this.constants_.LARGE_PADDING;if(Blockly.blockRendering.Types.isInput(a)&& !b){if(Blockly.blockRendering.Types.isExternalInput(a))return this.constants_.NO_PADDING;if(Blockly.blockRendering.Types.isInlineInput(a))return this.constants_.LARGE_PADDING;if(Blockly.blockRendering.Types.isStatementInput(a))return this.constants_.NO_PADDING}if(!Blockly.blockRendering.Types.isInput(a)&&b&&Blockly.blockRendering.Types.isInput(b)){if(Blockly.blockRendering.Types.isField(a)&&a.isEditable){if(Blockly.blockRendering.Types.isInlineInput(b)||Blockly.blockRendering.Types.isExternalInput(b))return this.constants_.SMALL_PADDING}else{if(Blockly.blockRendering.Types.isInlineInput(b)|| Blockly.blockRendering.Types.isExternalInput(b))return this.constants_.MEDIUM_LARGE_PADDING;if(Blockly.blockRendering.Types.isStatementInput(b))return this.constants_.LARGE_PADDING}return this.constants_.LARGE_PADDING-1}if(Blockly.blockRendering.Types.isIcon(a)&&b&&!Blockly.blockRendering.Types.isInput(b))return this.constants_.LARGE_PADDING;if(Blockly.blockRendering.Types.isInlineInput(a)&&b&&Blockly.blockRendering.Types.isField(b))return b.isEditable?this.constants_.MEDIUM_PADDING:this.constants_.LARGE_PADDING; -if(Blockly.blockRendering.Types.isLeftSquareCorner(a)&&b){if(Blockly.blockRendering.Types.isHat(b))return this.constants_.NO_PADDING;if(Blockly.blockRendering.Types.isPreviousConnection(b))return b.notchOffset;if(Blockly.blockRendering.Types.isNextConnection(b)){var c=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2;return b.notchOffset+c}}if(Blockly.blockRendering.Types.isLeftRoundedCorner(a)&&b){if(Blockly.blockRendering.Types.isPreviousConnection(b))return b.notchOffset-this.constants_.CORNER_RADIUS; -if(Blockly.blockRendering.Types.isNextConnection(b))return c=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2,b.notchOffset-this.constants_.CORNER_RADIUS+c}return Blockly.blockRendering.Types.isField(a)&&b&&Blockly.blockRendering.Types.isField(b)&&a.isEditable==b.isEditable||b&&Blockly.blockRendering.Types.isJaggedEdge(b)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}; +if(Blockly.blockRendering.Types.isLeftSquareCorner(a)&&b){if(Blockly.blockRendering.Types.isHat(b))return this.constants_.NO_PADDING;if(Blockly.blockRendering.Types.isPreviousConnection(b))return b.notchOffset;if(Blockly.blockRendering.Types.isNextConnection(b))return a=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2,b.notchOffset+a}if(Blockly.blockRendering.Types.isLeftRoundedCorner(a)&&b){if(Blockly.blockRendering.Types.isPreviousConnection(b))return b.notchOffset-this.constants_.CORNER_RADIUS; +if(Blockly.blockRendering.Types.isNextConnection(b))return a=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2,b.notchOffset-this.constants_.CORNER_RADIUS+a}return Blockly.blockRendering.Types.isField(a)&&b&&Blockly.blockRendering.Types.isField(b)&&a.isEditable==b.isEditable||b&&Blockly.blockRendering.Types.isJaggedEdge(b)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}; Blockly.geras.RenderInfo.prototype.getSpacerRowHeight_=function(a,b){return Blockly.blockRendering.Types.isTopRow(a)&&Blockly.blockRendering.Types.isBottomRow(b)?this.constants_.EMPTY_BLOCK_SPACER_HEIGHT:Blockly.blockRendering.Types.isTopRow(a)||Blockly.blockRendering.Types.isBottomRow(b)?this.constants_.NO_PADDING:a.hasExternalInput&&b.hasExternalInput?this.constants_.LARGE_PADDING:!a.hasStatement&&b.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:a.hasStatement&&b.hasStatement||!a.hasStatement&& b.hasDummyInput||a.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}; -Blockly.geras.RenderInfo.prototype.getElemCenterline_=function(a,b){if(Blockly.blockRendering.Types.isSpacer(b))return a.yPos+b.height/2;if(Blockly.blockRendering.Types.isBottomRow(a)){var c=a.yPos+a.height-a.descenderHeight;return Blockly.blockRendering.Types.isNextConnection(b)?c+b.height/2:c-b.height/2}if(Blockly.blockRendering.Types.isTopRow(a))return Blockly.blockRendering.Types.isHat(b)?a.capline-b.height/2:a.capline+b.height/2;c=a.yPos;Blockly.blockRendering.Types.isField(b)||Blockly.blockRendering.Types.isIcon(b)? +Blockly.geras.RenderInfo.prototype.getElemCenterline_=function(a,b){if(Blockly.blockRendering.Types.isSpacer(b))return a.yPos+b.height/2;if(Blockly.blockRendering.Types.isBottomRow(a))return a=a.yPos+a.height-a.descenderHeight,Blockly.blockRendering.Types.isNextConnection(b)?a+b.height/2:a-b.height/2;if(Blockly.blockRendering.Types.isTopRow(a))return Blockly.blockRendering.Types.isHat(b)?a.capline-b.height/2:a.capline+b.height/2;var c=a.yPos;Blockly.blockRendering.Types.isField(b)||Blockly.blockRendering.Types.isIcon(b)? (c+=b.height/2,(a.hasInlineInput||a.hasStatement)&&b.height+this.constants_.TALL_INPUT_FIELD_OFFSET_Y<=a.height&&(c+=this.constants_.TALL_INPUT_FIELD_OFFSET_Y)):c=Blockly.blockRendering.Types.isInlineInput(b)?c+b.height/2:c+a.height/2;return c}; Blockly.geras.RenderInfo.prototype.alignRowElements_=function(){if(this.isInline){for(var a=0,b=null,c=this.rows.length-1,d;d=this.rows[c];c--)d.nextRightEdge=a,Blockly.blockRendering.Types.isInputRow(d)&&(d.hasStatement&&this.alignStatementRow_(d),b&&b.hasStatement&&d.widthb?b:c;e=e?-1:1;a=(d?-1:1)*a/2;return Blockly.utils.svgPaths.lineTo(-e*c,a)+Blockly.utils.svgPaths.lineTo(e*c,a)}var b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(a){a/=2;return a>b?b:a},height:function(a){return a},connectionOffsetY:function(a){return a/2},connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b, !0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}}; @@ -1260,126 +1322,66 @@ Blockly.zelos.ConstantProvider.prototype.makeNotch=function(){function a(a){retu [Blockly.utils.svgPaths.point(a*e/2,0),Blockly.utils.svgPaths.point(a*e*3/4,-(g/2)),Blockly.utils.svgPaths.point(a*e,-g)])+Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*e,-f)])+Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(a*e/4,-(g/2)),Blockly.utils.svgPaths.point(a*e/2,-g),Blockly.utils.svgPaths.point(a*e,-g)])}var b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}}; Blockly.zelos.ConstantProvider.prototype.makeInsideCorners=function(){var a=this.CORNER_RADIUS,b=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(-a,a)),c=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(-a,a)),d=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(a,a)),e=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(a,a));return{width:a,height:a,pathTop:b,pathBottom:d,rightWidth:a,rightHeight:a,pathTopRight:c,pathBottomRight:e}}; Blockly.zelos.ConstantProvider.prototype.generateSecondaryColour_=function(a){return Blockly.utils.colour.blend("#000",a,.15)||a};Blockly.zelos.ConstantProvider.prototype.generateTertiaryColour_=function(a){return Blockly.utils.colour.blend("#000",a,.25)||a}; -Blockly.zelos.ConstantProvider.prototype.createDom=function(a){Blockly.zelos.ConstantProvider.superClass_.createDom.call(this,a);a=Blockly.utils.dom.createSvgElement("defs",{},a);var b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklySelectedGlowFilter"+this.randomIdentifier_,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:.5},b);var c=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"}, -b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#fff200","flood-opacity":1,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.selectedGlowFilterId=b.id;this.selectedGlowFilter_=b;a=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyReplacementGlowFilter"+this.randomIdentifier_, -height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:2},a);b=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"},a);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":"#fff200","flood-opacity":1,result:"outColor"},a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor", -in2:"outBlur",operator:"in",result:"outGlow"},a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"outGlow",operator:"over"},a);this.replacementGlowFilterId=a.id;this.replacementGlowFilter_=a}; -Blockly.zelos.ConstantProvider.prototype.getCSS_=function(a){a="."+a+"-renderer";return[a+" .blocklyText {","fill: #fff;","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-size: "+this.FIELD_TEXT_FONTSIZE+"pt;","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklyNonEditableText>rect:not(.blocklyDropdownRect),",a+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text,",a+ -" .blocklyNonEditableText>g>text,",a+" .blocklyEditableText>g>text {","fill: #575E75;","}",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect ,",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",a+" .blocklyDropdownText {","fill: #fff !important;", -"}",a+".blocklyWidgetDiv .goog-menuitem,",a+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",a+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fff200;","}",a+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier_+")","}"]};Blockly.zelos.TopRow=function(a){Blockly.zelos.TopRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.TopRow,Blockly.blockRendering.TopRow);Blockly.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b};Blockly.zelos.TopRow.prototype.hasRightSquareCorner=function(a){return!1}; -Blockly.zelos.BottomRow=function(a){Blockly.zelos.BottomRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.BottomRow,Blockly.blockRendering.BottomRow);Blockly.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection};Blockly.zelos.BottomRow.prototype.hasRightSquareCorner=function(a){return!1};Blockly.zelos.RightConnectionShape=function(a){Blockly.zelos.RightConnectionShape.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.getType("RIGHT_CONNECTION");this.width=this.height=0};Blockly.utils.object.inherits(Blockly.zelos.RightConnectionShape,Blockly.blockRendering.Measurable); -Blockly.zelos.StatementInput=function(a,b){Blockly.zelos.StatementInput.superClass_.constructor.call(this,a,b);if(this.connectedBlock){for(var c=this.connectedBlock;c.getNextBlock();)c=c.getNextBlock();c.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}};Blockly.utils.object.inherits(Blockly.zelos.StatementInput,Blockly.blockRendering.StatementInput);Blockly.zelos.RenderInfo=function(a,b){Blockly.zelos.RenderInfo.superClass_.constructor.call(this,a,b);this.topRow=new Blockly.zelos.TopRow(this.constants_);this.bottomRow=new Blockly.zelos.BottomRow(this.constants_);this.isInline=!0;this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=!1;this.rightSide=this.outputConnection?new Blockly.zelos.RightConnectionShape(this.constants_):null};Blockly.utils.object.inherits(Blockly.zelos.RenderInfo,Blockly.blockRendering.RenderInfo); +Blockly.zelos.ConstantProvider.prototype.createDom=function(a,b,c){Blockly.zelos.ConstantProvider.superClass_.createDom.call(this,a,b,c);a=Blockly.utils.dom.createSvgElement("defs",{},a);b=Blockly.utils.dom.createSvgElement("filter",{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},b);c=Blockly.utils.dom.createSvgElement("feComponentTransfer", +{result:"outBlur"},b);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},b);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.selectedGlowFilterId=b.id;this.selectedGlowFilter_=b;a=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyReplacementGlowFilter"+ +this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},a);b=Blockly.utils.dom.createSvgElement("feComponentTransfer",{result:"outBlur"},a);Blockly.utils.dom.createSvgElement("feFuncA",{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);Blockly.utils.dom.createSvgElement("feFlood",{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"}, +a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);Blockly.utils.dom.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"outGlow",operator:"over"},a);this.replacementGlowFilterId=a.id;this.replacementGlowFilter_=a}; +Blockly.zelos.ConstantProvider.prototype.getCSS_=function(a){return[a+" .blocklyText, ",a+" .blocklyFlyoutLabelText {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-size: "+this.FIELD_TEXT_FONTSIZE+"pt;","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklyText {","fill: #fff;","}",a+" .blocklyNonEditableText>rect:not(.blocklyDropdownRect),",a+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",a+" .blocklyNonEditableText>text,", +a+" .blocklyEditableText>text,",a+" .blocklyNonEditableText>g>text,",a+" .blocklyEditableText>g>text {","fill: #575E75;","}",a+" .blocklyFlyoutLabelText {","fill: #575E75;","}",a+" .blocklyText.blocklyBubbleText {","fill: #575E75;","}",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect ,",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+ +this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",a+" .blocklyDropdownText {","fill: #fff !important;","}",a+".blocklyWidgetDiv .goog-menuitem,",a+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",a+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",a+" .blocklyHighlightedConnectionPath {","stroke: "+this.SELECTED_GLOW_COLOUR+";","}",a+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+ +this.randomIdentifier+")","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none","}"]};Blockly.zelos.TopRow=function(a){Blockly.zelos.TopRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.TopRow,Blockly.blockRendering.TopRow);Blockly.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b}; +Blockly.zelos.TopRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection};Blockly.zelos.BottomRow=function(a){Blockly.zelos.BottomRow.superClass_.constructor.call(this,a)};Blockly.utils.object.inherits(Blockly.zelos.BottomRow,Blockly.blockRendering.BottomRow);Blockly.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1};Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection}; +Blockly.zelos.BottomRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection};Blockly.zelos.RightConnectionShape=function(a){Blockly.zelos.RightConnectionShape.superClass_.constructor.call(this,a);this.type|=Blockly.blockRendering.Types.getType("RIGHT_CONNECTION");this.width=this.height=0};Blockly.utils.object.inherits(Blockly.zelos.RightConnectionShape,Blockly.blockRendering.Measurable);Blockly.zelos.StatementInput=function(a,b){Blockly.zelos.StatementInput.superClass_.constructor.call(this,a,b);if(this.connectedBlock){for(a=this.connectedBlock;a.getNextBlock();)a=a.getNextBlock();a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}};Blockly.utils.object.inherits(Blockly.zelos.StatementInput,Blockly.blockRendering.StatementInput);Blockly.zelos.RenderInfo=function(a,b){Blockly.zelos.RenderInfo.superClass_.constructor.call(this,a,b);this.topRow=new Blockly.zelos.TopRow(this.constants_);this.bottomRow=new Blockly.zelos.BottomRow(this.constants_);this.isInline=!0;this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!f.precedesStatement;if(Blockly.blockRendering.Types.isInputRow(e)&&e.hasStatement)e.measure(),b=e.width-e.getLastInput().width+a;else if(d&&(2==c||f)&& Blockly.blockRendering.Types.isInputRow(e)&&!e.hasStatement){f=e.xPos;d=null;for(var g=0,h;h=e.elements[g];g++)Blockly.blockRendering.Types.isSpacer(h)&&(d=h),!(d&&(Blockly.blockRendering.Types.isField(h)||Blockly.blockRendering.Types.isInput(h))&&fc?c:this.height/2,b-c*(1-Math.sin(Math.acos((c-this.constants_.SMALL_PADDING)/c)));default:return 0}return Blockly.blockRendering.Types.isInlineInput(a)?(a=a.connectedBlock?a.connectedBlock.pathObject.outputShapeType: -a.shape.type,c==d.SHAPES.HEXAGONAL&&c!=a?0:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][a]):Blockly.blockRendering.Types.isField(a)?c==d.SHAPES.ROUND&&a.field instanceof Blockly.FieldTextInput?b-2.75*d.GRID_UNIT:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][0]:Blockly.blockRendering.Types.isIcon(a)?this.constants_.SMALL_PADDING:0}; +Blockly.zelos.RenderInfo.prototype.finalizeOutputConnection_=function(){if(this.outputConnection&&this.outputConnection.isDynamicShape){for(var a=0,b=0,c;c=this.rows[b];b++)c.yPos=a,a+=c.height;this.height=a;b=this.bottomRow.hasNextConnection?this.height-this.bottomRow.descenderHeight:this.height;a=this.outputConnection.shape.height(b);b=this.outputConnection.shape.width(b);this.outputConnection.height=a;this.outputConnection.width=b;this.outputConnection.startX=b;this.outputConnection.connectionOffsetY= +this.outputConnection.shape.connectionOffsetY(a);this.outputConnection.connectionOffsetX=this.outputConnection.shape.connectionOffsetX(b);c=0;this.hasStatementInput||this.bottomRow.hasNextConnection||(c=b,this.rightSide.height=a,this.rightSide.width=c,this.rightSide.centerline=a/2,this.rightSide.xPos=this.width+c);this.startX=b;this.width+=b+c;this.widthWithChildren+=b+c}}; +Blockly.zelos.RenderInfo.prototype.finalizeHorizontalAlignment_=function(){if(this.outputConnection&&!this.hasStatementInput&&!this.bottomRow.hasNextConnection){for(var a=0,b=0,c;c=this.rows[b];b++)if(Blockly.blockRendering.Types.isInputRow(c)){a=c.elements[c.elements.length-2];var d=this.getNegativeSpacing_(c.elements[1]),e=this.getNegativeSpacing_(a);a=d+e;var f=this.constants_.MIN_BLOCK_WIDTH+2*this.outputConnection.width;this.width-ac?c:this.height/2,b-c*(1-Math.sin(Math.acos((c-this.constants_.SMALL_PADDING)/c)));default:return 0}if(Blockly.blockRendering.Types.isInlineInput(a)){var e=a.connectedBlock;a=e?e.pathObject.outputShapeType: +a.shape.type;return e&&e.outputConnection&&(e.statementInputCount||e.nextConnection)||c==d.SHAPES.HEXAGONAL&&c!=a?0:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][a]}return Blockly.blockRendering.Types.isField(a)?c==d.SHAPES.ROUND&&a.field instanceof Blockly.FieldTextInput?b-2.75*d.GRID_UNIT:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][0]:Blockly.blockRendering.Types.isIcon(a)?this.constants_.SMALL_PADDING:0}; Blockly.zelos.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var a=2;a=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!d.precedesStatement;if(e?this.topRow.hasPreviousConnection:b.followsStatement){var g=3==c.elements.length&&(c.elements[1].field instanceof Blockly.FieldLabel||c.elements[1].field instanceof Blockly.FieldImage);if(!e&&g)b.height-=this.constants_.SMALL_PADDING, d.height-=this.constants_.SMALL_PADDING,c.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!f)b.height+=this.constants_.SMALL_PADDING;else if(f){e=!1;for(f=0;g=c.elements[f];f++)if(Blockly.blockRendering.Types.isInlineInput(g)&&g.connectedBlock&&!g.connectedBlock.isShadow()&&40<=g.connectedBlock.getHeightWidth().height){e=!0;break}e&&(b.height-=this.constants_.SMALL_PADDING,d.height-=this.constants_.SMALL_PADDING)}}}}; -Blockly.zelos.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();Blockly.zelos.RenderInfo.superClass_.finalize_.call(this)};Blockly.zelos.Drawer=function(a,b){Blockly.zelos.Drawer.superClass_.constructor.call(this,a,b)};Blockly.utils.object.inherits(Blockly.zelos.Drawer,Blockly.blockRendering.Drawer); +Blockly.zelos.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();Blockly.zelos.RenderInfo.superClass_.finalize_.call(this);this.rightSide&&(this.widthWithChildren+=this.rightSide.width)};Blockly.zelos.Drawer=function(a,b){Blockly.zelos.Drawer.superClass_.constructor.call(this,a,b)};Blockly.utils.object.inherits(Blockly.zelos.Drawer,Blockly.blockRendering.Drawer); Blockly.zelos.Drawer.prototype.draw=function(){var a=this.block_.pathObject;a.beginDrawing();this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();Blockly.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_);this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);a.endDrawing()}; -Blockly.zelos.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):Blockly.zelos.Drawer.superClass_.drawOutline_.call(this)};Blockly.zelos.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():Blockly.zelos.Drawer.superClass_.drawLeft_.call(this)}; +Blockly.zelos.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):Blockly.zelos.Drawer.superClass_.drawOutline_.call(this)}; +Blockly.zelos.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():Blockly.zelos.Drawer.superClass_.drawLeft_.call(this)}; Blockly.zelos.Drawer.prototype.drawRightSideRow_=function(a){if(!(0>=a.height))if(a.precedesStatement||a.followsStatement){var b=this.constants_.INSIDE_CORNERS.rightHeight;b=a.height-(a.precedesStatement?b:0);this.outlinePath_+=(a.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {", -"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;", -"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {", -"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {", -'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);Blockly.Trashcan=function(a){this.workspace_=a;this.contents_=[];this.flyout=null;if(!(0>=this.workspace_.options.maxTrashcanContents)){a=new Blockly.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex,renderer:this.workspace_.options.renderer});if(this.workspace_.horizontalLayout){a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_TOP?Blockly.TOOLBOX_AT_BOTTOM:Blockly.TOOLBOX_AT_TOP;if(!Blockly.HorizontalFlyout)throw Error("Missing require for Blockly.HorizontalFlyout"); -this.flyout=new Blockly.HorizontalFlyout(a)}else{a.toolboxPosition=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?Blockly.TOOLBOX_AT_LEFT:Blockly.TOOLBOX_AT_RIGHT;if(!Blockly.VerticalFlyout)throw Error("Missing require for Blockly.VerticalFlyout");this.flyout=new Blockly.VerticalFlyout(a)}this.workspace_.addChangeListener(this.onDelete_.bind(this))}};Blockly.Trashcan.prototype.WIDTH_=47;Blockly.Trashcan.prototype.BODY_HEIGHT_=44;Blockly.Trashcan.prototype.LID_HEIGHT_=16; -Blockly.Trashcan.prototype.MARGIN_BOTTOM_=20;Blockly.Trashcan.prototype.MARGIN_SIDE_=20;Blockly.Trashcan.prototype.MARGIN_HOTSPOT_=10;Blockly.Trashcan.prototype.SPRITE_LEFT_=0;Blockly.Trashcan.prototype.SPRITE_TOP_=32;Blockly.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_=.1;Blockly.Trashcan.ANIMATION_LENGTH_=80;Blockly.Trashcan.ANIMATION_FRAMES_=4;Blockly.Trashcan.OPACITY_MIN_=.4;Blockly.Trashcan.OPACITY_MAX_=.8;Blockly.Trashcan.MAX_LID_ANGLE_=45;Blockly.Trashcan.prototype.isOpen=!1; -Blockly.Trashcan.prototype.minOpenness_=0;Blockly.Trashcan.prototype.svgGroup_=null;Blockly.Trashcan.prototype.svgLid_=null;Blockly.Trashcan.prototype.lidTask_=0;Blockly.Trashcan.prototype.lidOpen_=0;Blockly.Trashcan.prototype.left_=0;Blockly.Trashcan.prototype.top_=0; -Blockly.Trashcan.prototype.createDom=function(){this.svgGroup_=Blockly.utils.dom.createSvgElement("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},b);var c=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, -y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup_);c.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);b=Blockly.utils.dom.createSvgElement("clipPath",{id:"blocklyTrashLidClipPath"+a},this.svgGroup_);Blockly.utils.dom.createSvgElement("rect",{width:this.WIDTH_,height:this.LID_HEIGHT_},b);this.svgLid_=Blockly.utils.dom.createSvgElement("image",{width:Blockly.SPRITE.width,x:-this.SPRITE_LEFT_,height:Blockly.SPRITE.height, -y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup_);this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+Blockly.SPRITE.url);Blockly.bindEventWithChecks_(this.svgGroup_,"mouseup",this,this.click);Blockly.bindEvent_(c,"mouseover",this,this.mouseOver_);Blockly.bindEvent_(c,"mouseout",this,this.mouseOut_);this.animateLid_();return this.svgGroup_}; -Blockly.Trashcan.prototype.init=function(a){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),Blockly.Trashcan.ANIMATION_LENGTH_/ -a))};Blockly.Trashcan.prototype.setLidAngle_=function(a){var b=this.workspace_.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")};Blockly.Trashcan.prototype.setMinOpenness_=function(a){this.minOpenness_=a;this.isOpen||this.setLidAngle_(a*Blockly.Trashcan.MAX_LID_ANGLE_)};Blockly.Trashcan.prototype.close=function(){this.setOpen(!1)}; -Blockly.Trashcan.prototype.click=function(){if(this.contents_.length){for(var a=[],b=0,c;c=this.contents_[b];b++)a[b]=Blockly.Xml.textToDom(c);this.flyout.show(a)}};Blockly.Trashcan.prototype.mouseOver_=function(){this.contents_.length&&this.setOpen(!0)};Blockly.Trashcan.prototype.mouseOut_=function(){this.setOpen(!1)}; -Blockly.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents)&&a.type==Blockly.Events.BLOCK_DELETE&&"shadow"!=a.oldXml.tagName.toLowerCase()&&(a=this.cleanBlockXML_(a.oldXml),-1==this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_)}}; -Blockly.Trashcan.prototype.cleanBlockXML_=function(a){for(var b=a=a.cloneNode(!0);b;){b.removeAttribute&&(b.removeAttribute("x"),b.removeAttribute("y"),b.removeAttribute("id"),b.removeAttribute("disabled"),"comment"==b.nodeName&&(b.removeAttribute("h"),b.removeAttribute("w"),b.removeAttribute("pinned")));var c=b.firstChild||b.nextSibling;if(!c)for(c=b.parentNode;c;){if(c.nextSibling){c=c.nextSibling;break}c=c.parentNode}b=c}return Blockly.Xml.domToText(a)};Blockly.VariablesDynamic={};Blockly.VariablesDynamic.onCreateVariableButtonClick_String=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"String")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Number=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Number")};Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour=function(a){Blockly.Variables.createVariableButtonHandler(a.getTargetWorkspace(),void 0,"Colour")}; -Blockly.VariablesDynamic.flyoutCategory=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",Blockly.Msg.NEW_COLOUR_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"); -b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",Blockly.VariablesDynamic.onCreateVariableButtonClick_String);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",Blockly.VariablesDynamic.onCreateVariableButtonClick_Number);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",Blockly.VariablesDynamic.onCreateVariableButtonClick_Colour);a=Blockly.VariablesDynamic.flyoutCategoryBlocks(a);return b=b.concat(a)}; -Blockly.VariablesDynamic.flyoutCategoryBlocks=function(a){a=a.getAllVariables();var b=[];if(0image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]);Blockly.Themes.Dark={}; -Blockly.Themes.Dark.defaultBlockStyles={colour_blocks:{colourPrimary:"#a5745b",colourSecondary:"#dbc7bd",colourTertiary:"#845d49"},list_blocks:{colourPrimary:"#745ba5",colourSecondary:"#c7bddb",colourTertiary:"#5d4984"},logic_blocks:{colourPrimary:"#5b80a5",colourSecondary:"#bdccdb",colourTertiary:"#496684"},loop_blocks:{colourPrimary:"#5ba55b",colourSecondary:"#bddbbd",colourTertiary:"#498449"},math_blocks:{colourPrimary:"#5b67a5",colourSecondary:"#bdc2db",colourTertiary:"#495284"},procedure_blocks:{colourPrimary:"#995ba5", -colourSecondary:"#d6bddb",colourTertiary:"#7a4984"},text_blocks:{colourPrimary:"#5ba58c",colourSecondary:"#bddbd1",colourTertiary:"#498470"},variable_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a"},variable_dynamic_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a"},hat_blocks:{colourPrimary:"#a55b99",colourSecondary:"#dbbdd6",colourTertiary:"#84497a",hat:"cap"}}; -Blockly.Themes.Dark.categoryStyles={colour_category:{colour:"#a5745b"},list_category:{colour:"#745ba5"},logic_category:{colour:"#5b80a5"},loop_category:{colour:"#5ba55b"},math_category:{colour:"#5b67a5"},procedure_category:{colour:"#995ba5"},text_category:{colour:"#5ba58c"},variable_category:{colour:"#a55b99"},variable_dynamic_category:{colour:"#a55b99"}};Blockly.Themes.Dark=new Blockly.Theme("dark",Blockly.Themes.Dark.defaultBlockStyles,Blockly.Themes.Dark.categoryStyles); -Blockly.Themes.Dark.setComponentStyle("workspaceBackgroundColour","#1e1e1e");Blockly.Themes.Dark.setComponentStyle("toolboxBackgroundColour","#333");Blockly.Themes.Dark.setComponentStyle("toolboxForegroundColour","#fff");Blockly.Themes.Dark.setComponentStyle("flyoutBackgroundColour","#252526");Blockly.Themes.Dark.setComponentStyle("flyoutForegroundColour","#ccc");Blockly.Themes.Dark.setComponentStyle("flyoutOpacity",1);Blockly.Themes.Dark.setComponentStyle("scrollbarColour","#797979"); -Blockly.Themes.Dark.setComponentStyle("scrollbarOpacity",.4); -(function(){Blockly.Css.register([".dark-theme .blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #2a2d2e;","}",".dark-theme.blocklyWidgetDiv .goog-menu, ",".dark-theme.blocklyDropDownDiv {","background-color: #3c3c3c;","}",".dark-theme.blocklyDropDownDiv {","border-color: #565656;","}",".dark-theme.blocklyWidgetDiv .goog-menuitem-content, ",".dark-theme.blocklyDropDownDiv .goog-menuitem-content {","color: #f0f0f0;","}",".dark-theme.blocklyWidgetDiv .goog-menuitem-disabled"," .goog-menuitem-content,", -".dark-theme.blocklyDropDownDiv .goog-menuitem-disabled"," .goog-menuitem-content {","color: #8a8a8a !important;","}"])})();Blockly.Themes.Deuteranopia={}; +Blockly.zelos.Renderer.prototype.getConnectionPreviewMethod=function(a,b,c){return b.type==Blockly.OUTPUT_VALUE?a.isConnected()?Blockly.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:Blockly.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE:Blockly.zelos.Renderer.superClass_.getConnectionPreviewMethod(a,b,c)};Blockly.blockRendering.register("zelos",Blockly.zelos.Renderer);Blockly.Themes.Dark=Blockly.Theme.defineTheme("dark",{base:Blockly.Themes.Classic,componentStyles:{workspaceBackgroundColour:"#1e1e1e",toolboxBackgroundColour:"#333",toolboxForegroundColour:"#fff",flyoutBackgroundColour:"#252526",flyoutForegroundColour:"#ccc",flyoutOpacity:1,scrollbarColour:"#797979",insertionMarkerColour:"#fff",insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:"#d0d0d0"}});Blockly.Themes.Deuteranopia={}; Blockly.Themes.Deuteranopia.defaultBlockStyles={colour_blocks:{colourPrimary:"#f2a72c",colourSecondary:"#f1c172",colourTertiary:"#da921c"},list_blocks:{colourPrimary:"#7d65ab",colourSecondary:"#a88be0",colourTertiary:"#66518e"},logic_blocks:{colourPrimary:"#9fd2f1",colourSecondary:"#c0e0f4",colourTertiary:"#74bae5"},loop_blocks:{colourPrimary:"#795a07",colourSecondary:"#ac8726",colourTertiary:"#c4a03f"},math_blocks:{colourPrimary:"#e6da39",colourSecondary:"#f3ec8e",colourTertiary:"#f2eeb7"},procedure_blocks:{colourPrimary:"#590721", colourSecondary:"#8c475d",colourTertiary:"#885464"},text_blocks:{colourPrimary:"#058863",colourSecondary:"#5ecfaf",colourTertiary:"#04684c"},variable_blocks:{colourPrimary:"#47025a",colourSecondary:"#820fa1",colourTertiary:"#8e579d"},variable_dynamic_blocks:{colourPrimary:"#47025a",colourSecondary:"#820fa1",colourTertiary:"#8e579d"}}; Blockly.Themes.Deuteranopia.categoryStyles={colour_category:{colour:"#f2a72c"},list_category:{colour:"#7d65ab"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#795a07"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#47025a"},variable_dynamic_category:{colour:"#47025a"}};Blockly.Themes.Deuteranopia=new Blockly.Theme("deuteranopia",Blockly.Themes.Deuteranopia.defaultBlockStyles,Blockly.Themes.Deuteranopia.categoryStyles);Blockly.Themes.HighContrast={}; Blockly.Themes.HighContrast.defaultBlockStyles={colour_blocks:{colourPrimary:"#a52714",colourSecondary:"#FB9B8C",colourTertiary:"#FBE1DD"},list_blocks:{colourPrimary:"#4a148c",colourSecondary:"#AD7BE9",colourTertiary:"#CDB6E9"},logic_blocks:{colourPrimary:"#01579b",colourSecondary:"#64C7FF",colourTertiary:"#C5EAFF"},loop_blocks:{colourPrimary:"#33691e",colourSecondary:"#9AFF78",colourTertiary:"#E1FFD7"},math_blocks:{colourPrimary:"#1a237e",colourSecondary:"#8A9EFF",colourTertiary:"#DCE2FF"},procedure_blocks:{colourPrimary:"#006064", colourSecondary:"#77E6EE",colourTertiary:"#CFECEE"},text_blocks:{colourPrimary:"#004d40",colourSecondary:"#5ae27c",colourTertiary:"#D2FFDD"},variable_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB"},variable_dynamic_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB"},hat_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB",hat:"cap"}}; -Blockly.Themes.HighContrast.categoryStyles={colour_category:{colour:"#a52714"},list_category:{colour:"#4a148c"},logic_category:{colour:"#01579b"},loop_category:{colour:"#33691e"},math_category:{colour:"#1a237e"},procedure_category:{colour:"#006064"},text_category:{colour:"#004d40"},variable_category:{colour:"#880e4f"},variable_dynamic_category:{colour:"#880e4f"}};Blockly.Themes.HighContrast=new Blockly.Theme("highcontrast",Blockly.Themes.HighContrast.defaultBlockStyles,Blockly.Themes.HighContrast.categoryStyles);Blockly.Themes.Tritanopia={}; +Blockly.Themes.HighContrast.categoryStyles={colour_category:{colour:"#a52714"},list_category:{colour:"#4a148c"},logic_category:{colour:"#01579b"},loop_category:{colour:"#33691e"},math_category:{colour:"#1a237e"},procedure_category:{colour:"#006064"},text_category:{colour:"#004d40"},variable_category:{colour:"#880e4f"},variable_dynamic_category:{colour:"#880e4f"}};Blockly.Themes.HighContrast=new Blockly.Theme("highcontrast",Blockly.Themes.HighContrast.defaultBlockStyles,Blockly.Themes.HighContrast.categoryStyles); +Blockly.Themes.HighContrast.setComponentStyle("selectedGlowColour","#000000");Blockly.Themes.HighContrast.setComponentStyle("selectedGlowSize",1);Blockly.Themes.HighContrast.setComponentStyle("replacementGlowColour","#000000");Blockly.Themes.HighContrast.setFontStyle({family:null,weight:null,size:16});Blockly.Themes.Tritanopia={}; Blockly.Themes.Tritanopia.defaultBlockStyles={colour_blocks:{colourPrimary:"#05427f",colourSecondary:"#2974c0",colourTertiary:"#2d74bb"},list_blocks:{colourPrimary:"#b69ce8",colourSecondary:"#ccbaef",colourTertiary:"#9176c5"},logic_blocks:{colourPrimary:"#9fd2f1",colourSecondary:"#c0e0f4",colourTertiary:"#74bae5"},loop_blocks:{colourPrimary:"#aa1846",colourSecondary:"#d36185",colourTertiary:"#7c1636"},math_blocks:{colourPrimary:"#e6da39",colourSecondary:"#f3ec8e",colourTertiary:"#f2eeb7"},procedure_blocks:{colourPrimary:"#590721", colourSecondary:"#8c475d",colourTertiary:"#885464"},text_blocks:{colourPrimary:"#058863",colourSecondary:"#5ecfaf",colourTertiary:"#04684c"},variable_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"},variable_dynamic_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"}}; -Blockly.Themes.Tritanopia.categoryStyles={colour_category:{colour:"#05427f"},list_category:{colour:"#b69ce8"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#aa1846"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#4b2d84"},variable_dynamic_category:{colour:"#4b2d84"}};Blockly.Themes.Tritanopia=new Blockly.Theme("tritanopia",Blockly.Themes.Tritanopia.defaultBlockStyles,Blockly.Themes.Tritanopia.categoryStyles);Blockly.requires={}; \ No newline at end of file +Blockly.Themes.Tritanopia.categoryStyles={colour_category:{colour:"#05427f"},list_category:{colour:"#b69ce8"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#aa1846"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#4b2d84"},variable_dynamic_category:{colour:"#4b2d84"}};Blockly.Themes.Tritanopia=new Blockly.Theme("tritanopia",Blockly.Themes.Tritanopia.defaultBlockStyles,Blockly.Themes.Tritanopia.categoryStyles);Blockly.requires={}; diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index 0acc427fe..980524061 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by build.py. +// Do not edit this file; automatically generated by gulp. 'use strict'; this.IS_NODE_JS = !!(typeof module !== 'undefined' && module.exports); @@ -21,166 +21,166 @@ this.BLOCKLY_DIR = (function(root) { this.BLOCKLY_BOOT = function(root) { // Execute after Closure has loaded. -goog.addDependency("../../core/block.js", ['Blockly.Block'], ['Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.fieldRegistry', 'Blockly.Input', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.Workspace']); -goog.addDependency("../../core/block_animations.js", ['Blockly.blockAnimations'], ['Blockly.utils.dom']); -goog.addDependency("../../core/block_drag_surface.js", ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); -goog.addDependency("../../core/block_dragger.js", ['Blockly.BlockDragger'], ['Blockly.blockAnimations', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.InsertionMarkerManager', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); -goog.addDependency("../../core/block_events.js", ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml']); -goog.addDependency("../../core/block_svg.js", ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.ContextMenu', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Events.BlockMove', 'Blockly.Msg', 'Blockly.navigation', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect']); -goog.addDependency("../../core/blockly.js", ['Blockly'], ['Blockly.constants', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.inject', 'Blockly.navigation', 'Blockly.Procedures', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.colour', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); -goog.addDependency("../../core/blocks.js", ['Blockly.Blocks'], []); -goog.addDependency("../../core/bubble.js", ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent', 'Blockly.Workspace']); -goog.addDependency("../../core/bubble_dragger.js", ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate']); -goog.addDependency("../../core/comment.js", ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent', 'Blockly.Warning']); -goog.addDependency("../../core/components/component.js", ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.dom', 'Blockly.utils.IdGenerator', 'Blockly.utils.style']); -goog.addDependency("../../core/components/menu/menu.js", ['Blockly.Menu'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/components/menu/menuitem.js", ['Blockly.MenuItem'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/components/tree/basenode.js", ['Blockly.tree.BaseNode'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.KeyCodes', 'Blockly.utils.style']); -goog.addDependency("../../core/components/tree/treecontrol.js", ['Blockly.tree.TreeControl'], ['Blockly.tree.TreeNode', 'Blockly.tree.BaseNode', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style']); -goog.addDependency("../../core/components/tree/treenode.js", ['Blockly.tree.TreeNode'], ['Blockly.tree.BaseNode', 'Blockly.utils.object', 'Blockly.utils.KeyCodes']); -goog.addDependency("../../core/connection.js", ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml']); -goog.addDependency("../../core/connection_db.js", ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection']); -goog.addDependency("../../core/constants.js", ['Blockly.constants'], []); -goog.addDependency("../../core/contextmenu.js", ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.uiMenu', 'Blockly.utils.userAgent', 'Blockly.Xml']); -goog.addDependency("../../core/css.js", ['Blockly.Css'], []); -goog.addDependency("../../core/dropdowndiv.js", ['Blockly.DropDownDiv'], ['Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style']); -goog.addDependency("../../core/events.js", ['Blockly.Events'], ['Blockly.utils']); -goog.addDependency("../../core/events_abstract.js", ['Blockly.Events.Abstract'], ['Blockly.Events']); -goog.addDependency("../../core/extensions.js", ['Blockly.Extensions'], ['Blockly.utils']); -goog.addDependency("../../core/field.js", ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.Size', 'Blockly.utils.style', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/field_angle.js", ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.fieldRegistry', 'Blockly.FieldTextInput', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/field_checkbox.js", ['Blockly.FieldCheckbox'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); -goog.addDependency("../../core/field_colour.js", ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.IdGenerator', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.Size']); -goog.addDependency("../../core/field_date.js", ['Blockly.FieldDate'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'goog.date', 'goog.date.DateTime', 'goog.events', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_he', 'goog.ui.DatePicker']); -goog.addDependency("../../core/field_dropdown.js", ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.utils.string', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/field_image.js", ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); -goog.addDependency("../../core/field_label.js", ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Size']); -goog.addDependency("../../core/field_label_serializable.js", ['Blockly.FieldLabelSerializable'], ['Blockly.FieldLabel', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.object']); -goog.addDependency("../../core/field_multilineinput.js", ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/field_number.js", ['Blockly.FieldNumber'], ['Blockly.fieldRegistry', 'Blockly.FieldTextInput', 'Blockly.utils.aria', 'Blockly.utils.object']); -goog.addDependency("../../core/field_registry.js", ['Blockly.fieldRegistry'], []); -goog.addDependency("../../core/field_textinput.js", ['Blockly.FieldTextInput'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.KeyCodes', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/field_variable.js", ['Blockly.FieldVariable'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.fieldRegistry', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Size', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml']); -goog.addDependency("../../core/flyout_base.js", ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.blockRendering', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); -goog.addDependency("../../core/flyout_button.js", ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); -goog.addDependency("../../core/flyout_dragger.js", ['Blockly.FlyoutDragger'], ['Blockly.utils.object', 'Blockly.WorkspaceDragger']); -goog.addDependency("../../core/flyout_horizontal.js", ['Blockly.HorizontalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.WidgetDiv']); -goog.addDependency("../../core/flyout_vertical.js", ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.utils', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.utils.userAgent', 'Blockly.WidgetDiv']); -goog.addDependency("../../core/generator.js", ['Blockly.Generator'], ['Blockly.Block']); -goog.addDependency("../../core/gesture.js", ['Blockly.Gesture'], ['Blockly.ASTNode', 'Blockly.blockAnimations', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.navigation', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.WorkspaceDragger']); -goog.addDependency("../../core/grid.js", ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/icon.js", ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.Size']); -goog.addDependency("../../core/inject.js", ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg']); -goog.addDependency("../../core/input.js", ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel']); -goog.addDependency("../../core/insertion_marker_manager.js", ['Blockly.InsertionMarkerManager'], ['Blockly.blockAnimations', 'Blockly.Events']); -goog.addDependency("../../core/keyboard_nav/action.js", ['Blockly.Action'], []); -goog.addDependency("../../core/keyboard_nav/ast_node.js", ['Blockly.ASTNode'], ['Blockly.utils.Coordinate']); -goog.addDependency("../../core/keyboard_nav/basic_cursor.js", ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor']); -goog.addDependency("../../core/keyboard_nav/cursor.js", ['Blockly.Cursor'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.Marker', 'Blockly.navigation', 'Blockly.utils.object']); -goog.addDependency("../../core/keyboard_nav/flyout_cursor.js", ['Blockly.FlyoutCursor'], ['Blockly.Cursor', 'Blockly.navigation', 'Blockly.utils.object']); -goog.addDependency("../../core/keyboard_nav/key_map.js", ['Blockly.user.keyMap'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object']); -goog.addDependency("../../core/keyboard_nav/marker.js", ['Blockly.Marker'], ['Blockly.ASTNode', 'Blockly.navigation']); -goog.addDependency("../../core/keyboard_nav/navigation.js", ['Blockly.navigation'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.utils.Coordinate', 'Blockly.user.keyMap']); -goog.addDependency("../../core/keyboard_nav/tab_navigate_cursor.js", ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object']); -goog.addDependency("../../core/marker_manager.js", ['Blockly.MarkerManager'], ['Blockly.Cursor', 'Blockly.Marker']); -goog.addDependency("../../core/msg.js", ['Blockly.Msg'], ['Blockly.utils.global']); -goog.addDependency("../../core/mutator.js", ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.xml', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); -goog.addDependency("../../core/names.js", ['Blockly.Names'], ['Blockly.Msg']); -goog.addDependency("../../core/options.js", ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.user.keyMap', 'Blockly.utils.userAgent', 'Blockly.Xml']); -goog.addDependency("../../core/procedures.js", ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.utils.xml', 'Blockly.Workspace', 'Blockly.Xml']); -goog.addDependency("../../core/rendered_connection.js", ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/common/block_rendering.js", ['Blockly.blockRendering'], ['Blockly.utils.object']); -goog.addDependency("../../core/renderers/common/constants.js", ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/renderers/common/debugger.js", ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types']); -goog.addDependency("../../core/renderers/common/drawer.js", ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths']); -goog.addDependency("../../core/renderers/common/i_path_object.js", ['Blockly.blockRendering.IPathObject'], []); -goog.addDependency("../../core/renderers/common/info.js", ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types']); -goog.addDependency("../../core/renderers/common/marker_svg.js", ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode']); -goog.addDependency("../../core/renderers/common/path_object.js", ['Blockly.blockRendering.PathObject'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.Theme', 'Blockly.utils.dom']); -goog.addDependency("../../core/renderers/common/renderer.js", ['Blockly.blockRendering.Renderer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.InsertionMarkerManager']); -goog.addDependency("../../core/renderers/geras/constants.js", ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/geras/drawer.js", ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths']); -goog.addDependency("../../core/renderers/geras/highlight_constants.js", ['Blockly.geras.HighlightConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.svgPaths']); -goog.addDependency("../../core/renderers/geras/highlighter.js", ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths']); -goog.addDependency("../../core/renderers/geras/info.js", ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/geras/measurables/inputs.js", ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.utils.object']); -goog.addDependency("../../core/renderers/geras/path_object.js", ['Blockly.geras.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.Theme', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/geras/renderer.js", ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/measurables/base.js", ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types']); -goog.addDependency("../../core/renderers/measurables/connections.js", ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/measurables/inputs.js", ['Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.StatementInput'], ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/measurables/row_elements.js", ['Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SquareCorner'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/measurables/rows.js", ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow'], ['Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/measurables/types.js", ['Blockly.blockRendering.Types'], []); -goog.addDependency("../../core/renderers/minimalist/constants.js", ['Blockly.minimalist.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/minimalist/drawer.js", ['Blockly.minimalist.Drawer'], ['Blockly.blockRendering.Drawer', 'Blockly.utils.object', 'Blockly.minimalist.RenderInfo']); -goog.addDependency("../../core/renderers/minimalist/info.js", ['Blockly.minimalist', 'Blockly.minimalist.RenderInfo'], ['Blockly.utils.object']); -goog.addDependency("../../core/renderers/minimalist/renderer.js", ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.utils.object', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo']); -goog.addDependency("../../core/renderers/thrasos/info.js", ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/thrasos/renderer.js", ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/zelos/constants.js", ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths']); -goog.addDependency("../../core/renderers/zelos/drawer.js", ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.RenderInfo']); -goog.addDependency("../../core/renderers/zelos/info.js", ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow']); -goog.addDependency("../../core/renderers/zelos/marker_svg.js", ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg']); -goog.addDependency("../../core/renderers/zelos/measurables/inputs.js", ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/zelos/measurables/row_elements.js", ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/zelos/measurables/rows.js", ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/zelos/path_object.js", ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.zelos.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/renderers/zelos/renderer.js", ['Blockly.zelos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.InsertionMarkerManager', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo', 'Blockly.zelos.MarkerSvg']); -goog.addDependency("../../core/requires.js", ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.HorizontalFlyout', 'Blockly.VerticalFlyout', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.ZoomControls', 'Blockly.Mutator', 'Blockly.Warning', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldLabelSerializable', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia']); -goog.addDependency("../../core/scrollbar.js", ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); -goog.addDependency("../../core/theme.js", ['Blockly.Theme'], ['Blockly.utils', 'Blockly.utils.colour']); -goog.addDependency("../../core/theme/classic.js", ['Blockly.Themes.Classic'], ['Blockly.Theme']); -goog.addDependency("../../core/theme/dark.js", ['Blockly.Themes.Dark'], ['Blockly.Css', 'Blockly.Theme']); -goog.addDependency("../../core/theme/deuteranopia.js", ['Blockly.Themes.Deuteranopia'], ['Blockly.Theme']); -goog.addDependency("../../core/theme/highcontrast.js", ['Blockly.Themes.HighContrast'], ['Blockly.Theme']); -goog.addDependency("../../core/theme/modern.js", ['Blockly.Themes.Modern'], ['Blockly.Theme']); -goog.addDependency("../../core/theme/tritanopia.js", ['Blockly.Themes.Tritanopia'], ['Blockly.Theme']); -goog.addDependency("../../core/theme/zelos.js", ['Blockly.Themes.Zelos'], ['Blockly.Theme']); -goog.addDependency("../../core/theme_manager.js", ['Blockly.ThemeManager'], ['Blockly.Theme']); -goog.addDependency("../../core/toolbox.js", ['Blockly.Toolbox'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.navigation', 'Blockly.Touch', 'Blockly.tree.TreeControl', 'Blockly.tree.TreeNode', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect']); -goog.addDependency("../../core/tooltip.js", ['Blockly.Tooltip'], ['Blockly.utils.string']); -goog.addDependency("../../core/touch.js", ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string']); -goog.addDependency("../../core/touch_gesture.js", ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object']); -goog.addDependency("../../core/trashcan.js", ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.utils.dom', 'Blockly.utils.Rect', 'Blockly.Xml']); -goog.addDependency("../../core/ui_events.js", ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object']); -goog.addDependency("../../core/ui_menu_utils.js", ['Blockly.utils.uiMenu'], ['Blockly.utils.style']); -goog.addDependency("../../core/utils.js", ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.colour', 'Blockly.utils.Coordinate', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/utils/aria.js", ['Blockly.utils.aria'], []); -goog.addDependency("../../core/utils/colour.js", ['Blockly.utils.colour'], []); -goog.addDependency("../../core/utils/coordinate.js", ['Blockly.utils.Coordinate'], []); -goog.addDependency("../../core/utils/dom.js", ['Blockly.utils.dom'], ['Blockly.utils.userAgent']); -goog.addDependency("../../core/utils/global.js", ['Blockly.utils.global'], []); -goog.addDependency("../../core/utils/idgenerator.js", ['Blockly.utils.IdGenerator'], []); -goog.addDependency("../../core/utils/keycodes.js", ['Blockly.utils.KeyCodes'], []); -goog.addDependency("../../core/utils/math.js", ['Blockly.utils.math'], []); -goog.addDependency("../../core/utils/object.js", ['Blockly.utils.object'], []); -goog.addDependency("../../core/utils/rect.js", ['Blockly.utils.Rect'], []); -goog.addDependency("../../core/utils/size.js", ['Blockly.utils.Size'], []); -goog.addDependency("../../core/utils/string.js", ['Blockly.utils.string'], []); -goog.addDependency("../../core/utils/style.js", ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size']); -goog.addDependency("../../core/utils/svg_paths.js", ['Blockly.utils.svgPaths'], []); -goog.addDependency("../../core/utils/useragent.js", ['Blockly.utils.userAgent'], ['Blockly.utils.global']); -goog.addDependency("../../core/utils/xml.js", ['Blockly.utils.xml'], []); -goog.addDependency("../../core/variable_events.js", ['Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object']); -goog.addDependency("../../core/variable_map.js", ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object']); -goog.addDependency("../../core/variable_model.js", ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils']); -goog.addDependency("../../core/variables.js", ['Blockly.Variables'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.xml', 'Blockly.VariableModel', 'Blockly.Xml']); -goog.addDependency("../../core/variables_dynamic.js", ['Blockly.VariablesDynamic'], ['Blockly.Variables', 'Blockly.Blocks', 'Blockly.Msg', 'Blockly.utils.xml', 'Blockly.VariableModel']); -goog.addDependency("../../core/warning.js", ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object']); -goog.addDependency("../../core/widgetdiv.js", ['Blockly.WidgetDiv'], ['Blockly.utils.style']); -goog.addDependency("../../core/workspace.js", ['Blockly.Workspace'], ['Blockly.Events', 'Blockly.Options', 'Blockly.utils', 'Blockly.utils.math', 'Blockly.VariableMap']); -goog.addDependency("../../core/workspace_audio.js", ['Blockly.WorkspaceAudio'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.userAgent']); -goog.addDependency("../../core/workspace_comment.js", ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml']); -goog.addDependency("../../core/workspace_comment_render_svg.js", ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom']); -goog.addDependency("../../core/workspace_comment_svg.js", ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.WorkspaceComment']); -goog.addDependency("../../core/workspace_drag_surface_svg.js", ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.dom']); -goog.addDependency("../../core/workspace_dragger.js", ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate']); -goog.addDependency("../../core/workspace_events.js", ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.utils.object']); -goog.addDependency("../../core/workspace_svg.js", ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.blockRendering', 'Blockly.ConnectionDB', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.navigation', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.Rect', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml']); -goog.addDependency("../../core/ws_comment_events.js", ['Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml']); -goog.addDependency("../../core/xml.js", ['Blockly.Xml'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.VarCreate', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml']); -goog.addDependency("../../core/zoom_controls.js", ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.dom']); +goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.Blocks', 'Blockly.Connection', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Workspace', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.string'], {}); +goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.dom'], {}); +goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/block_events.js', ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ContextMenu', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Ui', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.blockRendering.IPathObject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Procedures', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.constants', 'Blockly.inject', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.colour'], {}); +goog.addDependency('../../core/blocks.js', ['Blockly.Blocks'], [], {}); +goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); +goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/components/component.js', ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.IdGenerator', 'Blockly.utils.dom', 'Blockly.utils.style'], {}); +goog.addDependency('../../core/components/menu/menu.js', ['Blockly.Menu'], ['Blockly.Component', 'Blockly.utils.Coordinate', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/components/menu/menuitem.js', ['Blockly.MenuItem'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/components/tree/basenode.js', ['Blockly.tree.BaseNode'], ['Blockly.Component', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style'], {}); +goog.addDependency('../../core/components/tree/treecontrol.js', ['Blockly.tree.TreeControl'], ['Blockly.tree.BaseNode', 'Blockly.tree.TreeNode', 'Blockly.utils.aria', 'Blockly.utils.object', 'Blockly.utils.style'], {}); +goog.addDependency('../../core/components/tree/treenode.js', ['Blockly.tree.TreeNode'], ['Blockly.tree.BaseNode', 'Blockly.utils.KeyCodes', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml'], {}); +goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.RenderedConnection'], {}); +goog.addDependency('../../core/constants.js', ['Blockly.constants'], [], {}); +goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.Xml', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.uiMenu', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/css.js', ['Blockly.Css'], [], {'lang': 'es5'}); +goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style'], {}); +goog.addDependency('../../core/events.js', ['Blockly.Events'], ['Blockly.utils'], {}); +goog.addDependency('../../core/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {}); +goog.addDependency('../../core/extensions.js', ['Blockly.Extensions'], ['Blockly.utils'], {}); +goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/field_checkbox.js', ['Blockly.FieldCheckbox'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_colour.js', ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils.IdGenerator', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_date.js', ['Blockly.FieldDate'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'goog.date', 'goog.date.DateTime', 'goog.events', 'goog.i18n.DateTimeSymbols', 'goog.i18n.DateTimeSymbols_he', 'goog.ui.DatePicker'], {}); +goog.addDependency('../../core/field_dropdown.js', ['Blockly.FieldDropdown'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.fieldRegistry', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/field_image.js', ['Blockly.FieldImage'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_label.js', ['Blockly.FieldLabel'], ['Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_label_serializable.js', ['Blockly.FieldLabelSerializable'], ['Blockly.FieldLabel', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/field_number.js', ['Blockly.FieldNumber'], ['Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.aria', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/field_registry.js', ['Blockly.fieldRegistry'], [], {}); +goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/field_variable.js', ['Blockly.FieldVariable'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutCursor', 'Blockly.Gesture', 'Blockly.Marker', 'Blockly.Scrollbar', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es5'}); +goog.addDependency('../../core/flyout_dragger.js', ['Blockly.FlyoutDragger'], ['Blockly.WorkspaceDragger', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/flyout_horizontal.js', ['Blockly.HorizontalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/flyout_vertical.js', ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/generator.js', ['Blockly.Generator'], ['Blockly.Block'], {}); +goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.ASTNode', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.constants', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate'], {}); +goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.user.keyMap', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel'], {}); +goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.Events', 'Blockly.blockAnimations'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/action.js', ['Blockly.Action'], [], {}); +goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.utils.Coordinate'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Action', 'Blockly.Marker', 'Blockly.navigation', 'Blockly.utils.object'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/flyout_cursor.js', ['Blockly.FlyoutCursor'], ['Blockly.Cursor', 'Blockly.navigation', 'Blockly.utils.object'], {'lang': 'es5'}); +goog.addDependency('../../core/keyboard_nav/key_map.js', ['Blockly.user.keyMap'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/keyboard_nav/marker.js', ['Blockly.Marker'], ['Blockly.ASTNode', 'Blockly.navigation'], {}); +goog.addDependency('../../core/keyboard_nav/navigation.js', ['Blockly.navigation'], ['Blockly.ASTNode', 'Blockly.Action', 'Blockly.user.keyMap', 'Blockly.utils.Coordinate'], {}); +goog.addDependency('../../core/keyboard_nav/tab_navigate_cursor.js', ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], ['Blockly.Cursor', 'Blockly.Marker'], {}); +goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {}); +goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg'], {}); +goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.Xml', 'Blockly.user.keyMap', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.constants', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.Events', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); +goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {}); +goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types'], {}); +goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode'], {}); +goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.IPathObject', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo'], {}); +goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/geras/drawer.js', ['Blockly.geras.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.geras.Highlighter', 'Blockly.geras.RenderInfo', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {}); +goog.addDependency('../../core/renderers/geras/highlight_constants.js', ['Blockly.geras.HighlightConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/geras/highlighter.js', ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {}); +goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras', 'Blockly.geras.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/geras/measurables/inputs.js', ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.Theme', 'Blockly.blockRendering.PathObject', 'Blockly.geras.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/geras/renderer.js', ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/measurables/base.js', ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types'], {}); +goog.addDependency('../../core/renderers/measurables/connections.js', ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/measurables/inputs.js', ['Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.StatementInput'], ['Blockly.blockRendering.Connection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/measurables/row_elements.js', ['Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SquareCorner'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/measurables/rows.js', ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow'], ['Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/measurables/types.js', ['Blockly.blockRendering.Types'], [], {}); +goog.addDependency('../../core/renderers/minimalist/constants.js', ['Blockly.minimalist.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/minimalist/drawer.js', ['Blockly.minimalist.Drawer'], ['Blockly.blockRendering.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/minimalist/info.js', ['Blockly.minimalist', 'Blockly.minimalist.RenderInfo'], ['Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/minimalist/renderer.js', ['Blockly.minimalist.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.minimalist.ConstantProvider', 'Blockly.minimalist.Drawer', 'Blockly.minimalist.RenderInfo', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/thrasos/info.js', ['Blockly.thrasos', 'Blockly.thrasos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/thrasos/renderer.js', ['Blockly.thrasos.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.thrasos.RenderInfo', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es5'}); +goog.addDependency('../../core/renderers/zelos/drawer.js', ['Blockly.zelos.Drawer'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.RenderInfo'], {}); +goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos', 'Blockly.zelos.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {}); +goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg'], {}); +goog.addDependency('../../core/renderers/zelos/measurables/inputs.js', ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/zelos/measurables/row_elements.js', ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/zelos/measurables/rows.js', ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.TopRow', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider'], {}); +goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {}); +goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.Themes.Classic', 'Blockly.Themes.Dark', 'Blockly.Themes.Deuteranopia', 'Blockly.Themes.HighContrast', 'Blockly.Themes.Tritanopia', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer'], {}); +goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar', 'Blockly.ScrollbarPair'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/theme.js', ['Blockly.Theme'], ['Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/theme/classic.js', ['Blockly.Themes.Classic'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/dark.js', ['Blockly.Themes.Dark'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/deuteranopia.js', ['Blockly.Themes.Deuteranopia'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/highcontrast.js', ['Blockly.Themes.HighContrast'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/modern.js', ['Blockly.Themes.Modern'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/tritanopia.js', ['Blockly.Themes.Tritanopia'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme/zelos.js', ['Blockly.Themes.Zelos'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/theme_manager.js', ['Blockly.ThemeManager'], ['Blockly.Theme'], {}); +goog.addDependency('../../core/toolbox.js', ['Blockly.Toolbox'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Touch', 'Blockly.navigation', 'Blockly.tree.TreeControl', 'Blockly.tree.TreeNode', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.utils.string'], {}); +goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string'], {}); +goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.Scrollbar', 'Blockly.Xml', 'Blockly.utils.Rect', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/ui_events.js', ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/ui_menu_utils.js', ['Blockly.utils.uiMenu'], ['Blockly.utils.style'], {}); +goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.constants', 'Blockly.utils.Coordinate', 'Blockly.utils.colour', 'Blockly.utils.global', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {}); +goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], [], {}); +goog.addDependency('../../core/utils/coordinate.js', ['Blockly.utils.Coordinate'], [], {}); +goog.addDependency('../../core/utils/dom.js', ['Blockly.utils.dom'], ['Blockly.utils.userAgent'], {}); +goog.addDependency('../../core/utils/global.js', ['Blockly.utils.global'], [], {}); +goog.addDependency('../../core/utils/idgenerator.js', ['Blockly.utils.IdGenerator'], [], {}); +goog.addDependency('../../core/utils/keycodes.js', ['Blockly.utils.KeyCodes'], [], {}); +goog.addDependency('../../core/utils/math.js', ['Blockly.utils.math'], [], {}); +goog.addDependency('../../core/utils/object.js', ['Blockly.utils.object'], [], {}); +goog.addDependency('../../core/utils/rect.js', ['Blockly.utils.Rect'], [], {}); +goog.addDependency('../../core/utils/size.js', ['Blockly.utils.Size'], [], {}); +goog.addDependency('../../core/utils/string.js', ['Blockly.utils.string'], [], {}); +goog.addDependency('../../core/utils/style.js', ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size'], {}); +goog.addDependency('../../core/utils/svg_paths.js', ['Blockly.utils.svgPaths'], [], {}); +goog.addDependency('../../core/utils/useragent.js', ['Blockly.utils.userAgent'], ['Blockly.utils.global'], {}); +goog.addDependency('../../core/utils/xml.js', ['Blockly.utils.xml'], [], {}); +goog.addDependency('../../core/variable_events.js', ['Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.utils', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils'], {}); +goog.addDependency('../../core/variables.js', ['Blockly.Variables'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Xml', 'Blockly.utils', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/variables_dynamic.js', ['Blockly.VariablesDynamic'], ['Blockly.Blocks', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/widgetdiv.js', ['Blockly.WidgetDiv'], ['Blockly.utils.style'], {}); +goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.Events', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.utils', 'Blockly.utils.math'], {}); +goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], ['Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es5'}); +goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/workspace_comment_render_svg.js', ['Blockly.WorkspaceCommentSvg.render'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Ui', 'Blockly.WorkspaceComment', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.dom'], {}); +goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.utils.Coordinate'], {}); +goog.addDependency('../../core/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.utils.object'], {'lang': 'es5'}); +goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ConnectionDB', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.TouchGesture', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.constants', 'Blockly.navigation', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.object'], {}); +goog.addDependency('../../core/ws_comment_events.js', ['Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.object', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.VarCreate', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.xml'], {}); +goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.Css', 'Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency("base.js", [], []); // Load Blockly. diff --git a/blocks_compressed.js b/blocks_compressed.js index 3f38be573..174f4dec9 100644 --- a/blocks_compressed.js +++ b/blocks_compressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by build.py. +// Do not edit this file; automatically generated by gulp. 'use strict'; @@ -33,7 +33,7 @@ this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number") Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_SUBLIST_HELPURL);this.setStyle("list_blocks"); this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation"), b=this.getInput("AT1").type==Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)): -this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var d="FROM_START"==c||"FROM_END"==c;if(d!=b){var f=this.getSourceBlock();f.updateAt_(a,d);f.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}}; +this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var e="FROM_START"==c||"FROM_END"==c;if(e!=b){var d=this.getSourceBlock();d.updateAt_(a,e);d.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}}; Blockly.Blocks.lists_sort={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[Blockly.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Blockly.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Blockly.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Blockly.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks", tooltip:Blockly.Msg.LISTS_SORT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_SORT_HELPURL})}}; Blockly.Blocks.lists_split={init:function(){var a=this,b=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(b){a.updateType_(b)});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);this.setStyle("list_blocks");this.appendValueInput("INPUT").setCheck("String").appendField(b,"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);this.setOutput(!0, @@ -68,8 +68,8 @@ extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]);Blockly.Co Blockly.Extensions.register("controls_flow_tooltip",Blockly.Extensions.buildTooltipForDropdown("FLOW",Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS)); Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var d={enabled:!0};d.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=Blockly.Variables.generateVariableFieldDom(b);c=Blockly.utils.xml.createElement("block");c.setAttribute("type","variables_get");c.appendChild(b);d.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(d)}}}}; Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR")); -Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){this.workspace.isDragging&&!this.workspace.isDragging()&&(Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this)? -(this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1)))}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230; +Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()&&a.type==Blockly.Events.BLOCK_MOVE&&a.blockId==this.id){var b= +Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this);this.setWarningText(b?null:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);if(!this.isInFlyout){var c=Blockly.Events.getGroup();Blockly.Events.setGroup(a.group);this.setEnabled(b);Blockly.Events.setGroup(c)}}}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230; Blockly.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}", "MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]}, {type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks", @@ -96,7 +96,7 @@ d,"");null!=c?this.argumentVarModels_.push(c):console.log("Failed to create a va Blockly.utils.xml.createElement("block");e.setAttribute("type","procedures_mutatorarg");var f=Blockly.utils.xml.createElement("field");f.setAttribute("name","NAME");var g=Blockly.utils.xml.createTextNode(this.arguments_[d]);f.appendChild(g);e.appendChild(f);f=Blockly.utils.xml.createElement("next");e.appendChild(f);c.appendChild(e);c=f}a=Blockly.Xml.domToBlock(b,a);"procedures_defreturn"==this.type?a.setFieldValue(this.hasStatements_,"STATEMENTS"):a.removeInput("STATEMENT_INPUT");Blockly.Procedures.mutateCallers(this); return a},compose:function(a){this.arguments_=[];this.paramIds_=[];this.argumentVarModels_=[];for(var b=a.getInputTargetBlock("STACK");b;){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0), Blockly.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null;else{a=this.getInput("STACK").connection;if(this.statementConnection_=a.targetConnection)a=a.targetBlock(),a.unplug(),a.bumpNeighbours();this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableById(a); -if(""==c.type){c=c.name;for(var d=this.workspace.getVariableById(b),e=!1,f=0;f", - "lastupdated": "2020-01-23 14:59:14.637552", + "lastupdated": "2020-04-02 12:40:22.060792", "locale": "en", "messagedocumentation" : "qqq" }, diff --git a/msg/json/qqq.json b/msg/json/qqq.json index 596ea55ad..f2b7d1723 100644 --- a/msg/json/qqq.json +++ b/msg/json/qqq.json @@ -1,13 +1,4 @@ { - "@metadata": { - "authors": [ - "Espertus", - "Liuxinyu970226", - "Metalhead64", - "Robby", - "Shirayuki" - ] - }, "VARIABLES_DEFAULT_NAME": "default name - A simple, general default name for a variable, preferably short. For more context, see [[Translating:Blockly#infrequent_message_types]].\n{{Identical|Item}}", "UNNAMED_KEY": "default name - A simple, default name for an unnamed function or variable. Preferably indicates that the item is unnamed.", "TODAY": "button text - Button that sets a calendar to today's date.\n{{Identical|Today}}", diff --git a/php_compressed.js b/php_compressed.js index bd821bdc8..9f2b3f9ca 100644 --- a/php_compressed.js +++ b/php_compressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by build.py. +// Do not edit this file; automatically generated by gulp. 'use strict'; @@ -87,5 +87,4 @@ Blockly.PHP.text_getSubstring=function(a){var b=Blockly.PHP.valueToCode(a,"STRIN Blockly.PHP.text_trim=function(a){var b={LEFT:"ltrim",RIGHT:"rtrim",BOTH:"trim"}[a.getFieldValue("MODE")];a=Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_NONE)||"''";return[b+"("+a+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.text_print=function(a){return"print("+(Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_NONE)||"''")+");\n"}; Blockly.PHP.text_prompt_ext=function(a){var b="readline("+(a.getField("TEXT")?Blockly.PHP.quote_(a.getFieldValue("TEXT")):Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_NONE)||"''")+")";"NUMBER"==a.getFieldValue("TYPE")&&(b="floatval("+b+")");return[b,Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.text_prompt=Blockly.PHP.text_prompt_ext; Blockly.PHP.text_count=function(a){var b=Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_MEMBER)||"''";a=Blockly.PHP.valueToCode(a,"SUB",Blockly.PHP.ORDER_NONE)||"''";return["strlen("+a+") === 0 ? strlen("+b+") + 1 : substr_count("+b+", "+a+")",Blockly.PHP.ORDER_CONDITIONAL]}; -Blockly.PHP.text_replace=function(a){var b=Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_MEMBER)||"''",c=Blockly.PHP.valueToCode(a,"FROM",Blockly.PHP.ORDER_NONE)||"''";a=Blockly.PHP.valueToCode(a,"TO",Blockly.PHP.ORDER_NONE)||"''";return["str_replace("+c+", "+a+", "+b+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.text_reverse=function(a){return["strrev("+(Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_MEMBER)||"''")+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.variables={};Blockly.PHP.variables_get=function(a){return[Blockly.PHP.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.PHP.ORDER_ATOMIC]};Blockly.PHP.variables_set=function(a){var b=Blockly.PHP.valueToCode(a,"VALUE",Blockly.PHP.ORDER_ASSIGNMENT)||"0";return Blockly.PHP.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+";\n"}; -Blockly.PHP.variablesDynamic={};Blockly.PHP.variables_get_dynamic=Blockly.PHP.variables_get;Blockly.PHP.variables_set_dynamic=Blockly.PHP.variables_set; \ No newline at end of file +Blockly.PHP.text_replace=function(a){var b=Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_MEMBER)||"''",c=Blockly.PHP.valueToCode(a,"FROM",Blockly.PHP.ORDER_NONE)||"''";a=Blockly.PHP.valueToCode(a,"TO",Blockly.PHP.ORDER_NONE)||"''";return["str_replace("+c+", "+a+", "+b+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.text_reverse=function(a){return["strrev("+(Blockly.PHP.valueToCode(a,"TEXT",Blockly.PHP.ORDER_MEMBER)||"''")+")",Blockly.PHP.ORDER_FUNCTION_CALL]};Blockly.PHP.variables={};Blockly.PHP.variables_get=function(a){return[Blockly.PHP.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.PHP.ORDER_ATOMIC]};Blockly.PHP.variables_set=function(a){var b=Blockly.PHP.valueToCode(a,"VALUE",Blockly.PHP.ORDER_ASSIGNMENT)||"0";return Blockly.PHP.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+";\n"};Blockly.PHP.variablesDynamic={};Blockly.PHP.variables_get_dynamic=Blockly.PHP.variables_get;Blockly.PHP.variables_set_dynamic=Blockly.PHP.variables_set; diff --git a/python_compressed.js b/python_compressed.js index 2ca971182..01398bd1e 100644 --- a/python_compressed.js +++ b/python_compressed.js @@ -1,4 +1,4 @@ -// Do not edit this file; automatically generated by build.py. +// Do not edit this file; automatically generated by gulp. 'use strict'; @@ -42,8 +42,8 @@ Blockly.Python.logic_ternary=function(a){var b=Blockly.Python.valueToCode(a,"IF" Blockly.Python.controls_repeat=Blockly.Python.controls_repeat_ext;Blockly.Python.controls_whileUntil=function(a){var b="UNTIL"==a.getFieldValue("MODE"),c=Blockly.Python.valueToCode(a,"BOOL",b?Blockly.Python.ORDER_LOGICAL_NOT:Blockly.Python.ORDER_NONE)||"False",d=Blockly.Python.statementToCode(a,"DO");d=Blockly.Python.addLoopTrap(d,a)||Blockly.Python.PASS;b&&(c="not "+c);return"while "+c+":\n"+d}; Blockly.Python.controls_for=function(a){var b=Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),c=Blockly.Python.valueToCode(a,"FROM",Blockly.Python.ORDER_NONE)||"0",d=Blockly.Python.valueToCode(a,"TO",Blockly.Python.ORDER_NONE)||"0",e=Blockly.Python.valueToCode(a,"BY",Blockly.Python.ORDER_NONE)||"1",f=Blockly.Python.statementToCode(a,"DO");f=Blockly.Python.addLoopTrap(f,a)||Blockly.Python.PASS;var h="",g=function(){return Blockly.Python.provideFunction_("upRange", ["def "+Blockly.Python.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},k=function(){return Blockly.Python.provideFunction_("downRange",["def "+Blockly.Python.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};a=function(a,b,c){return"("+a+" <= "+b+") and "+g()+"("+a+", "+b+", "+c+") or "+k()+"("+a+", "+b+", "+c+")"};if(Blockly.isNumber(c)&&Blockly.isNumber(d)&& -Blockly.isNumber(e))c=Number(c),d=Number(d),e=Math.abs(Number(e)),0===c%1&&0===d%1&&0===e%1?(c<=d?(d++,a=0==c&&1==e?d:c+", "+d,1!=e&&(a+=", "+e)):(d--,a=c+", "+d+", -"+e),a="range("+a+")"):(a=ca?Blockly.Python.ORDER_UNARY_SIGN:Blockly.Python.ORDER_ATOMIC;return[a,b]}; Blockly.Python.math_arithmetic=function(a){var b={ADD:[" + ",Blockly.Python.ORDER_ADDITIVE],MINUS:[" - ",Blockly.Python.ORDER_ADDITIVE],MULTIPLY:[" * ",Blockly.Python.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",Blockly.Python.ORDER_MULTIPLICATIVE],POWER:[" ** ",Blockly.Python.ORDER_EXPONENTIATION]}[a.getFieldValue("OP")],c=b[0];b=b[1];var d=Blockly.Python.valueToCode(a,"A",b)||"0";a=Blockly.Python.valueToCode(a,"B",b)||"0";return[d+c+a,b]}; @@ -82,5 +82,4 @@ Blockly.Python.text_changeCase=function(a){var b={UPPERCASE:".upper()",LOWERCASE Blockly.Python.text_print=function(a){return"print("+(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_NONE)||"''")+")\n"}; Blockly.Python.text_prompt_ext=function(a){var b=Blockly.Python.provideFunction_("text_prompt",["def "+Blockly.Python.FUNCTION_NAME_PLACEHOLDER_+"(msg):"," try:"," return raw_input(msg)"," except NameError:"," return input(msg)"]),c=a.getField("TEXT")?Blockly.Python.quote_(a.getFieldValue("TEXT")):Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_NONE)||"''";b=b+"("+c+")";"NUMBER"==a.getFieldValue("TYPE")&&(b="float("+b+")");return[b,Blockly.Python.ORDER_FUNCTION_CALL]}; Blockly.Python.text_prompt=Blockly.Python.text_prompt_ext;Blockly.Python.text_count=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''";a=Blockly.Python.valueToCode(a,"SUB",Blockly.Python.ORDER_NONE)||"''";return[b+".count("+a+")",Blockly.Python.ORDER_MEMBER]}; -Blockly.Python.text_replace=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''",c=Blockly.Python.valueToCode(a,"FROM",Blockly.Python.ORDER_NONE)||"''";a=Blockly.Python.valueToCode(a,"TO",Blockly.Python.ORDER_NONE)||"''";return[b+".replace("+c+", "+a+")",Blockly.Python.ORDER_MEMBER]};Blockly.Python.text_reverse=function(a){return[(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''")+"[::-1]",Blockly.Python.ORDER_MEMBER]};Blockly.Python.variables={};Blockly.Python.variables_get=function(a){return[Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.Python.ORDER_ATOMIC]};Blockly.Python.variables_set=function(a){var b=Blockly.Python.valueToCode(a,"VALUE",Blockly.Python.ORDER_NONE)||"0";return Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+"\n"}; -Blockly.Python.variablesDynamic={};Blockly.Python.variables_get_dynamic=Blockly.Python.variables_get;Blockly.Python.variables_set_dynamic=Blockly.Python.variables_set; \ No newline at end of file +Blockly.Python.text_replace=function(a){var b=Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''",c=Blockly.Python.valueToCode(a,"FROM",Blockly.Python.ORDER_NONE)||"''";a=Blockly.Python.valueToCode(a,"TO",Blockly.Python.ORDER_NONE)||"''";return[b+".replace("+c+", "+a+")",Blockly.Python.ORDER_MEMBER]};Blockly.Python.text_reverse=function(a){return[(Blockly.Python.valueToCode(a,"TEXT",Blockly.Python.ORDER_MEMBER)||"''")+"[::-1]",Blockly.Python.ORDER_MEMBER]};Blockly.Python.variables={};Blockly.Python.variables_get=function(a){return[Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME),Blockly.Python.ORDER_ATOMIC]};Blockly.Python.variables_set=function(a){var b=Blockly.Python.valueToCode(a,"VALUE",Blockly.Python.ORDER_NONE)||"0";return Blockly.Python.variableDB_.getName(a.getFieldValue("VAR"),Blockly.VARIABLE_CATEGORY_NAME)+" = "+b+"\n"};Blockly.Python.variablesDynamic={};Blockly.Python.variables_get_dynamic=Blockly.Python.variables_get;Blockly.Python.variables_set_dynamic=Blockly.Python.variables_set; diff --git a/typings/blockly.d.ts b/typings/blockly.d.ts index 1a43c08b8..425ab3ff4 100644 --- a/typings/blockly.d.ts +++ b/typings/blockly.d.ts @@ -48,6 +48,7 @@ declare module Blockly { minScale?: number; scaleSpeed?: number; }; + renderer?: string; } interface BlocklyThemeOptions { @@ -185,6 +186,13 @@ declare module Blockly { */ hat: string|any /*undefined*/; + /** + * A count of statement inputs on the block. + * @type {number} + * @package + */ + statementInputCount: number; + /** @type {string} */ type: string; @@ -536,7 +544,7 @@ declare module Blockly { * initializer function. * @param {function(Blockly.Events.Abstract)} onchangeFn The callback to call * when the block's workspace changes. - * @throws {Error} if onchangeFn is not falsey or a function. + * @throws {Error} if onchangeFn is not falsey and not a function. */ setOnChange(onchangeFn: { (_0: Blockly.Events.Abstract): any /*missing*/ }): void; @@ -1412,6 +1420,36 @@ declare module Blockly { */ initSvg(): void; + /** + * Get the secondary colour of a block. + * @return {?string} #RRGGBB string. + */ + getColourSecondary(): string; + + /** + * Get the tertiary colour of a block. + * @return {?string} #RRGGBB string. + */ + getColourTertiary(): string; + + /** + * Get the shadow colour of a block. + * @return {?string} #RRGGBB string. + * @deprecated Use style.colourSecondary. (2020 January 21) + */ + getColourShadow(): string; + + /** + * Get the border colour(s) of a block. + * @return {{colourDark, colourLight, colourBorder}} An object containing + * colour values for the border(s) of the block. If the block is using a + * style the colourBorder will be defined and equal to the tertiary colour + * of the style (#RRGGBB string). Otherwise the colourDark and colourLight + * attributes will be defined (#RRGGBB strings). + * @deprecated Use style.colourTertiary. (2020 January 21) + */ + getColourBorder(): { colourDark: any /*missing*/; colourLight: any /*missing*/; colourBorder: any /*missing*/ }; + /** * Select this block. Highlight it visually. */ @@ -1522,7 +1560,7 @@ declare module Blockly { /** * Notify every input on this block to mark its fields as dirty. - * A dirty field is a field that needs to be re-rendererd. + * A dirty field is a field that needs to be re-rendered. */ markDirty(): void; @@ -1832,6 +1870,12 @@ declare module Blockly { */ render(opt_bubble?: boolean): void; + /** + * Redraw any attached marker or cursor svgs if needed. + * @protected + */ + updateMarkers_(): void; + /** * Add the cursor svg to this block's svg group. * @param {SVGElement} cursorSvg The svg root of the cursor to be added to the @@ -1863,7 +1907,7 @@ declare module Blockly { * @param {boolean} add True if highlighting should be added. * @package */ - highlightForReplacement(add: boolean): void; + fadeForReplacement(add: boolean): void; /** * Visual effect to show that if the dragging block is dropped it will connect @@ -1929,6 +1973,13 @@ declare module Blockly { */ var draggingConnections: Blockly.Connection[]; + /** + * Container element to render the WidgetDiv, DropDownDiv and Tooltip. + * @type {?Element} + * @package + */ + var parentContainer: Element; + /** * Blockly opaque event data used to unbind events when using * `Blockly.bindEvent_` and `Blockly.bindEventWithChecks_`. @@ -2085,6 +2136,15 @@ declare module Blockly { * @package */ function checkBlockColourConstants(): void; + + /** + * Set the parent container. This is the container element that the WidgetDiv, + * DropDownDiv, and Tooltip are rendered into the first time `Blockly.inject` + * is called. + * This method is a NOP if called after the first ``Blockly.inject``. + * @param {!Element} container The container element. + */ + function setParentContainer(container: Element): void; } @@ -2756,12 +2816,6 @@ declare module Blockly { */ var CURRENT_CONNECTION_PREFERENCE: any /*missing*/; - /** - * The main colour of insertion markers, in hex. The block is rendered a - * transparent grey by changing the fill opacity in CSS. - */ - var INSERTION_MARKER_COLOUR: any /*missing*/; - /** * Delay in ms between trigger and bumping unconnected block out of alignment. */ @@ -3631,7 +3685,7 @@ declare module Blockly.Extensions { * to the lookup table. * @param {!Object.} lookupTable The table of field values to * tooltip text. - * @return {Function} The extension function. + * @return {!Function} The extension function. */ function buildTooltipForDropdown(dropdownName: string, lookupTable: { [key: string]: string }): Function; @@ -3642,7 +3696,7 @@ declare module Blockly.Extensions { * @param {string} msgTemplate The template form to of the message text, with * %1 placeholder. * @param {string} fieldName The field with the replacement text. - * @return {Function} The extension function. + * @return {!Function} The extension function. */ function buildTooltipWithFieldText(msgTemplate: string, fieldName: string): Function; } @@ -3787,7 +3841,7 @@ declare module Blockly { * clicked. Blockly will automatically set the field as clickable if this * method is defined. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @return {void} * @protected */ @@ -3823,6 +3877,13 @@ declare module Blockly { */ setSourceBlock(block: Blockly.Block): void; + /** + * Get the renderer constant provider. + * @return {?Blockly.blockRendering.ConstantProvider} The renderer constant + * provider. + */ + getConstants(): Blockly.blockRendering.ConstantProvider; + /** * Get the block this field is attached to. * @return {Blockly.Block} The block containing this field. @@ -4003,7 +4064,7 @@ declare module Blockly { /** * Show an editor when the field is clicked only if the field is clickable. * @param {Event=} opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @package */ showEditor(opt_e?: Event): void; @@ -4018,9 +4079,25 @@ declare module Blockly { /** * Updates the size of the field based on the text. + * @param {number=} opt_margin margin to use when positioning the text element. * @protected */ - updateSize_(): void; + updateSize_(opt_margin?: number): void; + + /** + * Position a field's text element after a size change. This handles both LTR + * and RTL positioning. + * @param {number} xOffset x offset to use when positioning the text element. + * @param {number} contentWidth The content width. + * @protected + */ + positionTextElement_(xOffset: number, contentWidth: number): void; + + /** + * Position a field's border rect after a size change. + * @protected + */ + positionBorderRect_(): void; /** * Returns the height and width of the field. @@ -4111,7 +4188,7 @@ declare module Blockly { doValueUpdate_(newValue: any): void; /** - * Used to notify the field an invalid value was input. Can be overidden by + * Used to notify the field an invalid value was input. Can be overridden by * subclasses, see FieldTextInput. * No-op by default. * @param {*} _invalidValue The input value that was determined to be invalid. @@ -4203,6 +4280,12 @@ declare module Blockly { * @package */ setMarkerSvg(markerSvg: SVGElement): void; + + /** + * Redraw any attached marker or cursor svgs if needed. + * @protected + */ + updateMarkers_(): void; } } @@ -4362,15 +4445,6 @@ declare module Blockly { */ CURSOR: any /*missing*/; - /** - * Used to tell if the field needs to be rendered the next time the block is - * rendered. Checkbox fields are statically sized, and only need to be - * rendered at initialization. - * @type {boolean} - * @protected - */ - isDirty_: boolean; - /** * Create the block UI for this checkbox. * @package @@ -5122,12 +5196,6 @@ declare module Blockly { */ updateSize_(): void; - /** - * Resize the editor to fit the text. - * @protected - */ - resizeEditor_(): void; - /** * Create the text input editor widget. * @return {!HTMLTextAreaElement} The newly created text input editor. @@ -5148,13 +5216,6 @@ declare module Blockly { declare module Blockly.FieldMultilineInput { - /** - * The default height of a single line of text. - * @type {number} - * @const - */ - var LINE_HEIGHT: number; - /** * Construct a FieldMultilineInput from a JSON arg object, * dereferencing any string table references. @@ -5430,7 +5491,7 @@ declare module Blockly { /** * Show the inline free-text editor on top of the text. * @param {Event=} _opt_e Optional mouse event that triggered the field to open, - * or undefined if triggered programatically. + * or undefined if triggered programmatically. * @param {boolean=} opt_quietInput True if editor should be created without * focus. Defaults to false. * @protected @@ -5459,13 +5520,6 @@ declare module Blockly { */ onHtmlInputKeyDown_(e: Event): void; - /** - * Handle blur for the editor. - * @param {!Event} _e Focus event. - * @protected - */ - onHtmlInputBlur_(_e: Event): void; - /** * Set the html input value and the field's internal value. The difference * between this and ``setValue`` is that this also updates the html input @@ -5950,8 +6004,8 @@ declare module Blockly { /** * Create a copy of this block on the workspace. * @param {!Blockly.BlockSvg} originalBlock The block to copy from the flyout. - * @return {Blockly.BlockSvg} The newly created block, or null if something - * went wrong with deserialization. + * @return {!Blockly.BlockSvg} The newly created block. + * @throws {Error} if something went wrong with deserialization. * @package */ createBlock(originalBlock: Blockly.BlockSvg): Blockly.BlockSvg; @@ -6087,9 +6141,14 @@ declare module Blockly { declare module Blockly.FlyoutButton { /** - * The margin around the text in the button. + * The horizontal margin around the text in the button. */ - var MARGIN: any /*missing*/; + var MARGIN_X: any /*missing*/; + + /** + * The vertical margin around the text in the button. + */ + var MARGIN_Y: any /*missing*/; } @@ -6713,7 +6772,7 @@ declare module Blockly { * Move the grid to a new x and y position, and make sure that change is * visible. * @param {number} x The new x position of the grid (in px). - * @param {number} y The new y position ofthe grid (in px). + * @param {number} y The new y position of the grid (in px). * @package */ moveTo(x: number, y: number): void; @@ -7023,7 +7082,7 @@ declare module Blockly { applyConnections(): void; /** - * Update highlighted connections based on the most recent move location. + * Update connections based on the most recent move location. * @param {!Blockly.utils.Coordinate} dxy Position relative to drag start, * in workspace units. * @param {?number} deleteArea One of {@link Blockly.DELETE_AREA_TRASH}, @@ -7044,6 +7103,16 @@ declare module Blockly { } +declare module Blockly.InsertionMarkerManager { + + /** + * An enum describing different kinds of previews the InsertionMarkerManager + * could display. + * @enum {number} + */ + enum PREVIEW_TYPE { INSERTION_MARKER, INPUT_OUTLINE, REPLACEMENT_FADE } +} + declare module Blockly { @@ -7108,6 +7177,12 @@ declare module Blockly { */ setMarkerSvg(markerSvg: SVGElement): void; + /** + * Redraw the attached cursor svg if needed. + * @package + */ + updateMarkers(): void; + /** * Dispose of the marker manager. * Go through and delete all markers associated with this marker manager. @@ -7802,21 +7877,20 @@ declare module Blockly { /** * Class for a theme. * @param {string} name Theme name. - * @param {!Object.} blockStyles A map from - * style names (strings) to objects with style attributes for blocks. - * @param {!Object.} categoryStyles A map - * from style names (strings) to objects with style attributes for + * @param {!Object.=} opt_blockStyles A map + * from style names (strings) to objects with style attributes for blocks. + * @param {!Object.=} opt_categoryStyles A + * map from style names (strings) to objects with style attributes for * categories. - * @param {!Object.=} opt_componentStyles A map of Blockly component - * names to style value. + * @param {!Blockly.Theme.ComponentStyle=} opt_componentStyles A map of Blockly + * component names to style value. * @constructor */ - constructor(name: string, blockStyles: { [key: string]: Blockly.Theme.BlockStyle }, categoryStyles: { [key: string]: Blockly.Theme.CategoryStyle }, opt_componentStyles?: { [key: string]: any }); + constructor(name: string, opt_blockStyles?: { [key: string]: Blockly.Theme.BlockStyle }, opt_categoryStyles?: { [key: string]: Blockly.Theme.CategoryStyle }, opt_componentStyles?: Blockly.Theme.ComponentStyle); /** * The theme name. This can be used to reference a specific theme in CSS. * @type {string} - * @package */ name: string; @@ -7834,6 +7908,49 @@ declare module Blockly { */ categoryStyles: { [key: string]: Blockly.Theme.CategoryStyle }; + /** + * The UI components styles map. + * @type {!Blockly.Theme.ComponentStyle} + * @package + */ + componentStyles: Blockly.Theme.ComponentStyle; + + /** + * The font style. + * @type {!Blockly.Theme.FontStyle} + * @package + */ + fontStyle: Blockly.Theme.FontStyle; + + /** + * Whether or not to add a 'hat' on top of all blocks with no previous or + * output connections. + * @type {?boolean} + * @package + */ + startHats: boolean; + + /** + * Gets the class name that identifies this theme. + * @return {string} The CSS class name. + * @package + */ + getClassName(): string; + + /** + * Overrides or adds a style to the blockStyles map. + * @param {string} blockStyleName The name of the block style. + * @param {Blockly.Theme.BlockStyle} blockStyle The block style. + */ + setBlockStyle(blockStyleName: string, blockStyle: Blockly.Theme.BlockStyle): void; + + /** + * Overrides or adds a style to the categoryStyles map. + * @param {string} categoryStyleName The name of the category style. + * @param {Blockly.Theme.CategoryStyle} categoryStyle The category style. + */ + setCategoryStyle(categoryStyleName: string, categoryStyle: Blockly.Theme.CategoryStyle): void; + /** * Gets the style for a given Blockly UI component. If the style value is a * string, we attempt to find the value of any named references. @@ -7848,6 +7965,19 @@ declare module Blockly { * @param {*} styleValue The style value. */ setComponentStyle(componentName: string, styleValue: any): void; + + /** + * Configure a theme's font style. + * @param {Blockly.Theme.FontStyle} fontStyle The font style. + */ + setFontStyle(fontStyle: Blockly.Theme.FontStyle): void; + + /** + * Configure a theme's start hats. + * @param {boolean} startHats True if the theme enables start hats, false + * otherwise. + */ + setStartHats(startHats: boolean): void; } } @@ -7857,12 +7987,12 @@ declare module Blockly.Theme { /** * A block style. * @typedef {{ - * colourPrimary:string, - * colourSecondary:string, - * colourTertiary:string, - * hat:string - * }} - */ + * colourPrimary:string, + * colourSecondary:string, + * colourTertiary:string, + * hat:string + * }} + */ interface BlockStyle { colourPrimary: string; colourSecondary: string; @@ -7873,12 +8003,74 @@ declare module Blockly.Theme { /** * A category style. * @typedef {{ - * colour:string - * }} - */ + * colour:string + * }} + */ interface CategoryStyle { colour: string } + + /** + * A component style. + * @typedef {{ + * workspaceBackgroundColour:string?, + * toolboxBackgroundColour:string?, + * toolboxForegroundColour:string?, + * flyoutBackgroundColour:string?, + * flyoutForegroundColour:string?, + * flyoutOpacity:number?, + * scrollbarColour:string?, + * scrollbarOpacity:number?, + * insertionMarkerColour:string?, + * insertionMarkerOpacity:number?, + * markerColour:string?, + * cursorColour:string?, + * selectedGlowColour:string?, + * selectedGlowOpacity:number?, + * replacementGlowColour:string?, + * replacementGlowOpacity:number? + * }} + */ + interface ComponentStyle { + workspaceBackgroundColour: string; + toolboxBackgroundColour: string; + toolboxForegroundColour: string; + flyoutBackgroundColour: string; + flyoutForegroundColour: string; + flyoutOpacity: number; + scrollbarColour: string; + scrollbarOpacity: number; + insertionMarkerColour: string; + insertionMarkerOpacity: number; + markerColour: string; + cursorColour: string; + selectedGlowColour: string; + selectedGlowOpacity: number; + replacementGlowColour: string; + replacementGlowOpacity: number + } + + /** + * A font style. + * @typedef {{ + * family:string?, + * weight:string?, + * size:number? + * }} + */ + interface FontStyle { + family: string; + weight: string; + size: number + } + + /** + * Define a new Blockly theme. + * @param {string} name The name of the theme. + * @param {!Object} themeObj An object containing theme properties. + * @return {!Blockly.Theme} A new Blockly theme. + */ + function defineTheme(name: string, themeObj: Object): Blockly.Theme; } @@ -8185,6 +8377,18 @@ declare module Blockly.Tooltip { */ function bindMouseEvents(element: Element): void; + /** + * Unbinds tooltip mouse events from the SVG element. + * @param {!Element} element SVG element onto which tooltip is bound. + */ + function unbindMouseEvents(element: Element): void; + + /** + * Dispose of the tooltip. + * @package + */ + function dispose(): void; + /** * Hide the tooltip. */ @@ -8483,6 +8687,18 @@ declare module Blockly { */ dispose(): void; + /** + * Returns true if the trashcan contents-flyout is currently open. + * @return {boolean} True if the trashcan contents-flyout is currently open. + */ + contentsIsOpen(): boolean; + + /** + * Empties the trashcan's contents. If the contents-flyout is currently open + * it will be closed. + */ + emptyContents(): void; + /** * Position the trashcan. * It is positioned in the opposite corner to the corner the @@ -8518,6 +8734,24 @@ declare module Blockly { } +declare module CustomDialog { + + /** Hides any currently visible dialog. */ + function hide(): void; + + /** + * Shows the dialog. + * Allowed options: + * - showOkay: Whether to show the OK button. + * - showCancel: Whether to show the Cancel button. + * - showInput: Whether to show the text input field. + * - onOkay: Callback to handle the okay button. + * - onCancel: Callback to handle the cancel button and backdrop clicks. + */ + function show(title: any /* jsdoc error */, message: any /* jsdoc error */, options: any /* jsdoc error */): void; +} + + declare module Blockly.Events { class Ui extends Ui__Class { } @@ -8740,7 +8974,7 @@ declare module Blockly.utils { * Converts screen coordinates to workspace coordinates. * @param {Blockly.WorkspaceSvg} ws The workspace to find the coordinates on. * @param {Blockly.utils.Coordinate} screenCoordinates The screen coordinates to - * be converted to workspace coordintaes + * be converted to workspace coordinates * @return {Blockly.utils.Coordinate} The workspace coordinates. * @package */ @@ -10573,7 +10807,6 @@ declare module Blockly { /** * True if keyboard accessibility mode is on, false otherwise. * @type {boolean} - * @package */ keyboardAccessibilityMode: boolean; @@ -10697,8 +10930,9 @@ declare module Blockly { * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu options. * @param {!Array.} options List of menu options to add to. + * @param {!Event} e The right-click event that triggered the context menu. */ - configureContextMenu(options: Object[]): void; + configureContextMenu(options: Object[], e: Event): void; /** * In a flyout, the target workspace where blocks should be placed after a drag. @@ -11215,6 +11449,13 @@ declare module Blockly { */ setScale(newScale: number): void; + /** + * Get the workspace's zoom factor. If the workspace has a parent, we call into + * the parent to get the workspace scale. + * @return {number} The workspace zoom factor. Units: (pixels / workspaceUnit). + */ + getScale(): number; + /** * Scroll the workspace to a specified offset (in pixels), keeping in the * workspace bounds. See comment on workspaceSvg.scrollX for more detail on @@ -11771,6 +12012,13 @@ declare module Blockly { */ constructor(); + /** + * Whether the component is rendered right-to-left. + * @type {boolean} + * @protected + */ + rightToLeft_: boolean; + /** * Gets the unique ID for the instance of this component. If the instance * doesn't already have an ID, generates one on the fly. @@ -11968,15 +12216,6 @@ declare module Blockly { */ getContentElement(): Element; - /** - * Returns true if the component is rendered right-to-left, false otherwise. - * The first time this function is invoked, the right-to-left rendering property - * is set if it has not been already. - * @return {boolean} Whether the control is rendered right-to-left. - * @protected - */ - isRightToLeft(): boolean; - /** * Set is right-to-left. This function should be used if the component needs * to know the rendering direction during DOM creation (i.e. before @@ -12089,7 +12328,7 @@ declare module Blockly { * It is recommended that you use one of the createNode methods instead of * creating a node directly. * @param {string} type The type of the location. - * Must be in Bockly.ASTNode.types. + * Must be in Blockly.ASTNode.types. * @param {!(Blockly.Block|Blockly.Connection|Blockly.Field|Blockly.Workspace)} * location The position in the AST. * @param {!Object=} opt_params Optional dictionary of options. @@ -12705,25 +12944,25 @@ declare module Blockly.navigation { var ACTION_TOGGLE_KEYBOARD_NAV: Blockly.Action; /** - * The action to move the cursor to the keft on a worksapce. + * The action to move the cursor to the left on a workspace. * @type {!Blockly.Action} */ var ACTION_MOVE_WS_CURSOR_LEFT: Blockly.Action; /** - * The action to move the cursor to the right on a worksapce. + * The action to move the cursor to the right on a workspace. * @type {!Blockly.Action} */ var ACTION_MOVE_WS_CURSOR_RIGHT: Blockly.Action; /** - * The action to move the cursor up on a worksapce. + * The action to move the cursor up on a workspace. * @type {!Blockly.Action} */ var ACTION_MOVE_WS_CURSOR_UP: Blockly.Action; /** - * The action to move the cursor down on a worksapce. + * The action to move the cursor down on a workspace. * @type {!Blockly.Action} */ var ACTION_MOVE_WS_CURSOR_DOWN: Blockly.Action; @@ -13081,6 +13320,30 @@ declare module Blockly.utils.dom { * @return {number} Width of element. */ function getFastTextWidth(textElement: Element, fontSize: number, fontWeight: string, fontFamily: string): number; + + /** + * Gets the width of a text element using a faster method than `getTextWidth`. + * This method requires that we know the text element's font family and size in + * advance. Similar to `getTextWidth`, we cache the width we compute. + * This method is similar to ``getFastTextWidth`` but expects the font size + * parameter to be a string. + * @param {!Element} textElement An SVG 'text' element. + * @param {string} fontSize The font size to use. + * @param {string} fontWeight The font weight to use. + * @param {string} fontFamily The font family to use. + * @return {number} Width of element. + */ + function getFastTextWidthWithSizeString(textElement: Element, fontSize: string, fontWeight: string, fontFamily: string): number; + + /** + * Measure a font's metrics. The height and baseline values. + * @param {string} text Text to measure the font dimensions of. + * @param {string} fontSize The font size to use. + * @param {string} fontWeight The font weight to use. + * @param {string} fontFamily The font family to use. + * @return {{height: number, baseline: number}} Font measurements. + */ + function measureFontMetrics(text: string, fontSize: string, fontWeight: string, fontFamily: string): { height: number; baseline: number }; } @@ -13171,6 +13434,14 @@ declare module Blockly.utils.object { */ function mixin(target: Object, source: Object): void; + /** + * Complete a deep merge of all members of a source object with a target object. + * @param {!Object} target Target. + * @param {!Object} source Source. + * @return {!Object} The resulting object. + */ + function deepMerge(target: Object, source: Object): Object; + /** * Returns an array of a given object's own enumerable property values. * @param {!Object} obj Object containing values. @@ -13442,7 +13713,7 @@ declare module Blockly.utils.svgPaths { function point(x: number, y: number): string; /** - * Draw a curbic or quadratic curve. See + * Draw a cubic or quadratic curve. See * developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Cubic_B%C3%A9zier_Curve * These coordinates are unitless and hence in the user coordinate system. * @param {string} command The command to use. @@ -13608,12 +13879,59 @@ declare module Blockly.tree { */ constructor(content: string, config: Blockly.tree.BaseNode.Config); + /** + * Text content of the node label. + * @type {string} + * @package + */ + content: string; + + /** + * @type {string} + * @package + */ + iconClass: string; + + /** + * @type {string} + * @package + */ + expandedIconClass: string; + + /** + * The configuration for the tree. + * @type {!Blockly.tree.BaseNode.Config} + * @protected + */ + config_: Blockly.tree.BaseNode.Config; + /** * @type {Blockly.tree.TreeControl} * @protected */ tree: Blockly.tree.TreeControl; + /** + * Whether the tree item is selected. + * @type {boolean} + * @protected + */ + selected_: boolean; + + /** + * Whether the tree node is expanded. + * @type {boolean} + * @protected + */ + expanded_: boolean; + + /** + * Whether to allow user to collapse this node. + * @type {boolean} + * @protected + */ + isUserCollapsible_: boolean; + /** * Adds roles and states. * @protected @@ -13666,18 +13984,6 @@ declare module Blockly.tree { */ getChildren(): Blockly.tree.BaseNode[]; - /** - * @return {Blockly.tree.BaseNode} The first child of this node. - * @protected - */ - getFirstChild(): Blockly.tree.BaseNode; - - /** - * @return {Blockly.tree.BaseNode} The last child of this node. - * @protected - */ - getLastChild(): Blockly.tree.BaseNode; - /** * @return {Blockly.tree.BaseNode} The previous sibling of this node. * @protected @@ -13708,31 +14014,12 @@ declare module Blockly.tree { */ select(): void; - /** - * Selects the first node. - * @protected - */ - selectFirst(): void; - /** * Called from the tree to instruct the node change its selection state. * @param {boolean} selected The new selection state. * @protected */ - setSelectedInternal(selected: boolean): void; - - /** - * @return {boolean} Whether the node is expanded. - * @protected - */ - getExpanded(): boolean; - - /** - * Sets the node to be expanded internally, without state change events. - * @param {boolean} expanded Whether to expand or close the node. - * @protected - */ - setExpandedInternal(expanded: boolean): void; + setSelected(selected: boolean): void; /** * Sets the node to be expanded. @@ -13743,14 +14030,14 @@ declare module Blockly.tree { /** * Used to notify a node of that we have expanded it. - * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * Can be overridden by subclasses, see Blockly.tree.TreeNode. * @protected */ doNodeExpanded(): void; /** * Used to notify a node that we have collapsed it. - * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * Can be overridden by subclasses, see Blockly.tree.TreeNode. * @protected */ doNodeCollapsed(): void; @@ -13761,12 +14048,6 @@ declare module Blockly.tree { */ toggle(): void; - /** - * @return {boolean} Whether the node is collapsible by user actions. - * @protected - */ - isUserCollapsible(): boolean; - /** * Creates HTML Element for the node. * @return {!Element} HTML element @@ -13835,35 +14116,6 @@ declare module Blockly.tree { */ getChildrenElement(): Element; - /** - * Gets the icon class for the node. - * @return {string} s The icon source. - * @protected - */ - getIconClass(): string; - - /** - * Gets the icon class for when the node is expanded. - * @return {string} The class. - * @protected - */ - getExpandedIconClass(): string; - - /** - * Sets the text of the label. - * @param {string} s The plain text of the label. - * @protected - */ - setText(s: string): void; - - /** - * Returns the text of the label. If the text was originally set as HTML, the - * return value is unspecified. - * @return {string} The plain text of the label. - * @package - */ - getText(): string; - /** * Updates the row styles. * @protected @@ -13946,12 +14198,6 @@ declare module Blockly.tree { */ getPreviousShownNode(): Blockly.tree.BaseNode; - /** - * @return {!Blockly.tree.BaseNode.Config} The configuration for the tree. - * @protected - */ - getConfig(): Blockly.tree.BaseNode.Config; - /** * Internal method that is used to set the tree control on the node. * @param {Blockly.tree.TreeControl} tree The tree control. @@ -14421,11 +14667,13 @@ declare module Blockly.blockRendering { /** * Initialize anything needed for rendering (constants, etc). * @param {!string} name Name of the renderer to initialize. + * @param {!Blockly.Theme} theme The workspace theme object. + * @param {Object=} opt_rendererOverrides Rendering constant overrides. * @return {!Blockly.blockRendering.Renderer} The new instance of a renderer. * Already initialized. * @package */ - function init(name: string): Blockly.blockRendering.Renderer; + function init(name: string, theme: Blockly.Theme, opt_rendererOverrides?: Object): Blockly.blockRendering.Renderer; } @@ -14637,12 +14885,6 @@ declare module Blockly.blockRendering { */ FIELD_TEXT_FONTSIZE: number; - /** - * Height of text. - * @type {number} - */ - FIELD_TEXT_HEIGHT: number; - /** * Text font weight. * @type {string} @@ -14655,6 +14897,20 @@ declare module Blockly.blockRendering { */ FIELD_TEXT_FONTFAMILY: string; + /** + * Height of text. This constant is dynamically set in ``setFontConstants_`` + * to be the height of the text based on the font used. + * @type {number} + */ + FIELD_TEXT_HEIGHT: number; + + /** + * Text baseline. This constant is dynamically set in ``setFontConstants_`` + * to be the baseline of the text based on the font used. + * @type {number} + */ + FIELD_TEXT_BASELINE: number; + /** * A field's border rect corner radius. * @type {number} @@ -14686,19 +14942,6 @@ declare module Blockly.blockRendering { */ FIELD_BORDER_RECT_COLOUR: string; - /** - * Field text baseline. - * This is only used if `FIELD_TEXT_BASELINE_CENTER` is false. - * @type {number} - */ - FIELD_TEXT_BASELINE_Y: number; - - /** - * An text offset adjusting the Y position of text after positioning. - * @type {number} - */ - FIELD_TEXT_Y_OFFSET: number; - /** * A field's text element's dominant baseline. * @type {boolean} @@ -14781,25 +15024,13 @@ declare module Blockly.blockRendering { */ FIELD_CHECKBOX_X_OFFSET: number; - /** - * A checkbox field's Y offset. - * @type {number} - */ - FIELD_CHECKBOX_Y_OFFSET: number; - - /** - * A checkbox field's default width. - * @type {number} - */ - FIELD_CHECKBOX_DEFAULT_WIDTH: number; - /** * A random identifier used to ensure a unique ID is used for each * filter/pattern for the case of multiple Blockly instances on a page. * @type {string} - * @protected + * @package */ - randomIdentifier_: string; + randomIdentifier: string; /** * The ID of the emboss filter, or the empty string if no filter is set. @@ -14815,6 +15046,13 @@ declare module Blockly.blockRendering { */ disabledPatternId: string; + /** + * The ID of the debug filter, or the empty string if no pattern is set. + * @type {string} + * @package + */ + debugFilterId: string; + /** * Cursor colour. * @type {string} @@ -14871,6 +15109,21 @@ declare module Blockly.blockRendering { */ FULL_BLOCK_FIELDS: boolean; + /** + * The main colour of insertion markers, in hex. The block is rendered a + * transparent grey by changing the fill opacity in CSS. + * @type {string} + * @package + */ + INSERTION_MARKER_COLOUR: string; + + /** + * The insertion marker opacity. + * @type {number} + * @package + */ + INSERTION_MARKER_OPACITY: number; + /** * Enum for connection shapes. * @enum {number} @@ -14925,7 +15178,7 @@ declare module Blockly.blockRendering { * @param {!Blockly.Theme} theme The current workspace theme. * @package */ - refreshTheme(theme: Blockly.Theme): void; + setTheme(theme: Blockly.Theme): void; /** * The block styles map. @@ -14934,6 +15187,27 @@ declare module Blockly.blockRendering { */ blockStyles: { [key: string]: Blockly.Theme.BlockStyle }; + /** + * Sets dynamic properties that depend on other values or theme properties. + * @param {!Blockly.Theme} theme The current workspace theme. + * @protected + */ + setDynamicProperties_(theme: Blockly.Theme): void; + + /** + * Set constants related to fonts. + * @param {!Blockly.Theme} theme The current workspace theme. + * @protected + */ + setFontConstants_(theme: Blockly.Theme): void; + + /** + * Set constants from a theme's component styles. + * @param {!Blockly.Theme} theme The current workspace theme. + * @protected + */ + setComponentConstants_(theme: Blockly.Theme): void; + /** * Get or create a block style based on a single colour value. Generate a name * for the style based on the colour. @@ -15055,24 +15329,28 @@ declare module Blockly.blockRendering { /** * Create any DOM elements that this renderer needs (filters, patterns, etc). * @param {!SVGElement} svg The root of the workspace's SVG. + * @param {string} tagName The name to use for the CSS style tag. + * @param {string} selector The CSS selector to use. + * @suppress {strictModuleDepCheck} Debug renderer only included in playground. * @package */ - createDom(svg: SVGElement): void; + createDom(svg: SVGElement, tagName: string, selector: string): void; /** * Inject renderer specific CSS into the page. - * @param {string} name Name of the renderer. - * @package + * @param {string} tagName The name of the style tag to use. + * @param {string} selector The CSS selector to use. + * @protected */ - injectCSS(name: string): void; + injectCSS_(tagName: string, selector: string): void; /** * Get any renderer specific CSS to inject when the renderer is initialized. - * @param {string} name Name of the renderer. + * @param {string} selector CSS selector to use. * @return {!Array.} Array of CSS strings. * @protected */ - getCSS_(name: string): string[]; + getCSS_(selector: string): string[]; } } @@ -15086,10 +15364,12 @@ declare module Blockly.blockRendering { /** * An object that renders rectangles and dots for debugging rendering code. + * @param {!Blockly.blockRendering.ConstantProvider} constants The renderer's + * constants. * @package * @constructor */ - constructor(); + constructor(constants: Blockly.blockRendering.ConstantProvider); /** * Remove all elements the this object created on the last pass. @@ -15168,6 +15448,13 @@ declare module Blockly.blockRendering { * @package */ drawDebug(block: Blockly.BlockSvg, info: Blockly.blockRendering.RenderInfo): void; + + /** + * Show a debug filter to highlight that a block has been rendered. + * @param {!SVGElement} svgPath The block's svg path. + * @package + */ + drawRender(svgPath: SVGElement): void; } } @@ -15458,7 +15745,7 @@ declare module Blockly.blockRendering { * @param {boolean} enable True if styling should be added. * @package */ - updateReplacementHighlight(enable: boolean): void; + updateReplacementFade(enable: boolean): void; } } @@ -15562,11 +15849,10 @@ declare module Blockly.blockRendering { rows: Blockly.blockRendering.Row[]; /** - * The total number of input rows added onto the block. - * @type {number} - * @protected + * An array of input rows on the block. + * @type {!Array.} */ - inputRowNum_: number; + inputRows: Blockly.blockRendering.InputRow[]; /** * An array of measurable objects containing hidden icons. @@ -15941,6 +16227,12 @@ declare module Blockly.blockRendering { */ createDomInternal_(): Element; + /** + * Apply the marker's colour. + * @protected + */ + applyColour_(): void; + /** * Dispose of this marker. * @package @@ -15997,9 +16289,9 @@ declare module Blockly.blockRendering { /** * The renderer's constant provider. * @type {!Blockly.blockRendering.ConstantProvider} - * @protected + * @package */ - constants_: Blockly.blockRendering.ConstantProvider; + constants: Blockly.blockRendering.ConstantProvider; /** * The primary path of the block. @@ -16015,6 +16307,22 @@ declare module Blockly.blockRendering { */ style: Blockly.Theme.BlockStyle; + /** + * Holds the cursors svg element when the cursor is attached to the block. + * This is null if there is no cursor on the block. + * @type {SVGElement} + * @package + */ + cursorSvg: SVGElement; + + /** + * Holds the markers svg element when the marker is attached to the block. + * This is null if there is no marker on the block. + * @type {SVGElement} + * @package + */ + markerSvg: SVGElement; + /** * Set the path generated by the renderer onto the respective SVG element. * @param {string} pathString The path. @@ -16127,7 +16435,7 @@ declare module Blockly.blockRendering { * @param {boolean} enable True if styling should be added. * @package */ - updateReplacementHighlight(enable: boolean): void; + updateReplacementFade(enable: boolean): void; /** * Add or remove styling that shows that if the dragging block is dropped, this @@ -16164,10 +16472,49 @@ declare module Blockly.blockRendering { name: string; /** - * Initialize the renderer. + * Rendering constant overrides, passed in through options. + * @type {?Object} * @package */ - init(): void; + overrides: Object; + + /** + * Gets the class name that identifies this renderer. + * @return {string} The CSS class name. + * @package + */ + getClassName(): string; + + /** + * Initialize the renderer. + * @param {!Blockly.Theme} theme The workspace theme object. + * @param {Object=} opt_rendererOverrides Rendering constant overrides. + * @package + */ + init(theme: Blockly.Theme, opt_rendererOverrides?: Object): void; + + /** + * Create any DOM elements that this renderer needs. + * @param {!SVGElement} svg The root of the workspace's SVG. + * @param {!Blockly.Theme} theme The workspace theme object. + * @package + */ + createDom(svg: SVGElement, theme: Blockly.Theme): void; + + /** + * Refresh the renderer after a theme change. + * @param {!SVGElement} svg The root of the workspace's SVG. + * @param {!Blockly.Theme} theme The workspace theme object. + * @package + */ + refreshDom(svg: SVGElement, theme: Blockly.Theme): void; + + /** + * Dispose of this renderer. + * Delete all DOM elements that this renderer and its constants created. + * @package + */ + dispose(): void; /** * Create a new instance of the renderer's constant provider. @@ -16240,13 +16587,32 @@ declare module Blockly.blockRendering { shouldHighlightConnection(_conn: Blockly.Connection): boolean; /** - * Determine whether or not to insert a dragged block into a stack. - * @param {!Blockly.Block} block The target block. - * @param {!Blockly.Connection} conn The closest connection. - * @return {boolean} True if we should insert the dragged block into the stack. + * Checks if an orphaned block can connect to the "end" of the topBlock's + * block-clump. If the clump is a row the end is the last input. If the clump + * is a stack, the end is the last next connection. If the clump is neither, + * then this returns false. + * @param {!Blockly.BlockSvg} topBlock The top block of the block clump we want to try and + * connect to. + * @param {!Blockly.BlockSvg} orphanBlock The orphan block that wants to find + * a home. + * @param {number} localType The type of the connection being dragged. + * @return {boolean} Whether there is a home for the orphan or not. * @package */ - shouldInsertDraggedBlock(block: Blockly.Block, conn: Blockly.Connection): boolean; + orphanCanConnectAtEnd(topBlock: Blockly.BlockSvg, orphanBlock: Blockly.BlockSvg, localType: number): boolean; + + /** + * Chooses a connection preview method based on the available connection, the + * current dragged connection, and the block being dragged. + * @param {!Blockly.RenderedConnection} closest The available connection. + * @param {!Blockly.RenderedConnection} local The connection currently being + * dragged. + * @param {!Blockly.BlockSvg} topBlock The block currently being dragged. + * @return {!Blockly.InsertionMarkerManager.PREVIEW_TYPE} The preview type + * to display. + * @package + */ + getConnectionPreviewMethod(closest: Blockly.RenderedConnection, local: Blockly.RenderedConnection, topBlock: Blockly.BlockSvg): Blockly.InsertionMarkerManager.PREVIEW_TYPE; /** * Render the block. @@ -16956,7 +17322,7 @@ declare module Blockly.blockRendering.Types { /** * Get the enum flag value of an existing type or register a new type. * @param {!string} type The name of the type. - * @return {!number} The enum flag value assosiated with that type. + * @return {!number} The enum flag value associated with that type. * @package */ function getType(type: string): number; From 20ce185bc382a53bcb34d6886a0c6a2dd1a6085a Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 2 Apr 2020 16:11:00 -0700 Subject: [PATCH 104/105] Update version and build (#3787) --- blockly_compressed.js | 2 +- msg/json/en.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockly_compressed.js b/blockly_compressed.js index fc250ab91..08b305a36 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -767,7 +767,7 @@ Blockly.WidgetDiv.show=function(a,b,c){Blockly.WidgetDiv.hide();Blockly.WidgetDi Blockly.WidgetDiv.hide=function(){if(Blockly.WidgetDiv.isVisible()){Blockly.WidgetDiv.owner_=null;var a=Blockly.WidgetDiv.DIV;a.style.display="none";a.style.left="";a.style.top="";Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_();Blockly.WidgetDiv.dispose_=null;a.textContent="";Blockly.WidgetDiv.rendererClassName_&&(Blockly.utils.dom.removeClass(a,Blockly.WidgetDiv.rendererClassName_),Blockly.WidgetDiv.rendererClassName_="");Blockly.WidgetDiv.themeClassName_&&(Blockly.utils.dom.removeClass(a, Blockly.WidgetDiv.themeClassName_),Blockly.WidgetDiv.themeClassName_="");Blockly.getMainWorkspace().markFocused()}};Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_};Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};Blockly.WidgetDiv.positionInternal_=function(a,b,c){Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c+"px"}; Blockly.WidgetDiv.positionWithAnchor=function(a,b,c,d){var e=Blockly.WidgetDiv.calculateY_(a,b,c);a=Blockly.WidgetDiv.calculateX_(a,b,c,d);0>e?Blockly.WidgetDiv.positionInternal_(a,0,c.height+e):Blockly.WidgetDiv.positionInternal_(a,e,c.height)};Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)}; -Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200123.0-develop";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; +Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.VERSION="3.20200402.0";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth;c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))if(b.options.readOnly)Blockly.navigation.onKeyPress(a);else{var c=!1;if(a.keyCode==Blockly.utils.KeyCodes.ESC)Blockly.hideChaff(),Blockly.navigation.onBlocklyAction(Blockly.navigation.ACTION_EXIT);else{if(Blockly.navigation.onKeyPress(a))return;if(a.keyCode==Blockly.utils.KeyCodes.BACKSPACE||a.keyCode==Blockly.utils.KeyCodes.DELETE){a.preventDefault();if(Blockly.Gesture.inProgress())return; Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(a.keyCode==Blockly.utils.KeyCodes.C?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):a.keyCode!=Blockly.utils.KeyCodes.X||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0));a.keyCode==Blockly.utils.KeyCodes.V?Blockly.clipboardXml_&&(a=Blockly.clipboardSource_, diff --git a/msg/json/en.json b/msg/json/en.json index 13f4fce06..7570be7d2 100644 --- a/msg/json/en.json +++ b/msg/json/en.json @@ -1,7 +1,7 @@ { "@metadata": { "author": "Ellen Spertus ", - "lastupdated": "2020-04-02 12:40:22.060792", + "lastupdated": "2020-04-02 16:01:48.114405", "locale": "en", "messagedocumentation" : "qqq" }, diff --git a/package.json b/package.json index 7b5b15553..58146d7c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20200123.0-develop", + "version": "3.20200402.0", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 0175d69ea58f989d31c389c2a095559f53c4e601 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 2 Apr 2020 16:35:56 -0700 Subject: [PATCH 105/105] Update package lock (#3788) --- package-lock.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd5c471c7..0e0db42f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20200123.0-develop", + "version": "3.20200402.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -469,7 +469,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" }, "array-find-index": { @@ -1680,7 +1680,7 @@ }, "entities": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, @@ -3324,7 +3324,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -3416,7 +3416,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -3428,7 +3428,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } @@ -3612,7 +3612,7 @@ }, "htmlparser2": { "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { @@ -3631,7 +3631,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -3643,7 +3643,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } @@ -3800,7 +3800,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -3847,7 +3847,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -5261,7 +5261,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -5410,7 +5410,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -5555,7 +5555,7 @@ }, "pretty-hrtime": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true }, @@ -5694,7 +5694,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -6050,7 +6050,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -6216,7 +6216,7 @@ }, "shelljs": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", "dev": true }, @@ -6553,7 +6553,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -6565,7 +6565,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } @@ -6603,7 +6603,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -6766,7 +6766,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true },