Commit Graph

39 Commits

Author SHA1 Message Date
John Nesky
cee7f916bb feat!: Invalid Blocks (#7958)
* feat: Invalid Blocks

* Rename the new json property from invalid to invalidReasons.

* Merged isValid into isEnabled.

* Minor fixes.

* More minor fixes.

* Reverting some stuff that didn't need to change.

* Addressing PR feedback.

* Update the BlockInfo interface to match State.

* Make BlockChange.disabledReason private.
2024-04-17 19:47:51 -07:00
Neil Fraser
0ecbcde9fc chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
2024-03-15 00:03:55 +01:00
John Nesky
f246adbd26 feat: Parse newlines in JSON message as row separators. (#6944)
* feat: Parse message newlines as endOfRow dummies.

* Fix the multilineinput field test.

* Addressing PR feedback.

* Addressing PR feedback.

* Newline parsing now uses a new custom input.

* npm run format

* Added input_end_row to block factory.

* Addres feedback, fix endrow after external value.
2023-08-11 12:41:49 -07:00
Christopher Allen
5579098e35 fix(demos): Update BlockFactory generator stub generator (#7211)
Update the BlockFactory block generator function stub generator
to apply recent changes in generator function best practices:

- Use languageGenarator instead of Blockly.Language.
- Put generator functions in .forBlock dictionary.
- Accept (and use) a second argument that is the calling
  CodeGenerator object.
- User Order.ATOMIC enum instead of ORDER_ATOMIC.

Also:

- Prefix (e.g.) javascriptGenerator and Order with "javascript.".
- Use template literals where useful.
- DRY up all the non-special field stub code generation.
2023-06-27 14:36:15 +01:00
Neil Fraser
90b3f75d82 Remove @author tags (#5601)
Our files are up to a decade old, and have churned so much, that the initial author of the file no longer has much meaning.

Furthermore, this will encourage developers to post to the developer group, rather than emailing Googlers (usually me) directly.
2021-10-15 09:50:46 -07:00
Neil Fraser
c929b3015b chore: Convert == to === and != to !== where possible. (#5599) 2021-10-15 09:17:04 -07:00
Neil Fraser
d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Neil Fraser
2f2252f588 Rename variableDB_ to nameDB_
There is significant confusion in names and comments with regards to variables and procedures.  `Blockly.Generator.prototype.variableDB_` is a Blockly.Names database, not a variable map.  This rename introduces a getter and setter so deprecated references still work.  This commit also fixes some comments which are either outright wrong or misleading regarding variable and procedure names.
2021-05-27 21:30:26 -07:00
Sam El-Husseini
888e348c69 Clean out the date field (#3876) 2020-05-06 09:42:24 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -07:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini
986e965be8 Private/protected visibility cleanup (#3263)
* Fix a number of private visibility issues
2019-10-16 11:48:09 -05:00
Noah Glaser
8eb003f01f Fix capitolization error 2019-10-14 23:25:34 -07:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Beka Westberg
b149aabd16 Image Field Config (#2983)
* Added image field configuration.
2019-09-16 11:05:32 -07:00
Neil Fraser
23caa12571 Error is a constructor, ‘new’ is not required. 2019-09-12 18:02:59 -07:00
Beka Westberg
33e6fa6ed9 Fixed Block Factory XML not Getting Properly Cleaned (#2801)
* Fixed factory XML not getting properly cleaned.

* Added jsdoc.
2019-08-21 15:59:21 -07:00
Neil Fraser
ae24b544f3 Fix injection vulnerability in Block Factories.
Fixes issue #756.
2019-08-02 11:00:40 -07:00
Neil Fraser
e77a9b7e81 Change parseFloat() to Number()
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number.  An audit of each case shows nowhere that parseFloat()’s features are needed.
2019-08-01 11:36:58 -07:00
Neil Fraser
52b6ce18a5 Fix unit tests 2019-07-08 13:29:43 -07:00
Neil Fraser
cbd944106c Strip silly code
Sigh.
2019-06-26 13:55:55 -07:00
Beka Westberg
ce816b93bf Added field_label_serializable. (#2399) 2019-04-24 10:43:09 -07:00
Beka Westberg
969687ec34 Added flipRtl Support for FieldImages (#2203)
* Added flipRtl support for FieldImages. Added a flipRtl test block.

* Added blockfactory support.

* Fixed JSDoc.
2019-01-10 08:59:35 -08:00
Andrew n marshall
2747396cd3 Fixes to handling <pre> text content. 2018-06-25 13:20:10 -07:00
Andrew n marshall
b4cfe263fa Removing (most) Closure from BlockFactory (#1925)
Replacing all Closure goog. library calls from BlockFactory, with the exception of the ColorPicker and the test for the warning about running without Closure. This includes (almost) all goog.provide and goog.require statements.
2018-06-15 15:29:41 -07:00
Andrew n marshall
1956baa963 BlockFactory: Adding JSON/JavaScript import support (#1235)
Updates the BlockFactory main workspace based on the preview block generated from manual construction.

This is a continuation of PR #1216 by @JC-Orozco, rebased on latest develop branch. Bring it latest code up to Google styling and standards.
2017-08-17 12:40:58 -07:00
Andrew n marshall
3840b3804f Replacing latest prettifier hosted in repo with latest version at rawgit CDN. (#1120) 2017-05-22 12:09:23 -07:00
Rachel Fenichel
7395c24bf0 Fix apostrophe in tooltips and helpurls (#1111) 2017-05-19 16:14:53 -07:00
picklesrus
bdc5a02922 Fix #698 by adjusting the regex to not have \. Still not 100% sure w… (#700)
* Fix #698 by adjusting the regex to not have \.  Still not 100% sure why that was there.
Also replaces bad names on input.  There are probably more invalid names but this is
a start.
2016-12-09 17:19:17 -08:00
Rachel Fenichel
99c30007a7 Generate helpURL and tooltip for Javascript block definition 2016-12-08 14:41:40 -08:00
Rachel Fenichel
4871ff9fda Start getting helpurl and tooltip in 2016-12-08 14:26:53 -08:00
Neil Fraser
98c341bcfb Allow images in dropdown menus. 2016-11-05 00:17:07 -07:00
Neil Fraser
4f08f2536f Replace category colour pallet with correctly calculated colours. 2016-10-23 01:05:13 -07:00
Neil Fraser
a2e7481d04 Stop block exporter options from jumping around. 2016-10-14 08:29:48 -07:00
Neil Fraser
7255ec0eec Fix #693, this time correctly. 2016-10-14 02:00:43 -07:00
picklesrus
88dba494b9 Commit 941bdcd187 swapped caseInsensitiveCompare with toLowerCase but forgot to swap the check so it reversed the (#693)
error case. Fixing.
2016-10-12 11:06:09 -07:00
Neil Fraser
941bdcd187 Remove a bunch of Closure from Block Factory. 2016-10-11 16:50:13 -07:00
Neil Fraser
5df55ddea0 Block(ly) Factory prompts should have defaults. Drop unused copy of colourpicker code. 2016-10-11 12:16:17 -07:00
picklesrus
c102734ccb Replace Block Factory with Blockly Factory. Save Block Factory in blockfactory_old for safety. (#691)
Keep icon.png and blocks.js back into blockfactory rather than pointing to blockfactory_old.
2016-10-11 11:25:07 -07:00