@mdxeditor/editor 0.9.0 → 0.10.0-alpha.1

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 (289) hide show
  1. package/dist/FormatConstants.d.ts +9 -0
  2. package/dist/FormatConstants.js +10 -0
  3. package/dist/MDXEditor.d.ts +31 -0
  4. package/dist/MDXEditor.js +105 -0
  5. package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +4 -0
  6. package/dist/directive-editors/AdmonitionDirectiveDescriptor.js +29 -0
  7. package/dist/directive-editors/GenericDirectiveEditor.d.ts +3 -0
  8. package/dist/directive-editors/GenericDirectiveEditor.js +32 -0
  9. package/dist/exportMarkdownFromLexical.d.ts +114 -0
  10. package/dist/exportMarkdownFromLexical.js +199 -0
  11. package/dist/gurx/index.d.ts +3 -0
  12. package/dist/gurx/react.d.ts +121 -0
  13. package/dist/gurx/react.js +112 -0
  14. package/dist/gurx/realm.d.ts +133 -0
  15. package/dist/gurx/realm.js +491 -0
  16. package/dist/gurx/realmFactory.d.ts +58 -0
  17. package/dist/gurx/realmFactory.js +28 -0
  18. package/dist/icons/add_column.svg.js +8 -0
  19. package/dist/icons/add_photo.svg.js +8 -0
  20. package/dist/icons/add_row.svg.js +8 -0
  21. package/dist/icons/arrow_drop_down.svg.js +8 -0
  22. package/dist/icons/arrow_right.svg.js +8 -0
  23. package/dist/icons/check.svg.js +8 -0
  24. package/dist/icons/close.svg.js +8 -0
  25. package/dist/icons/code.svg.js +8 -0
  26. package/dist/icons/content_copy.svg.js +8 -0
  27. package/dist/icons/delete.svg.js +8 -0
  28. package/dist/icons/delete_small.svg.js +8 -0
  29. package/dist/icons/deployed_code.svg.js +8 -0
  30. package/dist/icons/difference.svg.js +8 -0
  31. package/dist/icons/edit.svg.js +8 -0
  32. package/dist/icons/emergency_home.svg.js +8 -0
  33. package/dist/icons/format_align_center.svg.js +8 -0
  34. package/dist/icons/format_align_left.svg.js +8 -0
  35. package/dist/icons/format_align_right.svg.js +8 -0
  36. package/dist/icons/format_bold.svg.js +8 -0
  37. package/dist/icons/format_italic.svg.js +8 -0
  38. package/dist/icons/format_list_bulleted.svg.js +8 -0
  39. package/dist/icons/format_list_numbered.svg.js +8 -0
  40. package/dist/icons/format_underlined.svg.js +8 -0
  41. package/dist/icons/frame_source.svg.js +8 -0
  42. package/dist/icons/frontmatter.svg.js +8 -0
  43. package/dist/icons/horizontal_rule.svg.js +8 -0
  44. package/dist/icons/insert_col_left.svg.js +8 -0
  45. package/dist/icons/insert_col_right.svg.js +8 -0
  46. package/dist/icons/insert_row_above.svg.js +8 -0
  47. package/dist/icons/insert_row_below.svg.js +8 -0
  48. package/dist/icons/link.svg.js +8 -0
  49. package/dist/icons/link_off.svg.js +8 -0
  50. package/dist/icons/markdown.svg.js +8 -0
  51. package/dist/icons/more_horiz.svg.js +8 -0
  52. package/dist/icons/open_in_new.svg.js +8 -0
  53. package/dist/icons/redo.svg.js +8 -0
  54. package/dist/icons/rich_text.svg.js +8 -0
  55. package/dist/icons/settings.svg.js +8 -0
  56. package/dist/icons/table.svg.js +8 -0
  57. package/dist/icons/undo.svg.js +8 -0
  58. package/dist/importMarkdownToLexical.d.ts +84 -0
  59. package/dist/importMarkdownToLexical.js +65 -0
  60. package/dist/index.d.ts +49 -1094
  61. package/dist/index.js +133 -72
  62. package/dist/jsx-editors/GenericJsxEditor.d.ts +3 -0
  63. package/dist/jsx-editors/GenericJsxEditor.js +56 -0
  64. package/dist/node_modules/react-diff-view/style/index.css.js +4 -0
  65. package/dist/plugins/codeblock/CodeBlockNode.d.ts +99 -0
  66. package/dist/plugins/codeblock/CodeBlockNode.js +155 -0
  67. package/dist/plugins/codeblock/CodeBlockVisitor.d.ts +4 -0
  68. package/dist/plugins/codeblock/CodeBlockVisitor.js +14 -0
  69. package/dist/plugins/codeblock/MdastCodeVisitor.d.ts +3 -0
  70. package/dist/plugins/codeblock/MdastCodeVisitor.js +16 -0
  71. package/dist/plugins/codeblock/index.d.ts +604 -0
  72. package/dist/plugins/codeblock/index.js +73 -0
  73. package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +3 -0
  74. package/dist/plugins/codemirror/CodeMirrorEditor.js +33 -0
  75. package/dist/plugins/codemirror/index.d.ts +786 -0
  76. package/dist/plugins/codemirror/index.js +62 -0
  77. package/dist/plugins/core/LexicalLinebreakVisitor.d.ts +4 -0
  78. package/dist/plugins/core/LexicalLinebreakVisitor.js +10 -0
  79. package/dist/plugins/core/LexicalParagraphVisitor.d.ts +4 -0
  80. package/dist/plugins/core/LexicalParagraphVisitor.js +10 -0
  81. package/dist/plugins/core/LexicalRootVisitor.d.ts +4 -0
  82. package/dist/plugins/core/LexicalRootVisitor.js +10 -0
  83. package/dist/plugins/core/LexicalTextVisitor.d.ts +5 -0
  84. package/dist/plugins/core/LexicalTextVisitor.js +85 -0
  85. package/dist/plugins/core/MdastFormattingVisitor.d.ts +4 -0
  86. package/dist/plugins/core/MdastFormattingVisitor.js +36 -0
  87. package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +3 -0
  88. package/dist/plugins/core/MdastInlineCodeVisitor.js +11 -0
  89. package/dist/plugins/core/MdastParagraphVisitor.d.ts +3 -0
  90. package/dist/plugins/core/MdastParagraphVisitor.js +15 -0
  91. package/dist/plugins/core/MdastRootVisitor.d.ts +3 -0
  92. package/dist/plugins/core/MdastRootVisitor.js +9 -0
  93. package/dist/plugins/core/MdastTextVisitor.d.ts +3 -0
  94. package/dist/plugins/core/MdastTextVisitor.js +10 -0
  95. package/dist/plugins/core/NestedLexicalEditor.d.ts +69 -0
  96. package/dist/plugins/core/NestedLexicalEditor.js +181 -0
  97. package/dist/plugins/core/PropertyPopover.d.ts +8 -0
  98. package/dist/plugins/core/PropertyPopover.js +36 -0
  99. package/dist/plugins/core/SharedHistoryPlugin.d.ts +2 -0
  100. package/dist/plugins/core/SharedHistoryPlugin.js +10 -0
  101. package/dist/plugins/core/index.d.ts +419 -0
  102. package/dist/plugins/core/index.js +343 -0
  103. package/dist/plugins/core/ui/PopoverUtils.d.ts +4 -0
  104. package/dist/plugins/core/ui/PopoverUtils.js +17 -0
  105. package/dist/plugins/diff-source/DiffSourceWrapper.d.ts +4 -0
  106. package/dist/plugins/diff-source/DiffSourceWrapper.js +11 -0
  107. package/dist/plugins/diff-source/DiffViewer.d.ts +2 -0
  108. package/dist/plugins/diff-source/DiffViewer.js +18 -0
  109. package/dist/plugins/diff-source/SourceEditor.d.ts +2 -0
  110. package/dist/plugins/diff-source/SourceEditor.js +25 -0
  111. package/dist/plugins/diff-source/index.d.ts +530 -0
  112. package/dist/plugins/diff-source/index.js +55 -0
  113. package/dist/plugins/directives/DirectiveNode.d.ts +51 -0
  114. package/dist/plugins/directives/DirectiveNode.js +92 -0
  115. package/dist/plugins/directives/DirectiveVisitor.d.ts +4 -0
  116. package/dist/plugins/directives/DirectiveVisitor.js +10 -0
  117. package/dist/plugins/directives/MdastDirectiveVisitor.d.ts +3 -0
  118. package/dist/plugins/directives/MdastDirectiveVisitor.js +13 -0
  119. package/dist/plugins/directives/index.d.ts +591 -0
  120. package/dist/plugins/directives/index.js +53 -0
  121. package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +6 -0
  122. package/dist/plugins/frontmatter/FrontmatterEditor.js +69 -0
  123. package/dist/plugins/frontmatter/FrontmatterNode.d.ts +35 -0
  124. package/dist/plugins/frontmatter/FrontmatterNode.js +71 -0
  125. package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.d.ts +4 -0
  126. package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.js +10 -0
  127. package/dist/plugins/frontmatter/MdastFrontmatterVisitor.d.ts +3 -0
  128. package/dist/plugins/frontmatter/MdastFrontmatterVisitor.js +10 -0
  129. package/dist/plugins/frontmatter/index.d.ts +510 -0
  130. package/dist/plugins/frontmatter/index.js +53 -0
  131. package/dist/plugins/headings/LexicalHeadingVisitor.d.ts +4 -0
  132. package/dist/plugins/headings/LexicalHeadingVisitor.js +11 -0
  133. package/dist/plugins/headings/MdastHeadingVisitor.d.ts +3 -0
  134. package/dist/plugins/headings/MdastHeadingVisitor.js +10 -0
  135. package/dist/plugins/headings/index.d.ts +105 -0
  136. package/dist/plugins/headings/index.js +20 -0
  137. package/dist/plugins/image/ImageEditor.d.ts +7 -0
  138. package/dist/{ImageEditor-ad505654.js → plugins/image/ImageEditor.js} +12 -47
  139. package/dist/plugins/image/ImageNode.d.ts +53 -0
  140. package/dist/plugins/image/ImageNode.js +108 -0
  141. package/dist/plugins/image/LexicalImageVisitor.d.ts +4 -0
  142. package/dist/plugins/image/LexicalImageVisitor.js +15 -0
  143. package/dist/plugins/image/MdastImageVisitor.d.ts +3 -0
  144. package/dist/plugins/image/MdastImageVisitor.js +16 -0
  145. package/dist/plugins/image/index.d.ts +541 -0
  146. package/dist/plugins/image/index.js +244 -0
  147. package/dist/plugins/jsx/LexicalJsxNode.d.ts +54 -0
  148. package/dist/plugins/jsx/LexicalJsxNode.js +99 -0
  149. package/dist/plugins/jsx/LexicalJsxVisitor.d.ts +4 -0
  150. package/dist/plugins/jsx/LexicalJsxVisitor.js +12 -0
  151. package/dist/plugins/jsx/MdastMdxJsEsmVisitor.d.ts +3 -0
  152. package/dist/plugins/jsx/MdastMdxJsEsmVisitor.js +8 -0
  153. package/dist/plugins/jsx/MdastMdxJsxElementVisitor.d.ts +3 -0
  154. package/dist/plugins/jsx/MdastMdxJsxElementVisitor.js +12 -0
  155. package/dist/plugins/jsx/index.d.ts +461 -0
  156. package/dist/plugins/jsx/index.js +37 -0
  157. package/dist/plugins/link/LexicalLinkVisitor.d.ts +4 -0
  158. package/dist/plugins/link/LexicalLinkVisitor.js +10 -0
  159. package/dist/plugins/link/MdastLinkVisitor.d.ts +3 -0
  160. package/dist/plugins/link/MdastLinkVisitor.js +14 -0
  161. package/dist/plugins/link/index.d.ts +108 -0
  162. package/dist/plugins/link/index.js +24 -0
  163. package/dist/plugins/link-dialog/LinkDialog.d.ts +12 -0
  164. package/dist/plugins/link-dialog/LinkDialog.js +174 -0
  165. package/dist/plugins/link-dialog/index.d.ts +496 -0
  166. package/dist/plugins/link-dialog/index.js +242 -0
  167. package/dist/plugins/lists/LexicalListItemVisitor.d.ts +4 -0
  168. package/dist/plugins/lists/LexicalListItemVisitor.js +22 -0
  169. package/dist/plugins/lists/LexicalListVisitor.d.ts +4 -0
  170. package/dist/plugins/lists/LexicalListVisitor.js +14 -0
  171. package/dist/plugins/lists/MdastListItemVisitor.d.ts +3 -0
  172. package/dist/plugins/lists/MdastListItemVisitor.js +10 -0
  173. package/dist/plugins/lists/MdastListVisitor.d.ts +3 -0
  174. package/dist/plugins/lists/MdastListVisitor.js +18 -0
  175. package/dist/plugins/lists/index.d.ts +521 -0
  176. package/dist/plugins/lists/index.js +111 -0
  177. package/dist/plugins/markdown-shortcut/index.d.ts +51 -0
  178. package/dist/plugins/markdown-shortcut/index.js +34 -0
  179. package/dist/plugins/quote/LexicalQuoteVisitor.d.ts +4 -0
  180. package/dist/plugins/quote/LexicalQuoteVisitor.js +14 -0
  181. package/dist/plugins/quote/MdastBlockQuoteVisitor.d.ts +3 -0
  182. package/dist/plugins/quote/MdastBlockQuoteVisitor.js +10 -0
  183. package/dist/plugins/quote/index.d.ts +348 -0
  184. package/dist/plugins/quote/index.js +26 -0
  185. package/dist/plugins/sandpack/SandpackEditor.d.ts +7 -0
  186. package/dist/plugins/sandpack/SandpackEditor.js +35 -0
  187. package/dist/plugins/sandpack/index.d.ts +826 -0
  188. package/dist/plugins/sandpack/index.js +93 -0
  189. package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +4 -0
  190. package/dist/{useCodeMirrorRef-177e9901.js → plugins/sandpack/useCodeMirrorRef.js} +22 -10
  191. package/dist/plugins/table/LexicalTableVisitor.d.ts +4 -0
  192. package/dist/plugins/table/LexicalTableVisitor.js +10 -0
  193. package/dist/plugins/table/MdastTableVisitor.d.ts +3 -0
  194. package/dist/plugins/table/MdastTableVisitor.js +10 -0
  195. package/dist/plugins/table/TableEditor.d.ts +21 -0
  196. package/dist/{TableEditor-44bef804.js → plugins/table/TableEditor.js} +109 -161
  197. package/dist/plugins/table/TableNode.d.ts +52 -0
  198. package/dist/plugins/table/TableNode.js +147 -0
  199. package/dist/plugins/table/index.d.ts +511 -0
  200. package/dist/plugins/table/index.js +59 -0
  201. package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.d.ts +4 -0
  202. package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.js +10 -0
  203. package/dist/plugins/thematic-break/MdastThematicBreakVisitor.d.ts +3 -0
  204. package/dist/plugins/thematic-break/MdastThematicBreakVisitor.js +10 -0
  205. package/dist/plugins/thematic-break/index.d.ts +510 -0
  206. package/dist/plugins/thematic-break/index.js +39 -0
  207. package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +2 -0
  208. package/dist/plugins/toolbar/components/BlockTypeSelect.js +52 -0
  209. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +2 -0
  210. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +35 -0
  211. package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +2 -0
  212. package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +30 -0
  213. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +2 -0
  214. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +32 -0
  215. package/dist/plugins/toolbar/components/CodeToggle.d.ts +2 -0
  216. package/dist/plugins/toolbar/components/CodeToggle.js +20 -0
  217. package/dist/plugins/toolbar/components/CreateLink.d.ts +2 -0
  218. package/dist/plugins/toolbar/components/CreateLink.js +11 -0
  219. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +4 -0
  220. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +27 -0
  221. package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +2 -0
  222. package/dist/plugins/toolbar/components/InsertAdmonition.js +29 -0
  223. package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +2 -0
  224. package/dist/plugins/toolbar/components/InsertCodeBlock.js +20 -0
  225. package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +2 -0
  226. package/dist/plugins/toolbar/components/InsertFrontmatter.js +11 -0
  227. package/dist/plugins/toolbar/components/InsertImage.d.ts +2 -0
  228. package/dist/plugins/toolbar/components/InsertImage.js +23 -0
  229. package/dist/plugins/toolbar/components/InsertSandpack.d.ts +2 -0
  230. package/dist/plugins/toolbar/components/InsertSandpack.js +13 -0
  231. package/dist/plugins/toolbar/components/InsertTable.d.ts +2 -0
  232. package/dist/plugins/toolbar/components/InsertTable.js +20 -0
  233. package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +2 -0
  234. package/dist/plugins/toolbar/components/InsertThematicBreak.js +11 -0
  235. package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +2 -0
  236. package/dist/plugins/toolbar/components/KitchenSinkToolbar.js +58 -0
  237. package/dist/plugins/toolbar/components/ListsToggle.d.ts +2 -0
  238. package/dist/plugins/toolbar/components/ListsToggle.js +23 -0
  239. package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +2 -0
  240. package/dist/plugins/toolbar/components/ShowSandpackInfo.js +32 -0
  241. package/dist/plugins/toolbar/components/UndoRedo.d.ts +2 -0
  242. package/dist/plugins/toolbar/components/UndoRedo.js +59 -0
  243. package/dist/plugins/toolbar/index.d.ts +416 -0
  244. package/dist/plugins/toolbar/index.js +39 -0
  245. package/dist/plugins/toolbar/primitives/DialogButton.d.ts +40 -0
  246. package/dist/plugins/toolbar/primitives/DialogButton.js +115 -0
  247. package/dist/plugins/toolbar/primitives/TooltipWrap.d.ts +5 -0
  248. package/dist/plugins/toolbar/primitives/TooltipWrap.js +12 -0
  249. package/dist/plugins/toolbar/primitives/select.d.ts +31 -0
  250. package/dist/plugins/toolbar/primitives/select.js +44 -0
  251. package/dist/plugins/toolbar/primitives/toolbar.d.ts +85 -0
  252. package/dist/plugins/toolbar/primitives/toolbar.js +111 -0
  253. package/dist/style.css +480 -240
  254. package/dist/styles/globals.css.js +4 -0
  255. package/dist/styles/lexical-theme.module.css.js +53 -0
  256. package/dist/styles/lexicalTheme.d.ts +2 -0
  257. package/dist/styles/lexicalTheme.js +28 -0
  258. package/dist/styles/ui.module.css.js +227 -0
  259. package/dist/utils/detectMac.d.ts +2 -0
  260. package/dist/utils/detectMac.js +6 -0
  261. package/dist/utils/fp.d.ts +47 -0
  262. package/dist/utils/fp.js +10 -0
  263. package/dist/utils/isPartOftheEditorUI.d.ts +1 -0
  264. package/dist/utils/isPartOftheEditorUI.js +12 -0
  265. package/dist/utils/lexicalHelpers.d.ts +11 -0
  266. package/dist/utils/lexicalHelpers.js +49 -0
  267. package/dist/utils/uuid4.d.ts +1 -0
  268. package/dist/utils/uuid4.js +10 -0
  269. package/dist/utils/voidEmitter.d.ts +14 -0
  270. package/dist/utils/voidEmitter.js +15 -0
  271. package/package.json +184 -14
  272. package/dist/CodeBlockEditor-ce4c85ed.js +0 -79
  273. package/dist/CodeBlockEditor-ed222322.cjs +0 -1
  274. package/dist/FrontmatterEditor-914aa241.cjs +0 -1
  275. package/dist/FrontmatterEditor-e2f25a6a.js +0 -118
  276. package/dist/ImageEditor-c4e65554.cjs +0 -1
  277. package/dist/JsxEditor-6cff258d.cjs +0 -1
  278. package/dist/JsxEditor-88d55ef8.js +0 -108
  279. package/dist/LeafDirectiveEditor-0e1328e6.cjs +0 -1
  280. package/dist/LeafDirectiveEditor-34ead530.js +0 -59
  281. package/dist/SandpackEditor-a999ca47.cjs +0 -1
  282. package/dist/SandpackEditor-b1e22784.js +0 -99
  283. package/dist/SourceEditor-0c46ec47.cjs +0 -1
  284. package/dist/SourceEditor-e509d0a5.js +0 -64
  285. package/dist/TableEditor-ced03ce4.cjs +0 -1
  286. package/dist/index-21fcefae.cjs +0 -1
  287. package/dist/index-ce0832cc.js +0 -4361
  288. package/dist/index.cjs +0 -1
  289. package/dist/useCodeMirrorRef-6cb866bd.cjs +0 -1
