@etrepum/lexical-builder-ssr 0.0.32

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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # `@etrepum/lexical-builder-ssr`
2
+
3
+ **EXPERIMENTAL** Lexical Builder Ssr
package/dist/dom.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare function withDOM<T>(f: (window: Window) => T): T;
9
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAEtD"}
package/dist/dom.js ADDED
@@ -0,0 +1,6 @@
1
+ function t(n) {
2
+ return n(window);
3
+ }
4
+ export {
5
+ t as withDOM
6
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare function withDOM<T>(f: (window: Window) => T): T;
9
+ //# sourceMappingURL=dom.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.node.d.ts","sourceRoot":"","sources":["../src/dom.node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAqBtD"}
@@ -0,0 +1,16 @@
1
+ import { JSDOM as l } from "jsdom";
2
+ function w(n) {
3
+ const i = globalThis.window;
4
+ if (i)
5
+ return n(globalThis.window);
6
+ const t = globalThis.MutationObserver, e = globalThis.document, o = new l().window;
7
+ globalThis.window = o, globalThis.document = o.document, globalThis.MutationObserver = o.MutationObserver;
8
+ try {
9
+ return n(o);
10
+ } finally {
11
+ globalThis.MutationObserver = t, globalThis.document = e, globalThis.window = i;
12
+ }
13
+ }
14
+ export {
15
+ w as withDOM
16
+ };
@@ -0,0 +1,7 @@
1
+ import { LexicalEditor } from 'lexical';
2
+ import { withDOM as withDOMLocal } from '@etrepum/lexical-builder-ssr/dom';
3
+
4
+ export declare const PACKAGE_VERSION: string;
5
+ export declare const withDOM: typeof withDOMLocal;
6
+ export declare function prerenderEditorHtml(editor: LexicalEditor): string;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAE3E,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,eAAO,MAAM,OAAO,qBAAe,CAAC;AAEpC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CASjE"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ import { withDOM as r } from "@etrepum/lexical-builder-ssr/dom";
2
+ const s = "0.0.32", l = r;
3
+ function c(e) {
4
+ return l(({ document: n }) => {
5
+ const t = n.createElement("div");
6
+ t.contentEditable = "false", e.setRootElement(t);
7
+ const o = t.innerHTML;
8
+ return e.setRootElement(null), o;
9
+ });
10
+ }
11
+ export {
12
+ s as PACKAGE_VERSION,
13
+ c as prerenderEditorHtml,
14
+ l as withDOM
15
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export default function invariant(cond?: boolean, message?: string, ...args: string[]): asserts cond;
9
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/shared/invariant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAQd"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@etrepum/lexical-builder-ssr",
3
+ "description": "[EXPERIMENTAL] Lexical Builder @etrepum/lexical-builder-ssr",
4
+ "type": "module",
5
+ "keywords": [
6
+ "lexical",
7
+ "lexical-builder",
8
+ "plug-in",
9
+ "plan"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc --noEmit && vite build",
13
+ "dev": "vite",
14
+ "test": "vitest run",
15
+ "test:watch": "vitest",
16
+ "lint": "eslint"
17
+ },
18
+ "version": "0.0.32",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/etrepum/lexical-builder.git",
23
+ "directory": "packages/lexical-builder-ssr"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/etrepum/lexical-builder/issues"
27
+ },
28
+ "homepage": "https://github.com/etrepum/lexical-builder",
29
+ "dependencies": {
30
+ "@etrepum/lexical-builder": "*"
31
+ },
32
+ "peerDependencies": {
33
+ "jsdom": ">=20.0.0",
34
+ "lexical": ">=0.16.2-nightly.20240716"
35
+ },
36
+ "sideEffects": false,
37
+ "devDependencies": {
38
+ "@repo/eslint-config": "*",
39
+ "@testing-library/dom": "*",
40
+ "@testing-library/jest-dom": "*",
41
+ "@testing-library/user-event": "*",
42
+ "@types/jsdom": "^21.1.7",
43
+ "eslint": "*",
44
+ "tslib": "*",
45
+ "typescript": "*",
46
+ "vite": "*",
47
+ "vite-plugin-dts": "*",
48
+ "vite-plugin-package-version": "*",
49
+ "vitest": "*"
50
+ },
51
+ "exports": {
52
+ ".": "./dist/index.js",
53
+ "./dom": {
54
+ "browser": "./dist/dom.js",
55
+ "default": "./dist/dom.node.js"
56
+ }
57
+ },
58
+ "files": [
59
+ "dist"
60
+ ]
61
+ }