getVisibleElements = parentElement => {
  if (!parentElement) {
    const svgContent = svgCanvas.getSvgContent()
    for (let i = 0; i < svgContent.children.length; i++) {
      if (svgContent.children[i].getBBox) {
        const bbox = svgContent.children[i].getBBox()
        if (
          bbox.width !== 0 &&
          bbox.height !== 0 &&
          bbox.width !== 0 &&
          bbox.height !== 0
        ) {
          parentElement = svgContent.children[i]
          break
        }
      }
    }
  }

  const contentElems = []
  if (parentElement) {
    const children = parentElement.children
    // eslint-disable-next-line array-callback-return
    Array.from(children, elem => {
      if (elem.getBBox) {
        contentElems.push(elem)
      }
    })
  }
  return contentElems.reverse()
}
Get all elements that have a BBox (excludes `<defs>`, `<title>`, etc).
Note that 0-opacity, off-screen etc elements are still considered "visible"
for this function.
@function module:utilities.getVisibleElements
@param {Element} parentElement - The parent DOM element to search within
@returns {Element[]} All "visible" elements.