@prosekit/lit 0.1.4 → 0.1.5

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.
@@ -505,6 +505,7 @@ export declare class ListManager<Item extends {
505
505
  onSelect: (item?: Item | null) => void;
506
506
  });
507
507
  get items(): Item[];
508
+ get active(): boolean;
508
509
  get availableItems(): Item[];
509
510
  get firstItem(): Item | null;
510
511
  get selectedItem(): Item | null;
@@ -675,7 +676,7 @@ declare const propNames_3: readonly ["editor"];
675
676
  export { propNames_3 as propNames_alias_3 }
676
677
  export { propNames_3 as propNames_alias_4 }
677
678
 
678
- declare const propNames_4: never[];
679
+ declare const propNames_4: readonly ["onSelect"];
679
680
  export { propNames_4 as propNames_alias_8 }
680
681
  export { propNames_4 as propNames_alias_9 }
681
682
 
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  // src/components/combo-box-item/component.ts
10
10
  import { ContextConsumer } from "@lit/context";
11
- var propNames = [];
11
+ var propNames = ["onSelect"];
12
12
  var ComboBoxItem = class extends LightElement {
13
13
  constructor() {
14
14
  super(...arguments);
@@ -14,6 +14,9 @@ var ListManager = class {
14
14
  get items() {
15
15
  return this.getItems();
16
16
  }
17
+ get active() {
18
+ return this.getActive();
19
+ }
17
20
  get availableItems() {
18
21
  var _a, _b;
19
22
  return (_b = (_a = this.items) == null ? void 0 : _a.filter((item) => !item.hidden)) != null ? _b : [];
@@ -49,6 +52,8 @@ var ListManager = class {
49
52
  this.setSelectedValue(this.getItemValue(item), reason);
50
53
  }
51
54
  selectFirstItem() {
55
+ if (!this.active)
56
+ return;
52
57
  const item = this.firstItem;
53
58
  const value = item ? this.getItemValue(item) : "";
54
59
  this.setSelectedValue(value, "keyboard");
@@ -80,25 +85,25 @@ var ListManager = class {
80
85
  }
81
86
  }
82
87
  handleArrowUp() {
83
- if (!this.getActive())
88
+ if (!this.active)
84
89
  return false;
85
90
  this.updateSelectedByChange(-1);
86
91
  return true;
87
92
  }
88
93
  handleArrowDown() {
89
- if (!this.getActive())
94
+ if (!this.active)
90
95
  return false;
91
96
  this.updateSelectedByChange(1);
92
97
  return true;
93
98
  }
94
99
  handleEscape() {
95
- if (!this.getActive())
100
+ if (!this.active)
96
101
  return false;
97
102
  this.onDismiss();
98
103
  return true;
99
104
  }
100
105
  handleEnter() {
101
- if (!this.getActive())
106
+ if (!this.active)
102
107
  return false;
103
108
  this.onSelect(this.selectedItem);
104
109
  return true;
@@ -142,7 +142,7 @@ var Popover = class extends LightElement {
142
142
  updated(changedProperties) {
143
143
  var _a;
144
144
  super.updated(changedProperties);
145
- if (popoverAvailable) {
145
+ if (popoverAvailable && this.isConnected) {
146
146
  this.popover = "manual";
147
147
  (_a = this.togglePopover) == null ? void 0 : _a.call(this, this.active);
148
148
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5CI65R73.js";
4
4
  import {
5
5
  ListManager
6
- } from "./chunk-PW3MTUZM.js";
6
+ } from "./chunk-GZRUCYLP.js";
7
7
  import {
8
8
  LightElement,
9
9
  defineCustomElement
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  AutocompleteList,
3
3
  propNames
4
- } from "./chunk-TGJAVLMZ.js";
4
+ } from "./chunk-WWRKI6AU.js";
5
5
  import "./chunk-MLUELLVA.js";
6
6
  import "./chunk-5CI65R73.js";
7
- import "./chunk-PW3MTUZM.js";
7
+ import "./chunk-GZRUCYLP.js";
8
8
  import "./chunk-S32IZIQF.js";
9
9
  export {
10
10
  AutocompleteList,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  autocompletePopoverContext
3
- } from "./chunk-TGJAVLMZ.js";
3
+ } from "./chunk-WWRKI6AU.js";
4
4
  import "./chunk-MLUELLVA.js";
5
5
  import "./chunk-5CI65R73.js";
6
6
  import {
7
7
  Popover,
8
8
  boundary
9
- } from "./chunk-Z3PEQ6MW.js";
10
- import "./chunk-PW3MTUZM.js";
9
+ } from "./chunk-I2VPMW75.js";
10
+ import "./chunk-GZRUCYLP.js";
11
11
  import {
12
12
  defineCustomElement
13
13
  } from "./chunk-S32IZIQF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ComboBoxItem,
3
3
  propNames
4
- } from "./chunk-L6FOAZFL.js";
4
+ } from "./chunk-7RGGPFFK.js";
5
5
  import "./chunk-C4MW43I4.js";
6
6
  import "./chunk-S32IZIQF.js";
7
7
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Popover
3
- } from "./chunk-Z3PEQ6MW.js";
3
+ } from "./chunk-I2VPMW75.js";
4
4
  import {
5
5
  ListManager
6
- } from "./chunk-PW3MTUZM.js";
7
- import "./chunk-L6FOAZFL.js";
6
+ } from "./chunk-GZRUCYLP.js";
7
+ import "./chunk-7RGGPFFK.js";
8
8
  import {
9
9
  comboBoxContext
10
10
  } from "./chunk-C4MW43I4.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Popover
3
- } from "./chunk-Z3PEQ6MW.js";
3
+ } from "./chunk-I2VPMW75.js";
4
4
  import {
5
5
  defineCustomElement
6
6
  } from "./chunk-S32IZIQF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Popover,
3
3
  propNames
4
- } from "./chunk-Z3PEQ6MW.js";
4
+ } from "./chunk-I2VPMW75.js";
5
5
  import "./chunk-S32IZIQF.js";
6
6
  export {
7
7
  Popover,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/lit",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -87,9 +87,9 @@
87
87
  "dependencies": {
88
88
  "@floating-ui/dom": "^1.5.3",
89
89
  "@lit/context": "^1.1.0",
90
- "@prosekit/core": "^0.1.0",
91
- "@prosekit/extensions": "^0.1.0",
92
- "@prosekit/pm": "^0.1.0",
90
+ "@prosekit/core": "^0.1.9",
91
+ "@prosekit/extensions": "^0.1.6",
92
+ "@prosekit/pm": "^0.1.1",
93
93
  "@superhuman/command-score": "^0.5.0",
94
94
  "lit": "^3.1.0"
95
95
  },
@@ -98,8 +98,8 @@
98
98
  "minify-literals": "^1.0.8",
99
99
  "tsup": "^8.0.1",
100
100
  "typescript": "^5.3.3",
101
- "vitest": "^1.0.2",
102
- "vue": "^3.3.11"
101
+ "vitest": "^1.0.4",
102
+ "vue": "^3.3.12"
103
103
  },
104
104
  "scripts": {
105
105
  "build:tsup": "tsup",