@webiny/lexical-editor 5.37.8 → 5.38.0-beta.0

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.
Files changed (229) hide show
  1. package/commands/image.d.ts +6 -0
  2. package/commands/{insertFiles.js → image.js} +3 -1
  3. package/commands/image.js.map +1 -0
  4. package/commands/index.d.ts +3 -0
  5. package/commands/index.js +40 -0
  6. package/commands/index.js.map +1 -0
  7. package/commands/list.d.ts +7 -0
  8. package/commands/list.js +15 -0
  9. package/commands/list.js.map +1 -0
  10. package/commands/quote.d.ts +5 -0
  11. package/commands/quote.js +11 -0
  12. package/commands/quote.js.map +1 -0
  13. package/components/Editor/HeadingEditor.js +3 -1
  14. package/components/Editor/ParagraphEditor.js +3 -1
  15. package/components/Editor/RichTextEditor.d.ts +2 -2
  16. package/components/Editor/RichTextEditor.js +19 -12
  17. package/components/Editor/RichTextEditor.js.map +1 -1
  18. package/components/LexicalEditorConfig/LexicalEditorConfig.js +3 -1
  19. package/components/LexicalEditorConfig/components/Node.js +3 -1
  20. package/components/LexicalEditorConfig/components/Plugin.js +3 -1
  21. package/components/LexicalEditorConfig/components/ToolbarElement.js +3 -1
  22. package/components/LexicalHtmlRenderer.d.ts +2 -2
  23. package/components/LexicalHtmlRenderer.js +24 -17
  24. package/components/LexicalHtmlRenderer.js.map +1 -1
  25. package/components/Toolbar/StaticToolbar.d.ts +2 -2
  26. package/components/Toolbar/StaticToolbar.js +7 -78
  27. package/components/Toolbar/StaticToolbar.js.map +1 -1
  28. package/components/Toolbar/Toolbar.d.ts +1 -1
  29. package/components/Toolbar/Toolbar.js +27 -80
  30. package/components/Toolbar/Toolbar.js.map +1 -1
  31. package/components/ToolbarActions/BoldAction.js +10 -20
  32. package/components/ToolbarActions/BoldAction.js.map +1 -1
  33. package/components/ToolbarActions/BulletListAction.js +17 -23
  34. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  35. package/components/ToolbarActions/CodeHighlightAction.js +10 -20
  36. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  37. package/components/ToolbarActions/FontColorAction.js +20 -37
  38. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  39. package/components/ToolbarActions/FontSizeAction.js +11 -27
  40. package/components/ToolbarActions/FontSizeAction.js.map +1 -1
  41. package/components/ToolbarActions/ImageAction.js +6 -4
  42. package/components/ToolbarActions/ImageAction.js.map +1 -1
  43. package/components/ToolbarActions/ItalicAction.js +10 -20
  44. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  45. package/components/ToolbarActions/LinkAction.js +18 -36
  46. package/components/ToolbarActions/LinkAction.js.map +1 -1
  47. package/components/ToolbarActions/NumberedListAction.js +18 -27
  48. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  49. package/components/ToolbarActions/QuoteAction.js +15 -24
  50. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  51. package/components/ToolbarActions/TextAlignmentAction.js +27 -21
  52. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  53. package/components/ToolbarActions/TypographyAction.js +53 -60
  54. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  55. package/components/ToolbarActions/UnderlineAction.js +11 -21
  56. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  57. package/context/FontColorActionContext.js +3 -1
  58. package/context/RichTextEditorContext.d.ts +2 -6
  59. package/context/RichTextEditorContext.js +20 -36
  60. package/context/RichTextEditorContext.js.map +1 -1
  61. package/context/SharedHistoryContext.js +3 -1
  62. package/context/TextAlignmentActionContextProps.js +3 -1
  63. package/context/TypographyActionContext.d.ts +1 -1
  64. package/context/TypographyActionContext.js +3 -1
  65. package/context/TypographyActionContext.js.map +1 -1
  66. package/hooks/index.d.ts +7 -0
  67. package/hooks/index.js +84 -0
  68. package/hooks/index.js.map +1 -0
  69. package/hooks/useCurrentElement.d.ts +7 -0
  70. package/hooks/useCurrentElement.js +33 -0
  71. package/hooks/useCurrentElement.js.map +1 -0
  72. package/hooks/useCurrentSelection.d.ts +12 -0
  73. package/hooks/useCurrentSelection.js +72 -0
  74. package/hooks/useCurrentSelection.js.map +1 -0
  75. package/hooks/useFontColorPicker.js +3 -1
  76. package/hooks/useIsMounted.d.ts +1 -0
  77. package/hooks/useIsMounted.js +20 -0
  78. package/hooks/useIsMounted.js.map +1 -0
  79. package/hooks/useList.js +22 -21
  80. package/hooks/useList.js.map +1 -1
  81. package/hooks/useQuote.d.ts +1 -1
  82. package/hooks/useQuote.js +9 -7
  83. package/hooks/useQuote.js.map +1 -1
  84. package/hooks/useRichTextEditor.js +3 -1
  85. package/hooks/useTextAlignmentAction.js +3 -1
  86. package/hooks/useTypographyAction.js +3 -1
  87. package/index.d.ts +4 -8
  88. package/index.js +71 -48
  89. package/index.js.map +1 -1
  90. package/package.json +16 -20
  91. package/plugins/BlurEventPlugin/BlurEventPlugin.js +3 -1
  92. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +3 -1
  93. package/plugins/CodeHighlightPlugin/index.js +3 -1
  94. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +11 -9
  95. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  96. package/plugins/FloatingLinkEditorPlugin/index.js +3 -1
  97. package/plugins/FontColorPlugin/FontColorPlugin.js +8 -7
  98. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  99. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -1
  100. package/plugins/ImagesPlugin/ImagesPlugin.js +11 -9
  101. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  102. package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.d.ts +9 -0
  103. package/plugins/LexicalUpdateStatePlugin/{LexicalUpdateStatePlugin.js → UpdateStatePlugin.js} +22 -14
  104. package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.js.map +1 -0
  105. package/plugins/LexicalUpdateStatePlugin/index.d.ts +1 -1
  106. package/plugins/LexicalUpdateStatePlugin/index.js +7 -5
  107. package/plugins/LexicalUpdateStatePlugin/index.js.map +1 -1
  108. package/plugins/LinkPlugin/LinkPlugin.d.ts +5 -0
  109. package/plugins/LinkPlugin/LinkPlugin.js +68 -0
  110. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -0
  111. package/plugins/ListPLugin/ListPlugin.js +6 -5
  112. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  113. package/plugins/TypographyPlugin/TypographyPlugin.js +7 -7
  114. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  115. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +6 -4
  116. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +1 -1
  117. package/types.d.ts +1 -60
  118. package/types.js +5 -3
  119. package/types.js.map +1 -1
  120. package/ui/ContentEditable.js +3 -1
  121. package/ui/Divider.js +3 -1
  122. package/ui/DropDown.js +3 -1
  123. package/ui/ImageResizer.js +3 -1
  124. package/ui/LinkPreview.js +3 -1
  125. package/ui/Placeholder.js +3 -1
  126. package/ui/TextInput.js +3 -1
  127. package/ui/ToolbarActionDialog.js +3 -1
  128. package/utils/canUseDOM.js +3 -1
  129. package/utils/files.d.ts +1 -1
  130. package/utils/files.js +3 -1
  131. package/utils/files.js.map +1 -1
  132. package/utils/generateInitialLexicalValue.js +3 -1
  133. package/utils/getDOMRangeRect.js +3 -1
  134. package/utils/getSelectedNode.js +3 -1
  135. package/utils/getTransparentImage.js +3 -1
  136. package/utils/insertImage.d.ts +2 -0
  137. package/utils/{nodes/insertImage.js → insertImage.js} +6 -5
  138. package/utils/insertImage.js.map +1 -0
  139. package/utils/isHTMLElement.js +3 -1
  140. package/utils/isUrlLinkReference.js +3 -1
  141. package/utils/isValidJSON.js +3 -1
  142. package/utils/isValidLexicalData.js +3 -1
  143. package/utils/point.js +3 -1
  144. package/utils/rect.js +3 -1
  145. package/utils/sanitizeUrl.js +3 -1
  146. package/utils/setFloatingElemPosition.js +3 -1
  147. package/commands/insertFiles.d.ts +0 -14
  148. package/commands/insertFiles.js.map +0 -1
  149. package/commands/webiny-list.d.ts +0 -7
  150. package/commands/webiny-list.js +0 -13
  151. package/commands/webiny-list.js.map +0 -1
  152. package/commands/webiny-quote.d.ts +0 -5
  153. package/commands/webiny-quote.js +0 -9
  154. package/commands/webiny-quote.js.map +0 -1
  155. package/components/ImageComponent.d.ts +0 -23
  156. package/components/ImageComponent.js +0 -252
  157. package/components/ImageComponent.js.map +0 -1
  158. package/nodes/FontColorNode.d.ts +0 -43
  159. package/nodes/FontColorNode.js +0 -123
  160. package/nodes/FontColorNode.js.map +0 -1
  161. package/nodes/HeadingNode.d.ts +0 -34
  162. package/nodes/HeadingNode.js +0 -191
  163. package/nodes/HeadingNode.js.map +0 -1
  164. package/nodes/ImageNode.d.ts +0 -50
  165. package/nodes/ImageNode.js +0 -206
  166. package/nodes/ImageNode.js.map +0 -1
  167. package/nodes/ListItemNode.d.ts +0 -46
  168. package/nodes/ListItemNode.js +0 -447
  169. package/nodes/ListItemNode.js.map +0 -1
  170. package/nodes/ListNode/formatList.d.ts +0 -19
  171. package/nodes/ListNode/formatList.js +0 -447
  172. package/nodes/ListNode/formatList.js.map +0 -1
  173. package/nodes/ListNode.d.ts +0 -42
  174. package/nodes/ListNode.js +0 -288
  175. package/nodes/ListNode.js.map +0 -1
  176. package/nodes/ParagraphNode.d.ts +0 -32
  177. package/nodes/ParagraphNode.js +0 -218
  178. package/nodes/ParagraphNode.js.map +0 -1
  179. package/nodes/QuoteNode.d.ts +0 -34
  180. package/nodes/QuoteNode.js +0 -225
  181. package/nodes/QuoteNode.js.map +0 -1
  182. package/nodes/TypographyElementNode.d.ts +0 -42
  183. package/nodes/TypographyElementNode.js +0 -151
  184. package/nodes/TypographyElementNode.js.map +0 -1
  185. package/nodes/imageNode.css +0 -43
  186. package/nodes/link-node.d.ts +0 -19
  187. package/nodes/link-node.js +0 -120
  188. package/nodes/link-node.js.map +0 -1
  189. package/nodes/types.d.ts +0 -15
  190. package/nodes/types.js +0 -5
  191. package/nodes/types.js.map +0 -1
  192. package/nodes/webinyNodes.d.ts +0 -7
  193. package/nodes/webinyNodes.js +0 -60
  194. package/nodes/webinyNodes.js.map +0 -1
  195. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.d.ts +0 -8
  196. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +0 -1
  197. package/themes/webinyLexicalTheme.css +0 -423
  198. package/themes/webinyLexicalTheme.d.ts +0 -9
  199. package/themes/webinyLexicalTheme.js +0 -90
  200. package/themes/webinyLexicalTheme.js.map +0 -1
  201. package/utils/findTypographyStyleByHtmlTag.d.ts +0 -8
  202. package/utils/findTypographyStyleByHtmlTag.js +0 -16
  203. package/utils/findTypographyStyleByHtmlTag.js.map +0 -1
  204. package/utils/getLexicalTextSelectionState.d.ts +0 -5
  205. package/utils/getLexicalTextSelectionState.js +0 -167
  206. package/utils/getLexicalTextSelectionState.js.map +0 -1
  207. package/utils/nodes/clearNodeFormating.d.ts +0 -2
  208. package/utils/nodes/clearNodeFormating.js +0 -28
  209. package/utils/nodes/clearNodeFormating.js.map +0 -1
  210. package/utils/nodes/formatToHeading.d.ts +0 -3
  211. package/utils/nodes/formatToHeading.js +0 -25
  212. package/utils/nodes/formatToHeading.js.map +0 -1
  213. package/utils/nodes/formatToParagraph.d.ts +0 -2
  214. package/utils/nodes/formatToParagraph.js +0 -20
  215. package/utils/nodes/formatToParagraph.js.map +0 -1
  216. package/utils/nodes/formatToQuote.d.ts +0 -2
  217. package/utils/nodes/formatToQuote.js +0 -25
  218. package/utils/nodes/formatToQuote.js.map +0 -1
  219. package/utils/nodes/insertImage.d.ts +0 -2
  220. package/utils/nodes/insertImage.js.map +0 -1
  221. package/utils/nodes/listNode.d.ts +0 -11
  222. package/utils/nodes/listNode.js +0 -107
  223. package/utils/nodes/listNode.js.map +0 -1
  224. package/utils/styleObjectToString.d.ts +0 -2
  225. package/utils/styleObjectToString.js +0 -22
  226. package/utils/styleObjectToString.js.map +0 -1
  227. package/utils/toTypographyEmotionMap.d.ts +0 -3
  228. package/utils/toTypographyEmotionMap.js +0 -41
  229. package/utils/toTypographyEmotionMap.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["_link","require","_utils","_sanitizeUrl","LinkNode","_BaseLinkNode","_inherits2","default","_super","_createSuper2","url","attributes","arguments","length","undefined","key","_classCallCheck2","call","_createClass2","value","createDOM","config","element","document","createElement","href","sanitizeUrl","__url","__target","target","__rel","rel","__title","title","addClassNamesToElement","theme","link","exportJSON","_objectSpread2","_get2","_getPrototypeOf2","prototype","type","version","getType","clone","node","__key","importDOM","a","conversion","convertAnchorElement","priority","importJSON","serializedNode","$createLinkNode","setFormat","format","setIndent","indent","setDirection","direction","BaseLinkNode","exports","domNode","isHTMLAnchorElement","content","textContent","getAttribute","$isLinkNode"],"sources":["link-node.ts"],"sourcesContent":["import {\n LinkAttributes,\n LinkNode as BaseLinkNode,\n SerializedAutoLinkNode,\n SerializedLinkNode as BaseSerializedLinkNode\n} from \"@lexical/link\";\nimport { DOMConversionMap, DOMConversionOutput, EditorConfig, NodeKey, Spread } from \"lexical\";\nimport { addClassNamesToElement, isHTMLAnchorElement } from \"@lexical/utils\";\nimport { sanitizeUrl } from \"~/utils/sanitizeUrl\";\n\nexport type SerializedLinkNode = Spread<\n {\n type: \"link-node\";\n version: 1;\n },\n Spread<LinkAttributes, BaseSerializedLinkNode>\n>;\n\nexport class LinkNode extends BaseLinkNode {\n constructor(url: string, attributes: LinkAttributes = {}, key?: NodeKey) {\n super(url, attributes, key);\n }\n\n static override getType(): string {\n return \"link-node\";\n }\n\n static override clone(node: LinkNode): LinkNode {\n return new LinkNode(\n node.__url,\n { rel: node.__rel, target: node.__target, title: node.__title },\n node.__key\n );\n }\n\n override createDOM(config: EditorConfig): HTMLAnchorElement {\n const element = document.createElement(\"a\");\n element.href = sanitizeUrl(this.__url);\n if (this.__target !== null) {\n element.target = this.__target;\n }\n if (this.__rel !== null) {\n element.rel = this.__rel;\n }\n if (this.__title !== null) {\n element.title = this.__title;\n }\n addClassNamesToElement(element, config.theme.link);\n return element;\n }\n\n static override importDOM(): DOMConversionMap | null {\n return {\n a: () => ({\n conversion: convertAnchorElement,\n priority: 1\n })\n };\n }\n\n static override importJSON(\n serializedNode: BaseSerializedLinkNode | SerializedLinkNode | SerializedAutoLinkNode\n ): LinkNode {\n const node = $createLinkNode(serializedNode.url, {\n rel: serializedNode.rel,\n target: serializedNode.target,\n title: serializedNode.title\n });\n node.setFormat(serializedNode.format);\n node.setIndent(serializedNode.indent);\n node.setDirection(serializedNode.direction);\n return node;\n }\n\n override exportJSON(): BaseSerializedLinkNode | SerializedLinkNode | SerializedAutoLinkNode {\n return {\n ...super.exportJSON(),\n type: \"link-node\",\n version: 1\n };\n }\n}\n\nfunction convertAnchorElement(domNode: Node): DOMConversionOutput {\n let node = null;\n if (isHTMLAnchorElement(domNode)) {\n const content = domNode.textContent;\n if (content !== null && content !== \"\") {\n node = $createLinkNode(domNode.getAttribute(\"href\") || \"\", {\n rel: domNode.getAttribute(\"rel\"),\n target: domNode.getAttribute(\"target\"),\n title: domNode.getAttribute(\"title\")\n });\n }\n }\n return { node };\n}\n\nexport const $isLinkNode = (node: any): node is LinkNode => {\n return node instanceof LinkNode;\n};\n\nexport const $createLinkNode = (url: string, attributes: LinkAttributes = {}, key?: KeyType) => {\n return new LinkNode(url, attributes, key);\n};\n"],"mappings":"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"}
