@mdxeditor/editor 1.14.3 → 2.0.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 (202) hide show
  1. package/dist/MDXEditor.js +19 -25
  2. package/dist/RealmWithPlugins.js +36 -0
  3. package/dist/directive-editors/GenericDirectiveEditor.js +7 -4
  4. package/dist/index.d.ts +2590 -62
  5. package/dist/index.js +138 -66
  6. package/dist/jsx-editors/GenericJsxEditor.js +12 -9
  7. package/dist/plugins/codeblock/CodeBlockNode.js +5 -5
  8. package/dist/plugins/codeblock/index.js +37 -63
  9. package/dist/plugins/codemirror/CodeMirrorEditor.js +3 -2
  10. package/dist/plugins/codemirror/index.js +28 -45
  11. package/dist/plugins/core/GenericHTMLNode.js +9 -1
  12. package/dist/plugins/core/MdastHTMLNode.js +0 -1
  13. package/dist/plugins/core/NestedLexicalEditor.js +11 -10
  14. package/dist/plugins/core/PropertyPopover.js +3 -2
  15. package/dist/plugins/core/SharedHistoryPlugin.js +3 -3
  16. package/dist/plugins/core/index.js +426 -385
  17. package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
  18. package/dist/plugins/core/ui/PopoverUtils.js +3 -2
  19. package/dist/plugins/diff-source/DiffSourceWrapper.js +3 -4
  20. package/dist/plugins/diff-source/DiffViewer.js +7 -7
  21. package/dist/plugins/diff-source/SourceEditor.js +6 -6
  22. package/dist/plugins/diff-source/index.js +17 -52
  23. package/dist/plugins/directives/DirectiveNode.js +28 -5
  24. package/dist/plugins/directives/index.js +36 -43
  25. package/dist/plugins/frontmatter/FrontmatterEditor.js +20 -16
  26. package/dist/plugins/frontmatter/index.js +51 -62
  27. package/dist/plugins/headings/index.js +43 -49
  28. package/dist/plugins/image/ImageDialog.js +11 -7
  29. package/dist/plugins/image/ImageEditor.js +10 -7
  30. package/dist/plugins/image/ImageNode.js +27 -5
  31. package/dist/plugins/image/index.js +65 -72
  32. package/dist/plugins/jsx/LexicalJsxNode.js +3 -2
  33. package/dist/plugins/jsx/index.js +48 -60
  34. package/dist/plugins/link/index.js +15 -20
  35. package/dist/plugins/link-dialog/LinkDialog.js +17 -16
  36. package/dist/plugins/link-dialog/index.js +194 -216
  37. package/dist/plugins/lists/index.js +50 -65
  38. package/dist/plugins/markdown-shortcut/index.js +12 -15
  39. package/dist/plugins/quote/index.js +11 -19
  40. package/dist/plugins/sandpack/SandpackEditor.js +3 -2
  41. package/dist/plugins/sandpack/index.js +34 -50
  42. package/dist/plugins/sandpack/useCodeMirrorRef.js +7 -6
  43. package/dist/plugins/table/TableEditor.js +12 -13
  44. package/dist/plugins/table/TableNode.js +28 -0
  45. package/dist/plugins/table/index.js +32 -39
  46. package/dist/plugins/thematic-break/index.js +19 -32
  47. package/dist/plugins/toolbar/components/BlockTypeSelect.js +9 -8
  48. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -4
  49. package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +3 -2
  50. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +5 -5
  51. package/dist/plugins/toolbar/components/CodeToggle.js +4 -3
  52. package/dist/plugins/toolbar/components/CreateLink.js +6 -4
  53. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +5 -5
  54. package/dist/plugins/toolbar/components/InsertAdmonition.js +5 -3
  55. package/dist/plugins/toolbar/components/InsertCodeBlock.js +5 -3
  56. package/dist/plugins/toolbar/components/InsertFrontmatter.js +6 -5
  57. package/dist/plugins/toolbar/components/InsertImage.js +6 -5
  58. package/dist/plugins/toolbar/components/InsertSandpack.js +5 -4
  59. package/dist/plugins/toolbar/components/InsertTable.js +5 -3
  60. package/dist/plugins/toolbar/components/InsertThematicBreak.js +6 -4
  61. package/dist/plugins/toolbar/components/ListsToggle.js +5 -4
  62. package/dist/plugins/toolbar/components/ShowSandpackInfo.js +9 -4
  63. package/dist/plugins/toolbar/components/UndoRedo.js +3 -3
  64. package/dist/plugins/toolbar/index.js +15 -31
  65. package/dist/plugins/toolbar/primitives/DialogButton.js +23 -24
  66. package/dist/plugins/toolbar/primitives/TooltipWrap.js +3 -2
  67. package/dist/plugins/toolbar/primitives/select.js +5 -4
  68. package/dist/plugins/toolbar/primitives/toolbar.js +10 -4
  69. package/dist/style.css +935 -571
  70. package/dist/styles/globals.css.js +1 -4
  71. package/dist/styles/lexical-theme.module.css.js +25 -19
  72. package/dist/styles/ui.module.css.js +103 -103
  73. package/package.json +64 -317
  74. package/dist/FormatConstants.d.ts +0 -9
  75. package/dist/MDXEditor.d.ts +0 -103
  76. package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +0 -17
  77. package/dist/directive-editors/GenericDirectiveEditor.d.ts +0 -8
  78. package/dist/exportMarkdownFromLexical.d.ts +0 -138
  79. package/dist/gurx/index.d.ts +0 -3
  80. package/dist/gurx/react.d.ts +0 -152
  81. package/dist/gurx/react.js +0 -206
  82. package/dist/gurx/realm.d.ts +0 -148
  83. package/dist/gurx/realm.js +0 -489
  84. package/dist/gurx/realmFactory.d.ts +0 -79
  85. package/dist/gurx/realmFactory.js +0 -32
  86. package/dist/importMarkdownToLexical.d.ts +0 -101
  87. package/dist/jsx-editors/GenericJsxEditor.d.ts +0 -8
  88. package/dist/plugins/codeblock/CodeBlockNode.d.ts +0 -100
  89. package/dist/plugins/codeblock/CodeBlockVisitor.d.ts +0 -4
  90. package/dist/plugins/codeblock/MdastCodeVisitor.d.ts +0 -3
  91. package/dist/plugins/codeblock/index.d.ts +0 -787
  92. package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +0 -3
  93. package/dist/plugins/codemirror/index.d.ts +0 -1038
  94. package/dist/plugins/core/GenericHTMLNode.d.ts +0 -38
  95. package/dist/plugins/core/Icon.d.ts +0 -6
  96. package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +0 -4
  97. package/dist/plugins/core/LexicalLinebreakVisitor.d.ts +0 -4
  98. package/dist/plugins/core/LexicalParagraphVisitor.d.ts +0 -4
  99. package/dist/plugins/core/LexicalRootVisitor.d.ts +0 -4
  100. package/dist/plugins/core/LexicalTextVisitor.d.ts +0 -5
  101. package/dist/plugins/core/MdastBreakVisitor.d.ts +0 -3
  102. package/dist/plugins/core/MdastFormattingVisitor.d.ts +0 -4
  103. package/dist/plugins/core/MdastHTMLNode.d.ts +0 -13
  104. package/dist/plugins/core/MdastHTMLVisitor.d.ts +0 -3
  105. package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +0 -3
  106. package/dist/plugins/core/MdastParagraphVisitor.d.ts +0 -3
  107. package/dist/plugins/core/MdastRootVisitor.d.ts +0 -3
  108. package/dist/plugins/core/MdastTextVisitor.d.ts +0 -3
  109. package/dist/plugins/core/NestedLexicalEditor.d.ts +0 -92
  110. package/dist/plugins/core/PropertyPopover.d.ts +0 -23
  111. package/dist/plugins/core/SharedHistoryPlugin.d.ts +0 -2
  112. package/dist/plugins/core/index.d.ts +0 -583
  113. package/dist/plugins/core/ui/DownshiftAutoComplete.d.ts +0 -15
  114. package/dist/plugins/core/ui/PopoverUtils.d.ts +0 -4
  115. package/dist/plugins/diff-source/DiffSourceWrapper.d.ts +0 -4
  116. package/dist/plugins/diff-source/DiffViewer.d.ts +0 -2
  117. package/dist/plugins/diff-source/SourceEditor.d.ts +0 -4
  118. package/dist/plugins/diff-source/index.d.ts +0 -725
  119. package/dist/plugins/directives/DirectiveNode.d.ts +0 -51
  120. package/dist/plugins/directives/DirectiveVisitor.d.ts +0 -4
  121. package/dist/plugins/directives/MdastDirectiveVisitor.d.ts +0 -3
  122. package/dist/plugins/directives/index.d.ts +0 -773
  123. package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +0 -6
  124. package/dist/plugins/frontmatter/FrontmatterNode.d.ts +0 -35
  125. package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.d.ts +0 -4
  126. package/dist/plugins/frontmatter/MdastFrontmatterVisitor.d.ts +0 -3
  127. package/dist/plugins/frontmatter/index.d.ts +0 -717
  128. package/dist/plugins/headings/LexicalHeadingVisitor.d.ts +0 -4
  129. package/dist/plugins/headings/MdastHeadingVisitor.d.ts +0 -3
  130. package/dist/plugins/headings/index.d.ts +0 -707
  131. package/dist/plugins/image/ImageDialog.d.ts +0 -2
  132. package/dist/plugins/image/ImageEditor.d.ts +0 -10
  133. package/dist/plugins/image/ImageNode.d.ts +0 -65
  134. package/dist/plugins/image/ImageResizer.d.ts +0 -18
  135. package/dist/plugins/image/LexicalImageVisitor.d.ts +0 -4
  136. package/dist/plugins/image/MdastImageVisitor.d.ts +0 -6
  137. package/dist/plugins/image/index.d.ts +0 -804
  138. package/dist/plugins/jsx/LexicalJsxNode.d.ts +0 -54
  139. package/dist/plugins/jsx/LexicalJsxVisitor.d.ts +0 -4
  140. package/dist/plugins/jsx/MdastMdxJsEsmVisitor.d.ts +0 -3
  141. package/dist/plugins/jsx/MdastMdxJsxElementVisitor.d.ts +0 -3
  142. package/dist/plugins/jsx/index.d.ts +0 -779
  143. package/dist/plugins/link/AutoLinkPlugin.d.ts +0 -9
  144. package/dist/plugins/link/LexicalLinkVisitor.d.ts +0 -4
  145. package/dist/plugins/link/MdastLinkVisitor.d.ts +0 -3
  146. package/dist/plugins/link/index.d.ts +0 -101
  147. package/dist/plugins/link-dialog/LinkDialog.d.ts +0 -16
  148. package/dist/plugins/link-dialog/index.d.ts +0 -670
  149. package/dist/plugins/lists/LexicalListItemVisitor.d.ts +0 -4
  150. package/dist/plugins/lists/LexicalListVisitor.d.ts +0 -4
  151. package/dist/plugins/lists/MdastListItemVisitor.d.ts +0 -3
  152. package/dist/plugins/lists/MdastListVisitor.d.ts +0 -3
  153. package/dist/plugins/lists/index.d.ts +0 -703
  154. package/dist/plugins/markdown-shortcut/index.d.ts +0 -80
  155. package/dist/plugins/quote/LexicalQuoteVisitor.d.ts +0 -4
  156. package/dist/plugins/quote/MdastBlockQuoteVisitor.d.ts +0 -3
  157. package/dist/plugins/quote/index.d.ts +0 -480
  158. package/dist/plugins/sandpack/SandpackEditor.d.ts +0 -7
  159. package/dist/plugins/sandpack/index.d.ts +0 -1077
  160. package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +0 -4
  161. package/dist/plugins/table/LexicalTableVisitor.d.ts +0 -4
  162. package/dist/plugins/table/MdastTableVisitor.d.ts +0 -3
  163. package/dist/plugins/table/TableEditor.d.ts +0 -21
  164. package/dist/plugins/table/TableNode.d.ts +0 -52
  165. package/dist/plugins/table/index.d.ts +0 -704
  166. package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.d.ts +0 -4
  167. package/dist/plugins/thematic-break/MdastThematicBreakVisitor.d.ts +0 -3
  168. package/dist/plugins/thematic-break/index.d.ts +0 -693
  169. package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +0 -6
  170. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +0 -5
  171. package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +0 -6
  172. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +0 -7
  173. package/dist/plugins/toolbar/components/CodeToggle.d.ts +0 -6
  174. package/dist/plugins/toolbar/components/CreateLink.d.ts +0 -6
  175. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +0 -18
  176. package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +0 -6
  177. package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +0 -7
  178. package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +0 -6
  179. package/dist/plugins/toolbar/components/InsertImage.d.ts +0 -6
  180. package/dist/plugins/toolbar/components/InsertSandpack.d.ts +0 -6
  181. package/dist/plugins/toolbar/components/InsertTable.d.ts +0 -6
  182. package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +0 -6
  183. package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +0 -7
  184. package/dist/plugins/toolbar/components/ListsToggle.d.ts +0 -7
  185. package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +0 -7
  186. package/dist/plugins/toolbar/components/UndoRedo.d.ts +0 -5
  187. package/dist/plugins/toolbar/index.d.ts +0 -564
  188. package/dist/plugins/toolbar/primitives/DialogButton.d.ts +0 -40
  189. package/dist/plugins/toolbar/primitives/TooltipWrap.d.ts +0 -8
  190. package/dist/plugins/toolbar/primitives/select.d.ts +0 -50
  191. package/dist/plugins/toolbar/primitives/toolbar.d.ts +0 -163
  192. package/dist/styles/lexicalTheme.d.ts +0 -2
  193. package/dist/utils/detectMac.d.ts +0 -3
  194. package/dist/utils/fp.d.ts +0 -47
  195. package/dist/utils/isPartOftheEditorUI.d.ts +0 -1
  196. package/dist/utils/lexicalHelpers.d.ts +0 -11
  197. package/dist/utils/makeHslTransparent.d.ts +0 -1
  198. package/dist/utils/mergeStyleAttributes.d.ts +0 -1
  199. package/dist/utils/uuid4.d.ts +0 -1
  200. package/dist/utils/voidEmitter.d.ts +0 -14
  201. package/dist/utils/whitespaceConversion.d.ts +0 -2
  202. package/dist/utils/whitespaceConversion.js +0 -9
