@pristy/pristy-libvue 0.25.2 → 0.26.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.
@@ -1,9 +1,9 @@
1
1
  import { AlfrescoApi as WM, ContentApi as sM, UploadApi as LM, RenditionsApi as pM, NodesApi as wM, SitesApi as xM, SearchApi as GM, PeopleApi as oM, FavoritesApi as nM, TrashcanApi as SM, GroupsApi as XM, SharedlinksApi as hM, VersionsApi as EM, ActionsApi as UM, CategoriesApi as kM, CommentsApi as QM, DownloadsApi as rM, TagsApi as vM, AspectsApi as RM, TypesApi as JM, WebscriptApi as FM } from "@alfresco/js-api";
2
2
  import { createI18n as BM } from "vue-i18n";
3
- import { defineStore as Y } from "pinia";
3
+ import { defineStore as O } from "pinia";
4
4
  import W from "axios";
5
5
  import { openBlock as HM, createElementBlock as VM } from "vue";
6
- const t = new WM(), y = new sM(t), PM = new LM(t), s = new pM(t), z = new wM(t), C = new xM(t), J = new GM(t), x = new oM(t), o = new nM(t), FI = new SM(t), F = new XM(t), L = new hM(t), e = new EM(t), BI = new UM(t), HI = new kM(t), VI = new QM(t), PI = new rM(t), KI = new vM(t), fI = new RM(t), _I = new JM(t), KM = new FM(t), B = "fichier", H = "dossier", V = {
6
+ const t = new WM(), Y = new sM(t), PM = new LM(t), s = new pM(t), z = new wM(t), C = new xM(t), J = new GM(t), x = new oM(t), o = new nM(t), FI = new SM(t), F = new XM(t), L = new hM(t), e = new EM(t), BI = new UM(t), HI = new kM(t), VI = new QM(t), PI = new rM(t), KI = new vM(t), fI = new RM(t), _I = new JM(t), KM = new FM(t), B = "fichier", H = "dossier", V = {
7
7
  401: "Vous n'\xEAtes pas ou plus connect\xE9.",
8
8
  502: "La r\xE9ponse re\xE7ue est non valide.",
9
9
  504: "Le d\xE9lai d'attente de la r\xE9ponse \xE0 \xE9t\xE9 d\xE9pass\xE9.",
@@ -768,10 +768,10 @@ i.prototype.mainError = function() {
768
768
  for (var D = 0; D < b.length; D++) {
769
769
  var m = b[D], l = I[m];
770
770
  I[m] = function(T) {
771
- var O = N.operation(g), d = Array.prototype.slice.call(arguments, 1), G = d.pop();
771
+ var y = N.operation(g), d = Array.prototype.slice.call(arguments, 1), G = d.pop();
772
772
  d.push(function(U) {
773
- O.retry(U) || (U && (arguments[0] = O.mainError()), G.apply(this, arguments));
774
- }), O.attempt(function() {
773
+ y.retry(U) || (U && (arguments[0] = y.mainError()), G.apply(this, arguments));
774
+ }), y.attempt(function() {
775
775
  T.apply(I, d);
776
776
  });
777
777
  }.bind(I, l), I[m].options = g;
@@ -789,22 +789,22 @@ function zI(N, M) {
789
789
  function m(T) {
790
790
  b(T || new Error("Aborted"));
791
791
  }
792
- function l(T, O) {
792
+ function l(T, y) {
793
793
  if (T.bail) {
794
794
  m(T);
795
795
  return;
796
796
  }
797
- D.retry(T) ? A.onRetry && A.onRetry(T, O) : b(D.mainError());
797
+ D.retry(T) ? A.onRetry && A.onRetry(T, y) : b(D.mainError());
798
798
  }
799
799
  function a(T) {
800
- var O;
800
+ var y;
801
801
  try {
802
- O = N(m, T);
802
+ y = N(m, T);
803
803
  } catch (d) {
804
804
  l(d, T);
805
805
  return;
806
806
  }
807
- Promise.resolve(O).then(g).catch(function(G) {
807
+ Promise.resolve(y).then(g).catch(function(G) {
808
808
  l(G, T);
809
809
  });
810
810
  }
@@ -815,16 +815,16 @@ function zI(N, M) {
815
815
  var k = zI;
816
816
  class CI {
817
817
  getThumbnailUrl(M) {
818
- return y.getDocumentThumbnailUrl(M);
818
+ return Y.getDocumentThumbnailUrl(M);
819
819
  }
820
820
  getPreviewUrl(M) {
821
- return y.getDocumentPreviewUrl(M);
821
+ return Y.getDocumentPreviewUrl(M);
822
822
  }
823
823
  getContentUrl(M) {
824
- return y.getContentUrl(M);
824
+ return Y.getContentUrl(M);
825
825
  }
826
826
  getVersionContentUrl(M, I) {
827
- return y.getVersionContentUrl(M, I);
827
+ return Y.getVersionContentUrl(M, I);
828
828
  }
829
829
  uploadFile(M, I, g) {
830
830
  return PM.uploadFile(g, null, M, null, I).on("progress", (b) => {
@@ -873,11 +873,11 @@ class CI {
873
873
  id: I
874
874
  }), new Error("NOT_CREATED");
875
875
  if (g.entry.status === "CREATED")
876
- return y.getRenditionUrl(M, I);
876
+ return Y.getRenditionUrl(M, I);
877
877
  throw new Error(g.entry.status);
878
878
  }).catch((g) => {
879
879
  if (console.error("createRendition", g), g.status === 409)
880
- return y.getRenditionUrl(M, I);
880
+ return Y.getRenditionUrl(M, I);
881
881
  throw g;
882
882
  }),
883
883
  {
@@ -896,7 +896,7 @@ class CI {
896
896
  id: g
897
897
  }), new Error("NOT_CREATED");
898
898
  if (b.entry.status === "CREATED")
899
- return y.getVersionRenditionUrl(
899
+ return Y.getVersionRenditionUrl(
900
900
  M,
901
901
  I,
902
902
  g
@@ -904,7 +904,7 @@ class CI {
904
904
  throw new Error(b.entry.status);
905
905
  }).catch((b) => {
906
906
  if (console.error("createRendition", b), b.status === 409)
907
- return y.getVersionRenditionUrl(
907
+ return Y.getVersionRenditionUrl(
908
908
  M,
909
909
  I,
910
910
  g
@@ -1287,7 +1287,7 @@ const dM = new iI(), uI = 60 * 1e3;
1287
1287
  function Q(N) {
1288
1288
  return new Promise((M) => setTimeout(M, N));
1289
1289
  }
1290
- const p = Y({
1290
+ const p = O({
1291
1291
  id: "UserStore",
1292
1292
  state: () => ({
1293
1293
  token: "",
@@ -1381,7 +1381,7 @@ const p = Y({
1381
1381
  });
1382
1382
  }
1383
1383
  }
1384
- }), w = Y({
1384
+ }), w = O({
1385
1385
  id: "ConfigStore",
1386
1386
  state: () => ({
1387
1387
  APP_ROOT: "/",
@@ -1526,7 +1526,7 @@ const p = Y({
1526
1526
  });
1527
1527
  }
1528
1528
  }
1529
- }), ZI = Y({
1529
+ }), ZI = O({
1530
1530
  id: "CollaboraStore",
1531
1531
  state: () => ({
1532
1532
  XMLExtensions: null,
@@ -1696,7 +1696,7 @@ class OI {
1696
1696
  return M.content.mimeType.startsWith("image/") ? g = "consultation-image" : M.content.mimeType.startsWith("video/") ? g = "consultation-video" : I.checkIfExists(M.content.mimeType, "edit") ? g = "edit-collabora" : g = "consultation-pdf", g;
1697
1697
  }
1698
1698
  }
1699
- const r = new OI(), v = Y({
1699
+ const r = new OI(), v = O({
1700
1700
  id: "MenuStore",
1701
1701
  state: () => ({
1702
1702
  menu: []
@@ -1924,7 +1924,7 @@ class kI {
1924
1924
  });
1925
1925
  }
1926
1926
  }
1927
- const Ng = new kI(), bg = Y({
1927
+ const Ng = new kI(), bg = O({
1928
1928
  id: "SearchStore",
1929
1929
  state: () => ({
1930
1930
  language: "afts",
@@ -2009,12 +2009,12 @@ const Ng = new kI(), bg = Y({
2009
2009
  this.fields = this.fields.filter((M) => M.query !== N.query);
2010
2010
  }
2011
2011
  }
2012
- }), Ag = Y({
2012
+ }), Ag = O({
2013
2013
  id: "UserPreferencesStore",
2014
2014
  state: () => ({
2015
2015
  listView: !0
2016
2016
  })
2017
- }), Dg = Y({
2017
+ }), Dg = O({
2018
2018
  id: "SelectionStore",
2019
2019
  state: () => ({
2020
2020
  nodes: [],
@@ -2042,7 +2042,7 @@ const Ng = new kI(), bg = Y({
2042
2042
  });
2043
2043
  }
2044
2044
  }
2045
- }), cg = Y({
2045
+ }), cg = O({
2046
2046
  id: "NavigationStore",
2047
2047
  state: () => ({
2048
2048
  currentNode: null,
@@ -2061,10 +2061,35 @@ const Ng = new kI(), bg = Y({
2061
2061
  actions: {
2062
2062
  load(N, M, I) {
2063
2063
  var g, b;
2064
- return !I && N === ((g = this.workspace) == null ? void 0 : g.id) && M === ((b = this.currentNode) == null ? void 0 : b.id) ? Promise.resolve() : (this.loading = !0, this.emptyFolder = !1, this.pagination = null, dM.getWorkspace(N).then((A) => (this.workspace = A, this.role = A.role, this.visibility = A.visibility, M ? S.getNode(M).then((D) => D) : S.getNode(A.guid).then((D) => (this.workspaceInfo = D, D)))).then((A) => S.getChildren(A.guid || A.id).then((D) => {
2064
+ return !I && N === ((g = this.workspace) == null ? void 0 : g.id) && M === ((b = this.currentNode) == null ? void 0 : b.id) ? Promise.resolve() : (this.loading = !0, this.emptyFolder = !1, this.pagination = null, dM.getWorkspace(N).then((A) => (this.workspace = A, this.role = A.role, this.visibility = A.visibility, M ? S.getNode(M).then((D) => D) : S.getNode(A.guid).then((D) => (this.workspaceInfo = D, D)))).then((A) => (this.canUpload = A.allowableOperations.includes("create"), S.getChildren(A.guid || A.id).then((D) => {
2065
2065
  var m;
2066
2066
  return D.documentLibrary ? this.currentNode = D.documentLibrary : this.currentNode = A, this.canUpload = (m = this.currentNode.allowableOperations) == null ? void 0 : m.includes("create"), this.children = D.children, this.pagination = D.pagination, this.children.length > 0 ? (this.folders = this.children.filter((l) => l.isFolder), this.files = this.children.filter((l) => l.isFile)) : (this.folders = [], this.files = [], this.emptyFolder = !0), this.loading = !1, A;
2067
- })));
2067
+ }))));
2068
+ }
2069
+ }
2070
+ }), jg = O({
2071
+ id: "ThemeStore",
2072
+ state: () => ({
2073
+ theme: ""
2074
+ }),
2075
+ actions: {
2076
+ changeTheme(N) {
2077
+ return new Promise((M, I) => {
2078
+ const g = document.head, b = document.getElementById("theme-link"), A = document.createElement("link");
2079
+ A.id = "theme-link", A.rel = "stylesheet", A.href = `https://cdnjs.cloudflare.com/ajax/libs/primevue/3.45.0/resources/themes/${N}/theme.min.css`, A.async = !0;
2080
+ const D = () => {
2081
+ M(!0);
2082
+ }, m = (l) => {
2083
+ I(l);
2084
+ };
2085
+ A.addEventListener("load", D), A.addEventListener("error", m), b && g.removeChild(b), g.appendChild(A), localStorage.setItem("theme", N), this.$patch({
2086
+ theme: N
2087
+ });
2088
+ });
2089
+ },
2090
+ initTheme() {
2091
+ let M = localStorage.getItem("theme") || "lara-light-green";
2092
+ this.changeTheme(M);
2068
2093
  }
2069
2094
  }
2070
2095
  });
@@ -2079,7 +2104,7 @@ export {
2079
2104
  HI as categoriesApi,
2080
2105
  Mg as collaboraAccessService,
2081
2106
  VI as commentsApi,
2082
- y as contentApi,
2107
+ Y as contentApi,
2083
2108
  PI as downloadsApi,
2084
2109
  j as errorService,
2085
2110
  YI as favoriteService,
@@ -2105,6 +2130,7 @@ export {
2105
2130
  cg as useNavigationStore,
2106
2131
  bg as useSearchStore,
2107
2132
  Dg as useSelectionStore,
2133
+ jg as useThemeStore,
2108
2134
  Ag as useUserPreferencesStore,
2109
2135
  p as useUserStore,
2110
2136
  e as versionsApi,