diff --git a/appengine/app.yaml b/appengine/app.yaml index 9c93fb6873d..563af8b24d0 100644 --- a/appengine/app.yaml +++ b/appengine/app.yaml @@ -70,6 +70,8 @@ handlers: # Blockly files. - url: /static static_dir: static + http_headers: + Access-Control-Allow-Origin: "*" secure: always # Storage API. diff --git a/core/gesture.ts b/core/gesture.ts index 4c65c1d3842..fa3d8a15138 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -467,6 +467,15 @@ export class Gesture { /* opt_noCaptureIdentifier */ true, ), ); + this.boundEvents.push( + browserEvents.conditionalBind( + document, + 'pointercancel', + null, + this.handleUp.bind(this), + /* opt_noCaptureIdentifier */ true, + ), + ); e.preventDefault(); e.stopPropagation(); diff --git a/core/touch.ts b/core/touch.ts index 9af3b1f9494..8fb2cd2298c 100644 --- a/core/touch.ts +++ b/core/touch.ts @@ -46,7 +46,6 @@ export const TOUCH_MAP: {[key: string]: string[]} = { 'mouseup': ['pointerup', 'pointercancel'], 'touchend': ['pointerup'], 'touchcancel': ['pointercancel'], - 'pointerup': ['pointerup', 'pointercancel'], }; /** PID of queued long-press task. */ diff --git a/core/variable_map.ts b/core/variable_map.ts index ba36dcea600..3a6cf402681 100644 --- a/core/variable_map.ts +++ b/core/variable_map.ts @@ -112,7 +112,11 @@ export class VariableMap const oldType = variable.getType(); if (oldType === newType) return variable; - this.variableMap.get(variable.getType())?.delete(variable.getId()); + const oldTypeVariables = this.variableMap.get(oldType); + oldTypeVariables?.delete(variable.getId()); + if (oldTypeVariables?.size === 0) { + this.variableMap.delete(oldType); + } variable.setType(newType); const newTypeVariables = this.variableMap.get(newType) ?? diff --git a/demos/minimap/icon.png b/demos/minimap/icon.png deleted file mode 100644 index 870caa070d8..00000000000 Binary files a/demos/minimap/icon.png and /dev/null differ diff --git a/demos/minimap/index.html b/demos/minimap/index.html deleted file mode 100644 index 1a8fd357dea..00000000000 --- a/demos/minimap/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - Blockly Demo: Minimap - - - - - - - -

Blockly > - Demos > Minimap

- -

This is a simple demo showing how a minimap can be implemented.

