Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v10.2.0 #7542

Merged
merged 104 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
68a8a5f
feat: add basic pasters (#7331)
BeksOmega Jul 31, 2023
74c01d2
chore: fix paster exports and registration (#7343)
BeksOmega Jul 31, 2023
ce1678e
fix: refactor CopyData interface to have the correct structure (#7344)
BeksOmega Aug 1, 2023
001d9ff
feat: make ICopyable generic and update clipboard APIs (#7348)
BeksOmega Aug 3, 2023
a901c62
fix: bumping copied objects (#7349)
BeksOmega Aug 9, 2023
7bca438
Revert "fix: removed X & Y from toolbox.ts and replaced movBy to move…
BeksOmega Aug 10, 2023
a8fca2d
Merge pull request #7378 from google/master
ericblackmonGoogle Aug 10, 2023
8b6c780
fix: remove specific warning text (#7376)
maribethb Aug 11, 2023
e30c4ac
chore: upgrade keyboard shortcuts and context menus to use non-deprec…
BeksOmega Aug 11, 2023
be2a6bb
feat: Export shape interfaces from ConstantProvider (#7373)
varshneydevansh Aug 11, 2023
1a41891
feat: merge copy paste work into develop
BeksOmega Aug 11, 2023
f246adb
feat: Parse newlines in JSON message as row separators. (#6944)
johnnesky Aug 11, 2023
cd9b0c1
chore(deps): Bump google-closure-compiler (#7389)
dependabot[bot] Aug 14, 2023
18ee0ec
fix: insertion marker's next blocks become real block (#7384)
HollowMan6 Aug 14, 2023
86f3182
Merge pull request #7393 from google/master
ericblackmonGoogle Aug 14, 2023
5b5a565
refactor(tests): Introduce loading shims, use in playgrounds (#7380)
cpcallen Aug 14, 2023
754448a
chore(deps): Bump patch-package from 7.0.0 to 8.0.0 (#7388)
dependabot[bot] Aug 14, 2023
bb33531
deprecate: workspace paste (#7356)
BeksOmega Aug 15, 2023
51be076
fix(build): Fix import of parent chunk's shim (#7398)
cpcallen Aug 16, 2023
b4ce6af
feat: add doFullSerialization support to blocks (#7363)
BeksOmega Aug 16, 2023
d32a13c
fix(tests): wait for the workspace to render before starting test act…
rachel-fenichel Aug 16, 2023
9efd944
fix: block change serialization (#7400)
BeksOmega Aug 16, 2023
10ab873
chore: fix docs in FieldImage (#7403)
rachel-fenichel Aug 16, 2023
d5c7105
chore(deps): Bump @microsoft/api-documenter from 7.22.20 to 7.22.33 (…
dependabot[bot] Aug 16, 2023
b602f21
feat: add accessors for the workspace svg group and block canvas (#7394)
BeksOmega Aug 16, 2023
d87386e
chore: Update README.md (#7404)
rachel-fenichel Aug 17, 2023
0dd814d
chore: update PR template and add info for new contribs (#7405)
maribethb Aug 17, 2023
82f6ca5
fix: saveConnections listener not being disposed (#7407)
BeksOmega Aug 17, 2023
60aa99a
chore: clean up measurement code in mini workspace bubble (#7408)
rachel-fenichel Aug 17, 2023
cb0f703
feat: add custom context menu rendering (#7409)
BeksOmega Aug 17, 2023
6f20ac2
refactor(tests): Use `import` instead of `goog.bootstrap` to load Blo…
cpcallen Aug 18, 2023
a38340b
chore(tests): set browser pause time in one place and enable toolbox …
rachel-fenichel Aug 19, 2023
eebf19c
chore(deps): Bump @typescript-eslint/eslint-plugin from 6.1.0 to 6.4.…
dependabot[bot] Aug 21, 2023
a0301a2
feat: make generator quoting methods public (#7392)
BeksOmega Aug 21, 2023
9909868
fix: Always draw dragged blocks atop others in the workspace. (#6874)
gonfunko Aug 21, 2023
9310677
feat: make ordered argument optional for workspace functions (#7424)
randrei12 Aug 22, 2023
d6d1074
chore: make ordered argument optional for workspace_svg functions (#7…
rachel-fenichel Aug 22, 2023
b9a7a0c
fix: do not create extra shadow blocks when mirroring events (#7427)
maribethb Aug 23, 2023
9d85afc
chore(deps): Bump eslint-plugin-jsdoc from 46.2.6 to 46.5.0 (#7417)
dependabot[bot] Aug 23, 2023
c8c1d26
chore(deps): Bump eslint-config-prettier from 8.8.0 to 9.0.0 (#7419)
dependabot[bot] Aug 23, 2023
2fce8ad
chore(deps): Bump @blockly/dev-tools from 7.0.2 to 7.0.3 (#7418)
dependabot[bot] Aug 23, 2023
7e3472c
fix: dragging blocks within a zoomed mutator (#7423)
BeksOmega Aug 24, 2023
9db853d
Revert "fix: insertion marker's next blocks become real block (#7384)…
rachel-fenichel Aug 24, 2023
51651df
Revert "feat: Insertion marker json deserialization 7316 (#7364)" (#7…
rachel-fenichel Aug 24, 2023
8823abd
chore: Merge master back into develop following v10.1.3 release
rachel-fenichel Aug 24, 2023
fb6c3dc
chore(deps): Bump @blockly/theme-modern from 5.0.0 to 5.0.1 (#7438)
dependabot[bot] Aug 28, 2023
650e620
Prevent raw content being served from storage. (#7443)
NeilFraser Aug 28, 2023
8193cff
chore: clean up mutator tests (#7434)
BeksOmega Aug 28, 2023
7ddbb83
chore(deps): Bump eslint from 8.43.0 to 8.48.0 (#7436)
dependabot[bot] Aug 30, 2023
7e9d1eb
chore(deps): Bump typescript from 5.1.3 to 5.2.2 (#7440)
dependabot[bot] Aug 30, 2023
be809d9
refactor(tests): Migrate generator tests to `import` shims; delete `b…
cpcallen Aug 30, 2023
b0a7c00
refactor(build): Delete Closure Library (#7415)
cpcallen Aug 30, 2023
68261e5
feat: add getVariableName and getProcedureName to CodeGenerator (#7445)
maribethb Aug 31, 2023
a2a9ab1
fix: insertion marker position when connection is resized (#7426)
clementcontet Sep 4, 2023
4b81c23
chore(deps): Bump @wdio/selenium-standalone-service (#7457)
dependabot[bot] Sep 5, 2023
9390796
chore(deps): Bump prettier from 3.0.0 to 3.0.3 (#7458)
dependabot[bot] Sep 6, 2023
3448616
fix: connection highlight not disposed when block deleted (#7454)
BeksOmega Sep 6, 2023
0d2879b
chore: remove unused sections from PR template (#7465)
BeksOmega Sep 6, 2023
1b2e912
chore: Use JSON objects for context menu callbackFactory (#7382)
johnnesky Sep 8, 2023
4eba35e
fix: doFullSerialization for insertion markers (#7467)
BeksOmega Sep 11, 2023
b1d25b5
chore(deps): Bump @typescript-eslint/eslint-plugin from 6.4.0 to 6.6.…
dependabot[bot] Sep 11, 2023
07fec20
chore: Tweak issue templates (#7455)
cpcallen Sep 11, 2023
b95067b
chore: position insertion marker in a single function
clementcontet Sep 12, 2023
e7030a1
refactor(build): Remove `closure-make-deps` and `closure-calculate-ch…
cpcallen Sep 12, 2023
6d63f3c
feat(tests): add helper to get a clickable element on a block
rachel-fenichel Sep 12, 2023
1f5dc25
fix(tests): use new helper function for right-clicks
rachel-fenichel Sep 12, 2023
6a920a8
fix(tests): use new helper function for right-clicks
rachel-fenichel Sep 12, 2023
8d6eb80
chore(tests): use new helper function in delete tests
rachel-fenichel Sep 12, 2023
cad3d4b
chore(tests): format
rachel-fenichel Sep 12, 2023
36b00fb
chore: format
clementcontet Sep 13, 2023
c59a52a
chore(deps): Bump @hyperjump/json-schema from 1.5.1 to 1.5.2 (#7475)
dependabot[bot] Sep 13, 2023
c2e6ed8
chore(deps): Bump eslint-plugin-jsdoc from 46.5.0 to 46.6.0 (#7476)
dependabot[bot] Sep 13, 2023
58c0e09
chore(deps): Bump selenium-standalone from 8.3.0 to 9.1.1 (#7459)
dependabot[bot] Sep 13, 2023
6415054
chore(deps): Bump actions/checkout from 3 to 4 (#7474)
dependabot[bot] Sep 13, 2023
1f0f733
chore: Remove 'cgi' import from Python (#7479)
NeilFraser Sep 13, 2023
fc76981
Merge pull request #7482 from clementcontet/fix-7426
rachel-fenichel Sep 13, 2023
5ee26c9
feat: use block instead of block ID in getClickableBlockElement
rachel-fenichel Sep 13, 2023
67f42f0
chore(tests): rewrite getClickableBlockElement as clickBlock
rachel-fenichel Sep 13, 2023
00d870e
Merge pull request #7485 from rachel-fenichel/clickableElement
rachel-fenichel Sep 13, 2023
cc3c0d9
fix: minor issues in browser tests
rachel-fenichel Sep 14, 2023
25d15fd
fix: zelos full block fields rendering badly (#7490)
BeksOmega Sep 14, 2023
d7cb893
chore(deps): Bump chai from 4.3.7 to 4.3.8 (#7498)
dependabot[bot] Sep 18, 2023
dd88f7b
chore(deps): Bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.7.…
dependabot[bot] Sep 18, 2023
e914c48
chore(deps): Bump eslint-plugin-jsdoc from 46.6.0 to 46.8.1 (#7496)
dependabot[bot] Sep 18, 2023
bd7334f
chore(deps): Bump webdriverio from 8.13.10 to 8.16.10 (#7495)
dependabot[bot] Sep 18, 2023
3806137
chore(deps): Bump @blockly/dev-tools from 7.0.3 to 7.1.0 (#7499)
dependabot[bot] Sep 18, 2023
c3b7d42
Merge pull request #7493 from rachel-fenichel/minor_browser_fixes
rachel-fenichel Sep 18, 2023
b22656b
chore(deps): update webdriverio to 8.16 and stop using selenium-stand…
rachel-fenichel Sep 18, 2023
550443f
chore(deps): remove selenium config and macOS test setup
rachel-fenichel Sep 18, 2023
f8a134c
fix: immediately render for JavaFX (#7502)
BeksOmega Sep 18, 2023
32c9daf
fix: bad JSON state leaving events disabled (#7501)
BeksOmega Sep 19, 2023
61cdbb6
chore: Setting style property to make CSP less grumpy. (#7503)
NeilFraser Sep 19, 2023
ed043e7
Merge pull request #7500 from rachel-fenichel/update_webdriverio
rachel-fenichel Sep 19, 2023
3b234c7
fix: Call onFinishEditing_ for fields on mobile. (#7483)
laurensvalk Sep 20, 2023
12ac358
fix: loading tooltips before messages (#7504)
BeksOmega Sep 20, 2023
4a6d439
fix: incorrect blockchange firing (#7492)
devbysn Sep 21, 2023
03bf464
chore(deps): Bump chai from 4.3.7 to 4.3.8 (#7513)
dependabot[bot] Sep 22, 2023
4bb115f
chore: Rollup of 2023 Q3 updates from TranslateWiki (#7540)
rachel-fenichel Sep 25, 2023
9089661
chore: Update metadata for release (#7541)
rachel-fenichel Sep 25, 2023
fd87350
chore(deps): Bump concurrently from 8.2.0 to 8.2.1 (#7509)
dependabot[bot] Sep 25, 2023
13a05cf
release: Merge branch 'develop' into rc/v10.2.0
rachel-fenichel Sep 25, 2023
3c99c38
release: Update version number to 10.2.0
rachel-fenichel Sep 25, 2023
c62f335
fix(build): Fix broken npm install of Closure Compiler (#7547)
cpcallen Sep 27, 2023
f8bd6be
fix(build): Fix sourcemaps, re-update metadata (#7550)
cpcallen Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: Create a report to help us improve
name: Report a bug 🐛
description: Report bugs in Blockly, so we can fix them.
labels: 'issue: bug, issue: triage'
body:
- type: markdown
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
contact_links:
- name: Blockly Forum
- name: Ask a question ❓
url: https://groups.google.com/forum/#!forum/blockly
about: The Blockly developer forum, where you can ask and answer questions.
- name: Plugins and examples
about: Go to the Blockly developer forum, where you can ask and answer questions.
- name: Report issues with plugins and examples 🧩
url: https://github.com/google/blockly-samples/issues/new/choose
about: File bugs or feature requests about plugins and samples in our blockly-samples repository.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Documentation
description: Report an issue with our documentation
name: Report a documentation problem 📖
description: Could our documentation be better? Tell us how.
labels: 'issue: docs, issue: triage'
body:
- type: markdown
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Feature request
description: Suggest an idea for this project
name: Make a feature request
description: Suggest an idea to make Blockly better.
labels: 'issue: feature request, issue: triage'
body:
- type: markdown
Expand Down
13 changes: 1 addition & 12 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

<!-- TODO: Verify the following, checking each box with an 'x' between the brackets: [x] -->

- [ ] I branched from develop
- [ ] My pull request is against develop
- [ ] My code follows the [style guide](https://developers.google.com/blockly/guides/modify/web/style-guide)
- [ ] I ran `npm run format` and `npm run lint`
- [ ] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)

## The details
### Resolves
Expand All @@ -22,14 +19,6 @@ Fixes

<!-- TODO: Describe what this Pull Request does. Include screenshots if applicable. -->

#### Behavior Before Change

<!--TODO: Image, gif or explanation of behavior before this pull request. -->

#### Behavior After Change

<!--TODO: Image, gif or explanation of behavior after this pull request. -->

### Reason for Changes

<!--TODO: Explain why these changes should be made. Include screenshots if applicable. -->
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/appengine_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
# When running manually this checks out the master branch.
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Prepare demo files
# Install all dependencies, then copy all the files needed for demos.
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/browser_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

Expand All @@ -45,10 +45,6 @@ jobs:
if: runner.os == 'Linux'
run: source ./tests/scripts/setup_linux_env.sh

- name: MacOS Test Setup
if: runner.os == 'macOS'
run: source ./tests/scripts/setup_osx_env.sh

- name: Run Build
run: npm run build

Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

Expand All @@ -44,10 +44,6 @@ jobs:
if: runner.os == 'Linux'
run: source ./tests/scripts/setup_linux_env.sh

- name: MacOS Test Setup
if: runner.os == 'macOS'
run: source ./tests/scripts/setup_osx_env.sh

- name: Run
run: npm run test

Expand All @@ -58,7 +54,7 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v3
Expand All @@ -75,7 +71,7 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v3
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/welcome_new_contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
pull_request_target:
types:
- opened
name: Welcome new contributors
jobs:
welcome:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: >
Welcome! It looks like this is your first pull request in Blockly,
so here are a couple of tips:

- You can find tips about contributing to Blockly and how to
validate your changes on our
[developer site](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change).

- All contributors must sign the Google Contributor License
Agreement (CLA). If the google-cla bot leaves a comment on this
PR, make sure you follow the instructions.

- We use [conventional commits](https://www.conventionalcommits.org/)
to make versioning the package easier. Make sure your commit
message is in the [proper format](https://developers.google.com/blockly/guides/contribute/get-started/commits)
or [learn how to fix it](https://developers.google.com/blockly/guides/contribute/get-started/commits#fixing_non-conventional_commits).

- If any of the other checks on this PR fail, you can click on
them to learn why. It might be that your change caused a test
failure, or that you need to double-check the
[style guide](https://developers.google.com/blockly/guides/contribute/core/style_guide).

Thank you for opening this PR! A member of the Blockly team will review it soon.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Want to make Blockly better? We welcome contributions to Blockly in the form of

## Releases

We release by pushing the latest code to the master branch, followed by updating the npm package, our [docs](https://developers.google.com/blockly), and [demo pages](https://google.github.io/blockly-samples/). We typically release a new version of Blockly once a quarter (every 3 months). If there are breaking bugs, such as a crash when performing a standard action or a rendering issue that makes Blockly unusable, we will cherry-pick fixes to master between releases to fix them. The [releases page](https://github.com/google/blockly/releases) has a list of all releases.
We release by pushing the latest code to the master branch, followed by updating the npm package, our [docs](https://developers.google.com/blockly), and [demo pages](https://google.github.io/blockly-samples/). If there are breaking bugs, such as a crash when performing a standard action or a rendering issue that makes Blockly unusable, we will cherry-pick fixes to master between releases to fix them. The [releases page](https://github.com/google/blockly/releases) has a list of all releases.

We use [semantic versioning](https://semver.org/). Releases that have breaking changes or are otherwise not backwards compatible will have a new major version. Patch versions are reserved for bug-fix patches between scheduled releases.

Expand Down Expand Up @@ -72,15 +72,7 @@ Unreleased APIs may change radically. Anything that is in `develop` but not `mas

## Issues and Milestones

We typically triage all bugs within 2 working days, which includes adding any appropriate labels and assigning it to a milestone. Please keep in mind, we are a small team so even feature requests that everyone agrees on may not be prioritized.

### Milestones

**Upcoming release** - The upcoming release milestone is for all bugs we plan on fixing before the next release. This typically has the form of `year_quarter_release` (such as `2019_q2_release`). Some bugs will be added to this release when they are triaged, others may be added closer to a release.

**Bug Bash Backlog** - These are bugs that we're still prioritizing. They haven't been added to a specific release yet, but we'll consider them for each release depending on relative priority and available time.

**Icebox** - These are bugs that we do not intend to spend time on. They are either too much work or minor enough that we don't expect them to ever take priority. We are still happy to accept pull requests for these bugs.
We typically triage all bugs within 1 week, which includes adding any appropriate labels and assigning it to a milestone. Please keep in mind, we are a small team so even feature requests that everyone agrees on may not be prioritized.

## Good to Know

Expand Down
2 changes: 2 additions & 0 deletions appengine/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ BlocklyStorage.handleRequest_ = function() {
BlocklyStorage.alert(BlocklyStorage.HASH_ERROR.replace('%1',
window.location.hash));
} else {
// Remove poison line to prevent raw content from being served.
data = data.replace(/^\{\[\(\< UNTRUSTED CONTENT \>\)\]\}\n/, '');
BlocklyStorage.loadXml_(data, BlocklyStorage.httpRequest_.workspace);
}
}
Expand Down
48 changes: 37 additions & 11 deletions appengine/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
limitations under the License.
"""

"""Store and retrieve XML with App Engine.
"""Store and retrieve Blockly XML/JSON with App Engine.
"""

__author__ = "[email protected] (Quynh Neutron)"

import cgi
import hashlib
from random import randint
from google.cloud import ndb
from random import randint
from urllib.parse import unquote


class Xml(ndb.Model):
Expand All @@ -32,6 +32,7 @@ class Xml(ndb.Model):
xml_content = ndb.TextProperty()
last_accessed = ndb.DateTimeProperty(auto_now=True)


def keyGen():
# Generate a random string of length KEY_LEN.
KEY_LEN = 6
Expand All @@ -40,8 +41,23 @@ def keyGen():
return "".join([CHARS[randint(0, max_index)] for x in range(KEY_LEN)])


# Parse POST data (e.g. a=1&b=2) into a dictionary (e.g. {"a": 1, "b": 2}).
# Very minimal parser. Does not combine repeated names (a=1&a=2), ignores
# valueless names (a&b), does not support isindex or multipart/form-data.
def parse_post(environ):
fp = environ["wsgi.input"]
data = fp.read().decode()
parts = data.split("&")
dict = {}
for part in parts:
tuple = part.split("=", 1)
if len(tuple) == 2:
dict[tuple[0]] = unquote(tuple[1])
return dict


def xmlToKey(xml_content):
# Store XML and return a generated key.
# Store XML/JSON and return a generated key.
xml_hash = int(hashlib.sha1(xml_content.encode("utf-8")).hexdigest(), 16)
xml_hash = int(xml_hash % (2 ** 64) - (2 ** 63))
client = ndb.Client()
Expand All @@ -65,7 +81,7 @@ def xmlToKey(xml_content):


def keyToXml(key_provided):
# Retrieve stored XML based on the provided key.
# Retrieve stored XML/JSON based on the provided key.
# Normalize the string.
key_provided = key_provided.lower().strip()
# Check datastore for a match.
Expand All @@ -80,20 +96,30 @@ def keyToXml(key_provided):
with client.context():
result.put()
xml = result.xml_content
# Add a poison line to prevent raw content from being served.
xml = "{[(< UNTRUSTED CONTENT >)]}\n" + xml
return xml


def app(environ, start_response):
forms = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ)
headers = [
("Content-Type", "text/plain")
]
if environ["REQUEST_METHOD"] != "POST":
start_response("405 Method Not Allowed", headers)
return ["Storage only accepts POST".encode("utf-8")]
if ("CONTENT_TYPE" in environ and
environ["CONTENT_TYPE"] != "application/x-www-form-urlencoded"):
start_response("405 Method Not Allowed", headers)
return ["Storage only accepts application/x-www-form-urlencoded".encode("utf-8")]

forms = parse_post(environ)
if "xml" in forms:
out = xmlToKey(forms["xml"].value)
out = xmlToKey(forms["xml"])
elif "key" in forms:
out = keyToXml(forms["key"].value)
out = keyToXml(forms["key"])
else:
out = ""

headers = [
("Content-Type", "text/plain")
]
start_response("200 OK", headers)
return [out.encode("utf-8")]
3 changes: 1 addition & 2 deletions blocks/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks');
// Former goog.module ID: Blockly.libraryBlocks

import * as colour from './colour.js';
import * as lists from './lists.js';
Expand Down
3 changes: 1 addition & 2 deletions blocks/colour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks.colour');
// Former goog.module ID: Blockly.libraryBlocks.colour

import {
createBlockDefinitionsFromJsonArray,
Expand Down
3 changes: 1 addition & 2 deletions blocks/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks.lists');
// Former goog.module ID: Blockly.libraryBlocks.lists

import * as fieldRegistry from '../core/field_registry.js';
import * as xmlUtils from '../core/utils/xml.js';
Expand Down
3 changes: 1 addition & 2 deletions blocks/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks.logic');
// Former goog.module ID: Blockly.libraryBlocks.logic

import * as Events from '../core/events/events.js';
import * as Extensions from '../core/extensions.js';
Expand Down
15 changes: 6 additions & 9 deletions blocks/loops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks.loops');
// Former goog.module ID: Blockly.libraryBlocks.loops

import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js';
import type {Block} from '../core/block.js';
Expand All @@ -16,8 +15,6 @@ import type {
} from '../core/contextmenu_registry.js';
import * as Events from '../core/events/events.js';
import * as Extensions from '../core/extensions.js';
import * as Variables from '../core/variables.js';
import * as xmlUtils from '../core/utils/xml.js';
import {Msg} from '../core/msg.js';
import {
createBlockDefinitionsFromJsonArray,
Expand Down Expand Up @@ -273,15 +270,15 @@ const CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
const variable = varField.getVariable()!;
const varName = variable.name;
if (!this.isCollapsed() && varName !== null) {
const xmlField = Variables.generateVariableFieldDom(variable);
const xmlBlock = xmlUtils.createElement('block');
xmlBlock.setAttribute('type', 'variables_get');
xmlBlock.appendChild(xmlField);
const getVarBlockState = {
type: 'variables_get',
fields: {VAR: varField.saveState(true)},
};

options.push({
enabled: true,
text: Msg['VARIABLES_SET_CREATE_GET'].replace('%1', varName),
callback: ContextMenu.callbackFactory(this, xmlBlock),
callback: ContextMenu.callbackFactory(this, getVarBlockState),
});
}
},
Expand Down
3 changes: 1 addition & 2 deletions blocks/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as goog from '../closure/goog/goog.js';
goog.declareModuleId('Blockly.libraryBlocks.math');
// Former goog.module ID: Blockly.libraryBlocks.math

import * as Extensions from '../core/extensions.js';
import type {FieldDropdown} from '../core/field_dropdown.js';
Expand Down
Loading
Loading