diff --git a/docs/foo-comments.min.js b/docs/foo-comments.min.js index 51edd00..b92ac62 100644 --- a/docs/foo-comments.min.js +++ b/docs/foo-comments.min.js @@ -396,5 +396,5 @@ var t;!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module },{"styled-components":"tFSs"}],"wOW0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=o(require("@fingerprintjs/fingerprintjs")),n=o(require("axios")),r=require("./style"),u=require("../../providers/Reactions");function o(e){return e&&e.__esModule?e:{default:e}}function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function l(o){var i=o.emotions,a=(0,u.useReactionState)(),l=(0,u.useReactionDispatch)(),c=(null==a?void 0:a.reactions)||{},f=c.aggregation,s=c.userReaction,d=(0,e.useCallback)(function(e){return l.react(e)},[]);return(0,e.useEffect)(function(){t.default.load().then(function(e){e.get().then(function(e){var t=e.visitorId;n.default.defaults.headers.common.fingerprint=t,l.getReactions()})})},[]),e.default.createElement(r.ContentBubbleContainer,null,i.map(function(t,n){var u,o=null==f||null===(u=f.find(function(e){return e._id===t}))||void 0===u?void 0:u.count;return e.default.createElement(r.ContentBubble,{key:n,$selected:(null==s?void 0:s.reaction)===t,onClick:function(){return d(t)}},e.default.createElement("span",null,t),o&&e.default.createElement(r.ContentBubbleCount,null,o))}))}var c=l;exports.default=c; },{"react":"n8MK","@fingerprintjs/fingerprintjs":"xlHb","axios":"dZBD","./style":"IQFN","../../providers/Reactions":"LbsM"}],"Focm":[function(require,module,exports) { -"use strict";var e=m(require("react")),t=m(require("react-dom")),r=m(require("./providers/Comments")),a=m(require("./providers/Reactions")),o=m(require("./providers/Language")),u=m(require("./providers/Theme")),n=m(require("./components/Editor")),l=m(require("./components/Comments")),d=m(require("./components/Footer")),i=m(require("./components/Reactions"));function m(e){return e&&e.__esModule?e:{default:e}}var c=document.getElementById("foo-comments");if(c){var f,s=c.getAttribute("data-api-url"),g=c.getAttribute("data-theme"),p=c.getAttribute("data-language"),q=null===(f=c.getAttribute("data-emotions"))||void 0===f?void 0:f.split(",");t.default.render(e.default.createElement(u.default,{theme:g},e.default.createElement(o.default,{language:p},q&&e.default.createElement(a.default,{api:s},e.default.createElement(i.default,{emotions:q})),e.default.createElement(r.default,{api:s},e.default.createElement(n.default,null),e.default.createElement(l.default,null)),e.default.createElement(d.default,null))),c)}c&&console.error("No comment section found. Please refer to documentation to include them https://github.com/foo-comments/foo-comments-widget ."); +"use strict";var e=m(require("react")),t=m(require("react-dom")),r=m(require("./providers/Comments")),a=m(require("./providers/Reactions")),o=m(require("./providers/Language")),u=m(require("./providers/Theme")),n=m(require("./components/Editor")),l=m(require("./components/Comments")),d=m(require("./components/Footer")),i=m(require("./components/Reactions"));function m(e){return e&&e.__esModule?e:{default:e}}var c=document.getElementById("foo-comments");if(c){var f,s=c.getAttribute("data-api-url"),g=c.getAttribute("data-theme"),p=c.getAttribute("data-language"),q=null===(f=c.getAttribute("data-emotions"))||void 0===f?void 0:f.split(",");t.default.render(e.default.createElement(u.default,{theme:g},e.default.createElement(o.default,{language:p},q&&e.default.createElement(a.default,{api:s},e.default.createElement(i.default,{emotions:q})),e.default.createElement(r.default,{api:s},e.default.createElement(n.default,null),e.default.createElement(l.default,null)),e.default.createElement(d.default,null))),c)}c||console.error("No comment section found. Please refer to documentation to include them https://github.com/foo-comments/foo-comments-widget ."); },{"react":"n8MK","react-dom":"NKHc","./providers/Comments":"JWV9","./providers/Reactions":"LbsM","./providers/Language":"PlpR","./providers/Theme":"Ib4m","./components/Editor":"Zi9t","./components/Comments":"tgfw","./components/Footer":"lkRV","./components/Reactions":"wOW0"}]},{},["Focm"], null) \ No newline at end of file diff --git a/src/index.js b/src/index.js index 74941ff..42d80a1 100644 --- a/src/index.js +++ b/src/index.js @@ -37,7 +37,7 @@ if (commentsElement) { ); } -if (commentsElement) { +if (!commentsElement) { console.error( 'No comment section found. Please refer to documentation to include them https://github.com/foo-comments/foo-comments-widget .' );