@payloadcms/richtext-lexical 3.0.0-beta.124 → 3.0.0-beta.126

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAS7C,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,iCAAiC,CAAA;AAErC,eAAO,MAAM,mBAAmB,qJAkE9B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAS7C,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,iCAAiC,CAAA;AAErC,eAAO,MAAM,mBAAmB,qJAoE9B,CAAA"}
@@ -26,6 +26,7 @@ export const RelationshipFeature = createServerFeature({
26
26
  draft,
27
27
  node,
28
28
  overrideAccess,
29
+ populateArg,
29
30
  populationPromises,
30
31
  req,
31
32
  showHiddenFields
@@ -51,7 +52,7 @@ export const RelationshipFeature = createServerFeature({
51
52
  key: 'value',
52
53
  overrideAccess,
53
54
  req,
54
- select: collection.config.defaultPopulate,
55
+ select: populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,
55
56
  showHiddenFields
56
57
  }));
57
58
  return node;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["populate","createServerFeature","createNode","relationshipPopulationPromiseHOC","i18n","RelationshipServerNode","RelationshipFeature","feature","props","maxDepth","clientFeatureProps","ClientFeature","nodes","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","node","overrideAccess","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","undefined","push","collectionSlug","config","slug","data","key","select","defaultPopulate"],"sources":["../../../../src/features/relationship/server/index.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { RelationshipServerNode } from './nodes/RelationshipNode.js'\n\nexport type ExclusiveRelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type RelationshipFeatureProps = {\n /**\n * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveRelationshipFeatureProps\n\nexport const RelationshipFeature = createServerFeature<\n RelationshipFeatureProps,\n RelationshipFeatureProps,\n ExclusiveRelationshipFeatureProps\n>({\n feature: ({ props }) => {\n // we don't need to pass maxDepth to the client, it's only used on the server\n const { maxDepth, ...clientFeatureProps } = props ?? {}\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#RelationshipFeatureClient',\n clientFeatureProps,\n i18n,\n nodes: [\n createNode({\n graphQLPopulationPromises: [relationshipPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth = maxDepth !== undefined && maxDepth < depth ? maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select: collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: RelationshipServerNode,\n }),\n ],\n }\n },\n key: 'relationship',\n})\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,gCAAgC,QAAQ;AACjD,SAASC,IAAI,QAAQ;AACrB,SAASC,sBAAsB,QAAQ;AAkCvC,OAAO,MAAMC,mBAAA,GAAsBL,mBAAA,CAIjC;EACAM,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB;IACA,MAAM;MAAEC,QAAQ;MAAE,GAAGC;IAAA,CAAoB,GAAGF,KAAA,IAAS,CAAC;IACtD,OAAO;MACLG,aAAA,EAAe;MACfD,kBAAA;MACAN,IAAA;MACAQ,KAAA,EAAO,CACLV,UAAA,CAAW;QACTW,yBAAA,EAA2B,CAACV,gCAAA,CAAiCK,KAAA,EAAO;QACpEM,KAAA,EAAO;UACLC,SAAA,EAAW,CACT,CAAC;YACCC,YAAY;YACZC,KAAK;YACLC,KAAK;YACLC,IAAI;YACJC,cAAc;YACdC,kBAAkB;YAClBC,GAAG;YACHC;UAAgB,CACjB;YACC,IAAI,CAACJ,IAAA,EAAMK,KAAA,EAAO;cAChB,OAAOL,IAAA;YACT;YACA,MAAMM,UAAA,GAAaH,GAAA,CAAII,OAAO,CAACC,WAAW,CAACR,IAAA,EAAMS,UAAA,CAAW;YAE5D,IAAI,CAACH,UAAA,EAAY;cACf,OAAON,IAAA;YACT;YACA;YACA,MAAMU,EAAA,GAAKV,IAAA,EAAMK,KAAA,EAAOK,EAAA,IAAMV,IAAA,EAAMK,KAAA,CAAM;YAAA;YAE1C,MAAMM,aAAA,GAAgBrB,QAAA,KAAasB,SAAA,IAAatB,QAAA,GAAWQ,KAAA,GAAQR,QAAA,GAAWQ,KAAA;YAE9EI,kBAAA,CAAmBW,IAAI,CACrBhC,QAAA,CAAS;cACP6B,EAAA;cACAI,cAAA,EAAgBR,UAAA,CAAWS,MAAM,CAACC,IAAI;cACtCnB,YAAA;cACAoB,IAAA,EAAMjB,IAAA;cACNF,KAAA,EAAOa,aAAA;cACPZ,KAAA;cACAmB,GAAA,EAAK;cACLjB,cAAA;cACAE,GAAA;cACAgB,MAAA,EAAQb,UAAA,CAAWS,MAAM,CAACK,eAAe;cACzChB;YACF;YAGF,OAAOJ,IAAA;UACT;QAEJ;QACAA,IAAA,EAAMd;MACR;IAEJ;EACF;EACAgC,GAAA,EAAK;AACP","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["populate","createServerFeature","createNode","relationshipPopulationPromiseHOC","i18n","RelationshipServerNode","RelationshipFeature","feature","props","maxDepth","clientFeatureProps","ClientFeature","nodes","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","node","overrideAccess","populateArg","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","undefined","push","collectionSlug","config","slug","data","key","select","defaultPopulate"],"sources":["../../../../src/features/relationship/server/index.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { RelationshipServerNode } from './nodes/RelationshipNode.js'\n\nexport type ExclusiveRelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type RelationshipFeatureProps = {\n /**\n * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveRelationshipFeatureProps\n\nexport const RelationshipFeature = createServerFeature<\n RelationshipFeatureProps,\n RelationshipFeatureProps,\n ExclusiveRelationshipFeatureProps\n>({\n feature: ({ props }) => {\n // we don't need to pass maxDepth to the client, it's only used on the server\n const { maxDepth, ...clientFeatureProps } = props ?? {}\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#RelationshipFeatureClient',\n clientFeatureProps,\n i18n,\n nodes: [\n createNode({\n graphQLPopulationPromises: [relationshipPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth = maxDepth !== undefined && maxDepth < depth ? maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: RelationshipServerNode,\n }),\n ],\n }\n },\n key: 'relationship',\n})\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,gCAAgC,QAAQ;AACjD,SAASC,IAAI,QAAQ;AACrB,SAASC,sBAAsB,QAAQ;AAkCvC,OAAO,MAAMC,mBAAA,GAAsBL,mBAAA,CAIjC;EACAM,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB;IACA,MAAM;MAAEC,QAAQ;MAAE,GAAGC;IAAA,CAAoB,GAAGF,KAAA,IAAS,CAAC;IACtD,OAAO;MACLG,aAAA,EAAe;MACfD,kBAAA;MACAN,IAAA;MACAQ,KAAA,EAAO,CACLV,UAAA,CAAW;QACTW,yBAAA,EAA2B,CAACV,gCAAA,CAAiCK,KAAA,EAAO;QACpEM,KAAA,EAAO;UACLC,SAAA,EAAW,CACT,CAAC;YACCC,YAAY;YACZC,KAAK;YACLC,KAAK;YACLC,IAAI;YACJC,cAAc;YACdC,WAAW;YACXC,kBAAkB;YAClBC,GAAG;YACHC;UAAgB,CACjB;YACC,IAAI,CAACL,IAAA,EAAMM,KAAA,EAAO;cAChB,OAAON,IAAA;YACT;YACA,MAAMO,UAAA,GAAaH,GAAA,CAAII,OAAO,CAACC,WAAW,CAACT,IAAA,EAAMU,UAAA,CAAW;YAE5D,IAAI,CAACH,UAAA,EAAY;cACf,OAAOP,IAAA;YACT;YACA;YACA,MAAMW,EAAA,GAAKX,IAAA,EAAMM,KAAA,EAAOK,EAAA,IAAMX,IAAA,EAAMM,KAAA,CAAM;YAAA;YAE1C,MAAMM,aAAA,GAAgBtB,QAAA,KAAauB,SAAA,IAAavB,QAAA,GAAWQ,KAAA,GAAQR,QAAA,GAAWQ,KAAA;YAE9EK,kBAAA,CAAmBW,IAAI,CACrBjC,QAAA,CAAS;cACP8B,EAAA;cACAI,cAAA,EAAgBR,UAAA,CAAWS,MAAM,CAACC,IAAI;cACtCpB,YAAA;cACAqB,IAAA,EAAMlB,IAAA;cACNF,KAAA,EAAOc,aAAA;cACPb,KAAA;cACAoB,GAAA,EAAK;cACLlB,cAAA;cACAG,GAAA;cACAgB,MAAA,EACElB,WAAA,GAAcK,UAAA,CAAWS,MAAM,CAACC,IAAI,CAAC,IAAIV,UAAA,CAAWS,MAAM,CAACK,eAAe;cAC5EhB;YACF;YAGF,OAAOL,IAAA;UACT;QAEJ;QACAA,IAAA,EAAMd;MACR;IAEJ;EACF;EACAiC,GAAA,EAAK;AACP","ignoreList":[]}
@@ -2,7 +2,7 @@ import type { Transformer } from '@lexical/markdown';
2
2
  import type { GenericLanguages, I18nClient } from '@payloadcms/translations';
3
3
  import type { JSONSchema4 } from 'json-schema';
4
4
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
5
- import type { Config, Field, JsonObject, Payload, PayloadComponent, PayloadRequest, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, ValidateOptions } from 'payload';
5
+ import type { Config, Field, JsonObject, Payload, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, ValidateOptions } from 'payload';
6
6
  import type { ServerEditorConfig } from '../lexical/config/types.js';
7
7
  import type { AdapterProps } from '../types.js';
8
8
  import type { HTMLConverter } from './converters/html/converter/types.js';
@@ -85,6 +85,10 @@ export type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {
85
85
  */
86
86
  locale: string;
87
87
  overrideAccess: boolean;
88
+ /**
89
+ * Only available in `afterRead` hooks.
90
+ */
91
+ populateArg?: PopulateType;
88
92
  /**
89
93
  * Only available in `afterRead` field hooks.
90
94
  */
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,qBAA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ClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n JsonObject,\n Payload,\n PayloadComponent,\n PayloadRequest,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: { field: string; message: string }[]\n mergeLocaleActions: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n */\n converters?: {\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n // @ts-expect-error - TODO: fix this\n componentImports?: Config['admin']['importMap']['generators'][0] | PayloadComponent[]\n componentMap?:\n | ((args: { i18n: I18nClient; payload: Payload; props: ServerProps; schemaPath: string }) => {\n [key: string]: PayloadComponent\n })\n | {\n [key: string]: PayloadComponent\n }\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]> | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: Transformer[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'markdownTransformers' | 'nodes'>>\n"],"mappings":"AAiXA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n JsonObject,\n Payload,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: { field: string; message: string }[]\n mergeLocaleActions: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n */\n converters?: {\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n // @ts-expect-error - TODO: fix this\n componentImports?: Config['admin']['importMap']['generators'][0] | PayloadComponent[]\n componentMap?:\n | ((args: { i18n: I18nClient; payload: Payload; props: ServerProps; schemaPath: string }) => {\n [key: string]: PayloadComponent\n })\n | {\n [key: string]: PayloadComponent\n }\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]> | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: Transformer[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'markdownTransformers' | 'nodes'>>\n"],"mappings":"AAsXA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,KAAK,EAKN,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAU3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,UAAU,EAAE,cAAc,GAAG;YAC5B,MAAM,EAAE,KAAK,EAAE,CAAA;SAChB,CAAA;KACF,CAAA;IACD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,eAAO,MAAM,aAAa,gIA4OxB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,KAAK,EAKN,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAU3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,UAAU,EAAE,cAAc,GAAG;YAC5B,MAAM,EAAE,KAAK,EAAE,CAAA;SAChB,CAAA;KACF,CAAA;IACD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,eAAO,MAAM,aAAa,gIA8OxB,CAAA"}
@@ -172,6 +172,7 @@ export const UploadFeature = createServerFeature({
172
172
  draft,
173
173
  node,
174
174
  overrideAccess,
175
+ populateArg,
175
176
  populationPromises,
176
177
  req,
177
178
  showHiddenFields
@@ -197,7 +198,7 @@ export const UploadFeature = createServerFeature({
197
198
  key: 'value',
198
199
  overrideAccess,
199
200
  req,
200
- select: collection.config.defaultPopulate,
201
+ select: populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,
201
202
  showHiddenFields
202
203
  }));
203
204
  return node;
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.js","names":["sanitizeFields","populate","createServerFeature","createNode","uploadPopulationPromiseHOC","i18n","UploadServerNode","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","feature","_config","isRoot","parentIsLocalized","props","collections","clientProps","collection","hasExtraFields","fields","length","validRelationships","map","c","slug","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","req","showHiddenFields","id","value","uploadDocument","collectionSlug","relationTo","data","key","ignored","console","error","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","getSubFields","allSubFields","concat","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","populationPromises","populateDepth","maxDepth","undefined","push","select","defaultPopulate","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/feature.server.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FileData,\n FileSize,\n Payload,\n TypeWithID,\n} from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/feature.client.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: CollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\n/**\n * Get the absolute URL for an upload URL by potentially prepending the serverURL\n */\nfunction getAbsoluteURL(url: string, payload: Payload): string {\n return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url\n}\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureProps,\n UploadFeaturePropsClient\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection].fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n props.collections[collection].fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: props.collections[collection].fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap = new Map<string, Field[]>()\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n schemaMap.set(collection, props.collections[collection].fields)\n }\n }\n\n return schemaMap\n },\n i18n,\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n req,\n showHiddenFields,\n }) => {\n // @ts-expect-error - for backwards-compatibility\n const id = node?.value?.id || node?.value\n\n if (req?.payload) {\n const uploadDocument: {\n value?: FileData & TypeWithID\n } = {}\n\n try {\n await populate({\n id,\n collectionSlug: node.relationTo,\n currentDepth,\n data: uploadDocument,\n depth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n })\n } catch (ignored) {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical upload node HTML converter: error fetching upload file',\n ignored,\n 'Node:',\n node,\n )\n return `<img />`\n }\n\n const url = getAbsoluteURL(uploadDocument?.value?.url ?? '', req?.payload)\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDocument?.value?.mimeType?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.value?.filename}</a>`\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (\n !uploadDocument?.value?.sizes ||\n !Object.keys(uploadDocument?.value?.sizes).length\n ) {\n return `<img src=\"${url}\" alt=\"${uploadDocument?.value?.filename}\" width=\"${uploadDocument?.value?.width}\" height=\"${uploadDocument?.value?.height}\"/>`\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n let pictureHTML = '<picture>'\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDocument.value?.sizes) {\n const imageSize: {\n url?: string\n } & FileSize = uploadDocument.value?.sizes[size]\n\n // Skip if any property of the size object is null\n if (\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = getAbsoluteURL(imageSize?.url, req?.payload)\n\n pictureHTML += `<source srcset=\"${imageSizeURL}\" media=\"(max-width: ${imageSize.width}px)\" type=\"${imageSize.mimeType}\">`\n }\n\n // Add the default img tag\n pictureHTML += `<img src=\"${url}\" alt=\"Image\" width=\"${uploadDocument.value?.width}\" height=\"${uploadDocument.value?.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${id}\" />`\n }\n },\n nodeTypes: [UploadServerNode.getType()],\n },\n },\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n allSubFields = allSubFields.concat(props?.collections?.[collection]?.fields)\n }\n return allSubFields\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select: collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAUA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AAiBjC;;;AAGA,SAASC,eAAeC,GAAW,EAAEC,OAAgB;EACnD,OAAO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CAACH,IAAA,EAAMK,KAAA,EAAO;cAChB,OAAOL,IAAA;YACT;YACA,MAAMtB,UAAA,GAAawB,GAAA,CAAIpC,OAAO,CAACU,WAAW,CAACwB,IAAA,EAAMQ,UAAA,CAAW;YAE5D,IAAI,CAAC9B,UAAA,EAAY;cACf,OAAOsB,IAAA;YACT;YACA;YACA,MAAMI,EAAA,GAAKJ,IAAA,EAAMK,KAAA,EAAOD,EAAA,IAAMJ,IAAA,EAAMK,KAAA,CAAM;YAAA;YAE1C,MAAMkC,aAAA,GACJhE,KAAA,EAAOiE,QAAA,KAAaC,SAAA,IAAalE,KAAA,EAAOiE,QAAA,GAAW1C,KAAA,GAAQvB,KAAA,EAAOiE,QAAA,GAAW1C,KAAA;YAE/EwC,kBAAA,CAAmBI,IAAI,CACrBrF,QAAA,CAAS;cACP+C,EAAA;cACAG,cAAA,EAAgB7B,UAAA,CAAWV,MAAM,CAACiB,IAAI;cACtCY,YAAA;cACAY,IAAA,EAAMT,IAAA;cACNF,KAAA,EAAOyC,aAAA;cACPxC,KAAA;cACAW,GAAA,EAAK;cACLT,cAAA;cACAC,GAAA;cACAyC,MAAA,EAAQjE,UAAA,CAAWV,MAAM,CAAC4E,eAAe;cACzCzC;YACF;YAGF,OAAOH,IAAA;UACT;QAEJ;QACAA,IAAA,EAAMtC,gBAAA;QACNmF,WAAA,EAAa,CAAClF,gBAAA,CAAiBY,KAAA;MACjC,GACD;MACDuE,2BAAA,EAA6BvE;IAC/B;EACF;EACAmC,GAAA,EAAK;AACP","ignoreList":[]}
1
+ {"version":3,"file":"feature.server.js","names":["sanitizeFields","populate","createServerFeature","createNode","uploadPopulationPromiseHOC","i18n","UploadServerNode","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","feature","_config","isRoot","parentIsLocalized","props","collections","clientProps","collection","hasExtraFields","fields","length","validRelationships","map","c","slug","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","req","showHiddenFields","id","value","uploadDocument","collectionSlug","relationTo","data","key","ignored","console","error","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","getSubFields","allSubFields","concat","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","populateArg","populationPromises","populateDepth","maxDepth","undefined","push","select","defaultPopulate","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/feature.server.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FileData,\n FileSize,\n Payload,\n TypeWithID,\n} from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/feature.client.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: CollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\n/**\n * Get the absolute URL for an upload URL by potentially prepending the serverURL\n */\nfunction getAbsoluteURL(url: string, payload: Payload): string {\n return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url\n}\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureProps,\n UploadFeaturePropsClient\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection].fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n props.collections[collection].fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: props.collections[collection].fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap = new Map<string, Field[]>()\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n schemaMap.set(collection, props.collections[collection].fields)\n }\n }\n\n return schemaMap\n },\n i18n,\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n req,\n showHiddenFields,\n }) => {\n // @ts-expect-error - for backwards-compatibility\n const id = node?.value?.id || node?.value\n\n if (req?.payload) {\n const uploadDocument: {\n value?: FileData & TypeWithID\n } = {}\n\n try {\n await populate({\n id,\n collectionSlug: node.relationTo,\n currentDepth,\n data: uploadDocument,\n depth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n })\n } catch (ignored) {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical upload node HTML converter: error fetching upload file',\n ignored,\n 'Node:',\n node,\n )\n return `<img />`\n }\n\n const url = getAbsoluteURL(uploadDocument?.value?.url ?? '', req?.payload)\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDocument?.value?.mimeType?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.value?.filename}</a>`\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (\n !uploadDocument?.value?.sizes ||\n !Object.keys(uploadDocument?.value?.sizes).length\n ) {\n return `<img src=\"${url}\" alt=\"${uploadDocument?.value?.filename}\" width=\"${uploadDocument?.value?.width}\" height=\"${uploadDocument?.value?.height}\"/>`\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n let pictureHTML = '<picture>'\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDocument.value?.sizes) {\n const imageSize: {\n url?: string\n } & FileSize = uploadDocument.value?.sizes[size]\n\n // Skip if any property of the size object is null\n if (\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = getAbsoluteURL(imageSize?.url, req?.payload)\n\n pictureHTML += `<source srcset=\"${imageSizeURL}\" media=\"(max-width: ${imageSize.width}px)\" type=\"${imageSize.mimeType}\">`\n }\n\n // Add the default img tag\n pictureHTML += `<img src=\"${url}\" alt=\"Image\" width=\"${uploadDocument.value?.width}\" height=\"${uploadDocument.value?.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${id}\" />`\n }\n },\n nodeTypes: [UploadServerNode.getType()],\n },\n },\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n allSubFields = allSubFields.concat(props?.collections?.[collection]?.fields)\n }\n return allSubFields\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAUA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AAiBjC;;;AAGA,SAASC,eAAeC,GAAW,EAAEC,OAAgB;EACnD,OAAOD,GAAA,EAAKE,UAAA,CAAW,UAAUF,GAAA,GAAM,CAACC,OAAA,EAASE,MAAA,EAAQC,SAAA,IAAa,EAAC,IAAKJ,GAAA;AAC9E;AAEA,OAAO,MAAMK,aAAA,GAAgBZ,mBAAA,CAI3B;EACAa,OAAA,EAAS,MAAAA,CAAO;IAAEH,MAAA,EAAQI,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ;QAAEC,WAAA,EAAa,CAAC;MAAE;IAC5B;IAEA,MAAMC,WAAA,GAAwC;MAC5CD,WAAA,EAAa,CAAC;IAChB;IACA,IAAID,KAAA,CAAMC,WAAW,EAAE;MACrB,KAAK,MAAME,UAAA,IAAcH,KAAA,CAAMC,WAAW,EAAE;QAC1CC,WAA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EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEjE,mBAAmB,gBAAgB,CAAA;AAEnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAExE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA"}
package/dist/index.js CHANGED
@@ -255,6 +255,7 @@ export function lexicalEditor(props) {
255
255
  locale,
256
256
  overrideAccess,
257
257
  path,
258
+ populate,
258
259
  populationPromises,
259
260
  req,
260
261
  schemaPath,
@@ -297,6 +298,7 @@ export function lexicalEditor(props) {
297
298
  overrideAccess: overrideAccess,
298
299
  parentRichTextFieldPath: path,
299
300
  parentRichTextFieldSchemaPath: schemaPath,
301
+ populateArg: populate,
300
302
  populationPromises: populationPromises,
301
303
  req,
302
304
  showHiddenFields: showHiddenFields,
@@ -333,6 +335,7 @@ export function lexicalEditor(props) {
333
335
  locale: locale,
334
336
  overrideAccess: overrideAccess,
335
337
  path,
338
+ populate,
336
339
  populationPromises: populationPromises,
337
340
  req,
338
341
  schemaPath,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["afterChangeTraverseFields","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","checkDependencies","deepCopyObject","deepCopyObjectSimple","withNullableJSONSchemaType","i18n","defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerEditorConfig","sanitizeServerFeatures","populateLexicalPopulationPromises","getGenerateImportMap","getGenerateSchemaMap","recurseNodeTree","richTextValidateHOC","defaultSanitizedServerEditorConfig","checkedDependencies","lexicalEditor","props","config","isRoot","parentIsLocalized","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","rootEditor","editor","rootEditorFeatures","defaultFeatures","rootFeatures","unSanitizedEditorConfig","featureI18n","lang","general","CellComponent","clientProps","admin","lexicalEditorConfig","path","editorConfig","FieldComponent","generateComponentMap","serverProps","generateImportMap","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","afterChange","args","collection","_context","global","operation","schemaPath","value","length","hook","nodeHooks","getSubFields","nodeIDMap","originalNodeIDMap","internal","richText","join","Object","keys","nodes","root","children","id","node","entries","afterChangeHooks","afterChangeHooksForNode","get","type","console","warn","originalNode","parentRichTextFieldPath","parentRichTextFieldSchemaPath","subFieldFn","subFieldDataFn","getSubFieldsData","subFields","data","originalData","doc","fields","previousDoc","previousSiblingDoc","siblingData","afterRead","fallbackLocale","locale","triggerAccessControl","triggerHooks","flattenedNodes","afterReadHooks","afterReadHooksForNode","beforeChange","errors","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","originalDataWithLocales","docWithLocales","newOriginalNodeIDMap","previousValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","BlocksFeature","LinebreakHTMLConverter","ParagraphHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","AutoLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorLexicalConfig","sortFeaturesForOptimalLoading","getEnabledNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","defaultRichTextValue","populate","createServerFeature","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport {\n afterChangeTraverseFields,\n afterReadTraverseFields,\n beforeChangeTraverseFields,\n beforeValidateTraverseFields,\n checkDependencies,\n deepCopyObject,\n deepCopyObjectSimple,\n withNullableJSONSchemaType,\n} from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from './types.js'\n\nimport { i18n } from './i18n.js'\nimport { defaultEditorConfig, defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { loadFeatures } from './lexical/config/server/loader.js'\nimport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { recurseNodeTree } from './utilities/recurseNodeTree.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet defaultSanitizedServerEditorConfig: null | SanitizedServerEditorConfig = null\nlet checkedDependencies = false\n\nexport function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n return async ({ config, isRoot, parentIsLocalized }) => {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n await checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/markdown',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: '0.18.0',\n },\n ],\n })\n }\n\n let features: FeatureProviderServer<any, any, any>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!props || (!props.features && !props.lexical)) {\n if (!defaultSanitizedServerEditorConfig) {\n defaultSanitizedServerEditorConfig = await sanitizeServerEditorConfig(\n defaultEditorConfig,\n config,\n parentIsLocalized,\n )\n features = deepCopyObject(defaultEditorFeatures)\n }\n\n finalSanitizedEditorConfig = deepCopyObject(defaultSanitizedServerEditorConfig)\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const rootEditor = config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n\n features =\n props.features && typeof props.features === 'function'\n ? props.features({\n defaultFeatures: deepCopyObject(defaultEditorFeatures),\n rootFeatures: rootEditorFeatures,\n })\n : (props.features as FeatureProviderServer<unknown, unknown, unknown>[])\n if (!features) {\n features = deepCopyObject(defaultEditorFeatures)\n }\n\n const lexical = props.lexical ?? deepCopyObjectSimple(defaultEditorConfig.lexical)!\n\n resolvedFeatureMap = await loadFeatures({\n config,\n isRoot,\n parentIsLocalized,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n finalSanitizedEditorConfig = {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical,\n resolvedFeatureMap,\n }\n }\n\n const featureI18n = finalSanitizedEditorConfig.features.i18n\n for (const lang in i18n) {\n if (!featureI18n[lang]) {\n featureI18n[lang] = {\n lexical: {},\n }\n }\n\n featureI18n[lang].lexical.general = i18n[lang]\n }\n\n return {\n CellComponent: {\n clientProps: {\n admin: props?.admin,\n lexicalEditorConfig: finalSanitizedEditorConfig.lexical,\n },\n path: '@payloadcms/richtext-lexical/client#RichTextCell',\n },\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n clientProps: {\n admin: props?.admin,\n lexicalEditorConfig: finalSanitizedEditorConfig.lexical,\n },\n path: '@payloadcms/richtext-lexical/client#RichTextField',\n },\n generateComponentMap: {\n path: '@payloadcms/richtext-lexical/generateComponentMap#getGenerateComponentMap',\n serverProps: {\n resolvedFeatureMap,\n },\n },\n generateImportMap: getGenerateImportMap({\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: {\n afterChange: [\n async (args) => {\n const { collection, context: _context, global, operation, path, req, schemaPath } = args\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.afterChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterChange) {\n value = await hook(args)\n }\n }\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const afterChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterChange\n const afterChangeHooksForNode = afterChangeHooks?.get(node.type)\n if (afterChangeHooksForNode) {\n for (const hook of afterChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(afterChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n\n if (subFields?.length) {\n await afterChangeTraverseFields({\n collection,\n context,\n data: originalData,\n doc: data,\n fields: subFields,\n global,\n operation,\n path,\n previousDoc: data,\n previousSiblingDoc: { ...data },\n req,\n schemaPath,\n siblingData: originalData || {},\n siblingDoc: { ...data },\n })\n }\n }\n }\n return value\n },\n ],\n afterRead: [\n /**\n * afterRead hooks do not receive the originalNode. Thus, they can run on all nodes, not just nodes with an ID.\n */\n async (args) => {\n const {\n collection,\n context: context,\n currentDepth,\n depth,\n draft,\n fallbackLocale,\n fieldPromises,\n findMany,\n flattenLocales,\n global,\n locale,\n overrideAccess,\n path,\n populationPromises,\n req,\n schemaPath,\n showHiddenFields,\n triggerAccessControl,\n triggerHooks,\n } = args\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.afterRead?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterRead) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterRead?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const flattenedNodes: SerializedLexicalNode[] = []\n\n recurseNodeTree({\n flattenedNodes,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n for (let node of flattenedNodes) {\n const afterReadHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterRead\n const afterReadHooksForNode = afterReadHooks?.get(node.type)\n if (afterReadHooksForNode) {\n for (const hook of afterReadHooksForNode) {\n node = await hook({\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n locale: locale!,\n node,\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n triggerAccessControl: triggerAccessControl!,\n triggerHooks: triggerHooks!,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n\n if (subFields?.length) {\n afterReadTraverseFields({\n collection,\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n doc: data,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n fields: subFields,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n global,\n locale: locale!,\n overrideAccess: overrideAccess!,\n path,\n populationPromises: populationPromises!,\n req,\n schemaPath,\n showHiddenFields: showHiddenFields!,\n siblingDoc: data,\n triggerAccessControl,\n triggerHooks,\n })\n }\n }\n }\n\n return value\n },\n ],\n beforeChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n errors,\n field,\n global,\n mergeLocaleActions,\n operation,\n path,\n req,\n schemaPath,\n siblingData,\n siblingDocWithLocales,\n skipValidation,\n } = args\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeChange) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n const originalNodeWithLocalesIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (field.name && siblingDocWithLocales?.[field.name]) {\n recurseNodeTree({\n nodeIDMap: originalNodeWithLocalesIDMap,\n nodes:\n (siblingDocWithLocales[field.name] as SerializedEditorState)?.root?.children ??\n [],\n })\n }\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.beforeChange\n const beforeChangeHooksForNode = beforeChangeHooks?.get(node.type)\n if (beforeChangeHooksForNode) {\n for (const hook of beforeChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n errors: errors!,\n mergeLocaleActions: mergeLocaleActions!,\n node,\n operation: operation!,\n originalNode: originalNodeIDMap[id],\n originalNodeWithLocales: originalNodeWithLocalesIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n skipValidation: skipValidation!,\n })\n }\n }\n\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n const originalDataWithLocales =\n subFieldDataFn({\n node: originalNodeWithLocalesIDMap[id],\n req,\n }) ?? {}\n\n if (subFields?.length) {\n await beforeChangeTraverseFields({\n id,\n collection,\n context,\n data,\n doc: originalData,\n docWithLocales: originalDataWithLocales ?? {},\n errors: errors!,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n path,\n req,\n schemaPath,\n siblingData: data,\n siblingDoc: originalData,\n siblingDocWithLocales: originalDataWithLocales ?? {},\n skipValidation,\n })\n }\n }\n }\n\n /**\n * within the beforeChange hook, id's may be re-generated.\n * Example:\n * 1. Seed data contains IDs for block feature blocks.\n * 2. Those are used in beforeValidate\n * 3. in beforeChange, those IDs are regenerated, because you cannot provide IDs during document creation. See baseIDField beforeChange hook for reasoning\n * 4. Thus, in order for all post-beforeChange hooks to receive the correct ID, we need to update the originalNodeIDMap with the new ID's, by regenerating the nodeIDMap.\n * The reason this is not generated for every hook, is to save on performance. We know we only really have to generate it in beforeValidate, which is the first hook,\n * and in beforeChange, which is where modifications to the provided IDs can occur.\n */\n const newOriginalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousValue = siblingData[field.name!]\n\n recurseNodeTree({\n nodeIDMap: newOriginalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!context.internal.richText) {\n context.internal.richText = {}\n }\n context.internal.richText[path.join('.')] = {\n originalNodeIDMap: newOriginalNodeIDMap,\n }\n\n return value\n },\n ],\n beforeValidate: [\n async (args) => {\n const {\n collection,\n context,\n global,\n operation,\n overrideAccess,\n path,\n previousValue,\n req,\n schemaPath,\n } = args\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeValidate?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeValidate) {\n value = await hook(args)\n }\n }\n\n // return value if there are NO hooks\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n /**\n * beforeValidate is the first field hook which runs. This is where we can create the node map, which can then be used in the other hooks.\n *\n */\n\n /**\n * flattenedNodes contains all nodes in the editor, in the order they appear in the editor. They will be used for the following hooks:\n * - afterRead\n *\n * The other hooks require nodes to have IDs, which is why those are ran only from the nodeIDMap. They require IDs because they have both doc/siblingDoc and data/siblingData, and\n * thus require a reliable way to match new node data to old node data. Given that node positions can change in between hooks, this is only reliably possible for nodes which are saved with\n * an ID.\n */\n //const flattenedNodes: SerializedLexicalNode[] = []\n\n /**\n * Only nodes with id's (so, nodes with hooks added to them) will be added to the nodeIDMap. They will be used for the following hooks:\n * - afterChange\n * - beforeChange\n * - beforeValidate\n *\n * Other hooks are handled by the flattenedNodes. All nodes in the nodeIDMap are part of flattenedNodes.\n */\n\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap: originalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!(context as any).internal.richText) {\n ;(context as any).internal.richText = {}\n }\n ;(context as any).internal.richText[path.join('.')] = {\n originalNodeIDMap,\n }\n\n /**\n * Now that the maps for all hooks are set up, we can run the validate hook\n */\n if (!finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size) {\n return value\n }\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n recurseNodeTree({\n //flattenedNodes,\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeValidateHooks =\n finalSanitizedEditorConfig.features.nodeHooks.beforeValidate\n const beforeValidateHooksForNode = beforeValidateHooks?.get(node.type)\n if (beforeValidateHooksForNode) {\n for (const hook of beforeValidateHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeValidate) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n\n if (subFields?.length) {\n await beforeValidateTraverseFields({\n id,\n collection,\n context,\n data,\n doc: originalData,\n fields: subFields,\n global,\n operation,\n overrideAccess: overrideAccess!,\n path,\n req,\n schemaPath,\n siblingData: data,\n siblingDoc: originalData,\n })\n }\n }\n }\n\n return value\n },\n ],\n },\n i18n: featureI18n,\n outputSchema: ({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n }) => {\n let outputSchema: JSONSchema4 = {\n // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.\n // In the future, we should\n // 1) allow recursive children\n // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.\n type: withNullableJSONSchemaType('object', isRequired),\n properties: {\n root: {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: {\n type: 'string',\n },\n children: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: {\n type: 'string',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['type', 'version'],\n },\n },\n direction: {\n oneOf: [\n {\n enum: ['ltr', 'rtl'],\n },\n {\n type: 'null',\n },\n ],\n },\n format: {\n type: 'string',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''], // ElementFormatType, since the root node is an element\n },\n indent: {\n type: 'integer',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['children', 'direction', 'format', 'indent', 'type', 'version'],\n },\n },\n required: ['root'],\n }\n for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes\n .modifyOutputSchemas) {\n outputSchema = modifyOutputSchema({\n collectionIDFieldTypes,\n config,\n currentSchema: outputSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n })\n }\n\n return outputSchema\n },\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\nexport { type BlockFields } from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { LinebreakHTMLConverter } from './features/converters/html/converter/converters/linebreak.js'\nexport { ParagraphHTMLConverter } from './features/converters/html/converter/converters/paragraph.js'\n\nexport { TextHTMLConverter } from './features/converters/html/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/html/converter/defaultConverters.js'\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/html/converter/index.js'\n\nexport type { HTMLConverter } from './features/converters/html/converter/types.js'\nexport { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/html/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\n\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\nexport { IndentFeature } from './features/indent/server/index.js'\n\nexport { AutoLinkNode } from './features/link/nodes/AutoLinkNode.js'\n\nexport { LinkNode } from './features/link/nodes/LinkNode.js'\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\nexport {\n type RelationshipData,\n RelationshipServerNode,\n} from './features/relationship/server/nodes/RelationshipNode.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\n\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/feature.server.js'\n\nexport type { UploadFeatureProps } from './features/upload/server/feature.server.js'\nexport { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\n\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\n\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\n\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport { getEnabledNodes } from './lexical/nodes/index.js'\nexport type { AdapterProps }\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\n\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport type * from './nodeTypes.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\n\nexport { populate } from './populateGraphQL/populate.js'\nexport type { LexicalEditorProps, LexicalRichTextAdapter } from './types.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\nexport { upgradeLexicalData } from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kC;AACzD,SAASC,qBAAqB,QAAQ;AACtC,SAASC,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAE7B,SAASC,QAAQ,QAAQ;AAEzB,SAASC,WAAW,QAAqC;AACzD,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AAOrC,SAASC,gBAAgB,QAAQ;AACjC,SACEC,mBAAmB,QAEd;AACP,SAEEC,sBAAsB,QACjB;AAEP,SAASC,mBAAmB,QAAQ;AACpC,SAASC,oBAAoB,QAAQ;AAsCrC,SAASC,UAAU,QAAQ,8BAA6B,CAAC;AAEzD,SAASC,aAAa,QAAQ;AAG9B,SAA0BC,gBAAgB,QAAQ;AAGlD,SACEhM,mBAAmB,EACnBC,qBAAqB,EACrBgM,0BAA0B,QACrB;AAEP,SAAS/L,YAAY,EAAEgM,6BAA6B,QAAQ;AAC5D,SACE/L,0BAA0B,EAC1BC,sBAAsB,QACjB;AAQP,SAAS+L,eAAe,QAAQ;AAQhC,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,sBAAsB,EACtBC,sBAAsB,EACtBC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EAClBC,SAAS,EACTC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,QACZ;AACP,SAASC,WAAW,EAAEC,WAAW,QAAQ;AAIzC,SAASC,oBAAoB,QAAQ;AAErC,SAASC,QAAQ,QAAQ;AAEzB,SAASC,mBAAmB,QAAQ;AAGpC,SAASC,kBAAkB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["afterChangeTraverseFields","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","checkDependencies","deepCopyObject","deepCopyObjectSimple","withNullableJSONSchemaType","i18n","defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerEditorConfig","sanitizeServerFeatures","populateLexicalPopulationPromises","getGenerateImportMap","getGenerateSchemaMap","recurseNodeTree","richTextValidateHOC","defaultSanitizedServerEditorConfig","checkedDependencies","lexicalEditor","props","config","isRoot","parentIsLocalized","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","rootEditor","editor","rootEditorFeatures","defaultFeatures","rootFeatures","unSanitizedEditorConfig","featureI18n","lang","general","CellComponent","clientProps","admin","lexicalEditorConfig","path","editorConfig","FieldComponent","generateComponentMap","serverProps","generateImportMap","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","afterChange","args","collection","_context","global","operation","schemaPath","value","length","hook","nodeHooks","getSubFields","nodeIDMap","originalNodeIDMap","internal","richText","join","Object","keys","nodes","root","children","id","node","entries","afterChangeHooks","afterChangeHooksForNode","get","type","console","warn","originalNode","parentRichTextFieldPath","parentRichTextFieldSchemaPath","subFieldFn","subFieldDataFn","getSubFieldsData","subFields","data","originalData","doc","fields","previousDoc","previousSiblingDoc","siblingData","afterRead","fallbackLocale","locale","populate","triggerAccessControl","triggerHooks","flattenedNodes","afterReadHooks","afterReadHooksForNode","populateArg","beforeChange","errors","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","originalDataWithLocales","docWithLocales","newOriginalNodeIDMap","previousValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","BlocksFeature","LinebreakHTMLConverter","ParagraphHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","AutoLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorLexicalConfig","sortFeaturesForOptimalLoading","getEnabledNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","defaultRichTextValue","createServerFeature","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport {\n afterChangeTraverseFields,\n afterReadTraverseFields,\n beforeChangeTraverseFields,\n beforeValidateTraverseFields,\n checkDependencies,\n deepCopyObject,\n deepCopyObjectSimple,\n withNullableJSONSchemaType,\n} from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from './types.js'\n\nimport { i18n } from './i18n.js'\nimport { defaultEditorConfig, defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { loadFeatures } from './lexical/config/server/loader.js'\nimport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { recurseNodeTree } from './utilities/recurseNodeTree.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet defaultSanitizedServerEditorConfig: null | SanitizedServerEditorConfig = null\nlet checkedDependencies = false\n\nexport function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n return async ({ config, isRoot, parentIsLocalized }) => {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n await checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/markdown',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: '0.18.0',\n },\n ],\n })\n }\n\n let features: FeatureProviderServer<any, any, any>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!props || (!props.features && !props.lexical)) {\n if (!defaultSanitizedServerEditorConfig) {\n defaultSanitizedServerEditorConfig = await sanitizeServerEditorConfig(\n defaultEditorConfig,\n config,\n parentIsLocalized,\n )\n features = deepCopyObject(defaultEditorFeatures)\n }\n\n finalSanitizedEditorConfig = deepCopyObject(defaultSanitizedServerEditorConfig)\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const rootEditor = config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n\n features =\n props.features && typeof props.features === 'function'\n ? props.features({\n defaultFeatures: deepCopyObject(defaultEditorFeatures),\n rootFeatures: rootEditorFeatures,\n })\n : (props.features as FeatureProviderServer<unknown, unknown, unknown>[])\n if (!features) {\n features = deepCopyObject(defaultEditorFeatures)\n }\n\n const lexical = props.lexical ?? deepCopyObjectSimple(defaultEditorConfig.lexical)!\n\n resolvedFeatureMap = await loadFeatures({\n config,\n isRoot,\n parentIsLocalized,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n finalSanitizedEditorConfig = {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical,\n resolvedFeatureMap,\n }\n }\n\n const featureI18n = finalSanitizedEditorConfig.features.i18n\n for (const lang in i18n) {\n if (!featureI18n[lang]) {\n featureI18n[lang] = {\n lexical: {},\n }\n }\n\n featureI18n[lang].lexical.general = i18n[lang]\n }\n\n return {\n CellComponent: {\n clientProps: {\n admin: props?.admin,\n lexicalEditorConfig: finalSanitizedEditorConfig.lexical,\n },\n path: '@payloadcms/richtext-lexical/client#RichTextCell',\n },\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n clientProps: {\n admin: props?.admin,\n lexicalEditorConfig: finalSanitizedEditorConfig.lexical,\n },\n path: '@payloadcms/richtext-lexical/client#RichTextField',\n },\n generateComponentMap: {\n path: '@payloadcms/richtext-lexical/generateComponentMap#getGenerateComponentMap',\n serverProps: {\n resolvedFeatureMap,\n },\n },\n generateImportMap: getGenerateImportMap({\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: {\n afterChange: [\n async (args) => {\n const { collection, context: _context, global, operation, path, req, schemaPath } = args\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.afterChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterChange) {\n value = await hook(args)\n }\n }\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const afterChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterChange\n const afterChangeHooksForNode = afterChangeHooks?.get(node.type)\n if (afterChangeHooksForNode) {\n for (const hook of afterChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(afterChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n\n if (subFields?.length) {\n await afterChangeTraverseFields({\n collection,\n context,\n data: originalData,\n doc: data,\n fields: subFields,\n global,\n operation,\n path,\n previousDoc: data,\n previousSiblingDoc: { ...data },\n req,\n schemaPath,\n siblingData: originalData || {},\n siblingDoc: { ...data },\n })\n }\n }\n }\n return value\n },\n ],\n afterRead: [\n /**\n * afterRead hooks do not receive the originalNode. Thus, they can run on all nodes, not just nodes with an ID.\n */\n async (args) => {\n const {\n collection,\n context: context,\n currentDepth,\n depth,\n draft,\n fallbackLocale,\n fieldPromises,\n findMany,\n flattenLocales,\n global,\n locale,\n overrideAccess,\n path,\n populate,\n populationPromises,\n req,\n schemaPath,\n showHiddenFields,\n triggerAccessControl,\n triggerHooks,\n } = args\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.afterRead?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterRead) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterRead?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const flattenedNodes: SerializedLexicalNode[] = []\n\n recurseNodeTree({\n flattenedNodes,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n for (let node of flattenedNodes) {\n const afterReadHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterRead\n const afterReadHooksForNode = afterReadHooks?.get(node.type)\n if (afterReadHooksForNode) {\n for (const hook of afterReadHooksForNode) {\n node = await hook({\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n locale: locale!,\n node,\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n populateArg: populate,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n triggerAccessControl: triggerAccessControl!,\n triggerHooks: triggerHooks!,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n\n if (subFields?.length) {\n afterReadTraverseFields({\n collection,\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n doc: data,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n fields: subFields,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n global,\n locale: locale!,\n overrideAccess: overrideAccess!,\n path,\n populate,\n populationPromises: populationPromises!,\n req,\n schemaPath,\n showHiddenFields: showHiddenFields!,\n siblingDoc: data,\n triggerAccessControl,\n triggerHooks,\n })\n }\n }\n }\n\n return value\n },\n ],\n beforeChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n errors,\n field,\n global,\n mergeLocaleActions,\n operation,\n path,\n req,\n schemaPath,\n siblingData,\n siblingDocWithLocales,\n skipValidation,\n } = args\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeChange) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n const originalNodeWithLocalesIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (field.name && siblingDocWithLocales?.[field.name]) {\n recurseNodeTree({\n nodeIDMap: originalNodeWithLocalesIDMap,\n nodes:\n (siblingDocWithLocales[field.name] as SerializedEditorState)?.root?.children ??\n [],\n })\n }\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.beforeChange\n const beforeChangeHooksForNode = beforeChangeHooks?.get(node.type)\n if (beforeChangeHooksForNode) {\n for (const hook of beforeChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n errors: errors!,\n mergeLocaleActions: mergeLocaleActions!,\n node,\n operation: operation!,\n originalNode: originalNodeIDMap[id],\n originalNodeWithLocales: originalNodeWithLocalesIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n skipValidation: skipValidation!,\n })\n }\n }\n\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n const originalDataWithLocales =\n subFieldDataFn({\n node: originalNodeWithLocalesIDMap[id],\n req,\n }) ?? {}\n\n if (subFields?.length) {\n await beforeChangeTraverseFields({\n id,\n collection,\n context,\n data,\n doc: originalData,\n docWithLocales: originalDataWithLocales ?? {},\n errors: errors!,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n path,\n req,\n schemaPath,\n siblingData: data,\n siblingDoc: originalData,\n siblingDocWithLocales: originalDataWithLocales ?? {},\n skipValidation,\n })\n }\n }\n }\n\n /**\n * within the beforeChange hook, id's may be re-generated.\n * Example:\n * 1. Seed data contains IDs for block feature blocks.\n * 2. Those are used in beforeValidate\n * 3. in beforeChange, those IDs are regenerated, because you cannot provide IDs during document creation. See baseIDField beforeChange hook for reasoning\n * 4. Thus, in order for all post-beforeChange hooks to receive the correct ID, we need to update the originalNodeIDMap with the new ID's, by regenerating the nodeIDMap.\n * The reason this is not generated for every hook, is to save on performance. We know we only really have to generate it in beforeValidate, which is the first hook,\n * and in beforeChange, which is where modifications to the provided IDs can occur.\n */\n const newOriginalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousValue = siblingData[field.name!]\n\n recurseNodeTree({\n nodeIDMap: newOriginalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!context.internal.richText) {\n context.internal.richText = {}\n }\n context.internal.richText[path.join('.')] = {\n originalNodeIDMap: newOriginalNodeIDMap,\n }\n\n return value\n },\n ],\n beforeValidate: [\n async (args) => {\n const {\n collection,\n context,\n global,\n operation,\n overrideAccess,\n path,\n previousValue,\n req,\n schemaPath,\n } = args\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeValidate?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeValidate) {\n value = await hook(args)\n }\n }\n\n // return value if there are NO hooks\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n /**\n * beforeValidate is the first field hook which runs. This is where we can create the node map, which can then be used in the other hooks.\n *\n */\n\n /**\n * flattenedNodes contains all nodes in the editor, in the order they appear in the editor. They will be used for the following hooks:\n * - afterRead\n *\n * The other hooks require nodes to have IDs, which is why those are ran only from the nodeIDMap. They require IDs because they have both doc/siblingDoc and data/siblingData, and\n * thus require a reliable way to match new node data to old node data. Given that node positions can change in between hooks, this is only reliably possible for nodes which are saved with\n * an ID.\n */\n //const flattenedNodes: SerializedLexicalNode[] = []\n\n /**\n * Only nodes with id's (so, nodes with hooks added to them) will be added to the nodeIDMap. They will be used for the following hooks:\n * - afterChange\n * - beforeChange\n * - beforeValidate\n *\n * Other hooks are handled by the flattenedNodes. All nodes in the nodeIDMap are part of flattenedNodes.\n */\n\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap: originalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!(context as any).internal.richText) {\n ;(context as any).internal.richText = {}\n }\n ;(context as any).internal.richText[path.join('.')] = {\n originalNodeIDMap,\n }\n\n /**\n * Now that the maps for all hooks are set up, we can run the validate hook\n */\n if (!finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size) {\n return value\n }\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n recurseNodeTree({\n //flattenedNodes,\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeValidateHooks =\n finalSanitizedEditorConfig.features.nodeHooks.beforeValidate\n const beforeValidateHooksForNode = beforeValidateHooks?.get(node.type)\n if (beforeValidateHooksForNode) {\n for (const hook of beforeValidateHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeValidate) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const data = subFieldDataFn({ node, req }) ?? {}\n const originalData = subFieldDataFn({ node: originalNodeIDMap[id], req }) ?? {}\n\n if (subFields?.length) {\n await beforeValidateTraverseFields({\n id,\n collection,\n context,\n data,\n doc: originalData,\n fields: subFields,\n global,\n operation,\n overrideAccess: overrideAccess!,\n path,\n req,\n schemaPath,\n siblingData: data,\n siblingDoc: originalData,\n })\n }\n }\n }\n\n return value\n },\n ],\n },\n i18n: featureI18n,\n outputSchema: ({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n }) => {\n let outputSchema: JSONSchema4 = {\n // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.\n // In the future, we should\n // 1) allow recursive children\n // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.\n type: withNullableJSONSchemaType('object', isRequired),\n properties: {\n root: {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: {\n type: 'string',\n },\n children: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: {\n type: 'string',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['type', 'version'],\n },\n },\n direction: {\n oneOf: [\n {\n enum: ['ltr', 'rtl'],\n },\n {\n type: 'null',\n },\n ],\n },\n format: {\n type: 'string',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''], // ElementFormatType, since the root node is an element\n },\n indent: {\n type: 'integer',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['children', 'direction', 'format', 'indent', 'type', 'version'],\n },\n },\n required: ['root'],\n }\n for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes\n .modifyOutputSchemas) {\n outputSchema = modifyOutputSchema({\n collectionIDFieldTypes,\n config,\n currentSchema: outputSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n })\n }\n\n return outputSchema\n },\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\nexport { type BlockFields } from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { LinebreakHTMLConverter } from './features/converters/html/converter/converters/linebreak.js'\nexport { ParagraphHTMLConverter } from './features/converters/html/converter/converters/paragraph.js'\n\nexport { TextHTMLConverter } from './features/converters/html/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/html/converter/defaultConverters.js'\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/html/converter/index.js'\n\nexport type { HTMLConverter } from './features/converters/html/converter/types.js'\nexport { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/html/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\n\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\nexport { IndentFeature } from './features/indent/server/index.js'\n\nexport { AutoLinkNode } from './features/link/nodes/AutoLinkNode.js'\n\nexport { LinkNode } from './features/link/nodes/LinkNode.js'\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\nexport {\n type RelationshipData,\n RelationshipServerNode,\n} from './features/relationship/server/nodes/RelationshipNode.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\n\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/feature.server.js'\n\nexport type { UploadFeatureProps } from './features/upload/server/feature.server.js'\nexport { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\n\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\n\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\n\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport { getEnabledNodes } from './lexical/nodes/index.js'\nexport type { AdapterProps }\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\n\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport type * from './nodeTypes.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\n\nexport { populate } from './populateGraphQL/populate.js'\nexport type { LexicalEditorProps, LexicalRichTextAdapter } from './types.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexic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,SAASC,gBAAgB,QAAQ;AACjC,SAASC,cAAc,QAAkC;AACzD,SAASC,qBAAqB,QAAQ;AACtC,SAASC,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAE7B,SAASC,QAAQ,QAAQ;AAEzB,SAASC,WAAW,QAAqC;AACzD,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AAOrC,SAASC,gBAAgB,QAAQ;AACjC,SACEC,mBAAmB,QAEd;AACP,SAEEC,sBAAsB,QACjB;AAEP,SAASC,mBAAmB,QAAQ;AACpC,SAASC,oBAAoB,QAAQ;AAsCrC,SAASC,UAAU,QAAQ,8BAA6B,CAAC;AAEzD,SAASC,aAAa,QAAQ;AAG9B,SAA0BC,gBAAgB,QAAQ;AAGlD,SACElM,mBAAmB,EACnBC,qBAAqB,EACrBkM,0BAA0B,QACrB;AAEP,SAASjM,YAAY,EAAEkM,6BAA6B,QAAQ;AAC5D,SACEjM,0BAA0B,EAC1BC,sBAAsB,QACjB;AAQP,SAASiM,eAAe,QAAQ;AAQhC,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,sBAAsB,EACtBC,sBAAsB,EACtBC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EAClBC,SAAS,EACTC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,QACZ;AACP,SAASC,WAAW,EAAEC,WAAW,QAAQ;AAIzC,SAASC,oBAAoB,QAAQ;AAErC,SAASlG,QAAQ,QAAQ;AAEzB,SAASmG,mBAAmB,QAAQ;AAGpC,SAASC,kBAAkB,QAAQ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.0.0-beta.124",
3
+ "version": "3.0.0-beta.126",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -56,8 +56,8 @@
56
56
  "lexical": "0.18.0",
57
57
  "react-error-boundary": "4.0.13",
58
58
  "uuid": "10.0.0",
59
- "@payloadcms/translations": "3.0.0-beta.124",
60
- "@payloadcms/ui": "3.0.0-beta.124"
59
+ "@payloadcms/translations": "3.0.0-beta.126",
60
+ "@payloadcms/ui": "3.0.0-beta.126"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@babel/cli": "^7.24.5",
@@ -78,7 +78,7 @@
78
78
  "eslint-plugin-react-compiler": "0.0.0-experimental-7670337-20240918",
79
79
  "swc-plugin-transform-remove-imports": "1.15.0",
80
80
  "@payloadcms/eslint-config": "3.0.0-beta.112",
81
- "payload": "3.0.0-beta.124"
81
+ "payload": "3.0.0-beta.126"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "@faceless-ui/modal": "3.0.0-beta.2",
@@ -96,8 +96,8 @@
96
96
  "lexical": "0.18.0",
97
97
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
98
98
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
99
- "@payloadcms/next": "3.0.0-beta.124",
100
- "payload": "3.0.0-beta.124"
99
+ "@payloadcms/next": "3.0.0-beta.126",
100
+ "payload": "3.0.0-beta.126"
101
101
  },
102
102
  "engines": {
103
103
  "node": "^18.20.2 || >=20.9.0"