forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
147 lines (131 loc) · 3.19 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import {createApp, h} from 'vue';
import {createPinia} from 'pinia';
import emitter from 'tiny-emitter/instance';
//import './styles/style.css';
import App from './App.vue';
import router from './router';
import GlobalMixins from '@/mixins/global.js';
import VueAnnouncer from '@vue-a11y/announcer';
import FloatingVue from 'floating-vue';
import VueScrollTo from 'vue-scrollto';
import Badge from '@/components/Badge/Badge.vue';
import Dropdown from '@/components/Dropdown/Dropdown.vue';
import Icon from '@/components/Icon/Icon.vue';
import Navigation from '@/components/Navigation/Navigation.vue';
import Notification from '@/components/Notification/Notification.vue';
import Panel from '@/components/Panel/Panel.vue';
import PanelSection from '@/components/Panel/PanelSection.vue';
import PkpButton from '@/components/Button/Button.vue';
import PkpHeader from '@/components/Header/Header.vue';
import Spinner from '@/components/Spinner/Spinner.vue';
import Step from '@/components/Steps/Step.vue';
import Steps from '@/components/Steps/Steps.vue';
import Tab from '@/components/Tabs/Tab.vue';
import Tabs from '@/components/Tabs/Tabs.vue';
export default window.pkp.eventBus = {
$on: (...args) => emitter.on(...args),
$once: (...args) => emitter.once(...args),
$off: (...args) => emitter.off(...args),
$emit: (...args) => emitter.emit(...args),
};
const vueApp = createApp({
data() {
/**
* Fake data that is passed to the root component
*
* This data is usually added to every PageComponent by the
* PKPTemplateManager class in OJS, OMP or OPS.
*/
return {
/**
* File genres
*/
fileGenres: [
{
id: 1,
name: 'Book Manuscript',
isPrimary: true,
},
{
id: 2,
name: 'Chapter Manuscript',
isPrimary: true,
},
{
id: 3,
name: 'Preface',
},
{
id: 4,
name: 'Index',
},
{
id: 5,
name: 'Glossary',
},
{
id: 7,
name: 'Prospectus',
},
{
id: 11,
name: 'Table',
},
{
id: 8,
name: 'Figure',
},
{
id: 9,
name: 'Audio',
},
{
id: 10,
name: 'Other',
},
],
/**
* TinyMCE configuration
*/
tinyMCE: {
skinUrl: '/styles/tinymce',
},
};
},
render: () => h(App),
});
const pinia = createPinia();
vueApp.use(pinia);
vueApp.config.productionTip = false;
vueApp.config.compilerOptions.whitespace = 'preserve';
vueApp.mixin(GlobalMixins);
vueApp.component('Badge', Badge);
vueApp.component('Dropdown', Dropdown);
vueApp.component('Icon', Icon);
vueApp.component('Navigation', Navigation);
vueApp.component('Notification', Notification);
vueApp.component('Panel', Panel);
vueApp.component('PanelSection', PanelSection);
vueApp.component('PkpButton', PkpButton);
vueApp.component('PkpHeader', PkpHeader);
vueApp.component('Spinner', Spinner);
vueApp.component('Step', Step);
vueApp.component('Steps', Steps);
vueApp.component('Tab', Tab);
vueApp.component('Tabs', Tabs);
vueApp.use(router);
vueApp.use(VueScrollTo);
vueApp.use(VueAnnouncer);
vueApp.use(FloatingVue, {
themes: {
'pkp-tooltip': {
$extend: 'tooltip',
triggers: ['click'],
delay: {
show: 0,
hide: 0,
},
},
},
});
vueApp.mount('#app');