@payloadcms/ui 3.18.0-canary.df484f6 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/AddNewRelation/useRelatedCollections.d.ts.map +1 -1
- package/dist/elements/AddNewRelation/useRelatedCollections.js +6 -4
- package/dist/elements/AddNewRelation/useRelatedCollections.js.map +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/AddingFilesView/index.js.map +1 -1
- package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
- package/dist/elements/BulkUpload/index.js +4 -2
- package/dist/elements/BulkUpload/index.js.map +1 -1
- package/dist/elements/DeleteDocument/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +4 -4
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/DuplicateDocument/index.js.map +1 -1
- package/dist/elements/ListDrawer/DrawerContent.js +6 -6
- package/dist/elements/ListDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/Localizer/index.d.ts.map +1 -1
- package/dist/elements/Localizer/index.js +21 -21
- package/dist/elements/Localizer/index.js.map +1 -1
- package/dist/elements/PublishButton/index.js +79 -100
- package/dist/elements/PublishButton/index.js.map +1 -1
- package/dist/elements/RelationshipTable/cells/DrawerLink/index.js +1 -1
- package/dist/elements/RelationshipTable/cells/DrawerLink/index.js.map +1 -1
- package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/index.js.map +1 -1
- package/dist/elements/SortColumn/index.scss +0 -1
- package/dist/elements/Table/DefaultCell/fields/Code/index.d.ts +2 -1
- package/dist/elements/Table/DefaultCell/fields/Code/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Code/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/File/index.d.ts +2 -1
- package/dist/elements/Table/DefaultCell/fields/File/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/File/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Relationship/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Relationship/index.js +1 -0
- package/dist/elements/Table/DefaultCell/fields/Relationship/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/index.js +33 -40
- package/dist/elements/Table/DefaultCell/index.js.map +1 -1
- package/dist/elements/TableColumns/RenderDefaultCell/index.d.ts.map +1 -1
- package/dist/elements/TableColumns/RenderDefaultCell/index.js +1 -1
- package/dist/elements/TableColumns/RenderDefaultCell/index.js.map +1 -1
- package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
- package/dist/elements/TableColumns/buildColumnState.js +30 -11
- package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
- package/dist/elements/TableColumns/index.js.map +1 -1
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/Upload/index.js +72 -33
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/index.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/index.js +18 -11
- package/dist/elements/WhereBuilder/Condition/Relationship/index.js.map +1 -1
- package/dist/elements/WhereBuilder/validateWhereQuery.js +2 -2
- package/dist/elements/WhereBuilder/validateWhereQuery.js.map +1 -1
- package/dist/exports/client/{CodeEditor-W7RSWONH.js → CodeEditor-BMYVMDNZ.js} +2 -2
- package/dist/exports/client/chunk-CQQHQHCB.js +26 -0
- package/dist/exports/client/{chunk-3MXUY6XL.js.map → chunk-CQQHQHCB.js.map} +3 -3
- package/dist/exports/client/index.js +22 -22
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +3 -3
- package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockRow.js +32 -47
- package/dist/fields/Blocks/BlockRow.js.map +1 -1
- package/dist/fields/Blocks/index.js +3 -2
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Join/index.d.ts.map +1 -1
- package/dist/fields/Join/index.js +5 -5
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Relationship/index.d.ts.map +1 -1
- package/dist/fields/Relationship/index.js +14 -8
- package/dist/fields/Relationship/index.js.map +1 -1
- package/dist/forms/Form/reduceToSerializableFields.d.ts +4 -0
- package/dist/forms/Form/reduceToSerializableFields.d.ts.map +1 -1
- package/dist/forms/Form/reduceToSerializableFields.js +15 -12
- package/dist/forms/Form/reduceToSerializableFields.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +26 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/providers/Config/index.d.ts +22 -13
- package/dist/providers/Config/index.d.ts.map +1 -1
- package/dist/providers/Config/index.js +45 -61
- package/dist/providers/Config/index.js.map +1 -1
- package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/Locale/index.d.ts.map +1 -1
- package/dist/providers/Locale/index.js +62 -54
- package/dist/providers/Locale/index.js.map +1 -1
- package/dist/scss/toasts.scss +2 -0
- package/dist/styles.css +1 -1
- package/dist/utilities/handleFormStateLocking.d.ts.map +1 -1
- package/dist/utilities/handleFormStateLocking.js +3 -3
- package/dist/utilities/handleFormStateLocking.js.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts +3 -0
- package/dist/utilities/isURLAllowed.d.ts.map +1 -0
- package/dist/utilities/isURLAllowed.js +31 -0
- package/dist/utilities/isURLAllowed.js.map +1 -0
- package/dist/views/Edit/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Auth/APIKey.js +4 -3
- package/dist/views/Edit/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/List/ListHeader/index.d.ts.map +1 -1
- package/dist/views/List/ListHeader/index.js +5 -4
- package/dist/views/List/ListHeader/index.js.map +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/exports/client/chunk-3MXUY6XL.js +0 -26
- /package/dist/exports/client/{CodeEditor-W7RSWONH.js.map → CodeEditor-BMYVMDNZ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{fieldIsHiddenOrDisabled as P,fieldIsID as R}from"payload/shared";var L=e=>{let t=o=>o.type!=="ui"&&P(o)&&!R(o)||o?.admin?.disableListColumn===!0;return e?.reduce((o,n)=>{if(t(n))return o;let i=n.type==="tabs"&&"tabs"in n?{...n,tabs:n.tabs.map(s=>({...s,fields:s.fields.filter(a=>!t(a))}))}:n;return o.push(i),o},[])};import{fieldAffectsData as x}from"payload/shared";var g=(e,t)=>e?.reduce((r,o)=>x(o)&&o.name===t?r:!x(o)&&"fields"in o?[...r,...g(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,i)=>[...n,..."name"in i?[i.name]:g(i.fields,t)],[])]:[...r,o.name],[]),T=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=g(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};import*as m from"react";var v=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=t.split(r);return m.createElement("span",null,o.map((n,i)=>{if(e&&n.startsWith("<")&&n.endsWith(">")){let s=n[1],a=e[s];if(a){let
|
|
1
|
+
import{fieldIsHiddenOrDisabled as P,fieldIsID as R}from"payload/shared";var L=e=>{let t=o=>o.type!=="ui"&&P(o)&&!R(o)||o?.admin?.disableListColumn===!0;return e?.reduce((o,n)=>{if(t(n))return o;let i=n.type==="tabs"&&"tabs"in n?{...n,tabs:n.tabs.map(s=>({...s,fields:s.fields.filter(a=>!t(a))}))}:n;return o.push(i),o},[])};import{fieldAffectsData as x}from"payload/shared";var g=(e,t)=>e?.reduce((r,o)=>x(o)&&o.name===t?r:!x(o)&&"fields"in o?[...r,...g(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,i)=>[...n,..."name"in i?[i.name]:g(i.fields,t)],[])]:[...r,o.name],[]),T=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=g(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};import*as m from"react";var v=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=t.split(r);return m.createElement("span",null,o.map((n,i)=>{if(e&&n.startsWith("<")&&n.endsWith(">")){let s=n[1],a=e[s];if(a){let c=new RegExp(`<${s}>(.*?)</${s}>`,"g"),p=n.replace(c,(d,u)=>u);return m.createElement(a,{key:i},m.createElement(v,{translationString:p}))}}return n}))},I=({elements:e,i18nKey:t,t:r,variables:o})=>{let n=r(t,o||{});return e?m.createElement(v,{elements:e,translationString:n}):n};import{isReactServerComponentOrFunction as w,serverProps as A}from"payload/shared";import M from"react";function k({Component:e,sanitizeServerOnlyProps:t,toMergeIntoProps:r}){return t===void 0&&(t=!w(e)),n=>{let i=D(n,r);return t&&A.forEach(s=>{delete i[s]}),M.createElement(e,{...i})}}function D(e,t){return{...e,...t}}import{isReactServerComponentOrFunction as z}from"payload/shared";import O from"react";var N=({Component:e,serverOnlyProps:t,...r})=>e?(n=>{let i={...n,...z(e)?t??{}:{}};return O.createElement(e,{...i})})(r):null;var Z=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 auto"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}});var $=["validate","customComponents"],B=e=>{let t={...e};for(let r of $)delete t[r];return t},U=e=>{let t={};for(let r in e)t[r]=B(e[r]);return t};import h from"react";var E=({fill:e})=>{let t=e||"var(--theme-elevation-1000)";return h.createElement("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{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",fill:t}),h.createElement("path",{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",fill:t}))};import l from"react";var q=`
|
|
2
2
|
.graphic-logo path {
|
|
3
3
|
fill: var(--theme-elevation-1000);
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,G=()=>l.createElement("svg",{className:"graphic-logo",fill:"none",height:"43.5",id:"b",viewBox:"0 0 193.38 43.5",width:"193.38",xmlns:"http://www.w3.org/2000/svg"},l.createElement("style",null,q),l.createElement("g",{id:"c"},l.createElement("path",{d:"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z"}),l.createElement("path",{d:"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z"}),l.createElement("g",{id:"d"},l.createElement("path",{d:"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z"}),l.createElement("path",{d:"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z"}),l.createElement("path",{d:"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),l.createElement("path",{d:"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z"}),l.createElement("path",{d:"M113.46,35.77V6.1h5.32v29.67h-5.32Z"}),l.createElement("path",{d:"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z"}),l.createElement("path",{d:"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),l.createElement("path",{d:"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z"}))));function j(e){if(e)try{e.abort()}catch{}}function V(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as S from"qs-esm";var K={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=S.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 W=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);var f=e=>{let{adminRoute:t,basePath:r="",path:o,serverURL:n}=e;if(t)if(t==="/"){if(!o)return`${n||""}${r}${t}`}else return`${n||""}${r}${t}${o}`;return`${n||""}${r}${o}`};import{format as H,formatDistanceToNow as we}from"date-fns";var y=({date:e,i18n:t,pattern:r})=>{let o=new Date(e);return t.dateFNS?H(o,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as _}from"@payloadcms/translations";var Q=({collectionConfig:e,data:t,dateFormat:r,fallback:o,globalConfig:n,i18n:i})=>{let s;if(e){let a=e?.admin?.useAsTitle;if(a&&(s=t?.[a]||s,s)){let c=e.fields.find(d=>"name"in d&&d.name===a);if(c?.type==="date"){let d="date"in c.admin&&c?.admin?.date?.displayFormat||r;s=y({date:s,i18n:i,pattern:d})||s}}}return n&&(s=_(n?.label,i)||n?.slug),s||(s=o||`[${i.t("general:untitled")}]`),s};import{getTranslation as C}from"@payloadcms/translations";var F=(r=>(r.collection="collections",r.global="globals",r))(F||{});function J(e,t,r){return e.reduce((n,i)=>{if(i.entity?.admin?.group===!1)return n;if(t?.[i.type.toLowerCase()]?.[i.entity.slug]?.read){let s=C(i.entity.admin.group,r),a="labels"in i.entity?i.entity.labels.plural:i.entity.label,c=typeof a=="function"?a({t:r.t}):a;if(i.entity.admin.group){let p=n.find(u=>C(u.label,r)===s),d=p;p||(d={entities:[],label:s},n.push(d)),d.entities.push({slug:i.entity.slug,type:i.type,label:c})}else n.find(d=>C(d.label,r)===r.t(`general:${i.type}`)).entities.push({slug:i.entity.slug,type:i.type,label:c})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}var X=({adminRoute:e,router:t})=>{let r=f({adminRoute:e,path:"/"});t.push(r)};var Y=({adminRoute:e,collectionSlug:t,router:r})=>{let o=f({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(o)};var ee=(e,t,r,o,n,i,s,a,c,p)=>{if(c)try{i(e,t??r,o),n||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:o},s(o),n&&p&&p(!1)}catch(d){console.error("Error during document takeover:",d)}};var te=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:o,isEditing:n}=e;return t?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var re=e=>e&&typeof e=="object";var oe=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);var b=e=>Object.keys(e).length===0,ne=(e,t)=>b(t)?e:b(e)?t:("and"in e?e.and.push(t):"or"in e?e={and:[e,t]}:e={and:[e,t]},e),ie=({collectionConfig:e,search:t,where:r={}})=>{if(t){let o={...r||{}},n=(e.admin.listSearchableFields||[e.admin?.useAsTitle||"id"]).map(i=>({[i]:{like:t}}));n.length>0&&(o=ne(o,{or:n})),b(o)||(r=o)}return r};function se(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}export{F as EntityType,E as PayloadIcon,G as PayloadLogo,I as Translation,N as WithServerSideProps,j as abortAndIgnore,L as filterFields,W as findLocaleFromCode,f as formatAdminURL,y as formatDate,Q as formatDocTitle,T as getInitialColumns,J as groupNavItems,V as handleAbortRef,X as handleBackToDashboard,Y as handleGoBack,ee as handleTakeOver,te as hasSavePermission,re as isClientUserObject,oe as isEditing,Z as mergeFieldStyles,ie as mergeListSearchAndWhere,U as reduceToSerializableFields,K as requests,se as sanitizeID,k as withMergedProps};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/TableColumns/filterFields.tsx", "../../../src/elements/TableColumns/getInitialColumns.ts", "../../../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/utilities/abortAndIgnore.ts", "../../../src/utilities/api.ts", "../../../src/utilities/findLocaleFromCode.ts", "../../../src/utilities/formatAdminURL.ts", "../../../src/utilities/formatDate.ts", "../../../src/utilities/formatDocTitle.ts", "../../../src/utilities/groupNavItems.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/mergeListSearchAndWhere.ts", "../../../src/utilities/sanitizeID.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disableListColumn` set to `true`\n * Does so recursively for `tabs` fields.\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 field?.admin?.disableListColumn === true\n\n const fields: T[] = incomingFields?.reduce((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // extract top-level `tabs` fields and filter out the same\n const formattedField: T =\n field.type === 'tabs' && 'tabs' in field\n ? {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: tab.fields.filter((tabField) => !shouldSkipField(tabField)),\n })),\n }\n : field\n\n acc.push(formattedField)\n\n return acc\n }, [])\n\n return fields\n}\n", "import type { ClientField, CollectionConfig, Field, ListPreferences } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): ListPreferences['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): ListPreferences['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", "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 = getMergedPropsComponent({\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 auto',\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'\nimport { deepCopyObjectComplex } from 'payload/shared'\n\ntype BlacklistedKeys = 'customComponents' | 'validate'\nconst blacklistedKeys: BlacklistedKeys[] = ['validate', 'customComponents']\n\nconst sanitizeField = (incomingField: FormField): FormField => {\n const field = deepCopyObjectComplex(incomingField)\n\n blacklistedKeys.forEach((key) => {\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 return Object.keys(fields).reduce(\n (acc, key) => {\n acc[key] = sanitizeField(fields[key])\n return acc\n },\n {} as {\n [key: string]: Omit<FormField, BlacklistedKeys>\n },\n )\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(--theme-elevation-1000);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"43.5\"\n id=\"b\"\n viewBox=\"0 0 193.38 43.5\"\n width=\"193.38\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g id=\"c\">\n <path d=\"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z\" />\n <path d=\"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z\" />\n <g id=\"d\">\n <path d=\"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z\" />\n <path d=\"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z\" />\n <path d=\"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z\" />\n <path d=\"M113.46,35.77V6.1h5.32v29.67h-5.32Z\" />\n <path d=\"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z\" />\n <path d=\"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z\" />\n </g>\n </g>\n </svg>\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", "import type { Config } from 'payload'\n\n/** Will read the `routes.admin` config and appropriately handle `\"/\"` admin paths */\nexport const formatAdminURL = (args: {\n adminRoute: Config['routes']['admin']\n basePath?: string\n path: string\n serverURL?: Config['serverURL']\n}): string => {\n const { adminRoute, basePath = '', path, serverURL } = args\n\n if (adminRoute) {\n if (adminRoute === '/') {\n if (!path) {\n return `${serverURL || ''}${basePath}${adminRoute}`\n }\n } else {\n return `${serverURL || ''}${basePath}${adminRoute}${path}`\n }\n }\n\n return `${serverURL || ''}${basePath}${path}`\n}\n", "import type { I18n } from '@payloadcms/translations'\n\nimport { format, formatDistanceToNow } from 'date-fns'\n\ntype FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n pattern: string\n}\n\nexport const formatDate = ({ date, i18n, pattern }: FormatDateArgs): string => {\n const theDate = new Date(date)\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<any, any>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new 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 '../utilities/formatDate.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?: 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] || title\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\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n if (!title) {\n title = fallback || `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nexport enum EntityType {\n collection = 'collections',\n global = 'globals',\n}\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 // Skip entities where admin.group is explicitly false\n if (entityToGroup.entity?.admin?.group === false) {\n return groups\n }\n\n if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\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' ? labelOrFunction({ t: i18n.t }) : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\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 { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from './formatAdminURL.js'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: AppRouterInstance\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '/',\n })\n router.push(redirectRoute)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from './formatAdminURL.js'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: AppRouterInstance\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router }: 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 const handleTakeOver = (\n id: number | string,\n collectionSlug: string,\n globalSlug: string,\n user: ClientUser | number | string,\n isWithinDoc: boolean,\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>,\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void,\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>,\n isLockingEnabled: boolean,\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void,\n): void => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n void 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 } 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", "import type { ClientCollectionConfig, SanitizedCollectionConfig, Where } from 'payload'\n\nconst isEmptyObject = (obj: object) => Object.keys(obj).length === 0\n\nexport const hoistQueryParamsToAnd = (currentWhere: Where, incomingWhere: Where) => {\n if (isEmptyObject(incomingWhere)) {\n return currentWhere\n }\n\n if (isEmptyObject(currentWhere)) {\n return incomingWhere\n }\n\n if ('and' in currentWhere) {\n currentWhere.and.push(incomingWhere)\n } else if ('or' in currentWhere) {\n currentWhere = {\n and: [currentWhere, incomingWhere],\n }\n } else {\n currentWhere = {\n and: [currentWhere, incomingWhere],\n }\n }\n\n return currentWhere\n}\n\ntype Args = {\n collectionConfig: ClientCollectionConfig | SanitizedCollectionConfig\n search: string\n where?: Where\n}\n\nexport const mergeListSearchAndWhere = ({ collectionConfig, search, where = {} }: Args): Where => {\n if (search) {\n let copyOfWhere = { ...(where || {}) }\n\n const searchAsConditions = (\n collectionConfig.admin.listSearchableFields || [collectionConfig.admin?.useAsTitle || 'id']\n ).map((fieldName) => ({\n [fieldName]: {\n like: search,\n },\n }))\n\n if (searchAsConditions.length > 0) {\n copyOfWhere = hoistQueryParamsToAnd(copyOfWhere, {\n or: searchAsConditions,\n })\n }\n\n if (!isEmptyObject(copyOfWhere)) {\n where = copyOfWhere\n }\n }\n\n return where\n}\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"],
|
|
5
|
-
"mappings": "AAEA,OAAS,2BAAAA,EAAyB,aAAAC,MAAiB,iBAM5C,IAAMC,EAA+CC,GAA6B,CACvF,IAAMC,EAAmBC,GACtBA,EAAM,OAAS,MAAQL,EAAwBK,CAAK,GAAK,CAACJ,EAAUI,CAAK,GAC1EA,GAAO,OAAO,oBAAsB,GAwBtC,OAtBoBF,GAAgB,OAAO,CAACG,EAAKD,IAAU,CACzD,GAAID,EAAgBC,CAAK,EACvB,OAAOC,EAIT,IAAMC,EACJF,EAAM,OAAS,QAAU,SAAUA,EAC/B,CACE,GAAGA,EACH,KAAMA,EAAM,KAAK,IAAKG,IAAS,CAC7B,GAAGA,EACH,OAAQA,EAAI,OAAO,OAAQC,GAAa,CAACL,EAAgBK,CAAQ,CAAC,CACpE,EAAE,CACJ,EACAJ,EAEN,OAAAC,EAAI,KAAKC,CAAc,EAEhBD,CACT,EAAG,CAAC,CAAC,CAGP,EClCA,OAAS,oBAAAI,MAAwB,iBAEjC,IAAMC,EAAsB,CAC1BC,EACAC,IAEAD,GAAQ,OAAO,CAACE,EAAWC,IACrBL,EAAiBK,CAAK,GAAKA,EAAM,OAASF,EACrCC,EAGL,CAACJ,EAAiBK,CAAK,GAAK,WAAYA,EACnC,CAAC,GAAGD,EAAW,GAAGH,EAAoBI,EAAM,OAAQF,CAAU,CAAC,EAGpEE,EAAM,OAAS,QAAU,SAAUA,EAC9B,CACL,GAAGD,EACH,GAAGC,EAAM,KAAK,OACZ,CAACC,EAAiBC,IAAQ,CACxB,GAAGD,EACH,GAAI,SAAUC,EAAM,CAACA,EAAI,IAAI,EAAIN,EAAoBM,EAAI,OAAQJ,CAAU,CAC7E,EACA,CAAC,CACH,CACF,EAGK,CAAC,GAAGC,EAAW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,EAAqB,EAHhFA,CAIX,ECnDA,OAAS,oCAAAC,EAAkC,eAAAC,MAAmB,iBAC9D,OAAOC,MAAW,QAwBX,SAASC,EAAuD,CACrE,UAAAC,EACA,wBAAAC,EACA,iBAAAC,CACF,EAIkC,CAChC,OAAID,IAA4B,SAC9BA,EAA0B,CAACL,EAAiCI,CAAS,GAGVG,GAAgB,CAC3E,IAAMC,EAAcC,EAAiBF,EAAaD,CAAgB,EAElE,OAAID,GACFJ,EAAY,QAASS,GAAS,CAC5B,OAAOF,EAAYE,CAAI,CACzB,CAAC,EAGIR,EAAA,cAACE,EAAA,CAAW,GAAGI,EAAa,CACrC,CAGF,CAEA,SAASC,EAAiBE,EAAOC,EAAS,CACxC,MAAO,CAAE,GAAGD,EAAO,GAAGC,CAAQ,CAChC,CCrDA,OAAS,oCAAAC,MAAwC,iBACjD,OAAOC,MAAW,QAEX,IAAMC,EAAoD,CAAC,CAChE,UAAAC,EACA,gBAAAC,EACA,GAAGC,CACL,IACMF,GACqCG,GAAgB,CACrD,IAAMC,EAA2B,CAC/B,GAAGD,EACH,GAAIN,EAAiCG,CAAS,EAAKC,GAAmB,CAAC,EAAK,CAAC,CAC/E,EAEA,OAAOH,EAAA,cAACE,EAAA,CAAW,GAAGI,EAA0B,CAClD,GAE2BF,CAAI,EAG1B,KCrBF,IAAMG,EACXC,IACyB,CACzB,GAAIA,GAAO,OAAO,OAAS,CAAC,EAC5B,GAAIA,GAAO,OAAO,MACd,CACE,gBAAiBA,EAAM,MAAM,KAC/B,EACA,CACE,KAAM,UACR,EAEJ,GAAIA,GAAO,OAAO,OAAO,KACrB,CACE,KAAMA,EAAM,MAAM,MAAM,IAC1B,EACA,CAAC,CACP,
|
|
6
|
-
"names": ["fieldIsHiddenOrDisabled", "fieldIsID", "filterFields", "incomingFields", "shouldSkipField", "field", "acc", "formattedField", "tab", "tabField", "fieldAffectsData", "getRemainingColumns", "fields", "useAsTitle", "remaining", "field", "tabFieldColumns", "tab", "getInitialColumns", "defaultColumns", "initialColumns", "remainingColumns", "column", "React", "RecursiveTranslation", "elements", "translationString", "regex", "sections", "section", "index", "elementKey", "Element", "children", "_", "group", "Translation", "i18nKey", "t", "variables", "stringWithVariables", "isReactServerComponentOrFunction", "serverProps", "React", "withMergedProps", "Component", "sanitizeServerOnlyProps", "toMergeIntoProps", "passedProps", "mergedProps", "simpleMergeProps", "prop", "props", "toMerge", "isReactServerComponentOrFunction", "React", "WithServerSideProps", "Component", "serverOnlyProps", "rest", "passedProps", "propsWithServerOnlyProps", "mergeFieldStyles", "field", "
|
|
4
|
+
"sourcesContent": ["import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disableListColumn` set to `true`\n * Does so recursively for `tabs` fields.\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 field?.admin?.disableListColumn === true\n\n const fields: T[] = incomingFields?.reduce((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // extract top-level `tabs` fields and filter out the same\n const formattedField: T =\n field.type === 'tabs' && 'tabs' in field\n ? {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: tab.fields.filter((tabField) => !shouldSkipField(tabField)),\n })),\n }\n : field\n\n acc.push(formattedField)\n\n return acc\n }, [])\n\n return fields\n}\n", "import type { ClientField, CollectionConfig, Field, ListPreferences } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): ListPreferences['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): ListPreferences['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", "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 = getMergedPropsComponent({\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 auto',\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(--theme-elevation-1000);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"43.5\"\n id=\"b\"\n viewBox=\"0 0 193.38 43.5\"\n width=\"193.38\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g id=\"c\">\n <path d=\"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z\" />\n <path d=\"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z\" />\n <g id=\"d\">\n <path d=\"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z\" />\n <path d=\"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z\" />\n <path d=\"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z\" />\n <path d=\"M113.46,35.77V6.1h5.32v29.67h-5.32Z\" />\n <path d=\"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z\" />\n <path d=\"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z\" />\n </g>\n </g>\n </svg>\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", "import type { Config } from 'payload'\n\n/** Will read the `routes.admin` config and appropriately handle `\"/\"` admin paths */\nexport const formatAdminURL = (args: {\n adminRoute: Config['routes']['admin']\n basePath?: string\n path: string\n serverURL?: Config['serverURL']\n}): string => {\n const { adminRoute, basePath = '', path, serverURL } = args\n\n if (adminRoute) {\n if (adminRoute === '/') {\n if (!path) {\n return `${serverURL || ''}${basePath}${adminRoute}`\n }\n } else {\n return `${serverURL || ''}${basePath}${adminRoute}${path}`\n }\n }\n\n return `${serverURL || ''}${basePath}${path}`\n}\n", "import type { I18n } from '@payloadcms/translations'\n\nimport { format, formatDistanceToNow } from 'date-fns'\n\ntype FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<any, any>\n pattern: string\n}\n\nexport const formatDate = ({ date, i18n, pattern }: FormatDateArgs): string => {\n const theDate = new Date(date)\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<any, any>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new 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 '../utilities/formatDate.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?: 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] || title\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\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n if (!title) {\n title = fallback || `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nexport enum EntityType {\n collection = 'collections',\n global = 'globals',\n}\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 // Skip entities where admin.group is explicitly false\n if (entityToGroup.entity?.admin?.group === false) {\n return groups\n }\n\n if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\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' ? labelOrFunction({ t: i18n.t }) : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\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 { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from './formatAdminURL.js'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: AppRouterInstance\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '/',\n })\n router.push(redirectRoute)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from './formatAdminURL.js'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: AppRouterInstance\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router }: 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 const handleTakeOver = (\n id: number | string,\n collectionSlug: string,\n globalSlug: string,\n user: ClientUser | number | string,\n isWithinDoc: boolean,\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>,\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void,\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>,\n isLockingEnabled: boolean,\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void,\n): void => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n void 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 } 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", "import type { ClientCollectionConfig, SanitizedCollectionConfig, Where } from 'payload'\n\nconst isEmptyObject = (obj: object) => Object.keys(obj).length === 0\n\nexport const hoistQueryParamsToAnd = (currentWhere: Where, incomingWhere: Where) => {\n if (isEmptyObject(incomingWhere)) {\n return currentWhere\n }\n\n if (isEmptyObject(currentWhere)) {\n return incomingWhere\n }\n\n if ('and' in currentWhere) {\n currentWhere.and.push(incomingWhere)\n } else if ('or' in currentWhere) {\n currentWhere = {\n and: [currentWhere, incomingWhere],\n }\n } else {\n currentWhere = {\n and: [currentWhere, incomingWhere],\n }\n }\n\n return currentWhere\n}\n\ntype Args = {\n collectionConfig: ClientCollectionConfig | SanitizedCollectionConfig\n search: string\n where?: Where\n}\n\nexport const mergeListSearchAndWhere = ({ collectionConfig, search, where = {} }: Args): Where => {\n if (search) {\n let copyOfWhere = { ...(where || {}) }\n\n const searchAsConditions = (\n collectionConfig.admin.listSearchableFields || [collectionConfig.admin?.useAsTitle || 'id']\n ).map((fieldName) => ({\n [fieldName]: {\n like: search,\n },\n }))\n\n if (searchAsConditions.length > 0) {\n copyOfWhere = hoistQueryParamsToAnd(copyOfWhere, {\n or: searchAsConditions,\n })\n }\n\n if (!isEmptyObject(copyOfWhere)) {\n where = copyOfWhere\n }\n }\n\n return where\n}\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"],
|
|
5
|
+
"mappings": "AAEA,OAAS,2BAAAA,EAAyB,aAAAC,MAAiB,iBAM5C,IAAMC,EAA+CC,GAA6B,CACvF,IAAMC,EAAmBC,GACtBA,EAAM,OAAS,MAAQL,EAAwBK,CAAK,GAAK,CAACJ,EAAUI,CAAK,GAC1EA,GAAO,OAAO,oBAAsB,GAwBtC,OAtBoBF,GAAgB,OAAO,CAACG,EAAKD,IAAU,CACzD,GAAID,EAAgBC,CAAK,EACvB,OAAOC,EAIT,IAAMC,EACJF,EAAM,OAAS,QAAU,SAAUA,EAC/B,CACE,GAAGA,EACH,KAAMA,EAAM,KAAK,IAAKG,IAAS,CAC7B,GAAGA,EACH,OAAQA,EAAI,OAAO,OAAQC,GAAa,CAACL,EAAgBK,CAAQ,CAAC,CACpE,EAAE,CACJ,EACAJ,EAEN,OAAAC,EAAI,KAAKC,CAAc,EAEhBD,CACT,EAAG,CAAC,CAAC,CAGP,EClCA,OAAS,oBAAAI,MAAwB,iBAEjC,IAAMC,EAAsB,CAC1BC,EACAC,IAEAD,GAAQ,OAAO,CAACE,EAAWC,IACrBL,EAAiBK,CAAK,GAAKA,EAAM,OAASF,EACrCC,EAGL,CAACJ,EAAiBK,CAAK,GAAK,WAAYA,EACnC,CAAC,GAAGD,EAAW,GAAGH,EAAoBI,EAAM,OAAQF,CAAU,CAAC,EAGpEE,EAAM,OAAS,QAAU,SAAUA,EAC9B,CACL,GAAGD,EACH,GAAGC,EAAM,KAAK,OACZ,CAACC,EAA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EAEEG,EAAmB,OAAS,IAC9BD,EAAcP,GAAsBO,EAAa,CAC/C,GAAIC,CACN,CAAC,GAGEV,EAAcS,CAAW,IAC5BD,EAAQC,EAEZ,CAEA,OAAOD,CACT,EC1DO,SAASI,GAAWC,EAAsC,CAK/D,OAJIA,IAAO,QAIP,OAAOA,GAAO,SACTA,EAGF,mBAAmBA,CAAE,CAC9B",
|
|
6
|
+
"names": ["fieldIsHiddenOrDisabled", "fieldIsID", "filterFields", "incomingFields", "shouldSkipField", "field", "acc", "formattedField", "tab", "tabField", "fieldAffectsData", "getRemainingColumns", "fields", "useAsTitle", "remaining", "field", "tabFieldColumns", "tab", "getInitialColumns", "defaultColumns", "initialColumns", "remainingColumns", "column", "React", "RecursiveTranslation", "elements", "translationString", "regex", "sections", "section", "index", "elementKey", "Element", "children", "_", "group", "Translation", "i18nKey", "t", "variables", "stringWithVariables", "isReactServerComponentOrFunction", "serverProps", "React", "withMergedProps", "Component", "sanitizeServerOnlyProps", "toMergeIntoProps", "passedProps", "mergedProps", "simpleMergeProps", "prop", "props", "toMerge", "isReactServerComponentOrFunction", "React", "WithServerSideProps", "Component", "serverOnlyProps", "rest", "passedProps", "propsWithServerOnlyProps", "mergeFieldStyles", "field", "blacklistedKeys", "sanitizeField", "incomingField", "field", "key", "reduceToSerializableFields", "fields", "result", "React", "PayloadIcon", "fillFromProps", "fill", "React", "css", "PayloadLogo", "abortAndIgnore", "abortController", "handleAbortRef", "abortControllerRef", "newController", "qs", "requests", "url", "options", "headers", "formattedOptions", "query", "findLocaleFromCode", "localizationConfig", "locale", "el", "formatAdminURL", "args", "adminRoute", "basePath", "path", "serverURL", "format", "formatDistanceToNow", "formatDate", "date", "i18n", "pattern", "theDate", "getTranslation", "formatDocTitle", "collectionConfig", "data", "dateFormatFromConfig", "fallback", "globalConfig", "i18n", "title", "useAsTitle", "fieldConfig", "f", "dateFormat", "formatDate", "getTranslation", "getTranslation", "EntityType", "groupNavItems", "entities", "permissions", "i18n", "groups", "entityToGroup", "translatedGroup", "labelOrFunction", "label", "existingGroup", "group", "matchedGroup", "handleBackToDashboard", "adminRoute", "router", "redirectRoute", "formatAdminURL", "handleGoBack", "adminRoute", "collectionSlug", "router", "redirectRoute", "formatAdminURL", "handleTakeOver", "id", "collectionSlug", "globalSlug", "user", "isWithinDoc", "updateDocumentEditor", "setCurrentEditor", "documentLockStateRef", "isLockingEnabled", "setIsReadOnlyForIncomingUser", "error", "hasSavePermission", "args", "collectionSlug", "docPermissions", "globalSlug", "isEditing", "isClientUserObject", "user", "isEditing", "id", "collectionSlug", "globalSlug", "isEmptyObject", "obj", "hoistQueryParamsToAnd", "currentWhere", "incomingWhere", "mergeListSearchAndWhere", "collectionConfig", "search", "where", "copyOfWhere", "searchAsConditions", "fieldName", "sanitizeID", "id"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRow.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/BlockRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAG/F,OAAO,
|
|
1
|
+
{"version":3,"file":"BlockRow.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/BlockRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAG/F,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAA;AAgBhH,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACrE,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACrD,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,yBAAyB,CAAA;IACtC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACtD,GAAG,0BAA0B,CAAA;AAE9B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0I/C,CAAA"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { getTranslation } from '@payloadcms/translations';
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { Fragment } from 'react';
|
|
7
7
|
import { Collapsible } from '../../elements/Collapsible/index.js';
|
|
8
8
|
import { ErrorPill } from '../../elements/ErrorPill/index.js';
|
|
9
9
|
import { Pill } from '../../elements/Pill/index.js';
|
|
@@ -16,7 +16,7 @@ import { RowActions } from './RowActions.js';
|
|
|
16
16
|
import { SectionTitle } from './SectionTitle/index.js';
|
|
17
17
|
const baseClass = 'blocks-field';
|
|
18
18
|
export const BlockRow = t0 => {
|
|
19
|
-
const $ = _c(
|
|
19
|
+
const $ = _c(38);
|
|
20
20
|
const {
|
|
21
21
|
addRow,
|
|
22
22
|
attributes,
|
|
@@ -76,50 +76,13 @@ export const BlockRow = t0 => {
|
|
|
76
76
|
let t4;
|
|
77
77
|
if ($[2] !== Label || $[3] !== addRow || $[4] !== attributes || $[5] !== block || $[6] !== blockPermissions || $[7] !== blocks || $[8] !== classNames || $[9] !== duplicateRow || $[10] !== errorCount || $[11] !== fieldHasErrors || $[12] !== fields || $[13] !== hasMaxRows || $[14] !== i18n || $[15] !== isLoading || $[16] !== isSortable || $[17] !== labels || $[18] !== listeners || $[19] !== moveRow || $[20] !== parentPath || $[21] !== path || $[22] !== readOnly || $[23] !== removeRow || $[24] !== row.blockType || $[25] !== row.collapsed || $[26] !== row.id || $[27] !== rowCount || $[28] !== rowIndex || $[29] !== schemaPath || $[30] !== setCollapse || $[31] !== setNodeRef || $[32] !== t3 || $[33] !== transform) {
|
|
78
78
|
let t5;
|
|
79
|
-
if ($[35] !==
|
|
80
|
-
t5 =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
className: `${baseClass}__block-header`,
|
|
85
|
-
children: [_jsx("span", {
|
|
86
|
-
className: `${baseClass}__block-number`,
|
|
87
|
-
children: String(rowIndex + 1).padStart(2, "0")
|
|
88
|
-
}), _jsx(Pill, {
|
|
89
|
-
className: `${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`,
|
|
90
|
-
pillStyle: "white",
|
|
91
|
-
children: getTranslation(block.labels.singular, i18n)
|
|
92
|
-
}), _jsx(SectionTitle, {
|
|
93
|
-
path: `${path}.blockName`,
|
|
94
|
-
readOnly
|
|
95
|
-
}), fieldHasErrors && _jsx(ErrorPill, {
|
|
96
|
-
count: errorCount,
|
|
97
|
-
i18n,
|
|
98
|
-
withMessage: true
|
|
99
|
-
})]
|
|
100
|
-
});
|
|
101
|
-
$[35] = Label;
|
|
102
|
-
$[36] = block;
|
|
103
|
-
$[37] = errorCount;
|
|
104
|
-
$[38] = fieldHasErrors;
|
|
105
|
-
$[39] = i18n;
|
|
106
|
-
$[40] = isLoading;
|
|
107
|
-
$[41] = path;
|
|
108
|
-
$[42] = readOnly;
|
|
109
|
-
$[43] = row.blockType;
|
|
110
|
-
$[44] = rowIndex;
|
|
111
|
-
$[45] = t5;
|
|
112
|
-
} else {
|
|
113
|
-
t5 = $[45];
|
|
114
|
-
}
|
|
115
|
-
let t6;
|
|
116
|
-
if ($[46] !== row.id || $[47] !== setCollapse) {
|
|
117
|
-
t6 = collapsed => setCollapse(row.id, collapsed);
|
|
118
|
-
$[46] = row.id;
|
|
119
|
-
$[47] = setCollapse;
|
|
120
|
-
$[48] = t6;
|
|
79
|
+
if ($[35] !== row.id || $[36] !== setCollapse) {
|
|
80
|
+
t5 = collapsed => setCollapse(row.id, collapsed);
|
|
81
|
+
$[35] = row.id;
|
|
82
|
+
$[36] = setCollapse;
|
|
83
|
+
$[37] = t5;
|
|
121
84
|
} else {
|
|
122
|
-
|
|
85
|
+
t5 = $[37];
|
|
123
86
|
}
|
|
124
87
|
t4 = _jsx("div", {
|
|
125
88
|
id: t3,
|
|
@@ -149,9 +112,31 @@ export const BlockRow = t0 => {
|
|
|
149
112
|
attributes,
|
|
150
113
|
listeners
|
|
151
114
|
} : undefined,
|
|
152
|
-
header:
|
|
115
|
+
header: isLoading ? _jsx(ShimmerEffect, {
|
|
116
|
+
height: "1rem",
|
|
117
|
+
width: "8rem"
|
|
118
|
+
}) : _jsx("div", {
|
|
119
|
+
className: `${baseClass}__block-header`,
|
|
120
|
+
children: Label || _jsxs(Fragment, {
|
|
121
|
+
children: [_jsx("span", {
|
|
122
|
+
className: `${baseClass}__block-number`,
|
|
123
|
+
children: String(rowIndex + 1).padStart(2, "0")
|
|
124
|
+
}), _jsx(Pill, {
|
|
125
|
+
className: `${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`,
|
|
126
|
+
pillStyle: "white",
|
|
127
|
+
children: getTranslation(block.labels.singular, i18n)
|
|
128
|
+
}), _jsx(SectionTitle, {
|
|
129
|
+
path: `${path}.blockName`,
|
|
130
|
+
readOnly
|
|
131
|
+
}), fieldHasErrors && _jsx(ErrorPill, {
|
|
132
|
+
count: errorCount,
|
|
133
|
+
i18n,
|
|
134
|
+
withMessage: true
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
153
138
|
isCollapsed: row.collapsed,
|
|
154
|
-
onToggle:
|
|
139
|
+
onToggle: t5,
|
|
155
140
|
children: isLoading ? _jsx(ShimmerEffect, {}) : _jsx(RenderFields, {
|
|
156
141
|
className: `${baseClass}__fields`,
|
|
157
142
|
fields,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRow.js","names":["c","_c","getTranslation","React","Collapsible","ErrorPill","Pill","ShimmerEffect","useFormSubmitted","RenderFields","useThrottledValue","useTranslation","RowActions","SectionTitle","baseClass","BlockRow","t0","$","addRow","attributes","block","blocks","duplicateRow","errorCount","fields","hasMaxRows","isLoading","isLoadingFromProps","isSortable","Label","labels","listeners","moveRow","parentPath","path","permissions","readOnly","removeRow","row","rowCount","rowIndex","schemaPath","setCollapse","setNodeRef","transform","i18n","hasSubmitted","fieldHasErrors","t1","t2","filter","Boolean","classNames","join","blockPermissions","permissionsBlockSpecific","slug","t3","split","t4","blockType","collapsed","id","t5","_jsx","height","width","_jsxs","className","children","String","padStart","pillStyle","singular","count","withMessage","t6","ref","style","actions","collapsibleStyle","dragHandleProps","undefined","header","onToggle","margins","parentIndexPath","parentSchemaPath"],"sources":["../../../src/fields/Blocks/BlockRow.tsx"],"sourcesContent":["'use client'\nimport type { ClientBlock, ClientField, Labels, Row, SanitizedFieldPermissions } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js'\nimport type { RenderFieldsProps } from '../../forms/RenderFields/types.js'\n\nimport { Collapsible } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { Pill } from '../../elements/Pill/index.js'\nimport { ShimmerEffect } from '../../elements/ShimmerEffect/index.js'\nimport { useFormSubmitted } from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { useThrottledValue } from '../../hooks/useThrottledValue.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { RowActions } from './RowActions.js'\nimport { SectionTitle } from './SectionTitle/index.js'\n\nconst baseClass = 'blocks-field'\n\ntype BlocksFieldProps = {\n addRow: (rowIndex: number, blockType: string) => Promise<void> | void\n block: ClientBlock\n blocks: ClientBlock[]\n duplicateRow: (rowIndex: number) => void\n errorCount: number\n fields: ClientField[]\n hasMaxRows?: boolean\n isLoading?: boolean\n isSortable?: boolean\n Label?: React.ReactNode\n labels: Labels\n moveRow: (fromIndex: number, toIndex: number) => void\n parentPath: string\n path: string\n permissions: SanitizedFieldPermissions\n readOnly: boolean\n removeRow: (rowIndex: number) => void\n row: Row\n rowCount: number\n rowIndex: number\n schemaPath: string\n setCollapse: (id: string, collapsed: boolean) => void\n} & UseDraggableSortableReturn\n\nexport const BlockRow: React.FC<BlocksFieldProps> = ({\n addRow,\n attributes,\n block,\n blocks,\n duplicateRow,\n errorCount,\n fields,\n hasMaxRows,\n isLoading: isLoadingFromProps,\n isSortable,\n Label,\n labels,\n listeners,\n moveRow,\n parentPath,\n path,\n permissions,\n readOnly,\n removeRow,\n row,\n rowCount,\n rowIndex,\n schemaPath,\n setCollapse,\n setNodeRef,\n transform,\n}) => {\n const isLoading = useThrottledValue(isLoadingFromProps, 500)\n\n const { i18n } = useTranslation()\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n let blockPermissions: RenderFieldsProps['permissions'] = undefined\n\n if (permissions === true) {\n blockPermissions = true\n } else {\n const permissionsBlockSpecific = permissions?.blocks?.[block.slug]\n if (permissionsBlockSpecific === true) {\n blockPermissions = true\n } else {\n blockPermissions = permissionsBlockSpecific?.fields\n }\n }\n\n return (\n <div\n id={`${parentPath?.split('.').join('-')}-row-${rowIndex}`}\n key={`${parentPath}-row-${rowIndex}`}\n ref={setNodeRef}\n style={{\n transform,\n }}\n >\n <Collapsible\n actions={\n !readOnly ? (\n <RowActions\n addRow={addRow}\n blocks={blocks}\n blockType={row.blockType}\n duplicateRow={duplicateRow}\n fields={block.fields}\n hasMaxRows={hasMaxRows}\n isSortable={isSortable}\n labels={labels}\n moveRow={moveRow}\n removeRow={removeRow}\n rowCount={rowCount}\n rowIndex={rowIndex}\n />\n ) : undefined\n }\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n dragHandleProps={\n isSortable\n ? {\n id: row.id,\n attributes,\n listeners,\n }\n : undefined\n }\n header={\n isLoading ? (\n <ShimmerEffect height=\"1rem\" width=\"8rem\" />\n ) : (\n Label || (\n <div className={`${baseClass}__block-header`}>\n <span className={`${baseClass}__block-number`}>\n {String(rowIndex + 1).padStart(2, '0')}\n </span>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`}\n pillStyle=\"white\"\n >\n {getTranslation(block.labels.singular, i18n)}\n </Pill>\n <SectionTitle path={`${path}.blockName`} readOnly={readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n )\n )\n }\n isCollapsed={row.collapsed}\n key={row.id}\n onToggle={(collapsed) => setCollapse(row.id, collapsed)}\n >\n {isLoading ? (\n <ShimmerEffect />\n ) : (\n <RenderFields\n className={`${baseClass}__fields`}\n fields={fields}\n margins=\"small\"\n parentIndexPath=\"\"\n parentPath={path}\n parentSchemaPath={schemaPath}\n permissions={blockPermissions}\n readOnly={readOnly}\n />\n )}\n </Collapsible>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAKlB,SAASC,WAAW,QAAQ;AAC5B,SAASC,SAAS,QAAQ;AAC1B,SAASC,IAAI,QAAQ;AACrB,SAASC,aAAa,QAAQ;AAC9B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,YAAY,QAAQ;AAC7B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,cAAc,QAAQ;AAC/B,SAASC,UAAU,QAAQ;AAC3B,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AA2BlB,OAAO,MAAMC,QAAA,GAAuCC,EAAA;EAAA,MAAAC,CAAA,GAAAhB,EAAA;EAAC;IAAAiB,MAAA;IAAAC,UAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,YAAA;IAAAC,UAAA;IAAAC,MAAA;IAAAC,UAAA;IAAAC,SAAA,EAAAC,kBAAA;IAAAC,UAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,SAAA;IAAAC,OAAA;IAAAC,UAAA;IAAAC,IAAA;IAAAC,WAAA;IAAAC,QAAA;IAAAC,SAAA;IAAAC,GAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,WAAA;IAAAC,UAAA;IAAAC;EAAA,IAAA5B,EA2BpD;EACC,MAAAU,SAAA,GAAkBhB,iBAAA,CAAkBiB,kBAAA,KAAoB;EAExD;IAAAkB;EAAA,IAAiBlC,cAAA;EACjB,MAAAmC,YAAA,GAAqBtC,gBAAA;EAErB,MAAAuC,cAAA,GAAuBD,YAAA,IAAgBvB,UAAA,IAAa;EAIlD,MAAAyB,E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CAAA,OAAAuB,QAAA;IAAAvB,CAAA,OAAAwB,UAAA;IAAAxB,CAAA,OAAAyB,WAAA;IAAAzB,CAAA,OAAA0B,UAAA;IAAA1B,CAAA,OAAAwC,EAAA;IAAAxC,CAAA,OAAA2B,SAAA;IAAA3B,CAAA,OAAA0C,EAAA;EAAA;IAAAA,EAAA,GAAA1C,CAAA;EAAA;EAAA,OAFtC0C,EAEsC;AAAA,CA8E1C","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BlockRow.js","names":["c","_c","getTranslation","React","Fragment","Collapsible","ErrorPill","Pill","ShimmerEffect","useFormSubmitted","RenderFields","useThrottledValue","useTranslation","RowActions","SectionTitle","baseClass","BlockRow","t0","$","addRow","attributes","block","blocks","duplicateRow","errorCount","fields","hasMaxRows","isLoading","isLoadingFromProps","isSortable","Label","labels","listeners","moveRow","parentPath","path","permissions","readOnly","removeRow","row","rowCount","rowIndex","schemaPath","setCollapse","setNodeRef","transform","i18n","hasSubmitted","fieldHasErrors","t1","t2","filter","Boolean","classNames","join","blockPermissions","permissionsBlockSpecific","slug","t3","split","t4","blockType","collapsed","id","t5","_jsx","ref","style","children","actions","className","collapsibleStyle","dragHandleProps","undefined","header","height","width","_jsxs","String","padStart","pillStyle","singular","count","withMessage","onToggle","margins","parentIndexPath","parentSchemaPath"],"sources":["../../../src/fields/Blocks/BlockRow.tsx"],"sourcesContent":["'use client'\nimport type { ClientBlock, ClientField, Labels, Row, SanitizedFieldPermissions } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { Fragment } from 'react'\n\nimport type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js'\nimport type { RenderFieldsProps } from '../../forms/RenderFields/types.js'\n\nimport { Collapsible } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { Pill } from '../../elements/Pill/index.js'\nimport { ShimmerEffect } from '../../elements/ShimmerEffect/index.js'\nimport { useFormSubmitted } from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { useThrottledValue } from '../../hooks/useThrottledValue.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { RowActions } from './RowActions.js'\nimport { SectionTitle } from './SectionTitle/index.js'\n\nconst baseClass = 'blocks-field'\n\ntype BlocksFieldProps = {\n addRow: (rowIndex: number, blockType: string) => Promise<void> | void\n block: ClientBlock\n blocks: ClientBlock[]\n duplicateRow: (rowIndex: number) => void\n errorCount: number\n fields: ClientField[]\n hasMaxRows?: boolean\n isLoading?: boolean\n isSortable?: boolean\n Label?: React.ReactNode\n labels: Labels\n moveRow: (fromIndex: number, toIndex: number) => void\n parentPath: string\n path: string\n permissions: SanitizedFieldPermissions\n readOnly: boolean\n removeRow: (rowIndex: number) => void\n row: Row\n rowCount: number\n rowIndex: number\n schemaPath: string\n setCollapse: (id: string, collapsed: boolean) => void\n} & UseDraggableSortableReturn\n\nexport const BlockRow: React.FC<BlocksFieldProps> = ({\n addRow,\n attributes,\n block,\n blocks,\n duplicateRow,\n errorCount,\n fields,\n hasMaxRows,\n isLoading: isLoadingFromProps,\n isSortable,\n Label,\n labels,\n listeners,\n moveRow,\n parentPath,\n path,\n permissions,\n readOnly,\n removeRow,\n row,\n rowCount,\n rowIndex,\n schemaPath,\n setCollapse,\n setNodeRef,\n transform,\n}) => {\n const isLoading = useThrottledValue(isLoadingFromProps, 500)\n\n const { i18n } = useTranslation()\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n let blockPermissions: RenderFieldsProps['permissions'] = undefined\n\n if (permissions === true) {\n blockPermissions = true\n } else {\n const permissionsBlockSpecific = permissions?.blocks?.[block.slug]\n if (permissionsBlockSpecific === true) {\n blockPermissions = true\n } else {\n blockPermissions = permissionsBlockSpecific?.fields\n }\n }\n\n return (\n <div\n id={`${parentPath?.split('.').join('-')}-row-${rowIndex}`}\n key={`${parentPath}-row-${rowIndex}`}\n ref={setNodeRef}\n style={{\n transform,\n }}\n >\n <Collapsible\n actions={\n !readOnly ? (\n <RowActions\n addRow={addRow}\n blocks={blocks}\n blockType={row.blockType}\n duplicateRow={duplicateRow}\n fields={block.fields}\n hasMaxRows={hasMaxRows}\n isSortable={isSortable}\n labels={labels}\n moveRow={moveRow}\n removeRow={removeRow}\n rowCount={rowCount}\n rowIndex={rowIndex}\n />\n ) : undefined\n }\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n dragHandleProps={\n isSortable\n ? {\n id: row.id,\n attributes,\n listeners,\n }\n : undefined\n }\n header={\n isLoading ? (\n <ShimmerEffect height=\"1rem\" width=\"8rem\" />\n ) : (\n <div className={`${baseClass}__block-header`}>\n {Label || (\n <Fragment>\n <span className={`${baseClass}__block-number`}>\n {String(rowIndex + 1).padStart(2, '0')}\n </span>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`}\n pillStyle=\"white\"\n >\n {getTranslation(block.labels.singular, i18n)}\n </Pill>\n <SectionTitle path={`${path}.blockName`} readOnly={readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </Fragment>\n )}\n </div>\n )\n }\n isCollapsed={row.collapsed}\n key={row.id}\n onToggle={(collapsed) => setCollapse(row.id, collapsed)}\n >\n {isLoading ? (\n <ShimmerEffect />\n ) : (\n <RenderFields\n className={`${baseClass}__fields`}\n fields={fields}\n margins=\"small\"\n parentIndexPath=\"\"\n parentPath={path}\n parentSchemaPath={schemaPath}\n permissions={blockPermissions}\n readOnly={readOnly}\n />\n )}\n </Collapsible>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,QAAQ,QAAQ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,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAE,UAAA;IAAAF,CAAA,MAAAG,KAAA;IAAAH,CAAA,MAAAqC,gBAAA;IAAArC,CAAA,MAAAI,MAAA;IAAAJ,CAAA,MAAAmC,UAAA;IAAAnC,CAAA,MAAAK,YAAA;IAAAL,CAAA,OAAAM,UAAA;IAAAN,CAAA,OAAA8B,cAAA;IAAA9B,CAAA,OAAAO,MAAA;IAAAP,CAAA,OAAAQ,UAAA;IAAAR,CAAA,OAAA4B,IAAA;IAAA5B,CAAA,OAAAS,SAAA;IAAAT,CAAA,OAAAW,UAAA;IAAAX,CAAA,OAAAa,MAAA;IAAAb,CAAA,OAAAc,SAAA;IAAAd,CAAA,OAAAe,OAAA;IAAAf,CAAA,OAAAgB,UAAA;IAAAhB,CAAA,OAAAiB,IAAA;IAAAjB,CAAA,OAAAmB,QAAA;IAAAnB,CAAA,OAAAoB,SAAA;IAAApB,CAAA,OAAAqB,GAAA,CAAAsB,SAAA;IAAA3C,CAAA,OAAAqB,GAAA,CAAAuB,SAAA;IAAA5C,CAAA,OAAAqB,GAAA,CAAAwB,EAAA;IAAA7C,CAAA,OAAAsB,QAAA;IAAAtB,CAAA,OAAAuB,QAAA;IAAAvB,CAAA,OAAAwB,UAAA;IAAAxB,CAAA,OAAAyB,WAAA;IAAAzB,CAAA,OAAA0B,UAAA;IAAA1B,CAAA,OAAAwC,EAAA;IAAAxC,CAAA,OAAA2B,SAAA;IAAA3B,CAAA,OAAA0C,EAAA;EAAA;IAAAA,EAAA,GAAA1C,CAAA;EAAA;EAAA,OAFtC0C,EAEsC;AAAA,CAgF1C","ignoreList":[]}
|
|
@@ -164,7 +164,8 @@ const BlocksFieldComponent = props => {
|
|
|
164
164
|
BeforeInput,
|
|
165
165
|
Description,
|
|
166
166
|
Error,
|
|
167
|
-
Label
|
|
167
|
+
Label,
|
|
168
|
+
RowLabels
|
|
168
169
|
} = t10;
|
|
169
170
|
let t11;
|
|
170
171
|
if ($[13] !== t9) {
|
|
@@ -438,7 +439,7 @@ const BlocksFieldComponent = props => {
|
|
|
438
439
|
hasMaxRows,
|
|
439
440
|
isLoading,
|
|
440
441
|
isSortable,
|
|
441
|
-
Label,
|
|
442
|
+
Label: RowLabels?.[i],
|
|
442
443
|
labels,
|
|
443
444
|
moveRow,
|
|
444
445
|
parentPath: path,
|