refactor(richtext-lexical): ensure field can be rendered outside EntityVisibilityProvider (#11842)
This ensures that the lexical field can be rendered without having to wrap it inside an `EntityVisibilityProvider`, making it a bit easier to manually render the lexical field in a custom component.
This commit is contained in:
@@ -43,7 +43,7 @@ export { ToolbarButton } from '../../features/toolbars/shared/ToolbarButton/inde
|
||||
export { TableFeatureClient } from '../../features/experimental_table/client/index.js'
|
||||
|
||||
export { ToolbarDropdown } from '../../features/toolbars/shared/ToolbarDropdown/index.js'
|
||||
export { UploadFeatureClient } from '../../features/upload/client/feature.client.js'
|
||||
export { UploadFeatureClient } from '../../features/upload/client/index.js'
|
||||
|
||||
export { RichTextField } from '../../field/index.js'
|
||||
export {
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as React from 'react'
|
||||
type Options = {
|
||||
uploads: boolean
|
||||
user: ClientUser
|
||||
visibleEntities: VisibleEntities
|
||||
visibleEntities?: VisibleEntities
|
||||
}
|
||||
|
||||
type FilteredCollectionsT = (
|
||||
@@ -17,7 +17,7 @@ type FilteredCollectionsT = (
|
||||
|
||||
const filterRichTextCollections: FilteredCollectionsT = (collections, options) => {
|
||||
return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {
|
||||
if (!options?.visibleEntities.collections.includes(slug)) {
|
||||
if (!options?.visibleEntities?.collections.includes(slug)) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import React, { useCallback, useId, useReducer, useRef, useState } from 'react'
|
||||
|
||||
import type { BaseClientFeatureProps } from '../../../typesClient.js'
|
||||
import type { UploadData } from '../../server/nodes/UploadNode.js'
|
||||
import type { UploadFeaturePropsClient } from '../feature.client.js'
|
||||
import type { UploadFeaturePropsClient } from '../index.js'
|
||||
import type { UploadNode } from '../nodes/UploadNode.js'
|
||||
|
||||
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'
|
||||
|
||||
@@ -16,7 +16,7 @@ import React, { useEffect } from 'react'
|
||||
|
||||
import type { PluginComponent } from '../../../typesClient.js'
|
||||
import type { UploadData } from '../../server/nodes/UploadNode.js'
|
||||
import type { UploadFeaturePropsClient } from '../feature.client.js'
|
||||
import type { UploadFeaturePropsClient } from '../index.js'
|
||||
|
||||
import { UploadDrawer } from '../drawer/index.js'
|
||||
import { $createUploadNode, UploadNode } from '../nodes/UploadNode.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PopulationPromise } from '../../typesServer.js'
|
||||
import type { UploadFeatureProps } from './feature.server.js'
|
||||
import type { UploadFeatureProps } from './index.js'
|
||||
import type { SerializedUploadNode } from './nodes/UploadNode.js'
|
||||
|
||||
import { populate } from '../../../populateGraphQL/populate.js'
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
|
||||
import { sanitizeFields } from 'payload'
|
||||
|
||||
import type { UploadFeaturePropsClient } from '../client/feature.client.js'
|
||||
import type { UploadFeaturePropsClient } from '../client/index.js'
|
||||
|
||||
import { populate } from '../../../populateGraphQL/populate.js'
|
||||
import { createServerFeature } from '../../../utilities/createServerFeature.js'
|
||||
@@ -2,7 +2,7 @@ import { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToForm
|
||||
import { isValidID } from 'payload'
|
||||
|
||||
import type { NodeValidation } from '../../typesServer.js'
|
||||
import type { UploadFeatureProps } from './feature.server.js'
|
||||
import type { UploadFeatureProps } from './index.js'
|
||||
import type { SerializedUploadNode } from './nodes/UploadNode.js'
|
||||
|
||||
export const uploadValidation = (
|
||||
|
||||
@@ -980,8 +980,8 @@ export type {
|
||||
|
||||
export { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts
|
||||
|
||||
export { UploadFeature } from './features/upload/server/feature.server.js'
|
||||
export type { UploadFeatureProps } from './features/upload/server/feature.server.js'
|
||||
export { UploadFeature } from './features/upload/server/index.js'
|
||||
export type { UploadFeatureProps } from './features/upload/server/index.js'
|
||||
|
||||
export { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'
|
||||
export type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'
|
||||
|
||||
@@ -22,7 +22,7 @@ import { UnorderedListFeature } from '../../../features/lists/unorderedList/serv
|
||||
import { ParagraphFeature } from '../../../features/paragraph/server/index.js'
|
||||
import { RelationshipFeature } from '../../../features/relationship/server/index.js'
|
||||
import { InlineToolbarFeature } from '../../../features/toolbars/inline/server/index.js'
|
||||
import { UploadFeature } from '../../../features/upload/server/feature.server.js'
|
||||
import { UploadFeature } from '../../../features/upload/server/index.js'
|
||||
import { LexicalEditorTheme } from '../../theme/EditorTheme.js'
|
||||
|
||||
export const defaultEditorLexicalConfig: LexicalEditorConfig = {
|
||||
|
||||
Reference in New Issue
Block a user