@payloadcms/richtext-lexical 3.0.0-beta.1 → 3.0.0-beta.10
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/field/features/converters/html/field/index.d.ts +8 -2
- package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
- package/dist/field/features/converters/html/field/index.js +6 -3
- package/dist/field/features/converters/html/field/index.js.map +1 -1
- package/dist/field/features/horizontalrule/component/index.d.ts +10 -0
- package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/component/index.js +64 -0
- package/dist/field/features/horizontalrule/component/index.js.map +1 -0
- package/dist/field/features/horizontalrule/feature.client.d.ts +3 -0
- package/dist/field/features/horizontalrule/feature.client.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/feature.client.js +53 -0
- package/dist/field/features/horizontalrule/feature.client.js.map +1 -0
- package/dist/field/features/horizontalrule/feature.server.d.ts +3 -0
- package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/feature.server.js +36 -0
- package/dist/field/features/horizontalrule/feature.server.js.map +1 -0
- package/dist/field/features/horizontalrule/markdownTransformer.d.ts +3 -0
- package/dist/field/features/horizontalrule/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/markdownTransformer.js +23 -0
- package/dist/field/features/horizontalrule/markdownTransformer.js.map +1 -0
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +55 -0
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +89 -0
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -0
- package/dist/field/features/horizontalrule/plugin/index.d.ts +6 -0
- package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/plugin/index.js +34 -0
- package/dist/field/features/horizontalrule/plugin/index.js.map +1 -0
- package/dist/field/features/horizontalrule/plugin/index.scss +20 -0
- package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
- package/dist/field/features/lists/htmlConverter.js +12 -4
- package/dist/field/features/lists/htmlConverter.js.map +1 -1
- package/dist/field/features/upload/validate.d.ts.map +1 -1
- package/dist/field/features/upload/validate.js +4 -6
- package/dist/field/features/upload/validate.js.map +1 -1
- package/dist/field/lexical/config/server/default.d.ts.map +1 -1
- package/dist/field/lexical/config/server/default.js +3 -1
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +11 -6
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +8 -3
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +17 -7
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.scss +4 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.js +19 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
- package/dist/generateComponentMap.d.ts.map +1 -1
- package/dist/generateComponentMap.js +4 -2
- package/dist/generateComponentMap.js.map +1 -1
- package/dist/scss/app.scss +2 -3
- package/dist/scss/vars.scss +0 -7
- package/package.json +14 -14
- package/components.d.ts +0 -6
- package/components.js +0 -7
- package/dist/scss/fonts.scss +0 -75
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Field } from 'payload/types';
|
|
2
2
|
import type { SanitizedServerEditorConfig } from '../../../../lexical/config/types.js';
|
|
3
3
|
import type { HTMLConverter } from '../converter/types.js';
|
|
4
4
|
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the lexicalHTML field should be hidden in the admin panel
|
|
7
|
+
*
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
hidden?: boolean;
|
|
5
11
|
name: string;
|
|
6
12
|
};
|
|
7
13
|
/**
|
|
@@ -18,6 +24,6 @@ export declare const lexicalHTML: (
|
|
|
18
24
|
*
|
|
19
25
|
* This has to be a SIBLING field of this lexicalHTML field - otherwise, it won't be able to find the lexical field.
|
|
20
26
|
**/
|
|
21
|
-
lexicalFieldName: string, props: Props) =>
|
|
27
|
+
lexicalFieldName: string, props: Props) => Field;
|
|
22
28
|
export {};
|
|
23
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAiB,MAAM,eAAe,CAAA;AAGzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAM1D,KAAK,KAAK,GAAG;IACX;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,sBAEnC;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,oBAqBA,CAAA;AAED,eAAO,MAAM,WAAW,EAAE;AACxB;;;;IAII;AACJ,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,KAAK,KACT,KAyHJ,CAAA"}
|
|
@@ -17,12 +17,15 @@ import { convertLexicalToHTML } from '../converter/index.js';
|
|
|
17
17
|
return finalConverters;
|
|
18
18
|
};
|
|
19
19
|
export const lexicalHTML = (lexicalFieldName, props)=>{
|
|
20
|
-
const { name = 'lexicalHTML' } = props;
|
|
20
|
+
const { name = 'lexicalHTML', hidden = true } = props;
|
|
21
21
|
return {
|
|
22
22
|
name,
|
|
23
|
-
type: '
|
|
23
|
+
type: 'code',
|
|
24
24
|
admin: {
|
|
25
|
-
|
|
25
|
+
editorOptions: {
|
|
26
|
+
language: 'html'
|
|
27
|
+
},
|
|
28
|
+
hidden
|
|
26
29
|
},
|
|
27
30
|
hooks: {
|
|
28
31
|
afterRead: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field, RichTextField
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field, RichTextField } from 'payload/types'\n\nimport type { AdapterProps, LexicalRichTextAdapter } from '../../../../../types.js'\nimport type { SanitizedServerEditorConfig } from '../../../../lexical/config/types.js'\nimport type { HTMLConverter } from '../converter/types.js'\nimport type { HTMLConverterFeatureProps } from '../feature.server.js'\n\nimport { defaultHTMLConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToHTML } from '../converter/index.js'\n\ntype Props = {\n /**\n * Whether the lexicalHTML field should be hidden in the admin panel\n *\n * @default true\n */\n hidden?: boolean\n name: string\n}\n\n/**\n * Combines the default HTML converters with HTML converters found in the features, and with HTML converters configured in the htmlConverter feature.\n *\n * @param editorConfig\n */\nexport const consolidateHTMLConverters = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const htmlConverterFeature = editorConfig.resolvedFeatureMap.get('htmlConverter')\n const htmlConverterFeatureProps: HTMLConverterFeatureProps =\n htmlConverterFeature?.serverFeatureProps\n\n const defaultConvertersWithConvertersFromFeatures = defaultHTMLConverters\n\n for (const converter of editorConfig.features.converters.html) {\n defaultConvertersWithConvertersFromFeatures.push(converter)\n }\n\n const finalConverters =\n htmlConverterFeatureProps?.converters &&\n typeof htmlConverterFeatureProps?.converters === 'function'\n ? htmlConverterFeatureProps.converters({\n defaultConverters: defaultConvertersWithConvertersFromFeatures,\n })\n : (htmlConverterFeatureProps?.converters as HTMLConverter[]) ||\n defaultConvertersWithConvertersFromFeatures\n\n return finalConverters\n}\n\nexport const lexicalHTML: (\n /**\n * A string which matches the lexical field name you want to convert to HTML.\n *\n * This has to be a SIBLING field of this lexicalHTML field - otherwise, it won't be able to find the lexical field.\n **/\n lexicalFieldName: string,\n props: Props,\n) => Field = (lexicalFieldName, props) => {\n const { name = 'lexicalHTML', hidden = true } = props\n return {\n name,\n type: 'code',\n admin: {\n editorOptions: {\n language: 'html',\n },\n hidden,\n },\n hooks: {\n afterRead: [\n async ({ collection, field, global, req, siblingData }) => {\n const fields = collection ? collection.fields : global.fields\n\n // find the path of this field, as well as its sibling fields, by looking for this `field` in fields and traversing it recursively\n function findFieldPathAndSiblingFields(\n fields: Field[],\n path: string[],\n ): {\n path: string[]\n siblingFields: Field[]\n } {\n for (const curField of fields) {\n if (curField === field) {\n return {\n path: [...path, curField.name],\n siblingFields: fields,\n }\n }\n\n if ('fields' in curField) {\n const result = findFieldPathAndSiblingFields(\n curField.fields,\n 'name' in curField ? [...path, curField.name] : [...path],\n )\n if (result) {\n return result\n }\n } else if ('tabs' in curField) {\n for (const tab of curField.tabs) {\n const result = findFieldPathAndSiblingFields(\n tab.fields,\n 'name' in tab ? [...path, tab.name] : [...path],\n )\n if (result) {\n return result\n }\n }\n } else if ('blocks' in curField) {\n for (const block of curField.blocks) {\n if (block?.fields?.length) {\n const result = findFieldPathAndSiblingFields(block.fields, [\n ...path,\n curField.name,\n block.slug,\n ])\n if (result) {\n return result\n }\n }\n }\n }\n }\n\n return null\n }\n\n const foundSiblingFields = findFieldPathAndSiblingFields(fields, [])\n\n if (!foundSiblingFields)\n throw new Error(\n `Could not find sibling fields of current lexicalHTML field with name ${field?.name}`,\n )\n\n const { siblingFields } = foundSiblingFields\n const lexicalField: RichTextField<SerializedEditorState, AdapterProps> =\n siblingFields.find(\n (field) => 'name' in field && field.name === lexicalFieldName,\n ) as RichTextField<SerializedEditorState, AdapterProps>\n\n const lexicalFieldData: SerializedEditorState = siblingData[lexicalFieldName]\n\n if (!lexicalFieldData) {\n return ''\n }\n\n if (!lexicalField) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the referenced lexical field was not found',\n )\n }\n\n const config = (lexicalField?.editor as LexicalRichTextAdapter)?.editorConfig\n\n if (!config) {\n throw new Error(\n 'The linked lexical field does not have an editorConfig. This is needed for the lexicalHTML field.',\n )\n }\n\n if (!config?.resolvedFeatureMap?.has('htmlConverter')) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the linked lexical field does not have a HTMLConverterFeature',\n )\n }\n\n const finalConverters = consolidateHTMLConverters({\n editorConfig: config,\n })\n\n return await convertLexicalToHTML({\n converters: finalConverters,\n data: lexicalFieldData,\n payload: req.payload,\n })\n },\n ],\n },\n }\n}\n"],"names":["defaultHTMLConverters","convertLexicalToHTML","consolidateHTMLConverters","editorConfig","htmlConverterFeature","resolvedFeatureMap","get","htmlConverterFeatureProps","serverFeatureProps","defaultConvertersWithConvertersFromFeatures","converter","features","converters","html","push","finalConverters","defaultConverters","lexicalHTML","lexicalFieldName","props","name","hidden","type","admin","editorOptions","language","hooks","afterRead","collection","field","global","req","siblingData","fields","findFieldPathAndSiblingFields","path","curField","siblingFields","result","tab","tabs","block","blocks","length","slug","foundSiblingFields","Error","lexicalField","find","lexicalFieldData","config","editor","has","data","payload"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NodeKey } from 'lexical';
|
|
2
|
+
/**
|
|
3
|
+
* React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.
|
|
4
|
+
*
|
|
5
|
+
* @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state
|
|
6
|
+
*/
|
|
7
|
+
export declare function HorizontalRuleComponent({ nodeKey }: {
|
|
8
|
+
nodeKey: NodeKey;
|
|
9
|
+
}): any;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAqBtC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,OAmDxE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
3
|
+
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js';
|
|
4
|
+
import lexicalUtilsImport from '@lexical/utils';
|
|
5
|
+
const { mergeRegister } = lexicalUtilsImport;
|
|
6
|
+
import lexicalImport from 'lexical';
|
|
7
|
+
const { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } = lexicalImport;
|
|
8
|
+
import { useCallback, useEffect } from 'react';
|
|
9
|
+
import { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js';
|
|
10
|
+
/**
|
|
11
|
+
* React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.
|
|
12
|
+
*
|
|
13
|
+
* @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state
|
|
14
|
+
*/ export function HorizontalRuleComponent({ nodeKey }) {
|
|
15
|
+
const [editor] = useLexicalComposerContext();
|
|
16
|
+
const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
|
|
17
|
+
const onDelete = useCallback((event)=>{
|
|
18
|
+
if (isSelected && $isNodeSelection($getSelection())) {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
const node = $getNodeByKey(nodeKey);
|
|
21
|
+
if ($isHorizontalRuleNode(node)) {
|
|
22
|
+
node.remove();
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}, [
|
|
28
|
+
isSelected,
|
|
29
|
+
nodeKey
|
|
30
|
+
]);
|
|
31
|
+
useEffect(()=>{
|
|
32
|
+
return mergeRegister(editor.registerCommand(CLICK_COMMAND, (event)=>{
|
|
33
|
+
const hrElem = editor.getElementByKey(nodeKey);
|
|
34
|
+
if (event.target === hrElem) {
|
|
35
|
+
if (!event.shiftKey) {
|
|
36
|
+
clearSelection();
|
|
37
|
+
}
|
|
38
|
+
setSelected(!isSelected);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW));
|
|
43
|
+
}, [
|
|
44
|
+
clearSelection,
|
|
45
|
+
editor,
|
|
46
|
+
isSelected,
|
|
47
|
+
nodeKey,
|
|
48
|
+
onDelete,
|
|
49
|
+
setSelected
|
|
50
|
+
]);
|
|
51
|
+
useEffect(()=>{
|
|
52
|
+
const hrElem = editor.getElementByKey(nodeKey);
|
|
53
|
+
if (hrElem !== null) {
|
|
54
|
+
hrElem.className = isSelected ? 'selected' : '';
|
|
55
|
+
}
|
|
56
|
+
}, [
|
|
57
|
+
editor,
|
|
58
|
+
isSelected,
|
|
59
|
+
nodeKey
|
|
60
|
+
]);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalrule/component/index.tsx"],"sourcesContent":["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport lexicalUtilsImport from '@lexical/utils'\nconst { mergeRegister } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} = lexicalImport\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n hrElem.className = isSelected ? 'selected' : ''\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","lexicalUtilsImport","mergeRegister","lexicalImport","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","useCallback","useEffect","$isHorizontalRuleNode","HorizontalRuleComponent","nodeKey","editor","isSelected","setSelected","clearSelection","onDelete","event","preventDefault","node","remove","registerCommand","hrElem","getElementByKey","target","shiftKey","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,OAAOC,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAE1B,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EACJC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EACnB,GAAGP;AACJ,SAASQ,WAAW,EAAEC,SAAS,QAAQ,QAAO;AAE9C,SAASC,qBAAqB,QAAQ,iCAAgC;AAEtE;;;;CAIC,GACD,OAAO,SAASC,wBAAwB,EAAEC,OAAO,EAAwB;IACvE,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,CAACkB,YAAYC,aAAaC,eAAe,GAAGnB,wBAAwBe;IAE1E,MAAMK,WAAWT,YACf,CAACU;QACC,IAAIJ,cAAcX,iBAAiBD,kBAAkB;YACnDgB,MAAMC,cAAc;YACpB,MAAMC,OAAOnB,cAAcW;YAC3B,IAAIF,sBAAsBU,OAAO;gBAC/BA,KAAKC,MAAM;gBACX,OAAO;YACT;QACF;QACA,OAAO;IACT,GACA;QAACP;QAAYF;KAAQ;IAGvBH,UAAU;QACR,OAAOV,cACLc,OAAOS,eAAe,CACpBlB,eACA,CAACc;YACC,MAAMK,SAASV,OAAOW,eAAe,CAACZ;YAEtC,IAAIM,MAAMO,MAAM,KAAKF,QAAQ;gBAC3B,IAAI,CAACL,MAAMQ,QAAQ,EAAE;oBACnBV;gBACF;gBACAD,YAAY,CAACD;gBACb,OAAO;YACT;YAEA,OAAO;QACT,GACAT,uBAEFQ,OAAOS,eAAe,CAACf,oBAAoBU,UAAUZ,uBACrDQ,OAAOS,eAAe,CAAChB,uBAAuBW,UAAUZ;IAE5D,GAAG;QAACW;QAAgBH;QAAQC;QAAYF;QAASK;QAAUF;KAAY;IAEvEN,UAAU;QACR,MAAMc,SAASV,OAAOW,eAAe,CAACZ;QACtC,IAAIW,WAAW,MAAM;YACnBA,OAAOI,SAAS,GAAGb,aAAa,aAAa;QAC/C;IACF,GAAG;QAACD;QAAQC;QAAYF;KAAQ;IAEhC,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/feature.client.tsx"],"names":[],"mappings":";AA8CA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
3
|
+
import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
|
|
4
|
+
import { createClientComponent } from '../createClientComponent.js';
|
|
5
|
+
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
6
|
+
import { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
|
|
7
|
+
import { HorizontalRulePlugin } from './plugin/index.js';
|
|
8
|
+
const HorizontalRuleFeatureClient = (props)=>{
|
|
9
|
+
return {
|
|
10
|
+
clientFeatureProps: props,
|
|
11
|
+
feature: ()=>({
|
|
12
|
+
clientFeatureProps: props,
|
|
13
|
+
markdownTransformers: [
|
|
14
|
+
MarkdownTransformer
|
|
15
|
+
],
|
|
16
|
+
nodes: [
|
|
17
|
+
HorizontalRuleNode
|
|
18
|
+
],
|
|
19
|
+
plugins: [
|
|
20
|
+
{
|
|
21
|
+
Component: HorizontalRulePlugin,
|
|
22
|
+
position: 'normal'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
slashMenu: {
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Basic',
|
|
29
|
+
key: 'basic',
|
|
30
|
+
options: [
|
|
31
|
+
new SlashMenuOption(`horizontalrule`, {
|
|
32
|
+
Icon: HorizontalRuleIcon,
|
|
33
|
+
displayName: `Horizontal Rule`,
|
|
34
|
+
keywords: [
|
|
35
|
+
'hr',
|
|
36
|
+
'horizontal rule',
|
|
37
|
+
'line',
|
|
38
|
+
'separator'
|
|
39
|
+
],
|
|
40
|
+
onSelect: ({ editor })=>{
|
|
41
|
+
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export const HorizontalRuleFeatureClientComponent = createClientComponent(HorizontalRuleFeatureClient);
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=feature.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js'\nimport { HorizontalRulePlugin } from './plugin/index.js'\n\nconst HorizontalRuleFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [HorizontalRuleNode],\n plugins: [\n {\n Component: HorizontalRulePlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`horizontalrule`, {\n Icon: HorizontalRuleIcon,\n displayName: `Horizontal Rule`,\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["SlashMenuOption","HorizontalRuleIcon","createClientComponent","MarkdownTransformer","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","options","displayName","key","Icon","keywords","onSelect","editor","dispatchCommand","undefined","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,eAAe,QAAQ,sEAAqE;AACrG,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,EAAEC,8BAA8B,QAAQ,gCAA+B;AAClG,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACR;iBAAoB;gBAC3CS,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbC,KAAK;4BACLF,SAAS;gCACP,IAAIjB,gBAAgB,CAAC,cAAc,CAAC,EAAE;oCACpCoB,MAAMnB;oCACNiB,aAAa,CAAC,eAAe,CAAC;oCAC9BG,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACnB,gCAAgCoB;oCACzD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,uCAAuCxB,sBAClDK,6BACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,eAAO,MAAM,qBAAqB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CA4BrF,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HorizontalRuleFeatureClientComponent } from './feature.client.js';
|
|
2
|
+
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
3
|
+
import { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js';
|
|
4
|
+
export const HorizontalRuleFeature = (props)=>{
|
|
5
|
+
return {
|
|
6
|
+
feature: ()=>{
|
|
7
|
+
return {
|
|
8
|
+
ClientComponent: HorizontalRuleFeatureClientComponent,
|
|
9
|
+
clientFeatureProps: null,
|
|
10
|
+
markdownTransformers: [
|
|
11
|
+
MarkdownTransformer
|
|
12
|
+
],
|
|
13
|
+
nodes: [
|
|
14
|
+
{
|
|
15
|
+
converters: {
|
|
16
|
+
html: {
|
|
17
|
+
converter: ()=>{
|
|
18
|
+
return `<hr/>`;
|
|
19
|
+
},
|
|
20
|
+
nodeTypes: [
|
|
21
|
+
HorizontalRuleNode.getType()
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
node: HorizontalRuleNode
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
serverFeatureProps: props
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
key: 'horizontalrule',
|
|
32
|
+
serverFeatureProps: props
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=feature.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"sourcesContent":["import type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { SerializedHorizontalRuleNode } from './nodes/HorizontalRuleNode.js'\n\nimport { HorizontalRuleFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js'\n\nexport const HorizontalRuleFeature: FeatureProviderProviderServer<undefined, undefined> = (\n props,\n) => {\n return {\n feature: () => {\n return {\n ClientComponent: HorizontalRuleFeatureClientComponent,\n clientFeatureProps: null,\n markdownTransformers: [MarkdownTransformer],\n nodes: [\n {\n converters: {\n html: {\n converter: () => {\n return `<hr/>`\n },\n nodeTypes: [HorizontalRuleNode.getType()],\n } as HTMLConverter<SerializedHorizontalRuleNode>,\n },\n node: HorizontalRuleNode,\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'horizontalrule',\n serverFeatureProps: props,\n }\n}\n"],"names":["HorizontalRuleFeatureClientComponent","MarkdownTransformer","HorizontalRuleNode","HorizontalRuleFeature","props","feature","ClientComponent","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","nodeTypes","getType","node","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,oCAAoC,QAAQ,sBAAqB;AAC1E,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,QAAQ,gCAA+B;AAElE,OAAO,MAAMC,wBAA6E,CACxFC;IAEA,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoB;gBACpBC,sBAAsB;oBAACP;iBAAoB;gBAC3CQ,OAAO;oBACL;wBACEC,YAAY;4BACVC,MAAM;gCACJC,WAAW;oCACT,OAAO,CAAC,KAAK,CAAC;gCAChB;gCACAC,WAAW;oCAACX,mBAAmBY,OAAO;iCAAG;4BAC3C;wBACF;wBACAC,MAAMb;oBACR;iBACD;gBACDc,oBAAoBZ;YACtB;QACF;QACAa,KAAK;QACLD,oBAAoBZ;IACtB;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,eAAO,MAAM,mBAAmB,EAAE,kBAiBjC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { $createHorizontalRuleNode, $isHorizontalRuleNode, HorizontalRuleNode } from './nodes/HorizontalRuleNode.js';
|
|
2
|
+
export const MarkdownTransformer = {
|
|
3
|
+
type: 'element',
|
|
4
|
+
dependencies: [
|
|
5
|
+
HorizontalRuleNode
|
|
6
|
+
],
|
|
7
|
+
export: (node, exportChildren)=>{
|
|
8
|
+
if (!$isHorizontalRuleNode(node)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return '---';
|
|
12
|
+
},
|
|
13
|
+
// match ---
|
|
14
|
+
regExp: /^---\s*$/,
|
|
15
|
+
replace: (parentNode)=>{
|
|
16
|
+
const node = $createHorizontalRuleNode();
|
|
17
|
+
if (node) {
|
|
18
|
+
parentNode.replace(node);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=markdownTransformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalrule/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport {\n $createHorizontalRuleNode,\n $isHorizontalRuleNode,\n HorizontalRuleNode,\n} from './nodes/HorizontalRuleNode.js'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [HorizontalRuleNode],\n export: (node, exportChildren) => {\n if (!$isHorizontalRuleNode(node)) {\n return null\n }\n return '---'\n },\n // match ---\n regExp: /^---\\s*$/,\n replace: (parentNode) => {\n const node = $createHorizontalRuleNode()\n if (node) {\n parentNode.replace(node)\n }\n },\n}\n"],"names":["$createHorizontalRuleNode","$isHorizontalRuleNode","HorizontalRuleNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","regExp","replace","parentNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SACEA,yBAAyB,EACzBC,qBAAqB,EACrBC,kBAAkB,QACb,gCAA+B;AAEtC,OAAO,MAAMC,sBAA0C;IACrDC,MAAM;IACNC,cAAc;QAACH;KAAmB;IAClCI,QAAQ,CAACC,MAAMC;QACb,IAAI,CAACP,sBAAsBM,OAAO;YAChC,OAAO;QACT;QACA,OAAO;IACT;IACA,YAAY;IACZE,QAAQ;IACRC,SAAS,CAACC;QACR,MAAMJ,OAAOP;QACb,IAAIO,MAAM;YACRI,WAAWD,OAAO,CAACH;QACrB;IACF;AACF,EAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DOMConversionMap, DOMExportOutput, LexicalCommand, LexicalNode, SerializedLexicalNode } from 'lexical';
|
|
2
|
+
import lexicalImport from 'lexical';
|
|
3
|
+
declare const DecoratorNode: typeof lexicalImport.DecoratorNode;
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.
|
|
7
|
+
*/
|
|
8
|
+
export type SerializedHorizontalRuleNode = SerializedLexicalNode;
|
|
9
|
+
export declare const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void>;
|
|
10
|
+
/**
|
|
11
|
+
* This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.
|
|
12
|
+
*
|
|
13
|
+
* They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.
|
|
14
|
+
*
|
|
15
|
+
* If we used DecoratorBlockNode instead, we would only need a decorate method
|
|
16
|
+
*/
|
|
17
|
+
export declare class HorizontalRuleNode extends DecoratorNode<React.ReactElement> {
|
|
18
|
+
static clone(node: HorizontalRuleNode): HorizontalRuleNode;
|
|
19
|
+
static getType(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Defines what happens if you copy an hr element from another page and paste it into the lexical editor
|
|
22
|
+
*
|
|
23
|
+
* This also determines the behavior of lexical's internal HTML -> Lexical converter
|
|
24
|
+
*/
|
|
25
|
+
static importDOM(): DOMConversionMap | null;
|
|
26
|
+
/**
|
|
27
|
+
* 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.
|
|
28
|
+
*/
|
|
29
|
+
static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode;
|
|
30
|
+
/**
|
|
31
|
+
* Determines how the hr element is rendered in the lexical editor. This is only the "initial" / "outer" HTML element.
|
|
32
|
+
*/
|
|
33
|
+
createDOM(): HTMLElement;
|
|
34
|
+
/**
|
|
35
|
+
* Allows you to render a React component within whatever createDOM returns.
|
|
36
|
+
*/
|
|
37
|
+
decorate(): React.ReactElement;
|
|
38
|
+
/**
|
|
39
|
+
* Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.
|
|
40
|
+
*
|
|
41
|
+
* This also determines the behavior of lexical's internal Lexical -> HTML converter
|
|
42
|
+
*/
|
|
43
|
+
exportDOM(): DOMExportOutput;
|
|
44
|
+
/**
|
|
45
|
+
* Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.
|
|
46
|
+
*/
|
|
47
|
+
exportJSON(): SerializedLexicalNode;
|
|
48
|
+
getTextContent(): string;
|
|
49
|
+
isInline(): false;
|
|
50
|
+
updateDOM(): boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function $createHorizontalRuleNode(): HorizontalRuleNode;
|
|
53
|
+
export declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=HorizontalRuleNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/nodes/HorizontalRuleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,cAAc,EACd,WAAW,EACX,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,OAAO,aAAa,MAAM,SAAS,CAAA;AACnC,QAAA,MAA+B,aAAa,oCAAiC,CAAA;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,CAAA;AAEhE,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAAC,IAAI,CAE/D,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;IACvE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB;IAI1D,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB;;;;OAIG;IACH,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,4BAA4B,GAAG,kBAAkB;IAInF;;OAEG;IACH,SAAS,IAAI,WAAW;IAIxB;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC,YAAY;IAI9B;;;;OAIG;IACH,SAAS,IAAI,eAAe;IAG5B;;OAEG;IACH,UAAU,IAAI,qBAAqB;IAOnC,cAAc,IAAI,MAAM;IAIxB,QAAQ,IAAI,KAAK;IAIjB,SAAS,IAAI,OAAO;CAGrB;AAMD,wBAAgB,yBAAyB,IAAI,kBAAkB,CAE9D;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,kBAAkB,CAE5B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import lexicalImport from 'lexical';
|
|
2
|
+
const { $applyNodeReplacement, DecoratorNode, createCommand } = lexicalImport;
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
const HorizontalRuleComponent = /*#__PURE__*/ React.lazy(()=>import('../component/index.js').then((module)=>({
|
|
5
|
+
default: module.HorizontalRuleComponent
|
|
6
|
+
})));
|
|
7
|
+
export const INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
|
|
8
|
+
/**
|
|
9
|
+
* This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.
|
|
10
|
+
*
|
|
11
|
+
* They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.
|
|
12
|
+
*
|
|
13
|
+
* If we used DecoratorBlockNode instead, we would only need a decorate method
|
|
14
|
+
*/ export class HorizontalRuleNode extends DecoratorNode {
|
|
15
|
+
static clone(node) {
|
|
16
|
+
return new HorizontalRuleNode(node.__key);
|
|
17
|
+
}
|
|
18
|
+
static getType() {
|
|
19
|
+
return 'horizontalrule';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Defines what happens if you copy an hr element from another page and paste it into the lexical editor
|
|
23
|
+
*
|
|
24
|
+
* This also determines the behavior of lexical's internal HTML -> Lexical converter
|
|
25
|
+
*/ static importDOM() {
|
|
26
|
+
return {
|
|
27
|
+
hr: ()=>({
|
|
28
|
+
conversion: convertHorizontalRuleElement,
|
|
29
|
+
priority: 0
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 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.
|
|
35
|
+
*/ static importJSON(serializedNode) {
|
|
36
|
+
return $createHorizontalRuleNode();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Determines how the hr element is rendered in the lexical editor. This is only the "initial" / "outer" HTML element.
|
|
40
|
+
*/ createDOM() {
|
|
41
|
+
return document.createElement('hr');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Allows you to render a React component within whatever createDOM returns.
|
|
45
|
+
*/ decorate() {
|
|
46
|
+
return /*#__PURE__*/ React.createElement(HorizontalRuleComponent, {
|
|
47
|
+
nodeKey: this.__key
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.
|
|
52
|
+
*
|
|
53
|
+
* This also determines the behavior of lexical's internal Lexical -> HTML converter
|
|
54
|
+
*/ exportDOM() {
|
|
55
|
+
return {
|
|
56
|
+
element: document.createElement('hr')
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.
|
|
61
|
+
*/ exportJSON() {
|
|
62
|
+
return {
|
|
63
|
+
type: 'horizontalrule',
|
|
64
|
+
version: 1
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
getTextContent() {
|
|
68
|
+
return '\n';
|
|
69
|
+
}
|
|
70
|
+
isInline() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
updateDOM() {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function convertHorizontalRuleElement() {
|
|
78
|
+
return {
|
|
79
|
+
node: $createHorizontalRuleNode()
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export function $createHorizontalRuleNode() {
|
|
83
|
+
return $applyNodeReplacement(new HorizontalRuleNode());
|
|
84
|
+
}
|
|
85
|
+
export function $isHorizontalRuleNode(node) {
|
|
86
|
+
return node instanceof HorizontalRuleNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=HorizontalRuleNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalrule/nodes/HorizontalRuleNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n} from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { $applyNodeReplacement, DecoratorNode, createCommand } = lexicalImport\nimport * as React from 'react'\n\nconst HorizontalRuleComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({\n default: module.HorizontalRuleComponent,\n })),\n)\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 = SerializedLexicalNode\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 HorizontalRuleNode extends DecoratorNode<React.ReactElement> {\n static clone(node: HorizontalRuleNode): HorizontalRuleNode {\n return new HorizontalRuleNode(node.__key)\n }\n\n static 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 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 importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode {\n return $createHorizontalRuleNode()\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 createDOM(): HTMLElement {\n return document.createElement('hr')\n }\n\n /**\n * Allows you to render a React component within whatever createDOM returns.\n */\n decorate(): React.ReactElement {\n return <HorizontalRuleComponent nodeKey={this.__key} />\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 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 exportJSON(): SerializedLexicalNode {\n return {\n type: 'horizontalrule',\n version: 1,\n }\n }\n\n getTextContent(): string {\n return '\\n'\n }\n\n isInline(): false {\n return false\n }\n\n updateDOM(): boolean {\n return false\n }\n}\n\nfunction convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleNode() }\n}\n\nexport function $createHorizontalRuleNode(): HorizontalRuleNode {\n return $applyNodeReplacement(new HorizontalRuleNode())\n}\n\nexport function $isHorizontalRuleNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleNode {\n return node instanceof HorizontalRuleNode\n}\n"],"names":["lexicalImport","$applyNodeReplacement","DecoratorNode","createCommand","React","HorizontalRuleComponent","lazy","then","module","default","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRuleNode","clone","node","__key","getType","importDOM","hr","conversion","convertHorizontalRuleElement","priority","importJSON","serializedNode","$createHorizontalRuleNode","createDOM","document","createElement","decorate","nodeKey","exportDOM","element","exportJSON","type","version","getTextContent","isInline","updateDOM","$isHorizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAAGH;AAChE,YAAYI,WAAW,QAAO;AAE9B,MAAMC,wCAA0BD,MAAME,IAAI,CAAC,IACzC,MAAM,CAAC,yBAAyBC,IAAI,CAAC,CAACC,SAAY,CAAA;YAChDC,SAASD,OAAOH,uBAAuB;QACzC,CAAA;AAQF,OAAO,MAAMK,iCAAuDP,cAClE,kCACD;AAED;;;;;;CAMC,GACD,OAAO,MAAMQ,2BAA2BT;IACtC,OAAOU,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIF,mBAAmBE,KAAKC,KAAK;IAC1C;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA;;;;GAIC,GACD,OAAOC,YAAqC;QAC1C,OAAO;YACLC,IAAI,IAAO,CAAA;oBACTC,YAAYC;oBACZC,UAAU;gBACZ,CAAA;QACF;IACF;IAEA;;GAEC,GACD,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC;IACT;IAEA;;GAEC,GACDC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEA;;GAEC,GACDC,WAA+B;QAC7B,qBAAO,oBAACtB;YAAwBuB,SAAS,IAAI,CAACd,KAAK;;IACrD;IAEA;;;;GAIC,GACDe,YAA6B;QAC3B,OAAO;YAAEC,SAASL,SAASC,aAAa,CAAC;QAAM;IACjD;IACA;;GAEC,GACDK,aAAoC;QAClC,OAAO;YACLC,MAAM;YACNC,SAAS;QACX;IACF;IAEAC,iBAAyB;QACvB,OAAO;IACT;IAEAC,WAAkB;QAChB,OAAO;IACT;IAEAC,YAAqB;QACnB,OAAO;IACT;AACF;AAEA,SAASjB;IACP,OAAO;QAAEN,MAAMU;IAA4B;AAC7C;AAEA,OAAO,SAASA;IACd,OAAOtB,sBAAsB,IAAIU;AACnC;AAEA,OAAO,SAAS0B,sBACdxB,IAAoC;IAEpC,OAAOA,gBAAgBF;AACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"names":[],"mappings":"AAeA,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CA2B3C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
|
|
3
|
+
const { useLexicalComposerContext } = lexicalComposerContextImport;
|
|
4
|
+
import lexicalUtilsImport from '@lexical/utils';
|
|
5
|
+
const { $insertNodeToNearestRoot } = lexicalUtilsImport;
|
|
6
|
+
import lexicalImport from 'lexical';
|
|
7
|
+
const { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } = lexicalImport;
|
|
8
|
+
import { useEffect } from 'react';
|
|
9
|
+
import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '../nodes/HorizontalRuleNode.js';
|
|
10
|
+
import './index.scss';
|
|
11
|
+
/**
|
|
12
|
+
* Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
|
|
13
|
+
*/ export function HorizontalRulePlugin() {
|
|
14
|
+
const [editor] = useLexicalComposerContext();
|
|
15
|
+
useEffect(()=>{
|
|
16
|
+
return editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, (type)=>{
|
|
17
|
+
const selection = $getSelection();
|
|
18
|
+
if (!$isRangeSelection(selection)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const focusNode = selection.focus.getNode();
|
|
22
|
+
if (focusNode !== null) {
|
|
23
|
+
const horizontalRuleNode = $createHorizontalRuleNode();
|
|
24
|
+
$insertNodeToNearestRoot(horizontalRuleNode);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}, COMMAND_PRIORITY_EDITOR);
|
|
28
|
+
}, [
|
|
29
|
+
editor
|
|
30
|
+
]);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalUtilsImport from '@lexical/utils'\nconst { $insertNodeToNearestRoot } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } = lexicalImport\nimport { useEffect } from 'react'\n\nimport {\n $createHorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from '../nodes/HorizontalRuleNode.js'\nimport './index.scss'\n\n/**\n * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.\n */\nexport function HorizontalRulePlugin(): null {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand(\n INSERT_HORIZONTAL_RULE_COMMAND,\n (type) => {\n const selection = $getSelection()\n\n if (!$isRangeSelection(selection)) {\n return false\n }\n\n const focusNode = selection.focus.getNode()\n\n if (focusNode !== null) {\n const horizontalRuleNode = $createHorizontalRuleNode()\n $insertNodeToNearestRoot(horizontalRuleNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalUtilsImport","$insertNodeToNearestRoot","lexicalImport","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,wBAAwB,EAAE,GAAGD;AAErC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,EAAE,GAAGH;AACtE,SAASI,SAAS,QAAQ,QAAO;AAEjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGX;IAEjBO,UAAU;QACR,OAAOI,OAAOC,eAAe,CAC3BH,gCACA,CAACI;YACC,MAAMC,YAAYV;YAElB,IAAI,CAACC,kBAAkBS,YAAY;gBACjC,OAAO;YACT;YAEA,MAAMC,YAAYD,UAAUE,KAAK,CAACC,OAAO;YAEzC,IAAIF,cAAc,MAAM;gBACtB,MAAMG,qBAAqBV;gBAC3BN,yBAAyBgB;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '../../../../scss/styles.scss';
|
|
2
|
+
|
|
3
|
+
hr {
|
|
4
|
+
padding: 2px 2px;
|
|
5
|
+
border: none;
|
|
6
|
+
margin: 1rem 0;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
hr:after {
|
|
11
|
+
content: '';
|
|
12
|
+
display: block;
|
|
13
|
+
height: 2px;
|
|
14
|
+
background-color: var(--theme-elevation-250);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
hr.selected {
|
|
18
|
+
outline: 2px solid var(--theme-success-500);
|
|
19
|
+
user-select: none;
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/field/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/field/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAM/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAI1E,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CAe/D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,CA0CvE,CAAA"}
|