@mdxeditor/editor 0.11.1 → 0.12.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.
@@ -34,6 +34,10 @@ export interface MDXEditorProps {
34
34
  * For a content-specific styling, Use `contentEditableClassName` property.
35
35
  */
36
36
  className?: string;
37
+ /**
38
+ * pass if you would like to have the editor automatically focused when mounted.
39
+ */
40
+ autoFocus?: boolean;
37
41
  }
38
42
  /**
39
43
  * The interface for the {@link MDXEditor} object reference.
package/dist/MDXEditor.js CHANGED
@@ -32,7 +32,8 @@ const RichTextEditor = () => {
32
32
  "contentEditableClassName",
33
33
  "composerChildren",
34
34
  "topAreaChildren",
35
- "editorWrappers"
35
+ "editorWrappers",
36
+ "autoFocus"
36
37
  );
37
38
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, topAreaChildren.map((Child, index) => /* @__PURE__ */ React__default.createElement(Child, { key: index })), /* @__PURE__ */ React__default.createElement(RenderRecurisveWrappers, { wrappers: editorWrappers }, /* @__PURE__ */ React__default.createElement(
38
39
  RichTextPlugin,
@@ -91,7 +92,8 @@ const MDXEditor = React__default.forwardRef((props, ref) => {
91
92
  contentEditableClassName: props.contentEditableClassName ?? "",
92
93
  initialMarkdown: props.markdown,
93
94
  onChange: props.onChange ?? noop,
94
- toMarkdownOptions: props.toMarkdownOptions ?? DEFAULT_MARKDOWN_OPTIONS
95
+ toMarkdownOptions: props.toMarkdownOptions ?? DEFAULT_MARKDOWN_OPTIONS,
96
+ autoFocus: props.autoFocus ?? false
95
97
  }),
96
98
  ...props.plugins || []
97
99
  ]
@@ -74,15 +74,31 @@ export interface LexicalExportVisitor<LN extends LexicalNode, UN extends Mdast.C
74
74
  */
75
75
  join?<T extends Mdast.Content>(prevNode: T, currentNode: T): T;
76
76
  }
77
+ /**
78
+ * The "any" type for LexicalExportVisitor.
79
+ * @internal
80
+ */
77
81
  export type LexicalVisitor = LexicalExportVisitor<LexicalNode, Mdast.Content>;
82
+ /**
83
+ * @internal
84
+ */
78
85
  export interface ExportLexicalTreeOptions {
79
86
  root: LexicalRootNode;
80
87
  visitors: LexicalVisitor[];
81
88
  jsxComponentDescriptors: JsxComponentDescriptor[];
82
89
  jsxIsAvailable: boolean;
83
90
  }
91
+ /**
92
+ * @internal
93
+ */
84
94
  export declare function exportLexicalTreeToMdast({ root, visitors, jsxComponentDescriptors, jsxIsAvailable }: ExportLexicalTreeOptions): Mdast.Root;
95
+ /**
96
+ * @internal
97
+ */
85
98
  export type ToMarkdownExtension = NonNullable<ToMarkdownOptions['extensions']>[number];
99
+ /**
100
+ * @internal
101
+ */
86
102
  export interface ExportMarkdownFromLexicalOptions extends ExportLexicalTreeOptions {
87
103
  visitors: LexicalVisitor[];
88
104
  /**
@@ -111,4 +127,7 @@ export interface LexicalConvertOptions {
111
127
  */
112
128
  toMarkdownOptions?: ToMarkdownOptions;
113
129
  }
130
+ /**
131
+ * @internal
132
+ */
114
133
  export declare function exportMarkdownFromLexical({ root, toMarkdownOptions, toMarkdownExtensions, visitors, jsxComponentDescriptors, jsxIsAvailable }: ExportMarkdownFromLexicalOptions): string;
