@protobase/ui 0.54.5 → 0.54.6
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/dist/app/app.js +5 -4
- package/dist/app/nav-recent.js +7 -5
- package/dist/app/pages/field-value.js +19 -11
- package/dist/app/pages/merge-ui.d.ts +1 -1
- package/dist/app/pages/merge-ui.js +3 -1
- package/dist/app/pages/project-ui.d.ts +4 -1
- package/dist/app/record-page.js +3 -3
- package/dist/app/related-cards/related-card.js +32 -28
- package/dist/app/search/search-model.js +15 -6
- package/dist/app/search/use-global-search.js +3 -1
- package/dist/app/titles/record-title-of.js +17 -0
- package/dist/app/titles/record-titles.js +63 -0
- package/dist/app/titles/relation-title.js +35 -0
- package/dist/app/titles/title-rule.d.ts +14 -0
- package/dist/app/use-nav-recent.js +3 -1
- package/dist/app/use-related-records.js +9 -9
- package/dist/data/query-keys.js +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/plugins/plugin-ui.js +1 -0
- package/dist/shell/assets/app-Y_3vlU3f.js +9 -0
- package/dist/shell/assets/{index-DvC8OI3c.js → index-IMD8ceia.js} +2 -2
- package/dist/shell/assets/{records-map-C-UIoBtb.js → records-map-TXpdTT7s.js} +2 -2
- package/dist/shell/assets/shared-protobase-ui-BHIhZYVr.js +2 -0
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-Y_3vlU3f.js.map +1 -0
- package/dist/shell-source-maps/assets/{index-DvC8OI3c.js.map → index-IMD8ceia.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-C-UIoBtb.js.map → records-map-TXpdTT7s.js.map} +1 -1
- package/dist/shell-source-maps/assets/shared-protobase-ui-BHIhZYVr.js.map +1 -0
- package/package.json +4 -4
- package/dist/shell/assets/app-7LGt1Apg.js +0 -9
- package/dist/shell/assets/shared-protobase-ui-Cc69lTef.js +0 -2
- package/dist/shell-source-maps/assets/app-7LGt1Apg.js.map +0 -1
- package/dist/shell-source-maps/assets/shared-protobase-ui-Cc69lTef.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{G as r,V as i,q as a}from"./vendor-xNCj9Gc_.js";import{$ as o,A as s,At as c,B as l,C as u,Ct as d,D as f,Dt as ee,E as p,Et as m,F as h,Ft as g,H as te,I as ne,It as re,J as ie,K as ae,L as oe,M as se,Mt as _,N as v,Nt as y,O as b,Ot as x,P as S,Pt as C,Q as w,R as T,S as E,St as D,T as O,Tt as k,U as A,V as j,W as M,X as N,Y as P,Z as F,_ as I,_t as L,a as R,at as z,b as B,bt as V,c as H,ct as U,d as W,dt as G,et as K,f as ce,ft as le,g as ue,gt as de,h as fe,ht as pe,i as me,it as q,j as he,jt as ge,k as J,kt as _e,l as ve,lt as ye,m as be,mt as Y,n as xe,nt as Se,o as Ce,ot as we,p as Te,pt as Ee,q as De,r as Oe,rt as ke,s as Ae,st as je,t as Me,tt as Ne,u as Pe,ut as Fe,v as Ie,vt as Le,w as Re,x as ze,xt as Be,y as Ve,yt as He,z as Ue}from"./app-7LGt1Apg.js";import{n as We}from"./preload-helper-SYSsmQ2O.js";import{t as X}from"./cn-Bi0ZEjD9.js";var Ge=e=>new Date(Date.parse(`${e}T00:00:00Z`)-864e5).toISOString().slice(0,10),Ke=(e,t,n=d())=>D(Date.parse(e),n)===D(Date.parse(t),n),Z=(e,t=Date.now(),n=d())=>{let r=D(Date.parse(e),n),i=D(t,n);return r===i?J(`today`):r===Ge(i)?J(`yesterday`):Be(Date.parse(`${r}T00:00:00Z`))},Q=e(n(),1),qe=({tone:e=`day`,label:t})=>{let n=t??J(`newMessages`),r=X(`h-px flex-1`,e===`new`?`bg-danger`:`bg-border`);return(0,Q.jsxs)(`div`,{role:`separator`,"aria-label":n,"data-tone":e,"data-chat-divider":``,className:`flex items-center gap-3 text-xs font-medium`,children:[(0,Q.jsx)(`span`,{className:r}),(0,Q.jsx)(`span`,{className:e===`new`?`text-danger`:`text-muted-foreground`,children:n}),(0,Q.jsx)(`span`,{className:r})]})},Je=({row:e,resource:t,recordKey:n,...r})=>{let i=De(),a=q(),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)(Y,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},$=e(t(),1),Ye=(e,t=Date.now())=>e.isSuccess&&!e.isFetching&&t-e.dataUpdatedAt>=1e4,Xe=()=>{let e=re(),t=e?.state.kind===`signed-in`?e.state.user:void 0,n=i({queryKey:g.members(t?.id??``),enabled:t!==void 0,queryFn:()=>{if(!e?.organizations)throw Error(`useMembers() needs organizations: turn them on in the auth config.`);return e.session.organizations.people()}}),r=(0,$.useMemo)(()=>new Map((n.data??[]).map(e=>[e.id,e])),[n.data]),{refetch:a}=n,o=(0,$.useCallback)(e=>{let t=r.get(e);return!t&&Ye(n)&&setTimeout(()=>void a(),0),t},[r,n,a]);return{...n,member:o}},Ze={width:640,height:480},Qe=e=>e.flatMap(e=>{if(`src`in e)return[{image:{url:e.src},alt:e.alt}];let t=de(e,Ze);return t?[{image:t,alt:e.alt??``}]:[]}),$e=({images:e,label:t,fit:n=`cover`,swipe:r=!0,className:i})=>{let a=Qe(e),o=ie(a.length);return(0,Q.jsxs)(`div`,{role:`group`,"aria-roledescription":`carousel`,"aria-label":t,className:X(`group/carousel relative overflow-hidden`,i),children:[(0,Q.jsx)(P,{"data-carousel-track":!0,carousel:o,swipe:r,slides:a.map(({image:e,alt:t})=>(0,Q.jsx)(ye,{image:e,alt:t,loading:`lazy`,className:X(`size-full`,n===`cover`?`object-cover`:`object-contain`)}))}),(0,Q.jsx)(N,{carousel:o,count:a.length,swipe:r,reveal:`group-hover/carousel:opacity-100`,className:`inset-0`})]})},et=({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:X(`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:X(`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))}),tt=(e,t,n)=>{let o=y(),s=a(),c=[...new Set(n)].sort();return i({queryKey:g.pickedLabels(e.name,c.join(`,`)),enabled:c.length>0,placeholderData:r,queryFn:()=>K(s,o,e,c,t)}).data??new Map},nt=e=>{let{resources:t,views:n}=_e(),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,$.useState)({}),c=tt(r,i,a),l=e=>o[e]??c.get(e)??e,u=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,Q.jsx)(G,{target:r,view:i,value:t??``,label:t===void 0?void 0:l(t),invalid:e.invalid,onChange:(e,t)=>{u(e,t),n(e)}})}let{value:d,onChange:f}=e;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(G,{target:r,view:i,value:``,chosen:d,several:!0,invalid:e.invalid,onChange:(e,t)=>{u(e,t),f(d.includes(e)?d.filter(t=>t!==e):[...d,e])}}),d.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,Q.jsx)(w,{label:l(e),onRemove:()=>f(d.filter(t=>t!==e))},e))})]})};export{B as ActionCard,z as ActionInputError,_ as ApiProvider,Me as App,Y as AppLink,W as AssistantDock,A as AuthLayout,ee as Button,$e as Carousel,qe as ChatDivider,b as ChatMessage,f as ChatThread,et as Choices,oe as CodeForm,Ie as CompactTable,E as Composer,m as Dialog,fe as DiffView,Le as Field,Ve as FieldList,H as Form,He as Input,o as LogoMark,we as Markdown,Re as MentionBox,u as MentionedText,M as MenuSelect,Fe as OtpInput,Te as PartView,Je as RecordLink,nt as RecordPicker,T as ResendCodeButton,k as ResponsiveDialog,L as Section,We as Segmented,ze as SidePanel,F as SignInPrompt,c as Spinner,be as StepList,Ee as Textarea,Ue as allowDelayMs,x as buttonClass,Z as chatDayLabel,je as definePlugin,U as defineUi,ue as diffStats,O as emptyDraft,xe as isConflict,l as isFramed,p as mentionedIds,h as mergeUi,I as parseDiff,se as pluginApi,v as protobaseVersion,Ke as sameChatDay,ne as uiFromModule,he as useApiToken,pe as useAppAddress,j as useArmedAfterFocus,Pe as useAssistant,ve as useAssistantClient,ce as useBackendData,y as useClient,Ne as useFacets,V as useFieldControl,te as useGuardedPress,Se as useHistogram,me as useInbox,q as useLayoutRecord,le as useList,ae as useListDisplay,R as useMarkNotificationsRead,Xe as useMembers,ge as useMeta,S as usePlugin,Ae as usePushNotifications,s as useRecord,C as useResourceClient,ke as useSeries,Ce as useUnreadNotifications,Oe as useUpdateRecord};
|
|
2
|
-
//# debugId=9cebd953-79f3-4ba9-8bd8-b08c520e11e5
|