@xwiki/cristal-authentication-nextcloud-ui 0.16.0 → 0.18.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,5 +1,33 @@
1
1
  # @xwiki/cristal-authentication-nextcloud-ui
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Cristal 0.18 Release
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @xwiki/cristal-api@0.18.0
13
+ - @xwiki/cristal-authentication-api@0.18.0
14
+ - @xwiki/cristal-authentication-nextcloud-state@0.18.0
15
+ - @xwiki/cristal-uiextension-api@0.18.0
16
+
17
+ ## 0.17.0
18
+
19
+ ### Minor Changes
20
+
21
+ - Cristal 0.17 Release
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @xwiki/cristal-api@0.17.0
27
+ - @xwiki/cristal-authentication-api@0.17.0
28
+ - @xwiki/cristal-authentication-nextcloud-state@0.17.0
29
+ - @xwiki/cristal-uiextension-api@0.17.0
30
+
3
31
  ## 0.16.0
4
32
 
5
33
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { defineComponent as _, inject as w, watch as g, resolveComponent as l, openBlock as v, createBlock as V, unref as e, isRef as m, withCtx as u, createVNode as i, createTextVNode as y, toDisplayString as N } from "vue";
1
+ import { defineComponent as _, inject as w, watch as g, resolveComponent as l, createBlock as v, openBlock as V, unref as e, isRef as m, withCtx as u, createVNode as i, createTextVNode as y, toDisplayString as N } from "vue";
2
2
  import { NextcloudAuthenticationState as S } from "@xwiki/cristal-authentication-nextcloud-state";
3
3
  import { useI18n as C } from "vue-i18n";
