@prosekit/lit 0.2.3 → 0.2.4

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.
@@ -516,7 +516,7 @@ export declare class ListManager<Item extends {
516
516
  queryClosestItem: (element: HTMLElement) => Item | null;
517
517
  getActive: () => boolean;
518
518
  onDismiss: () => void;
519
- onSelect: (item?: Item | null) => void;
519
+ onSelect: (item?: Item | null) => boolean;
520
520
  });
521
521
  get items(): Item[];
522
522
  get active(): boolean;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5CI65R73.js";
4
4
  import {
5
5
  ListManager
6
- } from "./chunk-GZRUCYLP.js";
6
+ } from "./chunk-MZAHIYA5.js";
7
7
  import {
8
8
  LightElement,
9
9
  defineCustomElement
@@ -101,9 +101,13 @@ var AutocompleteList = class extends LightElement {
101
101
  return (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.handleDismiss) == null ? void 0 : _b.call(_a);
102
102
  },
103
103
  onSelect: (item) => {
104
- var _a, _b, _c;
105
- (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.handleSubmit) == null ? void 0 : _b.call(_a);
106
- (_c = item == null ? void 0 : item.onSelect) == null ? void 0 : _c.call(item);
104
+ var _a, _b;
105
+ if (item == null ? void 0 : item.onSelect) {
106
+ (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.handleSubmit) == null ? void 0 : _b.call(_a);
107
+ item.onSelect();
108
+ return true;
109
+ }
110
+ return false;
107
111
  }
108
112
  });
109
113
  /**
@@ -105,8 +105,7 @@ var ListManager = class {
105
105
  handleEnter() {
106
106
  if (!this.active)
107
107
  return false;
108
- this.onSelect(this.selectedItem);
109
- return true;
108
+ return this.onSelect(this.selectedItem);
110
109
  }
111
110
  };
112
111
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  AutocompleteList,
3
3
  propNames
4
- } from "./chunk-JMZWTLTD.js";
4
+ } from "./chunk-CPC45JQ7.js";
5
5
  import "./chunk-I5EMQRE4.js";
6
6
  import "./chunk-5CI65R73.js";
7
- import "./chunk-GZRUCYLP.js";
7
+ import "./chunk-MZAHIYA5.js";
8
8
  import "./chunk-3AZDRLDR.js";
9
9
  export {
10
10
  AutocompleteList,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  autocompletePopoverContext
3
- } from "./chunk-JMZWTLTD.js";
3
+ } from "./chunk-CPC45JQ7.js";
4
4
  import "./chunk-I5EMQRE4.js";
5
5
  import "./chunk-5CI65R73.js";
6
6
  import {
7
7
  Popover
8
8
  } from "./chunk-YOZJWJGG.js";
9
- import "./chunk-GZRUCYLP.js";
9
+ import "./chunk-MZAHIYA5.js";
10
10
  import {
11
11
  defineCustomElement
12
12
  } from "./chunk-3AZDRLDR.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YOZJWJGG.js";
4
4
  import {
5
5
  ListManager
6
- } from "./chunk-GZRUCYLP.js";
6
+ } from "./chunk-MZAHIYA5.js";
7
7
  import "./chunk-3TPE2GKD.js";
8
8
  import {
9
9
  comboBoxContext
@@ -63,9 +63,13 @@ var ComboBox = class extends Popover {
63
63
  },
64
64
  onSelect: (item) => {
65
65
  var _a;
66
- this.setSelectedValue("", "keyboard");
67
- (_a = item == null ? void 0 : item.onSelect) == null ? void 0 : _a.call(item);
68
- this.hide();
66
+ if (item == null ? void 0 : item.onSelect) {
67
+ this.setSelectedValue("", "keyboard");
68
+ (_a = item == null ? void 0 : item.onSelect) == null ? void 0 : _a.call(item);
69
+ this.hide();
70
+ return true;
71
+ }
72
+ return false;
69
73
  }
70
74
  });
71
75
  this.context = new ContextProvider(this, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/lit",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -98,7 +98,7 @@
98
98
  "@floating-ui/dom": "^1.6.1",
99
99
  "@lit/context": "^1.1.0",
100
100
  "@prosekit/core": "^0.3.0",
101
- "@prosekit/extensions": "^0.3.0",
101
+ "@prosekit/extensions": "^0.3.1",
102
102
  "@prosekit/pm": "^0.1.1",
103
103
  "@superhuman/command-score": "^0.5.0",
104
104
  "@zag-js/dismissable": "^0.34.0",