@payloadcms/richtext-lexical 3.0.0-beta.10 → 3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/field/features/blocks/component/index.d.ts.map +1 -1
- package/dist/field/features/blocks/component/index.js +5 -2
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.server.js +15 -30
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/link/drawer/index.js +3 -2
- package/dist/field/features/link/drawer/index.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts.map +1 -1
- package/dist/field/features/link/feature.server.js +17 -3
- package/dist/field/features/link/feature.server.js.map +1 -1
- package/dist/field/features/types.d.ts +1 -5
- package/dist/field/features/types.d.ts.map +1 -1
- package/dist/field/features/types.js.map +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +3 -2
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
- package/dist/field/features/upload/feature.server.d.ts.map +1 -1
- package/dist/field/features/upload/feature.server.js +17 -5
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/generateComponentMap.js +19 -18
- package/dist/generateComponentMap.js.map +1 -1
- package/dist/generateSchemaMap.js +10 -9
- package/dist/generateSchemaMap.js.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +0 -423
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/upload/feature.server.ts"],"sourcesContent":["import type { Field, FieldWithRichTextRequiredEditor, Payload } from 'payload/types'\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { UploadFeaturePropsClient } from './feature.client.js'\n\nimport { UploadFeatureClientComponent } from './feature.client.js'\nimport { type SerializedUploadNode, UploadNode } from './nodes/UploadNode.js'\nimport { uploadPopulationPromiseHOC } from './populationPromise.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections: {\n [collection: string]: {\n fields: FieldWithRichTextRequiredEditor[]\n }\n }\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: FeatureProviderProviderServer<\n UploadFeatureProps,\n UploadFeaturePropsClient\n> = (props) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = { collections: {} }\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 return {\n feature: () => {\n return {\n ClientComponent: UploadFeatureClientComponent,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) return
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/upload/feature.server.ts"],"sourcesContent":["import type { Field, FieldWithRichTextRequiredEditor, Payload } from 'payload/types'\n\nimport { traverseFields } from '@payloadcms/next/utilities'\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { UploadFeaturePropsClient } from './feature.client.js'\n\nimport { UploadFeatureClientComponent } from './feature.client.js'\nimport { type SerializedUploadNode, UploadNode } from './nodes/UploadNode.js'\nimport { uploadPopulationPromiseHOC } from './populationPromise.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections: {\n [collection: string]: {\n fields: FieldWithRichTextRequiredEditor[]\n }\n }\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: FeatureProviderProviderServer<\n UploadFeatureProps,\n UploadFeaturePropsClient\n> = (props) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = { collections: {} }\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 return {\n feature: () => {\n return {\n ClientComponent: UploadFeatureClientComponent,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n if (!props?.collections) return null\n\n const schemaMap = new Map<string, Field[]>()\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 schemaMap.set(collection, props.collections[collection].fields)\n traverseFields({\n config,\n fields: props.collections[collection].fields,\n i18n,\n schemaMap,\n schemaPath: collection,\n validRelationships,\n })\n }\n }\n\n return schemaMap\n },\n nodes: [\n {\n converters: {\n html: {\n converter: async ({ node, payload }) => {\n if (payload) {\n let uploadDocument: any\n try {\n uploadDocument = await payload.findByID({\n id: node.value.id,\n collection: node.relationTo,\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: string = getAbsoluteURL(uploadDocument?.url as string, payload)\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!(uploadDocument?.mimeType as string)?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.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 (!uploadDocument?.sizes || !Object.keys(uploadDocument?.sizes).length) {\n return `<img src=\"${url}\" alt=\"${uploadDocument?.filename}\" width=\"${uploadDocument?.width}\" height=\"${uploadDocument?.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.sizes) {\n const imageSize = uploadDocument.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: string = getAbsoluteURL(imageSize?.url as string, 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.width}\" height=\"${uploadDocument.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${node.value.id}\" />`\n }\n },\n nodeTypes: [UploadNode.getType()],\n } as HTMLConverter<SerializedUploadNode>,\n },\n node: UploadNode,\n populationPromises: [uploadPopulationPromiseHOC(props)],\n validations: [uploadValidation()],\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'upload',\n serverFeatureProps: props,\n }\n}\n"],"names":["traverseFields","UploadFeatureClientComponent","UploadNode","uploadPopulationPromiseHOC","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","props","collections","clientProps","collection","hasExtraFields","fields","length","feature","ClientComponent","clientFeatureProps","generateSchemaMap","i18n","schemaMap","Map","validRelationships","map","c","slug","set","schemaPath","nodes","converters","html","converter","node","uploadDocument","findByID","id","value","relationTo","ignored","console","error","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","populationPromises","validations","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,6BAA4B;AAM3D,SAASC,4BAA4B,QAAQ,sBAAqB;AAClE,SAAoCC,UAAU,QAAQ,wBAAuB;AAC7E,SAASC,0BAA0B,QAAQ,yBAAwB;AACnE,SAAS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Aa,qBAAqB,EAAEF,UAAUJ,KAAK,CAAC,WAAW,EAAEI,UAAUT,QAAQ,CAAC,EAAE,CAAC;wCAC3H;wCAEA,0BAA0B;wCAC1BO,eAAe,CAAC,UAAU,EAAE9C,IAAI,qBAAqB,EAAE+B,eAAea,KAAK,CAAC,UAAU,EAAEb,eAAec,MAAM,CAAC,EAAE,CAAC;wCACjHC,eAAe;wCACf,OAAOA;oCACT,OAAO;wCACL,OAAO,CAAC,UAAU,EAAEhB,KAAKI,KAAK,CAACD,EAAE,CAAC,IAAI,CAAC;oCACzC;gCACF;gCACAkB,WAAW;oCAACvD,WAAWwD,OAAO;iCAAG;4BACnC;wBACF;wBACAtB,MAAMlC;wBACNyD,oBAAoB;4BAACxD,2BAA2BS;yBAAO;wBACvDgD,aAAa;4BAACxD;yBAAmB;oBACnC;iBACD;gBACDyD,oBAAoBjD;YACtB;QACF;QACAkD,KAAK;QACLD,oBAAoBjD;IACtB;AACF,EAAC"}
|
|
@@ -41,24 +41,25 @@ export const getGenerateComponentMap = (args)=>({ WithServerSideProps, config, i
|
|
|
41
41
|
schemaMap: new Map(),
|
|
42
42
|
schemaPath
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
const fields
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
if (schemas) {
|
|
45
|
+
for (const [schemaKey, fields] of schemas.entries()){
|
|
46
|
+
const sanitizedFields = sanitizeFields({
|
|
47
|
+
config,
|
|
48
|
+
fields: cloneDeep(fields),
|
|
49
|
+
requireFieldLevelRichTextEditor: true,
|
|
50
|
+
validRelationships
|
|
51
|
+
});
|
|
52
|
+
const mappedFields = mapFields({
|
|
53
|
+
WithServerSideProps,
|
|
54
|
+
config,
|
|
55
|
+
disableAddingID: true,
|
|
56
|
+
fieldSchema: sanitizedFields,
|
|
57
|
+
i18n,
|
|
58
|
+
parentPath: `${schemaPath}.feature.${featureKey}.fields.${schemaKey}`,
|
|
59
|
+
readOnly: false
|
|
60
|
+
});
|
|
61
|
+
componentMap.set(`feature.${featureKey}.fields.${schemaKey}`, mappedFields);
|
|
62
|
+
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
if (!ClientComponent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generateComponentMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport { mapFields } from '@payloadcms/ui/utilities/buildComponentMap'\nimport { sanitizeFields } from 'payload/config'\nimport React from 'react'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\nimport type { GeneratedFeatureProviderComponent } from './types.js'\n\nimport { cloneDeep } from './field/lexical/utils/cloneDeep.js'\n\nexport const getGenerateComponentMap =\n (args: {\n resolvedFeatureMap: ResolvedServerFeatureMap\n }): RichTextAdapter['generateComponentMap'] =>\n ({ WithServerSideProps, config, i18n, schemaPath }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n const componentMap = new Map()\n\n // turn args.resolvedFeatureMap into an array of [key, value] pairs, ordered by value.order, lowest order first:\n const resolvedFeatureMapArray = Array.from(args.resolvedFeatureMap.entries()).sort(\n (a, b) => a[1].order - b[1].order,\n )\n\n componentMap.set(\n `features`,\n resolvedFeatureMapArray\n .map(([featureKey, resolvedFeature]) => {\n const ClientComponent = resolvedFeature.ClientComponent\n const clientComponentProps = resolvedFeature.clientFeatureProps\n\n /**\n * Handle Feature Component Maps\n */\n if (\n 'generateComponentMap' in resolvedFeature &&\n typeof resolvedFeature.generateComponentMap === 'function'\n ) {\n const components = resolvedFeature.generateComponentMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaPath,\n })\n\n for (const componentKey in components) {\n const Component = components[componentKey]\n\n if (Component) {\n componentMap.set(\n `feature.${featureKey}.components.${componentKey}`,\n <WithServerSideProps\n Component={Component}\n componentKey={componentKey}\n featureKey={resolvedFeature.key}\n key={`${resolvedFeature.key}-${componentKey}`}\n />,\n )\n }\n }\n }\n\n /**\n * Handle Feature Schema Maps (rendered fields)\n */\n if (\n 'generateSchemaMap' in resolvedFeature &&\n typeof resolvedFeature.generateSchemaMap === 'function'\n ) {\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap: new Map(),\n schemaPath,\n })\n\n
|
|
1
|
+
{"version":3,"sources":["../src/generateComponentMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport { mapFields } from '@payloadcms/ui/utilities/buildComponentMap'\nimport { sanitizeFields } from 'payload/config'\nimport React from 'react'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\nimport type { GeneratedFeatureProviderComponent } from './types.js'\n\nimport { cloneDeep } from './field/lexical/utils/cloneDeep.js'\n\nexport const getGenerateComponentMap =\n (args: {\n resolvedFeatureMap: ResolvedServerFeatureMap\n }): RichTextAdapter['generateComponentMap'] =>\n ({ WithServerSideProps, config, i18n, schemaPath }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n const componentMap = new Map()\n\n // turn args.resolvedFeatureMap into an array of [key, value] pairs, ordered by value.order, lowest order first:\n const resolvedFeatureMapArray = Array.from(args.resolvedFeatureMap.entries()).sort(\n (a, b) => a[1].order - b[1].order,\n )\n\n componentMap.set(\n `features`,\n resolvedFeatureMapArray\n .map(([featureKey, resolvedFeature]) => {\n const ClientComponent = resolvedFeature.ClientComponent\n const clientComponentProps = resolvedFeature.clientFeatureProps\n\n /**\n * Handle Feature Component Maps\n */\n if (\n 'generateComponentMap' in resolvedFeature &&\n typeof resolvedFeature.generateComponentMap === 'function'\n ) {\n const components = resolvedFeature.generateComponentMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaPath,\n })\n\n for (const componentKey in components) {\n const Component = components[componentKey]\n\n if (Component) {\n componentMap.set(\n `feature.${featureKey}.components.${componentKey}`,\n <WithServerSideProps\n Component={Component}\n componentKey={componentKey}\n featureKey={resolvedFeature.key}\n key={`${resolvedFeature.key}-${componentKey}`}\n />,\n )\n }\n }\n }\n\n /**\n * Handle Feature Schema Maps (rendered fields)\n */\n if (\n 'generateSchemaMap' in resolvedFeature &&\n typeof resolvedFeature.generateSchemaMap === 'function'\n ) {\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap: new Map(),\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey, fields] of schemas.entries()) {\n const sanitizedFields = sanitizeFields({\n config,\n fields: cloneDeep(fields),\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n\n const mappedFields = mapFields({\n WithServerSideProps,\n config,\n disableAddingID: true,\n fieldSchema: sanitizedFields,\n i18n,\n parentPath: `${schemaPath}.feature.${featureKey}.fields.${schemaKey}`,\n readOnly: false,\n })\n\n componentMap.set(`feature.${featureKey}.fields.${schemaKey}`, mappedFields)\n }\n }\n }\n\n if (!ClientComponent) {\n return null\n }\n\n return {\n ClientComponent:\n clientComponentProps && typeof clientComponentProps === 'object' ? (\n <ClientComponent\n {...clientComponentProps}\n featureKey={resolvedFeature.key}\n key={resolvedFeature.key}\n order={resolvedFeature.order}\n />\n ) : (\n <ClientComponent\n featureKey={resolvedFeature.key}\n key={resolvedFeature.key}\n order={resolvedFeature.order}\n />\n ),\n key: resolvedFeature.key,\n order: resolvedFeature.order,\n } as GeneratedFeatureProviderComponent\n })\n .filter((feature) => feature !== null),\n )\n\n return componentMap\n }\n"],"names":["mapFields","sanitizeFields","React","cloneDeep","getGenerateComponentMap","args","WithServerSideProps","config","i18n","schemaPath","validRelationships","collections","map","c","slug","componentMap","Map","resolvedFeatureMapArray","Array","from","resolvedFeatureMap","entries","sort","a","b","order","set","featureKey","resolvedFeature","ClientComponent","clientComponentProps","clientFeatureProps","generateComponentMap","components","props","serverFeatureProps","componentKey","Component","key","generateSchemaMap","schemas","schemaMap","schemaKey","fields","sanitizedFields","requireFieldLevelRichTextEditor","mappedFields","disableAddingID","fieldSchema","parentPath","readOnly","filter","feature"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,SAAS,QAAQ,6CAA4C;AACtE,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAKzB,SAASC,SAAS,QAAQ,qCAAoC;AAE9D,OAAO,MAAMC,0BACX,CAACC,OAGD,CAAC,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAChD,MAAMC,qBAAqBH,OAAOI,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAEtE,MAAMC,eAAe,IAAIC;QAEzB,gHAAgH;QAChH,MAAMC,0BAA0BC,MAAMC,IAAI,CAACd,KAAKe,kBAAkB,CAACC,OAAO,IAAIC,IAAI,CAChF,CAACC,GAAGC,IAAMD,CAAC,CAAC,EAAE,CAACE,KAAK,GAAGD,CAAC,CAAC,EAAE,CAACC,KAAK;QAGnCV,aAAaW,GAAG,CACd,CAAC,QAAQ,CAAC,EACVT,wBACGL,GAAG,CAAC,CAAC,CAACe,YAAYC,gBAAgB;YACjC,MAAMC,kBAAkBD,gBAAgBC,eAAe;YACvD,MAAMC,uBAAuBF,gBAAgBG,kBAAkB;YAE/D;;WAEC,GACD,IACE,0BAA0BH,mBAC1B,OAAOA,gBAAgBI,oBAAoB,KAAK,YAChD;gBACA,MAAMC,aAAaL,gBAAgBI,oBAAoB,CAAC;oBACtDzB;oBACAC;oBACA0B,OAAON,gBAAgBO,kBAAkB;oBACzC1B;gBACF;gBAEA,IAAK,MAAM2B,gBAAgBH,WAAY;oBACrC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G9B,oBAACI;oBACCF,YAAYC,gBAAgBU,GAAG;oBAC/BA,KAAKV,gBAAgBU,GAAG;oBACxBb,OAAOG,gBAAgBH,KAAK;;gBAGlCa,KAAKV,gBAAgBU,GAAG;gBACxBb,OAAOG,gBAAgBH,KAAK;YAC9B;QACF,GACC0B,MAAM,CAAC,CAACC,UAAYA,YAAY;QAGrC,OAAOrC;IACT,EAAC"}
|
|
@@ -13,15 +13,16 @@ export const getGenerateSchemaMap = (args)=>({ config, i18n, schemaMap, schemaPa
|
|
|
13
13
|
schemaMap,
|
|
14
14
|
schemaPath
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
const fields
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
if (schemas) {
|
|
17
|
+
for (const [schemaKey, fields] of schemas.entries()){
|
|
18
|
+
const sanitizedFields = sanitizeFields({
|
|
19
|
+
config,
|
|
20
|
+
fields: cloneDeep(fields),
|
|
21
|
+
requireFieldLevelRichTextEditor: true,
|
|
22
|
+
validRelationships
|
|
23
|
+
});
|
|
24
|
+
schemaMap.set(`${schemaPath}.feature.${featureKey}.${schemaKey}`, sanitizedFields);
|
|
25
|
+
}
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
return schemaMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\n\nimport { cloneDeep } from './field/lexical/utils/cloneDeep.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, i18n, schemaMap, schemaPath }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n
|
|
1
|
+
{"version":3,"sources":["../src/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\n\nimport { cloneDeep } from './field/lexical/utils/cloneDeep.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, i18n, schemaMap, schemaPath }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey, fields] of schemas.entries()) {\n const sanitizedFields = sanitizeFields({\n config,\n fields: cloneDeep(fields),\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n\n schemaMap.set(`${schemaPath}.feature.${featureKey}.${schemaKey}`, sanitizedFields)\n }\n }\n }\n\n return schemaMap\n }\n"],"names":["sanitizeFields","cloneDeep","getGenerateSchemaMap","args","config","i18n","schemaMap","schemaPath","validRelationships","collections","map","c","slug","featureKey","resolvedFeature","resolvedFeatureMap","entries","generateSchemaMap","schemas","props","serverFeatureProps","schemaKey","fields","sanitizedFields","requireFieldLevelRichTextEditor","set"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAI/C,SAASC,SAAS,QAAQ,qCAAoC;AAE9D,OAAO,MAAMC,uBACX,CAACC,OACD,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,EAAE;QACtC,MAAMC,qBAAqBJ,OAAOK,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAEtE,KAAK,MAAM,CAACC,YAAYC,gBAAgB,IAAIX,KAAKY,kBAAkB,CAACC,OAAO,GAAI;YAC7E,IACE,CAAE,CAAA,uBAAuBF,eAAc,KACvC,OAAOA,gBAAgBG,iBAAiB,KAAK,YAC7C;gBACA;YACF;YACA,MAAMC,UAAUJ,gBAAgBG,iBAAiB,CAAC;gBAChDb;gBACAC;gBACAc,OAAOL,gBAAgBM,kBAAkB;gBACzCd;gBACAC;YACF;YAEA,IAAIW,SAAS;gBACX,KAAK,MAAM,CAACG,WAAWC,OAAO,IAAIJ,QAAQF,OAAO,GAAI;oBACnD,MAAMO,kBAAkBvB,eAAe;wBACrCI;wBACAkB,QAAQrB,UAAUqB;wBAClBE,iCAAiC;wBACjChB;oBACF;oBAEAF,UAAUmB,GAAG,CAAC,CAAC,EAAElB,WAAW,SAAS,EAAEM,WAAW,CAAC,EAAEQ,UAAU,CAAC,EAAEE;gBACpE;YACF;QACF;QAEA,OAAOjB;IACT,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.12",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
"@types/node": "20.12.5",
|
|
41
41
|
"@types/react": "18.2.74",
|
|
42
42
|
"@types/react-dom": "18.2.24",
|
|
43
|
+
"payload": "3.0.0-beta.12",
|
|
44
|
+
"@payloadcms/ui": "3.0.0-beta.12",
|
|
43
45
|
"@payloadcms/eslint-config": "1.1.1",
|
|
44
|
-
"@payloadcms/
|
|
45
|
-
"@payloadcms/
|
|
46
|
-
"@payloadcms/ui": "3.0.0-beta.10",
|
|
47
|
-
"payload": "3.0.0-beta.10"
|
|
46
|
+
"@payloadcms/translations": "3.0.0-beta.12",
|
|
47
|
+
"@payloadcms/next": "3.0.0-beta.12"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@payloadcms/
|
|
51
|
-
"@payloadcms/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
50
|
+
"@payloadcms/translations": "3.0.0-beta.12",
|
|
51
|
+
"@payloadcms/ui": "3.0.0-beta.12",
|
|
52
|
+
"@payloadcms/next": "3.0.0-beta.12",
|
|
53
|
+
"payload": "3.0.0-beta.12"
|
|
54
54
|
},
|
|
55
55
|
"exports": {
|
|
56
56
|
".": {
|
package/src/index.ts
DELETED
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import type { JSONSchema4 } from 'json-schema'
|
|
2
|
-
import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'
|
|
3
|
-
|
|
4
|
-
import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'
|
|
5
|
-
import { withNullableJSONSchemaType } from 'payload/utilities'
|
|
6
|
-
|
|
7
|
-
import type { FeatureProviderServer, ResolvedServerFeatureMap } from './field/features/types.js'
|
|
8
|
-
import type { SanitizedServerEditorConfig } from './field/lexical/config/types.js'
|
|
9
|
-
import type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapter } from './types.js'
|
|
10
|
-
|
|
11
|
-
import { RichTextCell } from './cell/index.js'
|
|
12
|
-
import { RichTextField } from './field/index.js'
|
|
13
|
-
import {
|
|
14
|
-
defaultEditorConfig,
|
|
15
|
-
defaultEditorFeatures,
|
|
16
|
-
defaultSanitizedServerEditorConfig,
|
|
17
|
-
} from './field/lexical/config/server/default.js'
|
|
18
|
-
import { loadFeatures } from './field/lexical/config/server/loader.js'
|
|
19
|
-
import { sanitizeServerFeatures } from './field/lexical/config/server/sanitize.js'
|
|
20
|
-
import { cloneDeep } from './field/lexical/utils/cloneDeep.js'
|
|
21
|
-
import { getGenerateComponentMap } from './generateComponentMap.js'
|
|
22
|
-
import { getGenerateSchemaMap } from './generateSchemaMap.js'
|
|
23
|
-
import { richTextRelationshipPromise } from './populate/richTextRelationshipPromise.js'
|
|
24
|
-
import { richTextValidateHOC } from './validate/index.js'
|
|
25
|
-
|
|
26
|
-
export function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapter {
|
|
27
|
-
let resolvedFeatureMap: ResolvedServerFeatureMap = null
|
|
28
|
-
|
|
29
|
-
let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only
|
|
30
|
-
if (!props || (!props.features && !props.lexical)) {
|
|
31
|
-
finalSanitizedEditorConfig = cloneDeep(defaultSanitizedServerEditorConfig)
|
|
32
|
-
resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap
|
|
33
|
-
} else {
|
|
34
|
-
let features: FeatureProviderServer<unknown, unknown>[] =
|
|
35
|
-
props.features && typeof props.features === 'function'
|
|
36
|
-
? props.features({ defaultFeatures: cloneDeep(defaultEditorFeatures) })
|
|
37
|
-
: (props.features as FeatureProviderServer<unknown, unknown>[])
|
|
38
|
-
if (!features) {
|
|
39
|
-
features = cloneDeep(defaultEditorFeatures)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const lexical: LexicalEditorConfig = props.lexical
|
|
43
|
-
|
|
44
|
-
resolvedFeatureMap = loadFeatures({
|
|
45
|
-
unSanitizedEditorConfig: {
|
|
46
|
-
features,
|
|
47
|
-
lexical: lexical ? lexical : defaultEditorConfig.lexical,
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
finalSanitizedEditorConfig = {
|
|
52
|
-
features: sanitizeServerFeatures(resolvedFeatureMap),
|
|
53
|
-
lexical: lexical ? lexical : defaultEditorConfig.lexical,
|
|
54
|
-
resolvedFeatureMap,
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
CellComponent: withMergedProps({
|
|
60
|
-
Component: RichTextCell,
|
|
61
|
-
toMergeIntoProps: { lexicalEditorConfig: finalSanitizedEditorConfig.lexical },
|
|
62
|
-
}),
|
|
63
|
-
FieldComponent: withMergedProps({
|
|
64
|
-
Component: RichTextField,
|
|
65
|
-
toMergeIntoProps: { lexicalEditorConfig: finalSanitizedEditorConfig.lexical },
|
|
66
|
-
}),
|
|
67
|
-
afterReadPromise: ({ field, incomingEditorState, siblingDoc }) => {
|
|
68
|
-
return new Promise<void>((resolve, reject) => {
|
|
69
|
-
const promises: Promise<void>[] = []
|
|
70
|
-
|
|
71
|
-
if (finalSanitizedEditorConfig?.features?.hooks?.afterReadPromises?.length) {
|
|
72
|
-
for (const afterReadPromise of finalSanitizedEditorConfig.features.hooks
|
|
73
|
-
.afterReadPromises) {
|
|
74
|
-
const promise = afterReadPromise({
|
|
75
|
-
field,
|
|
76
|
-
incomingEditorState,
|
|
77
|
-
siblingDoc,
|
|
78
|
-
})
|
|
79
|
-
if (promise) {
|
|
80
|
-
promises.push(promise)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
Promise.all(promises)
|
|
86
|
-
.then(() => resolve())
|
|
87
|
-
.catch((error) => reject(error))
|
|
88
|
-
})
|
|
89
|
-
},
|
|
90
|
-
editorConfig: finalSanitizedEditorConfig,
|
|
91
|
-
generateComponentMap: getGenerateComponentMap({
|
|
92
|
-
resolvedFeatureMap,
|
|
93
|
-
}),
|
|
94
|
-
generateSchemaMap: getGenerateSchemaMap({
|
|
95
|
-
resolvedFeatureMap,
|
|
96
|
-
}),
|
|
97
|
-
outputSchema: ({
|
|
98
|
-
collectionIDFieldTypes,
|
|
99
|
-
config,
|
|
100
|
-
field,
|
|
101
|
-
interfaceNameDefinitions,
|
|
102
|
-
isRequired,
|
|
103
|
-
}) => {
|
|
104
|
-
let outputSchema: JSONSchema4 = {
|
|
105
|
-
// This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.
|
|
106
|
-
// In the future, we should
|
|
107
|
-
// 1) allow recursive children
|
|
108
|
-
// 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.
|
|
109
|
-
type: withNullableJSONSchemaType('object', isRequired),
|
|
110
|
-
properties: {
|
|
111
|
-
root: {
|
|
112
|
-
type: 'object',
|
|
113
|
-
additionalProperties: false,
|
|
114
|
-
properties: {
|
|
115
|
-
type: {
|
|
116
|
-
type: 'string',
|
|
117
|
-
},
|
|
118
|
-
children: {
|
|
119
|
-
type: 'array',
|
|
120
|
-
items: {
|
|
121
|
-
type: 'object',
|
|
122
|
-
additionalProperties: true,
|
|
123
|
-
properties: {
|
|
124
|
-
type: {
|
|
125
|
-
type: 'string',
|
|
126
|
-
},
|
|
127
|
-
version: {
|
|
128
|
-
type: 'integer',
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
required: ['type', 'version'],
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
direction: {
|
|
135
|
-
oneOf: [
|
|
136
|
-
{
|
|
137
|
-
enum: ['ltr', 'rtl'],
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
type: 'null',
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
format: {
|
|
145
|
-
type: 'string',
|
|
146
|
-
enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''], // ElementFormatType, since the root node is an element
|
|
147
|
-
},
|
|
148
|
-
indent: {
|
|
149
|
-
type: 'integer',
|
|
150
|
-
},
|
|
151
|
-
version: {
|
|
152
|
-
type: 'integer',
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
required: ['children', 'direction', 'format', 'indent', 'type', 'version'],
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
required: ['root'],
|
|
159
|
-
}
|
|
160
|
-
for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes
|
|
161
|
-
.modifyOutputSchemas) {
|
|
162
|
-
outputSchema = modifyOutputSchema({
|
|
163
|
-
collectionIDFieldTypes,
|
|
164
|
-
config,
|
|
165
|
-
currentSchema: outputSchema,
|
|
166
|
-
field,
|
|
167
|
-
interfaceNameDefinitions,
|
|
168
|
-
isRequired,
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return outputSchema
|
|
173
|
-
},
|
|
174
|
-
populationPromise({
|
|
175
|
-
context,
|
|
176
|
-
currentDepth,
|
|
177
|
-
depth,
|
|
178
|
-
field,
|
|
179
|
-
findMany,
|
|
180
|
-
flattenLocales,
|
|
181
|
-
overrideAccess,
|
|
182
|
-
populationPromises,
|
|
183
|
-
req,
|
|
184
|
-
showHiddenFields,
|
|
185
|
-
siblingDoc,
|
|
186
|
-
}) {
|
|
187
|
-
// check if there are any features with nodes which have populationPromises for this field
|
|
188
|
-
if (finalSanitizedEditorConfig?.features?.populationPromises?.size) {
|
|
189
|
-
return richTextRelationshipPromise({
|
|
190
|
-
context,
|
|
191
|
-
currentDepth,
|
|
192
|
-
depth,
|
|
193
|
-
editorPopulationPromises: finalSanitizedEditorConfig.features.populationPromises,
|
|
194
|
-
field,
|
|
195
|
-
findMany,
|
|
196
|
-
flattenLocales,
|
|
197
|
-
overrideAccess,
|
|
198
|
-
populationPromises,
|
|
199
|
-
req,
|
|
200
|
-
showHiddenFields,
|
|
201
|
-
siblingDoc,
|
|
202
|
-
})
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return null
|
|
206
|
-
},
|
|
207
|
-
validate: richTextValidateHOC({
|
|
208
|
-
editorConfig: finalSanitizedEditorConfig,
|
|
209
|
-
}),
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export { AlignFeature } from './field/features/align/feature.server.js'
|
|
214
|
-
export { BlockQuoteFeature } from './field/features/blockquote/feature.server.js'
|
|
215
|
-
export {
|
|
216
|
-
BlocksFeature,
|
|
217
|
-
type BlocksFeatureProps,
|
|
218
|
-
type LexicalBlock,
|
|
219
|
-
} from './field/features/blocks/feature.server.js'
|
|
220
|
-
export {
|
|
221
|
-
$createBlockNode,
|
|
222
|
-
$isBlockNode,
|
|
223
|
-
type BlockFields,
|
|
224
|
-
BlockNode,
|
|
225
|
-
type SerializedBlockNode,
|
|
226
|
-
} from './field/features/blocks/nodes/BlocksNode.js'
|
|
227
|
-
|
|
228
|
-
export { TextDropdownSectionWithEntries } from './field/features/common/floatingSelectToolbarTextDropdownSection/index.js'
|
|
229
|
-
export { LinebreakHTMLConverter } from './field/features/converters/html/converter/converters/linebreak.js'
|
|
230
|
-
export { ParagraphHTMLConverter } from './field/features/converters/html/converter/converters/paragraph.js'
|
|
231
|
-
|
|
232
|
-
export { TextHTMLConverter } from './field/features/converters/html/converter/converters/text.js'
|
|
233
|
-
export { defaultHTMLConverters } from './field/features/converters/html/converter/defaultConverters.js'
|
|
234
|
-
export {
|
|
235
|
-
convertLexicalNodesToHTML,
|
|
236
|
-
convertLexicalToHTML,
|
|
237
|
-
} from './field/features/converters/html/converter/index.js'
|
|
238
|
-
export type { HTMLConverter } from './field/features/converters/html/converter/types.js'
|
|
239
|
-
export {
|
|
240
|
-
HTMLConverterFeature,
|
|
241
|
-
type HTMLConverterFeatureProps,
|
|
242
|
-
} from './field/features/converters/html/feature.server.js'
|
|
243
|
-
export {
|
|
244
|
-
consolidateHTMLConverters,
|
|
245
|
-
lexicalHTML,
|
|
246
|
-
} from './field/features/converters/html/field/index.js'
|
|
247
|
-
export { createClientComponent } from './field/features/createClientComponent.js'
|
|
248
|
-
export { TestRecorderFeature } from './field/features/debug/testrecorder/feature.server.js'
|
|
249
|
-
export { TreeViewFeature } from './field/features/debug/treeview/feature.server.js'
|
|
250
|
-
export { BoldFeature } from './field/features/format/bold/feature.server.js'
|
|
251
|
-
export { SectionWithEntries as FormatSectionWithEntries } from './field/features/format/common/floatingSelectToolbarSection.js'
|
|
252
|
-
export { InlineCodeFeature } from './field/features/format/inlinecode/feature.server.js'
|
|
253
|
-
export { ItalicFeature } from './field/features/format/italic/feature.server.js'
|
|
254
|
-
export { StrikethroughFeature } from './field/features/format/strikethrough/feature.server.js'
|
|
255
|
-
export { SubscriptFeature } from './field/features/format/subscript/feature.server.js'
|
|
256
|
-
export { SuperscriptFeature } from './field/features/format/superscript/feature.server.js'
|
|
257
|
-
export { UnderlineFeature } from './field/features/format/underline/feature.server.js'
|
|
258
|
-
|
|
259
|
-
export { HeadingFeature } from './field/features/heading/feature.server.js'
|
|
260
|
-
export { IndentFeature } from './field/features/indent/feature.server.js'
|
|
261
|
-
|
|
262
|
-
export { LinkFeature, type LinkFeatureServerProps } from './field/features/link/feature.server.js'
|
|
263
|
-
export {
|
|
264
|
-
$createAutoLinkNode,
|
|
265
|
-
$isAutoLinkNode,
|
|
266
|
-
AutoLinkNode,
|
|
267
|
-
} from './field/features/link/nodes/AutoLinkNode.js'
|
|
268
|
-
export {
|
|
269
|
-
$createLinkNode,
|
|
270
|
-
$isLinkNode,
|
|
271
|
-
LinkNode,
|
|
272
|
-
TOGGLE_LINK_COMMAND,
|
|
273
|
-
} from './field/features/link/nodes/LinkNode.js'
|
|
274
|
-
export type {
|
|
275
|
-
LinkFields,
|
|
276
|
-
SerializedAutoLinkNode,
|
|
277
|
-
SerializedLinkNode,
|
|
278
|
-
} from './field/features/link/nodes/types.js'
|
|
279
|
-
export { CheckListFeature } from './field/features/lists/checklist/feature.server.js'
|
|
280
|
-
export { OrderedListFeature } from './field/features/lists/orderedlist/feature.server.js'
|
|
281
|
-
export { UnorderedListFeature } from './field/features/lists/unorderedlist/feature.server.js'
|
|
282
|
-
export { LexicalPluginToLexicalFeature } from './field/features/migrations/lexicalPluginToLexical/feature.server.js'
|
|
283
|
-
export { SlateBlockquoteConverter } from './field/features/migrations/slateToLexical/converter/converters/blockquote/index.js'
|
|
284
|
-
export { SlateHeadingConverter } from './field/features/migrations/slateToLexical/converter/converters/heading/index.js'
|
|
285
|
-
export { SlateIndentConverter } from './field/features/migrations/slateToLexical/converter/converters/indent/index.js'
|
|
286
|
-
export { SlateLinkConverter } from './field/features/migrations/slateToLexical/converter/converters/link/index.js'
|
|
287
|
-
export { SlateListItemConverter } from './field/features/migrations/slateToLexical/converter/converters/listItem/index.js'
|
|
288
|
-
export { SlateOrderedListConverter } from './field/features/migrations/slateToLexical/converter/converters/orderedList/index.js'
|
|
289
|
-
export { SlateRelationshipConverter } from './field/features/migrations/slateToLexical/converter/converters/relationship/index.js'
|
|
290
|
-
export { SlateUnknownConverter } from './field/features/migrations/slateToLexical/converter/converters/unknown/index.js'
|
|
291
|
-
export { SlateUnorderedListConverter } from './field/features/migrations/slateToLexical/converter/converters/unorderedList/index.js'
|
|
292
|
-
|
|
293
|
-
export { SlateUploadConverter } from './field/features/migrations/slateToLexical/converter/converters/upload/index.js'
|
|
294
|
-
export { defaultSlateConverters } from './field/features/migrations/slateToLexical/converter/defaultConverters.js'
|
|
295
|
-
export {
|
|
296
|
-
convertSlateNodesToLexical,
|
|
297
|
-
convertSlateToLexical,
|
|
298
|
-
} from './field/features/migrations/slateToLexical/converter/index.js'
|
|
299
|
-
|
|
300
|
-
export type {
|
|
301
|
-
SlateNode,
|
|
302
|
-
SlateNodeConverter,
|
|
303
|
-
} from './field/features/migrations/slateToLexical/converter/types.js'
|
|
304
|
-
export { SlateToLexicalFeature } from './field/features/migrations/slateToLexical/feature.server.js'
|
|
305
|
-
export { ParagraphFeature } from './field/features/paragraph/feature.server.js'
|
|
306
|
-
export { RelationshipFeature } from './field/features/relationship/feature.server.js'
|
|
307
|
-
export {
|
|
308
|
-
$createRelationshipNode,
|
|
309
|
-
$isRelationshipNode,
|
|
310
|
-
type RelationshipData,
|
|
311
|
-
RelationshipNode,
|
|
312
|
-
type SerializedRelationshipNode,
|
|
313
|
-
} from './field/features/relationship/nodes/RelationshipNode.js'
|
|
314
|
-
export type {
|
|
315
|
-
ClientFeature,
|
|
316
|
-
ClientFeatureProviderMap,
|
|
317
|
-
FeatureProviderClient,
|
|
318
|
-
FeatureProviderProviderClient,
|
|
319
|
-
FeatureProviderProviderServer,
|
|
320
|
-
FeatureProviderServer,
|
|
321
|
-
NodeValidation,
|
|
322
|
-
PopulationPromise,
|
|
323
|
-
ResolvedClientFeature,
|
|
324
|
-
ResolvedClientFeatureMap,
|
|
325
|
-
ResolvedServerFeature,
|
|
326
|
-
ResolvedServerFeatureMap,
|
|
327
|
-
SanitizedClientFeatures,
|
|
328
|
-
SanitizedPlugin,
|
|
329
|
-
SanitizedServerFeatures,
|
|
330
|
-
ServerFeature,
|
|
331
|
-
ServerFeatureProviderMap,
|
|
332
|
-
} from './field/features/types.js'
|
|
333
|
-
export { UploadFeature } from './field/features/upload/feature.server.js'
|
|
334
|
-
|
|
335
|
-
export type { UploadFeatureProps } from './field/features/upload/feature.server.js'
|
|
336
|
-
|
|
337
|
-
export type { RawUploadPayload } from './field/features/upload/nodes/UploadNode.js'
|
|
338
|
-
|
|
339
|
-
export {
|
|
340
|
-
$createUploadNode,
|
|
341
|
-
$isUploadNode,
|
|
342
|
-
type SerializedUploadNode,
|
|
343
|
-
type UploadData,
|
|
344
|
-
UploadNode,
|
|
345
|
-
} from './field/features/upload/nodes/UploadNode.js'
|
|
346
|
-
export {
|
|
347
|
-
EditorConfigProvider,
|
|
348
|
-
useEditorConfigContext,
|
|
349
|
-
} from './field/lexical/config/client/EditorConfigProvider.js'
|
|
350
|
-
export {
|
|
351
|
-
sanitizeClientEditorConfig,
|
|
352
|
-
sanitizeClientFeatures,
|
|
353
|
-
} from './field/lexical/config/client/sanitize.js'
|
|
354
|
-
export {
|
|
355
|
-
defaultEditorConfig,
|
|
356
|
-
defaultEditorFeatures,
|
|
357
|
-
defaultEditorLexicalConfig,
|
|
358
|
-
defaultSanitizedServerEditorConfig,
|
|
359
|
-
} from './field/lexical/config/server/default.js'
|
|
360
|
-
export {
|
|
361
|
-
loadFeatures,
|
|
362
|
-
sortFeaturesForOptimalLoading,
|
|
363
|
-
} from './field/lexical/config/server/loader.js'
|
|
364
|
-
export {
|
|
365
|
-
sanitizeServerEditorConfig,
|
|
366
|
-
sanitizeServerFeatures,
|
|
367
|
-
} from './field/lexical/config/server/sanitize.js'
|
|
368
|
-
|
|
369
|
-
export type {
|
|
370
|
-
ClientEditorConfig,
|
|
371
|
-
SanitizedClientEditorConfig,
|
|
372
|
-
SanitizedServerEditorConfig,
|
|
373
|
-
ServerEditorConfig,
|
|
374
|
-
} from './field/lexical/config/types.js'
|
|
375
|
-
export { getEnabledNodes } from './field/lexical/nodes/index.js'
|
|
376
|
-
|
|
377
|
-
export {
|
|
378
|
-
type FloatingToolbarSection,
|
|
379
|
-
type FloatingToolbarSectionEntry,
|
|
380
|
-
} from './field/lexical/plugins/FloatingSelectToolbar/types.js'
|
|
381
|
-
export { ENABLE_SLASH_MENU_COMMAND } from './field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js'
|
|
382
|
-
export type { AdapterProps }
|
|
383
|
-
|
|
384
|
-
export {
|
|
385
|
-
SlashMenuGroup,
|
|
386
|
-
SlashMenuOption,
|
|
387
|
-
} from './field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'
|
|
388
|
-
export { CAN_USE_DOM } from './field/lexical/utils/canUseDOM.js'
|
|
389
|
-
export { cloneDeep } from './field/lexical/utils/cloneDeep.js'
|
|
390
|
-
export { getDOMRangeRect } from './field/lexical/utils/getDOMRangeRect.js'
|
|
391
|
-
export { getSelectedNode } from './field/lexical/utils/getSelectedNode.js'
|
|
392
|
-
export { isHTMLElement } from './field/lexical/utils/guard.js'
|
|
393
|
-
export { invariant } from './field/lexical/utils/invariant.js'
|
|
394
|
-
export { joinClasses } from './field/lexical/utils/joinClasses.js'
|
|
395
|
-
export { createBlockNode } from './field/lexical/utils/markdown/createBlockNode.js'
|
|
396
|
-
export {
|
|
397
|
-
DETAIL_TYPE_TO_DETAIL,
|
|
398
|
-
DOUBLE_LINE_BREAK,
|
|
399
|
-
ELEMENT_FORMAT_TO_TYPE,
|
|
400
|
-
ELEMENT_TYPE_TO_FORMAT,
|
|
401
|
-
IS_ALL_FORMATTING,
|
|
402
|
-
LTR_REGEX,
|
|
403
|
-
NON_BREAKING_SPACE,
|
|
404
|
-
NodeFormat,
|
|
405
|
-
RTL_REGEX,
|
|
406
|
-
TEXT_MODE_TO_TYPE,
|
|
407
|
-
TEXT_TYPE_TO_FORMAT,
|
|
408
|
-
TEXT_TYPE_TO_MODE,
|
|
409
|
-
} from './field/lexical/utils/nodeFormat.js'
|
|
410
|
-
export { Point, isPoint } from './field/lexical/utils/point.js'
|
|
411
|
-
export { Rect } from './field/lexical/utils/rect.js'
|
|
412
|
-
export { setFloatingElemPosition } from './field/lexical/utils/setFloatingElemPosition.js'
|
|
413
|
-
export { setFloatingElemPositionForLinkEditor } from './field/lexical/utils/setFloatingElemPositionForLinkEditor.js'
|
|
414
|
-
export {
|
|
415
|
-
addSwipeDownListener,
|
|
416
|
-
addSwipeLeftListener,
|
|
417
|
-
addSwipeRightListener,
|
|
418
|
-
addSwipeUpListener,
|
|
419
|
-
} from './field/lexical/utils/swipe.js'
|
|
420
|
-
export { sanitizeUrl, validateUrl } from './field/lexical/utils/url.js'
|
|
421
|
-
export { defaultRichTextValue } from './populate/defaultValue.js'
|
|
422
|
-
|
|
423
|
-
export type { LexicalEditorProps, LexicalRichTextAdapter } from './types.js'
|