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IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAIjC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,KAAK,IAAI;IAI/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;IAmD/C,WAAW;IA+BX,QAAQ,CAAC,KAAK,EAAE,MAAM;IAUtB,QAAQ;IAKR,QAAQ,CAAC,KAAK,EAAE,MAAM;IAetB,QAAQ;IAKR,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAgBrC,OAAO;IAMP,WAAW,CAAC,WAAW,EAAE,MAAM;IAuB/B,WAAW,CAAC,SAAS,UAAQ;IAY7B,QAAQ;IAgBR,IAAI,CAAC,IAAI,UAAO;IAYhB,IAAI;IAIJ,KAAK,CAAC,IAAI,UAAO;IAYjB,OAAO;IAIP,QAAQ,CAAC,SAAS,EAAE,MAAM;IAI1B,KAAK,CAAC,KAAK,EAAE,OAAO;CAqBrB","sources":["src/src/index.ts","src/index.ts"],"sourcesContent":[null,"import Sortable from \"sortablejs\";\r\n// @ts-ignore\r\nimport styles from \"bundle-text:./style.css\";\r\n\r\nif (!document) {\r\n throw Error(\"electron-tabs module must be called in renderer process\");\r\n}\r\n\r\ninterface TabGroupOptions {\r\n closeButtonText: string,\r\n defaultTab: TabOptions | ((tabGroup: TabGroup) => TabOptions),\r\n newTabButton: boolean,\r\n newTabButtonText: string,\r\n sortable: boolean,\r\n sortableOptions?: Sortable.Options\r\n visibilityThreshold: number,\r\n}\r\n\r\ninterface TabOptions {\r\n active?: boolean;\r\n badge?: string;\r\n closable?: boolean;\r\n icon?: string;\r\n iconURL?: string;\r\n ready?: ((tab: Tab) => void);\r\n src?: string;\r\n title?: string;\r\n visible?: boolean;\r\n webviewAttributes?: { [key: string]: any };\r\n}\r\n\r\nconst CLASSNAMES = {\r\n ROOT: \"tabgroup\",\r\n NAV: \"nav\",\r\n TABS: \"tabs\",\r\n TAB: \"tab\",\r\n BUTTONS: \"buttons\",\r\n VIEWS: \"views\",\r\n VIEW: \"view\"\r\n}\r\n\r\nfunction emit(emitter: TabGroup | Tab, type: string, args: any[]) {\r\n if (type === \"ready\") {\r\n emitter.isReady = true;\r\n }\r\n emitter.dispatchEvent(new CustomEvent(type, { detail: args }));\r\n}\r\n\r\nfunction on(emitter: TabGroup | Tab, type: string, fn: (detail: string) => void, options?: { [key: string]: any }) {\r\n if (type === \"ready\" && emitter.isReady === true) {\r\n fn.apply(emitter, [emitter]);\r\n }\r\n emitter.addEventListener(type, ((e: CustomEvent) => fn.apply(emitter, e.detail)) as EventListener, options);\r\n}\r\n\r\nclass TabGroup extends HTMLElement {\r\n buttonContainer: HTMLDivElement;\r\n isReady: boolean;\r\n newTabId: number;\r\n options: TabGroupOptions;\r\n shadow: ShadowRoot;\r\n tabContainer: HTMLDivElement;\r\n tabs: Array<Tab>;\r\n viewContainer: HTMLDivElement;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.isReady = false;\r\n\r\n // Options\r\n this.options = {\r\n closeButtonText: this.getAttribute(\"close-button-text\") || \"&#215;\",\r\n defaultTab: { title: \"New Tab\", active: true },\r\n newTabButton: !!this.getAttribute(\"new-tab-button\") === true || false,\r\n newTabButtonText: this.getAttribute(\"new-tab-button-text\") || \"&#65291;\",\r\n sortable: !!this.getAttribute(\"sortable\") === true || false,\r\n visibilityThreshold: Number(this.getAttribute(\"visibility-threshold\")) || 0\r\n };\r\n\r\n this.tabs = [];\r\n this.newTabId = 0;\r\n\r\n this.createComponent();\r\n this.initVisibility();\r\n if (this.options.sortable) {\r\n this.initSortable();\r\n }\r\n\r\n this.emit(\"ready\", this);\r\n }\r\n\r\n emit(type: string, ...args: any[]) {\r\n return emit(this, type, args);\r\n }\r\n\r\n on(type: string, fn: (...detail: any[]) => void) {\r\n return on(this, type, fn);\r\n }\r\n\r\n once(type: string, fn: (detail: string) => void) {\r\n return on(this, type, fn, { once: true });\r\n }\r\n\r\n connectedCallback() {\r\n // Support custom styles\r\n const style = this.querySelector(\"style\");\r\n if (style) {\r\n this.shadow.appendChild(style);\r\n }\r\n }\r\n\r\n private createComponent() {\r\n const shadow = this.attachShadow({mode: \"open\"});\r\n this.shadow = shadow;\r\n\r\n const wrapper = document.createElement(\"div\");\r\n wrapper.setAttribute(\"class\", CLASSNAMES.ROOT);\r\n\r\n const tabgroup = document.createElement(\"nav\");\r\n tabgroup.setAttribute(\"class\", CLASSNAMES.NAV);\r\n wrapper.appendChild(tabgroup);\r\n\r\n const tabContainer = document.createElement(\"div\");\r\n tabContainer.setAttribute(\"class\", CLASSNAMES.TABS);\r\n tabgroup.appendChild(tabContainer);\r\n this.tabContainer = tabContainer;\r\n\r\n const buttonContainer = document.createElement(\"div\");\r\n buttonContainer.setAttribute(\"class\", CLASSNAMES.BUTTONS);\r\n tabgroup.appendChild(buttonContainer);\r\n this.buttonContainer = buttonContainer;\r\n\r\n if (this.options.newTabButton) {\r\n const button = this.buttonContainer.appendChild(document.createElement(\"button\"));\r\n button.innerHTML = this.options.newTabButtonText;\r\n button.addEventListener(\"click\", this.addTab.bind(this, undefined), false);\r\n }\r\n\r\n const viewContainer = document.createElement(\"div\");\r\n viewContainer.setAttribute(\"class\", CLASSNAMES.VIEWS);\r\n wrapper.appendChild(viewContainer);\r\n this.viewContainer = viewContainer;\r\n\r\n const style = document.createElement(\"style\");\r\n style.textContent = styles;\r\n\r\n shadow.appendChild(style);\r\n shadow.appendChild(wrapper);\r\n }\r\n\r\n private initVisibility() {\r\n function toggleTabsVisibility(tab: Tab, tabGroup: TabGroup) {\r\n const visibilityThreshold = this.options.visibilityThreshold;\r\n const el = tabGroup.tabContainer.parentElement;\r\n if (this.tabs.length >= visibilityThreshold) {\r\n el.classList.add(\"visible\");\r\n } else {\r\n el.classList.remove(\"visible\");\r\n }\r\n }\r\n\r\n this.on(\"tab-added\", toggleTabsVisibility);\r\n this.on(\"tab-removed\", toggleTabsVisibility);\r\n }\r\n\r\n initSortable() {\r\n const createNewSortable = () => {\r\n const options = Object.assign({\r\n direction: \"horizontal\",\r\n animation: 150,\r\n swapThreshold: 0.20\r\n }, this.options.sortableOptions);\r\n new Sortable(this.tabContainer, options);\r\n };\r\n\r\n if (Sortable) {\r\n createNewSortable();\r\n } else {\r\n document.addEventListener(\"DOMContentLoaded\", createNewSortable);\r\n }\r\n }\r\n\r\n setDefaultTab(tab: TabOptions) {\r\n this.options.defaultTab = tab;\r\n }\r\n\r\n addTab(args = this.options.defaultTab) {\r\n if (typeof args === \"function\") {\r\n args = args(this);\r\n }\r\n const id = this.newTabId;\r\n this.newTabId++;\r\n const tab = new Tab(this, id, args);\r\n this.tabs.push(tab);\r\n // Don't call tab.activate() before a tab is referenced in this.tabs\r\n if (args.active === true) {\r\n tab.activate();\r\n }\r\n this.emit(\"tab-added\", tab, this);\r\n return tab;\r\n }\r\n\r\n getTab(id: number) {\r\n for (let i in this.tabs) {\r\n if (this.tabs[i].id === id) {\r\n return this.tabs[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n getTabByPosition(position: number) {\r\n const fromRight = position < 0;\r\n for (let i in this.tabs) {\r\n if (this.tabs[i].getPosition(fromRight) === position) {\r\n return this.tabs[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n getTabByRelPosition(position: number) {\r\n position = this.getActiveTab().getPosition() + position;\r\n if (position <= 0) {\r\n return null;\r\n }\r\n return this.getTabByPosition(position);\r\n }\r\n\r\n getNextTab() {\r\n return this.getTabByRelPosition(1);\r\n }\r\n\r\n getPreviousTab() {\r\n return this.getTabByRelPosition(-1);\r\n }\r\n\r\n getTabs() {\r\n return this.tabs.slice();\r\n }\r\n\r\n eachTab(fn: (tab: Tab) => void) {\r\n this.getTabs().forEach(fn);\r\n }\r\n\r\n getActiveTab() {\r\n if (this.tabs.length === 0) return null;\r\n return this.tabs[0];\r\n }\r\n\r\n setActiveTab(tab: Tab) {\r\n this.removeTab(tab);\r\n this.tabs.unshift(tab);\r\n this.emit(\"tab-active\", tab, this);\r\n }\r\n\r\n removeTab(tab: Tab, triggerEvent = false) {\r\n const id = tab.id;\r\n const index = this.tabs.findIndex((t: Tab) => t.id === id);\r\n this.tabs.splice(index, 1);\r\n if (triggerEvent) {\r\n this.emit(\"tab-removed\", tab, this);\r\n }\r\n }\r\n\r\n activateRecentTab() {\r\n if (this.tabs.length > 0) {\r\n this.tabs[0].activate();\r\n }\r\n }\r\n}\r\n\r\nclass Tab extends EventTarget {\r\n badge: string;\r\n closable: boolean;\r\n icon: string;\r\n iconURL: string;\r\n id: number;\r\n isClosed: boolean;\r\n isReady: boolean;\r\n tab: HTMLDivElement;\r\n tabElements: { [key: string]: HTMLSpanElement };\r\n tabGroup: TabGroup;\r\n title: string;\r\n webview: HTMLElement;\r\n webviewAttributes: { [key: string]: any };\r\n\r\n constructor(tabGroup: TabGroup, id: number, args: TabOptions) {\r\n super();\r\n this.badge = args.badge;\r\n this.closable = args.closable === false ? false : true;\r\n this.icon = args.icon;\r\n this.iconURL = args.iconURL;\r\n this.id = id;\r\n this.isClosed = false;\r\n this.isReady = false;\r\n this.tabElements = {};\r\n this.tabGroup = tabGroup;\r\n this.title = args.title;\r\n this.webviewAttributes = args.webviewAttributes || {};\r\n this.webviewAttributes.src = args.src;\r\n\r\n this.initTab();\r\n this.initWebview();\r\n\r\n if (args.visible !== false) {\r\n this.show();\r\n }\r\n if (typeof args.ready === \"function\") {\r\n args.ready(this);\r\n } else {\r\n this.emit(\"ready\", this);\r\n }\r\n }\r\n\r\n emit(type: string, ...args: any[]) {\r\n return emit(this, type, args);\r\n }\r\n\r\n on(type: string, fn: (...detail: any[]) => void) {\r\n return on(this, type, fn);\r\n }\r\n\r\n once(type: string, fn: (detail: string) => void) {\r\n return on(this, type, fn, { once: true });\r\n }\r\n\r\n private initTab() {\r\n const tab = this.tab = document.createElement(\"div\");\r\n tab.classList.add(CLASSNAMES.TAB);\r\n for (let el of [\"icon\", \"title\", \"close\", \"badge\"]) {\r\n const span = tab.appendChild(document.createElement(\"span\"));\r\n span.classList.add(`${CLASSNAMES.TAB}-${el}`);\r\n this.tabElements[el] = span;\r\n }\r\n\r\n this.setTitle(this.title);\r\n this.setBadge(this.badge);\r\n this.setIcon(this.iconURL, this.icon);\r\n this.initTabCloseButton();\r\n this.initTabClickHandler();\r\n\r\n this.tabGroup.tabContainer.appendChild(this.tab);\r\n }\r\n\r\n private initTabCloseButton() {\r\n const container = this.tabElements.close;\r\n if (this.closable) {\r\n const button = container.appendChild(document.createElement(\"button\"));\r\n button.innerHTML = this.tabGroup.options.closeButtonText;\r\n button.addEventListener(\"click\", this.close.bind(this, false), false);\r\n }\r\n }\r\n\r\n private initTabClickHandler() {\r\n // Mouse up\r\n const tabClickHandler = function(e: KeyboardEvent) {\r\n if (this.isClosed) return;\r\n if (e.which === 2) {\r\n this.close();\r\n }\r\n };\r\n this.tab.addEventListener(\"mouseup\", tabClickHandler.bind(this), false);\r\n // Mouse down\r\n const tabMouseDownHandler = function(e: KeyboardEvent) {\r\n if (this.isClosed) return;\r\n if (e.which === 1) {\r\n if ((e.target as HTMLElement).matches(\"button\")) return;\r\n this.activate();\r\n }\r\n };\r\n this.tab.addEventListener(\"mousedown\", tabMouseDownHandler.bind(this), false);\r\n }\r\n\r\n initWebview() {\r\n const webview = this.webview = document.createElement(\"webview\");\r\n\r\n const tabWebviewDidFinishLoadHandler = function(e: Event) {\r\n this.emit(\"webview-ready\", this);\r\n };\r\n\r\n this.webview.addEventListener(\"did-finish-load\", tabWebviewDidFinishLoadHandler.bind(this), false);\r\n\r\n const tabWebviewDomReadyHandler = function(e: Event) {\r\n // Remove this once https://github.com/electron/electron/issues/14474 is fixed\r\n webview.blur();\r\n webview.focus();\r\n this.emit(\"webview-dom-ready\", this);\r\n };\r\n\r\n this.webview.addEventListener(\"dom-ready\", tabWebviewDomReadyHandler.bind(this), false);\r\n\r\n this.webview.classList.add(CLASSNAMES.VIEW);\r\n if (this.webviewAttributes) {\r\n const attrs = this.webviewAttributes;\r\n for (let key in attrs) {\r\n const attr = attrs[key];\r\n if (attr === false) continue;\r\n this.webview.setAttribute(key, attr);\r\n }\r\n }\r\n\r\n this.tabGroup.viewContainer.appendChild(this.webview);\r\n }\r\n\r\n setTitle(title: string) {\r\n if (this.isClosed) return;\r\n const span = this.tabElements.title;\r\n span.innerHTML = title;\r\n span.title = title;\r\n this.title = title;\r\n this.emit(\"title-changed\", title, this);\r\n return this;\r\n }\r\n\r\n getTitle() {\r\n if (this.isClosed) return;\r\n return this.title;\r\n }\r\n\r\n setBadge(badge: string) {\r\n if (this.isClosed) return;\r\n const span = this.tabElements.badge;\r\n this.badge = badge;\r\n\r\n if (badge) {\r\n span.innerHTML = badge;\r\n span.classList.remove(\"hidden\");\r\n } else {\r\n span.classList.add(\"hidden\");\r\n }\r\n\r\n this.emit(\"badge-changed\", badge, this);\r\n }\r\n\r\n getBadge() {\r\n if (this.isClosed) return;\r\n return this.badge;\r\n }\r\n\r\n setIcon(iconURL: string, icon: string) {\r\n if (this.isClosed) return;\r\n this.iconURL = iconURL;\r\n this.icon = icon;\r\n const span = this.tabElements.icon;\r\n if (iconURL) {\r\n span.innerHTML = `<img src=\"${iconURL}\" />`;\r\n this.emit(\"icon-changed\", iconURL, this);\r\n } else if (icon) {\r\n span.innerHTML = `<i class=\"${icon}\"></i>`;\r\n this.emit(\"icon-changed\", icon, this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getIcon() {\r\n if (this.isClosed) return;\r\n if (this.iconURL) return this.iconURL;\r\n return this.icon;\r\n }\r\n\r\n setPosition(newPosition: number) {\r\n const tabContainer = this.tabGroup.tabContainer;\r\n const length = tabContainer.childElementCount;\r\n const thisPosition = this.getPosition();\r\n const tabs = Array.from(tabContainer.children)\r\n tabs.splice(thisPosition, 1);\r\n\r\n if (newPosition < 0) {\r\n newPosition += length;\r\n if (newPosition < 0) {\r\n newPosition = 0;\r\n }\r\n }\r\n\r\n if (newPosition < length) {\r\n tabContainer.insertBefore(this.tab, tabs[newPosition]);\r\n } else {\r\n tabContainer.appendChild(this.tab);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getPosition(fromRight = false) {\r\n let position = 0;\r\n let tab = this.tab;\r\n while ((tab = tab.previousSibling as HTMLDivElement) != null) position++;\r\n\r\n if (fromRight === true) {\r\n position -= this.tabGroup.tabContainer.childElementCount;\r\n }\r\n\r\n return position;\r\n }\r\n\r\n activate() {\r\n if (this.isClosed) return;\r\n const activeTab = this.tabGroup.getActiveTab();\r\n if (activeTab) {\r\n activeTab.tab.classList.remove(\"active\");\r\n activeTab.webview.classList.remove(\"visible\");\r\n activeTab.emit(\"inactive\", activeTab);\r\n }\r\n this.tabGroup.setActiveTab(this);\r\n this.tab.classList.add(\"active\");\r\n this.webview.classList.add(\"visible\");\r\n this.webview.focus();\r\n this.emit(\"active\", this);\r\n return this;\r\n }\r\n\r\n show(flag = true) {\r\n if (this.isClosed) return;\r\n if (flag) {\r\n this.tab.classList.add(\"visible\");\r\n this.emit(\"visible\", this);\r\n } else {\r\n this.tab.classList.remove(\"visible\");\r\n this.emit(\"hidden\", this);\r\n }\r\n return this;\r\n }\r\n\r\n hide() {\r\n return this.show(false);\r\n }\r\n\r\n flash(flag = true) {\r\n if (this.isClosed) return;\r\n if (flag !== false) {\r\n this.tab.classList.add(\"flash\");\r\n this.emit(\"flash\", this);\r\n } else {\r\n this.tab.classList.remove(\"flash\");\r\n this.emit(\"unflash\", this);\r\n }\r\n return this;\r\n }\r\n\r\n unflash() {\r\n return this.flash(false);\r\n }\r\n\r\n hasClass(classname: string) {\r\n return this.tab.classList.contains(classname);\r\n }\r\n\r\n close(force: boolean) {\r\n const abortController = new AbortController();\r\n const abort = () => abortController.abort();\r\n this.emit(\"closing\", this, abort);\r\n\r\n const abortSignal = abortController.signal;\r\n if (this.isClosed || (!this.closable && !force) || abortSignal.aborted) return;\r\n\r\n this.isClosed = true;\r\n const tabGroup = this.tabGroup;\r\n tabGroup.tabContainer.removeChild(this.tab);\r\n tabGroup.viewContainer.removeChild(this.webview);\r\n const activeTab = this.tabGroup.getActiveTab();\r\n tabGroup.removeTab(this, true);\r\n\r\n this.emit(\"close\", this);\r\n\r\n if (activeTab.id === this.id) {\r\n tabGroup.activateRecentTab();\r\n }\r\n }\r\n}\r\n\r\ncustomElements.define(\"tab-group\", TabGroup);\r\n\r\nexport type { TabGroup, Tab };\r\n"],"names":[],"version":3,"file":"electron-tabs.d.ts.map","sourceRoot":"../"}