mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							41 lines
						
					
					
						
							1.2 KiB
						
					
					
				
			
		
		
	
	
							41 lines
						
					
					
						
							1.2 KiB
						
					
					
				| import '@hotwired/turbo-rails'
 | |
| 
 | |
| import { createApp, reactive } from 'vue'
 | |
| 
 | |
| import ToggleVisible from './elements/toggle_visible'
 | |
| import DisableHidden from './elements/disable_hidden'
 | |
| import TurboModal from './elements/turbo_modal'
 | |
| import FileDropzone from './elements/file_dropzone'
 | |
| import MenuActive from './elements/menu_active'
 | |
| 
 | |
| import TemplateBuilder from './template_builder/builder'
 | |
| 
 | |
| document.addEventListener('turbo:before-cache', () => {
 | |
|   window.flash?.remove()
 | |
| })
 | |
| 
 | |
| window.customElements.define('toggle-visible', ToggleVisible)
 | |
| window.customElements.define('disable-hidden', DisableHidden)
 | |
| window.customElements.define('turbo-modal', TurboModal)
 | |
| window.customElements.define('file-dropzone', FileDropzone)
 | |
| window.customElements.define('menu-active', MenuActive)
 | |
| 
 | |
| window.customElements.define('template-builder', class extends HTMLElement {
 | |
|   connectedCallback () {
 | |
|     this.appElem = document.createElement('div')
 | |
| 
 | |
|     this.app = createApp(TemplateBuilder, {
 | |
|       template: reactive(JSON.parse(this.dataset.template))
 | |
|     })
 | |
| 
 | |
|     this.app.mount(this.appElem)
 | |
| 
 | |
|     this.appendChild(this.appElem)
 | |
|   }
 | |
| 
 | |
|   disconnectedCallback () {
 | |
|     this.app?.unmount()
 | |
|     this.appElem?.remove()
 | |
|   }
 | |
| })
 |