scratchblocks-plus 1.1.0 → 1.1.2

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.
@@ -244,7 +244,7 @@ export class MatrixView {
244
244
  if (isFilled) {
245
245
  rect.setAttribute("fill", "#FFFFFF")
246
246
  } else {
247
- rect.classList.add(`sb3-${parent.info.category}`)
247
+ addClass(rect, `sb3-${parent.info.category}`)
248
248
  }
249
249
 
250
250
  elements.push(rect)
@@ -997,7 +997,9 @@ class DocumentView {
997
997
  * Build the element map by finding all elements with data-block-path
998
998
  */
999
999
  _buildElementMap() {
1000
- if (!this.el) return
1000
+ if (!this.el || !this.el.querySelectorAll) {
1001
+ return
1002
+ }
1001
1003
 
1002
1004
  this.elementMap.clear()
1003
1005
  const blocks = this.el.querySelectorAll("[data-block-path]")
@@ -1028,7 +1030,9 @@ class DocumentView {
1028
1030
  */
1029
1031
  highlightBlock(path, options = {}) {
1030
1032
  const el = this.getElementByPath(path)
1031
- if (!el) return false
1033
+ if (!el) {
1034
+ return false
1035
+ }
1032
1036
 
1033
1037
  // Add highlight class to the first child (the shape element)
1034
1038
  const shapeEl = el.firstElementChild
package/syntax/model.js CHANGED
@@ -394,6 +394,13 @@ export class Block {
394
394
  return
395
395
  }
396
396
 
397
+ if (
398
+ this.info.category === "custom-arg" ||
399
+ this.info.category === "custom"
400
+ ) {
401
+ return
402
+ }
403
+
397
404
  const oldSpec = this.info.language.commands[id]
398
405
 
399
406
  const nativeSpec = lang.commands[id]