@payloadcms/richtext-lexical 3.0.0-beta.129 → 3.0.0-beta.130

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 (32) hide show
  1. package/dist/exports/client/{Field-SHUAQNQD.js → Field-GWJ72IYP.js} +2 -2
  2. package/dist/exports/client/{RelationshipComponent-IMM4CFBE.js → RelationshipComponent-2RT3YXUT.js} +2 -2
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/{chunk-352SHIZR.js → chunk-AE5XKHR4.js} +2 -2
  5. package/dist/exports/client/{chunk-PDAZFJVO.js → chunk-CUIBIFW2.js} +1 -1
  6. package/dist/exports/client/chunk-CUIBIFW2.js.map +7 -0
  7. package/dist/exports/client/{chunk-O4IOO4EU.js → chunk-MI5HS4QX.js} +2 -2
  8. package/dist/exports/client/{chunk-75T7MDBH.js → chunk-XDEGE6I5.js} +2 -2
  9. package/dist/exports/client/{chunk-ZOYGBIAN.js → chunk-YGRKYSDC.js} +2 -2
  10. package/dist/exports/client/{component-YE2TDR5O.js → component-YICNYPTU.js} +2 -2
  11. package/dist/exports/client/{component-EHTN2BHZ.js → component-YNHK5J3P.js} +2 -2
  12. package/dist/exports/client/{componentInline-N5LJ2LY2.js → componentInline-6RPSMLNJ.js} +2 -2
  13. package/dist/exports/client/index.js +2 -2
  14. package/dist/field/bundled.css +1 -1
  15. package/dist/field/rscEntry.d.ts +2 -2
  16. package/dist/field/rscEntry.d.ts.map +1 -1
  17. package/dist/field/rscEntry.js +0 -3
  18. package/dist/field/rscEntry.js.map +1 -1
  19. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  20. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  21. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  22. package/package.json +7 -7
  23. package/dist/exports/client/chunk-PDAZFJVO.js.map +0 -7
  24. /package/dist/exports/client/{Field-SHUAQNQD.js.map → Field-GWJ72IYP.js.map} +0 -0
  25. /package/dist/exports/client/{RelationshipComponent-IMM4CFBE.js.map → RelationshipComponent-2RT3YXUT.js.map} +0 -0
  26. /package/dist/exports/client/{chunk-352SHIZR.js.map → chunk-AE5XKHR4.js.map} +0 -0
  27. /package/dist/exports/client/{chunk-O4IOO4EU.js.map → chunk-MI5HS4QX.js.map} +0 -0
  28. /package/dist/exports/client/{chunk-75T7MDBH.js.map → chunk-XDEGE6I5.js.map} +0 -0
  29. /package/dist/exports/client/{chunk-ZOYGBIAN.js.map → chunk-YGRKYSDC.js.map} +0 -0
  30. /package/dist/exports/client/{component-YE2TDR5O.js.map → component-YICNYPTU.js.map} +0 -0
  31. /package/dist/exports/client/{component-EHTN2BHZ.js.map → component-YNHK5J3P.js.map} +0 -0
  32. /package/dist/exports/client/{componentInline-N5LJ2LY2.js.map → componentInline-6RPSMLNJ.js.map} +0 -0
@@ -1,9 +1,9 @@
1
- import type { ClientComponentProps, ServerComponentProps } from 'payload';
1
+ import type { ClientComponentProps, FieldPaths, ServerComponentProps } from 'payload';
2
2
  import React from 'react';
3
3
  import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
4
4
  import type { LexicalFieldAdminProps } from '../types.js';
5
5
  export declare const RscEntryLexicalField: React.FC<{
6
6
  admin: LexicalFieldAdminProps;
7
7
  sanitizedEditorConfig: SanitizedServerEditorConfig;
8
- } & ClientComponentProps & ServerComponentProps>;
8
+ } & ClientComponentProps & Pick<FieldPaths, 'path'> & ServerComponentProps>;
9
9
  //# sourceMappingURL=rscEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAuB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9F,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAKzD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,KAAK,EAAE,sBAAsB,CAAA;IAC7B,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,oBAAoB,CA8BvB,CAAA"}
