codevdesign 1.0.61 → 1.0.63
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.
|
@@ -16,32 +16,35 @@
|
|
|
16
16
|
|
|
17
17
|
<script setup lang="ts">
|
|
18
18
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
-
|
|
20
|
-
import
|
|
21
|
-
import Editor from '@tinymce/tinymce-vue'
|
|
19
|
+
|
|
20
|
+
import { computed, ref, watch, nextTick, defineAsyncComponent } from 'vue'
|
|
22
21
|
import type { Editor as TinyMCEEditor } from 'tinymce'
|
|
23
22
|
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
// TinyMCE chargé en chunk séparé (code-splitting)
|
|
24
|
+
const Editor = defineAsyncComponent(async () => {
|
|
25
|
+
// Le core doit s'initialiser en premier
|
|
26
|
+
await import('tinymce/tinymce.js')
|
|
27
|
+
// Tout le reste en parallèle
|
|
28
|
+
await Promise.all([
|
|
29
|
+
import('tinymce/icons/default/icons.min.js'),
|
|
30
|
+
import('tinymce/themes/silver/theme.min.js'),
|
|
31
|
+
import('tinymce/models/dom/model.min.js'),
|
|
32
|
+
import('tinymce/skins/ui/oxide/skin.js'),
|
|
33
|
+
import('tinymce/skins/ui/oxide/content.js'),
|
|
34
|
+
import('tinymce/skins/content/default/content.js'),
|
|
35
|
+
import('tinymce-i18n/langs7/fr_FR'),
|
|
36
|
+
import('tinymce/plugins/autoresize/plugin.min.js'),
|
|
37
|
+
import('tinymce/plugins/advlist/plugin.min.js'),
|
|
38
|
+
import('tinymce/plugins/lists/plugin.min.js'),
|
|
39
|
+
import('tinymce/plugins/link/plugin.min.js'),
|
|
40
|
+
import('tinymce/plugins/autolink/plugin.min.js'),
|
|
41
|
+
import('tinymce/plugins/fullscreen/plugin.min.js'),
|
|
42
|
+
import('tinymce/plugins/table/plugin.min.js'),
|
|
43
|
+
import('tinymce/plugins/image/plugin.min.js'),
|
|
44
|
+
import('tinymce/plugins/code/plugin.min.js'),
|
|
45
|
+
])
|
|
46
|
+
return (await import('@tinymce/tinymce-vue')).default
|
|
47
|
+
})
|
|
45
48
|
|
|
46
49
|
const openLink = (url?: string | null, target?: string | null) => {
|
|
47
50
|
if (!url) return
|
|
@@ -94,8 +97,8 @@
|
|
|
94
97
|
const editorReady = ref(true)
|
|
95
98
|
const editorValue = ref<string>(props.modelValue)
|
|
96
99
|
const _editor = ref<TinyMCEEditor | null>(null)
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
let _reinitPending = false
|
|
101
|
+
let _reinitLock = false
|
|
99
102
|
|
|
100
103
|
const imageTailleMaxMo = computed<number>(() => {
|
|
101
104
|
const n = Number(props.imageTailleMaximale)
|
|
@@ -165,10 +168,6 @@
|
|
|
165
168
|
setup: (editor: TinyMCEEditor) => {
|
|
166
169
|
_editor.value = editor
|
|
167
170
|
|
|
168
|
-
editor.on('init', () => {
|
|
169
|
-
// init ok
|
|
170
|
-
})
|
|
171
|
-
|
|
172
171
|
// liens cliquables
|
|
173
172
|
editor.on('click', (e: any) => {
|
|
174
173
|
const a = e.target?.closest?.('a')
|
|
@@ -305,17 +304,17 @@
|
|
|
305
304
|
|
|
306
305
|
// --- Re-montage TinyMCE si props importantes changent ---
|
|
307
306
|
const scheduleReinit = () => {
|
|
308
|
-
if (_reinitPending
|
|
309
|
-
_reinitPending
|
|
307
|
+
if (_reinitPending) return
|
|
308
|
+
_reinitPending = true
|
|
310
309
|
queueMicrotask(async () => {
|
|
311
|
-
_reinitPending
|
|
310
|
+
_reinitPending = false
|
|
312
311
|
await reinitEditor()
|
|
313
312
|
})
|
|
314
313
|
}
|
|
315
314
|
|
|
316
315
|
const reinitEditor = async () => {
|
|
317
|
-
if (_reinitLock
|
|
318
|
-
_reinitLock
|
|
316
|
+
if (_reinitLock) return
|
|
317
|
+
_reinitLock = true
|
|
319
318
|
try {
|
|
320
319
|
const ed = _editor.value as any
|
|
321
320
|
if (ed && typeof ed.remove === 'function') {
|
|
@@ -331,7 +330,7 @@
|
|
|
331
330
|
editorReady.value = true
|
|
332
331
|
await nextTick()
|
|
333
332
|
} finally {
|
|
334
|
-
_reinitLock
|
|
333
|
+
_reinitLock = false
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
336
|
|
package/outils/appAxios.ts
CHANGED
|
@@ -31,9 +31,6 @@ export default {
|
|
|
31
31
|
clearCache: false,
|
|
32
32
|
|
|
33
33
|
getAxios(): AxiosInstance {
|
|
34
|
-
// Singleton + clearCache
|
|
35
|
-
if (client && !this.clearCache) return client
|
|
36
|
-
|
|
37
34
|
const appStore = useAppStore()
|
|
38
35
|
|
|
39
36
|
const rawUrl = appStore.modeleCharger
|
|
@@ -49,7 +46,7 @@ export default {
|
|
|
49
46
|
client = axios.create({
|
|
50
47
|
baseURL: `${urlBase}/api`,
|
|
51
48
|
withCredentials: true,
|
|
52
|
-
timeout:
|
|
49
|
+
timeout: 90_000,
|
|
53
50
|
headers: {
|
|
54
51
|
Accept: 'application/json',
|
|
55
52
|
'Content-Type': 'application/json',
|
|
@@ -75,7 +72,8 @@ export default {
|
|
|
75
72
|
(error: AxiosError<any>) => {
|
|
76
73
|
const status = error.response?.status
|
|
77
74
|
const payload = error.response?.data?.resultat ?? { message: error.message }
|
|
78
|
-
|
|
75
|
+
console.log("Status d'erreur : ", status)
|
|
76
|
+
console.log("Contenu d'erreur", payload)
|
|
79
77
|
// 403 / 404
|
|
80
78
|
if (status === 403 || status === 404) {
|
|
81
79
|
try {
|
|
@@ -100,8 +98,7 @@ export default {
|
|
|
100
98
|
|
|
101
99
|
// Remonter l’erreur normalisée dans appstore
|
|
102
100
|
try {
|
|
103
|
-
if (payload
|
|
104
|
-
else if (payload) appStore.lancerErreur(payload)
|
|
101
|
+
if (payload) appStore.lancerErreur(payload)
|
|
105
102
|
} catch {
|
|
106
103
|
// no-op
|
|
107
104
|
}
|
|
@@ -119,7 +119,7 @@ class RafraichisseurToken {
|
|
|
119
119
|
// ajax vers le refresh
|
|
120
120
|
let iframe = document.createElement('iframe')
|
|
121
121
|
const url = this.getRefreshUrl(urlPortail)
|
|
122
|
-
iframe.src = `${url}?urlRetour=${encodeURI(window.
|
|
122
|
+
iframe.src = `${url}?urlRetour=${encodeURI(window.location.href)}`
|
|
123
123
|
iframe.id = 'idRafrToken'
|
|
124
124
|
iframe.style.display = 'none'
|
|
125
125
|
document.body.appendChild(iframe)
|