@lexical/headless 0.14.5 → 0.15.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.
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';
8
10
 
9
11
  var lexical = require('lexical');
@@ -16,6 +18,7 @@ var lexical = require('lexical');
16
18
  *
17
19
  */
18
20
 
21
+
19
22
  /**
20
23
  * Generates a headless editor that allows lexical to be used without the need for a DOM, eg in Node.js.
21
24
  * Throws an error when unsupported methods are used.
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import { createEditor } from 'lexical';
8
10
 
9
11
  /**
@@ -14,6 +16,7 @@ import { createEditor } from 'lexical';
14
16
  *
15
17
  */
16
18
 
19
+
17
20
  /**
18
21
  * Generates a headless editor that allows lexical to be used without the need for a DOM, eg in Node.js.
19
22
  * Throws an error when unsupported methods are used.
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict'
8
10
  const LexicalHeadless = process.env.NODE_ENV === 'development' ? require('./LexicalHeadless.dev.js') : require('./LexicalHeadless.prod.js');
9
11
  module.exports = LexicalHeadless;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import * as modDev from './LexicalHeadless.dev.mjs';
8
10
  import * as modProd from './LexicalHeadless.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHeadless.dev.mjs') : import('./LexicalHeadless.prod.mjs'));
8
10
  export const createHeadlessEditor = mod.createHeadlessEditor;
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';var c=require("lexical");exports.createHeadlessEditor=function(d){let a=c.createEditor(d);a._headless=!0;"registerDecoratorListener registerRootListener registerMutationListener getRootElement setRootElement getElementByKey focus blur".split(" ").forEach(b=>{a[b]=()=>{throw Error(`${b} is not supported in headless mode`);}});return a}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import{createEditor as e}from"lexical";function t(t){const r=e(t);r._headless=!0;return["registerDecoratorListener","registerRootListener","registerMutationListener","getRootElement","setRootElement","getElementByKey","focus","blur"].forEach((e=>{r[e]=()=>{throw new Error(`${e} is not supported in headless mode`)}})),r}export{t as createHeadlessEditor};
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "headless"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.14.5",
11
+ "version": "0.15.0",
12
12
  "main": "LexicalHeadless.js",
13
13
  "types": "index.d.ts",
14
14
  "repository": {
@@ -36,6 +36,6 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "lexical": "0.14.5"
39
+ "lexical": "0.15.0"
40
40
  }
41
41
  }