diff --git a/build/aframe-html.js b/build/aframe-html.js
index 33e0b85..11fe85a 100644
--- a/build/aframe-html.js
+++ b/build/aframe-html.js
@@ -1,7 +1,7 @@
(function (three) {
'use strict';
- // This is the same as https://github.com/mrdoob/three.js/commit/b354e68f185b34e798e7b86ca03c70e9bb5f7bc7
+ // This is a copy of https://github.com/mrdoob/three.js/blob/0403020848c26a9605eb91c99a949111ad4a532e/examples/jsm/interactive/HTMLMesh.js
class HTMLMesh extends three.Mesh {
@@ -194,22 +194,25 @@
context.font = style.fontWeight + ' ' + style.fontSize + ' ' + style.fontFamily;
context.textBaseline = 'top';
context.fillStyle = style.color;
- context.fillText( string, x, y + parseFloat(style.fontSize)*0.1 );
+ context.fillText( string, x, y + parseFloat( style.fontSize ) * 0.1 );
}
}
- function buildRectPath(x, y, w, h, r) {
- if (w < 2 * r) r = w / 2;
- if (h < 2 * r) r = h / 2;
+ function buildRectPath( x, y, w, h, r ) {
+
+ if ( w < 2 * r ) r = w / 2;
+ if ( h < 2 * r ) r = h / 2;
+
context.beginPath();
- context.moveTo(x+r, y);
- context.arcTo(x+w, y, x+w, y+h, r);
- context.arcTo(x+w, y+h, x, y+h, r);
- context.arcTo(x, y+h, x, y, r);
- context.arcTo(x, y, x+w, y, r);
+ context.moveTo( x + r, y );
+ context.arcTo( x + w, y, x + w, y + h, r );
+ context.arcTo( x + w, y + h, x, y + h, r );
+ context.arcTo( x, y + h, x, y, r );
+ context.arcTo( x, y, x + w, y, r );
context.closePath();
+
}
function drawBorder( style, which, x, y, width, height ) {
@@ -221,7 +224,7 @@
if ( borderWidth !== '0px' && borderStyle !== 'none' && borderColor !== 'transparent' && borderColor !== 'rgba(0, 0, 0, 0)' ) {
context.strokeStyle = borderColor;
- context.lineWidth = parseFloat(borderWidth);
+ context.lineWidth = parseFloat( borderWidth );
context.beginPath();
context.moveTo( x, y );
context.lineTo( x + width, y + height );
@@ -259,12 +262,30 @@
// Canvas element
if ( element.style.display === 'none' ) return;
- context.save();
+ const rect = element.getBoundingClientRect();
+
+ x = rect.left - offset.left - 0.5;
+ y = rect.top - offset.top - 0.5;
+
+ context.save();
const dpr = window.devicePixelRatio;
- context.scale(1/dpr, 1/dpr);
- context.drawImage(element, 0, 0 );
+ context.scale( 1 / dpr, 1 / dpr );
+ context.drawImage( element, x, y );
context.restore();
+ } else if ( element instanceof HTMLImageElement ) {
+
+ if ( element.style.display === 'none' ) return;
+
+ const rect = element.getBoundingClientRect();
+
+ x = rect.left - offset.left - 0.5;
+ y = rect.top - offset.top - 0.5;
+ width = rect.width;
+ height = rect.height;
+
+ context.drawImage( element, x, y, width, height );
+
} else {
if ( element.style.display === 'none' ) return;
@@ -278,116 +299,156 @@
style = window.getComputedStyle( element );
+ // Get the border of the element used for fill and border
+
+ buildRectPath( x, y, width, height, parseFloat( style.borderRadius ) );
+
const backgroundColor = style.backgroundColor;
- // Get the border of the element used for fill and border
- buildRectPath(x, y, width, height, parseFloat(style.borderRadius) );
if ( backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)' ) {
context.fillStyle = backgroundColor;
context.fill();
+
}
// If all the borders match then stroke the round rectangle
- const borders = ['borderTop', 'borderLeft', 'borderBottom', 'borderRight'];
+
+ const borders = [ 'borderTop', 'borderLeft', 'borderBottom', 'borderRight' ];
+
let match = true;
let prevBorder = null;
- for (const border of borders) {
- if (prevBorder) {
- match = (style[ border + 'Width' ] === style[ prevBorder + 'Width' ]) &&
- (style[ border + 'Color' ] === style[ prevBorder + 'Color' ]) &&
- (style[ border + 'Style' ] === style[ prevBorder + 'Style' ]);
+
+ for ( const border of borders ) {
+
+ if ( prevBorder !== null ) {
+
+ match = ( style[ border + 'Width' ] === style[ prevBorder + 'Width' ] ) &&
+ ( style[ border + 'Color' ] === style[ prevBorder + 'Color' ] ) &&
+ ( style[ border + 'Style' ] === style[ prevBorder + 'Style' ] );
+
}
- if (!match) break;
+
+ if ( match === false ) break;
+
prevBorder = border;
+
}
- // they all match so stroke the rectangle from before allows for border-radius
- if (match) {
- const width = parseFloat(style.borderTopWidth);
+ if ( match === true ) {
+
+ // They all match so stroke the rectangle from before allows for border-radius
+
+ const width = parseFloat( style.borderTopWidth );
+
if ( style.borderTopWidth !== '0px' && style.borderTopStyle !== 'none' && style.borderTopColor !== 'transparent' && style.borderTopColor !== 'rgba(0, 0, 0, 0)' ) {
+
context.strokeStyle = style.borderTopColor;
context.lineWidth = width;
context.stroke();
+
}
+
} else {
// Otherwise draw individual borders
+
drawBorder( style, 'borderTop', x, y, width, 0 );
drawBorder( style, 'borderLeft', x, y, 0, height );
drawBorder( style, 'borderBottom', x, y + height, width, 0 );
drawBorder( style, 'borderRight', x + width, y, 0, height );
+
}
- if ( element instanceof HTMLInputElement) {
+ if ( element instanceof HTMLInputElement ) {
let accentColor = style.accentColor;
- if (accentColor === undefined || accentColor === 'auto') accentColor = style.color;
- color.set(accentColor);
- const luminance = Math.sqrt( 0.299*color.r**2 + 0.587*color.g**2 + 0.114*color.b**2 );
+
+ if ( accentColor === undefined || accentColor === 'auto' ) accentColor = style.color;
+
+ color.set( accentColor );
+
+ const luminance = Math.sqrt( 0.299 * ( color.r ** 2 ) + 0.587 * ( color.g ** 2 ) + 0.114 * ( color.b ** 2 ) );
const accentTextColor = luminance < 0.5 ? 'white' : '#111111';
- if (element.type === 'radio') {
- buildRectPath(x,y,width,height,height);
+ if ( element.type === 'radio' ) {
+
+ buildRectPath( x, y, width, height, height );
+
context.fillStyle = 'white';
context.strokeStyle = accentColor;
context.lineWidth = 1;
context.fill();
context.stroke();
- if (element.checked) {
- const border = 2;
- buildRectPath(x+border,y+border,width-border*2,height-border*2, height);
+ if ( element.checked ) {
+
+ buildRectPath( x + 2, y + 2, width - 4, height - 4, height );
+
context.fillStyle = accentColor;
context.strokeStyle = accentTextColor;
- context.lineWidth = border;
+ context.lineWidth = 2;
context.fill();
context.stroke();
+
}
+
}
- if (element.type === 'checkbox') {
- buildRectPath(x,y,width,height,2);
+ if ( element.type === 'checkbox' ) {
+
+ buildRectPath( x, y, width, height, 2 );
+
context.fillStyle = element.checked ? accentColor : 'white';
context.strokeStyle = element.checked ? accentTextColor : accentColor;
context.lineWidth = 1;
context.stroke();
context.fill();
- if (element.checked) {
- const oldTextAlign = context.textAlign;
+ if ( element.checked ) {
+
+ const currentTextAlign = context.textAlign;
+
context.textAlign = 'center';
- drawText( {
+
+ const properties = {
color: accentTextColor,
fontFamily: style.fontFamily,
fontSize: height + 'px',
fontWeight: 'bold'
- }, x + width/2, y, '✔' );
- context.textAlign = oldTextAlign;
+ };
+
+ drawText( properties, x + ( width / 2 ), y, '✔' );
+
+ context.textAlign = currentTextAlign;
+
}
+
}
- if (element.type === 'range') {
- const [min,max,value] = ['min','max','value'].map(property => parseFloat(element[property]));
- const position = ((value-min)/(max-min)) * (width - height);
+ if ( element.type === 'range' ) {
- buildRectPath(x,y + height*0.25,width, height*0.5, height*0.25);
+ const [ min, max, value ] = [ 'min', 'max', 'value' ].map( property => parseFloat( element[ property ] ) );
+ const position = ( ( value - min ) / ( max - min ) ) * ( width - height );
+
+ buildRectPath( x, y + ( height / 4 ), width, height / 2, height / 4 );
context.fillStyle = accentTextColor;
context.strokeStyle = accentColor;
context.lineWidth = 1;
context.fill();
context.stroke();
- buildRectPath(x,y + height*0.25,position+height*0.5, height*0.5, height*0.25);
+ buildRectPath( x, y + ( height / 4 ), position + ( height / 2 ), height / 2, height / 4 );
context.fillStyle = accentColor;
context.fill();
- buildRectPath(x + position,y,height, height, height*0.5);
+ buildRectPath( x + position, y, height, height, height / 2 );
context.fillStyle = accentColor;
context.fill();
+
}
- if (element.type === 'color' || element.type === 'text' || element.type === 'number' ) {
+ if ( element.type === 'color' || element.type === 'text' || element.type === 'number' ) {
clipper.add( { x: x, y: y, width: width, height: height } );
@@ -440,6 +501,8 @@
// console.time( 'drawElement' );
+ context.clearRect(0, 0, canvas.width, canvas.height);
+
drawElement( element );
// console.timeEnd( 'drawElement' );
@@ -474,16 +537,16 @@
element.dispatchEvent( new MouseEvent( event, mouseEventInit ) );
- if (
- element instanceof HTMLInputElement && element.type === 'range' &&
- (event === 'mousedown' || event === 'click')
- ) {
- const [min,max] = ['min','max'].map(property => parseFloat(element[property]));
+ if ( element instanceof HTMLInputElement && element.type === 'range' && ( event === 'mousedown' || event === 'click' ) ) {
+
+ const [ min, max ] = [ 'min', 'max' ].map( property => parseFloat( element[ property ] ) );
+
const width = rect.width;
const offsetX = x - rect.x;
- const proportion = offsetX/width;
- element.value = min + (max-min)*proportion;
- element.dispatchEvent(new InputEvent('input', {bubbles: true}));
+ const proportion = offsetX / width;
+ element.value = min + ( max - min ) * proportion;
+ element.dispatchEvent( new InputEvent( 'input', { bubbles: true } ) );
+
}
}
diff --git a/build/aframe-html.js.map b/build/aframe-html.js.map
index 43ba929..08f9958 100644
--- a/build/aframe-html.js.map
+++ b/build/aframe-html.js.map
@@ -1 +1 @@
-{"version":3,"file":"aframe-html.js","sources":["../src/HTMLMesh.js","../src/aframe-html.js"],"sourcesContent":["// This is the same as https://github.com/mrdoob/three.js/commit/b354e68f185b34e798e7b86ca03c70e9bb5f7bc7\n// minus the code style and the window.dispatchEvent line commented see TODO.\n// Look at https://github.com/mrdoob/three.js/commits/dev/examples/jsm/interactive/HTMLMesh.js\n// to see if there are other changes that can be retrieved here.\nimport {\n\tCanvasTexture,\n\tLinearFilter,\n\tMesh,\n\tMeshBasicMaterial,\n\tPlaneGeometry,\n\tsRGBEncoding,\n\tColor\n} from 'three';\n\nclass HTMLMesh extends Mesh {\n\n\tconstructor( dom ) {\n\n\t\tconst texture = new HTMLTexture( dom );\n\n\t\tconst geometry = new PlaneGeometry( texture.image.width * 0.001, texture.image.height * 0.001 );\n\t\tconst material = new MeshBasicMaterial( { map: texture, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tfunction onEvent( event ) {\n\n\t\t\tmaterial.map.dispatchDOMEvent( event );\n\n\t\t}\n\n\t\tthis.addEventListener( 'mousedown', onEvent );\n\t\tthis.addEventListener( 'mousemove', onEvent );\n\t\tthis.addEventListener( 'mouseup', onEvent );\n\t\tthis.addEventListener( 'click', onEvent );\n\n\t\tthis.dispose = function () {\n\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\n\t\t\tmaterial.map.dispose();\n\n\t\t\tcanvases.delete( dom );\n\n\t\t\tthis.removeEventListener( 'mousedown', onEvent );\n\t\t\tthis.removeEventListener( 'mousemove', onEvent );\n\t\t\tthis.removeEventListener( 'mouseup', onEvent );\n\t\t\tthis.removeEventListener( 'click', onEvent );\n\n\t\t};\n\n\t}\n\n}\n\nclass HTMLTexture extends CanvasTexture {\n\n\tconstructor( dom ) {\n\n\t\tsuper( html2canvas( dom ) );\n\n\t\tthis.dom = dom;\n\n\t\tthis.anisotropy = 16;\n\t\tthis.encoding = sRGBEncoding;\n\t\tthis.minFilter = LinearFilter;\n\t\tthis.magFilter = LinearFilter;\n\n\t\t// Create an observer on the DOM, and run html2canvas update in the next loop\n\t\tconst observer = new MutationObserver( () => {\n\n\t\t\tif ( ! this.scheduleUpdate ) {\n\n\t\t\t\t// ideally should use xr.requestAnimationFrame, here setTimeout to avoid passing the renderer\n\t\t\t\tthis.scheduleUpdate = setTimeout( () => this.update(), 16 );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst config = { attributes: true, childList: true, subtree: true, characterData: true };\n\t\tobserver.observe( dom, config );\n\n\t\tthis.observer = observer;\n\n\t}\n\n\tdispatchDOMEvent( event ) {\n\n\t\tif ( event.data ) {\n\n\t\t\thtmlevent( this.dom, event.type, event.data.x, event.data.y );\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tthis.image = html2canvas( this.dom );\n\t\tthis.needsUpdate = true;\n\n\t\tthis.scheduleUpdate = null;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.observer ) {\n\n\t\t\tthis.observer.disconnect();\n\n\t\t}\n\n\t\tthis.scheduleUpdate = clearTimeout( this.scheduleUpdate );\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n\n//\n\nconst canvases = new WeakMap();\n\nfunction html2canvas( element ) {\n\n\tconst range = document.createRange();\n\tconst color = new Color();\n\n\tfunction Clipper( context ) {\n\n\t\tconst clips = [];\n\t\tlet isClipping = false;\n\n\t\tfunction doClip() {\n\n\t\t\tif ( isClipping ) {\n\n\t\t\t\tisClipping = false;\n\t\t\t\tcontext.restore();\n\n\t\t\t}\n\n\t\t\tif ( clips.length === 0 ) return;\n\n\t\t\tlet minX = - Infinity, minY = - Infinity;\n\t\t\tlet maxX = Infinity, maxY = Infinity;\n\n\t\t\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\t\t\tconst clip = clips[ i ];\n\n\t\t\t\tminX = Math.max( minX, clip.x );\n\t\t\t\tminY = Math.max( minY, clip.y );\n\t\t\t\tmaxX = Math.min( maxX, clip.x + clip.width );\n\t\t\t\tmaxY = Math.min( maxY, clip.y + clip.height );\n\n\t\t\t}\n\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tcontext.rect( minX, minY, maxX - minX, maxY - minY );\n\t\t\tcontext.clip();\n\n\t\t\tisClipping = true;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tadd: function ( clip ) {\n\n\t\t\t\tclips.push( clip );\n\t\t\t\tdoClip();\n\n\t\t\t},\n\n\t\t\tremove: function () {\n\n\t\t\t\tclips.pop();\n\t\t\t\tdoClip();\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction drawText( style, x, y, string ) {\n\n\t\tif ( string !== '' ) {\n\n\t\t\tif ( style.textTransform === 'uppercase' ) {\n\n\t\t\t\tstring = string.toUpperCase();\n\n\t\t\t}\n\n\t\t\tcontext.font = style.fontWeight + ' ' + style.fontSize + ' ' + style.fontFamily;\n\t\t\tcontext.textBaseline = 'top';\n\t\t\tcontext.fillStyle = style.color;\n\t\t\tcontext.fillText( string, x, y + parseFloat(style.fontSize)*0.1 );\n\n\t\t}\n\n\t}\n\n\tfunction buildRectPath(x, y, w, h, r) {\n\t\tif (w < 2 * r) r = w / 2;\n\t\tif (h < 2 * r) r = h / 2;\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(x+r, y);\n\t\tcontext.arcTo(x+w, y, x+w, y+h, r);\n\t\tcontext.arcTo(x+w, y+h, x, y+h, r);\n\t\tcontext.arcTo(x, y+h, x, y, r);\n\t\tcontext.arcTo(x, y, x+w, y, r);\n\t\tcontext.closePath();\n\t}\n\n\tfunction drawBorder( style, which, x, y, width, height ) {\n\n\t\tconst borderWidth = style[ which + 'Width' ];\n\t\tconst borderStyle = style[ which + 'Style' ];\n\t\tconst borderColor = style[ which + 'Color' ];\n\n\t\tif ( borderWidth !== '0px' && borderStyle !== 'none' && borderColor !== 'transparent' && borderColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\tcontext.strokeStyle = borderColor;\n\t\t\tcontext.lineWidth = parseFloat(borderWidth);\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo( x, y );\n\t\t\tcontext.lineTo( x + width, y + height );\n\t\t\tcontext.stroke();\n\n\t\t}\n\n\t}\n\n\tfunction drawElement( element, style ) {\n\n\t\tlet x = 0, y = 0, width = 0, height = 0;\n\n\t\tif ( element.nodeType === Node.TEXT_NODE ) {\n\n\t\t\t// text\n\n\t\t\trange.selectNode( element );\n\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tdrawText( style, x, y, element.nodeValue.trim() );\n\n\t\t} else if ( element.nodeType === Node.COMMENT_NODE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( element instanceof HTMLCanvasElement ) {\n\n\t\t\t// Canvas element\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tcontext.save();\n\t\t\tconst dpr = window.devicePixelRatio;\n\t\t\tcontext.scale(1/dpr, 1/dpr);\n\t\t\tcontext.drawImage(element, 0, 0 );\n\t\t\tcontext.restore();\n\n\t\t} else {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tstyle = window.getComputedStyle( element );\n\n\t\t\tconst backgroundColor = style.backgroundColor;\n\n\t\t\t// Get the border of the element used for fill and border\n\t\t\tbuildRectPath(x, y, width, height, parseFloat(style.borderRadius) );\n\t\t\tif ( backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\tcontext.fillStyle = backgroundColor;\n\t\t\t\tcontext.fill();\n\t\t\t}\n\n\t\t\t// If all the borders match then stroke the round rectangle\n\t\t\tconst borders = ['borderTop', 'borderLeft', 'borderBottom', 'borderRight'];\n\t\t\tlet match = true;\n\t\t\tlet prevBorder = null;\n\t\t\tfor (const border of borders) {\n\t\t\t\tif (prevBorder) {\n\t\t\t\t\tmatch = (style[ border + 'Width' ] === style[ prevBorder + 'Width' ]) &&\n\t\t\t\t\t(style[ border + 'Color' ] === style[ prevBorder + 'Color' ]) &&\n\t\t\t\t\t(style[ border + 'Style' ] === style[ prevBorder + 'Style' ]);\n\t\t\t\t}\n\t\t\t\tif (!match) break;\n\t\t\t\tprevBorder = border;\n\t\t\t}\n\n\t\t\t// they all match so stroke the rectangle from before allows for border-radius\n\t\t\tif (match) {\n\t\t\t\tconst width = parseFloat(style.borderTopWidth);\n\t\t\t\tif ( style.borderTopWidth !== '0px' && style.borderTopStyle !== 'none' && style.borderTopColor !== 'transparent' && style.borderTopColor !== 'rgba(0, 0, 0, 0)' ) {\n\t\t\t\t\tcontext.strokeStyle = style.borderTopColor;\n\t\t\t\t\tcontext.lineWidth = width;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Otherwise draw individual borders\n\t\t\t\tdrawBorder( style, 'borderTop', x, y, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderLeft', x, y, 0, height );\n\t\t\t\tdrawBorder( style, 'borderBottom', x, y + height, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderRight', x + width, y, 0, height );\n\t\t\t}\n\n\t\t\tif ( element instanceof HTMLInputElement) {\n\n\t\t\t\tlet accentColor = style.accentColor;\n\t\t\t\tif (accentColor === undefined || accentColor === 'auto') accentColor = style.color;\n\t\t\t\tcolor.set(accentColor);\n\t\t\t\tconst luminance = Math.sqrt( 0.299*color.r**2 + 0.587*color.g**2 + 0.114*color.b**2 );\n\t\t\t\tconst accentTextColor = luminance < 0.5 ? 'white' : '#111111';\n\n\t\t\t\tif (element.type === 'radio') {\n\t\t\t\t\tbuildRectPath(x,y,width,height,height);\n\t\t\t\t\tcontext.fillStyle = 'white';\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tif (element.checked) {\n\t\t\t\t\t\tconst border = 2;\n\t\t\t\t\t\tbuildRectPath(x+border,y+border,width-border*2,height-border*2, height);\n\t\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\t\tcontext.strokeStyle = accentTextColor;\n\t\t\t\t\t\tcontext.lineWidth = border;\n\t\t\t\t\t\tcontext.fill();\n\t\t\t\t\t\tcontext.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'checkbox') {\n\t\t\t\t\tbuildRectPath(x,y,width,height,2);\n\t\t\t\t\tcontext.fillStyle = element.checked ? accentColor : 'white';\n\t\t\t\t\tcontext.strokeStyle = element.checked ? accentTextColor : accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tif (element.checked) {\n\t\t\t\t\t\tconst oldTextAlign = context.textAlign;\n\t\t\t\t\t\tcontext.textAlign = 'center';\n\t\t\t\t\t\tdrawText( {\n\t\t\t\t\t\t\tcolor: accentTextColor,\n\t\t\t\t\t\t\tfontFamily: style.fontFamily,\n\t\t\t\t\t\t\tfontSize: height + 'px',\n\t\t\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t\t\t}, x + width/2, y, '✔' );\n\t\t\t\t\t\tcontext.textAlign = oldTextAlign;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'range') {\n\t\t\t\t\tconst [min,max,value] = ['min','max','value'].map(property => parseFloat(element[property]));\n\t\t\t\t\tconst position = ((value-min)/(max-min)) * (width - height);\n\n\t\t\t\t\tbuildRectPath(x,y + height*0.25,width, height*0.5, height*0.25);\n\t\t\t\t\tcontext.fillStyle = accentTextColor;\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tbuildRectPath(x,y + height*0.25,position+height*0.5, height*0.5, height*0.25);\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tbuildRectPath(x + position,y,height, height, height*0.5);\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'color' || element.type === 'text' || element.type === 'number' ) {\n\n\t\t\t\t\tclipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\t\t\t\tdrawText( style, x + parseInt( style.paddingLeft ), y + parseInt( style.paddingTop ), element.value );\n\n\t\t\t\t\tclipper.remove();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/*\n\t\t// debug\n\t\tcontext.strokeStyle = '#' + Math.random().toString( 16 ).slice( - 3 );\n\t\tcontext.strokeRect( x - 0.5, y - 0.5, width + 1, height + 1 );\n\t\t*/\n\n\t\tconst isClipping = style.overflow === 'auto' || style.overflow === 'hidden';\n\n\t\tif ( isClipping ) clipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tdrawElement( element.childNodes[ i ], style );\n\n\t\t}\n\n\t\tif ( isClipping ) clipper.remove();\n\n\t}\n\n\tconst offset = element.getBoundingClientRect();\n\n\tlet canvas = canvases.get( element );\n\n\tif ( canvas === undefined ) {\n\n\t\tcanvas = document.createElement( 'canvas' );\n\t\tcanvas.width = offset.width;\n\t\tcanvas.height = offset.height;\n\t\tcanvases.set( element, canvas );\n\n\t}\n\n\tconst context = canvas.getContext( '2d'/*, { alpha: false }*/ );\n\n\tconst clipper = new Clipper( context );\n\n\t// console.time( 'drawElement' );\n\n\tdrawElement( element );\n\n\t// console.timeEnd( 'drawElement' );\n\n\treturn canvas;\n\n}\n\nfunction htmlevent( element, event, x, y ) {\n\n\tconst mouseEventInit = {\n\t\tclientX: ( x * element.offsetWidth ) + element.offsetLeft,\n\t\tclientY: ( y * element.offsetHeight ) + element.offsetTop,\n\t\tview: element.ownerDocument.defaultView\n\t};\n\n\t// TODO: Find out why this is added. Keep commented out when this file is updated\n\t// window.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\tconst rect = element.getBoundingClientRect();\n\n\tx = x * rect.width + rect.left;\n\ty = y * rect.height + rect.top;\n\n\tfunction traverse( element ) {\n\n\t\tif ( element.nodeType !== Node.TEXT_NODE && element.nodeType !== Node.COMMENT_NODE ) {\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tif ( x > rect.left && x < rect.right && y > rect.top && y < rect.bottom ) {\n\n\t\t\t\telement.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\t\t\t\tif ( \n\t\t\t\t\telement instanceof HTMLInputElement && element.type === 'range' &&\n\t\t\t\t\t(event === 'mousedown' || event === 'click')\n\t\t\t\t) {\n\t\t\t\t\tconst [min,max] = ['min','max'].map(property => parseFloat(element[property]));\n\t\t\t\t\tconst width = rect.width;\n\t\t\t\t\tconst offsetX = x - rect.x;\n\t\t\t\t\tconst proportion = offsetX/width;\n\t\t\t\t\telement.value = min + (max-min)*proportion;\n\t\t\t\t\telement.dispatchEvent(new InputEvent('input', {bubbles: true}));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\ttraverse( element.childNodes[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttraverse( element );\n\n}\n\nexport { HTMLMesh };\n","/* jshint esversion: 9, -W097 */\n/* For dealing with spline curves */\n/* global THREE, AFRAME, setTimeout, console */\n'use strict';\n\nimport { HTMLMesh } from './HTMLMesh.js';\n\nconst schemaHTML = {\n\thtml: {\n\t\ttype: 'selector',\n\t},\n\tcursor: {\n\t\ttype: 'selector',\n\t}\n};\n\ndocumentation:\n{\n\tschemaHTML.html.description = `HTML element to use.`;\n\tschemaHTML.cursor.description = `Visual indicator for where the user is currently pointing`;\n}\n\nconst _pointer = new THREE.Vector2();\nconst _event = { type: '', data: _pointer };\nAFRAME.registerComponent('html', {\n\tschema: schemaHTML,\n\tinit() {\n\t\tthis.rerender = this.rerender.bind(this);\n\t\tthis.handle = this.handle.bind(this);\n\t\tthis.onClick = e => this.handle('click', e);\n\t\tthis.onMouseLeave = e => this.handle('mouseleave', e);\n\t\tthis.onMouseEnter = e => this.handle('mouseenter', e);\n\t\tthis.onMouseUp = e => this.handle('mouseup', e);\n\t\tthis.onMouseDown = e => this.handle('mousedown', e);\n\t\tthis.mouseMoveDetail = {\n\t\t\tdetail: {\n\t\t\t\tcursorEl: null,\n\t\t\t\tintersection: null\n\t\t\t}\n\t\t};\n\t},\n\tplay() {\n\t\tthis.el.addEventListener('click', this.onClick);\n\t\tthis.el.addEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.addEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.addEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.addEventListener('mousedown', this.onMouseDown);\n\t},\n\tpause() {\n\t\tthis.el.removeEventListener('click', this.onClick);\n\t\tthis.el.removeEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.removeEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.removeEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.removeEventListener('mousedown', this.onMouseDown);\n\t},\n\tupdate() {\n\t\tthis.remove();\n\t\tif (!this.data.html) return;\n\t\tconst mesh = new HTMLMesh(this.data.html);\n\t\tthis.el.setObject3D('html', mesh);\n\t\tthis.data.html.addEventListener('input', this.rerender);\n\t\tthis.data.html.addEventListener('change', this.rerender);\n\t\tthis.cursor = this.data.cursor ? this.data.cursor.object3D : null;\n\t},\n\ttick() {\n\t\tif (this.activeRaycaster) {\n\t\t\tconst intersection = this.activeRaycaster.components.raycaster.getIntersection(this.el);\n\t\t\tthis.mouseMoveDetail.detail.cursorEl = this.activeRaycaster;\n\t\t\tthis.mouseMoveDetail.detail.intersection = intersection;\n\t\t\tthis.handle('mousemove', this.mouseMoveDetail);\n\t\t}\n\t},\n\thandle(type, evt) {\n\t\tconst intersection = evt.detail.intersection;\n\t\tconst raycaster = evt.detail.cursorEl;\n\t\tif (type === 'mouseenter') {\n\t\t\tthis.activeRaycaster = raycaster;\n\t\t}\n\t\tif (type === 'mouseleave' && this.activeRaycaster === raycaster) {\n\t\t\tthis.activeRaycaster = null;\n\t\t}\n\t\tif (this.cursor) this.cursor.visible = false;\n\t\tif (intersection) {\n\t\t\tconst mesh = this.el.getObject3D('html');\n\t\t\tconst uv = intersection.uv;\n\t\t\t_event.type = type;\n\t\t\t_event.data.set( uv.x, 1 - uv.y );\n\t\t\tmesh.dispatchEvent( _event );\n\n\t\t\tif (this.cursor) {\n\t\t\t\tthis.cursor.visible = true;\n\t\t\t\tthis.cursor.parent.worldToLocal(this.cursor.position.copy(intersection.point));\n\t\t\t}\n\t\t}\n\t},\n\trerender() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh && !mesh.material.map.scheduleUpdate) {\n\t\t\tmesh.material.map.scheduleUpdate = setTimeout( () => mesh.material.map.update(), 16 );\n\t\t}\n\t},\n\tremove() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh) {\n\t\t\tthis.el.removeObject3D('html');\n\t\t\tthis.data.html.removeEventListener('input', this.rerender);\n\t\t\tthis.data.html.removeEventListener('change', this.rerender);\n\t\t\tmesh.dispose();\n\t\t}\n\t\tthis.activeRaycaster = null;\n\t\tthis.mouseMoveDetail.detail.cursorEl = null;\n\t\tthis.mouseMoveDetail.detail.intersection = null;\n\t\tthis.cursor = null;\n\t},\n});\n"],"names":["Mesh","PlaneGeometry","MeshBasicMaterial","CanvasTexture","sRGBEncoding","LinearFilter","Color"],"mappings":";;;CAAA;AAaA;CACA,MAAM,QAAQ,SAASA,UAAI,CAAC;AAC5B;CACA,CAAC,WAAW,EAAE,GAAG,GAAG;AACpB;CACA,EAAE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,GAAG,EAAE,CAAC;AACzC;CACA,EAAE,MAAM,QAAQ,GAAG,IAAIC,mBAAa,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;CAClG,EAAE,MAAM,QAAQ,GAAG,IAAIC,uBAAiB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;AACnG;CACA,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC9B;CACA,EAAE,SAAS,OAAO,EAAE,KAAK,GAAG;AAC5B;CACA,GAAG,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,EAAE,CAAC;AAC1C;CACA,GAAG;AACH;CACA,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,EAAE,OAAO,E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AAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE;CACjD,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,GAAG,UAAU,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;CACzF,GAAG;CACH,EAAE;CACF,CAAC,MAAM,GAAG;CACV,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C,EAAE,IAAI,IAAI,EAAE;CACZ,GAAG,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;CAClC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC9D,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC/D,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;CAClB,GAAG;CACH,EAAE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;CAC9B,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;CAC9C,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;CAClD,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;CACrB,EAAE;CACF,CAAC,CAAC;;;;;;"}
\ No newline at end of file
+{"version":3,"file":"aframe-html.js","sources":["../src/HTMLMesh.js","../src/aframe-html.js"],"sourcesContent":["// This is a copy of https://github.com/mrdoob/three.js/blob/0403020848c26a9605eb91c99a949111ad4a532e/examples/jsm/interactive/HTMLMesh.js\n// with the following changes:\n// - Revert back to using \"this.encoding = sRGBEncoding\" instead of \"this.colorSpace = SRGBColorSpace;\" for compatibility with three r147 aframe 1.4.2\n// - window.dispatchEvent line commented, see the TODO below.\n// Look at https://github.com/mrdoob/three.js/commits/dev/examples/jsm/interactive/HTMLMesh.js\n// to see if there are other changes that can be retrieved here.\nimport {\n\tCanvasTexture,\n\tLinearFilter,\n\tMesh,\n\tMeshBasicMaterial,\n\tPlaneGeometry,\n\tsRGBEncoding,\n\tColor\n} from 'three';\n\nclass HTMLMesh extends Mesh {\n\n\tconstructor( dom ) {\n\n\t\tconst texture = new HTMLTexture( dom );\n\n\t\tconst geometry = new PlaneGeometry( texture.image.width * 0.001, texture.image.height * 0.001 );\n\t\tconst material = new MeshBasicMaterial( { map: texture, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tfunction onEvent( event ) {\n\n\t\t\tmaterial.map.dispatchDOMEvent( event );\n\n\t\t}\n\n\t\tthis.addEventListener( 'mousedown', onEvent );\n\t\tthis.addEventListener( 'mousemove', onEvent );\n\t\tthis.addEventListener( 'mouseup', onEvent );\n\t\tthis.addEventListener( 'click', onEvent );\n\n\t\tthis.dispose = function () {\n\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\n\t\t\tmaterial.map.dispose();\n\n\t\t\tcanvases.delete( dom );\n\n\t\t\tthis.removeEventListener( 'mousedown', onEvent );\n\t\t\tthis.removeEventListener( 'mousemove', onEvent );\n\t\t\tthis.removeEventListener( 'mouseup', onEvent );\n\t\t\tthis.removeEventListener( 'click', onEvent );\n\n\t\t};\n\n\t}\n\n}\n\nclass HTMLTexture extends CanvasTexture {\n\n\tconstructor( dom ) {\n\n\t\tsuper( html2canvas( dom ) );\n\n\t\tthis.dom = dom;\n\n\t\tthis.anisotropy = 16;\n\t\tthis.encoding = sRGBEncoding;\n\t\tthis.minFilter = LinearFilter;\n\t\tthis.magFilter = LinearFilter;\n\n\t\t// Create an observer on the DOM, and run html2canvas update in the next loop\n\t\tconst observer = new MutationObserver( () => {\n\n\t\t\tif ( ! this.scheduleUpdate ) {\n\n\t\t\t\t// ideally should use xr.requestAnimationFrame, here setTimeout to avoid passing the renderer\n\t\t\t\tthis.scheduleUpdate = setTimeout( () => this.update(), 16 );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst config = { attributes: true, childList: true, subtree: true, characterData: true };\n\t\tobserver.observe( dom, config );\n\n\t\tthis.observer = observer;\n\n\t}\n\n\tdispatchDOMEvent( event ) {\n\n\t\tif ( event.data ) {\n\n\t\t\thtmlevent( this.dom, event.type, event.data.x, event.data.y );\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tthis.image = html2canvas( this.dom );\n\t\tthis.needsUpdate = true;\n\n\t\tthis.scheduleUpdate = null;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.observer ) {\n\n\t\t\tthis.observer.disconnect();\n\n\t\t}\n\n\t\tthis.scheduleUpdate = clearTimeout( this.scheduleUpdate );\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n\n//\n\nconst canvases = new WeakMap();\n\nfunction html2canvas( element ) {\n\n\tconst range = document.createRange();\n\tconst color = new Color();\n\n\tfunction Clipper( context ) {\n\n\t\tconst clips = [];\n\t\tlet isClipping = false;\n\n\t\tfunction doClip() {\n\n\t\t\tif ( isClipping ) {\n\n\t\t\t\tisClipping = false;\n\t\t\t\tcontext.restore();\n\n\t\t\t}\n\n\t\t\tif ( clips.length === 0 ) return;\n\n\t\t\tlet minX = - Infinity, minY = - Infinity;\n\t\t\tlet maxX = Infinity, maxY = Infinity;\n\n\t\t\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\t\t\tconst clip = clips[ i ];\n\n\t\t\t\tminX = Math.max( minX, clip.x );\n\t\t\t\tminY = Math.max( minY, clip.y );\n\t\t\t\tmaxX = Math.min( maxX, clip.x + clip.width );\n\t\t\t\tmaxY = Math.min( maxY, clip.y + clip.height );\n\n\t\t\t}\n\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tcontext.rect( minX, minY, maxX - minX, maxY - minY );\n\t\t\tcontext.clip();\n\n\t\t\tisClipping = true;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tadd: function ( clip ) {\n\n\t\t\t\tclips.push( clip );\n\t\t\t\tdoClip();\n\n\t\t\t},\n\n\t\t\tremove: function () {\n\n\t\t\t\tclips.pop();\n\t\t\t\tdoClip();\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction drawText( style, x, y, string ) {\n\n\t\tif ( string !== '' ) {\n\n\t\t\tif ( style.textTransform === 'uppercase' ) {\n\n\t\t\t\tstring = string.toUpperCase();\n\n\t\t\t}\n\n\t\t\tcontext.font = style.fontWeight + ' ' + style.fontSize + ' ' + style.fontFamily;\n\t\t\tcontext.textBaseline = 'top';\n\t\t\tcontext.fillStyle = style.color;\n\t\t\tcontext.fillText( string, x, y + parseFloat( style.fontSize ) * 0.1 );\n\n\t\t}\n\n\t}\n\n\tfunction buildRectPath( x, y, w, h, r ) {\n\n\t\tif ( w < 2 * r ) r = w / 2;\n\t\tif ( h < 2 * r ) r = h / 2;\n\n\t\tcontext.beginPath();\n\t\tcontext.moveTo( x + r, y );\n\t\tcontext.arcTo( x + w, y, x + w, y + h, r );\n\t\tcontext.arcTo( x + w, y + h, x, y + h, r );\n\t\tcontext.arcTo( x, y + h, x, y, r );\n\t\tcontext.arcTo( x, y, x + w, y, r );\n\t\tcontext.closePath();\n\n\t}\n\n\tfunction drawBorder( style, which, x, y, width, height ) {\n\n\t\tconst borderWidth = style[ which + 'Width' ];\n\t\tconst borderStyle = style[ which + 'Style' ];\n\t\tconst borderColor = style[ which + 'Color' ];\n\n\t\tif ( borderWidth !== '0px' && borderStyle !== 'none' && borderColor !== 'transparent' && borderColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\tcontext.strokeStyle = borderColor;\n\t\t\tcontext.lineWidth = parseFloat( borderWidth );\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo( x, y );\n\t\t\tcontext.lineTo( x + width, y + height );\n\t\t\tcontext.stroke();\n\n\t\t}\n\n\t}\n\n\tfunction drawElement( element, style ) {\n\n\t\tlet x = 0, y = 0, width = 0, height = 0;\n\n\t\tif ( element.nodeType === Node.TEXT_NODE ) {\n\n\t\t\t// text\n\n\t\t\trange.selectNode( element );\n\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tdrawText( style, x, y, element.nodeValue.trim() );\n\n\t\t} else if ( element.nodeType === Node.COMMENT_NODE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( element instanceof HTMLCanvasElement ) {\n\n\t\t\t// Canvas element\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\n\t\t context.save();\n\t\t\tconst dpr = window.devicePixelRatio;\n\t\t\tcontext.scale( 1 / dpr, 1 / dpr );\n\t\t\tcontext.drawImage( element, x, y );\n\t\t\tcontext.restore();\n\n\t\t} else if ( element instanceof HTMLImageElement ) {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tcontext.drawImage( element, x, y, width, height );\n\n\t\t} else {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tstyle = window.getComputedStyle( element );\n\n\t\t\t// Get the border of the element used for fill and border\n\n\t\t\tbuildRectPath( x, y, width, height, parseFloat( style.borderRadius ) );\n\n\t\t\tconst backgroundColor = style.backgroundColor;\n\n\t\t\tif ( backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\tcontext.fillStyle = backgroundColor;\n\t\t\t\tcontext.fill();\n\n\t\t\t}\n\n\t\t\t// If all the borders match then stroke the round rectangle\n\n\t\t\tconst borders = [ 'borderTop', 'borderLeft', 'borderBottom', 'borderRight' ];\n\n\t\t\tlet match = true;\n\t\t\tlet prevBorder = null;\n\n\t\t\tfor ( const border of borders ) {\n\n\t\t\t\tif ( prevBorder !== null ) {\n\n\t\t\t\t\tmatch = ( style[ border + 'Width' ] === style[ prevBorder + 'Width' ] ) &&\n\t\t\t\t\t( style[ border + 'Color' ] === style[ prevBorder + 'Color' ] ) &&\n\t\t\t\t\t( style[ border + 'Style' ] === style[ prevBorder + 'Style' ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( match === false ) break;\n\n\t\t\t\tprevBorder = border;\n\n\t\t\t}\n\n\t\t\tif ( match === true ) {\n\n\t\t\t\t// They all match so stroke the rectangle from before allows for border-radius\n\n\t\t\t\tconst width = parseFloat( style.borderTopWidth );\n\n\t\t\t\tif ( style.borderTopWidth !== '0px' && style.borderTopStyle !== 'none' && style.borderTopColor !== 'transparent' && style.borderTopColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\t\tcontext.strokeStyle = style.borderTopColor;\n\t\t\t\t\tcontext.lineWidth = width;\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// Otherwise draw individual borders\n\n\t\t\t\tdrawBorder( style, 'borderTop', x, y, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderLeft', x, y, 0, height );\n\t\t\t\tdrawBorder( style, 'borderBottom', x, y + height, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderRight', x + width, y, 0, height );\n\n\t\t\t}\n\n\t\t\tif ( element instanceof HTMLInputElement ) {\n\n\t\t\t\tlet accentColor = style.accentColor;\n\n\t\t\t\tif ( accentColor === undefined || accentColor === 'auto' ) accentColor = style.color;\n\n\t\t\t\tcolor.set( accentColor );\n\n\t\t\t\tconst luminance = Math.sqrt( 0.299 * ( color.r ** 2 ) + 0.587 * ( color.g ** 2 ) + 0.114 * ( color.b ** 2 ) );\n\t\t\t\tconst accentTextColor = luminance < 0.5 ? 'white' : '#111111';\n\n\t\t\t\tif ( element.type === 'radio' ) {\n\n\t\t\t\t\tbuildRectPath( x, y, width, height, height );\n\n\t\t\t\t\tcontext.fillStyle = 'white';\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tif ( element.checked ) {\n\n\t\t\t\t\t\tbuildRectPath( x + 2, y + 2, width - 4, height - 4, height );\n\n\t\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\t\tcontext.strokeStyle = accentTextColor;\n\t\t\t\t\t\tcontext.lineWidth = 2;\n\t\t\t\t\t\tcontext.fill();\n\t\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'checkbox' ) {\n\n\t\t\t\t\tbuildRectPath( x, y, width, height, 2 );\n\n\t\t\t\t\tcontext.fillStyle = element.checked ? accentColor : 'white';\n\t\t\t\t\tcontext.strokeStyle = element.checked ? accentTextColor : accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tif ( element.checked ) {\n\n\t\t\t\t\t\tconst currentTextAlign = context.textAlign;\n\n\t\t\t\t\t\tcontext.textAlign = 'center';\n\n\t\t\t\t\t\tconst properties = {\n\t\t\t\t\t\t\tcolor: accentTextColor,\n\t\t\t\t\t\t\tfontFamily: style.fontFamily,\n\t\t\t\t\t\t\tfontSize: height + 'px',\n\t\t\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tdrawText( properties, x + ( width / 2 ), y, '✔' );\n\n\t\t\t\t\t\tcontext.textAlign = currentTextAlign;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'range' ) {\n\n\t\t\t\t\tconst [ min, max, value ] = [ 'min', 'max', 'value' ].map( property => parseFloat( element[ property ] ) );\n\t\t\t\t\tconst position = ( ( value - min ) / ( max - min ) ) * ( width - height );\n\n\t\t\t\t\tbuildRectPath( x, y + ( height / 4 ), width, height / 2, height / 4 );\n\t\t\t\t\tcontext.fillStyle = accentTextColor;\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tbuildRectPath( x, y + ( height / 4 ), position + ( height / 2 ), height / 2, height / 4 );\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tbuildRectPath( x + position, y, height, height, height / 2 );\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'color' || element.type === 'text' || element.type === 'number' ) {\n\n\t\t\t\t\tclipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\t\t\t\tdrawText( style, x + parseInt( style.paddingLeft ), y + parseInt( style.paddingTop ), element.value );\n\n\t\t\t\t\tclipper.remove();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/*\n\t\t// debug\n\t\tcontext.strokeStyle = '#' + Math.random().toString( 16 ).slice( - 3 );\n\t\tcontext.strokeRect( x - 0.5, y - 0.5, width + 1, height + 1 );\n\t\t*/\n\n\t\tconst isClipping = style.overflow === 'auto' || style.overflow === 'hidden';\n\n\t\tif ( isClipping ) clipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tdrawElement( element.childNodes[ i ], style );\n\n\t\t}\n\n\t\tif ( isClipping ) clipper.remove();\n\n\t}\n\n\tconst offset = element.getBoundingClientRect();\n\n\tlet canvas = canvases.get( element );\n\n\tif ( canvas === undefined ) {\n\n\t\tcanvas = document.createElement( 'canvas' );\n\t\tcanvas.width = offset.width;\n\t\tcanvas.height = offset.height;\n\t\tcanvases.set( element, canvas );\n\n\t}\n\n\tconst context = canvas.getContext( '2d'/*, { alpha: false }*/ );\n\n\tconst clipper = new Clipper( context );\n\n\t// console.time( 'drawElement' );\n\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\tdrawElement( element );\n\n\t// console.timeEnd( 'drawElement' );\n\n\treturn canvas;\n\n}\n\nfunction htmlevent( element, event, x, y ) {\n\n\tconst mouseEventInit = {\n\t\tclientX: ( x * element.offsetWidth ) + element.offsetLeft,\n\t\tclientY: ( y * element.offsetHeight ) + element.offsetTop,\n\t\tview: element.ownerDocument.defaultView\n\t};\n\n\t// TODO: Find out why this is added. Keep commented out when this file is updated\n\t// window.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\tconst rect = element.getBoundingClientRect();\n\n\tx = x * rect.width + rect.left;\n\ty = y * rect.height + rect.top;\n\n\tfunction traverse( element ) {\n\n\t\tif ( element.nodeType !== Node.TEXT_NODE && element.nodeType !== Node.COMMENT_NODE ) {\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tif ( x > rect.left && x < rect.right && y > rect.top && y < rect.bottom ) {\n\n\t\t\t\telement.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\t\t\t\tif ( element instanceof HTMLInputElement && element.type === 'range' && ( event === 'mousedown' || event === 'click' ) ) {\n\n\t\t\t\t\tconst [ min, max ] = [ 'min', 'max' ].map( property => parseFloat( element[ property ] ) );\n\n\t\t\t\t\tconst width = rect.width;\n\t\t\t\t\tconst offsetX = x - rect.x;\n\t\t\t\t\tconst proportion = offsetX / width;\n\t\t\t\t\telement.value = min + ( max - min ) * proportion;\n\t\t\t\t\telement.dispatchEvent( new InputEvent( 'input', { bubbles: true } ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\ttraverse( element.childNodes[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttraverse( element );\n\n}\n\nexport { HTMLMesh };\n","/* jshint esversion: 9, -W097 */\n/* For dealing with spline curves */\n/* global THREE, AFRAME, setTimeout, console */\n'use strict';\n\nimport { HTMLMesh } from './HTMLMesh.js';\n\nconst schemaHTML = {\n\thtml: {\n\t\ttype: 'selector',\n\t},\n\tcursor: {\n\t\ttype: 'selector',\n\t}\n};\n\ndocumentation:\n{\n\tschemaHTML.html.description = `HTML element to use.`;\n\tschemaHTML.cursor.description = `Visual indicator for where the user is currently pointing`;\n}\n\nconst _pointer = new THREE.Vector2();\nconst _event = { type: '', data: _pointer };\nAFRAME.registerComponent('html', {\n\tschema: schemaHTML,\n\tinit() {\n\t\tthis.rerender = this.rerender.bind(this);\n\t\tthis.handle = this.handle.bind(this);\n\t\tthis.onClick = e => this.handle('click', e);\n\t\tthis.onMouseLeave = e => this.handle('mouseleave', e);\n\t\tthis.onMouseEnter = e => this.handle('mouseenter', e);\n\t\tthis.onMouseUp = e => this.handle('mouseup', e);\n\t\tthis.onMouseDown = e => this.handle('mousedown', e);\n\t\tthis.mouseMoveDetail = {\n\t\t\tdetail: {\n\t\t\t\tcursorEl: null,\n\t\t\t\tintersection: null\n\t\t\t}\n\t\t};\n\t},\n\tplay() {\n\t\tthis.el.addEventListener('click', this.onClick);\n\t\tthis.el.addEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.addEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.addEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.addEventListener('mousedown', this.onMouseDown);\n\t},\n\tpause() {\n\t\tthis.el.removeEventListener('click', this.onClick);\n\t\tthis.el.removeEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.removeEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.removeEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.removeEventListener('mousedown', this.onMouseDown);\n\t},\n\tupdate() {\n\t\tthis.remove();\n\t\tif (!this.data.html) return;\n\t\tconst mesh = new HTMLMesh(this.data.html);\n\t\tthis.el.setObject3D('html', mesh);\n\t\tthis.data.html.addEventListener('input', this.rerender);\n\t\tthis.data.html.addEventListener('change', this.rerender);\n\t\tthis.cursor = this.data.cursor ? this.data.cursor.object3D : null;\n\t},\n\ttick() {\n\t\tif (this.activeRaycaster) {\n\t\t\tconst intersection = this.activeRaycaster.components.raycaster.getIntersection(this.el);\n\t\t\tthis.mouseMoveDetail.detail.cursorEl = this.activeRaycaster;\n\t\t\tthis.mouseMoveDetail.detail.intersection = intersection;\n\t\t\tthis.handle('mousemove', this.mouseMoveDetail);\n\t\t}\n\t},\n\thandle(type, evt) {\n\t\tconst intersection = evt.detail.intersection;\n\t\tconst raycaster = evt.detail.cursorEl;\n\t\tif (type === 'mouseenter') {\n\t\t\tthis.activeRaycaster = raycaster;\n\t\t}\n\t\tif (type === 'mouseleave' && this.activeRaycaster === raycaster) {\n\t\t\tthis.activeRaycaster = null;\n\t\t}\n\t\tif (this.cursor) this.cursor.visible = false;\n\t\tif (intersection) {\n\t\t\tconst mesh = this.el.getObject3D('html');\n\t\t\tconst uv = intersection.uv;\n\t\t\t_event.type = type;\n\t\t\t_event.data.set( uv.x, 1 - uv.y );\n\t\t\tmesh.dispatchEvent( _event );\n\n\t\t\tif (this.cursor) {\n\t\t\t\tthis.cursor.visible = true;\n\t\t\t\tthis.cursor.parent.worldToLocal(this.cursor.position.copy(intersection.point));\n\t\t\t}\n\t\t}\n\t},\n\trerender() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh && !mesh.material.map.scheduleUpdate) {\n\t\t\tmesh.material.map.scheduleUpdate = setTimeout( () => mesh.material.map.update(), 16 );\n\t\t}\n\t},\n\tremove() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh) {\n\t\t\tthis.el.removeObject3D('html');\n\t\t\tthis.data.html.removeEventListener('input', this.rerender);\n\t\t\tthis.data.html.removeEventListener('change', this.rerender);\n\t\t\tmesh.dispose();\n\t\t}\n\t\tthis.activeRaycaster = null;\n\t\tthis.mouseMoveDetail.detail.cursorEl = null;\n\t\tthis.mouseMoveDetail.detail.intersection = null;\n\t\tthis.cursor = null;\n\t},\n});\n"],"names":["Mesh","PlaneGeometry","MeshBasicMaterial","CanvasTexture","sRGBEncoding","LinearFilter","Color"],"mappings":";;;CAAA;AAeA;CACA,MAAM,QAAQ,SAASA,UAAI,CAAC;AAC5B;CACA,CAAC,WAAW,EAAE,GAAG,GAAG;AACpB;CACA,EAAE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,GAAG,EAAE,CAAC;AACzC;CACA,EAAE,MAAM,QAAQ,GAAG,IAAIC,mBAAa,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;CAClG,EAAE,MAAM,QAAQ,GAAG,IAAIC,uBAAiB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;AACnG;CACA,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC9B;CACA,EAAE,SAAS,OAAO,EAAE,KAAK,GAAG;AAC5B;CACA,GAAG,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,EAAE,CAAC;AAC1C;CACA,GAAG;AACH;CACA,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;CAChD,E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AI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE;CACjD,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,GAAG,UAAU,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;CACzF,GAAG;CACH,EAAE;CACF,CAAC,MAAM,GAAG;CACV,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C,EAAE,IAAI,IAAI,EAAE;CACZ,GAAG,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;CAClC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC9D,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC/D,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;CAClB,GAAG;CACH,EAAE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;CAC9B,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;CAC9C,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;CAClD,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;CACrB,EAAE;CACF,CAAC,CAAC;;;;;;"}
\ No newline at end of file
diff --git a/build/aframe-html.min.js b/build/aframe-html.min.js
index 00f2bdb..eff44ff 100644
--- a/build/aframe-html.min.js
+++ b/build/aframe-html.min.js
@@ -1,2 +1,2 @@
-!function(e){"use strict";class t extends e.Mesh{constructor(t){const s=new i(t),n=new e.PlaneGeometry(.001*s.image.width,.001*s.image.height),r=new e.MeshBasicMaterial({map:s,toneMapped:!1,transparent:!0});function l(e){r.map.dispatchDOMEvent(e)}super(n,r),this.addEventListener("mousedown",l),this.addEventListener("mousemove",l),this.addEventListener("mouseup",l),this.addEventListener("click",l),this.dispose=function(){n.dispose(),r.dispose(),r.map.dispose(),o.delete(t),this.removeEventListener("mousedown",l),this.removeEventListener("mousemove",l),this.removeEventListener("mouseup",l),this.removeEventListener("click",l)}}}class i extends e.CanvasTexture{constructor(t){super(s(t)),this.dom=t,this.anisotropy=16,this.encoding=e.sRGBEncoding,this.minFilter=e.LinearFilter,this.magFilter=e.LinearFilter;const i=new MutationObserver((()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout((()=>this.update()),16))}));i.observe(t,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.observer=i}dispatchDOMEvent(e){e.data&&function(e,t,i,o){const s={clientX:i*e.offsetWidth+e.offsetLeft,clientY:o*e.offsetHeight+e.offsetTop,view:e.ownerDocument.defaultView},n=e.getBoundingClientRect();function r(e){if(e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE){const n=e.getBoundingClientRect();if(i>n.left&&in.top&&oparseFloat(e[t]))),s=n.width,r=(i-n.x)/s;e.value=t+(o-t)*r,e.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let t=0;tparseFloat(t[e]))),l=(n-o)/(s-o)*(p-m);r(h,u+.25*m,p,.5*m,.25*m),d.fillStyle=i,d.strokeStyle=e,d.lineWidth=1,d.fill(),d.stroke(),r(h,u+.25*m,l+.5*m,.5*m,.25*m),d.fillStyle=e,d.fill(),r(h+l,u,m,m,.5*m),d.fillStyle=e,d.fill()}"color"!==t.type&&"text"!==t.type&&"number"!==t.type||(c.add({x:h,y:u,width:p,height:m}),n(o,h+parseInt(o.paddingLeft),u+parseInt(o.paddingTop),t.value),c.remove())}}}const v="auto"===o.overflow||"hidden"===o.overflow;v&&c.add({x:h,y:u,width:p,height:m});for(let i=0;ithis.handle("click",e),this.onMouseLeave=e=>this.handle("mouseleave",e),this.onMouseEnter=e=>this.handle("mouseenter",e),this.onMouseUp=e=>this.handle("mouseup",e),this.onMouseDown=e=>this.handle("mousedown",e),this.mouseMoveDetail={detail:{cursorEl:null,intersection:null}}},play(){this.el.addEventListener("click",this.onClick),this.el.addEventListener("mouseleave",this.onMouseLeave),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseup",this.onMouseUp),this.el.addEventListener("mousedown",this.onMouseDown)},pause(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseup",this.onMouseUp),this.el.removeEventListener("mousedown",this.onMouseDown)},update(){if(this.remove(),!this.data.html)return;const e=new t(this.data.html);this.el.setObject3D("html",e),this.data.html.addEventListener("input",this.rerender),this.data.html.addEventListener("change",this.rerender),this.cursor=this.data.cursor?this.data.cursor.object3D:null},tick(){if(this.activeRaycaster){const e=this.activeRaycaster.components.raycaster.getIntersection(this.el);this.mouseMoveDetail.detail.cursorEl=this.activeRaycaster,this.mouseMoveDetail.detail.intersection=e,this.handle("mousemove",this.mouseMoveDetail)}},handle(e,t){const i=t.detail.intersection,o=t.detail.cursorEl;if("mouseenter"===e&&(this.activeRaycaster=o),"mouseleave"===e&&this.activeRaycaster===o&&(this.activeRaycaster=null),this.cursor&&(this.cursor.visible=!1),i){const t=this.el.getObject3D("html"),o=i.uv;n.type=e,n.data.set(o.x,1-o.y),t.dispatchEvent(n),this.cursor&&(this.cursor.visible=!0,this.cursor.parent.worldToLocal(this.cursor.position.copy(i.point)))}},rerender(){const e=this.el.getObject3D("html");e&&!e.material.map.scheduleUpdate&&(e.material.map.scheduleUpdate=setTimeout((()=>e.material.map.update()),16))},remove(){const e=this.el.getObject3D("html");e&&(this.el.removeObject3D("html"),this.data.html.removeEventListener("input",this.rerender),this.data.html.removeEventListener("change",this.rerender),e.dispose()),this.activeRaycaster=null,this.mouseMoveDetail.detail.cursorEl=null,this.mouseMoveDetail.detail.intersection=null,this.cursor=null}})}(THREE);
+!function(e){"use strict";class t extends e.Mesh{constructor(t){const s=new i(t),n=new e.PlaneGeometry(.001*s.image.width,.001*s.image.height),r=new e.MeshBasicMaterial({map:s,toneMapped:!1,transparent:!0});function l(e){r.map.dispatchDOMEvent(e)}super(n,r),this.addEventListener("mousedown",l),this.addEventListener("mousemove",l),this.addEventListener("mouseup",l),this.addEventListener("click",l),this.dispose=function(){n.dispose(),r.dispose(),r.map.dispose(),o.delete(t),this.removeEventListener("mousedown",l),this.removeEventListener("mousemove",l),this.removeEventListener("mouseup",l),this.removeEventListener("click",l)}}}class i extends e.CanvasTexture{constructor(t){super(s(t)),this.dom=t,this.anisotropy=16,this.encoding=e.sRGBEncoding,this.minFilter=e.LinearFilter,this.magFilter=e.LinearFilter;const i=new MutationObserver((()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout((()=>this.update()),16))}));i.observe(t,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.observer=i}dispatchDOMEvent(e){e.data&&function(e,t,i,o){const s={clientX:i*e.offsetWidth+e.offsetLeft,clientY:o*e.offsetHeight+e.offsetTop,view:e.ownerDocument.defaultView},n=e.getBoundingClientRect();function r(e){if(e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE){const n=e.getBoundingClientRect();if(i>n.left&&in.top&&oparseFloat(e[t]))),s=n.width,r=(i-n.x)/s;e.value=t+(o-t)*r,e.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let t=0;tparseFloat(t[e]))),l=(n-o)/(s-o)*(p-m);r(h,u+m/4,p,m/2,m/4),d.fillStyle=i,d.strokeStyle=e,d.lineWidth=1,d.fill(),d.stroke(),r(h,u+m/4,l+m/2,m/2,m/4),d.fillStyle=e,d.fill(),r(h+l,u,m,m,m/2),d.fillStyle=e,d.fill()}"color"!==t.type&&"text"!==t.type&&"number"!==t.type||(c.add({x:h,y:u,width:p,height:m}),n(o,h+parseInt(o.paddingLeft),u+parseInt(o.paddingTop),t.value),c.remove())}}}const v="auto"===o.overflow||"hidden"===o.overflow;v&&c.add({x:h,y:u,width:p,height:m});for(let i=0;ithis.handle("click",e),this.onMouseLeave=e=>this.handle("mouseleave",e),this.onMouseEnter=e=>this.handle("mouseenter",e),this.onMouseUp=e=>this.handle("mouseup",e),this.onMouseDown=e=>this.handle("mousedown",e),this.mouseMoveDetail={detail:{cursorEl:null,intersection:null}}},play(){this.el.addEventListener("click",this.onClick),this.el.addEventListener("mouseleave",this.onMouseLeave),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseup",this.onMouseUp),this.el.addEventListener("mousedown",this.onMouseDown)},pause(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseup",this.onMouseUp),this.el.removeEventListener("mousedown",this.onMouseDown)},update(){if(this.remove(),!this.data.html)return;const e=new t(this.data.html);this.el.setObject3D("html",e),this.data.html.addEventListener("input",this.rerender),this.data.html.addEventListener("change",this.rerender),this.cursor=this.data.cursor?this.data.cursor.object3D:null},tick(){if(this.activeRaycaster){const e=this.activeRaycaster.components.raycaster.getIntersection(this.el);this.mouseMoveDetail.detail.cursorEl=this.activeRaycaster,this.mouseMoveDetail.detail.intersection=e,this.handle("mousemove",this.mouseMoveDetail)}},handle(e,t){const i=t.detail.intersection,o=t.detail.cursorEl;if("mouseenter"===e&&(this.activeRaycaster=o),"mouseleave"===e&&this.activeRaycaster===o&&(this.activeRaycaster=null),this.cursor&&(this.cursor.visible=!1),i){const t=this.el.getObject3D("html"),o=i.uv;n.type=e,n.data.set(o.x,1-o.y),t.dispatchEvent(n),this.cursor&&(this.cursor.visible=!0,this.cursor.parent.worldToLocal(this.cursor.position.copy(i.point)))}},rerender(){const e=this.el.getObject3D("html");e&&!e.material.map.scheduleUpdate&&(e.material.map.scheduleUpdate=setTimeout((()=>e.material.map.update()),16))},remove(){const e=this.el.getObject3D("html");e&&(this.el.removeObject3D("html"),this.data.html.removeEventListener("input",this.rerender),this.data.html.removeEventListener("change",this.rerender),e.dispose()),this.activeRaycaster=null,this.mouseMoveDetail.detail.cursorEl=null,this.mouseMoveDetail.detail.intersection=null,this.cursor=null}})}(THREE);
//# sourceMappingURL=aframe-html.min.js.map
diff --git a/build/aframe-html.min.js.map b/build/aframe-html.min.js.map
index aca8c5f..b8c30e7 100644
--- a/build/aframe-html.min.js.map
+++ b/build/aframe-html.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"aframe-html.min.js","sources":["../src/HTMLMesh.js","../src/aframe-html.js"],"sourcesContent":["// This is the same as https://github.com/mrdoob/three.js/commit/b354e68f185b34e798e7b86ca03c70e9bb5f7bc7\n// minus the code style and the window.dispatchEvent line commented see TODO.\n// Look at https://github.com/mrdoob/three.js/commits/dev/examples/jsm/interactive/HTMLMesh.js\n// to see if there are other changes that can be retrieved here.\nimport {\n\tCanvasTexture,\n\tLinearFilter,\n\tMesh,\n\tMeshBasicMaterial,\n\tPlaneGeometry,\n\tsRGBEncoding,\n\tColor\n} from 'three';\n\nclass HTMLMesh extends Mesh {\n\n\tconstructor( dom ) {\n\n\t\tconst texture = new HTMLTexture( dom );\n\n\t\tconst geometry = new PlaneGeometry( texture.image.width * 0.001, texture.image.height * 0.001 );\n\t\tconst material = new MeshBasicMaterial( { map: texture, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tfunction onEvent( event ) {\n\n\t\t\tmaterial.map.dispatchDOMEvent( event );\n\n\t\t}\n\n\t\tthis.addEventListener( 'mousedown', onEvent );\n\t\tthis.addEventListener( 'mousemove', onEvent );\n\t\tthis.addEventListener( 'mouseup', onEvent );\n\t\tthis.addEventListener( 'click', onEvent );\n\n\t\tthis.dispose = function () {\n\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\n\t\t\tmaterial.map.dispose();\n\n\t\t\tcanvases.delete( dom );\n\n\t\t\tthis.removeEventListener( 'mousedown', onEvent );\n\t\t\tthis.removeEventListener( 'mousemove', onEvent );\n\t\t\tthis.removeEventListener( 'mouseup', onEvent );\n\t\t\tthis.removeEventListener( 'click', onEvent );\n\n\t\t};\n\n\t}\n\n}\n\nclass HTMLTexture extends CanvasTexture {\n\n\tconstructor( dom ) {\n\n\t\tsuper( html2canvas( dom ) );\n\n\t\tthis.dom = dom;\n\n\t\tthis.anisotropy = 16;\n\t\tthis.encoding = sRGBEncoding;\n\t\tthis.minFilter = LinearFilter;\n\t\tthis.magFilter = LinearFilter;\n\n\t\t// Create an observer on the DOM, and run html2canvas update in the next loop\n\t\tconst observer = new MutationObserver( () => {\n\n\t\t\tif ( ! this.scheduleUpdate ) {\n\n\t\t\t\t// ideally should use xr.requestAnimationFrame, here setTimeout to avoid passing the renderer\n\t\t\t\tthis.scheduleUpdate = setTimeout( () => this.update(), 16 );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst config = { attributes: true, childList: true, subtree: true, characterData: true };\n\t\tobserver.observe( dom, config );\n\n\t\tthis.observer = observer;\n\n\t}\n\n\tdispatchDOMEvent( event ) {\n\n\t\tif ( event.data ) {\n\n\t\t\thtmlevent( this.dom, event.type, event.data.x, event.data.y );\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tthis.image = html2canvas( this.dom );\n\t\tthis.needsUpdate = true;\n\n\t\tthis.scheduleUpdate = null;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.observer ) {\n\n\t\t\tthis.observer.disconnect();\n\n\t\t}\n\n\t\tthis.scheduleUpdate = clearTimeout( this.scheduleUpdate );\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n\n//\n\nconst canvases = new WeakMap();\n\nfunction html2canvas( element ) {\n\n\tconst range = document.createRange();\n\tconst color = new Color();\n\n\tfunction Clipper( context ) {\n\n\t\tconst clips = [];\n\t\tlet isClipping = false;\n\n\t\tfunction doClip() {\n\n\t\t\tif ( isClipping ) {\n\n\t\t\t\tisClipping = false;\n\t\t\t\tcontext.restore();\n\n\t\t\t}\n\n\t\t\tif ( clips.length === 0 ) return;\n\n\t\t\tlet minX = - Infinity, minY = - Infinity;\n\t\t\tlet maxX = Infinity, maxY = Infinity;\n\n\t\t\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\t\t\tconst clip = clips[ i ];\n\n\t\t\t\tminX = Math.max( minX, clip.x );\n\t\t\t\tminY = Math.max( minY, clip.y );\n\t\t\t\tmaxX = Math.min( maxX, clip.x + clip.width );\n\t\t\t\tmaxY = Math.min( maxY, clip.y + clip.height );\n\n\t\t\t}\n\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tcontext.rect( minX, minY, maxX - minX, maxY - minY );\n\t\t\tcontext.clip();\n\n\t\t\tisClipping = true;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tadd: function ( clip ) {\n\n\t\t\t\tclips.push( clip );\n\t\t\t\tdoClip();\n\n\t\t\t},\n\n\t\t\tremove: function () {\n\n\t\t\t\tclips.pop();\n\t\t\t\tdoClip();\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction drawText( style, x, y, string ) {\n\n\t\tif ( string !== '' ) {\n\n\t\t\tif ( style.textTransform === 'uppercase' ) {\n\n\t\t\t\tstring = string.toUpperCase();\n\n\t\t\t}\n\n\t\t\tcontext.font = style.fontWeight + ' ' + style.fontSize + ' ' + style.fontFamily;\n\t\t\tcontext.textBaseline = 'top';\n\t\t\tcontext.fillStyle = style.color;\n\t\t\tcontext.fillText( string, x, y + parseFloat(style.fontSize)*0.1 );\n\n\t\t}\n\n\t}\n\n\tfunction buildRectPath(x, y, w, h, r) {\n\t\tif (w < 2 * r) r = w / 2;\n\t\tif (h < 2 * r) r = h / 2;\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(x+r, y);\n\t\tcontext.arcTo(x+w, y, x+w, y+h, r);\n\t\tcontext.arcTo(x+w, y+h, x, y+h, r);\n\t\tcontext.arcTo(x, y+h, x, y, r);\n\t\tcontext.arcTo(x, y, x+w, y, r);\n\t\tcontext.closePath();\n\t}\n\n\tfunction drawBorder( style, which, x, y, width, height ) {\n\n\t\tconst borderWidth = style[ which + 'Width' ];\n\t\tconst borderStyle = style[ which + 'Style' ];\n\t\tconst borderColor = style[ which + 'Color' ];\n\n\t\tif ( borderWidth !== '0px' && borderStyle !== 'none' && borderColor !== 'transparent' && borderColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\tcontext.strokeStyle = borderColor;\n\t\t\tcontext.lineWidth = parseFloat(borderWidth);\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo( x, y );\n\t\t\tcontext.lineTo( x + width, y + height );\n\t\t\tcontext.stroke();\n\n\t\t}\n\n\t}\n\n\tfunction drawElement( element, style ) {\n\n\t\tlet x = 0, y = 0, width = 0, height = 0;\n\n\t\tif ( element.nodeType === Node.TEXT_NODE ) {\n\n\t\t\t// text\n\n\t\t\trange.selectNode( element );\n\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tdrawText( style, x, y, element.nodeValue.trim() );\n\n\t\t} else if ( element.nodeType === Node.COMMENT_NODE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( element instanceof HTMLCanvasElement ) {\n\n\t\t\t// Canvas element\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tcontext.save();\n\t\t\tconst dpr = window.devicePixelRatio;\n\t\t\tcontext.scale(1/dpr, 1/dpr);\n\t\t\tcontext.drawImage(element, 0, 0 );\n\t\t\tcontext.restore();\n\n\t\t} else {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tstyle = window.getComputedStyle( element );\n\n\t\t\tconst backgroundColor = style.backgroundColor;\n\n\t\t\t// Get the border of the element used for fill and border\n\t\t\tbuildRectPath(x, y, width, height, parseFloat(style.borderRadius) );\n\t\t\tif ( backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\tcontext.fillStyle = backgroundColor;\n\t\t\t\tcontext.fill();\n\t\t\t}\n\n\t\t\t// If all the borders match then stroke the round rectangle\n\t\t\tconst borders = ['borderTop', 'borderLeft', 'borderBottom', 'borderRight'];\n\t\t\tlet match = true;\n\t\t\tlet prevBorder = null;\n\t\t\tfor (const border of borders) {\n\t\t\t\tif (prevBorder) {\n\t\t\t\t\tmatch = (style[ border + 'Width' ] === style[ prevBorder + 'Width' ]) &&\n\t\t\t\t\t(style[ border + 'Color' ] === style[ prevBorder + 'Color' ]) &&\n\t\t\t\t\t(style[ border + 'Style' ] === style[ prevBorder + 'Style' ]);\n\t\t\t\t}\n\t\t\t\tif (!match) break;\n\t\t\t\tprevBorder = border;\n\t\t\t}\n\n\t\t\t// they all match so stroke the rectangle from before allows for border-radius\n\t\t\tif (match) {\n\t\t\t\tconst width = parseFloat(style.borderTopWidth);\n\t\t\t\tif ( style.borderTopWidth !== '0px' && style.borderTopStyle !== 'none' && style.borderTopColor !== 'transparent' && style.borderTopColor !== 'rgba(0, 0, 0, 0)' ) {\n\t\t\t\t\tcontext.strokeStyle = style.borderTopColor;\n\t\t\t\t\tcontext.lineWidth = width;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Otherwise draw individual borders\n\t\t\t\tdrawBorder( style, 'borderTop', x, y, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderLeft', x, y, 0, height );\n\t\t\t\tdrawBorder( style, 'borderBottom', x, y + height, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderRight', x + width, y, 0, height );\n\t\t\t}\n\n\t\t\tif ( element instanceof HTMLInputElement) {\n\n\t\t\t\tlet accentColor = style.accentColor;\n\t\t\t\tif (accentColor === undefined || accentColor === 'auto') accentColor = style.color;\n\t\t\t\tcolor.set(accentColor);\n\t\t\t\tconst luminance = Math.sqrt( 0.299*color.r**2 + 0.587*color.g**2 + 0.114*color.b**2 );\n\t\t\t\tconst accentTextColor = luminance < 0.5 ? 'white' : '#111111';\n\n\t\t\t\tif (element.type === 'radio') {\n\t\t\t\t\tbuildRectPath(x,y,width,height,height);\n\t\t\t\t\tcontext.fillStyle = 'white';\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tif (element.checked) {\n\t\t\t\t\t\tconst border = 2;\n\t\t\t\t\t\tbuildRectPath(x+border,y+border,width-border*2,height-border*2, height);\n\t\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\t\tcontext.strokeStyle = accentTextColor;\n\t\t\t\t\t\tcontext.lineWidth = border;\n\t\t\t\t\t\tcontext.fill();\n\t\t\t\t\t\tcontext.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'checkbox') {\n\t\t\t\t\tbuildRectPath(x,y,width,height,2);\n\t\t\t\t\tcontext.fillStyle = element.checked ? accentColor : 'white';\n\t\t\t\t\tcontext.strokeStyle = element.checked ? accentTextColor : accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tif (element.checked) {\n\t\t\t\t\t\tconst oldTextAlign = context.textAlign;\n\t\t\t\t\t\tcontext.textAlign = 'center';\n\t\t\t\t\t\tdrawText( {\n\t\t\t\t\t\t\tcolor: accentTextColor,\n\t\t\t\t\t\t\tfontFamily: style.fontFamily,\n\t\t\t\t\t\t\tfontSize: height + 'px',\n\t\t\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t\t\t}, x + width/2, y, '✔' );\n\t\t\t\t\t\tcontext.textAlign = oldTextAlign;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'range') {\n\t\t\t\t\tconst [min,max,value] = ['min','max','value'].map(property => parseFloat(element[property]));\n\t\t\t\t\tconst position = ((value-min)/(max-min)) * (width - height);\n\n\t\t\t\t\tbuildRectPath(x,y + height*0.25,width, height*0.5, height*0.25);\n\t\t\t\t\tcontext.fillStyle = accentTextColor;\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tbuildRectPath(x,y + height*0.25,position+height*0.5, height*0.5, height*0.25);\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tbuildRectPath(x + position,y,height, height, height*0.5);\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\n\t\t\t\tif (element.type === 'color' || element.type === 'text' || element.type === 'number' ) {\n\n\t\t\t\t\tclipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\t\t\t\tdrawText( style, x + parseInt( style.paddingLeft ), y + parseInt( style.paddingTop ), element.value );\n\n\t\t\t\t\tclipper.remove();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/*\n\t\t// debug\n\t\tcontext.strokeStyle = '#' + Math.random().toString( 16 ).slice( - 3 );\n\t\tcontext.strokeRect( x - 0.5, y - 0.5, width + 1, height + 1 );\n\t\t*/\n\n\t\tconst isClipping = style.overflow === 'auto' || style.overflow === 'hidden';\n\n\t\tif ( isClipping ) clipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tdrawElement( element.childNodes[ i ], style );\n\n\t\t}\n\n\t\tif ( isClipping ) clipper.remove();\n\n\t}\n\n\tconst offset = element.getBoundingClientRect();\n\n\tlet canvas = canvases.get( element );\n\n\tif ( canvas === undefined ) {\n\n\t\tcanvas = document.createElement( 'canvas' );\n\t\tcanvas.width = offset.width;\n\t\tcanvas.height = offset.height;\n\t\tcanvases.set( element, canvas );\n\n\t}\n\n\tconst context = canvas.getContext( '2d'/*, { alpha: false }*/ );\n\n\tconst clipper = new Clipper( context );\n\n\t// console.time( 'drawElement' );\n\n\tdrawElement( element );\n\n\t// console.timeEnd( 'drawElement' );\n\n\treturn canvas;\n\n}\n\nfunction htmlevent( element, event, x, y ) {\n\n\tconst mouseEventInit = {\n\t\tclientX: ( x * element.offsetWidth ) + element.offsetLeft,\n\t\tclientY: ( y * element.offsetHeight ) + element.offsetTop,\n\t\tview: element.ownerDocument.defaultView\n\t};\n\n\t// TODO: Find out why this is added. Keep commented out when this file is updated\n\t// window.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\tconst rect = element.getBoundingClientRect();\n\n\tx = x * rect.width + rect.left;\n\ty = y * rect.height + rect.top;\n\n\tfunction traverse( element ) {\n\n\t\tif ( element.nodeType !== Node.TEXT_NODE && element.nodeType !== Node.COMMENT_NODE ) {\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tif ( x > rect.left && x < rect.right && y > rect.top && y < rect.bottom ) {\n\n\t\t\t\telement.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\t\t\t\tif ( \n\t\t\t\t\telement instanceof HTMLInputElement && element.type === 'range' &&\n\t\t\t\t\t(event === 'mousedown' || event === 'click')\n\t\t\t\t) {\n\t\t\t\t\tconst [min,max] = ['min','max'].map(property => parseFloat(element[property]));\n\t\t\t\t\tconst width = rect.width;\n\t\t\t\t\tconst offsetX = x - rect.x;\n\t\t\t\t\tconst proportion = offsetX/width;\n\t\t\t\t\telement.value = min + (max-min)*proportion;\n\t\t\t\t\telement.dispatchEvent(new InputEvent('input', {bubbles: true}));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\ttraverse( element.childNodes[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttraverse( element );\n\n}\n\nexport { HTMLMesh };\n","/* jshint esversion: 9, -W097 */\n/* For dealing with spline curves */\n/* global THREE, AFRAME, setTimeout, console */\n'use strict';\n\nimport { HTMLMesh } from './HTMLMesh.js';\n\nconst schemaHTML = {\n\thtml: {\n\t\ttype: 'selector',\n\t},\n\tcursor: {\n\t\ttype: 'selector',\n\t}\n};\n\ndocumentation:\n{\n\tschemaHTML.html.description = `HTML element to use.`;\n\tschemaHTML.cursor.description = `Visual indicator for where the user is currently pointing`;\n}\n\nconst _pointer = new THREE.Vector2();\nconst _event = { type: '', data: _pointer };\nAFRAME.registerComponent('html', {\n\tschema: schemaHTML,\n\tinit() {\n\t\tthis.rerender = this.rerender.bind(this);\n\t\tthis.handle = this.handle.bind(this);\n\t\tthis.onClick = e => this.handle('click', e);\n\t\tthis.onMouseLeave = e => this.handle('mouseleave', e);\n\t\tthis.onMouseEnter = e => this.handle('mouseenter', e);\n\t\tthis.onMouseUp = e => this.handle('mouseup', e);\n\t\tthis.onMouseDown = e => this.handle('mousedown', e);\n\t\tthis.mouseMoveDetail = {\n\t\t\tdetail: {\n\t\t\t\tcursorEl: null,\n\t\t\t\tintersection: null\n\t\t\t}\n\t\t};\n\t},\n\tplay() {\n\t\tthis.el.addEventListener('click', this.onClick);\n\t\tthis.el.addEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.addEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.addEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.addEventListener('mousedown', this.onMouseDown);\n\t},\n\tpause() {\n\t\tthis.el.removeEventListener('click', this.onClick);\n\t\tthis.el.removeEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.removeEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.removeEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.removeEventListener('mousedown', this.onMouseDown);\n\t},\n\tupdate() {\n\t\tthis.remove();\n\t\tif (!this.data.html) return;\n\t\tconst mesh = new HTMLMesh(this.data.html);\n\t\tthis.el.setObject3D('html', mesh);\n\t\tthis.data.html.addEventListener('input', this.rerender);\n\t\tthis.data.html.addEventListener('change', this.rerender);\n\t\tthis.cursor = this.data.cursor ? this.data.cursor.object3D : null;\n\t},\n\ttick() {\n\t\tif (this.activeRaycaster) {\n\t\t\tconst intersection = this.activeRaycaster.components.raycaster.getIntersection(this.el);\n\t\t\tthis.mouseMoveDetail.detail.cursorEl = this.activeRaycaster;\n\t\t\tthis.mouseMoveDetail.detail.intersection = intersection;\n\t\t\tthis.handle('mousemove', this.mouseMoveDetail);\n\t\t}\n\t},\n\thandle(type, evt) {\n\t\tconst intersection = evt.detail.intersection;\n\t\tconst raycaster = evt.detail.cursorEl;\n\t\tif (type === 'mouseenter') {\n\t\t\tthis.activeRaycaster = raycaster;\n\t\t}\n\t\tif (type === 'mouseleave' && this.activeRaycaster === raycaster) {\n\t\t\tthis.activeRaycaster = null;\n\t\t}\n\t\tif (this.cursor) this.cursor.visible = false;\n\t\tif (intersection) {\n\t\t\tconst mesh = this.el.getObject3D('html');\n\t\t\tconst uv = intersection.uv;\n\t\t\t_event.type = type;\n\t\t\t_event.data.set( uv.x, 1 - uv.y );\n\t\t\tmesh.dispatchEvent( _event );\n\n\t\t\tif (this.cursor) {\n\t\t\t\tthis.cursor.visible = true;\n\t\t\t\tthis.cursor.parent.worldToLocal(this.cursor.position.copy(intersection.point));\n\t\t\t}\n\t\t}\n\t},\n\trerender() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh && !mesh.material.map.scheduleUpdate) {\n\t\t\tmesh.material.map.scheduleUpdate = setTimeout( () => mesh.material.map.update(), 16 );\n\t\t}\n\t},\n\tremove() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh) {\n\t\t\tthis.el.removeObject3D('html');\n\t\t\tthis.data.html.removeEventListener('input', this.rerender);\n\t\t\tthis.data.html.removeEventListener('change', this.rerender);\n\t\t\tmesh.dispose();\n\t\t}\n\t\tthis.activeRaycaster = null;\n\t\tthis.mouseMoveDetail.detail.cursorEl = null;\n\t\tthis.mouseMoveDetail.detail.intersection = null;\n\t\tthis.cursor = null;\n\t},\n});\n"],"names":["HTMLMesh","Mesh","constructor","dom","texture","HTMLTexture","geometry","PlaneGeometry","image","width","height","material","MeshBasicMaterial","map","toneMapped","transparent","onEvent","event","dispatchDOMEvent","super","this","addEventListener","dispose","canvases","delete","removeEventListener","CanvasTexture","html2canvas","anisotropy","encoding","sRGBEncoding","minFilter","LinearFilter","magFilter","observer","MutationObserver","scheduleUpdate","setTimeout","update","observe","attributes","childList","subtree","characterData","data","element","x","y","mouseEventInit","clientX","offsetWidth","offsetLeft","clientY","offsetHeight","offsetTop","view","ownerDocument","defaultView","rect","getBoundingClientRect","traverse","nodeType","Node","TEXT_NODE","COMMENT_NODE","left","right","top","bottom","dispatchEvent","MouseEvent","HTMLInputElement","type","min","max","property","parseFloat","proportion","value","InputEvent","bubbles","i","childNodes","length","htmlevent","needsUpdate","disconnect","clearTimeout","WeakMap","range","document","createRange","color","Color","drawText","style","string","textTransform","toUpperCase","context","font","fontWeight","fontSize","fontFamily","textBaseline","fillStyle","fillText","buildRectPath","w","h","r","beginPath","moveTo","arcTo","closePath","drawBorder","which","borderWidth","borderStyle","borderColor","strokeStyle","lineWidth","lineTo","stroke","offset","canvas","get","undefined","createElement","set","getContext","clipper","clips","isClipping","doClip","restore","minX","Infinity","minY","maxX","maxY","clip","Math","save","add","push","remove","pop","drawElement","selectNode","nodeValue","trim","HTMLCanvasElement","display","dpr","window","devicePixelRatio","scale","drawImage","backgroundColor","getComputedStyle","borderRadius","fill","borders","match","prevBorder","border","borderTopWidth","borderTopStyle","borderTopColor","accentColor","accentTextColor","sqrt","g","b","checked","oldTextAlign","textAlign","position","parseInt","paddingLeft","paddingTop","overflow","_event","THREE","Vector2","AFRAME","registerComponent","schema","html","cursor","init","rerender","bind","handle","onClick","e","onMouseLeave","onMouseEnter","onMouseUp","onMouseDown","mouseMoveDetail","detail","cursorEl","intersection","play","el","pause","mesh","setObject3D","object3D","tick","activeRaycaster","components","raycaster","getIntersection","evt","visible","getObject3D","uv","parent","worldToLocal","copy","point","removeObject3D"],"mappings":"0BAcA,MAAMA,UAAiBC,EAAAA,KAEtBC,YAAaC,GAEZ,MAAMC,EAAU,IAAIC,EAAaF,GAE3BG,EAAW,IAAIC,gBAAqC,KAAtBH,EAAQI,MAAMC,MAAsC,KAAvBL,EAAQI,MAAME,QACzEC,EAAW,IAAIC,oBAAmB,CAAEC,IAAKT,EAASU,YAAY,EAAOC,aAAa,IAIxF,SAASC,EAASC,GAEjBN,EAASE,IAAIK,iBAAkBD,GAJhCE,MAAOb,EAAUK,GAQjBS,KAAKC,iBAAkB,YAAaL,GACpCI,KAAKC,iBAAkB,YAAaL,GACpCI,KAAKC,iBAAkB,UAAWL,GAClCI,KAAKC,iBAAkB,QAASL,GAEhCI,KAAKE,QAAU,WAEdhB,EAASgB,UACTX,EAASW,UAETX,EAASE,IAAIS,UAEbC,EAASC,OAAQrB,GAEjBiB,KAAKK,oBAAqB,YAAaT,GACvCI,KAAKK,oBAAqB,YAAaT,GACvCI,KAAKK,oBAAqB,UAAWT,GACrCI,KAAKK,oBAAqB,QAAST,KAQtC,MAAMX,UAAoBqB,EAAAA,cAEzBxB,YAAaC,GAEZgB,MAAOQ,EAAaxB,IAEpBiB,KAAKjB,IAAMA,EAEXiB,KAAKQ,WAAa,GAClBR,KAAKS,SAAWC,eAChBV,KAAKW,UAAYC,eACjBZ,KAAKa,UAAYD,eAGjB,MAAME,EAAW,IAAIC,kBAAkB,KAE/Bf,KAAKgB,iBAGXhB,KAAKgB,eAAiBC,YAAY,IAAMjB,KAAKkB,UAAU,QAOzDJ,EAASK,QAASpC,EADH,CAAEqC,YAAY,EAAMC,WAAW,EAAMC,SAAS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KAAK0K,SAAQ1K,KAAK0K,OAAO2B,SAAU,GACnCb,EAAc,CACjB,MAAMI,EAAO5L,KAAK0L,GAAGY,YAAY,QAC3BC,EAAKf,EAAae,GACxBpC,EAAO/G,KAAOA,EACd+G,EAAO3I,KAAKqF,IAAK0F,EAAG7K,EAAG,EAAI6K,EAAG5K,GAC9BiK,EAAK3I,cAAekH,GAEhBnK,KAAK0K,SACR1K,KAAK0K,OAAO2B,SAAU,EACtBrM,KAAK0K,OAAO8B,OAAOC,aAAazM,KAAK0K,OAAOZ,SAAS4C,KAAKlB,EAAamB,WAI1E/B,WACC,MAAMgB,EAAO5L,KAAK0L,GAAGY,YAAY,QAC7BV,IAASA,EAAKrM,SAASE,IAAIuB,iBAC9B4K,EAAKrM,SAASE,IAAIuB,eAAiBC,YAAY,IAAM2K,EAAKrM,SAASE,IAAIyB,UAAU,MAGnF4G,SACC,MAAM8D,EAAO5L,KAAK0L,GAAGY,YAAY,QAC7BV,IACH5L,KAAK0L,GAAGkB,eAAe,QACvB5M,KAAKwB,KAAKiJ,KAAKpK,oBAAoB,QAASL,KAAK4K,UACjD5K,KAAKwB,KAAKiJ,KAAKpK,oBAAoB,SAAUL,KAAK4K,UAClDgB,EAAK1L,WAENF,KAAKgM,gBAAkB,KACvBhM,KAAKqL,gBAAgBC,OAAOC,SAAW,KACvCvL,KAAKqL,gBAAgBC,OAAOE,aAAe,KAC3CxL,KAAK0K,OAAS"}
\ No newline at end of file
+{"version":3,"file":"aframe-html.min.js","sources":["../src/HTMLMesh.js","../src/aframe-html.js"],"sourcesContent":["// This is a copy of https://github.com/mrdoob/three.js/blob/0403020848c26a9605eb91c99a949111ad4a532e/examples/jsm/interactive/HTMLMesh.js\n// with the following changes:\n// - Revert back to using \"this.encoding = sRGBEncoding\" instead of \"this.colorSpace = SRGBColorSpace;\" for compatibility with three r147 aframe 1.4.2\n// - window.dispatchEvent line commented, see the TODO below.\n// Look at https://github.com/mrdoob/three.js/commits/dev/examples/jsm/interactive/HTMLMesh.js\n// to see if there are other changes that can be retrieved here.\nimport {\n\tCanvasTexture,\n\tLinearFilter,\n\tMesh,\n\tMeshBasicMaterial,\n\tPlaneGeometry,\n\tsRGBEncoding,\n\tColor\n} from 'three';\n\nclass HTMLMesh extends Mesh {\n\n\tconstructor( dom ) {\n\n\t\tconst texture = new HTMLTexture( dom );\n\n\t\tconst geometry = new PlaneGeometry( texture.image.width * 0.001, texture.image.height * 0.001 );\n\t\tconst material = new MeshBasicMaterial( { map: texture, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tfunction onEvent( event ) {\n\n\t\t\tmaterial.map.dispatchDOMEvent( event );\n\n\t\t}\n\n\t\tthis.addEventListener( 'mousedown', onEvent );\n\t\tthis.addEventListener( 'mousemove', onEvent );\n\t\tthis.addEventListener( 'mouseup', onEvent );\n\t\tthis.addEventListener( 'click', onEvent );\n\n\t\tthis.dispose = function () {\n\n\t\t\tgeometry.dispose();\n\t\t\tmaterial.dispose();\n\n\t\t\tmaterial.map.dispose();\n\n\t\t\tcanvases.delete( dom );\n\n\t\t\tthis.removeEventListener( 'mousedown', onEvent );\n\t\t\tthis.removeEventListener( 'mousemove', onEvent );\n\t\t\tthis.removeEventListener( 'mouseup', onEvent );\n\t\t\tthis.removeEventListener( 'click', onEvent );\n\n\t\t};\n\n\t}\n\n}\n\nclass HTMLTexture extends CanvasTexture {\n\n\tconstructor( dom ) {\n\n\t\tsuper( html2canvas( dom ) );\n\n\t\tthis.dom = dom;\n\n\t\tthis.anisotropy = 16;\n\t\tthis.encoding = sRGBEncoding;\n\t\tthis.minFilter = LinearFilter;\n\t\tthis.magFilter = LinearFilter;\n\n\t\t// Create an observer on the DOM, and run html2canvas update in the next loop\n\t\tconst observer = new MutationObserver( () => {\n\n\t\t\tif ( ! this.scheduleUpdate ) {\n\n\t\t\t\t// ideally should use xr.requestAnimationFrame, here setTimeout to avoid passing the renderer\n\t\t\t\tthis.scheduleUpdate = setTimeout( () => this.update(), 16 );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst config = { attributes: true, childList: true, subtree: true, characterData: true };\n\t\tobserver.observe( dom, config );\n\n\t\tthis.observer = observer;\n\n\t}\n\n\tdispatchDOMEvent( event ) {\n\n\t\tif ( event.data ) {\n\n\t\t\thtmlevent( this.dom, event.type, event.data.x, event.data.y );\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tthis.image = html2canvas( this.dom );\n\t\tthis.needsUpdate = true;\n\n\t\tthis.scheduleUpdate = null;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.observer ) {\n\n\t\t\tthis.observer.disconnect();\n\n\t\t}\n\n\t\tthis.scheduleUpdate = clearTimeout( this.scheduleUpdate );\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n\n//\n\nconst canvases = new WeakMap();\n\nfunction html2canvas( element ) {\n\n\tconst range = document.createRange();\n\tconst color = new Color();\n\n\tfunction Clipper( context ) {\n\n\t\tconst clips = [];\n\t\tlet isClipping = false;\n\n\t\tfunction doClip() {\n\n\t\t\tif ( isClipping ) {\n\n\t\t\t\tisClipping = false;\n\t\t\t\tcontext.restore();\n\n\t\t\t}\n\n\t\t\tif ( clips.length === 0 ) return;\n\n\t\t\tlet minX = - Infinity, minY = - Infinity;\n\t\t\tlet maxX = Infinity, maxY = Infinity;\n\n\t\t\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\t\t\tconst clip = clips[ i ];\n\n\t\t\t\tminX = Math.max( minX, clip.x );\n\t\t\t\tminY = Math.max( minY, clip.y );\n\t\t\t\tmaxX = Math.min( maxX, clip.x + clip.width );\n\t\t\t\tmaxY = Math.min( maxY, clip.y + clip.height );\n\n\t\t\t}\n\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tcontext.rect( minX, minY, maxX - minX, maxY - minY );\n\t\t\tcontext.clip();\n\n\t\t\tisClipping = true;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tadd: function ( clip ) {\n\n\t\t\t\tclips.push( clip );\n\t\t\t\tdoClip();\n\n\t\t\t},\n\n\t\t\tremove: function () {\n\n\t\t\t\tclips.pop();\n\t\t\t\tdoClip();\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction drawText( style, x, y, string ) {\n\n\t\tif ( string !== '' ) {\n\n\t\t\tif ( style.textTransform === 'uppercase' ) {\n\n\t\t\t\tstring = string.toUpperCase();\n\n\t\t\t}\n\n\t\t\tcontext.font = style.fontWeight + ' ' + style.fontSize + ' ' + style.fontFamily;\n\t\t\tcontext.textBaseline = 'top';\n\t\t\tcontext.fillStyle = style.color;\n\t\t\tcontext.fillText( string, x, y + parseFloat( style.fontSize ) * 0.1 );\n\n\t\t}\n\n\t}\n\n\tfunction buildRectPath( x, y, w, h, r ) {\n\n\t\tif ( w < 2 * r ) r = w / 2;\n\t\tif ( h < 2 * r ) r = h / 2;\n\n\t\tcontext.beginPath();\n\t\tcontext.moveTo( x + r, y );\n\t\tcontext.arcTo( x + w, y, x + w, y + h, r );\n\t\tcontext.arcTo( x + w, y + h, x, y + h, r );\n\t\tcontext.arcTo( x, y + h, x, y, r );\n\t\tcontext.arcTo( x, y, x + w, y, r );\n\t\tcontext.closePath();\n\n\t}\n\n\tfunction drawBorder( style, which, x, y, width, height ) {\n\n\t\tconst borderWidth = style[ which + 'Width' ];\n\t\tconst borderStyle = style[ which + 'Style' ];\n\t\tconst borderColor = style[ which + 'Color' ];\n\n\t\tif ( borderWidth !== '0px' && borderStyle !== 'none' && borderColor !== 'transparent' && borderColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\tcontext.strokeStyle = borderColor;\n\t\t\tcontext.lineWidth = parseFloat( borderWidth );\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo( x, y );\n\t\t\tcontext.lineTo( x + width, y + height );\n\t\t\tcontext.stroke();\n\n\t\t}\n\n\t}\n\n\tfunction drawElement( element, style ) {\n\n\t\tlet x = 0, y = 0, width = 0, height = 0;\n\n\t\tif ( element.nodeType === Node.TEXT_NODE ) {\n\n\t\t\t// text\n\n\t\t\trange.selectNode( element );\n\n\t\t\tconst rect = range.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tdrawText( style, x, y, element.nodeValue.trim() );\n\n\t\t} else if ( element.nodeType === Node.COMMENT_NODE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( element instanceof HTMLCanvasElement ) {\n\n\t\t\t// Canvas element\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\n\t\t context.save();\n\t\t\tconst dpr = window.devicePixelRatio;\n\t\t\tcontext.scale( 1 / dpr, 1 / dpr );\n\t\t\tcontext.drawImage( element, x, y );\n\t\t\tcontext.restore();\n\n\t\t} else if ( element instanceof HTMLImageElement ) {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tcontext.drawImage( element, x, y, width, height );\n\n\t\t} else {\n\n\t\t\tif ( element.style.display === 'none' ) return;\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tx = rect.left - offset.left - 0.5;\n\t\t\ty = rect.top - offset.top - 0.5;\n\t\t\twidth = rect.width;\n\t\t\theight = rect.height;\n\n\t\t\tstyle = window.getComputedStyle( element );\n\n\t\t\t// Get the border of the element used for fill and border\n\n\t\t\tbuildRectPath( x, y, width, height, parseFloat( style.borderRadius ) );\n\n\t\t\tconst backgroundColor = style.backgroundColor;\n\n\t\t\tif ( backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\tcontext.fillStyle = backgroundColor;\n\t\t\t\tcontext.fill();\n\n\t\t\t}\n\n\t\t\t// If all the borders match then stroke the round rectangle\n\n\t\t\tconst borders = [ 'borderTop', 'borderLeft', 'borderBottom', 'borderRight' ];\n\n\t\t\tlet match = true;\n\t\t\tlet prevBorder = null;\n\n\t\t\tfor ( const border of borders ) {\n\n\t\t\t\tif ( prevBorder !== null ) {\n\n\t\t\t\t\tmatch = ( style[ border + 'Width' ] === style[ prevBorder + 'Width' ] ) &&\n\t\t\t\t\t( style[ border + 'Color' ] === style[ prevBorder + 'Color' ] ) &&\n\t\t\t\t\t( style[ border + 'Style' ] === style[ prevBorder + 'Style' ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( match === false ) break;\n\n\t\t\t\tprevBorder = border;\n\n\t\t\t}\n\n\t\t\tif ( match === true ) {\n\n\t\t\t\t// They all match so stroke the rectangle from before allows for border-radius\n\n\t\t\t\tconst width = parseFloat( style.borderTopWidth );\n\n\t\t\t\tif ( style.borderTopWidth !== '0px' && style.borderTopStyle !== 'none' && style.borderTopColor !== 'transparent' && style.borderTopColor !== 'rgba(0, 0, 0, 0)' ) {\n\n\t\t\t\t\tcontext.strokeStyle = style.borderTopColor;\n\t\t\t\t\tcontext.lineWidth = width;\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// Otherwise draw individual borders\n\n\t\t\t\tdrawBorder( style, 'borderTop', x, y, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderLeft', x, y, 0, height );\n\t\t\t\tdrawBorder( style, 'borderBottom', x, y + height, width, 0 );\n\t\t\t\tdrawBorder( style, 'borderRight', x + width, y, 0, height );\n\n\t\t\t}\n\n\t\t\tif ( element instanceof HTMLInputElement ) {\n\n\t\t\t\tlet accentColor = style.accentColor;\n\n\t\t\t\tif ( accentColor === undefined || accentColor === 'auto' ) accentColor = style.color;\n\n\t\t\t\tcolor.set( accentColor );\n\n\t\t\t\tconst luminance = Math.sqrt( 0.299 * ( color.r ** 2 ) + 0.587 * ( color.g ** 2 ) + 0.114 * ( color.b ** 2 ) );\n\t\t\t\tconst accentTextColor = luminance < 0.5 ? 'white' : '#111111';\n\n\t\t\t\tif ( element.type === 'radio' ) {\n\n\t\t\t\t\tbuildRectPath( x, y, width, height, height );\n\n\t\t\t\t\tcontext.fillStyle = 'white';\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tif ( element.checked ) {\n\n\t\t\t\t\t\tbuildRectPath( x + 2, y + 2, width - 4, height - 4, height );\n\n\t\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\t\tcontext.strokeStyle = accentTextColor;\n\t\t\t\t\t\tcontext.lineWidth = 2;\n\t\t\t\t\t\tcontext.fill();\n\t\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'checkbox' ) {\n\n\t\t\t\t\tbuildRectPath( x, y, width, height, 2 );\n\n\t\t\t\t\tcontext.fillStyle = element.checked ? accentColor : 'white';\n\t\t\t\t\tcontext.strokeStyle = element.checked ? accentTextColor : accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tif ( element.checked ) {\n\n\t\t\t\t\t\tconst currentTextAlign = context.textAlign;\n\n\t\t\t\t\t\tcontext.textAlign = 'center';\n\n\t\t\t\t\t\tconst properties = {\n\t\t\t\t\t\t\tcolor: accentTextColor,\n\t\t\t\t\t\t\tfontFamily: style.fontFamily,\n\t\t\t\t\t\t\tfontSize: height + 'px',\n\t\t\t\t\t\t\tfontWeight: 'bold'\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tdrawText( properties, x + ( width / 2 ), y, '✔' );\n\n\t\t\t\t\t\tcontext.textAlign = currentTextAlign;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'range' ) {\n\n\t\t\t\t\tconst [ min, max, value ] = [ 'min', 'max', 'value' ].map( property => parseFloat( element[ property ] ) );\n\t\t\t\t\tconst position = ( ( value - min ) / ( max - min ) ) * ( width - height );\n\n\t\t\t\t\tbuildRectPath( x, y + ( height / 4 ), width, height / 2, height / 4 );\n\t\t\t\t\tcontext.fillStyle = accentTextColor;\n\t\t\t\t\tcontext.strokeStyle = accentColor;\n\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\tcontext.fill();\n\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\tbuildRectPath( x, y + ( height / 4 ), position + ( height / 2 ), height / 2, height / 4 );\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t\tbuildRectPath( x + position, y, height, height, height / 2 );\n\t\t\t\t\tcontext.fillStyle = accentColor;\n\t\t\t\t\tcontext.fill();\n\n\t\t\t\t}\n\n\t\t\t\tif ( element.type === 'color' || element.type === 'text' || element.type === 'number' ) {\n\n\t\t\t\t\tclipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\t\t\t\tdrawText( style, x + parseInt( style.paddingLeft ), y + parseInt( style.paddingTop ), element.value );\n\n\t\t\t\t\tclipper.remove();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/*\n\t\t// debug\n\t\tcontext.strokeStyle = '#' + Math.random().toString( 16 ).slice( - 3 );\n\t\tcontext.strokeRect( x - 0.5, y - 0.5, width + 1, height + 1 );\n\t\t*/\n\n\t\tconst isClipping = style.overflow === 'auto' || style.overflow === 'hidden';\n\n\t\tif ( isClipping ) clipper.add( { x: x, y: y, width: width, height: height } );\n\n\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tdrawElement( element.childNodes[ i ], style );\n\n\t\t}\n\n\t\tif ( isClipping ) clipper.remove();\n\n\t}\n\n\tconst offset = element.getBoundingClientRect();\n\n\tlet canvas = canvases.get( element );\n\n\tif ( canvas === undefined ) {\n\n\t\tcanvas = document.createElement( 'canvas' );\n\t\tcanvas.width = offset.width;\n\t\tcanvas.height = offset.height;\n\t\tcanvases.set( element, canvas );\n\n\t}\n\n\tconst context = canvas.getContext( '2d'/*, { alpha: false }*/ );\n\n\tconst clipper = new Clipper( context );\n\n\t// console.time( 'drawElement' );\n\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\tdrawElement( element );\n\n\t// console.timeEnd( 'drawElement' );\n\n\treturn canvas;\n\n}\n\nfunction htmlevent( element, event, x, y ) {\n\n\tconst mouseEventInit = {\n\t\tclientX: ( x * element.offsetWidth ) + element.offsetLeft,\n\t\tclientY: ( y * element.offsetHeight ) + element.offsetTop,\n\t\tview: element.ownerDocument.defaultView\n\t};\n\n\t// TODO: Find out why this is added. Keep commented out when this file is updated\n\t// window.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\tconst rect = element.getBoundingClientRect();\n\n\tx = x * rect.width + rect.left;\n\ty = y * rect.height + rect.top;\n\n\tfunction traverse( element ) {\n\n\t\tif ( element.nodeType !== Node.TEXT_NODE && element.nodeType !== Node.COMMENT_NODE ) {\n\n\t\t\tconst rect = element.getBoundingClientRect();\n\n\t\t\tif ( x > rect.left && x < rect.right && y > rect.top && y < rect.bottom ) {\n\n\t\t\t\telement.dispatchEvent( new MouseEvent( event, mouseEventInit ) );\n\n\t\t\t\tif ( element instanceof HTMLInputElement && element.type === 'range' && ( event === 'mousedown' || event === 'click' ) ) {\n\n\t\t\t\t\tconst [ min, max ] = [ 'min', 'max' ].map( property => parseFloat( element[ property ] ) );\n\n\t\t\t\t\tconst width = rect.width;\n\t\t\t\t\tconst offsetX = x - rect.x;\n\t\t\t\t\tconst proportion = offsetX / width;\n\t\t\t\t\telement.value = min + ( max - min ) * proportion;\n\t\t\t\t\telement.dispatchEvent( new InputEvent( 'input', { bubbles: true } ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\ttraverse( element.childNodes[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttraverse( element );\n\n}\n\nexport { HTMLMesh };\n","/* jshint esversion: 9, -W097 */\n/* For dealing with spline curves */\n/* global THREE, AFRAME, setTimeout, console */\n'use strict';\n\nimport { HTMLMesh } from './HTMLMesh.js';\n\nconst schemaHTML = {\n\thtml: {\n\t\ttype: 'selector',\n\t},\n\tcursor: {\n\t\ttype: 'selector',\n\t}\n};\n\ndocumentation:\n{\n\tschemaHTML.html.description = `HTML element to use.`;\n\tschemaHTML.cursor.description = `Visual indicator for where the user is currently pointing`;\n}\n\nconst _pointer = new THREE.Vector2();\nconst _event = { type: '', data: _pointer };\nAFRAME.registerComponent('html', {\n\tschema: schemaHTML,\n\tinit() {\n\t\tthis.rerender = this.rerender.bind(this);\n\t\tthis.handle = this.handle.bind(this);\n\t\tthis.onClick = e => this.handle('click', e);\n\t\tthis.onMouseLeave = e => this.handle('mouseleave', e);\n\t\tthis.onMouseEnter = e => this.handle('mouseenter', e);\n\t\tthis.onMouseUp = e => this.handle('mouseup', e);\n\t\tthis.onMouseDown = e => this.handle('mousedown', e);\n\t\tthis.mouseMoveDetail = {\n\t\t\tdetail: {\n\t\t\t\tcursorEl: null,\n\t\t\t\tintersection: null\n\t\t\t}\n\t\t};\n\t},\n\tplay() {\n\t\tthis.el.addEventListener('click', this.onClick);\n\t\tthis.el.addEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.addEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.addEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.addEventListener('mousedown', this.onMouseDown);\n\t},\n\tpause() {\n\t\tthis.el.removeEventListener('click', this.onClick);\n\t\tthis.el.removeEventListener('mouseleave', this.onMouseLeave);\n\t\tthis.el.removeEventListener('mouseenter', this.onMouseEnter);\n\t\tthis.el.removeEventListener('mouseup', this.onMouseUp);\n\t\tthis.el.removeEventListener('mousedown', this.onMouseDown);\n\t},\n\tupdate() {\n\t\tthis.remove();\n\t\tif (!this.data.html) return;\n\t\tconst mesh = new HTMLMesh(this.data.html);\n\t\tthis.el.setObject3D('html', mesh);\n\t\tthis.data.html.addEventListener('input', this.rerender);\n\t\tthis.data.html.addEventListener('change', this.rerender);\n\t\tthis.cursor = this.data.cursor ? this.data.cursor.object3D : null;\n\t},\n\ttick() {\n\t\tif (this.activeRaycaster) {\n\t\t\tconst intersection = this.activeRaycaster.components.raycaster.getIntersection(this.el);\n\t\t\tthis.mouseMoveDetail.detail.cursorEl = this.activeRaycaster;\n\t\t\tthis.mouseMoveDetail.detail.intersection = intersection;\n\t\t\tthis.handle('mousemove', this.mouseMoveDetail);\n\t\t}\n\t},\n\thandle(type, evt) {\n\t\tconst intersection = evt.detail.intersection;\n\t\tconst raycaster = evt.detail.cursorEl;\n\t\tif (type === 'mouseenter') {\n\t\t\tthis.activeRaycaster = raycaster;\n\t\t}\n\t\tif (type === 'mouseleave' && this.activeRaycaster === raycaster) {\n\t\t\tthis.activeRaycaster = null;\n\t\t}\n\t\tif (this.cursor) this.cursor.visible = false;\n\t\tif (intersection) {\n\t\t\tconst mesh = this.el.getObject3D('html');\n\t\t\tconst uv = intersection.uv;\n\t\t\t_event.type = type;\n\t\t\t_event.data.set( uv.x, 1 - uv.y );\n\t\t\tmesh.dispatchEvent( _event );\n\n\t\t\tif (this.cursor) {\n\t\t\t\tthis.cursor.visible = true;\n\t\t\t\tthis.cursor.parent.worldToLocal(this.cursor.position.copy(intersection.point));\n\t\t\t}\n\t\t}\n\t},\n\trerender() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh && !mesh.material.map.scheduleUpdate) {\n\t\t\tmesh.material.map.scheduleUpdate = setTimeout( () => mesh.material.map.update(), 16 );\n\t\t}\n\t},\n\tremove() {\n\t\tconst mesh = this.el.getObject3D('html');\n\t\tif (mesh) {\n\t\t\tthis.el.removeObject3D('html');\n\t\t\tthis.data.html.removeEventListener('input', this.rerender);\n\t\t\tthis.data.html.removeEventListener('change', this.rerender);\n\t\t\tmesh.dispose();\n\t\t}\n\t\tthis.activeRaycaster = null;\n\t\tthis.mouseMoveDetail.detail.cursorEl = null;\n\t\tthis.mouseMoveDetail.detail.intersection = null;\n\t\tthis.cursor = null;\n\t},\n});\n"],"names":["HTMLMesh","Mesh","constructor","dom","texture","HTMLTexture","geometry","PlaneGeometry","image","width","height","material","MeshBasicMaterial","map","toneMapped","transparent","onEvent","event","dispatchDOMEvent","super","this","addEventListener","dispose","canvases","delete","removeEventListener","CanvasTexture","html2canvas","anisotropy","encoding","sRGBEncoding","minFilter","LinearFilter","magFilter","observer","MutationObserver","scheduleUpdate","setTimeout","update","observe","attributes","childList","subtree","characterData","data","element","x","y","mouseEventInit","clientX","offsetWidth","offsetLeft","clientY","offsetHeight","offsetTop","view","ownerDocument","defaultView","rect","getBoundingClientRect","traverse","nodeType","Node","TEXT_NODE","COMMENT_NODE","left","right","top","bottom","dispatchEvent","MouseEvent","HTMLInputElement","type","min","max","property","parseFloat","proportion","value","InputEvent","bubbles","i","childNodes","length","htmlevent","needsUpdate","disconnect","clearTimeout","WeakMap","range","document","createRange","color","Color","drawText","style","string","textTransform","toUpperCase","context","font","fontWeight","fontSize","fontFamily","textBaseline","fillStyle","fillText","buildRectPath","w","h","r","beginPath","moveTo","arcTo","closePath","drawBorder","which","borderWidth","borderStyle","borderColor","strokeStyle","lineWidth","lineTo","stroke","offset","canvas","get","undefined","createElement","set","getContext","clipper","clips","isClipping","doClip","restore","minX","Infinity","minY","maxX","maxY","clip","Math","save","add","push","remove","pop","clearRect","drawElement","selectNode","nodeValue","trim","HTMLCanvasElement","display","dpr","window","devicePixelRatio","scale","drawImage","HTMLImageElement","getComputedStyle","borderRadius","backgroundColor","fill","borders","match","prevBorder","border","borderTopWidth","borderTopStyle","borderTopColor","accentColor","accentTextColor","sqrt","g","b","checked","currentTextAlign","textAlign","position","parseInt","paddingLeft","paddingTop","overflow","_event","THREE","Vector2","AFRAME","registerComponent","schema","html","cursor","init","rerender","bind","handle","onClick","e","onMouseLeave","onMouseEnter","onMouseUp","onMouseDown","mouseMoveDetail","detail","cursorEl","intersection","play","el","pause","mesh","setObject3D","object3D","tick","activeRaycaster","components","raycaster","getIntersection","evt","visible","getObject3D","uv","parent","worldToLocal","copy","point","removeObject3D"],"mappings":"0BAgBA,MAAMA,UAAiBC,EAAAA,KAEtBC,YAAaC,GAEZ,MAAMC,EAAU,IAAIC,EAAaF,GAE3BG,EAAW,IAAIC,gBAAqC,KAAtBH,EAAQI,MAAMC,MAAsC,KAAvBL,EAAQI,MAAME,QACzEC,EAAW,IAAIC,oBAAmB,CAAEC,IAAKT,EAASU,YAAY,EAAOC,aAAa,IAIxF,SAASC,EAASC,GAEjBN,EAASE,IAAIK,iBAAkBD,GAJhCE,MAAOb,EAAUK,GAQjBS,KAAKC,iBAAkB,YAAaL,GACpCI,KAAKC,iBAAkB,YAAaL,GACpCI,KAAKC,iBAAkB,UAAWL,GAClCI,KAAKC,iBAAkB,QAASL,GAEhCI,KAAKE,QAAU,WAEdhB,EAASgB,UACTX,EAASW,UAETX,EAASE,IAAIS,UAEbC,EAASC,OAAQrB,GAEjBiB,KAAKK,oBAAqB,YAAaT,GACvCI,KAAKK,oBAAqB,YAAaT,GACvCI,KAAKK,oBAAqB,UAAWT,GACrCI,KAAKK,oBAAqB,QAAST,KAQtC,MAAMX,UAAoBqB,EAAAA,cAEzBxB,YAAaC,GAEZgB,MAAOQ,EAAaxB,IAEpBiB,KAAKjB,IAAMA,EAEXiB,KAAKQ,WAAa,GAClBR,KAAKS,SAAWC,eAChBV,KAAKW,UAAYC,eACjBZ,KAAKa,UAAYD,eAGjB,MAAME,EAAW,IAAIC,kBAAkB,KAE/Bf,KAAKgB,iBAGXhB,KAAKgB,eAAiBC,YAAY,IAAMjB,KAAKkB,UAAU,QAOzDJ,EAASK,QAASpC,E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