@xwiki/cristal-history-ui 0.21.1 → 0.22.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/CHANGELOG.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # @xwiki/cristal-history-ui
2
2
 
3
- ## 0.21.1
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Cristal 0.22 Release
4
8
 
5
9
  ### Patch Changes
6
10
 
7
- - Cristal 0.21.1 Release
8
11
  - Updated dependencies
9
- - @xwiki/cristal-api@0.21.1
10
- - @xwiki/cristal-document-api@0.21.1
11
- - @xwiki/cristal-extra-tabs-api@0.21.1
12
- - @xwiki/cristal-history-api@0.21.1
13
- - @xwiki/cristal-user-ui@0.21.1
12
+ - @xwiki/cristal-api@0.22.0
13
+ - @xwiki/cristal-document-api@0.22.0
14
+ - @xwiki/cristal-extra-tabs-api@0.22.0
15
+ - @xwiki/cristal-history-api@0.22.0
16
+ - @xwiki/cristal-user-ui@0.22.0
14
17
 
15
18
  ## 0.21.0
16
19
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../api-extractor.json"
4
+ }
@@ -1,6 +1,6 @@
1
1
  import { AbstractExtraTab } from '@xwiki/cristal-extra-tabs-api';
2
- import { Component } from 'vue';
3
2
  import { PageRevisionManagerProvider } from '@xwiki/cristal-history-api';
