@mappable-world/mappable-hint
Advanced tools
Comparing version 0.0.6 to 0.0.7
export { MMapHint, MMapHintContext } from './MMapHint'; | ||
export * from './types'; |
@@ -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),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})(); | ||
(()=>{"use strict";var e={200:(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 c=0;c<e.length;c++){var p=[].concat(e[c]);o&&a[p[0]]||(void 0!==r&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=r),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),i&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=i):p[4]="".concat(i)),t.push(p))}},t}},81:e=>{e.exports=function(e){return e[1]}},83:(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),c=n(565),p=n.n(c),u=n(216),d=n.n(u),m=n(589),h=n.n(m),f=n(200),v={};v.styleTagTransform=h(),v.setAttributes=p(),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],c=o.base?l[0]+o.base:l[0],p=r[c]||0,u="".concat(c," ").concat(p);r[c]=p+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),c=0;c<r.length;c++){var p=n(r[c]);0===t[p].references&&(t[p].updater(),t.splice(p,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(83);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))}},341:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0;var r=n(925);Object.defineProperty(t,"MMapHint",{enumerable:!0,get:function(){return r.MMapHint}}),Object.defineProperty(t,"MMapHintContext",{enumerable:!0,get:function(){return r.MMapHintContext}}),i(n(683),t)},683:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})}},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].call(r.exports,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=n(341);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._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={200:(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]}},83:(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),f=n.n(m),h=n(200),v={};v.styleTagTransform=f(),v.setAttributes=c(),v.insert=p().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=d(),i()(h.Z,v);const b=h.Z&&h.Z.locals?h.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 f=i(m,o);o.byIndex=s,t.splice(s,0,{identifier:u,updater:f,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(83);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))}},341:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.MMapHintContext=t.MMapHint=void 0;var r=n(925);Object.defineProperty(t,"MMapHint",{enumerable:!0,get:function(){return r.MMapHint}}),Object.defineProperty(t,"MMapHintContext",{enumerable:!0,get:function(){return r.MMapHintContext}}),i(n(683),t)},683:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})}},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].call(r.exports,r,r.exports,n),r.exports}return 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,n(341)})())); |
export { MMapHint, MMapHintContext } from './MMapHint'; | ||
export * from './types'; |
{ | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"name": "@mappable-world/mappable-hint", | ||
@@ -32,5 +32,4 @@ "description": "Hints for Mappable Maps JS API 3.0", | ||
"devDependencies": { | ||
"html-webpack-plugin": "^5.5.3", | ||
"@mappable-world/mappable-cli": "^0.0.16", | ||
"@mappable-world/mappable-types": "^0.0.4", | ||
"@mappable-world/mappable-cli": "^0.0.36", | ||
"@mappable-world/mappable-types": "^0.0.20", | ||
"@types/got": "9.6.12", | ||
@@ -50,5 +49,7 @@ "@types/jest": "29.5.3", | ||
"got": "11.8.6", | ||
"html-webpack-plugin": "^5.5.3", | ||
"identity-obj-proxy": "3.0.0", | ||
"jest": "29.6.1", | ||
"jsdom": "22.1.0", | ||
"postcss-loader": "^8.1.1", | ||
"prettier": "3.0.0", | ||
@@ -60,2 +61,3 @@ "style-loader": "3.3.3", | ||
"typescript": "5.1.6", | ||
"vue": "^3.4.38", | ||
"webpack": "5.88.1", | ||
@@ -62,0 +64,0 @@ "webpack-cli": "5.1.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48194
19
392
31