mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Merge pull request #8292 from google/develop
chore: merge develop into rc/v12
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -37,8 +37,8 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Npm Install
|
||||
run: npm install
|
||||
- name: Npm Clean Install
|
||||
run: npm ci
|
||||
|
||||
- name: Linux Test Setup
|
||||
if: runner.os == 'Linux'
|
||||
|
||||
@@ -109,6 +109,14 @@ export class BlockSvg
|
||||
*/
|
||||
width = 0;
|
||||
|
||||
/**
|
||||
* Width of this block, not including any connected value blocks.
|
||||
* Width is in workspace units.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
childlessWidth = 0;
|
||||
|
||||
/**
|
||||
* Map from IDs for warnings text to PIDs of functions to apply them.
|
||||
* Used to be able to maintain multiple warnings.
|
||||
@@ -436,8 +444,28 @@ export class BlockSvg
|
||||
* @returns Object with coordinates of the bounding box.
|
||||
*/
|
||||
getBoundingRectangle(): Rect {
|
||||
return this.getBoundingRectangleWithDimensions(this.getHeightWidth());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the coordinates of a bounding box describing the dimensions of this
|
||||
* block alone.
|
||||
* Coordinate system: workspace coordinates.
|
||||
*
|
||||
* @returns Object with coordinates of the bounding box.
|
||||
*/
|
||||
getBoundingRectangleWithoutChildren(): Rect {
|
||||
return this.getBoundingRectangleWithDimensions({
|
||||
height: this.height,
|
||||
width: this.width,
|
||||
});
|
||||
}
|
||||
|
||||
private getBoundingRectangleWithDimensions(blockBounds: {
|
||||
height: number;
|
||||
width: number;
|
||||
}) {
|
||||
const blockXY = this.getRelativeToSurfaceXY();
|
||||
const blockBounds = this.getHeightWidth();
|
||||
let left;
|
||||
let right;
|
||||
if (this.RTL) {
|
||||
|
||||
@@ -161,6 +161,7 @@ import {Marker} from './keyboard_nav/marker.js';
|
||||
import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js';
|
||||
import {MarkerManager} from './marker_manager.js';
|
||||
import type {LayerManager} from './layer_manager.js';
|
||||
import * as layers from './layers.js';
|
||||
import {Menu} from './menu.js';
|
||||
import {MenuItem} from './menuitem.js';
|
||||
import {MetricsManager} from './metrics_manager.js';
|
||||
@@ -585,3 +586,4 @@ export {ZoomControls};
|
||||
export {config};
|
||||
export {inject};
|
||||
export {serialization};
|
||||
export {layers};
|
||||
|
||||
@@ -7,13 +7,11 @@
|
||||
/**
|
||||
* The layer to place blocks on.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export const BLOCK = 50;
|
||||
|
||||
/**
|
||||
* The layer to place bubbles on.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export const BUBBLE = 100;
|
||||
|
||||
@@ -80,6 +80,7 @@ export class Drawer {
|
||||
// The dark path adds to the size of the block in both X and Y.
|
||||
this.block_.height = this.info_.height;
|
||||
this.block_.width = this.info_.widthWithChildren;
|
||||
this.block_.childlessWidth = this.info_.width;
|
||||
}
|
||||
|
||||
/** Create the outline of the block. This is a single continuous path. */
|
||||
|
||||
48
package-lock.json
generated
48
package-lock.json
generated
@@ -28,7 +28,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jsdoc": "^48.0.2",
|
||||
"glob": "^10.3.4",
|
||||
"google-closure-compiler": "^20230802.0.0",
|
||||
"google-closure-compiler": "^20240317.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-gzip": "^1.4.2",
|
||||
@@ -45,7 +45,7 @@
|
||||
"markdown-tables-to-json": "^0.1.7",
|
||||
"mocha": "^10.0.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier": "3.2.5",
|
||||
"prettier": "3.3.2",
|
||||
"readline-sync": "^1.4.10",
|
||||
"rimraf": "^5.0.0",
|
||||
"typescript": "^5.3.3",
|
||||
@@ -6121,13 +6121,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/google-closure-compiler": {
|
||||
"version": "20230802.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20230802.0.0.tgz",
|
||||
"integrity": "sha512-o2fYoc8lqOBdhm95Ick0vWrtwH2Icd5yLZhbTcQ0T7NfGiBepYvx1BB63hR8ebgzEZemz9Fh+O6Kg/3Mjm28ww==",
|
||||
"version": "20240317.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20240317.0.0.tgz",
|
||||
"integrity": "sha512-PlC5aU2vwsypKbxyFNXOW4psDZfhDoOr2dCwuo8VcgQji+HVIgRi2lviO66x2SfTi0ilm3kI6rq/RSdOMFczcQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chalk": "4.x",
|
||||
"google-closure-compiler-java": "^20230802.0.0",
|
||||
"google-closure-compiler-java": "^20240317.0.0",
|
||||
"minimist": "1.x",
|
||||
"vinyl": "2.x",
|
||||
"vinyl-sourcemaps-apply": "^0.2.0"
|
||||
@@ -6139,21 +6139,21 @@
|
||||
"node": ">=10"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"google-closure-compiler-linux": "^20230802.0.0",
|
||||
"google-closure-compiler-osx": "^20230802.0.0",
|
||||
"google-closure-compiler-windows": "^20230802.0.0"
|
||||
"google-closure-compiler-linux": "^20240317.0.0",
|
||||
"google-closure-compiler-osx": "^20240317.0.0",
|
||||
"google-closure-compiler-windows": "^20240317.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/google-closure-compiler-java": {
|
||||
"version": "20230802.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20230802.0.0.tgz",
|
||||
"integrity": "sha512-PWKLMLwj7pR/U0yYbiy649LLqAscu+F1gyY4Y/jK6CmSLb8cIJbL8BTJd00828TzTNfWnYwxbkcQw0y9C2YsGw==",
|
||||
"version": "20240317.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20240317.0.0.tgz",
|
||||
"integrity": "sha512-oWURPChjcCrVfiQOuVtpSoUJVvtOYo41JGEQ2qtArsTGmk/DpWh40vS6hitwKRM/0YzJX/jYUuyt9ibuXXJKmg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/google-closure-compiler-linux": {
|
||||
"version": "20230802.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20230802.0.0.tgz",
|
||||
"integrity": "sha512-F13U4iSXiWeGtHOFS25LVem1s6zI+pJvXVPVR7zSib5ppoUJ0JXnABJQezUR3FnpxmnkALG4oIGW0syH9zPLZA==",
|
||||
"version": "20240317.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20240317.0.0.tgz",
|
||||
"integrity": "sha512-dYLtcbbJdbbBS0lTy9SzySdVv/aGkpyTekQiW4ADhT/i1p1b4r0wQTKj6kpVVmFvbZ6t9tW/jbXc9EXXNUahZw==",
|
||||
"cpu": [
|
||||
"x32",
|
||||
"x64"
|
||||
@@ -6165,9 +6165,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/google-closure-compiler-osx": {
|
||||
"version": "20230802.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20230802.0.0.tgz",
|
||||
"integrity": "sha512-ANAi/ux92Tt+Na7vFDLeK2hRzotjC5j+nxoPtE0OcuNcbjji5dREKoJxkq7r0YwRTCzAFZszK5ip/NPdTOdCEg==",
|
||||
"version": "20240317.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20240317.0.0.tgz",
|
||||
"integrity": "sha512-0mABwjD4HP11rikFd8JRIb9OgPqn9h3o3wS0otufMfmbwS7zRpnnoJkunifhORl3VoR1gFm6vcTC9YziTEFdOw==",
|
||||
"cpu": [
|
||||
"x32",
|
||||
"x64",
|
||||
@@ -6180,9 +6180,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/google-closure-compiler-windows": {
|
||||
"version": "20230802.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20230802.0.0.tgz",
|
||||
"integrity": "sha512-ZQPujoNiiUyTGl8zEGR/0yAygWnbMtX/NQ/S/EHVgq5nmYkvDEVuiVbgpPAmO9lzBTq0hvUTRRATZbTU2ISxgA==",
|
||||
"version": "20240317.0.0",
|
||||
"resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20240317.0.0.tgz",
|
||||
"integrity": "sha512-fTueVFzNOWURFlXZmrFkAB7yA+jzpA2TeDOYeBEFwVlVGHwi8PV3Q9vCIWlbkE8wLpukKEg5wfRHYrLwVPINCA==",
|
||||
"cpu": [
|
||||
"x32",
|
||||
"x64"
|
||||
@@ -9692,9 +9692,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
||||
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jsdoc": "^48.0.2",
|
||||
"glob": "^10.3.4",
|
||||
"google-closure-compiler": "^20230802.0.0",
|
||||
"google-closure-compiler": "^20240317.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-gzip": "^1.4.2",
|
||||
@@ -132,7 +132,7 @@
|
||||
"markdown-tables-to-json": "^0.1.7",
|
||||
"mocha": "^10.0.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier": "3.2.5",
|
||||
"prettier": "3.3.2",
|
||||
"readline-sync": "^1.4.10",
|
||||
"rimraf": "^5.0.0",
|
||||
"typescript": "^5.3.3",
|
||||
|
||||
Reference in New Issue
Block a user