@sumit_yewale/angular 1.1.20 → 1.1.21-fix.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"sumit_yewale-angular.js","sources":["ng://@sumit_yewale/angular/utlis/insertCSS.ts","ng://@sumit_yewale/angular/lib/csvbox-button.component.ts","ng://@sumit_yewale/angular/lib/csvbox-angular.module.ts","ng://@sumit_yewale/angular/lib/interfaces/interface.ts"],"sourcesContent":["let styleElement: HTMLStyleElement\n\nconst GLOBAL_CSS = `\n.csvbox-holder {\n z-index: 2147483647;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n}\n.csvbox-holder iframe {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n`\n\nexport const insertCSS = (): void => {\n if (styleElement) {\n return\n }\n\n styleElement = document.createElement('style')\n styleElement.setAttribute('type', 'text/css')\n const head = document.querySelector('head');\n if (head) {\n head.appendChild(styleElement);\n }\n\n styleElement.textContent = GLOBAL_CSS\n}\n","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n SecurityContext,\n AfterContentInit,\n OnDestroy,\n ChangeDetectorRef,\n NgZone\n} from '@angular/core';\n\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { insertCSS } from '../utlis/insertCSS';\nimport { buildImportUrl, generateUuid, buildInitPayload, createFileSender, classifyStructuredMessage, classifyLegacyMessage } from '@sumit_yewale/adapter-core';\n\n// How long we wait for the importer to confirm a file it was sent before giving up on it.\nconst FILE_ACK_TIMEOUT_MS = 8000;\n\n// Page-wide record of the importers that are open or opening, shared by every CSVBox adapter\n// on the page (it lives on window so separate copies of an adapter see the same list). It does\n// two things: the newest importer is stacked on top (every holder is fixed, full screen and\n// z-index 2147483647, so equal z-indexes would leave the one that comes first in the DOM on\n// top), and the other instances learn that an importer is open so they can disable their button.\ninterface OpenImporterEntry { getHolder: () => HTMLElement | null; }\ninterface OpenImporters { open: OpenImporterEntry[]; listeners: Array<() => void>; }\nconst OPEN_IMPORTERS_KEY = '__csvboxOpenImporters';\nconst TOP_Z_INDEX = 2147483647;\n\nfunction openImporters(): OpenImporters {\n const w = window as any;\n if (!w[OPEN_IMPORTERS_KEY]) w[OPEN_IMPORTERS_KEY] = { open: [], listeners: [] };\n return w[OPEN_IMPORTERS_KEY];\n}\n\nfunction restackOpenImporters(reg: OpenImporters): void {\n reg.open.forEach((entry, i) => {\n const holder = entry.getHolder();\n if (holder) holder.style.zIndex = String(TOP_Z_INDEX - (reg.open.length - 1 - i));\n });\n}\n\nfunction registerOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n if (reg.open.indexOf(entry) >= 0) return;\n reg.open.push(entry);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction unregisterOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n const i = reg.open.indexOf(entry);\n if (i < 0) return;\n reg.open.splice(i, 1);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction isBlockedByOpenImporter(entry: OpenImporterEntry): boolean {\n const reg = openImporters();\n return reg.open.length > 0 && reg.open.indexOf(entry) < 0;\n}\n\nfunction subscribeOpenImporters(fn: () => void): () => void {\n const reg = openImporters();\n reg.listeners.push(fn);\n return () => {\n const i = reg.listeners.indexOf(fn);\n if (i >= 0) reg.listeners.splice(i, 1);\n };\n}\n\nconst appVersion = '1.1.20';\n\n@Component({\n selector: 'csvbox-button',\n template: `\n <div>\n <button [disabled]=\"disabled || blockedByOther\" (click)=\"openModal()\" [attr.data-csvbox-token]=\"uuid\">\n <ng-content></ng-content>\n </button>\n </div>\n `\n})\n\nexport class CSVBoxButtonComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n\n isModalShown = false;\n\n @Input() onImport?: Function;\n @Input() onReady?: Function;\n @Input() onClose?: Function;\n @Input() onSubmit?: Function;\n\n @Input() isImported?: Function;\n @Input() isReady?: Function;\n @Input() isClosed?: Function;\n @Input() isSubmitted?: Function;\n\n @Input() importerReady?: Function;\n @Input() closed?: Function;\n @Input() submitted?: Function;\n @Input() imported?: Function;\n @Input() loadStarted?: Function;\n\n @Input() user?: object;\n @Input() dynamicColumns?: object;\n @Input() licenseKey: string | null = null;\n @Input() options?: object;\n @Input() uuid: string | null = null;\n @Input() customDomain: string | null = null;\n @Input() dataLocation: string | null = null;\n @Input() language: string | null = null;\n @Input() environment?: object;\n\n @Input() theme: string | null = null;\n\n @Input() isIframeLoaded: boolean = false;\n @Input() openModalOnIframeLoad: boolean = false;\n\n @Input() lazy: boolean = false;\n\n safeUrl: any;\n\n iframe: HTMLIFrameElement | null = null;\n\n @Input() disabled: boolean = true;\n\n constructor(public sanitizer:DomSanitizer, private cdr: ChangeDetectorRef, private zone: NgZone) {}\n\n // True while a different importer on the page is open: the button stays disabled.\n blockedByOther: boolean = false;\n\n private registryEntry: OpenImporterEntry = { getHolder: () => this.holder };\n\n private fileSender = createFileSender({\n getIframe: () => this.iframe,\n getToken: () => this.uuid as string,\n getTargetOrigin: () => this.targetOrigin as string,\n getBaseDomain: () => this.baseDomain,\n takeFile: () => {\n const file = this.pendingFile;\n this.pendingFile = null;\n return file;\n },\n onSent: () => this.startFileAckTimer()\n });\n\n private unsubscribeOpenImporters: (() => void) | null = null;\n\n holder: any;\n\n pendingFile: File | null = null;\n\n targetOrigin: string | undefined;\n\n // Data-location sheets redirect to another host, so the iframe origin can differ from\n // targetOrigin. baseDomain is used to check the real origin before trusting it.\n baseDomain: string = \"app.csvbox.io\";\n\n private fileAckTimer: any = null;\n\n ngOnInit(): void {\n this.uuid = generateUuid();\n let iframeUrl = buildImportUrl(\n {\n licenseKey: this.licenseKey,\n customDomain: this.customDomain,\n dataLocation: this.dataLocation,\n language: this.language,\n theme: this.theme,\n environment: this.environment\n },\n \"angular\",\n appVersion\n );\n // Default place to send the file. A file is only ever sent to a named origin, never \"*\".\n this.targetOrigin = new URL(iframeUrl).origin;\n this.baseDomain = this.customDomain || \"app.csvbox.io\";\n this.safeUrl = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.sanitizer.bypassSecurityTrustResourceUrl(iframeUrl));\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(changes[\"user\"] && changes['user'].currentValue != changes['user'].previousValue) {\n this.updateUserVariabe(changes['user'].currentValue);\n }\n }\n\n updateUserVariabe(data: any): void {\n this.user = data;\n if (this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage({\n \"customer\" : data\n }, \"*\");\n }\n }\n\n private messageListener = (event: MessageEvent) => {\n // Older importers send these as bare strings, without a token.\n const legacy = classifyLegacyMessage(event.data);\n if (legacy) {\n // Legacy messages carry no token, so the only way to tell which importer sent one is its\n // window. Ignore those that came from another instance's iframe (or anywhere else).\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n if (legacy.type === \"mainModalHidden\") {\n this.handleModalClosed();\n } else if (legacy.type === \"uploadSuccessful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (legacy.type === \"uploadFailed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n return;\n }\n\n // Set-file handshake messages. The shared core does not classify these, so they are\n // read here, behind the same unique_token check the core applies.\n const raw = event.data;\n if (raw && typeof raw === \"object\" && raw.data && raw.data.unique_token == this.uuid) {\n this.fileSender.learnOrigin(event);\n\n if (raw.type === \"csvbox-set-file-rejected\" && raw.data.reason === \"not-a-file\") {\n // Reply to our probe (it has no file). It only tells us the origin, so do nothing.\n return;\n }\n if (raw.type === \"csvbox-modal-shown\") {\n this.clearFileAckTimer();\n registerOpenImporter(this.registryEntry);\n // What the file path in openModal() is waiting for. display as well as\n // pointer-events: a second file declined while the first was still opening the\n // modal has put the holder away in the meantime.\n this.isModalShown = true;\n if (this.holder) {\n this.holder.style.display = 'block';\n this.holder.style.pointerEvents = 'auto';\n }\n return;\n }\n if (raw.type === \"csvbox-set-file-rejected\") {\n this.clearFileAckTimer();\n // The importer has the file and will not take it. Put the holder away only if the\n // modal was never confirmed up: a file declined while it is open leaves that modal\n // where it is, and its own 'csvbox-modal-hidden' will put the holder away.\n if (!this.isModalShown && this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n unregisterOpenImporter(this.registryEntry);\n }\n console.warn(\"[csvbox] importer declined the supplied file: \" + raw.data.reason);\n return;\n }\n }\n\n let message = classifyStructuredMessage(event.data, this.uuid!);\n if (!message) {\n return;\n }\n\n if (message.type === \"data-on-submit\") {\n if (this.onSubmit) this.onSubmit(message.metadata);\n if (this.isSubmitted) this.isSubmitted(message.metadata);\n if (this.submitted) this.submitted(message.metadata);\n } else if (message.type === \"data-push-status\") {\n if (!message.success) {\n delete message.metadata[\"unique_token\"];\n }\n if (this.onImport) this.onImport(message.success, message.metadata);\n if (this.isImported) this.isImported(message.success, message.metadata);\n if (this.imported) this.imported(message.success, message.metadata);\n } else if (message.type === \"csvbox-modal-hidden\") {\n this.handleModalClosed();\n } else if (message.type === \"csvbox-upload-successful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (message.type === \"csvbox-upload-failed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n };\n\n ngAfterContentInit(): void {\n window.addEventListener(\"message\", this.messageListener, false);\n this.syncBlocked();\n this.unsubscribeOpenImporters = subscribeOpenImporters(() => this.syncBlocked());\n\n if(this.lazy) {\n this.disabled = false;\n } else {\n this.disabled = true;\n this.initImporter();\n }\n }\n\n handleModalClosed(): void {\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n }\n this.isModalShown = false;\n this.isIframeLoaded = false;\n this.openModalOnIframeLoad = false;\n if (this.holder) this.holder.remove();\n this.holder = null;\n this.iframe = null;\n // A new iframe is built on the next open, so the origin is learned again.\n this.clearProbeTimer();\n unregisterOpenImporter(this.registryEntry);\n if (this.onClose) this.onClose();\n if (this.isClosed) this.isClosed();\n if (this.closed) this.closed();\n }\n\n initImporter() {\n if (this.loadStarted) this.loadStarted();\n\n this.uuid = generateUuid();\n\n insertCSS();\n\n let iframe = document.createElement(\"iframe\");\n this.iframe = iframe;\n iframe.setAttribute(\"src\", this.safeUrl);\n iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write *\");\n iframe.frameBorder = \"0\";\n\n let self = this;\n iframe.onload = function () {\n if (self.onReady) self.onReady();\n if (self.isReady) self.isReady();\n if (self.importerReady) self.importerReady();\n\n self.disabled = false;\n self.isIframeLoaded = true;\n if (self.iframe && self.iframe.contentWindow) {\n self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, self.uuid!), \"*\");\n }\n if(self.openModalOnIframeLoad) {\n self.openModal();\n }\n }\n\n this.holder = document.createElement('div');\n this.holder.classList.add('csvbox-holder');\n this.holder.setAttribute('id', `csvbox-embed-${this.uuid}`);\n this.holder.appendChild(iframe);\n\n document.body.insertAdjacentElement(\n 'beforeend', this.holder\n );\n // The holder did not exist yet if openModal() asked for the importer before it was built.\n restackOpenImporters(openImporters());\n }\n\n openModal(): void {\n // Counts as open from the moment it is requested, so the other buttons are disabled while\n // this importer is still loading, and so it is stacked above any importer opened earlier.\n registerOpenImporter(this.registryEntry);\n if(!this.iframe) {\n this.openModalOnIframeLoad = true;\n this.initImporter();\n return;\n }\n if(!this.isModalShown) {\n if(this.isIframeLoaded) {\n if(this.pendingFile) {\n // The importer opens its own modal once it has the file, so that it can inject on\n // 'shown.bs.modal'. Sending 'openModal' as well would race that.\n //\n // It can also decline: wrong step, an import file URL configured on the sheet, or\n // an importer too old to know the message at all. So the holder goes up\n // click-through and stays that way until 'csvbox-modal-shown' confirms the modal\n // is really up. It covers the viewport at z-index 2147483647 and the importer\n // renders transparent with its modal closed, so arming it on an unanswered message\n // leaves an invisible sheet over the host page eating every click.\n //\n // display:block regardless, so the iframe lays out and animates normally; only\n // pointer-events is held back. isModalShown likewise waits for the confirmation,\n // or a declined file would latch the importer shut for good.\n if(this.holder) {\n this.holder.style.pointerEvents = 'none';\n this.holder.style.display = 'block';\n }\n this.fileSender.send();\n } else {\n this.isModalShown = true;\n if(this.holder) {\n // Explicit: a previously declined file leaves the holder click-through.\n this.holder.style.pointerEvents = 'auto';\n this.holder.style.display = 'block';\n }\n if(this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage('openModal', '*');\n }\n }\n } else {\n this.openModalOnIframeLoad = true;\n }\n }\n }\n\n /**\n * Open the importer on a File the host page already has, instead of the file picker.\n *\n * Reachable through a template reference (`#importer` then `importer.openModalWithFile(file)`)\n * or `@ViewChild(CSVBoxButtonComponent)`.\n *\n * The File crosses to the iframe by structured clone, so the importer receives the real\n * object and applies its own extension, worksheet and size rules to it -- this does not\n * bypass any of them. Pass a File; a Blob has no name for the importer to read an\n * extension from.\n */\n openModalWithFile(file: File): void {\n if(typeof File === 'undefined' || !(file instanceof File)) {\n return;\n }\n\n this.pendingFile = file;\n\n // Already open: hand it over now rather than holding it for the next open. The importer\n // takes it only while it is still on the upload step, and ignores it once the user has a\n // dataset and a mapping in progress.\n if(this.isModalShown && this.iframe && this.isIframeLoaded) {\n this.fileSender.send();\n return;\n }\n\n this.openModal();\n }\n\n clearProbeTimer(): void {\n this.clearFileAckTimer();\n this.fileSender.reset();\n }\n\n startFileAckTimer(): void {\n this.clearFileAckTimer();\n this.fileAckTimer = setTimeout(() => {\n this.fileAckTimer = null;\n this.giveUpOnFile();\n }, FILE_ACK_TIMEOUT_MS);\n }\n\n clearFileAckTimer(): void {\n if (this.fileAckTimer) {\n clearTimeout(this.fileAckTimer);\n this.fileAckTimer = null;\n }\n }\n\n // The importer never confirmed the file it was sent (an origin we do not trust, or an importer too\n // old to know the message). Without this the holder would stay up, invisible and click-through,\n // and the other instances' buttons would stay disabled for good.\n giveUpOnFile(): void {\n if (this.isModalShown) {\n return;\n }\n const holder = this.holder;\n if (holder) {\n holder.style.display = 'none';\n holder.style.pointerEvents = 'auto';\n }\n unregisterOpenImporter(this.registryEntry);\n console.warn(\"[csvbox] the importer did not respond to the supplied file\");\n }\n\n private syncBlocked(): void {\n const blocked = isBlockedByOpenImporter(this.registryEntry);\n if (blocked !== this.blockedByOther) {\n // The registry can call back from outside Angular's zone (another instance, another app).\n this.zone.run(() => {\n this.blockedByOther = blocked;\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy(): void {\n this.clearProbeTimer();\n window.removeEventListener(\"message\", this.messageListener);\n unregisterOpenImporter(this.registryEntry);\n if (this.unsubscribeOpenImporters) {\n this.unsubscribeOpenImporters();\n this.unsubscribeOpenImporters = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CSVBoxButtonComponent } from './csvbox-button.component';\n\n\n\n@NgModule({\n declarations: [\n CSVBoxButtonComponent\n ],\n imports: [\n ],\n exports: [\n CSVBoxButtonComponent\n ]\n})\nexport class CSVBoxAngularModule { }\n","export interface CSVBoxMethods {\n onData?: (result:boolean, data:any) => void;\n}\n"],"names":[],"mappings":";;;;;;;;;;IAAI,YAA8B;;MAE5B,UAAU,GAAG;;;;;;;;;;;;;;;;;CAiBlB;;AAED,MAAa,SAAS;;;AAAG;IACvB,IAAI,YAAY,EAAE;QAChB,OAAM;KACP;IAED,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9C,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;;UACvC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;IAC3C,IAAI,IAAI,EAAE;QACR,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;KAChC;IAED,YAAY,CAAC,WAAW,GAAG,UAAU,CAAA;CACtC,CAAA;;;;;;;AClCD;;MAkBM,mB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AAgC;;IAEhC,qCAAuB;;IACvB,+CAAiC;;IACjC,2CAA0C;;IAC1C,wCAA0B;;IAC1B,qCAAoC;;IACpC,6CAA4C;;IAC5C,6CAA4C;;IAC5C,yCAAwC;;IACxC,4CAA8B;;IAE9B,sCAAqC;;IAErC,+CAAyC;;IACzC,sDAAgD;;IAEhD,qCAA+B;;IAE/B,wCAAa;;IAEb,uCAAwC;;IAExC,yCAAkC;;IAKlC,+CAAgC;;;;;IAEhC,8CAA4E;;;;;IAE5E,2CAWG;;;;;IAEH,yDAA6D;;IAE7D,uCAAY;;IAEZ,4CAAgC;;IAEhC,6CAAiC;;IAIjC,2CAAqC;;;;;IAErC,6CAAiC;;;;;IAqCjC,gDAwFE;;IA7JU,0CAA6B;;;;;IAAE,oCAA8B;;;;;IAAE,qCAAoB;;;;;;;;AClIjG,MAea,mBAAmB;;;YAV/B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,qBAAqB;iBACtB;gBACD,OAAO,EAAE,EACR;gBACD,OAAO,EAAE;oBACP,qBAAqB;iBACtB;aACF;;;;;;;;;;;ACdD,4BAEC;;;IADC,+BAA4C;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"sumit_yewale-angular.js","sources":["ng://@sumit_yewale/angular/utlis/insertCSS.ts","ng://@sumit_yewale/angular/lib/csvbox-button.component.ts","ng://@sumit_yewale/angular/lib/csvbox-angular.module.ts","ng://@sumit_yewale/angular/lib/interfaces/interface.ts"],"sourcesContent":["let styleElement: HTMLStyleElement\n\nconst GLOBAL_CSS = `\n.csvbox-holder {\n z-index: 2147483647;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n}\n.csvbox-holder iframe {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n`\n\nexport const insertCSS = (): void => {\n if (styleElement) {\n return\n }\n\n styleElement = document.createElement('style')\n styleElement.setAttribute('type', 'text/css')\n const head = document.querySelector('head');\n if (head) {\n head.appendChild(styleElement);\n }\n\n styleElement.textContent = GLOBAL_CSS\n}\n","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n SecurityContext,\n AfterContentInit,\n OnDestroy,\n ChangeDetectorRef,\n NgZone\n} from '@angular/core';\n\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { insertCSS } from '../utlis/insertCSS';\nimport { buildImportUrl, generateUuid, buildInitPayload, createMessageGate, createImportTracker, createFileSender, classifyStructuredMessage, classifyLegacyMessage } from '@sumit_yewale/adapter-core';\n\n// How long we wait for the importer to confirm a file it was sent before giving up on it.\nconst FILE_ACK_TIMEOUT_MS = 8000;\n\n// Page-wide record of the importers that are open or opening, shared by every CSVBox adapter\n// on the page (it lives on window so separate copies of an adapter see the same list). It does\n// two things: the newest importer is stacked on top (every holder is fixed, full screen and\n// z-index 2147483647, so equal z-indexes would leave the one that comes first in the DOM on\n// top), and the other instances learn that an importer is open so they can disable their button.\ninterface OpenImporterEntry { getHolder: () => HTMLElement | null; }\ninterface OpenImporters { open: OpenImporterEntry[]; listeners: Array<() => void>; }\nconst OPEN_IMPORTERS_KEY = '__csvboxOpenImporters';\nconst TOP_Z_INDEX = 2147483647;\n\nfunction openImporters(): OpenImporters {\n const w = window as any;\n if (!w[OPEN_IMPORTERS_KEY]) w[OPEN_IMPORTERS_KEY] = { open: [], listeners: [] };\n return w[OPEN_IMPORTERS_KEY];\n}\n\nfunction restackOpenImporters(reg: OpenImporters): void {\n reg.open.forEach((entry, i) => {\n const holder = entry.getHolder();\n if (holder) holder.style.zIndex = String(TOP_Z_INDEX - (reg.open.length - 1 - i));\n });\n}\n\nfunction registerOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n if (reg.open.indexOf(entry) >= 0) return;\n reg.open.push(entry);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction unregisterOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n const i = reg.open.indexOf(entry);\n if (i < 0) return;\n reg.open.splice(i, 1);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction isBlockedByOpenImporter(entry: OpenImporterEntry): boolean {\n const reg = openImporters();\n return reg.open.length > 0 && reg.open.indexOf(entry) < 0;\n}\n\nfunction subscribeOpenImporters(fn: () => void): () => void {\n const reg = openImporters();\n reg.listeners.push(fn);\n return () => {\n const i = reg.listeners.indexOf(fn);\n if (i >= 0) reg.listeners.splice(i, 1);\n };\n}\n\nconst appVersion = '1.1.20';\n\n@Component({\n selector: 'csvbox-button',\n template: `\n <div>\n <button [disabled]=\"disabled || blockedByOther\" (click)=\"openModal()\" [attr.data-csvbox-token]=\"uuid\">\n <ng-content></ng-content>\n </button>\n </div>\n `\n})\n\nexport class CSVBoxButtonComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n\n isModalShown = false;\n\n @Input() onImport?: Function;\n @Input() onReady?: Function;\n @Input() onClose?: Function;\n @Input() onSubmit?: Function;\n\n @Input() isImported?: Function;\n @Input() isReady?: Function;\n @Input() isClosed?: Function;\n @Input() isSubmitted?: Function;\n\n @Input() importerReady?: Function;\n @Input() closed?: Function;\n @Input() submitted?: Function;\n @Input() imported?: Function;\n @Input() loadStarted?: Function;\n\n @Input() user?: object;\n @Input() dynamicColumns?: object;\n @Input() licenseKey: string | null = null;\n @Input() options?: object;\n @Input() uuid: string | null = null;\n @Input() customDomain: string | null = null;\n @Input() dataLocation: string | null = null;\n @Input() language: string | null = null;\n @Input() environment?: object;\n\n @Input() theme: string | null = null;\n\n @Input() isIframeLoaded: boolean = false;\n @Input() openModalOnIframeLoad: boolean = false;\n\n @Input() lazy: boolean = false;\n\n safeUrl: any;\n\n iframe: HTMLIFrameElement | null = null;\n\n @Input() disabled: boolean = true;\n\n constructor(public sanitizer:DomSanitizer, private cdr: ChangeDetectorRef, private zone: NgZone) {}\n\n // True while a different importer on the page is open: the button stays disabled.\n blockedByOther: boolean = false;\n\n private messageGate = createMessageGate();\n private importTracker = createImportTracker();\n\n private registryEntry: OpenImporterEntry = { getHolder: () => this.holder };\n\n private fileSender = createFileSender({\n getIframe: () => this.iframe,\n getToken: () => this.uuid as string,\n getTargetOrigin: () => this.targetOrigin as string,\n getBaseDomain: () => this.baseDomain,\n takeFile: () => {\n const file = this.pendingFile;\n this.pendingFile = null;\n return file;\n },\n onSent: () => this.startFileAckTimer()\n });\n\n private unsubscribeOpenImporters: (() => void) | null = null;\n\n holder: any;\n\n pendingFile: File | null = null;\n\n targetOrigin: string | undefined;\n\n // Data-location sheets redirect to another host, so the iframe origin can differ from\n // targetOrigin. baseDomain is used to check the real origin before trusting it.\n baseDomain: string = \"app.csvbox.io\";\n\n private fileAckTimer: any = null;\n\n ngOnInit(): void {\n this.uuid = generateUuid();\n let iframeUrl = buildImportUrl(\n {\n licenseKey: this.licenseKey,\n customDomain: this.customDomain,\n dataLocation: this.dataLocation,\n language: this.language,\n theme: this.theme,\n environment: this.environment\n },\n \"angular\",\n appVersion\n );\n // Default place to send the file. A file is only ever sent to a named origin, never \"*\".\n this.targetOrigin = new URL(iframeUrl).origin;\n this.baseDomain = this.customDomain || \"app.csvbox.io\";\n this.safeUrl = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.sanitizer.bypassSecurityTrustResourceUrl(iframeUrl));\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(changes[\"user\"] && changes['user'].currentValue != changes['user'].previousValue) {\n this.updateUserVariabe(changes['user'].currentValue);\n }\n }\n\n updateUserVariabe(data: any): void {\n this.user = data;\n if (this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage({\n \"customer\" : data\n }, \"*\");\n }\n }\n\n private messageListener = (event: MessageEvent) => {\n // Older importers send these as bare strings, without a token.\n const legacy = classifyLegacyMessage(event.data);\n if (legacy) {\n // Legacy messages carry no token, so the only way to tell which importer sent one is its\n // window. Ignore those that came from another instance's iframe (or anywhere else).\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n // A newer importer sends the typed message as well; act on that one only.\n if (!this.messageGate.allowLegacy()) {\n return;\n }\n const ended = this.importTracker.observe(legacy);\n if (legacy.type === \"mainModalHidden\") {\n this.handleModalClosed();\n } else if (legacy.type === \"uploadSuccessful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (legacy.type === \"uploadFailed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n this.finishImport(ended);\n return;\n }\n\n // Set-file handshake messages. The shared core does not classify these, so they are\n // read here, behind the same unique_token check the core applies.\n const raw = event.data;\n if (raw && typeof raw === \"object\" && raw.data && raw.data.unique_token == this.uuid) {\n this.fileSender.learnOrigin(event);\n\n if (raw.type === \"csvbox-set-file-rejected\" && raw.data.reason === \"not-a-file\") {\n // Reply to our probe (it has no file). It only tells us the origin, so do nothing.\n return;\n }\n if (raw.type === \"csvbox-modal-shown\") {\n this.clearFileAckTimer();\n registerOpenImporter(this.registryEntry);\n // What the file path in openModal() is waiting for. display as well as\n // pointer-events: a second file declined while the first was still opening the\n // modal has put the holder away in the meantime.\n this.isModalShown = true;\n if (this.holder) {\n this.holder.style.display = 'block';\n this.holder.style.pointerEvents = 'auto';\n }\n return;\n }\n if (raw.type === \"csvbox-set-file-rejected\") {\n this.clearFileAckTimer();\n // The importer has the file and will not take it. Put the holder away only if the\n // modal was never confirmed up: a file declined while it is open leaves that modal\n // where it is, and its own 'csvbox-modal-hidden' will put the holder away.\n if (!this.isModalShown && this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n unregisterOpenImporter(this.registryEntry);\n }\n console.warn(\"[csvbox] importer declined the supplied file: \" + raw.data.reason);\n return;\n }\n }\n\n let message = classifyStructuredMessage(event.data, this.uuid!);\n if (!message) {\n return;\n }\n this.messageGate.markTyped();\n const ended = this.importTracker.observe(message);\n\n if (message.type === \"data-on-submit\") {\n if (this.onSubmit) this.onSubmit(message.metadata);\n if (this.isSubmitted) this.isSubmitted(message.metadata);\n if (this.submitted) this.submitted(message.metadata);\n } else if (message.type === \"data-push-status\") {\n if (this.onImport) this.onImport(message.success, message.metadata);\n if (this.isImported) this.isImported(message.success, message.metadata);\n if (this.imported) this.imported(message.success, message.metadata);\n } else if (message.type === \"csvbox-modal-hidden\") {\n this.handleModalClosed();\n } else if (message.type === \"csvbox-upload-successful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (message.type === \"csvbox-upload-failed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n this.finishImport(ended);\n };\n\n ngAfterContentInit(): void {\n window.addEventListener(\"message\", this.messageListener, false);\n this.syncBlocked();\n this.unsubscribeOpenImporters = subscribeOpenImporters(() => this.syncBlocked());\n\n if(this.lazy) {\n this.disabled = false;\n } else {\n this.disabled = true;\n this.initImporter();\n }\n }\n\n handleModalClosed(): void {\n if (this.importTracker.isInFlight()) {\n // Closed after submitting and before the result arrived: keep the iframe and its listener\n // so the late result still reaches onImport. It is removed once that result has been\n // delivered (see finishImport), so the next open is a fresh load.\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n }\n this.isModalShown = false;\n this.openModalOnIframeLoad = false;\n this.clearFileAckTimer();\n unregisterOpenImporter(this.registryEntry);\n } else {\n this.destroyImporter();\n }\n if (this.onClose) this.onClose();\n if (this.isClosed) this.isClosed();\n if (this.closed) this.closed();\n }\n\n // Called after the result of an import has been delivered. If the modal was closed in the\n // meantime the iframe was only hidden, so remove it now.\n private finishImport(ended: boolean): void {\n if (ended && !this.isModalShown && this.iframe) {\n this.destroyImporter();\n }\n }\n\n // Puts the importer away: the next open builds a new iframe with a new token.\n private destroyImporter(): void {\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n this.holder.remove();\n }\n this.holder = null;\n this.iframe = null;\n this.isModalShown = false;\n this.isIframeLoaded = false;\n this.openModalOnIframeLoad = false;\n this.messageGate.reset();\n this.importTracker.reset();\n // A new iframe is built on the next open, so the origin is learned again.\n this.clearProbeTimer();\n unregisterOpenImporter(this.registryEntry);\n }\n\n initImporter() {\n if (this.loadStarted) this.loadStarted();\n\n this.uuid = generateUuid();\n this.messageGate.reset();\n this.importTracker.reset();\n\n insertCSS();\n\n let iframe = document.createElement(\"iframe\");\n this.iframe = iframe;\n iframe.setAttribute(\"src\", this.safeUrl);\n iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write *\");\n iframe.frameBorder = \"0\";\n\n let self = this;\n iframe.onload = function () {\n self.disabled = false;\n self.isIframeLoaded = true;\n // The handshake goes first: a consumer that calls openModalWithFile() from the ready\n // callback needs the importer to already have its customer, columns, options and token.\n if (self.iframe && self.iframe.contentWindow) {\n self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, self.uuid!), \"*\");\n }\n if (self.onReady) self.onReady();\n if (self.isReady) self.isReady();\n if (self.importerReady) self.importerReady();\n\n if(self.openModalOnIframeLoad) {\n self.openModal();\n }\n }\n\n this.holder = document.createElement('div');\n this.holder.classList.add('csvbox-holder');\n this.holder.setAttribute('id', `csvbox-embed-${this.uuid}`);\n this.holder.appendChild(iframe);\n\n document.body.insertAdjacentElement(\n 'beforeend', this.holder\n );\n // The holder did not exist yet if openModal() asked for the importer before it was built.\n restackOpenImporters(openImporters());\n }\n\n openModal(): void {\n // Counts as open from the moment it is requested, so the other buttons are disabled while\n // this importer is still loading, and so it is stacked above any importer opened earlier.\n registerOpenImporter(this.registryEntry);\n if(!this.iframe) {\n this.openModalOnIframeLoad = true;\n this.initImporter();\n return;\n }\n if(!this.isModalShown) {\n if(this.isIframeLoaded) {\n if(this.pendingFile) {\n // The importer opens its own modal once it has the file, so that it can inject on\n // 'shown.bs.modal'. Sending 'openModal' as well would race that.\n //\n // It can also decline: wrong step, an import file URL configured on the sheet, or\n // an importer too old to know the message at all. So the holder goes up\n // click-through and stays that way until 'csvbox-modal-shown' confirms the modal\n // is really up. It covers the viewport at z-index 2147483647 and the importer\n // renders transparent with its modal closed, so arming it on an unanswered message\n // leaves an invisible sheet over the host page eating every click.\n //\n // display:block regardless, so the iframe lays out and animates normally; only\n // pointer-events is held back. isModalShown likewise waits for the confirmation,\n // or a declined file would latch the importer shut for good.\n if(this.holder) {\n this.holder.style.pointerEvents = 'none';\n this.holder.style.display = 'block';\n }\n this.fileSender.send();\n } else {\n this.isModalShown = true;\n if(this.holder) {\n // Explicit: a previously declined file leaves the holder click-through.\n this.holder.style.pointerEvents = 'auto';\n this.holder.style.display = 'block';\n }\n if(this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage('openModal', '*');\n }\n }\n } else {\n this.openModalOnIframeLoad = true;\n }\n }\n }\n\n /**\n * Open the importer on a File the host page already has, instead of the file picker.\n *\n * Reachable through a template reference (`#importer` then `importer.openModalWithFile(file)`)\n * or `@ViewChild(CSVBoxButtonComponent)`.\n *\n * The File crosses to the iframe by structured clone, so the importer receives the real\n * object and applies its own extension, worksheet and size rules to it -- this does not\n * bypass any of them. Pass a File; a Blob has no name for the importer to read an\n * extension from.\n */\n openModalWithFile(file: File): void {\n if(typeof File === 'undefined' || !(file instanceof File)) {\n return;\n }\n\n this.pendingFile = file;\n\n // Already open: hand it over now rather than holding it for the next open. The importer\n // takes it only while it is still on the upload step, and ignores it once the user has a\n // dataset and a mapping in progress.\n if(this.isModalShown && this.iframe && this.isIframeLoaded) {\n this.fileSender.send();\n return;\n }\n\n this.openModal();\n }\n\n clearProbeTimer(): void {\n this.clearFileAckTimer();\n this.fileSender.reset();\n }\n\n startFileAckTimer(): void {\n this.clearFileAckTimer();\n this.fileAckTimer = setTimeout(() => {\n this.fileAckTimer = null;\n this.giveUpOnFile();\n }, FILE_ACK_TIMEOUT_MS);\n }\n\n clearFileAckTimer(): void {\n if (this.fileAckTimer) {\n clearTimeout(this.fileAckTimer);\n this.fileAckTimer = null;\n }\n }\n\n // The importer never confirmed the file it was sent (an origin we do not trust, or an importer too\n // old to know the message). Without this the holder would stay up, invisible and click-through,\n // and the other instances' buttons would stay disabled for good.\n giveUpOnFile(): void {\n if (this.isModalShown) {\n return;\n }\n const holder = this.holder;\n if (holder) {\n holder.style.display = 'none';\n holder.style.pointerEvents = 'auto';\n }\n unregisterOpenImporter(this.registryEntry);\n console.warn(\"[csvbox] the importer did not respond to the supplied file\");\n }\n\n private syncBlocked(): void {\n const blocked = isBlockedByOpenImporter(this.registryEntry);\n if (blocked !== this.blockedByOther) {\n // The registry can call back from outside Angular's zone (another instance, another app).\n this.zone.run(() => {\n this.blockedByOther = blocked;\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy(): void {\n window.removeEventListener(\"message\", this.messageListener);\n // Takes the holder out of document.body: left there, it would keep covering the page with\n // an invisible full-screen layer that nothing is left to hide.\n this.destroyImporter();\n if (this.unsubscribeOpenImporters) {\n this.unsubscribeOpenImporters();\n this.unsubscribeOpenImporters = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CSVBoxButtonComponent } from './csvbox-button.component';\n\n\n\n@NgModule({\n declarations: [\n CSVBoxButtonComponent\n ],\n imports: [\n ],\n exports: [\n CSVBoxButtonComponent\n ]\n})\nexport class CSVBoxAngularModule { }\n","export interface CSVBoxMethods {\n onData?: (result:boolean, data:any) => void;\n}\n"],"names":[],"mappings":";;;;;;;;;;IAAI,YAA8B;;MAE5B,UAAU,GAAG;;;;;;;;;;;;;;;;;CAiBlB;;AAED,MAAa,SAAS;;;AAAG;IACvB,IAAI,YAAY,EAAE;QAChB,OAAM;KACP;IAED,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9C,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;;UACvC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;IAC3C,IAAI,IAAI,EA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,4CAAgC;;IAEhC,qCAAuB;;IACvB,+CAAiC;;IACjC,2CAA0C;;IAC1C,wCAA0B;;IAC1B,qCAAoC;;IACpC,6CAA4C;;IAC5C,6CAA4C;;IAC5C,yCAAwC;;IACxC,4CAA8B;;IAE9B,sCAAqC;;IAErC,+CAAyC;;IACzC,sDAAgD;;IAEhD,qCAA+B;;IAE/B,wCAAa;;IAEb,uCAAwC;;IAExC,yCAAkC;;IAKlC,+CAAgC;;;;;IAEhC,4CAA0C;;;;;IAC1C,8CAA8C;;;;;IAE9C,8CAA4E;;;;;IAE5E,2CAWG;;;;;IAEH,yDAA6D;;IAE7D,uCAAY;;IAEZ,4CAAgC;;IAEhC,6CAAiC;;IAIjC,2CAAqC;;;;;IAErC,6CAAiC;;;;;IAqCjC,gDA8FE;;IAtKU,0CAA6B;;;;;IAAE,oCAA8B;;;;;IAAE,qCAAoB;;;;;;;;AClIjG,MAea,mBAAmB;;;YAV/B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,qBAAqB;iBACtB;gBACD,OAAO,EAAE,EACR;gBACD,OAAO,EAAE;oBACP,qBAAqB;iBACtB;aACF;;;;;;;;;;;ACdD,4BAEC;;;IADC,+BAA4C;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { SecurityContext, Component, ChangeDetectorRef, NgZone, Input, NgModule } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
- import { createFileSender, classifyLegacyMessage, classifyStructuredMessage, generateUuid, buildImportUrl, buildInitPayload } from '@sumit_yewale/adapter-core';
3
+ import { createMessageGate, createImportTracker, createFileSender, classifyLegacyMessage, classifyStructuredMessage, generateUuid, buildImportUrl, buildInitPayload } from '@sumit_yewale/adapter-core';
4
4
 
