Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
libraries/*
*.md

addon/*
images/*
inject/l10n.js
l10n/*
_locales/*

.github/workflows/*
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"endOfLine": "lf"
}
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extensionName": {
"message": "Scratch 3 Developer Tools"
},
"extensionDescription": {
"message": "Scratch 3 Developer Tools to enhance your Scratch Editing Experience on https://scratch.mit.edu"
}
}
9 changes: 9 additions & 0 deletions addon/BlockInstance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Encapsulates a block (either in this sprite or another / Blockly, or native JSON block
*/
export default class BlockInstance {
constructor(target, block) {
this.targetId = target.id;
this.id = block.id;
}
}
34 changes: 34 additions & 0 deletions addon/BlockItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export default class BlockItem {
constructor(cls, procCode, labelID, y) {
this.cls = cls;
this.procCode = procCode;
this.labelID = labelID;
this.y = y;
this.lower = procCode.toLowerCase();
/**
* An Array of block ids
* @type {Array.<string>}
*/
this.clones = null;
this.eventName = null;
}

/**
* True if the blockID matches a black represented by this BlockItem
* @param id
* @returns {boolean}
*/
matchesID(id) {
if (this.labelID === id) {
return true;
}
if (this.clones) {
for (const cloneID of this.clones) {
if (cloneID === id) {
return true;
}
}
}
return false;
}
}
Loading