react-losant-dashboard-block
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -69,2 +69,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.LosantDashboardBlock = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var theme = _props.theme; | ||
var ctx = _props.ctx; | ||
@@ -96,2 +97,6 @@ if (!dashboardId || !blockId) { | ||
var url = host + '/#/block/' + dashboardId + '/' + blockId + '?theme=' + theme; | ||
Object.keys(ctx || {}).forEach(function (key) { | ||
var val = ctx[key]; | ||
url += '&ctx[' + key + ']=' + val; | ||
}); | ||
return _react2['default'].createElement('iframe', { | ||
@@ -110,10 +115,11 @@ frameBorder: 0, | ||
LosantDashboardBlock.propTypes = { | ||
blockId: _react.PropTypes.string, | ||
ctx: _react.PropTypes.object, | ||
dashboardId: _react.PropTypes.string, | ||
blockId: _react.PropTypes.string, | ||
height: _react.PropTypes.string, // CSS units | ||
style: _react.PropTypes.object, | ||
theme: _react.PropTypes.oneOf(['light', 'dark']), | ||
style: _react.PropTypes.object, | ||
width: _react.PropTypes.string, // CSS units | ||
height: _react.PropTypes.string // CSS units | ||
}; | ||
width: _react.PropTypes.string }; | ||
// CSS units | ||
LosantDashboardBlock.defaultProps = { | ||
@@ -120,0 +126,0 @@ theme: 'light', |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.LosantDashboardBlock=e()}}(function(){return function e(t,r,n){function o(l,f){if(!r[l]){if(!t[l]){var u="function"==typeof require&&require;if(!f&&u)return u(l,!0);if(i)return i(l,!0);var a=new Error("Cannot find module '"+l+"'");throw a.code="MODULE_NOT_FOUND",a}var d=r[l]={exports:{}};t[l][0].call(d.exports,function(e){var r=t[l][1][e];return o(r?r:e)},d,d.exports,e,t,r,n)}return r[l].exports}for(var i="function"==typeof require&&require,l=0;l<n.length;l++)o(n[l]);return o}({1:[function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=function(e,t,r){for(var n=!0;n;){var o=e,i=t,l=r;n=!1,null===o&&(o=Function.prototype);var f=Object.getOwnPropertyDescriptor(o,i);if(void 0!==f){if("value"in f)return f.value;var u=f.get;if(void 0===u)return;return u.call(l)}var a=Object.getPrototypeOf(o);if(null===a)return;e=a,t=i,r=l,n=!0,f=a=void 0}},u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,d=n(a),p=function(e){function t(){o(this,t),f(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.dashboardId,r=e.blockId,n=e.width,o=e.height,i=e.style,l=e.theme;if(!t||!r)return d["default"].createElement("div",{style:u({},{width:n,height:o,lineHeight:o},{style:i},{background:"#f5f4f3",textAlign:"center"})},d["default"].createElement("span",{style:{display:"inline-block",verticalAlign:"middle",lineHeight:"normal"}},d["default"].createElement("code",null,"dashboardId")," and ",d["default"].createElement("code",null,"blockId")," are required."));var f="https://app.losant.com",a=f+"/#/block/"+t+"/"+r+"?theme="+l;return d["default"].createElement("iframe",{frameBorder:0,style:i,src:a,width:n,height:o})}}]),t}(a.Component);p.propTypes={dashboardId:a.PropTypes.string,blockId:a.PropTypes.string,theme:a.PropTypes.oneOf(["light","dark"]),style:a.PropTypes.object,width:a.PropTypes.string,height:a.PropTypes.string},p.defaultProps={theme:"light",width:"100%",height:"240px"},r["default"]=p,t.exports=r["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.LosantDashboardBlock=e()}}(function(){return function e(t,r,n){function o(f,l){if(!r[f]){if(!t[f]){var u="function"==typeof require&&require;if(!l&&u)return u(f,!0);if(i)return i(f,!0);var a=new Error("Cannot find module '"+f+"'");throw a.code="MODULE_NOT_FOUND",a}var c=r[f]={exports:{}};t[f][0].call(c.exports,function(e){var r=t[f][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)o(n[f]);return o}({1:[function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function(e,t,r){for(var n=!0;n;){var o=e,i=t,f=r;n=!1,null===o&&(o=Function.prototype);var l=Object.getOwnPropertyDescriptor(o,i);if(void 0!==l){if("value"in l)return l.value;var u=l.get;if(void 0===u)return;return u.call(f)}var a=Object.getPrototypeOf(o);if(null===a)return;e=a,t=i,r=f,n=!0,l=a=void 0}},u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,c=n(a),d=function(e){function t(){o(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),f(t,[{key:"render",value:function(){var e=this.props,t=e.dashboardId,r=e.blockId,n=e.width,o=e.height,i=e.style,f=e.theme,l=e.ctx;if(!t||!r)return c["default"].createElement("div",{style:u({},{width:n,height:o,lineHeight:o},{style:i},{background:"#f5f4f3",textAlign:"center"})},c["default"].createElement("span",{style:{display:"inline-block",verticalAlign:"middle",lineHeight:"normal"}},c["default"].createElement("code",null,"dashboardId")," and ",c["default"].createElement("code",null,"blockId")," are required."));var a="https://app.losant.com",d=a+"/#/block/"+t+"/"+r+"?theme="+f;return Object.keys(l||{}).forEach(function(e){var t=l[e];d+="&ctx["+e+"]="+t}),c["default"].createElement("iframe",{frameBorder:0,style:i,src:d,width:n,height:o})}}]),t}(a.Component);d.propTypes={blockId:a.PropTypes.string,ctx:a.PropTypes.object,dashboardId:a.PropTypes.string,height:a.PropTypes.string,style:a.PropTypes.object,theme:a.PropTypes.oneOf(["light","dark"]),width:a.PropTypes.string},d.defaultProps={theme:"light",width:"100%",height:"240px"},r["default"]=d,t.exports=r["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |
@@ -67,2 +67,3 @@ /** | ||
var theme = _props.theme; | ||
var ctx = _props.ctx; | ||
@@ -92,7 +93,7 @@ if (!dashboardId || !blockId) { | ||
} | ||
var host = 'https://app.structure.works'; | ||
var host = 'https://app.losant.com'; | ||
var url = host + '/#/block/' + dashboardId + '/' + blockId + '?theme=' + theme; | ||
Object.keys(ctx || {}).forEach(function (key) { | ||
var val = ctx[key]; | ||
url += '&' + key + '=' + val; | ||
url += '&ctx[' + key + ']=' + val; | ||
}); | ||
@@ -99,0 +100,0 @@ return _react2['default'].createElement('iframe', { |
{ | ||
"name": "react-losant-dashboard-block", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "React Losant Dashboard Block", | ||
@@ -5,0 +5,0 @@ "main": "lib/LosantDashboardBlock.js", |
@@ -41,3 +41,3 @@ /** | ||
} | ||
const host = 'https://app.structure.works'; | ||
const host = 'https://app.losant.com'; | ||
let url = `${host}/#/block/${dashboardId}/${blockId}?theme=${theme}`; | ||
@@ -44,0 +44,0 @@ Object.keys(ctx || {}).forEach((key) => { |
32815
427