- - - - - - -
-
-
-
-
- - - - - - - - diff --git a/demos/minimap/minimap.js b/demos/minimap/minimap.js deleted file mode 100644 index a4343899ad6..00000000000 --- a/demos/minimap/minimap.js +++ /dev/null @@ -1,302 +0,0 @@ -/** - - * Copyright 2017 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @fileoverview JavaScript for Blockly's Minimap demo. - */ -'use strict'; - -/** - * Creating a separate namespace for minimap. - */ -var Minimap = {}; - -/** - * Initialize the workspace and minimap. - * @param {!Workspace} workspace The main workspace of the user. - * @param {!Workspace} minimap The workspace that will be used as a minimap. - */ -Minimap.init = function(workspace, minimap) { - this.workspace = workspace; - this.minimap = minimap; - - // Adding scroll callback functionality to vScroll and hScroll just for this demo. - // IMPORTANT: This should be changed when there is proper UI event handling - // API available and should be handled by workspace's event listeners. - this.workspace.scrollbar.vScroll.setHandlePosition = function(newPosition) { - this.handlePosition_ = newPosition; - this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_); - - // Code above is same as the original setHandlePosition function in core/scrollbar.js. - // New code starts from here. - - // Get the absolutePosition. - var absolutePosition = (this.handlePosition_ / this.ratio); - - // Firing the scroll change listener. - Minimap.onScrollChange(absolutePosition, this.horizontal_); - }; - - // Adding call back for horizontal scroll. - this.workspace.scrollbar.hScroll.setHandlePosition = function(newPosition) { - this.handlePosition_ = newPosition; - this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_); - - // Code above is same as the original setHandlePosition function in core/scrollbar.js. - // New code starts from here. - - // Get the absolutePosition. - var absolutePosition = (this.handlePosition_ / this.ratio); - - // Firing the scroll change listener. - Minimap.onScrollChange(absolutePosition, this.horizontal_); - }; - - - // Required to stop a positive feedback loop when user clicks minimap - // and the scroll changes, which in turn may change minimap. - this.disableScrollChange = false; - - // Listen to events on the main workspace. - this.workspace.addChangeListener(Minimap.mirrorEvent); - - //Get rectangle bounding the minimap div. - this.rect = document.getElementById('mapDiv').getBoundingClientRect(); - - // Create a svg overlay on the top of mapDiv for the minimap. - 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', - 'height': this.rect.bottom-this.rect.top, - 'width': this.rect.right-this.rect.left, - 'class': 'minimap', - }, document.getElementById('mapDiv')); - this.svg.style.top = this.rect.top + 'px'; - this.svg.style.left = this.rect.left + 'px'; - - // Creating a rectangle in the minimap that represents current view. - Blockly.utils.dom.createSvgElement('rect', { - 'width': 100, - 'height': 100, - 'class': 'mapDragger' - }, this.svg); - - // Rectangle in the minimap that represents current view. - this.mapDragger = this.svg.childNodes[0]; - - // Adding mouse events to the rectangle, to make it Draggable. - // Using Blockly.browserEvents.bind to attach mouse/touch listeners. - Blockly.browserEvents.bind( - this.mapDragger, 'mousedown', null, Minimap.mousedown); - - //When the window change, we need to resize the minimap window. - window.addEventListener('resize', Minimap.repositionMinimap); - - // Mouse up event for the minimap. - this.svg.addEventListener('mouseup', Minimap.updateMapDragger); - - //Boolean to check whether I am dragging the surface or not. - this.isDragging = false; -}; - -Minimap.mousedown = function(e) { - // Using Blockly.browserEvents.bind to attach mouse/touch listeners. - Minimap.mouseMoveBindData = Blockly.browserEvents.bind( - document, 'mousemove', null, Minimap.mousemove); - Minimap.mouseUpBindData = - Blockly.browserEvents.bind(document, 'mouseup', null, Minimap.mouseup); - - Minimap.isDragging = true; - e.stopPropagation(); -}; - -Minimap.mouseup = function(e) { - Minimap.isDragging = false; - // Removing listeners. - Blockly.browserEvents.unbind(Minimap.mouseUpBindData); - Blockly.browserEvents.unbind(Minimap.mouseMoveBindData); - Minimap.updateMapDragger(e); - e.stopPropagation(); -}; - -Minimap.mousemove = function(e) { - if (Minimap.isDragging) { - Minimap.updateMapDragger(e); - e.stopPropagation(); - } -}; - -/** - * Run non-UI events from the main workspace on the minimap. - * @param {!Blockly.Events.Abstract} event Event that triggered in the main - * workspace. - */ -Minimap.mirrorEvent = function(event) { - if (event.isUiEvent) { - return; // Don't mirror UI events. - } - // Convert event to JSON. This could then be transmitted across the net. - var json = event.toJson(); - // Convert JSON back into an event, then execute it. - var minimapEvent = Blockly.Events.fromJson(json, Minimap.minimap); - minimapEvent.run(true); - Minimap.scaleMinimap(); - Minimap.setDraggerHeight(); - Minimap.setDraggerWidth(); -}; - -/** - * Called when window is resized. Repositions the minimap overlay. - */ -Minimap.repositionMinimap = function() { - Minimap.rect = document.getElementById('mapDiv').getBoundingClientRect(); - Minimap.svg.style.top = Minimap.rect.top + 'px'; - Minimap.svg.style.left = Minimap.rect.left + 'px'; -}; - -/** - * Updates the rectangle's height. - */ -Minimap.setDraggerHeight = function() { - var workspaceMetrics = Minimap.workspace.getMetrics(); - var draggerHeight = (workspaceMetrics.viewHeight / Minimap.workspace.scale) * - Minimap.minimap.scale; - // It's zero when first block is placed. - if (draggerHeight === 0) { - return; - } - Minimap.mapDragger.setAttribute('height', draggerHeight); -}; - -/** - * Updates the rectangle's width. - */ -Minimap.setDraggerWidth = function() { - var workspaceMetrics = Minimap.workspace.getMetrics(); - var draggerWidth = (workspaceMetrics.viewWidth / Minimap.workspace.scale) * - Minimap.minimap.scale; - // It's zero when first block is placed. - if (draggerWidth === 0) { - return; - } - Minimap.mapDragger.setAttribute('width', draggerWidth); -}; - - -/** - * Updates the overall position of the viewport of the minimap by appropriately - * using translate functions. - */ -Minimap.scaleMinimap = function() { - var minimapBoundingBox = Minimap.minimap.getBlocksBoundingBox(); - var workspaceBoundingBox = Minimap.workspace.getBlocksBoundingBox(); - var workspaceMetrics = Minimap.workspace.getMetrics(); - var minimapMetrics = Minimap.minimap.getMetrics(); - - // Scaling the minimap such that all the blocks can be seen in the viewport. - // This padding is default because this is how to scrollbar(in main workspace) - // is implemented. - var topPadding = (workspaceMetrics.viewHeight) * Minimap.minimap.scale / - (2 * Minimap.workspace.scale); - var sidePadding = (workspaceMetrics.viewWidth) * Minimap.minimap.scale / - (2 * Minimap.workspace.scale); - - // If actual padding is more than half view ports height, - // change it to actual padding. - if ((workspaceBoundingBox.y * Minimap.workspace.scale - - workspaceMetrics.contentTop) * - Minimap.minimap.scale / Minimap.workspace.scale > topPadding) { - topPadding = (workspaceBoundingBox.y * Minimap.workspace.scale - - workspaceMetrics.contentTop) * - Minimap.minimap.scale / Minimap.workspace.scale; - } - - // If actual padding is more than half view ports height, - // change it to actual padding. - if ((workspaceBoundingBox.x * Minimap.workspace.scale - - workspaceMetrics.contentLeft) * - Minimap.minimap.scale / Minimap.workspace.scale > sidePadding) { - sidePadding = (workspaceBoundingBox.x * Minimap.workspace.scale - - workspaceMetrics.contentLeft) * - Minimap.minimap.scale / Minimap.workspace.scale; - } - - var scalex = (minimapMetrics.viewWidth - 2 * sidePadding) / - minimapBoundingBox.width; - var scaley = (minimapMetrics.viewHeight - 2 * topPadding) / - minimapBoundingBox.height; - Minimap.minimap.setScale(Math.min(scalex, scaley)); - - // Translating the minimap. - Minimap.minimap.translate( - -minimapMetrics.contentLeft * Minimap.minimap.scale + sidePadding, - -minimapMetrics.contentTop * Minimap.minimap.scale + topPadding); -}; - -/** - * Handles the onclick event on the minimapBoundingBox. - * Changes mapDraggers position. - * @param {!Event} e Event from the mouse click. - */ -Minimap.updateMapDragger = function(e) { - var y = e.clientY; - var x = e.clientX; - var draggerHeight = Minimap.mapDragger.getAttribute('height'); - var draggerWidth = Minimap.mapDragger.getAttribute('width'); - - var finalY = y - Minimap.rect.top - draggerHeight / 2; - var finalX = x - Minimap.rect.left - draggerWidth / 2; - - var maxValidY = (Minimap.workspace.getMetrics().contentHeight - - Minimap.workspace.getMetrics().viewHeight) * Minimap.minimap.scale; - var maxValidX = (Minimap.workspace.getMetrics().contentWidth - - Minimap.workspace.getMetrics().viewWidth) * Minimap.minimap.scale; - - if (y + draggerHeight / 2 > Minimap.rect.bottom) { - finalY = Minimap.rect.bottom - Minimap.rect.top - draggerHeight; - } else if (y < Minimap.rect.top + draggerHeight / 2) { - finalY = 0; - } - - if (x + draggerWidth / 2 > Minimap.rect.right) { - finalX = Minimap.rect.right - Minimap.rect.left - draggerWidth; - } else if (x < Minimap.rect.left + draggerWidth / 2) { - finalX = 0; - } - - // Do not go below lower bound of scrollbar. - if (finalY > maxValidY) { - finalY = maxValidY; - } - if (finalX > maxValidX) { - finalX = maxValidX; - } - Minimap.mapDragger.setAttribute('y', finalY); - Minimap.mapDragger.setAttribute('x', finalX); - // Required, otherwise creates a feedback loop. - Minimap.disableScrollChange = true; - Minimap.workspace.scrollbar.vScroll.set((finalY * Minimap.workspace.scale) / - Minimap.minimap.scale); - Minimap.workspace.scrollbar.hScroll.set((finalX * Minimap.workspace.scale) / - Minimap.minimap.scale); - Minimap.disableScrollChange = false; -}; - -/** - * Handles the onclick event on the minimapBoundingBox, parameters are passed by - * the event handler. - * @param {number} position This is the absolute position of the scrollbar. - * @param {boolean} horizontal Informs if the change event if for - * horizontal (true) or vertical (false) scrollbar. - */ -Minimap.onScrollChange = function(position, horizontal) { - if (!Minimap.disableScrollChange) { - Minimap.mapDragger.setAttribute(horizontal ? 'x' : 'y', - position * Minimap.minimap.scale / Minimap.workspace.scale); - } -}; diff --git a/demos/mobile/README.md b/demos/mobile/README.md deleted file mode 100644 index 168690e55db..00000000000 --- a/demos/mobile/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Blockly on Mobile Devices - -This directory contains three examples of running the Blockly library on mobile -devices. The `html/` directory is a example of configuring a webpage for touch -devices, with a Blockly workspace that fills the screen. - -The `mobile/html/` is also the basis for the Android and iOS demos. Each native -app copies this demo into the app's local resources, and required Blockly -library files, and hosts them in an embedded WebView. - -Thus, developers can quickly iterate within the `mobile/html/` directory, and -see changes in both the Android and iOS native apps. - -## Running the Mobile HTML Demo - -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 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, -filling the page with one large Blockly workspace. - -## The Android App - -### Build and Run - -Open the `demos/mobile/android/` directory in Android Studio. The project -files in the directory should be ready to build and run the demo in an emulator -or connected device. - -### Android Copy Tasks - -If you edit the `mobile/html/` demo to include new files, you will need to -update the native app project files to also copy those files. - -In the Android project, two Gradle tasks are responsible for the copies. -In `mobile/android/app/build.gradle`, the tasks `copyBlocklyHtmlFile` and -`copyBlocklyMoreFiles` configure the copy actions. - -## The iOS App - -### Build and Run - -Open the `demos/mobile/iOS/` directory in XCode. The project files in the -directory should be ready to build and run the demo in a simulator or connected -device. - -### iOS Copy Script - -The XCode project call out to `mobile/ios/cp_resources.sh` to copy the required -HTML and related files. If you've edited the `mobile/html/` demo to require new -files, update this script to copy these files, too. diff --git a/demos/mobile/android/.gitignore b/demos/mobile/android/.gitignore deleted file mode 100644 index 3ba2b2b61bd..00000000000 --- a/demos/mobile/android/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -/build -/captures -/app/src/main/assets/blockly -.settings -.project - -# Local Settings -local.properties - -# Project files -*.komodoproject -.gradle -*.iml -.idea - -# Build files -*.pyc -*.apk -*.ap_ -*.class -*.dex - -# OSX Files -.DS_Store - -# Windows Files -Thumb.db diff --git a/demos/mobile/android/README.md b/demos/mobile/android/README.md deleted file mode 100644 index 31f968feab4..00000000000 --- a/demos/mobile/android/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Blockly in an Android WebView - -This code demonstrates how to get Blockly running in an Android app by -embedding it in a WebView. - -### BlocklyWebViewFragment - -Most of the work is done within the fragment class `BlocklyWebViewFragment`. -This fragment instantiates the WebView, loads the HTML -(`assets/blockly/webview.html`, copied from `demos/mobile/html/index.html`), -and provides a few helper methods. - -### Copying web assets with gradle - -This android project copies the necessary files from the main Blockly -repository (i.e., parent directory). In `app/build.gradle`, note the -`copyBlocklyHtmlFile` and `copyBlocklyMoreFiles` tasks. - -In your own project, the HTML and related files can be placed directly in the -`assets/blockly` directory without the copy step. However, using the copy tasks -simplifies the synchronization with an iOS app using the same files. - -### Loading Block Definitions and Generator functions - -The `webview.html` loads the block definitions and generator functions directly -into the page, without support or coordination with the Android classes. This -assumes the app will always utilize the same blocks. This does not mean all -blocks are visible to the user all the time; that is controlled by the toolbox -and workspace files. This should accommodate almost all applications. - -This does mean loading your own block definitions and generators will involve -editing the HTML, adding you own ` - - - - - - -
- - - diff --git a/demos/mobile/html/ln_resources.sh b/demos/mobile/html/ln_resources.sh deleted file mode 100755 index 8f7a8b979bd..00000000000 --- a/demos/mobile/html/ln_resources.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -e -# -# Create symbolic links in this directory for the -# Blockly library files used by this demo's index.html. - -if [[ ! -e ../../../dist/blockly_compressed.js ]]; then - echo "ERROR: Could not locate blockly_compressed.js. Run from demos/mobile/html/" 1>&2 - exit 1 # terminate and indicate error -fi - -if [ ! -L blockly_compressed.js ]; then - ln -s ../../../dist/blockly_compressed.js blockly_compressed.js -fi -if [ ! -L blocks_compressed.js ]; then - ln -s ../../../dist/blocks_compressed.js blocks_compressed.js -fi -if [ ! -L media ]; then - ln -s ../../../media media -fi -if [ ! -L msg ]; then - ln -s ../../../build/msg msg -fi diff --git a/demos/mobile/html/toolbox_standard.js b/demos/mobile/html/toolbox_standard.js deleted file mode 100644 index 20326882fc5..00000000000 --- a/demos/mobile/html/toolbox_standard.js +++ /dev/null @@ -1,333 +0,0 @@ - -var BLOCKLY_TOOLBOX_XML = BLOCKLY_TOOLBOX_XML || Object.create(null); - -/* BEGINNING BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. USE BLOCKLY DEVTOOLS. */ -BLOCKLY_TOOLBOX_XML['standard'] = -// From XML string/file, replace ^\s?(\s*)?(<.*>)$ with \+$1'$2' -// Tweak first and last line. -'' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '123' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '9' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '45' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '0' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '3.1' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '64' -+ '' -+ '' -+ '' -+ '' -+ '10' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '50' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '1' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'text' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'abc' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '5' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ 'list' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ ',' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '100' -+ '' -+ '' -+ '' -+ '' -+ '50' -+ '' -+ '' -+ '' -+ '' -+ '0' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '#ff0000' -+ '' -+ '' -+ '' -+ '' -+ '#3333ff' -+ '' -+ '' -+ '' -+ '' -+ '0.5' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ '' -+ ''; -/* END BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. */ diff --git a/demos/mobile/ios/.gitignore b/demos/mobile/ios/.gitignore deleted file mode 100644 index 6c1f837691d..00000000000 --- a/demos/mobile/ios/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Files copied by cp_resources.sh -/Resources/Non-Localized/Blockly - - -# Xcode.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj b/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj deleted file mode 100644 index a3f72fcd431..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj +++ /dev/null @@ -1,390 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB036C54211B89D600CCC9D8 /* WebKit.framework */; }; - AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980110211A37B50025AFF2 /* AppDelegate.swift */; }; - AB980113211A37B50025AFF2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980112211A37B50025AFF2 /* ViewController.swift */; }; - AB980116211A37B50025AFF2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980114211A37B50025AFF2 /* Main.storyboard */; }; - AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB980117211A37B70025AFF2 /* Assets.xcassets */; }; - AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */; }; - ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */ = {isa = PBXBuildFile; fileRef = ABA1B7FB212214E7000D3CC5 /* Blockly */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - AB036C54211B89D600CCC9D8 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - AB98010D211A37B50025AFF2 /* Blockly WebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Blockly WebView.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - AB980110211A37B50025AFF2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - AB980112211A37B50025AFF2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - AB980115211A37B50025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - AB980117211A37B70025AFF2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - AB98011A211A37B70025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - AB98011C211A37B70025AFF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - ABA1B7FB212214E7000D3CC5 /* Blockly */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Blockly; path = "Resources/Non-Localized/Blockly"; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AB98010A211A37B50025AFF2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - AB036C53211B89D500CCC9D8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - AB036C54211B89D600CCC9D8 /* WebKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - AB980104211A37B50025AFF2 = { - isa = PBXGroup; - children = ( - AB98010F211A37B50025AFF2 /* Blockly WebView */, - AB98010E211A37B50025AFF2 /* Products */, - AB036C53211B89D500CCC9D8 /* Frameworks */, - ); - sourceTree = ""; - }; - AB98010E211A37B50025AFF2 /* Products */ = { - isa = PBXGroup; - children = ( - AB98010D211A37B50025AFF2 /* Blockly WebView.app */, - ); - name = Products; - sourceTree = ""; - }; - AB98010F211A37B50025AFF2 /* Blockly WebView */ = { - isa = PBXGroup; - children = ( - ABA1B7F9212214B9000D3CC5 /* Resources */, - AB980110211A37B50025AFF2 /* AppDelegate.swift */, - AB980112211A37B50025AFF2 /* ViewController.swift */, - AB980114211A37B50025AFF2 /* Main.storyboard */, - AB980117211A37B70025AFF2 /* Assets.xcassets */, - AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */, - AB98011C211A37B70025AFF2 /* Info.plist */, - ); - path = "Blockly WebView"; - sourceTree = ""; - }; - ABA1B7F9212214B9000D3CC5 /* Resources */ = { - isa = PBXGroup; - children = ( - ABA1B7FA212214C6000D3CC5 /* Non-Localized */, - ); - path = Resources; - sourceTree = ""; - }; - ABA1B7FA212214C6000D3CC5 /* Non-Localized */ = { - isa = PBXGroup; - children = ( - ABA1B7FB212214E7000D3CC5 /* Blockly */, - ); - path = "Non-Localized"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AB98010C211A37B50025AFF2 /* Blockly WebView */ = { - isa = PBXNativeTarget; - buildConfigurationList = AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */; - buildPhases = ( - AB980109211A37B50025AFF2 /* Sources */, - AB98010A211A37B50025AFF2 /* Frameworks */, - ABEDABD1212372E700A66667 /* ShellScript */, - AB98010B211A37B50025AFF2 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Blockly WebView"; - productName = "Blockly WebView"; - productReference = AB98010D211A37B50025AFF2 /* Blockly WebView.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AB980105211A37B50025AFF2 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0940; - LastUpgradeCheck = 0940; - ORGANIZATIONNAME = Google; - TargetAttributes = { - AB98010C211A37B50025AFF2 = { - CreatedOnToolsVersion = 9.4.1; - }; - }; - }; - buildConfigurationList = AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AB980104211A37B50025AFF2; - productRefGroup = AB98010E211A37B50025AFF2 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AB98010C211A37B50025AFF2 /* Blockly WebView */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AB98010B211A37B50025AFF2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */, - AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */, - AB980116211A37B50025AFF2 /* Main.storyboard in Resources */, - ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - ABEDABD1212372E700A66667 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ./cp_resources.sh; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - AB980109211A37B50025AFF2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AB980113211A37B50025AFF2 /* ViewController.swift in Sources */, - AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - AB980114211A37B50025AFF2 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AB980115211A37B50025AFF2 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AB98011A211A37B70025AFF2 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - AB98011D211A37B70025AFF2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - AB98011E211A37B70025AFF2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AB980120211A37B70025AFF2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3KZF7Q7Q49; - INFOPLIST_FILE = "Blockly WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AB980121211A37B70025AFF2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3KZF7Q7Q49; - INFOPLIST_FILE = "Blockly WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB98011D211A37B70025AFF2 /* Debug */, - AB98011E211A37B70025AFF2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB980120211A37B70025AFF2 /* Debug */, - AB980121211A37B70025AFF2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AB980105211A37B50025AFF2 /* Project object */; -} diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 2a4f4ae836a..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist b/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index e1e71ff066e..00000000000 --- a/demos/mobile/ios/Blockly WebView.xcodeproj/xcuserdata/marshalla.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - SchemeUserState - - Blockly WebView.xcscheme - - orderHint - 0 - - Blockly WebView.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/demos/mobile/ios/Blockly WebView/AppDelegate.swift b/demos/mobile/ios/Blockly WebView/AppDelegate.swift deleted file mode 100644 index 1f2bf6eedce..00000000000 --- a/demos/mobile/ios/Blockly WebView/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// Blockly WebView -// -// Created by Andrew Marshall on 8/7/18. -// Copyright © 2018 Google. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json b/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65fd7..00000000000 --- a/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json b/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c918..00000000000 --- a/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard b/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5810..00000000000 --- a/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard b/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard deleted file mode 100644 index 35c8fdddfc2..00000000000 --- a/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/mobile/ios/Blockly WebView/Info.plist b/demos/mobile/ios/Blockly WebView/Info.plist deleted file mode 100644 index 16be3b68112..00000000000 --- a/demos/mobile/ios/Blockly WebView/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/demos/mobile/ios/Blockly WebView/ViewController.swift b/demos/mobile/ios/Blockly WebView/ViewController.swift deleted file mode 100644 index e9f75dab465..00000000000 --- a/demos/mobile/ios/Blockly WebView/ViewController.swift +++ /dev/null @@ -1,110 +0,0 @@ -// ViewController.swift -// Blockly WebView UI controller. -// -// Created by Andrew Marshall on 8/7/18. -// Copyright © 2018 Google. All rights reserved. -// - -import UIKit -import WebKit - - -/// A basic ViewController for a WebView. -/// It handles the initial page load, and functions like window.prompt(). -class ViewController: UIViewController, WKUIDelegate { - /// The name used to reference this iOS object when executing callbacks from the JS code. - /// If this value is changed, it should also be changed in the `CODE_GENERATOR_BRIDGE_JS` file. - fileprivate static let HOST_HTML = "Blockly/webview.html" - - @IBOutlet weak var webView: WKWebView! - - /// Additional setup after loading the UI NIB. - override func viewDidLoad() { - super.viewDidLoad() - webView.uiDelegate = self - // Do any additional setup after loading the view, typically from a nib. - loadWebContent() - } - - /// Load the root HTML page into the webview. - func loadWebContent() { - if let htmlUrl = Bundle.main.url(forResource: "webview", withExtension: "html", - subdirectory: "Blockly") { - webView.load(URLRequest.init(url: htmlUrl)) - } else { - NSLog("Failed to load HTML. Could not find resource.") - } - } - - /// Handle window.alert() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptAlertPanelWithMessage message: String, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping () -> Void) { - - let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) - let title = NSLocalizedString("OK", comment: "OK Button") - let ok = UIAlertAction(title: title, style: .default) { (action: UIAlertAction) -> Void in - alert.dismiss(animated: true, completion: nil) - } - alert.addAction(ok) - present(alert, animated: true) - completionHandler() - } - - /// Handle window.confirm() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptConfirmPanelWithMessage message: String, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping (Bool) -> Void) { - - let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert) - let closeAndHandle = { (okayed: Bool) in - alert.dismiss(animated: true, completion: nil) - completionHandler(okayed) - } - - let okTitle = NSLocalizedString("OK", comment: "OK button title") - let ok = UIAlertAction(title: okTitle, style: .default) { (action: UIAlertAction) -> Void in - closeAndHandle(true) - } - alert.addAction(ok) - - let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title") - let cancel = UIAlertAction(title: cancelTitle, style: .default) { - (action: UIAlertAction) -> Void in - closeAndHandle(false) - } - alert.addAction(cancel) - present(alert, animated: true) - } - - /// Handle window.prompt() with a native dialog. - func webView(_ webView: WKWebView, - runJavaScriptTextInputPanelWithPrompt prompt: String, - defaultText: String?, - initiatedByFrame frame: WKFrameInfo, - completionHandler: @escaping (String?) -> Void) { - - let alert = UIAlertController(title: prompt, message: nil, preferredStyle: .alert) - - alert.addTextField { (textField) in - textField.text = defaultText - } - - let okTitle = NSLocalizedString("OK", comment: "OK button title") - let okAction = UIAlertAction(title: okTitle, style: .default) { (_) in - let textInput = alert.textFields![0] as UITextField - completionHandler(textInput.text) - } - alert.addAction(okAction) - - let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title") - let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel) { (_) in - completionHandler(nil) - } - alert.addAction(cancelAction) - - present(alert, animated: true) - } -} diff --git a/demos/mobile/ios/cp_resources.sh b/demos/mobile/ios/cp_resources.sh deleted file mode 100755 index afb532bc5d9..00000000000 --- a/demos/mobile/ios/cp_resources.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eux - -BLOCKLY_ROOT=../../.. -IOS_RESOURCES=Resources/Non-Localized/Blockly - -MORE_FILES_TO_COPY=( - "dist/blockly_compressed.js" - "dist/blocks_compressed.js" - "media" - "build/msg" - ) - -mkdir -p $IOS_RESOURCES/media -mkdir -p $IOS_RESOURCES/msg/js -rsync -rp ../html/index.html $IOS_RESOURCES/webview.html -rsync -rp ../html/toolbox_standard.js $IOS_RESOURCES/toolbox_standard.js -for i in "${MORE_FILES_TO_COPY[@]}"; do # The quotes are necessary here - TARGET_DIR=$(dirname $IOS_RESOURCES/$i) - rsync -rp $BLOCKLY_ROOT/$i $TARGET_DIR -done diff --git a/msg/json/constants.json b/msg/json/constants.json index ede1c1b75c2..2677e406f74 100644 --- a/msg/json/constants.json +++ b/msg/json/constants.json @@ -1,11 +1,12 @@ { - "MATH_HUE": "230", - "LOOPS_HUE": "120", + "#": "Automatically generated, do not edit this file!", + "COLOUR_HUE": "20", "LISTS_HUE": "260", "LOGIC_HUE": "210", - "VARIABLES_HUE": "330", - "TEXTS_HUE": "160", + "LOOPS_HUE": "120", + "MATH_HUE": "230", "PROCEDURES_HUE": "290", - "COLOUR_HUE": "20", - "VARIABLES_DYNAMIC_HUE": "310" -} + "TEXTS_HUE": "160", + "VARIABLES_DYNAMIC_HUE": "310", + "VARIABLES_HUE": "330" +} \ No newline at end of file diff --git a/msg/json/en.json b/msg/json/en.json index 5494d7fb09f..ec5862ae465 100644 --- a/msg/json/en.json +++ b/msg/json/en.json @@ -1,7 +1,7 @@ { "@metadata": { "author": "Ellen Spertus ", - "lastupdated": "2025-06-17 15:36:41.845826", + "lastupdated": "2025-09-08 16:26:57.642330", "locale": "en", "messagedocumentation" : "qqq" }, diff --git a/msg/json/synonyms.json b/msg/json/synonyms.json index 1af8184700d..9fc089ebea7 100644 --- a/msg/json/synonyms.json +++ b/msg/json/synonyms.json @@ -1,4 +1,5 @@ { + "#": "Automatically generated, do not edit this file!", "CONTROLS_FOREACH_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_FOR_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_IF_ELSEIF_TITLE_ELSEIF": "CONTROLS_IF_MSG_ELSEIF", @@ -7,7 +8,6 @@ "CONTROLS_IF_MSG_THEN": "CONTROLS_REPEAT_INPUT_DO", "CONTROLS_WHILEUNTIL_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO", "LISTS_CREATE_WITH_ITEM_TITLE": "VARIABLES_DEFAULT_NAME", - "LISTS_GET_INDEX_HELPURL": "LISTS_INDEX_OF_HELPURL", "LISTS_GET_INDEX_INPUT_IN_LIST": "LISTS_INLIST", "LISTS_GET_SUBLIST_INPUT_IN_LIST": "LISTS_INLIST", "LISTS_INDEX_OF_INPUT_IN_LIST": "LISTS_INLIST", @@ -19,4 +19,4 @@ "PROCEDURES_DEFRETURN_TITLE": "PROCEDURES_DEFNORETURN_TITLE", "TEXT_APPEND_VARIABLE": "VARIABLES_DEFAULT_NAME", "TEXT_CREATE_JOIN_ITEM_TITLE_ITEM": "VARIABLES_DEFAULT_NAME" -} +} \ No newline at end of file diff --git a/msg/messages.js b/msg/messages.js index b7611b4849b..1095ae05776 100644 --- a/msg/messages.js +++ b/msg/messages.js @@ -85,10 +85,10 @@ Blockly.Msg.REMOVE_COMMENT = 'Remove Comment'; /// context menu - Make a copy of the selected workspace comment.\n{{Identical|Duplicate}} Blockly.Msg.DUPLICATE_COMMENT = 'Duplicate Comment'; /** @type {string} */ -/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]]. +/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|INLINE INPUTS}}. Blockly.Msg.EXTERNAL_INPUTS = 'External Inputs'; /** @type {string} */ -/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]]. +/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|EXTERNAL INPUTS}}. Blockly.Msg.INLINE_INPUTS = 'Inline Inputs'; /** @type {string} */ /// context menu - Permanently delete the selected block. diff --git a/package-lock.json b/package-lock.json index afd057ce613..2d7aec2ea17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -15,6 +15,7 @@ "devDependencies": { "@blockly/block-test": "^7.0.2", "@blockly/dev-tools": "^9.0.2", + "@blockly/keyboard-navigation": "^3.0.1", "@blockly/theme-modern": "^7.0.1", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", @@ -199,6 +200,15 @@ "node": "*" } }, + "node_modules/@blockly/keyboard-navigation": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@blockly/keyboard-navigation/-/keyboard-navigation-3.0.1.tgz", + "integrity": "sha512-qSOPqsqRgkSLEoUeEZc81PWe558pXqY0e+4jkRODoAD+I1hMpCoD+6ivveRp7Jpb8WE1lj2PrAFOVuIVpphjHA==", + "dev": true, + "peerDependencies": { + "blockly": "^12.3.0" + } + }, "node_modules/@blockly/theme-dark": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-8.0.1.tgz", @@ -404,9 +414,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -530,9 +540,9 @@ "license": "MIT" }, "node_modules/@eslint/js": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", - "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", + "version": "9.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz", + "integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==", "dev": true, "license": "MIT", "engines": { @@ -1283,9 +1293,9 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.10.7", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.7.tgz", - "integrity": "sha512-wHWLkQWBjHtajZeqCB74nsa/X70KheyOhySYBRmVQDJiNj0zjZR/naPCvdWjMhcG1LmjaMV/9WtTo5mpe8qWLw==", + "version": "2.10.9", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.9.tgz", + "integrity": "sha512-kUGHwABarVhvMP+zhW5zvDA7LmGcd4TwrTEBwcTQic5EebUqaK5NjC0UXLJepIFVGsr2N/Z8NJQz2JYGo1ZwxA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -3223,19 +3233,18 @@ } }, "node_modules/concurrently": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.0.tgz", - "integrity": "sha512-IsB/fiXTupmagMW4MNp2lx2cdSN2FfZq78vF90LBB+zZHArbIQZjQtzXCiXnvTxCZSvXanTqFLWBjw2UkLx1SQ==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.2", - "lodash": "^4.17.21", - "rxjs": "^7.8.1", - "shell-quote": "^1.8.1", - "supports-color": "^8.1.1", - "tree-kill": "^1.2.2", - "yargs": "^17.7.2" + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" }, "bin": { "conc": "dist/bin/concurrently.js", @@ -3628,9 +3637,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1475386", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1475386.tgz", - "integrity": "sha512-RQ809ykTfJ+dgj9bftdeL2vRVxASAuGU+I9LEx9Ij5TXU5HrgAQVmzi72VA+mkzscE12uzlRv5/tWWv9R9J1SA==", + "version": "0.0.1495869", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1495869.tgz", + "integrity": "sha512-i+bkd9UYFis40RcnkW7XrOprCujXRAHg62IVh/Ah3G8MmNXpCGt1m0dTFhSdx/AVs8XEMbdOGRwdkR1Bcta8AA==", "dev": true, "license": "BSD-3-Clause" }, @@ -3985,19 +3994,19 @@ } }, "node_modules/eslint": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz", - "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", + "version": "9.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.36.0.tgz", + "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", "@eslint/config-helpers": "^0.3.1", "@eslint/core": "^0.15.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.34.0", + "@eslint/js": "9.36.0", "@eslint/plugin-kit": "^0.3.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -6937,10 +6946,11 @@ } }, "node_modules/mocha": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz", - "integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.2.tgz", + "integrity": "sha512-lkqVJPmqqG/w5jmmFtiRvtA2jkDyNVUcefFJKb2uyX4dekk8Okgqop3cgbFiaIvj8uCRJVTP5x9dfxGyXm2jvQ==", "dev": true, + "license": "MIT", "dependencies": { "browser-stdout": "^1.3.1", "chokidar": "^4.0.1", @@ -7858,14 +7868,15 @@ } }, "node_modules/prettier-plugin-organize-imports": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz", - "integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz", + "integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==", "dev": true, + "license": "MIT", "peerDependencies": { "prettier": ">=2.0", "typescript": ">=2.9", - "vue-tsc": "^2.1.0" + "vue-tsc": "^2.1.0 || 3" }, "peerDependenciesMeta": { "vue-tsc": { @@ -7955,17 +7966,18 @@ } }, "node_modules/puppeteer-core": { - "version": "24.17.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.17.0.tgz", - "integrity": "sha512-RYOBKFiF+3RdwIZTEacqNpD567gaFcBAOKTT7742FdB1icXudrPI7BlZbYTYWK2wgGQUXt9Zi1Yn+D5PmCs4CA==", + "version": "24.20.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.20.0.tgz", + "integrity": "sha512-n0y/f8EYyZt4yEJkjP3Vrqf9A4qa3uYpKYdsiedIY4bxIfTw1aAJSpSVPmWBPlr1LO4cNq2hGNIBWKPhvBF68w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.10.7", + "@puppeteer/browsers": "2.10.9", "chromium-bidi": "8.0.0", "debug": "^4.4.1", - "devtools-protocol": "0.0.1475386", + "devtools-protocol": "0.0.1495869", "typed-query-selector": "^2.12.0", + "webdriver-bidi-protocol": "0.2.8", "ws": "^8.18.3" }, "engines": { @@ -8406,19 +8418,21 @@ } }, "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/rxjs/node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/safaridriver": { "version": "1.0.0", @@ -8537,10 +8551,14 @@ } }, "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -9664,6 +9682,13 @@ "node": ">=18.20.0" } }, + "node_modules/webdriver-bidi-protocol": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.2.8.tgz", + "integrity": "sha512-KPvtVAIX8VHjLZH1KHT5GXoOaPeb0Ju+JlAcdshw6Z/gsmRtLoxt0Hw99PgJwZta7zUQaAUIHHWDRkzrPHsQTQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/webdriverio": { "version": "9.14.0", "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.14.0.tgz", diff --git a/package.json b/package.json index 7b639a872ea..de5778bdbcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "12.3.0", + "version": "12.3.1", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" @@ -102,6 +102,7 @@ "devDependencies": { "@blockly/block-test": "^7.0.2", "@blockly/dev-tools": "^9.0.2", + "@blockly/keyboard-navigation": "^3.0.1", "@blockly/theme-modern": "^7.0.1", "@hyperjump/browser": "^1.1.4", "@hyperjump/json-schema": "^1.5.0", diff --git a/tests/mocha/variable_map_test.js b/tests/mocha/variable_map_test.js index 76dffbe9dc7..b0ceec28e4c 100644 --- a/tests/mocha/variable_map_test.js +++ b/tests/mocha/variable_map_test.js @@ -258,6 +258,13 @@ suite('Variable Map', function () { assert.deepEqual(newTypeVariables, [variable]); assert.equal(variable.getType(), ''); }); + + test('removes the type from the map when the last instance is changed', function () { + const var1 = this.variableMap.createVariable('name1', 'type1'); + const var2 = this.variableMap.createVariable('name2', 'type2'); + this.variableMap.changeVariableType(var1, 'type2'); + assert.deepEqual(this.variableMap.getTypes(), ['type2']); + }); }, ); diff --git a/tests/playgrounds/advanced_playground.html b/tests/playgrounds/advanced_playground.html index 1fcbbd812a9..5c00de6ee99 100644 --- a/tests/playgrounds/advanced_playground.html +++ b/tests/playgrounds/advanced_playground.html @@ -18,6 +18,11 @@ await loadScript( '../../node_modules/@blockly/theme-modern/dist/index.js', ); + await loadScript( + '../../node_modules/@blockly/keyboard-navigation/dist/index.js', + ); + + let kbNavigation; function start() { setBackgroundColour(); @@ -47,6 +52,28 @@ // Refresh theme. ws.setTheme(ws.getTheme()); }); + + // Keyboard navigation options. + const kbOptions = { + 'Enable keyboard navigation': false, + }; + gui.remember(kbOptions); + gui.add(kbOptions, 'Enable keyboard navigation').onChange((enabled) => { + setupKeyboardNav(enabled, playground); + }); + + // Set up keyboard navigation on page load + setupKeyboardNav(kbOptions['Enable keyboard navigation'], playground); + } + + function setupKeyboardNav(enabled, playground) { + if (enabled) { + kbNavigation = new KeyboardNavigation(playground.getWorkspace()); + } else { + if (kbNavigation) { + kbNavigation.dispose(); + } + } } function initPlayground() { @@ -101,6 +128,8 @@ }; Blockly.ContextMenuItems.registerCommentOptions(); + KeyboardNavigation.registerKeyboardNavigationStyles(); + // TODO: register the navigation-deferring toolbox. createPlayground( document.getElementById('root'), @@ -153,6 +182,7 @@ +