package/nodes/types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export declare type ThemeStyleType = "typography" | "colors" | "fonts";
2
- export interface ThemeStyleValue {
3
- styleId: string;
4
- type: ThemeStyleType;
5
- }
6
- export interface TextNodeThemeStyles {
7
- getThemeStyles: () => ThemeStyleValue[];
8
- setThemeStyles: (styles: ThemeStyleValue[]) => void;
9
- }
10
- export interface TypographyStylesNode {
11
- setTypography: (typographyStyleId: string) => void;
12
- getTypographyStyleId: () => string | undefined;
13
- clearTypographyStyle: () => void;
14
- hasTypographyStyle: () => boolean;
15
- }
package/nodes/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type ThemeStyleType = \"typography\" | \"colors\" | \"fonts\";\n\nexport interface ThemeStyleValue {\n styleId: string;\n type: ThemeStyleType;\n}\n\nexport interface TextNodeThemeStyles {\n getThemeStyles: () => ThemeStyleValue[];\n setThemeStyles: (styles: ThemeStyleValue[]) => void;\n}\n\n/*\n * Indicates that the node is implementing the typography styles\n */\nexport interface TypographyStylesNode {\n setTypography: (typographyStyleId: string) => void;\n getTypographyStyleId: () => string | undefined;\n clearTypographyStyle: () => void;\n hasTypographyStyle: () => boolean;\n}\n"],"mappings":""}
@@ -1,7 +0,0 @@
1
- import type { Klass, LexicalNode } from "lexical";
2
- export declare const WebinyNodes: ReadonlyArray<Klass<LexicalNode> | {
3
- replace: Klass<LexicalNode>;
4
- with: <T extends {
5
- new (...args: any): any;
6
- }>(node: InstanceType<T>) => LexicalNode;
7
- }>;
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WebinyNodes = void 0;
7
- var _lexical = require("lexical");
8
- var _code = require("@lexical/code");
9
- var _hashtag = require("@lexical/hashtag");
10
- var _link = require("@lexical/link");
11
- var _mark = require("@lexical/mark");
12
- var _overflow = require("@lexical/overflow");
13
- var _FontColorNode = require("./FontColorNode");
14
- var _TypographyElementNode = require("./TypographyElementNode");
15
- var _ListNode = require("./ListNode");
16
- var _ListItemNode = require("./ListItemNode");
17
- var _HeadingNode = require("./HeadingNode");
18
- var _ParagraphNode = require("./ParagraphNode");
19
- var _richText = require("@lexical/rich-text");
20
- var _QuoteNode = require("./QuoteNode");
21
- var _ImageNode = require("./ImageNode");
22
- var _linkNode = require("./link-node");
23
- // This is a list of all the nodes that our Lexical implementation supports OOTB.
24
- var WebinyNodes = [
25
- // These nodes are copy-pasted from Lexical and modified to fit our needs.
26
- // https://github.com/facebook/lexical/tree/main/packages/lexical-playground/src/nodes
27
- // https://github.com/facebook/lexical/tree/main/packages
28
- _ImageNode.ImageNode, _ListNode.ListNode, _ListItemNode.ListItemNode,
29
- // These nodes are directly imported from Lexical.
30
- _code.CodeNode, _hashtag.HashtagNode, _code.CodeHighlightNode, _link.AutoLinkNode, _overflow.OverflowNode, _mark.MarkNode,
31
- // Our custom nodes.
32
- _FontColorNode.FontColorNode, _TypographyElementNode.TypographyElementNode,
33
- // The following code replaces the built-in Lexical nodes with our custom ones.
34
- // https://lexical.dev/docs/concepts/node-replacement
35
- _ParagraphNode.ParagraphNode, {
36
- replace: _lexical.ParagraphNode,
37
- with: function _with() {
38
- return new _ParagraphNode.ParagraphNode();
39
- }
40
- }, _HeadingNode.HeadingNode, {
41
- replace: _richText.HeadingNode,
42
- with: function _with(node) {
43
- return new _HeadingNode.HeadingNode(node.getTag());
44
- }
45
- }, _QuoteNode.QuoteNode, {
46
- replace: _richText.QuoteNode,
47
- with: function _with() {
48
- return new _QuoteNode.QuoteNode();
49
- }
50
- }, _linkNode.LinkNode, {
51
- replace: _link.LinkNode,
52
- with: function _with(node) {
53
- return new _linkNode.LinkNode(node.getURL(), {
54
- rel: node.getRel(),
55
- title: node.getTitle(),
56
- target: node.getTarget()
57
- }, node.getKey());
58
- }
59
- }];
60
- exports.WebinyNodes = WebinyNodes;
@@ -1 +0,0 @@
1
- {"version":3,"names":["_lexical","require","_code","_hashtag","_link","_mark","_overflow","_FontColorNode","_TypographyElementNode","_ListNode","_ListItemNode","_HeadingNode","_ParagraphNode","_richText","_QuoteNode","_ImageNode","_linkNode","WebinyNodes","ImageNode","ListNode","ListItemNode","CodeNode","HashtagNode","CodeHighlightNode","AutoLinkNode","OverflowNode","MarkNode","FontColorNode","TypographyElementNode","ParagraphNode","replace","BaseParagraphNode","with","_with","HeadingNode","BaseHeadingNode","node","getTag","QuoteNode","BaseQuoteNode","LinkNode","BaseLinkNode","getURL","rel","getRel","title","getTitle","target","getTarget","getKey","exports"],"sources":["webinyNodes.ts"],"sourcesContent":["import type { Klass, LexicalNode } from \"lexical\";\nimport { ParagraphNode as BaseParagraphNode } from \"lexical\";\nimport { CodeHighlightNode, CodeNode } from \"@lexical/code\";\nimport { HashtagNode } from \"@lexical/hashtag\";\nimport { AutoLinkNode, LinkNode as BaseLinkNode } from \"@lexical/link\";\nimport { MarkNode } from \"@lexical/mark\";\nimport { OverflowNode } from \"@lexical/overflow\";\nimport { FontColorNode } from \"~/nodes/FontColorNode\";\nimport { TypographyElementNode } from \"~/nodes/TypographyElementNode\";\nimport { ListNode } from \"~/nodes/ListNode\";\nimport { ListItemNode } from \"~/nodes/ListItemNode\";\nimport { HeadingNode } from \"~/nodes/HeadingNode\";\nimport { ParagraphNode } from \"~/nodes/ParagraphNode\";\nimport { HeadingNode as BaseHeadingNode, QuoteNode as BaseQuoteNode } from \"@lexical/rich-text\";\nimport { QuoteNode } from \"~/nodes/QuoteNode\";\nimport { ImageNode } from \"~/nodes/ImageNode\";\nimport { LinkNode } from \"~/nodes/link-node\";\n\n// This is a list of all the nodes that our Lexical implementation supports OOTB.\nexport const WebinyNodes: ReadonlyArray<\n | Klass<LexicalNode>\n | {\n replace: Klass<LexicalNode>;\n with: <T extends { new (...args: any): any }>(node: InstanceType<T>) => LexicalNode;\n }\n> = [\n // These nodes are copy-pasted from Lexical and modified to fit our needs.\n // https://github.com/facebook/lexical/tree/main/packages/lexical-playground/src/nodes\n // https://github.com/facebook/lexical/tree/main/packages\n ImageNode,\n ListNode,\n ListItemNode,\n\n // These nodes are directly imported from Lexical.\n CodeNode,\n HashtagNode,\n CodeHighlightNode,\n AutoLinkNode,\n OverflowNode,\n MarkNode,\n\n // Our custom nodes.\n FontColorNode,\n TypographyElementNode,\n\n // The following code replaces the built-in Lexical nodes with our custom ones.\n // https://lexical.dev/docs/concepts/node-replacement\n ParagraphNode,\n {\n replace: BaseParagraphNode,\n with: () => {\n return new ParagraphNode();\n }\n },\n HeadingNode,\n {\n replace: BaseHeadingNode,\n with: (node: BaseHeadingNode) => {\n return new HeadingNode(node.getTag());\n }\n },\n QuoteNode,\n {\n replace: BaseQuoteNode,\n with: () => {\n return new QuoteNode();\n }\n },\n LinkNode,\n {\n replace: BaseLinkNode,\n with: (node: BaseLinkNode) => {\n return new LinkNode(\n node.getURL(),\n {\n rel: node.getRel(),\n title: node.getTitle(),\n target: node.getTarget()\n },\n node.getKey()\n );\n }\n }\n];\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AAEA;AACO,IAAMgB,WAMZ,GAAG;AACA;AACA;AACA;AACAC,oBAAS,EACTC,kBAAQ,EACRC,0BAAY;AAEZ;AACAC,cAAQ,EACRC,oBAAW,EACXC,uBAAiB,EACjBC,kBAAY,EACZC,sBAAY,EACZC,cAAQ;AAER;AACAC,4BAAa,EACbC,4CAAqB;AAErB;AACA;AACAC,4BAAa,EACb;EACIC,OAAO,EAAEC,sBAAiB;EAC1BC,IAAI,EAAE,SAAAC,MAAA,EAAM;IACR,OAAO,IAAIJ,4BAAa,CAAC,CAAC;EAC9B;AACJ,CAAC,EACDK,wBAAW,EACX;EACIJ,OAAO,EAAEK,qBAAe;EACxBH,IAAI,EAAE,SAAAC,MAACG,IAAqB,EAAK;IAC7B,OAAO,IAAIF,wBAAW,CAACE,IAAI,CAACC,MAAM,CAAC,CAAC,CAAC;EACzC;AACJ,CAAC,EACDC,oBAAS,EACT;EACIR,OAAO,EAAES,mBAAa;EACtBP,IAAI,EAAE,SAAAC,MAAA,EAAM;IACR,OAAO,IAAIK,oBAAS,CAAC,CAAC;EAC1B;AACJ,CAAC,EACDE,kBAAQ,EACR;EACIV,OAAO,EAAEW,cAAY;EACrBT,IAAI,EAAE,SAAAC,MAACG,IAAkB,EAAK;IAC1B,OAAO,IAAII,kBAAQ,CACfJ,IAAI,CAACM,MAAM,CAAC,CAAC,EACb;MACIC,GAAG,EAAEP,IAAI,CAACQ,MAAM,CAAC,CAAC;MAClBC,KAAK,EAAET,IAAI,CAACU,QAAQ,CAAC,CAAC;MACtBC,MAAM,EAAEX,IAAI,CAACY,SAAS,CAAC;IAC3B,CAAC,EACDZ,IAAI,CAACa,MAAM,CAAC,CAChB,CAAC;EACL;AACJ,CAAC,CACJ;AAACC,OAAA,CAAAjC,WAAA,GAAAA,WAAA"}
@@ -1,8 +0,0 @@
1
- import { FC } from "react";
2
- import { LexicalValue } from "../../types";
3
- interface LexicalUpdateStatePlugin {
4
- value: LexicalValue | null;
5
- readOnly?: boolean;
6
- }
7
- export declare const LexicalUpdateStatePlugin: FC<LexicalUpdateStatePlugin>;
8
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"names":["_LexicalComposerContext","require","_react","_interopRequireWildcard","_isValidLexicalData","_generateInitialLexicalValue","LexicalUpdateStatePlugin","_ref","value","_useLexicalComposerCo","useLexicalComposerContext","_useLexicalComposerCo2","_slicedToArray2","default","editor","useEffect","editorState","getEditorState","JSON","stringify","toJSON","initialEditorState","parseEditorState","isValidLexicalData","generateInitialLexicalValue","setEditorState","createElement","Fragment","exports"],"sources":["LexicalUpdateStatePlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport React, { FC, useEffect } from \"react\";\nimport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\nimport { generateInitialLexicalValue } from \"~/utils/generateInitialLexicalValue\";\nimport { LexicalValue } from \"~/types\";\n\ninterface LexicalUpdateStatePlugin {\n value: LexicalValue | null;\n readOnly?: boolean;\n}\n\n/*\n * Updates the lexical state if new value is provided to the lexical editor trough props\n */\nexport const LexicalUpdateStatePlugin: FC<LexicalUpdateStatePlugin> = ({\n value\n}): React.ReactElement => {\n const [editor] = useLexicalComposerContext();\n useEffect(() => {\n if (value && editor) {\n const editorState = editor.getEditorState();\n if (JSON.stringify(editorState.toJSON()) === value) {\n return;\n }\n\n const initialEditorState = editor.parseEditorState(\n isValidLexicalData(value)\n ? (value as string)\n : (generateInitialLexicalValue() as string)\n );\n editor.setEditorState(initialEditorState);\n }\n }, [value, editor]);\n\n return <></>;\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AAQA;AACA;AACA;AACO,IAAMK,wBAAsD,GAAG,SAAzDA,wBAAsDA,CAAAC,IAAA,EAEzC;EAAA,IADtBC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAEL,IAAAC,qBAAA,GAAiB,IAAAC,iDAAyB,EAAC,CAAC;IAAAC,sBAAA,OAAAC,eAAA,CAAAC,OAAA,EAAAJ,qBAAA;IAArCK,MAAM,GAAAH,sBAAA;EACb,IAAAI,gBAAS,EAAC,YAAM;IACZ,IAAIP,KAAK,IAAIM,MAAM,EAAE;MACjB,IAAME,WAAW,GAAGF,MAAM,CAACG,cAAc,CAAC,CAAC;MAC3C,IAAIC,IAAI,CAACC,SAAS,CAACH,WAAW,CAACI,MAAM,CAAC,CAAC,CAAC,KAAKZ,KAAK,EAAE;QAChD;MACJ;MAEA,IAAMa,kBAAkB,GAAGP,MAAM,CAACQ,gBAAgB,CAC9C,IAAAC,sCAAkB,EAACf,KAAK,CAAC,GAClBA,KAAK,GACL,IAAAgB,wDAA2B,EAAC,CACvC,CAAC;MACDV,MAAM,CAACW,cAAc,CAACJ,kBAAkB,CAAC;IAC7C;EACJ,CAAC,EAAE,CAACb,KAAK,EAAEM,MAAM,CAAC,CAAC;EAEnB,oBAAOZ,MAAA,CAAAW,OAAA,CAAAa,aAAA,CAAAxB,MAAA,CAAAW,OAAA,CAAAc,QAAA,MAAI,CAAC;AAChB,CAAC;AAACC,OAAA,CAAAtB,wBAAA,GAAAA,wBAAA"}
@@ -1,423 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- /**
9
- * This are fallback styles for Webiny.
10
- */
11
- .WebinyLexical__ltr {
12
- text-align: inherit;
13
- }
14
- .WebinyLexical__rtl {
15
- text-align: inherit;
16
- }
17
- .WebinyLexical__paragraph {
18
- margin: 0;
19
- position: relative;
20
- text-align: inherit;
21
- font-size: inherit;
22
- }
23
- .WebinyLexical__quote {
24
- margin: 0;
25
- margin-left: 20px;
26
- margin-bottom: 10px;
27
- font-size: 15px;
28
- color: rgb(101, 103, 107);
29
- border-left-color: rgb(206, 208, 212);
30
- border-left-width: 4px;
31
- border-left-style: solid;
32
- padding-left: 16px;
33
- }
34
- .WebinyLexical__h1 {
35
- font-size: 24px;
36
- font-weight: inherit;
37
- margin: inherit;
38
- }
39
-
40
- .WebinyLexical__h2 {
41
- font-size: 15px;
42
- font-weight: inherit;
43
- margin: inherit;
44
- }
45
-
46
- .WebinyLexical__h3 {
47
- font-size: 12px;
48
- font-weight: inherit;
49
- margin: inherit;
50
- }
51
-
52
- .WebinyLexical__textBold {
53
- font-weight: bold;
54
- }
55
-
56
- .WebinyLexical__textItalic {
57
- font-style: italic;
58
- }
59
- .WebinyLexical__textUnderline {
60
- text-decoration: underline;
61
- }
62
- .WebinyLexical__textStrikethrough {
63
- text-decoration: line-through;
64
- }
65
- .WebinyLexical__textUnderlineStrikethrough {
66
- text-decoration: underline line-through;
67
- }
68
-
69
- .WebinyLexical__textSubscript {
70
- font-size: 0.8em;
71
- vertical-align: sub !important;
72
- }
73
-
74
- .WebinyLexical__textSuperscript {
75
- font-size: 0.8em;
76
- vertical-align: super;
77
- }
78
-
79
- .WebinyLexical__textCode {
80
- background-color: rgb(240, 242, 245);
81
- padding: 1px 0.25rem;
82
- font-family: Menlo, Consolas, Monaco, monospace;
83
- font-size: 94%;
84
- }
85
- .WebinyLexical__hashtag {
86
- background-color: rgba(88, 144, 255, 0.15);
87
- border-bottom: 1px solid rgba(88, 144, 255, 0.3);
88
- }
89
- .WebinyLexical__link {
90
- color: rgb(33, 111, 219);
91
- text-decoration: none;
92
- }
93
- .WebinyLexical__link:hover {
94
- text-decoration: underline;
95
- }
96
- .WebinyLexical__code {
97
- background-color: rgb(240, 242, 245);
98
- font-family: Menlo, Consolas, Monaco, monospace;
99
- display: block;
100
- padding: 8px 8px 8px 52px;
101
- line-height: 1.53;
102
- font-size: 13px;
103
- margin: 0;
104
- margin-top: 8px;
105
- margin-bottom: 8px;
106
- tab-size: 2;
107
- /* white-space: pre; */
108
- overflow-x: auto;
109
- position: relative;
110
- }
111
- .WebinyLexical__code:before {
112
- content: attr(data-gutter);
113
- position: absolute;
114
- background-color: #eee;
115
- left: 0;
116
- top: 0;
117
- border-right: 1px solid #ccc;
118
- padding: 8px;
119
- color: #777;
120
- white-space: pre-wrap;
121
- text-align: right;
122
- min-width: 25px;
123
- }
124
- .WebinyLexical__table {
125
- border-collapse: collapse;
126
- border-spacing: 0;
127
- max-width: 100%;
128
- overflow-y: scroll;
129
- table-layout: fixed;
130
- width: calc(100% - 25px);
131
- margin: 30px 0;
132
- }
133
- .WebinyLexical__tableSelected {
134
- outline: 2px solid rgb(60, 132, 244);
135
- }
136
- .WebinyLexical__tableCell {
137
- border: 1px solid #bbb;
138
- min-width: 75px;
139
- vertical-align: top;
140
- text-align: start;
141
- padding: 6px 8px;
142
- position: relative;
143
- cursor: default;
144
- outline: none;
145
- }
146
- .WebinyLexical__tableCellSortedIndicator {
147
- display: block;
148
- opacity: 0.5;
149
- position: absolute;
150
- bottom: 0;
151
- left: 0;
152
- width: 100%;
153
- height: 4px;
154
- background-color: #999;
155
- }
156
- .WebinyLexical__tableCellResizer {
157
- position: absolute;
158
- right: -4px;
159
- height: 100%;
160
- width: 8px;
161
- cursor: ew-resize;
162
- z-index: 10;
163
- top: 0;
164
- }
165
- .WebinyLexical__tableCellHeader {
166
- background-color: #f2f3f5;
167
- text-align: start;
168
- }
169
- .WebinyLexical__tableCellSelected {
170
- background-color: #c9dbf0;
171
- }
172
- .WebinyLexical__tableCellPrimarySelected {
173
- border: 2px solid rgb(60, 132, 244);
174
- display: block;
175
- height: calc(100% - 2px);
176
- position: absolute;
177
- width: calc(100% - 2px);
178
- left: -1px;
179
- top: -1px;
180
- z-index: 2;
181
- }
182
- .WebinyLexical__tableCellEditing {
183
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
184
- border-radius: 3px;
185
- }
186
- .WebinyLexical__tableAddColumns {
187
- position: absolute;
188
- top: 0;
189
- width: 20px;
190
- background-color: #eee;
191
- height: 100%;
192
- right: 0;
193
- animation: table-controls 0.2s ease;
194
- border: 0;
195
- cursor: pointer;
196
- }
197
-
198
- .WebinyLexical__tableAddColumns:hover {
199
- background-color: #c9dbf0;
200
- }
201
- .WebinyLexical__tableAddRows {
202
- position: absolute;
203
- bottom: -25px;
204
- width: calc(100% - 25px);
205
- background-color: #eee;
206
- height: 20px;
207
- left: 0;
208
- animation: table-controls 0.2s ease;
209
- border: 0;
210
- cursor: pointer;
211
- }
212
- .WebinyLexical__tableAddRows:hover {
213
- background-color: #c9dbf0;
214
- }
215
- @keyframes table-controls {
216
- 0% {
217
- opacity: 0;
218
- }
219
- 100% {
220
- opacity: 1;
221
- }
222
- }
223
- .WebinyLexical__tableCellResizeRuler {
224
- display: block;
225
- position: absolute;
226
- width: 1px;
227
- background-color: rgb(60, 132, 244);
228
- height: 100%;
229
- top: 0;
230
- }
231
- .WebinyLexical__tableCellActionButtonContainer {
232
- display: block;
233
- right: 5px;
234
- top: 6px;
235
- position: absolute;
236
- z-index: 4;
237
- width: 20px;
238
- height: 20px;
239
- }
240
- .WebinyLexical__tableCellActionButton {
241
- background-color: #eee;
242
- display: block;
243
- border: 0;
244
- border-radius: 20px;
245
- width: 20px;
246
- height: 20px;
247
- color: #222;
248
- cursor: pointer;
249
- }
250
- .WebinyLexical__tableCellActionButton:hover {
251
- background-color: #ddd;
252
- }
253
- .WebinyLexical__characterLimit {
254
- display: inline;
255
- background-color: #ffbbbb !important;
256
- }
257
- .WebinyLexical__ol1 {
258
- list-style: auto;
259
- padding: 0;
260
- margin: 0;
261
- margin-left: 16px;
262
- list-style-position: inside;
263
- }
264
- .WebinyLexical__ol2 {
265
- list-style: initial;
266
- padding: 0;
267
- margin: 0;
268
- margin-left: 16px;
269
- list-style-type: upper-alpha;
270
- list-style-position: inside;
271
- }
272
- .WebinyLexical__ol3 {
273
- list-style: initial;
274
- list-style: auto;
275
- padding: 0;
276
- margin: 0;
277
- margin-left: 16px;
278
- list-style-type: lower-alpha;
279
- list-style-position: inside;
280
- }
281
- .WebinyLexical__ol4 {
282
- list-style: initial;
283
- padding: 0;
284
- margin: 0;
285
- margin-left: 16px;
286
- list-style-type: upper-roman;
287
- list-style-position: inside;
288
- }
289
- .WebinyLexical__ol5 {
290
- list-style: initial;
291
- padding: 0;
292
- margin: 0;
293
- margin-left: 16px;
294
- list-style-type: lower-roman;
295
- list-style-position: inside;
296
- }
297
- .WebinyLexical__ul {
298
- list-style: initial;
299
- padding: 0;
300
- margin: 0;
301
- margin-left: 16px;
302
- list-style-position: inside;
303
- }
304
- .WebinyLexical__listItem {
305
- margin: 0 32px;
306
- }
307
- .WebinyLexical__listItemChecked,
308
- .WebinyLexical__listItemUnchecked {
309
- position: relative;
310
- margin-left: 8px;
311
- margin-right: 8px;
312
- padding-left: 24px;
313
- padding-right: 24px;
314
- list-style-type: none;
315
- outline: none;
316
- }
317
- .WebinyLexical__listItemChecked {
318
- text-decoration: line-through;
319
- }
320
- .WebinyLexical__listItemUnchecked:before,
321
- .WebinyLexical__listItemChecked:before {
322
- content: '';
323
- width: 16px;
324
- height: 16px;
325
- top: 2px;
326
- left: 0;
327
- cursor: pointer;
328
- display: block;
329
- background-size: cover;
330
- position: absolute;
331
- }
332
- .WebinyLexical__listItemUnchecked[dir='rtl']:before,
333
- .WebinyLexical__listItemChecked[dir='rtl']:before {
334
- left: auto;
335
- right: 0;
336
- }
337
- .WebinyLexical__listItemUnchecked:focus:before,
338
- .WebinyLexical__listItemChecked:focus:before {
339
- box-shadow: 0 0 0 2px #a6cdfe;
340
- border-radius: 2px;
341
- }
342
- .WebinyLexical__listItemUnchecked:before {
343
- border: 1px solid #999;
344
- border-radius: 2px;
345
- }
346
- .WebinyLexical__listItemChecked:before {
347
- border: 1px solid rgb(61, 135, 245);
348
- border-radius: 2px;
349
- background-color: #3d87f5;
350
- background-repeat: no-repeat;
351
- }
352
- .WebinyLexical__listItemChecked:after {
353
- content: '';
354
- cursor: pointer;
355
- border-color: #fff;
356
- border-style: solid;
357
- position: absolute;
358
- display: block;
359
- top: 6px;
360
- width: 3px;
361
- left: 7px;
362
- height: 6px;
363
- transform: rotate(45deg);
364
- border-width: 0 2px 2px 0;
365
- }
366
- .WebinyLexical__nestedListItem {
367
- list-style-type: none;
368
- }
369
- .WebinyLexical__nestedListItem:before,
370
- .WebinyLexical__nestedListItem:after {
371
- display: none;
372
- }
373
- .WebinyLexical__tokenComment {
374
- color: slategray;
375
- }
376
- .WebinyLexical__tokenPunctuation {
377
- color: #999;
378
- }
379
- .WebinyLexical__tokenProperty {
380
- color: #905;
381
- }
382
- .WebinyLexical__tokenSelector {
383
- color: #690;
384
- }
385
- .WebinyLexical__tokenOperator {
386
- color: #9a6e3a;
387
- }
388
- .WebinyLexical__tokenAttr {
389
- color: #07a;
390
- }
391
- .WebinyLexical__tokenVariable {
392
- color: #e90;
393
- }
394
- .WebinyLexical__tokenFunction {
395
- color: #dd4a68;
396
- }
397
- .WebinyLexical__mark {
398
- background: rgba(255, 212, 0, 0.14);
399
- border-bottom: 2px solid rgba(255, 212, 0, 0.3);
400
- padding-bottom: 2px;
401
- }
402
- .WebinyLexical__markOverlap {
403
- background: rgba(255, 212, 0, 0.3);
404
- border-bottom: 2px solid rgba(255, 212, 0, 0.7);
405
- }
406
- .WebinyLexical__mark.selected {
407
- background: rgba(255, 212, 0, 0.5);
408
- border-bottom: 2px solid rgba(255, 212, 0, 1);
409
- }
410
- .WebinyLexical__markOverlap.selected {
411
- background: rgba(255, 212, 0, 0.7);
412
- border-bottom: 2px solid rgba(255, 212, 0, 0.7);
413
- }
414
- .WebinyLexical__embedBlock {
415
- user-select: none;
416
- }
417
- .WebinyLexical__embedBlockFocus {
418
- outline: 2px solid rgb(60, 132, 244);
419
- }
420
-
421
- .WebinyLexical__placeholder {
422
- text-align: left;
423
- }
@@ -1,9 +0,0 @@
1
- import type { EditorThemeClasses } from "lexical";
2
- import "./webinyLexicalTheme.css";
3
- import { ThemeEmotionMap } from "../types";
4
- export declare type WebinyTheme = {
5
- styles?: Record<string, any>;
6
- emotionMap?: ThemeEmotionMap;
7
- };
8
- export declare type WebinyEditorTheme = WebinyTheme & EditorThemeClasses;
9
- export declare const webinyEditorTheme: WebinyEditorTheme;
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.webinyEditorTheme = void 0;
7
- require("./webinyLexicalTheme.css");
8
- var webinyEditorTheme = {
9
- styles: undefined,
10
- emotionMap: undefined,
11
- characterLimit: "WebinyLexical__characterLimit",
12
- code: "WebinyLexical__code",
13
- codeHighlight: {
14
- atrule: "WebinyLexical__tokenAttr",
15
- attr: "WebinyLexical__tokenAttr",
16
- boolean: "WebinyLexical__tokenProperty",
17
- builtin: "WebinyLexical__tokenSelector",
18
- cdata: "WebinyLexical__tokenComment",
19
- char: "WebinyLexical__tokenSelector",
20
- class: "WebinyLexical__tokenFunction",
21
- "class-name": "WebinyLexical__tokenFunction",
22
- comment: "WebinyLexical__tokenComment",
23
- constant: "WebinyLexical__tokenProperty",
24
- deleted: "WebinyLexical__tokenProperty",
25
- doctype: "WebinyLexical__tokenComment",
26
- entity: "WebinyLexical__tokenOperator",
27
- function: "WebinyLexical__tokenFunction",
28
- important: "WebinyLexical__tokenVariable",
29
- inserted: "WebinyLexical__tokenSelector",
30
- keyword: "WebinyLexical__tokenAttr",
31
- namespace: "WebinyLexical__tokenVariable",
32
- number: "WebinyLexical__tokenProperty",
33
- operator: "WebinyLexical__tokenOperator",
34
- prolog: "WebinyLexical__tokenComment",
35
- property: "WebinyLexical__tokenProperty",
36
- punctuation: "WebinyLexical__tokenPunctuation",
37
- regex: "WebinyLexical__tokenVariable",
38
- selector: "WebinyLexical__tokenSelector",
39
- string: "WebinyLexical__tokenSelector",
40
- symbol: "WebinyLexical__tokenProperty",
41
- tag: "WebinyLexical__tokenProperty",
42
- url: "WebinyLexical__tokenOperator",
43
- variable: "WebinyLexical__tokenVariable"
44
- },
45
- embedBlock: {
46
- base: "WebinyLexical__embedBlock",
47
- focus: "WebinyLexical__embedBlockFocus"
48
- },
49
- hashtag: "WebinyLexical__hashtag",
50
- heading: {
51
- h1: "WebinyLexical__h1",
52
- h2: "WebinyLexical__h2",
53
- h3: "WebinyLexical__h3",
54
- h4: "WebinyLexical__h4",
55
- h5: "WebinyLexical__h5",
56
- h6: "WebinyLexical__h6"
57
- },
58
- link: "WebinyLexical__link",
59
- list: {
60
- listitem: "WebinyLexical__listItem",
61
- listitemChecked: "WebinyLexical__listItemChecked",
62
- listitemUnchecked: "WebinyLexical__listItemUnchecked",
63
- nested: {
64
- listitem: "WebinyLexical__nestedListItem"
65
- },
66
- olDepth: ["WebinyLexical__ol1", "WebinyLexical__ol2", "WebinyLexical__ol3", "WebinyLexical__ol4", "WebinyLexical__ol5"],
67
- ul: "WebinyLexical__ul"
68
- },
69
- ltr: "WebinyLexical__ltr",
70
- mark: "WebinyLexical__mark",
71
- markOverlap: "WebinyLexical__markOverlap",
72
- paragraph: "WebinyLexical__paragraph",
73
- quote: "WebinyLexical__quote",
74
- rtl: "WebinyLexical__rtl",
75
- text: {
76
- bold: "WebinyLexical__textBold",
77
- code: "WebinyLexical__textCode",
78
- italic: "WebinyLexical__textItalic",
79
- strikethrough: "WebinyLexical__textStrikethrough",
80
- subscript: "WebinyLexical__textSubscript",
81
- superscript: "WebinyLexical__textSuperscript",
82
- underline: "WebinyLexical__textUnderline",
83
- underlineStrikethrough: "WebinyLexical__textUnderlineStrikethrough"
84
- },
85
- fontColorText: "WebinyLexical__fontColorText",
86
- image: "editor-image",
87
- indent: "PlaygroundEditorTheme__indent",
88
- inlineImage: "inline-editor-image"
89
- };
90
- exports.webinyEditorTheme = webinyEditorTheme;