@payloadcms/richtext-lexical 3.80.0-internal.60d6f94 → 3.80.0-internal.82dcece

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/exports/client/Field-OIMYWB22.js +2 -0
  2. package/dist/exports/client/Field-OIMYWB22.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-2S5Q7QYO.js +2 -0
  5. package/dist/exports/client/chunk-2S5Q7QYO.js.map +7 -0
  6. package/dist/exports/client/chunk-EZX4YW7S.js +12 -0
  7. package/dist/exports/client/chunk-EZX4YW7S.js.map +7 -0
  8. package/dist/exports/client/componentInline-NL25DNZ5.js +2 -0
  9. package/dist/exports/client/index.d.ts +0 -1
  10. package/dist/exports/client/index.d.ts.map +1 -1
  11. package/dist/exports/client/index.js +23 -23
  12. package/dist/exports/client/index.js.map +3 -3
  13. package/dist/exports/react/index.d.ts +1 -3
  14. package/dist/exports/react/index.d.ts.map +1 -1
  15. package/dist/exports/react/index.js +0 -1
  16. package/dist/exports/react/index.js.map +1 -1
  17. package/dist/features/blocks/client/component/BlockContent.d.ts +4 -7
  18. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  19. package/dist/features/blocks/client/component/BlockContent.js +8 -9
  20. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  21. package/dist/features/blocks/client/component/index.d.ts +4 -20
  22. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  23. package/dist/features/blocks/client/component/index.js +55 -112
  24. package/dist/features/blocks/client/component/index.js.map +1 -1
  25. package/dist/features/blocks/client/componentInline/index.d.ts +14 -8
  26. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  27. package/dist/features/blocks/client/componentInline/index.js +18 -67
  28. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  29. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -4
  30. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/features/blocks/client/nodes/BlocksNode.js +1 -3
  32. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  33. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -4
  34. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  35. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +1 -3
  36. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  37. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  38. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +3 -1
  39. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  40. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  41. package/dist/features/converters/lexicalToHtml/async/converters/link.js +7 -2
  42. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  43. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  44. package/dist/features/converters/lexicalToHtml/async/converters/list.js +5 -1
  45. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  46. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  47. package/dist/features/converters/lexicalToHtml/async/converters/table.js +2 -1
  48. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  49. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  50. package/dist/features/converters/lexicalToHtml/async/converters/text.js +2 -1
  51. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  52. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  53. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +11 -10
  54. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  55. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts +5 -0
  56. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -0
  57. package/dist/features/converters/lexicalToHtml/shared/cssColors.js +8 -0
  58. package/dist/features/converters/lexicalToHtml/shared/cssColors.js.map +1 -0
  59. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  60. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +3 -1
  61. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  62. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  63. package/dist/features/converters/lexicalToHtml/sync/converters/link.js +7 -2
  64. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  66. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +5 -1
  67. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  68. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  69. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +2 -1
  70. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  72. package/dist/features/converters/lexicalToHtml/sync/converters/text.js +2 -1
  73. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  74. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  75. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +11 -10
  76. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  77. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +20 -6
  78. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  79. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -7
  80. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  81. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +2 -17
  82. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  83. package/dist/features/converters/lexicalToJSX/converter/index.js +4 -124
  84. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  85. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +10 -14
  86. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  87. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  88. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -1
  89. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  90. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  91. package/dist/field/Diff/converters/link.js +7 -2
  92. package/dist/field/Diff/converters/link.js.map +1 -1
  93. package/dist/field/Field.d.ts.map +1 -1
  94. package/dist/field/Field.js +19 -19
  95. package/dist/field/Field.js.map +1 -1
  96. package/dist/field/bundled.css +1 -1
  97. package/dist/field/index.d.ts +0 -1
  98. package/dist/field/index.d.ts.map +1 -1
  99. package/dist/field/index.js +35 -64
  100. package/dist/field/index.js.map +1 -1
  101. package/dist/field/rscEntry.d.ts +1 -1
  102. package/dist/field/rscEntry.d.ts.map +1 -1
  103. package/dist/field/rscEntry.js +0 -12
  104. package/dist/field/rscEntry.js.map +1 -1
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +1 -3
  108. package/dist/index.js.map +1 -1
  109. package/dist/lexical/LexicalEditor.d.ts +1 -1
  110. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  111. package/dist/lexical/LexicalEditor.js +9 -7
  112. package/dist/lexical/LexicalEditor.js.map +1 -1
  113. package/dist/lexical/LexicalProvider.d.ts +1 -0
  114. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  115. package/dist/lexical/LexicalProvider.js +6 -13
  116. package/dist/lexical/LexicalProvider.js.map +1 -1
  117. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  118. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  119. package/dist/lexical/config/client/sanitize.js +2 -3
  120. package/dist/lexical/config/client/sanitize.js.map +1 -1
  121. package/dist/lexical/config/types.d.ts +0 -4
  122. package/dist/lexical/config/types.d.ts.map +1 -1
  123. package/dist/lexical/config/types.js.map +1 -1
  124. package/dist/lexical/nodes/index.d.ts +2 -12
  125. package/dist/lexical/nodes/index.d.ts.map +1 -1
  126. package/dist/lexical/nodes/index.js +2 -213
  127. package/dist/lexical/nodes/index.js.map +1 -1
  128. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  129. package/dist/lexical/plugins/SlashMenu/index.js +1 -14
  130. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  131. package/dist/types.d.ts +2 -329
  132. package/dist/types.d.ts.map +1 -1
  133. package/dist/types.js.map +1 -1
  134. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  135. package/dist/utilities/generateImportMap.js +0 -1
  136. package/dist/utilities/generateImportMap.js.map +1 -1
  137. package/dist/validate/hasText.d.ts +1 -6
  138. package/dist/validate/hasText.d.ts.map +1 -1
  139. package/dist/validate/hasText.js +4 -10
  140. package/dist/validate/hasText.js.map +1 -1
  141. package/package.json +6 -11
  142. package/dist/exports/client/Field-ESDONIMD.js +0 -2
  143. package/dist/exports/client/Field-ESDONIMD.js.map +0 -7
  144. package/dist/exports/client/chunk-VCJQ5B3S.js +0 -12
  145. package/dist/exports/client/chunk-VCJQ5B3S.js.map +0 -7
  146. package/dist/exports/client/chunk-YWIZCGSY.js +0 -2
  147. package/dist/exports/client/chunk-YWIZCGSY.js.map +0 -7
  148. package/dist/exports/client/componentInline-CBBUBQ7P.js +0 -2
  149. package/dist/exports/client/internal-client.d.ts +0 -3
  150. package/dist/exports/client/internal-client.d.ts.map +0 -1
  151. package/dist/field/RichTextViewProvider.d.ts +0 -86
  152. package/dist/field/RichTextViewProvider.d.ts.map +0 -1
  153. package/dist/field/RichTextViewProvider.js +0 -90
  154. package/dist/field/RichTextViewProvider.js.map +0 -1
  155. package/dist/field/ViewSelector.d.ts +0 -4
  156. package/dist/field/ViewSelector.d.ts.map +0 -1
  157. package/dist/field/ViewSelector.js +0 -89
  158. package/dist/field/ViewSelector.js.map +0 -1
  159. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts +0 -2
  160. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +0 -1
  161. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +0 -48
  162. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +0 -1
  163. /package/dist/exports/client/{componentInline-CBBUBQ7P.js.map → componentInline-NL25DNZ5.js.map} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/blocks/client/componentInline/index.tsx", "../../../src/features/blocks/client/nodes/InlineBlocksNode.tsx", "../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n FormSubmit,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\n\nimport './index.scss'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n })\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n })\n },\n [editor, nodeKey, formData],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <EditButton />\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n", "'use client'\nimport ObjectID from 'bson-objectid'\nimport {\n $applyNodeReplacement,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n} from 'lexical'\nimport React, { type JSX } from 'react'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type {\n InlineBlockFields,\n SerializedInlineBlockNode,\n} from '../../server/nodes/InlineBlocksNode.js'\n\nimport { ServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nconst InlineBlockComponent = React.lazy(() =>\n import('../componentInline/index.js').then((module) => ({\n default: module.InlineBlockComponent,\n })),\n)\n\nexport type InlineBlockDecorateFunction = (\n editor: LexicalEditor,\n config: EditorConfig,\n CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>,\n CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>,\n) => JSX.Element\n\nexport class InlineBlockNode extends ServerInlineBlockNode {\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode {\n const node = $createInlineBlockNode(serializedNode.fields)\n return node\n }\n\n override decorate(\n ...[_editor, config, CustomBlock, CustomLabel]: Parameters<InlineBlockDecorateFunction>\n ): ReturnType<InlineBlockDecorateFunction> {\n return (\n <InlineBlockComponent\n cacheBuster={this.getCacheBuster()}\n className={config.theme.inlineBlock ?? 'LexicalEditorTheme__inlineBlock'}\n CustomBlock={CustomBlock}\n CustomLabel={CustomLabel}\n formData={this.getFields()}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return super.exportJSON()\n }\n}\n\nexport function $createInlineBlockNode(fields: Exclude<InlineBlockFields, 'id'>): InlineBlockNode {\n return $applyNodeReplacement(\n new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isInlineBlockNode(\n node: InlineBlockNode | LexicalNode | null | undefined,\n): node is InlineBlockNode {\n return node instanceof InlineBlockNode\n}\n", "import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\n\nimport type { StronglyTypedLeafNode } from '../../../../nodeTypes.js'\n\nexport type InlineBlockFields<TInlineBlockFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TInlineBlockFields\n\nexport type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = {\n fields: InlineBlockFields<TBlockFields>\n} & StronglyTypedLeafNode<SerializedLexicalNode, 'inlineBlock'>\n\nexport class ServerInlineBlockNode extends DecoratorNode<null | React.ReactElement> {\n __cacheBuster: number\n __fields: InlineBlockFields\n\n constructor({\n cacheBuster,\n fields,\n key,\n }: {\n cacheBuster?: number\n fields: InlineBlockFields\n key?: NodeKey\n }) {\n super(key)\n this.__fields = fields\n this.__cacheBuster = cacheBuster || 0\n }\n\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return new this({\n cacheBuster: node.__cacheBuster,\n fields: node.__fields,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'inlineBlock'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode {\n const node = $createServerInlineBlockNode(serializedNode.fields)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n canIndent() {\n return true\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, config?.theme?.inlineBlock)\n return element\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n return null\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return {\n type: 'inlineBlock',\n fields: this.getFields(),\n version: 1,\n }\n }\n\n getCacheBuster(): number {\n return this.getLatest().__cacheBuster\n }\n\n getFields(): InlineBlockFields {\n return this.getLatest().__fields\n }\n\n override getTextContent(): string {\n return `Block Field`\n }\n\n override isInline() {\n return true\n }\n\n setFields(fields: InlineBlockFields, preventFormStateUpdate?: boolean): void {\n const writable = this.getWritable()\n writable.__fields = fields\n if (!preventFormStateUpdate) {\n writable.__cacheBuster++\n }\n }\n\n override updateDOM(): boolean {\n return false\n }\n}\n\nexport function $createServerInlineBlockNode(\n fields: Exclude<InlineBlockFields, 'id'>,\n): ServerInlineBlockNode {\n return $applyNodeReplacement(\n new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isServerInlineBlockNode(\n node: LexicalNode | null | ServerInlineBlockNode | undefined,\n): node is ServerInlineBlockNode {\n return node instanceof ServerInlineBlockNode\n}\n"],
5
- "mappings": "mJAIA,OAASA,6BAAAA,OAAiC,wCAC1C,OAASC,sBAAAA,OAA0B,oCACnC,OAASC,kBAAAA,OAAsB,2BAC/B,OACEC,UAAAA,GACAC,UAAAA,GACAC,qBAAAA,GACAC,QAAAA,GACAC,oBAAAA,GACAC,cAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,aAAAA,GACAC,mBAAAA,GACAC,mBAAAA,GACAC,gBAAAA,GACAC,sBAAAA,GACAC,kBAAAA,OACK,iBACP,OAASC,kBAAAA,MAAsB,wBAC/B,OAASC,iBAAAA,MAAqB,UAI9B,OAASC,8CAAAA,EAA4CC,wBAAAA,OAA4B,iBACjF,OAAOC,GAASC,iBAAAA,GAAeC,eAAAA,EAAaC,aAAAA,EAAWC,WAAAA,EAASC,UAAAA,MAAc,QAC9E,OAASC,MAAMC,OAAY,gDC7B3B,OAAOC,OAAc,gBACrB,OACEC,yBAAAA,OAIK,UACP,OAAOC,OAAyB,QCKhC,OAASC,0BAAAA,OAA8B,iBACvC,OAAOC,OAAc,gBACrB,OAASC,yBAAAA,GAAuBC,iBAAAA,OAAqB,UAa9C,IAAMC,EAAN,cAAoCD,EAAA,CACzCE,cACAC,SAEAC,YAAY,CACVC,YAAAA,EACAC,OAAAA,EACAC,IAAAA,CAAG,EAKF,CACD,MAAMA,CAAA,EACN,KAAKJ,SAAWG,EAChB,KAAKJ,cAAgBG,GAAe,CACtC,CAEA,OAAgBG,MAAMC,EAAoD,CACxE,OAAO,IAAI,KAAK,CACdJ,YAAaI,EAAKP,cAClBI,OAAQG,EAAKN,SACbI,IAAKE,EAAKC,KACZ,CAAA,CACF,CAEA,OAAgBC,SAAkB,CAChC,MAAO,aACT,CAEA,OAAgBC,WAAqD,CACnE,MAAO,CAAC,CACV,CAEA,OAAgBC,WAAW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GC,CAAA,uBAClCoJ,EAAC,OAAA,WAAK,iBAAe/I,EAASuE,UAAU,aAAA,IACvCnE,EACCiD,EAAC,MAAA,CAAI3D,UAAW,GAAGC,CAAA,qBACjB0D,EAACqE,EAAA,CAAA,CAAA,IAED,IAAA,GA0EZ",
6
- "names": ["useLexicalComposerContext", "useLexicalEditable", "getTranslation", "Button", "Drawer", "EditDepthProvider", "Form", "formatDrawerSlug", "FormSubmit", "RenderFields", "ShimmerEffect", "useConfig", "useDocumentForm", "useDocumentInfo", "useEditDepth", "useServerFunctions", "useTranslation", "abortAndIgnore", "$getNodeByKey", "deepCopyObjectSimpleWithoutReactComponents", "reduceFieldsToValues", "React", "createContext", "useCallback", "useEffect", "useMemo", "useRef", "v4", "uuid", "ObjectID", "$applyNodeReplacement", "React", "addClassNamesToElement", "ObjectID", "$applyNodeReplacement", "DecoratorNode", "ServerInlineBlockNode", "__cacheBuster", "__fields", "constructor", "cacheBuster", "fields", "key", "clone", "node", "__key", "getType", "importDOM", "importJSON", "serializedNode", "$createServerInlineBlockNode", "isInline", "canIndent", "createDOM", "config", "element", "document", "createElement", "theme", "inlineBlock", "decorate", "editor", "exportDOM", "classList", "add", "text", "createTextNode", "getTextContent", "append", "exportJSON", "type", "getFields", "version", "getCacheBuster", "getLatest", "setFields", "preventFormStateUpdate", "writable", "getWritable", "updateDOM", "id", "default", "toHexString", "InlineBlockComponent", "React", "lazy", "then", "module", "default", "InlineBlockNode", "ServerInlineBlockNode", "clone", "node", "getType", "importJSON", "serializedNode", "$createInlineBlockNode", "fields", "decorate", "_editor", "config", "CustomBlock", "CustomLabel", "_jsx", "cacheBuster", "getCacheBuster", "className", "theme", "inlineBlock", "formData", "getFields", "nodeKey", "getKey", "exportJSON", "$applyNodeReplacement", "id", "ObjectID", "toHexString", "$isInlineBlockNode", "InlineBlockComponentContext", "createContext", "initialState", "useInlineBlockComponentContext", "React", "use", "InlineBlockComponent", "props", "cacheBuster", "className", "baseClass", "CustomBlock", "CustomBlockFromProps", "CustomLabel", "CustomLabelFromProps", "formData", "nodeKey", "editor", "useLexicalComposerContext", "isEditable", "useLexicalEditable", "i18n", "t", "useTranslation", "createdInlineBlock", "fieldProps", "featureClientSchemaMap", "initialLexicalFormState", "schemaPath", "setCreatedInlineBlock", "uuid", "uuidFromContext", "useEditorConfigContext", "fields", "parentDocumentFields", "useDocumentForm", "getFormState", "useServerFunctions", "editDepth", "useEditDepth", "firstTimeDrawer", "useRef", "setInitialState", "useState", "cachedFormState", "id", "formState", "Object", "fromEntries", "entries", "map", "fieldName", "fieldState", "initialValue", "value", "hasMounted", "prevCacheBuster", "useEffect", "current", "formUuid", "setCustomLabel", "customComponents", "BlockLabel", "undefined", "setCustomBlock", "Block", "resolvedCustomBlock", "useMemo", "_jsx", "isEditor", "isJSXConverter", "resolvedCustomLabel", "drawerSlug", "formatDrawerSlug", "slug", "depth", "toggleDrawer", "useLexicalDrawer", "inlineBlockElemElemRef", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "config", "useConfig", "componentMapRenderedBlockPath", "blockType", "blocksField", "clientBlock", "blockReferences", "blocksMap", "blocks", "clientBlockFields", "getKey", "length", "removeInlineBlock", "useCallback", "update", "$getNodeByKey", "remove", "blockDisplayName", "labels", "singular", "getTranslation", "onChangeAbortControllerRef", "AbortController", "schemaFieldsPath", "abortController", "state", "data", "docPermissions", "docPreferences", "documentFormState", "deepCopyObjectSimpleWithoutReactComponents", "excludeFiles", "initialBlockData", "initialBlockFormState", "operation", "readOnly", "renderAllFields", "signal", "newFormStateData", "reduceFieldsToValues", "node", "$isInlineBlockNode", "newData", "setFields", "abortAndIgnore", "onChange", "prevFormState", "submit", "controller", "isStateOutOfSync", "keys", "some", "key", "onFormSubmit", "RemoveButton", "Button", "buttonStyle", "disabled", "icon", "onClick", "e", "preventDefault", "round", "size", "tooltip", "label", "EditButton", "el", "InlineBlockContainer", "children", "filter", "Boolean", "join", "ref", "Label", "_jsxs", "Form", "beforeSubmit", "disableValidationOnSubmit", "onSubmit", "EditDepthProvider", "Drawer", "title", "_Fragment", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "permissions", "FormSubmit", "programmaticSubmit", "ShimmerEffect", "height", "width"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";import{a,b}from"./chunk-YWIZCGSY.js";import"./chunk-INBEEENE.js";import"./chunk-BZZVLW4U.js";export{b as InlineBlockComponent,a as useInlineBlockComponentContext};
2
- //# sourceMappingURL=componentInline-CBBUBQ7P.js.map
@@ -1,3 +0,0 @@
1
- export { BlockContent, useBlockComponentContext, } from '../../features/blocks/client/component/BlockContent.js';
2
- export { BlockComponent } from '../../features/blocks/client/component/index.js';
3
- //# sourceMappingURL=internal-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-client.d.ts","sourceRoot":"","sources":["../../../src/exports/client/internal-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,GACzB,MAAM,wDAAwD,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAA"}
@@ -1,86 +0,0 @@
1
- import React from 'react';
2
- import type { LexicalEditorNodeMap, LexicalEditorViewMap } from '../types.js';
3
- /**
4
- * Context for managing richtext editor view state and inheritance.
5
- */
6
- type RichTextViewContextType = {
7
- /**
8
- * The currently active view name (e.g., 'default', 'frontend', 'debug').
9
- */
10
- currentView: string;
11
- /**
12
- * The resolved node map for the current view, containing rendering overrides for each node type.
13
- */
14
- currentViewMap?: LexicalEditorNodeMap;
15
- /**
16
- * True if the current view was explicitly set (via prop) by this provider or an ancestor.
17
- * Used to distinguish intentional view settings from automatic defaults.
18
- */
19
- hasExplicitCurrentView?: boolean;
20
- /**
21
- * If true, nested richtext editors will inherit this provider's currentView and views.
22
- */
23
- inheritable?: boolean;
24
- /**
25
- * True if this provider's view is controlled by an ancestor provider — either because the
26
- * ancestor has a views map (view-map inheritance) or an explicit `currentView` prop.
27
- * When true, the ViewSelector is hidden.
28
- */
29
- isControlledByParent?: boolean;
30
- /**
31
- * Function to programmatically change the current view.
32
- */
33
- setCurrentView: (view: string) => void;
34
- /**
35
- * Map of all available views for this editor. Each key is a view name, each value contains
36
- * admin config, node overrides, and lexical config for that view.
37
- */
38
- views?: LexicalEditorViewMap;
39
- };
40
- /**
41
- * Provider for managing richtext editor view state and its inheritance.
42
- *
43
- * Handles two key scenarios:
44
- * 1. **Explicit view setting**: Wrap with `currentView` and `inheritable={true}` to force nested editors to a specific view
45
- * 2. **View map inheritance**: Nested editors inherit `views` from parents, allowing view switching across the hierarchy
46
- *
47
- * When a nested editor inherits from a parent, its ViewSelector is hidden because the view is controlled by an ancestor.
48
- *
49
- * @example
50
- * Force all nested richtext editors to use "frontend" view:
51
- * ```tsx
52
- * <RichTextViewProvider currentView="frontend" inheritable={true}>
53
- * <MyForm /> {/* All richtext fields inside will use "frontend" view }
54
- * </RichTextViewProvider>
55
- * ```
56
- */
57
- export declare const RichTextViewProvider: React.FC<{
58
- children: React.ReactNode;
59
- currentView?: string;
60
- inheritable?: boolean;
61
- views?: LexicalEditorViewMap;
62
- }>;
63
- /**
64
- * Access the current richtext editor view context.
65
- *
66
- * Returns the active view name, node overrides, inheritance state, and a function to switch views.
67
- *
68
- * @example
69
- * ```tsx
70
- * function MyComponent() {
71
- * const { currentView, currentViewMap, isControlledByParent, setCurrentView } = useRichTextView()
72
- *
73
- * return (
74
- * <div>
75
- * <p>Active view: {currentView}</p>
76
- * {isControlledByParent && <p>View controlled by parent</p>}
77
- * {currentViewMap?.heading && <p>Custom heading renderer active</p>}
78
- * <button onClick={() => setCurrentView('frontend')}>Switch to frontend</button>
79
- * </div>
80
- * )
81
- * }
82
- * ```
83
- */
84
- export declare function useRichTextView(): RichTextViewContextType;
85
- export {};
86
- //# sourceMappingURL=RichTextViewProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextViewProvider.d.ts","sourceRoot":"","sources":["../../src/field/RichTextViewProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAE7E;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC7B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAQD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAoDA,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,IAAI,uBAAuB,CAEzD"}
@@ -1,90 +0,0 @@
1
- 'use client';
2
-
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { useControllableState } from '@payloadcms/ui';
5
- import React, { createContext, use, useMemo } from 'react';
6
- const RichTextViewContext = /*#__PURE__*/createContext({
7
- currentView: 'default',
8
- inheritable: false,
9
- setCurrentView: () => {}
10
- });
11
- /**
12
- * Provider for managing richtext editor view state and its inheritance.
13
- *
14
- * Handles two key scenarios:
15
- * 1. **Explicit view setting**: Wrap with `currentView` and `inheritable={true}` to force nested editors to a specific view
16
- * 2. **View map inheritance**: Nested editors inherit `views` from parents, allowing view switching across the hierarchy
17
- *
18
- * When a nested editor inherits from a parent, its ViewSelector is hidden because the view is controlled by an ancestor.
19
- *
20
- * @example
21
- * Force all nested richtext editors to use "frontend" view:
22
- * ```tsx
23
- * <RichTextViewProvider currentView="frontend" inheritable={true}>
24
- * <MyForm /> {/* All richtext fields inside will use "frontend" view }
25
- * </RichTextViewProvider>
26
- * ```
27
- */
28
- export const RichTextViewProvider = args => {
29
- const parentContext = useRichTextView();
30
- // Track if this provider explicitly sets currentView (not just using the default)
31
- const hasOwnExplicitView = args.currentView !== undefined;
32
- const isControlledByParent = parentContext.inheritable && (Boolean(parentContext.views) || Boolean(parentContext.hasExplicitCurrentView));
33
- // This provider has explicit currentView if it sets one OR inherits one from parent
34
- const hasExplicitCurrentView = hasOwnExplicitView || parentContext.inheritable && Boolean(parentContext.hasExplicitCurrentView);
35
- const {
36
- children,
37
- currentView: currentViewFromProps,
38
- inheritable,
39
- views
40
- } = {
41
- children: args.children,
42
- currentView: isControlledByParent ? parentContext.currentView : args.currentView,
43
- // Propagate inheritable flag through the hierarchy
44
- inheritable: parentContext.inheritable || args.inheritable,
45
- // Only inherit views if parent has a views map
46
- views: isControlledByParent && parentContext.views ? parentContext.views : args.views
47
- };
48
- const [currentView, setCurrentView] = useControllableState(currentViewFromProps, 'default');
49
- const value = useMemo(() => {
50
- const currentViewMap = views ? views[currentView] || views.default : undefined;
51
- return {
52
- currentView,
53
- currentViewMap,
54
- hasExplicitCurrentView,
55
- inheritable,
56
- isControlledByParent,
57
- setCurrentView,
58
- views
59
- };
60
- }, [currentView, inheritable, hasExplicitCurrentView, isControlledByParent, setCurrentView, views]);
61
- return /*#__PURE__*/_jsx(RichTextViewContext, {
62
- value: value,
63
- children: children
64
- });
65
- };
66
- /**
67
- * Access the current richtext editor view context.
68
- *
69
- * Returns the active view name, node overrides, inheritance state, and a function to switch views.
70
- *
71
- * @example
72
- * ```tsx
73
- * function MyComponent() {
74
- * const { currentView, currentViewMap, isControlledByParent, setCurrentView } = useRichTextView()
75
- *
76
- * return (
77
- * <div>
78
- * <p>Active view: {currentView}</p>
79
- * {isControlledByParent && <p>View controlled by parent</p>}
80
- * {currentViewMap?.heading && <p>Custom heading renderer active</p>}
81
- * <button onClick={() => setCurrentView('frontend')}>Switch to frontend</button>
82
- * </div>
83
- * )
84
- * }
85
- * ```
86
- */
87
- export function useRichTextView() {
88
- return use(RichTextViewContext);
89
- }
90
- //# sourceMappingURL=RichTextViewProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextViewProvider.js","names":["useControllableState","React","createContext","use","useMemo","RichTextViewContext","currentView","inheritable","setCurrentView","RichTextViewProvider","args","parentContext","useRichTextView","hasOwnExplicitView","undefined","isControlledByParent","Boolean","views","hasExplicitCurrentView","children","currentViewFromProps","value","currentViewMap","default","_jsx"],"sources":["../../src/field/RichTextViewProvider.tsx"],"sourcesContent":["'use client'\nimport { useControllableState } from '@payloadcms/ui'\nimport React, { createContext, use, useMemo } from 'react'\n\nimport type { LexicalEditorNodeMap, LexicalEditorViewMap } from '../types.js'\n\n/**\n * Context for managing richtext editor view state and inheritance.\n */\ntype RichTextViewContextType = {\n /**\n * The currently active view name (e.g., 'default', 'frontend', 'debug').\n */\n currentView: string\n /**\n * The resolved node map for the current view, containing rendering overrides for each node type.\n */\n currentViewMap?: LexicalEditorNodeMap\n /**\n * True if the current view was explicitly set (via prop) by this provider or an ancestor.\n * Used to distinguish intentional view settings from automatic defaults.\n */\n hasExplicitCurrentView?: boolean\n /**\n * If true, nested richtext editors will inherit this provider's currentView and views.\n */\n inheritable?: boolean\n /**\n * True if this provider's view is controlled by an ancestor provider — either because the\n * ancestor has a views map (view-map inheritance) or an explicit `currentView` prop.\n * When true, the ViewSelector is hidden.\n */\n isControlledByParent?: boolean\n /**\n * Function to programmatically change the current view.\n */\n setCurrentView: (view: string) => void\n /**\n * Map of all available views for this editor. Each key is a view name, each value contains\n * admin config, node overrides, and lexical config for that view.\n */\n views?: LexicalEditorViewMap\n}\n\nconst RichTextViewContext = createContext<RichTextViewContextType>({\n currentView: 'default',\n inheritable: false,\n setCurrentView: () => {},\n})\n\n/**\n * Provider for managing richtext editor view state and its inheritance.\n *\n * Handles two key scenarios:\n * 1. **Explicit view setting**: Wrap with `currentView` and `inheritable={true}` to force nested editors to a specific view\n * 2. **View map inheritance**: Nested editors inherit `views` from parents, allowing view switching across the hierarchy\n *\n * When a nested editor inherits from a parent, its ViewSelector is hidden because the view is controlled by an ancestor.\n *\n * @example\n * Force all nested richtext editors to use \"frontend\" view:\n * ```tsx\n * <RichTextViewProvider currentView=\"frontend\" inheritable={true}>\n * <MyForm /> {/* All richtext fields inside will use \"frontend\" view }\n * </RichTextViewProvider>\n * ```\n */\nexport const RichTextViewProvider: React.FC<{\n children: React.ReactNode\n currentView?: string\n inheritable?: boolean\n views?: LexicalEditorViewMap\n}> = (args) => {\n const parentContext = useRichTextView()\n\n // Track if this provider explicitly sets currentView (not just using the default)\n const hasOwnExplicitView = args.currentView !== undefined\n\n const isControlledByParent =\n parentContext.inheritable &&\n (Boolean(parentContext.views) || Boolean(parentContext.hasExplicitCurrentView))\n\n // This provider has explicit currentView if it sets one OR inherits one from parent\n const hasExplicitCurrentView =\n hasOwnExplicitView ||\n (parentContext.inheritable && Boolean(parentContext.hasExplicitCurrentView))\n\n const {\n children,\n currentView: currentViewFromProps,\n inheritable,\n views,\n } = {\n children: args.children,\n currentView: isControlledByParent ? parentContext.currentView : args.currentView,\n // Propagate inheritable flag through the hierarchy\n inheritable: parentContext.inheritable || args.inheritable,\n // Only inherit views if parent has a views map\n views: isControlledByParent && parentContext.views ? parentContext.views : args.views,\n }\n\n const [currentView, setCurrentView] = useControllableState(currentViewFromProps, 'default')\n\n const value = useMemo(() => {\n const currentViewMap = views ? views[currentView] || views.default : undefined\n return {\n currentView,\n currentViewMap,\n hasExplicitCurrentView,\n inheritable,\n isControlledByParent,\n setCurrentView,\n views,\n }\n }, [\n currentView,\n inheritable,\n hasExplicitCurrentView,\n isControlledByParent,\n setCurrentView,\n views,\n ])\n\n return <RichTextViewContext value={value}>{children}</RichTextViewContext>\n}\n\n/**\n * Access the current richtext editor view context.\n *\n * Returns the active view name, node overrides, inheritance state, and a function to switch views.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { currentView, currentViewMap, isControlledByParent, setCurrentView } = useRichTextView()\n *\n * return (\n * <div>\n * <p>Active view: {currentView}</p>\n * {isControlledByParent && <p>View controlled by parent</p>}\n * {currentViewMap?.heading && <p>Custom heading renderer active</p>}\n * <button onClick={() => setCurrentView('frontend')}>Switch to frontend</button>\n * </div>\n * )\n * }\n * ```\n */\nexport function useRichTextView(): RichTextViewContextType {\n return use(RichTextViewContext)\n}\n"],"mappings":"AAAA;;;AACA,SAASA,oBAAoB,QAAQ;AACrC,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,OAAO,QAAQ;AA0CnD,MAAMC,mBAAA,gBAAsBH,aAAA,CAAuC;EACjEI,WAAA,EAAa;EACbC,WAAA,EAAa;EACbC,cAAA,EAAgBA,CAAA,MAAO;AACzB;AAEA;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,oBAAA,GAKPC,IAAA;EACJ,MAAMC,aAAA,GAAgBC,eAAA;EAEtB;EACA,MAAMC,kBAAA,GAAqBH,IAAA,CAAKJ,WAAW,KAAKQ,SAAA;EAEhD,MAAMC,oBAAA,GACJJ,aAAA,CAAcJ,WAAW,KACxBS,OAAA,CAAQL,aAAA,CAAcM,KAAK,KAAKD,OAAA,CAAQL,aAAA,CAAcO,sBAAsB;EAE/E;EACA,MAAMA,sBAAA,GACJL,kBAAA,IACCF,aAAA,CAAcJ,WAAW,IAAIS,OAAA,CAAQL,aAAA,CAAcO,sBAAsB;EAE5E,MAAM;IACJC,QAAQ;IACRb,WAAA,EAAac,oBAAoB;IACjCb,WAAW;IACXU;EAAK,CACN,GAAG;IACFE,QAAA,EAAUT,IAAA,CAAKS,QAAQ;IACvBb,WAAA,EAAaS,oBAAA,GAAuBJ,aAAA,CAAcL,WAAW,GAAGI,IAAA,CAAKJ,WAAW;IAChF;IACAC,WAAA,EAAaI,aAAA,CAAcJ,WAAW,IAAIG,IAAA,CAAKH,WAAW;IAC1D;IACAU,KAAA,EAAOF,oBAAA,IAAwBJ,aAAA,CAAcM,KAAK,GAAGN,aAAA,CAAcM,KAAK,GAAGP,IAAA,CAAKO;EAClF;EAEA,MAAM,CAACX,WAAA,EAAaE,cAAA,CAAe,GAAGR,oBAAA,CAAqBoB,oBAAA,EAAsB;EAEjF,MAAMC,KAAA,GAAQjB,OAAA,CAAQ;IACpB,MAAMkB,cAAA,GAAiBL,KAAA,GAAQA,KAAK,CAACX,WAAA,CAAY,IAAIW,KAAA,CAAMM,OAAO,GAAGT,SAAA;IACrE,OAAO;MACLR,WAAA;MACAgB,cAAA;MACAJ,sBAAA;MACAX,WAAA;MACAQ,oBAAA;MACAP,cAAA;MACAS;IACF;EACF,GAAG,CACDX,WAAA,EACAC,WAAA,EACAW,sBAAA,EACAH,oBAAA,EACAP,cAAA,EACAS,KAAA,CACD;EAED,oBAAOO,IAAA,CAACnB,mBAAA;IAAoBgB,KAAA,EAAOA,KAAA;cAAQF;;AAC7C;AAEA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,SAASP,gBAAA;EACd,OAAOT,GAAA,CAAIE,mBAAA;AACb","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './ViewSelector.scss';
3
- export declare function ViewSelector(): null | React.ReactElement;
4
- //# sourceMappingURL=ViewSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewSelector.d.ts","sourceRoot":"","sources":["../../src/field/ViewSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,qBAAqB,CAAA;AAE5B,wBAAgB,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CAyDxD"}
@@ -1,89 +0,0 @@
1
- 'use client';
2
-
3
- import { c as _c } from "react/compiler-runtime";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- import { ChevronIcon, Popup, PopupList } from '@payloadcms/ui';
6
- import React from 'react';
7
- import { useRichTextView } from './RichTextViewProvider.js';
8
- export function ViewSelector() {
9
- const $ = _c(5);
10
- const {
11
- currentView,
12
- setCurrentView,
13
- views
14
- } = useRichTextView();
15
- if (!views || Object.keys(views).length === 0) {
16
- return null;
17
- }
18
- let t0;
19
- let t1;
20
- if ($[0] !== currentView || $[1] !== setCurrentView || $[2] !== views) {
21
- t1 = Symbol.for("react.early_return_sentinel");
22
- bb0: {
23
- const viewKeys = Object.keys(views);
24
- const hasNonDefaultViews = viewKeys.some(_temp);
25
- if (!hasNonDefaultViews) {
26
- t1 = null;
27
- break bb0;
28
- }
29
- const allViews = ["default", ...viewKeys.filter(_temp2)];
30
- const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1);
31
- t0 = _jsx("div", {
32
- className: "lexical-view-selector",
33
- children: _jsx(Popup, {
34
- button: _jsxs("button", {
35
- className: "lexical-view-selector__button",
36
- type: "button",
37
- children: [_jsx("span", {
38
- className: "lexical-view-selector__label",
39
- children: currentViewLabel
40
- }), _jsx(ChevronIcon, {
41
- className: "lexical-view-selector__icon"
42
- })]
43
- }),
44
- buttonType: "custom",
45
- horizontalAlign: "left",
46
- render: t2 => {
47
- const {
48
- close
49
- } = t2;
50
- return _jsx(PopupList.ButtonGroup, {
51
- children: allViews.map(viewName => {
52
- const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1);
53
- return _jsx(PopupList.Button, {
54
- active: viewName === currentView,
55
- disabled: viewName === currentView,
56
- onClick: () => {
57
- setCurrentView?.(viewName);
58
- close();
59
- },
60
- children: viewLabel
61
- }, viewName);
62
- })
63
- });
64
- },
65
- size: "large"
66
- })
67
- });
68
- }
69
- $[0] = currentView;
70
- $[1] = setCurrentView;
71
- $[2] = views;
72
- $[3] = t0;
73
- $[4] = t1;
74
- } else {
75
- t0 = $[3];
76
- t1 = $[4];
77
- }
78
- if (t1 !== Symbol.for("react.early_return_sentinel")) {
79
- return t1;
80
- }
81
- return t0;
82
- }
83
- function _temp2(key_0) {
84
- return key_0 !== "default";
85
- }
86
- function _temp(key) {
87
- return key !== "default";
88
- }
89
- //# sourceMappingURL=ViewSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewSelector.js","names":["c","_c","ChevronIcon","Popup","PopupList","React","useRichTextView","ViewSelector","$","currentView","setCurrentView","views","Object","keys","length","t0","t1","Symbol","for","bb0","viewKeys","hasNonDefaultViews","some","_temp","allViews","filter","_temp2","currentViewLabel","charAt","toUpperCase","slice","_jsx","className","children","button","_jsxs","type","horizontalAlign","render","t2","close","ButtonGroup","map","viewName","viewLabel","Button","active","disabled","onClick","key_0","key"],"sources":["../../src/field/ViewSelector.tsx"],"sourcesContent":["'use client'\nimport { ChevronIcon, Popup, PopupList } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport './ViewSelector.scss'\n\nexport function ViewSelector(): null | React.ReactElement {\n const { currentView, setCurrentView, views } = useRichTextView()\n\n // Don't show if no views or only default exists\n if (!views || Object.keys(views).length === 0) {\n return null\n }\n\n const viewKeys = Object.keys(views)\n const hasNonDefaultViews = viewKeys.some((key) => key !== 'default')\n\n // If only 'default' exists, no need to show selector\n if (!hasNonDefaultViews) {\n return null\n }\n\n // Build list of available views\n const allViews = ['default', ...viewKeys.filter((key) => key !== 'default')]\n\n const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1)\n\n return (\n <div className=\"lexical-view-selector\">\n <Popup\n button={\n <button className=\"lexical-view-selector__button\" type=\"button\">\n <span className=\"lexical-view-selector__label\">{currentViewLabel}</span>\n <ChevronIcon className=\"lexical-view-selector__icon\" />\n </button>\n }\n buttonType=\"custom\"\n horizontalAlign=\"left\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {allViews.map((viewName) => {\n const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1)\n\n return (\n <PopupList.Button\n active={viewName === currentView}\n disabled={viewName === currentView}\n key={viewName}\n onClick={() => {\n setCurrentView?.(viewName)\n close()\n }}\n >\n {viewLabel}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ;AAC9C,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAGhC,OAAO,SAAAC,aAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL;IAAAQ,WAAA;IAAAC,cAAA;IAAAC;EAAA,IAA+CL,eAAA;EAAA,IAG3C,CAACK,KAAA,IAASC,MAAA,CAAAC,IAAA,CAAYF,KAAA,EAAAG,MAAA,MAAkB;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,WAAA,IAAAD,CAAA,QAAAE,cAAA,IAAAF,CAAA,QAAAG,KAAA;IASnCK,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MALT,MAAAC,QAAA,GAAiBR,MAAA,CAAAC,IAAA,CAAYF,KAAA;MAC7B,MAAAU,kBAAA,GAA2BD,QAAA,CAAAE,IAAA,CAAAC,KAA+B;MAAA,KAGrDF,kBAAA;QACIL,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIT,MAAAK,QAAA,IAAkB,cAAcJ,QAAA,CAAAK,MAAA,CAAAC,MAAiC;MAEjE,MAAAC,gBAAA,GAAyBlB,WAAA,CAAAmB,MAAA,EAAmB,EAAAC,WAAA,CAAc,IAAKpB,WAAA,CAAAqB,KAAA,EAAkB;MAG/Ef,EAAA,GAAAgB,IAAA,CAAC;QAAAC,SAAA,EAAc;QAAAC,QAAA,EACbF,IAAA,CAAA5B,KAAA;UAAA+B,MAAA,EAEIC,KAAA,CAAC;YAAAH,SAAA,EAAiB;YAAAI,IAAA,EAAqC;YAAAH,QAAA,GACrDF,IAAA,CAAC;cAAAC,SAAA,EAAe;cAAAC,QAAA,EAAgCN;YAAA,C,GAChDI,IAAA,CAAA7B,WAAA;cAAA8B,SAAA,EAAuB;YAAA,C;;sBAGhB;UAAAK,eAAA,EACK;UAAAC,MAAA,EAAAC,EAAA;YACP;cAAAC;YAAA,IAAAD,EAAS;YAAA,OAChBR,IAAA,CAAA3B,SAAA,CAAAqC,WAAA;cAAAR,QAAA,EACGT,QAAA,CAAAkB,GAAA,CAAAC,QAAA;gBACC,MAAAC,SAAA,GAAkBD,QAAA,CAAAf,MAAA,EAAgB,EAAAC,WAAA,CAAc,IAAKc,QAAA,CAAAb,KAAA,EAAe;gBAAA,OAGlEC,IAAA,CAAA3B,SAAA,CAAAyC,MAAA;kBAAAC,MAAA,EACUH,QAAA,KAAalC,WAAA;kBAAAsC,QAAA,EACXJ,QAAA,KAAalC,WAAA;kBAAAuC,OAAA,EAAAA,CAAA;oBAGrBtC,cAAA,GAAiBiC,QAAA;oBACjBH,KAAA;kBAAA;kBAAAP,QAAA,EAGDW;gBAAA,GANID,QAAA;cAAA,CASX;YAAA,C;;gBAGC;QAAA,C;;;;;;;;;;;;;;;SA/BT5B,E;;AAtBG,SAAAW,OAAAuB,KAAA;EAAA,OAiBoDC,KAAA,KAAQ;AAAA;AAjB5D,SAAA3B,MAAA2B,GAAA;EAAA,OAS6CA,GAAA,KAAQ;AAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare function NodeViewOverridePlugin(): null;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"names":[],"mappings":"AAOA,wBAAgB,sBAAsB,IAAI,IAAI,CAsB7C"}
@@ -1,48 +0,0 @@
1
- 'use client';
2
-
3
- import { c as _c } from "react/compiler-runtime";
4
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
- import { useEffect } from 'react';
6
- import { useRichTextView } from '../../../field/RichTextViewProvider.js';
7
- import { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js';
8
- export function NodeViewOverridePlugin() {
9
- const $ = _c(5);
10
- const [editor] = useLexicalComposerContext();
11
- const {
12
- currentView,
13
- views
14
- } = useRichTextView();
15
- let t0;
16
- let t1;
17
- if ($[0] !== currentView || $[1] !== editor || $[2] !== views) {
18
- t0 = () => {
19
- if (!views) {
20
- return;
21
- }
22
- if (currentView === "default") {
23
- if (views.default) {
24
- registerEditorNodeViews(editor, views.default?.nodes);
25
- } else {
26
- clearEditorNodeViews(editor);
27
- }
28
- } else {
29
- if (views[currentView]) {
30
- clearEditorNodeViews(editor);
31
- registerEditorNodeViews(editor, views[currentView]?.nodes);
32
- }
33
- }
34
- };
35
- t1 = [editor, views, currentView];
36
- $[0] = currentView;
37
- $[1] = editor;
38
- $[2] = views;
39
- $[3] = t0;
40
- $[4] = t1;
41
- } else {
42
- t0 = $[3];
43
- t1 = $[4];
44
- }
45
- useEffect(t0, t1);
46
- return null;
47
- }
48
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useEffect","useRichTextView","clearEditorNodeViews","registerEditorNodeViews","NodeViewOverridePlugin","$","editor","currentView","views","t0","t1","default","nodes"],"sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useEffect } from 'react'\n\nimport { useRichTextView } from '../../../field/RichTextViewProvider.js'\nimport { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js'\n\nexport function NodeViewOverridePlugin(): null {\n const [editor] = useLexicalComposerContext()\n const { currentView, views } = useRichTextView()\n\n useEffect(() => {\n if (!views) {\n return\n }\n\n if (currentView === 'default') {\n if (views.default) {\n registerEditorNodeViews(editor, views.default?.nodes)\n } else {\n clearEditorNodeViews(editor)\n }\n } else if (views[currentView]) {\n clearEditorNodeViews(editor)\n registerEditorNodeViews(editor, views[currentView]?.nodes)\n }\n }, [editor, views, currentView])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,SAAS,QAAQ;AAE1B,SAASC,eAAe,QAAQ;AAChC,SAASC,oBAAoB,EAAEC,uBAAuB,QAAQ;AAE9D,OAAO,SAAAC,uBAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL,OAAAQ,MAAA,IAAiBP,yBAAA;EACjB;IAAAQ,WAAA;IAAAC;EAAA,IAA+BP,eAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAL,CAAA,QAAAE,WAAA,IAAAF,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAG,KAAA;IAErBC,EAAA,GAAAA,CAAA;MAAA,KACHD,KAAA;QAAA;MAAA;MAAA,IAIDD,WAAA,KAAgB;QAAA,IACdC,KAAA,CAAAG,OAAA;UACFR,uBAAA,CAAwBG,MAAA,EAAQE,KAAA,CAAAG,OAAA,EAAAC,KAAe;QAAA;UAE/CV,oBAAA,CAAqBI,MAAA;QAAA;MAAA;QAAA,IAEdE,KAAK,CAACD,WAAA;UACfL,oBAAA,CAAqBI,MAAA;UACrBH,uBAAA,CAAwBG,MAAA,EAAQE,KAAK,CAACD,WAAA,GAAAK,KAAc;QAAA;MAAA;IAAA;IAErDF,EAAA,IAACJ,MAAA,EAAQE,KAAA,EAAOD,WAAA;IAAYF,CAAA,MAAAE,WAAA;IAAAF,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAG,KAAA;IAAAH,CAAA,MAAAI,EAAA;IAAAJ,CAAA,MAAAK,EAAA;EAAA;IAAAD,EAAA,GAAAJ,CAAA;IAAAK,EAAA,GAAAL,CAAA;EAAA;EAf/BL,SAAA,CAAUS,EAeV,EAAGC,EAA4B;EAAA;AAAA","ignoreList":[]}