4
4
  const k = {
@@ -31,7 +31,7 @@ const k = {
31
31
  }
32
32
  ), (r, t) => {
33
33
  const p = l("x-text-field"), h = l("x-form"), b = l("x-btn"), f = l("x-dialog");
34
- return v(), V(f, {
34
+ return V(), v(f, {
35
35
  modelValue: e(d),
36
36
  "onUpdate:modelValue": t[2] || (t[2] = (n) => m(d) ? d.value = n : null),
37
37
  width: "auto",
@@ -82,4 +82,4 @@ const k = {
82
82
  export {
83
83
  j as default
84
84
  };
85
- //# sourceMappingURL=NextcloudLoginMenu-rReh2dpy.js.map
85
+ //# sourceMappingURL=NextcloudLoginMenu-BKGCETcL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NextcloudLoginMenu-rReh2dpy.js","sources":["../src/translations.ts","../src/vue/NextcloudLoginMenu.vue"],"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 = {\n en,\n fr,\n};\nexport default translations;\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n\n<script lang=\"ts\" setup>\nimport messages from \"../translations\";\nimport { CristalApp } from \"@xwiki/cristal-api\";\nimport { NextcloudAuthenticationState } from \"@xwiki/cristal-authentication-nextcloud-state\";\nimport { inject, watch } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst cristal = inject<CristalApp>(\"cristal\")!;\n\nconst authenticationState = cristal\n .getContainer()\n .get<NextcloudAuthenticationState>(NextcloudAuthenticationState);\nconst modalOpened: Ref<boolean> = authenticationState.modalOpened;\nconst username: Ref<string> = authenticationState.username;\nconst password: Ref<string> = authenticationState.password;\nconst callback: Ref<() => void> = authenticationState.callback;\n\nwatch(\n authenticationState.modalOpened,\n async (newValue: boolean, oldValue: boolean) => {\n if (newValue && !oldValue) {\n authenticationState.username.value = \"\";\n authenticationState.password.value = \"\";\n }\n },\n);\n</script>\n\n<template>\n <x-dialog\n v-model=\"modalOpened\"\n width=\"auto\"\n :title=\"t('authentication.nextcloud.modal.title')\"\n >\n <template #default>\n <x-form id=\"nextcloud-login-form\" @submit=\"callback\">\n <x-text-field\n v-model=\"username\"\n :label=\"t('authentication.nextcloud.modal.username.label')\"\n :help=\"t('authentication.nextcloud.modal.username.help')\"\n autofocus\n required\n ></x-text-field>\n <x-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"t('authentication.nextcloud.modal.password.label')\"\n :help=\"t('authentication.nextcloud.modal.password.help')\"\n ></x-text-field>\n </x-form>\n </template>\n <template #footer>\n <x-btn variant=\"primary\" type=\"submit\" form=\"nextcloud-login-form\">{{\n t(\"authentication.nextcloud.modal.submit.label\")\n }}</x-btn>\n </template>\n </x-dialog>\n</template>\n"],"names":["translations","en","fr","t","useI18n","messages","authenticationState","inject","NextcloudAuthenticationState","modalOpened","username","password","callback","watch","newValue","oldValue"],"mappings":";;;;;;;;;;;;;;;;;GAuBMA,IAAe;AAAA,EACnB,IAAAC;AAAA,EACA,IAAAC;AACF;;;ACEM,UAAA,EAAE,GAAAC,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GAIKC,IAFUC,EAAmB,SAAS,EAGzC,aAAa,EACb,IAAkCC,CAA4B,GAC3DC,IAA4BH,EAAoB,aAChDI,IAAwBJ,EAAoB,UAC5CK,IAAwBL,EAAoB,UAC5CM,IAA4BN,EAAoB;AAEtD,WAAAO;AAAA,MACEP,EAAoB;AAAA,MACpB,OAAOQ,GAAmBC,MAAsB;AAC1C,QAAAD,KAAY,CAACC,MACfT,EAAoB,SAAS,QAAQ,IACrCA,EAAoB,SAAS,QAAQ;AAAA,MACvC;AAAA,IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NextcloudLoginMenu-BKGCETcL.js","sources":["../src/translations.ts","../src/vue/NextcloudLoginMenu.vue"],"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 = {\n en,\n fr,\n};\nexport default translations;\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n\n<script lang=\"ts\" setup>\nimport messages from \"../translations\";\nimport { CristalApp } from \"@xwiki/cristal-api\";\nimport { NextcloudAuthenticationState } from \"@xwiki/cristal-authentication-nextcloud-state\";\nimport { inject, watch } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst cristal = inject<CristalApp>(\"cristal\")!;\n\nconst authenticationState = cristal\n .getContainer()\n .get<NextcloudAuthenticationState>(NextcloudAuthenticationState);\nconst modalOpened: Ref<boolean> = authenticationState.modalOpened;\nconst username: Ref<string> = authenticationState.username;\nconst password: Ref<string> = authenticationState.password;\nconst callback: Ref<() => void> = authenticationState.callback;\n\nwatch(\n authenticationState.modalOpened,\n async (newValue: boolean, oldValue: boolean) => {\n if (newValue && !oldValue) {\n authenticationState.username.value = \"\";\n authenticationState.password.value = \"\";\n }\n },\n);\n</script>\n\n<template>\n <x-dialog\n v-model=\"modalOpened\"\n width=\"auto\"\n :title=\"t('authentication.nextcloud.modal.title')\"\n >\n <template #default>\n <x-form id=\"nextcloud-login-form\" @submit=\"callback\">\n <x-text-field\n v-model=\"username\"\n :label=\"t('authentication.nextcloud.modal.username.label')\"\n :help=\"t('authentication.nextcloud.modal.username.help')\"\n autofocus\n required\n ></x-text-field>\n <x-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"t('authentication.nextcloud.modal.password.label')\"\n :help=\"t('authentication.nextcloud.modal.password.help')\"\n ></x-text-field>\n </x-form>\n </template>\n <template #footer>\n <x-btn variant=\"primary\" type=\"submit\" form=\"nextcloud-login-form\">{{\n t(\"authentication.nextcloud.modal.submit.label\")\n }}</x-btn>\n </template>\n </x-dialog>\n</template>\n"],"names":["translations","en","fr","t","useI18n","messages","authenticationState","inject","NextcloudAuthenticationState","modalOpened","username","password","callback","watch","newValue","oldValue"],"mappings":";;;;;;;;;;;;;;;;;GAuBMA,IAAe;AAAA,EACnB,IAAAC;AAAA,EACA,IAAAC;AACF;;;ACEM,UAAA,EAAE,GAAAC,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GAIKC,IAFUC,EAAmB,SAAS,EAGzC,aAAa,EACb,IAAkCC,CAA4B,GAC3DC,IAA4BH,EAAoB,aAChDI,IAAwBJ,EAAoB,UAC5CK,IAAwBL,EAAoB,UAC5CM,IAA4BN,EAAoB;AAEtD,WAAAO;AAAA,MACEP,EAAoB;AAAA,MACpB,OAAOQ,GAAmBC,MAAsB;AAC1C,QAAAD,KAAY,CAACC,MACfT,EAAoB,SAAS,QAAQ,IACrCA,EAAoB,SAAS,QAAQ;AAAA,MACvC;AAAA,IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.es.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { injectable as c, inject as u } from "inversify";
2
- var d = Object.defineProperty, p = Object.getOwnPropertyDescriptor, h = (t, e, i, a) => {
3
- for (var n = a > 1 ? void 0 : a ? p(e, i) : e, r = t.length - 1, o; r >= 0; r--)
4
- (o = t[r]) && (n = (a ? o(e, i, n) : o(n)) || n);
5
- return a && n && d(e, i, n), n;
6
- }, l = (t, e) => (i, a) => e(i, a, t);
7
- let s = class {
2
+ var d = Object.getOwnPropertyDescriptor, h = (t, e, i, n) => {
3
+ for (var a = n > 1 ? void 0 : n ? d(e, i) : e, r = t.length - 1, s; r >= 0; r--)
4
+ (s = t[r]) && (a = s(a) || a);
5
+ return a;
6
+ }, l = (t, e) => (i, n) => e(i, n, t);
7
+ let o = class {
8
8
  constructor(t) {
9
9
  this.authenticationManager = t, this.id = "sidebar.actions.nextcloudLoginMenu", this.uixpName = "sidebar.actions", this.order = 2100, this.parameters = {};
10
10
  }
11
11
  async component() {
12
- return (await import("./NextcloudLoginMenu-rReh2dpy.js")).default;
12
+ return (await import("./NextcloudLoginMenu-BKGCETcL.js")).default;
13
13
  }
14
14
  async enabled() {
15
15
  const t = this.authenticationManager.get();
16
16
  return !await (t == null ? void 0 : t.isAuthenticated());
17
17
  }
18
18
  };
19
- s = h([
19
+ o = h([
20
20
  c(),
21
21
  l(0, u("AuthenticationManagerProvider"))
22
- ], s);
23
- class m {
22
+ ], o);
23
+ class g {
24
24
  constructor(e) {
25
- e.bind("UIExtension").to(s).inSingletonScope();
25
+ e.bind("UIExtension").to(o).inSingletonScope();
26
26
  }
27
27
  }
28
28
  export {
29
- m as ComponentInit
29
+ g as ComponentInit
30
30
  };
31
31
  //# sourceMappingURL=index.es.js.map
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(i,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("inversify"),require("vue"),require("@xwiki/cristal-authentication-nextcloud-state"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["exports","inversify","vue","@xwiki/cristal-authentication-nextcloud-state","vue-i18n"],d):(i=typeof globalThis<"u"?globalThis:i||self,d(i["cristal_authentication-nextcloud-ui"]={},i.inversify,i.Vue,i.cristalAuthenticationNextcloudState,i.vueI18n))})(this,function(i,d,e,x,h){"use strict";var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,w=(o,t,u,n)=>{for(var a=n>1?void 0:n?b(t,u):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(a=(n?r(t,u,a):r(a))||a);return n&&a&&_(t,u,a),a},g=(o,t)=>(u,n)=>t(u,n,o);let m=class{constructor(o){this.authenticationManager=o,this.id="sidebar.actions.nextcloudLoginMenu",this.uixpName="sidebar.actions",this.order=2100,this.parameters={}}async component(){return(await Promise.resolve().then(()=>C)).default}async enabled(){const o=this.authenticationManager.get();return!await(o==null?void 0:o.isAuthenticated())}};m=w([d.injectable(),g(0,d.inject("AuthenticationManagerProvider"))],m);class y{constructor(t){t.bind("UIExtension").to(m).inSingletonScope()}}const V={en:{"authentication.nextcloud.modal.title":"Nextcloud Login","authentication.nextcloud.modal.username.label":"Username","authentication.nextcloud.modal.username.help":"Enter your username.","authentication.nextcloud.modal.password.label":"Password","authentication.nextcloud.modal.password.help":"It is not recommended to enter your own personal password, you should enter a specific application password instead.","authentication.nextcloud.modal.submit.label":"Log-in"},fr:{"authentication.nextcloud.modal.title":"Connexion à Nextcloud","authentication.nextcloud.modal.username.label":"Nom d'utilisateur","authentication.nextcloud.modal.username.help":"Saisissez votre nom d'utilisateur.","authentication.nextcloud.modal.password.label":"Mot de passe","authentication.nextcloud.modal.password.help":"Il n'est pas recommandé de saisir votre mot de passe personnel, vous devriez saisir un mot de passe d'application à la place.","authentication.nextcloud.modal.submit.label":"Se connecter"}},C=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"NextcloudLoginMenu",setup(o){const{t}=h.useI18n({messages:V}),n=e.inject("cristal").getContainer().get(x.NextcloudAuthenticationState),a=n.modalOpened,s=n.username,r=n.password,N=n.callback;return e.watch(n.modalOpened,async(p,l)=>{p&&!l&&(n.username.value="",n.password.value="")}),(p,l)=>{const f=e.resolveComponent("x-text-field"),S=e.resolveComponent("x-form"),O=e.resolveComponent("x-btn"),P=e.resolveComponent("x-dialog");return e.openBlock(),e.createBlock(P,{modelValue:e.unref(a),"onUpdate:modelValue":l[2]||(l[2]=c=>e.isRef(a)?a.value=c:null),width:"auto",title:e.unref(t)("authentication.nextcloud.modal.title")},{default:e.withCtx(()=>[e.createVNode(S,{id:"nextcloud-login-form",onSubmit:e.unref(N)},{default:e.withCtx(()=>[e.createVNode(f,{modelValue:e.unref(s),"onUpdate:modelValue":l[0]||(l[0]=c=>e.isRef(s)?s.value=c:null),label:e.unref(t)("authentication.nextcloud.modal.username.label"),help:e.unref(t)("authentication.nextcloud.modal.username.help"),autofocus:"",required:""},null,8,["modelValue","label","help"]),e.createVNode(f,{modelValue:e.unref(r),"onUpdate:modelValue":l[1]||(l[1]=c=>e.isRef(r)?r.value=c:null),type:"password",label:e.unref(t)("authentication.nextcloud.modal.password.label"),help:e.unref(t)("authentication.nextcloud.modal.password.help")},null,8,["modelValue","label","help"])]),_:1},8,["onSubmit"])]),footer:e.withCtx(()=>[e.createVNode(O,{variant:"primary",type:"submit",form:"nextcloud-login-form"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("authentication.nextcloud.modal.submit.label")),1)]),_:1})]),_:1},8,["modelValue","title"])}}})},Symbol.toStringTag,{value:"Module"}));i.ComponentInit=y,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ (function(a,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("inversify"),require("vue"),require("@xwiki/cristal-authentication-nextcloud-state"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["exports","inversify","vue","@xwiki/cristal-authentication-nextcloud-state","vue-i18n"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a["cristal_authentication-nextcloud-ui"]={},a.inversify,a.Vue,a.cristalAuthenticationNextcloudState,a.vueI18n))})(this,function(a,r,e,f,h){"use strict";var b=Object.getOwnPropertyDescriptor,_=(n,t,c,o)=>{for(var i=o>1?void 0:o?b(t,c):t,s=n.length-1,d;s>=0;s--)(d=n[s])&&(i=d(i)||i);return i},w=(n,t)=>(c,o)=>t(c,o,n);let m=class{constructor(n){this.authenticationManager=n,this.id="sidebar.actions.nextcloudLoginMenu",this.uixpName="sidebar.actions",this.order=2100,this.parameters={}}async component(){return(await Promise.resolve().then(()=>V)).default}async enabled(){const n=this.authenticationManager.get();return!await(n==null?void 0:n.isAuthenticated())}};m=_([r.injectable(),w(0,r.inject("AuthenticationManagerProvider"))],m);class g{constructor(t){t.bind("UIExtension").to(m).inSingletonScope()}}const y={en:{"authentication.nextcloud.modal.title":"Nextcloud Login","authentication.nextcloud.modal.username.label":"Username","authentication.nextcloud.modal.username.help":"Enter your username.","authentication.nextcloud.modal.password.label":"Password","authentication.nextcloud.modal.password.help":"It is not recommended to enter your own personal password, you should enter a specific application password instead.","authentication.nextcloud.modal.submit.label":"Log-in"},fr:{"authentication.nextcloud.modal.title":"Connexion à Nextcloud","authentication.nextcloud.modal.username.label":"Nom d'utilisateur","authentication.nextcloud.modal.username.help":"Saisissez votre nom d'utilisateur.","authentication.nextcloud.modal.password.label":"Mot de passe","authentication.nextcloud.modal.password.help":"Il n'est pas recommandé de saisir votre mot de passe personnel, vous devriez saisir un mot de passe d'application à la place.","authentication.nextcloud.modal.submit.label":"Se connecter"}},V=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"NextcloudLoginMenu",setup(n){const{t}=h.useI18n({messages:y}),o=e.inject("cristal").getContainer().get(f.NextcloudAuthenticationState),i=o.modalOpened,s=o.username,d=o.password,C=o.callback;return e.watch(o.modalOpened,async(p,l)=>{p&&!l&&(o.username.value="",o.password.value="")}),(p,l)=>{const x=e.resolveComponent("x-text-field"),N=e.resolveComponent("x-form"),S=e.resolveComponent("x-btn"),M=e.resolveComponent("x-dialog");return e.openBlock(),e.createBlock(M,{modelValue:e.unref(i),"onUpdate:modelValue":l[2]||(l[2]=u=>e.isRef(i)?i.value=u:null),width:"auto",title:e.unref(t)("authentication.nextcloud.modal.title")},{default:e.withCtx(()=>[e.createVNode(N,{id:"nextcloud-login-form",onSubmit:e.unref(C)},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:e.unref(s),"onUpdate:modelValue":l[0]||(l[0]=u=>e.isRef(s)?s.value=u:null),label:e.unref(t)("authentication.nextcloud.modal.username.label"),help:e.unref(t)("authentication.nextcloud.modal.username.help"),autofocus:"",required:""},null,8,["modelValue","label","help"]),e.createVNode(x,{modelValue:e.unref(d),"onUpdate:modelValue":l[1]||(l[1]=u=>e.isRef(d)?d.value=u:null),type:"password",label:e.unref(t)("authentication.nextcloud.modal.password.label"),help:e.unref(t)("authentication.nextcloud.modal.password.help")},null,8,["modelValue","label","help"])]),_:1},8,["onSubmit"])]),footer:e.withCtx(()=>[e.createVNode(S,{variant:"primary",type:"submit",form:"nextcloud-login-form"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("authentication.nextcloud.modal.submit.label")),1)]),_:1})]),_:1},8,["modelValue","title"])}}})},Symbol.toStringTag,{value:"Module"}));a.ComponentInit=g,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/NextcloudLoginMenuUIExtension.ts","../src/index.ts","../src/translations.ts","../src/vue/NextcloudLoginMenu.vue"],"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 { inject, injectable } from \"inversify\";\nimport type {\n AuthenticationManager,\n AuthenticationManagerProvider,\n} from \"@xwiki/cristal-authentication-api\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\nimport type { Component } from \"vue\";\n\n/**\n * Login {@link UIExtension} for the Nextcloud backend.\n *\n * @since 0.16\n */\n@injectable()\nexport class NextcloudLoginMenuUIExtension implements UIExtension {\n id = \"sidebar.actions.nextcloudLoginMenu\";\n uixpName = \"sidebar.actions\";\n order = 2100;\n parameters = {};\n\n constructor(\n @inject(\"AuthenticationManagerProvider\")\n private authenticationManager: AuthenticationManagerProvider,\n ) {}\n\n async component(): Promise<Component> {\n return (await import(\"./vue/NextcloudLoginMenu.vue\")).default;\n }\n\n async enabled(): Promise<boolean> {\n const authenticationManager: AuthenticationManager =\n this.authenticationManager.get()!;\n const authenticated: boolean =\n await authenticationManager?.isAuthenticated();\n return !authenticated;\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 { NextcloudLoginMenuUIExtension } from \"./NextcloudLoginMenuUIExtension\";\nimport { Container } from \"inversify\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\n\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<UIExtension>(\"UIExtension\")\n .to(NextcloudLoginMenuUIExtension)\n .inSingletonScope();\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 en from \"../langs/translation-en.json\";\nimport fr from \"../langs/translation-fr.json\";\n\nconst translations = {\n en,\n fr,\n};\nexport default translations;\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n\n<script lang=\"ts\" setup>\nimport messages from \"../translations\";\nimport { CristalApp } from \"@xwiki/cristal-api\";\nimport { NextcloudAuthenticationState } from \"@xwiki/cristal-authentication-nextcloud-state\";\nimport { inject, watch } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst cristal = inject<CristalApp>(\"cristal\")!;\n\nconst authenticationState = cristal\n .getContainer()\n .get<NextcloudAuthenticationState>(NextcloudAuthenticationState);\nconst modalOpened: Ref<boolean> = authenticationState.modalOpened;\nconst username: Ref<string> = authenticationState.username;\nconst password: Ref<string> = authenticationState.password;\nconst callback: Ref<() => void> = authenticationState.callback;\n\nwatch(\n authenticationState.modalOpened,\n async (newValue: boolean, oldValue: boolean) => {\n if (newValue && !oldValue) {\n authenticationState.username.value = \"\";\n authenticationState.password.value = \"\";\n }\n },\n);\n</script>\n\n<template>\n <x-dialog\n v-model=\"modalOpened\"\n width=\"auto\"\n :title=\"t('authentication.nextcloud.modal.title')\"\n >\n <template #default>\n <x-form id=\"nextcloud-login-form\" @submit=\"callback\">\n <x-text-field\n v-model=\"username\"\n :label=\"t('authentication.nextcloud.modal.username.label')\"\n :help=\"t('authentication.nextcloud.modal.username.help')\"\n autofocus\n required\n ></x-text-field>\n <x-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"t('authentication.nextcloud.modal.password.label')\"\n :help=\"t('authentication.nextcloud.modal.password.help')\"\n ></x-text-field>\n </x-form>\n </template>\n <template #footer>\n <x-btn variant=\"primary\" type=\"submit\" form=\"nextcloud-login-form\">{{\n t(\"authentication.nextcloud.modal.submit.label\")\n }}</x-btn>\n </template>\n </x-dialog>\n</template>\n"],"names":["NextcloudLoginMenuUIExtension","authenticationManager","NextcloudLoginMenu","__decorateClass","injectable","__decorateParam","ComponentInit","container","translations","useI18n","messages","authenticationState","inject","NextcloudAuthenticationState","modalOpened","username","password","callback","watch","newValue","oldValue"],"mappings":"+tBAkCO,IAAMA,EAAN,KAA2D,CAMhE,YAEUC,EACR,CADQ,KAAA,sBAAAA,EAPL,KAAA,GAAA,qCACM,KAAA,SAAA,kBACH,KAAA,MAAA,KACR,KAAA,WAAa,CAAC,CAAA,CAOd,MAAM,WAAgC,CAC5B,OAAA,MAAM,QAAA,QAAA,EAAA,KAAA,IAAAC,CAAA,GAAwC,OAAA,CAGxD,MAAM,SAA4B,CAC1B,MAAAD,EACJ,KAAK,sBAAsB,IAAI,EAGjC,MAAO,CADL,MAAMA,GAAA,YAAAA,EAAuB,kBACvB,CAEZ,EAtBaD,EAANG,EAAA,CADNC,aAAW,EAQPC,aAAO,+BAA+B,CAAA,CAAA,EAP9BL,CAAA,ECVN,MAAMM,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EACG,KAAkB,aAAa,EAC/B,GAAGP,CAA6B,EAChC,iBAAiB,CAAA,CAExB,CCRA,MAAMQ,EAAe,CACnB,udACA,sgBACF,wHCEM,KAAA,CAAE,CAAE,EAAIC,UAAQ,CACpBC,SAAAA,CAAA,CACD,EAIKC,EAFUC,SAAmB,SAAS,EAGzC,aAAa,EACb,IAAkCC,EAAAA,4BAA4B,EAC3DC,EAA4BH,EAAoB,YAChDI,EAAwBJ,EAAoB,SAC5CK,EAAwBL,EAAoB,SAC5CM,EAA4BN,EAAoB,SAEtDO,OAAAA,EAAA,MACEP,EAAoB,YACpB,MAAOQ,EAAmBC,IAAsB,CAC1CD,GAAY,CAACC,IACfT,EAAoB,SAAS,MAAQ,GACrCA,EAAoB,SAAS,MAAQ,GACvC,CAEJ"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/NextcloudLoginMenuUIExtension.ts","../src/index.ts","../src/translations.ts","../src/vue/NextcloudLoginMenu.vue"],"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 { inject, injectable } from \"inversify\";\nimport type {\n AuthenticationManager,\n AuthenticationManagerProvider,\n} from \"@xwiki/cristal-authentication-api\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\nimport type { Component } from \"vue\";\n\n/**\n * Login {@link UIExtension} for the Nextcloud backend.\n *\n * @since 0.16\n */\n@injectable()\nexport class NextcloudLoginMenuUIExtension implements UIExtension {\n id = \"sidebar.actions.nextcloudLoginMenu\";\n uixpName = \"sidebar.actions\";\n order = 2100;\n parameters = {};\n\n constructor(\n @inject(\"AuthenticationManagerProvider\")\n private authenticationManager: AuthenticationManagerProvider,\n ) {}\n\n async component(): Promise<Component> {\n return (await import(\"./vue/NextcloudLoginMenu.vue\")).default;\n }\n\n async enabled(): Promise<boolean> {\n const authenticationManager: AuthenticationManager =\n this.authenticationManager.get()!;\n const authenticated: boolean =\n await authenticationManager?.isAuthenticated();\n return !authenticated;\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 { NextcloudLoginMenuUIExtension } from \"./NextcloudLoginMenuUIExtension\";\nimport { Container } from \"inversify\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\n\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<UIExtension>(\"UIExtension\")\n .to(NextcloudLoginMenuUIExtension)\n .inSingletonScope();\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 en from \"../langs/translation-en.json\";\nimport fr from \"../langs/translation-fr.json\";\n\nconst translations = {\n en,\n fr,\n};\nexport default translations;\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n\n<script lang=\"ts\" setup>\nimport messages from \"../translations\";\nimport { CristalApp } from \"@xwiki/cristal-api\";\nimport { NextcloudAuthenticationState } from \"@xwiki/cristal-authentication-nextcloud-state\";\nimport { inject, watch } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport type { Ref } from \"vue\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst cristal = inject<CristalApp>(\"cristal\")!;\n\nconst authenticationState = cristal\n .getContainer()\n .get<NextcloudAuthenticationState>(NextcloudAuthenticationState);\nconst modalOpened: Ref<boolean> = authenticationState.modalOpened;\nconst username: Ref<string> = authenticationState.username;\nconst password: Ref<string> = authenticationState.password;\nconst callback: Ref<() => void> = authenticationState.callback;\n\nwatch(\n authenticationState.modalOpened,\n async (newValue: boolean, oldValue: boolean) => {\n if (newValue && !oldValue) {\n authenticationState.username.value = \"\";\n authenticationState.password.value = \"\";\n }\n },\n);\n</script>\n\n<template>\n <x-dialog\n v-model=\"modalOpened\"\n width=\"auto\"\n :title=\"t('authentication.nextcloud.modal.title')\"\n >\n <template #default>\n <x-form id=\"nextcloud-login-form\" @submit=\"callback\">\n <x-text-field\n v-model=\"username\"\n :label=\"t('authentication.nextcloud.modal.username.label')\"\n :help=\"t('authentication.nextcloud.modal.username.help')\"\n autofocus\n required\n ></x-text-field>\n <x-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"t('authentication.nextcloud.modal.password.label')\"\n :help=\"t('authentication.nextcloud.modal.password.help')\"\n ></x-text-field>\n </x-form>\n </template>\n <template #footer>\n <x-btn variant=\"primary\" type=\"submit\" form=\"nextcloud-login-form\">{{\n t(\"authentication.nextcloud.modal.submit.label\")\n }}</x-btn>\n </template>\n </x-dialog>\n</template>\n"],"names":["NextcloudLoginMenuUIExtension","authenticationManager","NextcloudLoginMenu","__decorateClass","injectable","__decorateParam","ComponentInit","container","translations","useI18n","messages","authenticationState","inject","NextcloudAuthenticationState","modalOpened","username","password","callback","watch","newValue","oldValue"],"mappings":"2qBAkCO,IAAMA,EAAN,KAA2D,CAMhE,YAEUC,EACR,CADQ,KAAA,sBAAAA,EAPL,KAAA,GAAA,qCACM,KAAA,SAAA,kBACH,KAAA,MAAA,KACR,KAAA,WAAa,CAAC,CAAA,CAOd,MAAM,WAAgC,CAC5B,OAAA,MAAM,QAAA,QAAA,EAAA,KAAA,IAAAC,CAAA,GAAwC,OAAA,CAGxD,MAAM,SAA4B,CAC1B,MAAAD,EACJ,KAAK,sBAAsB,IAAI,EAGjC,MAAO,CADL,MAAMA,GAAA,YAAAA,EAAuB,kBACvB,CAEZ,EAtBaD,EAANG,EAAA,CADNC,aAAW,EAQPC,aAAO,+BAA+B,CAAA,CAAA,EAP9BL,CAAA,ECVN,MAAMM,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EACG,KAAkB,aAAa,EAC/B,GAAGP,CAA6B,EAChC,iBAAiB,CAAA,CAExB,CCRA,MAAMQ,EAAe,CACnB,udACA,sgBACF,wHCEM,KAAA,CAAE,CAAE,EAAIC,UAAQ,CACpBC,SAAAA,CAAA,CACD,EAIKC,EAFUC,SAAmB,SAAS,EAGzC,aAAa,EACb,IAAkCC,EAAAA,4BAA4B,EAC3DC,EAA4BH,EAAoB,YAChDI,EAAwBJ,EAAoB,SAC5CK,EAAwBL,EAAoB,SAC5CM,EAA4BN,EAAoB,SAEtDO,OAAAA,EAAA,MACEP,EAAoB,YACpB,MAAOQ,EAAmBC,IAAsB,CAC1CD,GAAY,CAACC,IACfT,EAAoB,SAAS,MAAQ,GACrCA,EAAoB,SAAS,MAAQ,GACvC,CAEJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-authentication-nextcloud-ui",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -22,24 +22,24 @@
22
22
  },
