@payloadcms/richtext-lexical 3.0.0-beta.84 → 3.0.0-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +3 -3
- package/dist/field/index.js +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +12 -2
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +6 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{a as It,c as cl,e as dl,f as ul,g as pl,h as ml}from"./chunk-EBB2CEB6.js";import{a as Ne,b as Ft,c as Le,d as Oo,e as Ho}from"./chunk-LTR7V74A.js";import{a as ke,b as Xe,c as Ze,d as Je}from"./chunk-VMCQSR3T.js";import{a as we,b as Re,c as _e,d as Mt}from"./chunk-4EX7W4UX.js";import{a as le,b as Ye,c as Se,d as ve,e as Ie,f as Pt}from"./chunk-E4HH5PS6.js";import{a as al,b as A}from"./chunk-SQHN3N6E.js";function G(e){return{items:e,key:"basic",label:({i18n:t})=>t.t("lexical:general:slashMenuBasicGroupLabel")}}import{createHeadlessEditor as fl}from"@lexical/headless";import{useClientFunctions as gl,useTableCell as Cl}from"@payloadcms/ui";import{$getRoot as hl}from"lexical";import Dt,{useEffect as Go,useState as At}from"react";var Bo={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",codeHighlight:{atrule:"LexicalEditorTheme__tokenAttr",attr:"LexicalEditorTheme__tokenAttr",boolean:"LexicalEditorTheme__tokenProperty",builtin:"LexicalEditorTheme__tokenSelector",cdata:"LexicalEditorTheme__tokenComment",char:"LexicalEditorTheme__tokenSelector",class:"LexicalEditorTheme__tokenFunction","class-name":"LexicalEditorTheme__tokenFunction",comment:"LexicalEditorTheme__tokenComment",constant:"LexicalEditorTheme__tokenProperty",deleted:"LexicalEditorTheme__tokenProperty",doctype:"LexicalEditorTheme__tokenComment",entity:"LexicalEditorTheme__tokenOperator",function:"LexicalEditorTheme__tokenFunction",important:"LexicalEditorTheme__tokenVariable",inserted:"LexicalEditorTheme__tokenSelector",keyword:"LexicalEditorTheme__tokenAttr",namespace:"LexicalEditorTheme__tokenVariable",number:"LexicalEditorTheme__tokenProperty",operator:"LexicalEditorTheme__tokenOperator",prolog:"LexicalEditorTheme__tokenComment",property:"LexicalEditorTheme__tokenProperty",punctuation:"LexicalEditorTheme__tokenPunctuation",regex:"LexicalEditorTheme__tokenVariable",selector:"LexicalEditorTheme__tokenSelector",string:"LexicalEditorTheme__tokenSelector",symbol:"LexicalEditorTheme__tokenProperty",tag:"LexicalEditorTheme__tokenProperty",url:"LexicalEditorTheme__tokenOperator",variable:"LexicalEditorTheme__tokenVariable"},embedBlock:{base:"LexicalEditorTheme__embedBlock",focus:"LexicalEditorTheme__embedBlockFocus"},hashtag:"LexicalEditorTheme__hashtag",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",indent:"LexicalEditorTheme__indent",inlineImage:"LexicalEditor__inline-image",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellEditing:"LexicalEditorTheme__tableCellEditing",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellPrimarySelected:"LexicalEditorTheme__tableCellPrimarySelected",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableCellSortedIndicator:"LexicalEditorTheme__tableCellSortedIndicator",tableResizeRuler:"LexicalEditorTheme__tableCellResizeRuler",tableSelected:"LexicalEditorTheme__tableSelected",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"editor-upload"};var Fe={namespace:"lexical",theme:Bo};function qe({clientFunctions:e,schemaPath:t,unSanitizedEditorConfig:o}){for(let l of o.features)if(!l?.clientFeatureProps?.featureKey||l?.clientFeatureProps?.order===void 0||l?.clientFeatureProps?.order===null)throw new Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");o.features=o.features.sort((l,a)=>l.clientFeatureProps.order-a.clientFeatureProps.order);let n=new Map(o.features.map(l=>[l.clientFeatureProps.featureKey,l])),r=new Map,i=0;for(let l of o.features){let a={};Object.entries(e).forEach(([c,d])=>{if(c.startsWith(`lexicalFeature.${t}.${l.clientFeatureProps.featureKey}.components.`)){let p=c.split(`${t}.${l.clientFeatureProps.featureKey}.components.`)[1];a[p]=d}});let s=typeof l.feature=="function"?l.feature({clientFunctions:a,featureProviderMap:n,resolvedFeatures:r,unSanitizedEditorConfig:o}):l.feature;r.set(l.clientFeatureProps.featureKey,{...s,key:l.clientFeatureProps.featureKey,order:i}),i++}return r}var $o=e=>{let t={enabledFeatures:[],hooks:{load:[],save:[]},markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}};if(!e?.size)return t;e.forEach(o=>{if(o.hooks&&(o.hooks?.load?.length&&(t.hooks.load=t.hooks.load.concat(o.hooks.load)),o.hooks?.save?.length&&(t.hooks.save=t.hooks.save.concat(o.hooks.save))),o.providers?.length&&(t.providers=t.providers.concat(o.providers)),o.nodes?.length&&(t.nodes=t.nodes.concat(o.nodes)),o.plugins?.length&&o.plugins.forEach((n,r)=>{t.plugins.push({Component:n.Component,clientProps:o.sanitizedClientFeatureProps,key:o.key+r,position:n.position})}),o.toolbarInline?.groups?.length)for(let n of o.toolbarInline.groups){let r=t.toolbarInline.groups.find(i=>i.key===n.key);r?t.toolbarInline.groups=t.toolbarInline.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.toolbarInline?.groups.push(r)}if(o.toolbarFixed?.groups?.length)for(let n of o.toolbarFixed.groups){let r=t.toolbarFixed.groups.find(i=>i.key===n.key);r?t.toolbarFixed.groups=t.toolbarFixed.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.toolbarFixed?.groups.push(r)}if(o.slashMenu?.groups){o.slashMenu.dynamicGroups?.length&&(t.slashMenu.dynamicGroups=t.slashMenu.dynamicGroups.concat(o.slashMenu.dynamicGroups));for(let n of o.slashMenu.groups){let r=t.slashMenu.groups.find(i=>i.key===n.key);r?t.slashMenu.groups=t.slashMenu.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.slashMenu.groups.push(r)}}o.markdownTransformers?.length&&(t.markdownTransformers=t.markdownTransformers.concat(o.markdownTransformers)),t.enabledFeatures.push(o.key)}),t.toolbarInline.groups.sort((o,n)=>o.order&&n.order?o.order-n.order:o.order?-1:n.order?1:0),t.toolbarFixed.groups.sort((o,n)=>o.order&&n.order?o.order-n.order:o.order?-1:n.order?1:0);for(let o of t.toolbarInline.groups)o.items.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let o of t.toolbarFixed.groups)o.items.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);return t};function Me(e,t,o){return{admin:o,features:$o(t),lexical:e,resolvedFeatureMap:t}}import{jsx as Uo,jsxs as xl}from"react/jsx-runtime";var bl=e=>{let{admin:t,field:{_schemaPath:o,richTextComponentMap:n},lexicalEditorConfig:r}=e,[i,l]=Dt.useState("Loading..."),{cellData:a}=Cl(),s=gl(),[c,d]=At(!1),[p,u]=At([]),[m,f]=At(null),C=n.get("features").sort((x,F)=>x.order-F.order),E=0;for(let x of C){let F=Array.from(n.keys()).filter(M=>M.startsWith(`feature.${x.key}.components.`));E+=1,E+=F.length}return Go(()=>{if(!c){let x=[],F=0;if(Object.entries(s).forEach(([M,T])=>{M.startsWith(`lexicalFeature.${o}.`)&&(M.includes(".lexical_internal_components.")||x.push(T),F++)}),F===E){u(x),d(!0);let M=qe({clientFunctions:s,schemaPath:o,unSanitizedEditorConfig:{features:x,lexical:r}});f(Me(r||Fe,M,t))}}},[t,C,c,s,o,C.length,p,m,r,n,E]),Go(()=>{if(!c)return;let x=a;if(x==null||!c||!m){l("");return}if(m?.features?.hooks?.load?.length&&m.features.hooks.load.forEach(T=>{x=T({incomingEditorState:x})}),!x||typeof x!="object"){l("");return}if(Array.isArray(x)&&!("root"in x)){l("");return}if("jsonContent"in x){l("");return}let F=fl({namespace:m.lexical.namespace,nodes:It({editorConfig:m}),theme:m.lexical.theme});F.setEditorState(F.parseEditorState(x));let M=F.getEditorState().read(()=>hl().getTextContent())||"";l(M)},[a,r,c,m]),c?Uo("span",{children:i}):Uo(Dt.Fragment,{children:Array.isArray(C)&&C.map(x=>{let M=Array.from(n.keys()).filter(T=>T.startsWith(`lexical_internal_feature.${x.key}.lexical_internal_components.`)).map(T=>n.get(T));return xl(Dt.Fragment,{children:[M?.length?M.map(T=>T):null,x.ClientFeature]},x.key)})})};import{$isElementNode as re,$isRangeSelection as et,FORMAT_ELEMENT_COMMAND as tt}from"lexical";import{jsx as Ot,jsxs as Tl}from"react/jsx-runtime";var Wo=()=>Tl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ot("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ot("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ot("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Ht,jsxs as El}from"react/jsx-runtime";var Vo=()=>El("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ht("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Bt,jsxs as yl}from"react/jsx-runtime";var Qe=()=>yl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Bt("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as $t,jsxs as Nl}from"react/jsx-runtime";var zo=()=>Nl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[$t("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),$t("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),$t("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{useAddClientFunction as Ll,useFieldProps as kl,useTableCell as wl}from"@payloadcms/ui";var Ko=(e,t)=>{let{schemaPath:o}=kl(),i=wl()?.cellProps?.field?._schemaPath||o;Ll(`lexicalFeature.${i}.${e}`,t)};var Gt=e=>t=>(Ko(t.featureKey,e(t)),null);var k=e=>Gt(o=>{let n={clientFeatureProps:o};return typeof e=="function"?n.feature=({clientFunctions:r,featureProviderMap:i,resolvedFeatures:l,unSanitizedEditorConfig:a})=>{let s=e({clientFunctions:r,featureProviderMap:i,props:o,resolvedFeatures:l,unSanitizedEditorConfig:a});return s.sanitizedClientFeatureProps===null&&(s.sanitizedClientFeatureProps=o),s}:(e.sanitizedClientFeatureProps=o,n.feature=e),n});var jo=e=>({type:"dropdown",ChildComponent:Qe,items:e,key:"align",order:30});var Xo=[jo([{ChildComponent:Qe,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="left")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:e})=>e.t("lexical:align:alignLeftLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"left")},order:1},{ChildComponent:Wo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="center")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:e})=>e.t("lexical:align:alignCenterLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"center")},order:2},{ChildComponent:zo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="right")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:e})=>e.t("lexical:align:alignRightLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"right")},order:3},{ChildComponent:Vo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="justify")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:e})=>e.t("lexical:align:alignJustifyLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"justify")},order:4}])],Rl=k({toolbarFixed:{groups:Xo},toolbarInline:{groups:Xo}});import{$createQuoteNode as tn,$isQuoteNode as Qo,QuoteNode as Il}from"@lexical/rich-text";import{$setBlocksType as on}from"@lexical/selection";import{$getSelection as nn,$isRangeSelection as Fl}from"lexical";import{jsx as Zo}from"react/jsx-runtime";var Ut=()=>Zo("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Zo("path",{d:"M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",fill:"currentColor"})});import{jsx as Jo}from"react/jsx-runtime";var Pe=()=>Jo("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Jo("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})});var V=e=>({type:"dropdown",ChildComponent:Pe,items:e,key:"text",order:25});import{$createQuoteNode as _l,$isQuoteNode as Yo,QuoteNode as Sl}from"@lexical/rich-text";import{$createLineBreakNode as vl}from"lexical";var qo={type:"element",dependencies:[Sl],export:(e,t)=>{if(!Yo(e))return null;let o=t(e).split(`
|
|
1
|
+
"use client";import{a as It,c as cl,e as dl,f as ul,g as pl,h as ml}from"./chunk-EBB2CEB6.js";import{a as Ne,b as Ft,c as Le,d as Oo,e as Ho}from"./chunk-LTR7V74A.js";import{a as ke,b as Xe,c as Ze,d as Je}from"./chunk-VMCQSR3T.js";import{a as we,b as Re,c as _e,d as Mt}from"./chunk-4EX7W4UX.js";import{a as le,b as Ye,c as Se,d as ve,e as Ie,f as Pt}from"./chunk-E4HH5PS6.js";import{a as al,b as A}from"./chunk-SQHN3N6E.js";function G(e){return{items:e,key:"basic",label:({i18n:t})=>t.t("lexical:general:slashMenuBasicGroupLabel")}}import{createHeadlessEditor as fl}from"@lexical/headless";import{useClientFunctions as gl,useTableCell as Cl}from"@payloadcms/ui";import{$getRoot as hl}from"lexical";import Dt,{useEffect as Go,useState as At}from"react";var Bo={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",codeHighlight:{atrule:"LexicalEditorTheme__tokenAttr",attr:"LexicalEditorTheme__tokenAttr",boolean:"LexicalEditorTheme__tokenProperty",builtin:"LexicalEditorTheme__tokenSelector",cdata:"LexicalEditorTheme__tokenComment",char:"LexicalEditorTheme__tokenSelector",class:"LexicalEditorTheme__tokenFunction","class-name":"LexicalEditorTheme__tokenFunction",comment:"LexicalEditorTheme__tokenComment",constant:"LexicalEditorTheme__tokenProperty",deleted:"LexicalEditorTheme__tokenProperty",doctype:"LexicalEditorTheme__tokenComment",entity:"LexicalEditorTheme__tokenOperator",function:"LexicalEditorTheme__tokenFunction",important:"LexicalEditorTheme__tokenVariable",inserted:"LexicalEditorTheme__tokenSelector",keyword:"LexicalEditorTheme__tokenAttr",namespace:"LexicalEditorTheme__tokenVariable",number:"LexicalEditorTheme__tokenProperty",operator:"LexicalEditorTheme__tokenOperator",prolog:"LexicalEditorTheme__tokenComment",property:"LexicalEditorTheme__tokenProperty",punctuation:"LexicalEditorTheme__tokenPunctuation",regex:"LexicalEditorTheme__tokenVariable",selector:"LexicalEditorTheme__tokenSelector",string:"LexicalEditorTheme__tokenSelector",symbol:"LexicalEditorTheme__tokenProperty",tag:"LexicalEditorTheme__tokenProperty",url:"LexicalEditorTheme__tokenOperator",variable:"LexicalEditorTheme__tokenVariable"},embedBlock:{base:"LexicalEditorTheme__embedBlock",focus:"LexicalEditorTheme__embedBlockFocus"},hashtag:"LexicalEditorTheme__hashtag",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",indent:"LexicalEditorTheme__indent",inlineImage:"LexicalEditor__inline-image",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellEditing:"LexicalEditorTheme__tableCellEditing",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellPrimarySelected:"LexicalEditorTheme__tableCellPrimarySelected",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableCellSortedIndicator:"LexicalEditorTheme__tableCellSortedIndicator",tableResizeRuler:"LexicalEditorTheme__tableCellResizeRuler",tableSelected:"LexicalEditorTheme__tableSelected",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"editor-upload"};var Fe={namespace:"lexical",theme:Bo};function qe({clientFunctions:e,schemaPath:t,unSanitizedEditorConfig:o}){for(let l of o.features)if(!l?.clientFeatureProps?.featureKey||l?.clientFeatureProps?.order===void 0||l?.clientFeatureProps?.order===null)throw new Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");o.features=o.features.sort((l,a)=>l.clientFeatureProps.order-a.clientFeatureProps.order);let n=new Map(o.features.map(l=>[l.clientFeatureProps.featureKey,l])),r=new Map,i=0;for(let l of o.features){let a={};Object.entries(e).forEach(([c,d])=>{if(c.startsWith(`lexicalFeature.${t}.${l.clientFeatureProps.featureKey}.components.`)){let p=c.split(`${t}.${l.clientFeatureProps.featureKey}.components.`)[1];a[p]=d}});let s=typeof l.feature=="function"?l.feature({clientFunctions:a,featureProviderMap:n,resolvedFeatures:r,unSanitizedEditorConfig:o}):l.feature;r.set(l.clientFeatureProps.featureKey,{...s,key:l.clientFeatureProps.featureKey,order:i}),i++}return r}var $o=e=>{let t={enabledFeatures:[],hooks:{load:[],save:[]},markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}};if(!e?.size)return t;e.forEach(o=>{if(o.hooks&&(o.hooks?.load?.length&&(t.hooks.load=t.hooks.load.concat(o.hooks.load)),o.hooks?.save?.length&&(t.hooks.save=t.hooks.save.concat(o.hooks.save))),o.providers?.length&&(t.providers=t.providers.concat(o.providers)),o.nodes?.length&&(t.nodes=t.nodes.concat(o.nodes)),o.plugins?.length&&o.plugins.forEach((n,r)=>{t.plugins.push({Component:n.Component,clientProps:o.sanitizedClientFeatureProps,key:o.key+r,position:n.position})}),o.toolbarInline?.groups?.length)for(let n of o.toolbarInline.groups){let r=t.toolbarInline.groups.find(i=>i.key===n.key);r?t.toolbarInline.groups=t.toolbarInline.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.toolbarInline?.groups.push(r)}if(o.toolbarFixed?.groups?.length)for(let n of o.toolbarFixed.groups){let r=t.toolbarFixed.groups.find(i=>i.key===n.key);r?t.toolbarFixed.groups=t.toolbarFixed.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.toolbarFixed?.groups.push(r)}if(o.slashMenu?.groups){o.slashMenu.dynamicGroups?.length&&(t.slashMenu.dynamicGroups=t.slashMenu.dynamicGroups.concat(o.slashMenu.dynamicGroups));for(let n of o.slashMenu.groups){let r=t.slashMenu.groups.find(i=>i.key===n.key);r?t.slashMenu.groups=t.slashMenu.groups.filter(i=>i.key!==n.key):r={...n,items:[]},n?.items?.length&&(r.items=r.items.concat(n.items)),t.slashMenu.groups.push(r)}}o.markdownTransformers?.length&&(t.markdownTransformers=t.markdownTransformers.concat(o.markdownTransformers)),t.enabledFeatures.push(o.key)}),t.toolbarInline.groups.sort((o,n)=>o.order&&n.order?o.order-n.order:o.order?-1:n.order?1:0),t.toolbarFixed.groups.sort((o,n)=>o.order&&n.order?o.order-n.order:o.order?-1:n.order?1:0);for(let o of t.toolbarInline.groups)o.items.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let o of t.toolbarFixed.groups)o.items.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);return t};function Me(e,t,o){return{admin:o,features:$o(t),lexical:e,resolvedFeatureMap:t}}import{jsx as Uo,jsxs as xl}from"react/jsx-runtime";var bl=e=>{let{admin:t,field:{_schemaPath:o,richTextComponentMap:n},lexicalEditorConfig:r}=e,[i,l]=Dt.useState("Loading..."),{cellData:a}=Cl(),s=gl(),[c,d]=At(!1),[p,u]=At([]),[m,f]=At(null),C=n.get("features").sort((x,F)=>x.order-F.order),E=0;for(let x of C){let F=Array.from(n.keys()).filter(M=>M.startsWith(`feature.${x.key}.components.`));E+=1,E+=F.length}return Go(()=>{if(!c){let x=[],F=0;if(Object.entries(s).forEach(([M,T])=>{M.startsWith(`lexicalFeature.${o}.`)&&(M.includes(".lexical_internal_components.")||x.push(T),F++)}),F===E){u(x),d(!0);let M=qe({clientFunctions:s,schemaPath:o,unSanitizedEditorConfig:{features:x,lexical:r}});f(Me(r||Fe,M,t))}}},[t,C,c,s,o,C.length,p,m,r,n,E]),Go(()=>{if(!c)return;let x=a;if(x==null||!c||!m){l("");return}if(m?.features?.hooks?.load?.length&&m.features.hooks.load.forEach(T=>{x=T({incomingEditorState:x})}),!x||typeof x!="object"){l("");return}if(Array.isArray(x)&&!("root"in x)){l("");return}if("jsonContent"in x){l("");return}let F=fl({namespace:m.lexical.namespace,nodes:It({editorConfig:m}),theme:m.lexical.theme});F.setEditorState(F.parseEditorState(x));let M=F.getEditorState().read(()=>hl().getTextContent())||"";l(M)},[a,r,c,m]),c?Uo("span",{children:i}):Uo(Dt.Fragment,{children:Array.isArray(C)&&C.map(x=>{let M=Array.from(n.keys()).filter(T=>T.startsWith(`lexical_internal_feature.${x.key}.lexical_internal_components.`)).map(T=>n.get(T));return xl(Dt.Fragment,{children:[M?.length?M.map(T=>T):null,x.ClientFeature]},x.key)})})};import{$isElementNode as re,$isRangeSelection as et,FORMAT_ELEMENT_COMMAND as tt}from"lexical";import{jsx as Ot,jsxs as Tl}from"react/jsx-runtime";var Wo=()=>Tl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ot("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ot("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ot("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Ht,jsxs as El}from"react/jsx-runtime";var Vo=()=>El("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ht("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ht("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Bt,jsxs as yl}from"react/jsx-runtime";var Qe=()=>yl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Bt("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Bt("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as $t,jsxs as Nl}from"react/jsx-runtime";var zo=()=>Nl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[$t("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),$t("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),$t("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{useAddClientFunction as Ll,useFieldProps as kl,useTableCell as wl}from"@payloadcms/ui";var Ko=(e,t)=>{let{schemaPath:o}=kl(),i=wl()?.cellProps?.field?._schemaPath||o;Ll(`lexicalFeature.${i}.${e}`,t)};var Gt=e=>t=>(Ko(t.featureKey,e(t)),null);var k=e=>Gt(o=>{let n={clientFeatureProps:o};if(typeof e=="function")n.feature=({clientFunctions:r,featureProviderMap:i,resolvedFeatures:l,unSanitizedEditorConfig:a})=>{let s=e({clientFunctions:r,featureProviderMap:i,props:o,resolvedFeatures:l,unSanitizedEditorConfig:a});return s.sanitizedClientFeatureProps===null&&(s.sanitizedClientFeatureProps=o),s};else{let r={...e};r.sanitizedClientFeatureProps=o,n.feature=r}return n});var jo=e=>({type:"dropdown",ChildComponent:Qe,items:e,key:"align",order:30});var Xo=[jo([{ChildComponent:Qe,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="left")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:e})=>e.t("lexical:align:alignLeftLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"left")},order:1},{ChildComponent:Wo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="center")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:e})=>e.t("lexical:align:alignCenterLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"center")},order:2},{ChildComponent:zo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="right")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:e})=>e.t("lexical:align:alignRightLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"right")},order:3},{ChildComponent:Vo,isActive:({selection:e})=>{if(!et(e))return!1;for(let t of e.getNodes()){if(re(t)&&t.getFormatType()==="justify")continue;let o=t.getParent();if(!(re(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:e})=>e.t("lexical:align:alignJustifyLabel"),onSelect:({editor:e})=>{e.dispatchCommand(tt,"justify")},order:4}])],Rl=k({toolbarFixed:{groups:Xo},toolbarInline:{groups:Xo}});import{$createQuoteNode as tn,$isQuoteNode as Qo,QuoteNode as Il}from"@lexical/rich-text";import{$setBlocksType as on}from"@lexical/selection";import{$getSelection as nn,$isRangeSelection as Fl}from"lexical";import{jsx as Zo}from"react/jsx-runtime";var Ut=()=>Zo("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Zo("path",{d:"M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",fill:"currentColor"})});import{jsx as Jo}from"react/jsx-runtime";var Pe=()=>Jo("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Jo("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})});var V=e=>({type:"dropdown",ChildComponent:Pe,items:e,key:"text",order:25});import{$createQuoteNode as _l,$isQuoteNode as Yo,QuoteNode as Sl}from"@lexical/rich-text";import{$createLineBreakNode as vl}from"lexical";var qo={type:"element",dependencies:[Sl],export:(e,t)=>{if(!Yo(e))return null;let o=t(e).split(`
|
|
2
2
|
`),n=[];for(let r of o)n.push("> "+r);return n.join(`
|
|
3
3
|
`)},regExp:/^>\s/,replace:(e,t,o,n)=>{if(n){let i=e.getPreviousSibling();if(Yo(i)){i.splice(i.getChildrenSize(),0,[vl(),...t]),i.select(0,0),e.remove();return}}let r=_l();r.append(...t),e.replace(r),r.select(0,0)}};var en=[V([{ChildComponent:Ut,isActive:({selection:e})=>{if(!Fl(e))return!1;for(let t of e.getNodes())if(!Qo(t)&&!Qo(t.getParent()))return!1;return!0},key:"blockquote",label:({i18n:e})=>e.t("lexical:blockquote:label"),onSelect:({editor:e})=>{e.update(()=>{let t=nn();on(t,()=>tn())})},order:20}])],Ml=k({markdownTransformers:[qo],nodes:[Il],slashMenu:{groups:[G([{Icon:Ut,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:e})=>e.t("lexical:blockquote:label"),onSelect:({editor:e})=>{e.update(()=>{let t=nn();on(t,()=>tn())})}}])]},toolbarFixed:{groups:en},toolbarInline:{groups:en}});import{getTranslation as it}from"@payloadcms/translations";import{jsx as Wt,jsxs as Pl}from"react/jsx-runtime";var ot=()=>Pl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Wt("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),Wt("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),Wt("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{jsx as rn}from"react/jsx-runtime";var nt=()=>rn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rn("path",{clipRule:"evenodd",d:"M5.33333 6.5C5.11232 6.5 4.90036 6.5878 4.74408 6.74408C4.5878 6.90036 4.5 7.11232 4.5 7.33333V12.1667C4.5 12.3877 4.5878 12.5996 4.74408 12.7559C4.90036 12.9122 5.11232 13 5.33333 13H14.6667C14.8877 13 15.0996 12.9122 15.2559 12.7559C15.4122 12.5996 15.5 12.3877 15.5 12.1667V11.6667C15.5 11.3905 15.7239 11.1667 16 11.1667C16.2761 11.1667 16.5 11.3905 16.5 11.6667V12.1667C16.5 12.6529 16.3068 13.1192 15.963 13.463C15.6192 13.8068 15.1529 14 14.6667 14H5.33333C4.8471 14 4.38079 13.8068 4.03697 13.463C3.69315 13.1192 3.5 12.6529 3.5 12.1667V7.33333C3.5 6.8471 3.69315 6.38079 4.03697 6.03697C4.38079 5.69315 4.8471 5.5 5.33333 5.5H10.3333C10.6095 5.5 10.8333 5.72386 10.8333 6C10.8333 6.27614 10.6095 6.5 10.3333 6.5H5.33333ZM13 6.5C12.7239 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.7239 5.5 13 5.5H16C16.2761 5.5 16.5 5.72386 16.5 6V9C16.5 9.27614 16.2761 9.5 16 9.5C15.7239 9.5 15.5 9.27614 15.5 9V7.20711L13.3536 9.35355C13.1583 9.54882 12.8417 9.54882 12.6464 9.35355C12.4512 9.15829 12.4512 8.84171 12.6464 8.64645L14.7929 6.5H13ZM6.16699 8.33325C6.16699 8.05711 6.39085 7.83325 6.66699 7.83325H11.0003C11.2765 7.83325 11.5003 8.05711 11.5003 8.33325C11.5003 8.60939 11.2765 8.83325 11.0003 8.83325H6.66699C6.39085 8.83325 6.16699 8.60939 6.16699 8.33325ZM6.16699 10.9999C6.16699 10.7238 6.39085 10.4999 6.66699 10.4999H13.3337C13.6098 10.4999 13.8337 10.7238 13.8337 10.9999C13.8337 11.2761 13.6098 11.4999 13.3337 11.4999H6.66699C6.39085 11.4999 6.16699 11.2761 6.16699 10.9999Z",fill:"currentColor",fillRule:"evenodd"})});import Bl from"bson-objectid";import $l from"react";import{DecoratorBlockNode as Dl}from"@lexical/react/LexicalDecoratorBlockNode.js";import Al from"bson-objectid";import{deepCopyObjectSimple as Ol}from"payload/shared";var De=class extends Dl{__fields;constructor({fields:t,format:o,key:n}){super(o,n),this.__fields=t}static clone(t){return new this({fields:t.__fields,format:t.__format,key:t.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(t){t.version===1&&(t={...t,fields:{...t.fields.data},version:2});let o=Hl(t.fields);return o.setFormat(t.format),o}static isInline(){return!1}decorate(t,o){return null}exportDOM(){let t=document.createElement("div"),o=document.createTextNode(this.getTextContent());return t.append(o),{element:t}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields(),version:2}}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(t){let o=Ol(t),n=this.getWritable();n.__fields=o}};function Hl(e){return new De({fields:{...e,id:e?.id||new Al.default().toHexString()}})}import{jsx as Wl}from"react/jsx-runtime";var Gl=$l.lazy(()=>import("./component-6C5JERGA.js").then(e=>({default:e.BlockComponent}))),J=class extends De{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importJSON(t){t.version===1&&(t={...t,fields:{...t.fields.data},version:2});let o=rt(t.fields);return o.setFormat(t.format),o}decorate(t,o){return Wl(Gl,{formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function rt(e){return new J({fields:{...e,id:e?.id||new Bl.default().toHexString()}})}function Ul(e){return e instanceof J}import{useLexicalComposerContext as Vl}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as zl,$wrapNodeInElement as Kl,mergeRegister as jl}from"@lexical/utils";import{getTranslation as Xl}from"@payloadcms/translations";import{formatDrawerSlug as Zl,useEditDepth as Jl,useFieldProps as Yl,useModal as ql,useTranslation as Ql}from"@payloadcms/ui";import{$createParagraphNode as es,$getNodeByKey as ts,$getPreviousSelection as os,$getSelection as ln,$insertNodes as ns,$isParagraphNode as sn,$isRangeSelection as an,$isRootOrShadowRoot as rs,COMMAND_PRIORITY_EDITOR as Vt}from"lexical";import{useEffect as is,useState as zt}from"react";import{jsx as ls}from"react/jsx-runtime";var cn=()=>{let[e]=Vl(),{closeModal:t,toggleModal:o}=ql(),[n,r]=zt(null),[i,l]=zt(""),[a,s]=zt(null),{i18n:c,t:d}=Ql(),{schemaPath:p}=Yl(),{uuid:u}=A(),m=Jl(),f=Zl({slug:"lexical-inlineBlocks-create-"+u,depth:m}),{field:{richTextComponentMap:C}}=A();if(is(()=>{if(!e.hasNodes([J]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return jl(e.registerCommand(Ne,y=>(e.update(()=>{let h=ln()||os();if(an(h)){let w=rt(y);zl(w);let{focus:I}=h,v=I.getNode();sn(v)&&v.getTextContentSize()===0&&v.getParent().getChildren().filter(L=>sn(L)).length>1&&v.remove()}}),!0),Vt),e.registerCommand(Ft,y=>{if(a){let w=ts(a);return w?(w.setFields(y),s(null),!0):!1}let h=Ho(y);return ns([h]),rs(h.getParentOrThrow())&&Kl(h,es).selectEnd(),!0},Vt),e.registerCommand(Le,({fields:y,nodeKey:h})=>{if(r(y??null),s(h??null),l(y?.blockType??""),h)return o(f),!0;let w=null;return e.getEditorState().read(()=>{let I=ln();an(I)&&(w=I)}),w&&o(f),!0},Vt))},[e,a,o,f]),!n)return null;let E=`${p}.lexical_internal_feature.blocks.lexical_inline_blocks.lexical_inline_blocks.${n?.blockType}`,x="lexical_internal_feature.blocks.fields.lexical_inline_blocks",F=C.has(x)?C.get(x)[0]:null,M=F?F.blocks.find(y=>y.slug===n?.blockType):null;if(!F)return null;let T=M?.labels?.singular?Xl(M?.labels?.singular,c):M?.slug;return ls(le,{data:n,drawerSlug:f,drawerTitle:d(`lexical:blocks:inlineBlocks:${n?.id?"edit":"create"}`,{label:T??d("lexical:blocks:inlineBlocks:label")}),featureKey:"blocks",fieldMapOverride:M?.fields,handleDrawerSubmit:(y,h)=>{t(f),h&&(h.blockType=i,e.dispatchCommand(Ft,h))},schemaFieldsPathOverride:E,schemaPathSuffix:n?.blockType})};var ss=k(({props:e})=>({nodes:[J,Oo],plugins:[{Component:cn,position:"normal"}],sanitizedClientFeatureProps:e,slashMenu:{groups:[e.clientBlockSlugs?.length?{items:e.clientBlockSlugs.map(t=>({Icon:ot,key:"block-"+t,keywords:["block","blocks",t],label:({i18n:o,richTextComponentMap:n})=>{let l=n.get("lexical_internal_feature.blocks.fields.lexical_blocks")[0].blocks.find(s=>s.slug===t);return l.labels.singular?it(l.labels.singular,o):l.slug},onSelect:({editor:o})=>{o.dispatchCommand(Ne,{id:null,blockName:"",blockType:t})}})),key:"blocks",label:({i18n:t})=>t.t("lexical:blocks:label")}:null,e.clientInlineBlockSlugs?.length?{items:e.clientInlineBlockSlugs.map(t=>({Icon:nt,key:"inlineBlocks-"+t,keywords:["inlineBlock","inline block",t],label:({i18n:o,richTextComponentMap:n})=>{let l=n.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(s=>s.slug===t);return l.labels.singular?it(l.labels.singular,o):l.slug},onSelect:({editor:o})=>{o.dispatchCommand(Le,{fields:{id:null,blockName:"",blockType:t}})}})),key:"inlineBlocks",label:({i18n:t})=>t.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[e.clientBlockSlugs?.length?{type:"dropdown",ChildComponent:ot,items:e.clientBlockSlugs.map((t,o)=>({ChildComponent:ot,isActive:void 0,key:"block-"+t,label:({i18n:n,richTextComponentMap:r})=>{let a=r.get("lexical_internal_feature.blocks.fields.lexical_blocks")[0].blocks.find(c=>c.slug===t);return a.labels.singular?it(a.labels.singular,n):a.slug},onSelect:({editor:n})=>{n.dispatchCommand(Ne,{id:null,blockName:"",blockType:t})},order:o})),key:"blocks",order:20}:null,e.clientInlineBlockSlugs?.length?{type:"dropdown",ChildComponent:nt,items:e.clientInlineBlockSlugs.map((t,o)=>({ChildComponent:nt,isActive:void 0,key:"inlineBlock-"+t,label:({i18n:n,richTextComponentMap:r})=>{let a=r.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(c=>c.slug===t);return a.labels.singular?it(a.labels.singular,n):a.slug},onSelect:({editor:n})=>{n.dispatchCommand(Le,{fields:{blockType:t}})},order:o})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}));import{useLexicalComposerContext as ds}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as us,$createTextNode as ps,$getRoot as ms}from"lexical";import*as fn from"react";import{useCallback as se,useEffect as Kt,useLayoutEffect as un,useRef as jt,useState as lt}from"react";var K=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var as=K&&"documentMode"in document?document.documentMode:null,dn=K&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Lg=K&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),kg=K&&"InputEvent"in window&&!as?"getTargetRanges"in new window.InputEvent("input"):!1,wg=K&&/Version\/[\d.].*Safari/.test(navigator.userAgent),Rg=K&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_g=K&&/Android/.test(navigator.userAgent),Sg=K&&/Win/.test(navigator.platform),cs=K&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vg=K&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!cs;import{jsx as ae,jsxs as Xt}from"react/jsx-runtime";var fs=e=>{let t=document.createElement("textarea");t.value=e||"",t.style.position="absolute",t.style.opacity="0",document.body?.appendChild(t),t.focus(),t.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(t)},gs=(e,t)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t||"")),o.setAttribute("download",e),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Cs=e=>{let o=((n,r)=>{switch(n){case"click":return` await page.mouse.click(${r.x}, ${r.y});`;case"press":return` await page.keyboard.press('${r}');`;case"keydown":return` await page.keyboard.keydown('${r}');`;case"keyup":return` await page.keyboard.keyup('${r}');`;case"type":return` await page.keyboard.type('${r}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
|
|
4
4
|
await assertSelection(page, {
|