1
+ {"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAEV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAKzD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,KAAK,EAAE,sBAAsB,CAAA;IAC7B,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACxB,oBAAoB,CA2BvB,CAAA"}
@@ -23,10 +23,7 @@ export const RscEntryLexicalField = args => {
23
23
  featureClientSchemaMap: featureClientSchemaMap,
24
24
  field: args.clientField,
25
25
  forceRender: args.forceRender,
26
- indexPath: args.indexPath,
27
26
  lexicalEditorConfig: args.sanitizedEditorConfig.lexical,
28
- parentPath: args.parentPath,
29
- parentSchemaPath: args.parentSchemaPath,
30
27
  path: path,
31
28
  permissions: args.permissions,
32
29
  readOnly: args.readOnly,
@@ -1 +1 @@
1
- {"version":3,"file":"rscEntry.js","names":["React","RichTextField","initLexicalFeatures","RscEntryLexicalField","args","path","clientField","name","schemaPath","clientFeatures","featureClientSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","_jsx","admin","field","forceRender","indexPath","lexicalEditorConfig","lexical","parentPath","parentSchemaPath","permissions","readOnly","renderedBlocks"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { ClientComponentProps, RichTextFieldClient, ServerComponentProps } from 'payload'\n\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminProps } from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\nexport const RscEntryLexicalField: React.FC<\n {\n admin: LexicalFieldAdminProps\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n ServerComponentProps\n> = (args) => {\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n const { clientFeatures, featureClientSchemaMap } = initLexicalFeatures({\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n return (\n <RichTextField\n admin={args.admin}\n clientFeatures={clientFeatures}\n featureClientSchemaMap={featureClientSchemaMap}\n field={args.clientField as RichTextFieldClient}\n forceRender={args.forceRender}\n indexPath={args.indexPath}\n lexicalEditorConfig={args.sanitizedEditorConfig.lexical}\n parentPath={args.parentPath}\n parentSchemaPath={args.parentSchemaPath}\n path={path}\n permissions={args.permissions}\n readOnly={args.readOnly}\n renderedBlocks={args.renderedBlocks}\n schemaPath={schemaPath}\n />\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAKlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,mBAAmB,QAAQ;AACpC,OAAO,MAAMC,oBAAA,GAMRC,IAAA;EACH,MAAMC,IAAA,GAAOD,IAAA,CAAKC,IAAI,IAAID,IAAC,CAAKE,WAAW,CAAyBC,IAAI;EACxE,MAAMC,UAAA,GAAaJ,IAAA,CAAKI,UAAU,IAAIH,IAAA;EACtC,MAAM;IAAEI,cAAc;IAAEC;EAAsB,CAAE,GAAGR,mBAAA,CAAoB;IACrES,cAAA,EAAgBP,IAAA,CAAKO,cAAc;IACnCC,IAAA,EAAMR,IAAA,CAAKQ,IAAI;IACfP,IAAA;IACAQ,OAAA,EAAST,IAAA,CAAKS,OAAO;IACrBC,qBAAA,EAAuBV,IAAA,CAAKU,qBAAqB;IACjDN;EACF;EACA,oBACEO,IAAA,CAACd,aAAA;IACCe,KAAA,EAAOZ,IAAA,CAAKY,KAAK;IACjBP,cAAA,EAAgBA,cAAA;IAChBC,sBAAA,EAAwBA,sBAAA;IACxBO,KAAA,EAAOb,IAAA,CAAKE,WAAW;IACvBY,WAAA,EAAad,IAAA,CAAKc,WAAW;IAC7BC,SAAA,EAAWf,IAAA,CAAKe,SAAS;IACzBC,mBAAA,EAAqBhB,IAAA,CAAKU,qBAAqB,CAACO,OAAO;IACvDC,UAAA,EAAYlB,IAAA,CAAKkB,UAAU;IAC3BC,gBAAA,EAAkBnB,IAAA,CAAKmB,gBAAgB;IACvClB,IAAA,EAAMA,IAAA;IACNmB,WAAA,EAAapB,IAAA,CAAKoB,WAAW;IAC7BC,QAAA,EAAUrB,IAAA,CAAKqB,QAAQ;IACvBC,cAAA,EAAgBtB,IAAA,CAAKsB,cAAc;IACnClB,UAAA,EAAYA;;AAGlB","ignoreList":[]}
1
+ {"version":3,"file":"rscEntry.js","names":["React","RichTextField","initLexicalFeatures","RscEntryLexicalField","args","path","clientField","name","schemaPath","clientFeatures","featureClientSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","_jsx","admin","field","forceRender","lexicalEditorConfig","lexical","permissions","readOnly","renderedBlocks"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n ServerComponentProps,\n} from 'payload'\n\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminProps } from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\nexport const RscEntryLexicalField: React.FC<\n {\n admin: LexicalFieldAdminProps\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n ServerComponentProps\n> = (args) => {\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n const { clientFeatures, featureClientSchemaMap } = initLexicalFeatures({\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n return (\n <RichTextField\n admin={args.admin}\n clientFeatures={clientFeatures}\n featureClientSchemaMap={featureClientSchemaMap}\n field={args.clientField as RichTextFieldClient}\n forceRender={args.forceRender}\n lexicalEditorConfig={args.sanitizedEditorConfig.lexical}\n path={path}\n permissions={args.permissions}\n readOnly={args.readOnly}\n renderedBlocks={args.renderedBlocks}\n schemaPath={schemaPath}\n />\n )\n}\n"],"mappings":";AAOA,OAAOA,KAAA,MAAW;AAKlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,mBAAmB,QAAQ;AACpC,OAAO,MAAMC,oBAAA,GAORC,IAAA;EACH,MAAMC,IAAA,GAAOD,IAAA,CAAKC,IAAI,IAAID,IAAC,CAAKE,WAAW,CAAyBC,IAAI;EACxE,MAAMC,UAAA,GAAaJ,IAAA,CAAKI,UAAU,IAAIH,IAAA;EACtC,MAAM;IAAEI,cAAc;IAAEC;EAAsB,CAAE,GAAGR,mBAAA,CAAoB;IACrES,cAAA,EAAgBP,IAAA,CAAKO,cAAc;IACnCC,IAAA,EAAMR,IAAA,CAAKQ,IAAI;IACfP,IAAA;IACAQ,OAAA,EAAST,IAAA,CAAKS,OAAO;IACrBC,qBAAA,EAAuBV,IAAA,CAAKU,qBAAqB;IACjDN;EACF;EACA,oBACEO,IAAA,CAACd,aAAA;IACCe,KAAA,EAAOZ,IAAA,CAAKY,KAAK;IACjBP,cAAA,EAAgBA,cAAA;IAChBC,sBAAA,EAAwBA,sBAAA;IACxBO,KAAA,EAAOb,IAAA,CAAKE,WAAW;IACvBY,WAAA,EAAad,IAAA,CAAKc,WAAW;IAC7BC,mBAAA,EAAqBf,IAAA,CAAKU,qBAAqB,CAACM,OAAO;IACvDf,IAAA,EAAMA,IAAA;IACNgB,WAAA,EAAajB,IAAA,CAAKiB,WAAW;IAC7BC,QAAA,EAAUlB,IAAA,CAAKkB,QAAQ;IACvBC,cAAA,EAAgBnB,IAAA,CAAKmB,cAAc;IACnCf,UAAA,EAAYA;;AAGlB","ignoreList":[]}
@@ -9,7 +9,7 @@ export interface EditorConfigContextType {
9
9
  editor: LexicalEditor;
10
10
  editorConfig: SanitizedClientEditorConfig;
11
11
  editorContainerRef: React.RefObject<HTMLDivElement>;
12
- fieldProps: MarkRequired<LexicalRichTextFieldProps, 'indexPath' | 'parentPath' | 'parentSchemaPath' | 'path' | 'schemaPath'>;
12
+ fieldProps: MarkRequired<LexicalRichTextFieldProps, 'path' | 'schemaPath'>;
13
13
  focusedEditor: EditorConfigContextType | null;
14
14
  focusEditor: (editorContext: EditorConfigContextType) => void;
15
15
  parentEditor: EditorConfigContextType;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorConfigProvider.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAO9D,MAAM,WAAW,uBAAuB;IAEt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B,QAAO,uBAMzC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorConfigProvider.js","names":["useLexicalComposerContext","React","createContext","useContext","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","fieldProps","uuid","EditorConfigProvider","children","editorContainerRef","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","parentEditor","registerChild","childUUID","childEditorContext","newMap","set","unregisterChild","delete","_jsx","Provider","value","useEditorConfigContext","context","undefined","Error"],"sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { MarkRequired } from 'ts-essentials'\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\n fieldProps: MarkRequired<\n LexicalRichTextFieldProps,\n 'indexPath' | 'parentPath' | 'parentSchemaPath' | 'path' | 'schemaPath'\n >\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\n// @ts-expect-error: TODO: Fix this\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n fieldProps: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement | null>\n\n fieldProps: LexicalRichTextFieldProps\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 fieldProps,\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) => {\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 fieldProps,\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"],"mappings":"AAAA;;;AAKA,SAASA,yBAAyB,QAAQ;AAC1C,YAAYC,KAAA,MAAW;AACvB,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAKrE;AACA,SAASC,kBAAA;EACP,OAAOC,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG,MAAMH,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG;AAC/F;AAuBA;AACA,MAAMC,OAAA,gBAAkDV,aAAA,CAAc;EACpEW,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,QAAQ;EACRJ,YAAY;EACZK,kBAAkB;EAClBJ,UAAU;EACVK;AAAa,CAQd;EACC,MAAM,CAACC,MAAA,CAAO,GAAGpB,yBAAA;EACjB;EACA,MAAM,CAACe,IAAA,CAAK,GAAGT,QAAA,CAASC,iBAAA;EAExB,MAAMc,eAAA,GAAkBhB,MAAA,CAA6C,IAAIiB,GAAA;EACzE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGlB,QAAA,CAAyC;EACnF,MAAMmB,YAAA,GAAepB,MAAA,CAAoB,IAAIqB,GAAA;EAE7C,MAAMC,eAAA,GAAgBvB,OAAA,CACpB,OACG;IACCwB,UAAA,EAAaD,aAAA;MACX;MACAF,YAAA,CAAaI,OAAO,CAACC,KAAK,GAAG;MAAA;IAC/B;IACAT,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AAA,CACD;EAGH,oBAAO8B,IAAA,CAACjC,OAAA,CAAQkC,QAAQ;IAACC,KAAA,EAAOpB,eAAA;cAAgBV;;AAClD;AAEA,OAAO,MAAM+B,sBAAA,GAAyBA,CAAA;EACpC,MAAAC,OAAA,GAAgB9C,UAAA,CAAAS,OAAW;EAAA,IACvBqC,OAAA,KAAAC,SAAY;IAAA,UAAAC,KAAA,CACE;EAAA;EAAA,OAEXF,OAAA;AAAA,CACT","ignoreList":[]}
1
+ {"version":3,"file":"EditorConfigProvider.js","names":["useLexicalComposerContext","React","createContext","useContext","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","fieldProps","uuid","EditorConfigProvider","children","editorContainerRef","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","parentEditor","registerChild","childUUID","childEditorContext","newMap","set","unregisterChild","delete","_jsx","Provider","value","useEditorConfigContext","context","undefined","Error"],"sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { MarkRequired } from 'ts-essentials'\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\n fieldProps: MarkRequired<LexicalRichTextFieldProps, 'path' | 'schemaPath'>\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\n// @ts-expect-error: TODO: Fix this\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n fieldProps: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement | null>\n\n fieldProps: LexicalRichTextFieldProps\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 fieldProps,\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) => {\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 fieldProps,\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"],"mappings":"AAAA;;;AAKA,SAASA,yBAAyB,QAAQ;AAC1C,YAAYC,KAAA,MAAW;AACvB,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAKrE;AACA,SAASC,kBAAA;EACP,OAAOC,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG,MAAMH,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG;AAC/F;AAoBA;AACA,MAAMC,OAAA,gBAAkDV,aAAA,CAAc;EACpEW,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,QAAQ;EACRJ,YAAY;EACZK,kBAAkB;EAClBJ,UAAU;EACVK;AAAa,CAQd;EACC,MAAM,CAACC,MAAA,CAAO,GAAGpB,yBAAA;EACjB;EACA,MAAM,CAACe,IAAA,CAAK,GAAGT,QAAA,CAASC,iBAAA;EAExB,MAAMc,eAAA,GAAkBhB,MAAA,CAA6C,IAAIiB,GAAA;EACzE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB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BQ,OAAO;QAC9CY,QAAA,CAAOG,MAAM,CAACL,WAAA;QACdlB,eAAA,CAAgBQ,OAAO,GAAGY,QAAA;MAC5B;IACF;IAEA1B;EACF,IACF,CACEK,MAAA,EACAC,eAAA,EACAR,YAAA,EACAK,kBAAA,EACAJ,UAAA,EACAS,aAAA,EACAJ,aAAA,EACAJ,IAAA,CACD;EAGH,oBAAO8B,IAAA,CAACjC,OAAA,CAAQkC,QAAQ;IAACC,KAAA,EAAOpB,eAAA;cAAgBV;;AAClD;AAEA,OAAO,MAAM+B,sBAAA,GAAyBA,CAAA;EACpC,MAAAC,OAAA,GAAgB9C,UAAA,CAAAS,OAAW;EAAA,IACvBqC,OAAA,KAAAC,SAAY;IAAA,UAAAC,KAAA,CACE;EAAA;EAAA,OAEXF,OAAA;AAAA,CACT","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.0.0-beta.129",
3
+ "version": "3.0.0-beta.130",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -64,8 +64,8 @@
64
64
  "react-error-boundary": "4.0.13",
65
65
  "ts-essentials": "10.0.3",
66
66
  "uuid": "10.0.0",
67
- "@payloadcms/translations": "3.0.0-beta.129",
68
- "@payloadcms/ui": "3.0.0-beta.129"
67
+ "@payloadcms/translations": "3.0.0-beta.130",
68
+ "@payloadcms/ui": "3.0.0-beta.130"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@babel/cli": "^7.24.5",
@@ -85,8 +85,8 @@
85
85
  "esbuild-sass-plugin": "3.3.1",
86
86
  "eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
87
87
  "swc-plugin-transform-remove-imports": "1.15.0",
88
- "@payloadcms/eslint-config": "3.0.0-beta.112",
89
- "payload": "3.0.0-beta.129"
88
+ "payload": "3.0.0-beta.130",
89
+ "@payloadcms/eslint-config": "3.0.0-beta.112"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@faceless-ui/modal": "3.0.0-beta.2",
@@ -104,8 +104,8 @@
104
104
  "lexical": "0.20.0",
105
105
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
106
106
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
107
- "@payloadcms/next": "3.0.0-beta.129",
108
- "payload": "3.0.0-beta.129"
107
+ "@payloadcms/next": "3.0.0-beta.130",
108
+ "payload": "3.0.0-beta.130"
109
109
  },
110
110
  "engines": {
111
111
  "node": "^18.20.2 || >=20.9.0"
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/lexical/config/client/EditorConfigProvider.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { MarkRequired } from 'ts-essentials'\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\n fieldProps: MarkRequired<\n LexicalRichTextFieldProps,\n 'indexPath' | 'parentPath' | 'parentSchemaPath' | 'path' | 'schemaPath'\n >\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\n// @ts-expect-error: TODO: Fix this\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n fieldProps: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement | null>\n\n fieldProps: LexicalRichTextFieldProps\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 fieldProps,\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) => {\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 fieldProps,\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": "wCAKA,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,CAwBA,IAAMC,EAAkDV,EAAc,CACpEW,aAAc,KACdC,WAAY,KACZC,KAAM,IACR,CAAA,EAEaC,EAAuBA,CAAC,CACnCC,SAAAA,EACAJ,aAAAA,EACAK,mBAAAA,EACAJ,WAAAA,EACAK,cAAAA,CAAa,IAQd,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,WAAAA,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,QAASC,GAAA,CAC/BA,EAAYL,YAAYJ,CAAA,CAC1B,CAAA,EAEAF,EAAaI,QAAQC,MAAK,EAC5B,EACAO,aAAclB,EACdmB,cAAeA,CAACC,EAAWC,IAAA,CACzB,GAAI,CAACnB,EAAgBQ,QAAQI,IAAIM,CAAA,EAAY,CAC3C,IAAME,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOC,IAAIH,EAAWC,CAAA,EACtBnB,EAAgBQ,QAAUY,CAC5B,CACF,EACAE,gBAAkBJ,GAAA,CAChB,GAAIlB,EAAgBQ,QAAQI,IAAIM,CAAA,EAAY,CAC1C,IAAME,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOG,OAAOL,CAAA,EACdlB,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,IAAAC,EAAgB9C,EAAAS,CAAW,EAAA,GACvBqC,IAAAC,OAAY,MAAA,IAAAC,MACE,oEAAA,EAAA,OAEXF,CAAA",
6
- "names": ["useLexicalComposerContext", "createContext", "useContext", "useMemo", "useRef", "useState", "generateQuickGuid", "Math", "random", "toString", "substring", "Context", "editorConfig", "fieldProps", "uuid", "EditorConfigProvider", "children", "editorContainerRef", "parentContext", "editor", "childrenEditors", "Map", "focusedEditor", "setFocusedEditor", "focusHistory", "Set", "editorContext", "blurEditor", "current", "clear", "focusEditor", "editorUUID", "has", "add", "forEach", "childEditor", "parentEditor", "registerChild", "childUUID", "childEditorContext", "newMap", "set", "unregisterChild", "delete", "_jsx", "Provider", "value", "useEditorConfigContext", "context", "undefined", "Error"]
7
- }