3
+ import { Component } from 'vue';
4
4
  export declare class HistoryExtraTab extends AbstractExtraTab {
5
5
  private readonly pageRevisionManagerProvider;
6
6
  title: string;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,7 @@
1
1
  import { Container } from 'inversify';
2
+ /**
3
+ * @beta
4
+ */
2
5
  export declare class ComponentInit {
3
6
  constructor(container: Container);
4
7
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import { Container } from 'inversify';
2
+ /**
3
+ * @beta
4
+ */
2
5
  export declare class ComponentInit {
3
6
  constructor(container: Container);
4
7
  }
package/dist/index.es.js CHANGED
@@ -79,8 +79,11 @@ var z = Object.getOwnPropertyDescriptor, G = (e, t, r, o) => {
79
79
  }, J = (e, t) => (r, o) => t(r, o, e);
80
80
  let v = class extends M {
81
81
  constructor(e) {
82
- super(b), this.pageRevisionManagerProvider = e, this.order = 3e3, this.id = "history", this.title = this.t("history.extraTabs.title");
82
+ super(b), this.pageRevisionManagerProvider = e, this.title = this.t("history.extraTabs.title");
83
83
  }
84
+ title;
85
+ order = 3e3;
86
+ id = "history";
84
87
  async panel() {
85
88
  return $;
86
89
  }
@@ -1 +1 @@
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 { name as documentServiceName } from \"@xwiki/cristal-document-api\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { CristalApp, PageData } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-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 { Component } from \"vue\";\nimport type { PageRevisionManagerProvider } from \"@xwiki/cristal-history-api\";\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\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,EAAM,MAAA,MAAA,MAAA,EAAA;AAAA,QACQP,EAAA,0BAAdG,EAuBQ,SAAAK,GAAA;AAAA,kBAtBNL,EAqBKM,GAAA,MAAAC,EArBkBZ,EAAA,OAAS,CAArBa,YAAXR,EAqBK,MAAA;AAAA,YArB8B,KAAKQ,EAAS;AAAA,UAAA;YAC/CJ,EAEK,MAFLK,GAEK;AAAA,cADHL,EAA4D,QAA5DM,GAA4DP,EAA1BK,EAAS,OAAO,GAAA,CAAA;AAAA,YAAA;YAEpDJ,EAgBK,MAAA,MAAA;AAAA,cAfHO,EAYSC,GAAA;AAAA,gBAZD,SAAQ;AAAA,gBAA0B,KAAI;AAAA,cAAA;gBACjC,QACT,MAKM;AAAA,kBALNR,EAKM,KAAA;AAAA,oBALF,MAAMI,EAAS;AAAA,kBAAA,GACjBL,EAAAK,EAAS,KAAK,eAAe,QAAS;AAAA;;;;gBAM/B,QACT,MAA8B;AAAA,kBAA9BG,EAA8BV,EAAAY,CAAA,GAAA;AAAA,oBAAvB,MAAML,EAAS;AAAA,kBAAA;;;;8BAG1BJ,EAAM,MAAA,MAAA,MAAA,EAAA;AAAA,gBAAA,MACND,EAAGK,EAAS,OAAO,GAAA,CAAA;AAAA,YAAA;;;;;;;;;;;;;;;;;ACvDpB,IAAMM,IAAN,cAA8BC,EAAiB;AAAA,EAGpD,YAEmBC,GACjB;AACA,UAAM1B,CAAQ,GAFG,KAAA,8BAAA0B,GAMnB,KAAA,QAAQ,KACR,KAAA,KAAK,WAJH,KAAK,QAAQ,KAAK,EAAE,yBAAyB;AAAA,EAC/C;AAAA,EAKA,MAAM,QAA4B;AAChC,WAAOC;AAAA,EACT;AAAA,EAEA,MAAe,UAA4B;AACzC,WAAO,KAAK,4BAA4B,IAAA;AAAA,EAC1C;AACF;AArBaH,IAANI,EAAA;AAAA,EADNC,EAAA;AAAA,EAKIC,OAAO,6BAA6B,CAAA;AAAA,GAJ5BN,CAAA;ACJN,MAAMO,GAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAe,UAAU,EAAE,GAAGR,CAAe,EAAE,iBAAA;AAAA,EAC3D;AACF;"}
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 { name as documentServiceName } from \"@xwiki/cristal-document-api\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { CristalApp, PageData } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-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,EAAM,MAAA,MAAA,MAAA,EAAA;AAAA,QACQP,EAAA,0BAAdG,EAuBQ,SAAAK,GAAA;AAAA,kBAtBNL,EAqBKM,GAAA,MAAAC,EArBkBZ,EAAA,OAAS,CAArBa,YAAXR,EAqBK,MAAA;AAAA,YArB8B,KAAKQ,EAAS;AAAA,UAAA;YAC/CJ,EAEK,MAFLK,GAEK;AAAA,cADHL,EAA4D,QAA5DM,GAA4DP,EAA1BK,EAAS,OAAO,GAAA,CAAA;AAAA,YAAA;YAEpDJ,EAgBK,MAAA,MAAA;AAAA,cAfHO,EAYSC,GAAA;AAAA,gBAZD,SAAQ;AAAA,gBAA0B,KAAI;AAAA,cAAA;gBACjC,QACT,MAKM;AAAA,kBALNR,EAKM,KAAA;AAAA,oBALF,MAAMI,EAAS;AAAA,kBAAA,GACjBL,EAAAK,EAAS,KAAK,eAAe,QAAS;AAAA;;;;gBAM/B,QACT,MAA8B;AAAA,kBAA9BG,EAA8BV,EAAAY,CAAA,GAAA;AAAA,oBAAvB,MAAML,EAAS;AAAA,kBAAA;;;;8BAG1BJ,EAAM,MAAA,MAAA,MAAA,EAAA;AAAA,gBAAA,MACND,EAAGK,EAAS,OAAO,GAAA,CAAA;AAAA,YAAA;;;;;;;;;;;;;;;;;ACvDpB,IAAMM,IAAN,cAA8BC,EAAiB;AAAA,EAGpD,YAEmBC,GACjB;AACA,UAAM1B,CAAQ,GAFG,KAAA,8BAAA0B,GAGjB,KAAK,QAAQ,KAAK,EAAE,yBAAyB;AAAA,EAC/C;AAAA,EARA;AAAA,EAUA,QAAQ;AAAA,EACR,KAAK;AAAA,EAEL,MAAM,QAA4B;AAChC,WAAOC;AAAA,EACT;AAAA,EAEA,MAAe,UAA4B;AACzC,WAAO,KAAK,4BAA4B,IAAA;AAAA,EAC1C;AACF;AArBaH,IAANI,EAAA;AAAA,EADNC,EAAA;AAAA,EAKIC,OAAO,6BAA6B,CAAA;AAAA,GAJ5BN,CAAA;ACDN,MAAMO,GAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAe,UAAU,EAAE,GAAGR,CAAe,EAAE,iBAAA;AAAA,EAC3D;AACF;"}
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("p[data-v-4c710495]{font-size:var(--cr-font-size-medium)}table[data-v-4c710495]{border-collapse:collapse}table tr[data-v-4c710495]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-4c710495]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-4c710495]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-4c710495]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-4c710495]{text-align:center}table .history-revision[data-v-4c710495]{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-document-api"),require("@xwiki/cristal-user-ui"),require("vue-i18n"),require("@xwiki/cristal-extra-tabs-api"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","vue","@xwiki/cristal-document-api","@xwiki/cristal-user-ui","vue-i18n","@xwiki/cristal-extra-tabs-api","inversify"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["cristal_history-ui"]={},t.Vue,t.cristalDocumentApi,t.cristalUserUi,t.vueI18n,t.cristalExtraTabsApi,t.inversify))})(this,function(t,e,y,b,g,_,u){"use strict";var m=document.createElement("style");m.textContent=`p[data-v-4c710495]{font-size:var(--cr-font-size-medium)}table[data-v-4c710495]{border-collapse:collapse}table tr[data-v-4c710495]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-4c710495]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-4c710495]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-4c710495]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-4c710495]{text-align:center}table .history-revision[data-v-4c710495]{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(m);const h={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 i=r.__vccOpts||r;for(const[s,n]of a)i[s]=n;return i})(e.defineComponent({__name:"HistoryTab",setup(r){const{t:a}=g.useI18n({messages:h}),i=e.inject("cristal"),n=i.getContainer().get(y.name).getCurrentDocument(),o=e.ref([]),c=e.ref(!0);return e.onMounted(async()=>{n.value&&(o.value=await i.getContainer().get("PageRevisionManagerProvider").get().getRevisions(n.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:o.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(o.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(b.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-4c710495"]]);var S=Object.getOwnPropertyDescriptor,B=(r,a,i,s)=>{for(var n=s>1?void 0:s?S(a,i):a,o=r.length-1,c;o>=0;o--)(c=r[o])&&(n=c(n)||n);return n},w=(r,a)=>(i,s)=>a(i,s,r);let p=class extends _.AbstractExtraTab{constructor(r){super(h),this.pageRevisionManagerProvider=r,this.order=3e3,this.id="history",this.title=this.t("history.extraTabs.title")}async panel(){return C}async enabled(){return this.pageRevisionManagerProvider.has()}};p=B([u.injectable(),w(0,u.inject("PageRevisionManagerProvider"))],p);class P{constructor(a){a.bind("ExtraTab").to(p).inSingletonScope()}}t.ComponentInit=P,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
2
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@xwiki/cristal-document-api"),require("@xwiki/cristal-user-ui"),require("vue-i18n"),require("@xwiki/cristal-extra-tabs-api"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","vue","@xwiki/cristal-document-api","@xwiki/cristal-user-ui","vue-i18n","@xwiki/cristal-extra-tabs-api","inversify"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["cristal_history-ui"]={},t.Vue,t.cristalDocumentApi,t.cristalUserUi,t.vueI18n,t.cristalExtraTabsApi,t.inversify))})(this,(function(t,e,h,b,g,_,u){"use strict";var m=document.createElement("style");m.textContent=`p[data-v-4c710495]{font-size:var(--cr-font-size-medium)}table[data-v-4c710495]{border-collapse:collapse}table tr[data-v-4c710495]:hover{background-color:var(--cr-color-neutral-200)}table td[data-v-4c710495]{vertical-align:top;padding:var(--cr-spacing-small)}table td[data-v-4c710495]:first-child{border-radius:var(--cr-border-radius-medium) 0 0 var(--cr-border-radius-medium)}table td[data-v-4c710495]:last-child{border-radius:0 var(--cr-border-radius-medium) var(--cr-border-radius-medium) 0}table .history-revision-cell[data-v-4c710495]{text-align:center}table .history-revision[data-v-4c710495]{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(m);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 i=r.__vccOpts||r;for(const[s,n]of a)i[s]=n;return i})(e.defineComponent({__name:"HistoryTab",setup(r){const{t:a}=g.useI18n({messages:y}),i=e.inject("cristal"),n=i.getContainer().get(h.name).getCurrentDocument(),o=e.ref([]),c=e.ref(!0);return e.onMounted(async()=>{n.value&&(o.value=await i.getContainer().get("PageRevisionManagerProvider").get().getRevisions(n.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:o.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(o.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(b.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-4c710495"]]);var S=Object.getOwnPropertyDescriptor,B=(r,a,i,s)=>{for(var n=s>1?void 0:s?S(a,i):a,o=r.length-1,c;o>=0;o--)(c=r[o])&&(n=c(n)||n);return n},w=(r,a)=>(i,s)=>a(i,s,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([u.injectable(),w(0,u.inject("PageRevisionManagerProvider"))],p);class P{constructor(a){a.bind("ExtraTab").to(p).inSingletonScope()}}t.ComponentInit=P,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
4
4
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
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 { name as documentServiceName } from \"@xwiki/cristal-document-api\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { CristalApp, PageData } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-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 { Component } from \"vue\";\nimport type { PageRevisionManagerProvider } from \"@xwiki/cristal-history-api\";\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\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,mBAqBKM,EAAAA,SAAA,KAAAC,EAAAA,WArBkBZ,EAAA,MAAZa,kBAAXR,EAAAA,mBAqBK,KAAA,CArB8B,IAAKQ,EAAS,OAAA,GAC/CJ,EAAAA,mBAEK,KAFLK,EAEK,CADHL,EAAAA,mBAA4D,OAA5DM,EAA4DP,EAAAA,gBAA1BK,EAAS,OAAO,EAAA,CAAA,CAAA,GAEpDJ,EAAAA,mBAgBK,KAAA,KAAA,CAfHO,EAAAA,YAYSC,EAAA,CAZD,QAAQ,0BAA0B,IAAI,MAAA,GACjC,eACT,IAKM,CALNR,EAAAA,mBAKM,IAAA,CALF,KAAMI,EAAS,GAAA,EACjBL,EAAAA,gBAAAK,EAAS,KAAK,eAAe,OAAS,+CAM/B,eACT,IAA8B,CAA9BG,cAA8BV,EAAAA,MAAAY,EAAAA,IAAA,EAAA,CAAvB,KAAML,EAAS,IAAA,4CAG1BJ,qBAAM,KAAA,KAAA,KAAA,EAAA,qBAAA,IACND,EAAAA,gBAAGK,EAAS,OAAO,EAAA,CAAA,CAAA,iOCvDpB,IAAMM,EAAN,cAA8BC,EAAAA,gBAAiB,CAGpD,YAEmBC,EACjB,CACA,MAAM1B,CAAQ,EAFG,KAAA,4BAAA0B,EAMnB,KAAA,MAAQ,IACR,KAAA,GAAK,UAJH,KAAK,MAAQ,KAAK,EAAE,yBAAyB,CAC/C,CAKA,MAAM,OAA4B,CAChC,OAAOC,CACT,CAEA,MAAe,SAA4B,CACzC,OAAO,KAAK,4BAA4B,IAAA,CAC1C,CACF,EArBaH,EAANI,EAAA,CADNC,aAAA,EAKIC,aAAO,6BAA6B,CAAA,CAAA,EAJ5BN,CAAA,ECJN,MAAMO,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAe,UAAU,EAAE,GAAGR,CAAe,EAAE,iBAAA,CAC3D,CACF"}
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 { name as documentServiceName } from \"@xwiki/cristal-document-api\";\nimport { User } from \"@xwiki/cristal-user-ui\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { CristalApp, PageData } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type {\n PageRevision,\n PageRevisionManagerProvider,\n} from \"@xwiki/cristal-history-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,mBAqBKM,EAAAA,SAAA,KAAAC,EAAAA,WArBkBZ,EAAA,MAAZa,kBAAXR,EAAAA,mBAqBK,KAAA,CArB8B,IAAKQ,EAAS,OAAA,GAC/CJ,EAAAA,mBAEK,KAFLK,EAEK,CADHL,EAAAA,mBAA4D,OAA5DM,EAA4DP,EAAAA,gBAA1BK,EAAS,OAAO,EAAA,CAAA,CAAA,GAEpDJ,EAAAA,mBAgBK,KAAA,KAAA,CAfHO,EAAAA,YAYSC,EAAA,CAZD,QAAQ,0BAA0B,IAAI,MAAA,GACjC,eACT,IAKM,CALNR,EAAAA,mBAKM,IAAA,CALF,KAAMI,EAAS,GAAA,EACjBL,EAAAA,gBAAAK,EAAS,KAAK,eAAe,OAAS,+CAM/B,eACT,IAA8B,CAA9BG,cAA8BV,EAAAA,MAAAY,EAAAA,IAAA,EAAA,CAAvB,KAAML,EAAS,IAAA,4CAG1BJ,qBAAM,KAAA,KAAA,KAAA,EAAA,qBAAA,IACND,EAAAA,gBAAGK,EAAS,OAAO,EAAA,CAAA,CAAA,iOCvDpB,IAAMM,EAAN,cAA8BC,EAAAA,gBAAiB,CAGpD,YAEmBC,EACjB,CACA,MAAM1B,CAAQ,EAFG,KAAA,4BAAA0B,EAGjB,KAAK,MAAQ,KAAK,EAAE,yBAAyB,CAC/C,CARA,MAUA,MAAQ,IACR,GAAK,UAEL,MAAM,OAA4B,CAChC,OAAOC,CACT,CAEA,MAAe,SAA4B,CACzC,OAAO,KAAK,4BAA4B,IAAA,CAC1C,CACF,EArBaH,EAANI,EAAA,CADNC,aAAA,EAKIC,aAAO,6BAA6B,CAAA,CAAA,EAJ5BN,CAAA,ECDN,MAAMO,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAe,UAAU,EAAE,GAAGR,CAAe,EAAE,iBAAA,CAC3D,CACF"}
@@ -0,0 +1,16 @@
1
+ ## API Report File for "@xwiki/cristal-history-ui"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Container } from 'inversify';
8
+
9
+ // @beta (undocumented)
10
+ export class ComponentInit {
11
+ constructor(container: Container);
12
+ }
13
+
14
+ // (No @packageDocumentation comment for this package)
15
+
16
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-history-ui",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -26,14 +26,15 @@
26
26
  }
27
27
  },
28
28
  "main": "./dist/index.es.js",
29
+ "types": "./dist/index.d.ts",
29
30
  "dependencies": {
30
31
  "vue-i18n": "11.1.11",
31
32
  "vue-router": "4.5.1",
32
- "@xwiki/cristal-api": "0.21.1",
33
- "@xwiki/cristal-history-api": "0.21.1",
34
- "@xwiki/cristal-document-api": "0.21.1",
35
- "@xwiki/cristal-user-ui": "0.21.1",
36
- "@xwiki/cristal-extra-tabs-api": "0.21.1"
33
+ "@xwiki/cristal-api": "0.22.0",
34
+ "@xwiki/cristal-document-api": "0.22.0",
35
+ "@xwiki/cristal-extra-tabs-api": "0.22.0",
36
+ "@xwiki/cristal-history-api": "0.22.0",
37
+ "@xwiki/cristal-user-ui": "0.22.0"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "inversify": "7.x",
@@ -41,20 +42,21 @@
41
42
  "vue": "3.x"
42
43
  },
43
44
  "devDependencies": {
44
- "inversify": "7.7.0",
45
+ "inversify": "7.9.0",
45
46
  "reflect-metadata": "0.2.2",
46
47
  "typescript": "5.9.2",
47
- "vite": "7.0.6",
48
- "vue": "3.5.18",
48
+ "vite": "7.1.5",
49
+ "vue": "3.5.20",
49
50
  "vue-tsc": "2.2.12",
50
- "@xwiki/cristal-dev-config": "0.21.1",
51
- "@xwiki/cristal-dsapi": "0.21.1"
51
+ "@xwiki/cristal-dev-config": "0.22.0",
52
+ "@xwiki/cristal-dsapi": "0.22.0"
52
53
  },
53
54
  "scripts": {
54
- "build": "vue-tsc --project tsconfig.json && vite build",
55
+ "api-extractor:local": "api-extractor run --local",
56
+ "build": "vite build",
55
57
  "clean": "rimraf dist",
56
58
  "lint": "eslint \"./src/**/*.{ts,tsx,vue}\" --max-warnings=0",
57
- "test": "vitest --run"
58
- },
59
- "types": "./dist/index.d.ts"
59
+ "test": "vitest --run",
60
+ "typecheck": "vue-tsc"
61
+ }
60
62
  }
@@ -22,8 +22,8 @@ import messages from "./translations";
22
22
  import HistoryTab from "./vue/HistoryTab.vue";
23
23
  import { AbstractExtraTab } from "@xwiki/cristal-extra-tabs-api";
24
24
  import { inject, injectable } from "inversify";
25
- import { Component } from "vue";
26
25
  import type { PageRevisionManagerProvider } from "@xwiki/cristal-history-api";
26
+ import type { Component } from "vue";
27
27
 
28
28
  @injectable()
29
29
  export class HistoryExtraTab extends AbstractExtraTab {
package/src/index.ts CHANGED
@@ -22,6 +22,9 @@ import { HistoryExtraTab } from "./HistoryExtraTab";
22
22
  import type { ExtraTab } from "@xwiki/cristal-extra-tabs-api";
23
23
  import type { Container } from "inversify";
24
24
 
25
+ /**
26
+ * @beta
27
+ */
25
28
  export class ComponentInit {
26
29
  constructor(container: Container) {
27
30
  container.bind<ExtraTab>("ExtraTab").to(HistoryExtraTab).inSingletonScope();
package/vitest.config.ts CHANGED
@@ -19,7 +19,7 @@
19
19
  */
20
20
 
21
21
  import localConfig from "./vite.config";
22
+ import { vitestVue as defaultConfig } from "@xwiki/cristal-dev-config";
22
23
  import { mergeConfig } from "vitest/config";
23
- import defaultConfig from "@xwiki/cristal-dev-config/vitest-vue.config";
24
24
 
25
25
  export default mergeConfig(defaultConfig, localConfig);