@front-finance/link
Advanced tools
Comparing version 1.1.7 to 1.1.8
import { FrontOptions, FrontConnection } from './utils/types'; | ||
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection; |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { FrontPayload, TransferFinishedPayload } from './types'; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare const iframeId = "front-link-popup__iframe"; | ||
export declare function removePopup(): void; | ||
export declare function addPopup(iframeLink: string): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addPopup = exports.removePopup = exports.iframeId = void 0; | ||
var style_1 = require("./style"); | ||
var popupId = 'front-link-popup'; | ||
@@ -10,3 +11,3 @@ var backdropId = 'front-link-popup__backdrop'; | ||
var getPopupHtml = function (link) { return "\n<div id=\"".concat(popupId, "\">\n <div id=\"").concat(backdropId, "\"></div>\n <div id=\"").concat(popupContentId, "\">\n <iframe id=\"").concat(exports.iframeId, "\" src=\"").concat(link, "\" allow=\"clipboard-read *; clipboard-write *\" />\n </div>\n</div>\n"); }; | ||
var styles = "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: 0.6;\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: 24px;\n background: white;\n flex-grow: 1;\n }\n\n #").concat(popupContentId, " iframe {\n border: none;\n width: 100%;\n flex-grow: 1;\n border-radius: 24px;\n }\n\n @media only screen and (max-width: 768px) {\n #").concat(popupContentId, " {\n height: 100vh;\n width: 100vw;\n max-width: 100%;\n min-width: 100%;\n max-height: 100%;\n min-height: 100%;\n border-radius: 0px;\n }\n\n #").concat(popupContentId, " iframe {\n border-radius: 0px;\n }\n }\n\n @media only screen and (max-height: 710px) {\n #").concat(popupContentId, " {\n max-height: 100%;\n min-height: 100%;\n }\n }\n</style>\n"); | ||
var getStyles = function (style) { return "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: ").concat((0, style_1.getNumber)(0.6, style === null || style === void 0 ? void 0 : style.io), ";\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: ").concat((0, style_1.getNumber)(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n background: white;\n flex-grow: 1;\n }\n\n #").concat(popupContentId, " iframe {\n border: none;\n width: 100%;\n flex-grow: 1;\n border-radius: ").concat((0, style_1.getNumber)(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n }\n\n @media only screen and (max-width: 768px) {\n #").concat(popupContentId, " {\n height: 100vh;\n width: 100vw;\n max-width: 100%;\n min-width: 100%;\n max-height: 100%;\n min-height: 100%;\n border-radius: 0px;\n }\n\n #").concat(popupContentId, " iframe {\n border-radius: 0px;\n }\n }\n\n @media only screen and (max-height: 710px) {\n #").concat(popupContentId, " {\n max-height: 100%;\n min-height: 100%;\n }\n }\n</style>\n"); }; | ||
function removePopup() { | ||
@@ -21,5 +22,6 @@ var _a, _b; | ||
function addPopup(iframeLink) { | ||
var style = (0, style_1.getLinkStyle)(iframeLink); | ||
removePopup(); | ||
var popup = getPopupHtml(iframeLink); | ||
var stylesElement = htmlToElement(styles); | ||
var stylesElement = htmlToElement(getStyles(style)); | ||
if (stylesElement) { | ||
@@ -26,0 +28,0 @@ window.document.head.appendChild(stylesElement); |
@@ -113,1 +113,5 @@ import type { BrokerType } from '@front-finance/api'; | ||
} | ||
export interface LinkStyle { | ||
ir: number; | ||
io: number; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
import { FrontOptions, FrontConnection } from './utils/types'; | ||
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection; |
@@ -0,0 +0,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
{ | ||
"name": "@front-finance/link", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Front Finance accounts connection client lib", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,0 +0,0 @@ # @front-finance/link |
@@ -0,0 +0,0 @@ import { FrontPayload, TransferFinishedPayload } from './types'; |
@@ -0,0 +0,0 @@ var FRONT_EVENT_TYPE_KEYS = [ |
export declare const iframeId = "front-link-popup__iframe"; | ||
export declare function removePopup(): void; | ||
export declare function addPopup(iframeLink: string): void; |
@@ -0,1 +1,2 @@ | ||
import { getLinkStyle, getNumber } from './style'; | ||
var popupId = 'front-link-popup'; | ||
@@ -7,3 +8,3 @@ var backdropId = 'front-link-popup__backdrop'; | ||
var getPopupHtml = function (link) { return "\n<div id=\"".concat(popupId, "\">\n <div id=\"").concat(backdropId, "\"></div>\n <div id=\"").concat(popupContentId, "\">\n <iframe id=\"").concat(iframeId, "\" src=\"").concat(link, "\" allow=\"clipboard-read *; clipboard-write *\" />\n </div>\n</div>\n"); }; | ||
var styles = "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: 0.6;\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: 24px;\n background: white;\n flex-grow: 1;\n }\n\n #").concat(popupContentId, " iframe {\n border: none;\n width: 100%;\n flex-grow: 1;\n border-radius: 24px;\n }\n\n @media only screen and (max-width: 768px) {\n #").concat(popupContentId, " {\n height: 100vh;\n width: 100vw;\n max-width: 100%;\n min-width: 100%;\n max-height: 100%;\n min-height: 100%;\n border-radius: 0px;\n }\n\n #").concat(popupContentId, " iframe {\n border-radius: 0px;\n }\n }\n\n @media only screen and (max-height: 710px) {\n #").concat(popupContentId, " {\n max-height: 100%;\n min-height: 100%;\n }\n }\n</style>\n"); | ||
var getStyles = function (style) { return "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: ").concat(getNumber(0.6, style === null || style === void 0 ? void 0 : style.io), ";\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: ").concat(getNumber(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n background: white;\n flex-grow: 1;\n }\n\n #").concat(popupContentId, " iframe {\n border: none;\n width: 100%;\n flex-grow: 1;\n border-radius: ").concat(getNumber(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n }\n\n @media only screen and (max-width: 768px) {\n #").concat(popupContentId, " {\n height: 100vh;\n width: 100vw;\n max-width: 100%;\n min-width: 100%;\n max-height: 100%;\n min-height: 100%;\n border-radius: 0px;\n }\n\n #").concat(popupContentId, " iframe {\n border-radius: 0px;\n }\n }\n\n @media only screen and (max-height: 710px) {\n #").concat(popupContentId, " {\n max-height: 100%;\n min-height: 100%;\n }\n }\n</style>\n"); }; | ||
export function removePopup() { | ||
@@ -17,5 +18,6 @@ var _a, _b; | ||
export function addPopup(iframeLink) { | ||
var style = getLinkStyle(iframeLink); | ||
removePopup(); | ||
var popup = getPopupHtml(iframeLink); | ||
var stylesElement = htmlToElement(styles); | ||
var stylesElement = htmlToElement(getStyles(style)); | ||
if (stylesElement) { | ||
@@ -22,0 +24,0 @@ window.document.head.appendChild(stylesElement); |
@@ -113,1 +113,5 @@ import type { BrokerType } from '@front-finance/api'; | ||
} | ||
export interface LinkStyle { | ||
ir: number; | ||
io: number; | ||
} |
export {}; |
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
48335
26
895