@payloadcms/richtext-lexical 3.60.0-canary.0 → 3.60.0-internal.40d58c0
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/RelationshipComponent-JXQOFHXF.js +2 -0
- package/dist/exports/client/RelationshipComponent-JXQOFHXF.js.map +7 -0
- package/dist/exports/client/{chunk-XNERFY6G.js → chunk-IBFFIWII.js} +2 -2
- package/dist/exports/client/{chunk-XNERFY6G.js.map → chunk-IBFFIWII.js.map} +2 -2
- package/dist/exports/client/chunk-O6XRT2H3.js +2 -0
- package/dist/exports/client/{chunk-BQCXN3B4.js.map → chunk-O6XRT2H3.js.map} +4 -4
- package/dist/exports/client/component-WT25HAJA.js +2 -0
- package/dist/exports/client/component-WT25HAJA.js.map +7 -0
- package/dist/exports/client/componentInline-ZHQ2OTFH.js +2 -0
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +22 -22
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/premade/CodeBlock/index.d.ts +3 -1
- package/dist/features/blocks/premade/CodeBlock/index.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/index.js +7 -2
- package/dist/features/blocks/premade/CodeBlock/index.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +2 -3
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -3
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/heading/server/index.d.ts +1 -1
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -3
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +1 -6
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.d.ts +3 -2
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +72 -59
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +41 -49
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +13 -0
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -0
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +64 -0
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -0
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +2 -3
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/upload/client/component/index.d.ts +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +1 -11
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.d.ts +3 -2
- package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
- package/dist/features/upload/client/drawer/index.js +8 -9
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/index.d.ts +2 -1
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +72 -75
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +18 -3
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +6 -0
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts +2 -3
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nodeTypes.d.ts +23 -14
- package/dist/nodeTypes.d.ts.map +1 -1
- package/dist/nodeTypes.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts +47 -6
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js +9 -1
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/package.json +6 -6
- package/dist/exports/client/RelationshipComponent-TSIENULZ.js +0 -2
- package/dist/exports/client/RelationshipComponent-TSIENULZ.js.map +0 -7
- package/dist/exports/client/chunk-BQCXN3B4.js +0 -2
- package/dist/exports/client/component-CYFKY3IL.js +0 -2
- package/dist/exports/client/component-CYFKY3IL.js.map +0 -7
- package/dist/exports/client/componentInline-NGTRUSGB.js +0 -2
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts +0 -7
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +0 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +0 -96
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +0 -1
- /package/dist/exports/client/{componentInline-NGTRUSGB.js.map → componentInline-ZHQ2OTFH.js.map} +0 -0
|
@@ -3,5 +3,7 @@ import type { AdditionalCodeComponentProps } from './Component/Code.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* @experimental - this API may change in future, minor releases
|
|
5
5
|
*/
|
|
6
|
-
export declare const CodeBlock: (args?:
|
|
6
|
+
export declare const CodeBlock: (args?: {
|
|
7
|
+
fieldOverrides?: Partial<Block>;
|
|
8
|
+
} & AdditionalCodeComponentProps) => Block;
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/premade/CodeBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAKvE;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/premade/CodeBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAKvE;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,CACtB,IAAI,CAAC,EAAE;IACL,cAAc,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;CAChC,GAAG,4BAA4B,KAC7B,KAiDJ,CAAA"}
|
|
@@ -3,7 +3,11 @@ import { codeConverter } from './converter.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* @experimental - this API may change in future, minor releases
|
|
5
5
|
*/
|
|
6
|
-
export const CodeBlock =
|
|
6
|
+
export const CodeBlock = _args => {
|
|
7
|
+
const {
|
|
8
|
+
fieldOverrides,
|
|
9
|
+
...args
|
|
10
|
+
} = _args || {};
|
|
7
11
|
const languages = args?.languages || defaultLanguages;
|
|
8
12
|
return {
|
|
9
13
|
slug: args?.slug || 'Code',
|
|
@@ -44,7 +48,8 @@ export const CodeBlock = args => {
|
|
|
44
48
|
},
|
|
45
49
|
label: ''
|
|
46
50
|
}],
|
|
47
|
-
jsx: codeConverter
|
|
51
|
+
jsx: codeConverter,
|
|
52
|
+
...(fieldOverrides || {})
|
|
48
53
|
};
|
|
49
54
|
};
|
|
50
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defaultLanguages","codeConverter","CodeBlock","args","languages","slug","admin","components","Block","clientProps","path","jsx","fields","name","type","hidden","defaultValue","defaultLanguage","Object","keys","options","entries","map","key","value","label","Field"],"sources":["../../../../../src/features/blocks/premade/CodeBlock/index.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport type { AdditionalCodeComponentProps } from './Component/Code.js'\n\nimport { defaultLanguages } from './Component/defaultLanguages.js'\nimport { codeConverter } from './converter.js'\n\n/**\n * @experimental - this API may change in future, minor releases\n */\nexport const CodeBlock: (args?: AdditionalCodeComponentProps) => Block = (
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultLanguages","codeConverter","CodeBlock","_args","fieldOverrides","args","languages","slug","admin","components","Block","clientProps","path","jsx","fields","name","type","hidden","defaultValue","defaultLanguage","Object","keys","options","entries","map","key","value","label","Field"],"sources":["../../../../../src/features/blocks/premade/CodeBlock/index.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport type { AdditionalCodeComponentProps } from './Component/Code.js'\n\nimport { defaultLanguages } from './Component/defaultLanguages.js'\nimport { codeConverter } from './converter.js'\n\n/**\n * @experimental - this API may change in future, minor releases\n */\nexport const CodeBlock: (\n args?: {\n fieldOverrides?: Partial<Block>\n } & AdditionalCodeComponentProps,\n) => Block = (_args) => {\n const { fieldOverrides, ...args } = _args || {}\n const languages = args?.languages || defaultLanguages\n\n return {\n slug: args?.slug || 'Code',\n admin: {\n components: {\n Block: {\n clientProps: {\n // If default languages are used, return undefined (=> do not pass `languages` variable) in order to reduce data sent to the client\n languages: args?.languages,\n },\n path: '@payloadcms/richtext-lexical/client#CodeBlockBlockComponent',\n },\n },\n jsx: '@payloadcms/richtext-lexical/client#codeConverterClient',\n },\n fields: [\n {\n name: 'language',\n type: 'select',\n admin: {\n // We'll manually render this field into the block component header\n hidden: true,\n },\n defaultValue: args?.defaultLanguage || Object.keys(languages)[0],\n options: Object.entries(languages).map(([key, value]) => ({\n label: value,\n value: key,\n })),\n },\n {\n name: 'code',\n type: 'code',\n admin: {\n components: {\n Field: {\n clientProps: args,\n path: '@payloadcms/richtext-lexical/client#CodeComponent',\n },\n },\n },\n label: '',\n },\n ],\n jsx: codeConverter,\n ...(fieldOverrides || {}),\n }\n}\n"],"mappings":"AAIA,SAASA,gBAAgB,QAAQ;AACjC,SAASC,aAAa,QAAQ;AAE9B;;;AAGA,OAAO,MAAMC,SAAA,GAICC,KAAA;EACZ,MAAM;IAAEC,cAAc;IAAE,GAAGC;EAAA,CAAM,GAAGF,KAAA,IAAS,CAAC;EAC9C,MAAMG,SAAA,GAAYD,IAAA,EAAMC,SAAA,IAAaN,gBAAA;EAErC,OAAO;IACLO,IAAA,EAAMF,IAAA,EAAME,IAAA,IAAQ;IACpBC,KAAA,EAAO;MACLC,UAAA,EAAY;QACVC,KAAA,EAAO;UACLC,WAAA,EAAa;YACX;YACAL,SAAA,EAAWD,IAAA,EAAMC;UACnB;UACAM,IAAA,EAAM;QACR;MACF;MACAC,GAAA,EAAK;IACP;IACAC,MAAA,EAAQ,CACN;MACEC,IAAA,EAAM;MACNC,IAAA,EAAM;MACNR,KAAA,EAAO;QACL;QACAS,MAAA,EAAQ;MACV;MACAC,YAAA,EAAcb,IAAA,EAAMc,eAAA,IAAmBC,MAAA,CAAOC,IAAI,CAACf,SAAA,CAAU,CAAC,EAAE;MAChEgB,OAAA,EAASF,MAAA,CAAOG,OAAO,CAACjB,SAAA,EAAWkB,GAAG,CAAC,CAAC,CAACC,GAAA,EAAKC,KAAA,CAAM,MAAM;QACxDC,KAAA,EAAOD,KAAA;QACPA,KAAA,EAAOD;MACT;IACF,GACA;MACEV,IAAA,EAAM;MACNC,IAAA,EAAM;MACNR,KAAA,EAAO;QACLC,UAAA,EAAY;UACVmB,KAAA,EAAO;YACLjB,WAAA,EAAaN,IAAA;YACbO,IAAA,EAAM;UACR;QACF;MACF;MACAe,KAAA,EAAO;IACT,EACD;IACDd,GAAA,EAAKZ,aAAA;IACL,IAAIG,cAAA,IAAkB,CAAC,CAAC;EAC1B;AACF","ignoreList":[]}
|
|
@@ -14,11 +14,10 @@ export type BlockFields<TBlockFields extends JsonObject = JsonObject> = {
|
|
|
14
14
|
export type BlockFieldsOptionalID<TBlockFields extends JsonObject = JsonObject> = {
|
|
15
15
|
id?: string;
|
|
16
16
|
} & BaseBlockFields<TBlockFields>;
|
|
17
|
-
export type SerializedBlockNode<TBlockFields extends JsonObject = JsonObject> = Spread<{
|
|
18
|
-
children?: never;
|
|
17
|
+
export type SerializedBlockNode<TBlockFields extends JsonObject = JsonObject> = Omit<Spread<{
|
|
19
18
|
fields: BlockFields<TBlockFields>;
|
|
20
19
|
type: 'block';
|
|
21
|
-
}, SerializedDecoratorBlockNode>;
|
|
20
|
+
}, Omit<SerializedDecoratorBlockNode, 'type'>>, 'children'>;
|
|
22
21
|
export declare class ServerBlockNode extends DecoratorBlockNode {
|
|
23
22
|
__cacheBuster: number;
|
|
24
23
|
__fields: BlockFields;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/server/nodes/BlocksNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CA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AAW,EAAE,sBAAsB,CAAC,EAAE,OAAO,GAAG,IAAI;CAOvE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAOrF;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,eAAe,GAAG,SAAS,GACrD,IAAI,IAAI,eAAe,CAEzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksNode.js","names":["DecoratorBlockNode","ObjectID","ServerBlockNode","__cacheBuster","__fields","constructor","cacheBuster","fields","format","key","clone","node","__format","__key","getType","importDOM","importJSON","serializedNode","version","data","$createServerBlockNode","setFormat","isInline","decorate","editor","config","exportDOM","element","document","createElement","text","createTextNode","getTextContent","append","exportJSON","type","getFields","getCacheBuster","getLatest","setFields","preventFormStateUpdate","writable","getWritable","id","default","toHexString","$isServerBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/BlocksNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\n\ntype BaseBlockFields<TBlockFields extends JsonObject = JsonObject> = {\n /** Block form data */\n blockName: string\n blockType: string\n} & TBlockFields\n\nexport type BlockFields<TBlockFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TBlockFields>\n\nexport type BlockFieldsOptionalID<TBlockFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TBlockFields>\n\nexport type SerializedBlockNode<TBlockFields extends JsonObject = JsonObject> =
|
|
1
|
+
{"version":3,"file":"BlocksNode.js","names":["DecoratorBlockNode","ObjectID","ServerBlockNode","__cacheBuster","__fields","constructor","cacheBuster","fields","format","key","clone","node","__format","__key","getType","importDOM","importJSON","serializedNode","version","data","$createServerBlockNode","setFormat","isInline","decorate","editor","config","exportDOM","element","document","createElement","text","createTextNode","getTextContent","append","exportJSON","type","getFields","getCacheBuster","getLatest","setFields","preventFormStateUpdate","writable","getWritable","id","default","toHexString","$isServerBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/BlocksNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\n\ntype BaseBlockFields<TBlockFields extends JsonObject = JsonObject> = {\n /** Block form data */\n blockName: string\n blockType: string\n} & TBlockFields\n\nexport type BlockFields<TBlockFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TBlockFields>\n\nexport type BlockFieldsOptionalID<TBlockFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TBlockFields>\n\nexport type SerializedBlockNode<TBlockFields extends JsonObject = JsonObject> = Omit<\n Spread<\n {\n fields: BlockFields<TBlockFields>\n type: 'block'\n },\n Omit<SerializedDecoratorBlockNode, 'type'>\n >,\n 'children'\n>\n\nexport class ServerBlockNode extends DecoratorBlockNode {\n __cacheBuster: number\n __fields: BlockFields\n\n constructor({\n cacheBuster,\n fields,\n format,\n key,\n }: {\n cacheBuster?: number\n fields: BlockFields\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__fields = fields\n this.__cacheBuster = cacheBuster || 0\n }\n\n static override clone(node: ServerBlockNode): ServerBlockNode {\n return new this({\n cacheBuster: node.__cacheBuster,\n fields: node.__fields,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'block'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static override importJSON(serializedNode: SerializedBlockNode): ServerBlockNode {\n if (serializedNode.version === 1) {\n // Convert (version 1 had the fields wrapped in another, unnecessary data property)\n serializedNode = {\n ...serializedNode,\n fields: {\n ...(serializedNode as any).fields.data,\n },\n version: 2,\n }\n }\n const node = $createServerBlockNode(serializedNode.fields)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedBlockNode {\n return {\n ...super.exportJSON(),\n type: 'block',\n fields: this.getFields(),\n version: 2,\n }\n }\n\n getCacheBuster(): number {\n return this.getLatest().__cacheBuster\n }\n\n getFields(): BlockFields {\n return this.getLatest().__fields\n }\n\n override getTextContent(): string {\n return `Block Field`\n }\n\n setFields(fields: BlockFields, preventFormStateUpdate?: boolean): void {\n const writable = this.getWritable()\n writable.__fields = fields\n if (!preventFormStateUpdate) {\n writable.__cacheBuster++\n }\n }\n}\n\nexport function $createServerBlockNode(fields: BlockFieldsOptionalID): ServerBlockNode {\n return new ServerBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n })\n}\n\nexport function $isServerBlockNode(\n node: LexicalNode | null | ServerBlockNode | undefined,\n): node is ServerBlockNode {\n return node instanceof ServerBlockNode\n}\n"],"mappings":"AAcA,SAASA,kBAAkB,QAAQ;AACnC,OAAOC,QAAA,MAAc;AA2BrB,OAAO,MAAMC,eAAA,SAAwBF,kBAAA;EACnCG,aAAA;EACAC,QAAA;EAEAC,YAAY;IACVC,WAAW;IACXC,MAAM;IACNC,MAAM;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5B,MAAA,EAAQ,IAAI,CAAC6B,SAAS;MACtBlB,OAAA,EAAS;IACX;EACF;EAEAmB,eAAA,EAAyB;IACvB,OAAO,IAAI,CAACC,SAAS,GAAGnC,aAAa;EACvC;EAEAiC,UAAA,EAAyB;IACvB,OAAO,IAAI,CAACE,SAAS,GAAGlC,QAAQ;EAClC;EAES4B,eAAA,EAAyB;IAChC,OAAO,aAAa;EACtB;EAEAO,UAAUhC,MAAmB,EAAEiC,sBAAgC,EAAQ;IACrE,MAAMC,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAASrC,QAAQ,GAAGG,MAAA;IACpB,IAAI,CAACiC,sBAAA,EAAwB;MAC3BC,QAAA,CAAStC,aAAa;IACxB;EACF;AACF;AAEA,OAAO,SAASiB,uBAAuBb,MAA6B;EAClE,OAAO,IAAIL,eAAA,CAAgB;IACzBK,MAAA,EAAQ;MACN,GAAGA,MAAM;MACToC,EAAA,EAAIpC,MAAA,EAAQoC,EAAA,IAAM,IAAI1C,QAAA,CAAS2C,OAAO,GAAGC,WAAW;IACtD;EACF;AACF;AAEA,OAAO,SAASC,mBACdnC,IAAsD;EAEtD,OAAOA,IAAA,YAAgBT,eAAA;AACzB","ignoreList":[]}
|
|
@@ -7,11 +7,10 @@ export type InlineBlockFields<TInlineBlockFields extends JsonObject = JsonObject
|
|
|
7
7
|
blockType: string;
|
|
8
8
|
id: string;
|
|
9
9
|
} & TInlineBlockFields;
|
|
10
|
-
export type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = Spread<{
|
|
11
|
-
children?: never;
|
|
10
|
+
export type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = Omit<Spread<{
|
|
12
11
|
fields: InlineBlockFields<TBlockFields>;
|
|
13
12
|
type: 'inlineBlock';
|
|
14
|
-
}, SerializedLexicalNode>;
|
|
13
|
+
}, Omit<SerializedLexicalNode, 'type'>>, 'children'>;
|
|
15
14
|
export declare class ServerInlineBlockNode extends DecoratorNode<null | React.ReactElement> {
|
|
16
15
|
__cacheBuster: number;
|
|
17
16
|
__fields: InlineBlockFields;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineBlocksNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,MAAM,iBAAiB,CAAC,kBAAkB,SAAS,UAAU,GAAG,UAAU,IAAI;IAClF,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;CACX,GAAG,kBAAkB,CAAA;AAEtB,MAAM,MAAM,yBAAyB,CAAC,YAAY,SAAS,UAAU,GAAG,UAAU,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"InlineBlocksNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MA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B,EAAE,sBAAsB,CAAC,EAAE,OAAO,GAAG,IAAI;IAQnE,SAAS,IAAI,OAAO;CAG9B;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,GACvC,qBAAqB,CAOvB;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,qBAAqB,GAAG,SAAS,GAC3D,IAAI,IAAI,qBAAqB,CAE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineBlocksNode.js","names":["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","$isServerInlineBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"sourcesContent":["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> =
|
|
1
|
+
{"version":3,"file":"InlineBlocksNode.js","names":["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","$isServerInlineBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"sourcesContent":["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> = Omit<\n Spread<\n {\n fields: InlineBlockFields<TBlockFields>\n type: 'inlineBlock'\n },\n Omit<SerializedLexicalNode, 'type'>\n >,\n 'children'\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"],"mappings":"AAcA,OAAOA,QAAA,MAAc;AACrB,SAASC,aAAa,QAAQ;AAkB9B,OAAO,MAAMC,qBAAA,SAA8BD,aAAA;EACzCE,aAAA;EACAC,QAAA;EAEAC,YAAY;IACVC,WAAW;IACXC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACA,GAAA;IACN,IAAI,CAACJ,QAAQ,GAAGG,MAAA;IAChB,IAAI,CAACJ,aAAa,GAAGG,WAAA,IAAe;EACtC;EAEA,OAAgBG,MAAMC,IAA2B,EAAyB;IACxE,OAAO,IAAI,IAAI,CAAC;MACdJ,WAAA,EAAaI,IAAA,CAAKP,aAAa;MAC/BI,MAAA,EAAQG,IAAA,CAAKN,QAAQ;MACrBI,GAAA,E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C,QAAQ,GAAGG,MAAA;IACpB,IAAI,CAACiC,sBAAA,EAAwB;MAC3BC,QAAA,CAAStC,aAAa;IACxB;EACF;EAESwC,UAAA,EAAqB;IAC5B,OAAO;EACT;AACF;AAEA,OAAO,SAAS3B,6BACdT,MAAwC;EAExC,OAAO,IAAIL,qBAAA,CAAsB;IAC/BK,MAAA,EAAQ;MACN,GAAGA,MAAM;MACTqC,EAAA,EAAIrC,MAAA,EAAQqC,EAAA,IAAM,IAAI5C,QAAA,CAAS6C,OAAO,GAAGC,WAAW;IACtD;EACF;AACF;AAEA,OAAO,SAASC,yBACdrC,IAA4D;EAE5D,OAAOA,IAAA,YAAgBR,qBAAA;AACzB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import type { SerializedHeadingNode as _SerializedHeadingNode, HeadingTagType }
|
|
|
2
2
|
import type { Spread } from 'lexical';
|
|
3
3
|
export type SerializedHeadingNode = Spread<{
|
|
4
4
|
type: 'heading';
|
|
5
|
-
}, _SerializedHeadingNode
|
|
5
|
+
}, Omit<_SerializedHeadingNode, 'type'>>;
|
|
6
6
|
export type HeadingFeatureProps = {
|
|
7
7
|
enabledHeadingSizes?: HeadingTagType[];
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/heading/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,IAAI,sBAAsB,EAC/C,cAAc,EACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAUrC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,IAAI,EAAE,SAAS,CAAA;CAChB,EACD,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/heading/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,IAAI,sBAAsB,EAC/C,cAAc,EACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAUrC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,IAAI,EAAE,SAAS,CAAA;CAChB,EACD,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CACrC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,cAAc,6HAsEzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HeadingNode","createServerFeature","convertLexicalNodesToHTML","createNode","MarkdownTransformer","i18n","HeadingFeature","feature","props","enabledHeadingSizes","sort","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","style","format","indent","filter","Boolean","join","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { MarkdownTransformer } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n _SerializedHeadingNode
|
|
1
|
+
{"version":3,"file":"index.js","names":["HeadingNode","createServerFeature","convertLexicalNodesToHTML","createNode","MarkdownTransformer","i18n","HeadingFeature","feature","props","enabledHeadingSizes","sort","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","style","format","indent","filter","Boolean","join","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { MarkdownTransformer } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n Omit<_SerializedHeadingNode, 'type'>\n>\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n enabledHeadingSizes.sort()\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#HeadingFeatureClient',\n clientFeatureProps: props,\n i18n,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n const style = [\n node.format ? `text-align: ${node.format};` : '',\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n node.indent > 0 ? `padding-inline-start: ${node.indent * 40}px;` : '',\n ]\n .filter(Boolean)\n .join(' ')\n return `<${node?.tag}${style ? ` style='${style}'` : ''}>${childrenText}</${node?.tag}>`\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"mappings":"AAMA,SAASA,WAAW,QAAQ;AAE5B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAarB,OAAO,MAAMC,cAAA,GAAiBL,mBAAA,CAI5B;EACAM,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;IAEA,MAAM;MAAEC,mBAAA,GAAsB,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM;IAAK,CAAE,GAAGD,KAAA;IAEvEC,mBAAA,CAAoBC,IAAI;IAExB,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoBJ,KAAA;MACpBH,IAAA;MACAQ,oBAAA,EAAsB,CAACT,mBAAA,CAAoBK,mBAAA,EAAqB;MAChEK,KAAA,EAAO,CACLX,UAAA,CAAW;QACTY,UAAA,EAAY;UACVC,IAAA,EAAM;YACJC,SAAA,EAAW,MAAAA,CAAO;cAChBF,UAAU;cACVG,YAAY;cACZC,KAAK;cACLC,KAAK;cACLC,IAAI;cACJC,cAAc;cACdC,MAAM;cACNC,GAAG;cACHC;YAAgB,CACjB;cACC,MAAMC,YAAA,GAAe,MAAMxB,yBAAA,CAA0B;gBACnDa,UAAA;gBACAG,YAAA;gBACAC,KAAA;gBACAC,KAAA;gBACAO,YAAA,EAAcN,IAAA,CAAKO,QAAQ;gBAC3BN,cAAA;gBACAC,MAAA,EAAQ;kBACN,GAAGF,IAAI;kBACPE;gBACF;gBACAC,GAAA;gBACAC;cACF;cACA,MAAMI,KAAA,GAAQ,CACZR,IAAA,CAAKS,MAAM,GAAG,eAAeT,IAAA,CAAKS,MAAM,GAAG,GAAG;cAC9C;cACA;cACA;cACA;cACAT,IAAA,CAAKU,MAAM,GAAG,IAAI,yBAAyBV,IAAA,CAAKU,MAAM,GAAG,OAAO,GAAG,GACpE,CACEC,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;cACR,OAAO,IAAIb,IAAA,EAAMc,GAAA,GAAMN,KAAA,GAAQ,WAAWA,KAAA,GAAQ,GAAG,MAAMH,YAAA,KAAiBL,IAAA,EAAMc,GAAA,GAAM;YAC1F;YACAC,SAAA,EAAW,CAACpC,WAAA,CAAYqC,OAAO;UACjC;QACF;QACAhB,IAAA,EAAMrB;MACR,GACD;MACDsC,2BAAA,EAA6B9B;IAC/B;EACF;EACA+B,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -4,10 +4,9 @@ import { DecoratorNode } from 'lexical';
|
|
|
4
4
|
/**
|
|
5
5
|
* Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.
|
|
6
6
|
*/
|
|
7
|
-
export type SerializedHorizontalRuleNode = Spread<{
|
|
8
|
-
children?: never;
|
|
7
|
+
export type SerializedHorizontalRuleNode = Omit<Spread<{
|
|
9
8
|
type: 'horizontalrule';
|
|
10
|
-
}, SerializedLexicalNode>;
|
|
9
|
+
}, Omit<SerializedLexicalNode, 'type'>>, 'children'>;
|
|
11
10
|
export declare const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void>;
|
|
12
11
|
/**
|
|
13
12
|
* This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAGnC,OAAO,EAAwC,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAGnC,OAAO,EAAwC,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,MAAM,CACJ;IACE,IAAI,EAAE,gBAAgB,CAAA;CACvB,EACD,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,CACpC,EACD,UAAU,CACX,CAAA;AAED,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAAC,IAAI,CAE/D,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC;WACpE,KAAK,CAAC,IAAI,EAAE,wBAAwB,GAAG,wBAAwB;WAI/D,OAAO,IAAI,MAAM;IAIjC;;;;OAIG;WACa,SAAS,IAAI,gBAAgB,GAAG,IAAI;IASpD;;OAEG;WACa,UAAU,CACxB,cAAc,EAAE,4BAA4B,GAC3C,wBAAwB;IAI3B;;OAEG;IACM,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;IAM5C,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY;IAI9C;;;;OAIG;IACM,SAAS,IAAI,eAAe;IAGrC;;OAEG;IACM,UAAU,IAAI,qBAAqB;IAOnC,cAAc,IAAI,MAAM;IAIxB,QAAQ,IAAI,KAAK;IAIjB,SAAS,IAAI,OAAO;CAG9B;AAMD,wBAAgB,+BAA+B,IAAI,wBAAwB,CAE1E;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,wBAAwB,CAElC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalRuleNode.js","names":["addClassNamesToElement","$applyNodeReplacement","createCommand","DecoratorNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRuleServerNode","clone","node","__key","getType","importDOM","hr","conversion","$convertHorizontalRuleElement","priority","importJSON","serializedNode","$createHorizontalRuleServerNode","createDOM","config","element","document","createElement","theme","decorate","exportDOM","exportJSON","type","version","getTextContent","isInline","updateDOM","$isHorizontalRuleServerNode"],"sources":["../../../../../src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\nimport type * as React from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, createCommand, DecoratorNode } from 'lexical'\n\n/**\n * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.\n */\nexport type SerializedHorizontalRuleNode =
|
|
1
|
+
{"version":3,"file":"HorizontalRuleNode.js","names":["addClassNamesToElement","$applyNodeReplacement","createCommand","DecoratorNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRuleServerNode","clone","node","__key","getType","importDOM","hr","conversion","$convertHorizontalRuleElement","priority","importJSON","serializedNode","$createHorizontalRuleServerNode","createDOM","config","element","document","createElement","theme","decorate","exportDOM","exportJSON","type","version","getTextContent","isInline","updateDOM","$isHorizontalRuleServerNode"],"sources":["../../../../../src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\nimport type * as React from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, createCommand, DecoratorNode } from 'lexical'\n\n/**\n * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.\n */\nexport type SerializedHorizontalRuleNode = Omit<\n Spread<\n {\n type: 'horizontalrule'\n },\n Omit<SerializedLexicalNode, 'type'>\n >,\n 'children'\n>\n\nexport const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void> = createCommand(\n 'INSERT_HORIZONTAL_RULE_COMMAND',\n)\n\n/**\n * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.\n *\n * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.\n *\n * If we used DecoratorBlockNode instead, we would only need a decorate method\n */\nexport class HorizontalRuleServerNode extends DecoratorNode<null | React.ReactElement> {\n static override clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode {\n return new this(node.__key)\n }\n\n static override getType(): string {\n return 'horizontalrule'\n }\n\n /**\n * Defines what happens if you copy an hr element from another page and paste it into the lexical editor\n *\n * This also determines the behavior of lexical's internal HTML -> Lexical converter\n */\n static override importDOM(): DOMConversionMap | null {\n return {\n hr: () => ({\n conversion: $convertHorizontalRuleElement,\n priority: 0,\n }),\n }\n }\n\n /**\n * The data for this node is stored serialized as JSON. This is the \"load function\" of that node: it takes the saved data and converts it into a node.\n */\n static override importJSON(\n serializedNode: SerializedHorizontalRuleNode,\n ): HorizontalRuleServerNode {\n return $createHorizontalRuleServerNode()\n }\n\n /**\n * Determines how the hr element is rendered in the lexical editor. This is only the \"initial\" / \"outer\" HTML element.\n */\n override createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('hr')\n addClassNamesToElement(element, config.theme.hr)\n return element\n }\n\n override decorate(): null | React.ReactElement {\n return null\n }\n\n /**\n * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.\n *\n * This also determines the behavior of lexical's internal Lexical -> HTML converter\n */\n override exportDOM(): DOMExportOutput {\n return { element: document.createElement('hr') }\n }\n /**\n * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.\n */\n override exportJSON(): SerializedLexicalNode {\n return {\n type: 'horizontalrule',\n version: 1,\n }\n }\n\n override getTextContent(): string {\n return '\\n'\n }\n\n override isInline(): false {\n return false\n }\n\n override updateDOM(): boolean {\n return false\n }\n}\n\nfunction $convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleServerNode() }\n}\n\nexport function $createHorizontalRuleServerNode(): HorizontalRuleServerNode {\n return $applyNodeReplacement(new HorizontalRuleServerNode())\n}\n\nexport function $isHorizontalRuleServerNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleServerNode {\n return node instanceof HorizontalRuleServerNode\n}\n"],"mappings":"AAYA,SAASA,sBAAsB,QAAQ;AACvC,SAASC,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AAepE,OAAO,MAAMC,8BAAA,GAAuDF,aAAA,CAClE;AAGF;;;;;;;AAOA,OAAO,MAAMG,wBAAA,SAAiCF,aAAA;EAC5C,OAAgBG,MAAMC,IAA8B,EAA4B;IAC9E,OAAO,IAAI,IAAI,CAACA,IAAA,CAAKC,KAAK;EAC5B;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO;EACT;EAEA;;;;;EAKA,OAAgBC,UAAA,EAAqC;IACnD,OAAO;MACLC,EAAA,EAAIA,CAAA,MAAO;QACTC,UAAA,EAAYC,6BAAA;QACZC,QAAA,EAAU;MACZ;IACF;EACF;EAEA;;;EAGA,OAAgBC,WACdC,cAA4C,EAClB;IAC1B,OAAOC,+BAAA;EACT;EAEA;;;EAGAC,SAASA,CAAUC,MAAoB,EAAe;IACpD,MAAMC,OAAA,GAAUC,QAAA,CAASC,aAAa,CAAC;IACvCtB,sBAAA,CAAuBoB,OAAA,EAASD,MAAA,CAAOI,KAAK,CAACZ,EAAE;IAC/C,OAAOS,OAAA;EACT;EAESI,SAAA,EAAsC;IAC7C,OAAO;EACT;EAEA;;;;;EAKAC,SAASA,CAAA,EAA6B;IACpC,OAAO;MAAEL,OAAA,EAASC,QAAA,CAASC,aAAa,CAAC;IAAM;EACjD;EACA;;;EAGAI,UAASA,CAAA,EAAoC;IAC3C,OAAO;MACLC,IAAA,EAAM;MACNC,OAAA,EAAS;IACX;EACF;EAESC,eAAA,EAAyB;IAChC,OAAO;EACT;EAESC,SAAA,EAAkB;IACzB,OAAO;EACT;EAESC,UAAA,EAAqB;IAC5B,OAAO;EACT;AACF;AAEA,SAASlB,8BAAA;EACP,OAAO;IAAEN,IAAA,EAAMU,+BAAA;EAAkC;AACnD;AAEA,OAAO,SAASA,gCAAA;EACd,OAAOhB,qBAAA,CAAsB,IAAII,wBAAA;AACnC;AAEA,OAAO,SAAS2B,4BACdzB,IAAoC;EAEpC,OAAOA,IAAA,YAAgBF,wBAAA;AACzB","ignoreList":[]}
|
|
@@ -8,6 +8,6 @@ type Props = {
|
|
|
8
8
|
format?: ElementFormatType;
|
|
9
9
|
nodeKey?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const RelationshipComponent:
|
|
11
|
+
export declare const RelationshipComponent: React.FC<Props>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=RelationshipComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAOhD,OAAO,KAAoD,MAAM,OAAO,CAAA;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAG9E,OAAO,cAAc,CAAA;AASrB,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;
|
|
1
|
+
{"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAOhD,OAAO,KAAoD,MAAM,OAAO,CAAA;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAG9E,OAAO,cAAc,CAAA;AASrB,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA0GjD,CAAA"}
|
|
@@ -13,7 +13,7 @@ const baseClass = 'lexical-relationship';
|
|
|
13
13
|
const initialParams = {
|
|
14
14
|
depth: 0
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
export const RelationshipComponent = props => {
|
|
17
17
|
const {
|
|
18
18
|
data: {
|
|
19
19
|
relationTo,
|
|
@@ -126,9 +126,4 @@ const Component = props => {
|
|
|
126
126
|
})]
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
|
-
export const RelationshipComponent = props => {
|
|
130
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
131
|
-
...props
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
129
|
//# sourceMappingURL=RelationshipComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipComponent.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","useConfig","usePayloadAPI","useTranslation","$getNodeByKey","React","useCallback","useReducer","useRef","useState","useLexicalDocumentDrawer","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","baseClass","initialParams","depth","
|
|
1
|
+
{"version":3,"file":"RelationshipComponent.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","useConfig","usePayloadAPI","useTranslation","$getNodeByKey","React","useCallback","useReducer","useRef","useState","useLexicalDocumentDrawer","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","baseClass","initialParams","depth","RelationshipComponent","props","data","relationTo","value","nodeKey","Error","relationshipElemRef","editor","isEditable","config","routes","api","serverURL","getEntityConfig","relatedCollection","collectionSlug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","slug","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","removeRelationship","update","remove","updateRelationship","_jsxs","className","contentEditable","ref","_jsx","label","labels","singular","admin","useAsTitle","buttonStyle","disabled","el","icon","onClick","dispatchCommand","replace","round","tooltip","e","preventDefault","onSave"],"sources":["../../../../../src/features/relationship/client/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, useConfig, usePayloadAPI, useTranslation } from '@payloadcms/ui'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport './index.scss'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nexport const RelationshipComponent: React.FC<Props> = (props) => {\n const {\n data: { relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Relationship value should be a string or number. The Lexical Relationship component should not receive the populated value object.',\n )\n }\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const [relatedCollection] = useState(() => getEntityConfig({ collectionSlug: relationTo }))\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey!)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(() => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDocumentDrawer()\n dispatchCacheBust()\n }, [cacheBust, setParams, closeDocumentDrawer])\n\n return (\n <div className={baseClass} contentEditable={false} ref={relationshipElemRef}>\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: relatedCollection.labels?.singular\n ? getTranslation(relatedCollection.labels?.singular, i18n)\n : relatedCollection.slug,\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : value}\n </p>\n </DocumentDrawerToggler>\n </div>\n {isEditable && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n if (nodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {!!value && <DocumentDrawer onSave={updateRelationship} />}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,EAAEC,SAAS,EAAEC,aAAa,EAAEC,cAAc,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAC9B,OAAOC,KAAA,IAASC,WAAW,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAIjE,SAASC,wBAAwB,QAAQ;AAEzC,SAASC,uCAAuC,QAAQ;AAExD,MAAMC,SAAA,GAAY;AAElB,MAAMC,aAAA,GAAgB;EACpBC,KAAA,EAAO;AACT;AASA,OAAO,MAAMC,qBAAA,GAA0CC,KAAA;EACrD,MAAM;IACJC,IAAA,EAAM;MAAEC,UAAU;MAAEC;IAAK,CAAE;IAC3BC;EAAO,CACR,GAAGJ,KAAA;EAEJ,IAAI,OAAOG,KAAA,KAAU,UAAU;IAC7B,MAAM,IAAIE,KAAA,CACR;EAEJ;EAEA,MAAMC,mBAAA,GAAsBd,MAAA,CAA8B;EAE1D,MAAM,CAACe,MAA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ACF;QACAqB,KAAK;QACLC,OAAA,EAAShC,CAAA,CAAE;;QAKhB,CAAC,CAACd,KAAA,iBAASgC,IAAA,CAACX,cAAA;MAAe4B,MAAA,EAAQtB;;;AAG1C","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { CollectionSlug } from 'payload';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
type Props = {
|
|
3
|
-
enabledCollectionSlugs:
|
|
4
|
+
enabledCollectionSlugs: CollectionSlug[];
|
|
4
5
|
};
|
|
5
|
-
export declare const RelationshipDrawer: (
|
|
6
|
+
export declare const RelationshipDrawer: ({ enabledCollectionSlugs }: Props) => React.ReactNode;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAA2C,MAAM,OAAO,CAAA;AAiC/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,CAAA;AA6DD,eAAO,MAAM,kBAAkB,+BAAgC,KAAK,KAAG,KAAK,CAAC,SAM5E,CAAA"}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
6
|
+
import { toast } from '@payloadcms/ui';
|
|
6
7
|
import { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical';
|
|
7
8
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
9
|
import { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js';
|
|
9
10
|
import { $createRelationshipNode } from '../nodes/RelationshipNode.js';
|
|
10
11
|
import { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js';
|
|
11
|
-
import { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js';
|
|
12
12
|
import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js';
|
|
13
13
|
const insertRelationship = ({
|
|
14
14
|
editor,
|
|
@@ -34,64 +34,55 @@ const insertRelationship = ({
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
const RelationshipDrawerComponent = t0 => {
|
|
37
|
-
const $ = _c(
|
|
37
|
+
const $ = _c(14);
|
|
38
38
|
const {
|
|
39
39
|
enabledCollectionSlugs
|
|
40
40
|
} = t0;
|
|
41
41
|
const [editor] = useLexicalComposerContext();
|
|
42
|
-
let t1;
|
|
43
|
-
if ($[0] !== enabledCollectionSlugs?.[0]) {
|
|
44
|
-
t1 = () => enabledCollectionSlugs?.[0];
|
|
45
|
-
$[0] = enabledCollectionSlugs?.[0];
|
|
46
|
-
$[1] = t1;
|
|
47
|
-
} else {
|
|
48
|
-
t1 = $[1];
|
|
49
|
-
}
|
|
50
|
-
const [selectedCollectionSlug] = useState(t1);
|
|
51
42
|
const [replaceNodeKey, setReplaceNodeKey] = useState(null);
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
if ($[
|
|
55
|
-
|
|
56
|
-
collectionSlugs:
|
|
57
|
-
selectedCollection:
|
|
43
|
+
const t1 = enabledCollectionSlugs?.[0];
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[0] !== enabledCollectionSlugs || $[1] !== t1) {
|
|
46
|
+
t2 = {
|
|
47
|
+
collectionSlugs: enabledCollectionSlugs,
|
|
48
|
+
selectedCollection: t1
|
|
58
49
|
};
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
50
|
+
$[0] = enabledCollectionSlugs;
|
|
51
|
+
$[1] = t1;
|
|
52
|
+
$[2] = t2;
|
|
62
53
|
} else {
|
|
63
|
-
|
|
54
|
+
t2 = $[2];
|
|
64
55
|
}
|
|
65
56
|
const {
|
|
66
57
|
closeListDrawer,
|
|
67
58
|
ListDrawer,
|
|
68
59
|
openListDrawer
|
|
69
|
-
} = useLexicalListDrawer(
|
|
60
|
+
} = useLexicalListDrawer(t2);
|
|
61
|
+
let t3;
|
|
70
62
|
let t4;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
t4 = () => editor.registerCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, payload => {
|
|
63
|
+
if ($[3] !== editor || $[4] !== openListDrawer) {
|
|
64
|
+
t3 = () => editor.registerCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, payload => {
|
|
74
65
|
setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null);
|
|
75
66
|
openListDrawer();
|
|
76
67
|
return true;
|
|
77
68
|
}, COMMAND_PRIORITY_EDITOR);
|
|
78
|
-
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
69
|
+
t4 = [editor, openListDrawer];
|
|
70
|
+
$[3] = editor;
|
|
71
|
+
$[4] = openListDrawer;
|
|
72
|
+
$[5] = t3;
|
|
73
|
+
$[6] = t4;
|
|
83
74
|
} else {
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
t3 = $[5];
|
|
76
|
+
t4 = $[6];
|
|
86
77
|
}
|
|
87
|
-
useEffect(
|
|
88
|
-
let
|
|
89
|
-
if ($[
|
|
90
|
-
|
|
78
|
+
useEffect(t3, t4);
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[7] !== closeListDrawer || $[8] !== editor || $[9] !== replaceNodeKey) {
|
|
81
|
+
t5 = t6 => {
|
|
91
82
|
const {
|
|
92
83
|
collectionSlug,
|
|
93
84
|
doc
|
|
94
|
-
} =
|
|
85
|
+
} = t6;
|
|
95
86
|
insertRelationship({
|
|
96
87
|
editor,
|
|
97
88
|
relationTo: collectionSlug,
|
|
@@ -100,35 +91,57 @@ const RelationshipDrawerComponent = t0 => {
|
|
|
100
91
|
});
|
|
101
92
|
closeListDrawer();
|
|
102
93
|
};
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
94
|
+
$[7] = closeListDrawer;
|
|
95
|
+
$[8] = editor;
|
|
96
|
+
$[9] = replaceNodeKey;
|
|
97
|
+
$[10] = t5;
|
|
107
98
|
} else {
|
|
108
|
-
|
|
99
|
+
t5 = $[10];
|
|
109
100
|
}
|
|
110
|
-
const onSelect =
|
|
111
|
-
let
|
|
112
|
-
if ($[
|
|
113
|
-
|
|
101
|
+
const onSelect = t5;
|
|
102
|
+
let t6;
|
|
103
|
+
if ($[11] !== ListDrawer || $[12] !== onSelect) {
|
|
104
|
+
t6 = _jsx(ListDrawer, {
|
|
114
105
|
onSelect
|
|
115
106
|
});
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
107
|
+
$[11] = ListDrawer;
|
|
108
|
+
$[12] = onSelect;
|
|
109
|
+
$[13] = t6;
|
|
119
110
|
} else {
|
|
120
|
-
|
|
111
|
+
t6 = $[13];
|
|
121
112
|
}
|
|
122
|
-
return
|
|
113
|
+
return t6;
|
|
123
114
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
const RelationshipDrawerComponentFallback = () => {
|
|
116
|
+
const $ = _c(3);
|
|
117
|
+
const [editor] = useLexicalComposerContext();
|
|
118
|
+
let t0;
|
|
119
|
+
let t1;
|
|
120
|
+
if ($[0] !== editor) {
|
|
121
|
+
t0 = () => editor.registerCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, _temp, COMMAND_PRIORITY_EDITOR);
|
|
122
|
+
t1 = [editor];
|
|
123
|
+
$[0] = editor;
|
|
124
|
+
$[1] = t0;
|
|
125
|
+
$[2] = t1;
|
|
126
|
+
} else {
|
|
127
|
+
t0 = $[1];
|
|
128
|
+
t1 = $[2];
|
|
129
|
+
}
|
|
130
|
+
useEffect(t0, t1);
|
|
131
|
+
return null;
|
|
132
|
+
};
|
|
133
|
+
export const RelationshipDrawer = ({
|
|
134
|
+
enabledCollectionSlugs
|
|
135
|
+
}) => {
|
|
136
|
+
if (!enabledCollectionSlugs?.length) {
|
|
137
|
+
return /*#__PURE__*/_jsx(RelationshipDrawerComponentFallback, {});
|
|
138
|
+
}
|
|
139
|
+
return /*#__PURE__*/_jsx(RelationshipDrawerComponent, {
|
|
140
|
+
enabledCollectionSlugs: enabledCollectionSlugs
|
|
132
141
|
});
|
|
133
142
|
};
|
|
143
|
+
function _temp() {
|
|
144
|
+
toast.error("No relationship collections enabled");
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
134
147
|
//# sourceMappingURL=index.js.map
|