@frontify/fondue 12.0.0-beta.7 → 12.0.0-beta.9
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/components/AssetInput/AssetInput.es.js +5 -5
- package/dist/components/AssetInput/AssetInput.es.js.map +1 -1
- package/dist/components/ColorInputFlyout/ColorPickerFlyout.es.js +8 -7
- package/dist/components/ColorInputFlyout/ColorPickerFlyout.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/BoldPlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/BoldPlugin/index.es.js +11 -7
- package/dist/components/RichTextEditor/Plugins/BoldPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/index.es.js +11 -8
- package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/CodePlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/CodePlugin/index.es.js +16 -8
- package/dist/components/RichTextEditor/Plugins/CodePlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/ItalicPlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/ItalicPlugin/index.es.js +12 -8
- package/dist/components/RichTextEditor/Plugins/ItalicPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemContentMarkupElement.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemContentMarkupElement.es.js +2 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemContentMarkupElement.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemMarkupElement.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemMarkupElement.es.js +2 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/ListItemMarkupElement.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/OrderedListPlugin/index.d.ts +2 -0
- package/dist/components/RichTextEditor/Plugins/ListPlugin/OrderedListPlugin/index.es.js +12 -6
- package/dist/components/RichTextEditor/Plugins/ListPlugin/OrderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/ListPlugin/UnorderedListPlugin/index.d.ts +2 -0
- package/dist/components/RichTextEditor/Plugins/ListPlugin/UnorderedListPlugin/index.es.js +12 -6
- package/dist/components/RichTextEditor/Plugins/ListPlugin/UnorderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/MarkupElement.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/StrikethroughPlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/StrikethroughPlugin/index.es.js +10 -6
- package/dist/components/RichTextEditor/Plugins/StrikethroughPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/UnderlinePlugin/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/UnderlinePlugin/index.es.js +10 -6
- package/dist/components/RichTextEditor/Plugins/UnderlinePlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js +12 -9
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utils/reactCssPropsToCss.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utils/serializeLeafToHtml.es.js +11 -13
- package/dist/components/RichTextEditor/serializer/utils/serializeLeafToHtml.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.d.ts +1 -1
- package/dist/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.es.js +9 -10
- package/dist/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.d.ts +1 -1
- package/dist/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.es.js +5 -16
- package/dist/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.es.js.map +1 -1
- package/dist/components/RichTextEditor/utils/deepMerge.d.ts +6 -0
- package/dist/components/RichTextEditor/utils/deepMerge.es.js +18 -0
- package/dist/components/RichTextEditor/utils/deepMerge.es.js.map +1 -0
- package/dist/components/RichTextEditor/utils/editorConfig.es.js +31 -31
- package/dist/components/RichTextEditor/utils/editorConfig.es.js.map +1 -1
- package/dist/components/RichTextEditor/utils/index.d.ts +1 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +3565 -3527
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/RichTextEditor/components/bold.d.ts +0 -4
- package/dist/components/RichTextEditor/components/bold.es.js +0 -10
- package/dist/components/RichTextEditor/components/bold.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/code.d.ts +0 -4
- package/dist/components/RichTextEditor/components/code.es.js +0 -10
- package/dist/components/RichTextEditor/components/code.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/index.d.ts +0 -10
- package/dist/components/RichTextEditor/components/italic.d.ts +0 -4
- package/dist/components/RichTextEditor/components/italic.es.js +0 -10
- package/dist/components/RichTextEditor/components/italic.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/list-item-content.d.ts +0 -3
- package/dist/components/RichTextEditor/components/list-item-content.es.js +0 -8
- package/dist/components/RichTextEditor/components/list-item-content.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/list-item.d.ts +0 -3
- package/dist/components/RichTextEditor/components/list-item.es.js +0 -8
- package/dist/components/RichTextEditor/components/list-item.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/ordered-list.d.ts +0 -4
- package/dist/components/RichTextEditor/components/ordered-list.es.js +0 -10
- package/dist/components/RichTextEditor/components/ordered-list.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/strikethrough.d.ts +0 -4
- package/dist/components/RichTextEditor/components/strikethrough.es.js +0 -10
- package/dist/components/RichTextEditor/components/strikethrough.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/underline.d.ts +0 -4
- package/dist/components/RichTextEditor/components/underline.es.js +0 -10
- package/dist/components/RichTextEditor/components/underline.es.js.map +0 -1
- package/dist/components/RichTextEditor/components/unordered-list.d.ts +0 -4
- package/dist/components/RichTextEditor/components/unordered-list.es.js +0 -10
- package/dist/components/RichTextEditor/components/unordered-list.es.js.map +0 -1
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { createUnderlinePlugin as
|
|
1
|
+
import { createUnderlinePlugin as r } from "@udecode/plate";
|
|
2
2
|
import { UNDERLINE_PLUGIN as n } from "./id.es.js";
|
|
3
3
|
import { UnderlineMarkupElement as t } from "./UnderlineMarkupElement.es.js";
|
|
4
|
+
import { UNDERLINE_CLASSES as s, UnderlineMarkupElement as N, UnderlineMarkupElementNode as c } from "./UnderlineMarkupElement.es.js";
|
|
4
5
|
import { UnderlineButton as o } from "./UnderlineButton.es.js";
|
|
5
|
-
import { Plugin as
|
|
6
|
-
class d extends
|
|
7
|
-
constructor(
|
|
6
|
+
import { Plugin as m } from "../Plugin.es.js";
|
|
7
|
+
class d extends m {
|
|
8
|
+
constructor(e) {
|
|
8
9
|
super(n, {
|
|
9
10
|
button: o,
|
|
10
11
|
markupElement: new t(),
|
|
11
|
-
...
|
|
12
|
+
...e
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
plugins() {
|
|
15
|
-
return [
|
|
16
|
+
return [r()];
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
20
|
+
s as UNDERLINE_CLASSES,
|
|
21
|
+
N as UnderlineMarkupElement,
|
|
22
|
+
c as UnderlineMarkupElementNode,
|
|
19
23
|
d as UnderlinePlugin
|
|
20
24
|
};
|
|
21
25
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../src/components/RichTextEditor/Plugins/UnderlinePlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createUnderlinePlugin } from '@udecode/plate';\nimport { UNDERLINE_PLUGIN } from './id';\nimport { UnderlineMarkupElement } from './UnderlineMarkupElement';\nimport { UnderlineButton } from './UnderlineButton';\nimport { Plugin, PluginProps } from '../Plugin';\n\nexport class UnderlinePlugin extends Plugin {\n constructor(props?: PluginProps) {\n super(UNDERLINE_PLUGIN, {\n button: UnderlineButton,\n markupElement: new UnderlineMarkupElement(),\n ...props,\n });\n }\n\n plugins() {\n return [createUnderlinePlugin()];\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../src/components/RichTextEditor/Plugins/UnderlinePlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { createUnderlinePlugin } from '@udecode/plate';\nimport { UNDERLINE_PLUGIN } from './id';\nimport { UnderlineMarkupElement } from './UnderlineMarkupElement';\nimport { UnderlineButton } from './UnderlineButton';\nimport { Plugin, PluginProps } from '../Plugin';\n\nexport class UnderlinePlugin extends Plugin {\n constructor(props?: PluginProps) {\n super(UNDERLINE_PLUGIN, {\n button: UnderlineButton,\n markupElement: new UnderlineMarkupElement(),\n ...props,\n });\n }\n\n plugins() {\n return [createUnderlinePlugin()];\n }\n}\n\nexport * from './UnderlineMarkupElement';\n"],"names":[],"mappings":";;;;;;AAQO,MAAM,UAAwB,EAAO;AAAA,EACxC,YAAY,GAAqB;AAC7B,UAAM,GAAkB;AAAA,MACpB,QAAQ;AAAA,MACR,eAAe,IAAI,EAAuB;AAAA,MAC1C,GAAG;AAAA,IAAA,CACN;AAAA,EACL;AAAA,EAEA,UAAU;AACC,WAAA,CAAC,GAAuB;AAAA,EACnC;AACJ;"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { defaultDesignTokens as
|
|
1
|
+
import { defaultDesignTokens as s } from "../utils/defaultDesignTokens.es.js";
|
|
2
2
|
import { parseRawValue as i } from "../utils/parseRawValue.es.js";
|
|
3
|
-
import { serializeNodeToHtmlRecursive as
|
|
4
|
-
import { setDefaultDesignTokensIfNull as
|
|
5
|
-
const
|
|
6
|
-
const r = i(
|
|
7
|
-
return
|
|
8
|
-
},
|
|
3
|
+
import { serializeNodeToHtmlRecursive as n } from "./utils/serializeNodeToHtmlRecursive.es.js";
|
|
4
|
+
import { setDefaultDesignTokensIfNull as m } from "./utils/setDefaultDesignTokensIfNull.es.js";
|
|
5
|
+
const T = (e, o = s) => {
|
|
6
|
+
const r = i(e);
|
|
7
|
+
return l(r, o);
|
|
8
|
+
}, l = (e, o = s) => {
|
|
9
|
+
const r = m(s, o);
|
|
10
|
+
return e.map((t) => n(t, r)).join("");
|
|
11
|
+
};
|
|
9
12
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
l as serializeNodesToHtml,
|
|
14
|
+
T as serializeRawToHtml
|
|
12
15
|
};
|
|
13
16
|
//# sourceMappingURL=serializeToHtml.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["import { TDescendant } from '@udecode/plate';\nimport { DesignTokens } from '../types';\nimport { defaultDesignTokens } from '../utils/defaultDesignTokens';\nimport { parseRawValue } from '../utils/parseRawValue';\nimport { serializeNodeToHtmlRecursive } from './utils/serializeNodeToHtmlRecursive';\nimport { setDefaultDesignTokensIfNull } from './utils/setDefaultDesignTokensIfNull';\n\nexport const serializeRawToHtml = (raw: string, designTokens: DesignTokens = defaultDesignTokens): string => {\n const nodes = parseRawValue(raw);\n return serializeNodesToHtml(nodes, designTokens);\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n designTokens: DesignTokens = defaultDesignTokens,\n): string => {\n
|
|
1
|
+
{"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["import { TDescendant } from '@udecode/plate';\nimport { DesignTokens } from '../types';\nimport { defaultDesignTokens } from '../utils/defaultDesignTokens';\nimport { parseRawValue } from '../utils/parseRawValue';\nimport { serializeNodeToHtmlRecursive } from './utils/serializeNodeToHtmlRecursive';\nimport { setDefaultDesignTokensIfNull } from './utils/setDefaultDesignTokensIfNull';\n\nexport const serializeRawToHtml = (raw: string, designTokens: DesignTokens = defaultDesignTokens): string => {\n const nodes = parseRawValue(raw);\n return serializeNodesToHtml(nodes, designTokens);\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n designTokens: DesignTokens = defaultDesignTokens,\n): string => {\n const mergedDesignTokens = setDefaultDesignTokensIfNull(defaultDesignTokens, designTokens);\n return nodes.map((node) => serializeNodeToHtmlRecursive(node, mergedDesignTokens)).join('');\n};\n"],"names":[],"mappings":";;;;AAOO,MAAM,IAAqB,CAAC,GAAa,IAA6B,MAAgC;AACnG,QAAA,IAAQ,EAAc,CAAG;AACxB,SAAA,EAAqB,GAAO,CAAY;AACnD,GAEa,IAAuB,CAChC,GACA,IAA6B,MACpB;AACH,QAAA,IAAqB,EAA6B,GAAqB,CAAY;AAClF,SAAA,EAAM,IAAI,CAAC,MAAS,EAA6B,GAAM,CAAkB,CAAC,EAAE,KAAK,EAAE;AAC9F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/reactCssPropsToCss.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/reactCssPropsToCss.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { convertCamelCaseToKebabCase } from './convertCamelCaseToKebabCase';\n\nexport const reactCssPropsToCss = (props?: any): string => {\n if (!props) {\n return '';\n }\n return Object.keys(props)\n .map((key) => `${convertCamelCaseToKebabCase(key)}: ${props[key]};`)\n .join(' ');\n};\n"],"names":[],"mappings":";AAIa,MAAA,IAAqB,CAAC,MAC1B,IAGE,OAAO,KAAK,CAAK,EACnB,IAAI,CAAC,MAAQ,GAAG,EAA4B,CAAG,MAAM,EAAM,KAAO,EAClE,KAAK,GAAG,IAJF;"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "../../
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let s = o(r.text);
|
|
12
|
-
return r.bold && (s = `<span class="${i}">${s}</span>`), r.italic && (s = `<span class="${t}">${s}</span>`), r.underline && (s = `<span class="${m}">${s}</span>`), r.strikethrough && (s = `<span class="${a}">${s}</span>`), r.code && (s = `<span class="${p}">${s}</span>`), s;
|
|
1
|
+
import "../../Plugins/index.es.js";
|
|
2
|
+
import a from "../../../../node_modules/escape-html/index.es.js";
|
|
3
|
+
import { BOLD_CLASSES as i } from "../../Plugins/BoldPlugin/BoldMarkupElement.es.js";
|
|
4
|
+
import { ITALIC_CLASSES as p } from "../../Plugins/ItalicPlugin/ItalicMarkupElement.es.js";
|
|
5
|
+
import { UNDERLINE_CLASSES as t } from "../../Plugins/UnderlinePlugin/UnderlineMarkupElement.es.js";
|
|
6
|
+
import { STRIKETHROUGH_CLASSES as S } from "../../Plugins/StrikethroughPlugin/StrikethroughMarkupElement.es.js";
|
|
7
|
+
import { CODE_CLASSES as m } from "../../Plugins/CodePlugin/CodeMarkupElement.es.js";
|
|
8
|
+
const L = (r) => {
|
|
9
|
+
let s = a(r.text);
|
|
10
|
+
return r.bold && (s = `<span class="${i}">${s}</span>`), r.italic && (s = `<span class="${p}">${s}</span>`), r.underline && (s = `<span class="${t}">${s}</span>`), r.strikethrough && (s = `<span class="${S}">${s}</span>`), r.code && (s = `<span class="${m}">${s}</span>`), s;
|
|
13
11
|
};
|
|
14
12
|
export {
|
|
15
|
-
|
|
13
|
+
L as serializeLeafToHtml
|
|
16
14
|
};
|
|
17
15
|
//# sourceMappingURL=serializeLeafToHtml.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/serializeLeafToHtml.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/serializeLeafToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport {\n BOLD_CLASSES,\n CODE_CLASSES,\n ITALIC_CLASSES,\n STRIKETHROUGH_CLASSES,\n UNDERLINE_CLASSES,\n} from '@components/RichTextEditor/Plugins';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TDescendant): string => {\n let string = escapeHtml(node.text);\n if (node.bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (node.italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (node.underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (node.strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (node.code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n return string;\n};\n"],"names":["escapeHtml"],"mappings":";;;;;;;AAYa,MAAA,IAAsB,CAAC,MAA8B;AAC1D,MAAA,IAASA,EAAW,EAAK,IAAI;AACjC,SAAI,EAAK,QACL,KAAS,gBAAgB,MAAiB,aAE1C,EAAK,UACL,KAAS,gBAAgB,MAAmB,aAE5C,EAAK,aACL,KAAS,gBAAgB,MAAsB,aAE/C,EAAK,iBACL,KAAS,gBAAgB,MAA0B,aAEnD,EAAK,QACL,KAAS,gBAAgB,MAAiB,aAEvC;AACX;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DesignTokens } from '../../../RichTextEditor/types';
|
|
2
1
|
import { TDescendant } from '@udecode/plate';
|
|
2
|
+
import { DesignTokens } from '../../../RichTextEditor/types';
|
|
3
3
|
export declare const serializeNodeToHtmlRecursive: (node: TDescendant, designTokens: DesignTokens) => string;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import "react";
|
|
2
1
|
import { ELEMENT_LINK as c, ELEMENT_LI as i, ELEMENT_OL as m, ELEMENT_UL as s, ELEMENT_PARAGRAPH as $ } from "@udecode/plate";
|
|
3
|
-
import "../../
|
|
4
|
-
import { OL_CLASSES as o } from "../../components/ordered-list.es.js";
|
|
5
|
-
import { UL_CLASSES as u } from "../../components/unordered-list.es.js";
|
|
6
|
-
import { ELEMENT_CHECK_ITEM as L } from "../../Plugins/CheckboxListPlugin/id.es.js";
|
|
2
|
+
import "../../Plugins/index.es.js";
|
|
7
3
|
import { TextStyles as l } from "../../Plugins/TextStylePlugin/TextStyles/textStyles.es.js";
|
|
8
4
|
import "../../Plugins/TextStylePlugin/TextStyles/Custom1Plugin/createCustom1Plugin.es.js";
|
|
9
5
|
import "../../Plugins/TextStylePlugin/TextStyles/Custom2Plugin/createCustom2Plugin.es.js";
|
|
@@ -15,10 +11,13 @@ import "../../Plugins/TextStylePlugin/TextStyles/Heading4Plugin/createHeading4Pl
|
|
|
15
11
|
import "../../Plugins/TextStylePlugin/TextStyles/Quote/createQuotePlugin.es.js";
|
|
16
12
|
import a from "../../../../node_modules/escape-html/index.es.js";
|
|
17
13
|
import { reactCssPropsToCss as e } from "./reactCssPropsToCss.es.js";
|
|
18
|
-
import { serializeLeafToHtml as
|
|
14
|
+
import { serializeLeafToHtml as o } from "./serializeLeafToHtml.es.js";
|
|
15
|
+
import { ELEMENT_CHECK_ITEM as u } from "../../Plugins/CheckboxListPlugin/id.es.js";
|
|
16
|
+
import { OL_CLASSES as L } from "../../Plugins/ListPlugin/OrderedListPlugin/OrderedListMarkupElement.es.js";
|
|
17
|
+
import { UL_CLASSES as h } from "../../Plugins/ListPlugin/UnorderedListPlugin/UnorderedListMarkupElement.es.js";
|
|
19
18
|
const N = (E, t) => {
|
|
20
19
|
if (!E.children)
|
|
21
|
-
return
|
|
20
|
+
return o(E);
|
|
22
21
|
const r = E.children.map((p) => N(p, t)).join("");
|
|
23
22
|
switch (E.type) {
|
|
24
23
|
case l.ELEMENT_HEADING1:
|
|
@@ -40,14 +39,14 @@ const N = (E, t) => {
|
|
|
40
39
|
case $:
|
|
41
40
|
return `<p>${r}</p>`;
|
|
42
41
|
case s:
|
|
43
|
-
return `<ul class="${
|
|
42
|
+
return `<ul class="${h}">${r}</ul>`;
|
|
44
43
|
case m:
|
|
45
|
-
return `<ol class="${
|
|
44
|
+
return `<ol class="${L}">${r}</ol>`;
|
|
46
45
|
case i:
|
|
47
46
|
return `<li>${r}</li>`;
|
|
48
47
|
case c:
|
|
49
48
|
return E.chosenLink ? `<a style="${e(t.link)}" target=${E.chosenLink.openInNewTab ? "_blank" : "_self"} href="${a(E.chosenLink.searchResult.link)}">${r}</a>` : `<a style="${e(t.link)}" href="${a(E.url)}">${r}</a>`;
|
|
50
|
-
case
|
|
49
|
+
case u:
|
|
51
50
|
return `<input type="checkbox"/><label>${r}</label>`;
|
|
52
51
|
default:
|
|
53
52
|
return r;
|
package/dist/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeNodeToHtmlRecursive.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"serializeNodeToHtmlRecursive.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/serializeNodeToHtmlRecursive.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LI, ELEMENT_LINK, ELEMENT_OL, ELEMENT_PARAGRAPH, ELEMENT_UL, TDescendant } from '@udecode/plate';\nimport { ELEMENT_CHECK_ITEM, OL_CLASSES, UL_CLASSES } from '@components/RichTextEditor/Plugins';\nimport { DesignTokens } from '@components/RichTextEditor/types';\nimport { TextStyles } from '@components/RichTextEditor/Plugins/TextStylePlugin/TextStyles';\nimport escapeHtml from 'escape-html';\nimport { reactCssPropsToCss } from './reactCssPropsToCss';\nimport { serializeLeafToHtml } from './serializeLeafToHtml';\n\nexport const serializeNodeToHtmlRecursive = (node: TDescendant, designTokens: DesignTokens): string => {\n if (!node.children) {\n return serializeLeafToHtml(node);\n }\n\n const children = node.children.map((n: TDescendant) => serializeNodeToHtmlRecursive(n, designTokens)).join('');\n\n switch (node.type) {\n case TextStyles.ELEMENT_HEADING1:\n return `<h1 style=\"${reactCssPropsToCss(designTokens.heading1)}\">${children}</h1>`;\n case TextStyles.ELEMENT_HEADING2:\n return `<h2 style=\"${reactCssPropsToCss(designTokens.heading2)}\">${children}</h2>`;\n case TextStyles.ELEMENT_HEADING3:\n return `<h3 style=\"${reactCssPropsToCss(designTokens.heading3)}\">${children}</h3>`;\n case TextStyles.ELEMENT_HEADING4:\n return `<h4 style=\"${reactCssPropsToCss(designTokens.heading4)}\">${children}</h4>`;\n case TextStyles.ELEMENT_CUSTOM1:\n return `<p style=\"${reactCssPropsToCss(designTokens.custom1)}\">${children}</p>`;\n case TextStyles.ELEMENT_CUSTOM2:\n return `<p style=\"${reactCssPropsToCss(designTokens.custom2)}\">${children}</p>`;\n case TextStyles.ELEMENT_CUSTOM3:\n return `<p style=\"${reactCssPropsToCss(designTokens.custom3)}\">${children}</p>`;\n case TextStyles.ELEMENT_QUOTE:\n return `<p style=\"${reactCssPropsToCss(designTokens.quote)}\">${children}</p>`;\n case ELEMENT_PARAGRAPH:\n return `<p>${children}</p>`;\n case ELEMENT_UL:\n return `<ul class=\"${UL_CLASSES}\">${children}</ul>`;\n case ELEMENT_OL:\n return `<ol class=\"${OL_CLASSES}\">${children}</ol>`;\n case ELEMENT_LI:\n return `<li>${children}</li>`;\n case ELEMENT_LINK:\n if (node.chosenLink) {\n return `<a style=\"${reactCssPropsToCss(designTokens.link)}\" target=${\n node.chosenLink.openInNewTab ? '_blank' : '_self'\n } href=\"${escapeHtml(node.chosenLink.searchResult.link)}\">${children}</a>`;\n }\n return `<a style=\"${reactCssPropsToCss(designTokens.link)}\" href=\"${escapeHtml(node.url)}\">${children}</a>`;\n case ELEMENT_CHECK_ITEM:\n return `<input type=\"checkbox\"/><label>${children}</label>`;\n\n default:\n return children;\n }\n};\n"],"names":["escapeHtml"],"mappings":";;;;;;;;;;;;;;;;;AAUa,MAAA,IAA+B,CAAC,GAAmB,MAAuC;AAC/F,MAAA,CAAC,EAAK;AACN,WAAO,EAAoB,CAAI;AAGnC,QAAM,IAAW,EAAK,SAAS,IAAI,CAAC,MAAmB,EAA6B,GAAG,CAAY,CAAC,EAAE,KAAK,EAAE;AAE7G,UAAQ,EAAK;AAAA,SACJ,EAAW;AACZ,aAAO,cAAc,EAAmB,EAAa,QAAQ,MAAM;AAAA,SAClE,EAAW;AACZ,aAAO,cAAc,EAAmB,EAAa,QAAQ,MAAM;AAAA,SAClE,EAAW;AACZ,aAAO,cAAc,EAAmB,EAAa,QAAQ,MAAM;AAAA,SAClE,EAAW;AACZ,aAAO,cAAc,EAAmB,EAAa,QAAQ,MAAM;AAAA,SAClE,EAAW;AACZ,aAAO,aAAa,EAAmB,EAAa,OAAO,MAAM;AAAA,SAChE,EAAW;AACZ,aAAO,aAAa,EAAmB,EAAa,OAAO,MAAM;AAAA,SAChE,EAAW;AACZ,aAAO,aAAa,EAAmB,EAAa,OAAO,MAAM;AAAA,SAChE,EAAW;AACZ,aAAO,aAAa,EAAmB,EAAa,KAAK,MAAM;AAAA,SAC9D;AACD,aAAO,MAAM;AAAA,SACZ;AACD,aAAO,cAAc,MAAe;AAAA,SACnC;AACD,aAAO,cAAc,MAAe;AAAA,SACnC;AACD,aAAO,OAAO;AAAA,SACb;AACD,aAAI,EAAK,aACE,aAAa,EAAmB,EAAa,IAAI,aACpD,EAAK,WAAW,eAAe,WAAW,iBACpCA,EAAW,EAAK,WAAW,aAAa,IAAI,MAAM,UAEzD,aAAa,EAAmB,EAAa,IAAI,YAAYA,EAAW,EAAK,GAAG,MAAM;AAAA,SAC5F;AACD,aAAO,kCAAkC;AAAA;AAGlC,aAAA;AAAA;AAEnB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DesignTokens } from '../../../RichTextEditor/types';
|
|
2
|
-
export declare const setDefaultDesignTokensIfNull: (
|
|
2
|
+
export declare const setDefaultDesignTokensIfNull: (defaultTokens: DesignTokens, customTokens: DesignTokens) => DesignTokens;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import "../../
|
|
4
|
-
|
|
5
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Custom3Plugin/createCustom3Plugin.es.js";
|
|
6
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Heading1Plugin/createHeading1Plugin.es.js";
|
|
7
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Heading2Plugin/createHeading2Plugin.es.js";
|
|
8
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Heading3Plugin/createHeading3Plugin.es.js";
|
|
9
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Heading4Plugin/createHeading4Plugin.es.js";
|
|
10
|
-
import "../../Plugins/TextStylePlugin/TextStyles/Quote/createQuotePlugin.es.js";
|
|
11
|
-
const D = (t) => {
|
|
12
|
-
for (const o of Object.values(r).filter((e) => e !== r.ELEMENT_PARAGRAPH))
|
|
13
|
-
t[o] || (t[o] = m[o]);
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
1
|
+
import "@udecode/plate";
|
|
2
|
+
import "slate";
|
|
3
|
+
import { deepMerge as t } from "../../utils/deepMerge.es.js";
|
|
4
|
+
const m = (e, o) => t(e, o);
|
|
16
5
|
export {
|
|
17
|
-
|
|
6
|
+
m as setDefaultDesignTokensIfNull
|
|
18
7
|
};
|
|
19
8
|
//# sourceMappingURL=setDefaultDesignTokensIfNull.es.js.map
|
package/dist/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDefaultDesignTokensIfNull.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"setDefaultDesignTokensIfNull.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utils/setDefaultDesignTokensIfNull.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { DesignTokens } from '@components/RichTextEditor/types';\nimport { deepMerge } from '@components/RichTextEditor/utils';\n\nexport const setDefaultDesignTokensIfNull = (defaultTokens: DesignTokens, customTokens: DesignTokens): DesignTokens =>\n deepMerge<DesignTokens>(defaultTokens, customTokens);\n"],"names":[],"mappings":";;;AAKO,MAAM,IAA+B,CAAC,GAA6B,MACtE,EAAwB,GAAe,CAAY;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const s = (n) => n && typeof n == "object" && !Array.isArray(n), c = (n, e) => {
|
|
2
|
+
if (!s(n) || !s(e))
|
|
3
|
+
return {};
|
|
4
|
+
const i = Object.assign({}, n);
|
|
5
|
+
for (const t of Object.keys(e)) {
|
|
6
|
+
if (t in n && s(e[t])) {
|
|
7
|
+
i[t] = c(n[t], e[t]);
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
Object.assign(i, { [t]: e[t] });
|
|
11
|
+
}
|
|
12
|
+
return i;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
c as deepMerge,
|
|
16
|
+
s as isObject
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=deepMerge.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMerge.es.js","sources":["../../../../src/components/RichTextEditor/utils/deepMerge.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\ntype NestedObject = {\n [key: string | number]: any;\n};\n\nexport const isObject = <T = object>(obj: T) => obj && typeof obj === 'object' && !Array.isArray(obj);\n\nexport const deepMerge = <T extends NestedObject = NestedObject>(target: T, source: T): NestedObject => {\n if (!isObject(target) || !isObject(source)) {\n return {};\n }\n\n const output: NestedObject = Object.assign({}, target);\n\n for (const key of Object.keys(source)) {\n if (key in target && isObject(source[key])) {\n output[key] = deepMerge(target[key], source[key]);\n continue;\n }\n\n Object.assign(output, { [key]: source[key] });\n }\n\n return output;\n};\n"],"names":[],"mappings":"AAMa,MAAA,IAAW,CAAa,MAAW,KAAO,OAAO,KAAQ,YAAY,CAAC,MAAM,QAAQ,CAAG,GAEvF,IAAY,CAAwC,GAAW,MAA4B;AACpG,MAAI,CAAC,EAAS,CAAM,KAAK,CAAC,EAAS,CAAM;AACrC,WAAO;AAGX,QAAM,IAAuB,OAAO,OAAO,IAAI,CAAM;AAErD,aAAW,KAAO,OAAO,KAAK,CAAM,GAAG;AACnC,QAAI,KAAO,KAAU,EAAS,EAAO,EAAI,GAAG;AACxC,QAAO,KAAO,EAAU,EAAO,IAAM,EAAO,EAAI;AAChD;AAAA,IACJ;AAEA,WAAO,OAAO,GAAQ,EAAE,CAAC,IAAM,EAAO,IAAM;AAAA,EAChD;AAEO,SAAA;AACX;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createPlateUI as o, ELEMENT_LINK as i, ELEMENT_UL as E, ELEMENT_OL as m, ELEMENT_LI as n, ELEMENT_LIC as a, MARK_BOLD as l, MARK_ITALIC as p, MARK_UNDERLINE as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { LinkMarkupElementNode as O } from "../Plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js";
|
|
6
|
-
import { ListItemElement as K } from "../components/list-item.es.js";
|
|
7
|
-
import { ListItemContentElement as S } from "../components/list-item-content.es.js";
|
|
8
|
-
import { OrderedListElement as h } from "../components/ordered-list.es.js";
|
|
9
|
-
import { StrikethroughMark as D } from "../components/strikethrough.es.js";
|
|
10
|
-
import { UnderlineMark as G } from "../components/underline.es.js";
|
|
11
|
-
import { UnorderedListElement as B } from "../components/unordered-list.es.js";
|
|
12
|
-
import { createCheckboxListPlugin as x } from "../Plugins/CheckboxListPlugin/index.es.js";
|
|
1
|
+
import { createPlateUI as o, ELEMENT_LINK as i, ELEMENT_UL as E, ELEMENT_OL as m, ELEMENT_LI as n, ELEMENT_LIC as a, MARK_BOLD as l, MARK_ITALIC as p, MARK_UNDERLINE as u, MARK_STRIKETHROUGH as M, MARK_CODE as c, createPlugins as N, createSoftBreakPlugin as g, createAlignPlugin as L, ELEMENT_PARAGRAPH as d, createIndentPlugin as f, createParagraphPlugin as P, createCodeBlockPlugin as T, createListPlugin as _, createBoldPlugin as s, createItalicPlugin as k, createUnderlinePlugin as C, createStrikethroughPlugin as I, createCodePlugin as A } from "@udecode/plate";
|
|
2
|
+
import { ListItemMarkupElementNode as H } from "../Plugins/ListPlugin/ListItemMarkupElement.es.js";
|
|
3
|
+
import { ListItemContentMarkupElementNode as U } from "../Plugins/ListPlugin/ListItemContentMarkupElement.es.js";
|
|
4
|
+
import { LinkMarkupElementNode as R } from "../Plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js";
|
|
13
5
|
import { ELEMENT_CHECK_ITEM as r } from "../Plugins/CheckboxListPlugin/id.es.js";
|
|
6
|
+
import { UnderlineMarkupElementNode as O } from "../Plugins/UnderlinePlugin/UnderlineMarkupElement.es.js";
|
|
7
|
+
import { OrderedListMarkupElementNode as K } from "../Plugins/ListPlugin/OrderedListPlugin/OrderedListMarkupElement.es.js";
|
|
8
|
+
import { UnorderedListMarkupElementNode as S } from "../Plugins/ListPlugin/UnorderedListPlugin/UnorderedListMarkupElement.es.js";
|
|
9
|
+
import { StrikethroughMarkupElementNode as h } from "../Plugins/StrikethroughPlugin/StrikethroughMarkupElement.es.js";
|
|
10
|
+
import { BoldMarkupElementNode as D } from "../Plugins/BoldPlugin/BoldMarkupElement.es.js";
|
|
11
|
+
import { CodeMarkupElementNode as G } from "../Plugins/CodePlugin/CodeMarkupElement.es.js";
|
|
12
|
+
import { ItalicMarkupElementNode as B } from "../Plugins/ItalicPlugin/ItalicMarkupElement.es.js";
|
|
13
|
+
import { createCheckboxListPlugin as x } from "../Plugins/CheckboxListPlugin/index.es.js";
|
|
14
14
|
import { CheckboxListElementNode as y } from "../Plugins/CheckboxListPlugin/CheckboxListElement.es.js";
|
|
15
15
|
import { createLinkPlugin as b } from "../Plugins/LinkPlugin/index.es.js";
|
|
16
16
|
import { TextStyles as e } from "../Plugins/TextStylePlugin/TextStyles/textStyles.es.js";
|
|
@@ -22,27 +22,27 @@ import { createHeading2Plugin as w } from "../Plugins/TextStylePlugin/TextStyles
|
|
|
22
22
|
import { createHeading3Plugin as z } from "../Plugins/TextStylePlugin/TextStyles/Heading3Plugin/createHeading3Plugin.es.js";
|
|
23
23
|
import { createHeading4Plugin as F } from "../Plugins/TextStylePlugin/TextStyles/Heading4Plugin/createHeading4Plugin.es.js";
|
|
24
24
|
import { createQuotePlugin as J } from "../Plugins/TextStylePlugin/TextStyles/Quote/createQuotePlugin.es.js";
|
|
25
|
-
const
|
|
25
|
+
const fe = () => {
|
|
26
26
|
const t = o({
|
|
27
|
-
[i]:
|
|
28
|
-
[E]:
|
|
29
|
-
[m]:
|
|
30
|
-
[n]:
|
|
31
|
-
[a]:
|
|
32
|
-
[l]:
|
|
33
|
-
[p]:
|
|
27
|
+
[i]: R,
|
|
28
|
+
[E]: S,
|
|
29
|
+
[m]: K,
|
|
30
|
+
[n]: H,
|
|
31
|
+
[a]: U,
|
|
32
|
+
[l]: D,
|
|
33
|
+
[p]: B,
|
|
34
|
+
[u]: O,
|
|
35
|
+
[M]: h,
|
|
34
36
|
[c]: G,
|
|
35
|
-
[g]: D,
|
|
36
|
-
[L]: U,
|
|
37
37
|
[r]: y
|
|
38
38
|
});
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return N([
|
|
40
|
+
g(),
|
|
41
|
+
L({
|
|
42
42
|
inject: {
|
|
43
43
|
props: {
|
|
44
44
|
validTypes: [
|
|
45
|
-
|
|
45
|
+
d,
|
|
46
46
|
e.ELEMENT_HEADING1,
|
|
47
47
|
e.ELEMENT_HEADING2,
|
|
48
48
|
e.ELEMENT_HEADING3,
|
|
@@ -55,22 +55,22 @@ const Te = () => {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}),
|
|
58
|
-
|
|
58
|
+
f({
|
|
59
59
|
inject: {
|
|
60
60
|
props: {
|
|
61
61
|
validTypes: [r]
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}),
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
P(),
|
|
66
|
+
T(),
|
|
67
67
|
_(),
|
|
68
68
|
x(),
|
|
69
69
|
b(),
|
|
70
70
|
s(),
|
|
71
|
+
k(),
|
|
71
72
|
C(),
|
|
72
73
|
I(),
|
|
73
|
-
k(),
|
|
74
74
|
A(),
|
|
75
75
|
q(),
|
|
76
76
|
w(),
|
|
@@ -85,6 +85,6 @@ const Te = () => {
|
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
fe as getEditorConfig
|
|
89
89
|
};
|
|
90
90
|
//# sourceMappingURL=editorConfig.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorConfig.es.js","sources":["../../../../src/components/RichTextEditor/utils/editorConfig.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_OL,\n ELEMENT_PARAGRAPH,\n ELEMENT_UL,\n MARK_BOLD,\n MARK_CODE,\n MARK_ITALIC,\n MARK_STRIKETHROUGH,\n MARK_UNDERLINE,\n createAlignPlugin,\n createBoldPlugin,\n createCodeBlockPlugin,\n createCodePlugin,\n createIndentPlugin,\n createItalicPlugin,\n createListPlugin,\n createParagraphPlugin,\n createPlateUI,\n createPlugins,\n createSoftBreakPlugin,\n createStrikethroughPlugin,\n createUnderlinePlugin,\n} from '@udecode/plate';\nimport {
|
|
1
|
+
{"version":3,"file":"editorConfig.es.js","sources":["../../../../src/components/RichTextEditor/utils/editorConfig.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_OL,\n ELEMENT_PARAGRAPH,\n ELEMENT_UL,\n MARK_BOLD,\n MARK_CODE,\n MARK_ITALIC,\n MARK_STRIKETHROUGH,\n MARK_UNDERLINE,\n createAlignPlugin,\n createBoldPlugin,\n createCodeBlockPlugin,\n createCodePlugin,\n createIndentPlugin,\n createItalicPlugin,\n createListPlugin,\n createParagraphPlugin,\n createPlateUI,\n createPlugins,\n createSoftBreakPlugin,\n createStrikethroughPlugin,\n createUnderlinePlugin,\n} from '@udecode/plate';\nimport { ListItemMarkupElementNode } from '../Plugins/ListPlugin/ListItemMarkupElement';\nimport { ListItemContentMarkupElementNode } from '../Plugins/ListPlugin/ListItemContentMarkupElement';\nimport { LinkMarkupElementNode } from '../Plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode';\nimport { ELEMENT_CHECK_ITEM } from '../Plugins/CheckboxListPlugin/id';\nimport { UnderlineMarkupElementNode } from '../Plugins/UnderlinePlugin/UnderlineMarkupElement';\nimport { OrderedListMarkupElementNode } from '../Plugins/ListPlugin/OrderedListPlugin/OrderedListMarkupElement';\nimport { UnorderedListMarkupElementNode } from '../Plugins/ListPlugin/UnorderedListPlugin/UnorderedListMarkupElement';\nimport { StrikethroughMarkupElementNode } from '../Plugins/StrikethroughPlugin/StrikethroughMarkupElement';\nimport { BoldMarkupElementNode } from '../Plugins/BoldPlugin/BoldMarkupElement';\nimport { CodeMarkupElementNode } from '../Plugins/CodePlugin/CodeMarkupElement';\nimport { ItalicMarkupElementNode } from '../Plugins/ItalicPlugin/ItalicMarkupElement';\nimport { createCheckboxListPlugin } from '../Plugins/CheckboxListPlugin/index';\nimport { CheckboxListElementNode } from '../Plugins/CheckboxListPlugin/CheckboxListElement';\nimport { createLinkPlugin } from '../Plugins/LinkPlugin';\nimport {\n TextStyles,\n createCustom1Plugin,\n createCustom2Plugin,\n createCustom3Plugin,\n createHeading1Plugin,\n createHeading2Plugin,\n createHeading3Plugin,\n createHeading4Plugin,\n createQuotePlugin,\n} from '../Plugins/TextStylePlugin/TextStyles';\n\nexport const getEditorConfig = () => {\n const components = createPlateUI({\n // this will override the components over the default ones\n [ELEMENT_LINK]: LinkMarkupElementNode,\n [ELEMENT_UL]: UnorderedListMarkupElementNode,\n [ELEMENT_OL]: OrderedListMarkupElementNode,\n [ELEMENT_LI]: ListItemMarkupElementNode,\n [ELEMENT_LIC]: ListItemContentMarkupElementNode,\n [MARK_BOLD]: BoldMarkupElementNode,\n [MARK_ITALIC]: ItalicMarkupElementNode,\n [MARK_UNDERLINE]: UnderlineMarkupElementNode,\n [MARK_STRIKETHROUGH]: StrikethroughMarkupElementNode,\n [MARK_CODE]: CodeMarkupElementNode,\n [ELEMENT_CHECK_ITEM]: CheckboxListElementNode,\n });\n\n return createPlugins(\n [\n createSoftBreakPlugin(),\n createAlignPlugin({\n inject: {\n props: {\n validTypes: [\n ELEMENT_PARAGRAPH,\n TextStyles.ELEMENT_HEADING1,\n TextStyles.ELEMENT_HEADING2,\n TextStyles.ELEMENT_HEADING3,\n TextStyles.ELEMENT_HEADING4,\n TextStyles.ELEMENT_CUSTOM1,\n TextStyles.ELEMENT_CUSTOM2,\n TextStyles.ELEMENT_CUSTOM3,\n TextStyles.ELEMENT_QUOTE,\n ],\n },\n },\n }),\n createIndentPlugin({\n inject: {\n props: {\n validTypes: [ELEMENT_CHECK_ITEM],\n },\n },\n }),\n createParagraphPlugin(),\n createCodeBlockPlugin(),\n createListPlugin(),\n createCheckboxListPlugin(),\n createLinkPlugin(),\n createBoldPlugin(),\n createItalicPlugin(),\n createUnderlinePlugin(),\n createStrikethroughPlugin(),\n createCodePlugin(),\n createHeading1Plugin(),\n createHeading2Plugin(),\n createHeading3Plugin(),\n createHeading4Plugin(),\n createCustom1Plugin(),\n createCustom2Plugin(),\n createCustom3Plugin(),\n createQuotePlugin(),\n ],\n {\n components,\n },\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsDO,MAAM,KAAkB,MAAM;AACjC,QAAM,IAAa,EAAc;AAAA,IAE7B,CAAC,IAAe;AAAA,IAChB,CAAC,IAAa;AAAA,IACd,CAAC,IAAa;AAAA,IACd,CAAC,IAAa;AAAA,IACd,CAAC,IAAc;AAAA,IACf,CAAC,IAAY;AAAA,IACb,CAAC,IAAc;AAAA,IACf,CAAC,IAAiB;AAAA,IAClB,CAAC,IAAqB;AAAA,IACtB,CAAC,IAAY;AAAA,IACb,CAAC,IAAqB;AAAA,EAAA,CACzB;AAED,SAAO,EACH;AAAA,IACI,EAAsB;AAAA,IACtB,EAAkB;AAAA,MACd,QAAQ;AAAA,QACJ,OAAO;AAAA,UACH,YAAY;AAAA,YACR;AAAA,YACA,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,YACX,EAAW;AAAA,UACf;AAAA,QACJ;AAAA,MACJ;AAAA,IAAA,CACH;AAAA,IACD,EAAmB;AAAA,MACf,QAAQ;AAAA,QACJ,OAAO;AAAA,UACH,YAAY,CAAC,CAAkB;AAAA,QACnC;AAAA,MACJ;AAAA,IAAA,CACH;AAAA,IACD,EAAsB;AAAA,IACtB,EAAsB;AAAA,IACtB,EAAiB;AAAA,IACjB,EAAyB;AAAA,IACzB,EAAiB;AAAA,IACjB,EAAiB;AAAA,IACjB,EAAmB;AAAA,IACnB,EAAsB;AAAA,IACtB,EAA0B;AAAA,IAC1B,EAAiB;AAAA,IACjB,EAAqB;AAAA,IACrB,EAAqB;AAAA,IACrB,EAAqB;AAAA,IACrB,EAAqB;AAAA,IACrB,EAAoB;AAAA,IACpB,EAAoB;AAAA,IACpB,EAAoB;AAAA,IACpB,EAAkB;AAAA,EAAA,GAEtB;AAAA,IACI;AAAA,EAAA,CAER;AACJ;"}
|