@@ -4,7 +4,7 @@ import type { ValuesForKeys, TypedRealm, System, RealmFactory, ValueForKey,
4
4
  /**
5
5
  * Describes the mapping between the system streams and the component properties.
6
6
  * Each property uses the keys as the names of the properties and the values as the corresponding stream names.
7
- * @typeParam SS the type of the system.
7
+ * @typeParam SS - the type of the system.
8
8
  */
9
9
  export interface SystemPropsMap<Sys extends System, K = keyof Sys, D = {
10
10
  [name: string]: K;
@@ -42,8 +42,10 @@ export type MethodsFromPropMap<Sys extends System, Map extends SystemPropsMap<Sy
42
42
  [K in StringKeys<Map['methods']>]: Map['methods'][K] extends string ? Sys[Map['methods'][K]] extends RealmNode<infer R> ? (value: R) => void : never : never;
43
43
  };
44
44
  /**
45
- * Used to correctly specify type refs for system components
45
+ * @internal
46
+ * Used to correctly specify type refs for system components.
46
47
  *
48
+ * @example
47
49
  * ```tsx
48
50
  * const s = system(() => { return { a: statefulStream(0) } })
49
51
  * const { Component } = systemToComponent(s)
@@ -54,15 +56,15 @@ export type MethodsFromPropMap<Sys extends System, Map extends SystemPropsMap<Sy
54
56
  * }
55
57
  * ```
56
58
  *
57
- * @typeParam T the type of the component
59
+ * @typeParam T - the type of the component
58
60
  */
59
61
  export type RefHandle<T> = T extends React.ForwardRefExoticComponent<React.RefAttributes<infer Handle>> ? Handle : never;
60
62
  /**
61
63
  * Converts a system spec to React component by mapping the system streams to component properties, events and methods. Returns hooks for querying and modifying
62
64
  * the system streams from the component's child components.
63
- * @param realmFactory The return value from a [[system]] call.
64
- * @param map The streams to props / events / methods mapping Check [[SystemPropsMap]] for more details.
65
- * @param Root The optional React component to render. By default, the resulting component renders nothing, acting as a logical wrapper for its children.
65
+ * @param realmFactory - The return value from a [[system]] call.
66
+ * @param map - The streams to props / events / methods mapping Check [[SystemPropsMap]] for more details.
67
+ * @param Root - The optional React component to render. By default, the resulting component renders nothing, acting as a logical wrapper for its children.
66
68
  * @returns an object containing the following:
67
69
  * - `Component`: the React component.
68
70
  * - `useEmitterValue`: a hook that lets child components use values emitted from the specified output stream.
@@ -80,6 +82,7 @@ export declare function realmFactoryToComponent<RootComp, RF extends RealmFactor
80
82
  children?: React.ReactNode;
81
83
  })> & React.RefAttributes<MethodsFromPropMap<Sys, M>>>;
82
84
  };
85
+ /** @internal */
83
86
  export declare function sysHooks<Sys extends System>(): {
84
87
  useRealmContext: () => TypedRealm<Sys>;
85
88
  useEmitter: <K extends Extract<keyof Sys, string>>(key: K, callback: (value: ValueForKey<Sys, K>) => void) => void;
@@ -88,18 +91,40 @@ export declare function sysHooks<Sys extends System>(): {
88
91
  usePublisher: <K_2 extends keyof Sys>(key: K_2) => (value: ValueForKey<Sys, K_2>) => void;
89
92
  };
90
93
  type SystemAndDependencies<Spec extends AnySystemSpec> = SystemOfSpecs<[Spec]> & SystemOfSpecs<Spec['dependencies']>;
94
+ /**
95
+ * The parameters of a plugin declaration. THe best way to understand what each one does is to examine the source code of the existing plugins.
96
+ */
91
97
  export interface RealmPluginParams<Spec extends AnySystemSpec, Params extends object> {
98
+ /**
99
+ * The id of the plugin. Used to declare conditional features that are activated only if the plugin is present.
100
+ */
92
101
  id: string;
102
+ /**
103
+ * The ids of the plugins that this plugin depends on. The plugin will not be activated if any of the dependencies is not present.
104
+ */
93
105
  dependencies?: string[];
106
+ /**
107
+ * The system spec of the plugin. Construct one using {@link system}.
108
+ */
94
109
  systemSpec: Spec;
110
+ /**
111
+ * The callback is executed every time the react component is re-rendered.
112
+ */
95
113
  applyParamsToSystem?: (realm: TypedRealm<SystemAndDependencies<Spec>>, props: Params) => void;
114
+ /**
115
+ * Executed when the component mounts. Use this to register import/export visitors, add lexical nodes to the editor, etc.
116
+ */
96
117
  init?: (realm: TypedRealm<SystemAndDependencies<Spec>>, props: Params) => void;
97
118
  }
119
+ /** @internal */
98
120
  export interface PluginConstructor<Spec extends AnySystemSpec, Params extends object> {
99
121
  (params?: Params): {
100
122
  pluginParams?: Params;
101
123
  } & RealmPluginParams<Spec, Params>;
102
124
  }
125
+ /**
126
+ * Declares a new MDXEditor plugin.
127
+ */
103
128
  export declare function realmPlugin<Spec extends AnySystemSpec, Params extends object>(params: RealmPluginParams<Spec, Params>): readonly [PluginConstructor<Spec, Params>, {
104
129
  useRealmContext: () => TypedRealm<SystemAndDependencies<Spec>>;
105
130
  useEmitter: <K extends Extract<keyof (Spec extends AnySystemSpec ? {} & ReturnType<Spec["constructor"]> : never), string> | Extract<keyof SystemOfSpecs<Spec["dependencies"]>, string>>(key: K, callback: (value: ValueForKey<SystemAndDependencies<Spec>, K>) => void) => void;
@@ -107,13 +132,16 @@ export declare function realmPlugin<Spec extends AnySystemSpec, Params extends o
107
132
  usePubKeys: () => (values: SystemDict<SystemAndDependencies<Spec>>) => void;
108
133
  usePublisher: <K_2 extends keyof (Spec extends AnySystemSpec ? {} & ReturnType<Spec["constructor"]> : never) | keyof SystemOfSpecs<Spec["dependencies"]>>(key: K_2) => (value: ValueForKey<SystemAndDependencies<Spec>, K_2>) => void;
109
134
  }];
135
+ /** @internal */
110
136
  export declare const RealmPluginInitializer: <P extends ({
111
137
  pluginParams?: any;
112
138
  } & RealmPluginParams<AnySystemSpec, any>)[]>({ plugins, children }: {
113
139
  plugins: P;
114
140
  children?: React.ReactNode;
115
141
  }) => React.FunctionComponentElement<React.ProviderProps<TypedRealm<any>>>;
142
+ /** @internal */
116
143
  export declare function useHasPlugin(id: string): boolean;
144
+ /** @internal */
117
145
  export declare const RequirePlugin: React.FC<{
118
146
  id: string;
119
147
  children: React.ReactNode;
@@ -1,20 +1,26 @@
1
1
  import { LongTuple } from './realmFactory';
2
+ /** @internal */
2
3
  export type NodeKey = string;
3
- export interface RealmNode<T = unknown> {
4
+ /** @internal */
5
+ export interface RealmNode<_T = unknown> {
4
6
  key: NodeKey;
5
7
  toString(): string;
6
8
  }
7
9
  /** @internal */
8
10
  type RN<T = unknown> = RealmNode<T>;
11
+ /** @internal **/
9
12
  export type Subscription<T = any> = (value: T) => unknown;
13
+ /** @internal */
10
14
  export type UnsubscribeHandle = () => void;
11
15
  type ProjectionFunc<T extends unknown[] = unknown[]> = (done: (...values: unknown[]) => void) => (...args: T) => void;
16
+ /** @internal */
12
17
  export interface RealmProjection<T extends unknown[] = unknown[]> {
13
18
  sources: Set<NodeKey>;
14
19
  pulls: Set<NodeKey>;
15
20
  sink: NodeKey;
16
21
  map: ProjectionFunc<T>;
17
22
  }
23
+ /** @internal */
18
24
  export interface RealmProjectionSpec<T extends unknown[] = unknown[]> {
19
25
  sources: RealmNode[];
20
26
  pulls?: RealmNode[];
@@ -23,14 +29,18 @@ export interface RealmProjectionSpec<T extends unknown[] = unknown[]> {
23
29
  }
24
30
  /**
25
31
  * A function which determines if two values are equal.
26
- * Implement custom comparators when [[distinctUntilChanged]] needs to work on non-primitive objects.
32
+ * Implement custom comparators when the distinctUntilChanged operator needs to work on non-primitive objects.
27
33
  * @returns true if values should be considered equal.
28
34
  */
29
35
  export interface Comparator<T = any> {
30
36
  (current: T, next: T): boolean;
31
37
  }
32
38
  type NodesFromValuesRec<T extends unknown[], Acc extends unknown[]> = T extends [infer Head, ...infer Tail] ? NodesFromValuesRec<Tail, [...Acc, Head extends unknown ? RealmNode<Head> : never]> : Acc;
39
+ /** @internal */
33
40
  export type NodesFromValues<T extends unknown[]> = T extends unknown[] ? NodesFromValuesRec<T, []> : never;
41
+ /**
42
+ * A comparator function to determine if two values are equal. Used by distinctUntilChanged operator.
43
+ */
34
44
  export declare function defaultComparator<T>(current: T, next: T): boolean;
35
45
  declare class SetMap<T> {
36
46
  map: Map<string, Set<T>>;
@@ -39,6 +49,9 @@ declare class SetMap<T> {
39
49
  use(key: NodeKey, cb: (value: Set<T>) => unknown): void;
40
50
  delete(key: NodeKey): boolean;
41
51
  }
52
+ /**
53
+ * @internal
54
+ */
42
55
  export declare class RefCount {
43
56
  map: Map<NodeKey, number>;
44
57
  constructor(map?: Map<string, number>);
@@ -46,7 +59,9 @@ export declare class RefCount {
46
59
  increment(key: NodeKey): void;
47
60
  decrement(key: NodeKey, ifZero: () => void): void;
48
61
  }
62
+ /** @internal */
49
63
  export type RealmGraph = SetMap<RealmProjection>;
64
+ /** @internal */
50
65
  export declare function realm(): {
51
66
  combine: {
52
67
  <T1>(nodes_0: RN<T1>): RN<T1>;
@@ -128,6 +143,7 @@ export declare function realm(): {
128
143
  subKey: (key: string, subscription: Subscription<unknown>) => UnsubscribeHandle;
129
144
  subKeys: (keys: string[], subscription: Subscription<unknown>) => UnsubscribeHandle;
130
145
  };
146
+ /** @internal */
131
147
  export interface Realm extends ReturnType<typeof realm> {
132
148
  }
133
149
  export {};
@@ -1,4 +1,7 @@
1
1
  import { Realm, RealmNode, Subscription, UnsubscribeHandle } from './realm';
2
+ /**
3
+ * The system interface is the runtime representation of a state management module, a a record of nodes.
4
+ */
2
5
  export interface System {
3
6
  [key: string]: RealmNode<any>;
4
7
  }
@@ -12,11 +15,13 @@ export interface SystemSpec<Dependencies extends AnySystemSpecs, /** @internal *
12
15
  constructor: Constructor;
13
16
  dependencies: Dependencies;
14
17
  }
18
+ /** @internal **/
15
19
  export interface AnySystemSpec extends SystemSpec<AnySystemSpecs, any> {
16
20
  id: string;
17
21
  }
18
- export interface AnySystemSpecs extends Array<AnySystemSpec> {
19
- }
22
+ /** @internal **/
23
+ export type AnySystemSpecs = Array<AnySystemSpec>;
24
+ /** @internal **/
20
25
  export type SystemOfSpec<Spec extends AnySystemSpec> = ReturnType<Spec['constructor']>;
21
26
  /** @internal **/
22
27
  export type SSR<Spec extends AnySystemSpec> = SystemOfSpec<Spec>;
@@ -30,19 +35,32 @@ type SystemsFromSpecsRec<ST extends unknown[], Acc extends unknown[]> = ST exten
30
35
  export interface SystemConstructor<D extends AnySystemSpecs> {
31
36
  (r: Realm, dependencies: SystemsFromSpecs<D>): System;
32
37
  }
38
+ /**
39
+ * Declare a new state management module (system). The constructor receives the realm and the dependencies as arguments.
40
+ * @param constructor - The system constructor.
41
+ * @param dependencies - The dependencies of the system - other systems.
42
+ */
33
43
  export declare function system<Dependencies extends LongTuple<AnySystemSpec>, Constructor extends SystemConstructor<Dependencies>>(constructor: Constructor, dependencies?: Dependencies): SystemSpec<Dependencies, Constructor>;
34
44
  type SystemKey<S extends System> = Extract<keyof S, string>;
45
+ /** @internal */
35
46
  export type ValuesForKeys<S extends System, K extends SystemKey<S>[]> = K extends unknown[] ? ValuesForKeysRec<S, K, []> : never;
36
47
  type ValuesForKeysRec<S extends Record<any, RealmNode>, K extends unknown[], Acc extends unknown[]> = K extends [infer Head, ...infer Tail] ? ValuesForKeysRec<S, Tail, [...Acc, S[Head] extends RealmNode<infer R> ? R : never]> : Acc;
48
+ /** @internal **/
37
49
  export type SystemOfSpecs<Specs extends AnySystemSpec[]> = Specs extends unknown[] ? SystemOfSpecsRec<Specs, {}> : Specs;
38
50
  type SystemOfSpecsRec<Specs extends unknown[], Acc extends {}> = Specs extends [infer Head, ...infer Tail] ? SystemOfSpecsRec<Tail, Head extends AnySystemSpec ? Acc & SystemOfSpec<Head> : never> : Acc;
51
+ /** @internal */
39
52
  export type LongTuple<K> = [] | [K] | [K, K] | [K, K, K] | [K, K, K, K] | [K, K, K, K, K] | [K, K, K, K, K, K] | [K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K] | [K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K];
53
+ /** @internal */
40
54
  export type SystemKeys<S extends System, K extends Extract<keyof S, string> = Extract<keyof S, string>> = LongTuple<K>;
55
+ /** @internal */
41
56
  export type ValueForKey<S extends System, K extends keyof S> = S[K] extends RealmNode<infer V> ? V : never;
57
+ /** @internal */
42
58
  export type SystemDict<S extends System> = {
43
59
  [K in keyof S]?: ValueForKey<S, K>;
44
60
  };
61
+ /** @internal */
45
62
  export type SystemKeysArray<S extends System> = Array<keyof S>;
63
+ /** @internal */
46
64
  export interface TypedRealm<S extends System> extends Pick<Realm, 'sub' | 'pub' | 'spread' | 'derive' | 'singletonSubKey' | 'resetSingletonSubs'> {
47
65
  getKeyValues<K extends SystemKeys<S>>(keys: K): ValuesForKeys<S, K>;
48
66
  getKeyValue<K extends keyof S>(key: K): ValueForKey<S, K>;
@@ -52,7 +70,10 @@ export interface TypedRealm<S extends System> extends Pick<Realm, 'sub' | 'pub'
52
70
  subKey<K extends keyof S>(key: K, subscription: Subscription<ValueForKey<S, K>>): UnsubscribeHandle;
53
71
  subKeys<K extends SystemKeys<S>>(keys: K, subscription: Subscription<ValuesForKeys<S, K>>): UnsubscribeHandle;
54
72
  }
73
+ /** @internal */
55
74
  export declare function realmFactory<Specs extends LongTuple<AnySystemSpec>>(...specs: Specs): TypedRealm<SystemOfSpecs<Specs>>;
75
+ /** @internal */
56
76
  export type RealmFactory<Sys extends System> = () => TypedRealm<Sys>;
77
+ /** @internal */
57
78
  export declare function getRealmFactory<Specs extends LongTuple<AnySystemSpec>>(...specs: Specs): () => TypedRealm<SystemOfSpecs<[...Specs]>>;
58
79
  export {};
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- const SvgRichText = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_318_249", style: {
2
+ const SvgRichText = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_447_68", style: {
3
3
  maskType: "alpha"
4
- }, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_318_249)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 22V20H19V22H5Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M6.80005 18V4H12.325C13.4084 4 14.4084 4.33333 15.325 5C16.2417 5.66667 16.7001 6.59167 16.7001 7.775C16.7001 8.625 16.5084 9.279 16.125 9.737C15.7417 10.1957 15.3834 10.525 15.05 10.725C15.4667 10.9083 15.9294 11.25 16.438 11.75C16.946 12.25 17.2001 13 17.2001 14C17.2001 15.4833 16.6584 16.521 15.575 17.113C14.4917 17.7043 13.475 18 12.525 18H6.80005ZM9.82505 15.2H12.425C13.225 15.2 13.7124 14.9957 13.887 14.587C14.0624 14.179 14.15 13.8833 14.15 13.7C14.15 13.5167 14.0624 13.2207 13.887 12.812C13.7124 12.404 13.2 12.2 12.35 12.2H9.82505V15.2ZM9.82505 9.5H12.15C12.7 9.5 13.1 9.35833 13.35 9.075C13.6 8.79167 13.725 8.475 13.725 8.125C13.725 7.725 13.5834 7.4 13.3 7.15C13.0167 6.9 12.65 6.775 12.2 6.775H9.82505V9.5Z", fill: "currentColor" })));
4
+ }, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_447_68)" }, /* @__PURE__ */ React.createElement("path", { d: "M6 17H18L14.25 12L11.25 16L9 13L6 17ZM3 21V3H21V21H3ZM5 19H19V5H5V19Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M6 12V6H11V12H9.5V10.5H7.5V12H6ZM7.5 9H9.5V7.5H7.5V9Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M12 6H18V7.5H12V6Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M12 9H18V10.5H12V9Z", fill: "currentColor" })));
5
5
  const RichTextIcon = SvgRichText;
6
6
  export {
7
7
  RichTextIcon as default
@@ -3,6 +3,7 @@ import * as Mdast from 'mdast';
3
3
  import { fromMarkdown } from 'mdast-util-from-markdown';
4
4
  import { ParseOptions } from 'micromark-util-types';
5
5
  import { IS_BOLD, IS_ITALIC, IS_UNDERLINE } from './FormatConstants';
6
+ /** @internal */
6
7
  export type MdastExtensions = NonNullable<Parameters<typeof fromMarkdown>[1]>['mdastExtensions'];
7
8
  /**
8
9
  * A set of actions that can be used to modify the lexical tree while visiting the mdast tree.
@@ -61,12 +62,14 @@ export interface MdastImportVisitor<UN extends Mdast.Content> {
61
62
  }
62
63
  /**
63
64
  * The options of the tree import utility. Not meant to be used directly.
65
+ * @internal
64
66
  */
65
67
  export interface MdastTreeImportOptions {
66
68
  root: LexicalRootNode;
67
69
  visitors: MdastImportVisitor<Mdast.Content>[];
68
70
  mdastRoot: Mdast.Root;
69
71
  }
72
+ /** @internal */
70
73
  export interface MarkdownParseOptions extends Omit<MdastTreeImportOptions, 'mdastRoot'> {
71
74
  markdown: string;
72
75
  syntaxExtensions: NonNullable<ParseOptions['extensions']>;
@@ -74,11 +77,15 @@ export interface MarkdownParseOptions extends Omit<MdastTreeImportOptions, 'mdas
74
77
  }
75
78
  /**
76
79
  * An extension for the `fromMarkdown` utility tree construction.
80
+ * @internal
77
81
  */
78
82
  export type MdastExtension = NonNullable<MdastExtensions>[number];
79
83
  /**
80
84
  * An extension for the `fromMarkdown` utility markdown parse.
85
+ * @internal
81
86
  */
82
87
  export type SyntaxExtension = MarkdownParseOptions['syntaxExtensions'][number];
88
+ /** @internal */
83
89
  export declare function importMarkdownToLexical({ root, markdown, visitors, syntaxExtensions, mdastExtensions }: MarkdownParseOptions): void;
90
+ /** @internal */
84
91
  export declare function importMdastTreeToLexical({ root, mdastRoot, visitors }: MdastTreeImportOptions): void;
@@ -94,6 +94,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
94
94
  markdown: RealmNode<string>;
95
95
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
96
96
  contentEditableClassName: RealmNode<string>;
97
+ autoFocus: RealmNode<boolean>;
97
98
  composerChildren: RealmNode<ComponentType<{}>[]>;
98
99
  addComposerChild: RealmNode<ComponentType<{}>>;
99
100
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -142,6 +143,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
142
143
  markdown: RealmNode<string>;
143
144
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
144
145
  contentEditableClassName: RealmNode<string>;
146
+ autoFocus: RealmNode<boolean>;
145
147
  composerChildren: RealmNode<ComponentType<{}>[]>;
146
148
  addComposerChild: RealmNode<ComponentType<{}>>;
147
149
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -213,6 +215,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
213
215
  markdown: RealmNode<string>;
214
216
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
215
217
  contentEditableClassName: RealmNode<string>;
218
+ autoFocus: RealmNode<boolean>;
216
219
  composerChildren: RealmNode<ComponentType<{}>[]>;
217
220
  addComposerChild: RealmNode<ComponentType<{}>>;
218
221
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -261,6 +264,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
261
264
  markdown: RealmNode<string>;
262
265
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
263
266
  contentEditableClassName: RealmNode<string>;
267
+ autoFocus: RealmNode<boolean>;
264
268
  composerChildren: RealmNode<ComponentType<{}>[]>;
265
269
  addComposerChild: RealmNode<ComponentType<{}>>;
266
270
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -324,6 +328,7 @@ codeBlockPluginHooks: {
324
328
  markdown: RealmNode<string>;
325
329
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
326
330
  contentEditableClassName: RealmNode<string>;
331
+ autoFocus: RealmNode<boolean>;
327
332
  composerChildren: RealmNode<ComponentType<{}>[]>;
328
333
  addComposerChild: RealmNode<ComponentType<{}>>;
329
334
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -344,7 +349,7 @@ codeBlockPluginHooks: {
344
349
  convertSelectionToNode: RealmNode<() => ElementNode>;
345
350
  insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
346
351
  }>;
347
- useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K, callback: (value: ValueForKey<{
352
+ useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K, callback: (value: ValueForKey<{
348
353
  codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
349
354
  defaultCodeBlockLanguage: RealmNode<string>;
350
355
  appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
@@ -378,6 +383,7 @@ codeBlockPluginHooks: {
378
383
  markdown: RealmNode<string>;
379
384
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
380
385
  contentEditableClassName: RealmNode<string>;
386
+ autoFocus: RealmNode<boolean>;
381
387
  composerChildren: RealmNode<ComponentType<{}>[]>;
382
388
  addComposerChild: RealmNode<ComponentType<{}>>;
383
389
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -432,6 +438,7 @@ codeBlockPluginHooks: {
432
438
  markdown: RealmNode<string>;
433
439
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
434
440
  contentEditableClassName: RealmNode<string>;
441
+ autoFocus: RealmNode<boolean>;
435
442
  composerChildren: RealmNode<ComponentType<{}>[]>;
436
443
  addComposerChild: RealmNode<ComponentType<{}>>;
437
444
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -485,6 +492,7 @@ codeBlockPluginHooks: {
485
492
  markdown: RealmNode<string>;
486
493
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
487
494
  contentEditableClassName: RealmNode<string>;
495
+ autoFocus: RealmNode<boolean>;
488
496
  composerChildren: RealmNode<ComponentType<{}>[]>;
489
497
  addComposerChild: RealmNode<ComponentType<{}>>;
490
498
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -539,6 +547,7 @@ codeBlockPluginHooks: {
539
547
  markdown: RealmNode<string>;
540
548
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
541
549
  contentEditableClassName: RealmNode<string>;
550
+ autoFocus: RealmNode<boolean>;
542
551
  composerChildren: RealmNode<ComponentType<{}>[]>;
543
552
  addComposerChild: RealmNode<ComponentType<{}>>;
544
553
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -559,7 +568,7 @@ codeBlockPluginHooks: {
559
568
  convertSelectionToNode: RealmNode<() => ElementNode>;
560
569
  insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
561
570
  }>) => void;
562
- usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K_2) => (value: ValueForKey<{
571
+ usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K_2) => (value: ValueForKey<{
563
572
  codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
564
573
  defaultCodeBlockLanguage: RealmNode<string>;
565
574
  appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
@@ -593,6 +602,7 @@ codeBlockPluginHooks: {
593
602
  markdown: RealmNode<string>;
594
603
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
595
604
  contentEditableClassName: RealmNode<string>;
605
+ autoFocus: RealmNode<boolean>;
596
606
  composerChildren: RealmNode<ComponentType<{}>[]>;
597
607
  addComposerChild: RealmNode<ComponentType<{}>>;
598
608
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -42,6 +42,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
42
42
  markdown: RealmNode<string>;
43
43
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
44
44
  contentEditableClassName: RealmNode<string>;
45
+ autoFocus: RealmNode<boolean>;
45
46
  composerChildren: RealmNode<ComponentType<{}>[]>;
46
47
  addComposerChild: RealmNode<ComponentType<{}>>;
47
48
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -90,6 +91,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
90
91
  markdown: RealmNode<string>;
91
92
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
92
93
  contentEditableClassName: RealmNode<string>;
94
+ autoFocus: RealmNode<boolean>;
93
95
  composerChildren: RealmNode<ComponentType<{}>[]>;
94
96
  addComposerChild: RealmNode<ComponentType<{}>>;
95
97
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -138,6 +140,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
138
140
  markdown: RealmNode<string>;
139
141
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
140
142
  contentEditableClassName: RealmNode<string>;
143
+ autoFocus: RealmNode<boolean>;
141
144
  composerChildren: RealmNode<ComponentType<{}>[]>;
142
145
  addComposerChild: RealmNode<ComponentType<{}>>;
143
146
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -191,6 +194,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
191
194
  markdown: RealmNode<string>;
192
195
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
193
196
  contentEditableClassName: RealmNode<string>;
197
+ autoFocus: RealmNode<boolean>;
194
198
  composerChildren: RealmNode<ComponentType<{}>[]>;
195
199
  addComposerChild: RealmNode<ComponentType<{}>>;
196
200
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -253,6 +257,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
253
257
  markdown: RealmNode<string>;
254
258
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
255
259
  contentEditableClassName: RealmNode<string>;
260
+ autoFocus: RealmNode<boolean>;
256
261
  composerChildren: RealmNode<ComponentType<{}>[]>;
257
262
  addComposerChild: RealmNode<ComponentType<{}>>;
258
263
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -301,6 +306,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
301
306
  markdown: RealmNode<string>;
302
307
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
303
308
  contentEditableClassName: RealmNode<string>;
309
+ autoFocus: RealmNode<boolean>;
304
310
  composerChildren: RealmNode<ComponentType<{}>[]>;
305
311
  addComposerChild: RealmNode<ComponentType<{}>>;
306
312
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -349,6 +355,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
349
355
  markdown: RealmNode<string>;
350
356
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
351
357
  contentEditableClassName: RealmNode<string>;
358
+ autoFocus: RealmNode<boolean>;
352
359
  composerChildren: RealmNode<ComponentType<{}>[]>;
353
360
  addComposerChild: RealmNode<ComponentType<{}>>;
354
361
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -402,6 +409,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
402
409
  markdown: RealmNode<string>;
403
410
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
404
411
  contentEditableClassName: RealmNode<string>;
412
+ autoFocus: RealmNode<boolean>;
405
413
  composerChildren: RealmNode<ComponentType<{}>[]>;
406
414
  addComposerChild: RealmNode<ComponentType<{}>>;
407
415
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -472,6 +480,7 @@ codeMirrorHooks: {
472
480
  markdown: RealmNode<string>;
473
481
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
474
482
  contentEditableClassName: RealmNode<string>;
483
+ autoFocus: RealmNode<boolean>;
475
484
  composerChildren: RealmNode<ComponentType<{}>[]>;
476
485
  addComposerChild: RealmNode<ComponentType<{}>>;
477
486
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -497,7 +506,7 @@ codeMirrorHooks: {
497
506
  appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
498
507
  insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
499
508
  }>;
500
- useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K, callback: (value: ValueForKey<{
509
+ useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K, callback: (value: ValueForKey<{
501
510
  codeBlockLanguages: RealmNode<Record<string, string>>;
502
511
  insertCodeMirror: RealmNode<{
503
512
  language: string;
@@ -532,6 +541,7 @@ codeMirrorHooks: {
532
541
  markdown: RealmNode<string>;
533
542
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
534
543
  contentEditableClassName: RealmNode<string>;
544
+ autoFocus: RealmNode<boolean>;
535
545
  composerChildren: RealmNode<ComponentType<{}>[]>;
536
546
  addComposerChild: RealmNode<ComponentType<{}>>;
537
547
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -592,6 +602,7 @@ codeMirrorHooks: {
592
602
  markdown: RealmNode<string>;
593
603
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
594
604
  contentEditableClassName: RealmNode<string>;
605
+ autoFocus: RealmNode<boolean>;
595
606
  composerChildren: RealmNode<ComponentType<{}>[]>;
596
607
  addComposerChild: RealmNode<ComponentType<{}>>;
597
608
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -651,6 +662,7 @@ codeMirrorHooks: {
651
662
  markdown: RealmNode<string>;
652
663
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
653
664
  contentEditableClassName: RealmNode<string>;
665
+ autoFocus: RealmNode<boolean>;
654
666
  composerChildren: RealmNode<ComponentType<{}>[]>;
655
667
  addComposerChild: RealmNode<ComponentType<{}>>;
656
668
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -711,6 +723,7 @@ codeMirrorHooks: {
711
723
  markdown: RealmNode<string>;
712
724
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
713
725
  contentEditableClassName: RealmNode<string>;
726
+ autoFocus: RealmNode<boolean>;
714
727
  composerChildren: RealmNode<ComponentType<{}>[]>;
715
728
  addComposerChild: RealmNode<ComponentType<{}>>;
716
729
  topAreaChildren: RealmNode<ComponentType<{}>[]>;
@@ -736,7 +749,7 @@ codeMirrorHooks: {
736
749
  appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
737
750
  insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
738
751
  }>) => void;
739
- usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K_2) => (value: ValueForKey<{
752
+ usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K_2) => (value: ValueForKey<{
740
753
  codeBlockLanguages: RealmNode<Record<string, string>>;
741
754
  insertCodeMirror: RealmNode<{
742
755
  language: string;
@@ -771,6 +784,7 @@ codeMirrorHooks: {
771
784
  markdown: RealmNode<string>;
772
785
  editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
773
786
  contentEditableClassName: RealmNode<string>;
787
+ autoFocus: RealmNode<boolean>;
774
788
  composerChildren: RealmNode<ComponentType<{}>[]>;
775
789
  addComposerChild: RealmNode<ComponentType<{}>>;
776
790
  topAreaChildren: RealmNode<ComponentType<{}>[]>;