@payloadcms/ui 4.0.0-internal.183b315 → 4.0.0-internal.293e026
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/css/colors.css +107 -60
- package/dist/elements/Chip/index.css +1 -1
- package/dist/elements/Combobox/index.css +8 -8
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/DatePicker.js +4 -2
- package/dist/elements/DatePicker/DatePicker.js.map +1 -1
- package/dist/elements/DatePicker/index.css +5 -0
- package/dist/elements/DatePicker/index.js +1 -1
- package/dist/elements/DatePicker/index.js.map +1 -1
- package/dist/elements/GroupByControl/index.d.ts.map +1 -1
- package/dist/elements/GroupByControl/index.js +3 -0
- package/dist/elements/GroupByControl/index.js.map +1 -1
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +1 -1
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListSelection/index.css +1 -1
- package/dist/elements/Pill/index.css +1 -1
- package/dist/elements/PillSelector/index.css +1 -1
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +27 -10
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/ReactSelect/index.css +53 -52
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +68 -9
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +6 -1
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Blocks/index.js +1 -2
- package/dist/elements/Table/DefaultCell/fields/Blocks/index.js.map +1 -1
- package/dist/elements/TimezonePicker/index.css +73 -24
- package/dist/elements/TimezonePicker/index.d.ts.map +1 -1
- package/dist/elements/TimezonePicker/index.js +31 -4
- package/dist/elements/TimezonePicker/index.js.map +1 -1
- package/dist/elements/WhereBuilder/Condition/index.css +1 -1
- package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/index.js +3 -0
- package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/shared/index.js +1 -1
- package/dist/exports/shared/index.js.map +2 -2
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +6 -11
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Group/index.css +1 -1
- package/dist/fields/Join/index.js +1 -1
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.css +3 -3
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.js +1 -1
- package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/icons/Dots/index.css +4 -4
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +1 -8
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/providers/Theme/index.d.ts +17 -2
- package/dist/providers/Theme/index.d.ts.map +1 -1
- package/dist/providers/Theme/index.js +122 -73
- package/dist/providers/Theme/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/copyDataFromLocale.js +1 -1
- package/dist/utilities/copyDataFromLocale.js.map +1 -1
- package/dist/utilities/renderTable.js +1 -1
- package/dist/utilities/renderTable.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.js +3 -0
- package/dist/utilities/traverseForLocalizedFields.js.map +1 -1
- package/dist/views/List/index.js +2 -2
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/Verify/index.client.d.ts +4 -0
- package/dist/views/Verify/index.client.d.ts.map +1 -1
- package/dist/views/Verify/index.client.js +81 -0
- package/dist/views/Verify/index.client.js.map +1 -1
- package/dist/views/Verify/index.css +38 -0
- package/dist/views/Verify/index.d.ts +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +13 -19
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +2 -2
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +3 -3
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
- package/package.json +4 -4
- package/dist/views/Unauthorized/index.scss +0 -14
- package/dist/views/Verify/index.scss +0 -18
|
@@ -2,5 +2,5 @@ import{jsx as g}from"react/jsx-runtime";import"react";var V=({elements:e,transla
|
|
|
2
2
|
.graphic-logo path {
|
|
3
3
|
fill: var(--color-text);
|
|
4
4
|
}
|
|
5
|
-
`,ne=()=>F("svg",{className:"graphic-logo",fill:"none",height:"32",viewBox:"0 0 143 32",width:"143",xmlns:"http://www.w3.org/2000/svg",children:[c("style",{children:oe}),F("g",{clipPath:"url(#payload-logo-clip)",children:[c("path",{d:"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z"}),c("path",{d:"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z"}),c("path",{d:"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z"}),c("path",{d:"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z"}),c("path",{d:"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z"}),c("path",{d:"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z"}),c("path",{d:"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z"}),c("path",{d:"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z"}),c("path",{d:"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z"}),c("path",{d:"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z"})]}),c("defs",{children:c("clipPath",{id:"payload-logo-clip",children:c("rect",{fill:"white",height:"32",width:"142.257"})})})]});import{fieldIsHiddenOrDisabled as se,fieldIsID as ie,isFieldDisabled as le}from"payload/shared";var D=e=>{let t=r=>r.type!=="ui"&&se(r)&&!ie(r)||le(r,"column");return(e??[]).reduce((r,o)=>{if(t(o))return r;if(o.type==="tabs"&&"tabs"in o){let n={...o,tabs:o.tabs.map(s=>({...s,fields:D(s.fields)}))};return r.push(n),r}if("fields"in o&&Array.isArray(o.fields)){let n={...o,fields:D(o.fields)};return r.push(n),r}return r.push(o),r},[])};import{fieldAffectsData as k}from"payload/shared";var L=(e,t)=>e?.reduce((r,o)=>k(o)&&o.name===t?r:!k(o)&&"fields"in o?[...r,...L(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,s)=>[...n,..."name"in s?[s.name]:L(s.fields,t)],[])]:[...r,o.name],[]),ae=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=L(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};function ce(e){if(e)try{e.abort()}catch{}}function fe(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as O from"qs-esm";var ue={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,o)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=O.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,o)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,o)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,o)}};var pe=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);var de={},h={};function m(e,t){try{let o=(de[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return o in h?h[o]:U(o,o.split(":"))}catch{if(e in h)return h[e];let r=e?.match(me);return r?U(e,r.slice(1)):NaN}}var me=/([+-]\d\d):?(\d\d)?/;function U(e,t){let r=+t[0],o=+(t[1]||0);return h[e]=r>0?r*60+o:r*60-o}var d=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(m(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Z(this,NaN),b(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-m(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),b(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},N=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!N.test(e))return;let t=e.replace(N,"$1UTC");d.prototype[t]&&(e.startsWith("get")?d.prototype[e]=function(){return this.internal[t]()}:(d.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),he(this),+this},d.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),b(this),+this}))});function b(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function he(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Z(e)}function Z(e){let t=m(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),n=-new Date(+r).getTimezoneOffset(),s=o-n,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);let l=o-t;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);let a=m(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-a,f=a!==t,v=u-l;if(f&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);let z=m(e.timeZone,e),x=a-z;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}import{format as j,formatDistanceToNow as pt,transpose as ge}from"date-fns";var T=({date:e,i18n:t,pattern:r,timezone:o})=>{let n=new d(new Date(e));if(o){let s=d.tz(o),i=n.withTimeZone(o),l=ge(i,s);return t.dateFNS?j(l,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?j(n,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as Ce}from"@payloadcms/translations";function w(e){return typeof e=="object"&&"root"in e}function C(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=C(r.children,t));return t}var P=e=>Array.isArray(e)?e.map(t=>typeof t=="object"&&t!==null?t.id:String(t)).filter(Boolean).join(", "):typeof e=="object"&&e!==null?e.id||"":String(e);var ye=({collectionConfig:e,data:t,dateFormat:r,fallback:o,globalConfig:n,i18n:s})=>{let i;if(e){let l=e?.admin?.useAsTitle;if(l&&(i=t?.[l],i)){let a=e.fields.find(f=>"name"in f&&f.name===l),p=a?.type==="date",u=a?.type==="relationship";if(p){let f="date"in a.admin&&a?.admin?.date?.displayFormat||r;i=T({date:i,i18n:s,pattern:f})||i}u&&(i=P(t[l]))}}return n&&(i=Ce(n?.label,s)||n?.slug),i&&w(i)&&(i=C(i.root.children?.[0]?.children||[],"")),!i&&w(o)&&(i=C(o.root.children?.[0]?.children||[],"")),i||(i=typeof o=="string"?o:`[${s.t("general:untitled")}]`),i};async function xe(e){let{payload:{config:t},payload:r}=e,o=[];if(t.globals.length>0)if(r.collections?.["payload-locked-documents"]){let n=await r.find({collection:"payload-locked-documents",depth:1,overrideAccess:!1,pagination:!1,req:e,select:{globalSlug:!0,updatedAt:!0,user:!0},where:{globalSlug:{exists:!0}}});o=t.globals.map(s=>{let i=typeof s.lockDocuments=="object"?s.lockDocuments.duration:300,l=n.docs.find(a=>a.globalSlug===s.slug);return{slug:s.slug,data:{_isLocked:!!l,_lastEditedAt:l?.updatedAt??null,_userEditing:l?.user?.value??null},lockDuration:i}})}else o=t.globals.map(n=>{let s=typeof n.lockDocuments=="object"?n.lockDocuments.duration:300;return{slug:n.slug,data:{_isLocked:!1,_lastEditedAt:null,_userEditing:null},lockDuration:s}});return o}import{EntityType as E}from"payload";import{getTranslation as M}from"@payloadcms/translations";function A({adminGroup:e,entityPermissions:t}){return e===!1?!1:!!t?.read}function S(e,t,r){return e.reduce((n,s)=>{if(A({adminGroup:s.entity?.admin?.group,entityPermissions:t?.[s.type.toLowerCase()]?.[s.entity.slug]})){let i="labels"in s.entity?s.entity.labels.plural:s.entity.label,l=typeof i=="function"?i({i18n:r,t:r.t}):i;if(s.entity.admin.group){let a=M(s.entity.admin.group,r),p=n.find(f=>M(f.label,r)===a),u=p;p||(u={entities:[],label:a},n.push(u)),u.entities.push({slug:s.entity.slug,type:s.type,label:l})}else n.find(p=>M(p.label,r)===r.t(`general:${s.type}`)).entities.push({slug:s.entity.slug,type:s.type,label:l})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}function De(e,t,r,o){let n=r.collections.filter(l=>e?.collections?.[l.slug]?.read&&t.collections.includes(l.slug)),s=r.globals.filter(l=>e?.globals?.[l.slug]?.read&&t.globals.includes(l.slug));return S([...n.map(l=>({type:E.collection,entity:l}))??[],...s.map(l=>({type:E.global,entity:l}))??[]],e,o)}function R(e,t){if(typeof e=="function")try{return e({user:t})}catch{return!0}return!!e}function Le({req:e}){return{collections:e.payload.config.collections.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean),globals:e.payload.config.globals.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean)}}import{formatAdminURL as be}from"payload/shared";var Te=({adminRoute:e,router:t,serverURL:r})=>{let o=be({adminRoute:e,path:"",serverURL:r});t.push(o)};import{formatAdminURL as we}from"payload/shared";var Me=({adminRoute:e,collectionSlug:t,router:r,serverURL:o})=>{let n=we({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var Se=async({id:e,clearRouteCache:t,collectionSlug:r,documentLockStateRef:o,globalSlug:n,isLockingEnabled:s,isWithinDoc:i,setCurrentEditor:l,setIsReadOnlyForIncomingUser:a,updateDocumentEditor:p,user:u})=>{if(s)try{await p(e,r??n,u),i||(o.current.hasShownLockedModal=!0),o.current={hasShownLockedModal:o.current?.hasShownLockedModal,isLocked:!0,user:u},l(u),i&&a&&a(!1),t&&t()}catch(f){console.error("Error during document takeover:",f)}};var ve=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:o,isEditing:n}=e;return t?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var Ve=e=>e&&typeof e=="object";var He=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function Fe(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}var y=e=>{for(let t of e){if("localized"in t&&t.localized)return!0;switch(t.type){case"array":case"collapsible":case"group":case"row":if(t.fields&&y(t.fields))return!0;break;case"blocks":if(t.blocks){for(let r of t.blocks)if(r.fields&&y(r.fields))return!0}break;case"tabs":if(t.tabs){for(let r of t.tabs)if("localized"in r&&r.localized||"fields"in r&&r.fields&&y(r.fields))return!0}break}}return!1};export{re as PayloadIcon,ne as PayloadLogo,I as Translation,q as WithServerSideProps,ce as abortAndIgnore,D as filterFields,pe as findLocaleFromCode,T as formatDate,ye as formatDocTitle,xe as getGlobalData,ae as getInitialColumns,De as getNavGroups,Le as getVisibleEntities,S as groupNavItems,fe as handleAbortRef,Te as handleBackToDashboard,Me as handleGoBack,Se as handleTakeOver,ve as hasSavePermission,Ve as isClientUserObject,He as isEditing,Q as mergeFieldStyles,ee as reduceToSerializableFields,ue as requests,Fe as sanitizeID,y as traverseForLocalizedFields,W as withMergedProps};
|
|
5
|
+
`,ne=()=>F("svg",{className:"graphic-logo",fill:"none",height:"32",viewBox:"0 0 143 32",width:"143",xmlns:"http://www.w3.org/2000/svg",children:[c("style",{children:oe}),F("g",{clipPath:"url(#payload-logo-clip)",children:[c("path",{d:"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z"}),c("path",{d:"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z"}),c("path",{d:"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z"}),c("path",{d:"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z"}),c("path",{d:"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z"}),c("path",{d:"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z"}),c("path",{d:"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z"}),c("path",{d:"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z"}),c("path",{d:"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z"}),c("path",{d:"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z"})]}),c("defs",{children:c("clipPath",{id:"payload-logo-clip",children:c("rect",{fill:"white",height:"32",width:"142.257"})})})]});import{fieldIsHiddenOrDisabled as se,fieldIsID as ie,isFieldDisabled as le}from"payload/shared";var D=e=>{let t=r=>r.type!=="ui"&&se(r)&&!ie(r)||le(r,"column");return(e??[]).reduce((r,o)=>{if(t(o))return r;if(o.type==="tabs"&&"tabs"in o){let n={...o,tabs:o.tabs.map(s=>({...s,fields:D(s.fields)}))};return r.push(n),r}if("fields"in o&&Array.isArray(o.fields)){let n={...o,fields:D(o.fields)};return r.push(n),r}return r.push(o),r},[])};import{fieldAffectsData as k}from"payload/shared";var L=(e,t)=>e?.reduce((r,o)=>k(o)&&o.name===t?r:!k(o)&&"fields"in o?[...r,...L(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,s)=>[...n,..."name"in s?[s.name]:L(s.fields,t)],[])]:[...r,o.name],[]),ae=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=L(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};function ce(e){if(e)try{e.abort()}catch{}}function fe(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as O from"qs-esm";var ue={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,o)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=O.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,o)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,o)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,o)}};var pe=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);var de={},h={};function m(e,t){try{let o=(de[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return o in h?h[o]:U(o,o.split(":"))}catch{if(e in h)return h[e];let r=e?.match(me);return r?U(e,r.slice(1)):NaN}}var me=/([+-]\d\d):?(\d\d)?/;function U(e,t){let r=+t[0],o=+(t[1]||0);return h[e]=r>0?r*60+o:r*60-o}var d=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(m(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Z(this,NaN),b(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-m(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),b(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},N=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!N.test(e))return;let t=e.replace(N,"$1UTC");d.prototype[t]&&(e.startsWith("get")?d.prototype[e]=function(){return this.internal[t]()}:(d.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),he(this),+this},d.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),b(this),+this}))});function b(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function he(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Z(e)}function Z(e){let t=m(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),n=-new Date(+r).getTimezoneOffset(),s=o-n,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);let l=o-t;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);let a=m(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-a,f=a!==t,v=u-l;if(f&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);let z=m(e.timeZone,e),x=a-z;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}import{format as j,formatDistanceToNow as pt,transpose as ge}from"date-fns";var T=({date:e,i18n:t,pattern:r,timezone:o})=>{let n=new d(new Date(e));if(o){let s=d.tz(o),i=n.withTimeZone(o),l=ge(i,s);return t.dateFNS?j(l,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?j(n,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as Ce}from"@payloadcms/translations";function w(e){return typeof e=="object"&&"root"in e}function C(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=C(r.children,t));return t}var P=e=>Array.isArray(e)?e.map(t=>typeof t=="object"&&t!==null?t.id:String(t)).filter(Boolean).join(", "):typeof e=="object"&&e!==null?e.id||"":String(e);var ye=({collectionConfig:e,data:t,dateFormat:r,fallback:o,globalConfig:n,i18n:s})=>{let i;if(e){let l=e?.admin?.useAsTitle;if(l&&(i=t?.[l],i)){let a=e.fields.find(f=>"name"in f&&f.name===l),p=a?.type==="date",u=a?.type==="relationship";if(p){let f="date"in a.admin&&a?.admin?.date?.displayFormat||r;i=T({date:i,i18n:s,pattern:f})||i}u&&(i=P(t[l]))}}return n&&(i=Ce(n?.label,s)||n?.slug),i&&w(i)&&(i=C(i.root.children?.[0]?.children||[],"")),!i&&w(o)&&(i=C(o.root.children?.[0]?.children||[],"")),i||(i=typeof o=="string"?o:`[${s.t("general:untitled")}]`),i};async function xe(e){let{payload:{config:t},payload:r}=e,o=[];if(t.globals.length>0)if(r.collections?.["payload-locked-documents"]){let n=await r.find({collection:"payload-locked-documents",depth:1,overrideAccess:!1,pagination:!1,req:e,select:{globalSlug:!0,updatedAt:!0,user:!0},where:{globalSlug:{exists:!0}}});o=t.globals.map(s=>{let i=typeof s.lockDocuments=="object"?s.lockDocuments.duration:300,l=n.docs.find(a=>a.globalSlug===s.slug);return{slug:s.slug,data:{_isLocked:!!l,_lastEditedAt:l?.updatedAt??null,_userEditing:l?.user?.value??null},lockDuration:i}})}else o=t.globals.map(n=>{let s=typeof n.lockDocuments=="object"?n.lockDocuments.duration:300;return{slug:n.slug,data:{_isLocked:!1,_lastEditedAt:null,_userEditing:null},lockDuration:s}});return o}import{EntityType as E}from"payload";import{getTranslation as M}from"@payloadcms/translations";function A({adminGroup:e,entityPermissions:t}){return e===!1?!1:!!t?.read}function S(e,t,r){return e.reduce((n,s)=>{if(A({adminGroup:s.entity?.admin?.group,entityPermissions:t?.[s.type.toLowerCase()]?.[s.entity.slug]})){let i="labels"in s.entity?s.entity.labels.plural:s.entity.label,l=typeof i=="function"?i({i18n:r,t:r.t}):i;if(s.entity.admin.group){let a=M(s.entity.admin.group,r),p=n.find(f=>M(f.label,r)===a),u=p;p||(u={entities:[],label:a},n.push(u)),u.entities.push({slug:s.entity.slug,type:s.type,label:l})}else n.find(p=>M(p.label,r)===r.t(`general:${s.type}`)).entities.push({slug:s.entity.slug,type:s.type,label:l})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}function De(e,t,r,o){let n=r.collections.filter(l=>e?.collections?.[l.slug]?.read&&t.collections.includes(l.slug)),s=r.globals.filter(l=>e?.globals?.[l.slug]?.read&&t.globals.includes(l.slug));return S([...n.map(l=>({type:E.collection,entity:l}))??[],...s.map(l=>({type:E.global,entity:l}))??[]],e,o)}function R(e,t){if(typeof e=="function")try{return e({user:t})}catch{return!0}return!!e}function Le({req:e}){return{collections:e.payload.config.collections.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean),globals:e.payload.config.globals.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean)}}import{formatAdminURL as be}from"payload/shared";var Te=({adminRoute:e,router:t,serverURL:r})=>{let o=be({adminRoute:e,path:"",serverURL:r});t.push(o)};import{formatAdminURL as we}from"payload/shared";var Me=({adminRoute:e,collectionSlug:t,router:r,serverURL:o})=>{let n=we({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var Se=async({id:e,clearRouteCache:t,collectionSlug:r,documentLockStateRef:o,globalSlug:n,isLockingEnabled:s,isWithinDoc:i,setCurrentEditor:l,setIsReadOnlyForIncomingUser:a,updateDocumentEditor:p,user:u})=>{if(s)try{await p(e,r??n,u),i||(o.current.hasShownLockedModal=!0),o.current={hasShownLockedModal:o.current?.hasShownLockedModal,isLocked:!0,user:u},l(u),i&&a&&a(!1),t&&t()}catch(f){console.error("Error during document takeover:",f)}};var ve=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:o,isEditing:n}=e;return t?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var Ve=e=>e&&typeof e=="object";var He=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function Fe(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}var y=e=>{for(let t of e){if("localized"in t&&t.localized)return!0;switch(t.type){case"array":case"collapsible":case"group":case"row":if(t.fields&&y(t.fields))return!0;break;case"blocks":if(t.blocks){for(let r of t.blocks)if(typeof r!="string"&&r.fields&&y(r.fields))return!0}break;case"tabs":if(t.tabs){for(let r of t.tabs)if("localized"in r&&r.localized||"fields"in r&&r.fields&&y(r.fields))return!0}break}}return!1};export{re as PayloadIcon,ne as PayloadLogo,I as Translation,q as WithServerSideProps,ce as abortAndIgnore,D as filterFields,pe as findLocaleFromCode,T as formatDate,ye as formatDocTitle,xe as getGlobalData,ae as getInitialColumns,De as getNavGroups,Le as getVisibleEntities,S as groupNavItems,fe as handleAbortRef,Te as handleBackToDashboard,Me as handleGoBack,Se as handleTakeOver,ve as hasSavePermission,Ve as isClientUserObject,He as isEditing,Q as mergeFieldStyles,ee as reduceToSerializableFields,ue as requests,Fe as sanitizeID,y as traverseForLocalizedFields,W as withMergedProps};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/Translation/index.tsx", "../../../src/elements/withMergedProps/index.tsx", "../../../src/elements/WithServerSideProps/index.tsx", "../../../src/fields/mergeFieldStyles.ts", "../../../src/forms/Form/reduceToSerializableFields.ts", "../../../src/graphics/Icon/index.tsx", "../../../src/graphics/Logo/index.tsx", "../../../src/providers/TableColumns/buildColumnState/filterFields.tsx", "../../../src/providers/TableColumns/getInitialColumns.ts", "../../../src/utilities/abortAndIgnore.ts", "../../../src/utilities/api.ts", "../../../src/utilities/findLocaleFromCode.ts", "../../../../../node_modules/.pnpm/@date-fns+tz@1.2.0/node_modules/@date-fns/tz/tzOffset/index.js", "../../../../../node_modules/.pnpm/@date-fns+tz@1.2.0/node_modules/@date-fns/tz/date/mini.js", "../../../src/utilities/formatDocTitle/formatDateTitle.ts", "../../../src/utilities/formatDocTitle/index.ts", "../../../src/utilities/formatDocTitle/formatLexicalDocTitle.ts", "../../../src/utilities/formatDocTitle/formatRelationshipTitle.ts", "../../../src/utilities/getGlobalData.ts", "../../../src/utilities/getNavGroups.ts", "../../../src/utilities/groupNavItems.ts", "../../../src/utilities/isNavEntityVisible.ts", "../../../src/utilities/getVisibleEntities.ts", "../../../src/utilities/handleBackToDashboard.tsx", "../../../src/utilities/handleGoBack.tsx", "../../../src/utilities/handleTakeOver.tsx", "../../../src/utilities/hasSavePermission.ts", "../../../src/utilities/isClientUserObject.ts", "../../../src/utilities/isEditing.ts", "../../../src/utilities/sanitizeID.ts", "../../../src/utilities/traverseForLocalizedFields.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'\n\nimport * as React from 'react'\n\nconst RecursiveTranslation: React.FC<{\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n translationString: string\n}> = ({ elements, translationString }) => {\n const regex = /(<[^>]+>.*?<\\/[^>]+>)/g\n const sections = translationString.split(regex)\n\n return (\n <span>\n {sections.map((section, index) => {\n if (elements && section.startsWith('<') && section.endsWith('>')) {\n const elementKey = section[1]\n const Element = elements[elementKey]\n\n if (Element) {\n const regex = new RegExp(`<${elementKey}>(.*?)<\\/${elementKey}>`, 'g')\n const children = section.replace(regex, (_, group) => group)\n\n return (\n <Element key={index}>\n <RecursiveTranslation translationString={children} />\n </Element>\n )\n }\n }\n\n return section\n })}\n </span>\n )\n}\n\nexport type TranslationProps = {\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n i18nKey: ClientTranslationKeys\n t: TFunction\n variables?: Record<string, unknown>\n}\n\nexport const Translation: React.FC<TranslationProps> = ({ elements, i18nKey, t, variables }) => {\n const stringWithVariables = t(i18nKey, variables || {})\n\n if (!elements) {\n return stringWithVariables\n }\n\n return <RecursiveTranslation elements={elements} translationString={stringWithVariables} />\n}\n", "import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = withMergedProps({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n", "import type { WithServerSidePropsComponent } from 'payload'\n\nimport { isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nexport const WithServerSideProps: WithServerSidePropsComponent = ({\n Component,\n serverOnlyProps,\n ...rest\n}) => {\n if (Component) {\n const WithServerSideProps: React.FC = (passedProps) => {\n const propsWithServerOnlyProps = {\n ...passedProps,\n ...(isReactServerComponentOrFunction(Component) ? (serverOnlyProps ?? {}) : {}),\n }\n\n return <Component {...propsWithServerOnlyProps} />\n }\n\n return WithServerSideProps(rest)\n }\n\n return null\n}\n", "import type { ClientField } from 'payload'\n\nexport const mergeFieldStyles = (\n field: ClientField | Omit<ClientField, 'type'>,\n): React.CSSProperties => ({\n ...(field?.admin?.style || {}),\n ...(field?.admin?.width\n ? {\n '--field-width': field.admin.width,\n }\n : {\n flex: '1 1 0%',\n }),\n // allow flex overrides to still take precedence over the fallback\n ...(field?.admin?.style?.flex\n ? {\n flex: field.admin.style.flex,\n }\n : {}),\n})\n", "import { type FormField, type FormState } from 'payload'\n\ntype BlacklistedKeys = 'customComponents' | 'validate'\nconst blacklistedKeys: BlacklistedKeys[] = ['validate', 'customComponents']\n\nconst sanitizeField = (incomingField: FormField): FormField => {\n const field = { ...incomingField } // shallow copy, as we only need to remove top-level keys\n\n for (const key of blacklistedKeys) {\n delete field[key]\n }\n\n return field\n}\n\n/**\n * Takes in FormState and removes fields that are not serializable.\n * Returns FormState without blacklisted keys.\n */\nexport const reduceToSerializableFields = (\n fields: FormState,\n): {\n [key: string]: Omit<FormField, BlacklistedKeys>\n} => {\n const result: Record<string, Omit<FormField, BlacklistedKeys>> = {}\n\n for (const key in fields) {\n result[key] = sanitizeField(fields[key])\n }\n\n return result\n}\n", "import React from 'react'\n\nexport const PayloadIcon: React.FC<{\n fill?: string\n}> = ({ fill: fillFromProps }) => {\n const fill = fillFromProps || 'var(--theme-elevation-1000)'\n\n return (\n <svg\n className=\"graphic-icon\"\n height=\"100%\"\n viewBox=\"0 0 25 25\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z\"\n fill={fill}\n />\n <path\n d=\"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z\"\n fill={fill}\n />\n </svg>\n )\n}\n", "import React from 'react'\n\nconst css = `\n .graphic-logo path {\n fill: var(--color-text);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"32\"\n viewBox=\"0 0 143 32\"\n width=\"143\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g clipPath=\"url(#payload-logo-clip)\">\n <path d=\"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z\" />\n <path d=\"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z\" />\n <path d=\"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z\" />\n <path d=\"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z\" />\n <path d=\"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z\" />\n <path d=\"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z\" />\n <path d=\"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z\" />\n <path d=\"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z\" />\n <path d=\"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z\" />\n <path d=\"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z\" />\n </g>\n <defs>\n <clipPath id=\"payload-logo-clip\">\n <rect fill=\"white\" height=\"32\" width=\"142.257\" />\n </clipPath>\n </defs>\n </svg>\n)\n", "import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID, isFieldDisabled } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disabled.column` set to `true`.\n * Recurses through `tabs` and any container with `.fields` (e.g., `row`, `group`, `collapsible`).\n */\nexport const filterFields = <T extends ClientField | Field>(incomingFields: T[]): T[] => {\n const shouldSkipField = (field: T): boolean =>\n (field.type !== 'ui' && fieldIsHiddenOrDisabled(field) && !fieldIsID(field)) ||\n isFieldDisabled(field, 'column')\n\n return (incomingFields ?? []).reduce<T[]>((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // handle tabs\n if (field.type === 'tabs' && 'tabs' in field) {\n const formattedField: T = {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: filterFields(tab.fields as T[]),\n })),\n }\n acc.push(formattedField)\n return acc\n }\n\n // handle fields with subfields (row, group, collapsible, etc.)\n if ('fields' in field && Array.isArray(field.fields)) {\n const formattedField: T = {\n ...field,\n fields: filterFields(field.fields as T[]),\n }\n acc.push(formattedField)\n return acc\n }\n\n // leaf\n acc.push(field)\n return acc\n }, [])\n}\n", "import type { ClientField, CollectionConfig, CollectionPreferences, Field } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): CollectionPreferences['columns'] =>\n fields?.reduce((remaining, field) => {\n if (fieldAffectsData(field) && field.name === useAsTitle) {\n return remaining\n }\n\n if (!fieldAffectsData(field) && 'fields' in field) {\n return [...remaining, ...getRemainingColumns(field.fields, useAsTitle)]\n }\n\n if (field.type === 'tabs' && 'tabs' in field) {\n return [\n ...remaining,\n ...field.tabs.reduce(\n (tabFieldColumns, tab) => [\n ...tabFieldColumns,\n ...('name' in tab ? [tab.name] : getRemainingColumns(tab.fields, useAsTitle)),\n ],\n [],\n ),\n ]\n }\n\n return [...remaining, field.name]\n }, [])\n\n/**\n * Returns the initial columns to display in the table based on the following criteria:\n * 1. If `defaultColumns` is set in the collection config, use those columns\n * 2. Otherwise take `useAtTitle, if set, and the next 3 fields that are not hidden or disabled\n */\nexport const getInitialColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: CollectionConfig['admin']['useAsTitle'],\n defaultColumns: CollectionConfig['admin']['defaultColumns'],\n): CollectionPreferences['columns'] => {\n let initialColumns = []\n\n if (Array.isArray(defaultColumns) && defaultColumns.length >= 1) {\n initialColumns = defaultColumns\n } else {\n if (useAsTitle) {\n initialColumns.push(useAsTitle)\n }\n\n const remainingColumns = getRemainingColumns(fields, useAsTitle)\n\n initialColumns = initialColumns.concat(remainingColumns)\n initialColumns = initialColumns.slice(0, 4)\n }\n\n return initialColumns.map((column) => ({\n accessor: column,\n active: true,\n }))\n}\n", "export function abortAndIgnore(abortController: AbortController) {\n if (abortController) {\n try {\n abortController.abort()\n } catch (_err) {\n // swallow error\n }\n }\n}\n\n/**\n * Use this function when an effect is triggered multiple times over and you want to cancel the previous effect.\n * It will abort the previous effect and create a new AbortController for the next effect.\n * Important: You must also _reset_ the `abortControllerRef` after the effect is done, otherwise the next effect will be aborted immediately.\n * For example, run `abortControllerRef.current = null` in a `finally` block or after an awaited promise.\n * @param abortControllerRef\n * @returns {AbortController}\n */\nexport function handleAbortRef(\n abortControllerRef: React.RefObject<AbortController>,\n): AbortController {\n const newController = new AbortController()\n\n if (abortControllerRef.current) {\n try {\n abortControllerRef.current.abort()\n } catch (_err) {\n // swallow error\n }\n }\n\n abortControllerRef.current = newController\n\n return newController\n}\n", "import * as qs from 'qs-esm'\n\ntype GetOptions = {\n params?: Record<string, unknown>\n} & RequestInit\n\nexport const requests = {\n delete: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'delete',\n }\n\n return fetch(url, formattedOptions)\n },\n\n get: (url: string, options: GetOptions = { headers: {} }): Promise<Response> => {\n let query = ''\n if (options.params) {\n query = qs.stringify(options.params, { addQueryPrefix: true })\n }\n return fetch(`${url}${query}`, {\n credentials: 'include',\n ...options,\n })\n },\n\n patch: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'PATCH',\n }\n\n return fetch(url, formattedOptions)\n },\n\n post: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'post',\n }\n\n return fetch(`${url}`, formattedOptions)\n },\n\n put: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'put',\n }\n\n return fetch(url, formattedOptions)\n },\n}\n", "import type { Locale, SanitizedLocalizationConfig } from 'payload'\n/*\n return the Locale for given locale code, else return null\n*/\nexport const findLocaleFromCode = (\n localizationConfig: SanitizedLocalizationConfig,\n locale: string,\n): Locale | null => {\n if (!localizationConfig?.locales || localizationConfig.locales.length === 0) {\n return null\n }\n\n return localizationConfig.locales.find((el) => el?.code === locale)\n}\n", "const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n try {\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n timeZone,\n hour: \"numeric\",\n timeZoneName: \"longOffset\"\n }).format;\n const offsetStr = format(date).split('GMT')[1] || '';\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support \u00B1HH:MM/\u00B1HHMM/\u00B1HH\n // See: https://github.com/nodejs/node/issues/53419\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +values[0];\n const minutes = +(values[1] || 0);\n return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}", "import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}", "import type { I18n, I18nClient } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\nexport type FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = typeof date === 'string' ? new Date(date) : date\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n", "import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from './formatDateTitle.js'\nimport { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js'\nimport { formatRelationshipTitle } from './formatRelationshipTitle.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: object | string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] as string\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n const isRelationship = fieldConfig?.type === 'relationship'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n\n if (isRelationship) {\n const formattedRelationshipTitle = formatRelationshipTitle(data[useAsTitle])\n title = formattedRelationshipTitle\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n // richtext lexical case. We convert the first child of root to plain text\n if (title && isSerializedLexicalEditor(title)) {\n title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '')\n }\n\n if (!title && isSerializedLexicalEditor(fallback)) {\n title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '')\n }\n\n if (!title) {\n title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "type SerializedLexicalEditor = {\n root: {\n children: Array<{ children?: Array<{ type: string }>; type: string }>\n }\n}\n\nexport function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor {\n return typeof value === 'object' && 'root' in value\n}\n\nexport function formatLexicalDocTitle(\n editorState: Array<{ children?: Array<{ type: string }>; type: string }>,\n textContent: string,\n): string {\n for (const node of editorState) {\n if ('text' in node && node.text) {\n textContent += node.text as string\n } else {\n if (!('children' in node)) {\n textContent += `[${node.type}]`\n }\n }\n if ('children' in node && node.children) {\n textContent += formatLexicalDocTitle(node.children as Array<{ type: string }>, textContent)\n }\n }\n return textContent\n}\n", "export const formatRelationshipTitle = (data): string => {\n if (Array.isArray(data)) {\n return data\n .map((item) => {\n if (typeof item === 'object' && item !== null) {\n return item.id\n }\n return String(item)\n })\n .filter(Boolean)\n .join(', ')\n }\n\n if (typeof data === 'object' && data !== null) {\n return data.id || ''\n }\n\n return String(data)\n}\n", "import type { ClientUser, PayloadRequest, TypedUser } from 'payload'\n\nconst globalLockDurationDefault = 300\n\nexport async function getGlobalData(req: PayloadRequest) {\n const {\n payload: { config },\n payload,\n } = req\n // Query locked global documents only if there are globals in the config\n // This type is repeated from DashboardViewServerPropsOnly['globalData'].\n // I thought about moving it to a payload to share it, but we're already\n // exporting all the views props from the next package.\n let globalData: Array<{\n data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: ClientUser | number | string }\n lockDuration?: number\n slug: string\n }> = []\n\n if (config.globals.length > 0) {\n if (payload.collections?.['payload-locked-documents']) {\n const lockedDocuments = await payload.find({\n collection: 'payload-locked-documents',\n depth: 1,\n overrideAccess: false,\n pagination: false,\n req,\n select: {\n globalSlug: true,\n updatedAt: true,\n user: true,\n },\n where: {\n globalSlug: {\n exists: true,\n },\n },\n })\n\n // Map over globals to include `lockDuration` and lock data for each global slug\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n const lockedDoc = lockedDocuments.docs.find((doc) => doc.globalSlug === global.slug)\n\n return {\n slug: global.slug,\n data: {\n _isLocked: !!lockedDoc,\n _lastEditedAt: (lockedDoc?.updatedAt as string) ?? null,\n _userEditing: (lockedDoc?.user as { value?: TypedUser })?.value ?? null,\n },\n lockDuration,\n }\n })\n } else {\n // If locked-documents collection doesn't exist, return globals without lock data\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n return {\n slug: global.slug,\n data: {\n _isLocked: false,\n _lastEditedAt: null,\n _userEditing: null,\n },\n lockDuration,\n }\n })\n }\n }\n\n return globalData\n}\n", "import type { SanitizedConfig, SanitizedPermissions, VisibleEntities } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { EntityType } from 'payload'\n\nimport { type EntityToGroup, groupNavItems } from './groupNavItems.js'\n\n/** @internal */\nexport function getNavGroups(\n permissions: SanitizedPermissions,\n visibleEntities: VisibleEntities,\n config: SanitizedConfig,\n i18n: I18nClient,\n) {\n const collections = config.collections.filter(\n (collection) =>\n permissions?.collections?.[collection.slug]?.read &&\n visibleEntities.collections.includes(collection.slug),\n )\n\n const globals = config.globals.filter(\n (global) =>\n permissions?.globals?.[global.slug]?.read && visibleEntities.globals.includes(global.slug),\n )\n\n const navGroups = groupNavItems(\n [\n ...(collections.map((collection) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.collection,\n entity: collection,\n }\n\n return entityToGroup\n }) ?? []),\n ...(globals.map((global) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.global,\n entity: global,\n }\n\n return entityToGroup\n }) ?? []),\n ],\n permissions,\n i18n,\n )\n\n return navGroups\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n EntityType,\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { isNavEntityVisible } from './isNavEntityVisible.js'\n\nexport type EntityToGroup =\n | {\n entity: SanitizedCollectionConfig\n type: EntityType.collection\n }\n | {\n entity: SanitizedGlobalConfig\n type: EntityType.global\n }\n\nexport type NavGroupType = {\n entities: {\n label: StaticLabel\n slug: string\n type: EntityType\n }[]\n label: string\n}\n\nexport function groupNavItems(\n entities: EntityToGroup[],\n permissions: SanitizedPermissions,\n i18n: I18nClient,\n): NavGroupType[] {\n const result = entities.reduce(\n (groups, entityToGroup) => {\n if (\n isNavEntityVisible({\n adminGroup: entityToGroup.entity?.admin?.group,\n entityPermissions:\n permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug],\n })\n ) {\n const labelOrFunction =\n 'labels' in entityToGroup.entity\n ? entityToGroup.entity.labels.plural\n : entityToGroup.entity.label\n\n const label =\n typeof labelOrFunction === 'function'\n ? labelOrFunction({ i18n, t: i18n.t })\n : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\n\n const existingGroup = groups.find(\n (group) => getTranslation(group.label, i18n) === translatedGroup,\n ) as NavGroupType\n\n let matchedGroup: NavGroupType = existingGroup\n\n if (!existingGroup) {\n matchedGroup = { entities: [], label: translatedGroup }\n groups.push(matchedGroup)\n }\n\n matchedGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n } else {\n const defaultGroup = groups.find((group) => {\n return getTranslation(group.label, i18n) === i18n.t(`general:${entityToGroup.type}`)\n }) as NavGroupType\n defaultGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n }\n }\n\n return groups\n },\n [\n {\n entities: [],\n label: i18n.t('general:collections'),\n },\n {\n entities: [],\n label: i18n.t('general:globals'),\n },\n ],\n )\n\n return result.filter((group) => group.entities.length > 0)\n}\n", "import type { SanitizedDocumentPermissions } from 'payload'\n\ntype IsNavEntityVisibleArgs = {\n /** The entity's `admin.group`; an explicit `false` removes it from nav grouping. */\n adminGroup: false | Record<string, string> | string | undefined\n /** The current user's resolved permissions for this entity, if any. */\n entityPermissions: SanitizedDocumentPermissions | undefined\n}\n\n/**\n * Shared nav-visibility rule for collections and globals: an entity is shown when it\n * isn't explicitly removed from grouping (`admin.group: false`) and the user has read\n * permission. Entity-level `admin.hidden` is handled separately via `visibleEntities`.\n * Used by both the sidebar nav (`groupNavItems`) and the command palette so the two\n * surfaces stay in sync.\n */\nexport function isNavEntityVisible({\n adminGroup,\n entityPermissions,\n}: IsNavEntityVisibleArgs): boolean {\n if (adminGroup === false) {\n return false\n }\n\n return Boolean(entityPermissions?.read)\n}\n", "import type { PayloadRequest, VisibleEntities } from 'payload'\n\ntype Hidden = ((args: { user: unknown }) => boolean) | boolean\n\nfunction isHidden(hidden: Hidden | undefined, user: unknown): boolean {\n if (typeof hidden === 'function') {\n try {\n return hidden({ user })\n } catch {\n return true\n }\n }\n return !!hidden\n}\n\nexport function getVisibleEntities({ req }: { req: PayloadRequest }): VisibleEntities {\n return {\n collections: req.payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n globals: req.payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n }\n}\n", "import type { RouterAdapterRouter } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: RouterAdapterRouter\n serverURL?: string\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router, serverURL }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '',\n serverURL,\n })\n router.push(redirectRoute)\n}\n", "import type { RouterAdapterRouter } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: RouterAdapterRouter\n serverURL?: string\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router, serverURL }: GoBackProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: collectionSlug ? `/collections/${collectionSlug}` : '/',\n })\n router.push(redirectRoute)\n}\n", "import type { ClientUser } from 'payload'\n\nexport interface HandleTakeOverParams {\n clearRouteCache?: () => void\n collectionSlug?: string\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>\n globalSlug?: string\n id: number | string\n isLockingEnabled: boolean\n isWithinDoc: boolean\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>\n user: ClientUser | number | string\n}\n\nexport const handleTakeOver = async ({\n id,\n clearRouteCache,\n collectionSlug,\n documentLockStateRef,\n globalSlug,\n isLockingEnabled,\n isWithinDoc,\n setCurrentEditor,\n setIsReadOnlyForIncomingUser,\n updateDocumentEditor,\n user,\n}: HandleTakeOverParams): Promise<void> => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n await updateDocumentEditor(id, collectionSlug ?? globalSlug, user)\n\n if (!isWithinDoc) {\n documentLockStateRef.current.hasShownLockedModal = true\n }\n\n // Update the locked state to reflect the current user as the owner\n documentLockStateRef.current = {\n hasShownLockedModal: documentLockStateRef.current?.hasShownLockedModal,\n isLocked: true,\n user,\n }\n setCurrentEditor(user)\n\n // If this is a takeover within the document, ensure the document is editable\n if (isWithinDoc && setIsReadOnlyForIncomingUser) {\n setIsReadOnlyForIncomingUser(false)\n }\n\n // Need to clear the route cache to refresh the page and update readOnly state for server rendered components\n if (clearRouteCache) {\n clearRouteCache()\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error during document takeover:', error)\n }\n}\n", "import type {\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedGlobalPermission,\n} from 'payload'\n\nexport const hasSavePermission = (args: {\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n collectionSlug?: string\n docPermissions: SanitizedDocumentPermissions\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n globalSlug?: string\n isEditing: boolean\n}) => {\n const { collectionSlug, docPermissions, globalSlug, isEditing } = args\n\n if (collectionSlug) {\n return Boolean(\n (isEditing && docPermissions?.update) ||\n (!isEditing && (docPermissions as SanitizedCollectionPermission)?.create),\n )\n }\n\n if (globalSlug) {\n return Boolean((docPermissions as SanitizedGlobalPermission)?.update)\n }\n\n return false\n}\n", "import type { ClientUser } from 'payload'\n\nexport const isClientUserObject = (user): user is ClientUser => {\n return user && typeof user === 'object'\n}\n", "export const isEditing = ({\n id,\n collectionSlug,\n globalSlug,\n}: {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}): boolean => Boolean(globalSlug || (collectionSlug && !!id))\n", "export function sanitizeID(id: number | string): number | string {\n if (id === undefined) {\n return id\n }\n\n if (typeof id === 'number') {\n return id\n }\n\n return decodeURIComponent(id)\n}\n", "import type { ClientField, Field } from 'payload'\n\nexport const traverseForLocalizedFields = (fields: ClientField[] | Field[]): boolean => {\n for (const field of fields) {\n if ('localized' in field && field.localized) {\n return true\n }\n\n switch (field.type) {\n case 'array':\n case 'collapsible':\n case 'group':\n case 'row':\n if (field.fields && traverseForLocalizedFields(field.fields)) {\n return true\n }\n break\n\n case 'blocks':\n if (field.blocks) {\n for (const block of field.blocks) {\n if (block.fields && traverseForLocalizedFields(block.fields)) {\n return true\n }\n }\n }\n break\n\n case 'tabs':\n if (field.tabs) {\n for (const tab of field.tabs) {\n if ('localized' in tab && tab.localized) {\n return true\n }\n if ('fields' in tab && tab.fields && traverseForLocalizedFields(tab.fields)) {\n return true\n }\n }\n }\n break\n }\n }\n\n return false\n}\n"],
|
|
5
|
-
"mappings": "wCAEA,MAAuB,QAEvB,IAAMA,EAGDA,CAAC,CAAEC,SAAAA,EAAUC,kBAAAA,CAAiB,IAAE,CACnC,IAAMC,EAAQ,yBACRC,EAAWF,EAAkBG,MAAMF,CAAA,EAEzC,OACEG,EAAC,OAAA,UACEF,EAASG,IAAI,CAACC,EAASC,IAAA,CACtB,GAAIR,GAAYO,EAAQE,WAAW,GAAA,GAAQF,EAAQG,SAAS,GAAA,EAAM,CAChE,IAAMC,EAAaJ,EAAQ,CAAA,EACrBK,EAAUZ,EAASW,CAAA,EAEzB,GAAIC,EAAS,CACX,IAAMV,EAAQ,IAAIW,OAAO,IAAIF,CAAA,WAAsBA,CAAA,IAAe,GAAA,EAC5DG,EAAWP,EAAQQ,QAAQb,EAAO,CAACc,EAAGC,IAAUA,CAAA,EAEtD,OACEZ,EAACO,EAAA,UACCP,EAACN,EAAA,CAAqBE,kBAAmBa,KAD7BN,CAAA,CAIlB,CACF,CAEA,OAAOD,CACT,CAAA,GAGN,EASaW,EAA0CA,CAAC,CAAElB,SAAAA,EAAUmB,QAAAA,EAASC,EAAAA,EAAGC,UAAAA,CAAS,IAAE,CACzF,IAAMC,EAAsBF,EAAED,EAASE,GAAa,CAAC,CAAA,EAErD,OAAKrB,EAIEK,EAACN,EAAA,CAAqBC,SAAUA,EAAUC,kBAAmBqB,IAH3DA,CAIX,0CCnDA,OAASC,oCAAAA,EAA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IP,OAAOD,GAAO,SACTA,EAGFE,mBAAmBF,CAAA,CAC5B,CCRO,IAAMG,EAA8BC,GAAA,CACzC,QAAWC,KAASD,EAAQ,CAC1B,GAAI,cAAeC,GAASA,EAAMC,UAChC,MAAO,GAGT,OAAQD,EAAME,KAAI,CAChB,IAAK,QACL,IAAK,cACL,IAAK,QACL,IAAK,MACH,GAAIF,EAAMD,QAAUD,EAA2BE,EAAMD,MAAM,EACzD,MAAO,GAET,MAEF,IAAK,SACH,GAAIC,EAAMG,QACR,QAAWC,KAASJ,EAAMG,OACxB,GAAIC,EAAML,QAAUD,EAA2BM,EAAML,MAAM,EACzD,MAAO,GAIb,MAEF,IAAK,OACH,GAAIC,EAAMK,MACR,QAAWC,KAAON,EAAMK,KAItB,GAHI,cAAeC,GAAOA,EAAIL,WAG1B,WAAYK,GAAOA,EAAIP,QAAUD,EAA2BQ,EAAIP,MAAM,EACxE,MAAO,GAIb,KACJ,CACF,CAEA,MAAO,EACT",
|
|
4
|
+
"sourcesContent": ["import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'\n\nimport * as React from 'react'\n\nconst RecursiveTranslation: React.FC<{\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n translationString: string\n}> = ({ elements, translationString }) => {\n const regex = /(<[^>]+>.*?<\\/[^>]+>)/g\n const sections = translationString.split(regex)\n\n return (\n <span>\n {sections.map((section, index) => {\n if (elements && section.startsWith('<') && section.endsWith('>')) {\n const elementKey = section[1]\n const Element = elements[elementKey]\n\n if (Element) {\n const regex = new RegExp(`<${elementKey}>(.*?)<\\/${elementKey}>`, 'g')\n const children = section.replace(regex, (_, group) => group)\n\n return (\n <Element key={index}>\n <RecursiveTranslation translationString={children} />\n </Element>\n )\n }\n }\n\n return section\n })}\n </span>\n )\n}\n\nexport type TranslationProps = {\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n i18nKey: ClientTranslationKeys\n t: TFunction\n variables?: Record<string, unknown>\n}\n\nexport const Translation: React.FC<TranslationProps> = ({ elements, i18nKey, t, variables }) => {\n const stringWithVariables = t(i18nKey, variables || {})\n\n if (!elements) {\n return stringWithVariables\n }\n\n return <RecursiveTranslation elements={elements} translationString={stringWithVariables} />\n}\n", "import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = withMergedProps({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n", "import type { WithServerSidePropsComponent } from 'payload'\n\nimport { isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nexport const WithServerSideProps: WithServerSidePropsComponent = ({\n Component,\n serverOnlyProps,\n ...rest\n}) => {\n if (Component) {\n const WithServerSideProps: React.FC = (passedProps) => {\n const propsWithServerOnlyProps = {\n ...passedProps,\n ...(isReactServerComponentOrFunction(Component) ? (serverOnlyProps ?? {}) : {}),\n }\n\n return <Component {...propsWithServerOnlyProps} />\n }\n\n return WithServerSideProps(rest)\n }\n\n return null\n}\n", "import type { ClientField } from 'payload'\n\nexport const mergeFieldStyles = (\n field: ClientField | Omit<ClientField, 'type'>,\n): React.CSSProperties => ({\n ...(field?.admin?.style || {}),\n ...(field?.admin?.width\n ? {\n '--field-width': field.admin.width,\n }\n : {\n flex: '1 1 0%',\n }),\n // allow flex overrides to still take precedence over the fallback\n ...(field?.admin?.style?.flex\n ? {\n flex: field.admin.style.flex,\n }\n : {}),\n})\n", "import { type FormField, type FormState } from 'payload'\n\ntype BlacklistedKeys = 'customComponents' | 'validate'\nconst blacklistedKeys: BlacklistedKeys[] = ['validate', 'customComponents']\n\nconst sanitizeField = (incomingField: FormField): FormField => {\n const field = { ...incomingField } // shallow copy, as we only need to remove top-level keys\n\n for (const key of blacklistedKeys) {\n delete field[key]\n }\n\n return field\n}\n\n/**\n * Takes in FormState and removes fields that are not serializable.\n * Returns FormState without blacklisted keys.\n */\nexport const reduceToSerializableFields = (\n fields: FormState,\n): {\n [key: string]: Omit<FormField, BlacklistedKeys>\n} => {\n const result: Record<string, Omit<FormField, BlacklistedKeys>> = {}\n\n for (const key in fields) {\n result[key] = sanitizeField(fields[key])\n }\n\n return result\n}\n", "import React from 'react'\n\nexport const PayloadIcon: React.FC<{\n fill?: string\n}> = ({ fill: fillFromProps }) => {\n const fill = fillFromProps || 'var(--theme-elevation-1000)'\n\n return (\n <svg\n className=\"graphic-icon\"\n height=\"100%\"\n viewBox=\"0 0 25 25\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z\"\n fill={fill}\n />\n <path\n d=\"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z\"\n fill={fill}\n />\n </svg>\n )\n}\n", "import React from 'react'\n\nconst css = `\n .graphic-logo path {\n fill: var(--color-text);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"32\"\n viewBox=\"0 0 143 32\"\n width=\"143\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g clipPath=\"url(#payload-logo-clip)\">\n <path d=\"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z\" />\n <path d=\"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z\" />\n <path d=\"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z\" />\n <path d=\"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z\" />\n <path d=\"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z\" />\n <path d=\"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z\" />\n <path d=\"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z\" />\n <path d=\"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z\" />\n <path d=\"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z\" />\n <path d=\"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z\" />\n </g>\n <defs>\n <clipPath id=\"payload-logo-clip\">\n <rect fill=\"white\" height=\"32\" width=\"142.257\" />\n </clipPath>\n </defs>\n </svg>\n)\n", "import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID, isFieldDisabled } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disabled.column` set to `true`.\n * Recurses through `tabs` and any container with `.fields` (e.g., `row`, `group`, `collapsible`).\n */\nexport const filterFields = <T extends ClientField | Field>(incomingFields: T[]): T[] => {\n const shouldSkipField = (field: T): boolean =>\n (field.type !== 'ui' && fieldIsHiddenOrDisabled(field) && !fieldIsID(field)) ||\n isFieldDisabled(field, 'column')\n\n return (incomingFields ?? []).reduce<T[]>((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // handle tabs\n if (field.type === 'tabs' && 'tabs' in field) {\n const formattedField: T = {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: filterFields(tab.fields as T[]),\n })),\n }\n acc.push(formattedField)\n return acc\n }\n\n // handle fields with subfields (row, group, collapsible, etc.)\n if ('fields' in field && Array.isArray(field.fields)) {\n const formattedField: T = {\n ...field,\n fields: filterFields(field.fields as T[]),\n }\n acc.push(formattedField)\n return acc\n }\n\n // leaf\n acc.push(field)\n return acc\n }, [])\n}\n", "import type { ClientField, CollectionConfig, CollectionPreferences, Field } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): CollectionPreferences['columns'] =>\n fields?.reduce((remaining, field) => {\n if (fieldAffectsData(field) && field.name === useAsTitle) {\n return remaining\n }\n\n if (!fieldAffectsData(field) && 'fields' in field) {\n return [...remaining, ...getRemainingColumns(field.fields, useAsTitle)]\n }\n\n if (field.type === 'tabs' && 'tabs' in field) {\n return [\n ...remaining,\n ...field.tabs.reduce(\n (tabFieldColumns, tab) => [\n ...tabFieldColumns,\n ...('name' in tab ? [tab.name] : getRemainingColumns(tab.fields, useAsTitle)),\n ],\n [],\n ),\n ]\n }\n\n return [...remaining, field.name]\n }, [])\n\n/**\n * Returns the initial columns to display in the table based on the following criteria:\n * 1. If `defaultColumns` is set in the collection config, use those columns\n * 2. Otherwise take `useAtTitle, if set, and the next 3 fields that are not hidden or disabled\n */\nexport const getInitialColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: CollectionConfig['admin']['useAsTitle'],\n defaultColumns: CollectionConfig['admin']['defaultColumns'],\n): CollectionPreferences['columns'] => {\n let initialColumns = []\n\n if (Array.isArray(defaultColumns) && defaultColumns.length >= 1) {\n initialColumns = defaultColumns\n } else {\n if (useAsTitle) {\n initialColumns.push(useAsTitle)\n }\n\n const remainingColumns = getRemainingColumns(fields, useAsTitle)\n\n initialColumns = initialColumns.concat(remainingColumns)\n initialColumns = initialColumns.slice(0, 4)\n }\n\n return initialColumns.map((column) => ({\n accessor: column,\n active: true,\n }))\n}\n", "export function abortAndIgnore(abortController: AbortController) {\n if (abortController) {\n try {\n abortController.abort()\n } catch (_err) {\n // swallow error\n }\n }\n}\n\n/**\n * Use this function when an effect is triggered multiple times over and you want to cancel the previous effect.\n * It will abort the previous effect and create a new AbortController for the next effect.\n * Important: You must also _reset_ the `abortControllerRef` after the effect is done, otherwise the next effect will be aborted immediately.\n * For example, run `abortControllerRef.current = null` in a `finally` block or after an awaited promise.\n * @param abortControllerRef\n * @returns {AbortController}\n */\nexport function handleAbortRef(\n abortControllerRef: React.RefObject<AbortController>,\n): AbortController {\n const newController = new AbortController()\n\n if (abortControllerRef.current) {\n try {\n abortControllerRef.current.abort()\n } catch (_err) {\n // swallow error\n }\n }\n\n abortControllerRef.current = newController\n\n return newController\n}\n", "import * as qs from 'qs-esm'\n\ntype GetOptions = {\n params?: Record<string, unknown>\n} & RequestInit\n\nexport const requests = {\n delete: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'delete',\n }\n\n return fetch(url, formattedOptions)\n },\n\n get: (url: string, options: GetOptions = { headers: {} }): Promise<Response> => {\n let query = ''\n if (options.params) {\n query = qs.stringify(options.params, { addQueryPrefix: true })\n }\n return fetch(`${url}${query}`, {\n credentials: 'include',\n ...options,\n })\n },\n\n patch: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'PATCH',\n }\n\n return fetch(url, formattedOptions)\n },\n\n post: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'post',\n }\n\n return fetch(`${url}`, formattedOptions)\n },\n\n put: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'put',\n }\n\n return fetch(url, formattedOptions)\n },\n}\n", "import type { Locale, SanitizedLocalizationConfig } from 'payload'\n/*\n return the Locale for given locale code, else return null\n*/\nexport const findLocaleFromCode = (\n localizationConfig: SanitizedLocalizationConfig,\n locale: string,\n): Locale | null => {\n if (!localizationConfig?.locales || localizationConfig.locales.length === 0) {\n return null\n }\n\n return localizationConfig.locales.find((el) => el?.code === locale)\n}\n", "const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n try {\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n timeZone,\n hour: \"numeric\",\n timeZoneName: \"longOffset\"\n }).format;\n const offsetStr = format(date).split('GMT')[1] || '';\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support \u00B1HH:MM/\u00B1HHMM/\u00B1HH\n // See: https://github.com/nodejs/node/issues/53419\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +values[0];\n const minutes = +(values[1] || 0);\n return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}", "import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}", "import type { I18n, I18nClient } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\nexport type FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = typeof date === 'string' ? new Date(date) : date\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n", "import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from './formatDateTitle.js'\nimport { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js'\nimport { formatRelationshipTitle } from './formatRelationshipTitle.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: object | string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] as string\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n const isRelationship = fieldConfig?.type === 'relationship'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n\n if (isRelationship) {\n const formattedRelationshipTitle = formatRelationshipTitle(data[useAsTitle])\n title = formattedRelationshipTitle\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n // richtext lexical case. We convert the first child of root to plain text\n if (title && isSerializedLexicalEditor(title)) {\n title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '')\n }\n\n if (!title && isSerializedLexicalEditor(fallback)) {\n title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '')\n }\n\n if (!title) {\n title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "type SerializedLexicalEditor = {\n root: {\n children: Array<{ children?: Array<{ type: string }>; type: string }>\n }\n}\n\nexport function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor {\n return typeof value === 'object' && 'root' in value\n}\n\nexport function formatLexicalDocTitle(\n editorState: Array<{ children?: Array<{ type: string }>; type: string }>,\n textContent: string,\n): string {\n for (const node of editorState) {\n if ('text' in node && node.text) {\n textContent += node.text as string\n } else {\n if (!('children' in node)) {\n textContent += `[${node.type}]`\n }\n }\n if ('children' in node && node.children) {\n textContent += formatLexicalDocTitle(node.children as Array<{ type: string }>, textContent)\n }\n }\n return textContent\n}\n", "export const formatRelationshipTitle = (data): string => {\n if (Array.isArray(data)) {\n return data\n .map((item) => {\n if (typeof item === 'object' && item !== null) {\n return item.id\n }\n return String(item)\n })\n .filter(Boolean)\n .join(', ')\n }\n\n if (typeof data === 'object' && data !== null) {\n return data.id || ''\n }\n\n return String(data)\n}\n", "import type { ClientUser, PayloadRequest, TypedUser } from 'payload'\n\nconst globalLockDurationDefault = 300\n\nexport async function getGlobalData(req: PayloadRequest) {\n const {\n payload: { config },\n payload,\n } = req\n // Query locked global documents only if there are globals in the config\n // This type is repeated from DashboardViewServerPropsOnly['globalData'].\n // I thought about moving it to a payload to share it, but we're already\n // exporting all the views props from the next package.\n let globalData: Array<{\n data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: ClientUser | number | string }\n lockDuration?: number\n slug: string\n }> = []\n\n if (config.globals.length > 0) {\n if (payload.collections?.['payload-locked-documents']) {\n const lockedDocuments = await payload.find({\n collection: 'payload-locked-documents',\n depth: 1,\n overrideAccess: false,\n pagination: false,\n req,\n select: {\n globalSlug: true,\n updatedAt: true,\n user: true,\n },\n where: {\n globalSlug: {\n exists: true,\n },\n },\n })\n\n // Map over globals to include `lockDuration` and lock data for each global slug\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n const lockedDoc = lockedDocuments.docs.find((doc) => doc.globalSlug === global.slug)\n\n return {\n slug: global.slug,\n data: {\n _isLocked: !!lockedDoc,\n _lastEditedAt: (lockedDoc?.updatedAt as string) ?? null,\n _userEditing: (lockedDoc?.user as { value?: TypedUser })?.value ?? null,\n },\n lockDuration,\n }\n })\n } else {\n // If locked-documents collection doesn't exist, return globals without lock data\n globalData = config.globals.map((global) => {\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : globalLockDurationDefault\n\n return {\n slug: global.slug,\n data: {\n _isLocked: false,\n _lastEditedAt: null,\n _userEditing: null,\n },\n lockDuration,\n }\n })\n }\n }\n\n return globalData\n}\n", "import type { SanitizedConfig, SanitizedPermissions, VisibleEntities } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { EntityType } from 'payload'\n\nimport { type EntityToGroup, groupNavItems } from './groupNavItems.js'\n\n/** @internal */\nexport function getNavGroups(\n permissions: SanitizedPermissions,\n visibleEntities: VisibleEntities,\n config: SanitizedConfig,\n i18n: I18nClient,\n) {\n const collections = config.collections.filter(\n (collection) =>\n permissions?.collections?.[collection.slug]?.read &&\n visibleEntities.collections.includes(collection.slug),\n )\n\n const globals = config.globals.filter(\n (global) =>\n permissions?.globals?.[global.slug]?.read && visibleEntities.globals.includes(global.slug),\n )\n\n const navGroups = groupNavItems(\n [\n ...(collections.map((collection) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.collection,\n entity: collection,\n }\n\n return entityToGroup\n }) ?? []),\n ...(globals.map((global) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.global,\n entity: global,\n }\n\n return entityToGroup\n }) ?? []),\n ],\n permissions,\n i18n,\n )\n\n return navGroups\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n EntityType,\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { isNavEntityVisible } from './isNavEntityVisible.js'\n\nexport type EntityToGroup =\n | {\n entity: SanitizedCollectionConfig\n type: EntityType.collection\n }\n | {\n entity: SanitizedGlobalConfig\n type: EntityType.global\n }\n\nexport type NavGroupType = {\n entities: {\n label: StaticLabel\n slug: string\n type: EntityType\n }[]\n label: string\n}\n\nexport function groupNavItems(\n entities: EntityToGroup[],\n permissions: SanitizedPermissions,\n i18n: I18nClient,\n): NavGroupType[] {\n const result = entities.reduce(\n (groups, entityToGroup) => {\n if (\n isNavEntityVisible({\n adminGroup: entityToGroup.entity?.admin?.group,\n entityPermissions:\n permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug],\n })\n ) {\n const labelOrFunction =\n 'labels' in entityToGroup.entity\n ? entityToGroup.entity.labels.plural\n : entityToGroup.entity.label\n\n const label =\n typeof labelOrFunction === 'function'\n ? labelOrFunction({ i18n, t: i18n.t })\n : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\n\n const existingGroup = groups.find(\n (group) => getTranslation(group.label, i18n) === translatedGroup,\n ) as NavGroupType\n\n let matchedGroup: NavGroupType = existingGroup\n\n if (!existingGroup) {\n matchedGroup = { entities: [], label: translatedGroup }\n groups.push(matchedGroup)\n }\n\n matchedGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n } else {\n const defaultGroup = groups.find((group) => {\n return getTranslation(group.label, i18n) === i18n.t(`general:${entityToGroup.type}`)\n }) as NavGroupType\n defaultGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n }\n }\n\n return groups\n },\n [\n {\n entities: [],\n label: i18n.t('general:collections'),\n },\n {\n entities: [],\n label: i18n.t('general:globals'),\n },\n ],\n )\n\n return result.filter((group) => group.entities.length > 0)\n}\n", "import type { SanitizedDocumentPermissions } from 'payload'\n\ntype IsNavEntityVisibleArgs = {\n /** The entity's `admin.group`; an explicit `false` removes it from nav grouping. */\n adminGroup: false | Record<string, string> | string | undefined\n /** The current user's resolved permissions for this entity, if any. */\n entityPermissions: SanitizedDocumentPermissions | undefined\n}\n\n/**\n * Shared nav-visibility rule for collections and globals: an entity is shown when it\n * isn't explicitly removed from grouping (`admin.group: false`) and the user has read\n * permission. Entity-level `admin.hidden` is handled separately via `visibleEntities`.\n * Used by both the sidebar nav (`groupNavItems`) and the command palette so the two\n * surfaces stay in sync.\n */\nexport function isNavEntityVisible({\n adminGroup,\n entityPermissions,\n}: IsNavEntityVisibleArgs): boolean {\n if (adminGroup === false) {\n return false\n }\n\n return Boolean(entityPermissions?.read)\n}\n", "import type { PayloadRequest, VisibleEntities } from 'payload'\n\ntype Hidden = ((args: { user: unknown }) => boolean) | boolean\n\nfunction isHidden(hidden: Hidden | undefined, user: unknown): boolean {\n if (typeof hidden === 'function') {\n try {\n return hidden({ user })\n } catch {\n return true\n }\n }\n return !!hidden\n}\n\nexport function getVisibleEntities({ req }: { req: PayloadRequest }): VisibleEntities {\n return {\n collections: req.payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n globals: req.payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n }\n}\n", "import type { RouterAdapterRouter } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: RouterAdapterRouter\n serverURL?: string\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router, serverURL }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '',\n serverURL,\n })\n router.push(redirectRoute)\n}\n", "import type { RouterAdapterRouter } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: RouterAdapterRouter\n serverURL?: string\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router, serverURL }: GoBackProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: collectionSlug ? `/collections/${collectionSlug}` : '/',\n })\n router.push(redirectRoute)\n}\n", "import type { ClientUser } from 'payload'\n\nexport interface HandleTakeOverParams {\n clearRouteCache?: () => void\n collectionSlug?: string\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>\n globalSlug?: string\n id: number | string\n isLockingEnabled: boolean\n isWithinDoc: boolean\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>\n user: ClientUser | number | string\n}\n\nexport const handleTakeOver = async ({\n id,\n clearRouteCache,\n collectionSlug,\n documentLockStateRef,\n globalSlug,\n isLockingEnabled,\n isWithinDoc,\n setCurrentEditor,\n setIsReadOnlyForIncomingUser,\n updateDocumentEditor,\n user,\n}: HandleTakeOverParams): Promise<void> => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n await updateDocumentEditor(id, collectionSlug ?? globalSlug, user)\n\n if (!isWithinDoc) {\n documentLockStateRef.current.hasShownLockedModal = true\n }\n\n // Update the locked state to reflect the current user as the owner\n documentLockStateRef.current = {\n hasShownLockedModal: documentLockStateRef.current?.hasShownLockedModal,\n isLocked: true,\n user,\n }\n setCurrentEditor(user)\n\n // If this is a takeover within the document, ensure the document is editable\n if (isWithinDoc && setIsReadOnlyForIncomingUser) {\n setIsReadOnlyForIncomingUser(false)\n }\n\n // Need to clear the route cache to refresh the page and update readOnly state for server rendered components\n if (clearRouteCache) {\n clearRouteCache()\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error during document takeover:', error)\n }\n}\n", "import type {\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedGlobalPermission,\n} from 'payload'\n\nexport const hasSavePermission = (args: {\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n collectionSlug?: string\n docPermissions: SanitizedDocumentPermissions\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n globalSlug?: string\n isEditing: boolean\n}) => {\n const { collectionSlug, docPermissions, globalSlug, isEditing } = args\n\n if (collectionSlug) {\n return Boolean(\n (isEditing && docPermissions?.update) ||\n (!isEditing && (docPermissions as SanitizedCollectionPermission)?.create),\n )\n }\n\n if (globalSlug) {\n return Boolean((docPermissions as SanitizedGlobalPermission)?.update)\n }\n\n return false\n}\n", "import type { ClientUser } from 'payload'\n\nexport const isClientUserObject = (user): user is ClientUser => {\n return user && typeof user === 'object'\n}\n", "export const isEditing = ({\n id,\n collectionSlug,\n globalSlug,\n}: {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}): boolean => Boolean(globalSlug || (collectionSlug && !!id))\n", "export function sanitizeID(id: number | string): number | string {\n if (id === undefined) {\n return id\n }\n\n if (typeof id === 'number') {\n return id\n }\n\n return decodeURIComponent(id)\n}\n", "import type { ClientField, Field } from 'payload'\n\nexport const traverseForLocalizedFields = (fields: ClientField[] | Field[]): boolean => {\n for (const field of fields) {\n if ('localized' in field && field.localized) {\n return true\n }\n\n switch (field.type) {\n case 'array':\n case 'collapsible':\n case 'group':\n case 'row':\n if (field.fields && traverseForLocalizedFields(field.fields)) {\n return true\n }\n break\n\n case 'blocks':\n if (field.blocks) {\n for (const block of field.blocks) {\n if (typeof block === 'string') {\n continue\n }\n if (block.fields && traverseForLocalizedFields(block.fields)) {\n return true\n }\n }\n }\n break\n\n case 'tabs':\n if (field.tabs) {\n for (const tab of field.tabs) {\n if ('localized' in tab && tab.localized) {\n return true\n }\n if ('fields' in tab && tab.fields && traverseForLocalizedFields(tab.fields)) {\n return true\n }\n }\n }\n break\n }\n }\n\n return false\n}\n"],
|
|
5
|
+
"mappings": "wCAEA,MAAuB,QAEvB,IAAMA,EAGDA,CAAC,CAAEC,SAAAA,EAAUC,kBAAAA,CAAiB,IAAE,CACnC,IAAMC,EAAQ,yBACRC,EAAWF,EAAkBG,MAAMF,CAAA,EAEzC,OACEG,EAAC,OAAA,UACEF,EAASG,IAAI,CAACC,EAASC,IAAA,CACtB,GAAIR,GAAYO,EAAQE,WAAW,GAAA,GAAQF,EAAQG,SAAS,GAAA,EAAM,CAChE,IAAMC,EAAaJ,EAAQ,CAAA,EACrBK,EAAUZ,EAASW,CAAA,EAEzB,GAAIC,EAAS,CACX,IAAMV,EAAQ,IAAIW,OAAO,IAAIF,CAAA,WAAsBA,CAAA,IAAe,GAAA,EAC5DG,EAAWP,EAAQQ,QAAQb,EAAO,CAACc,EAAGC,IAAUA,CAAA,EAEtD,OACEZ,EAACO,EAAA,UACCP,EAACN,EAAA,CAAqBE,kBAAmBa,KAD7BN,CAAA,CAIlB,CACF,CAEA,OAAOD,CACT,CAAA,GAGN,EASaW,EAA0CA,CAAC,CAAElB,SAAAA,EAAUmB,QAAAA,EAASC,EAAAA,EAAGC,UAAAA,CAAS,IAAE,CACzF,IAAMC,EAAsBF,EAAED,EAASE,GAAa,CAAC,CAAA,EAErD,OAAKrB,EAIEK,EAACN,EAAA,CAAqBC,SAAUA,EAAUC,kBAAmBqB,IAH3DA,CAIX,0CCnDA,OAASC,oCAAAA,EAAkCC,eAAAA,MAAmB,iBAC9D,MAAkB,QAwBX,SAASC,EAAuD,CACrEC,UAAAA,EACAC,wBAAAA,EACAC,iBAAAA,CAAgB,EAKjB,CACC,OAAID,IAA4BE,SAC9BF,EAA0B,CAACJ,EAAiCG,CAAA,GAGDI,GAAA,CAC3D,I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ACL,IAAK,cACL,IAAK,QACL,IAAK,MACH,GAAIF,EAAMD,QAAUD,EAA2BE,EAAMD,MAAM,EACzD,MAAO,GAET,MAEF,IAAK,SACH,GAAIC,EAAMG,QACR,QAAWC,KAASJ,EAAMG,OACxB,GAAI,OAAOC,GAAU,UAGjBA,EAAML,QAAUD,EAA2BM,EAAML,MAAM,EACzD,MAAO,GAIb,MAEF,IAAK,OACH,GAAIC,EAAMK,MACR,QAAWC,KAAON,EAAMK,KAItB,GAHI,cAAeC,GAAOA,EAAIL,WAG1B,WAAYK,GAAOA,EAAIP,QAAUD,EAA2BQ,EAAIP,MAAM,EACxE,MAAO,GAIb,KACJ,CACF,CAEA,MAAO,EACT",
|
|
6
6
|
"names": ["RecursiveTranslation", "elements", "translationString", "regex", "sections", "split", "_jsx", "map", "section", "index", "startsWith", "endsWith", "elementKey", "Element", "RegExp", "children", "replace", "_", "group", "Translation", "i18nKey", "t", "variables", "stringWithVariables", "isReactServerComponentOrFunction", "serverProps", "withMergedProps", "Component", "sanitizeServerOnlyProps", "toMergeIntoProps", "undefined", "passedProps", "mergedProps", "simpleMergeProps", "forEach", "prop", "_jsx", "props", "toMerge", "isReactServerComponentOrFunction", "WithServerSideProps", "Component", "serverOnlyProps", "rest", "passedProps", "propsWithServerOnlyProps", "_jsx", "mergeFieldStyles", "field", "admin", "style", "width", "flex", "blacklistedKeys", "sanitizeField", "incomingField", "field", "key", "reduceToSerializableFields", "fields", "result", "PayloadIcon", "fill", "fillFromProps", "_jsxs", "className", "height", "viewBox", "width", "xmlns", "_jsx", "d", "css", "PayloadLogo", "_jsxs", "className", "fill", "height", "viewBox", "width", "xmlns", "_jsx", "clipPath", "d", "id", "fieldIsHiddenOrDisabled", "fieldIsID", "isFieldDisabled", "filterFields", "incomingFields", "shouldSkipField", "field", "type", "reduce", "acc", "formattedField", "tabs", "map", "tab", "fields", "push", "Array", "isArray", "fieldAffectsData", "getRemainingColumns", "fields", "useAsTitle", "reduce", "remaining", "field", "name", "type", "tabs", "tabFieldColumns", "tab", "getInitialColumns", "defaultColumns", "initialColumns", "Array", "isArray", "length", "push", "remainingColumns", "concat", "slice", "map", "column", "accessor", "active", "abortAndIgnore", "abortController", "abort", "handleAbortRef", "abortControllerRef", "newController", "AbortController", "current", "qs", "requests", "delete", "url", "options", "headers", "formattedOptions", "credentials", "method", "fetch", "get", "query", "params", "stringify", "addQueryPrefix", "patch", "post", "put", "findLocaleFromCode", "localizationConfig", "locale", "locales", "length", "find", "el", "code", "offsetFormatCache", "offsetCache", "tzOffset", "timeZone", "date", "offsetStr", "calcOffset", "captures", "offsetRe", "cacheStr", "values", "hours", "minutes", "TZDateMini", "_TZDateMini", "args", "tzOffset", "adjustToSystemTZ", "syncToInternal", "tz", "timeZone", "time", "date", "re", "method", "utcMethod", "syncFromInternal", "offset", "prevHour", "systemOffset", "prevHourSystemOffset", "systemDSTChange", "dstShift", "offsetDiff", "postOffset", "postOffsetDiff", "offsetChanged", "postDiff", "newOffset", "offsetChange", "format", "formatDistanceToNow", "transpose", "formatDate", "date", "i18n", "pattern", "timezone", "theDate", "TZDate", "Date", "DateWithOriginalTz", "tz", "modifiedDate", "withTimeZone", "dateWithTimezone", "dateFNS", "locale", "t", "getTranslation", "isSerializedLexicalEditor", "value", "formatLexicalDocTitle", "editorState", "textContent", "node", "text", "type", "children", "formatRelationshipTitle", "data", "Array", "isArray", "map", "item", "id", "String", "filter", "Boolean", "join", "formatDocTitle", "collectionConfig", "data", "dateFormat", "dateFormatFromConfig", "fallback", "globalConfig", "i18n", "title", "useAsTitle", "admin", "fieldConfig", "fields", "find", "f", "name", "isDate", "type", "isRelationship", "date", "displayFormat", "formatDate", "pattern", "formatRelationshipTitle", "getTranslation", "label", "slug", "isSerializedLexicalEditor", "formatLexicalDocTitle", "root", "children", "t", "getGlobalData", "req", "payload", "config", "globalData", "globals", "length", "collections", "lockedDocuments", "find", "collection", "depth", "overrideAccess", "pagination", "select", "globalSlug", "updatedAt", "user", "where", "exists", "map", "global", "lockDuration", "lockDocuments", "duration", "globalLockDurationDefault", "lockedDoc", "docs", "doc", "slug", "data", "_isLocked", "_lastEditedAt", "_userEditing", "value", "EntityType", "getTranslation", "isNavEntityVisible", "adminGroup", "entityPermissions", "Boolean", "read", "groupNavItems", "entities", "permissions", "i18n", "reduce", "groups", "entityToGroup", "isNavEntityVisible", "adminGroup", "entity", "admin", "group", "entityPermissions", "type", "toLowerCase", "slug", "labelOrFunction", "labels", "plural", "label", "t", "translatedGroup", "getTranslation", "existingGroup", "find", "matchedGroup", "push", "filter", "length", "getNavGroups", "permissions", "visibleEntities", "config", "i18n", "collections", "filter", "collection", "slug", "read", "includes", "globals", "global", "groupNavItems", "map", "type", "EntityType", "entity", "isHidden", "hidden", "user", "getVisibleEntities", "req", "collections", "payload", "config", "map", "slug", "admin", "filter", "Boolean", "globals", "formatAdminURL", "handleBackToDashboard", "adminRoute", "router", "serverURL", "redirectRoute", "path", "push", "formatAdminURL", "handleGoBack", "adminRoute", "collectionSlug", "router", "serverURL", "redirectRoute", "path", "push", "handleTakeOver", "id", "clearRouteCache", "collectionSlug", "documentLockStateRef", "globalSlug", "isLockingEnabled", "isWithinDoc", "setCurrentEditor", "setIsReadOnlyForIncomingUser", "updateDocumentEditor", "user", "current", "hasShownLockedModal", "isLocked", "error", "console", "hasSavePermission", "args", "collectionSlug", "docPermissions", "globalSlug", "isEditing", "Boolean", "update", "create", "isClientUserObject", "user", "isEditing", "id", "collectionSlug", "globalSlug", "Boolean", "sanitizeID", "id", "undefined", "decodeURIComponent", "traverseForLocalizedFields", "fields", "field", "localized", "type", "blocks", "block", "tabs", "tab"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAgC7D,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAgC7D,OAAO,aAAa,CAAA;AA0gBpB,eAAO,MAAM,WAAW;;;;+EAAsC,CAAA"}
|
|
@@ -55,7 +55,6 @@ const BlocksFieldComponent = props => {
|
|
|
55
55
|
description,
|
|
56
56
|
isSortable = true
|
|
57
57
|
} = {},
|
|
58
|
-
blockReferences,
|
|
59
58
|
blocks,
|
|
60
59
|
label,
|
|
61
60
|
labels: labelsFromProps,
|
|
@@ -146,15 +145,11 @@ const BlocksFieldComponent = props => {
|
|
|
146
145
|
clientBlocks,
|
|
147
146
|
clientBlocksAfterFilter: clientBlocksAfterFilter_0
|
|
148
147
|
} = useMemo(() => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const block = typeof blockReference === 'string' ? config.blocksMap[blockReference] : blockReference;
|
|
155
|
-
if (block) {
|
|
156
|
-
resolvedBlocks.push(block);
|
|
157
|
-
}
|
|
148
|
+
const resolvedBlocks = [];
|
|
149
|
+
for (const blockOrSlug of blocks) {
|
|
150
|
+
const block = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
|
|
151
|
+
if (block) {
|
|
152
|
+
resolvedBlocks.push(block);
|
|
158
153
|
}
|
|
159
154
|
}
|
|
160
155
|
if (Array.isArray(blocksFilterOptions)) {
|
|
@@ -171,7 +166,7 @@ const BlocksFieldComponent = props => {
|
|
|
171
166
|
clientBlocks: resolvedBlocks,
|
|
172
167
|
clientBlocksAfterFilter: resolvedBlocks
|
|
173
168
|
};
|
|
174
|
-
}, [
|
|
169
|
+
}, [blocks, blocksFilterOptions, config.blocksMap]);
|
|
175
170
|
const getBlockConfig = blockType => config.blocksMap[blockType] ?? clientBlocks.find(block_1 => block_1.slug === blockType);
|
|
176
171
|
const addRow = useCallback((rowIndex, blockType_0) => {
|
|
177
172
|
addFieldRow({
|