moodle_local_treestudyplan/amd/build/simpleline/simpleline.min.js.map

1 line
25 KiB
Plaintext

{"version":3,"file":"simpleline.min.js","sources":["../../src/simpleline/simpleline.js"],"sourcesContent":["/*eslint no-console: \"off\"*/\n/*eslint no-trailing-spaces: \"off\"*/\n\n/*\nThe MIT License (MIT)\n\nCopyright (c) 2023 P.M. Kuipers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nimport {calc} from \"./css-calc\";\n\n\n/**\n * Copies defined properties in to, over from the from object. Does so recursively\n * Used to copy user defined parameters onto a pre-existing object with defaults preset.\n * @param {Object} to The object to copy to\n * @param {Object} from The object tp copy from (but only the properties already named in \"to\")\n */\nconst specsCopy = (to, from) => {\n for(const ix in to){\n if(from.hasOwnProperty(ix)){\n if( typeof to[ix] == \"object\"\n && typeof from[ix] == \"object\")\n {\n if(Array.isArray(to[ix])){\n if(Array.isArray(from[ix])){\n to[ix] = Array.from(from[ix]);\n } // else, skip...\n } else {\n specsCopy(to[ix], from[ix]); // recursive copy\n }\n }\n else {\n to[ix] = from[ix];\n }\n }\n }\n};\n\nconst debounce = (func, delay) => {\n let timer;\n return function(...args) {\n const context = this;\n clearTimeout(timer);\n timer = setTimeout(() => {\n func.apply(context, args);\n }, delay);\n };\n};\n\n/**\n * Get the position of an element relative to another\n * @param {HTMLElement} el The element whose position to determine\n * @param {HTMLElement} reference Relative to this element\n * @returns {object} Position object with {x: ..., y:...}\n */\nconst getElementPosition = (el, reference) => {\n if(!el || !(el instanceof HTMLElement)){\n // Always return 0,0 if the element is invalid\n return {x: 0, y: 0};\n }\n\n if (!reference || !(reference instanceof HTMLElement)){\n // Take the document body as reference if the reference is invalud\n reference = document.querySelector(\"body\");\n }\n\n if( el.offsetParent === reference){\n // easily done if the reference element is also the offsetParent..\n return {x: el.offsetLeft, y: el.offsetTop};\n } else {\n const elR = el.getBoundingClientRect();\n const refR = reference.getBoundingClientRect();\n\n return {x: elR.left - refR.left,\n y: elR.top - refR.top};\n }\n};\n\nexport class SimpleLine {\n static idCounter = 0;\n\n /**\n * Create a new line object\n *\n * @param {HTMLElement|string} start The element the line starts from\n * @param {HTMLElement|string} end The element the line ends at\n * @param {object} config Configuration for the\n * @returns {SimpleLine} object\n */\n constructor(start, end, config){\n this.svg = null;\n this.id = SimpleLine.idCounter++;\n\n this.setConfig(config);\n // Validate start element\n if(start instanceof HTMLElement) {\n this.start = start;\n } else if (typeof start === 'string' || this.start instanceof String) {\n this.startSelector = start;\n this.start = document.querySelector(start);\n if(!(this.start instanceof HTMLElement)){\n console.error(\"Cannot find start element:\",start);\n return;\n }\n } else {\n console.error(\"Start element not string or dom element\",start);\n return;\n }\n\n // Validate end element\n if(end instanceof HTMLElement) {\n this.end = end;\n } else if (typeof end === 'string' || this.end instanceof String) {\n this.endSelector = end;\n this.end = document.querySelector(end);\n if(!(this.end instanceof HTMLElement)){\n console.error(\"Cannot find end element:\",end);\n return;\n }\n } else {\n console.error(\"End element not string or dom element\",start);\n return;\n }\n\n // create observers for both elements\n this.resizeObserver = new ResizeObserver(debounce(() => {\n this.update();\n },20));\n this.resizeObserver.observe(this.start);\n this.resizeObserver.observe(this.end);\n\n // Setup the mutationobserver so we can remove the line if it's start or end is removed.\n this.mutationObserver = new MutationObserver(function(mutations_list) {\n mutations_list.forEach(function(mutation) {\n mutation.removedNodes.forEach(function(removed_node) {\n if (this){\n if(removed_node == this.start || removed_node == this.end) {\n console.warning(\"Element removed\",removed_node);\n this.remove();\n }\n }\n });\n });\n });\n\n this.mutationObserver.observe(this.start.parentElement, { subtree: false, childList: true });\n this.mutationObserver.observe(this.end.parentElement, { subtree: false, childList: true });\n\n\n // Setup the position checker\n this.positionCheck(); // Initialize refresh\n if(this.specs.autorefresh > 0){\n this.refreshTimer = setInterval(()=>{this.positionCheck();},this.specs.autorefresh);\n }\n this.active = true;\n this.update(); // fist draw\n }\n\n /**\n * Change the simpleline config\n * @param {object} config The object containing the specs\n */\n setConfig(config){\n // setup defaults\n if(!(this.specs)){\n this.specs = {\n autorefresh: 10,\n class: \"\",\n color: \"\", // invalid propery makes it inherit from parent containers\n anchors: {\n // top, middle, bottom\n // left, center, right\n start: [\"middle\",\"right\"],\n end: [\"middle\", \"left\"],\n },\n gravity: {\n start: 1,\n end: 1,\n },\n stroke: \"4px\",\n };\n }\n\n if(config && typeof config == \"object\"){\n specsCopy(this.specs,config);\n }\n if(this.svg){\n // Re-initialize the refresh timer\n clearInterval(this.refreshTimer);\n if(this.specs.autorefresh > 0){\n this.refreshTimer = setInterval(()=>{this.positionCheck();},this.specs.autorefresh);\n }\n // Update the svg image\n this.update();\n }\n }\n\n /**\n * Get the css class of the line\n */\n get cssClass(){\n return this.specs.class;\n }\n\n /**\n * Set the css class of the line\n */\n set cssClass(cssClass)\n {\n this.specs.class = cssClass;\n this.update();\n }\n\n /**\n * Check for an element positino change and update accordingly\n */\n positionCheck(){\n const startPos = {x: this.start.offsetLeft, y: this.start.offsetTop};\n const endPos = {x: this.end.offsetLeft, y: this.end.offsetTop};\n\n let needUpdate = false;\n if(this.startPos){\n needUpdate = needUpdate || (this.startPos.x != startPos.x || this.startPos.y != startPos.y);\n //console.info(\"Offset position changed for\",this.start);\n }\n this.startPos = startPos;\n\n if(this.endPos){\n needUpdate = needUpdate || (this.endPos.x != endPos.x || this.endPos.y != endPos.y);\n //console.info(\"Offset position changed for\",this.end);\n }\n this.endPos = endPos;\n\n if(needUpdate){\n this.update();\n }\n\n }\n\n getContainer(){\n // Validate or determine container\n let container = this.start.offsetParent;\n if(!container) {\n if(getComputedStyle(this.start).position == \"fixed\"){\n container = document.querySelector(\"body\");\n } else {\n console.error(\"Start element has no offsetParent. likely \");\n }\n }\n return container;\n }\n\n getAnchorPoint(anchor){\n\n let el = this.start;\n if(anchor != \"start\"){\n anchor = \"end\";\n el = this.end;\n }\n\n let x, dirX;\n let y, dirY;\n // determine start coordinates\n if(this.specs.anchors[anchor].includes(\"left\")){\n x = 0;\n dirX = -1;\n } else if (this.specs.anchors[anchor].includes(\"right\")) {\n x = el.offsetWidth -1;\n dirX = 1;\n } else { // center\n x = el.offsetWidth / 2;\n dirX = 0;\n }\n if(this.specs.anchors[anchor].includes(\"top\")){\n y = 0;\n dirY = -1;\n } else if (this.specs.anchors[anchor].includes(\"bottom\")) {\n y = el.offsetHeight -1;\n dirY = 1;\n } else { // middle\n y = el.offsetHeight / 2;\n dirY = 0;\n }\n\n return { x: x, y: y, dir: {x: dirX, y: dirY}};\n }\n\n /**\n * Generates the svg defs parts including the marker\n * @returns {Object}\n */\n svgDefs(){\n const defs = document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n const marker = document.createElementNS(\"http://www.w3.org/2000/svg\", \"marker\");\n marker.setAttribute(\"id\",`simpleline-${this.id}-arrow`);\n marker.setAttribute(\"markerUnits\",`strokeWidth`);\n marker.setAttribute(\"viewBox\",`-8 -8 16 16`);\n marker.setAttribute(\"orient\",`auto`);\n marker.setAttribute(\"markerWidth\",`4`);\n marker.setAttribute(\"markerHeight\",`4`);\n defs.appendChild(marker);\n const polygon = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n polygon.setAttribute(\"fill\",`currentColor`);\n polygon.setAttribute(\"points\",`-8,-8 8,0 -8,8 -5,0`);\n marker.append(polygon);\n return defs;\n }\n\n /**\n * (Re)Paint the arrow\n *\n */\n update(){\n if(!this.active){ return;} // don't do this if we are no longer active\n\n const container = this.getContainer();\n if (!container) { return; } // Do not create any svg if container is empty\n\n if(this.svg && (this.svg instanceof SVGElement)){\n if(container !== this.svg.offsetParent){\n // update the svg's parent if the container was changed\n container.appendChild(this.svg);\n }\n } else {\n this.svg = document.createElementNS('http://www.w3.org/2000/svg','svg');\n this.svg.setAttribute(\"id\",`simpleline-${this.id}`);\n this.svg.setAttribute(\"class\",`simpleline ${this.specs.class}`);\n this.svg.style.position = \"absolute\";\n this.svg.style.pointerEvents = 'none';\n\n container.appendChild(this.svg);\n this.svg.appendChild(this.svgDefs()); // create a new defs element and add it to the svg\n // Add the marker definitions\n\n }\n\n // determine proper x, y ,h and w\n const startAnchor = this.getAnchorPoint(\"start\");\n const endAnchor = this.getAnchorPoint(\"end\");\n\n // make it a little shorter at the end to compensate for the size of the arrow\n const strokeWpx = calc(this.specs.stroke);\n endAnchor.x += endAnchor.dir.x * strokeWpx *1.5;\n endAnchor.y += endAnchor.dir.y * strokeWpx *1.5;\n\n const elStartPos = getElementPosition(this.start,container);\n const elEndPos = getElementPosition(this.end,container);\n\n //console.info(\"startAnchor\",startAnchor);\n //console.info(\"endAnchor\",endAnchor);\n //console.info(\"elStartPos\",elStartPos);\n //console.info(\"elEndPos\",elEndPos);\n\n // Determine basic h/w between start and end anchor to help determine desired control point length\n const w = Math.max(elStartPos.x + startAnchor.x,elEndPos.x + endAnchor.x)\n - Math.min(elStartPos.x + startAnchor.x,elEndPos.x + endAnchor.x);\n const h = Math.max(elStartPos.y + startAnchor.y,elEndPos.y + endAnchor.y)\n - Math.min(elStartPos.y + startAnchor.y,elEndPos.y + endAnchor.y);\n const weight = Math.sqrt(h*h+w*w)/2;\n // Determine start positions and end positions relative to container\n const cStartPos = {\n x: elStartPos.x + startAnchor.x,\n y: elStartPos.y + startAnchor.y,\n dirx: elStartPos.x + startAnchor.x + startAnchor.dir.x * this.specs.gravity.start * weight,\n diry: elStartPos.y + startAnchor.y + startAnchor.dir.y * this.specs.gravity.start * weight,\n };\n\n const cEndPos = {\n x: elEndPos.x + endAnchor.x,\n y: elEndPos.y + endAnchor.y,\n dirx: elEndPos.x + endAnchor.x + endAnchor.dir.x * this.specs.gravity.end * weight,\n diry: elEndPos.y + endAnchor.y + endAnchor.dir.y * this.specs.gravity.end * weight,\n };\n\n // determine the bounding rectangle of the\n //console.info(\"cStartPos\",cStartPos);\n //console.info(\"cEndPos\",cEndPos);\n\n const margin = (!isNaN(this.specs.stroke)?5*this.specs.stroke:25);\n const bounds = {\n x: Math.min(cStartPos.x,cEndPos.x,cStartPos.dirx,cEndPos.dirx) - margin,\n y: Math.min(cStartPos.y,cEndPos.y,cStartPos.diry,cEndPos.diry) - margin,\n w: Math.max(cStartPos.x,cEndPos.x,cStartPos.dirx,cEndPos.dirx)\n - Math.min(cStartPos.x,cEndPos.x,cStartPos.dirx,cEndPos.dirx) + 2*margin,\n h: Math.max(cStartPos.y,cEndPos.y,cStartPos.diry,cEndPos.diry)\n - Math.min(cStartPos.y,cEndPos.y,cStartPos.diry,cEndPos.diry) + 2*margin,\n };\n\n // Now convert the coordinates to the svg space\n const startPos = {\n x: cStartPos.x - bounds.x,\n y: cStartPos.y - bounds.y,\n dirx: cStartPos.dirx - bounds.x,\n diry: cStartPos.diry - bounds.y,\n };\n const endPos = {\n x: cEndPos.x - bounds.x,\n y: cEndPos.y - bounds.y,\n dirx: cEndPos.dirx - bounds.x,\n diry: cEndPos.diry - bounds.y,\n };\n\n //console.info(\"Bounds\",bounds);\n //console.info(\"startPos\",startPos);\n //console.info(\"endPos\",endPos);\n // Update the svg attributes\n this.svg.setAttribute(\"viewBox\",`0 0 ${bounds.w}, ${bounds.h}`);\n this.svg.setAttribute(\"width\",`${bounds.w}px`);\n this.svg.setAttribute(\"height\",`${bounds.h}px`);\n this.svg.style.color = this.specs.color;\n\n // Reposition the SVG relative to the container\n this.svg.style.left = `${bounds.x}px`;\n this.svg.style.top = `${bounds.y}px`;\n this.svg.style.width = `${bounds.w}px`;\n this.svg.style.height = `${bounds.h}px`;\n\n\n // Draw the line\n if(!this.line){\n this.line = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\n this.line.setAttribute(\"marker-end\",`url(#simpleline-${this.id}-arrow)`);\n this.svg.appendChild(this.line);\n }\n let strokeWidth = this.specs.stroke;\n if(!isNaN(strokeWidth) && strokeWidth != 0){\n strokeWidth = `${strokeWidth}px`;\n }\n this.line.style.stroke = \"currentColor\";\n this.line.style.fill = \"none\";\n this.line.style.strokeWidth= strokeWidth;\n this.line.setAttribute('d',\n `M ${startPos.x} ${startPos.y}\n C ${startPos.dirx} ${startPos.diry}, ${endPos.dirx} ${endPos.diry}, ${endPos.x} ${endPos.y}`);\n }\n\n /**\n * Remove the line element from the dom and invalidate it.\n */\n remove(){\n // remove the line\n this.svg.remove();\n this.svg = null;\n this.line = null;\n\n // clear the refresh timer\n clearInterval(this.refreshTimer);\n // stop the observers\n this.resizeObserver.disconnect();\n this.mutationObserver.disconnect();\n this.active = false;\n }\n}\n"],"names":["specsCopy","to","from","ix","hasOwnProperty","Array","isArray","debounce","func","delay","timer","args","context","this","clearTimeout","setTimeout","apply","getElementPosition","el","reference","HTMLElement","x","y","document","querySelector","offsetParent","offsetLeft","offsetTop","elR","getBoundingClientRect","refR","left","top","SimpleLine","constructor","start","end","config","svg","id","idCounter","setConfig","String","console","error","startSelector","endSelector","resizeObserver","ResizeObserver","update","observe","mutationObserver","MutationObserver","mutations_list","forEach","mutation","removedNodes","removed_node","warning","remove","parentElement","subtree","childList","positionCheck","specs","autorefresh","refreshTimer","setInterval","active","class","color","anchors","gravity","stroke","clearInterval","cssClass","startPos","endPos","needUpdate","getContainer","container","getComputedStyle","position","getAnchorPoint","anchor","dirX","dirY","includes","offsetWidth","offsetHeight","dir","svgDefs","defs","createElementNS","marker","setAttribute","appendChild","polygon","append","SVGElement","style","pointerEvents","startAnchor","endAnchor","strokeWpx","elStartPos","elEndPos","w","Math","max","min","h","weight","sqrt","cStartPos","dirx","diry","cEndPos","margin","isNaN","bounds","width","height","line","strokeWidth","fill","disconnect"],"mappings":"kMAoCMA,UAAY,CAACC,GAAIC,YACf,MAAMC,MAAMF,GACTC,KAAKE,eAAeD,MACE,iBAAVF,GAAGE,KACY,iBAAZD,KAAKC,IAEZE,MAAMC,QAAQL,GAAGE,KACbE,MAAMC,QAAQJ,KAAKC,OAClBF,GAAGE,IAAME,MAAMH,KAAKA,KAAKC,MAG7BH,UAAUC,GAAGE,IAAKD,KAAKC,KAI3BF,GAAGE,IAAMD,KAAKC,MAMxBI,SAAW,CAACC,KAAMC,aAChBC,aACG,yCAAYC,6CAAAA,iCACTC,QAAUC,KAChBC,aAAaJ,OACbA,MAAQK,YAAW,KACfP,KAAKQ,MAAMJ,QAASD,QACrBF,OALP,EAeEQ,mBAAqB,CAACC,GAAIC,kBACxBD,IAAQA,cAAcE,mBAEf,CAACC,EAAG,EAAGC,EAAG,MAGhBH,WAAeA,qBAAqBC,cAErCD,UAAYI,SAASC,cAAc,SAGnCN,GAAGO,eAAiBN,gBAEb,CAACE,EAAGH,GAAGQ,WAAYJ,EAAGJ,GAAGS,WAC7B,OACGC,IAAMV,GAAGW,wBACTC,KAAOX,UAAUU,8BAEhB,CAACR,EAAGO,IAAIG,KAAOD,KAAKC,KACnBT,EAAGM,IAAII,IAAMF,KAAKE,aAIrBC,WAWTC,YAAYC,MAAOC,IAAKC,gBACfC,IAAM,UACNC,GAAKN,WAAWO,iBAEhBC,UAAUJ,QAEZF,iBAAiBf,iBACXe,MAAQA,UACV,MAAqB,iBAAVA,OAAsBtB,KAAKsB,iBAAiBO,oBAQ1DC,QAAQC,MAAM,0CAA0CT,eAPnDU,cAAgBV,WAChBA,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