@@ -1,163 +0,0 @@
1
- import * as RadixToolbar from '@radix-ui/react-toolbar';
2
- import React from 'react';
3
- import { EditorInFocus } from '../../core';
4
- /**
5
- * @internal
6
- */
7
- export declare const Root: React.FC<{
8
- readOnly: boolean;
9
- children: React.ReactNode;
10
- }>;
11
- /**
12
- * A toolbar button primitive.
13
- */
14
- export declare const Button: React.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<object>>;
15
- /**
16
- * A toolbar button with a custom toolbar primitive.
17
- */
18
- export declare const ButtonWithTooltip: ({ title, children, ...props }: Omit<RadixToolbar.ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<object> & {
19
- title: string;
20
- }) => React.JSX.Element;
21
- /**
22
- * @internal
23
- */
24
- export declare const ToolbarToggleItem: React.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<object>>;
25
- /**
26
- * @internal
27
- */
28
- export declare const SingleToggleGroup: React.ForwardRefExoticComponent<(Omit<RadixToolbar.ToolbarToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<RadixToolbar.ToolbarToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & React.RefAttributes<object>>;
29
- /**
30
- * @internal
31
- */
32
- export declare const ToggleSingleGroupWithItem: React.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarToggleGroupSingleProps, "type"> & {
33
- on: boolean;
34
- title: string;
35
- disabled?: boolean | undefined;
36
- } & React.RefAttributes<HTMLDivElement>>;
37
- /**
38
- * A toolbar primitive that allows you to build an UI with multiple non-exclusive toggle groups, like the bold/italic/underline toggle.
39
- */
40
- export declare const MultipleChoiceToggleGroup: React.FC<{
41
- items: {
42
- title: string;
43
- contents: React.ReactNode;
44
- active: boolean;
45
- onChange: (active: boolean) => void;
46
- disabled?: boolean;
47
- }[];
48
- }>;
49
- /**
50
- * The properties of the {@link SingleChoiceToggleGroup} React component.
51
- */
52
- export interface SingleChoiceToggleGroupProps<T extends string> {
53
- items: {
54
- title: string;
55
- value: T;
56
- contents: React.ReactNode;
57
- }[];
58
- onChange: (value: T) => void;
59
- value: T;
60
- className?: string;
61
- }
62
- /**
63
- * A toolbar primitive that allows you to build an UI with multiple exclusive toggle groups, like the list type toggle.
64
- */
65
- export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChange, className, items }: SingleChoiceToggleGroupProps<T>) => React.JSX.Element;
66
- /**
67
- * The properties of the {@link ButtonOrDropdownButton} React component.
68
- */
69
- export interface ButtonOrDropdownButtonProps<T extends string> {
70
- /**
71
- * The contents of the button - usually an icon.
72
- */
73
- children: React.ReactNode;
74
- /**
75
- * The title used for the tooltip.
76
- */
77
- title: string;
78
- /**
79
- * The function to execute when the button is clicked or an item is chosen from the dropdown.
80
- * If there is only one item in the dropdown, the value will be an empty string.
81
- */
82
- onChoose: (value: T) => void;
83
- /**
84
- * The items to show in the dropdown.
85
- */
86
- items: {
87
- /**
88
- * The value to pass to the `onChoose` function when this item is chosen.
89
- */
90
- value: T;
91
- /**
92
- * The label to show in the dropdown.
93
- */
94
- label: string | JSX.Element;
95
- }[];
96
- }
97
- /**
98
- * Use this primitive to create a toolbar button that can be either a button or a dropdown, depending on the number of items passed.
99
- *
100
- * @see {@link ButtonOrDropdownButtonProps} for the properties of the React component.
101
- */
102
- export declare const ButtonOrDropdownButton: <T extends string>(props: ButtonOrDropdownButtonProps<T>) => React.JSX.Element;
103
- /**
104
- * An object that describes a possible option to be displayed in the {@link ConditionalContents} component.
105
- */
106
- export type ConditionalContentsOption = {
107
- /**
108
- * A function that returns `true` if the option should be displayed for the current editor in focus.
109
- */
110
- when: (rootNode: EditorInFocus | null) => boolean;
111
- /**
112
- * The contents to display if the `when` function returns `true`.
113
- */
114
- contents: () => React.ReactNode;
115
- };
116
- /**
117
- * A default option to be displayed in the {@link ConditionalContents} component if none of the other options match.
118
- */
119
- export type FallBackOption = {
120
- /**
121
- * The contents to display
122
- */
123
- fallback: () => React.ReactNode;
124
- };
125
- /**
126
- * The properties of the {@link ConditionalContents} React component.
127
- */
128
- export interface ConditionalContentsProps {
129
- /**
130
- * A set of options that define the contents to show based on the editor that is in focus.
131
- * Can be either a {@link ConditionalContentsOption} or a {@link FallBackOption}.
132
- * See the {@link ConditionalContents} documentation for an example.
133
- */
134
- options: (ConditionalContentsOption | FallBackOption)[];
135
- }
136
- /**
137
- * A toolbar primitive that allows you to show different contents based on the editor that is in focus.
138
- * Useful for code editors that have different features and don't support rich text formatting.
139
- * @example
140
- * ```tsx
141
- * <ConditionalContents
142
- * options={[
143
- * { when: (editor) => editor?.editorType === 'codeblock', contents: () => <ChangeCodeMirrorLanguage /> },
144
- * { when: (editor) => editor?.editorType === 'sandpack', contents: () => <ShowSandpackInfo /> },
145
- * {
146
- * fallback: () => (
147
- * <>
148
- * <UndoRedo />
149
- * <BoldItalicUnderlineToggles />
150
- * <InsertCodeBlock />
151
- * </>
152
- * )
153
- * }
154
- * ]}
155
- * />
156
- * ```
157
- */
158
- export declare const ConditionalContents: React.FC<ConditionalContentsProps>;
159
- /**
160
- * A toolbar primitive that allows you to show a separator between toolbar items.
161
- * By default, the separator is styled as vertical line.
162
- */
163
- export declare const Separator: React.ForwardRefExoticComponent<RadixToolbar.ToolbarSeparatorProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,2 +0,0 @@
1
- import { EditorThemeClasses } from 'lexical';
2
- export declare const lexicalTheme: EditorThemeClasses;
@@ -1,3 +0,0 @@
1
- export declare const CAN_USE_DOM: boolean;
2
- export declare const IS_APPLE: boolean;
3
- export declare function controlOrMeta(metaKey: boolean, ctrlKey: boolean): boolean;
@@ -1,47 +0,0 @@
1
- /**
2
- * Utils includes a handful of functional utilities inspired by or taken from the [Ramda library](https://ramdajs.com/);
3
- * Use these for your convenience - they are here so that urx is zero-dependency package.
4
- * @packageDocumentation
5
- */
6
- /** @internal */
7
- export interface Proc {
8
- (): unknown;
9
- }
10
- /**
11
- * Performs left to right composition of two functions.
12
- */
13
- export declare function compose<I, A, R>(a: (arg: A) => R, b: (arg: I) => A): (arg: I) => R;
14
- /**
15
- * Takes a value and applies a function to it.
16
- */
17
- export declare function thrush<I, K>(arg: I, proc: (arg: I) => K): K;
18
- /**
19
- * Takes a 2 argument function and partially applies the first argument.
20
- */
21
- export declare function curry2to1<T, K, R>(proc: (arg1: T, arg2: K) => R, arg1: T): (arg2: K) => R;
22
- /**
23
- * Takes a 1 argument function and returns a function which when called, executes it with the provided argument.
24
- */
25
- export declare function curry1to0<T, R>(proc: (arg: T) => R, arg: T): () => R;
26
- /**
27
- * Returns a function which extracts the property from from the passed object.
28
- */
29
- export declare function prop<T extends Record<string, unknown>>(property: keyof T): (object: T) => T[keyof T];
30
- /**
31
- * Calls callback with the first argument, and returns it.
32
- */
33
- export declare function tap<T>(arg: T, proc: (arg: T) => unknown): T;
34
- /**
35
- * Calls the passed function.
36
- */
37
- export declare function call(proc: Proc): void;
38
- /**
39
- * returns a function which when called always returns the passed value
40
- */
41
- export declare function always<T>(value: T): () => T;
42
- /**
43
- * returns a function which calls all passed functions in the passed order.
44
- * joinProc does not pass arguments or collect return values.
45
- */
46
- export declare function joinProc(...procs: Proc[]): () => void;
47
- export declare function noop(): void;
@@ -1 +0,0 @@
1
- export declare function isPartOftheEditorUI(element: HTMLElement | null, editorRoot: HTMLElement): boolean;
@@ -1,11 +0,0 @@
1
- import { ElementNode, LexicalEditor, RangeSelection, TextNode } from 'lexical';
2
- import { ExportMarkdownFromLexicalOptions } from '../exportMarkdownFromLexical';
3
- export declare function fromWithinEditorRead<T>(editor: LexicalEditor, fn: () => T): T;
4
- export declare function getSelectedNode(selection: RangeSelection): TextNode | ElementNode | null;
5
- export declare function getSelectionRectangle(editor: LexicalEditor): {
6
- top: number;
7
- left: number;
8
- width: number;
9
- height: number;
10
- } | null;
11
- export declare function getStateAsMarkdown(editor: LexicalEditor, exportParams: Omit<ExportMarkdownFromLexicalOptions, 'root'>): string;
@@ -1 +0,0 @@
1
- export declare function makeHslTransparent(hsl: string, alpha: number): string;
@@ -1 +0,0 @@
1
- export declare function mergeStyleAttributes(style1: string, style2: string): string;
@@ -1 +0,0 @@
1
- export declare function uuidv4(): string;
@@ -1,14 +0,0 @@
1
- /**
2
- * An emitter object that has a single subscription that will be executed.
3
- * The construct is used so that the lexical nodes can focus their React component editors.
4
- */
5
- export type VoidEmitter = {
6
- /**
7
- * Subscribes to the emitter event
8
- */
9
- subscribe: (cb: () => void) => void;
10
- };
11
- export declare function voidEmitter(): {
12
- publish: () => void;
13
- subscribe: (cb: () => void) => void;
14
- };
@@ -1,2 +0,0 @@
1
- export declare const WHITESPACE_MARKER = "\u00A0";
2
- export declare function replaceWhitespace(str: string): string;
@@ -1,9 +0,0 @@
1
- const WHITESPACE_MARKER = " ";
2
- const WHITESPACE_REGEX = /^\s+|\s+$/g;
3
- function replaceWhitespace(str) {
4
- return str.replace(WHITESPACE_REGEX, (spaces) => WHITESPACE_MARKER.repeat(spaces.length));
5
- }
6
- export {
7
- WHITESPACE_MARKER,
8
- replaceWhitespace
9
- };