@@ -0,0 +1,62 @@
1
+ import { coreSystem } from "../core/index.js";
2
+ import { codeBlockSystem } from "../codeblock/index.js";
3
+ import { CodeMirrorEditor } from "./CodeMirrorEditor.js";
4
+ import { system } from "../../gurx/realmFactory.js";
5
+ import { realmPlugin } from "../../gurx/react.js";
6
+ const defaultCodeBlockLanguages = {
7
+ js: "JavaScript",
8
+ ts: "TypeScript",
9
+ tsx: "TypeScript (React)",
10
+ jsx: "JavaScript (React)",
11
+ css: "CSS"
12
+ };
13
+ const codeMirrorSystem = system(
14
+ (r, [, { insertCodeBlock }]) => {
15
+ const codeBlockLanguages = r.node(defaultCodeBlockLanguages);
16
+ const insertCodeMirror = r.node();
17
+ r.link(
18
+ r.pipe(
19
+ insertCodeMirror,
20
+ r.o.map(({ language, code }) => {
21
+ return {
22
+ code,
23
+ language,
24
+ meta: ""
25
+ };
26
+ })
27
+ ),
28
+ insertCodeBlock
29
+ );
30
+ return {
31
+ codeBlockLanguages,
32
+ insertCodeMirror
33
+ };
34
+ },
35
+ [coreSystem, codeBlockSystem]
36
+ );
37
+ const [
38
+ /** @internal */
39
+ codeMirrorPlugin,
40
+ /** @internal */
41
+ codeMirrorHooks
42
+ ] = realmPlugin({
43
+ id: "codemirror",
44
+ systemSpec: codeMirrorSystem,
45
+ applyParamsToSystem(r, params) {
46
+ r.pubKey("codeBlockLanguages", params.codeBlockLanguages);
47
+ },
48
+ init(r, { codeBlockLanguages }) {
49
+ r.pubKey("appendCodeBlockEditorDescriptor", {
50
+ match(language, meta) {
51
+ return codeBlockLanguages.hasOwnProperty(language) && meta === "";
52
+ },
53
+ priority: 1,
54
+ Editor: CodeMirrorEditor
55
+ });
56
+ }
57
+ });
58
+ export {
59
+ codeMirrorHooks,
60
+ codeMirrorPlugin,
61
+ codeMirrorSystem
62
+ };
@@ -0,0 +1,4 @@
1
+ import { LineBreakNode } from 'lexical';
2
+ import * as Mdast from 'mdast';
3
+ import { LexicalExportVisitor } from '../../exportMarkdownFromLexical';
4
+ export declare const LexicalLinebreakVisitor: LexicalExportVisitor<LineBreakNode, Mdast.Text>;
@@ -0,0 +1,10 @@
1
+ import { $isLineBreakNode } from "lexical";
2
+ const LexicalLinebreakVisitor = {
3
+ testLexicalNode: $isLineBreakNode,
4
+ visitLexicalNode: ({ mdastParent, actions }) => {
5
+ actions.appendToParent(mdastParent, { type: "text", value: "\n" });
6
+ }
7
+ };
8
+ export {
9
+ LexicalLinebreakVisitor
10
+ };
@@ -0,0 +1,4 @@
1
+ import { ParagraphNode } from 'lexical';
2
+ import * as Mdast from 'mdast';
3
+ import { LexicalExportVisitor } from '../../exportMarkdownFromLexical';
4
+ export declare const LexicalParagraphVisitor: LexicalExportVisitor<ParagraphNode, Mdast.Paragraph>;
@@ -0,0 +1,10 @@
1
+ import { $isParagraphNode } from "lexical";
2
+ const LexicalParagraphVisitor = {
3
+ testLexicalNode: $isParagraphNode,
4
+ visitLexicalNode: ({ actions }) => {
5
+ actions.addAndStepInto("paragraph");
6
+ }
7
+ };
8
+ export {
9
+ LexicalParagraphVisitor
10
+ };
@@ -0,0 +1,4 @@
1
+ import { RootNode as LexicalRootNode } from 'lexical';
2
+ import * as Mdast from 'mdast';
3
+ import { LexicalExportVisitor } from '../../exportMarkdownFromLexical';
4
+ export declare const LexicalRootVisitor: LexicalExportVisitor<LexicalRootNode, Mdast.Content>;
@@ -0,0 +1,10 @@
1
+ import { $isRootNode } from "lexical";
2
+ const LexicalRootVisitor = {
3
+ testLexicalNode: $isRootNode,
4
+ visitLexicalNode: ({ actions }) => {
5
+ actions.addAndStepInto("root");
6
+ }
7
+ };
8
+ export {
9
+ LexicalRootVisitor
10
+ };
@@ -0,0 +1,5 @@
1
+ import { TextNode } from 'lexical';
2
+ import * as Mdast from 'mdast';
3
+ import { LexicalExportVisitor } from '../../exportMarkdownFromLexical';
4
+ export declare function isMdastText(mdastNode: Mdast.Content): mdastNode is Mdast.Text;
5
+ export declare const LexicalTextVisitor: LexicalExportVisitor<TextNode, Mdast.Text>;
@@ -0,0 +1,85 @@
1
+ import { $isTextNode } from "lexical";
2
+ import { IS_CODE, IS_ITALIC, IS_BOLD, IS_UNDERLINE } from "../../FormatConstants.js";
3
+ function isMdastText(mdastNode) {
4
+ return mdastNode.type === "text";
5
+ }
6
+ const LexicalTextVisitor = {
7
+ shouldJoin: (prevNode, currentNode) => {
8
+ return ["text", "emphasis", "strong", "mdxJsxTextElement"].includes(prevNode.type) && prevNode.type === currentNode.type;
9
+ },
10
+ join(prevNode, currentNode) {
11
+ if (isMdastText(prevNode) && isMdastText(currentNode)) {
12
+ return {
13
+ type: "text",
14
+ value: prevNode.value + currentNode.value
15
+ };
16
+ } else {
17
+ return {
18
+ ...prevNode,
19
+ children: [...prevNode.children, ...currentNode.children]
20
+ };
21
+ }
22
+ },
23
+ testLexicalNode: $isTextNode,
24
+ visitLexicalNode: ({ lexicalNode, mdastParent, actions }) => {
25
+ const previousSibling = lexicalNode.getPreviousSibling();
26
+ const prevFormat = $isTextNode(previousSibling) ? previousSibling.getFormat() : 0;
27
+ const textContent = lexicalNode.getTextContent();
28
+ const format = lexicalNode.getFormat() ?? 0;
29
+ if (format & IS_CODE) {
30
+ actions.addAndStepInto("inlineCode", {
31
+ value: textContent
32
+ });
33
+ return;
34
+ }
35
+ let localParentNode = mdastParent;
36
+ if (prevFormat & format & IS_ITALIC) {
37
+ localParentNode = actions.appendToParent(localParentNode, {
38
+ type: "emphasis",
39
+ children: []
40
+ });
41
+ }
42
+ if (prevFormat & format & IS_BOLD) {
43
+ localParentNode = actions.appendToParent(localParentNode, {
44
+ type: "strong",
45
+ children: []
46
+ });
47
+ }
48
+ if (prevFormat & format & IS_UNDERLINE) {
49
+ localParentNode = actions.appendToParent(localParentNode, {
50
+ type: "mdxJsxTextElement",
51
+ name: "u",
52
+ children: [],
53
+ attributes: []
54
+ });
55
+ }
56
+ if (format & IS_ITALIC && !(prevFormat & IS_ITALIC)) {
57
+ localParentNode = actions.appendToParent(localParentNode, {
58
+ type: "emphasis",
59
+ children: []
60
+ });
61
+ }
62
+ if (format & IS_BOLD && !(prevFormat & IS_BOLD)) {
63
+ localParentNode = actions.appendToParent(localParentNode, {
64
+ type: "strong",
65
+ children: []
66
+ });
67
+ }
68
+ if (format & IS_UNDERLINE && !(prevFormat & IS_UNDERLINE)) {
69
+ localParentNode = actions.appendToParent(localParentNode, {
70
+ type: "mdxJsxTextElement",
71
+ name: "u",
72
+ children: [],
73
+ attributes: []
74
+ });
75
+ }
76
+ actions.appendToParent(localParentNode, {
77
+ type: "text",
78
+ value: textContent
79
+ });
80
+ }
81
+ };
82
+ export {
83
+ LexicalTextVisitor,
84
+ isMdastText
85
+ };
@@ -0,0 +1,4 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdxJsxTextElement } from 'mdast-util-mdx';
3
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
4
+ export declare const MdastFormattingVisitor: MdastImportVisitor<Mdast.Emphasis | Mdast.Strong | MdxJsxTextElement>;
@@ -0,0 +1,36 @@
1
+ import { IS_UNDERLINE, IS_ITALIC, IS_BOLD } from "../../FormatConstants.js";
2
+ function isOpeningUnderlineNode(node) {
3
+ return node.type === "html" && node.value === "<u>";
4
+ }
5
+ function isClosingUnderlineNode(node) {
6
+ return node.type === "html" && node.value === "</u>";
7
+ }
8
+ function isJsxUnderlineNode(node) {
9
+ return node.type === "mdxJsxTextElement" && node.name === "u";
10
+ }
11
+ const MdastFormattingVisitor = {
12
+ testNode(mdastNode) {
13
+ return mdastNode.type === "emphasis" || mdastNode.type === "strong" || isJsxUnderlineNode(mdastNode) || isOpeningUnderlineNode(mdastNode) || isClosingUnderlineNode(mdastNode);
14
+ },
15
+ visitNode({ mdastNode, lexicalParent, actions, mdastParent }) {
16
+ if (isOpeningUnderlineNode(mdastNode)) {
17
+ actions.addFormatting(IS_UNDERLINE, mdastParent);
18
+ return;
19
+ }
20
+ if (isClosingUnderlineNode(mdastNode)) {
21
+ actions.removeFormatting(IS_UNDERLINE, mdastParent);
22
+ return;
23
+ }
24
+ if (mdastNode.type === "emphasis") {
25
+ actions.addFormatting(IS_ITALIC);
26
+ } else if (mdastNode.type === "strong") {
27
+ actions.addFormatting(IS_BOLD);
28
+ } else if (isJsxUnderlineNode(mdastNode)) {
29
+ actions.addFormatting(IS_UNDERLINE);
30
+ }
31
+ actions.visitChildren(mdastNode, lexicalParent);
32
+ }
33
+ };
34
+ export {
35
+ MdastFormattingVisitor
36
+ };
@@ -0,0 +1,3 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
3
+ export declare const MdastInlineCodeVisitor: MdastImportVisitor<Mdast.InlineCode>;
@@ -0,0 +1,11 @@
1
+ import { $createTextNode } from "lexical";
2
+ import { IS_CODE } from "../../FormatConstants.js";
3
+ const MdastInlineCodeVisitor = {
4
+ testNode: "inlineCode",
5
+ visitNode({ mdastNode, actions }) {
6
+ actions.addAndStepInto($createTextNode(mdastNode.value).setFormat(IS_CODE));
7
+ }
8
+ };
9
+ export {
10
+ MdastInlineCodeVisitor
11
+ };
@@ -0,0 +1,3 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
3
+ export declare const MdastParagraphVisitor: MdastImportVisitor<Mdast.Paragraph>;
@@ -0,0 +1,15 @@
1
+ import { $createParagraphNode } from "lexical";
2
+ const lexicalTypesThatShouldSkipParagraphs = ["listitem", "quote", "admonition"];
3
+ const MdastParagraphVisitor = {
4
+ testNode: "paragraph",
5
+ visitNode: function({ mdastNode, lexicalParent, actions }) {
6
+ if (lexicalTypesThatShouldSkipParagraphs.includes(lexicalParent.getType())) {
7
+ actions.visitChildren(mdastNode, lexicalParent);
8
+ } else {
9
+ actions.addAndStepInto($createParagraphNode());
10
+ }
11
+ }
12
+ };
13
+ export {
14
+ MdastParagraphVisitor
15
+ };
@@ -0,0 +1,3 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
3
+ export declare const MdastRootVisitor: MdastImportVisitor<Mdast.Content>;
@@ -0,0 +1,9 @@
1
+ const MdastRootVisitor = {
2
+ testNode: "root",
3
+ visitNode({ actions, mdastNode, lexicalParent }) {
4
+ actions.visitChildren(mdastNode, lexicalParent);
5
+ }
6
+ };
7
+ export {
8
+ MdastRootVisitor
9
+ };
@@ -0,0 +1,3 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
3
+ export declare const MdastTextVisitor: MdastImportVisitor<Mdast.Text>;
@@ -0,0 +1,10 @@
1
+ import { $createTextNode } from "lexical";
2
+ const MdastTextVisitor = {
3
+ testNode: "text",
4
+ visitNode({ mdastNode, actions }) {
5
+ actions.addAndStepInto($createTextNode(mdastNode.value).setFormat(actions.getParentFormatting()));
6
+ }
7
+ };
8
+ export {
9
+ MdastTextVisitor
10
+ };
@@ -0,0 +1,69 @@
1
+ import { DecoratorNode, EditorConfig, LexicalEditor } from 'lexical';
2
+ import * as Mdast from 'mdast';
3
+ import { Node } from 'unist';
4
+ import React from 'react';
5
+ import { ContentEditable } from '@lexical/react/LexicalContentEditable';
6
+ import { VoidEmitter } from '../../utils/voidEmitter';
7
+ interface NestedEditorsContextValue<T extends Node> {
8
+ parentEditor: LexicalEditor;
9
+ config: EditorConfig;
10
+ mdastNode: T;
11
+ lexicalNode: DecoratorNode<any> & {
12
+ setMdastNode: (mdastNode: any) => void;
13
+ };
14
+ focusEmitter: VoidEmitter;
15
+ }
16
+ export declare const NestedEditorsContext: React.Context<NestedEditorsContextValue<Node<import("unist").Data>> | undefined>;
17
+ export declare const useNestedEditorContext: <T extends Mdast.Content>() => NestedEditorsContextValue<T>;
18
+ /**
19
+ * A hook that returns a function that can be used to update the mdast node. Use this in your custom editor components.
20
+ */
21
+ export declare function useMdastNodeUpdater<T extends Mdast.Content>(): (node: Partial<T>) => void;
22
+ /**
23
+ * A hook that returns a function that removes the lexical node from the editor.
24
+ */
25
+ export declare function useLexicalNodeRemove(): () => void;
26
+ /**
27
+ * The properties of the {@link NestedEditor} React Component.
28
+ * @typeParam T - The type of the mdast node of the editor.
29
+ */
30
+ export interface NestedEditorProps<T extends Mdast.Content> {
31
+ /**
32
+ * A function that returns the phrasing content of the mdast node. In most cases, this will be the `children` property of the mdast node, but you can also have multiple nested nodes with their own children.
33
+ */
34
+ getContent: (mdastNode: T) => Mdast.Content[];
35
+ /**
36
+ * A function that should return the updated mdast node based on the original mdast node and the new content (serialized as mdast tree) produced by the editor.
37
+ */
38
+ getUpdatedMdastNode: (mdastNode: T, children: Mdast.Content[]) => T;
39
+ /**
40
+ * Props passed to the {@link https://github.com/facebook/lexical/blob/main/packages/lexical-react/src/LexicalContentEditable.tsx | ContentEditable} component.
41
+ */
42
+ contentEditableProps?: React.ComponentProps<typeof ContentEditable>;
43
+ /**
44
+ * Whether or not the editor edits blocks (multiple paragraphs)
45
+ */
46
+ block?: boolean;
47
+ /**
48
+ * An emitter (usually constructed in the lexical node) that will activate the editor when the node is focused.
49
+ */
50
+ focusEmitter?: VoidEmitter;
51
+ }
52
+ /**
53
+ * A nested editor React component that allows editing of the contents of complex markdown nodes that have nested markdown content (for example, custom directives or JSX elements). See the {@link NestedEditorProps} for more details on the compoment props.
54
+ *
55
+ * @example
56
+ * You can use a type param to specify the type of the mdast node
57
+ *
58
+ * ```tsx
59
+ *
60
+ * interface CalloutDirectiveNode extends LeafDirective {
61
+ * name: 'callout'
62
+ * children: Mdast.PhrasingContent[]
63
+ * }
64
+ *
65
+ * return <NestedEditor<CalloutDirectiveNode> getContent={node => node.children} getUpdatedMdastNode={(node, children) => ({ ...node, children })} />
66
+ * ```
67
+ */
68
+ export declare const NestedLexicalEditor: <T extends Mdast.Content>(props: NestedEditorProps<T>) => React.JSX.Element;
69
+ export {};
@@ -0,0 +1,181 @@
1
+ import { $addUpdateTag, $getNodeByKey, createEditor, $getRoot, BLUR_COMMAND, COMMAND_PRIORITY_EDITOR, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_HIGH, KEY_BACKSPACE_COMMAND, COMMAND_PRIORITY_CRITICAL } from "lexical";
2
+ import React__default from "react";
3
+ import { corePluginHooks, NESTED_EDITOR_UPDATED_COMMAND } from "./index.js";
4
+ import { ContentEditable } from "@lexical/react/LexicalContentEditable";
5
+ import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
6
+ import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
7
+ import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
8
+ import { lexicalTheme } from "../../styles/lexicalTheme.js";
9
+ import { exportLexicalTreeToMdast } from "../../exportMarkdownFromLexical.js";
10
+ import { importMdastTreeToLexical } from "../../importMarkdownToLexical.js";
11
+ import styles from "../../styles/ui.module.css.js";
12
+ import { SharedHistoryPlugin } from "./SharedHistoryPlugin.js";
13
+ import { mergeRegister } from "@lexical/utils";
14
+ import { isPartOftheEditorUI } from "../../utils/isPartOftheEditorUI.js";
15
+ const NestedEditorsContext = React__default.createContext(void 0);
16
+ const useNestedEditorContext = () => {
17
+ const context = React__default.useContext(NestedEditorsContext);
18
+ if (!context) {
19
+ throw new Error("useNestedEditor must be used within a NestedEditorsProvider");
20
+ }
21
+ return context;
22
+ };
23
+ function useMdastNodeUpdater() {
24
+ const { parentEditor, lexicalNode } = useNestedEditorContext();
25
+ return function updateMdastNode(node) {
26
+ parentEditor.update(() => {
27
+ $addUpdateTag("history-push");
28
+ const currentNode = $getNodeByKey(lexicalNode.getKey());
29
+ if (currentNode) {
30
+ currentNode.setMdastNode(node);
31
+ }
32
+ });
33
+ };
34
+ }
35
+ function useLexicalNodeRemove() {
36
+ const { parentEditor, lexicalNode } = useNestedEditorContext();
37
+ return () => {
38
+ parentEditor.update(() => {
39
+ const node = $getNodeByKey(lexicalNode.getKey());
40
+ node.selectNext();
41
+ node.remove();
42
+ });
43
+ };
44
+ }
45
+ const NestedLexicalEditor = function(props) {
46
+ const { getContent, getUpdatedMdastNode, contentEditableProps, block = false } = props;
47
+ const { mdastNode, lexicalNode } = useNestedEditorContext();
48
+ const updateMdastNode = useMdastNodeUpdater();
49
+ const removeNode = useLexicalNodeRemove();
50
+ const content = getContent(mdastNode);
51
+ const [rootEditor] = corePluginHooks.useEmitterValues("rootEditor");
52
+ const [importVisitors, exportVisitors, usedLexicalNodes, jsxComponentDescriptors, jsxIsAvailable, nestedEditorChildren] = corePluginHooks.useEmitterValues(
53
+ "importVisitors",
54
+ "exportVisitors",
55
+ "usedLexicalNodes",
56
+ "jsxComponentDescriptors",
57
+ "jsxIsAvailable",
58
+ "nestedEditorChildren"
59
+ );
60
+ const setEditorInFocus = corePluginHooks.usePublisher("editorInFocus");
61
+ const [editor] = React__default.useState(() => {
62
+ const editor2 = createEditor({
63
+ nodes: usedLexicalNodes,
64
+ theme: lexicalTheme
65
+ });
66
+ return editor2;
67
+ });
68
+ React__default.useEffect(() => {
69
+ var _a;
70
+ (_a = props.focusEmitter) == null ? void 0 : _a.subscribe(() => {
71
+ editor.focus();
72
+ });
73
+ }, [editor, props.focusEmitter]);
74
+ React__default.useEffect(() => {
75
+ editor.update(() => {
76
+ $getRoot().clear();
77
+ let theContent = content;
78
+ if (block) {
79
+ if (theContent.length === 0) {
80
+ theContent = [{ type: "paragraph", children: [] }];
81
+ }
82
+ } else {
83
+ theContent = [{ type: "paragraph", children: content }];
84
+ }
85
+ importMdastTreeToLexical({
86
+ root: $getRoot(),
87
+ mdastRoot: {
88
+ type: "root",
89
+ children: theContent
90
+ },
91
+ visitors: importVisitors
92
+ });
93
+ });
94
+ }, [editor, block, importVisitors]);
95
+ React__default.useEffect(() => {
96
+ function updateParentNode() {
97
+ editor.getEditorState().read(() => {
98
+ const mdast = exportLexicalTreeToMdast({
99
+ root: $getRoot(),
100
+ visitors: exportVisitors,
101
+ jsxComponentDescriptors,
102
+ jsxIsAvailable
103
+ });
104
+ const content2 = block ? mdast.children : mdast.children[0].children;
105
+ updateMdastNode(getUpdatedMdastNode(structuredClone(mdastNode), content2));
106
+ });
107
+ }
108
+ return mergeRegister(
109
+ editor.registerCommand(
110
+ BLUR_COMMAND,
111
+ (payload) => {
112
+ const relatedTarget = payload.relatedTarget;
113
+ if (isPartOftheEditorUI(relatedTarget, rootEditor.getRootElement())) {
114
+ return false;
115
+ }
116
+ updateParentNode();
117
+ setEditorInFocus(null);
118
+ return true;
119
+ },
120
+ COMMAND_PRIORITY_EDITOR
121
+ ),
122
+ // triggered by codemirror
123
+ editor.registerCommand(
124
+ NESTED_EDITOR_UPDATED_COMMAND,
125
+ () => {
126
+ updateParentNode();
127
+ return true;
128
+ },
129
+ COMMAND_PRIORITY_EDITOR
130
+ ),
131
+ editor.registerCommand(
132
+ SELECTION_CHANGE_COMMAND,
133
+ () => {
134
+ setEditorInFocus({ editorType: "lexical", rootNode: lexicalNode });
135
+ return false;
136
+ },
137
+ COMMAND_PRIORITY_HIGH
138
+ ),
139
+ editor.registerCommand(
140
+ KEY_BACKSPACE_COMMAND,
141
+ (_, editor2) => {
142
+ const editorElement = editor2.getRootElement();
143
+ if ((editorElement == null ? void 0 : editorElement.innerText) === "\n") {
144
+ removeNode();
145
+ return true;
146
+ }
147
+ return false;
148
+ },
149
+ COMMAND_PRIORITY_CRITICAL
150
+ )
151
+ );
152
+ }, [
153
+ block,
154
+ editor,
155
+ exportVisitors,
156
+ getUpdatedMdastNode,
157
+ jsxComponentDescriptors,
158
+ jsxIsAvailable,
159
+ lexicalNode,
160
+ mdastNode,
161
+ removeNode,
162
+ setEditorInFocus,
163
+ updateMdastNode,
164
+ rootEditor
165
+ ]);
166
+ return /* @__PURE__ */ React__default.createElement(LexicalNestedComposer, { initialEditor: editor }, /* @__PURE__ */ React__default.createElement(
167
+ RichTextPlugin,
168
+ {
169
+ contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { ...contentEditableProps, className: styles.nestedEditor }),
170
+ placeholder: null,
171
+ ErrorBoundary: LexicalErrorBoundary
172
+ }
173
+ ), /* @__PURE__ */ React__default.createElement(SharedHistoryPlugin, null), nestedEditorChildren.map((Child, index) => /* @__PURE__ */ React__default.createElement(Child, { key: index })));
174
+ };
175
+ export {
176
+ NestedEditorsContext,
177
+ NestedLexicalEditor,
178
+ useLexicalNodeRemove,
179
+ useMdastNodeUpdater,
180
+ useNestedEditorContext
181
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface PropertyPopoverProps {
3
+ properties: Record<string, string>;
4
+ onChange: (values: Record<string, string>) => void;
5
+ title: string;
6
+ }
7
+ export declare const PropertyPopover: React.FC<PropertyPopoverProps>;
8
+ export {};
@@ -0,0 +1,36 @@
1
+ import * as RadixPopover from "@radix-ui/react-popover";
2
+ import React__default from "react";
3
+ import { useForm } from "react-hook-form";
4
+ import SettingsIcon from "../../icons/settings.svg.js";
5
+ import styles from "../../styles/ui.module.css.js";
6
+ import { PopoverPortal, PopoverContent } from "./ui/PopoverUtils.js";
7
+ const PropertyPopover = ({ title, properties, onChange }) => {
8
+ const [open, setOpen] = React__default.useState(false);
9
+ const { register, handleSubmit, reset } = useForm({ defaultValues: properties });
10
+ return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open, onOpenChange: (v) => setOpen(v) }, /* @__PURE__ */ React__default.createElement(RadixPopover.Trigger, { className: styles.iconButton }, /* @__PURE__ */ React__default.createElement(SettingsIcon, { style: { display: "block" } })), /* @__PURE__ */ React__default.createElement(PopoverPortal, null, /* @__PURE__ */ React__default.createElement(PopoverContent, null, /* @__PURE__ */ React__default.createElement(
11
+ "form",
12
+ {
13
+ onSubmit: handleSubmit((values) => {
14
+ onChange(values);
15
+ setOpen(false);
16
+ })
17
+ },
18
+ /* @__PURE__ */ React__default.createElement("h3", { className: styles.propertyPanelTitle }, title, " Attributes"),
19
+ /* @__PURE__ */ React__default.createElement("table", { className: styles.propertyEditorTable }, /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: styles.readOnlyColumnCell }, "Attribute"), /* @__PURE__ */ React__default.createElement("th", null, "Value"))), /* @__PURE__ */ React__default.createElement("tbody", null, Object.keys(properties).map((propName) => /* @__PURE__ */ React__default.createElement("tr", { key: propName }, /* @__PURE__ */ React__default.createElement("th", { className: styles.readOnlyColumnCell }, " ", propName, " "), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement("input", { ...register(propName), className: styles.propertyEditorInput }))))), /* @__PURE__ */ React__default.createElement("tfoot", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", { colSpan: 2 }, /* @__PURE__ */ React__default.createElement("div", { className: styles.buttonsFooter }, /* @__PURE__ */ React__default.createElement("button", { type: "submit", className: styles.primaryButton }, "Save"), /* @__PURE__ */ React__default.createElement(
20
+ "button",
21
+ {
22
+ type: "reset",
23
+ className: styles.secondaryButton,
24
+ onClick: (e) => {
25
+ e.preventDefault();
26
+ reset(properties);
27
+ setOpen(false);
28
+ }
29
+ },
30
+ "Cancel"
31
+ ))))))
32
+ ))));
33
+ };
34
+ export {
35
+ PropertyPopover
36
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SharedHistoryPlugin: () => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
2
+ import React__default from "react";
3
+ import { corePluginHooks } from "./index.js";
4
+ const SharedHistoryPlugin = () => {
5
+ const [historyState] = corePluginHooks.useEmitterValues("historyState");
6
+ return /* @__PURE__ */ React__default.createElement(HistoryPlugin, { externalHistoryState: historyState });
7
+ };
8
+ export {
9
+ SharedHistoryPlugin
10
+ };