@payloadcms/richtext-lexical 3.2.3-canary.2d2e7d5 → 3.2.3-canary.5e3c2f6
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-JP7H7AZE.js → Field-KHGUSLMB.js} +2 -2
- package/dist/exports/client/{Field-JP7H7AZE.js.map → Field-KHGUSLMB.js.map} +2 -2
- package/dist/exports/client/{RelationshipComponent-XOQBVKA3.js → RelationshipComponent-F77EQHRG.js} +2 -2
- package/dist/exports/client/{chunk-YSJURFKK.js → chunk-4J2ONJMB.js} +2 -2
- package/dist/exports/client/{chunk-XCEM47RI.js → chunk-AXXPUMFU.js} +2 -2
- package/dist/exports/client/{chunk-5PBXL4HT.js → chunk-F26IQ5RE.js} +2 -2
- package/dist/exports/client/{chunk-5PBXL4HT.js.map → chunk-F26IQ5RE.js.map} +1 -1
- package/dist/exports/client/chunk-H3D3IU3G.js +2 -0
- package/dist/exports/client/{chunk-DOK5S7LE.js.map → chunk-H3D3IU3G.js.map} +2 -2
- package/dist/exports/client/{chunk-2CYU43GM.js → chunk-INBEEENE.js} +2 -2
- package/dist/exports/client/{chunk-2CYU43GM.js.map → chunk-INBEEENE.js.map} +1 -1
- package/dist/exports/client/{chunk-ZTAS32RX.js → chunk-PGMIO4IN.js} +2 -2
- package/dist/exports/client/{chunk-2L2Z4JHF.js → chunk-XOABLBHB.js} +2 -2
- package/dist/exports/client/{chunk-2L2Z4JHF.js.map → chunk-XOABLBHB.js.map} +1 -1
- package/dist/exports/client/{component-D6PKVJ2K.js → component-NSAU5Y76.js} +2 -2
- package/dist/exports/client/component-SX36AJXS.js +2 -0
- package/dist/exports/client/{component-ANB7VZLA.js.map → component-SX36AJXS.js.map} +2 -2
- package/dist/exports/client/componentInline-B5YNOX32.js +2 -0
- package/dist/exports/client/index.js +17 -17
- package/dist/exports/client/index.js.map +2 -2
- package/dist/features/blocks/client/component/BlockContent.js +8 -8
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +5 -5
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +7 -4
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -3
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +3 -3
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +6 -6
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js +3 -3
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
- package/dist/features/horizontalRule/client/component/index.js +19 -18
- package/dist/features/horizontalRule/client/component/index.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.js +13 -12
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/indent/client/plugins/index.js +3 -3
- package/dist/features/indent/client/plugins/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +3 -3
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/link/index.js +9 -5
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +13 -13
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +23 -19
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +19 -18
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +39 -31
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +31 -23
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +27 -26
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +36 -36
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.js +3 -3
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +6 -3
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/field/index.js +7 -7
- package/dist/field/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +15 -15
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +17 -17
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +17 -17
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js +4 -4
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/lexical/plugins/TextPlugin/index.js +3 -3
- package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +3 -3
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +11 -11
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +10 -10
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +14 -14
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +11 -11
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
- package/package.json +15 -15
- package/dist/exports/client/chunk-DOK5S7LE.js +0 -2
- package/dist/exports/client/component-ANB7VZLA.js +0 -2
- package/dist/exports/client/componentInline-OK3ZQ6YQ.js +0 -2
- /package/dist/exports/client/{RelationshipComponent-XOQBVKA3.js.map → RelationshipComponent-F77EQHRG.js.map} +0 -0
- /package/dist/exports/client/{chunk-YSJURFKK.js.map → chunk-4J2ONJMB.js.map} +0 -0
- /package/dist/exports/client/{chunk-XCEM47RI.js.map → chunk-AXXPUMFU.js.map} +0 -0
- /package/dist/exports/client/{chunk-ZTAS32RX.js.map → chunk-PGMIO4IN.js.map} +0 -0
- /package/dist/exports/client/{component-D6PKVJ2K.js.map → component-NSAU5Y76.js.map} +0 -0
- /package/dist/exports/client/{componentInline-OK3ZQ6YQ.js.map → componentInline-B5YNOX32.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","useLexicalListDrawer","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","EnabledRelationshipsCondition","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","editor","relationTo","replaceNodeKey","value","dispatchCommand","update","node","replace","RelationshipDrawerComponent","t0","$","enabledCollectionSlugs","t1","selectedCollectionSlug","setSelectedCollectionSlug","setReplaceNodeKey","t2","undefined","t3","collectionSlugs","selectedCollection","closeListDrawer","isListDrawerOpen","ListDrawer","openListDrawer","t4","t5","registerCommand","payload","nodeKey","t6","t7","collectionSlug","docID","onSelect","t8","t9","_jsx","RelationshipDrawer","props","length"],"sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js'\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js'\nimport { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js'\n\nconst insertRelationship = ({\n editor,\n relationTo,\n replaceNodeKey,\n value,\n}: {\n editor: LexicalEditor\n relationTo: string\n replaceNodeKey: null | string\n value: number | string\n}) => {\n if (!replaceNodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_COMMAND, {\n relationTo,\n value,\n })\n } else {\n editor.update(() => {\n const node = $getNodeByKey(replaceNodeKey)\n if (node) {\n node.replace($createRelationshipNode({ relationTo, value }))\n }\n })\n }\n}\n\ntype Props = {\n enabledCollectionSlugs: null | string[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n const [selectedCollectionSlug, setSelectedCollectionSlug] = useState(\n () => enabledCollectionSlugs?.[0],\n )\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const { closeListDrawer, isListDrawerOpen, ListDrawer, openListDrawer } = useLexicalListDrawer({\n collectionSlugs: enabledCollectionSlugs ? enabledCollectionSlugs : undefined,\n selectedCollection: selectedCollectionSlug,\n })\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n (payload) => {\n setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null)\n openListDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openListDrawer])\n\n const onSelect = useCallback(\n ({ collectionSlug, docID }: { collectionSlug: string; docID: number | string }) => {\n insertRelationship({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: docID,\n })\n closeListDrawer()\n },\n [editor, closeListDrawer, replaceNodeKey],\n )\n\n useEffect(() => {\n // always reset back to first option\n // TODO: this is not working, see the ListDrawer component\n setSelectedCollectionSlug(enabledCollectionSlugs?.[0])\n }, [isListDrawerOpen, enabledCollectionSlugs])\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nexport const RelationshipDrawer = (props: Props): React.ReactNode => {\n return (props?.enabledCollectionSlugs?.length ?? -1) > 0 ? ( // If enabledCollectionSlugs it overrides what EnabledRelationshipsCondition is doing\n <RelationshipDrawerComponent {...props} />\n ) : (\n <EnabledRelationshipsCondition {...props}>\n <RelationshipDrawerComponent {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,aAAa,EAAEC,uBAAuB,QAAQ;AACvD,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ;AAExD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,uCAAuC,QAAQ;AAExD,MAAMC,kBAAA,GAAqBA,CAAC;EAC1BC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC;AAAK,CAMN;EACC,IAAI,CAACD,cAAA,EAAgB;IACnBF,MAAA,CAAOI,eAAe,CAACR,2BAAA,EAA6B;MAClDK,UAAA;MACAE;IACF;EACF,OAAO;IACLH,MAAA,CAAOK,MAAM,CAAC;MACZ,MAAMC,IAAA,GAAOlB,aAAA,CAAcc,cAAA;MAC3B,IAAII,IAAA,EAAM;QACRA,IAAA,CAAKC,OAAO,CAACZ,uBAAA,CAAwB;UAAEM,UAAA;UAAYE;QAAM;MAC3D;IACF;EACF;AACF;AAMA,MAAMK,2BAAA,GAA+CC,EAAA;EAAA,MAAAC,CAAA,GAAAxB,EAAA;EAAC;IAAAyB;EAAA,IAAAF,EAA0B;EAC9E,OAAAT,MAAA,IAAiBb,yBAAA;EAAA,IAAAyB,EAAA;EAAA,IAAAF,CAAA,QAAAC,sBAAA;IAEfC,EAAA,GAAAA,CAAA,KAAMD,sBAAA;IAA2BD,CAAA,MAAAC,sBAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EADnC,OAAAG,sBAAA,EAAAC,yBAAA,IAA4DrB,QAAA,CAC1DmB,EAAiC;EAEnC,OAAAV,cAAA,EAAAa,iBAAA,IAA4CtB,QAAA,KAAwB;EAGjD,MAAAuB,EAAA,GAAAL,sBAAA,GAAyBA,sBAAA,GAAAM,SAAyB;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","useLexicalListDrawer","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","EnabledRelationshipsCondition","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","editor","relationTo","replaceNodeKey","value","dispatchCommand","update","node","replace","RelationshipDrawerComponent","t0","$","enabledCollectionSlugs","t1","selectedCollectionSlug","setSelectedCollectionSlug","setReplaceNodeKey","t2","undefined","t3","collectionSlugs","selectedCollection","closeListDrawer","isListDrawerOpen","ListDrawer","openListDrawer","t4","t5","registerCommand","payload","nodeKey","t6","t7","collectionSlug","docID","onSelect","t8","t9","_jsx","RelationshipDrawer","props","length"],"sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js'\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js'\nimport { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js'\n\nconst insertRelationship = ({\n editor,\n relationTo,\n replaceNodeKey,\n value,\n}: {\n editor: LexicalEditor\n relationTo: string\n replaceNodeKey: null | string\n value: number | string\n}) => {\n if (!replaceNodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_COMMAND, {\n relationTo,\n value,\n })\n } else {\n editor.update(() => {\n const node = $getNodeByKey(replaceNodeKey)\n if (node) {\n node.replace($createRelationshipNode({ relationTo, value }))\n }\n })\n }\n}\n\ntype Props = {\n enabledCollectionSlugs: null | string[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n const [selectedCollectionSlug, setSelectedCollectionSlug] = useState(\n () => enabledCollectionSlugs?.[0],\n )\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const { closeListDrawer, isListDrawerOpen, ListDrawer, openListDrawer } = useLexicalListDrawer({\n collectionSlugs: enabledCollectionSlugs ? enabledCollectionSlugs : undefined,\n selectedCollection: selectedCollectionSlug,\n })\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n (payload) => {\n setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null)\n openListDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openListDrawer])\n\n const onSelect = useCallback(\n ({ collectionSlug, docID }: { collectionSlug: string; docID: number | string }) => {\n insertRelationship({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: docID,\n })\n closeListDrawer()\n },\n [editor, closeListDrawer, replaceNodeKey],\n )\n\n useEffect(() => {\n // always reset back to first option\n // TODO: this is not working, see the ListDrawer component\n setSelectedCollectionSlug(enabledCollectionSlugs?.[0])\n }, [isListDrawerOpen, enabledCollectionSlugs])\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nexport const RelationshipDrawer = (props: Props): React.ReactNode => {\n return (props?.enabledCollectionSlugs?.length ?? -1) > 0 ? ( // If enabledCollectionSlugs it overrides what EnabledRelationshipsCondition is doing\n <RelationshipDrawerComponent {...props} />\n ) : (\n <EnabledRelationshipsCondition {...props}>\n <RelationshipDrawerComponent {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,aAAa,EAAEC,uBAAuB,QAAQ;AACvD,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ;AAExD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,uCAAuC,QAAQ;AAExD,MAAMC,kBAAA,GAAqBA,CAAC;EAC1BC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC;AAAK,CAMN;EACC,IAAI,CAACD,cAAA,EAAgB;IACnBF,MAAA,CAAOI,eAAe,CAACR,2BAAA,EAA6B;MAClDK,UAAA;MACAE;IACF;EACF,OAAO;IACLH,MAAA,CAAOK,MAAM,CAAC;MACZ,MAAMC,IAAA,GAAOlB,aAAA,CAAcc,cAAA;MAC3B,IAAII,IAAA,EAAM;QACRA,IAAA,CAAKC,OAAO,CAACZ,uBAAA,CAAwB;UAAEM,UAAA;UAAYE;QAAM;MAC3D;IACF;EACF;AACF;AAMA,MAAMK,2BAAA,GAA+CC,EAAA;EAAA,MAAAC,C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UAAA,IAAAb,CAAA,SAAAwB,QAAA;IAEtCE,EAAA,GAAAC,IAAA,CAACd,UAAA;MAAAW;IAAA,C;;;;;;;SAADE,E;CACT;AAEA,OAAO,MAAME,kBAAA,GAAsBC,KAAA;EACjC,OAAO,CAACA,KAAA,EAAO5B,sBAAA,EAAwB6B,MAAA,IAAU,CAAC,KAAK,iBACrDH,IAAA,CAAC7B,2BAAA;IAA6B,GAAG+B;oBAEjCF,IAAA,CAACxC,6BAAA;IAA+B,GAAG0C,KAAK;cACtC,aAAAF,IAAA,CAAC7B,2BAAA;MAA6B,GAAG+B;;;AAGvC","ignoreList":[]}
|
|
@@ -28,22 +28,22 @@ export const RelationshipPlugin = t0 => {
|
|
|
28
28
|
} else {
|
|
29
29
|
if (clientProps?.disabledCollections) {
|
|
30
30
|
let t2;
|
|
31
|
-
if ($[0] !== clientProps || $[1] !== collections) {
|
|
31
|
+
if ($[0] !== clientProps?.disabledCollections || $[1] !== collections) {
|
|
32
32
|
let t3;
|
|
33
|
-
if ($[3] !== clientProps) {
|
|
33
|
+
if ($[3] !== clientProps?.disabledCollections) {
|
|
34
34
|
t3 = t4 => {
|
|
35
35
|
const {
|
|
36
36
|
slug
|
|
37
37
|
} = t4;
|
|
38
38
|
return !clientProps?.disabledCollections?.includes(slug);
|
|
39
39
|
};
|
|
40
|
-
$[3] = clientProps;
|
|
40
|
+
$[3] = clientProps?.disabledCollections;
|
|
41
41
|
$[4] = t3;
|
|
42
42
|
} else {
|
|
43
43
|
t3 = $[4];
|
|
44
44
|
}
|
|
45
45
|
t2 = collections.filter(t3).map(_temp);
|
|
46
|
-
$[0] = clientProps;
|
|
46
|
+
$[0] = clientProps?.disabledCollections;
|
|
47
47
|
$[1] = collections;
|
|
48
48
|
$[2] = t2;
|
|
49
49
|
} else {
|
|
@@ -59,21 +59,7 @@ export const RelationshipPlugin = t0 => {
|
|
|
59
59
|
if (!editor.hasNodes([RelationshipNode])) {
|
|
60
60
|
throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");
|
|
61
61
|
}
|
|
62
|
-
return editor.registerCommand(INSERT_RELATIONSHIP_COMMAND,
|
|
63
|
-
const selection = $getSelection() || $getPreviousSelection();
|
|
64
|
-
if ($isRangeSelection(selection)) {
|
|
65
|
-
const relationshipNode = $createRelationshipNode(payload);
|
|
66
|
-
$insertNodeToNearestRoot(relationshipNode);
|
|
67
|
-
const {
|
|
68
|
-
focus
|
|
69
|
-
} = selection;
|
|
70
|
-
const focusNode = focus.getNode();
|
|
71
|
-
if ($isParagraphNode(focusNode) && focusNode.getTextContentSize() === 0 && focusNode.getParentOrThrow().getChildren().filter(node => $isParagraphNode(node)).length > 1) {
|
|
72
|
-
focusNode.remove();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
}, COMMAND_PRIORITY_EDITOR);
|
|
62
|
+
return editor.registerCommand(INSERT_RELATIONSHIP_COMMAND, _temp3, COMMAND_PRIORITY_EDITOR);
|
|
77
63
|
};
|
|
78
64
|
t3 = [editor];
|
|
79
65
|
$[5] = editor;
|
|
@@ -102,4 +88,22 @@ function _temp(t0) {
|
|
|
102
88
|
} = t0;
|
|
103
89
|
return slug_0;
|
|
104
90
|
}
|
|
91
|
+
function _temp2(node) {
|
|
92
|
+
return $isParagraphNode(node);
|
|
93
|
+
}
|
|
94
|
+
function _temp3(payload) {
|
|
95
|
+
const selection = $getSelection() || $getPreviousSelection();
|
|
96
|
+
if ($isRangeSelection(selection)) {
|
|
97
|
+
const relationshipNode = $createRelationshipNode(payload);
|
|
98
|
+
$insertNodeToNearestRoot(relationshipNode);
|
|
99
|
+
const {
|
|
100
|
+
focus
|
|
101
|
+
} = selection;
|
|
102
|
+
const focusNode = focus.getNode();
|
|
103
|
+
if ($isParagraphNode(focusNode) && focusNode.getTextContentSize() === 0 && focusNode.getParentOrThrow().getChildren().filter(_temp2).length > 1) {
|
|
104
|
+
focusNode.remove();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
105
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","config","t1","collections","enabledRelations","enabledCollections","disabledCollections","t2","t3","t4","slug","includes","filter","map","_temp","hasNodes","Error","registerCommand","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","config","t1","collections","enabledRelations","enabledCollections","disabledCollections","t2","t3","t4","slug","includes","filter","map","_temp","hasNodes","Error","registerCommand","_temp3","_jsx","enabledCollectionSlugs","slug_0","_temp2","node","payload","selection","relationshipNode","focus","focusNode","getNode","getTextContentSize","getParentOrThrow","getChildren","length","remove"],"sources":["../../../../../src/features/relationship/client/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../../typesClient.js'\nimport type { RelationshipFeatureProps } from '../../server/index.js'\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const {\n config: { collections },\n } = useConfig()\n\n let enabledRelations: null | string[] = null\n\n if (clientProps?.enabledCollections) {\n enabledRelations = clientProps?.enabledCollections\n } else if (clientProps?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !clientProps?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const relationshipNode = $createRelationshipNode(payload)\n // Insert relationship node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(relationshipNode)\n\n const { focus } = selection\n const focusNode = focus.getNode()\n\n // First, delete currently selected node if it's an empty paragraph and if there are sufficient\n // paragraph nodes (more than 1) left in the parent node, so that we don't \"trap\" the user\n if (\n $isParagraphNode(focusNode) &&\n focusNode.getTextContentSize() === 0 &&\n focusNode\n .getParentOrThrow()\n .getChildren()\n .filter((node) => $isParagraphNode(node)).length > 1\n ) {\n focusNode.remove()\n }\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,wBAAwB,QAAQ;AACzC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CAAAE,kBAAA,CAA4B,OAAO,IACnCF,SAAA,CAAAG,gBAAA,CACmB,EAAAC,WAAA,CACL,EAAApB,MAAA,CAAAU,MACuB,EAAAW,MAAA,IAAgB;MAErDL,SAAA,CAAAM,MAAA,CAAgB;IAAA;EAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -22,9 +22,9 @@ const filterRichTextCollections = (collections, options) => {
|
|
|
22
22
|
};
|
|
23
23
|
export const EnabledRelationshipsCondition = props => {
|
|
24
24
|
const $ = _c(16);
|
|
25
|
-
let t0;
|
|
26
|
-
let rest;
|
|
27
25
|
let children;
|
|
26
|
+
let rest;
|
|
27
|
+
let t0;
|
|
28
28
|
if ($[0] !== props) {
|
|
29
29
|
({
|
|
30
30
|
children,
|
|
@@ -32,13 +32,13 @@ export const EnabledRelationshipsCondition = props => {
|
|
|
32
32
|
...rest
|
|
33
33
|
} = props);
|
|
34
34
|
$[0] = props;
|
|
35
|
-
$[1] =
|
|
35
|
+
$[1] = children;
|
|
36
36
|
$[2] = rest;
|
|
37
|
-
$[3] =
|
|
37
|
+
$[3] = t0;
|
|
38
38
|
} else {
|
|
39
|
-
|
|
39
|
+
children = $[1];
|
|
40
40
|
rest = $[2];
|
|
41
|
-
|
|
41
|
+
t0 = $[3];
|
|
42
42
|
}
|
|
43
43
|
const uploads = t0 === undefined ? false : t0;
|
|
44
44
|
const {
|
|
@@ -59,12 +59,7 @@ export const EnabledRelationshipsCondition = props => {
|
|
|
59
59
|
uploads,
|
|
60
60
|
user,
|
|
61
61
|
visibleEntities
|
|
62
|
-
}).map(
|
|
63
|
-
const {
|
|
64
|
-
slug
|
|
65
|
-
} = t3;
|
|
66
|
-
return slug;
|
|
67
|
-
});
|
|
62
|
+
}).map(_temp);
|
|
68
63
|
$[4] = collections;
|
|
69
64
|
$[5] = uploads;
|
|
70
65
|
$[6] = user;
|
|
@@ -78,27 +73,33 @@ export const EnabledRelationshipsCondition = props => {
|
|
|
78
73
|
return null;
|
|
79
74
|
}
|
|
80
75
|
let t3;
|
|
81
|
-
if ($[9] !==
|
|
76
|
+
if ($[9] !== children || $[10] !== enabledCollectionSlugs || $[11] !== rest) {
|
|
82
77
|
let t4;
|
|
83
|
-
if ($[13] !==
|
|
78
|
+
if ($[13] !== enabledCollectionSlugs || $[14] !== rest) {
|
|
84
79
|
t4 = {
|
|
85
80
|
...rest,
|
|
86
81
|
enabledCollectionSlugs
|
|
87
82
|
};
|
|
88
|
-
$[13] =
|
|
89
|
-
$[14] =
|
|
83
|
+
$[13] = enabledCollectionSlugs;
|
|
84
|
+
$[14] = rest;
|
|
90
85
|
$[15] = t4;
|
|
91
86
|
} else {
|
|
92
87
|
t4 = $[15];
|
|
93
88
|
}
|
|
94
89
|
t3 = React.cloneElement(children, t4);
|
|
95
|
-
$[9] =
|
|
90
|
+
$[9] = children;
|
|
96
91
|
$[10] = enabledCollectionSlugs;
|
|
97
|
-
$[11] =
|
|
92
|
+
$[11] = rest;
|
|
98
93
|
$[12] = t3;
|
|
99
94
|
} else {
|
|
100
95
|
t3 = $[12];
|
|
101
96
|
}
|
|
102
97
|
return t3;
|
|
103
98
|
};
|
|
99
|
+
function _temp(t0) {
|
|
100
|
+
const {
|
|
101
|
+
slug
|
|
102
|
+
} = t0;
|
|
103
|
+
return slug;
|
|
104
|
+
}
|
|
104
105
|
//# sourceMappingURL=EnabledRelationshipsCondition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnabledRelationshipsCondition.js","names":["c","_c","useAuth","useConfig","useEntityVisibility","React","filterRichTextCollections","collections","options","filter","slug","admin","enableRichTextRelationship","upload","visibleEntities","includes","uploads","Boolean","EnabledRelationshipsCondition","props","$","
|
|
1
|
+
{"version":3,"file":"EnabledRelationshipsCondition.js","names":["c","_c","useAuth","useConfig","useEntityVisibility","React","filterRichTextCollections","collections","options","filter","slug","admin","enableRichTextRelationship","upload","visibleEntities","includes","uploads","Boolean","EnabledRelationshipsCondition","props","$","children","rest","t0","undefined","config","t1","user","t2","map","_temp","enabledCollectionSlugs","useState","length","t3","t4","cloneElement"],"sources":["../../../../../src/features/relationship/client/utils/EnabledRelationshipsCondition.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options?.visibleEntities.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<any> = (props) => {\n const { children, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user: user!, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,OAAO,EAAEC,SAAS,EAAEC,mBAAmB,QAAQ;AACxD,YAAYC,KAAA,MAAW;AAavB,MAAMC,yBAAA,GAAkDA,CAACC,WAAA,EAAaC,OAAA;EACpE,OAAOD,WAAA,CAAYE,MAAM,CAAC,CAAC;IAAEC,IAAI;IAAEC,KAAA,EAAO;MAAEC;IAA0B,CAAE;IAAEC;EAAM,CAAE;IAChF,IAAI,CAACL,OAAA,EAASM,eAAA,CAAgBP,WAAA,CAAYQ,QAAA,CAAS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AQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAFlB,OAAAW,sBAAA,IAAiC1B,KAAA,CAAA2B,QAAA,CAAeJ,EAE9B;EAAA,KAIbG,sBAAA,CAAAE,MAAA;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAd,CAAA,QAAAC,QAAA,IAAAD,CAAA,SAAAW,sBAAA,IAAAX,CAAA,SAAAE,IAAA;IAAA,IAAAa,EAAA;IAAA,IAAAf,CAAA,SAAAW,sBAAA,IAAAX,CAAA,SAAAE,IAAA;MAI+Ba,EAAA;QAAA,GAAKb,IAAI;QAAAS;MAAA;MAAyBX,CAAA,OAAAW,sBAAA;MAAAX,CAAA,OAAAE,IAAA;MAAAF,CAAA,OAAAe,EAAA;IAAA;MAAAA,EAAA,GAAAf,CAAA;IAAA;IAA/Dc,EAAA,GAAA7B,KAAA,CAAA+B,YAAA,CAAmBf,QAAA,EAAUc,EAAkC;IAAAf,CAAA,MAAAC,QAAA;IAAAD,CAAA,OAAAW,sBAAA;IAAAX,CAAA,OAAAE,IAAA;IAAAF,CAAA,OAAAc,EAAA;EAAA;IAAAA,EAAA,GAAAd,CAAA;EAAA;EAAA,OAA/Dc,EAA+D;AAAA,CACxE;AAnB4D,SAAAJ,MAAAP,EAAA;EAUrD;IAAAb;EAAA,IAAAa,EAAQ;EAAA,OAAKb,IAAA;AAAA","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ function ButtonGroupItem({
|
|
|
31
31
|
}, item.key);
|
|
32
32
|
}
|
|
33
33
|
function ToolbarGroupComponent(t0) {
|
|
34
|
-
const $ = _c(
|
|
34
|
+
const $ = _c(23);
|
|
35
35
|
const {
|
|
36
36
|
anchorElem,
|
|
37
37
|
editor,
|
|
@@ -52,8 +52,7 @@ function ToolbarGroupComponent(t0) {
|
|
|
52
52
|
const [dropdownLabel, setDropdownLabel] = React.useState(undefined);
|
|
53
53
|
const [DropdownIcon, setDropdownIcon] = React.useState(undefined);
|
|
54
54
|
let t2;
|
|
55
|
-
|
|
56
|
-
if ($[0] !== group) {
|
|
55
|
+
if ($[0] !== group.ChildComponent || $[1] !== group.items || $[2] !== group.type) {
|
|
57
56
|
t2 = () => {
|
|
58
57
|
if (group?.type === "dropdown" && group.items.length && group.ChildComponent) {
|
|
59
58
|
setDropdownIcon(() => group.ChildComponent);
|
|
@@ -61,17 +60,24 @@ function ToolbarGroupComponent(t0) {
|
|
|
61
60
|
setDropdownIcon(undefined);
|
|
62
61
|
}
|
|
63
62
|
};
|
|
63
|
+
$[0] = group.ChildComponent;
|
|
64
|
+
$[1] = group.items;
|
|
65
|
+
$[2] = group.type;
|
|
66
|
+
$[3] = t2;
|
|
67
|
+
} else {
|
|
68
|
+
t2 = $[3];
|
|
69
|
+
}
|
|
70
|
+
let t3;
|
|
71
|
+
if ($[4] !== group) {
|
|
64
72
|
t3 = [group];
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[2] = t3;
|
|
73
|
+
$[4] = group;
|
|
74
|
+
$[5] = t3;
|
|
68
75
|
} else {
|
|
69
|
-
|
|
70
|
-
t3 = $[2];
|
|
76
|
+
t3 = $[5];
|
|
71
77
|
}
|
|
72
78
|
React.useEffect(t2, t3);
|
|
73
79
|
let t4;
|
|
74
|
-
if ($[
|
|
80
|
+
if ($[6] !== featureClientSchemaMap || $[7] !== group.ChildComponent || $[8] !== group.items || $[9] !== group.type || $[10] !== i18n || $[11] !== schemaPath) {
|
|
75
81
|
t4 = t5 => {
|
|
76
82
|
const {
|
|
77
83
|
activeItems
|
|
@@ -112,18 +118,20 @@ function ToolbarGroupComponent(t0) {
|
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
};
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
121
|
+
$[6] = featureClientSchemaMap;
|
|
122
|
+
$[7] = group.ChildComponent;
|
|
123
|
+
$[8] = group.items;
|
|
124
|
+
$[9] = group.type;
|
|
125
|
+
$[10] = i18n;
|
|
126
|
+
$[11] = schemaPath;
|
|
127
|
+
$[12] = t4;
|
|
120
128
|
} else {
|
|
121
|
-
t4 = $[
|
|
129
|
+
t4 = $[12];
|
|
122
130
|
}
|
|
123
131
|
const onActiveChange = t4;
|
|
124
132
|
const t5 = `fixed-toolbar__group fixed-toolbar__group-${group.key}`;
|
|
125
133
|
let t6;
|
|
126
|
-
if ($[
|
|
134
|
+
if ($[13] !== DropdownIcon || $[14] !== anchorElem || $[15] !== dropdownLabel || $[16] !== editor || $[17] !== editorConfig.features.toolbarFixed?.groups.length || $[18] !== group || $[19] !== index || $[20] !== onActiveChange || $[21] !== t5) {
|
|
127
135
|
t6 = _jsxs("div", {
|
|
128
136
|
className: t5,
|
|
129
137
|
children: [group.type === "dropdown" && group.items.length ? DropdownIcon ? _jsx(ToolbarDropdown, {
|
|
@@ -151,18 +159,18 @@ function ToolbarGroupComponent(t0) {
|
|
|
151
159
|
className: "divider"
|
|
152
160
|
})]
|
|
153
161
|
}, group.key);
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
162
|
+
$[13] = DropdownIcon;
|
|
163
|
+
$[14] = anchorElem;
|
|
164
|
+
$[15] = dropdownLabel;
|
|
165
|
+
$[16] = editor;
|
|
166
|
+
$[17] = editorConfig.features.toolbarFixed?.groups.length;
|
|
167
|
+
$[18] = group;
|
|
168
|
+
$[19] = index;
|
|
169
|
+
$[20] = onActiveChange;
|
|
170
|
+
$[21] = t5;
|
|
171
|
+
$[22] = t6;
|
|
164
172
|
} else {
|
|
165
|
-
t6 = $[
|
|
173
|
+
t6 = $[22];
|
|
166
174
|
}
|
|
167
175
|
return t6;
|
|
168
176
|
}
|
|
@@ -267,7 +275,7 @@ export const FixedToolbarPlugin = t0 => {
|
|
|
267
275
|
const editorConfig = clientProps.applyToFocusedEditor ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig : currentEditorConfig;
|
|
268
276
|
let t1;
|
|
269
277
|
let t2;
|
|
270
|
-
if ($[0] !==
|
|
278
|
+
if ($[0] !== clientProps.disableIfParentHasFixedToolbar || $[1] !== editor || $[2] !== editorConfig || $[3] !== editorConfigContext) {
|
|
271
279
|
t2 = Symbol.for("react.early_return_sentinel");
|
|
272
280
|
bb0: {
|
|
273
281
|
const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext);
|
|
@@ -288,10 +296,10 @@ export const FixedToolbarPlugin = t0 => {
|
|
|
288
296
|
parentWithFixedToolbar
|
|
289
297
|
});
|
|
290
298
|
}
|
|
291
|
-
$[0] =
|
|
292
|
-
$[1] =
|
|
299
|
+
$[0] = clientProps.disableIfParentHasFixedToolbar;
|
|
300
|
+
$[1] = editor;
|
|
293
301
|
$[2] = editorConfig;
|
|
294
|
-
$[3] =
|
|
302
|
+
$[3] = editorConfigContext;
|
|
295
303
|
$[4] = t1;
|
|
296
304
|
$[5] = t2;
|
|
297
305
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","ButtonGroupItem","anchorElem","editor","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","t0","$","editorConfig","group","index","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","dropdownLabel","setDropdownLabel","useState","undefined","DropdownIcon","setDropdownIcon","t2","t3","type","items","length","useEffect","t4","t5","activeItems","label","substring","t","count","onActiveChange","t6","features","toolbarFixed","_jsxs","className","children","Icon","itemsContainerClassNames","maxActiveItems","map","item_0","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","onFocus","event","stopPropagation","ref","isEditable","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","Symbol","for","bb0","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport './index.scss'\n\nfunction ButtonGroupItem({\n anchorElem,\n editor,\n item,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton editor={editor} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n const [dropdownLabel, setDropdownLabel] = React.useState<string | undefined>(undefined)\n const [DropdownIcon, setDropdownIcon] = React.useState<React.FC | undefined>(undefined)\n\n React.useEffect(() => {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n } else {\n setDropdownIcon(undefined)\n }\n }, [group])\n\n const onActiveChange = React.useCallback(\n ({ activeItems }: { activeItems: ToolbarGroupItem[] }) => {\n if (!activeItems.length) {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n setDropdownLabel(undefined)\n } else {\n setDropdownIcon(undefined)\n setDropdownLabel(undefined)\n }\n return\n }\n const item = activeItems[0]\n\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n // Crop title to max. 25 characters\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n if (activeItems.length === 1) {\n setDropdownLabel(label)\n setDropdownIcon(() => item.ChildComponent)\n } else {\n setDropdownLabel(\n i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length }),\n )\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n } else {\n setDropdownIcon(undefined)\n }\n }\n },\n [group, i18n, featureClientSchemaMap, schemaPath],\n )\n\n return (\n <div className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`} key={group.key}>\n {group.type === 'dropdown' && group.items.length ? (\n DropdownIcon ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={group.maxActiveItems ?? 1}\n onActiveChange={onActiveChange}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={group.maxActiveItems ?? 1}\n onActiveChange={onActiveChange}\n />\n )\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n return (\n <ButtonGroupItem anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n\n const { y } = useScrollInfo()\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n >\n {editor.isEditable() && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ;AAClE,YAAYC,KAAA,MAAW;AACvB,SAASC,OAAO,QAAQ;AAQxB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAGhC,SAASC,gBAAgB;EACvBC,UAAU;EACVC,MAAM;EACNC;AAAI,CAKL;EACC,IAAIA,IAAA,CAAKC,SAAS,EAAE;IAClB,OACED,IAAA,EAAMC,SAAA,iBACJC,IAAA,CAACF,IAAA,CAAKC,SAAS;MAACH,UAAA,EAAYA,UAAA;MAAYC,MAAA,EAAQA,MAAA;MAAQC,IAAA,EAAMA;OAAWA,IAAA,CAAKG,GAAG;EAGvF;EAEA,IAAI,CAACH,IAAA,CAAKI,cAAc,EAAE;IACxB,OAAO;EACT;EAEA,oBACEF,IAAA,CAACP,aAAA;IAAcI,MAAA,EAAQA,MAAA;IAAQC,IAAA,EAAMA,IAAA;cACnC,aAAAE,IAAA,CAACF,IAAA,CAAKI,cAAc;KAD0BJ,IAAA,CAAKG,GAAG;AAI5D;AAEA,SAAAE,sBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAApB,EAAA;EAA+B;IAAAW,UAAA;IAAAC,MAAA;IAAAS,YAAA;IAAAC,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GAAA;MAJX,MAAAzC,sBAAA,GAA+B6B,+BAAA,CAAgCC,mBAAA;MAAA,IAE3D/B,WAAA,EAAAM,8BAAA;QAAA,IACEL,sBAAA;UACK5B,EAAA;UAAA,MAAAqE,GAAA;QAAA;MAAA;MAAA,KAINnF,YAAA,EAAA6B,QAAA,EAAAC,YAAA,EAAAS,MAAA,EAAArB,MAAA;QACIJ,EAAA;QAAA,MAAAqE,GAAA;MAAA;MAIP9E,EAAA,GAAAX,IAAA,CAAA8C,YAAA;QAAAlD,UAAA,EAAA8F,QAAA,CAAAC,IAAA;QAAA9F,MAAA;QAAAS,YAAA;QAAA0C;MAAA,C;;;;;;;;;;;;;;;SAAArC,E;CAOJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","ButtonGroupItem","anchorElem","editor","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","t0","$","editorConfig","group","index","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","dropdownLabel","setDropdownLabel","useState","undefined","DropdownIcon","setDropdownIcon","t2","items","type","length","t3","useEffect","t4","t5","activeItems","label","substring","t","count","onActiveChange","t6","features","toolbarFixed","groups","_jsxs","className","children","Icon","itemsContainerClassNames","maxActiveItems","map","item_0","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","onFocus","event","stopPropagation","ref","isEditable","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","Symbol","for","bb0","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport './index.scss'\n\nfunction ButtonGroupItem({\n anchorElem,\n editor,\n item,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton editor={editor} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n const [dropdownLabel, setDropdownLabel] = React.useState<string | undefined>(undefined)\n const [DropdownIcon, setDropdownIcon] = React.useState<React.FC | undefined>(undefined)\n\n React.useEffect(() => {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n } else {\n setDropdownIcon(undefined)\n }\n }, [group])\n\n const onActiveChange = React.useCallback(\n ({ activeItems }: { activeItems: ToolbarGroupItem[] }) => {\n if (!activeItems.length) {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n setDropdownLabel(undefined)\n } else {\n setDropdownIcon(undefined)\n setDropdownLabel(undefined)\n }\n return\n }\n const item = activeItems[0]\n\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n // Crop title to max. 25 characters\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n if (activeItems.length === 1) {\n setDropdownLabel(label)\n setDropdownIcon(() => item.ChildComponent)\n } else {\n setDropdownLabel(\n i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length }),\n )\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent!)\n } else {\n setDropdownIcon(undefined)\n }\n }\n },\n [group, i18n, featureClientSchemaMap, schemaPath],\n )\n\n return (\n <div className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`} key={group.key}>\n {group.type === 'dropdown' && group.items.length ? (\n DropdownIcon ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={group.maxActiveItems ?? 1}\n onActiveChange={onActiveChange}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={group.maxActiveItems ?? 1}\n onActiveChange={onActiveChange}\n />\n )\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n return (\n <ButtonGroupItem anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n\n const { y } = useScrollInfo()\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n >\n {editor.isEditable() && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}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AzE,EAAA;EAAA,IAAAS,EAAA;EAAA,IAAAf,CAAA,QAAA0C,WAAA,CAAAM,8BAAA,IAAAhD,CAAA,QAAAR,MAAA,IAAAQ,CAAA,QAAAC,YAAA,IAAAD,CAAA,QAAAyE,mBAAA;IAMO1D,EAAA,GAAAmE,MAAA,CAAAC,GAAA;IAAAC,GAAA;MAJX,MAAAzC,sBAAA,GAA+B6B,+BAAA,CAAgCC,mBAAA;MAAA,IAE3D/B,WAAA,EAAAM,8BAAA;QAAA,IACEL,sBAAA;UACK5B,EAAA;UAAA,MAAAqE,GAAA;QAAA;MAAA;MAAA,KAINnF,YAAA,EAAA6B,QAAA,EAAAC,YAAA,EAAAC,MAAA,EAAAd,MAAA;QACIH,EAAA;QAAA,MAAAqE,GAAA;MAAA;MAIP9E,EAAA,GAAAX,IAAA,CAAA8C,YAAA;QAAAlD,UAAA,EAAA8F,QAAA,CAAAC,IAAA;QAAA9F,MAAA;QAAAS,YAAA;QAAA0C;MAAA,C;;;;;;;;;;;;;;;SAAArC,E;CAOJ","ignoreList":[]}
|
|
@@ -35,7 +35,7 @@ function ButtonGroupItem({
|
|
|
35
35
|
}, item.key);
|
|
36
36
|
}
|
|
37
37
|
function ToolbarGroupComponent(t0) {
|
|
38
|
-
const $ = _c(
|
|
38
|
+
const $ = _c(19);
|
|
39
39
|
const {
|
|
40
40
|
anchorElem,
|
|
41
41
|
editor,
|
|
@@ -47,8 +47,7 @@ function ToolbarGroupComponent(t0) {
|
|
|
47
47
|
} = useEditorConfigContext();
|
|
48
48
|
const [DropdownIcon, setDropdownIcon] = React.useState();
|
|
49
49
|
let t1;
|
|
50
|
-
|
|
51
|
-
if ($[0] !== group) {
|
|
50
|
+
if ($[0] !== group.ChildComponent || $[1] !== group.items || $[2] !== group.type) {
|
|
52
51
|
t1 = () => {
|
|
53
52
|
if (group?.type === "dropdown" && group.items.length && group.ChildComponent) {
|
|
54
53
|
setDropdownIcon(() => group.ChildComponent);
|
|
@@ -56,17 +55,24 @@ function ToolbarGroupComponent(t0) {
|
|
|
56
55
|
setDropdownIcon(undefined);
|
|
57
56
|
}
|
|
58
57
|
};
|
|
58
|
+
$[0] = group.ChildComponent;
|
|
59
|
+
$[1] = group.items;
|
|
60
|
+
$[2] = group.type;
|
|
61
|
+
$[3] = t1;
|
|
62
|
+
} else {
|
|
63
|
+
t1 = $[3];
|
|
64
|
+
}
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[4] !== group) {
|
|
59
67
|
t2 = [group];
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
$[2] = t2;
|
|
68
|
+
$[4] = group;
|
|
69
|
+
$[5] = t2;
|
|
63
70
|
} else {
|
|
64
|
-
|
|
65
|
-
t2 = $[2];
|
|
71
|
+
t2 = $[5];
|
|
66
72
|
}
|
|
67
73
|
React.useEffect(t1, t2);
|
|
68
74
|
let t3;
|
|
69
|
-
if ($[
|
|
75
|
+
if ($[6] !== group.ChildComponent || $[7] !== group.items || $[8] !== group.type) {
|
|
70
76
|
t3 = t4 => {
|
|
71
77
|
const {
|
|
72
78
|
activeItems
|
|
@@ -82,15 +88,17 @@ function ToolbarGroupComponent(t0) {
|
|
|
82
88
|
const item = activeItems[0];
|
|
83
89
|
setDropdownIcon(() => item.ChildComponent);
|
|
84
90
|
};
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
91
|
+
$[6] = group.ChildComponent;
|
|
92
|
+
$[7] = group.items;
|
|
93
|
+
$[8] = group.type;
|
|
94
|
+
$[9] = t3;
|
|
87
95
|
} else {
|
|
88
|
-
t3 = $[
|
|
96
|
+
t3 = $[9];
|
|
89
97
|
}
|
|
90
98
|
const onActiveChange = t3;
|
|
91
99
|
const t4 = `inline-toolbar-popup__group inline-toolbar-popup__group-${group.key}`;
|
|
92
100
|
let t5;
|
|
93
|
-
if ($[
|
|
101
|
+
if ($[10] !== DropdownIcon || $[11] !== anchorElem || $[12] !== editor || $[13] !== editorConfig.features.toolbarInline?.groups.length || $[14] !== group || $[15] !== index || $[16] !== onActiveChange || $[17] !== t4) {
|
|
94
102
|
t5 = _jsxs("div", {
|
|
95
103
|
className: t4,
|
|
96
104
|
children: [group.type === "dropdown" && group.items.length ? DropdownIcon ? _jsx(ToolbarDropdown, {
|
|
@@ -114,17 +122,17 @@ function ToolbarGroupComponent(t0) {
|
|
|
114
122
|
className: "divider"
|
|
115
123
|
})]
|
|
116
124
|
}, group.key);
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
125
|
+
$[10] = DropdownIcon;
|
|
126
|
+
$[11] = anchorElem;
|
|
127
|
+
$[12] = editor;
|
|
128
|
+
$[13] = editorConfig.features.toolbarInline?.groups.length;
|
|
129
|
+
$[14] = group;
|
|
130
|
+
$[15] = index;
|
|
131
|
+
$[16] = onActiveChange;
|
|
132
|
+
$[17] = t4;
|
|
133
|
+
$[18] = t5;
|
|
126
134
|
} else {
|
|
127
|
-
t5 = $[
|
|
135
|
+
t5 = $[18];
|
|
128
136
|
}
|
|
129
137
|
return t5;
|
|
130
138
|
}
|