@crowdin/react-crowdin-login
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -6,6 +6,8 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -55,3 +57,3 @@ function __() { this.constructor = d; } | ||
var uri = encodeURIComponent(redirectUri || window.location.href); | ||
return "https://accounts.crowdin.com/oauth/authorize?client_id=" + clientId + "&redirect_uri=" + uri + "&response_type=code&scope=" + scope; | ||
return "https://accounts.crowdin.com/oauth/authorize?client_id=".concat(clientId, "&redirect_uri=").concat(uri, "&response_type=code&scope=").concat(scope); | ||
}; | ||
@@ -61,3 +63,3 @@ _this.sendTokenRequest = function (code) { | ||
var redirect_uri = redirectUri || window.location.href; | ||
return fetch("https://cors-anywhere.herokuapp.com/https://accounts.crowdin.com/oauth/token", { | ||
return fetch("https://corsanywhere.herokuapp.com/https://accounts.crowdin.com/oauth/token", { | ||
method: "POST", | ||
@@ -77,3 +79,3 @@ headers: { | ||
_this.handleLoginClick = function () { | ||
var popup = window_1.openWindow({ | ||
var popup = (0, window_1.openWindow)({ | ||
url: _this.buildCodeRequestURL(), | ||
@@ -83,3 +85,3 @@ name: "Log in with Crowdin" | ||
if (popup) { | ||
window_1.observeWindow({ popup: popup, onClose: _this.handleClosingPopup }); | ||
(0, window_1.observeWindow)({ popup: popup, onClose: _this.handleClosingPopup }); | ||
_this.setState({ | ||
@@ -86,0 +88,0 @@ popup: popup |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CrowdinLogin = void 0; | ||
var CrowdinLogin_1 = require("./CrowdinLogin"); | ||
@@ -4,0 +5,0 @@ exports.CrowdinLogin = CrowdinLogin_1.default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.openWindow = function (_a) { | ||
exports.observeWindow = exports.openWindow = void 0; | ||
var openWindow = function (_a) { | ||
var url = _a.url, name = _a.name; | ||
var top = (window.innerHeight - 400) / 2 + window.screenY; | ||
var left = (window.innerWidth - 400) / 2 + window.screenX; | ||
return window.open(url, name, "dialog=yes,top=" + top + "px,left=" + left + ",width=" + 400 + "px,height=" + 500 + "px"); | ||
return window.open(url, name, "dialog=yes,top=".concat(top, "px,left=").concat(left, ",width=").concat(400, "px,height=").concat(500, "px")); | ||
}; | ||
exports.observeWindow = function (_a) { | ||
exports.openWindow = openWindow; | ||
var observeWindow = function (_a) { | ||
var popup = _a.popup, interval = _a.interval, onClose = _a.onClose; | ||
@@ -18,2 +20,3 @@ var intervalId = setInterval(function () { | ||
}; | ||
exports.observeWindow = observeWindow; | ||
//# sourceMappingURL=window.js.map |
@@ -5,3 +5,3 @@ { | ||
"main": "dist/index.js", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"author": "alexandrtovmach@gmail.com", | ||
@@ -13,33 +13,31 @@ "private": false, | ||
"build": "rm -rf ./dist && tsc && webpack", | ||
"deploy": "lint-staged && npm run build && gh-pages -d examples/dist", | ||
"prettify": "prettier --write './src/**/*.{js,jsx,ts,tsx,json,css,md}'" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.6.2", | ||
"@babel/core": "^7.6.2", | ||
"@babel/preset-env": "^7.6.2", | ||
"@babel/preset-react": "^7.0.0", | ||
"@types/react": "^16.4.18", | ||
"@types/react-dom": "^16.0.9", | ||
"babel-loader": "^8.0.6", | ||
"css-loader": "^3.2.0", | ||
"file-loader": "^4.2.0", | ||
"gh-pages": "^2.0.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.20.2", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-react": "^7.18.6", | ||
"@types/react": "^18.0.25", | ||
"@types/react-dom": "^18.0.8", | ||
"babel-loader": "^9.1.0", | ||
"css-loader": "^6.7.1", | ||
"file-loader": "^6.2.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"husky": "^3.0.5", | ||
"lint-staged": "^9.4.0", | ||
"node-sass": "^4.9.4", | ||
"prettier": "^1.14.3", | ||
"react": "^16.6.0", | ||
"react-dom": "^16.6.0", | ||
"react-scripts": "^3.1.2", | ||
"sass-loader": "^8.0.0", | ||
"semantic-ui-css": "^2.4.1", | ||
"semantic-ui-react": "^0.88.1", | ||
"style-loader": "^1.0.0", | ||
"typescript": "^3.1.3", | ||
"url-loader": "^2.1.0", | ||
"webpack": "^4.23.1", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "^3.1.10" | ||
"node-sass": "^8.0.0", | ||
"prettier": "^2.7.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "^5.0.1", | ||
"sass-loader": "^13.2.0", | ||
"semantic-ui-css": "^2.5.0", | ||
"semantic-ui-react": "^2.1.3", | ||
"style-loader": "^3.3.1", | ||
"typescript": "^4.8.4", | ||
"url-loader": "^4.1.1", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^4.10.0", | ||
"webpack-dev-server": "^4.11.1" | ||
}, | ||
@@ -46,0 +44,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
125390
26
19
261