@payloadcms/richtext-lexical 3.59.0-internal.d8b427e → 3.59.0-internal.ee5f42c
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/exports/client/{Field-2MCIQXRP.js → Field-EHRBYNHO.js} +2 -2
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-TLQLXR6Q.js → chunk-2Y72RT72.js} +2 -2
- package/dist/exports/client/chunk-3BY5IZJD.js +2 -0
- package/dist/exports/client/chunk-3BY5IZJD.js.map +7 -0
- package/dist/exports/client/componentInline-7TPI7ZBC.js +2 -0
- package/dist/exports/client/index.d.ts +0 -3
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -35
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockContent.d.ts +27 -52
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +51 -45
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +9 -2
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +25 -7
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +50 -62
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +1 -0
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +0 -5
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/markdownTransformer.d.ts +17 -0
- package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/client/markdownTransformer.js +144 -0
- package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
- package/dist/features/blocks/server/i18n.js +38 -38
- package/dist/features/blocks/server/i18n.js.map +1 -1
- package/dist/features/blocks/server/index.js +1 -1
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/server/{markdown/markdownTransformer.js → markdownTransformer.js} +48 -6
- package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +1 -0
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +15 -10
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js +2 -2
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -1
- package/package.json +6 -6
- package/dist/exports/client/chunk-K47TNP5J.js +0 -2
- package/dist/exports/client/chunk-K47TNP5J.js.map +0 -7
- package/dist/exports/client/componentInline-AGFSKAY4.js +0 -2
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +0 -6
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +0 -1
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +0 -24
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +0 -1
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +0 -6
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +0 -1
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +0 -20
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +0 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +0 -12
- package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +0 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.js +0 -348
- package/dist/features/blocks/client/markdown/markdownTransformer.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +0 -5
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +0 -151
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Code.d.ts +0 -61
- package/dist/features/blocks/premade/CodeBlock/Component/Code.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js +0 -89
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +0 -4
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +0 -17
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +0 -4
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +0 -26
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/converter.d.ts +0 -7
- package/dist/features/blocks/premade/CodeBlock/converter.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/converter.js +0 -46
- package/dist/features/blocks/premade/CodeBlock/converter.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/converterClient.d.ts +0 -2
- package/dist/features/blocks/premade/CodeBlock/converterClient.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/converterClient.js +0 -4
- package/dist/features/blocks/premade/CodeBlock/converterClient.js.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/index.d.ts +0 -7
- package/dist/features/blocks/premade/CodeBlock/index.d.ts.map +0 -1
- package/dist/features/blocks/premade/CodeBlock/index.js +0 -52
- package/dist/features/blocks/premade/CodeBlock/index.js.map +0 -1
- package/dist/features/blocks/server/markdown/getLexicalToMarkdown.d.ts +0 -6
- package/dist/features/blocks/server/markdown/getLexicalToMarkdown.d.ts.map +0 -1
- package/dist/features/blocks/server/markdown/getLexicalToMarkdown.js +0 -27
- package/dist/features/blocks/server/markdown/getLexicalToMarkdown.js.map +0 -1
- package/dist/features/blocks/server/markdown/getMarkdownToLexical.d.ts +0 -7
- package/dist/features/blocks/server/markdown/getMarkdownToLexical.d.ts.map +0 -1
- package/dist/features/blocks/server/markdown/getMarkdownToLexical.js +0 -22
- package/dist/features/blocks/server/markdown/getMarkdownToLexical.js.map +0 -1
- package/dist/features/blocks/server/markdown/linesFromMatchToContentAndPropsString.d.ts.map +0 -1
- package/dist/features/blocks/server/markdown/linesFromMatchToContentAndPropsString.js.map +0 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +0 -15
- package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +0 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.js.map +0 -1
- package/dist/lexical/ui/icons/Collapse/index.d.ts +0 -3
- package/dist/lexical/ui/icons/Collapse/index.d.ts.map +0 -1
- package/dist/lexical/ui/icons/Collapse/index.js +0 -18
- package/dist/lexical/ui/icons/Collapse/index.js.map +0 -1
- /package/dist/exports/client/{Field-2MCIQXRP.js.map → Field-EHRBYNHO.js.map} +0 -0
- /package/dist/exports/client/{chunk-TLQLXR6Q.js.map → chunk-2Y72RT72.js.map} +0 -0
- /package/dist/exports/client/{componentInline-AGFSKAY4.js.map → componentInline-7TPI7ZBC.js.map} +0 -0
- /package/dist/features/blocks/server/{markdown/linesFromMatchToContentAndPropsString.d.ts → linesFromMatchToContentAndPropsString.d.ts} +0 -0
- /package/dist/features/blocks/server/{markdown/linesFromMatchToContentAndPropsString.js → linesFromMatchToContentAndPropsString.js} +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 React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nconst baseClass = 'inline-block'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\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 { v4 as uuid } from 'uuid'\n\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\ntype Props = {\n /**\n * Can be modified by the node in order to trigger the re-fetch of the initial state based on the\n * formData. This is useful when node.setFields() is explicitly called from outside of the form - in\n * this case, the new field state is likely not reflected in the form state, so we need to re-fetch\n */\n readonly cacheBuster: number\n readonly formData: InlineBlockFields\n readonly nodeKey: string\n}\n\ntype 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<Props> = (props) => {\n const { cacheBuster, formData, nodeKey } = props\n\n const [editor] = useLexicalComposerContext()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, readOnly, 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 () => initialLexicalFormState?.[formData.id]?.formState,\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 [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n initialState?.['_components']?.customComponents?.BlockLabel,\n )\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n initialState?.['_components']?.customComponents?.Block,\n )\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 globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state),\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 setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n setCustomBlock(state['_components']?.customComponents?.Block)\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 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 formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\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 setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n schemaFieldsPath,\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={readOnly}\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 [blockDisplayName, readOnly, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={readOnly}\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 [blockDisplayName, readOnly, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[baseClass, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [formData.blockType],\n )\n\n const Label = useMemo(() => {\n if (CustomLabel) {\n return () => CustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [CustomLabel, 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 {editor.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={uuid()}\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={false}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {CustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {CustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {editor.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 type { EditorConfig, LexicalEditor, LexicalNode } from 'lexical'\n\nimport ObjectID from 'bson-objectid'\nimport React, { type JSX } from 'react'\n\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 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(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <InlineBlockComponent\n cacheBuster={this.getCacheBuster()}\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 new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\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 Spread,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { DecoratorNode } from 'lexical'\n\nexport type InlineBlockFields<TInlineBlockFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TInlineBlockFields\n\nexport type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n fields: InlineBlockFields<TBlockFields>\n type: 'inlineBlock'\n },\n SerializedLexicalNode\n>\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 override createDOM() {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\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 new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\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": "mJAEA,OAAOA,GAASC,iBAAAA,GAAeC,eAAAA,EAAaC,aAAAA,EAAWC,WAAAA,EAASC,UAAAA,MAAc,QAK9E,OAASC,6BAAAA,OAAiC,wCAC1C,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,OAASC,MAAMC,OAAY,gDC5B3B,OAAOC,OAAc,gBACrB,OAAOC,OAAyB,QCUhC,OAAOC,OAAc,gBACrB,OAASC,iBAAAA,OAAqB,UAgBvB,IAAMC,EAAN,cAAoCD,EAAA,CACzCE,cACAC,SAEAC,YAAY,CACVC,YAAAA,EACAC,OAAAA,EACAC,IAAAA,CAAG,E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,WAECrE,IAGH6F,EAACP,EAAA,WACEnI,EAAeoH,EAACqB,GAAA,CAAA,CAAA,EAAWrB,EAACuC,GAAA,CAAcC,OAAO,OAAOC,MAAM,SAC9DpJ,EAAOqJ,WAAU,EAChBpB,EAAC,MAAA,CAAInB,UAAW,GAAG1H,CAAA,sBACjBuH,EAACa,GAAA,CAAA,CAAA,EACDb,EAACF,EAAA,CAAA,CAAA,CAAA,IAED,IAAA,OA3ERwB,EAACP,EAAA,CAAqBZ,UAAW,GAAG1H,CAAA,uBAClC6I,EAAC,OAAA,WAAK,iBAAenI,EAASuD,UAAU,aAAA,IACvCrD,EAAOqJ,WAAU,EAChB1C,EAAC,MAAA,CAAIG,UAAW,GAAG1H,CAAA,qBACjBuH,EAACF,EAAA,CAAA,CAAA,IAED,IAAA,GA0EZ",
|
|
6
|
-
"names": ["React", "createContext", "useCallback", "useEffect", "useMemo", "useRef", "useLexicalComposerContext", "getTranslation", "Button", "Drawer", "EditDepthProvider", "Form", "formatDrawerSlug", "FormSubmit", "RenderFields", "ShimmerEffect", "useConfig", "useDocumentForm", "useDocumentInfo", "useEditDepth", "useServerFunctions", "useTranslation", "abortAndIgnore", "$getNodeByKey", "deepCopyObjectSimpleWithoutReactComponents", "reduceFieldsToValues", "v4", "uuid", "ObjectID", "React", "ObjectID", "DecoratorNode", "ServerInlineBlockNode", "__cacheBuster", "__fields", "constructor", "cacheBuster", "fields", "key", "clone", "node", "__key", "getType", "importDOM", "importJSON", "serializedNode", "$createServerInlineBlockNode", "isInline", "canIndent", "createDOM", "element", "document", "createElement", "classList", "add", "decorate", "editor", "config", "exportDOM", "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", "_jsx", "cacheBuster", "getCacheBuster", "formData", "getFields", "nodeKey", "getKey", "exportJSON", "id", "ObjectID", "toHexString", "$isInlineBlockNode", "baseClass", "InlineBlockComponentContext", "createContext", "initialState", "useInlineBlockComponentContext", "React", "use", "InlineBlockComponent", "props", "cacheBuster", "formData", "nodeKey", "editor", "useLexicalComposerContext", "i18n", "t", "useTranslation", "createdInlineBlock", "fieldProps", "featureClientSchemaMap", "initialLexicalFormState", "readOnly", "schemaPath", "setCreatedInlineBlock", "uuid", "uuidFromContext", "useEditorConfigContext", "fields", "parentDocumentFields", "useDocumentForm", "getFormState", "useServerFunctions", "editDepth", "useEditDepth", "firstTimeDrawer", "useRef", "setInitialState", "useState", "id", "formState", "hasMounted", "prevCacheBuster", "useEffect", "current", "CustomLabel", "setCustomLabel", "customComponents", "BlockLabel", "CustomBlock", "setCustomBlock", "Block", "drawerSlug", "formatDrawerSlug", "slug", "depth", "toggleDrawer", "useLexicalDrawer", "inlineBlockElemElemRef", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "config", "useConfig", "componentMapRenderedBlockPath", "blockType", "blocksField", "clientBlock", "blockReferences", "blocksMap", "blocks", "clientBlockFields", "getKey", "length", "undefined", "removeInlineBlock", "useCallback", "update", "$getNodeByKey", "remove", "blockDisplayName", "labels", "singular", "getTranslation", "onChangeAbortControllerRef", "AbortController", "schemaFieldsPath", "abortController", "state", "data", "docPermissions", "docPreferences", "documentFormState", "deepCopyObjectSimpleWithoutReactComponents", "initialBlockData", "initialBlockFormState", "operation", "renderAllFields", "signal", "newFormStateData", "reduceFieldsToValues", "node", "$isInlineBlockNode", "newData", "setFields", "abortAndIgnore", "onChange", "prevFormState", "submit", "controller", "isStateOutOfSync", "Object", "keys", "some", "key", "value", "onFormSubmit", "RemoveButton", "useMemo", "_jsx", "Button", "buttonStyle", "className", "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", "isEditable"]
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical';
|
|
2
|
-
import { type Transformer } from '../../../../packages/@lexical/markdown/index.js';
|
|
3
|
-
export declare function getLexicalToMarkdown(allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>, allTransformers: Transformer[]): (args: {
|
|
4
|
-
editorState: Record<string, any>;
|
|
5
|
-
}) => string;
|
|
6
|
-
//# sourceMappingURL=getLexicalToMarkdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLexicalToMarkdown.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIzE,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AAExD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,KAAK,MAAM,CAoBxD"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createHeadlessEditor } from '@lexical/headless';
|
|
2
|
-
import { $convertToMarkdownString } from '../../../../packages/@lexical/markdown/index.js';
|
|
3
|
-
export function getLexicalToMarkdown(allNodes, allTransformers) {
|
|
4
|
-
const lexicalToMarkdown = ({
|
|
5
|
-
editorState
|
|
6
|
-
}) => {
|
|
7
|
-
const headlessEditor = createHeadlessEditor({
|
|
8
|
-
nodes: allNodes
|
|
9
|
-
});
|
|
10
|
-
try {
|
|
11
|
-
headlessEditor.setEditorState(headlessEditor.parseEditorState(editorState)) // This should commit the editor state immediately
|
|
12
|
-
;
|
|
13
|
-
} catch (e) {
|
|
14
|
-
console.error('getLexicalToMarkdown: ERROR parsing editor state', e);
|
|
15
|
-
}
|
|
16
|
-
let markdown = '';
|
|
17
|
-
headlessEditor.getEditorState().read(() => {
|
|
18
|
-
markdown = $convertToMarkdownString(allTransformers);
|
|
19
|
-
});
|
|
20
|
-
return markdown;
|
|
21
|
-
};
|
|
22
|
-
return lexicalToMarkdown;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=getLexicalToMarkdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLexicalToMarkdown.js","names":["createHeadlessEditor","$convertToMarkdownString","getLexicalToMarkdown","allNodes","allTransformers","lexicalToMarkdown","editorState","headlessEditor","nodes","setEditorState","parseEditorState","e","console","error","markdown","getEditorState","read"],"sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"sourcesContent":["import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport {\n $convertToMarkdownString,\n type Transformer,\n} from '../../../../packages/@lexical/markdown/index.js'\n\nexport function getLexicalToMarkdown(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { editorState: Record<string, any> }) => string {\n const lexicalToMarkdown = ({ editorState }: { editorState: Record<string, any> }): string => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n try {\n headlessEditor.setEditorState(headlessEditor.parseEditorState(editorState as any)) // This should commit the editor state immediately\n } catch (e) {\n console.error('getLexicalToMarkdown: ERROR parsing editor state', e)\n }\n\n let markdown: string = ''\n headlessEditor.getEditorState().read(() => {\n markdown = $convertToMarkdownString(allTransformers)\n })\n\n return markdown\n }\n return lexicalToMarkdown\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC,SACEC,wBAAwB,QAEnB;AAEP,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAW,CAAwC;IAC9E,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEA,IAAI;MACFI,cAAA,CAAeE,cAAc,CAACF,cAAA,CAAeG,gBAAgB,CAACJ,WAAA,GAAqB;MAAA;IACrF,EAAE,OAAOK,CAAA,EAAG;MACVC,OAAA,CAAQC,KAAK,CAAC,oDAAoDF,CAAA;IACpE;IAEA,IAAIG,QAAA,GAAmB;IACvBP,cAAA,CAAeQ,cAAc,GAAGC,IAAI,CAAC;MACnCF,QAAA,GAAWb,wBAAA,CAAyBG,eAAA;IACtC;IAEA,OAAOU,QAAA;EACT;EACA,OAAOT,iBAAA;AACT","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState } from 'lexical';
|
|
2
|
-
import { type Transformer } from '../../../../packages/@lexical/markdown/index.js';
|
|
3
|
-
export declare function getMarkdownToLexical(allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>, allTransformers: Transformer[]): (args: {
|
|
4
|
-
markdown: string;
|
|
5
|
-
}) => SerializedEditorState;
|
|
6
|
-
//# sourceMappingURL=getMarkdownToLexical.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkdownToLexical.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIhG,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AAExD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAK,qBAAqB,CAkBvD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createHeadlessEditor } from '@lexical/headless';
|
|
2
|
-
import { $convertFromMarkdownString } from '../../../../packages/@lexical/markdown/index.js';
|
|
3
|
-
export function getMarkdownToLexical(allNodes, allTransformers) {
|
|
4
|
-
const markdownToLexical = ({
|
|
5
|
-
markdown
|
|
6
|
-
}) => {
|
|
7
|
-
const headlessEditor = createHeadlessEditor({
|
|
8
|
-
nodes: allNodes
|
|
9
|
-
});
|
|
10
|
-
headlessEditor.update(() => {
|
|
11
|
-
$convertFromMarkdownString(markdown, allTransformers);
|
|
12
|
-
}, {
|
|
13
|
-
discrete: true
|
|
14
|
-
});
|
|
15
|
-
const editorJSON = headlessEditor.getEditorState().toJSON();
|
|
16
|
-
return editorJSON;
|
|
17
|
-
};
|
|
18
|
-
return markdownToLexical;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=getMarkdownToLexical.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkdownToLexical.js","names":["createHeadlessEditor","$convertFromMarkdownString","getMarkdownToLexical","allNodes","allTransformers","markdownToLexical","markdown","headlessEditor","nodes","update","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"sourcesContent":["import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport {\n $convertFromMarkdownString,\n type Transformer,\n} from '../../../../packages/@lexical/markdown/index.js'\n\nexport function getMarkdownToLexical(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { markdown: string }) => SerializedEditorState {\n const markdownToLexical = ({ markdown }: { markdown: string }): SerializedEditorState => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n headlessEditor.update(\n () => {\n $convertFromMarkdownString(markdown, allTransformers)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON\n }\n return markdownToLexical\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC,SACEC,0BAA0B,QAErB;AAEP,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAQ,CAAwB;IAC3D,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEAI,cAAA,CAAeE,MAAM,CACnB;MACER,0BAAA,CAA2BK,QAAA,EAAUF,eAAA;IACvC,GACA;MAAEM,QAAA,EAAU;IAAK;IAGnB,MAAMC,UAAA,GAAaJ,cAAA,CAAeK,cAAc,GAAGC,MAAM;IAEzD,OAAOF,UAAA;EACT;EACA,OAAON,iBAAA;AACT","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ClientBlock } from 'payload';
|
|
2
|
-
import { type Klass, type LexicalNode, type LexicalNodeReplacement } from 'lexical';
|
|
3
|
-
import type { Transformer } from '../../../../packages/@lexical/markdown/index.js';
|
|
4
|
-
import type { MultilineElementTransformer, TextMatchTransformer } from '../../../../packages/@lexical/markdown/MarkdownTransformers.js';
|
|
5
|
-
export declare const getBlockMarkdownTransformers: ({ blocks, inlineBlocks, }: {
|
|
6
|
-
blocks: ClientBlock[];
|
|
7
|
-
inlineBlocks: ClientBlock[];
|
|
8
|
-
}) => ((props: {
|
|
9
|
-
allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>;
|
|
10
|
-
allTransformers: Transformer[];
|
|
11
|
-
}) => MultilineElementTransformer | TextMatchTransformer)[];
|
|
12
|
-
//# sourceMappingURL=markdownTransformer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE5B,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,gEAAgE,CAAA;AAqBvE,eAAO,MAAM,4BAA4B,8BAGtC;IACD,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,KAAG,CAAC,CAAC,KAAK,EAAE;IACX,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAAA;IAC5D,eAAe,EAAE,WAAW,EAAE,CAAA;CAC/B,KAAK,2BAA2B,GAAG,oBAAoB,CAAC,EA8BxD,CAAA"}
|
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
import { $parseSerializedNode } from 'lexical';
|
|
2
|
-
import { extractPropsFromJSXPropsString } from '../../../../utilities/jsx/extractPropsFromJSXPropsString.js';
|
|
3
|
-
import { propsToJSXString } from '../../../../utilities/jsx/jsx.js';
|
|
4
|
-
import { linesFromStartToContentAndPropsString } from '../../server/markdown/linesFromMatchToContentAndPropsString.js';
|
|
5
|
-
import { $createBlockNode, $isBlockNode, BlockNode } from '../nodes/BlocksNode.js';
|
|
6
|
-
import { $createInlineBlockNode, $isInlineBlockNode, InlineBlockNode } from '../nodes/InlineBlocksNode.js';
|
|
7
|
-
import { getLexicalToMarkdown } from './getLexicalToMarkdown.js';
|
|
8
|
-
import { getMarkdownToLexical } from './getMarkdownToLexical.js';
|
|
9
|
-
function createTagRegexes(tagName) {
|
|
10
|
-
const escapedTagName = tagName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
11
|
-
return {
|
|
12
|
-
regExpEnd: new RegExp(`</(${escapedTagName})\\s*>|<${escapedTagName}[^>]*?/>`, 'i'),
|
|
13
|
-
regExpStart: new RegExp(`<(${escapedTagName})([^>]*?)\\s*(/?)>`, 'i')
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export const getBlockMarkdownTransformers = ({
|
|
17
|
-
blocks,
|
|
18
|
-
inlineBlocks
|
|
19
|
-
}) => {
|
|
20
|
-
if (!blocks?.length && !inlineBlocks?.length) {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
let transformers = [];
|
|
24
|
-
if (blocks?.length) {
|
|
25
|
-
for (const block of blocks) {
|
|
26
|
-
const transformer = getMarkdownTransformerForBlock(block, false);
|
|
27
|
-
if (transformer) {
|
|
28
|
-
transformers = transformers.concat(transformer);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (inlineBlocks?.length) {
|
|
33
|
-
for (const block of inlineBlocks) {
|
|
34
|
-
const transformer = getMarkdownTransformerForBlock(block, true);
|
|
35
|
-
if (transformer) {
|
|
36
|
-
transformers = transformers.concat(transformer);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return transformers;
|
|
41
|
-
};
|
|
42
|
-
function getMarkdownTransformerForBlock(block, isInlineBlock) {
|
|
43
|
-
if (!block.jsx) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const regex = createTagRegexes(block.slug);
|
|
47
|
-
const toReturn = [];
|
|
48
|
-
if (isInlineBlock) {
|
|
49
|
-
toReturn.push(({
|
|
50
|
-
allNodes,
|
|
51
|
-
allTransformers
|
|
52
|
-
}) => ({
|
|
53
|
-
type: 'text-match',
|
|
54
|
-
dependencies: [InlineBlockNode],
|
|
55
|
-
export: node => {
|
|
56
|
-
if (!$isInlineBlockNode(node)) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
if (node.getFields()?.blockType?.toLowerCase() !== block.slug.toLowerCase()) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
const nodeFields = node.getFields();
|
|
63
|
-
const lexicalToMarkdown = getLexicalToMarkdown(allNodes, allTransformers);
|
|
64
|
-
const exportResult = block.jsx.export({
|
|
65
|
-
fields: nodeFields,
|
|
66
|
-
lexicalToMarkdown
|
|
67
|
-
});
|
|
68
|
-
if (exportResult === false) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
if (typeof exportResult === 'string') {
|
|
72
|
-
return exportResult;
|
|
73
|
-
}
|
|
74
|
-
const hasProps = exportResult.props && Object.keys(exportResult.props)?.length > 0;
|
|
75
|
-
const props = exportResult.props ?? {};
|
|
76
|
-
if (exportResult?.children?.length) {
|
|
77
|
-
return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({
|
|
78
|
-
props
|
|
79
|
-
}) : ''}>${exportResult.children}</${nodeFields.blockType}>`;
|
|
80
|
-
}
|
|
81
|
-
return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({
|
|
82
|
-
props
|
|
83
|
-
}) : ''}/>`;
|
|
84
|
-
},
|
|
85
|
-
getEndIndex: (node, match) => {
|
|
86
|
-
const {
|
|
87
|
-
endlineLastCharIndex
|
|
88
|
-
} = linesFromStartToContentAndPropsString({
|
|
89
|
-
isEndOptional: false,
|
|
90
|
-
lines: [node.getTextContent()],
|
|
91
|
-
regexpEndRegex: regex.regExpEnd,
|
|
92
|
-
startLineIndex: 0,
|
|
93
|
-
startMatch: match,
|
|
94
|
-
trimChildren: false
|
|
95
|
-
});
|
|
96
|
-
return endlineLastCharIndex;
|
|
97
|
-
},
|
|
98
|
-
importRegExp: block.jsx?.customStartRegex ?? regex.regExpStart,
|
|
99
|
-
regExp: /___ignoreignoreignore___/g,
|
|
100
|
-
replace(node, match) {
|
|
101
|
-
const {
|
|
102
|
-
content,
|
|
103
|
-
propsString
|
|
104
|
-
} = linesFromStartToContentAndPropsString({
|
|
105
|
-
isEndOptional: false,
|
|
106
|
-
lines: [node.getTextContent()],
|
|
107
|
-
regexpEndRegex: regex.regExpEnd,
|
|
108
|
-
startLineIndex: 0,
|
|
109
|
-
startMatch: {
|
|
110
|
-
...match,
|
|
111
|
-
index: 0
|
|
112
|
-
},
|
|
113
|
-
trimChildren: false
|
|
114
|
-
});
|
|
115
|
-
if (!block?.jsx?.import) {
|
|
116
|
-
// No multiline transformer handled this line successfully
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers);
|
|
120
|
-
const blockFields = block.jsx.import({
|
|
121
|
-
children: content,
|
|
122
|
-
closeMatch: null,
|
|
123
|
-
htmlToLexical: null,
|
|
124
|
-
markdownToLexical,
|
|
125
|
-
openMatch: match,
|
|
126
|
-
props: propsString ? extractPropsFromJSXPropsString({
|
|
127
|
-
propsString
|
|
128
|
-
}) : {}
|
|
129
|
-
});
|
|
130
|
-
if (blockFields === false) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const inlineBlockNode = $createInlineBlockNode({
|
|
134
|
-
blockType: block.slug,
|
|
135
|
-
...blockFields
|
|
136
|
-
});
|
|
137
|
-
node.replace(inlineBlockNode);
|
|
138
|
-
}
|
|
139
|
-
}));
|
|
140
|
-
return toReturn;
|
|
141
|
-
}
|
|
142
|
-
toReturn.push(({
|
|
143
|
-
allNodes,
|
|
144
|
-
allTransformers
|
|
145
|
-
}) => ({
|
|
146
|
-
dependencies: [BlockNode],
|
|
147
|
-
export: node => {
|
|
148
|
-
if (!$isBlockNode(node)) {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
if (node.getFields()?.blockType?.toLowerCase() !== block.slug.toLowerCase()) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
const nodeFields = node.getFields();
|
|
155
|
-
const lexicalToMarkdown = getLexicalToMarkdown(allNodes, allTransformers);
|
|
156
|
-
const exportResult = block.jsx.export({
|
|
157
|
-
fields: nodeFields,
|
|
158
|
-
lexicalToMarkdown
|
|
159
|
-
});
|
|
160
|
-
if (exportResult === false) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
if (typeof exportResult === 'string') {
|
|
164
|
-
return exportResult;
|
|
165
|
-
}
|
|
166
|
-
const hasProps = exportResult.props && Object.keys(exportResult.props)?.length > 0;
|
|
167
|
-
const props = exportResult.props ?? {};
|
|
168
|
-
if (exportResult?.children?.length) {
|
|
169
|
-
const children = exportResult.children;
|
|
170
|
-
let sanitizedChildren = '';
|
|
171
|
-
// Ensure it has a leftpad of at least 2 spaces. The data is saved without those spaces, so we can just blindly add it to every child
|
|
172
|
-
if (children.includes('\n')) {
|
|
173
|
-
for (const child of children.split('\n')) {
|
|
174
|
-
let sanitizedChild = '';
|
|
175
|
-
if (!block?.jsx?.doNotTrimChildren && child !== '') {
|
|
176
|
-
sanitizedChild = ' ';
|
|
177
|
-
}
|
|
178
|
-
sanitizedChild += child + '\n';
|
|
179
|
-
sanitizedChildren += sanitizedChild;
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
sanitizedChildren = (block?.jsx?.doNotTrimChildren ? '' : ' ') + children + '\n';
|
|
183
|
-
}
|
|
184
|
-
return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({
|
|
185
|
-
props
|
|
186
|
-
}) : ''}>\n${sanitizedChildren}</${nodeFields.blockType}>`;
|
|
187
|
-
}
|
|
188
|
-
return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({
|
|
189
|
-
props
|
|
190
|
-
}) : ''}/>`;
|
|
191
|
-
},
|
|
192
|
-
handleImportAfterStartMatch: block.jsx?.customEndRegex ? undefined : ({
|
|
193
|
-
lines,
|
|
194
|
-
rootNode,
|
|
195
|
-
startLineIndex,
|
|
196
|
-
startMatch,
|
|
197
|
-
transformer
|
|
198
|
-
}) => {
|
|
199
|
-
const regexpEndRegex = typeof transformer.regExpEnd === 'object' && 'regExp' in transformer.regExpEnd ? transformer.regExpEnd.regExp : transformer.regExpEnd;
|
|
200
|
-
const isEndOptional = transformer.regExpEnd && typeof transformer.regExpEnd === 'object' && 'optional' in transformer.regExpEnd ? transformer.regExpEnd.optional : !transformer.regExpEnd;
|
|
201
|
-
const {
|
|
202
|
-
afterEndLine,
|
|
203
|
-
beforeStartLine,
|
|
204
|
-
content: unsanitizedContent,
|
|
205
|
-
endLineIndex,
|
|
206
|
-
propsString
|
|
207
|
-
} = linesFromStartToContentAndPropsString({
|
|
208
|
-
isEndOptional,
|
|
209
|
-
lines,
|
|
210
|
-
regexpEndRegex,
|
|
211
|
-
startLineIndex,
|
|
212
|
-
startMatch,
|
|
213
|
-
trimChildren: false
|
|
214
|
-
});
|
|
215
|
-
let content = '';
|
|
216
|
-
if (block?.jsx?.doNotTrimChildren) {
|
|
217
|
-
content = unsanitizedContent.endsWith('\n') ? unsanitizedContent.slice(0, -1) : unsanitizedContent;
|
|
218
|
-
} else {
|
|
219
|
-
// Ensure it has a leftpad of at least 2 spaces. The data is saved without those spaces, so we can just blindly add it to every child
|
|
220
|
-
if (unsanitizedContent.includes('\n')) {
|
|
221
|
-
const split = unsanitizedContent.split('\n');
|
|
222
|
-
let index = 0;
|
|
223
|
-
for (const child of split) {
|
|
224
|
-
index++;
|
|
225
|
-
if (child.startsWith(' ')) {
|
|
226
|
-
content += child.slice(2);
|
|
227
|
-
} else {
|
|
228
|
-
// If one child is misaligned, skip aligning completely, unless it's just empty
|
|
229
|
-
if (child === '') {
|
|
230
|
-
content += child;
|
|
231
|
-
} else {
|
|
232
|
-
content = unsanitizedContent.endsWith('\n') ? unsanitizedContent.slice(0, -1) : unsanitizedContent;
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
content += index === split.length ? '' : '\n';
|
|
237
|
-
}
|
|
238
|
-
} else {
|
|
239
|
-
content = (!unsanitizedContent.startsWith(' ') ? unsanitizedContent : unsanitizedContent.slice(2)) + '\n';
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (!block?.jsx?.import) {
|
|
243
|
-
// No multiline transformer handled this line successfully
|
|
244
|
-
return [false, startLineIndex];
|
|
245
|
-
}
|
|
246
|
-
const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers);
|
|
247
|
-
const blockFields = block.jsx.import({
|
|
248
|
-
children: content,
|
|
249
|
-
closeMatch: null,
|
|
250
|
-
htmlToLexical: null,
|
|
251
|
-
markdownToLexical,
|
|
252
|
-
openMatch: startMatch,
|
|
253
|
-
props: propsString ? extractPropsFromJSXPropsString({
|
|
254
|
-
propsString
|
|
255
|
-
}) : {}
|
|
256
|
-
});
|
|
257
|
-
if (blockFields === false) {
|
|
258
|
-
return [false, startLineIndex];
|
|
259
|
-
}
|
|
260
|
-
const node = $createBlockNode({
|
|
261
|
-
blockType: block.slug,
|
|
262
|
-
...blockFields
|
|
263
|
-
});
|
|
264
|
-
if (node) {
|
|
265
|
-
// Now handle beforeStartLine and afterEndLine. If those are not empty, we need to add them as text nodes before and after the block node.
|
|
266
|
-
// However, those themselves can contain other markdown matches, so we need to parse them as well.
|
|
267
|
-
// Example where this is needed: "Hello <InlineCode>inline code</InlineCode> test."
|
|
268
|
-
let prevNodes = null;
|
|
269
|
-
let nextNodes = null;
|
|
270
|
-
// TODO: Might not need this prevNodes and nextNodes handling if inline nodes are handled by textmatch transformers
|
|
271
|
-
if (beforeStartLine?.length) {
|
|
272
|
-
prevNodes = markdownToLexical({
|
|
273
|
-
markdown: beforeStartLine
|
|
274
|
-
})?.root?.children ?? [];
|
|
275
|
-
const firstPrevNode = prevNodes?.[0];
|
|
276
|
-
if (firstPrevNode) {
|
|
277
|
-
rootNode.append($parseSerializedNode(firstPrevNode));
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
rootNode.append(node);
|
|
281
|
-
if (afterEndLine?.length) {
|
|
282
|
-
nextNodes = markdownToLexical({
|
|
283
|
-
markdown: afterEndLine
|
|
284
|
-
})?.root?.children;
|
|
285
|
-
const lastChild = rootNode.getChildren()[rootNode.getChildren().length - 1];
|
|
286
|
-
const children = $parseSerializedNode(nextNodes[0])?.getChildren();
|
|
287
|
-
if (children?.length) {
|
|
288
|
-
for (const child of children) {
|
|
289
|
-
lastChild.append(child);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return [true, endLineIndex];
|
|
295
|
-
},
|
|
296
|
-
regExpEnd: block.jsx?.customEndRegex ?? regex.regExpEnd,
|
|
297
|
-
regExpStart: block.jsx?.customStartRegex ?? regex.regExpStart,
|
|
298
|
-
// This replace is ONLY run for ``` code blocks (so any blocks with custom start and end regexes). For others, we use the special JSX handling above:
|
|
299
|
-
type: 'multiline-element',
|
|
300
|
-
replace: (rootNode, children, openMatch, closeMatch, linesInBetween) => {
|
|
301
|
-
if (block?.jsx?.import) {
|
|
302
|
-
if (!linesInBetween) {
|
|
303
|
-
// convert children to linesInBetween
|
|
304
|
-
let line = '';
|
|
305
|
-
if (children) {
|
|
306
|
-
for (const child of children) {
|
|
307
|
-
line += child.getTextContent();
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
linesInBetween = [line];
|
|
311
|
-
}
|
|
312
|
-
let childrenString = '';
|
|
313
|
-
if (block?.jsx?.doNotTrimChildren) {
|
|
314
|
-
childrenString = linesInBetween.join('\n');
|
|
315
|
-
} else {
|
|
316
|
-
childrenString = linesInBetween.join('\n').trim();
|
|
317
|
-
}
|
|
318
|
-
const propsString = openMatch[1]?.trim();
|
|
319
|
-
const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers);
|
|
320
|
-
const blockFields = block.jsx.import({
|
|
321
|
-
children: childrenString,
|
|
322
|
-
closeMatch: closeMatch,
|
|
323
|
-
htmlToLexical: null,
|
|
324
|
-
markdownToLexical,
|
|
325
|
-
openMatch: openMatch,
|
|
326
|
-
props: propsString ? extractPropsFromJSXPropsString({
|
|
327
|
-
propsString
|
|
328
|
-
}) : {}
|
|
329
|
-
});
|
|
330
|
-
if (blockFields === false) {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
const node = $createBlockNode({
|
|
334
|
-
blockType: block.slug,
|
|
335
|
-
...blockFields
|
|
336
|
-
});
|
|
337
|
-
if (node) {
|
|
338
|
-
rootNode.append(node);
|
|
339
|
-
}
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
return false // Run next transformer
|
|
343
|
-
;
|
|
344
|
-
}
|
|
345
|
-
}));
|
|
346
|
-
return toReturn;
|
|
347
|
-
}
|
|
348
|
-
//# sourceMappingURL=markdownTransformer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTransformer.js","names":["$parseSerializedNode","extractPropsFromJSXPropsString","propsToJSXString","linesFromStartToContentAndPropsString","$createBlockNode","$isBlockNode","BlockNode","$createInlineBlockNode","$isInlineBlockNode","InlineBlockNode","getLexicalToMarkdown","getMarkdownToLexical","createTagRegexes","tagName","escapedTagName","replace","regExpEnd","RegExp","regExpStart","getBlockMarkdownTransformers","blocks","inlineBlocks","length","transformers","block","transformer","getMarkdownTransformerForBlock","concat","isInlineBlock","jsx","regex","slug","toReturn","push","allNodes","allTransformers","type","dependencies","export","node","getFields","blockType","toLowerCase","nodeFields","lexicalToMarkdown","exportResult","fields","hasProps","props","Object","keys","children","getEndIndex","match","endlineLastCharIndex","isEndOptional","lines","getTextContent","regexpEndRegex","startLineIndex","startMatch","trimChildren","importRegExp","customStartRegex","regExp","content","propsString","index","import","markdownToLexical","blockFields","closeMatch","htmlToLexical","openMatch","inlineBlockNode","sanitizedChildren","includes","child","split","sanitizedChild","doNotTrimChildren","handleImportAfterStartMatch","customEndRegex","undefined","rootNode","optional","afterEndLine","beforeStartLine","unsanitizedContent","endLineIndex","endsWith","slice","startsWith","prevNodes","nextNodes","markdown","root","firstPrevNode","append","lastChild","getChildren","linesInBetween","line","childrenString","join","trim"],"sources":["../../../../../src/features/blocks/client/markdown/markdownTransformer.ts"],"sourcesContent":["import type { ClientBlock } from 'payload'\n\nimport {\n $parseSerializedNode,\n type ElementNode,\n type Klass,\n type LexicalNode,\n type LexicalNodeReplacement,\n type SerializedLexicalNode,\n} from 'lexical'\n\nimport type { Transformer } from '../../../../packages/@lexical/markdown/index.js'\nimport type {\n MultilineElementTransformer,\n TextMatchTransformer,\n} from '../../../../packages/@lexical/markdown/MarkdownTransformers.js'\n\nimport { extractPropsFromJSXPropsString } from '../../../../utilities/jsx/extractPropsFromJSXPropsString.js'\nimport { propsToJSXString } from '../../../../utilities/jsx/jsx.js'\nimport { linesFromStartToContentAndPropsString } from '../../server/markdown/linesFromMatchToContentAndPropsString.js'\nimport { $createBlockNode, $isBlockNode, BlockNode } from '../nodes/BlocksNode.js'\nimport {\n $createInlineBlockNode,\n $isInlineBlockNode,\n InlineBlockNode,\n} from '../nodes/InlineBlocksNode.js'\nimport { getLexicalToMarkdown } from './getLexicalToMarkdown.js'\nimport { getMarkdownToLexical } from './getMarkdownToLexical.js'\n\nfunction createTagRegexes(tagName: string) {\n const escapedTagName = tagName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n return {\n regExpEnd: new RegExp(`</(${escapedTagName})\\\\s*>|<${escapedTagName}[^>]*?/>`, 'i'),\n regExpStart: new RegExp(`<(${escapedTagName})([^>]*?)\\\\s*(/?)>`, 'i'),\n }\n}\nexport const getBlockMarkdownTransformers = ({\n blocks,\n inlineBlocks,\n}: {\n blocks: ClientBlock[]\n inlineBlocks: ClientBlock[]\n}): ((props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n}) => MultilineElementTransformer | TextMatchTransformer)[] => {\n if (!blocks?.length && !inlineBlocks?.length) {\n return []\n }\n let transformers: ((props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n }) => MultilineElementTransformer | TextMatchTransformer)[] = []\n\n if (blocks?.length) {\n for (const block of blocks) {\n const transformer = getMarkdownTransformerForBlock(block, false)\n\n if (transformer) {\n transformers = transformers.concat(transformer)\n }\n }\n }\n\n if (inlineBlocks?.length) {\n for (const block of inlineBlocks) {\n const transformer = getMarkdownTransformerForBlock(block, true)\n\n if (transformer) {\n transformers = transformers.concat(transformer)\n }\n }\n }\n\n return transformers\n}\n\nfunction getMarkdownTransformerForBlock(\n block: ClientBlock,\n isInlineBlock: boolean,\n): Array<\n (props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n }) => MultilineElementTransformer | TextMatchTransformer\n> | null {\n if (!block.jsx) {\n return null\n }\n const regex = createTagRegexes(block.slug)\n const toReturn: Array<\n (props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n }) => MultilineElementTransformer | TextMatchTransformer\n > = []\n\n if (isInlineBlock) {\n toReturn.push(({ allNodes, allTransformers }) => ({\n type: 'text-match',\n dependencies: [InlineBlockNode],\n export: (node) => {\n if (!$isInlineBlockNode(node)) {\n return null\n }\n\n if (node.getFields()?.blockType?.toLowerCase() !== block.slug.toLowerCase()) {\n return null\n }\n\n const nodeFields = node.getFields()\n const lexicalToMarkdown = getLexicalToMarkdown(allNodes, allTransformers)\n\n const exportResult = block.jsx!.export({\n fields: nodeFields,\n lexicalToMarkdown,\n })\n if (exportResult === false) {\n return null\n }\n if (typeof exportResult === 'string') {\n return exportResult\n }\n\n const hasProps = exportResult.props && Object.keys(exportResult.props)?.length > 0\n const props = exportResult.props ?? {}\n\n if (exportResult?.children?.length) {\n return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({ props }) : ''}>${exportResult.children}</${nodeFields.blockType}>`\n }\n\n return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({ props }) : ''}/>`\n },\n getEndIndex: (node, match) => {\n const { endlineLastCharIndex } = linesFromStartToContentAndPropsString({\n isEndOptional: false,\n lines: [node.getTextContent()],\n regexpEndRegex: regex.regExpEnd,\n startLineIndex: 0,\n startMatch: match,\n trimChildren: false,\n })\n\n return endlineLastCharIndex\n },\n importRegExp: block.jsx?.customStartRegex ?? regex.regExpStart,\n regExp: /___ignoreignoreignore___/g,\n replace(node, match) {\n const { content, propsString } = linesFromStartToContentAndPropsString({\n isEndOptional: false,\n lines: [node.getTextContent()],\n regexpEndRegex: regex.regExpEnd,\n startLineIndex: 0,\n startMatch: {\n ...match,\n index: 0,\n },\n trimChildren: false,\n })\n\n if (!block?.jsx?.import) {\n // No multiline transformer handled this line successfully\n return\n }\n\n const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers)\n\n const blockFields = block.jsx.import({\n children: content,\n closeMatch: null,\n htmlToLexical: null, // TODO\n markdownToLexical,\n openMatch: match,\n props: propsString\n ? extractPropsFromJSXPropsString({\n propsString,\n })\n : {},\n })\n if (blockFields === false) {\n return\n }\n\n const inlineBlockNode = $createInlineBlockNode({\n blockType: block.slug,\n ...(blockFields as any),\n })\n\n node.replace(inlineBlockNode)\n },\n }))\n\n return toReturn\n }\n\n toReturn.push(({ allNodes, allTransformers }) => ({\n dependencies: [BlockNode],\n export: (node) => {\n if (!$isBlockNode(node)) {\n return null\n }\n\n if (node.getFields()?.blockType?.toLowerCase() !== block.slug.toLowerCase()) {\n return null\n }\n\n const nodeFields = node.getFields()\n const lexicalToMarkdown = getLexicalToMarkdown(allNodes, allTransformers)\n\n const exportResult = block.jsx!.export({\n fields: nodeFields,\n lexicalToMarkdown,\n })\n if (exportResult === false) {\n return null\n }\n if (typeof exportResult === 'string') {\n return exportResult\n }\n\n const hasProps = exportResult.props && Object.keys(exportResult.props)?.length > 0\n const props = exportResult.props ?? {}\n\n if (exportResult?.children?.length) {\n const children = exportResult.children\n let sanitizedChildren = ''\n\n // Ensure it has a leftpad of at least 2 spaces. The data is saved without those spaces, so we can just blindly add it to every child\n if (children.includes('\\n')) {\n for (const child of children.split('\\n')) {\n let sanitizedChild = ''\n if (!block?.jsx?.doNotTrimChildren && child !== '') {\n sanitizedChild = ' '\n }\n sanitizedChild += child + '\\n'\n\n sanitizedChildren += sanitizedChild\n }\n } else {\n sanitizedChildren = (block?.jsx?.doNotTrimChildren ? '' : ' ') + children + '\\n'\n }\n\n return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({ props }) : ''}>\\n${sanitizedChildren}</${nodeFields.blockType}>`\n }\n\n return `<${nodeFields.blockType}${hasProps ? ' ' + propsToJSXString({ props }) : ''}/>`\n },\n handleImportAfterStartMatch: block.jsx?.customEndRegex\n ? undefined\n : ({ lines, rootNode, startLineIndex, startMatch, transformer }) => {\n const regexpEndRegex: RegExp | undefined =\n typeof transformer.regExpEnd === 'object' && 'regExp' in transformer.regExpEnd\n ? transformer.regExpEnd.regExp\n : transformer.regExpEnd\n\n const isEndOptional =\n transformer.regExpEnd &&\n typeof transformer.regExpEnd === 'object' &&\n 'optional' in transformer.regExpEnd\n ? transformer.regExpEnd.optional\n : !transformer.regExpEnd\n\n const {\n afterEndLine,\n beforeStartLine,\n content: unsanitizedContent,\n endLineIndex,\n propsString,\n } = linesFromStartToContentAndPropsString({\n isEndOptional,\n lines,\n regexpEndRegex,\n startLineIndex,\n startMatch,\n trimChildren: false,\n })\n\n let content = ''\n\n if (block?.jsx?.doNotTrimChildren) {\n content = unsanitizedContent.endsWith('\\n')\n ? unsanitizedContent.slice(0, -1)\n : unsanitizedContent\n } else {\n // Ensure it has a leftpad of at least 2 spaces. The data is saved without those spaces, so we can just blindly add it to every child\n if (unsanitizedContent.includes('\\n')) {\n const split = unsanitizedContent.split('\\n')\n let index = 0\n for (const child of split) {\n index++\n\n if (child.startsWith(' ')) {\n content += child.slice(2)\n } else {\n // If one child is misaligned, skip aligning completely, unless it's just empty\n if (child === '') {\n content += child\n } else {\n content = unsanitizedContent.endsWith('\\n')\n ? unsanitizedContent.slice(0, -1)\n : unsanitizedContent\n break\n }\n }\n\n content += index === split.length ? '' : '\\n'\n }\n } else {\n content =\n (!unsanitizedContent.startsWith(' ')\n ? unsanitizedContent\n : unsanitizedContent.slice(2)) + '\\n'\n }\n }\n\n if (!block?.jsx?.import) {\n // No multiline transformer handled this line successfully\n return [false, startLineIndex]\n }\n\n const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers)\n\n const blockFields = block.jsx.import({\n children: content,\n closeMatch: null,\n htmlToLexical: null, // TODO\n markdownToLexical,\n openMatch: startMatch,\n props: propsString\n ? extractPropsFromJSXPropsString({\n propsString,\n })\n : {},\n })\n if (blockFields === false) {\n return [false, startLineIndex]\n }\n\n const node = $createBlockNode({\n blockType: block.slug,\n ...blockFields,\n } as any)\n\n if (node) {\n // Now handle beforeStartLine and afterEndLine. If those are not empty, we need to add them as text nodes before and after the block node.\n // However, those themselves can contain other markdown matches, so we need to parse them as well.\n // Example where this is needed: \"Hello <InlineCode>inline code</InlineCode> test.\"\n let prevNodes: null | SerializedLexicalNode[] = null\n let nextNodes: null | SerializedLexicalNode[] = null\n // TODO: Might not need this prevNodes and nextNodes handling if inline nodes are handled by textmatch transformers\n\n if (beforeStartLine?.length) {\n prevNodes = markdownToLexical({ markdown: beforeStartLine })?.root?.children ?? []\n\n const firstPrevNode = prevNodes?.[0]\n if (firstPrevNode) {\n rootNode.append($parseSerializedNode(firstPrevNode))\n }\n }\n\n rootNode.append(node)\n\n if (afterEndLine?.length) {\n nextNodes = markdownToLexical({ markdown: afterEndLine })?.root?.children\n const lastChild = rootNode.getChildren()[rootNode.getChildren().length - 1]\n\n const children = ($parseSerializedNode(nextNodes[0]!) as ElementNode)?.getChildren()\n if (children?.length) {\n for (const child of children) {\n ;(lastChild as ElementNode).append(child)\n }\n }\n }\n }\n\n return [true, endLineIndex]\n },\n regExpEnd: block.jsx?.customEndRegex ?? regex.regExpEnd,\n regExpStart: block.jsx?.customStartRegex ?? regex.regExpStart,\n // This replace is ONLY run for ``` code blocks (so any blocks with custom start and end regexes). For others, we use the special JSX handling above:\n type: 'multiline-element',\n replace: (rootNode, children, openMatch, closeMatch, linesInBetween) => {\n if (block?.jsx?.import) {\n if (!linesInBetween) {\n // convert children to linesInBetween\n let line = ''\n if (children) {\n for (const child of children) {\n line += child.getTextContent()\n }\n }\n\n linesInBetween = [line]\n }\n\n let childrenString = ''\n if (block?.jsx?.doNotTrimChildren) {\n childrenString = linesInBetween.join('\\n')\n } else {\n childrenString = linesInBetween.join('\\n').trim()\n }\n\n const propsString = openMatch[1]?.trim()\n\n const markdownToLexical = getMarkdownToLexical(allNodes, allTransformers)\n\n const blockFields = block.jsx.import({\n children: childrenString,\n closeMatch: closeMatch as RegExpMatchArray,\n htmlToLexical: null, // TODO\n markdownToLexical,\n openMatch: openMatch as RegExpMatchArray,\n props: propsString\n ? extractPropsFromJSXPropsString({\n propsString,\n })\n : {},\n })\n if (blockFields === false) {\n return false\n }\n\n const node = $createBlockNode({\n blockType: block.slug,\n ...blockFields,\n } as any)\n\n if (node) {\n rootNode.append(node)\n }\n\n return\n }\n return false // Run next transformer\n },\n }))\n\n return toReturn\n}\n"],"mappings":"AAEA,SACEA,oBAAoB,QAMf;AAQP,SAASC,8BAA8B,QAAQ;AAC/C,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qCAAqC,QAAQ;AACtD,SAASC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,QAAQ;AAC1D,SACEC,sBAAsB,EACtBC,kBAAkB,EAClBC,eAAe,QACV;AACP,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AAErC,SAASC,iBAAiBC,OAAe;EACvC,MAAMC,cAAA,GAAiBD,OAAA,CAAQE,OAAO,CAAC,uBAAuB;EAC9D,OAAO;IACLC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AAA,CAASc,MAAM,CAAC3D,IAAA;QAClB;QAEA;MACF;MACA,OAAO,MAAM;MAAA;IACf;EACF;EAEA,OAAOP,QAAA;AACT","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/premade/CodeBlock/Component/Block.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA;AAQ7D,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAC5C,QAAQ,CAAC,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAAC,CA+F1D,CAAA"}
|