23
23
  "main": "./dist/index.es.js",
24
24
  "dependencies": {
25
- "inversify": "7.1.0",
25
+ "inversify": "7.5.1",
26
26
  "vue": "3.5.13",
27
- "vue-i18n": "11.1.2",
28
- "@xwiki/cristal-api": "0.16.0",
29
- "@xwiki/cristal-authentication-api": "0.16.0",
30
- "@xwiki/cristal-authentication-nextcloud-state": "0.16.0",
31
- "@xwiki/cristal-uiextension-api": "0.16.0"
27
+ "vue-i18n": "11.1.3",
28
+ "@xwiki/cristal-api": "0.18.0",
29
+ "@xwiki/cristal-authentication-nextcloud-state": "0.18.0",
30
+ "@xwiki/cristal-authentication-api": "0.18.0",
31
+ "@xwiki/cristal-uiextension-api": "0.18.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@vue/test-utils": "2.4.6",
35
35
  "reflect-metadata": "0.2.2",
36
- "typescript": "5.8.2",
37
- "vite": "6.2.2",
38
- "vitest": "3.0.8",
39
- "vue-tsc": "2.2.8",
40
- "@xwiki/cristal-dev-config": "0.16.0",
41
- "@xwiki/cristal-dev-test-utils": "0.16.0",
42
- "@xwiki/cristal-dsapi": "0.16.0"
36
+ "typescript": "5.8.3",
37
+ "vite": "6.3.5",
38
+ "vitest": "3.1.2",
39
+ "vue-tsc": "2.2.10",
40
+ "@xwiki/cristal-dev-config": "0.18.0",
41
+ "@xwiki/cristal-dsapi": "0.18.0",
42
+ "@xwiki/cristal-dev-test-utils": "0.18.0"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "vue-tsc --project tsconfig.json && vite build",