scratch-blocks 2.1.19 → 2.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -0
- package/dist/main.mjs +1 -1
- package/dist/types/src/renderer/renderer.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/fields/scratch_field_variable.ts +1 -1
- package/src/index.ts +1 -1
- package/src/renderer/constants.ts +1 -1
- package/src/renderer/drawer.ts +1 -1
- package/src/renderer/renderer.ts +2 -1
- package/src/scratch_c_block_wrap.ts +3 -2
- package/src/scratch_comment_bubble.ts +1 -1
- package/src/scratch_connection_checker.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../src/renderer/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,OAAO,CAAC,KAAK,CAAC,QAAQ;IACzD;;;;OAIG;IACM,YAAY,IAAI,MAAM;IAI/B;;;;;;OAMG;IACM,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,GAAG,MAAM;IAI9F;;;;OAIG;IACM,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,GAAG,UAAU;IAI7D;;;OAGG;IACM,cAAc,IAAI,gBAAgB;IAI3C;;;;;OAKG;IACM,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU;IAItF;;;;OAIG;IACM,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../src/renderer/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,OAAO,CAAC,KAAK,CAAC,QAAQ;IACzD;;;;OAIG;IACM,YAAY,IAAI,MAAM;IAI/B;;;;;;OAMG;IACM,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,GAAG,MAAM;IAI9F;;;;OAIG;IACM,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,GAAG,UAAU;IAI7D;;;OAGG;IACM,cAAc,IAAI,gBAAgB;IAI3C;;;;;OAKG;IACM,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU;IAItF;;;;OAIG;IACM,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,GAAG,OAAO;CAIpF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scratch-blocks",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.20",
|
|
4
4
|
"description": "Scratch Blocks is a library for building creative computing interfaces.",
|
|
5
5
|
"author": "Massachusetts Institute of Technology",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
"blockly": "^12.4.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@commitlint/cli": "20.5.
|
|
40
|
-
"@commitlint/config-conventional": "20.5.
|
|
41
|
-
"@vitest/browser": "4.1.
|
|
42
|
-
"@vitest/browser-playwright": "4.1.
|
|
43
|
-
"eslint": "9.39.
|
|
44
|
-
"eslint-config-scratch": "14.1.
|
|
39
|
+
"@commitlint/cli": "20.5.3",
|
|
40
|
+
"@commitlint/config-conventional": "20.5.3",
|
|
41
|
+
"@vitest/browser": "4.1.11",
|
|
42
|
+
"@vitest/browser-playwright": "4.1.11",
|
|
43
|
+
"eslint": "9.39.5",
|
|
44
|
+
"eslint-config-scratch": "14.1.79",
|
|
45
45
|
"husky": "9.1.7",
|
|
46
|
-
"playwright": "1.
|
|
47
|
-
"prettier": "3.8.
|
|
46
|
+
"playwright": "1.63.0",
|
|
47
|
+
"prettier": "3.8.5",
|
|
48
48
|
"scratch-semantic-release-config": "4.0.1",
|
|
49
|
-
"semantic-release": "25.0.
|
|
49
|
+
"semantic-release": "25.0.9",
|
|
50
50
|
"source-map-loader": "5.0.0",
|
|
51
|
-
"ts-loader": "9.
|
|
51
|
+
"ts-loader": "9.6.2",
|
|
52
52
|
"typescript": "5.9.3",
|
|
53
|
-
"vitest": "4.1.
|
|
54
|
-
"webpack": "5.
|
|
53
|
+
"vitest": "4.1.11",
|
|
54
|
+
"webpack": "5.111.1",
|
|
55
55
|
"webpack-cli": "6.0.1",
|
|
56
|
-
"webpack-dev-server": "5.2.
|
|
56
|
+
"webpack-dev-server": "5.2.6"
|
|
57
57
|
},
|
|
58
58
|
"config": {
|
|
59
59
|
"commitizen": {
|
|
@@ -47,7 +47,7 @@ export class ScratchFieldVariable extends Blockly.FieldVariable {
|
|
|
47
47
|
// dropdownCreate returns MenuOption[] rather than Blockly.MenuGenerator's
|
|
48
48
|
// MenuOption[][] variant; the cast is needed to satisfy FieldVariable's
|
|
49
49
|
// menuGenerator_ type while the actual runtime shape is compatible.
|
|
50
|
-
this.menuGenerator_ = ScratchFieldVariable.dropdownCreate.bind(this)
|
|
50
|
+
this.menuGenerator_ = ScratchFieldVariable.dropdownCreate.bind(this)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
initModel() {
|
package/src/index.ts
CHANGED
|
@@ -159,7 +159,7 @@ export function isContentNodeFocused(): boolean {
|
|
|
159
159
|
return Blockly.getFocusManager().getFocusedNode() !== null
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
registerContinuousToolbox()
|
|
163
163
|
Blockly.Scrollbar.scrollbarThickness = Blockly.Touch.TOUCH_ENABLED ? 14 : 11
|
|
164
164
|
Blockly.FlyoutButton.TEXT_MARGIN_X = 40
|
|
165
165
|
Blockly.FlyoutButton.TEXT_MARGIN_Y = 10
|
|
@@ -52,7 +52,7 @@ export class ConstantProvider extends Blockly.zelos.ConstantProvider {
|
|
|
52
52
|
* @returns The shape object for the given connection.
|
|
53
53
|
*/
|
|
54
54
|
override shapeFor(connection: Blockly.RenderedConnection): ReturnType<Blockly.zelos.ConstantProvider['shapeFor']> {
|
|
55
|
-
const connectionType = connection.type
|
|
55
|
+
const connectionType: Blockly.ConnectionType = connection.type
|
|
56
56
|
let checks = connection.getCheck()
|
|
57
57
|
const hexagonal = this.HEXAGONAL
|
|
58
58
|
const rounded = this.ROUNDED
|
package/src/renderer/drawer.ts
CHANGED
|
@@ -64,7 +64,7 @@ export class Drawer extends Blockly.zelos.Drawer {
|
|
|
64
64
|
*/
|
|
65
65
|
override drawConnectionHighlightPath(measurable: Blockly.blockRendering.Connection) {
|
|
66
66
|
const conn = measurable.connectionModel
|
|
67
|
-
const connectionType = conn.type
|
|
67
|
+
const connectionType: Blockly.ConnectionType = conn.type
|
|
68
68
|
if (connectionType === Blockly.ConnectionType.INPUT_VALUE && measurable.isDynamicShape) {
|
|
69
69
|
const input = measurable as Blockly.blockRendering.InlineInput
|
|
70
70
|
const EXPAND_X = 0.5
|
package/src/renderer/renderer.ts
CHANGED
|
@@ -65,7 +65,8 @@ export class ScratchRenderer extends Blockly.zelos.Renderer {
|
|
|
65
65
|
* @returns True if we should highlight the connection.
|
|
66
66
|
*/
|
|
67
67
|
override shouldHighlightConnection(connection: Blockly.RenderedConnection): boolean {
|
|
68
|
-
|
|
68
|
+
const connectionType: Blockly.ConnectionType = connection.type
|
|
69
|
+
return connectionType === Blockly.ConnectionType.INPUT_VALUE
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -28,7 +28,8 @@ Blockly.Connection.getConnectionForOrphanedConnection = function (
|
|
|
28
28
|
// Apply the wrapping logic when the orphaned connection is a statement
|
|
29
29
|
// connection (PREVIOUS_STATEMENT). Value connections (OUTPUT_VALUE) are
|
|
30
30
|
// already handled by the original implementation.
|
|
31
|
-
|
|
31
|
+
const orphanType: Blockly.ConnectionType = orphanConnection.type
|
|
32
|
+
if (orphanType === Blockly.ConnectionType.PREVIOUS_STATEMENT) {
|
|
32
33
|
const checker = orphanConnection.getConnectionChecker()
|
|
33
34
|
for (const input of startBlock.inputList) {
|
|
34
35
|
const conn = input.connection
|
|
@@ -87,7 +88,7 @@ Reflect.set(
|
|
|
87
88
|
if (markerPreviousConnection?.isConnected() && !markerNextConnection?.isConnected()) {
|
|
88
89
|
for (const input of marker.inputList) {
|
|
89
90
|
const conn = input.connection
|
|
90
|
-
const connType = conn?.type
|
|
91
|
+
const connType = conn?.type
|
|
91
92
|
if (connType !== Blockly.ConnectionType.NEXT_STATEMENT || !conn?.isConnected()) {
|
|
92
93
|
continue
|
|
93
94
|
}
|
|
@@ -69,7 +69,7 @@ export class ScratchCommentBubble
|
|
|
69
69
|
if (gesture) {
|
|
70
70
|
// ScratchCommentBubble implements IBubble structurally but TypeScript
|
|
71
71
|
// cannot verify it because IBubble.drag has a different signature here.
|
|
72
|
-
gesture.handleBubbleStart(e, this
|
|
72
|
+
gesture.handleBubbleStart(e, this)
|
|
73
73
|
Blockly.common.setSelected(this)
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -50,8 +50,9 @@ class ScratchConnectionChecker extends Blockly.ConnectionChecker {
|
|
|
50
50
|
// getConnectionForOrphanedConnection patch routes displaced blocks into
|
|
51
51
|
// statement inputs, so we allow the connection when a suitable statement
|
|
52
52
|
// input exists on the dragging block.
|
|
53
|
+
const bType: Blockly.ConnectionType = b.type
|
|
53
54
|
if (
|
|
54
|
-
|
|
55
|
+
bType === Blockly.ConnectionType.NEXT_STATEMENT &&
|
|
55
56
|
b.isConnected() &&
|
|
56
57
|
!(a.getSourceBlock() as Blockly.Block).nextConnection
|
|
57
58
|
) {
|