@payloadcms/richtext-lexical 3.0.0-beta.119 → 3.0.0-beta.120

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.
Files changed (57) hide show
  1. package/dist/exports/client/RelationshipComponent-LBWKOBGF.js +2 -0
  2. package/dist/exports/client/RelationshipComponent-LBWKOBGF.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-5PBXL4HT.js +2 -0
  5. package/dist/exports/client/chunk-5PBXL4HT.js.map +7 -0
  6. package/dist/exports/client/chunk-7SR2HYD6.js +2 -0
  7. package/dist/exports/client/chunk-7SR2HYD6.js.map +7 -0
  8. package/dist/exports/client/{chunk-QZNJUROL.js → chunk-XY4TCSM7.js} +2 -2
  9. package/dist/exports/client/component-4TP4L5EV.js +2 -0
  10. package/dist/exports/client/component-4TP4L5EV.js.map +7 -0
  11. package/dist/exports/client/index.js +7 -7
  12. package/dist/exports/client/index.js.map +4 -4
  13. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  14. package/dist/features/blocks/client/plugin/index.js +32 -37
  15. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  16. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  17. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +27 -32
  18. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  19. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  20. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -9
  21. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  22. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  23. package/dist/features/relationship/client/components/RelationshipComponent.js +10 -7
  24. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  25. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  26. package/dist/features/relationship/client/drawer/index.js +24 -23
  27. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  28. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  29. package/dist/features/upload/client/component/index.js +30 -28
  30. package/dist/features/upload/client/component/index.js.map +1 -1
  31. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  32. package/dist/features/upload/client/drawer/index.js +32 -32
  33. package/dist/features/upload/client/drawer/index.js.map +1 -1
  34. package/dist/field/bundled.css +1 -1
  35. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  36. package/dist/utilities/fieldsDrawer/Drawer.js +63 -27
  37. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  38. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +13 -0
  39. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -0
  40. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +129 -0
  41. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -0
  42. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts +10 -0
  43. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -0
  44. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +136 -0
  45. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -0
  46. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts +16 -0
  47. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -0
  48. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +144 -0
  49. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -0
  50. package/package.json +7 -7
  51. package/dist/exports/client/RelationshipComponent-FTWR5YDX.js +0 -2
  52. package/dist/exports/client/RelationshipComponent-FTWR5YDX.js.map +0 -7
  53. package/dist/exports/client/chunk-WAMTSCVM.js +0 -2
  54. package/dist/exports/client/chunk-WAMTSCVM.js.map +0 -7
  55. package/dist/exports/client/component-6PBZ2U3Z.js +0 -2
  56. package/dist/exports/client/component-6PBZ2U3Z.js.map +0 -7
  57. /package/dist/exports/client/{chunk-QZNJUROL.js.map → chunk-XY4TCSM7.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{c as j}from"react/compiler-runtime";import{jsx as L}from"react/jsx-runtime";import{useLexicalComposerContext as M}from"@lexical/react/LexicalComposerContext";import{useDocumentDrawer as _,useModal as b}from"@payloadcms/ui";import{$getPreviousSelection as h,$getSelection as v,$setSelection as E}from"lexical";import{useEffect as P,useState as T}from"react";var G=$=>{let e=j(21),[o]=M(),[l,k]=T(null),[c,C]=T(!1),[S,w,O]=_($),{closeDrawer:d,drawerSlug:t}=O,{modalState:n}=b(),i;e[0]!==o?(i=()=>{o.read(()=>{let r=v()??h();k(r)}),C(!0)},e[0]=o,e[1]=i):i=e[1];let g=i,a;e[2]!==l||e[3]!==o?(a=()=>{l&&o.update(()=>{E(l.clone())},{discrete:!0,skipTransforms:!0})},e[2]=l,e[3]=o,e[4]=a):a=e[4];let u=a,m;e[5]!==d?(m=()=>{d()},e[5]=d,e[6]=m):m=e[6];let x=m,f,D;e[7]!==c||e[8]!==n||e[9]!==t||e[10]!==u?(f=()=>{if(!c)return;let r=n[t];r&&!r?.isOpen&&(C(!1),setTimeout(()=>{u()},1))},D=[n,t,u,c],e[7]=c,e[8]=n,e[9]=t,e[10]=u,e[11]=f,e[12]=D):(f=e[11],D=e[12]),P(f,D);let s;e[13]!==w||e[14]!==g?(s=r=>L(w,{...r,onClick:g}),e[13]=w,e[14]=g,e[15]=s):s=e[15];let p;return e[16]!==x||e[17]!==S||e[18]!==t||e[19]!==s?(p={closeDocumentDrawer:x,DocumentDrawer:S,documentDrawerSlug:t,DocumentDrawerToggler:s},e[16]=x,e[17]=S,e[18]=t,e[19]=s,e[20]=p):p=e[20],p};export{G as a};
2
+ //# sourceMappingURL=chunk-5PBXL4HT.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utilities/fieldsDrawer/useLexicalDocumentDrawer.tsx"],
4
+ "sourcesContent": ["'use client'\nimport type { UseDocumentDrawer } from '@payloadcms/ui'\nimport type { BaseSelection } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useDocumentDrawer, useModal } from '@payloadcms/ui'\nimport { $getPreviousSelection, $getSelection, $setSelection } from 'lexical'\nimport { useCallback, useEffect, useState } from 'react'\n\n/**\n *\n * Wrapper around useDocumentDrawer that restores and saves selection state (cursor position) when opening and closing the drawer.\n * By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.\n */\nexport const useLexicalDocumentDrawer = (\n args: Parameters<UseDocumentDrawer>[0],\n): {\n closeDocumentDrawer: () => void\n DocumentDrawer: ReturnType<UseDocumentDrawer>[0]\n documentDrawerSlug: string\n DocumentDrawerToggler: ReturnType<UseDocumentDrawer>[1]\n} => {\n const [editor] = useLexicalComposerContext()\n const [selectionState, setSelectionState] = useState<BaseSelection | null>(null)\n const [wasOpen, setWasOpen] = useState<boolean>(false)\n\n const [\n DocumentDrawer,\n DocumentDrawerToggler,\n { closeDrawer: closeDrawer, drawerSlug: documentDrawerSlug },\n ] = useDocumentDrawer(args)\n const { modalState } = useModal()\n\n const storeSelection = useCallback(() => {\n editor.read(() => {\n const selection = $getSelection() ?? $getPreviousSelection()\n setSelectionState(selection)\n })\n setWasOpen(true)\n }, [editor])\n\n const restoreSelection = useCallback(() => {\n if (selectionState) {\n editor.update(\n () => {\n $setSelection(selectionState.clone())\n },\n { discrete: true, skipTransforms: true },\n )\n }\n }, [editor, selectionState])\n\n const closeDocumentDrawer = () => {\n //restoreSelection() // Should already be stored by the useEffect below\n closeDrawer()\n }\n\n // We need to handle drawer closing via a useEffect, as toggleDrawer / closeDrawer will not be triggered if the drawer\n // is closed by clicking outside of the drawer. This useEffect will handle everything.\n useEffect(() => {\n if (!wasOpen) {\n return\n }\n\n const thisModalState = modalState[documentDrawerSlug]\n // Exists in modalState (thus has opened at least once before) and is closed\n if (thisModalState && !thisModalState?.isOpen) {\n setWasOpen(false)\n setTimeout(() => {\n restoreSelection()\n }, 1)\n }\n }, [modalState, documentDrawerSlug, restoreSelection, wasOpen])\n\n return {\n closeDocumentDrawer,\n DocumentDrawer,\n documentDrawerSlug,\n DocumentDrawerToggler: (props) => <DocumentDrawerToggler {...props} onClick={storeSelection} />,\n }\n}\n"],
5
+ "mappings": "AAAA,OAAAA,KAAAC,MAAA,iEAIA,OAASC,6BAAAA,MAAiC,wCAC1C,OAASC,qBAAAA,EAAmBC,YAAAA,MAAgB,iBAC5C,OAASC,yBAAAA,EAAuBC,iBAAAA,EAAeC,iBAAAA,MAAqB,UACpE,OAAsBC,aAAAA,EAAWC,YAAAA,MAAgB,QAO1C,IAAMC,EAA2BC,GAAA,CAAA,IAAAC,EAAAX,EAAA,EAAA,EAQtC,CAAAY,CAAA,EAAiBX,EAAA,EACjB,CAAAY,EAAAC,CAAA,EAA4CN,EAAA,IAA+B,EAC3E,CAAAO,EAAAC,CAAA,EAA8BR,EAAA,EAAkB,EAEhD,CAAAS,EAAAC,EAAAC,CAAA,EAIIjB,EAAkBQ,CAAA,EADpB,CAAAU,YAAAA,EAAAC,WAAAC,CAAA,EAAAH,EAEF,CAAAI,WAAAA,CAAA,EAAuBpB,EAAA,EAAAqB,EAAAb,EAAA,CAAA,IAAAC,GAEYY,EAAAA,IAAA,CACjCZ,EAAAa,KAAA,IAAA,CACE,IAAAC,EAAkBrB,EAAA,GAAmBD,EAAA,EACrCU,EAAkBY,CAAA,CAAA,CACpB,EACAV,EAAA,EAAW,CAAA,EACbL,EAAA,CAAA,EAAAC,EAAAD,EAAA,CAAA,EAAAa,GAAAA,EAAAb,EAAA,CAAA,EANA,IAAAgB,EAAuBH,EAMZI,EAAAjB,EAAA,CAAA,IAAAE,GAAAF,EAAA,CAAA,IAAAC,GAE0BgB,EAAAA,IAAA,CAC/Bf,GACFD,EAAAiB,OAAA,IA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,mBAAAA,EAAAJ,sBAIkBuB,GACzB9B,EAAA,EAAA,EAAAwB,EAAAxB,EAAA,EAAA,EAAAM,EAAAN,EAAA,EAAA,EAAAW,EAAAX,EAAA,EAAA,EAAA8B,EAAA9B,EAAA,EAAA,EAAAkC,GAAAA,EAAAlC,EAAA,EAAA,EALOkC,CAKP",
6
+ "names": ["c", "_c", "useLexicalComposerContext", "useDocumentDrawer", "useModal", "$getPreviousSelection", "$getSelection", "$setSelection", "useEffect", "useState", "useLexicalDocumentDrawer", "args", "$", "editor", "selectionState", "setSelectionState", "wasOpen", "setWasOpen", "DocumentDrawer", "DocumentDrawerToggler", "t0", "closeDrawer", "drawerSlug", "documentDrawerSlug", "modalState", "t1", "read", "selection", "storeSelection", "t2", "update", "clone", "discrete", "skipTransforms", "restoreSelection", "t3", "closeDocumentDrawer", "t4", "t5", "thisModalState", "isOpen", "setTimeout", "t6", "props", "_jsx", "onClick", "t7"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{b as T}from"./chunk-GD6LBQBJ.js";import{c as et}from"react/compiler-runtime";import{jsx as P}from"react/jsx-runtime";import{Drawer as rt,useModal as ot}from"@payloadcms/ui";import"react";import{c as K}from"react/compiler-runtime";import{jsx as U,jsxs as B}from"react/jsx-runtime";import{Form as G,FormSubmit as V,RenderFields as q,useConfig as Q,useDocumentInfo as X,useFieldProps as Y,useTranslation as Z}from"@payloadcms/ui";import{getFormState as E}from"@payloadcms/ui/shared";import{useEffect as N,useState as z}from"react";import{v4 as tt}from"uuid";var I=r=>{let t=K(27),{data:e,featureKey:o,fieldMapOverride:n,handleDrawerSubmit:S,schemaFieldsPathOverride:x,schemaPathSuffix:c}=r,{t:u}=Z(),{id:i}=X(),{schemaPath:f}=Y(),{config:a}=Q(),[l,s]=z(!1),{field:h}=T(),{richTextComponentMap:p}=h,v=`lexical_internal_feature.${o}.fields${c?`.${c}`:""}`,m=x??`${f}.lexical_internal_feature.${o}${c?`.${c}`:""}`,_;t[0]!==n||t[1]!==p||t[2]!==v?(_=n??p?.get(v),t[0]=n,t[1]=p,t[2]=v,t[3]=_):_=t[3];let d=_,g,b;t[4]!==a.routes.api||t[5]!==a.serverURL||t[6]!==i||t[7]!==e||t[8]!==m?(g=()=>{(async()=>{let{state:y}=await E({apiRoute:a.routes.api,body:{id:i,data:e??{},operation:"update",schemaPath:m},serverURL:a.serverURL});s(y)})()},b=[a.routes.api,a.serverURL,m,i,e],t[4]=a.routes.api,t[5]=a.serverURL,t[6]=i,t[7]=e,t[8]=m,t[9]=g,t[10]=b):(g=t[9],b=t[10]),N(g,b);let R;t[11]!==a.routes.api||t[12]!==a.serverURL||t[13]!==i||t[14]!==m?(R=async w=>{let{formState:y}=w,{state:J}=await E({apiRoute:a.routes.api,body:{id:i,formState:y,operation:"update",schemaPath:m},serverURL:a.serverURL});return J},t[11]=a.routes.api,t[12]=a.serverURL,t[13]=i,t[14]=m,t[15]=R):R=t[15];let D=R;if(l===!1)return null;let C;if(t[16]!==D||t[17]!==d||t[18]!==m||t[19]!==u||t[20]!==l||t[21]!==S){let w;t[23]!==d?(w=Array.isArray(d)?d:[],t[23]=d,t[24]=w):w=t[24];let y;t[25]!==d?(y=Array.isArray(d)?d:[],t[25]=d,t[26]=y):y=t[26],C=B(G,{beforeSubmit:[D],disableValidationOnSubmit:!0,fields:w,initialState:l,onChange:[D],onSubmit:S,uuid:tt(),children:[U(q,{fields:y,forceRender:!0,path:"",readOnly:!1,schemaPath:m}),U(V,{children:u("fields:saveChanges")})]}),t[16]=D,t[17]=d,t[18]=m,t[19]=u,t[20]=l,t[21]=S,t[22]=C}else C=t[22];return C};var Ht=r=>{let t=et(14),{className:e,data:o,drawerSlug:n,drawerTitle:S,featureKey:x,fieldMapOverride:c,handleDrawerSubmit:u,schemaFieldsPathOverride:i,schemaPathSuffix:f}=r,{closeModal:a}=ot(),l=S??"",s;t[0]!==a||t[1]!==n||t[2]!==u?(s=(p,v)=>{a(n),setTimeout(()=>{u(p,v)},1)},t[0]=a,t[1]=n,t[2]=u,t[3]=s):s=t[3];let h;return t[4]!==o||t[5]!==x||t[6]!==c||t[7]!==s||t[8]!==i||t[9]!==f||t[10]!==e||t[11]!==n||t[12]!==l?(h=P(rt,{className:e,slug:n,title:l,children:P(I,{data:o,featureKey:x,fieldMapOverride:c,handleDrawerSubmit:s,schemaFieldsPathOverride:i,schemaPathSuffix:f})}),t[4]=o,t[5]=x,t[6]=c,t[7]=s,t[8]=i,t[9]=f,t[10]=e,t[11]=n,t[12]=l,t[13]=h):h=t[13],h};import{c as at}from"react/compiler-runtime";import{useLexicalComposerContext as nt}from"@lexical/react/LexicalComposerContext";import{useModal as it}from"@payloadcms/ui";import{$getPreviousSelection as st,$getSelection as lt,$setSelection as ct}from"lexical";import{useEffect as ut,useState as F}from"react";var Xt=(r,t)=>{let e=at(24),[o]=nt(),[n,S]=F(null),[x,c]=F(!1),{closeModal:u,isModalOpen:i,modalState:f,toggleModal:a}=it(),l;e[0]!==o?(l=()=>{o.read(()=>{let D=lt()??st();S(D)})},e[0]=o,e[1]=l):l=e[1];let s=l,h;e[2]!==n||e[3]!==o?(h=()=>{n&&o.update(()=>{ct(n.clone())},{discrete:!0,skipTransforms:!0})},e[2]=n,e[3]=o,e[4]=h):h=e[4];let p=h,v;e[5]!==u||e[6]!==r?(v=()=>{u(r)},e[5]=u,e[6]=r,e[7]=v):v=e[7];let m=v,_;e[8]!==i||e[9]!==r||e[10]!==s||e[11]!==p||e[12]!==a?(_=()=>{i(r)?p():s(),c(!0),a(r)},e[8]=i,e[9]=r,e[10]=s,e[11]=p,e[12]=a,e[13]=_):_=e[13];let d=_,g,b;e[14]!==x||e[15]!==f||e[16]!==r||e[17]!==t||e[18]!==p?(g=()=>{if(!x)return;let D=f[r];D&&!D?.isOpen&&(c(!1),t?setTimeout(()=>{p()},1):p())},b=[f,r,p,x,t],e[14]=x,e[15]=f,e[16]=r,e[17]=t,e[18]=p,e[19]=g,e[20]=b):(g=e[19],b=e[20]),ut(g,b);let R;return e[21]!==m||e[22]!==d?(R={closeDrawer:m,toggleDrawer:d},e[21]=m,e[22]=d,e[23]=R):R=e[23],R};import{c as ft}from"react/compiler-runtime";import{useAuth as pt,useConfig as mt,useEntityVisibility as dt}from"@payloadcms/ui";import*as A from"react";var ht=(r,t)=>r.filter(({slug:e,admin:{enableRichTextRelationship:o},upload:n})=>t?.visibleEntities.collections.includes(e)?t?.uploads?o&&!!n:n?!1:o:!1),zt=r=>{let t=ft(16),e,o,n;t[0]!==r?({children:n,uploads:e,...o}=r,t[0]=r,t[1]=e,t[2]=o,t[3]=n):(e=t[1],o=t[2],n=t[3]);let S=e===void 0?!1:e,{config:x}=mt(),{collections:c}=x,{user:u}=pt(),{visibleEntities:i}=dt(),f;t[4]!==c||t[5]!==S||t[6]!==u||t[7]!==i?(f=()=>ht(c,{uploads:S,user:u,visibleEntities:i}).map(s=>{let{slug:h}=s;return h}),t[4]=c,t[5]=S,t[6]=u,t[7]=i,t[8]=f):f=t[8];let[a]=A.useState(f);if(!a.length)return null;let l;if(t[9]!==o||t[10]!==a||t[11]!==n){let s;t[13]!==o||t[14]!==a?(s={...o,enabledCollectionSlugs:a},t[13]=o,t[14]=a,t[15]=s):s=t[15],l=A.cloneElement(n,s),t[9]=o,t[10]=a,t[11]=n,t[12]=l}else l=t[12];return l};import{createCommand as xt}from"lexical";var re=xt("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{jsx as bt}from"react/jsx-runtime";import k from"bson-objectid";import{$applyNodeReplacement as Rt}from"lexical";import*as W from"react";import{jsx as St}from"react/jsx-runtime";import{DecoratorBlockNode as vt}from"@lexical/react/LexicalDecoratorBlockNode.js";import j from"bson-objectid";import{$applyNodeReplacement as _t}from"lexical";import"react";function $(r){return r.parentElement!=null&&r.parentElement.tagName==="LI"&&r.previousSibling===null&&r.getAttribute("aria-roledescription")==="checkbox"}function gt(r){if(r.hasAttribute("data-lexical-upload-relation-to")&&r.hasAttribute("data-lexical-upload-id")){let e=r.getAttribute("data-lexical-upload-id"),o=r.getAttribute("data-lexical-upload-relation-to");if(e!=null&&o!=null)return{node:L({data:{fields:{},relationTo:o,value:e}})}}let t=r;return t.src.startsWith("file:///")||$(t),null}var O=class extends vt{__data;constructor({data:t,format:e,key:o}){super(e,o),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"upload"}static importDOM(){return{img:t=>({conversion:gt,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new j.default().toHexString(),t.version=3);let e={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},o=L({data:e});return o.setFormat(t.format),o}static isInline(){return!1}decorate(){return St(RawUploadComponent,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let t=document.createElement("img");return t.setAttribute("data-lexical-upload-id",String(this.__data?.value)),t.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(t){let e=this.getWritable();e.__data=t}updateDOM(){return!1}};function L({data:r}){return r?.id||(r.id=new j.default().toHexString()),_t(new O({data:r}))}var Dt=W.lazy(()=>import("./component-4TP4L5EV.js").then(r=>({default:r.UploadComponent})));function yt(r){if(r.hasAttribute("data-lexical-upload-relation-to")&&r.hasAttribute("data-lexical-upload-id")){let e=r.getAttribute("data-lexical-upload-id"),o=r.getAttribute("data-lexical-upload-relation-to");if(e!=null&&o!=null)return{node:H({data:{fields:{},relationTo:o,value:e}})}}let t=r;return t.src.startsWith("file:///")||$(t),null}var M=class extends O{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:yt,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new k.default().toHexString(),t.version=3);let e={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},o=H({data:e});return o.setFormat(t.format),o}decorate(){return bt(Dt,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function H({data:r}){return r?.id||(r.id=new k.default().toHexString()),Rt(new M({data:r}))}function de(r){return r instanceof M}export{Ht as a,Xt as b,zt as c,re as d,M as e,H as f,de as g};
2
+ //# sourceMappingURL=chunk-7SR2HYD6.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/utilities/fieldsDrawer/useLexicalDrawer.tsx", "../../../src/features/relationship/client/utils/EnabledRelationshipsCondition.tsx", "../../../src/features/upload/client/drawer/commands.ts", "../../../src/features/upload/client/nodes/UploadNode.tsx", "../../../src/features/upload/server/nodes/UploadNode.tsx"],
4
+ "sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer, useModal } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n const { closeModal } = useModal()\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={(args, args2) => {\n // Simply close drawer - no need for useLexicalDrawer here as at this point,\n // we don't need to restore the cursor position. This is handled by the useEffect in useLexicalDrawer.\n closeModal(drawerSlug)\n\n // Actual drawer submit logic needs to be triggered after the drawer is closed.\n // That's because the lexical selection / cursor restore logic that is striggerer by\n // `useLexicalDrawer` neeeds to be triggered before any editor.update calls that may happen\n // in the `handleDrawerSubmit` function.\n setTimeout(() => {\n handleDrawerSubmit(args, args2)\n }, 1)\n }}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n )\n}\n", "'use client'\nimport type { ClientField, FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const { config } = useConfig()\n const [initialState, setInitialState] = useState<false | FormState>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any =\n fieldMapOverride ?? (richTextComponentMap?.get(componentMapRenderedFieldsPath) as ClientField[]) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id: id!,\n data: data ?? {},\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, data])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }) => {\n const { state } = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id: id!,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n return state\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n", "'use client'\nimport type { BaseSelection } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useModal } from '@payloadcms/ui'\nimport { $getPreviousSelection, $getSelection, $setSelection } from 'lexical'\nimport { useCallback, useEffect, useState } from 'react'\n\n/**\n *\n * Wrapper around useModal that restores and saves selection state (cursor position) when opening and closing the drawer.\n * By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.\n */\nexport const useLexicalDrawer = (slug: string, restoreLate?: boolean) => {\n const [editor] = useLexicalComposerContext()\n const [selectionState, setSelectionState] = useState<BaseSelection | null>(null)\n const [wasOpen, setWasOpen] = useState<boolean>(false)\n\n const {\n closeModal: closeBaseModal,\n isModalOpen: isBaseModalOpen,\n modalState,\n toggleModal: toggleBaseModal,\n } = useModal()\n\n const storeSelection = useCallback(() => {\n editor.read(() => {\n const selection = $getSelection() ?? $getPreviousSelection()\n setSelectionState(selection)\n })\n }, [editor])\n\n const restoreSelection = useCallback(() => {\n if (selectionState) {\n editor.update(\n () => {\n $setSelection(selectionState.clone())\n },\n { discrete: true, skipTransforms: true },\n )\n }\n }, [editor, selectionState])\n\n const closeDrawer = () => {\n //restoreSelection() // Should already be stored by the useEffect below\n closeBaseModal(slug)\n }\n\n const toggleDrawer = () => {\n if (!isBaseModalOpen(slug)) {\n storeSelection()\n } else {\n restoreSelection()\n }\n setWasOpen(true)\n toggleBaseModal(slug)\n }\n\n // We need to handle drawer closing via a useEffect, as toggleDrawer / closeDrawer will not be triggered if the drawer\n // is closed by clicking outside of the drawer. This useEffect will handle everything.\n useEffect(() => {\n if (!wasOpen) {\n return\n }\n\n const thisModalState = modalState[slug]\n // Exists in modalState (thus has opened at least once before) and is closed\n if (thisModalState && !thisModalState?.isOpen) {\n setWasOpen(false)\n\n if (restoreLate) {\n // restoreLate is used for upload extra field drawers. For some reason, the selection is not restored if we call restoreSelection immediately.\n setTimeout(() => {\n restoreSelection()\n }, 1)\n } else {\n restoreSelection()\n }\n }\n }, [modalState, slug, restoreSelection, wasOpen, restoreLate])\n\n return {\n closeDrawer,\n toggleDrawer,\n }\n}\n", "'use client'\nimport type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options?.visibleEntities.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<any> = (props) => {\n const { children, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user: user!, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n", "'use client'\nimport type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type { DOMConversionMap, DOMConversionOutput, LexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\n\nimport { isGoogleDocCheckboxImg, UploadServerNode } from '../../server/nodes/UploadNode.js'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends UploadServerNode {\n static clone(node: UploadServerNode): UploadServerNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n decorate(): JSX.Element {\n return <RawUploadComponent data={this.__data} nodeKey={this.getKey()} />\n }\n\n exportJSON(): SerializedUploadNode {\n return super.exportJSON()\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n", "import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { CollectionSlug, DataFromCollectionSlug, JsonObject } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nexport type UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n [TCollectionSlug in CollectionSlug]: {\n fields: TUploadExtraFieldsData\n // Every lexical node that has sub-fields needs to have a unique ID. This is the ID of this upload node, not the ID of the linked upload document\n id: string\n relationTo: TCollectionSlug\n // Value can be just the document ID, or the full, populated document\n value: DataFromCollectionSlug<TCollectionSlug> | number | string\n }\n}[CollectionSlug]\n\nexport function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {\n return (\n img.parentElement != null &&\n img.parentElement.tagName === 'LI' &&\n img.previousSibling === null &&\n img.getAttribute('aria-roledescription') === 'checkbox'\n )\n}\n\nfunction $convertUploadServerElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadServerNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadServerElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n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,GAAsB,IAAIrB,EAAW,CAAEP,KAAMA,CAAmB,CAAA,CAAA,CACzE,CAEO,SAAS6B,GAAc/B,EAAoC,CAChE,OAAOA,aAAgBS,CACzB",
6
+ "names": ["c", "_c", "Drawer", "useModal", "c", "_c", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useTranslation", "getFormState", "useEffect", "useState", "v4", "uuid", "DrawerContent", "t0", "$", "_c", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "field", "t1", "useEditorConfigContext", "richTextComponentMap", "componentMapRenderedFieldsPath", "schemaFieldsPath", "t2", "get", "fields", "t3", "state", "getFormState", "apiRoute", "routes", "api", "body", "operation", "serverURL", "t4", "useEffect", "t5", "t6", "formState", "prevFormState", "state_0", "onChange", "t7", "Array", "isArray", "t8", "_jsxs", "Form", "beforeSubmit", "disableValidationOnSubmit", "onSubmit", "uuid", "children", "_jsx", "RenderFields", "forceRender", "path", "readOnly", "FormSubmit", "FieldsDrawer", "t0", "$", "_c", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "closeModal", "useModal", "t1", "t2", "args", "args2", "setTimeout", "t3", "_jsx", "Drawer", "slug", "title", "children", "DrawerContent", "c", "_c", "useLexicalComposerContext", "useModal", "$getPreviousSelection", "$getSelection", "$setSelection", "useEffect", "useState", "useLexicalDrawer", "slug", "restoreLate", "$", "editor", "selectionState", "setSelectionState", "wasOpen", "setWasOpen", "closeModal", "closeBaseModal", "isModalOpen", "isBaseModalOpen", "modalState", "toggleModal", "toggleBaseModal", "t0", "read", "selection", "storeSelection", "t1", "update", "clone", "discrete", "skipTransforms", "restoreSelection", "t2", "closeDrawer", "t3", "toggleDrawer", "t4", "t5", "thisModalState", "isOpen", "setTimeout", "t6", "c", "_c", "useAuth", "useConfig", "useEntityVisibility", "React", "filterRichTextCollections", "collections", "options", "filter", "slug", "admin", "enableRichTextRelationship", "upload", "visibleEntities", "includes", "uploads", "Boolean", "EnabledRelationshipsCondition", "props", "$", "t0", "rest", "children", "undefined", "config", "t1", "user", "t2", "map", "t3", "enabledCollectionSlugs", "useState", "length", "t4", "cloneElement", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "ObjectID", "$applyNodeReplacement", "React", "DecoratorBlockNode", "ObjectID", "$applyNodeReplacement", "isGoogleDocCheckboxImg", "img", "parentElement", "tagName", "previousSibling", "getAttribute", "$convertUploadServerElement", "domNode", "hasAttribute", "id", "relationTo", "node", "$createUploadServerNode", "data", "fields", "value", "src", "startsWith", "UploadServerNode", "__data", "constructor", "format", "key", "clone", "__format", "__key", "getType", "importDOM", "conversion", "priority", "importJSON", "serializedNode", "version", "default", "toHexString", "importedData", "setFormat", "isInline", "decorate", "_jsx", "RawUploadComponent", "nodeKey", "getKey", "exportDOM", "element", "document", "createElement", "setAttribute", "String", "exportJSON", "getData", "type", "getLatest", "setData", "writable", "getWritable", "updateDOM", "RawUploadComponent", "lazy", "then", "module", "default", "UploadComponent", "$convertUploadElement", "domNode", "hasAttribute", "id", "getAttribute", "relationTo", "node", "$createUploadNode", "data", "fields", "value", "img", "src", "startsWith", "isGoogleDocCheckboxImg", "UploadNode", "UploadServerNode", "clone", "getType", "importDOM", "conversion", "priority", "importJSON", "serializedNode", "version", "ObjectID", "toHexString", "importedData", "setFormat", "format", "decorate", "_jsx", "__data", "nodeKey", "getKey", "exportJSON", "$applyNodeReplacement", "$isUploadNode"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{createCommand as u}from"lexical";var d=u("INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND");import{jsx as h}from"react/jsx-runtime";import*as l from"react";import{DecoratorBlockNode as c}from"@lexical/react/LexicalDecoratorBlockNode.js";function p(r){let t=r.getAttribute("data-lexical-relationship-id"),e=r.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:o({relationTo:e,value:t})}:null}var n=class extends c{__data;constructor({data:t,format:e,key:a}){super(e,a),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"relationship"}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:p,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},a=o(e);return a.setFormat(t.format),a}static isInline(){return!1}decorate(t,e){return null}exportDOM(){let t=document.createElement("div");t.setAttribute("data-lexical-relationship-id",String(this.__data?.value)),t.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let e=document.createTextNode(this.getTextContent());return t.append(e),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${this.__data?.value}`}setData(t){let e=this.getWritable();e.__data=t}};function o(r){return new n({data:r})}var _=l.lazy(()=>import("./RelationshipComponent-FTWR5YDX.js").then(r=>({default:r.RelationshipComponent})));function m(r){let t=r.getAttribute("data-lexical-relationship-id"),e=r.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:s({relationTo:e,value:t})}:null}var i=class extends n{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:m,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},a=s(e);return a.setFormat(t.format),a}decorate(t,e){return h(_,{className:e.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function s(r){return new i({data:r})}function R(r){return r instanceof i}export{d as a,i as b,s as c,R as d};
2
- //# sourceMappingURL=chunk-QZNJUROL.js.map
1
+ import{createCommand as u}from"lexical";var d=u("INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND");import{jsx as h}from"react/jsx-runtime";import*as l from"react";import{DecoratorBlockNode as c}from"@lexical/react/LexicalDecoratorBlockNode.js";function p(r){let t=r.getAttribute("data-lexical-relationship-id"),e=r.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:o({relationTo:e,value:t})}:null}var n=class extends c{__data;constructor({data:t,format:e,key:a}){super(e,a),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"relationship"}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:p,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},a=o(e);return a.setFormat(t.format),a}static isInline(){return!1}decorate(t,e){return null}exportDOM(){let t=document.createElement("div");t.setAttribute("data-lexical-relationship-id",String(this.__data?.value)),t.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let e=document.createTextNode(this.getTextContent());return t.append(e),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${this.__data?.value}`}setData(t){let e=this.getWritable();e.__data=t}};function o(r){return new n({data:r})}var _=l.lazy(()=>import("./RelationshipComponent-LBWKOBGF.js").then(r=>({default:r.RelationshipComponent})));function m(r){let t=r.getAttribute("data-lexical-relationship-id"),e=r.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:s({relationTo:e,value:t})}:null}var i=class extends n{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:m,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},a=s(e);return a.setFormat(t.format),a}decorate(t,e){return h(_,{className:e.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function s(r){return new i({data:r})}function R(r){return r instanceof i}export{d as a,i as b,s as c,R as d};
2
+ //# sourceMappingURL=chunk-XY4TCSM7.js.map
@@ -0,0 +1,2 @@
1
+ "use client";import{a as M,b as O,c as A,d as P,g as T}from"./chunk-7SR2HYD6.js";import{a as U}from"./chunk-5PBXL4HT.js";import{b}from"./chunk-GD6LBQBJ.js";import{jsx as e,jsxs as d}from"react/jsx-runtime";import{useLexicalComposerContext as oe}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as ae}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as le}from"@lexical/utils";import{getTranslation as F}from"@payloadcms/translations";import{Button as C,File as re,formatDrawerSlug as ie,useConfig as se,useEditDepth as ne,usePayloadAPI as de,useTranslation as ce}from"@payloadcms/ui";import{$getNodeByKey as I,$getSelection as ue,$isNodeSelection as me,CLICK_COMMAND as pe,COMMAND_PRIORITY_LOW as w,KEY_BACKSPACE_COMMAND as fe,KEY_DELETE_COMMAND as ge}from"lexical";import{useCallback as f,useEffect as he,useId as _e,useReducer as De,useRef as be,useState as Ce}from"react";var o="lexical-upload",K={depth:0},we=c=>{let{data:{fields:j,relationTo:N,value:n},nodeKey:l}=c;if(typeof n=="object")throw new Error("Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.");let{config:{collections:B,routes:{api:k},serverURL:W}}=se(),g=be(null),{uuid:Y}=b(),z=ne(),[a]=oe(),[r,h,x]=ae(l),{editorConfig:H,field:_}=b(),{i18n:S,t:u}=ce(),[$,q]=De(t=>t+1,0),[i]=Ce(()=>B.find(t=>t.slug===N)),G=_e(),v=ie({slug:"lexical-upload-drawer-"+Y+G,depth:z}),{toggleDrawer:J}=O(v,!0),{closeDocumentDrawer:E,DocumentDrawer:Q,DocumentDrawerToggler:V}=U({id:n,collectionSlug:i.slug}),[{data:m},{setParams:R}]=de(`${W}${k}/${i.slug}/${n}`,{initialParams:K}),y=m?.thumbnailURL||m?.url,X=f(()=>{a.update(()=>{I(l)?.remove()})},[a,l]),Z=f(t=>{R({...K,cacheBust:$}),q(),E()},[R,$,E]),D=f(t=>{let p=ue();return r&&me(p)&&(t.preventDefault(),a.update(()=>{p.getNodes().forEach(s=>{T(s)&&s.remove()})})),!1},[a,r]);he(()=>le(a.registerCommand(pe,t=>t.target===g.current||g.current?.contains(t.target)?(t.shiftKey?h(!r):r||(x(),h(!0)),!0):!1,w),a.registerCommand(ge,D,w),a.registerCommand(fe,D,w)),[x,a,r,l,D,h]);let L=H?.resolvedFeatureMap?.get("upload")?.sanitizedClientFeatureProps.collections?.[i.slug]?.hasExtraFields,ee=f((t,p)=>{a.update(()=>{let s=I(l);if(s){let te={...s.getData(),fields:p};s.setData(te)}})},[a,l]);return d("div",{className:[o,r&&`${o}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:g,children:[d("div",{className:`${o}__card`,children:[d("div",{className:`${o}__topRow`,children:[e("div",{className:`${o}__thumbnail`,children:y?e("img",{alt:m?.filename,"data-lexical-upload-id":n,"data-lexical-upload-relation-to":N,src:y}):e(re,{})}),d("div",{className:`${o}__topRowRightPanel`,children:[e("div",{className:`${o}__collectionLabel`,children:F(i.labels.singular,S)}),a.isEditable()&&d("div",{className:`${o}__actions`,children:[L?e(C,{buttonStyle:"icon-label",className:`${o}__upload-drawer-toggler`,disabled:_?.admin?.readOnly,el:"button",icon:"edit",onClick:()=>{J()},round:!0,tooltip:u("fields:editRelationship")}):null,e(C,{buttonStyle:"icon-label",className:`${o}__swap-drawer-toggler`,disabled:_?.admin?.readOnly,el:"button",icon:"swap",onClick:()=>{a.dispatchCommand(P,{replace:{nodeKey:l}})},round:!0,tooltip:u("fields:swapUpload")}),e(C,{buttonStyle:"icon-label",className:`${o}__removeButton`,disabled:_?.admin?.readOnly,icon:"x",onClick:t=>{t.preventDefault(),X()},round:!0,tooltip:u("fields:removeUpload")})]})]})]}),e("div",{className:`${o}__bottomRow`,children:e(V,{className:`${o}__doc-drawer-toggler`,children:e("strong",{children:m?.filename})})})]}),n?e(Q,{onSave:Z}):null,L?e(M,{data:j,drawerSlug:v,drawerTitle:u("general:editLabel",{label:F(i.labels.singular,S)}),featureKey:"upload",handleDrawerSubmit:ee,schemaPathSuffix:i.slug}):null]})},Ie=c=>e(A,{...c,uploads:!0,children:e(we,{...c})});export{Ie as UploadComponent};
2
+ //# sourceMappingURL=component-4TP4L5EV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/upload/client/component/index.tsx"],
4
+ "sourcesContent": ["'use client'\nimport type { BaseSelection } from 'lexical'\nimport type { ClientCollectionConfig, Data } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n File,\n formatDrawerSlug,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(\n () => collections.find((coll) => coll.slug === relationTo)!,\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n const deleteSelection = $getSelection()\n if (isSelected && $isNodeSelection(deleteSelection)) {\n event.preventDefault()\n editor.update(() => {\n deleteSelection.getNodes().forEach((node) => {\n if ($isUploadNode(node)) {\n node.remove()\n }\n })\n })\n }\n return false\n },\n [editor, isSelected],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (\n event.target === uploadRef.current ||\n uploadRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.admin?.readOnly}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={field?.admin?.readOnly}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],
5
+ "mappings": "8MAIA,OAASA,6BAAAA,OAAiC,2CAC1C,OAASC,2BAAAA,OAA+B,4CACxC,OAASC,iBAAAA,OAAqB,iBAC9B,OAASC,kBAAAA,MAAsB,2BAC/B,OACEC,UAAAA,EACAC,QAAAA,GACAC,oBAAAA,GACAC,aAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,kBAAAA,OACK,iBACP,OACEC,iBAAAA,EACAC,iBAAAA,GACAC,oBAAAA,GACAC,iBAAAA,GACAC,wBAAAA,EACAC,yBAAAA,GACAC,sBAAAA,OACK,UACP,OAAgBC,eAAAA,EAAaC,aAAAA,GAAWC,SAAAA,GAAOC,cAAAA,GAAYC,UAAAA,GAAQC,YAAAA,OAAgB,QAgBnF,IAAMC,EAAY,iBAEZC,EAAgB,CACpBC,MAAO,CACT,EAOMC,GAAqCC,GAAA,CACzC,GAAM,CACJC,KAAM,CAAEC,OAAAA,EAAQC,WAAAA,EAAYC,MAAAA,CAAK,EACjCC,QAAAA,CAAO,EACLL,EAEJ,GAAI,OAAOI,GAAU,SACnB,MAAM,IAAIE,MACR,wHAAA,EAIJ,GAAM,CACJC,OAAQ,CACNC,YAAAA,EACAC,OAAQ,CAAEC,IAAAA,CAAG,EACbC,UAAAA,CAAS,CACV,EACCC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AGlG,CAAA,uBACjBwG,EAACrD,EAAA,CAAsB+C,UAAW,GAAGlG,CAAA,gCACnCwG,EAAC,SAAA,UAAQnG,GAAMqG,kBAIpBlG,EAAQgG,EAACtD,EAAA,CAAe6E,OAAQ9D,IAAmB,KACnDsB,EACCiB,EAACwB,EAAA,CACC3H,KAAMC,EACN2H,WAAYpF,EACZqF,YAAalG,EAAE,oBAAqB,CAClCmG,MAAOtB,EAAevE,EAAkBwE,OAAOC,SAAUhF,CAAA,CAC3D,CAAA,EACAqG,WAAW,SACXC,mBAAoB1C,GACpB2C,iBAAkBhG,EAAkBI,OAEpC,IAAA,GAGV,EAEa6F,GAAmBnI,GAE5BoG,EAACgC,EAAA,CAA+B,GAAGpI,EAAOqI,QAAO,YAC/CjC,EAACrG,GAAA,CAAW,GAAGC",
6
+ "names": ["useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "File", "formatDrawerSlug", "useConfig", "useEditDepth", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "useId", "useReducer", "useRef", "useState", "baseClass", "initialParams", "depth", "Component", "props", "data", "fields", "relationTo", "value", "nodeKey", "Error", "config", "collections", "routes", "api", "serverURL", "useConfig", "uploadRef", "useRef", "uuid", "useEditorConfigContext", "editDepth", "useEditDepth", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "editorConfig", "field", "i18n", "t", "useTranslation", "cacheBust", "dispatchCacheBust", "useReducer", "state", "relatedCollection", "useState", "find", "coll", "slug", "componentID", "useId", "extraFieldsDrawerSlug", "formatDrawerSlug", "toggleDrawer", "useLexicalDrawer", "closeDocumentDrawer", "DocumentDrawer", "DocumentDrawerToggler", "useLexicalDocumentDrawer", "id", "collectionSlug", "setParams", "usePayloadAPI", "thumbnailSRC", "thumbnailURL", "url", "removeUpload", "useCallback", "update", "$getNodeByKey", "remove", "updateUpload", "$onDelete", "event", "deleteSelection", "$getSelection", "$isNodeSelection", "preventDefault", "getNodes", "forEach", "node", "$isUploadNode", "useEffect", "mergeRegister", "registerCommand", "CLICK_COMMAND", "target", "current", "contains", "shiftKey", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "hasExtraFields", "resolvedFeatureMap", "get", "sanitizedClientFeatureProps", "onExtraFieldsDrawerSubmit", "_", "uploadNode", "newData", "getData", "setData", "_jsxs", "className", "filter", "Boolean", "join", "contentEditable", "ref", "_jsx", "alt", "filename", "src", "File", "getTranslation", "labels", "singular", "isEditable", "Button", "buttonStyle", "disabled", "admin", "readOnly", "el", "icon", "onClick", "round", "tooltip", "dispatchCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "replace", "e", "onSave", "FieldsDrawer", "drawerSlug", "drawerTitle", "label", "featureKey", "handleDrawerSubmit", "schemaPathSuffix", "UploadComponent", "EnabledRelationshipsCondition", "uploads"]
7
+ }