@tanstack/lit-hotkeys 0.24.0 → 0.24.1

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.
@@ -1,11 +1,18 @@
1
+ import { isServer } from "lit";
2
+
1
3
  // src/controllers/_server.ts
4
+ const nodeBuild = isServer;
2
5
  /**
3
6
  * Whether the code runs on a server. With `@lit-labs/ssr`'s
4
7
  * `connectedCallback: true` option, the server calls `hostConnected` and never
5
8
  * calls `hostDisconnected`, so controllers must not subscribe there.
9
+ *
10
+ * `@lit-labs/ssr`'s DOM shim defines a `document` with no window. Lit's own
11
+ * `isServer` is also true where Lit's Node build runs with a real DOM, such as
12
+ * tests in happy-dom or jsdom, and controllers must work there.
6
13
  */
7
- function isServer() {
8
- return typeof document === "undefined";
14
+ function isServer$1() {
15
+ return typeof document === "undefined" || nodeBuild && !document.defaultView;
9
16
  }
10
17
 
11
- export { isServer };
18
+ export { isServer$1 as isServer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/lit-hotkeys",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "description": "Lit adapter for TanStack Hotkeys",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -35,9 +35,10 @@
35
35
  "skills"
36
36
  ],
37
37
  "dependencies": {
38
- "@tanstack/hotkeys": "0.27.0"
38
+ "@tanstack/hotkeys": "0.27.1"
39
39
  },
40
40
  "devDependencies": {
41
+ "@lit-labs/ssr": "^4.1.0",
41
42
  "@tanstack/hotkeys-test-utils": "0.0.0",
42
43
  "lit": "^3.3.3"
43
44
  },