| 1 |
/* eslint no-unused-vars: "off" */ |
| 2 |
import { createApp } from 'vue' |
| 3 |
import { createPinia } from 'pinia' |
| 4 |
import App from '../../../views/admin/App.vue' |
| 5 |
import router from '@/router' |
| 6 |
import 'maz-ui/styles' |
| 7 |
import 'element-plus/dist/index.css' |
| 8 |
import { useLabelsStore } from '@/stores/labels' |
| 9 |
import { useLabels } from '@/composables/useLabels' |
| 10 |
|
| 11 |
declare global { |
| 12 |
interface Window { |
| 13 |
wp: { |
| 14 |
media: () => void |
| 15 |
open: () => void |
| 16 |
} |
| 17 |
wpIvyApiSettings: { |
| 18 |
root: string |
| 19 |
nonce: string |
| 20 |
namespace?: string |
| 21 |
} |
| 22 |
wpIvySettings: { |
| 23 |
general: { |
| 24 |
fullscreen: boolean |
| 25 |
version: string |
| 26 |
} |
| 27 |
} |
| 28 |
wpIvyUrls: { |
| 29 |
pluginURL: string |
| 30 |
siteURL: string |
| 31 |
} |
| 32 |
wpIvyDateFormat?: { |
| 33 |
dateFormat: string |
| 34 |
timeFormat: string |
| 35 |
dateTimeFormat: string |
| 36 |
locale: string |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
const app = createApp(App) |
| 42 |
const pinia = createPinia() |
| 43 |
app.use(pinia) |
| 44 |
app.use(router) |
| 45 |
|
| 46 |
// Initialize the labels store with WordPress data |
| 47 |
const labelsStore = useLabelsStore() |
| 48 |
labelsStore.initialize() |
| 49 |
|
| 50 |
// Make labels globally available to all components |
| 51 |
app.config.globalProperties.$labels = useLabels() |
| 52 |
|
| 53 |
app.mount('#ivyforms-app') |
| 54 |
|