@payloadcms/richtext-lexical 3.0.0-beta.97 → 3.0.0-beta.99

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 (138) hide show
  1. package/dist/cell/index.d.ts.map +1 -1
  2. package/dist/cell/index.js +20 -68
  3. package/dist/cell/index.js.map +1 -1
  4. package/dist/exports/client/Field-WN5O3VIW.js +2 -0
  5. package/dist/exports/client/Field-WN5O3VIW.js.map +7 -0
  6. package/dist/exports/client/{RelationshipComponent-CPYVT3XN.js → RelationshipComponent-Z5SZ5FFT.js} +2 -2
  7. package/dist/exports/client/bundled.css +1 -1
  8. package/dist/exports/client/{chunk-BR57XNHD.js → chunk-366OGJYE.js} +2 -2
  9. package/dist/exports/client/{chunk-XIBMVIFW.js → chunk-7UTZDNYS.js} +2 -2
  10. package/dist/exports/client/{chunk-EPEFKP5H.js → chunk-GTKNWSQW.js} +2 -2
  11. package/dist/exports/client/{chunk-MFAXC4ZA.js → chunk-TXEIKM77.js} +1 -1
  12. package/dist/exports/client/chunk-TXEIKM77.js.map +7 -0
  13. package/dist/exports/client/{component-BRCRMQID.js → component-LHFD5Z33.js} +2 -2
  14. package/dist/exports/client/component-UJILB3MH.js +2 -0
  15. package/dist/exports/client/component-UJILB3MH.js.map +7 -0
  16. package/dist/exports/client/{componentInline-RETIC4OV.js → componentInline-JLMSR7BP.js} +2 -2
  17. package/dist/exports/client/index.d.ts +0 -1
  18. package/dist/exports/client/index.d.ts.map +1 -1
  19. package/dist/exports/client/index.js +12 -12
  20. package/dist/exports/client/index.js.map +4 -4
  21. package/dist/features/align/client/index.d.ts +1 -4
  22. package/dist/features/align/client/index.d.ts.map +1 -1
  23. package/dist/features/blockquote/client/index.d.ts +1 -4
  24. package/dist/features/blockquote/client/index.d.ts.map +1 -1
  25. package/dist/features/blocks/client/index.d.ts +1 -4
  26. package/dist/features/blocks/client/index.d.ts.map +1 -1
  27. package/dist/features/debug/testRecorder/client/index.d.ts +1 -4
  28. package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -1
  29. package/dist/features/debug/treeView/client/index.d.ts +1 -4
  30. package/dist/features/debug/treeView/client/index.d.ts.map +1 -1
  31. package/dist/features/experimental_table/client/index.d.ts +1 -1
  32. package/dist/features/experimental_table/client/index.d.ts.map +1 -1
  33. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +1 -1
  34. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  35. package/dist/features/format/bold/feature.client.d.ts +1 -4
  36. package/dist/features/format/bold/feature.client.d.ts.map +1 -1
  37. package/dist/features/format/inlineCode/feature.client.d.ts +1 -4
  38. package/dist/features/format/inlineCode/feature.client.d.ts.map +1 -1
  39. package/dist/features/format/italic/feature.client.d.ts +1 -4
  40. package/dist/features/format/italic/feature.client.d.ts.map +1 -1
  41. package/dist/features/format/strikethrough/feature.client.d.ts +1 -4
  42. package/dist/features/format/strikethrough/feature.client.d.ts.map +1 -1
  43. package/dist/features/format/subscript/feature.client.d.ts +1 -4
  44. package/dist/features/format/subscript/feature.client.d.ts.map +1 -1
  45. package/dist/features/format/superscript/feature.client.d.ts +1 -4
  46. package/dist/features/format/superscript/feature.client.d.ts.map +1 -1
  47. package/dist/features/format/underline/feature.client.d.ts +1 -4
  48. package/dist/features/format/underline/feature.client.d.ts.map +1 -1
  49. package/dist/features/heading/client/index.d.ts +1 -4
  50. package/dist/features/heading/client/index.d.ts.map +1 -1
  51. package/dist/features/horizontalRule/client/index.d.ts +1 -4
  52. package/dist/features/horizontalRule/client/index.d.ts.map +1 -1
  53. package/dist/features/indent/client/index.d.ts +1 -4
  54. package/dist/features/indent/client/index.d.ts.map +1 -1
  55. package/dist/features/link/client/index.d.ts +1 -13
  56. package/dist/features/link/client/index.d.ts.map +1 -1
  57. package/dist/features/lists/checklist/client/index.d.ts +1 -4
  58. package/dist/features/lists/checklist/client/index.d.ts.map +1 -1
  59. package/dist/features/lists/orderedList/client/index.d.ts +1 -4
  60. package/dist/features/lists/orderedList/client/index.d.ts.map +1 -1
  61. package/dist/features/lists/unorderedList/client/index.d.ts +1 -4
  62. package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -1
  63. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +1 -4
  64. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  65. package/dist/features/migrations/slateToLexical/feature.client.d.ts +1 -4
  66. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  67. package/dist/features/migrations/slateToLexical/feature.client.js +1 -3
  68. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  69. package/dist/features/paragraph/client/index.d.ts +1 -4
  70. package/dist/features/paragraph/client/index.d.ts.map +1 -1
  71. package/dist/features/relationship/client/index.d.ts +2 -17
  72. package/dist/features/relationship/client/index.d.ts.map +1 -1
  73. package/dist/features/toolbars/fixed/client/index.d.ts +1 -4
  74. package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -1
  75. package/dist/features/toolbars/inline/client/index.d.ts +1 -4
  76. package/dist/features/toolbars/inline/client/index.d.ts.map +1 -1
  77. package/dist/features/typesClient.d.ts +4 -5
  78. package/dist/features/typesClient.d.ts.map +1 -1
  79. package/dist/features/typesClient.js.map +1 -1
  80. package/dist/features/typesServer.d.ts +2 -2
  81. package/dist/features/typesServer.d.ts.map +1 -1
  82. package/dist/features/typesServer.js.map +1 -1
  83. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  84. package/dist/features/upload/client/component/index.js +17 -18
  85. package/dist/features/upload/client/component/index.js.map +1 -1
  86. package/dist/features/upload/client/feature.client.d.ts +1 -4
  87. package/dist/features/upload/client/feature.client.d.ts.map +1 -1
  88. package/dist/field/bundled.css +1 -1
  89. package/dist/field/index.d.ts.map +1 -1
  90. package/dist/field/index.js +62 -71
  91. package/dist/field/index.js.map +1 -1
  92. package/dist/index.d.ts +1 -1
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js.map +1 -1
  95. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  96. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  97. package/dist/lexical/config/client/loader.d.ts +1 -3
  98. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  99. package/dist/lexical/config/client/loader.js +7 -19
  100. package/dist/lexical/config/client/loader.js.map +1 -1
  101. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  102. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  103. package/dist/lexical/config/client/sanitize.js +1 -1
  104. package/dist/lexical/config/client/sanitize.js.map +1 -1
  105. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  106. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  107. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +9 -7
  108. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  109. package/dist/types.d.ts +3 -4
  110. package/dist/types.d.ts.map +1 -1
  111. package/dist/types.js.map +1 -1
  112. package/dist/utilities/createClientFeature.d.ts +3 -5
  113. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  114. package/dist/utilities/createClientFeature.js +1 -4
  115. package/dist/utilities/createClientFeature.js.map +1 -1
  116. package/dist/utilities/generateComponentMap.d.ts.map +1 -1
  117. package/dist/utilities/generateComponentMap.js +10 -17
  118. package/dist/utilities/generateComponentMap.js.map +1 -1
  119. package/package.json +7 -7
  120. package/dist/exports/client/Field-MPDY6IHA.js +0 -2
  121. package/dist/exports/client/Field-MPDY6IHA.js.map +0 -7
  122. package/dist/exports/client/chunk-MFAXC4ZA.js.map +0 -7
  123. package/dist/exports/client/component-3EGTURAI.js +0 -2
  124. package/dist/exports/client/component-3EGTURAI.js.map +0 -7
  125. package/dist/features/createClientComponent.d.ts +0 -7
  126. package/dist/features/createClientComponent.d.ts.map +0 -1
  127. package/dist/features/createClientComponent.js +0 -13
  128. package/dist/features/createClientComponent.js.map +0 -1
  129. package/dist/features/createFeaturePropComponent.d.ts +0 -6
  130. package/dist/features/createFeaturePropComponent.d.ts.map +0 -1
  131. package/dist/features/createFeaturePropComponent.js +0 -19
  132. package/dist/features/createFeaturePropComponent.js.map +0 -1
  133. /package/dist/exports/client/{RelationshipComponent-CPYVT3XN.js.map → RelationshipComponent-Z5SZ5FFT.js.map} +0 -0
  134. /package/dist/exports/client/{chunk-BR57XNHD.js.map → chunk-366OGJYE.js.map} +0 -0
  135. /package/dist/exports/client/{chunk-XIBMVIFW.js.map → chunk-7UTZDNYS.js.map} +0 -0
  136. /package/dist/exports/client/{chunk-EPEFKP5H.js.map → chunk-GTKNWSQW.js.map} +0 -0
  137. /package/dist/exports/client/{component-BRCRMQID.js.map → component-LHFD5Z33.js.map} +0 -0
  138. /package/dist/exports/client/{componentInline-RETIC4OV.js.map → componentInline-JLMSR7BP.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{b as E}from"./chunk-MFAXC4ZA.js";import{jsx as L}from"react/jsx-runtime";import{Drawer as z}from"@payloadcms/ui";import"react";import{c as H}from"react/compiler-runtime";import{jsx as T,jsxs as J}from"react/jsx-runtime";import{Form as K,FormSubmit as B,RenderFields as G,useConfig as V,useDocumentInfo as q,useFieldProps as Q,useTranslation as X}from"@payloadcms/ui";import{getFormState as I}from"@payloadcms/ui/shared";import{useEffect as Y,useState as Z}from"react";import{v4 as N}from"uuid";var F=e=>{let t=H(27),{data:a,featureKey:r,fieldMapOverride:o,handleDrawerSubmit:c,schemaFieldsPathOverride:v,schemaPathSuffix:s}=e,{t:f}=X(),{id:i}=q(),{schemaPath:x}=Q(),{config:n}=V(),[p,m]=Z(!1),{field:O}=E(),{richTextComponentMap:w}=O,U=`lexical_internal_feature.${r}.fields${s?`.${s}`:""}`,l=v??`${x}.lexical_internal_feature.${r}${s?`.${s}`:""}`,g;t[0]!==o||t[1]!==w||t[2]!==U?(g=o??w.get(U),t[0]=o,t[1]=w,t[2]=U,t[3]=g):g=t[3];let u=g,S,b;t[4]!==n.routes.api||t[5]!==n.serverURL||t[6]!==i||t[7]!==a||t[8]!==l?(S=()=>{(async()=>{let d=await I({apiRoute:n.routes.api,body:{id:i,data:a??{},operation:"update",schemaPath:l},serverURL:n.serverURL});m(d)})()},b=[n.routes.api,n.serverURL,l,i,a],t[4]=n.routes.api,t[5]=n.serverURL,t[6]=i,t[7]=a,t[8]=l,t[9]=S,t[10]=b):(S=t[9],b=t[10]),Y(S,b);let R;t[11]!==n.routes.api||t[12]!==n.serverURL||t[13]!==i||t[14]!==l?(R=async h=>{let{formState:d}=h;return await I({apiRoute:n.routes.api,body:{id:i,formState:d,operation:"update",schemaPath:l},serverURL:n.serverURL})},t[11]=n.routes.api,t[12]=n.serverURL,t[13]=i,t[14]=l,t[15]=R):R=t[15];let y=R;if(p===!1)return null;let D;if(t[16]!==y||t[17]!==u||t[18]!==l||t[19]!==f||t[20]!==p||t[21]!==c){let h;t[23]!==u?(h=Array.isArray(u)?u:[],t[23]=u,t[24]=h):h=t[24];let d;t[25]!==u?(d=Array.isArray(u)?u:[],t[25]=u,t[26]=d):d=t[26],D=J(K,{beforeSubmit:[y],disableValidationOnSubmit:!0,fields:h,initialState:p,onChange:[y],onSubmit:c,uuid:N(),children:[T(G,{fields:d,forceRender:!0,path:"",readOnly:!1,schemaPath:l}),T(B,{children:f("fields:saveChanges")})]}),t[16]=y,t[17]=u,t[18]=l,t[19]=f,t[20]=p,t[21]=c,t[22]=D}else D=t[22];return D};var Ut=({className:e,data:t,drawerSlug:a,drawerTitle:r,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})=>L(z,{className:e,slug:a,title:r??"",children:L(F,{data:t,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})});import{c as tt}from"react/compiler-runtime";import{useAuth as et,useConfig as rt,useEntityVisibility as at}from"@payloadcms/ui";import*as A from"react";var nt=(e,t)=>e.filter(({slug:a,admin:{enableRichTextRelationship:r},upload:o})=>t.visibleEntities.collections.includes(a)?t?.uploads?r&&!!o:o?!1:r:!1),It=e=>{let t=tt(16),a,r,o;t[0]!==e?({children:o,uploads:a,...r}=e,t[0]=e,t[1]=a,t[2]=r,t[3]=o):(a=t[1],r=t[2],o=t[3]);let c=a===void 0?!1:a,{config:v}=rt(),{collections:s}=v,{user:f}=et(),{visibleEntities:i}=at(),x;t[4]!==s||t[5]!==c||t[6]!==f||t[7]!==i?(x=()=>nt(s,{uploads:c,user:f,visibleEntities:i}).map(m=>{let{slug:O}=m;return O}),t[4]=s,t[5]=c,t[6]=f,t[7]=i,t[8]=x):x=t[8];let[n]=A.useState(x);if(!n.length)return null;let p;if(t[9]!==r||t[10]!==n||t[11]!==o){let m;t[13]!==r||t[14]!==n?(m={...r,enabledCollectionSlugs:n},t[13]=r,t[14]=n,t[15]=m):m=t[15],p=A.cloneElement(o,m),t[9]=r,t[10]=n,t[11]=o,t[12]=p}else p=t[12];return p};import{createCommand as ot}from"lexical";var Pt=ot("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{jsx as ct}from"react/jsx-runtime";import M from"bson-objectid";import{$applyNodeReplacement as ft}from"lexical";import*as k from"react";import{jsx as it}from"react/jsx-runtime";import{DecoratorBlockNode as st}from"@lexical/react/LexicalDecoratorBlockNode.js";import P from"bson-objectid";import{$applyNodeReplacement as lt}from"lexical";import"react";function $(e){return e.parentElement!=null&&e.parentElement.tagName==="LI"&&e.previousSibling===null&&e.getAttribute("aria-roledescription")==="checkbox"}function ut(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:j({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var _=class extends st{__data;constructor({data:t,format:a,key:r}){super(a,r),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:ut,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new P.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=j({data:a});return r.setFormat(t.format),r}static isInline(){return!1}decorate(){return it(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 a=this.getWritable();a.__data=t}updateDOM(){return!1}};function j({data:e}){return e?.id||(e.id=new P.default().toHexString()),lt(new _({data:e}))}var pt=k.lazy(()=>import("./component-3EGTURAI.js").then(e=>({default:e.UploadComponent})));function mt(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:W({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var C=class extends _{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:mt,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new M.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=W({data:a});return r.setFormat(t.format),r}decorate(){return ct(pt,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function W({data:e}){return e?.id||(e.id=new M.default().toHexString()),ft(new C({data:e}))}function Qt(e){return e instanceof C}export{Ut as a,It as b,Pt as c,C as d,W as e,Qt as f};
2
- //# sourceMappingURL=chunk-BR57XNHD.js.map
1
+ import{b as E}from"./chunk-TXEIKM77.js";import{jsx as L}from"react/jsx-runtime";import{Drawer as z}from"@payloadcms/ui";import"react";import{c as H}from"react/compiler-runtime";import{jsx as T,jsxs as J}from"react/jsx-runtime";import{Form as K,FormSubmit as B,RenderFields as G,useConfig as V,useDocumentInfo as q,useFieldProps as Q,useTranslation as X}from"@payloadcms/ui";import{getFormState as I}from"@payloadcms/ui/shared";import{useEffect as Y,useState as Z}from"react";import{v4 as N}from"uuid";var F=e=>{let t=H(27),{data:a,featureKey:r,fieldMapOverride:o,handleDrawerSubmit:c,schemaFieldsPathOverride:v,schemaPathSuffix:s}=e,{t:f}=X(),{id:i}=q(),{schemaPath:x}=Q(),{config:n}=V(),[p,m]=Z(!1),{field:O}=E(),{richTextComponentMap:w}=O,U=`lexical_internal_feature.${r}.fields${s?`.${s}`:""}`,l=v??`${x}.lexical_internal_feature.${r}${s?`.${s}`:""}`,g;t[0]!==o||t[1]!==w||t[2]!==U?(g=o??w.get(U),t[0]=o,t[1]=w,t[2]=U,t[3]=g):g=t[3];let u=g,S,b;t[4]!==n.routes.api||t[5]!==n.serverURL||t[6]!==i||t[7]!==a||t[8]!==l?(S=()=>{(async()=>{let d=await I({apiRoute:n.routes.api,body:{id:i,data:a??{},operation:"update",schemaPath:l},serverURL:n.serverURL});m(d)})()},b=[n.routes.api,n.serverURL,l,i,a],t[4]=n.routes.api,t[5]=n.serverURL,t[6]=i,t[7]=a,t[8]=l,t[9]=S,t[10]=b):(S=t[9],b=t[10]),Y(S,b);let R;t[11]!==n.routes.api||t[12]!==n.serverURL||t[13]!==i||t[14]!==l?(R=async h=>{let{formState:d}=h;return await I({apiRoute:n.routes.api,body:{id:i,formState:d,operation:"update",schemaPath:l},serverURL:n.serverURL})},t[11]=n.routes.api,t[12]=n.serverURL,t[13]=i,t[14]=l,t[15]=R):R=t[15];let y=R;if(p===!1)return null;let D;if(t[16]!==y||t[17]!==u||t[18]!==l||t[19]!==f||t[20]!==p||t[21]!==c){let h;t[23]!==u?(h=Array.isArray(u)?u:[],t[23]=u,t[24]=h):h=t[24];let d;t[25]!==u?(d=Array.isArray(u)?u:[],t[25]=u,t[26]=d):d=t[26],D=J(K,{beforeSubmit:[y],disableValidationOnSubmit:!0,fields:h,initialState:p,onChange:[y],onSubmit:c,uuid:N(),children:[T(G,{fields:d,forceRender:!0,path:"",readOnly:!1,schemaPath:l}),T(B,{children:f("fields:saveChanges")})]}),t[16]=y,t[17]=u,t[18]=l,t[19]=f,t[20]=p,t[21]=c,t[22]=D}else D=t[22];return D};var Ut=({className:e,data:t,drawerSlug:a,drawerTitle:r,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})=>L(z,{className:e,slug:a,title:r??"",children:L(F,{data:t,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})});import{c as tt}from"react/compiler-runtime";import{useAuth as et,useConfig as rt,useEntityVisibility as at}from"@payloadcms/ui";import*as A from"react";var nt=(e,t)=>e.filter(({slug:a,admin:{enableRichTextRelationship:r},upload:o})=>t.visibleEntities.collections.includes(a)?t?.uploads?r&&!!o:o?!1:r:!1),It=e=>{let t=tt(16),a,r,o;t[0]!==e?({children:o,uploads:a,...r}=e,t[0]=e,t[1]=a,t[2]=r,t[3]=o):(a=t[1],r=t[2],o=t[3]);let c=a===void 0?!1:a,{config:v}=rt(),{collections:s}=v,{user:f}=et(),{visibleEntities:i}=at(),x;t[4]!==s||t[5]!==c||t[6]!==f||t[7]!==i?(x=()=>nt(s,{uploads:c,user:f,visibleEntities:i}).map(m=>{let{slug:O}=m;return O}),t[4]=s,t[5]=c,t[6]=f,t[7]=i,t[8]=x):x=t[8];let[n]=A.useState(x);if(!n.length)return null;let p;if(t[9]!==r||t[10]!==n||t[11]!==o){let m;t[13]!==r||t[14]!==n?(m={...r,enabledCollectionSlugs:n},t[13]=r,t[14]=n,t[15]=m):m=t[15],p=A.cloneElement(o,m),t[9]=r,t[10]=n,t[11]=o,t[12]=p}else p=t[12];return p};import{createCommand as ot}from"lexical";var Pt=ot("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{jsx as ct}from"react/jsx-runtime";import M from"bson-objectid";import{$applyNodeReplacement as ft}from"lexical";import*as k from"react";import{jsx as it}from"react/jsx-runtime";import{DecoratorBlockNode as st}from"@lexical/react/LexicalDecoratorBlockNode.js";import P from"bson-objectid";import{$applyNodeReplacement as lt}from"lexical";import"react";function $(e){return e.parentElement!=null&&e.parentElement.tagName==="LI"&&e.previousSibling===null&&e.getAttribute("aria-roledescription")==="checkbox"}function ut(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:j({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var _=class extends st{__data;constructor({data:t,format:a,key:r}){super(a,r),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:ut,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new P.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=j({data:a});return r.setFormat(t.format),r}static isInline(){return!1}decorate(){return it(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 a=this.getWritable();a.__data=t}updateDOM(){return!1}};function j({data:e}){return e?.id||(e.id=new P.default().toHexString()),lt(new _({data:e}))}var pt=k.lazy(()=>import("./component-UJILB3MH.js").then(e=>({default:e.UploadComponent})));function mt(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:W({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var C=class extends _{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:mt,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new M.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=W({data:a});return r.setFormat(t.format),r}decorate(){return ct(pt,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function W({data:e}){return e?.id||(e.id=new M.default().toHexString()),ft(new C({data:e}))}function Qt(e){return e instanceof C}export{Ut as a,It as b,Pt as c,C as d,W as e,Qt as f};
2
+ //# sourceMappingURL=chunk-366OGJYE.js.map
@@ -1,2 +1,2 @@
1
- import{createCommand as i}from"lexical";var O=i("INSERT_BLOCK_COMMAND"),x=i("INSERT_INLINE_BLOCK_COMMAND"),I=i("OPEN_INLINE_BLOCK_DRAWER_COMMAND");import{jsx as p}from"react/jsx-runtime";import u from"bson-objectid";import m from"react";import c from"bson-objectid";import{DecoratorNode as l}from"lexical";import{deepCopyObjectSimple as d}from"payload/shared";var r=class extends l{__fields;constructor({fields:e,key:n}){super(n),this.__fields=e}static clone(e){return new this({fields:e.__fields,key:e.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(e){return a(e.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(){let e=document.createElement("span");return e.classList.add("inline-block-container"),e}decorate(e,n){return null}exportDOM(){let e=document.createElement("span");e.classList.add("inline-block-container");let n=document.createTextNode(this.getTextContent());return e.append(n),{element:e}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(e){let n=d(e),s=this.getWritable();s.__fields=n}updateDOM(){return!1}};function a(t){return new r({fields:{...t,id:t?.id||new c.default().toHexString()}})}var f=m.lazy(()=>import("./componentInline-RETIC4OV.js").then(t=>({default:t.InlineBlockComponent}))),o=class extends r{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return _(e.fields)}decorate(e,n){return p(f,{formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function _(t){return new o({fields:{...t,id:t?.id||new u.default().toHexString()}})}function y(t){return t instanceof o}export{O as a,x as b,I as c,o as d,_ as e,y as f};
2
- //# sourceMappingURL=chunk-XIBMVIFW.js.map
1
+ import{createCommand as i}from"lexical";var O=i("INSERT_BLOCK_COMMAND"),x=i("INSERT_INLINE_BLOCK_COMMAND"),I=i("OPEN_INLINE_BLOCK_DRAWER_COMMAND");import{jsx as p}from"react/jsx-runtime";import u from"bson-objectid";import m from"react";import c from"bson-objectid";import{DecoratorNode as l}from"lexical";import{deepCopyObjectSimple as d}from"payload/shared";var r=class extends l{__fields;constructor({fields:e,key:n}){super(n),this.__fields=e}static clone(e){return new this({fields:e.__fields,key:e.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(e){return a(e.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(){let e=document.createElement("span");return e.classList.add("inline-block-container"),e}decorate(e,n){return null}exportDOM(){let e=document.createElement("span");e.classList.add("inline-block-container");let n=document.createTextNode(this.getTextContent());return e.append(n),{element:e}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(e){let n=d(e),s=this.getWritable();s.__fields=n}updateDOM(){return!1}};function a(t){return new r({fields:{...t,id:t?.id||new c.default().toHexString()}})}var f=m.lazy(()=>import("./componentInline-JLMSR7BP.js").then(t=>({default:t.InlineBlockComponent}))),o=class extends r{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return _(e.fields)}decorate(e,n){return p(f,{formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function _(t){return new o({fields:{...t,id:t?.id||new u.default().toHexString()}})}function y(t){return t instanceof o}export{O as a,x as b,I as c,o as d,_ as e,y as f};
2
+ //# sourceMappingURL=chunk-7UTZDNYS.js.map
@@ -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-CPYVT3XN.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-EPEFKP5H.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-Z5SZ5FFT.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-GTKNWSQW.js.map
@@ -1,2 +1,2 @@
1
1
  import{jsx as w}from"react/jsx-runtime";import{useLexicalComposerContext as x}from"@lexical/react/LexicalComposerContext.js";import"react";import{createContext as C,useContext as M,useMemo as b,useRef as E,useState as m}from"react";function v(){return Math.random().toString(36).substring(2,12)+Math.random().toString(36).substring(2,12)}var g=C({editorConfig:null,field:null,uuid:null}),F=({children:o,editorConfig:s,editorContainerRef:c,field:d,parentContext:n})=>{let[a]=x(),[f]=m(v()),t=E(new Map),[l,h]=m(null),u=E(new Set),p=b(()=>({blurEditor:r=>{u.current.clear()},childrenEditors:t,editor:a,editorConfig:s,editorContainerRef:c,field:d,focusedEditor:l,focusEditor:r=>{let e=r.uuid;u.current.has(e)||(u.current.add(e),h(r),n?.uuid&&n.focusEditor(r),t.current.forEach((i,S)=>{i.focusEditor(r)}),u.current.clear())},parentEditor:n,registerChild:(r,e)=>{if(!t.current.has(r)){let i=new Map(t.current);i.set(r,e),t.current=i}},unregisterChild:r=>{if(t.current.has(r)){let e=new Map(t.current);e.delete(r),t.current=e}},uuid:f}),[a,t,s,c,d,l,n,f]);return w(g.Provider,{value:p,children:o})},G=()=>{let o=M(g);if(o===void 0)throw new Error("useEditorConfigContext must be used within an EditorConfigProvider");return o};export{F as a,G as b};
2
- //# sourceMappingURL=chunk-MFAXC4ZA.js.map
2
+ //# sourceMappingURL=chunk-TXEIKM77.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/lexical/config/client/EditorConfigProvider.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n focusedEditor: EditorConfigContextType | null\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n field,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field,\n focusedEditor,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n field,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],
5
+ "mappings": "wCAIA,OAASA,6BAAAA,MAAiC,2CAC1C,MAAuB,QACvB,OAASC,iBAAAA,EAAeC,cAAAA,EAAYC,WAAAA,EAASC,UAAAA,EAAQC,YAAAA,MAAgB,QAMrE,SAASC,GAAA,CACP,OAAOC,KAAKC,OAAM,EAAGC,SAAS,EAAA,EAAIC,UAAU,EAAG,EAAA,EAAMH,KAAKC,OAAM,EAAGC,SAAS,EAAA,EAAIC,UAAU,EAAG,EAAA,CAC/F,CAmBA,IAAMC,EAAkDV,EAAc,CACpEW,aAAc,KACdC,MAAO,KACPC,KAAM,IACR,CAAA,EAEaC,EAAuBA,CAAC,CACnCC,SAAAA,EACAJ,aAAAA,EACAK,mBAAAA,EACAJ,MAAAA,EACAK,cAAAA,CAAa,IAOd,CACC,GAAM,CAACC,CAAA,EAAUnB,EAAA,EAEX,CAACc,CAAA,EAAQT,EAASC,EAAA,CAAA,EAElBc,EAAkBhB,EAA6C,IAAIiB,GAAA,EACnE,CAACC,EAAeC,CAAA,EAAoBlB,EAAyC,IAAA,EAC7EmB,EAAepB,EAAoB,IAAIqB,GAAA,EAEvCC,EAAgBvB,EACpB,KACG,CACCwB,WAAaD,GAAA,CAEXF,EAAaI,QAAQC,MAAK,CAC5B,EACAT,gBAAAA,EACAD,OAAAA,EACAP,aAAAA,EACAK,mBAAAA,EACAJ,MAAAA,EACAS,cAAAA,EACAQ,YAAcJ,GAAA,CACZ,IAAMK,EAAaL,EAAcZ,KAG7BU,EAAaI,QAAQI,IAAID,CAAA,IAK7BP,EAAaI,QAAQK,IAAIF,CAAA,EACzBR,EAAiBG,CAAA,EAGbR,GAAeJ,MACjBI,EAAcY,YAAYJ,CAAA,EAE5BN,EAAgBQ,QAAQM,QAAQ,CAACC,EAAaC,IAAA,CAC5CD,EAAYL,YAAYJ,CAAA,CAC1B,CAAA,EAEAF,EAAaI,QAAQC,MAAK,EAC5B,EACAQ,aAAcnB,EACdoB,cAAeA,CAACF,EAAWG,IAAA,CACzB,GAAI,CAACnB,EAAgBQ,QAAQI,IAAII,CAAA,EAAY,CAC3C,IAAMI,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOC,IAAIL,EAAWG,CAAA,EACtBnB,EAAgBQ,QAAUY,CAC5B,CACF,EACAE,gBAAkBN,GAAA,CAChB,GAAIhB,EAAgBQ,QAAQI,IAAII,CAAA,EAAY,CAC1C,IAAMI,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOG,OAAOP,CAAA,EACdhB,EAAgBQ,QAAUY,CAC5B,CACF,EAEA1B,KAAAA,CACF,GACF,CACEK,EACAC,EACAR,EACAK,EACAJ,EACAS,EACAJ,EACAJ,CAAA,CACD,EAGH,OAAO8B,EAACjC,EAAQkC,SAAQ,CAACC,MAAOpB,WAAgBV,GAClD,EAEa+B,EAAyBA,IAAA,CACpC,IAAMC,EAAU9C,EAAWS,CAAA,EAC3B,GAAIqC,IAAYC,OACd,MAAM,IAAIC,MAAM,oEAAA,EAElB,OAAOF,CACT",
6
+ "names": ["useLexicalComposerContext", "createContext", "useContext", "useMemo", "useRef", "useState", "generateQuickGuid", "Math", "random", "toString", "substring", "Context", "editorConfig", "field", "uuid", "EditorConfigProvider", "children", "editorContainerRef", "parentContext", "editor", "childrenEditors", "Map", "focusedEditor", "setFocusedEditor", "focusHistory", "Set", "editorContext", "blurEditor", "current", "clear", "focusEditor", "editorUUID", "has", "add", "forEach", "childEditor", "childUUID", "parentEditor", "registerChild", "childEditorContext", "newMap", "set", "unregisterChild", "delete", "_jsx", "Provider", "value", "useEditorConfigContext", "context", "undefined", "Error"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{b as T}from"./chunk-MFAXC4ZA.js";import{jsx as f,jsxs as le}from"react/jsx-runtime";import{Collapsible as se,Form as ie,Pill as ne,RenderComponent as ae,SectionTitle as re,ShimmerEffect as ce,useConfig as de,useDocumentInfo as me,useFieldProps as ue,useFormSubmitted as fe,useTranslation as pe}from"@payloadcms/ui";import{useCallback as be,useEffect as he,useMemo as ke,useState as ye}from"react";import{getTranslation as _e}from"@payloadcms/translations";import{getFormState as I}from"@payloadcms/ui/shared";import{v4 as Ce}from"uuid";import{jsx as k,jsxs as B}from"react/jsx-runtime";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as H}from"@payloadcms/translations";import{Button as W,Collapsible as z,ErrorPill as G,Pill as J,RenderComponent as Q,RenderFields as X,SectionTitle as Y,useDocumentInfo as Z,useFormSubmitted as ee,useTranslation as oe}from"@payloadcms/ui";import{dequal as te}from"dequal/lite";import{$getNodeByKey as O}from"lexical";import A,{useCallback as E}from"react";import{c as K}from"react/compiler-runtime";import{useAllFormFields as V}from"@payloadcms/ui";import{reduceFieldsToValues as D}from"payload/shared";import{useEffect as M}from"react";function w({fields:i}){for(let e in i){let o=i[e];Array.isArray(o.rows)&&"value"in o&&(o.disableFormData=!0)}return i}var j=i=>{let e=K(8),{onChange:o}=i,[l]=V(),d,s;e[0]!==l?(s=w({fields:l}),d=D(s,!0),e[0]=l,e[1]=d,e[2]=s):(d=e[1],s=e[2]);let m=d,t,a;return e[3]!==o||e[4]!==s||e[5]!==m?(t=()=>{o&&o({fullFieldsWithValues:s,newFormData:m})},a=[m,o,s],e[3]=o,e[4]=s,e[5]=m,e[6]=t,e[7]=a):(t=e[6],a=e[7]),M(t,a),null};function L(i){for(let e in i){let o=i[e];Array.isArray(o)&&!o?.length?delete i[e]:o&&typeof o=="object"?L(o):o==null&&delete i[e]}}var U=i=>{let{baseClass:e,clientBlock:o,field:l,formSchema:d,nodeKey:s,schemaPath:m}=i,{formData:t}=i,{i18n:a}=oe(),[u]=q(),{getDocPreferences:x,setDocFieldPreferences:P}=Z(),[p,N]=A.useState(()=>{let r=!1;return x().then(c=>{let h=c?.fields[l.name]?.collapsed;h&&h.includes(t.id)&&(r=!0,N(!0))}),r}),F=ee(),[n,S]=A.useState(0),C=F&&n>0,$=[`${e}__row`,C?`${e}__row--has-errors`:`${e}__row--no-errors`].filter(Boolean).join(" "),R=E(({fullFieldsWithValues:r,newFormData:c})=>{if(c.id=t.id,c.blockType=t.blockType,L(c),L(t),te(t,c)||setTimeout(()=>{u.update(()=>{let _=O(s);_&&(t=c,_.setFields(c))})},0),F){let _=0;for(let h of Object.values(r))h?.valid===!1&&_++;S(_)}},[u,s,F,t]),v=E(r=>{x().then(c=>{let h=c?.fields[l.name]?.collapsed,g=h&&h?.length?h:[];r?g.includes(t.id)||g.push(t.id):g.includes(t.id)&&g.splice(g.indexOf(t.id),1),P(l.name,{collapsed:g,hello:"hi"})})},[x,l.name,P,t.id]),b=E(()=>{u.update(()=>{O(s).remove()})},[u,s]);return B(A.Fragment,{children:[k(z,{className:$,collapsibleStyle:C?"error":"default",header:o?.admin?.components?.Label?k(Q,{clientProps:{blockKind:"lexicalBlock",formData:t},mappedComponent:o.admin.components.Label}):B("div",{className:`${e}__block-header`,children:[B("div",{children:[k(J,{className:`${e}__block-pill ${e}__block-pill-${t?.blockType}`,pillStyle:"white",children:typeof o?.labels.singular=="string"?H(o?.labels.singular,a):o.slug}),k(Y,{path:"blockName",readOnly:l?.admin?.readOnly}),C&&k(G,{count:n,i18n:a,withMessage:!0})]}),u.isEditable()&&k(W,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:l?.admin?.readOnly,icon:"x",onClick:r=>{r.preventDefault(),b()},round:!0,tooltip:"Remove Block"})]}),isCollapsed:p,onToggle:r=>{v(r),N(r)},children:k(X,{className:`${e}__fields`,fields:d,forceRender:!0,margins:"small",path:"",readOnly:!1,schemaPath:m})},0),k(j,{onChange:R})]})};var y="lexical-block",We=i=>{let{formData:e,nodeKey:o}=i,{config:l}=de(),d=fe(),{id:s}=me(),{path:m,schemaPath:t}=ue(),{field:a}=T(),[u,x]=ye(!1),{field:{richTextComponentMap:P}}=T(),p=`${t}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${e.blockType}`,n=P.get("lexical_internal_feature.blocks.fields.lexical_blocks")[0].blocks.find(v=>v.slug===e.blockType);he(()=>{e&&(async()=>{let b=await I({apiRoute:l.routes.api,body:{id:s,data:e,operation:"update",schemaPath:p},serverURL:l.serverURL});b&&(b.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},x(b))})()},[l.routes.api,l.serverURL,p,s]);let S=be(async({formState:v})=>{let b=await I({apiRoute:l.routes.api,body:{id:s,formState:v,operation:"update",schemaPath:p},serverURL:l.serverURL});return b.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},b},[l.routes.api,l.serverURL,s,p,e.blockName]),{i18n:C}=pe(),$=[`${y}__row`,`${y}__row--no-errors`].filter(Boolean).join(" "),R=ke(()=>n&&u!==!1?f(ie,{beforeSubmit:[S],fields:n.fields,initialState:u,onChange:[S],submitted:d,uuid:Ce(),children:f(U,{baseClass:y,clientBlock:n,field:a,formData:e,formSchema:n.fields,nodeKey:o,path:`${m}.lexical_internal_feature.blocks.${e.blockType}`,schemaPath:p})}):f(se,{className:$,collapsibleStyle:"default",header:n?.admin?.components?.Label?f(ae,{clientProps:{blockKind:"lexicalBlock",formData:e},mappedComponent:n.admin.components.Label}):f("div",{className:`${y}__block-header`,children:le("div",{children:[f(ne,{className:`${y}__block-pill ${y}__block-pill-${e?.blockType}`,pillStyle:"white",children:n&&typeof n.labels.singular=="string"?_e(n.labels.singular,C):n.slug}),f(re,{path:"blockName",readOnly:a?.admin?.readOnly})]})}),children:f(ce,{height:"35vh"})},0),[n,u,S,d,a,o,m,p,$,C]);return f("div",{className:y+" "+y+"-"+e.blockType,children:R})};export{We as BlockComponent};
2
- //# sourceMappingURL=component-BRCRMQID.js.map
1
+ "use client";import{b as T}from"./chunk-TXEIKM77.js";import{jsx as f,jsxs as le}from"react/jsx-runtime";import{Collapsible as se,Form as ie,Pill as ne,RenderComponent as ae,SectionTitle as re,ShimmerEffect as ce,useConfig as de,useDocumentInfo as me,useFieldProps as ue,useFormSubmitted as fe,useTranslation as pe}from"@payloadcms/ui";import{useCallback as be,useEffect as he,useMemo as ke,useState as ye}from"react";import{getTranslation as _e}from"@payloadcms/translations";import{getFormState as I}from"@payloadcms/ui/shared";import{v4 as Ce}from"uuid";import{jsx as k,jsxs as B}from"react/jsx-runtime";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as H}from"@payloadcms/translations";import{Button as W,Collapsible as z,ErrorPill as G,Pill as J,RenderComponent as Q,RenderFields as X,SectionTitle as Y,useDocumentInfo as Z,useFormSubmitted as ee,useTranslation as oe}from"@payloadcms/ui";import{dequal as te}from"dequal/lite";import{$getNodeByKey as O}from"lexical";import A,{useCallback as E}from"react";import{c as K}from"react/compiler-runtime";import{useAllFormFields as V}from"@payloadcms/ui";import{reduceFieldsToValues as D}from"payload/shared";import{useEffect as M}from"react";function w({fields:i}){for(let e in i){let o=i[e];Array.isArray(o.rows)&&"value"in o&&(o.disableFormData=!0)}return i}var j=i=>{let e=K(8),{onChange:o}=i,[l]=V(),d,s;e[0]!==l?(s=w({fields:l}),d=D(s,!0),e[0]=l,e[1]=d,e[2]=s):(d=e[1],s=e[2]);let m=d,t,a;return e[3]!==o||e[4]!==s||e[5]!==m?(t=()=>{o&&o({fullFieldsWithValues:s,newFormData:m})},a=[m,o,s],e[3]=o,e[4]=s,e[5]=m,e[6]=t,e[7]=a):(t=e[6],a=e[7]),M(t,a),null};function L(i){for(let e in i){let o=i[e];Array.isArray(o)&&!o?.length?delete i[e]:o&&typeof o=="object"?L(o):o==null&&delete i[e]}}var U=i=>{let{baseClass:e,clientBlock:o,field:l,formSchema:d,nodeKey:s,schemaPath:m}=i,{formData:t}=i,{i18n:a}=oe(),[u]=q(),{getDocPreferences:x,setDocFieldPreferences:P}=Z(),[p,N]=A.useState(()=>{let r=!1;return x().then(c=>{let h=c?.fields[l.name]?.collapsed;h&&h.includes(t.id)&&(r=!0,N(!0))}),r}),F=ee(),[n,S]=A.useState(0),C=F&&n>0,$=[`${e}__row`,C?`${e}__row--has-errors`:`${e}__row--no-errors`].filter(Boolean).join(" "),R=E(({fullFieldsWithValues:r,newFormData:c})=>{if(c.id=t.id,c.blockType=t.blockType,L(c),L(t),te(t,c)||setTimeout(()=>{u.update(()=>{let _=O(s);_&&(t=c,_.setFields(c))})},0),F){let _=0;for(let h of Object.values(r))h?.valid===!1&&_++;S(_)}},[u,s,F,t]),v=E(r=>{x().then(c=>{let h=c?.fields[l.name]?.collapsed,g=h&&h?.length?h:[];r?g.includes(t.id)||g.push(t.id):g.includes(t.id)&&g.splice(g.indexOf(t.id),1),P(l.name,{collapsed:g,hello:"hi"})})},[x,l.name,P,t.id]),b=E(()=>{u.update(()=>{O(s).remove()})},[u,s]);return B(A.Fragment,{children:[k(z,{className:$,collapsibleStyle:C?"error":"default",header:o?.admin?.components?.Label?k(Q,{clientProps:{blockKind:"lexicalBlock",formData:t},mappedComponent:o.admin.components.Label}):B("div",{className:`${e}__block-header`,children:[B("div",{children:[k(J,{className:`${e}__block-pill ${e}__block-pill-${t?.blockType}`,pillStyle:"white",children:typeof o?.labels.singular=="string"?H(o?.labels.singular,a):o.slug}),k(Y,{path:"blockName",readOnly:l?.admin?.readOnly}),C&&k(G,{count:n,i18n:a,withMessage:!0})]}),u.isEditable()&&k(W,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:l?.admin?.readOnly,icon:"x",onClick:r=>{r.preventDefault(),b()},round:!0,tooltip:"Remove Block"})]}),isCollapsed:p,onToggle:r=>{v(r),N(r)},children:k(X,{className:`${e}__fields`,fields:d,forceRender:!0,margins:"small",path:"",readOnly:!1,schemaPath:m})},0),k(j,{onChange:R})]})};var y="lexical-block",We=i=>{let{formData:e,nodeKey:o}=i,{config:l}=de(),d=fe(),{id:s}=me(),{path:m,schemaPath:t}=ue(),{field:a}=T(),[u,x]=ye(!1),{field:{richTextComponentMap:P}}=T(),p=`${t}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${e.blockType}`,n=P.get("lexical_internal_feature.blocks.fields.lexical_blocks")[0].blocks.find(v=>v.slug===e.blockType);he(()=>{e&&(async()=>{let b=await I({apiRoute:l.routes.api,body:{id:s,data:e,operation:"update",schemaPath:p},serverURL:l.serverURL});b&&(b.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},x(b))})()},[l.routes.api,l.serverURL,p,s]);let S=be(async({formState:v})=>{let b=await I({apiRoute:l.routes.api,body:{id:s,formState:v,operation:"update",schemaPath:p},serverURL:l.serverURL});return b.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},b},[l.routes.api,l.serverURL,s,p,e.blockName]),{i18n:C}=pe(),$=[`${y}__row`,`${y}__row--no-errors`].filter(Boolean).join(" "),R=ke(()=>n&&u!==!1?f(ie,{beforeSubmit:[S],fields:n.fields,initialState:u,onChange:[S],submitted:d,uuid:Ce(),children:f(U,{baseClass:y,clientBlock:n,field:a,formData:e,formSchema:n.fields,nodeKey:o,path:`${m}.lexical_internal_feature.blocks.${e.blockType}`,schemaPath:p})}):f(se,{className:$,collapsibleStyle:"default",header:n?.admin?.components?.Label?f(ae,{clientProps:{blockKind:"lexicalBlock",formData:e},mappedComponent:n.admin.components.Label}):f("div",{className:`${y}__block-header`,children:le("div",{children:[f(ne,{className:`${y}__block-pill ${y}__block-pill-${e?.blockType}`,pillStyle:"white",children:n&&typeof n.labels.singular=="string"?_e(n.labels.singular,C):n.slug}),f(re,{path:"blockName",readOnly:a?.admin?.readOnly})]})}),children:f(ce,{height:"35vh"})},0),[n,u,S,d,a,o,m,p,$,C]);return f("div",{className:y+" "+y+"-"+e.blockType,children:R})};export{We as BlockComponent};
2
+ //# sourceMappingURL=component-LHFD5Z33.js.map
@@ -0,0 +1,2 @@
1
+ "use client";import{a as T,b as U,c as A,f as P}from"./chunk-366OGJYE.js";import{b}from"./chunk-TXEIKM77.js";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{useLexicalComposerContext as ee}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as te}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as oe}from"@lexical/utils";import{getTranslation as I}from"@payloadcms/translations";import{Button as v,DrawerToggler as le,File as ae,formatDrawerSlug as re,useConfig as ie,useDocumentDrawer as ne,useEditDepth as se,useModal as de,usePayloadAPI as ce,useTranslation as ue}from"@payloadcms/ui";import{$getNodeByKey as w,$getSelection as me,$isNodeSelection as pe,CLICK_COMMAND as fe,COMMAND_PRIORITY_LOW as N,KEY_BACKSPACE_COMMAND as ge,KEY_DELETE_COMMAND as he}from"lexical";import{useCallback as f,useEffect as _e,useId as Ce,useReducer as De,useRef as be,useState as ve}from"react";var o="lexical-upload",K={depth:0},we=d=>{let{data:{fields:j,relationTo:S,value:n},nodeKey:a}=d;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:F},serverURL:k}}=ie(),g=be(null),{closeModal:$}=de(),{uuid:W}=b(),Y=se(),[l]=ee(),[r,h,x]=te(a),{editorConfig:z,field:_}=b(),{i18n:R,t:c}=ue(),[E,H]=De(e=>e+1,0),[i]=ve(()=>B.find(e=>e.slug===S)),q=Ce(),u=re({slug:"lexical-upload-drawer-"+W+q,depth:Y}),[G,J,{closeDrawer:y}]=ne({id:n,collectionSlug:i.slug}),[{data:m},{setParams:M}]=ce(`${k}${F}/${i.slug}/${n}`,{initialParams:K}),L=m?.thumbnailURL||m?.url,Q=f(()=>{l.update(()=>{w(a).remove()})},[l,a]),V=f(e=>{M({...K,cacheBust:E}),H(),y()},[M,E,y]),C=f(e=>{if(r&&pe(me())){e.preventDefault();let p=w(a);if(P(p))return p.remove(),!0}return!1},[r,a]);_e(()=>oe(l.registerCommand(fe,e=>e.target===g.current||g.current?.contains(e.target)?(e.shiftKey?h(!r):r||(x(),h(!0)),!0):!1,N),l.registerCommand(he,C,N),l.registerCommand(ge,C,N)),[x,l,r,a,C,h]);let O=z?.resolvedFeatureMap?.get("upload")?.sanitizedClientFeatureProps.collections?.[i.slug]?.hasExtraFields,X=f((e,p)=>{l.update(()=>{let D=w(a);if(D){let Z={...D.getData(),fields:p};D.setData(Z)}}),$(u)},[$,l,u,a]);return s("div",{className:[o,r&&`${o}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:g,children:[s("div",{className:`${o}__card`,children:[s("div",{className:`${o}__topRow`,children:[t("div",{className:`${o}__thumbnail`,children:L?t("img",{alt:m?.filename,"data-lexical-upload-id":n,"data-lexical-upload-relation-to":S,src:L}):t(ae,{})}),s("div",{className:`${o}__topRowRightPanel`,children:[t("div",{className:`${o}__collectionLabel`,children:I(i.labels.singular,R)}),l.isEditable()&&s("div",{className:`${o}__actions`,children:[O?t(le,{className:`${o}__upload-drawer-toggler`,disabled:_?.admin?.readOnly,slug:u,children:t(v,{buttonStyle:"icon-label",el:"div",icon:"edit",onClick:e=>{e.preventDefault()},round:!0,tooltip:c("fields:editRelationship")})}):null,t(v,{buttonStyle:"icon-label",disabled:_?.admin?.readOnly,el:"div",icon:"swap",onClick:()=>{l.dispatchCommand(A,{replace:{nodeKey:a}})},round:!0,tooltip:c("fields:swapUpload")}),t(v,{buttonStyle:"icon-label",className:`${o}__removeButton`,disabled:_?.admin?.readOnly,icon:"x",onClick:e=>{e.preventDefault(),Q()},round:!0,tooltip:c("fields:removeUpload")})]})]})]}),t("div",{className:`${o}__bottomRow`,children:t(J,{className:`${o}__doc-drawer-toggler`,children:t("strong",{children:m?.filename})})})]}),n?t(G,{onSave:V}):null,O?t(T,{data:j,drawerSlug:u,drawerTitle:c("general:editLabel",{label:I(i.labels.singular,R)}),featureKey:"upload",handleDrawerSubmit:X,schemaPathSuffix:i.slug}):null]})},Ie=d=>t(U,{...d,uploads:!0,children:t(we,{...d})});export{Ie as UploadComponent};
2
+ //# sourceMappingURL=component-UJILB3MH.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 { 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 DrawerToggler,\n File,\n formatDrawerSlug,\n useConfig,\n useDocumentDrawer,\n useEditDepth,\n useModal,\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 { 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 { closeModal } = useModal()\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 drawerSlug = 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 const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\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 closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\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 closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, 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 <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.admin?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.admin?.readOnly}\n el=\"div\"\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={drawerSlug}\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": "+JAGA,OAASA,6BAAAA,OAAiC,2CAC1C,OAASC,2BAAAA,OAA+B,4CACxC,OAASC,iBAAAA,OAAqB,iBAC9B,O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exicalNodeSelection", "mergeRegister", "getTranslation", "Button", "DrawerToggler", "File", "formatDrawerSlug", "useConfig", "useDocumentDrawer", "useEditDepth", "useModal", "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", "closeModal", "useModal", "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", "drawerSlug", "formatDrawerSlug", "DocumentDrawer", "DocumentDrawerToggler", "closeDrawer", "useDocumentDrawer", "id", "collectionSlug", "setParams", "usePayloadAPI", "thumbnailSRC", "thumbnailURL", "url", "removeUpload", "useCallback", "update", "$getNodeByKey", "remove", "updateUpload", "$onDelete", "event", "$isNodeSelection", "$getSelection", "preventDefault", "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", "DrawerToggler", "disabled", "admin", "readOnly", "Button", "buttonStyle", "el", "icon", "onClick", "e", "round", "tooltip", "dispatchCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "replace", "onSave", "FieldsDrawer", "drawerTitle", "label", "featureKey", "handleDrawerSubmit", "schemaPathSuffix", "UploadComponent", "EnabledRelationshipsCondition", "uploads"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{c as N,f as x}from"./chunk-XIBMVIFW.js";import{b as p}from"./chunk-MFAXC4ZA.js";import{jsx as a,jsxs as E}from"react/jsx-runtime";import{useCallback as f,useEffect as I,useRef as K}from"react";import{useLexicalComposerContext as L}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as S}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as $}from"@lexical/utils";import{getTranslation as M}from"@payloadcms/translations";import{Button as v,RenderComponent as h,useTranslation as A}from"@payloadcms/ui";import{$getNodeByKey as D,$getSelection as T,$isNodeSelection as P,CLICK_COMMAND as j,COMMAND_PRIORITY_LOW as b,KEY_BACKSPACE_COMMAND as Y,KEY_DELETE_COMMAND as z}from"lexical";var s="inline-block",le=y=>{let{formData:r,nodeKey:o}=y,[e]=L(),{i18n:C,t:k}=A(),{field:_}=p(),m=K(null),[l,c,d]=S(o),{field:{richTextComponentMap:O}}=p(),t=O.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(n=>n.slug===r.blockType),R=f(()=>{e.update(()=>{D(o).remove()})},[e,o]),u=f(n=>{if(l&&P(T())){n.preventDefault();let i=D(o);if(x(i))return i.remove(),!0}return!1},[l,o]),g=f(n=>{let i=n;return i.target===m.current||m.current?.contains(i.target)?(i.shiftKey?c(!l):l||(d(),c(!0)),!0):!1},[l,c,d]);I(()=>$(e.registerCommand(j,g,b),e.registerCommand(z,u,b),e.registerCommand(Y,u,b)),[d,e,l,o,u,c,g]);let B=t?.labels?.singular?M(t.labels.singular,C):t.slug;return E("div",{className:[s,s+"-"+r.blockType,l&&`${s}--selected`].filter(Boolean).join(" "),ref:m,children:[t?.admin?.components?.Label?a(h,{clientProps:{blockKind:"lexicalInlineBlock",formData:r},mappedComponent:t.admin.components.Label}):a("div",{children:M(t.labels?.singular,C)}),e.isEditable()&&E("div",{className:`${s}__actions`,children:[a(v,{buttonStyle:"icon-label",className:`${s}__editButton`,disabled:_?.admin?.readOnly,el:"div",icon:"edit",onClick:()=>{e.dispatchCommand(N,{fields:r,nodeKey:o})},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:edit",{label:B})}),a(v,{buttonStyle:"icon-label",className:`${s}__removeButton`,disabled:_?.admin?.readOnly,icon:"x",onClick:n=>{n.preventDefault(),R()},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:remove",{label:B})})]})]})};export{le as InlineBlockComponent};
2
- //# sourceMappingURL=componentInline-RETIC4OV.js.map
1
+ "use client";import{c as N,f as x}from"./chunk-7UTZDNYS.js";import{b as p}from"./chunk-TXEIKM77.js";import{jsx as a,jsxs as E}from"react/jsx-runtime";import{useCallback as f,useEffect as I,useRef as K}from"react";import{useLexicalComposerContext as L}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as S}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as $}from"@lexical/utils";import{getTranslation as M}from"@payloadcms/translations";import{Button as v,RenderComponent as h,useTranslation as A}from"@payloadcms/ui";import{$getNodeByKey as D,$getSelection as T,$isNodeSelection as P,CLICK_COMMAND as j,COMMAND_PRIORITY_LOW as b,KEY_BACKSPACE_COMMAND as Y,KEY_DELETE_COMMAND as z}from"lexical";var s="inline-block",le=y=>{let{formData:r,nodeKey:o}=y,[e]=L(),{i18n:C,t:k}=A(),{field:_}=p(),m=K(null),[l,c,d]=S(o),{field:{richTextComponentMap:O}}=p(),t=O.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(n=>n.slug===r.blockType),R=f(()=>{e.update(()=>{D(o).remove()})},[e,o]),u=f(n=>{if(l&&P(T())){n.preventDefault();let i=D(o);if(x(i))return i.remove(),!0}return!1},[l,o]),g=f(n=>{let i=n;return i.target===m.current||m.current?.contains(i.target)?(i.shiftKey?c(!l):l||(d(),c(!0)),!0):!1},[l,c,d]);I(()=>$(e.registerCommand(j,g,b),e.registerCommand(z,u,b),e.registerCommand(Y,u,b)),[d,e,l,o,u,c,g]);let B=t?.labels?.singular?M(t.labels.singular,C):t.slug;return E("div",{className:[s,s+"-"+r.blockType,l&&`${s}--selected`].filter(Boolean).join(" "),ref:m,children:[t?.admin?.components?.Label?a(h,{clientProps:{blockKind:"lexicalInlineBlock",formData:r},mappedComponent:t.admin.components.Label}):a("div",{children:M(t.labels?.singular,C)}),e.isEditable()&&E("div",{className:`${s}__actions`,children:[a(v,{buttonStyle:"icon-label",className:`${s}__editButton`,disabled:_?.admin?.readOnly,el:"div",icon:"edit",onClick:()=>{e.dispatchCommand(N,{fields:r,nodeKey:o})},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:edit",{label:B})}),a(v,{buttonStyle:"icon-label",className:`${s}__removeButton`,disabled:_?.admin?.readOnly,icon:"x",onClick:n=>{n.preventDefault(),R()},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:remove",{label:B})})]})]})};export{le as InlineBlockComponent};
2
+ //# sourceMappingURL=componentInline-JLMSR7BP.js.map
@@ -3,7 +3,6 @@ export { RichTextCell } from '../../cell/index.js';
3
3
  export { AlignFeatureClient } from '../../features/align/client/index.js';
4
4
  export { BlockquoteFeatureClient } from '../../features/blockquote/client/index.js';
5
5
  export { BlocksFeatureClient } from '../../features/blocks/client/index.js';
6
- export { createClientComponent } from '../../features/createClientComponent.js';
7
6
  export { TestRecorderFeatureClient } from '../../features/debug/testRecorder/client/index.js';
8
7
  export { TreeViewFeatureClient } from '../../features/debug/treeView/client/index.js';
9
8
  export { BoldFeatureClient } from '../../features/format/bold/feature.client.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAE5F,OAAO,EAAE,YAAY,EAAE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E,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6DAA6D,CAAA;AAElH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAE5E,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,qEAAqE,CAAA;AAE/G,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE9D,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,UAAU,GACX,MAAM,kDAAkD,CAAA;AAEzD,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,8DAA8D,CAAA;AAErE,OAAO,EACL,eAAe,EACf,WAAW,EACX,QAAQ,EACR,mBAAmB,GACpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,YAAY,GACb,MAAM,2CAA2C,CAAA;AAElD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,kDAAkD,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,E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