@lexical/headless 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LexicalHeadless.d.ts +3 -1
- package/LexicalHeadless.dev.js +0 -2
- package/package.json +2 -2
package/LexicalHeadless.d.ts
CHANGED
|
@@ -13,12 +13,14 @@ import type {
|
|
|
13
13
|
EditorThemeClasses,
|
|
14
14
|
} from 'lexical';
|
|
15
15
|
|
|
16
|
+
import {Class} from 'utility-types';
|
|
17
|
+
|
|
16
18
|
export function createHeadlessEditor(editorConfig?: {
|
|
17
19
|
namespace?: string;
|
|
18
20
|
editorState?: EditorState;
|
|
19
21
|
theme?: EditorThemeClasses;
|
|
20
22
|
parentEditor?: LexicalEditor;
|
|
21
|
-
nodes?:
|
|
23
|
+
nodes?: ReadonlyArray<Class<LexicalNode>>;
|
|
22
24
|
onError: (error: Error) => void;
|
|
23
25
|
disableEvents?: boolean;
|
|
24
26
|
readOnly?: boolean;
|
package/LexicalHeadless.dev.js
CHANGED
|
@@ -14,13 +14,11 @@ var lexical = require('lexical');
|
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
17
|
*/
|
|
19
18
|
function createHeadlessEditor(editorConfig) {
|
|
20
19
|
const editor = lexical.createEditor(editorConfig);
|
|
21
20
|
editor._headless = true;
|
|
22
21
|
['registerDecoratorListener', 'registerRootListener', 'registerMutationListeners', 'getRootElement', 'setRootElement', 'getElementByKey', 'focus', 'blur'].forEach(method => {
|
|
23
|
-
// $FlowFixMe
|
|
24
22
|
editor[method] = () => {
|
|
25
23
|
throw new Error(`${method} is not supported in headless mode`);
|
|
26
24
|
};
|
package/package.json
CHANGED