Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mappable-world/mappable-hint

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mappable-world/mappable-hint - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

1

dist/esm/MMapHint/index.js

@@ -86,3 +86,2 @@ var _a;

_onDetach() {
this._destroyDomContext();
this._detachDom();

@@ -89,0 +88,0 @@ this._element = null;

2

dist/index.js

@@ -1,1 +0,1 @@

(()=>{"use strict";var e={713:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),i=n.n(o),r=n(645),a=n.n(r)()(i());a.push([e.id,".mappablex0--mmaphint__container {\n position: absolute;\n z-index: 200;\n top: 0;\n left: 0;\n\n display: block;\n\n width: 100%;\n height: 100%;\n\n pointer-events: none;\n}\n\n.mappablex0--mmaphint__hint {\n position: absolute;\n\n display: none;\n}\n\n.mappablex0--mmaphint__hint_is-visible {\n position: absolute;\n\n display: block;\n}\n",""]);const s=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var p=0;p<e.length;p++){var c=[].concat(e[p]);o&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},866:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var o=n(379),i=n.n(o),r=n(795),a=n.n(r),s=n(569),l=n.n(s),p=n(565),c=n.n(p),u=n(216),d=n.n(u),m=n(589),h=n.n(m),f=n(713),v={};v.styleTagTransform=h(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=d(),i()(f.Z,v);const _=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var r={},a=[],s=0;s<e.length;s++){var l=e[s],p=o.base?l[0]+o.base:l[0],c=r[p]||0,u="".concat(p," ").concat(c);r[p]=c+1;var d=n(u),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(m);else{var h=i(m,o);o.byIndex=s,t.splice(s,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var r=o(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<r.length;a++){var s=n(r[a]);t[s].references--}for(var l=o(e,i),p=0;p<r.length;p++){var c=n(r[p]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}r=l}}},569:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0,n(866);const o=new mappable.MMapContext("MMapHint");t.MMapHintContext=o;class i extends mappable.MMapGroupEntity{constructor(e){super(e,{container:!0}),this._addDirectChild(new mappable.MMapListener({layer:"any",onMouseMove:(e,{screenCoordinates:t})=>{this._hintElement.classList.contains("mappablex0--mmaphint__hint_is-visible")&&this._positionHintElement(t)},onMouseEnter:(e,{screenCoordinates:t})=>{const n=this._props.hint(null==e?void 0:e.entity);n?(this._positionHintElement(t),this._toggleHint(!0),this._provideContext(o,{hint:n})):(this._toggleHint(!1),this._provideContext(o,null))},onMouseLeave:()=>{this._provideContext(o,null),this._toggleHint(!1)},onUpdate:()=>{this._provideContext(o,null),this._toggleHint(!1)}}))}_positionHintElement(e){const{left:t,top:n}=this.root.container.getBoundingClientRect(),o=(e[0]-t).toFixed(0),i=(e[1]-n).toFixed(0);this._hintElement.style.transform=`translate(${o}px, ${i}px)`}_toggleHint(e){this._hintElement.classList.toggle("mappablex0--mmaphint__hint_is-visible",e)}_onAttach(){this._element=document.createElement("MMaps"),this._element.className="mappablex0--mmaphint__container",this._hintElement=this._element.appendChild(document.createElement("MMaps")),this._hintElement.className="mappablex0--mmaphint__hint",this._detachDom=mappable.useDomContext(this,this._element,this._hintElement),this._provideContext(o,null)}_onDetach(){this._destroyDomContext(),this._detachDom(),this._element=null}}t.MMapHint=i,i[mappable.overrideKeyReactify]=(e,{reactify:t,React:n})=>{const i=t.entity(e),{MMapReactContainer:r}=t.module(mappable);return({children:e,...t})=>n.createElement(i,t,n.createElement(r,{context:o},e))}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.MMapHintContext=e.MMapHint=void 0;var t=n(925);Object.defineProperty(e,"MMapHint",{enumerable:!0,get:function(){return t.MMapHint}}),Object.defineProperty(e,"MMapHintContext",{enumerable:!0,get:function(){return t.MMapHintContext}})})(),self["@mappable-world/mappable-hint"]=o})();
(()=>{"use strict";var e={713:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),i=n.n(o),a=n(645),r=n.n(a)()(i());r.push([e.id,".mappablex0--mmaphint__container {\n position: absolute;\n z-index: 200;\n top: 0;\n left: 0;\n\n display: block;\n\n width: 100%;\n height: 100%;\n\n pointer-events: none;\n}\n\n.mappablex0--mmaphint__hint {\n position: absolute;\n\n display: none;\n}\n\n.mappablex0--mmaphint__hint_is-visible {\n position: absolute;\n\n display: block;\n}\n",""]);const s=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(r[l]=!0)}for(var p=0;p<e.length;p++){var c=[].concat(e[p]);o&&r[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},866:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var o=n(379),i=n.n(o),a=n(795),r=n.n(a),s=n(569),l=n.n(s),p=n(565),c=n.n(p),u=n(216),d=n.n(u),m=n(589),h=n.n(m),f=n(713),v={};v.styleTagTransform=h(),v.setAttributes=c(),v.insert=l().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),i()(f.Z,v);const _=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var a={},r=[],s=0;s<e.length;s++){var l=e[s],p=o.base?l[0]+o.base:l[0],c=a[p]||0,u="".concat(p," ").concat(c);a[p]=c+1;var d=n(u),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(m);else{var h=i(m,o);o.byIndex=s,t.splice(s,0,{identifier:u,updater:h,references:1})}r.push(u)}return r}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var a=o(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<a.length;r++){var s=n(a[r]);t[s].references--}for(var l=o(e,i),p=0;p<a.length;p++){var c=n(a[p]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}a=l}}},569:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0,n(866);const o=new mappable.MMapContext("MMapHint");t.MMapHintContext=o;class i extends mappable.MMapGroupEntity{constructor(e){super(e,{container:!0}),this._addDirectChild(new mappable.MMapListener({layer:"any",onMouseMove:(e,{screenCoordinates:t})=>{this._hintElement.classList.contains("mappablex0--mmaphint__hint_is-visible")&&this._positionHintElement(t)},onMouseEnter:(e,{screenCoordinates:t})=>{const n=this._props.hint(null==e?void 0:e.entity);n?(this._positionHintElement(t),this._toggleHint(!0),this._provideContext(o,{hint:n})):(this._toggleHint(!1),this._provideContext(o,null))},onMouseLeave:()=>{this._provideContext(o,null),this._toggleHint(!1)},onUpdate:()=>{this._provideContext(o,null),this._toggleHint(!1)}}))}_positionHintElement(e){const{left:t,top:n}=this.root.container.getBoundingClientRect(),o=(e[0]-t).toFixed(0),i=(e[1]-n).toFixed(0);this._hintElement.style.transform=`translate(${o}px, ${i}px)`}_toggleHint(e){this._hintElement.classList.toggle("mappablex0--mmaphint__hint_is-visible",e)}_onAttach(){this._element=document.createElement("MMaps"),this._element.className="mappablex0--mmaphint__container",this._hintElement=this._element.appendChild(document.createElement("MMaps")),this._hintElement.className="mappablex0--mmaphint__hint",this._detachDom=mappable.useDomContext(this,this._element,this._hintElement),this._provideContext(o,null)}_onDetach(){this._detachDom(),this._element=null}}t.MMapHint=i,i[mappable.overrideKeyReactify]=(e,{reactify:t,React:n})=>{const i=t.entity(e),{MMapReactContainer:a}=t.module(mappable);return({children:e,...t})=>n.createElement(i,t,n.createElement(a,{context:o},e))}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={id:o,exports:{}};return e[o](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.MMapHintContext=e.MMapHint=void 0;var t=n(925);Object.defineProperty(e,"MMapHint",{enumerable:!0,get:function(){return t.MMapHint}}),Object.defineProperty(e,"MMapHintContext",{enumerable:!0,get:function(){return t.MMapHintContext}})})(),self["@mappable-world/mappable-hint"]=o})();

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@mappable-world/mappable-hint"]=t():e["@mappable-world/mappable-hint"]=t()}(self,(()=>(()=>{"use strict";var e={713:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),i=n.n(o),r=n(645),a=n.n(r)()(i());a.push([e.id,".mappablex0--mmaphint__container {\n position: absolute;\n z-index: 200;\n top: 0;\n left: 0;\n\n display: block;\n\n width: 100%;\n height: 100%;\n\n pointer-events: none;\n}\n\n.mappablex0--mmaphint__hint {\n position: absolute;\n\n display: none;\n}\n\n.mappablex0--mmaphint__hint_is-visible {\n position: absolute;\n\n display: block;\n}\n",""]);const s=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var p=this[s][0];null!=p&&(a[p]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);o&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},866:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var o=n(379),i=n.n(o),r=n(795),a=n.n(r),s=n(569),p=n.n(s),l=n(565),c=n.n(l),u=n(216),d=n.n(u),m=n(589),h=n.n(m),f=n(713),v={};v.styleTagTransform=h(),v.setAttributes=c(),v.insert=p().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=d(),i()(f.Z,v);const b=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var r={},a=[],s=0;s<e.length;s++){var p=e[s],l=o.base?p[0]+o.base:p[0],c=r[l]||0,u="".concat(l," ").concat(c);r[l]=c+1;var d=n(u),m={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)t[d].references++,t[d].updater(m);else{var h=i(m,o);o.byIndex=s,t.splice(s,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var r=o(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<r.length;a++){var s=n(r[a]);t[s].references--}for(var p=o(e,i),l=0;l<r.length;l++){var c=n(r[l]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}r=p}}},569:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0,n(866);const o=new mappable.MMapContext("MMapHint");t.MMapHintContext=o;class i extends mappable.MMapGroupEntity{constructor(e){super(e,{container:!0}),this._addDirectChild(new mappable.MMapListener({layer:"any",onMouseMove:(e,{screenCoordinates:t})=>{this._hintElement.classList.contains("mappablex0--mmaphint__hint_is-visible")&&this._positionHintElement(t)},onMouseEnter:(e,{screenCoordinates:t})=>{const n=this._props.hint(null==e?void 0:e.entity);n?(this._positionHintElement(t),this._toggleHint(!0),this._provideContext(o,{hint:n})):(this._toggleHint(!1),this._provideContext(o,null))},onMouseLeave:()=>{this._provideContext(o,null),this._toggleHint(!1)},onUpdate:()=>{this._provideContext(o,null),this._toggleHint(!1)}}))}_positionHintElement(e){const{left:t,top:n}=this.root.container.getBoundingClientRect(),o=(e[0]-t).toFixed(0),i=(e[1]-n).toFixed(0);this._hintElement.style.transform=`translate(${o}px, ${i}px)`}_toggleHint(e){this._hintElement.classList.toggle("mappablex0--mmaphint__hint_is-visible",e)}_onAttach(){this._element=document.createElement("MMaps"),this._element.className="mappablex0--mmaphint__container",this._hintElement=this._element.appendChild(document.createElement("MMaps")),this._hintElement.className="mappablex0--mmaphint__hint",this._detachDom=mappable.useDomContext(this,this._element,this._hintElement),this._provideContext(o,null)}_onDetach(){this._destroyDomContext(),this._detachDom(),this._element=null}}t.MMapHint=i,i[mappable.overrideKeyReactify]=(e,{reactify:t,React:n})=>{const i=t.entity(e),{MMapReactContainer:r}=t.module(mappable);return({children:e,...t})=>n.createElement(i,t,n.createElement(r,{context:o},e))}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.MMapHintContext=e.MMapHint=void 0;var t=n(925);Object.defineProperty(e,"MMapHint",{enumerable:!0,get:function(){return t.MMapHint}}),Object.defineProperty(e,"MMapHintContext",{enumerable:!0,get:function(){return t.MMapHintContext}})})(),o})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@mappable-world/mappable-hint"]=t():e["@mappable-world/mappable-hint"]=t()}(self,(()=>(()=>{"use strict";var e={713:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),i=n.n(o),r=n(645),a=n.n(r)()(i());a.push([e.id,".mappablex0--mmaphint__container {\n position: absolute;\n z-index: 200;\n top: 0;\n left: 0;\n\n display: block;\n\n width: 100%;\n height: 100%;\n\n pointer-events: none;\n}\n\n.mappablex0--mmaphint__hint {\n position: absolute;\n\n display: none;\n}\n\n.mappablex0--mmaphint__hint_is-visible {\n position: absolute;\n\n display: block;\n}\n",""]);const s=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var p=this[s][0];null!=p&&(a[p]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);o&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},866:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var o=n(379),i=n.n(o),r=n(795),a=n.n(r),s=n(569),p=n.n(s),l=n(565),c=n.n(l),u=n(216),d=n.n(u),m=n(589),h=n.n(m),f=n(713),v={};v.styleTagTransform=h(),v.setAttributes=c(),v.insert=p().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=d(),i()(f.Z,v);const b=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var r={},a=[],s=0;s<e.length;s++){var p=e[s],l=o.base?p[0]+o.base:p[0],c=r[l]||0,u="".concat(l," ").concat(c);r[l]=c+1;var d=n(u),m={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)t[d].references++,t[d].updater(m);else{var h=i(m,o);o.byIndex=s,t.splice(s,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var r=o(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<r.length;a++){var s=n(r[a]);t[s].references--}for(var p=o(e,i),l=0;l<r.length;l++){var c=n(r[l]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}r=p}}},569:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0,n(866);const o=new mappable.MMapContext("MMapHint");t.MMapHintContext=o;class i extends mappable.MMapGroupEntity{constructor(e){super(e,{container:!0}),this._addDirectChild(new mappable.MMapListener({layer:"any",onMouseMove:(e,{screenCoordinates:t})=>{this._hintElement.classList.contains("mappablex0--mmaphint__hint_is-visible")&&this._positionHintElement(t)},onMouseEnter:(e,{screenCoordinates:t})=>{const n=this._props.hint(null==e?void 0:e.entity);n?(this._positionHintElement(t),this._toggleHint(!0),this._provideContext(o,{hint:n})):(this._toggleHint(!1),this._provideContext(o,null))},onMouseLeave:()=>{this._provideContext(o,null),this._toggleHint(!1)},onUpdate:()=>{this._provideContext(o,null),this._toggleHint(!1)}}))}_positionHintElement(e){const{left:t,top:n}=this.root.container.getBoundingClientRect(),o=(e[0]-t).toFixed(0),i=(e[1]-n).toFixed(0);this._hintElement.style.transform=`translate(${o}px, ${i}px)`}_toggleHint(e){this._hintElement.classList.toggle("mappablex0--mmaphint__hint_is-visible",e)}_onAttach(){this._element=document.createElement("MMaps"),this._element.className="mappablex0--mmaphint__container",this._hintElement=this._element.appendChild(document.createElement("MMaps")),this._hintElement.className="mappablex0--mmaphint__hint",this._detachDom=mappable.useDomContext(this,this._element,this._hintElement),this._provideContext(o,null)}_onDetach(){this._detachDom(),this._element=null}}t.MMapHint=i,i[mappable.overrideKeyReactify]=(e,{reactify:t,React:n})=>{const i=t.entity(e),{MMapReactContainer:r}=t.module(mappable);return({children:e,...t})=>n.createElement(i,t,n.createElement(r,{context:o},e))}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.MMapHintContext=e.MMapHint=void 0;var t=n(925);Object.defineProperty(e,"MMapHint",{enumerable:!0,get:function(){return t.MMapHint}}),Object.defineProperty(e,"MMapHintContext",{enumerable:!0,get:function(){return t.MMapHintContext}})})(),o})()));

@@ -43,3 +43,2 @@ import type TReact from 'react';

static [mappable.overrideKeyReactify]: CustomReactify<MMapHint, TReact.FC<TReact.PropsWithChildren<MMapHintProps>>>;
private _destroyDomContext;
private _detachDom;

@@ -46,0 +45,0 @@ private _element;

{
"version": "0.0.5",
"version": "0.0.6",
"name": "@mappable-world/mappable-hint",

@@ -4,0 +4,0 @@ "description": "Hints for Mappable Maps JS API 3.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc