@coffer-org/web 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{i as e}from"./fields-DVMUyXbG.js";import{i as t}from"./module-DytlXfXo.js";import{n,r}from"./plugin-b0fDTTXJ.js";import{t as i}from"./settings-Dfvzj6n2.js";var a=t({module:`bus_route`,vault:`transit`,label:`transit.bus_route.label`,icon:`lucide:bus`,views:{table:[`route_number`,`from`,`to`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.int({key:`route_number`,label:`transit.bus_route.fields.route_number`}),e.string({key:`from`,label:`transit.bus_route.fields.from`,rules:{max:100}}),e.string({key:`to`,label:`transit.bus_route.fields.to`,rules:{max:100}}),e.string({key:`stop`,label:`transit.bus_route.fields.stop`,rules:{max:200}}),e.time({key:`weekday_times`,label:`transit.bus_route.fields.weekday_times`,multiple:!0}),e.time({key:`saturday_times`,label:`transit.bus_route.fields.saturday_times`,multiple:!0}),e.time({key:`sunday_times`,label:`transit.bus_route.fields.sunday_times`,multiple:!0}),e.text({key:`notes`,label:`transit.bus_route.fields.notes`,rules:{max:500}}),e.tags({key:`tags`,label:`transit.bus_route.fields.tags`})]}),o=n({id:`transit`,version:`1.0.0`,dependsOn:[],vaults:[{meta:r({id:`transit`,label:`transit.vault.label`,icon:`lucide:bus`}),modules:[a]}],settings:i({label:`transit.settings.label`,fields:[e.boolean({key:`use_nextcloud`,label:`transit.settings.use_nextcloud`}),e.string({key:`caldav_calendar`,label:`transit.settings.caldav_calendar`}),e.string({key:`caldav_url`,label:`transit.settings.caldav_url`}),e.string({key:`caldav_username`,label:`transit.settings.caldav_username`}),e.password({key:`caldav_password`,label:`transit.settings.caldav_password`})]})});export{o as default};
1
+ import{i as e}from"./fields-DVMUyXbG.js";import{i as t}from"./module-DytlXfXo.js";import{n,r}from"./plugin-b0fDTTXJ.js";import{t as i}from"./settings-Dfvzj6n2.js";var a=t({module:`bus_route`,vault:`transit`,label:`transit.bus_route.label`,icon:`lucide:bus`,views:{table:[`route_number`,`from`,`to`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.int({key:`route_number`,label:`transit.bus_route.fields.route_number`}),e.string({key:`from`,label:`transit.bus_route.fields.from`,rules:{max:100}}),e.string({key:`to`,label:`transit.bus_route.fields.to`,rules:{max:100}}),e.string({key:`stop`,label:`transit.bus_route.fields.stop`,rules:{max:200}}),e.time({key:`weekday_times`,label:`transit.bus_route.fields.weekday_times`,multiple:!0}),e.time({key:`saturday_times`,label:`transit.bus_route.fields.saturday_times`,multiple:!0}),e.time({key:`sunday_times`,label:`transit.bus_route.fields.sunday_times`,multiple:!0}),e.text({key:`notes`,label:`transit.bus_route.fields.notes`,rules:{max:500}}),e.tags({key:`tags`,label:`transit.bus_route.fields.tags`})]}),o=n({id:`transit`,version:`1.0.0`,dependsOn:[],vaults:[{meta:r({id:`transit`,label:`transit.vault.label`,icon:`lucide:bus`}),modules:[a]}],settings:i({label:`transit.settings.label`,fields:[e.string({key:`caldav_calendar`,label:`transit.settings.caldav_calendar`}),e.string({key:`caldav_url`,label:`transit.settings.caldav_url`}),e.string({key:`caldav_username`,label:`transit.settings.caldav_username`}),e.password({key:`caldav_password`,label:`transit.settings.caldav_password`})]})});export{o as default};
@@ -1 +1 @@
1
- import{i as e}from"./fields-DVMUyXbG.js";import{i as t}from"./module-DytlXfXo.js";import{t as n}from"./extend-DLMSdMhy.js";import{n as r,r as i}from"./plugin-b0fDTTXJ.js";import{t as a}from"./settings-Dfvzj6n2.js";var o=t({module:`medicine`,vault:`health`,label:`health.medicine.label`,icon:`lucide:pill`,views:{table:[`type`,`form`,`quantity`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.image({key:`photo`,label:`health.medicine.fields.photo`}),e.int({key:`quantity`,label:`health.medicine.fields.quantity`,rules:{min:0,max:1e5}}),e.date({key:`quantityCheckedAt`,label:`health.medicine.fields.quantityCheckedAt`}),e.text({key:`description`,label:`health.medicine.fields.description`,rules:{max:1e3}}),e.keyed({key:`dose`,label:`health.medicine.fields.dose`,by:e.relation({key:`person`,label:`health.medicine.fields.dose_person`,options:{vault:`people`,module:`person`}}),fields:[e.perWeekday({key:`value`,label:`health.medicine.fields.dose_value`,rules:{min:0,max:20,step:.5}})]}),e.select({key:`intakeTimes`,label:`health.medicine.fields.intakeTimes`,options:`day-periods`,multiple:!0}),e.period({key:`intakePeriods`,label:`health.medicine.fields.intakePeriods`,multiple:!0}),e.select({key:`type`,label:`core.fields.type`,required:!0,options:[{value:`vitamin`,title:`health.medicine.options.type.vitamin`},{value:`supplement`,title:`health.medicine.options.type.supplement`},{value:`medication`,title:`health.medicine.options.type.medication`},{value:`antibiotic`,title:`health.medicine.options.type.antibiotic`},{value:`hormone`,title:`health.medicine.options.type.hormone`},{value:`painkiller`,title:`health.medicine.options.type.painkiller`},{value:`homeopathy`,title:`health.medicine.options.type.homeopathy`},{value:`herbal`,title:`health.medicine.options.type.herbal`}]}),e.select({key:`form`,label:`health.medicine.fields.form`,options:[{value:`tablet`,title:`health.medicine.options.form.tablet`},{value:`capsule`,title:`health.medicine.options.form.capsule`},{value:`syrup`,title:`health.medicine.options.form.syrup`},{value:`drops`,title:`health.medicine.options.form.drops`},{value:`ointment`,title:`health.medicine.options.form.ointment`},{value:`gel`,title:`health.medicine.options.form.gel`},{value:`spray`,title:`health.medicine.options.form.spray`},{value:`injection`,title:`health.medicine.options.form.injection`},{value:`powder`,title:`health.medicine.options.form.powder`},{value:`suppository`,title:`health.medicine.options.form.suppository`}]})]}),s=t({module:`health_visit`,vault:`health`,label:`health.health_visit.label`,icon:`lucide:stethoscope`,views:{table:[`date`,`person`,`specialty`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.date({key:`date`,label:`health.health_visit.fields.date`}),e.string({key:`specialist`,label:`health.health_visit.fields.specialist`,rules:{max:200}}),e.string({key:`specialty`,label:`health.health_visit.fields.specialty`,rules:{max:100}}),e.string({key:`clinic`,label:`health.health_visit.fields.clinic`,rules:{max:200}}),e.relation({key:`person`,label:`health.health_visit.fields.person`,options:{vault:`people`,module:`person`}}),e.text({key:`reason`,label:`health.health_visit.fields.reason`,rules:{max:1e3}}),e.text({key:`result`,label:`health.health_visit.fields.result`,rules:{max:2e3}}),e.text({key:`next_step`,label:`health.health_visit.fields.next_step`,rules:{max:1e3}}),e.money({key:`cost`,label:`health.health_visit.fields.cost`,rules:{defaultCurrency:`UAH`}}),e.image({key:`photos`,label:`health.health_visit.fields.photos`,multiple:!0}),e.file({key:`files`,label:`health.health_visit.fields.files`,multiple:!0}),e.relation({key:`medicines`,label:`health.health_visit.fields.medicines`,options:{vault:`health`,module:`medicine`},multiple:!0}),e.reminder({key:`nextVisit`,label:`health.health_visit.fields.nextVisit`,rules:{lead:14}})]}),c=t({module:`health_test`,vault:`health`,label:`health.health_test.label`,icon:`lucide:flask-conical`,views:{table:[`date`,`person`,`status`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.date({key:`date`,label:`health.health_test.fields.date`}),e.string({key:`clinic`,label:`health.health_test.fields.clinic`,rules:{max:200}}),e.select({key:`status`,label:`health.health_test.fields.status`,options:[{value:`ordered`,title:`health.health_test.options.status.ordered`},{value:`completed`,title:`health.health_test.options.status.completed`},{value:`cancelled`,title:`health.health_test.options.status.cancelled`}]}),e.select({key:`test_type`,label:`health.health_test.fields.test_type`,options:[{value:`blood`,title:`health.health_test.options.test_type.blood`},{value:`urine`,title:`health.health_test.options.test_type.urine`},{value:`ultrasound`,title:`health.health_test.options.test_type.ultrasound`},{value:`xray`,title:`health.health_test.options.test_type.xray`},{value:`mri`,title:`health.health_test.options.test_type.mri`},{value:`other`,title:`health.health_test.options.test_type.other`}]}),e.relation({key:`person`,label:`health.health_test.fields.person`,options:{vault:`people`,module:`person`}}),e.text({key:`result`,label:`health.health_test.fields.result`,rules:{max:5e3}}),e.image({key:`attachments`,label:`health.health_test.fields.attachments`,multiple:!0})]}),l=n({id:`person_body`,label:`health.person_body.label`,icon:`lucide:ruler`,attachTo:[{vault:`people`,module:`person`}],claude:`Person's body measurements. weightKg — weight in kg. heightCm — height in cm.`,fields:[e.real({key:`weightKg`,label:`health.person_body.fields.weightKg`,rules:{min:1,max:500}}),e.int({key:`heightCm`,label:`health.person_body.fields.heightCm`,rules:{min:50,max:250}})]}),u=r({id:`health`,version:`1.0.0`,dependsOn:[`people`],optionLists:[{name:`day-periods`,options:[{value:`any`,title:`health.dayPeriods.any`},{value:`before_breakfast`,title:`health.dayPeriods.before_breakfast`},{value:`with_breakfast`,title:`health.dayPeriods.with_breakfast`},{value:`after_breakfast`,title:`health.dayPeriods.after_breakfast`},{value:`with_food`,title:`health.dayPeriods.with_food`},{value:`after_lunch`,title:`health.dayPeriods.after_lunch`},{value:`evening`,title:`health.dayPeriods.evening`},{value:`before_bed`,title:`health.dayPeriods.before_bed`},{value:`as_needed`,title:`health.dayPeriods.as_needed`}]}],vaults:[{meta:i({id:`health`,label:`health.vault.label`,icon:`lucide:hospital`}),modules:[o,s,c]}],extends_:[l],settings:a({label:`health.settings.label`,fields:[e.boolean({key:`use_nextcloud`,label:`health.settings.use_nextcloud`}),e.string({key:`caldav_calendar`,label:`health.settings.caldav_calendar`}),e.string({key:`caldav_url`,label:`health.settings.caldav_url`}),e.string({key:`caldav_username`,label:`health.settings.caldav_username`}),e.password({key:`caldav_password`,label:`health.settings.caldav_password`})]})});export{u as default};
1
+ import{i as e}from"./fields-DVMUyXbG.js";import{i as t}from"./module-DytlXfXo.js";import{t as n}from"./extend-DLMSdMhy.js";import{n as r,r as i}from"./plugin-b0fDTTXJ.js";import{t as a}from"./settings-Dfvzj6n2.js";var o=t({module:`medicine`,vault:`health`,label:`health.medicine.label`,icon:`lucide:pill`,views:{table:[`type`,`form`,`quantity`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.image({key:`photo`,label:`health.medicine.fields.photo`}),e.int({key:`quantity`,label:`health.medicine.fields.quantity`,rules:{min:0,max:1e5}}),e.date({key:`quantityCheckedAt`,label:`health.medicine.fields.quantityCheckedAt`}),e.text({key:`description`,label:`health.medicine.fields.description`,rules:{max:1e3}}),e.keyed({key:`dose`,label:`health.medicine.fields.dose`,by:e.relation({key:`person`,label:`health.medicine.fields.dose_person`,options:{vault:`people`,module:`person`}}),fields:[e.perWeekday({key:`value`,label:`health.medicine.fields.dose_value`,rules:{min:0,max:20,step:.5}})]}),e.select({key:`intakeTimes`,label:`health.medicine.fields.intakeTimes`,options:`day-periods`,multiple:!0}),e.period({key:`intakePeriods`,label:`health.medicine.fields.intakePeriods`,multiple:!0}),e.select({key:`type`,label:`core.fields.type`,required:!0,options:[{value:`vitamin`,title:`health.medicine.options.type.vitamin`},{value:`supplement`,title:`health.medicine.options.type.supplement`},{value:`medication`,title:`health.medicine.options.type.medication`},{value:`antibiotic`,title:`health.medicine.options.type.antibiotic`},{value:`hormone`,title:`health.medicine.options.type.hormone`},{value:`painkiller`,title:`health.medicine.options.type.painkiller`},{value:`homeopathy`,title:`health.medicine.options.type.homeopathy`},{value:`herbal`,title:`health.medicine.options.type.herbal`}]}),e.select({key:`form`,label:`health.medicine.fields.form`,options:[{value:`tablet`,title:`health.medicine.options.form.tablet`},{value:`capsule`,title:`health.medicine.options.form.capsule`},{value:`syrup`,title:`health.medicine.options.form.syrup`},{value:`drops`,title:`health.medicine.options.form.drops`},{value:`ointment`,title:`health.medicine.options.form.ointment`},{value:`gel`,title:`health.medicine.options.form.gel`},{value:`spray`,title:`health.medicine.options.form.spray`},{value:`injection`,title:`health.medicine.options.form.injection`},{value:`powder`,title:`health.medicine.options.form.powder`},{value:`suppository`,title:`health.medicine.options.form.suppository`}]})]}),s=t({module:`health_visit`,vault:`health`,label:`health.health_visit.label`,icon:`lucide:stethoscope`,views:{table:[`date`,`person`,`specialty`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.date({key:`date`,label:`health.health_visit.fields.date`}),e.string({key:`specialist`,label:`health.health_visit.fields.specialist`,rules:{max:200}}),e.string({key:`specialty`,label:`health.health_visit.fields.specialty`,rules:{max:100}}),e.string({key:`clinic`,label:`health.health_visit.fields.clinic`,rules:{max:200}}),e.relation({key:`person`,label:`health.health_visit.fields.person`,options:{vault:`people`,module:`person`}}),e.text({key:`reason`,label:`health.health_visit.fields.reason`,rules:{max:1e3}}),e.text({key:`result`,label:`health.health_visit.fields.result`,rules:{max:2e3}}),e.text({key:`next_step`,label:`health.health_visit.fields.next_step`,rules:{max:1e3}}),e.money({key:`cost`,label:`health.health_visit.fields.cost`,rules:{defaultCurrency:`UAH`}}),e.image({key:`photos`,label:`health.health_visit.fields.photos`,multiple:!0}),e.file({key:`files`,label:`health.health_visit.fields.files`,multiple:!0}),e.relation({key:`medicines`,label:`health.health_visit.fields.medicines`,options:{vault:`health`,module:`medicine`},multiple:!0}),e.reminder({key:`nextVisit`,label:`health.health_visit.fields.nextVisit`,rules:{lead:14}})]}),c=t({module:`health_test`,vault:`health`,label:`health.health_test.label`,icon:`lucide:flask-conical`,views:{table:[`date`,`person`,`status`]},fields:[e.title({key:`name`,label:`core.fields.name`}),e.date({key:`date`,label:`health.health_test.fields.date`}),e.string({key:`clinic`,label:`health.health_test.fields.clinic`,rules:{max:200}}),e.select({key:`status`,label:`health.health_test.fields.status`,options:[{value:`ordered`,title:`health.health_test.options.status.ordered`},{value:`completed`,title:`health.health_test.options.status.completed`},{value:`cancelled`,title:`health.health_test.options.status.cancelled`}]}),e.select({key:`test_type`,label:`health.health_test.fields.test_type`,options:[{value:`blood`,title:`health.health_test.options.test_type.blood`},{value:`urine`,title:`health.health_test.options.test_type.urine`},{value:`ultrasound`,title:`health.health_test.options.test_type.ultrasound`},{value:`xray`,title:`health.health_test.options.test_type.xray`},{value:`mri`,title:`health.health_test.options.test_type.mri`},{value:`other`,title:`health.health_test.options.test_type.other`}]}),e.relation({key:`person`,label:`health.health_test.fields.person`,options:{vault:`people`,module:`person`}}),e.text({key:`result`,label:`health.health_test.fields.result`,rules:{max:5e3}}),e.image({key:`attachments`,label:`health.health_test.fields.attachments`,multiple:!0})]}),l=n({id:`person_body`,label:`health.person_body.label`,icon:`lucide:ruler`,attachTo:[{vault:`people`,module:`person`}],claude:`Person's body measurements. weightKg — weight in kg. heightCm — height in cm.`,fields:[e.real({key:`weightKg`,label:`health.person_body.fields.weightKg`,rules:{min:1,max:500}}),e.int({key:`heightCm`,label:`health.person_body.fields.heightCm`,rules:{min:50,max:250}})]}),u=r({id:`health`,version:`1.0.0`,dependsOn:[`people`],optionLists:[{name:`day-periods`,options:[{value:`any`,title:`health.dayPeriods.any`},{value:`before_breakfast`,title:`health.dayPeriods.before_breakfast`},{value:`with_breakfast`,title:`health.dayPeriods.with_breakfast`},{value:`after_breakfast`,title:`health.dayPeriods.after_breakfast`},{value:`with_food`,title:`health.dayPeriods.with_food`},{value:`after_lunch`,title:`health.dayPeriods.after_lunch`},{value:`evening`,title:`health.dayPeriods.evening`},{value:`before_bed`,title:`health.dayPeriods.before_bed`},{value:`as_needed`,title:`health.dayPeriods.as_needed`}]}],vaults:[{meta:i({id:`health`,label:`health.vault.label`,icon:`lucide:hospital`}),modules:[o,s,c]}],extends_:[l],settings:a({label:`health.settings.label`,fields:[e.string({key:`caldav_calendar`,label:`health.settings.caldav_calendar`}),e.string({key:`caldav_url`,label:`health.settings.caldav_url`}),e.string({key:`caldav_username`,label:`health.settings.caldav_username`}),e.password({key:`caldav_password`,label:`health.settings.caldav_password`})]})});export{u as default};
package/dist/index.html CHANGED
@@ -37,7 +37,7 @@
37
37
  }
38
38
  }
39
39
  </script>
40
- <script type="module" crossorigin src="/assets/index-D4NbdNI4.js"></script>
40
+ <script type="module" crossorigin src="/assets/index-CPz8IKjT.js"></script>
41
41
  <link rel="modulepreload" crossorigin href="/assets/chunk-QTnfLwEv.js">
42
42
  <link rel="modulepreload" crossorigin href="/assets/clsx-CjYvs854.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-CRUx2QLQ.js">
@@ -62,10 +62,10 @@
62
62
  <link rel="modulepreload" crossorigin href="/assets/Toolbar-CXro4MxC.js">
63
63
  <link rel="modulepreload" crossorigin href="/assets/chunk-6CSD65Y2-FavEEIOj.js">
64
64
  <link rel="modulepreload" crossorigin href="/assets/countries-BSm8PNWW.js">
65
- <link rel="modulepreload" crossorigin href="/assets/api-BpunGHNa.js">
65
+ <link rel="modulepreload" crossorigin href="/assets/api-j5etRnzW.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/PageBody-DXEdPT8C.js">
67
67
  <link rel="modulepreload" crossorigin href="/assets/SettingsForm-Bhsv5BEu.js">
68
- <link rel="modulepreload" crossorigin href="/assets/auth-context-BNCSMPL8.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/auth-context-C4OfTBfT.js">
69
69
  <link rel="stylesheet" crossorigin href="/assets/index-Bkh3f49V.css">
70
70
  </head>
71
71
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/web",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -1,2 +0,0 @@
1
- import{r as e}from"./chunk-QTnfLwEv.js";import{t}from"./react-D4J6PwTK.js";import{C as n,T as r,i,r as a,t as o,w as s}from"./button-CbB4uqRh.js";import{n as c}from"./chunk-6CSD65Y2-FavEEIOj.js";import{t as l}from"./jsx-dev-runtime-BMBl2lag.js";import{c as u,i as d,n as f,s as p,t as m}from"./dist-CdBkAqXL.js";import{t as h}from"./jsx-runtime-DV9KAPzc.js";import{t as g}from"./dist-iFwZyFpC.js";import{b as _,d as v,v as y,y as b}from"./api-BpunGHNa.js";import{n as x,r as S}from"./auth-context-BNCSMPL8.js";import{t as C}from"./PageBody-DXEdPT8C.js";var w=e(t(),1),T=h(),E=`Switch`,[D,O]=p(E),[k,A]=D(E);function j(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=m({prop:n,defaultProp:i??!1,onChange:c,caller:E}),[h,g]=w.useState(null),[_,v]=w.useState(null),y={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:w.useRef(!1),required:l,defaultChecked:i,isFormControl:h?!!o||!!h.closest(`form`):!0,bubbleInput:_,setBubbleInput:v};return(0,T.jsx)(k,{scope:t,...y,children:z(d)?d(y):r})}var M=`SwitchTrigger`,N=w.forwardRef(({__scopeSwitch:e,onClick:t,...r},i)=>{let{value:a,disabled:o,checked:s,required:c,setControl:l,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:h}=A(M,e),g=n(i,l);return(0,T.jsx)(d.button,{type:`button`,role:`switch`,"aria-checked":s,"aria-required":c,"data-state":B(s),"data-disabled":o?``:void 0,disabled:o,value:a,...r,ref:g,onClick:u(t,e=>{f(e=>!e),h&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});N.displayName=M;var P=w.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,T.jsx)(j,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{...d,ref:t,__scopeSwitch:n}),e&&(0,T.jsx)(R,{__scopeSwitch:n})]})})});P.displayName=E;var F=`SwitchThumb`,I=w.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=A(F,n);return(0,T.jsx)(d.span,{"data-state":B(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});I.displayName=F;var L=`SwitchBubbleInput`,R=w.forwardRef(({__scopeSwitch:e,...t},r)=>{let{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:p,form:m,bubbleInput:h,setBubbleInput:_}=A(L,e),v=n(r,_),y=g(o),b=f(i);w.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(y!==o&&n){let t=new Event(`click`,{bubbles:r});n.call(e,o),e.dispatchEvent(t)}},[h,y,o,a]);let x=w.useRef(o);return(0,T.jsx)(d.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:p,form:m,...t,tabIndex:-1,ref:v,style:{...t.style,...b,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});R.displayName=L;function z(e){return typeof e==`function`}function B(e){return e?`checked`:`unchecked`}var V=l(),H=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/switch.tsx`,U=w.forwardRef(({className:e,...t},n)=>(0,V.jsxDEV)(P,{ref:n,className:s(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-border`,e),...t,children:(0,V.jsxDEV)(I,{className:s(`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform`,`data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)},void 0,!1,{fileName:H,lineNumber:20,columnNumber:5},void 0)},void 0,!1,{fileName:H,lineNumber:9,columnNumber:3},void 0));U.displayName=P.displayName;var W=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/badge.tsx`,G=a(`inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground`,outline:`border-border text-text`,accent:`border-accent/30 bg-accent/15 text-accent`}},defaultVariants:{variant:`default`}});function K({className:e,variant:t,...n}){return(0,V.jsxDEV)(`div`,{className:s(G({variant:t}),e),...n},void 0,!1,{fileName:W,lineNumber:24,columnNumber:10},this)}var q=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/app/SettingsPage.tsx`;function J(){let{t:e}=r(),{role:t}=x(),n=t===`admin`,[a,s]=(0,w.useState)([]),[l,u]=(0,w.useState)(!0),[d,f]=(0,w.useState)(null),p=e=>d===e||d===`*`,m=a.filter(e=>e.latestVersion&&e.latestVersion!==e.installedVersion),[h,g]=(0,w.useState)(null),[T,E]=(0,w.useState)(!1),D=t=>e(`${t}.plugin.label`,{defaultValue:t}),O=t=>e(`${t}.plugin.description`,{defaultValue:``}),k=t=>e(`${t}.vault.label`,{defaultValue:t}),A=(t,n)=>e(`${t}.${n}.label`,{defaultValue:n}),j={core_required:()=>e(`plugins.errors.core_required`),has_dependents:t=>e(`plugins.errors.has_dependents`,{list:t.dependents.join(`, `)}),missing_deps:t=>e(`plugins.errors.missing_deps`,{list:t.deps.join(`, `)}),unknown_plugin:()=>e(`plugins.errors.unknown_plugin`)},M=()=>v().then(e=>{s(e),u(!1)});(0,w.useEffect)(()=>{M()},[]);async function N(t){if(!window.confirm(e(`plugins.confirmPurge`,{id:t.id})))return;f(t.id),g(null);let n=await fetch(`/api/plugins/${t.id}/data`,{method:`DELETE`}),r=await n.json().catch(()=>({}));if(f(null),!n.ok){g(j[r.error]?.(r)??e(`plugins.genericError`,{code:r.error??n.status}));return}E(!0),await M()}async function P(t){f(t.id),g(null);let n=await y(t.id,!t.enabled);if(!n.ok){f(null),g(j[n.error]?.(n.data??{})??e(`plugins.genericError`,{code:n.error}));return}window.location.reload()}async function F(){let e=Date.now();for(;Date.now()-e<3e4;){await new Promise(e=>setTimeout(e,1e3));try{if((await fetch(`/health`)).ok)return!0}catch{}}return!1}async function I(t){if(!t.latestVersion||!window.confirm(e(`plugins.confirmUpdate`,{id:t.id,from:t.installedVersion,to:t.latestVersion})))return;f(t.id),g(null);let n=await _(t.id);if(!n.ok){f(null),g(n.stderr?`${e(`plugins.updateError`)}: ${n.stderr}`:e(`plugins.genericError`,{code:n.error}));return}E(!0),await F()&&window.location.reload()}async function L(){if(m.length===0)return;let t=m.map(e=>`${D(e.id)}: v${e.installedVersion} → v${e.latestVersion}`).join(`
2
- `);if(!window.confirm(e(`plugins.confirmUpdateAll`,{count:m.length,list:t})))return;f(`*`),g(null);let n=await b();if(!n.ok){f(null),g(n.stderr?`${e(`plugins.updateError`)}: ${n.stderr}`:e(`plugins.genericError`,{code:n.error}));return}E(!0),await F()&&window.location.reload()}let R=a.find(e=>e.id===`core`);return(0,V.jsxDEV)(C,{children:[(0,V.jsxDEV)(`h1`,{className:`mb-6 text-[28px] font-bold text-text`,children:e(`settings.title`)},void 0,!1,{fileName:q,lineNumber:139,columnNumber:7},this),(0,V.jsxDEV)(`section`,{className:`mb-6`,children:[(0,V.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.personalTitle`)},void 0,!1,{fileName:q,lineNumber:143,columnNumber:9},this),(0,V.jsxDEV)(S,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,V.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`auth.accountTitle`)},void 0,!1,{fileName:q,lineNumber:146,columnNumber:13},this)},void 0,!1,{fileName:q,lineNumber:145,columnNumber:11},this),(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,V.jsxDEV)(c,{to:`/settings/account`,title:e(`auth.accountTitle`),"aria-label":e(`auth.accountTitle`),children:(0,V.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:q,lineNumber:150,columnNumber:15},this)},void 0,!1,{fileName:q,lineNumber:149,columnNumber:13},this)},void 0,!1,{fileName:q,lineNumber:148,columnNumber:11},this)]},void 0,!0,{fileName:q,lineNumber:144,columnNumber:9},this)]},void 0,!0,{fileName:q,lineNumber:142,columnNumber:7},this),n&&(0,V.jsxDEV)(V.Fragment,{children:[(0,V.jsxDEV)(`section`,{className:`mb-6`,children:[(0,V.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.systemTitle`)},void 0,!1,{fileName:q,lineNumber:160,columnNumber:13},this),(0,V.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`settings.systemDescription`)},void 0,!1,{fileName:q,lineNumber:161,columnNumber:13},this),(0,V.jsxDEV)(S,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,V.jsxDEV)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[(0,V.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`core.settings.label`)},void 0,!1,{fileName:q,lineNumber:164,columnNumber:17},this),R&&(0,V.jsxDEV)(Y,{plugin:R,busy:p(`core`),onUpdate:()=>I(R)},void 0,!1,{fileName:q,lineNumber:165,columnNumber:26},this)]},void 0,!0,{fileName:q,lineNumber:163,columnNumber:15},this),(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,V.jsxDEV)(c,{to:`/settings/core`,title:e(`core.settings.label`),"aria-label":e(`core.settings.label`),children:(0,V.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:q,lineNumber:169,columnNumber:19},this)},void 0,!1,{fileName:q,lineNumber:168,columnNumber:17},this)},void 0,!1,{fileName:q,lineNumber:167,columnNumber:15},this)]},void 0,!0,{fileName:q,lineNumber:162,columnNumber:13},this)]},void 0,!0,{fileName:q,lineNumber:159,columnNumber:11},this),(0,V.jsxDEV)(`section`,{className:`mb-6`,children:[(0,V.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.usersTitle`)},void 0,!1,{fileName:q,lineNumber:177,columnNumber:13},this),(0,V.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`settings.usersDescription`)},void 0,!1,{fileName:q,lineNumber:178,columnNumber:13},this),(0,V.jsxDEV)(S,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,V.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`settings.usersTitle`)},void 0,!1,{fileName:q,lineNumber:181,columnNumber:17},this)},void 0,!1,{fileName:q,lineNumber:180,columnNumber:15},this),(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,V.jsxDEV)(c,{to:`/settings/users`,title:e(`settings.usersTitle`),"aria-label":e(`settings.usersTitle`),children:(0,V.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:q,lineNumber:185,columnNumber:19},this)},void 0,!1,{fileName:q,lineNumber:184,columnNumber:17},this)},void 0,!1,{fileName:q,lineNumber:183,columnNumber:15},this)]},void 0,!0,{fileName:q,lineNumber:179,columnNumber:13},this)]},void 0,!0,{fileName:q,lineNumber:176,columnNumber:11},this),(0,V.jsxDEV)(`section`,{children:[(0,V.jsxDEV)(`div`,{className:`mb-1 flex items-center gap-3`,children:[(0,V.jsxDEV)(`h2`,{className:`text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`plugins.title`)},void 0,!1,{fileName:q,lineNumber:194,columnNumber:15},this),m.length>0&&(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,disabled:d!==null,onClick:L,className:`shrink-0 border border-accent/40 text-accent hover:bg-accent/10 hover:text-accent`,children:e(`plugins.updateAllButton`,{count:m.length})},void 0,!1,{fileName:q,lineNumber:196,columnNumber:17},this)]},void 0,!0,{fileName:q,lineNumber:193,columnNumber:13},this),(0,V.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`plugins.description`)},void 0,!1,{fileName:q,lineNumber:208,columnNumber:13},this),l?(0,V.jsxDEV)(`p`,{className:`text-muted`,children:e(`plugins.loading`)},void 0,!1,{fileName:q,lineNumber:211,columnNumber:15},this):(0,V.jsxDEV)(V.Fragment,{children:[T&&(0,V.jsxDEV)(`div`,{className:`mb-5 rounded-xl border border-accent/40 bg-accent/10 px-4 py-3 text-sm text-accent`,children:[e(`plugins.restartBannerBefore`),(0,V.jsxDEV)(`b`,{children:e(`plugins.restartBannerBold`)},void 0,!1,{fileName:q,lineNumber:217,columnNumber:21},this),e(`plugins.restartBannerAfter`)]},void 0,!0,{fileName:q,lineNumber:215,columnNumber:19},this),h&&(0,V.jsxDEV)(`div`,{className:`mb-5 rounded-xl border border-danger/40 bg-danger/10 px-4 py-3 text-sm text-danger`,children:h},void 0,!1,{fileName:q,lineNumber:222,columnNumber:19},this),(0,V.jsxDEV)(`div`,{className:`flex flex-col gap-2`,children:a.filter(e=>e.id!==`core`).map(t=>{let n=O(t.id),r=t.enabled?a.filter(e=>e.enabled&&e.id!==t.id&&e.dependsOn.includes(t.id)):[],s=r.length>0,l=s?e(`plugins.blockedByDependents`,{list:r.map(e=>D(e.id)).join(`, `)}):t.enabled?e(`plugins.switchDisable`):e(`plugins.switchEnable`),u=[t.dependsOn.length>0&&`${e(`plugins.metaDepends`)} ${t.dependsOn.map(D).join(`, `)}`,t.vaults.length>0&&`${e(`plugins.metaVaults`)} ${t.vaults.map(k).join(`, `)}`,t.extends.length>0&&`${e(`plugins.metaExtends`)} ${t.extends.map(e=>A(t.id,e)).join(`, `)}`].filter(Boolean).join(` · `)||`—`;return(0,V.jsxDEV)(S,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,V.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxDEV)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxDEV)(`span`,{className:`font-semibold text-text`,children:D(t.id)},void 0,!1,{fileName:q,lineNumber:259,columnNumber:31},this),(0,V.jsxDEV)(Y,{plugin:t,busy:p(t.id),onUpdate:()=>I(t)},void 0,!1,{fileName:q,lineNumber:260,columnNumber:31},this)]},void 0,!0,{fileName:q,lineNumber:258,columnNumber:29},this),n&&(0,V.jsxDEV)(`div`,{className:`text-xs text-muted mt-0.5 truncate`,children:n},void 0,!1,{fileName:q,lineNumber:262,columnNumber:45},this),(0,V.jsxDEV)(`div`,{className:`text-xs text-muted mt-0.5 truncate`,children:u},void 0,!1,{fileName:q,lineNumber:263,columnNumber:29},this)]},void 0,!0,{fileName:q,lineNumber:257,columnNumber:27},this),t.hasSettings&&(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,V.jsxDEV)(c,{to:`/settings/${t.id}`,title:e(`plugins.settingsTitle`,{defaultValue:`Налаштування`}),"aria-label":e(`plugins.settingsTitle`,{defaultValue:`Налаштування`}),children:(0,V.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:q,lineNumber:278,columnNumber:33},this)},void 0,!1,{fileName:q,lineNumber:273,columnNumber:31},this)},void 0,!1,{fileName:q,lineNumber:266,columnNumber:29},this),(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,disabled:p(t.id),onClick:()=>N(t),title:e(`plugins.purgeTitle`),className:`shrink-0 border border-danger/40 text-danger hover:bg-danger/10 hover:text-danger`,children:e(`plugins.purgeButton`)},void 0,!1,{fileName:q,lineNumber:282,columnNumber:27},this),(0,V.jsxDEV)(`span`,{title:l,className:`shrink-0`,children:(0,V.jsxDEV)(U,{checked:t.enabled,disabled:p(t.id)||s,onCheckedChange:()=>P(t),title:l},void 0,!1,{fileName:q,lineNumber:296,columnNumber:29},this)},void 0,!1,{fileName:q,lineNumber:295,columnNumber:27},this)]},t.id,!0,{fileName:q,lineNumber:256,columnNumber:25},this)})},void 0,!1,{fileName:q,lineNumber:227,columnNumber:17},this)]},void 0,!0,{fileName:q,lineNumber:213,columnNumber:15},this)]},void 0,!0,{fileName:q,lineNumber:192,columnNumber:11},this)]},void 0,!0,{fileName:q,lineNumber:157,columnNumber:9},this)]},void 0,!0,{fileName:q,lineNumber:138,columnNumber:5},this)}function Y({plugin:e,busy:t,onUpdate:n}){let{t:i}=r(),a=!!e.latestVersion&&e.latestVersion!==e.installedVersion;return(0,V.jsxDEV)(V.Fragment,{children:[(0,V.jsxDEV)(K,{variant:`secondary`,className:`text-[10px] font-medium`,children:[`v`,e.installedVersion]},void 0,!0,{fileName:q,lineNumber:329,columnNumber:7},this),a&&(0,V.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,disabled:t,onClick:n,title:i(`plugins.updateTitle`,{from:e.installedVersion,to:e.latestVersion}),className:`shrink-0 border border-accent/40 text-accent hover:bg-accent/10 hover:text-accent`,children:i(`plugins.updateButton`)},void 0,!1,{fileName:q,lineNumber:333,columnNumber:9},this)]},void 0,!0,{fileName:q,lineNumber:328,columnNumber:5},this)}export{J as SettingsPage};
@@ -1 +0,0 @@
1
- import{i as e}from"./fields-DVMUyXbG.js";import{n as t}from"./plugin-b0fDTTXJ.js";import{t as n}from"./settings-Dfvzj6n2.js";var r=t({id:`nextcloud`,version:`1.0.0`,dependsOn:[],vaults:[],settings:n({label:`nextcloud.settings.label`,fields:[e.string({key:`nextcloud_url`,label:`nextcloud.settings.nextcloud_url`,required:!0}),e.string({key:`login`,label:`nextcloud.settings.login`,required:!0}),e.password({key:`password`,label:`nextcloud.settings.password`,required:!0}),e.button({label:`nextcloud.settings.test_button`,value:`nextcloud.testConnection`,icon:`lucide:wifi`})]})});export{r as default};