@coffer-org/web 1.3.1 → 1.5.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 +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-BWdgp_qe.js"></script>
40
+ <script type="module" crossorigin src="/assets/index-DQMxiv4z.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-gSu-mjEH.js">
65
+ <link rel="modulepreload" crossorigin href="/assets/api-BpunGHNa.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-BLh4J0hg.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/auth-context-BNCSMPL8.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.3.1",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -1 +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{d as _,v,y}from"./api-gSu-mjEH.js";import{n as b,r as x}from"./auth-context-BLh4J0hg.js";import{t as S}from"./PageBody-DXEdPT8C.js";var C=e(t(),1),w=h(),T=`Switch`,[E,D]=p(T),[O,k]=E(T);function A(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:T}),[h,g]=C.useState(null),[_,v]=C.useState(null),y={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:C.useRef(!1),required:l,defaultChecked:i,isFormControl:h?!!o||!!h.closest(`form`):!0,bubbleInput:_,setBubbleInput:v};return(0,w.jsx)(O,{scope:t,...y,children:R(d)?d(y):r})}var j=`SwitchTrigger`,M=C.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}=k(j,e),g=n(i,l);return(0,w.jsx)(d.button,{type:`button`,role:`switch`,"aria-checked":s,"aria-required":c,"data-state":z(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())})})});M.displayName=j;var N=C.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,w.jsx)(A,{__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,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(M,{...d,ref:t,__scopeSwitch:n}),e&&(0,w.jsx)(L,{__scopeSwitch:n})]})})});N.displayName=T;var P=`SwitchThumb`,F=C.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=k(P,n);return(0,w.jsx)(d.span,{"data-state":z(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});F.displayName=P;var I=`SwitchBubbleInput`,L=C.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:_}=k(I,e),v=n(r,_),y=g(o),b=f(i);C.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=C.useRef(o);return(0,w.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%)`}})});L.displayName=I;function R(e){return typeof e==`function`}function z(e){return e?`checked`:`unchecked`}var B=l(),V=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/switch.tsx`,H=C.forwardRef(({className:e,...t},n)=>(0,B.jsxDEV)(N,{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,B.jsxDEV)(F,{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:V,lineNumber:20,columnNumber:5},void 0)},void 0,!1,{fileName:V,lineNumber:9,columnNumber:3},void 0));H.displayName=N.displayName;var U=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/components/ui/badge.tsx`,W=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 G({className:e,variant:t,...n}){return(0,B.jsxDEV)(`div`,{className:s(W({variant:t}),e),...n},void 0,!1,{fileName:U,lineNumber:24,columnNumber:10},this)}var K=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/app/SettingsPage.tsx`;function q(){let{t:e}=r(),{role:t}=b(),n=t===`admin`,[a,s]=(0,C.useState)([]),[l,u]=(0,C.useState)(!0),[d,f]=(0,C.useState)(null),[p,m]=(0,C.useState)(null),[h,g]=(0,C.useState)(!1),w=t=>e(`${t}.plugin.label`,{defaultValue:t}),T=t=>e(`${t}.plugin.description`,{defaultValue:``}),E=t=>e(`${t}.vault.label`,{defaultValue:t}),D=(t,n)=>e(`${t}.${n}.label`,{defaultValue:n}),O={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`)},k=()=>_().then(e=>{s(e),u(!1)});(0,C.useEffect)(()=>{k()},[]);async function A(t){if(!window.confirm(e(`plugins.confirmPurge`,{id:t.id})))return;f(t.id),m(null);let n=await fetch(`/api/plugins/${t.id}/data`,{method:`DELETE`}),r=await n.json().catch(()=>({}));if(f(null),!n.ok){m(O[r.error]?.(r)??e(`plugins.genericError`,{code:r.error??n.status}));return}g(!0),await k()}async function j(t){f(t.id),m(null);let n=await v(t.id,!t.enabled);if(!n.ok){f(null),m(O[n.error]?.(n.data??{})??e(`plugins.genericError`,{code:n.error}));return}window.location.reload()}async function M(){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 N(t){if(!t.latestVersion||!window.confirm(e(`plugins.confirmUpdate`,{id:t.id,from:t.installedVersion,to:t.latestVersion})))return;f(t.id),m(null);let n=await y(t.id);if(!n.ok){f(null),m(n.stderr?`${e(`plugins.updateError`)}: ${n.stderr}`:e(`plugins.genericError`,{code:n.error}));return}g(!0),await M()&&window.location.reload()}let P=a.find(e=>e.id===`core`);return(0,B.jsxDEV)(S,{children:[(0,B.jsxDEV)(`h1`,{className:`mb-6 text-[28px] font-bold text-text`,children:e(`settings.title`)},void 0,!1,{fileName:K,lineNumber:118,columnNumber:7},this),(0,B.jsxDEV)(`section`,{className:`mb-6`,children:[(0,B.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.personalTitle`)},void 0,!1,{fileName:K,lineNumber:122,columnNumber:9},this),(0,B.jsxDEV)(x,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,B.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:(0,B.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`auth.accountTitle`)},void 0,!1,{fileName:K,lineNumber:125,columnNumber:13},this)},void 0,!1,{fileName:K,lineNumber:124,columnNumber:11},this),(0,B.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,B.jsxDEV)(c,{to:`/settings/account`,title:e(`auth.accountTitle`),"aria-label":e(`auth.accountTitle`),children:(0,B.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:K,lineNumber:129,columnNumber:15},this)},void 0,!1,{fileName:K,lineNumber:128,columnNumber:13},this)},void 0,!1,{fileName:K,lineNumber:127,columnNumber:11},this)]},void 0,!0,{fileName:K,lineNumber:123,columnNumber:9},this)]},void 0,!0,{fileName:K,lineNumber:121,columnNumber:7},this),n&&(0,B.jsxDEV)(B.Fragment,{children:[(0,B.jsxDEV)(`section`,{className:`mb-6`,children:[(0,B.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.systemTitle`)},void 0,!1,{fileName:K,lineNumber:139,columnNumber:13},this),(0,B.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`settings.systemDescription`)},void 0,!1,{fileName:K,lineNumber:140,columnNumber:13},this),(0,B.jsxDEV)(x,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,B.jsxDEV)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[(0,B.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`core.settings.label`)},void 0,!1,{fileName:K,lineNumber:143,columnNumber:17},this),P&&(0,B.jsxDEV)(J,{plugin:P,busy:d===`core`,onUpdate:()=>N(P)},void 0,!1,{fileName:K,lineNumber:144,columnNumber:26},this)]},void 0,!0,{fileName:K,lineNumber:142,columnNumber:15},this),(0,B.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,B.jsxDEV)(c,{to:`/settings/core`,title:e(`core.settings.label`),"aria-label":e(`core.settings.label`),children:(0,B.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:K,lineNumber:148,columnNumber:19},this)},void 0,!1,{fileName:K,lineNumber:147,columnNumber:17},this)},void 0,!1,{fileName:K,lineNumber:146,columnNumber:15},this)]},void 0,!0,{fileName:K,lineNumber:141,columnNumber:13},this)]},void 0,!0,{fileName:K,lineNumber:138,columnNumber:11},this),(0,B.jsxDEV)(`section`,{className:`mb-6`,children:[(0,B.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`settings.usersTitle`)},void 0,!1,{fileName:K,lineNumber:156,columnNumber:13},this),(0,B.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`settings.usersDescription`)},void 0,!1,{fileName:K,lineNumber:157,columnNumber:13},this),(0,B.jsxDEV)(x,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,B.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:(0,B.jsxDEV)(`span`,{className:`font-semibold text-text`,children:e(`settings.usersTitle`)},void 0,!1,{fileName:K,lineNumber:160,columnNumber:17},this)},void 0,!1,{fileName:K,lineNumber:159,columnNumber:15},this),(0,B.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,B.jsxDEV)(c,{to:`/settings/users`,title:e(`settings.usersTitle`),"aria-label":e(`settings.usersTitle`),children:(0,B.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:K,lineNumber:164,columnNumber:19},this)},void 0,!1,{fileName:K,lineNumber:163,columnNumber:17},this)},void 0,!1,{fileName:K,lineNumber:162,columnNumber:15},this)]},void 0,!0,{fileName:K,lineNumber:158,columnNumber:13},this)]},void 0,!0,{fileName:K,lineNumber:155,columnNumber:11},this),(0,B.jsxDEV)(`section`,{children:[(0,B.jsxDEV)(`h2`,{className:`mb-1 text-sm font-semibold uppercase tracking-wide text-muted`,children:e(`plugins.title`)},void 0,!1,{fileName:K,lineNumber:172,columnNumber:13},this),(0,B.jsxDEV)(`p`,{className:`mb-3 text-sm text-muted`,children:e(`plugins.description`)},void 0,!1,{fileName:K,lineNumber:173,columnNumber:13},this),l?(0,B.jsxDEV)(`p`,{className:`text-muted`,children:e(`plugins.loading`)},void 0,!1,{fileName:K,lineNumber:176,columnNumber:15},this):(0,B.jsxDEV)(B.Fragment,{children:[h&&(0,B.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,B.jsxDEV)(`b`,{children:e(`plugins.restartBannerBold`)},void 0,!1,{fileName:K,lineNumber:182,columnNumber:21},this),e(`plugins.restartBannerAfter`)]},void 0,!0,{fileName:K,lineNumber:180,columnNumber:19},this),p&&(0,B.jsxDEV)(`div`,{className:`mb-5 rounded-xl border border-danger/40 bg-danger/10 px-4 py-3 text-sm text-danger`,children:p},void 0,!1,{fileName:K,lineNumber:187,columnNumber:19},this),(0,B.jsxDEV)(`div`,{className:`flex flex-col gap-2`,children:a.filter(e=>e.id!==`core`).map(t=>{let n=T(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=>w(e.id)).join(`, `)}):t.enabled?e(`plugins.switchDisable`):e(`plugins.switchEnable`),u=[t.dependsOn.length>0&&`${e(`plugins.metaDepends`)} ${t.dependsOn.map(w).join(`, `)}`,t.vaults.length>0&&`${e(`plugins.metaVaults`)} ${t.vaults.map(E).join(`, `)}`,t.extends.length>0&&`${e(`plugins.metaExtends`)} ${t.extends.map(e=>D(t.id,e)).join(`, `)}`].filter(Boolean).join(` · `)||`—`;return(0,B.jsxDEV)(x,{className:`flex items-center gap-4 px-4 py-3`,children:[(0,B.jsxDEV)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxDEV)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxDEV)(`span`,{className:`font-semibold text-text`,children:w(t.id)},void 0,!1,{fileName:K,lineNumber:224,columnNumber:31},this),(0,B.jsxDEV)(J,{plugin:t,busy:d===t.id,onUpdate:()=>N(t)},void 0,!1,{fileName:K,lineNumber:225,columnNumber:31},this)]},void 0,!0,{fileName:K,lineNumber:223,columnNumber:29},this),n&&(0,B.jsxDEV)(`div`,{className:`text-xs text-muted mt-0.5 truncate`,children:n},void 0,!1,{fileName:K,lineNumber:227,columnNumber:45},this),(0,B.jsxDEV)(`div`,{className:`text-xs text-muted mt-0.5 truncate`,children:u},void 0,!1,{fileName:K,lineNumber:228,columnNumber:29},this)]},void 0,!0,{fileName:K,lineNumber:222,columnNumber:27},this),t.hasSettings&&(0,B.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,className:`shrink-0 border border-border`,asChild:!0,children:(0,B.jsxDEV)(c,{to:`/settings/${t.id}`,title:e(`plugins.settingsTitle`,{defaultValue:`Налаштування`}),"aria-label":e(`plugins.settingsTitle`,{defaultValue:`Налаштування`}),children:(0,B.jsxDEV)(i,{name:`lucide:settings`,size:16},void 0,!1,{fileName:K,lineNumber:243,columnNumber:33},this)},void 0,!1,{fileName:K,lineNumber:238,columnNumber:31},this)},void 0,!1,{fileName:K,lineNumber:231,columnNumber:29},this),(0,B.jsxDEV)(o,{variant:`ghost`,size:`sm`,type:`button`,disabled:d===t.id,onClick:()=>A(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:K,lineNumber:247,columnNumber:27},this),(0,B.jsxDEV)(`span`,{title:l,className:`shrink-0`,children:(0,B.jsxDEV)(H,{checked:t.enabled,disabled:d===t.id||s,onCheckedChange:()=>j(t),title:l},void 0,!1,{fileName:K,lineNumber:261,columnNumber:29},this)},void 0,!1,{fileName:K,lineNumber:260,columnNumber:27},this)]},t.id,!0,{fileName:K,lineNumber:221,columnNumber:25},this)})},void 0,!1,{fileName:K,lineNumber:192,columnNumber:17},this)]},void 0,!0,{fileName:K,lineNumber:178,columnNumber:15},this)]},void 0,!0,{fileName:K,lineNumber:171,columnNumber:11},this)]},void 0,!0,{fileName:K,lineNumber:136,columnNumber:9},this)]},void 0,!0,{fileName:K,lineNumber:117,columnNumber:5},this)}function J({plugin:e,busy:t,onUpdate:n}){let{t:i}=r(),a=!!e.latestVersion&&e.latestVersion!==e.installedVersion;return(0,B.jsxDEV)(B.Fragment,{children:[(0,B.jsxDEV)(G,{variant:`secondary`,className:`text-[10px] font-medium`,children:[`v`,e.installedVersion]},void 0,!0,{fileName:K,lineNumber:294,columnNumber:7},this),a&&(0,B.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:K,lineNumber:298,columnNumber:9},this)]},void 0,!0,{fileName:K,lineNumber:293,columnNumber:5},this)}export{q 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};