5
5
  /**
6
6
  * @fileoverview added by tsickle
@@ -171,6 +171,8 @@ var CSVBoxButtonComponent = /** @class */ (function () {
171
171
  this.disabled = true;
172
172
  // True while a different importer on the page is open: the button stays disabled.
173
173
  this.blockedByOther = false;
174
+ this.messageGate = createMessageGate();
175
+ this.importTracker = createImportTracker();
174
176
  this.registryEntry = { getHolder: (/**
175
177
  * @return {?}
176
178
  */
@@ -226,6 +228,12 @@ var CSVBoxButtonComponent = /** @class */ (function () {
226
228
  if (!_this.iframe || event.source !== _this.iframe.contentWindow) {
227
229
  return;
228
230
  }
231
+ // A newer importer sends the typed message as well; act on that one only.
232
+ if (!_this.messageGate.allowLegacy()) {
233
+ return;
234
+ }
235
+ /** @type {?} */
236
+ var ended_1 = _this.importTracker.observe(legacy);
229
237
  if (legacy.type === "mainModalHidden") {
230
238
  _this.handleModalClosed();
231
239
  }
@@ -245,6 +253,7 @@ var CSVBoxButtonComponent = /** @class */ (function () {
245
253
  if (_this.imported)
246
254
  _this.imported(false);
247
255
  }
256
+ _this.finishImport(ended_1);
248
257
  return;
249
258
  }
250
259
  // Set-file handshake messages. The shared core does not classify these, so they are
@@ -289,6 +298,9 @@ var CSVBoxButtonComponent = /** @class */ (function () {
289
298
  if (!message) {
290
299
  return;
291
300
  }
301
+ _this.messageGate.markTyped();
302
+ /** @type {?} */
303
+ var ended = _this.importTracker.observe(message);
292
304
  if (message.type === "data-on-submit") {
293
305
  if (_this.onSubmit)
294
306
  _this.onSubmit(message.metadata);
@@ -298,9 +310,6 @@ var CSVBoxButtonComponent = /** @class */ (function () {
298
310
  _this.submitted(message.metadata);
299
311
  }
300
312
  else if (message.type === "data-push-status") {
301
- if (!message.success) {
302
- delete message.metadata["unique_token"];
303
- }
304
313
  if (_this.onImport)
305
314
  _this.onImport(message.success, message.metadata);
306
315
  if (_this.isImported)
@@ -327,6 +336,7 @@ var CSVBoxButtonComponent = /** @class */ (function () {
327
336
  if (_this.imported)
328
337
  _this.imported(false);
329
338
  }
339
+ _this.finishImport(ended);
330
340
  });
331
341
  }
332
342
  /**
@@ -408,27 +418,80 @@ var CSVBoxButtonComponent = /** @class */ (function () {
408
418
  CSVBoxButtonComponent.prototype.handleModalClosed = /**
409
419
  * @return {?}
410
420
  */
421
+ function () {
422
+ if (this.importTracker.isInFlight()) {
423
+ // Closed after submitting and before the result arrived: keep the iframe and its listener
424
+ // so the late result still reaches onImport. It is removed once that result has been
425
+ // delivered (see finishImport), so the next open is a fresh load.
426
+ if (this.holder) {
427
+ this.holder.style.display = 'none';
428
+ this.holder.style.pointerEvents = 'auto';
429
+ }
430
+ this.isModalShown = false;
431
+ this.openModalOnIframeLoad = false;
432
+ this.clearFileAckTimer();
433
+ unregisterOpenImporter(this.registryEntry);
434
+ }
435
+ else {
436
+ this.destroyImporter();
437
+ }
438
+ if (this.onClose)
439
+ this.onClose();
440
+ if (this.isClosed)
441
+ this.isClosed();
442
+ if (this.closed)
443
+ this.closed();
444
+ };
445
+ // Called after the result of an import has been delivered. If the modal was closed in the
446
+ // meantime the iframe was only hidden, so remove it now.
447
+ // Called after the result of an import has been delivered. If the modal was closed in the
448
+ // meantime the iframe was only hidden, so remove it now.
449
+ /**
450
+ * @private
451
+ * @param {?} ended
452
+ * @return {?}
453
+ */
454
+ CSVBoxButtonComponent.prototype.finishImport =
455
+ // Called after the result of an import has been delivered. If the modal was closed in the
456
+ // meantime the iframe was only hidden, so remove it now.
457
+ /**
458
+ * @private
459
+ * @param {?} ended
460
+ * @return {?}
461
+ */
462
+ function (ended) {
463
+ if (ended && !this.isModalShown && this.iframe) {
464
+ this.destroyImporter();
465
+ }
466
+ };
467
+ // Puts the importer away: the next open builds a new iframe with a new token.
468
+ // Puts the importer away: the next open builds a new iframe with a new token.
469
+ /**
470
+ * @private
471
+ * @return {?}
472
+ */
473
+ CSVBoxButtonComponent.prototype.destroyImporter =
474
+ // Puts the importer away: the next open builds a new iframe with a new token.
475
+ /**
476
+ * @private
477
+ * @return {?}
478
+ */
411
479
  function () {
412
480
  if (this.holder) {
413
481
  this.holder.style.display = 'none';
414
482
  this.holder.style.pointerEvents = 'auto';
483
+ this.holder.remove();
415
484
  }
485
+ this.holder = null;
486
+ this.iframe = null;
416
487
  this.isModalShown = false;
417
488
  this.isIframeLoaded = false;
418
489
  this.openModalOnIframeLoad = false;
419
- if (this.holder)
420
- this.holder.remove();
421
- this.holder = null;
422
- this.iframe = null;
490
+ this.messageGate.reset();
491
+ this.importTracker.reset();
423
492
  // A new iframe is built on the next open, so the origin is learned again.
424
493
  this.clearProbeTimer();
425
494
  unregisterOpenImporter(this.registryEntry);
426
- if (this.onClose)
427
- this.onClose();
428
- if (this.isClosed)
429
- this.isClosed();
430
- if (this.closed)
431
- this.closed();
432
495
  };
433
496
  /**
434
497
  * @return {?}
@@ -440,6 +503,8 @@ var CSVBoxButtonComponent = /** @class */ (function () {
440
503
  if (this.loadStarted)
441
504
  this.loadStarted();
442
505
  this.uuid = generateUuid();
506
+ this.messageGate.reset();
507
+ this.importTracker.reset();
443
508
  insertCSS();
444
509
  /** @type {?} */
445
510
  var iframe = document.createElement("iframe");
@@ -453,17 +518,19 @@ var CSVBoxButtonComponent = /** @class */ (function () {
453
518
  * @return {?}
454
519
  */
455
520
  function () {
521
+ self.disabled = false;
522
+ self.isIframeLoaded = true;
523
+ // The handshake goes first: a consumer that calls openModalWithFile() from the ready
524
+ // callback needs the importer to already have its customer, columns, options and token.
525
+ if (self.iframe && self.iframe.contentWindow) {
526
+ self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, (/** @type {?} */ (self.uuid))), "*");
527
+ }
456
528
  if (self.onReady)
457
529
  self.onReady();
458
530
  if (self.isReady)
459
531
  self.isReady();
460
532
  if (self.importerReady)
461
533
  self.importerReady();
462
- self.disabled = false;
463
- self.isIframeLoaded = true;
464
- if (self.iframe && self.iframe.contentWindow) {
465
- self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, (/** @type {?} */ (self.uuid))), "*");
466
- }
467
534
  if (self.openModalOnIframeLoad) {
468
535
  self.openModal();
469
536
  }
@@ -679,9 +746,10 @@ var CSVBoxButtonComponent = /** @class */ (function () {
679
746
  * @return {?}
680
747
  */
681
748
  function () {
682
- this.clearProbeTimer();
683
749
  window.removeEventListener("message", this.messageListener);
684
- unregisterOpenImporter(this.registryEntry);
750
+ // Takes the holder out of document.body: left there, it would keep covering the page with
751
+ // an invisible full-screen layer that nothing is left to hide.
752
+ this.destroyImporter();
685
753
  if (this.unsubscribeOpenImporters) {
686
754
  this.unsubscribeOpenImporters();
687
755
  this.unsubscribeOpenImporters = null;
@@ -793,6 +861,16 @@ if (false) {
793
861
  CSVBoxButtonComponent.prototype.disabled;
794
862
  /** @type {?} */
795
863
  CSVBoxButtonComponent.prototype.blockedByOther;
864
+ /**
865
+ * @type {?}
866
+ * @private
867
+ */
868
+ CSVBoxButtonComponent.prototype.messageGate;
869
+ /**
870
+ * @type {?}
871
+ * @private
872
+ */
873
+ CSVBoxButtonComponent.prototype.importTracker;
796
874
  /**
797
875
  * @type {?}
798
876
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"sumit_yewale-angular.js","sources":["ng://@sumit_yewale/angular/utlis/insertCSS.ts","ng://@sumit_yewale/angular/lib/csvbox-button.component.ts","ng://@sumit_yewale/angular/lib/csvbox-angular.module.ts","ng://@sumit_yewale/angular/lib/interfaces/interface.ts"],"sourcesContent":["let styleElement: HTMLStyleElement\n\nconst GLOBAL_CSS = `\n.csvbox-holder {\n z-index: 2147483647;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n}\n.csvbox-holder iframe {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n`\n\nexport const insertCSS = (): void => {\n if (styleElement) {\n return\n }\n\n styleElement = document.createElement('style')\n styleElement.setAttribute('type', 'text/css')\n const head = document.querySelector('head');\n if (head) {\n head.appendChild(styleElement);\n }\n\n styleElement.textContent = GLOBAL_CSS\n}\n","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n SecurityContext,\n AfterContentInit,\n OnDestroy,\n ChangeDetectorRef,\n NgZone\n} from '@angular/core';\n\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { insertCSS } from '../utlis/insertCSS';\nimport { buildImportUrl, generateUuid, buildInitPayload, createFileSender, classifyStructuredMessage, classifyLegacyMessage } from '@sumit_yewale/adapter-core';\n\n// How long we wait for the importer to confirm a file it was sent before giving up on it.\nconst FILE_ACK_TIMEOUT_MS = 8000;\n\n// Page-wide record of the importers that are open or opening, shared by every CSVBox adapter\n// on the page (it lives on window so separate copies of an adapter see the same list). It does\n// two things: the newest importer is stacked on top (every holder is fixed, full screen and\n// z-index 2147483647, so equal z-indexes would leave the one that comes first in the DOM on\n// top), and the other instances learn that an importer is open so they can disable their button.\ninterface OpenImporterEntry { getHolder: () => HTMLElement | null; }\ninterface OpenImporters { open: OpenImporterEntry[]; listeners: Array<() => void>; }\nconst OPEN_IMPORTERS_KEY = '__csvboxOpenImporters';\nconst TOP_Z_INDEX = 2147483647;\n\nfunction openImporters(): OpenImporters {\n const w = window as any;\n if (!w[OPEN_IMPORTERS_KEY]) w[OPEN_IMPORTERS_KEY] = { open: [], listeners: [] };\n return w[OPEN_IMPORTERS_KEY];\n}\n\nfunction restackOpenImporters(reg: OpenImporters): void {\n reg.open.forEach((entry, i) => {\n const holder = entry.getHolder();\n if (holder) holder.style.zIndex = String(TOP_Z_INDEX - (reg.open.length - 1 - i));\n });\n}\n\nfunction registerOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n if (reg.open.indexOf(entry) >= 0) return;\n reg.open.push(entry);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction unregisterOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n const i = reg.open.indexOf(entry);\n if (i < 0) return;\n reg.open.splice(i, 1);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction isBlockedByOpenImporter(entry: OpenImporterEntry): boolean {\n const reg = openImporters();\n return reg.open.length > 0 && reg.open.indexOf(entry) < 0;\n}\n\nfunction subscribeOpenImporters(fn: () => void): () => void {\n const reg = openImporters();\n reg.listeners.push(fn);\n return () => {\n const i = reg.listeners.indexOf(fn);\n if (i >= 0) reg.listeners.splice(i, 1);\n };\n}\n\nconst appVersion = '1.1.20';\n\n@Component({\n selector: 'csvbox-button',\n template: `\n <div>\n <button [disabled]=\"disabled || blockedByOther\" (click)=\"openModal()\" [attr.data-csvbox-token]=\"uuid\">\n <ng-content></ng-content>\n </button>\n </div>\n `\n})\n\nexport class CSVBoxButtonComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n\n isModalShown = false;\n\n @Input() onImport?: Function;\n @Input() onReady?: Function;\n @Input() onClose?: Function;\n @Input() onSubmit?: Function;\n\n @Input() isImported?: Function;\n @Input() isReady?: Function;\n @Input() isClosed?: Function;\n @Input() isSubmitted?: Function;\n\n @Input() importerReady?: Function;\n @Input() closed?: Function;\n @Input() submitted?: Function;\n @Input() imported?: Function;\n @Input() loadStarted?: Function;\n\n @Input() user?: object;\n @Input() dynamicColumns?: object;\n @Input() licenseKey: string | null = null;\n @Input() options?: object;\n @Input() uuid: string | null = null;\n @Input() customDomain: string | null = null;\n @Input() dataLocation: string | null = null;\n @Input() language: string | null = null;\n @Input() environment?: object;\n\n @Input() theme: string | null = null;\n\n @Input() isIframeLoaded: boolean = false;\n @Input() openModalOnIframeLoad: boolean = false;\n\n @Input() lazy: boolean = false;\n\n safeUrl: any;\n\n iframe: HTMLIFrameElement | null = null;\n\n @Input() disabled: boolean = true;\n\n constructor(public sanitizer:DomSanitizer, private cdr: ChangeDetectorRef, private zone: NgZone) {}\n\n // True while a different importer on the page is open: the button stays disabled.\n blockedByOther: boolean = false;\n\n private registryEntry: OpenImporterEntry = { getHolder: () => this.holder };\n\n private fileSender = createFileSender({\n getIframe: () => this.iframe,\n getToken: () => this.uuid as string,\n getTargetOrigin: () => this.targetOrigin as string,\n getBaseDomain: () => this.baseDomain,\n takeFile: () => {\n const file = this.pendingFile;\n this.pendingFile = null;\n return file;\n },\n onSent: () => this.startFileAckTimer()\n });\n\n private unsubscribeOpenImporters: (() => void) | null = null;\n\n holder: any;\n\n pendingFile: File | null = null;\n\n targetOrigin: string | undefined;\n\n // Data-location sheets redirect to another host, so the iframe origin can differ from\n // targetOrigin. baseDomain is used to check the real origin before trusting it.\n baseDomain: string = \"app.csvbox.io\";\n\n private fileAckTimer: any = null;\n\n ngOnInit(): void {\n this.uuid = generateUuid();\n let iframeUrl = buildImportUrl(\n {\n licenseKey: this.licenseKey,\n customDomain: this.customDomain,\n dataLocation: this.dataLocation,\n language: this.language,\n theme: this.theme,\n environment: this.environment\n },\n \"angular\",\n appVersion\n );\n // Default place to send the file. A file is only ever sent to a named origin, never \"*\".\n this.targetOrigin = new URL(iframeUrl).origin;\n this.baseDomain = this.customDomain || \"app.csvbox.io\";\n this.safeUrl = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.sanitizer.bypassSecurityTrustResourceUrl(iframeUrl));\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(changes[\"user\"] && changes['user'].currentValue != changes['user'].previousValue) {\n this.updateUserVariabe(changes['user'].currentValue);\n }\n }\n\n updateUserVariabe(data: any): void {\n this.user = data;\n if (this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage({\n \"customer\" : data\n }, \"*\");\n }\n }\n\n private messageListener = (event: MessageEvent) => {\n // Older importers send these as bare strings, without a token.\n const legacy = classifyLegacyMessage(event.data);\n if (legacy) {\n // Legacy messages carry no token, so the only way to tell which importer sent one is its\n // window. Ignore those that came from another instance's iframe (or anywhere else).\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n if (legacy.type === \"mainModalHidden\") {\n this.handleModalClosed();\n } else if (legacy.type === \"uploadSuccessful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (legacy.type === \"uploadFailed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n return;\n }\n\n // Set-file handshake messages. The shared core does not classify these, so they are\n // read here, behind the same unique_token check the core applies.\n const raw = event.data;\n if (raw && typeof raw === \"object\" && raw.data && raw.data.unique_token == this.uuid) {\n this.fileSender.learnOrigin(event);\n\n if (raw.type === \"csvbox-set-file-rejected\" && raw.data.reason === \"not-a-file\") {\n // Reply to our probe (it has no file). It only tells us the origin, so do nothing.\n return;\n }\n if (raw.type === \"csvbox-modal-shown\") {\n this.clearFileAckTimer();\n registerOpenImporter(this.registryEntry);\n // What the file path in openModal() is waiting for. display as well as\n // pointer-events: a second file declined while the first was still opening the\n // modal has put the holder away in the meantime.\n this.isModalShown = true;\n if (this.holder) {\n this.holder.style.display = 'block';\n this.holder.style.pointerEvents = 'auto';\n }\n return;\n }\n if (raw.type === \"csvbox-set-file-rejected\") {\n this.clearFileAckTimer();\n // The importer has the file and will not take it. Put the holder away only if the\n // modal was never confirmed up: a file declined while it is open leaves that modal\n // where it is, and its own 'csvbox-modal-hidden' will put the holder away.\n if (!this.isModalShown && this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n unregisterOpenImporter(this.registryEntry);\n }\n console.warn(\"[csvbox] importer declined the supplied file: \" + raw.data.reason);\n return;\n }\n }\n\n let message = classifyStructuredMessage(event.data, this.uuid!);\n if (!message) {\n return;\n }\n\n if (message.type === \"data-on-submit\") {\n if (this.onSubmit) this.onSubmit(message.metadata);\n if (this.isSubmitted) this.isSubmitted(message.metadata);\n if (this.submitted) this.submitted(message.metadata);\n } else if (message.type === \"data-push-status\") {\n if (!message.success) {\n delete message.metadata[\"unique_token\"];\n }\n if (this.onImport) this.onImport(message.success, message.metadata);\n if (this.isImported) this.isImported(message.success, message.metadata);\n if (this.imported) this.imported(message.success, message.metadata);\n } else if (message.type === \"csvbox-modal-hidden\") {\n this.handleModalClosed();\n } else if (message.type === \"csvbox-upload-successful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (message.type === \"csvbox-upload-failed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n };\n\n ngAfterContentInit(): void {\n window.addEventListener(\"message\", this.messageListener, false);\n this.syncBlocked();\n this.unsubscribeOpenImporters = subscribeOpenImporters(() => this.syncBlocked());\n\n if(this.lazy) {\n this.disabled = false;\n } else {\n this.disabled = true;\n this.initImporter();\n }\n }\n\n handleModalClosed(): void {\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n }\n this.isModalShown = false;\n this.isIframeLoaded = false;\n this.openModalOnIframeLoad = false;\n if (this.holder) this.holder.remove();\n this.holder = null;\n this.iframe = null;\n // A new iframe is built on the next open, so the origin is learned again.\n this.clearProbeTimer();\n unregisterOpenImporter(this.registryEntry);\n if (this.onClose) this.onClose();\n if (this.isClosed) this.isClosed();\n if (this.closed) this.closed();\n }\n\n initImporter() {\n if (this.loadStarted) this.loadStarted();\n\n this.uuid = generateUuid();\n\n insertCSS();\n\n let iframe = document.createElement(\"iframe\");\n this.iframe = iframe;\n iframe.setAttribute(\"src\", this.safeUrl);\n iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write *\");\n iframe.frameBorder = \"0\";\n\n let self = this;\n iframe.onload = function () {\n if (self.onReady) self.onReady();\n if (self.isReady) self.isReady();\n if (self.importerReady) self.importerReady();\n\n self.disabled = false;\n self.isIframeLoaded = true;\n if (self.iframe && self.iframe.contentWindow) {\n self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, self.uuid!), \"*\");\n }\n if(self.openModalOnIframeLoad) {\n self.openModal();\n }\n }\n\n this.holder = document.createElement('div');\n this.holder.classList.add('csvbox-holder');\n this.holder.setAttribute('id', `csvbox-embed-${this.uuid}`);\n this.holder.appendChild(iframe);\n\n document.body.insertAdjacentElement(\n 'beforeend', this.holder\n );\n // The holder did not exist yet if openModal() asked for the importer before it was built.\n restackOpenImporters(openImporters());\n }\n\n openModal(): void {\n // Counts as open from the moment it is requested, so the other buttons are disabled while\n // this importer is still loading, and so it is stacked above any importer opened earlier.\n registerOpenImporter(this.registryEntry);\n if(!this.iframe) {\n this.openModalOnIframeLoad = true;\n this.initImporter();\n return;\n }\n if(!this.isModalShown) {\n if(this.isIframeLoaded) {\n if(this.pendingFile) {\n // The importer opens its own modal once it has the file, so that it can inject on\n // 'shown.bs.modal'. Sending 'openModal' as well would race that.\n //\n // It can also decline: wrong step, an import file URL configured on the sheet, or\n // an importer too old to know the message at all. So the holder goes up\n // click-through and stays that way until 'csvbox-modal-shown' confirms the modal\n // is really up. It covers the viewport at z-index 2147483647 and the importer\n // renders transparent with its modal closed, so arming it on an unanswered message\n // leaves an invisible sheet over the host page eating every click.\n //\n // display:block regardless, so the iframe lays out and animates normally; only\n // pointer-events is held back. isModalShown likewise waits for the confirmation,\n // or a declined file would latch the importer shut for good.\n if(this.holder) {\n this.holder.style.pointerEvents = 'none';\n this.holder.style.display = 'block';\n }\n this.fileSender.send();\n } else {\n this.isModalShown = true;\n if(this.holder) {\n // Explicit: a previously declined file leaves the holder click-through.\n this.holder.style.pointerEvents = 'auto';\n this.holder.style.display = 'block';\n }\n if(this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage('openModal', '*');\n }\n }\n } else {\n this.openModalOnIframeLoad = true;\n }\n }\n }\n\n /**\n * Open the importer on a File the host page already has, instead of the file picker.\n *\n * Reachable through a template reference (`#importer` then `importer.openModalWithFile(file)`)\n * or `@ViewChild(CSVBoxButtonComponent)`.\n *\n * The File crosses to the iframe by structured clone, so the importer receives the real\n * object and applies its own extension, worksheet and size rules to it -- this does not\n * bypass any of them. Pass a File; a Blob has no name for the importer to read an\n * extension from.\n */\n openModalWithFile(file: File): void {\n if(typeof File === 'undefined' || !(file instanceof File)) {\n return;\n }\n\n this.pendingFile = file;\n\n // Already open: hand it over now rather than holding it for the next open. The importer\n // takes it only while it is still on the upload step, and ignores it once the user has a\n // dataset and a mapping in progress.\n if(this.isModalShown && this.iframe && this.isIframeLoaded) {\n this.fileSender.send();\n return;\n }\n\n this.openModal();\n }\n\n clearProbeTimer(): void {\n this.clearFileAckTimer();\n this.fileSender.reset();\n }\n\n startFileAckTimer(): void {\n this.clearFileAckTimer();\n this.fileAckTimer = setTimeout(() => {\n this.fileAckTimer = null;\n this.giveUpOnFile();\n }, FILE_ACK_TIMEOUT_MS);\n }\n\n clearFileAckTimer(): void {\n if (this.fileAckTimer) {\n clearTimeout(this.fileAckTimer);\n this.fileAckTimer = null;\n }\n }\n\n // The importer never confirmed the file it was sent (an origin we do not trust, or an importer too\n // old to know the message). Without this the holder would stay up, invisible and click-through,\n // and the other instances' buttons would stay disabled for good.\n giveUpOnFile(): void {\n if (this.isModalShown) {\n return;\n }\n const holder = this.holder;\n if (holder) {\n holder.style.display = 'none';\n holder.style.pointerEvents = 'auto';\n }\n unregisterOpenImporter(this.registryEntry);\n console.warn(\"[csvbox] the importer did not respond to the supplied file\");\n }\n\n private syncBlocked(): void {\n const blocked = isBlockedByOpenImporter(this.registryEntry);\n if (blocked !== this.blockedByOther) {\n // The registry can call back from outside Angular's zone (another instance, another app).\n this.zone.run(() => {\n this.blockedByOther = blocked;\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy(): void {\n this.clearProbeTimer();\n window.removeEventListener(\"message\", this.messageListener);\n unregisterOpenImporter(this.registryEntry);\n if (this.unsubscribeOpenImporters) {\n this.unsubscribeOpenImporters();\n this.unsubscribeOpenImporters = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CSVBoxButtonComponent } from './csvbox-button.component';\n\n\n\n@NgModule({\n declarations: [\n CSVBoxButtonComponent\n ],\n imports: [\n ],\n exports: [\n CSVBoxButtonComponent\n ]\n})\nexport class CSVBoxAngularModule { }\n","export interface CSVBoxMethods {\n onData?: (result:boolean, data:any) => void;\n}\n"],"names":[],"mappings":";;;;;;;;;;IAAI,YAA8B;;IAE5B,UAAU,GAAG,wPAiBlB;;AAED,IAAa,SA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G;IAKA;KAUoC;;gBAVnC,QAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,qBAAqB;qBACtB;oBACD,OAAO,EAAE,EACR;oBACD,OAAO,EAAE;wBACP,qBAAqB;qBACtB;iBACF;;IACkC,0BAAC;CAVpC;;;;;;;;;;ACLA,4BAEC;;;IADC,+BAA4C;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"sumit_yewale-angular.js","sources":["ng://@sumit_yewale/angular/utlis/insertCSS.ts","ng://@sumit_yewale/angular/lib/csvbox-button.component.ts","ng://@sumit_yewale/angular/lib/csvbox-angular.module.ts","ng://@sumit_yewale/angular/lib/interfaces/interface.ts"],"sourcesContent":["let styleElement: HTMLStyleElement\n\nconst GLOBAL_CSS = `\n.csvbox-holder {\n z-index: 2147483647;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n}\n.csvbox-holder iframe {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n`\n\nexport const insertCSS = (): void => {\n if (styleElement) {\n return\n }\n\n styleElement = document.createElement('style')\n styleElement.setAttribute('type', 'text/css')\n const head = document.querySelector('head');\n if (head) {\n head.appendChild(styleElement);\n }\n\n styleElement.textContent = GLOBAL_CSS\n}\n","import {\n Component,\n OnInit,\n Input,\n OnChanges,\n SimpleChanges,\n SecurityContext,\n AfterContentInit,\n OnDestroy,\n ChangeDetectorRef,\n NgZone\n} from '@angular/core';\n\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { insertCSS } from '../utlis/insertCSS';\nimport { buildImportUrl, generateUuid, buildInitPayload, createMessageGate, createImportTracker, createFileSender, classifyStructuredMessage, classifyLegacyMessage } from '@sumit_yewale/adapter-core';\n\n// How long we wait for the importer to confirm a file it was sent before giving up on it.\nconst FILE_ACK_TIMEOUT_MS = 8000;\n\n// Page-wide record of the importers that are open or opening, shared by every CSVBox adapter\n// on the page (it lives on window so separate copies of an adapter see the same list). It does\n// two things: the newest importer is stacked on top (every holder is fixed, full screen and\n// z-index 2147483647, so equal z-indexes would leave the one that comes first in the DOM on\n// top), and the other instances learn that an importer is open so they can disable their button.\ninterface OpenImporterEntry { getHolder: () => HTMLElement | null; }\ninterface OpenImporters { open: OpenImporterEntry[]; listeners: Array<() => void>; }\nconst OPEN_IMPORTERS_KEY = '__csvboxOpenImporters';\nconst TOP_Z_INDEX = 2147483647;\n\nfunction openImporters(): OpenImporters {\n const w = window as any;\n if (!w[OPEN_IMPORTERS_KEY]) w[OPEN_IMPORTERS_KEY] = { open: [], listeners: [] };\n return w[OPEN_IMPORTERS_KEY];\n}\n\nfunction restackOpenImporters(reg: OpenImporters): void {\n reg.open.forEach((entry, i) => {\n const holder = entry.getHolder();\n if (holder) holder.style.zIndex = String(TOP_Z_INDEX - (reg.open.length - 1 - i));\n });\n}\n\nfunction registerOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n if (reg.open.indexOf(entry) >= 0) return;\n reg.open.push(entry);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction unregisterOpenImporter(entry: OpenImporterEntry): void {\n const reg = openImporters();\n const i = reg.open.indexOf(entry);\n if (i < 0) return;\n reg.open.splice(i, 1);\n restackOpenImporters(reg);\n reg.listeners.slice().forEach(fn => fn());\n}\n\nfunction isBlockedByOpenImporter(entry: OpenImporterEntry): boolean {\n const reg = openImporters();\n return reg.open.length > 0 && reg.open.indexOf(entry) < 0;\n}\n\nfunction subscribeOpenImporters(fn: () => void): () => void {\n const reg = openImporters();\n reg.listeners.push(fn);\n return () => {\n const i = reg.listeners.indexOf(fn);\n if (i >= 0) reg.listeners.splice(i, 1);\n };\n}\n\nconst appVersion = '1.1.20';\n\n@Component({\n selector: 'csvbox-button',\n template: `\n <div>\n <button [disabled]=\"disabled || blockedByOther\" (click)=\"openModal()\" [attr.data-csvbox-token]=\"uuid\">\n <ng-content></ng-content>\n </button>\n </div>\n `\n})\n\nexport class CSVBoxButtonComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n\n isModalShown = false;\n\n @Input() onImport?: Function;\n @Input() onReady?: Function;\n @Input() onClose?: Function;\n @Input() onSubmit?: Function;\n\n @Input() isImported?: Function;\n @Input() isReady?: Function;\n @Input() isClosed?: Function;\n @Input() isSubmitted?: Function;\n\n @Input() importerReady?: Function;\n @Input() closed?: Function;\n @Input() submitted?: Function;\n @Input() imported?: Function;\n @Input() loadStarted?: Function;\n\n @Input() user?: object;\n @Input() dynamicColumns?: object;\n @Input() licenseKey: string | null = null;\n @Input() options?: object;\n @Input() uuid: string | null = null;\n @Input() customDomain: string | null = null;\n @Input() dataLocation: string | null = null;\n @Input() language: string | null = null;\n @Input() environment?: object;\n\n @Input() theme: string | null = null;\n\n @Input() isIframeLoaded: boolean = false;\n @Input() openModalOnIframeLoad: boolean = false;\n\n @Input() lazy: boolean = false;\n\n safeUrl: any;\n\n iframe: HTMLIFrameElement | null = null;\n\n @Input() disabled: boolean = true;\n\n constructor(public sanitizer:DomSanitizer, private cdr: ChangeDetectorRef, private zone: NgZone) {}\n\n // True while a different importer on the page is open: the button stays disabled.\n blockedByOther: boolean = false;\n\n private messageGate = createMessageGate();\n private importTracker = createImportTracker();\n\n private registryEntry: OpenImporterEntry = { getHolder: () => this.holder };\n\n private fileSender = createFileSender({\n getIframe: () => this.iframe,\n getToken: () => this.uuid as string,\n getTargetOrigin: () => this.targetOrigin as string,\n getBaseDomain: () => this.baseDomain,\n takeFile: () => {\n const file = this.pendingFile;\n this.pendingFile = null;\n return file;\n },\n onSent: () => this.startFileAckTimer()\n });\n\n private unsubscribeOpenImporters: (() => void) | null = null;\n\n holder: any;\n\n pendingFile: File | null = null;\n\n targetOrigin: string | undefined;\n\n // Data-location sheets redirect to another host, so the iframe origin can differ from\n // targetOrigin. baseDomain is used to check the real origin before trusting it.\n baseDomain: string = \"app.csvbox.io\";\n\n private fileAckTimer: any = null;\n\n ngOnInit(): void {\n this.uuid = generateUuid();\n let iframeUrl = buildImportUrl(\n {\n licenseKey: this.licenseKey,\n customDomain: this.customDomain,\n dataLocation: this.dataLocation,\n language: this.language,\n theme: this.theme,\n environment: this.environment\n },\n \"angular\",\n appVersion\n );\n // Default place to send the file. A file is only ever sent to a named origin, never \"*\".\n this.targetOrigin = new URL(iframeUrl).origin;\n this.baseDomain = this.customDomain || \"app.csvbox.io\";\n this.safeUrl = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.sanitizer.bypassSecurityTrustResourceUrl(iframeUrl));\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(changes[\"user\"] && changes['user'].currentValue != changes['user'].previousValue) {\n this.updateUserVariabe(changes['user'].currentValue);\n }\n }\n\n updateUserVariabe(data: any): void {\n this.user = data;\n if (this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage({\n \"customer\" : data\n }, \"*\");\n }\n }\n\n private messageListener = (event: MessageEvent) => {\n // Older importers send these as bare strings, without a token.\n const legacy = classifyLegacyMessage(event.data);\n if (legacy) {\n // Legacy messages carry no token, so the only way to tell which importer sent one is its\n // window. Ignore those that came from another instance's iframe (or anywhere else).\n if (!this.iframe || event.source !== this.iframe.contentWindow) {\n return;\n }\n // A newer importer sends the typed message as well; act on that one only.\n if (!this.messageGate.allowLegacy()) {\n return;\n }\n const ended = this.importTracker.observe(legacy);\n if (legacy.type === \"mainModalHidden\") {\n this.handleModalClosed();\n } else if (legacy.type === \"uploadSuccessful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (legacy.type === \"uploadFailed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n this.finishImport(ended);\n return;\n }\n\n // Set-file handshake messages. The shared core does not classify these, so they are\n // read here, behind the same unique_token check the core applies.\n const raw = event.data;\n if (raw && typeof raw === \"object\" && raw.data && raw.data.unique_token == this.uuid) {\n this.fileSender.learnOrigin(event);\n\n if (raw.type === \"csvbox-set-file-rejected\" && raw.data.reason === \"not-a-file\") {\n // Reply to our probe (it has no file). It only tells us the origin, so do nothing.\n return;\n }\n if (raw.type === \"csvbox-modal-shown\") {\n this.clearFileAckTimer();\n registerOpenImporter(this.registryEntry);\n // What the file path in openModal() is waiting for. display as well as\n // pointer-events: a second file declined while the first was still opening the\n // modal has put the holder away in the meantime.\n this.isModalShown = true;\n if (this.holder) {\n this.holder.style.display = 'block';\n this.holder.style.pointerEvents = 'auto';\n }\n return;\n }\n if (raw.type === \"csvbox-set-file-rejected\") {\n this.clearFileAckTimer();\n // The importer has the file and will not take it. Put the holder away only if the\n // modal was never confirmed up: a file declined while it is open leaves that modal\n // where it is, and its own 'csvbox-modal-hidden' will put the holder away.\n if (!this.isModalShown && this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n unregisterOpenImporter(this.registryEntry);\n }\n console.warn(\"[csvbox] importer declined the supplied file: \" + raw.data.reason);\n return;\n }\n }\n\n let message = classifyStructuredMessage(event.data, this.uuid!);\n if (!message) {\n return;\n }\n this.messageGate.markTyped();\n const ended = this.importTracker.observe(message);\n\n if (message.type === \"data-on-submit\") {\n if (this.onSubmit) this.onSubmit(message.metadata);\n if (this.isSubmitted) this.isSubmitted(message.metadata);\n if (this.submitted) this.submitted(message.metadata);\n } else if (message.type === \"data-push-status\") {\n if (this.onImport) this.onImport(message.success, message.metadata);\n if (this.isImported) this.isImported(message.success, message.metadata);\n if (this.imported) this.imported(message.success, message.metadata);\n } else if (message.type === \"csvbox-modal-hidden\") {\n this.handleModalClosed();\n } else if (message.type === \"csvbox-upload-successful\") {\n if (this.onImport) this.onImport(true);\n if (this.isImported) this.isImported(true);\n if (this.imported) this.imported(true);\n } else if (message.type === \"csvbox-upload-failed\") {\n if (this.onImport) this.onImport(false);\n if (this.isImported) this.isImported(false);\n if (this.imported) this.imported(false);\n }\n this.finishImport(ended);\n };\n\n ngAfterContentInit(): void {\n window.addEventListener(\"message\", this.messageListener, false);\n this.syncBlocked();\n this.unsubscribeOpenImporters = subscribeOpenImporters(() => this.syncBlocked());\n\n if(this.lazy) {\n this.disabled = false;\n } else {\n this.disabled = true;\n this.initImporter();\n }\n }\n\n handleModalClosed(): void {\n if (this.importTracker.isInFlight()) {\n // Closed after submitting and before the result arrived: keep the iframe and its listener\n // so the late result still reaches onImport. It is removed once that result has been\n // delivered (see finishImport), so the next open is a fresh load.\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n }\n this.isModalShown = false;\n this.openModalOnIframeLoad = false;\n this.clearFileAckTimer();\n unregisterOpenImporter(this.registryEntry);\n } else {\n this.destroyImporter();\n }\n if (this.onClose) this.onClose();\n if (this.isClosed) this.isClosed();\n if (this.closed) this.closed();\n }\n\n // Called after the result of an import has been delivered. If the modal was closed in the\n // meantime the iframe was only hidden, so remove it now.\n private finishImport(ended: boolean): void {\n if (ended && !this.isModalShown && this.iframe) {\n this.destroyImporter();\n }\n }\n\n // Puts the importer away: the next open builds a new iframe with a new token.\n private destroyImporter(): void {\n if (this.holder) {\n this.holder.style.display = 'none';\n this.holder.style.pointerEvents = 'auto';\n this.holder.remove();\n }\n this.holder = null;\n this.iframe = null;\n this.isModalShown = false;\n this.isIframeLoaded = false;\n this.openModalOnIframeLoad = false;\n this.messageGate.reset();\n this.importTracker.reset();\n // A new iframe is built on the next open, so the origin is learned again.\n this.clearProbeTimer();\n unregisterOpenImporter(this.registryEntry);\n }\n\n initImporter() {\n if (this.loadStarted) this.loadStarted();\n\n this.uuid = generateUuid();\n this.messageGate.reset();\n this.importTracker.reset();\n\n insertCSS();\n\n let iframe = document.createElement(\"iframe\");\n this.iframe = iframe;\n iframe.setAttribute(\"src\", this.safeUrl);\n iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write *\");\n iframe.frameBorder = \"0\";\n\n let self = this;\n iframe.onload = function () {\n self.disabled = false;\n self.isIframeLoaded = true;\n // The handshake goes first: a consumer that calls openModalWithFile() from the ready\n // callback needs the importer to already have its customer, columns, options and token.\n if (self.iframe && self.iframe.contentWindow) {\n self.iframe.contentWindow.postMessage(buildInitPayload(self.user, self.dynamicColumns, self.options, self.uuid!), \"*\");\n }\n if (self.onReady) self.onReady();\n if (self.isReady) self.isReady();\n if (self.importerReady) self.importerReady();\n\n if(self.openModalOnIframeLoad) {\n self.openModal();\n }\n }\n\n this.holder = document.createElement('div');\n this.holder.classList.add('csvbox-holder');\n this.holder.setAttribute('id', `csvbox-embed-${this.uuid}`);\n this.holder.appendChild(iframe);\n\n document.body.insertAdjacentElement(\n 'beforeend', this.holder\n );\n // The holder did not exist yet if openModal() asked for the importer before it was built.\n restackOpenImporters(openImporters());\n }\n\n openModal(): void {\n // Counts as open from the moment it is requested, so the other buttons are disabled while\n // this importer is still loading, and so it is stacked above any importer opened earlier.\n registerOpenImporter(this.registryEntry);\n if(!this.iframe) {\n this.openModalOnIframeLoad = true;\n this.initImporter();\n return;\n }\n if(!this.isModalShown) {\n if(this.isIframeLoaded) {\n if(this.pendingFile) {\n // The importer opens its own modal once it has the file, so that it can inject on\n // 'shown.bs.modal'. Sending 'openModal' as well would race that.\n //\n // It can also decline: wrong step, an import file URL configured on the sheet, or\n // an importer too old to know the message at all. So the holder goes up\n // click-through and stays that way until 'csvbox-modal-shown' confirms the modal\n // is really up. It covers the viewport at z-index 2147483647 and the importer\n // renders transparent with its modal closed, so arming it on an unanswered message\n // leaves an invisible sheet over the host page eating every click.\n //\n // display:block regardless, so the iframe lays out and animates normally; only\n // pointer-events is held back. isModalShown likewise waits for the confirmation,\n // or a declined file would latch the importer shut for good.\n if(this.holder) {\n this.holder.style.pointerEvents = 'none';\n this.holder.style.display = 'block';\n }\n this.fileSender.send();\n } else {\n this.isModalShown = true;\n if(this.holder) {\n // Explicit: a previously declined file leaves the holder click-through.\n this.holder.style.pointerEvents = 'auto';\n this.holder.style.display = 'block';\n }\n if(this.iframe && this.iframe.contentWindow) {\n this.iframe.contentWindow.postMessage('openModal', '*');\n }\n }\n } else {\n this.openModalOnIframeLoad = true;\n }\n }\n }\n\n /**\n * Open the importer on a File the host page already has, instead of the file picker.\n *\n * Reachable through a template reference (`#importer` then `importer.openModalWithFile(file)`)\n * or `@ViewChild(CSVBoxButtonComponent)`.\n *\n * The File crosses to the iframe by structured clone, so the importer receives the real\n * object and applies its own extension, worksheet and size rules to it -- this does not\n * bypass any of them. Pass a File; a Blob has no name for the importer to read an\n * extension from.\n */\n openModalWithFile(file: File): void {\n if(typeof File === 'undefined' || !(file instanceof File)) {\n return;\n }\n\n this.pendingFile = file;\n\n // Already open: hand it over now rather than holding it for the next open. The importer\n // takes it only while it is still on the upload step, and ignores it once the user has a\n // dataset and a mapping in progress.\n if(this.isModalShown && this.iframe && this.isIframeLoaded) {\n this.fileSender.send();\n return;\n }\n\n this.openModal();\n }\n\n clearProbeTimer(): void {\n this.clearFileAckTimer();\n this.fileSender.reset();\n }\n\n startFileAckTimer(): void {\n this.clearFileAckTimer();\n this.fileAckTimer = setTimeout(() => {\n this.fileAckTimer = null;\n this.giveUpOnFile();\n }, FILE_ACK_TIMEOUT_MS);\n }\n\n clearFileAckTimer(): void {\n if (this.fileAckTimer) {\n clearTimeout(this.fileAckTimer);\n this.fileAckTimer = null;\n }\n }\n\n // The importer never confirmed the file it was sent (an origin we do not trust, or an importer too\n // old to know the message). Without this the holder would stay up, invisible and click-through,\n // and the other instances' buttons would stay disabled for good.\n giveUpOnFile(): void {\n if (this.isModalShown) {\n return;\n }\n const holder = this.holder;\n if (holder) {\n holder.style.display = 'none';\n holder.style.pointerEvents = 'auto';\n }\n unregisterOpenImporter(this.registryEntry);\n console.warn(\"[csvbox] the importer did not respond to the supplied file\");\n }\n\n private syncBlocked(): void {\n const blocked = isBlockedByOpenImporter(this.registryEntry);\n if (blocked !== this.blockedByOther) {\n // The registry can call back from outside Angular's zone (another instance, another app).\n this.zone.run(() => {\n this.blockedByOther = blocked;\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy(): void {\n window.removeEventListener(\"message\", this.messageListener);\n // Takes the holder out of document.body: left there, it would keep covering the page with\n // an invisible full-screen layer that nothing is left to hide.\n this.destroyImporter();\n if (this.unsubscribeOpenImporters) {\n this.unsubscribeOpenImporters();\n this.unsubscribeOpenImporters = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CSVBoxButtonComponent } from './csvbox-button.component';\n\n\n\n@NgModule({\n declarations: [\n CSVBoxButtonComponent\n ],\n imports: [\n ],\n exports: [\n CSVBoxButtonComponent\n ]\n})\nexport class CSVBoxAngularModule { }\n","export interface CSVBoxMethods {\n onData?: (result:boolean, data:any) => void;\n}\n"],"names":[],"mappings":";;;;;;;;;;IAAI,YAA8B;;IAE5B,UAAU,GAAG,wPAiBlB;;AAED,IAAa,SAAS;;;AAAG;IACvB,IAAI,YAAY,EAAE;QAChB,OAAM;KACP;IAED,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9C,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;;QACvC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;IAC3C,IAAI,IAAI,EAAE;QACR,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;KAChC;IAED,YAAY,CAAC,WAAW,GAAG,UAAU,CAAA;CACtC,CAAA;;;;;;;AClCD;;IAkBM,mBAAmB,GAAG,IAAI;;;;AAOhC,gCAAoE;;;IAAtC,sCAAoC;;;;;AAClE,4BAAoF;;;IAA1D,6BAA0B;;IAAC,kCAA6B;;;IAC5E,kBAAkB,GAAG,uBAAuB;;IAC5C,WAAW,GAAG,UAAU;;;;AAE9B,SAAS,aAAa;;QACd,CAAC,sBAAG,MAAM,EAAO;IACvB,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAAE,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAChF,OAAO,CA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4CAA8B;;IAE9B,sCAAqC;;IAErC,+CAAyC;;IACzC,sDAAgD;;IAEhD,qCAA+B;;IAE/B,wCAAa;;IAEb,uCAAwC;;IAExC,yCAAkC;;IAKlC,+CAAgC;;;;;IAEhC,4CAA0C;;;;;IAC1C,8CAA8C;;;;;IAE9C,8CAA4E;;;;;IAE5E,2CAWG;;;;;IAEH,yDAA6D;;IAE7D,uCAAY;;IAEZ,4CAAgC;;IAEhC,6CAAiC;;IAIjC,2CAAqC;;;;;IAErC,6CAAiC;;;;;IAqCjC,gDA8FE;;IAtKU,0CAA6B;;;;;IAAE,oCAA8B;;;;;IAAE,qCAAoB;;;;;;;;AClIjG;IAKA;KAUoC;;gBAVnC,QAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,qBAAqB;qBACtB;oBACD,OAAO,EAAE,EACR;oBACD,OAAO,EAAE;wBACP,qBAAqB;qBACtB;iBACF;;IACkC,0BAAC;CAVpC;;;;;;;;;;ACLA,4BAEC;;;IADC,+BAA4C;;;;;;;;;;;;;;;;;"}
@@ -36,6 +36,8 @@ export declare class CSVBoxButtonComponent implements OnInit, OnChanges, AfterCo
36
36
  disabled: boolean;
37
37
  constructor(sanitizer: DomSanitizer, cdr: ChangeDetectorRef, zone: NgZone);
38
38
  blockedByOther: boolean;
39
+ private messageGate;
40
+ private importTracker;
39
41
  private registryEntry;
40
42
  private fileSender;
41
43
  private unsubscribeOpenImporters;
@@ -50,6 +52,8 @@ export declare class CSVBoxButtonComponent implements OnInit, OnChanges, AfterCo
50
52
  private messageListener;
51
53
  ngAfterContentInit(): void;
52
54
  handleModalClosed(): void;
55
+ private finishImport;
56
+ private destroyImporter;
53
57
  initImporter(): void;
54
58
  openModal(): void;
55
59
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sumit_yewale/angular",
3
- "version": "1.1.20",
3
+ "version": "1.1.21-fix.1",
4
4
  "description": "Angular adapter for csvbox.io",
5
5
  "author": "csvbox-io",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "tslib": "^2.0.0",
17
- "@sumit_yewale/adapter-core": "^0.1.0"
17
+ "@sumit_yewale/adapter-core": "^0.2.0"
18
18
  },
19
19
  "keywords": [
20
20
  "csv",