@protobase/ui 0.37.2 → 0.39.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,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{$ as n,A as r,B as i,C as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as ee,O as te,P as ne,Q as re,R as g,S as _,T as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as T,_t as E,a as D,at as O,b as k,c as A,ct as j,d as M,dt as N,et as P,f as F,ft as I,g as L,gt as R,h as z,ht as B,i as V,it as H,j as U,k as ie,l as W,lt as G,m as K,mt as q,n as J,nt as Y,ot as ae,p as oe,q as se,r as ce,rt as le,s as ue,st as de,t as fe,tt as X,u as pe,ut as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./app-C1zG0oRE.js";import{r as be}from"./preload-helper-BZ3hrQDD.js";import{t as Z}from"./cn-Bi0ZEjD9.js";import{t as xe}from"./jsx-runtime-NZYk81nU.js";var Q=e(xe(),1),Se=({row:e,resource:t,recordKey:n,...r})=>{let i=A(),a=K(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,Q.jsx)(g,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},Ce=({name:e,label:t,options:n,value:r,onChange:i})=>(0,Q.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,Q.jsxs)(`label`,{className:Z(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,Q.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,Q.jsx)(`span`,{className:Z(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),$=(e,t,n)=>{let r=X(),i=ae(),a=[...new Set(n)].sort();return H({queryKey:le.pickedLabels(e.name,a.join(`,`)),enabled:a.length>0,placeholderData:O,queryFn:()=>pe(i,r,e,a,t)}).data??new Map},we=e(t(),1),Te=e=>{let{resources:t,views:n}=re(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,we.useState)({}),l=$(r,i,a),u=e=>o[e]??l.get(e)??e,d=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,Q.jsx)(c,{target:r,view:i,value:t??``,label:t===void 0?void 0:u(t),invalid:e.invalid,onChange:(e,t)=>{d(e,t),n(e)}})}let{value:f,onChange:p}=e;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(c,{target:r,view:i,value:``,chosen:f,several:!0,invalid:e.invalid,onChange:(e,t)=>{d(e,t),p(f.includes(e)?f.filter(t=>t!==e):[...f,e])}}),f.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,Q.jsx)(W,{label:u(e),onRemove:()=>p(f.filter(t=>t!==e))},e))})]})};export{o as ActionCard,z as ActionInputError,P as ApiProvider,fe as App,g as AppLink,he as AssistantDock,w as AuthLayout,N as Button,U as ChatMessage,r as ChatThread,Ce as Choices,C as CodeForm,v as CompactTable,ie as Composer,me as Dialog,_ as DiffView,b as Field,s as FieldList,V as Form,B as Input,E as LogoMark,h as Markdown,D as MenuSelect,G as OtpInput,k as PartView,Se as RecordLink,Te as RecordPicker,S as ResendCodeButton,j as ResponsiveDialog,i as Section,be as Segmented,te as SidePanel,de as SignInPrompt,q as Spinner,_e as StepList,m as Textarea,I as buttonClass,ee as definePlugin,ne as defineUi,a as diffStats,J as isConflict,se as mergeUi,ge as parseDiff,x as pluginApi,l as protobaseVersion,f as uiFromModule,y as useApiToken,ye as useAppAddress,T as useAssistant,L as useAssistantClient,ve as useBackendData,X as useClient,M as useFacets,R as useFieldControl,F as useHistogram,K as useLayoutRecord,d as useList,ue as useListDisplay,n as useMeta,p as usePlugin,u as useRecord,Y as useResourceClient,oe as useSeries,ce as useUpdateRecord};
2
- //# debugId=63f7e2e9-2036-4607-8ba1-208a83f0e17f
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{$ as n,A as r,B as i,C as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as ee,O as te,P as ne,Q as re,R as g,S as _,T as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as T,_t as E,a as D,at as O,b as k,c as A,ct as j,d as M,dt as N,et as P,f as F,ft as I,g as L,gt as R,h as z,ht as B,i as V,it as H,j as U,k as ie,l as W,lt as G,m as K,mt as q,n as J,nt as Y,ot as ae,p as oe,q as se,r as ce,rt as le,s as ue,st as de,t as fe,tt as X,u as pe,ut as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./app-BCgljtR4.js";import{r as be}from"./preload-helper-BZ3hrQDD.js";import{t as Z}from"./cn-Bi0ZEjD9.js";import{t as xe}from"./jsx-runtime-NZYk81nU.js";var Q=e(xe(),1),Se=({row:e,resource:t,recordKey:n,...r})=>{let i=A(),a=K(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,Q.jsx)(g,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},Ce=({name:e,label:t,options:n,value:r,onChange:i})=>(0,Q.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,Q.jsxs)(`label`,{className:Z(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,Q.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,Q.jsx)(`span`,{className:Z(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),$=(e,t,n)=>{let r=X(),i=ae(),a=[...new Set(n)].sort();return H({queryKey:le.pickedLabels(e.name,a.join(`,`)),enabled:a.length>0,placeholderData:O,queryFn:()=>pe(i,r,e,a,t)}).data??new Map},we=e(t(),1),Te=e=>{let{resources:t,views:n}=re(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,we.useState)({}),l=$(r,i,a),u=e=>o[e]??l.get(e)??e,d=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,Q.jsx)(c,{target:r,view:i,value:t??``,label:t===void 0?void 0:u(t),invalid:e.invalid,onChange:(e,t)=>{d(e,t),n(e)}})}let{value:f,onChange:p}=e;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(c,{target:r,view:i,value:``,chosen:f,several:!0,invalid:e.invalid,onChange:(e,t)=>{d(e,t),p(f.includes(e)?f.filter(t=>t!==e):[...f,e])}}),f.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,Q.jsx)(W,{label:u(e),onRemove:()=>p(f.filter(t=>t!==e))},e))})]})};export{o as ActionCard,z as ActionInputError,P as ApiProvider,fe as App,g as AppLink,he as AssistantDock,w as AuthLayout,N as Button,U as ChatMessage,r as ChatThread,Ce as Choices,C as CodeForm,v as CompactTable,ie as Composer,me as Dialog,_ as DiffView,b as Field,s as FieldList,V as Form,B as Input,E as LogoMark,h as Markdown,D as MenuSelect,G as OtpInput,k as PartView,Se as RecordLink,Te as RecordPicker,S as ResendCodeButton,j as ResponsiveDialog,i as Section,be as Segmented,te as SidePanel,de as SignInPrompt,q as Spinner,_e as StepList,m as Textarea,I as buttonClass,ee as definePlugin,ne as defineUi,a as diffStats,J as isConflict,se as mergeUi,ge as parseDiff,x as pluginApi,l as protobaseVersion,f as uiFromModule,y as useApiToken,ye as useAppAddress,T as useAssistant,L as useAssistantClient,ve as useBackendData,X as useClient,M as useFacets,R as useFieldControl,F as useHistogram,K as useLayoutRecord,d as useList,ue as useListDisplay,n as useMeta,p as usePlugin,u as useRecord,Y as useResourceClient,oe as useSeries,ce as useUpdateRecord};
2
+ //# debugId=f71d4c2b-5298-4462-86af-c1c537642558
@@ -18,15 +18,15 @@
18
18
  }
19
19
  document.documentElement.dataset.theme = stored === 'light' || stored === 'dark' ? stored : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
20
20
  </script>
21
- <script type="importmap">{"imports":{"react":"/assets/shared-react-DhkZ2M4l.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-xPQrWk0g.js","react-dom":"/assets/shared-react-dom-D508a1cq.js","@protobase/ui":"/assets/shared-protobase-ui-Bj9-LpID.js"}}</script>
22
- <script type="module" crossorigin src="/assets/index-B7G87PyV.js"></script>
21
+ <script type="importmap">{"imports":{"react":"/assets/shared-react-DhkZ2M4l.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-xPQrWk0g.js","react-dom":"/assets/shared-react-dom-D508a1cq.js","@protobase/ui":"/assets/shared-protobase-ui-D3HUwrUp.js"}}</script>
22
+ <script type="module" crossorigin src="/assets/index-Dfo0EmgH.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/react-Cvdyeg_0.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/react-dom-B-VxWsjA.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/cn-Bi0ZEjD9.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-NZYk81nU.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-BZ3hrQDD.js">
29
- <link rel="modulepreload" crossorigin href="/assets/app-C1zG0oRE.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/app-BCgljtR4.js">
30
30
  <link rel="stylesheet" crossorigin href="/assets/app-GUjJKojE.css">
31
31
  <link rel="stylesheet" crossorigin href="/assets/index-BX850JXd.css">
32
32
  <link rel="stylesheet" href="/protobase.theme.css">
@@ -1,5 +1,5 @@
1
1
  {
2
- "protobase": "0.37.2",
2
+ "protobase": "0.39.0",
3
3
  "pluginApi": 1,
4
4
  "paths": [
5
5
  "/index.html",
@@ -1,5 +1,5 @@
1
- const cacheName = "protobase-shell-8642e9653400a4d5"
2
- const precache = ["/index.html","/assets/shared-react-DhkZ2M4l.js","/assets/shared-react-jsx-runtime-xPQrWk0g.js","/assets/shared-react-dom-D508a1cq.js","/assets/shared-protobase-ui-Bj9-LpID.js","/assets/index-B7G87PyV.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-Cvdyeg_0.js","/assets/react-dom-B-VxWsjA.js","/assets/cn-Bi0ZEjD9.js","/assets/jsx-runtime-NZYk81nU.js","/assets/preload-helper-BZ3hrQDD.js","/assets/app-C1zG0oRE.js","/assets/app-GUjJKojE.css","/assets/index-BX850JXd.css","/protobase.theme.css","/protobase.favicon.svg"]
1
+ const cacheName = "protobase-shell-39712983dd6e178d"
2
+ const precache = ["/index.html","/assets/shared-react-DhkZ2M4l.js","/assets/shared-react-jsx-runtime-xPQrWk0g.js","/assets/shared-react-dom-D508a1cq.js","/assets/shared-protobase-ui-D3HUwrUp.js","/assets/index-Dfo0EmgH.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-Cvdyeg_0.js","/assets/react-dom-B-VxWsjA.js","/assets/cn-Bi0ZEjD9.js","/assets/jsx-runtime-NZYk81nU.js","/assets/preload-helper-BZ3hrQDD.js","/assets/app-BCgljtR4.js","/assets/app-GUjJKojE.css","/assets/index-BX850JXd.css","/protobase.theme.css","/protobase.favicon.svg"]
3
3
  const revalidated = ["/protobase.theme.css","/protobase.favicon.svg"]
4
4
 
5
5
  const fromCache = (request) =>