@pristy/pristy-libvue 2.20.0 → 2.21.1
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.
- package/dist/{ActivityHistory-mnyCOXpF.js → ActivityHistory-BGjkKWml.js} +2 -2
- package/dist/{ActivityHistory-mnyCOXpF.js.map → ActivityHistory-BGjkKWml.js.map} +1 -1
- package/dist/{BookmarksComponent-Ct3cvar_.js → BookmarksComponent-DHIe0ttf.js} +2 -2
- package/dist/{BookmarksComponent-Ct3cvar_.js.map → BookmarksComponent-DHIe0ttf.js.map} +1 -1
- package/dist/{ChartWrapper-D47EsmaA.js → ChartWrapper-Zs8fU_KC.js} +2 -2
- package/dist/{ChartWrapper-D47EsmaA.js.map → ChartWrapper-Zs8fU_KC.js.map} +1 -1
- package/dist/{DisplayFileInDashboardComponent-d1VV0zCK.js → DisplayFileInDashboardComponent-VTGlXPxP.js} +19 -18
- package/dist/{DisplayFileInDashboardComponent-d1VV0zCK.js.map → DisplayFileInDashboardComponent-VTGlXPxP.js.map} +1 -1
- package/dist/{ExternalApps-qh9EP0C1.js → ExternalApps-B2alflcL.js} +2 -2
- package/dist/{ExternalApps-qh9EP0C1.js.map → ExternalApps-B2alflcL.js.map} +1 -1
- package/dist/{FavoriteList-DSuKUDkO.js → FavoriteList-CcY7AFMX.js} +88 -69
- package/dist/FavoriteList-CcY7AFMX.js.map +1 -0
- package/dist/{MarkdownComponent-BuXsGIqz.js → MarkdownComponent-LDoBl43h.js} +2 -2
- package/dist/{MarkdownComponent-BuXsGIqz.js.map → MarkdownComponent-LDoBl43h.js.map} +1 -1
- package/dist/PDFComponent-BXyQNUhl.js +987 -0
- package/dist/PDFComponent-BXyQNUhl.js.map +1 -0
- package/dist/PdfConfigService-BKVsjC1W.js +17 -0
- package/dist/PdfConfigService-BKVsjC1W.js.map +1 -0
- package/dist/PdfToolsComponent-BC45mg3C.js +1970 -0
- package/dist/PdfToolsComponent-BC45mg3C.js.map +1 -0
- package/dist/{SearchInput-Btu1tLFU.js → SearchInput-C3A2rG7G.js} +2 -2
- package/dist/{SearchInput-Btu1tLFU.js.map → SearchInput-C3A2rG7G.js.map} +1 -1
- package/dist/{UnknownBlockType-DqgwDcoj.js → UnknownBlockType-CK5rOiTB.js} +2 -2
- package/dist/{UnknownBlockType-DqgwDcoj.js.map → UnknownBlockType-CK5rOiTB.js.map} +1 -1
- package/dist/{index-DVW6EuXw.js → index-CPjFX5To.js} +11927 -13508
- package/dist/index-CPjFX5To.js.map +1 -0
- package/dist/pristy-libvue.css +1 -1
- package/dist/pristy-libvue.es.js +200 -194
- package/dist/pristy-libvue.umd.js +23 -23
- package/dist/pristy-libvue.umd.js.map +1 -1
- package/dist/src/components/CodeMirrorBase.vue.d.ts +1 -1
- package/dist/src/components/CodeMirrorEditor.vue.d.ts.map +1 -1
- package/dist/src/components/DiffViewerDialog.vue.d.ts +2 -2
- package/dist/src/components/IconPickerDialog.vue.d.ts +1 -1
- package/dist/src/components/breadcrumb/ComplexBreadcrumb.vue.d.ts.map +1 -1
- package/dist/src/components/classification/AdminClassificationPage.vue.d.ts +9 -2
- package/dist/src/components/classification/AdminClassificationPage.vue.d.ts.map +1 -1
- package/dist/src/components/classification/ClassificationPlanList.vue.d.ts +7 -1
- package/dist/src/components/classification/ClassificationPlanList.vue.d.ts.map +1 -1
- package/dist/src/components/classification/FieldForm.vue.d.ts +6 -0
- package/dist/src/components/classification/FieldForm.vue.d.ts.map +1 -1
- package/dist/src/components/classification/NatureSelector.vue.d.ts +4 -2
- package/dist/src/components/classification/NatureSelector.vue.d.ts.map +1 -1
- package/dist/src/components/classification/UploadPlanPopup.vue.d.ts.map +1 -1
- package/dist/src/components/classification/ViewSelectorPopup.vue.d.ts +2 -0
- package/dist/src/components/classification/ViewSelectorPopup.vue.d.ts.map +1 -1
- package/dist/src/components/config/ConfigRawEditor.vue.d.ts +80 -0
- package/dist/src/components/config/ConfigRawEditor.vue.d.ts.map +1 -0
- package/dist/src/components/config/ListVersionConfig.vue.d.ts +20 -13
- package/dist/src/components/config/ListVersionConfig.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/DashboardAdminPage.vue.d.ts +61 -6
- package/dist/src/components/dashboard/DashboardComponent.vue.d.ts +45 -0
- package/dist/src/components/dashboard/editor/BlockConfigEditor.vue.d.ts +8 -5
- package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts +61 -6
- package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/JsonEditorDialog.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/MarkdownEditorDialog.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/block-configs/ExternalAppsConfig.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/block-configs/ExternalAppsConfig.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/block-configs/FavoritesConfig.vue.d.ts +3 -1
- package/dist/src/components/dashboard/editor/block-configs/FavoritesConfig.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/blockDraft.d.ts +22 -0
- package/dist/src/components/dashboard/editor/blockDraft.d.ts.map +1 -0
- package/dist/src/components/dashboard/editor/grid/BlockTypeSelector.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/grid/GridBlock.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/widgets/FavoriteFileList.vue.d.ts +9 -0
- package/dist/src/components/dashboard/widgets/FavoriteFolderList.vue.d.ts +9 -0
- package/dist/src/components/dashboard/widgets/FavoriteList.vue.d.ts +36 -0
- package/dist/src/components/dashboard/widgets/FavoriteList.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/widgets/FavoriteSiteList.vue.d.ts +9 -0
- package/dist/src/components/navigation/ColumnTogglePanel.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentCompactTableView.vue.d.ts +18 -0
- package/dist/src/components/navigation/ContentCompactTableView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentTableView.vue.d.ts +9 -0
- package/dist/src/components/navigation/ContentTableView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/DynamicContentView.vue.d.ts +37 -1
- package/dist/src/components/navigation/DynamicContentView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/PreviewPanel.vue.d.ts +4 -2
- package/dist/src/components/navigation/SelectionBar.vue.d.ts.map +1 -1
- package/dist/src/components/search/AdvancedViewPanel.vue.d.ts.map +1 -1
- package/dist/src/components/search/ViewResultsPanel.vue.d.ts.map +1 -1
- package/dist/src/components/toast/CustomToastContent.vue.d.ts +1 -1
- package/dist/src/components/viewer/ArchiveViewer.vue.d.ts +14 -0
- package/dist/src/components/viewer/ArchiveViewer.vue.d.ts.map +1 -0
- package/dist/src/components/viewer/PDFComponent.vue.d.ts +2 -0
- package/dist/src/components/viewer/PDFComponent.vue.d.ts.map +1 -1
- package/dist/src/components/viewer/lazyPdfComponents.d.ts +442 -0
- package/dist/src/components/viewer/lazyPdfComponents.d.ts.map +1 -0
- package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts +25 -2
- package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts.map +1 -1
- package/dist/src/components/views/ViewList.vue.d.ts.map +1 -1
- package/dist/src/composables/useClassificationPlan.d.ts.map +1 -1
- package/dist/src/i18n/index.d.ts +136 -10
- package/dist/src/i18n/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/services/ArchiveService.d.ts +49 -0
- package/dist/src/services/ArchiveService.d.ts.map +1 -0
- package/dist/src/services/CapabilitiesService.d.ts +45 -0
- package/dist/src/services/CapabilitiesService.d.ts.map +1 -0
- package/dist/src/services/IconeService.d.ts.map +1 -1
- package/dist/src/services/PdfLinkService.d.ts +51 -0
- package/dist/src/services/PdfLinkService.d.ts.map +1 -0
- package/dist/src/stores/favorites.d.ts.map +1 -1
- package/dist/src/stores/filingPlan.d.ts.map +1 -1
- package/dist/src/utils/classificationPlanUtils.d.ts +53 -0
- package/dist/src/utils/classificationPlanUtils.d.ts.map +1 -1
- package/dist/src/utils/overflowUtils.d.ts +26 -0
- package/dist/src/utils/overflowUtils.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/FavoriteList-DSuKUDkO.js.map +0 -1
- package/dist/index-DVW6EuXw.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as f,
|
|
2
|
-
import { mapState as
|
|
1
|
+
import { _ as f, e as T, d as F, f as S, w as I } from "./index-CPjFX5To.js";
|
|
2
|
+
import { mapState as g } from "pinia";
|
|
3
3
|
import y from "primevue/tooltip";
|
|
4
|
-
import { resolveDirective as b, openBlock as s, createElementBlock as o, Fragment as k, renderList as E, createElementVNode as a, normalizeClass as
|
|
5
|
-
const
|
|
4
|
+
import { resolveDirective as b, openBlock as s, createElementBlock as o, Fragment as k, renderList as E, createElementVNode as a, normalizeClass as C, withDirectives as v, createTextVNode as w, toDisplayString as n, createCommentVNode as p, resolveComponent as m, createBlock as _ } from "vue";
|
|
5
|
+
const $ = {
|
|
6
6
|
name: "FavoriteFileList",
|
|
7
7
|
directives: {
|
|
8
8
|
tooltip: y
|
|
@@ -15,6 +15,10 @@ const I = {
|
|
|
15
15
|
urlResolver: {
|
|
16
16
|
type: Function,
|
|
17
17
|
default: null
|
|
18
|
+
},
|
|
19
|
+
favoriteFilter: {
|
|
20
|
+
type: Function,
|
|
21
|
+
default: null
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
data() {
|
|
@@ -23,13 +27,13 @@ const I = {
|
|
|
23
27
|
};
|
|
24
28
|
},
|
|
25
29
|
computed: {
|
|
26
|
-
...
|
|
30
|
+
...g(S, ["ESPACES_HOST"]),
|
|
27
31
|
favoriteFiles() {
|
|
28
|
-
return this.favorites.map((e) => e.target.file).filter((e) => e != null).filter((e) => this.matchesSite(e)).sort((e, r) => e.name.localeCompare(r.name));
|
|
32
|
+
return this.favorites.filter((e) => !this.favoriteFilter || this.favoriteFilter(e)).map((e) => e.target.file).filter((e) => e != null).filter((e) => this.matchesSite(e)).sort((e, r) => e.name.localeCompare(r.name));
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
mounted() {
|
|
32
|
-
const e =
|
|
36
|
+
const e = F();
|
|
33
37
|
e.loadFavorites().then(() => {
|
|
34
38
|
this.favorites = e.fileFavorites;
|
|
35
39
|
}).catch((r) => {
|
|
@@ -39,17 +43,17 @@ const I = {
|
|
|
39
43
|
methods: {
|
|
40
44
|
matchesSite(e) {
|
|
41
45
|
return this.siteId ? e.path?.elements?.find(
|
|
42
|
-
(
|
|
46
|
+
(t) => t.nodeType === "st:site"
|
|
43
47
|
)?.name === this.siteId : !0;
|
|
44
48
|
},
|
|
45
49
|
getIconClass(e) {
|
|
46
50
|
return e ? e === "application/pdf" ? "ri-file-pdf-line" : e.includes("word") || e.includes("opendocument.text") || e === "application/rtf" ? "ri-file-word-line" : e.includes("excel") || e.includes("spreadsheet") ? "ri-file-excel-line" : e.includes("powerpoint") || e.includes("presentation") ? "ri-file-ppt-line" : e.startsWith("image/") ? "ri-image-line" : e.startsWith("video/") ? "ri-video-line" : e.startsWith("audio/") ? "ri-music-line" : e.includes("zip") || e.includes("tar") || e.includes("compressed") ? "ri-file-zip-line" : e.startsWith("text/") || e === "application/json" || e === "application/xml" ? "ri-file-text-line" : e === "message/rfc822" ? "ri-mail-line" : "ri-file-line" : "ri-file-line";
|
|
47
51
|
},
|
|
48
52
|
navigateTo(e) {
|
|
49
|
-
const r =
|
|
50
|
-
let
|
|
51
|
-
e.mimeType === "image/vnd.dxf" || e.mimeType === "image/vnd.dwg" || e.mimeType === "message/rfc822" ?
|
|
52
|
-
`${this.ESPACES_HOST}/espaces/${
|
|
53
|
+
const r = T();
|
|
54
|
+
let t = "";
|
|
55
|
+
e.mimeType === "image/vnd.dxf" || e.mimeType === "image/vnd.dwg" || e.mimeType === "message/rfc822" ? t = "pdf" : e.mimeType.startsWith("image/") ? t = "image" : e.mimeType.startsWith("video/") ? t = "video" : e.mimeType.startsWith("text/x-markdown") || e.mimeType.startsWith("text/x-web-markdown") ? t = "md" : e.mimeType.startsWith("text/html") ? t = "html" : e.mimeType.startsWith("text/plain") ? t = "text" : e.mimeType === "application/pdf" ? t = "pdf" : (r.checkIfExists(e.mimeType, "edit") && (t = "edit"), r.checkIfExists(e.mimeType, "view") && (t = "view"), r.checkIfExists(e.mimeType, "view_comment") && (t = "view_comment")), this.urlResolver ? this.urlResolver(e) : window.open(
|
|
56
|
+
`${this.ESPACES_HOST}/espaces/${t}/${e.id}`,
|
|
53
57
|
"_blank"
|
|
54
58
|
);
|
|
55
59
|
}
|
|
@@ -61,38 +65,38 @@ const I = {
|
|
|
61
65
|
key: 0,
|
|
62
66
|
class: "file-secondary-name"
|
|
63
67
|
}, V = { key: 1 };
|
|
64
|
-
function O(e, r,
|
|
68
|
+
function O(e, r, t, h, c, l) {
|
|
65
69
|
const d = b("tooltip");
|
|
66
|
-
return
|
|
67
|
-
(s(!0), o(k, null, E(
|
|
68
|
-
key:
|
|
70
|
+
return l.favoriteFiles.length > 0 ? (s(), o("div", x, [
|
|
71
|
+
(s(!0), o(k, null, E(l.favoriteFiles, (i) => (s(), o("button", {
|
|
72
|
+
key: i.id,
|
|
69
73
|
class: "file-card",
|
|
70
|
-
onClick: (u) =>
|
|
71
|
-
"aria-label":
|
|
74
|
+
onClick: (u) => l.navigateTo(i),
|
|
75
|
+
"aria-label": i.title || i.name
|
|
72
76
|
}, [
|
|
73
77
|
a("div", R, [
|
|
74
78
|
a("i", {
|
|
75
|
-
class:
|
|
79
|
+
class: C([l.getIconClass(i.mimeType), "file-icon"]),
|
|
76
80
|
"aria-hidden": "true"
|
|
77
81
|
}, null, 2),
|
|
78
82
|
a("div", P, [
|
|
79
83
|
v((s(), o("div", A, [
|
|
80
|
-
w(
|
|
84
|
+
w(n(i.title || i.name), 1)
|
|
81
85
|
])), [
|
|
82
86
|
[
|
|
83
87
|
d,
|
|
84
|
-
|
|
88
|
+
i.description || i.title || i.name,
|
|
85
89
|
void 0,
|
|
86
90
|
{ bottom: !0 }
|
|
87
91
|
]
|
|
88
92
|
]),
|
|
89
|
-
|
|
93
|
+
i.title ? (s(), o("div", W, n(i.name), 1)) : p("", !0)
|
|
90
94
|
])
|
|
91
95
|
])
|
|
92
96
|
], 8, L))), 128))
|
|
93
|
-
])) : (s(), o("div", V,
|
|
97
|
+
])) : (s(), o("div", V, n(e.$t("emptyFavoriteFile")), 1));
|
|
94
98
|
}
|
|
95
|
-
const D = /* @__PURE__ */ f(
|
|
99
|
+
const D = /* @__PURE__ */ f($, [["render", O], ["__scopeId", "data-v-f19ce364"]]), H = {
|
|
96
100
|
name: "FavoriteFolderList",
|
|
97
101
|
directives: {
|
|
98
102
|
tooltip: y
|
|
@@ -105,6 +109,10 @@ const D = /* @__PURE__ */ f(I, [["render", O], ["__scopeId", "data-v-3d75be70"]]
|
|
|
105
109
|
urlResolver: {
|
|
106
110
|
type: Function,
|
|
107
111
|
default: null
|
|
112
|
+
},
|
|
113
|
+
favoriteFilter: {
|
|
114
|
+
type: Function,
|
|
115
|
+
default: null
|
|
108
116
|
}
|
|
109
117
|
},
|
|
110
118
|
data() {
|
|
@@ -113,13 +121,13 @@ const D = /* @__PURE__ */ f(I, [["render", O], ["__scopeId", "data-v-3d75be70"]]
|
|
|
113
121
|
};
|
|
114
122
|
},
|
|
115
123
|
computed: {
|
|
116
|
-
...
|
|
124
|
+
...g(S, ["ESPACES_HOST"]),
|
|
117
125
|
favoriteFolders() {
|
|
118
|
-
return this.favorites.map((e) => e.target.folder).filter((e) => e != null).filter((e) => this.matchesSite(e)).sort((e, r) => e.name.localeCompare(r.name));
|
|
126
|
+
return this.favorites.filter((e) => !this.favoriteFilter || this.favoriteFilter(e)).map((e) => e.target.folder).filter((e) => e != null).filter((e) => this.matchesSite(e)).sort((e, r) => e.name.localeCompare(r.name));
|
|
119
127
|
}
|
|
120
128
|
},
|
|
121
129
|
mounted() {
|
|
122
|
-
const e =
|
|
130
|
+
const e = F();
|
|
123
131
|
e.loadFavorites().then(() => {
|
|
124
132
|
this.favorites = e.folderFavorites;
|
|
125
133
|
}).catch((r) => {
|
|
@@ -129,7 +137,7 @@ const D = /* @__PURE__ */ f(I, [["render", O], ["__scopeId", "data-v-3d75be70"]]
|
|
|
129
137
|
methods: {
|
|
130
138
|
matchesSite(e) {
|
|
131
139
|
return this.siteId ? e.path?.elements?.find(
|
|
132
|
-
(
|
|
140
|
+
(t) => t.nodeType === "st:site"
|
|
133
141
|
)?.name === this.siteId : !0;
|
|
134
142
|
},
|
|
135
143
|
navigateTo(e) {
|
|
@@ -143,14 +151,14 @@ const D = /* @__PURE__ */ f(I, [["render", O], ["__scopeId", "data-v-3d75be70"]]
|
|
|
143
151
|
key: 0,
|
|
144
152
|
class: "folder-grid-container"
|
|
145
153
|
}, N = ["onClick", "aria-label"], z = { class: "folder-card-row" }, M = { class: "folder-info" }, U = { class: "folder-name" }, j = { key: 1 };
|
|
146
|
-
function q(e, r,
|
|
154
|
+
function q(e, r, t, h, c, l) {
|
|
147
155
|
const d = b("tooltip");
|
|
148
|
-
return
|
|
149
|
-
(s(!0), o(k, null, E(
|
|
150
|
-
key:
|
|
156
|
+
return l.favoriteFolders.length > 0 ? (s(), o("div", B, [
|
|
157
|
+
(s(!0), o(k, null, E(l.favoriteFolders, (i) => (s(), o("button", {
|
|
158
|
+
key: i.id,
|
|
151
159
|
class: "folder-card",
|
|
152
|
-
onClick: (u) =>
|
|
153
|
-
"aria-label":
|
|
160
|
+
onClick: (u) => l.navigateTo(i),
|
|
161
|
+
"aria-label": i.name
|
|
154
162
|
}, [
|
|
155
163
|
a("div", z, [
|
|
156
164
|
r[0] || (r[0] = a("i", {
|
|
@@ -159,11 +167,11 @@ function q(e, r, i, m, c, n) {
|
|
|
159
167
|
}, null, -1)),
|
|
160
168
|
a("div", M, [
|
|
161
169
|
v((s(), o("div", U, [
|
|
162
|
-
w(
|
|
170
|
+
w(n(i.name), 1)
|
|
163
171
|
])), [
|
|
164
172
|
[
|
|
165
173
|
d,
|
|
166
|
-
|
|
174
|
+
i.name,
|
|
167
175
|
void 0,
|
|
168
176
|
{ bottom: !0 }
|
|
169
177
|
]
|
|
@@ -171,9 +179,9 @@ function q(e, r, i, m, c, n) {
|
|
|
171
179
|
])
|
|
172
180
|
])
|
|
173
181
|
], 8, N))), 128))
|
|
174
|
-
])) : (s(), o("div", j,
|
|
182
|
+
])) : (s(), o("div", j, n(e.$t("emptyFavoriteFolder")), 1));
|
|
175
183
|
}
|
|
176
|
-
const G = /* @__PURE__ */ f(H, [["render", q], ["__scopeId", "data-v-
|
|
184
|
+
const G = /* @__PURE__ */ f(H, [["render", q], ["__scopeId", "data-v-fa282c0d"]]), J = {
|
|
177
185
|
name: "FavoriteSiteList",
|
|
178
186
|
directives: {
|
|
179
187
|
tooltip: y
|
|
@@ -182,6 +190,10 @@ const G = /* @__PURE__ */ f(H, [["render", q], ["__scopeId", "data-v-c3b23970"]]
|
|
|
182
190
|
urlResolver: {
|
|
183
191
|
type: Function,
|
|
184
192
|
default: null
|
|
193
|
+
},
|
|
194
|
+
favoriteFilter: {
|
|
195
|
+
type: Function,
|
|
196
|
+
default: null
|
|
185
197
|
}
|
|
186
198
|
},
|
|
187
199
|
data() {
|
|
@@ -228,7 +240,7 @@ const G = /* @__PURE__ */ f(H, [["render", q], ["__scopeId", "data-v-c3b23970"]]
|
|
|
228
240
|
}
|
|
229
241
|
},
|
|
230
242
|
mounted() {
|
|
231
|
-
const e =
|
|
243
|
+
const e = F();
|
|
232
244
|
e.loadFavorites().then(() => {
|
|
233
245
|
this.favorites = e.siteFavorites;
|
|
234
246
|
}).catch((r) => {
|
|
@@ -236,30 +248,30 @@ const G = /* @__PURE__ */ f(H, [["render", q], ["__scopeId", "data-v-c3b23970"]]
|
|
|
236
248
|
});
|
|
237
249
|
},
|
|
238
250
|
computed: {
|
|
239
|
-
...
|
|
251
|
+
...g(S, ["ESPACES_HOST"]),
|
|
240
252
|
favoriteSites() {
|
|
241
|
-
return this.favorites.map((e) => this.getSite(e)).filter((e) => e != null).sort((e, r) => e.title.localeCompare(r.title));
|
|
253
|
+
return this.favorites.filter((e) => !this.favoriteFilter || this.favoriteFilter(e)).map((e) => this.getSite(e)).filter((e) => e != null).sort((e, r) => e.title.localeCompare(r.title));
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
256
|
}, K = {
|
|
245
257
|
key: 0,
|
|
246
258
|
class: "site-grid-container"
|
|
247
259
|
}, Q = { class: "site-card-row" }, X = ["aria-label"], Y = ["onClick"], Z = { class: "site-description" }, ee = { key: 1 };
|
|
248
|
-
function te(e, r,
|
|
260
|
+
function te(e, r, t, h, c, l) {
|
|
249
261
|
const d = b("tooltip");
|
|
250
|
-
return
|
|
251
|
-
(s(!0), o(k, null, E(
|
|
252
|
-
key:
|
|
262
|
+
return l.favoriteSites.length > 0 ? (s(), o("div", K, [
|
|
263
|
+
(s(!0), o(k, null, E(l.favoriteSites, (i) => (s(), o("div", {
|
|
264
|
+
key: i.id,
|
|
253
265
|
class: "site-card"
|
|
254
266
|
}, [
|
|
255
267
|
a("div", Q, [
|
|
256
268
|
v(a("span", {
|
|
257
|
-
class:
|
|
258
|
-
"aria-label":
|
|
269
|
+
class: C(["visibility-dot", "visibility-dot--" + l.getVisibilitySeverity(i.visibility)]),
|
|
270
|
+
"aria-label": l.getVisibilityLabel(i.visibility)
|
|
259
271
|
}, null, 10, X), [
|
|
260
272
|
[
|
|
261
273
|
d,
|
|
262
|
-
|
|
274
|
+
l.getVisibilityLabel(i.visibility),
|
|
263
275
|
void 0,
|
|
264
276
|
{ bottom: !0 }
|
|
265
277
|
]
|
|
@@ -267,24 +279,24 @@ function te(e, r, i, m, c, n) {
|
|
|
267
279
|
a("div", null, [
|
|
268
280
|
v((s(), o("div", {
|
|
269
281
|
class: "site-title",
|
|
270
|
-
onClick: (u) =>
|
|
282
|
+
onClick: (u) => l.goToSite(i)
|
|
271
283
|
}, [
|
|
272
|
-
w(
|
|
284
|
+
w(n(i.title), 1)
|
|
273
285
|
], 8, Y)), [
|
|
274
286
|
[
|
|
275
287
|
d,
|
|
276
|
-
|
|
288
|
+
i.title,
|
|
277
289
|
void 0,
|
|
278
290
|
{ bottom: !0 }
|
|
279
291
|
]
|
|
280
292
|
]),
|
|
281
|
-
a("div", Z,
|
|
293
|
+
a("div", Z, n(i.description || "Aucune description"), 1)
|
|
282
294
|
])
|
|
283
295
|
])
|
|
284
296
|
]))), 128))
|
|
285
|
-
])) : (s(), o("div", ee,
|
|
297
|
+
])) : (s(), o("div", ee, n(e.$t("emptyFavoriteSite")), 1));
|
|
286
298
|
}
|
|
287
|
-
const ie = /* @__PURE__ */ f(J, [["render", te], ["__scopeId", "data-v-
|
|
299
|
+
const ie = /* @__PURE__ */ f(J, [["render", te], ["__scopeId", "data-v-d4f00cad"]]), re = {
|
|
288
300
|
name: "FavoriteList",
|
|
289
301
|
components: {
|
|
290
302
|
FavoriteFileList: D,
|
|
@@ -304,6 +316,10 @@ const ie = /* @__PURE__ */ f(J, [["render", te], ["__scopeId", "data-v-64a7ee8d"
|
|
|
304
316
|
urlResolver: {
|
|
305
317
|
type: Function,
|
|
306
318
|
default: null
|
|
319
|
+
},
|
|
320
|
+
favoriteFilter: {
|
|
321
|
+
type: Function,
|
|
322
|
+
default: null
|
|
307
323
|
}
|
|
308
324
|
},
|
|
309
325
|
data() {
|
|
@@ -325,7 +341,7 @@ const ie = /* @__PURE__ */ f(J, [["render", te], ["__scopeId", "data-v-64a7ee8d"
|
|
|
325
341
|
this.siteTitle = "";
|
|
326
342
|
return;
|
|
327
343
|
}
|
|
328
|
-
|
|
344
|
+
I.getWorkspace(e).then((r) => {
|
|
329
345
|
this.siteTitle = r.title || r.id;
|
|
330
346
|
}).catch(() => {
|
|
331
347
|
this.siteTitle = e;
|
|
@@ -336,26 +352,29 @@ const ie = /* @__PURE__ */ f(J, [["render", te], ["__scopeId", "data-v-64a7ee8d"
|
|
|
336
352
|
key: 0,
|
|
337
353
|
class: "site-title-label"
|
|
338
354
|
};
|
|
339
|
-
function oe(e, r,
|
|
340
|
-
const d =
|
|
355
|
+
function oe(e, r, t, h, c, l) {
|
|
356
|
+
const d = m("FavoriteFileList"), i = m("FavoriteFolderList"), u = m("FavoriteSiteList");
|
|
341
357
|
return s(), o("div", null, [
|
|
342
|
-
c.siteTitle ? (s(), o("p", se,
|
|
343
|
-
|
|
358
|
+
c.siteTitle ? (s(), o("p", se, n(c.siteTitle), 1)) : p("", !0),
|
|
359
|
+
t.filter === "file" ? (s(), _(d, {
|
|
344
360
|
key: 1,
|
|
345
|
-
"site-id":
|
|
346
|
-
"url-resolver":
|
|
347
|
-
|
|
361
|
+
"site-id": t.siteId,
|
|
362
|
+
"url-resolver": t.urlResolver,
|
|
363
|
+
"favorite-filter": t.favoriteFilter
|
|
364
|
+
}, null, 8, ["site-id", "url-resolver", "favorite-filter"])) : t.filter === "folder" ? (s(), _(i, {
|
|
348
365
|
key: 2,
|
|
349
|
-
"site-id":
|
|
350
|
-
"url-resolver":
|
|
351
|
-
|
|
366
|
+
"site-id": t.siteId,
|
|
367
|
+
"url-resolver": t.urlResolver,
|
|
368
|
+
"favorite-filter": t.favoriteFilter
|
|
369
|
+
}, null, 8, ["site-id", "url-resolver", "favorite-filter"])) : t.filter === "site" ? (s(), _(u, {
|
|
352
370
|
key: 3,
|
|
353
|
-
"url-resolver":
|
|
354
|
-
|
|
371
|
+
"url-resolver": t.urlResolver,
|
|
372
|
+
"favorite-filter": t.favoriteFilter
|
|
373
|
+
}, null, 8, ["url-resolver", "favorite-filter"])) : p("", !0)
|
|
355
374
|
]);
|
|
356
375
|
}
|
|
357
|
-
const ce = /* @__PURE__ */ f(re, [["render", oe], ["__scopeId", "data-v-
|
|
376
|
+
const ce = /* @__PURE__ */ f(re, [["render", oe], ["__scopeId", "data-v-c563ef74"]]);
|
|
358
377
|
export {
|
|
359
378
|
ce as default
|
|
360
379
|
};
|
|
361
|
-
//# sourceMappingURL=FavoriteList-
|
|
380
|
+
//# sourceMappingURL=FavoriteList-CcY7AFMX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavoriteList-CcY7AFMX.js","sources":["../src/components/dashboard/widgets/FavoriteFileList.vue","../src/components/dashboard/widgets/FavoriteFolderList.vue","../src/components/dashboard/widgets/FavoriteSiteList.vue","../src/components/dashboard/widgets/FavoriteList.vue"],"sourcesContent":["<!--\n Copyright (C) 2022 - Jeci SARL - https://jeci.fr\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as\n published by the Free Software Foundation, either version 3 of the\n License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.html.\n-->\n\n<template>\n <div class=\"file-grid-container\" v-if=\"favoriteFiles.length > 0\">\n <button\n v-for=\"file in favoriteFiles\"\n :key=\"file.id\"\n class=\"file-card\"\n @click=\"navigateTo(file)\"\n :aria-label=\"file.title || file.name\"\n >\n <div class=\"file-card-row\">\n <i\n :class=\"getIconClass(file.mimeType)\"\n class=\"file-icon\"\n aria-hidden=\"true\"\n ></i>\n <div class=\"file-info\">\n <div\n class=\"file-name\"\n v-tooltip.bottom=\"file.description || file.title || file.name\"\n >\n {{ file.title || file.name }}\n </div>\n <div v-if=\"file.title\" class=\"file-secondary-name\">\n {{ file.name }}\n </div>\n </div>\n </div>\n </button>\n </div>\n <div v-else>{{ $t(\"emptyFavoriteFile\") }}</div>\n</template>\n\n<script>\nimport { useCollaboraStore } from \"@/stores/collabora\";\nimport { useConfigStore } from \"@/stores/config\";\nimport { useFavoritesStore } from \"@/stores/favorites\";\nimport { mapState } from \"pinia\";\nimport Tooltip from \"primevue/tooltip\";\n\nexport default {\n name: \"FavoriteFileList\",\n directives: {\n tooltip: Tooltip,\n },\n props: {\n siteId: {\n type: String,\n default: \"\",\n },\n urlResolver: {\n type: Function,\n default: null,\n },\n favoriteFilter: {\n type: Function,\n default: null,\n },\n },\n data() {\n return {\n favorites: [],\n };\n },\n computed: {\n ...mapState(useConfigStore, [\"ESPACES_HOST\"]),\n favoriteFiles() {\n return this.favorites\n .filter((fav) => !this.favoriteFilter || this.favoriteFilter(fav))\n .map((fav) => fav.target.file)\n .filter((file) => file !== undefined && file !== null)\n .filter((file) => this.matchesSite(file))\n .sort((a, b) => a.name.localeCompare(b.name));\n },\n },\n mounted() {\n const favoritesStore = useFavoritesStore();\n favoritesStore\n .loadFavorites()\n .then(() => {\n this.favorites = favoritesStore.fileFavorites;\n })\n .catch((err) => {\n console.error(\"Error loading favorites:\", err);\n });\n },\n methods: {\n matchesSite(node) {\n if (!this.siteId) {\n return true;\n }\n const siteElement = node.path?.elements?.find(\n (el) => el.nodeType === \"st:site\",\n );\n return siteElement?.name === this.siteId;\n },\n getIconClass(mimeType) {\n if (!mimeType) {\n return \"ri-file-line\";\n }\n if (mimeType === \"application/pdf\") {\n return \"ri-file-pdf-line\";\n }\n if (\n mimeType.includes(\"word\") ||\n mimeType.includes(\"opendocument.text\") ||\n mimeType === \"application/rtf\"\n ) {\n return \"ri-file-word-line\";\n }\n if (mimeType.includes(\"excel\") || mimeType.includes(\"spreadsheet\")) {\n return \"ri-file-excel-line\";\n }\n if (\n mimeType.includes(\"powerpoint\") ||\n mimeType.includes(\"presentation\")\n ) {\n return \"ri-file-ppt-line\";\n }\n if (mimeType.startsWith(\"image/\")) {\n return \"ri-image-line\";\n }\n if (mimeType.startsWith(\"video/\")) {\n return \"ri-video-line\";\n }\n if (mimeType.startsWith(\"audio/\")) {\n return \"ri-music-line\";\n }\n if (\n mimeType.includes(\"zip\") ||\n mimeType.includes(\"tar\") ||\n mimeType.includes(\"compressed\")\n ) {\n return \"ri-file-zip-line\";\n }\n if (\n mimeType.startsWith(\"text/\") ||\n mimeType === \"application/json\" ||\n mimeType === \"application/xml\"\n ) {\n return \"ri-file-text-line\";\n }\n if (mimeType === \"message/rfc822\") {\n return \"ri-mail-line\";\n }\n return \"ri-file-line\";\n },\n navigateTo(file) {\n const collaboraStore = useCollaboraStore();\n let destinationName = \"\";\n if (\n file.mimeType === \"image/vnd.dxf\" ||\n file.mimeType === \"image/vnd.dwg\" ||\n file.mimeType === \"message/rfc822\"\n ) {\n destinationName = \"pdf\";\n } else if (file.mimeType.startsWith(\"image/\")) {\n destinationName = \"image\";\n } else if (file.mimeType.startsWith(\"video/\")) {\n destinationName = \"video\";\n } else if (\n file.mimeType.startsWith(\"text/x-markdown\") ||\n file.mimeType.startsWith(\"text/x-web-markdown\")\n ) {\n destinationName = \"md\";\n } else if (file.mimeType.startsWith(\"text/html\")) {\n destinationName = \"html\";\n } else if (file.mimeType.startsWith(\"text/plain\")) {\n destinationName = \"text\";\n } else if (file.mimeType === \"application/pdf\") {\n destinationName = \"pdf\";\n } else {\n if (collaboraStore.checkIfExists(file.mimeType, \"edit\")) {\n destinationName = \"edit\";\n }\n if (collaboraStore.checkIfExists(file.mimeType, \"view\")) {\n destinationName = \"view\";\n }\n if (collaboraStore.checkIfExists(file.mimeType, \"view_comment\")) {\n destinationName = \"view_comment\";\n }\n }\n if (this.urlResolver) {\n this.urlResolver(file);\n } else {\n window.open(\n `${this.ESPACES_HOST}/espaces/${destinationName}/${file.id}`,\n \"_blank\",\n );\n }\n },\n },\n};\n</script>\n\n<style scoped>\n.file-grid-container {\n display: grid;\n gap: 1rem;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n}\n\n.file-card {\n background-color: var(--p-content-background);\n padding: 1rem;\n border-radius: 0.75rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n border: 1px solid var(--p-content-border-color);\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: inherit;\n color: inherit;\n transition:\n border-color 0.2s,\n box-shadow 0.2s;\n}\n\n.file-card:hover {\n border-color: var(--p-primary-color);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n}\n\n.file-card:focus-visible {\n outline: 2px solid var(--p-primary-color);\n outline-offset: 2px;\n}\n\n.file-card-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.file-icon {\n font-size: 1.5rem;\n color: var(--p-primary-color);\n flex-shrink: 0;\n}\n\n.file-info {\n min-width: 0;\n overflow: hidden;\n}\n\n.file-info > div {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.file-name {\n font-weight: 500;\n font-size: 0.875rem;\n}\n\n.file-secondary-name {\n font-size: 0.75rem;\n color: var(--p-text-muted-color);\n margin-top: 0.25rem;\n}\n</style>\n","<!--\n Copyright (C) 2022 - Jeci SARL - https://jeci.fr\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as\n published by the Free Software Foundation, either version 3 of the\n License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.html.\n-->\n\n<template>\n <div class=\"folder-grid-container\" v-if=\"favoriteFolders.length > 0\">\n <button\n v-for=\"folder in favoriteFolders\"\n :key=\"folder.id\"\n class=\"folder-card\"\n @click=\"navigateTo(folder)\"\n :aria-label=\"folder.name\"\n >\n <div class=\"folder-card-row\">\n <i class=\"ri-folder-line folder-icon\" aria-hidden=\"true\"></i>\n <div class=\"folder-info\">\n <div class=\"folder-name\" v-tooltip.bottom=\"folder.name\">\n {{ folder.name }}\n </div>\n </div>\n </div>\n </button>\n </div>\n <div v-else>{{ $t(\"emptyFavoriteFolder\") }}</div>\n</template>\n\n<script>\nimport { useConfigStore } from \"@/stores/config\";\nimport { useFavoritesStore } from \"@/stores/favorites\";\nimport { mapState } from \"pinia\";\nimport Tooltip from \"primevue/tooltip\";\n\nexport default {\n name: \"FavoriteFolderList\",\n directives: {\n tooltip: Tooltip,\n },\n props: {\n siteId: {\n type: String,\n default: \"\",\n },\n urlResolver: {\n type: Function,\n default: null,\n },\n favoriteFilter: {\n type: Function,\n default: null,\n },\n },\n data() {\n return {\n favorites: [],\n };\n },\n computed: {\n ...mapState(useConfigStore, [\"ESPACES_HOST\"]),\n favoriteFolders() {\n return this.favorites\n .filter((fav) => !this.favoriteFilter || this.favoriteFilter(fav))\n .map((fav) => fav.target.folder)\n .filter((folder) => folder !== undefined && folder !== null)\n .filter((folder) => this.matchesSite(folder))\n .sort((a, b) => a.name.localeCompare(b.name));\n },\n },\n mounted() {\n const favoritesStore = useFavoritesStore();\n favoritesStore\n .loadFavorites()\n .then(() => {\n this.favorites = favoritesStore.folderFavorites;\n })\n .catch((err) => {\n console.error(\"Error loading favorites:\", err);\n });\n },\n methods: {\n matchesSite(node) {\n if (!this.siteId) {\n return true;\n }\n const siteElement = node.path?.elements?.find(\n (el) => el.nodeType === \"st:site\",\n );\n return siteElement?.name === this.siteId;\n },\n navigateTo(folder) {\n if (this.urlResolver) {\n this.urlResolver(folder);\n } else {\n window.open(\n `${this.ESPACES_HOST}/espaces/mes-espaces/dossier/${folder.id}`,\n \"_blank\",\n );\n }\n },\n },\n};\n</script>\n\n<style scoped>\n.folder-grid-container {\n display: grid;\n gap: 1rem;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n}\n\n.folder-card {\n background-color: var(--p-content-background);\n padding: 1rem;\n border-radius: 0.75rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n border: 1px solid var(--p-content-border-color);\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: inherit;\n color: inherit;\n transition:\n border-color 0.2s,\n box-shadow 0.2s;\n}\n\n.folder-card:hover {\n border-color: var(--p-primary-color);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n}\n\n.folder-card:focus-visible {\n outline: 2px solid var(--p-primary-color);\n outline-offset: 2px;\n}\n\n.folder-card-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.folder-icon {\n font-size: 1.5rem;\n color: var(--p-primary-color);\n flex-shrink: 0;\n}\n\n.folder-info {\n min-width: 0;\n overflow: hidden;\n}\n\n.folder-info > div {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.folder-name {\n font-weight: 500;\n font-size: 0.875rem;\n}\n</style>\n","<!--\n Copyright (C) 2022 - Jeci SARL - https://jeci.fr\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as\n published by the Free Software Foundation, either version 3 of the\n License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.html.\n-->\n\n<template>\n <div class=\"site-grid-container\" v-if=\"favoriteSites.length > 0\">\n <div v-for=\"site in favoriteSites\" :key=\"site.id\" class=\"site-card\">\n <div class=\"site-card-row\">\n <span\n class=\"visibility-dot\"\n :class=\"'visibility-dot--' + getVisibilitySeverity(site.visibility)\"\n :aria-label=\"getVisibilityLabel(site.visibility)\"\n v-tooltip.bottom=\"getVisibilityLabel(site.visibility)\"\n ></span>\n <div>\n <div\n class=\"site-title\"\n @click=\"goToSite(site)\"\n v-tooltip.bottom=\"site.title\"\n >\n {{ site.title }}\n </div>\n <div class=\"site-description\">\n {{ site.description || \"Aucune description\" }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else>{{ $t(\"emptyFavoriteSite\") }}</div>\n</template>\n\n<script>\nimport { useConfigStore } from \"@/stores/config\";\nimport { useFavoritesStore } from \"@/stores/favorites\";\nimport { mapState } from \"pinia\";\nimport Tooltip from \"primevue/tooltip\";\n\nexport default {\n name: \"FavoriteSiteList\",\n directives: {\n tooltip: Tooltip,\n },\n props: {\n urlResolver: {\n type: Function,\n default: null,\n },\n favoriteFilter: {\n type: Function,\n default: null,\n },\n },\n data() {\n return {\n favorites: [],\n };\n },\n methods: {\n getSite(fav) {\n return fav.target.site;\n },\n goToSite(site) {\n if (this.urlResolver) {\n this.urlResolver(site);\n } else {\n window.open(\n `${this.ESPACES_HOST}/espaces/mes-espaces/${site.id}`,\n \"_blank\",\n );\n }\n },\n getVisibilityLabel(visibility) {\n switch (visibility) {\n case \"PUBLIC\":\n return \"Public\";\n case \"PRIVATE\":\n return \"Privé\";\n case \"MODERATED\":\n return \"Modéré\";\n default:\n return \"Inconnu\";\n }\n },\n getVisibilitySeverity(visibility) {\n switch (visibility) {\n case \"PUBLIC\":\n return \"success\"; // vert\n case \"PRIVATE\":\n return \"danger\"; // rouge\n case \"MODERATED\":\n return \"warning\"; // orange\n default:\n return \"info\";\n }\n },\n },\n mounted() {\n const favoritesStore = useFavoritesStore();\n favoritesStore\n .loadFavorites()\n .then(() => {\n this.favorites = favoritesStore.siteFavorites;\n })\n .catch((err) => {\n console.error(\"Erreur lors du chargement des favoris:\", err);\n });\n },\n computed: {\n ...mapState(useConfigStore, [\"ESPACES_HOST\"]),\n favoriteSites() {\n // Parcours chaque favorite, récupère target.site si existant\n return this.favorites\n .filter((fav) => !this.favoriteFilter || this.favoriteFilter(fav))\n .map((fav) => this.getSite(fav))\n .filter((site) => site !== undefined && site !== null)\n .sort((a, b) => a.title.localeCompare(b.title));\n },\n },\n};\n</script>\n<style scoped>\n.site-grid-container {\n display: grid;\n gap: 0.5rem;\n grid-template-columns: 1fr;\n}\n\n.site-card {\n background-color: var(--p-content-background);\n padding: 0.5rem 0.75rem;\n border-radius: 0.75rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.site-card-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.site-title {\n display: flex;\n font-weight: 500;\n font-size: 0.875rem;\n cursor: pointer;\n}\n\n.site-description {\n display: flex;\n font-size: 0.75rem;\n color: var(--p-text-muted-color);\n margin-top: 0.25rem;\n}\n\n.visibility-dot {\n width: 0.75rem;\n height: 0.75rem;\n border-radius: 50%;\n flex-shrink: 0;\n}\n\n.visibility-dot--success {\n background-color: var(--p-green-500);\n}\n\n.visibility-dot--danger {\n background-color: var(--p-red-500);\n}\n\n.visibility-dot--warning {\n background-color: var(--p-orange-500);\n}\n\n.visibility-dot--info {\n background-color: var(--p-blue-500);\n}\n</style>\n","<!--\n Copyright (C) 2022 - Jeci SARL - https://jeci.fr\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as\n published by the Free Software Foundation, either version 3 of the\n License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.html.\n-->\n\n<template>\n <div>\n <p v-if=\"siteTitle\" class=\"site-title-label\">\n {{ siteTitle }}\n </p>\n <FavoriteFileList\n v-if=\"filter === 'file'\"\n :site-id=\"siteId\"\n :url-resolver=\"urlResolver\"\n :favorite-filter=\"favoriteFilter\"\n />\n <FavoriteFolderList\n v-else-if=\"filter === 'folder'\"\n :site-id=\"siteId\"\n :url-resolver=\"urlResolver\"\n :favorite-filter=\"favoriteFilter\"\n />\n <FavoriteSiteList\n v-else-if=\"filter === 'site'\"\n :url-resolver=\"urlResolver\"\n :favorite-filter=\"favoriteFilter\"\n />\n </div>\n</template>\n\n<script>\nimport FavoriteFileList from \"@/components/dashboard/widgets/FavoriteFileList.vue\";\nimport FavoriteFolderList from \"@/components/dashboard/widgets/FavoriteFolderList.vue\";\nimport FavoriteSiteList from \"@/components/dashboard/widgets/FavoriteSiteList.vue\";\nimport workspaceService from \"@/services/WorkspaceService.js\";\n\nexport default {\n name: \"FavoriteList\",\n components: {\n FavoriteFileList,\n FavoriteFolderList,\n FavoriteSiteList,\n },\n props: {\n filter: {\n type: String,\n default: \"file\",\n validator: (value) => [\"file\", \"folder\", \"site\"].includes(value),\n },\n siteId: {\n type: String,\n default: \"\",\n },\n urlResolver: {\n type: Function,\n default: null,\n },\n favoriteFilter: {\n type: Function,\n default: null,\n },\n },\n data() {\n return {\n siteTitle: \"\",\n };\n },\n watch: {\n siteId: {\n immediate: true,\n handler(newSiteId) {\n this.resolveSiteTitle(newSiteId);\n },\n },\n },\n methods: {\n resolveSiteTitle(siteId) {\n if (!siteId) {\n this.siteTitle = \"\";\n return;\n }\n workspaceService\n .getWorkspace(siteId)\n .then((site) => {\n this.siteTitle = site.title || site.id;\n })\n .catch(() => {\n this.siteTitle = siteId;\n });\n },\n },\n};\n</script>\n\n<style scoped>\n.site-title-label {\n margin-top: 0;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n color: var(--p-text-muted-color);\n}\n</style>\n"],"names":["_sfc_main","Tooltip","mapState","useConfigStore","fav","file","a","b","favoritesStore","useFavoritesStore","err","node","el","mimeType","collaboraStore","useCollaboraStore","destinationName","_hoisted_3","_hoisted_4","_hoisted_5","$options","_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","$event","_createElementVNode","_withDirectives","_createTextVNode","_toDisplayString","_hoisted_6","_ctx","folder","site","visibility","_hoisted_2","FavoriteFileList","FavoriteFolderList","FavoriteSiteList","value","newSiteId","siteId","workspaceService","$data","$props","_createBlock","_component_FavoriteFileList","_component_FavoriteFolderList","_component_FavoriteSiteList"],"mappings":";;;;AAwDA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,SAASC;AAAA;EAEX,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,aAAa;AAAA,MACX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,EAAA;AAAA,MACT,gBAAcA,EAAA;AAAA,MACd,mBAAiBA,EAAA;AAAA,mEAGPA,EAAA,WAAM,iBADnBC,EAKEE,GAAA;AAAA;MAHC,WAASH,EAAA;AAAA,MACT,gBAAcA,EAAA;AAAA,MACd,mBAAiBA,EAAA;AAAA,mEAGPA,EAAA,WAAM,eADnBC,EAIEG,GAAA;AAAA;MAFC,gBAAcJ,EAAA;AAAA,MACd,mBAAiBA,EAAA;AAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as i, d } from "./index-
|
|
1
|
+
import { _ as i, a as d } from "./index-CPjFX5To.js";
|
|
2
2
|
import { marked as o } from "marked";
|
|
3
3
|
import r from "dompurify";
|
|
4
4
|
import { openBlock as s, createElementBlock as m } from "vue";
|
|
@@ -53,4 +53,4 @@ const _ = /* @__PURE__ */ i(l, [["render", u]]);
|
|
|
53
53
|
export {
|
|
54
54
|
_ as default
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=MarkdownComponent-
|
|
56
|
+
//# sourceMappingURL=MarkdownComponent-LDoBl43h.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownComponent-
|
|
1
|
+
{"version":3,"file":"MarkdownComponent-LDoBl43h.js","sources":["../src/components/dashboard/widgets/MarkdownComponent.vue"],"sourcesContent":["<!--\n Copyright (C) 2022 - Jeci SARL - https://jeci.fr\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as\n published by the Free Software Foundation, either version 3 of the\n License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/agpl-3.0.html.\n-->\n<template>\n <div :id=\"`content-${uniqueId}`\"></div>\n</template>\n\n<script>\nimport alfrescoNodeService from \"@/services/AlfrescoNodeService.js\";\nimport { marked } from \"marked\";\nimport DOMPurify from \"dompurify\";\n\nexport default {\n name: \"MarkdownComponent\",\n props: {\n id: {\n type: String,\n default: null,\n },\n markdownContent: {\n type: String,\n default: null,\n },\n },\n data() {\n return {\n uniqueId: `markdown-${Math.random().toString(36).substr(2, 9)}`,\n };\n },\n mounted() {\n // Priority: id from Alfresco > inline markdown content > default sample\n if (this.id && this.id.trim()) {\n this.loadMarkdown();\n } else if (this.markdownContent && this.markdownContent.trim()) {\n this.loadInlineMarkdown();\n } else {\n this.loadSampleMarkDown();\n }\n },\n methods: {\n loadInlineMarkdown() {\n const element = document.getElementById(`content-${this.uniqueId}`);\n if (element && this.markdownContent) {\n element.innerHTML = DOMPurify.sanitize(\n marked.parse(this.markdownContent),\n );\n }\n },\n loadSampleMarkDown() {\n const sample = this.$t(\"dashboard.markdownSample\");\n const element = document.getElementById(`content-${this.uniqueId}`);\n if (element) {\n element.innerHTML = DOMPurify.sanitize(marked.parse(sample));\n }\n },\n async loadMarkdown() {\n try {\n const contentBlob = await alfrescoNodeService.getNodeContent(this.id);\n let rawMarkdown = await contentBlob.text();\n const element = document.getElementById(`content-${this.uniqueId}`);\n if (element) {\n element.innerHTML = DOMPurify.sanitize(marked.parse(rawMarkdown));\n }\n } catch (error) {\n console.error(\"Erreur lors du chargement du markdown:\", error);\n }\n },\n },\n};\n</script>\n<style scoped></style>\n"],"names":["_sfc_main","element","DOMPurify","marked","sample","rawMarkdown","alfrescoNodeService","error","_createElementBlock","$data"],"mappings":";;;;AAyBA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AAAA,IACL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA;;EAGb,OAAO;AACL,WAAO;AAAA,MACL,UAAU,YAAY,KAAK,OAAM,EAAG,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC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