@xwiki/cristal-history-ui 1.3.0 → 1.4.0
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/package.json +9 -9
- package/dist/HistoryExtraTab.d.ts +0 -12
- package/dist/index.d.cts +0 -7
- package/dist/index.d.ts +0 -7
- package/dist/index.es.js +0 -106
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -4
- package/dist/index.umd.js.map +0 -1
- package/dist/translations.d.ts +0 -21
- package/dist/vue/HistoryTab.vue.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-history-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"main": "./dist/index.es.js",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@xwiki/platform-api": "18.
|
|
32
|
-
"@xwiki/platform-document-api": "18.
|
|
31
|
+
"@xwiki/platform-api": "18.4.0",
|
|
32
|
+
"@xwiki/platform-document-api": "18.4.0",
|
|
33
33
|
"vue-i18n": "11.3.0",
|
|
34
|
-
"@xwiki/cristal-extra-tabs-api": "1.
|
|
35
|
-
"@xwiki/cristal-
|
|
36
|
-
"@xwiki/cristal-
|
|
34
|
+
"@xwiki/cristal-extra-tabs-api": "1.4.0",
|
|
35
|
+
"@xwiki/cristal-user-ui": "1.4.0",
|
|
36
|
+
"@xwiki/cristal-history-api": "1.4.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"inversify": "8.x",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"vue-router": "5.x"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@xwiki/platform-dsapi": "18.
|
|
45
|
+
"@xwiki/platform-dsapi": "18.4.0",
|
|
46
46
|
"inversify": "8.1.0",
|
|
47
47
|
"reflect-metadata": "0.2.2",
|
|
48
48
|
"typescript": "5.9.3",
|
|
49
49
|
"vite": "7.3.2",
|
|
50
50
|
"vue": "3.5.30",
|
|
51
51
|
"vue-router": "5.0.3",
|
|
52
|
-
"vue-tsc": "3.2.
|
|
53
|
-
"@xwiki/cristal-dev-config": "1.
|
|
52
|
+
"vue-tsc": "3.2.9",
|
|
53
|
+
"@xwiki/cristal-dev-config": "1.4.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"api-extractor:local": "api-extractor run --local",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AbstractExtraTab } from '@xwiki/cristal-extra-tabs-api';
|
|
2
|
-
import { PageRevisionManagerProvider } from '@xwiki/cristal-history-api';
|
|
3
|
-
import { Component } from 'vue';
|
|
4
|
-
export declare class HistoryExtraTab extends AbstractExtraTab {
|
|
5
|
-
private readonly pageRevisionManagerProvider;
|
|
6
|
-
title: string;
|
|
7
|
-
constructor(pageRevisionManagerProvider: PageRevisionManagerProvider);
|
|
8
|
-
order: number;
|
|
9
|
-
id: string;
|
|
10
|
-
panel(): Promise<Component>;
|
|
11
|
-
enabled(): Promise<boolean>;
|
|
12
|
-
}
|
package/dist/index.d.cts
DELETED
package/dist/index.d.ts
DELETED
package/dist/index.es.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("p[data-v-2d247591]{font-size:var(--cr-font-size-medium)}table[data-v-2d247591]{border-collapse:collapse}table tr[data-v-2d247591]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-2d247591]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-2d247591]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-2d247591]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-2d247591]{text-align:center}table .history-revision[data-v-2d247591]{background-color:var(--cr-color-neutral-300);border-radius:var(--cr-border-radius-pill);padding:var(--cr-spacing-2x-small);font-size:var(--cr-font-size-x-small)}")),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
import { defineComponent as f, inject as T, ref as m, onMounted as C, resolveComponent as P, openBlock as l, createElementBlock as c, Fragment as p, toDisplayString as d, unref as y, createElementVNode as u, renderList as k, createVNode as g, withCtx as _, createTextVNode as R, createCommentVNode as S } from "vue";
|
|
3
|
-
import { User as j } from "@xwiki/cristal-user-ui";
|
|
4
|
-
import { name as E } from "@xwiki/platform-document-api";
|
|
5
|
-
import { useI18n as H } from "vue-i18n";
|
|
6
|
-
import { AbstractExtraTab as M } from "@xwiki/cristal-extra-tabs-api";
|
|
7
|
-
import { injectable as w, inject as D } from "inversify";
|
|
8
|
-
const L = {
|
|
9
|
-
"history.extraTabs.title": "History",
|
|
10
|
-
"history.extraTabs.loading": "Loading...",
|
|
11
|
-
"history.extraTabs.header": "This page has {nRevisions} versions stored.",
|
|
12
|
-
"history.extraTabs.entry": "{date} by {user}"
|
|
13
|
-
}, N = {
|
|
14
|
-
"history.extraTabs.title": "Historique",
|
|
15
|
-
"history.extraTabs.loading": "Chargement en cours ...",
|
|
16
|
-
"history.extraTabs.header": "Ce document a {nRevisions} versions stockées.",
|
|
17
|
-
"history.extraTabs.entry": "{date} par {user}"
|
|
18
|
-
}, b = {
|
|
19
|
-
en: L,
|
|
20
|
-
fr: N
|
|
21
|
-
}, O = { key: 0 }, V = { key: 1 }, I = { key: 2 }, B = { class: "history-revision-cell" }, q = { class: "history-revision" }, A = ["href"], F = /* @__PURE__ */ f({
|
|
22
|
-
__name: "HistoryTab",
|
|
23
|
-
setup(e) {
|
|
24
|
-
const { t } = H({
|
|
25
|
-
messages: b
|
|
26
|
-
}), r = T("cristal"), s = r.getContainer().get(E).getCurrentDocument(), n = m([]), a = m(!0);
|
|
27
|
-
return C(async () => {
|
|
28
|
-
s.value && (n.value = await r.getContainer().get("PageRevisionManagerProvider").get().getRevisions(s.value)), a.value = !1;
|
|
29
|
-
}), (K, h) => {
|
|
30
|
-
const x = P("i18n-t");
|
|
31
|
-
return l(), c(p, null, [
|
|
32
|
-
a.value ? (l(), c("p", O, d(y(t)("history.extraTabs.loading")), 1)) : (l(), c("p", V, d(y(t)("history.extraTabs.header", { nRevisions: n.value.length })), 1)),
|
|
33
|
-
h[1] || (h[1] = u("br", null, null, -1)),
|
|
34
|
-
a.value ? S("", !0) : (l(), c("table", I, [
|
|
35
|
-
(l(!0), c(p, null, k(n.value, (i) => (l(), c("tr", {
|
|
36
|
-
key: i.version
|
|
37
|
-
}, [
|
|
38
|
-
u("td", B, [
|
|
39
|
-
u("span", q, d(i.version), 1)
|
|
40
|
-
]),
|
|
41
|
-
u("td", null, [
|
|
42
|
-
g(x, {
|
|
43
|
-
keypath: "history.extraTabs.entry",
|
|
44
|
-
tag: "span"
|
|
45
|
-
}, {
|
|
46
|
-
date: _(() => [
|
|
47
|
-
u("a", {
|
|
48
|
-
href: i.url
|
|
49
|
-
}, d(i.date.toLocaleString(void 0, {
|
|
50
|
-
dateStyle: "short",
|
|
51
|
-
timeStyle: "short"
|
|
52
|
-
})), 9, A)
|
|
53
|
-
]),
|
|
54
|
-
user: _(() => [
|
|
55
|
-
g(y(j), {
|
|
56
|
-
user: i.user
|
|
57
|
-
}, null, 8, ["user"])
|
|
58
|
-
]),
|
|
59
|
-
_: 2
|
|
60
|
-
}, 1024),
|
|
61
|
-
h[0] || (h[0] = u("br", null, null, -1)),
|
|
62
|
-
R(" " + d(i.comment), 1)
|
|
63
|
-
])
|
|
64
|
-
]))), 128))
|
|
65
|
-
]))
|
|
66
|
-
], 64);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}), U = (e, t) => {
|
|
70
|
-
const r = e.__vccOpts || e;
|
|
71
|
-
for (const [o, s] of t)
|
|
72
|
-
r[o] = s;
|
|
73
|
-
return r;
|
|
74
|
-
}, $ = /* @__PURE__ */ U(F, [["__scopeId", "data-v-2d247591"]]);
|
|
75
|
-
var z = Object.getOwnPropertyDescriptor, G = (e, t, r, o) => {
|
|
76
|
-
for (var s = o > 1 ? void 0 : o ? z(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
77
|
-
(a = e[n]) && (s = a(s) || s);
|
|
78
|
-
return s;
|
|
79
|
-
}, J = (e, t) => (r, o) => t(r, o, e);
|
|
80
|
-
let v = class extends M {
|
|
81
|
-
constructor(e) {
|
|
82
|
-
super(b), this.pageRevisionManagerProvider = e, this.title = this.t("history.extraTabs.title");
|
|
83
|
-
}
|
|
84
|
-
title;
|
|
85
|
-
order = 3e3;
|
|
86
|
-
id = "history";
|
|
87
|
-
async panel() {
|
|
88
|
-
return $;
|
|
89
|
-
}
|
|
90
|
-
async enabled() {
|
|
91
|
-
return this.pageRevisionManagerProvider.has();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
v = G([
|
|
95
|
-
w(),
|
|
96
|
-
J(0, D("PageRevisionManagerProvider"))
|
|
97
|
-
], v);
|
|
98
|
-
class te {
|
|
99
|
-
constructor(t) {
|
|
100
|
-
t.bind("ExtraTab").to(v).inSingletonScope();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
te as ComponentInit
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/translations.ts","../src/vue/HistoryTab.vue","../src/HistoryExtraTab.ts","../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport en from \"../langs/translation-en.json\";\nimport fr from \"../langs/translation-fr.json\";\n\nconst translations: Record<string, Record<string, string>> = {\n en,\n fr,\n};\nexport default translations;\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software 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 GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../translations\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { name as documentServiceName } from \"@xwiki/platform-document-api\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-api\";\nimport type { CristalApp, PageData } from \"@xwiki/platform-api\";\nimport type { DocumentService } from \"@xwiki/platform-document-api\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst documentService = cristal\n .getContainer()\n .get<DocumentService>(documentServiceName);\nconst currentPage: Ref<PageData | undefined> =\n documentService.getCurrentDocument();\nconst revisions: Ref<Array<PageRevision>> = ref([]);\nconst isLoading: Ref<boolean> = ref(true);\n\nonMounted(async () => {\n if (currentPage.value) {\n revisions.value = await cristal\n .getContainer()\n .get<PageRevisionManagerProvider>(\"PageRevisionManagerProvider\")\n .get()\n .getRevisions(currentPage.value);\n }\n isLoading.value = false;\n});\n</script>\n\n<template>\n <p v-if=\"isLoading\">{{ t(\"history.extraTabs.loading\") }}</p>\n <p v-else>\n {{ t(\"history.extraTabs.header\", { nRevisions: revisions.length }) }}\n </p>\n <br />\n <table v-if=\"!isLoading\">\n <tr v-for=\"revision of revisions\" :key=\"revision.version\">\n <td class=\"history-revision-cell\">\n <span class=\"history-revision\">{{ revision.version }}</span>\n </td>\n <td>\n <i18n-t keypath=\"history.extraTabs.entry\" tag=\"span\">\n <template #date>\n <a :href=\"revision.url\">{{\n revision.date.toLocaleString(undefined, {\n dateStyle: \"short\",\n timeStyle: \"short\",\n })\n }}</a>\n </template>\n <template #user>\n <user :user=\"revision.user\" />\n </template>\n </i18n-t>\n <br />\n {{ revision.comment }}\n </td>\n </tr>\n </table>\n</template>\n\n<style scoped>\np {\n font-size: var(--cr-font-size-medium);\n}\ntable {\n border-collapse: collapse;\n}\ntable tr:hover {\n background-color: var(--cr-color-neutral-200);\n}\ntable td {\n vertical-align: top;\n padding: var(--cr-spacing-small);\n}\ntable td:first-child {\n border-radius: var(--cr-border-radius-medium) 0 0\n var(--cr-border-radius-medium);\n}\ntable td:last-child {\n border-radius: 0 var(--cr-border-radius-medium) var(--cr-border-radius-medium)\n 0;\n}\ntable .history-revision-cell {\n text-align: center;\n}\ntable .history-revision {\n background-color: var(--cr-color-neutral-300);\n border-radius: var(--cr-border-radius-pill);\n padding: var(--cr-spacing-2x-small);\n font-size: var(--cr-font-size-x-small);\n}\n</style>\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport messages from \"./translations\";\nimport HistoryTab from \"./vue/HistoryTab.vue\";\nimport { AbstractExtraTab } from \"@xwiki/cristal-extra-tabs-api\";\nimport { inject, injectable } from \"inversify\";\nimport type { PageRevisionManagerProvider } from \"@xwiki/cristal-history-api\";\nimport type { Component } from \"vue\";\n\n@injectable()\nexport class HistoryExtraTab extends AbstractExtraTab {\n title: string;\n\n constructor(\n @inject(\"PageRevisionManagerProvider\")\n private readonly pageRevisionManagerProvider: PageRevisionManagerProvider,\n ) {\n super(messages);\n this.title = this.t(\"history.extraTabs.title\");\n }\n\n order = 3000;\n id = \"history\";\n\n async panel(): Promise<Component> {\n return HistoryTab;\n }\n\n override async enabled(): Promise<boolean> {\n return this.pageRevisionManagerProvider.has();\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { HistoryExtraTab } from \"./HistoryExtraTab\";\nimport type { ExtraTab } from \"@xwiki/cristal-extra-tabs-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container.bind<ExtraTab>(\"ExtraTab\").to(HistoryExtraTab).inSingletonScope();\n }\n}\n"],"names":["translations","en","fr","useI18n","messages","cristal","inject","currentPage","documentServiceName","revisions","ref","isLoading","onMounted","_openBlock","_createElementBlock","_unref","_hoisted_2","_toDisplayString","_createElementVNode","_hoisted_3","_Fragment","_renderList","revision","_hoisted_4","_hoisted_5","_createVNode","_component_i18n_t","User","HistoryExtraTab","AbstractExtraTab","pageRevisionManagerProvider","HistoryTab","__decorateClass","injectable","__decorateParam","ComponentInit","container"],"mappings":";;;;;;;;;;;;;;;;GAuBMA,IAAuD;AAAA,EAC3D,IAAAC;AAAA,EACA,IAAAC;AACF;;;ACOA,UAAM,EAAE,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAsBC,EAAmB,SAAS,GAIlDC,IAHkBF,EACrB,aAAA,EACA,IAAqBG,CAAmB,EAEzB,mBAAA,GACZC,IAAsCC,EAAI,EAAE,GAC5CC,IAA0BD,EAAI,EAAI;AAExC,WAAAE,EAAU,YAAY;AACpB,MAAIL,EAAY,UACdE,EAAU,QAAQ,MAAMJ,EACrB,aAAA,EACA,IAAiC,6BAA6B,EAC9D,IAAA,EACA,aAAaE,EAAY,KAAK,IAEnCI,EAAU,QAAQ;AAAA,IACpB,CAAC;;;QAIUA,EAAA,SAATE,EAAA,GAAAC,EAA4D,UAArCC,EAAA,CAAA,EAAC,2BAAA,CAAA,GAAA,CAAA,MACxBF,EAAA,GAAAC,EAEI,KAAAE,GAAAC,EADCF,EAAA,CAAA,EAAC,4BAAA,EAAA,YAA2CN,EAAA,MAAU,OAAA,CAAM,CAAA,GAAA,CAAA;AAAA,wBAEjES,EA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zB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAe,UAAU,EAAE,GAAGR,CAAe,EAAE,iBAAA;AAAA,EAC3D;AACF;"}
|
package/dist/index.umd.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("p[data-v-2d247591]{font-size:var(--cr-font-size-medium)}table[data-v-2d247591]{border-collapse:collapse}table tr[data-v-2d247591]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-2d247591]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-2d247591]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-2d247591]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-2d247591]{text-align:center}table .history-revision[data-v-2d247591]{background-color:var(--cr-color-neutral-300);border-radius:var(--cr-border-radius-pill);padding:var(--cr-spacing-2x-small);font-size:var(--cr-font-size-x-small)}")),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@xwiki/cristal-user-ui"),require("@xwiki/platform-document-api"),require("vue-i18n"),require("@xwiki/cristal-extra-tabs-api"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","vue","@xwiki/cristal-user-ui","@xwiki/platform-document-api","vue-i18n","@xwiki/cristal-extra-tabs-api","inversify"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["cristal_history-ui"]={},t.Vue,t.cristalUserUi,t.platformDocumentApi,t.vueI18n,t.cristalExtraTabsApi,t.inversify))})(this,(function(t,e,h,b,g,_,m){"use strict";var u=document.createElement("style");u.textContent=`p[data-v-2d247591]{font-size:var(--cr-font-size-medium)}table[data-v-2d247591]{border-collapse:collapse}table tr[data-v-2d247591]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-2d247591]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-2d247591]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-2d247591]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-2d247591]{text-align:center}table .history-revision[data-v-2d247591]{background-color:var(--cr-color-neutral-300);border-radius:var(--cr-border-radius-pill);padding:var(--cr-spacing-2x-small);font-size:var(--cr-font-size-x-small)}
|
|
3
|
-
/*$vite$:1*/`,document.head.appendChild(u);const y={en:{"history.extraTabs.title":"History","history.extraTabs.loading":"Loading...","history.extraTabs.header":"This page has {nRevisions} versions stored.","history.extraTabs.entry":"{date} by {user}"},fr:{"history.extraTabs.title":"Historique","history.extraTabs.loading":"Chargement en cours ...","history.extraTabs.header":"Ce document a {nRevisions} versions stockées.","history.extraTabs.entry":"{date} par {user}"}},f={key:0},x={key:1},v={key:2},k={class:"history-revision-cell"},T={class:"history-revision"},E=["href"],C=((r,a)=>{const n=r.__vccOpts||r;for(const[o,i]of a)n[o]=i;return n})(e.defineComponent({__name:"HistoryTab",setup(r){const{t:a}=g.useI18n({messages:y}),n=e.inject("cristal"),i=n.getContainer().get(b.name).getCurrentDocument(),s=e.ref([]),c=e.ref(!0);return e.onMounted(async()=>{i.value&&(s.value=await n.getContainer().get("PageRevisionManagerProvider").get().getRevisions(i.value)),c.value=!1}),(j,d)=>{const V=e.resolveComponent("i18n-t");return e.openBlock(),e.createElementBlock(e.Fragment,null,[c.value?(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(e.unref(a)("history.extraTabs.loading")),1)):(e.openBlock(),e.createElementBlock("p",x,e.toDisplayString(e.unref(a)("history.extraTabs.header",{nRevisions:s.value.length})),1)),d[1]||(d[1]=e.createElementVNode("br",null,null,-1)),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("table",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,l=>(e.openBlock(),e.createElementBlock("tr",{key:l.version},[e.createElementVNode("td",k,[e.createElementVNode("span",T,e.toDisplayString(l.version),1)]),e.createElementVNode("td",null,[e.createVNode(V,{keypath:"history.extraTabs.entry",tag:"span"},{date:e.withCtx(()=>[e.createElementVNode("a",{href:l.url},e.toDisplayString(l.date.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})),9,E)]),user:e.withCtx(()=>[e.createVNode(e.unref(h.User),{user:l.user},null,8,["user"])]),_:2},1024),d[0]||(d[0]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l.comment),1)])]))),128))]))],64)}}}),[["__scopeId","data-v-2d247591"]]);var S=Object.getOwnPropertyDescriptor,B=(r,a,n,o)=>{for(var i=o>1?void 0:o?S(a,n):a,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},w=(r,a)=>(n,o)=>a(n,o,r);let p=class extends _.AbstractExtraTab{constructor(r){super(y),this.pageRevisionManagerProvider=r,this.title=this.t("history.extraTabs.title")}title;order=3e3;id="history";async panel(){return C}async enabled(){return this.pageRevisionManagerProvider.has()}};p=B([m.injectable(),w(0,m.inject("PageRevisionManagerProvider"))],p);class P{constructor(a){a.bind("ExtraTab").to(p).inSingletonScope()}}t.ComponentInit=P,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
4
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/translations.ts","../src/vue/HistoryTab.vue","../src/HistoryExtraTab.ts","../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport en from \"../langs/translation-en.json\";\nimport fr from \"../langs/translation-fr.json\";\n\nconst translations: Record<string, Record<string, string>> = {\n en,\n fr,\n};\nexport default translations;\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software 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 GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../translations\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { name as documentServiceName } from \"@xwiki/platform-document-api\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-api\";\nimport type { CristalApp, PageData } from \"@xwiki/platform-api\";\nimport type { DocumentService } from \"@xwiki/platform-document-api\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst documentService = cristal\n .getContainer()\n .get<DocumentService>(documentServiceName);\nconst currentPage: Ref<PageData | undefined> =\n documentService.getCurrentDocument();\nconst revisions: Ref<Array<PageRevision>> = ref([]);\nconst isLoading: Ref<boolean> = ref(true);\n\nonMounted(async () => {\n if (currentPage.value) {\n revisions.value = await cristal\n .getContainer()\n .get<PageRevisionManagerProvider>(\"PageRevisionManagerProvider\")\n .get()\n .getRevisions(currentPage.value);\n }\n isLoading.value = false;\n});\n</script>\n\n<template>\n <p v-if=\"isLoading\">{{ t(\"history.extraTabs.loading\") }}</p>\n <p v-else>\n {{ t(\"history.extraTabs.header\", { nRevisions: revisions.length }) }}\n </p>\n <br />\n <table v-if=\"!isLoading\">\n <tr v-for=\"revision of revisions\" :key=\"revision.version\">\n <td class=\"history-revision-cell\">\n <span class=\"history-revision\">{{ revision.version }}</span>\n </td>\n <td>\n <i18n-t keypath=\"history.extraTabs.entry\" tag=\"span\">\n <template #date>\n <a :href=\"revision.url\">{{\n revision.date.toLocaleString(undefined, {\n dateStyle: \"short\",\n timeStyle: \"short\",\n })\n }}</a>\n </template>\n <template #user>\n <user :user=\"revision.user\" />\n </template>\n </i18n-t>\n <br />\n {{ revision.comment }}\n </td>\n </tr>\n </table>\n</template>\n\n<style scoped>\np {\n font-size: var(--cr-font-size-medium);\n}\ntable {\n border-collapse: collapse;\n}\ntable tr:hover {\n background-color: var(--cr-color-neutral-200);\n}\ntable td {\n vertical-align: top;\n padding: var(--cr-spacing-small);\n}\ntable td:first-child {\n border-radius: var(--cr-border-radius-medium) 0 0\n var(--cr-border-radius-medium);\n}\ntable td:last-child {\n border-radius: 0 var(--cr-border-radius-medium) var(--cr-border-radius-medium)\n 0;\n}\ntable .history-revision-cell {\n text-align: center;\n}\ntable .history-revision {\n background-color: var(--cr-color-neutral-300);\n border-radius: var(--cr-border-radius-pill);\n padding: var(--cr-spacing-2x-small);\n font-size: var(--cr-font-size-x-small);\n}\n</style>\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport messages from \"./translations\";\nimport HistoryTab from \"./vue/HistoryTab.vue\";\nimport { AbstractExtraTab } from \"@xwiki/cristal-extra-tabs-api\";\nimport { inject, injectable } from \"inversify\";\nimport type { PageRevisionManagerProvider } from \"@xwiki/cristal-history-api\";\nimport type { Component } from \"vue\";\n\n@injectable()\nexport class HistoryExtraTab extends AbstractExtraTab {\n title: string;\n\n constructor(\n @inject(\"PageRevisionManagerProvider\")\n private readonly pageRevisionManagerProvider: PageRevisionManagerProvider,\n ) {\n super(messages);\n this.title = this.t(\"history.extraTabs.title\");\n }\n\n order = 3000;\n id = \"history\";\n\n async panel(): Promise<Component> {\n return HistoryTab;\n }\n\n override async enabled(): Promise<boolean> {\n return this.pageRevisionManagerProvider.has();\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { HistoryExtraTab } from \"./HistoryExtraTab\";\nimport type { ExtraTab } from \"@xwiki/cristal-extra-tabs-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container.bind<ExtraTab>(\"ExtraTab\").to(HistoryExtraTab).inSingletonScope();\n }\n}\n"],"names":["translations","t","useI18n","messages","cristal","inject","currentPage","documentServiceName","revisions","ref","isLoading","onMounted","_openBlock","_createElementBlock","_unref","_hoisted_2","_toDisplayString","_createElementVNode","_hoisted_3","_Fragment","_renderList","revision","_hoisted_4","_hoisted_5","_createVNode","_component_i18n_t","User","HistoryExtraTab","AbstractExtraTab","pageRevisionManagerProvider","HistoryTab","__decorateClass","injectable","__decorateParam","ComponentInit","container"],"mappings":";2CAuBA,MAAMA,EAAuD,CAC3D,wMACA,0NACF,iOCOA,KAAM,CAAE,EAAAC,CAAA,EAAMC,UAAQ,CAAA,SACpBC,CAAA,CACD,EACKC,EAAsBC,EAAAA,OAAmB,SAAS,EAIlDC,EAHkBF,EACrB,aAAA,EACA,IAAqBG,EAAAA,IAAmB,EAEzB,mBAAA,EACZC,EAAsCC,EAAAA,IAAI,EAAE,EAC5CC,EAA0BD,EAAAA,IAAI,EAAI,EAExCE,OAAAA,EAAAA,UAAU,SAAY,CAChBL,EAAY,QACdE,EAAU,MAAQ,MAAMJ,EACrB,aAAA,EACA,IAAiC,6BAA6B,EAC9D,IAAA,EACA,aAAaE,EAAY,KAAK,GAEnCI,EAAU,MAAQ,EACpB,CAAC,0GAIUA,EAAA,OAATE,EAAAA,UAAA,EAAAC,EAAAA,mBAA4D,wBAArCC,EAAAA,MAAAb,CAAA,EAAC,2BAAA,CAAA,EAAA,CAAA,IACxBW,EAAAA,UAAA,EAAAC,EAAAA,mBAEI,IAAAE,EAAAC,EAAAA,gBADCF,EAAAA,MAAAb,CAAA,EAAC,2BAAA,CAAA,WAA2CO,EAAA,MAAU,MAAA,CAAM,CAAA,EAAA,CAAA,eAEjES,qBAAM,KAAA,KAAA,KAAA,EAAA,GACQP,EAAA,iDAAdG,EAAAA,mBAuBQ,QAAAK,EAAA,kBAtBNL,EAAAA,mBA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
|
-
* information regarding copyright ownership.
|
|
4
|
-
*
|
|
5
|
-
* This is free software; you can redistribute it and/or modify it
|
|
6
|
-
* under the terms of the GNU Lesser General Public License as
|
|
7
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
8
|
-
* the License, or (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This software is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
-
* Lesser General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Lesser General Public
|
|
16
|
-
* License along with this software; if not, write to the Free
|
|
17
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
18
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
19
|
-
*/
|
|
20
|
-
declare const translations: Record<string, Record<string, string>>;
|
|
21
|
-
export default translations;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|