diff --git a/main-require.cjs b/main-require.cjs index c143ede..d1108b3 100644 --- a/main-require.cjs +++ b/main-require.cjs @@ -3320,7 +3320,7 @@ const getPathSegments = (node, rbox) => { // Get reference from element const ref = node.getAttribute('href') || node.getAttribute('xlink:href') // Get the actual referenced Node - const refNode = node.getRootNode().getElementById(ref.slice(1)) + const refNode = node.getRootNode().querySelector(ref) // Get the BBox of the referenced element and apply the viewbox of // TODO: Do we need to apply the transformations of the element? // Check bbox of transformed element which is reused with @@ -5026,4 +5026,4 @@ for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_expor if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ })() ; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9tYWluLXJlcXVpcmUuY2pzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7OztBQ0FBOzs7Ozs7Ozs7O0FDQUE7Ozs7Ozs7Ozs7QUNBQTs7Ozs7Ozs7OztBQ0FBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNBdUI7QUFDTTtBQUM3QjtBQUNBO0FBQ0E7QUFDQTtBQUNPO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDTztBQUNQO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDTztBQUNQO0FBQ0E7QUFDQTtBQUNBLHFCQUFxQixzQ0FBUztBQUM5QjtBQUNBO0FBQ0Esb0JBQW9CLDZDQUFnQjtBQUNwQyxNQUFNO0FBQ04sbURBQW1ELEtBQUs7QUFDeEQ7QUFDQTtBQUNBLFNBQVMsU0FBSTtBQUNiO0FBQ0E7QUFDTztBQUNBO0FBQ1A7QUFDTztBQUNQO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7QUN6Q2dDO0FBQ2E7QUFDN0M7QUFDTyxtQkFB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ogcHJlZml4IGNvdWxkIGJlIFwibnVsbFwiIGluIHRoaXMgY2FzZSB3ZSBhcmUgbG9va2luZyBmb3IgZGVmYXVsdCBuYW1lc3BhY2VcclxuICAgICAgICByZXR1cm4gdGhpcy5uYW1lc3BhY2VVUklcclxuICAgICAgfVxyXG5cclxuICAgICAgZm9yIChjb25zdCBbIGtleSwgdmFsIF0gb2YgdGhpcy5hdHRycy5lbnRyaWVzKCkpIHtcclxuICAgICAgICBpZiAoIWtleS5pbmNsdWRlcygnOicpKSBjb250aW51ZVxyXG5cclxuICAgICAgICBjb25zdCBbIGF0dHJQcmVmaXgsIG5hbWUgXSA9IGtleS5zcGxpdCgnOicpXHJcbiAgICAgICAgaWYgKGF0dHJQcmVmaXggPT09ICd4bWxucycgJiYgbmFtZSA9PT0gcHJlZml4KSB7XHJcbiAgICAgICAgICBpZiAodmFsICE9IG51bGwpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbFxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgcmV0dXJuIG51bGxcclxuICAgICAgICAgIC8vIEZJWE1FOiBMb29rIHVwIGlmIHByZWZpeCBvciBhdHRyUHJlZml4XHJcbiAgICAgICAgfSBlbHNlIGlmIChuYW1lID09PSAneG1sbnMnICYmIHByZWZpeCA9PSBudWxsKSB7XHJcbiAgICAgICAgICBpZiAodmFsICE9IG51bGwpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbFxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgcmV0dXJuIG51bGxcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuXHJcbiAgICAgIC8vIEVudGl0eVJlZmVyZW5jZXMgbWF5IGhhdmUgdG8gYmUgc2tpcHBlZCB0byBnZXQgdG8gaXRcclxuICAgICAgaWYgKHRoaXMucGFyZW50Tm9kZSkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLnBhcmVudE5vZGUubG9va3VwTmFtZXNwYWNlVVJJKHByZWZpeClcclxuICAgICAgfVxyX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xyXG4gICAgZm9yIChjb25zdCBub2RlIG9mIHRoaXMuY2hpbGROb2Rlcykge1xyXG4gICAgICBjb25zdCBsYXN0ID0gY2hpbGROb2Rlcy5zaGlmdCgpXHJcbiAgICAgIGlmICghbGFzdCkge1xyXG4gICAgICAgIGlmIChub2RlLmRhdGEpIHtcclxuICAgICAgICAgIGNoaWxkTm9kZXMudW5zaGlmdChub2RlKVxyXG4gICAgICAgIH1cclxuICAgICAgICBjb250aW51ZVxyXG4gICAgICB9XHJcblxyXG4gICAgICBpZiAobm9kZS5ub2RlVHlwZSA9PT0gTm9kZS5URVhUX05PREUpIHtcclxuICAgICAgICBpZiAoIW5vZGUuZGF0YSkge1xyXG4gICAgICAgICAgY2hpbGROb2Rlcy51bnNoaWZ0KGxhc3QpXHJcbiAgICAgICAgICBjb250aW51ZVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKGxhc3Qubm9kZVR5cGUgPT09IE5vZGUuVEVYVF9OT0RFKSB7XHJcbiAgICAgICAgICBjb25zdCBtZXJnZWQgPSB0aGlzLm93bmVyRG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobGFzdC5kYXRhICsgbm9kZS5kYXRhKVxyXG4gICAgICAgICAgY2hpbGROb2Rlcy5wdXNoKG1lcmdlZClcclxuICAgICAgICAgIGNvbnRpbnVlXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBjaGlsZE5vZGVzLnB1c2gobGFzdCwgbm9kZSlcclxuICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGNoaWxkTm9kZXMuZm9yRWFjaChub2RlID0+IHtcclxuICAgICAgbm9kZS5wYXJlbnROb2RlID0gdGhpc1xyXG4gICAgfSlcclxuICAgIHRoaXMuY2hpbGROb2RlcyA9IGNoaWxkTm9kZXNcclxuICAgIC8vIHRoaXMuY2hpbGROb2RlcyA9IHRoaXMuY2hpbGROb2Rlcy5mb3JFYWNoKCh0ZXh0Tm9kZXMsIG5vZGUpID0+IHtcclxuIC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4gICAgdmFyIGRldCA9IGEgKiBkIC0gYiAqIGNcclxuICAgIGlmICghZGV0KSB0aHJvdyBuZXcgRXJyb3IoJ0Nhbm5vdCBpbnZlcnQgJyArIHRoaXMpXHJcblxyXG4gICAgLy8gQ2FsY3VsYXRlIHRoZSB0b3AgMngyIG1hdHJpeFxyXG4gICAgdmFyIG5hID0gZCAvIGRldFxyXG4gICAgdmFyIG5iID0gLWIgLyBkZXRcclxuICAgIHZhciBuYyA9IC1jIC8gZGV0XHJcbiAgICB2YXIgbmQgPSBhIC8gZGV0XHJcblxyXG4gICAgLy8gQXBwbHkgdGhlIGludmVydGVkIG1hdHJpeCB0byB0aGUgdG9wIHJpZ2h0XHJcbiAgICB2YXIgbmUgPSAtKG5hICogZSArIG5jICogZilcclxuICAgIHZhciBuZiA9IC0obmIgKiBlICsgbmQgKiBmKVxyXG5cclxuICAgIC8vIENvbnN0cnVjdCB0aGUgaW52ZXJ0ZWQgbWF0cml4XHJcbiAgICB0aGlzLmEgPSBuYVxyXG4gICAgdGhpcy5iID0gbmJcclxuICAgIHRoaXMuYyA9IG5jXHJcbiAgICB0aGlzLmQgPSBuZFxyXG4gICAgdGhpcy5lID0gbmVcclxuICAgIHRoaXMuZiA9IG5mXHJcblxyXG4gICAgcmV0dXJuIHRoaXNcclxuICB9XHJcblxyXG4gIG11bHRpcGx5IChtKSB7XHJcbiAgICB2YXIgciA9IG5ldyBTVkdNYXRyaXgoKVxyXG4gICAgci5hID0gdGhpcy5hICogbS5hICsgdGhpcy5jICogbS5iICsgdGhpcy5lICogMFxyXG4gICAgci5iID0gdGhpcy5iICogbS5hICsgdGhpcy5kICogbS5iICsgdGhpcy5mICogMFxyXG4gICAgci5jID0gdGhpcy5hICogbS5jICsgdGhpcy5jICogbS5kICsgdGhpcy5lICogMFxyXG4gICAgci5kID0gdGhpcy5iICogbS5jICsgdGhpcy5kICogbS5kICsgdGhpcy5mICogMFxyXG4gICAgci5lID0gdGhpcy5hICogbS5lICsgdGhpcy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JvdHRvbSA9IHRoaXMudG9wICsgdGhpcy5oZWlnaHRcclxuICB9XHJcblxyXG4gIC8vIE1lcmdlIHJlY3QgYm94IHdpdGggYW5vdGhlciwgcmV0dXJuIGEgbmV3IGluc3RhbmNlXHJcbiAgbWVyZ2UgKGJveCkge1xyXG4gICAgaWYgKGJveCBpbnN0YW5jZW9mIE5vQm94KSByZXR1cm4gbmV3IEJveCh0aGlzKVxyXG5cclxuICAgIHZhciB4ID0gTWF0aC5taW4odGhpcy54LCBib3gueClcclxuICAgIHZhciB5ID0gTWF0aC5taW4odGhpcy55LCBib3gueSlcclxuXHJcbiAgICByZXR1cm4gbmV3IEJveChcclxuICAgICAgeCwgeSxcclxuICAgICAgTWF0aC5tYXgodGhpcy54ICsgdGhpcy53aWR0aCwgYm94LnggKyBib3gud2lkdGgpIC0geCxcclxuICAgICAgTWF0aC5tYXgodGhpcy55ICsgdGhpcy5oZWlnaHQsIGJveC55ICsgYm94LmhlaWdodCkgLSB5XHJcbiAgICApXHJcbiAgfVxyXG5cclxuICB0cmFuc2Zvcm0gKG0pIHtcclxuICAgIHZhciB4TWluID0gSW5maW5pdHlcclxuICAgIHZhciB4TWF4ID0gLUluZmluaXR5XHJcbiAgICB2YXIgeU1pbiA9IEluZmluaXR5XHJcbiAgICB2YXIgeU1heCA9IC1JbmZpbml0eVxyXG5cclxuICAgIHZhciBwdHMgPSBbXHJcbiAgICAgIG5ldyBQb2ludCh0aGlzLngsIHRoaXMueSksXHJcbiAgICAgIG5ldyBQb2ludCh0aGlzLnggKyB0aGlzLndpZHRoLCB0aGlzLnkpLFxyXG4gICAgICBuZXcgUG9pbnQodGhpcy54LCB0aGlzLnkgKyB0aGlzLmhlaWdodCksXHJcbiAgICAgIG5ldyBQb2ludCh0aGlzLnggKyB0aGlzLndpZHRoLCB0aGlzLnkgKyB0aGlzLmhlaWdodClcclxuICAgIF1cclxuXHJcbiAgICBwdHMuZm9yRWFjaChmdW5jdGlvbiAocCkge1xyXG4gICAgICB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2YWwgXSBvZiB0aGlzLmF0dHJzLmVudHJpZXMoKSkge1xuICAgICAgICBpZiAoIWtleS5pbmNsdWRlcygnOicpKSBjb250aW51ZVxuXG4gICAgICAgIGNvbnN0IFsgYXR0clByZWZpeCwgbmFtZSBdID0ga2V5LnNwbGl0KCc6JylcbiAgICAgICAgaWYgKGF0dHJQcmVmaXggPT09ICd4bWxucycgJiYgbmFtZSA9PT0gcHJlZml4KSB7XG4gICAgICAgICAgaWYgKHZhbCAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsXG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsXG4gICAgICAgICAgLy8gRklYTUU6IExvb2sgdXAgaWYgcHJlZml4IG9yIGF0dHJQcmVmaXhcbiAgICAgICAgfSBlbHNlIGlmIChuYW1lID09PSAneG1sbnMnICYmIHByZWZpeCA9PSBudWxsKSB7XG4gICAgICAgICAgaWYgKHZhbCAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsXG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gRW50aXR5UmVmZXJlbmNlcyBtYXkgaGF2ZSB0byBiZSBza2lwcGVkIHRvIGdldCB0byBpdFxuICAgICAgaWYgKHRoaXMucGFyZW50Tm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJlbnROb2RlLmxvb2t1cE5hbWVzcGFjZVVSSShwcmVmaXgpXG4gICAgICB9XG4gICAgICByZXR1cm4gbnVsbFxuICAgIGNhc2UgTm9kZS5ET0NVTUVOVF9OT0RFOlxuICAgICAgcmV0dXJuIHRoaXMuZG9jdW1lbnRFbGVtZW50Lmxvb2t1cE5hbWVzcGFjZVVSSShwcmVmaXgpXG4gICAgY2FzZSBOb2RlLkVOVElUWV9OT0RFOlxuICAgIGNhc2UgTm9kZS5OT1RBVElPTl9OT0RFOlxuICAgIGNhc2UgTm9kZS5ET0N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bS5iICsgdGhpcy5mICogMFxyXG4gICAgci5jID0gdGhpcy5hICogbS5jICsgdGhpcy5jICogbS5kICsgdGhpcy5lICogMFxyXG4gICAgci5kID0gdGhpcy5iICogbS5jICsgdGhpcy5kICogbS5kICsgdGhpcy5mICogMFxyXG4gICAgci5lID0gdGhpcy5hICogbS5lICsgdGhpcy5jICogbS5mICsgdGhpcy5lICogMVxyXG4gICAgci5mID0gdGhpcy5iICogbS5lICsgdGhpcy5kICogbS5mICsgdGhpcy5mICogMVxyXG4gICAgcmV0dXJuIHJcclxuICB9XHJcblxyXG4gIHJvdGF0ZSAociwgeCwgeSkge1xyXG4gICAgciA9IHIgJSAzNjAgKiBNYXRoLlBJIC8gMTgwXHJcbiAgICByZXR1cm4gdGhpcy5tdWx0aXBseShtYXRyaXhGYWN0b3J5KFxyXG4gICAgICBNYXRoLmNvcyhyKSxcclxuICAgICAgTWF0aC5zaW4ociksXHJcbiAgICAgIC1NYXRoLnNpbihyKSxcclxuICAgICAgTWF0aC5jb3MociksXHJcbiAgICAgIHggPyAtTWF0aC5jb3MocikgKiB4ICsgTWF0aC5zaW4ocikgKiB5ICsgeCA6IDAsXHJcbiAgICAgIHkgPyAtTWF0aC5zaW4ocikgKiB4IC0gTWF0aC5jb3MocikgKiB5ICsgeSA6IDBcclxuICAgICkpXHJcbiAgfVxuXG4gIHNjYWxlIChzY2FsZVgsIHNjYWxlWSA9IHNjYWxlWCkge1xyXG4gICAgcmV0dXJuIHRoaXMubXVsdGlwbHkobWF0cml4RmFjdG9yeShzY2FsZVgsIDAsIDAsIHNjYWxlWSwgMCwgMCkpXHJcbiAgfVxuXG4gIHNrZXcgKHgsIHkpIHtcclxuICAgIHJldHVybiB0aGlzLm11bHRpcGx5KG1hdHJpeEZhY3RvcnkoMSwgTWF0aC50YW4ocmFkaWFucyh5KSksIE1hdGgudGFuKHJhZGlhbnMoeCkpLCAxLCAwLCAwKSlcclxuICB9XG5cbiAgc2tld1ggKHgpIHtcclxuICAgIHJ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ICAgICAgbmV3IFBvaW50KHhbMF1bMF0sIHlbMF1bMF0pLFxyXG4gICAgICBuZXcgUG9pbnQoeFswXVsxXSwgeVswXVsxXSksXHJcbiAgICAgIG5ldyBQb2ludCh4WzBdWzJdLCB5WzBdWzJdKSxcclxuICAgICAgbmV3IFBvaW50KHhbMF1bM10sIHlbMF1bM10pXHJcbiAgICApXHJcblxyXG4gICAgY29uc3QgYiA9IG5ldyBDdWJpYyhcclxuICAgICAgbmV3IFBvaW50KHhbMV1bMF0sIHlbMV1bMF0pLFxyXG4gICAgICBuZXcgUG9pbnQoeFsxXVsxXSwgeVsxXVsxXSksXHJcbiAgICAgIG5ldyBQb2ludCh4WzFdWzJdLCB5WzFdWzJdKSxcclxuICAgICAgbmV3IFBvaW50KHhbMV1bM10sIHlbMV1bM10pXHJcbiAgICApXHJcblxyXG4gICAgcmV0dXJuIFsgYSwgYiBdXHJcbiAgfVxyXG5cclxuICBzcGxpdEF0U2NhbGFyICh6LCBwKSB7XHJcbiAgICBjb25zdCBwMSA9IHRoaXMucDFbcF1cclxuICAgIGNvbnN0IHAyID0gdGhpcy5jMVtwXVxyXG4gICAgY29uc3QgcDMgPSB0aGlzLmMyW3BdXHJcbiAgICBjb25zdCBwNCA9IHRoaXMucDJbcF1cclxuXHJcbiAgICBjb25zdCB0ID0geiAqIHogKiB6ICogcDQgLSAzICogeiAqIHogKiAoeiAtIDEpICogcDMgKyAzICogeiAqICh6IC0gMSkgKiAoeiAtIDEpICogcDIgLSAoeiAtIDEpICogKHogLSAxKSAqICh6IC0gMSkgKiBwMVxyXG5cclxuICAgIHJldHVybiBbXHJcbiAgICAgIFtcclxuICAgICAgICBwMSxcclxuICAgICAgICB6ICogcDIgLSAoeiAtIDEpICogcDEsXHJcbiAgICAgICAgeiAqIHogKiBwMyAtIDIgKiB6ICogKHogLSAxKSAqIHAyICsgKHogLSAxKSAqICh6IC0gMSkgKiBwMSxcclxuICAgICAgICB0XHJcbiAgICAgIF0sXHJcbiAgICAg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git a/package.json b/package.json index 15cc5dc..94d21f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svgdom", - "version": "0.1.10", + "version": "0.1.11", "description": "Straightforward DOM implementation for SVG, HTML and XML", "main": "./main-require.cjs", "exports": {