@prosekit/lit 0.2.2 → 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.
- package/dist/_tsup-dts-rollup.d.ts +1 -1
- package/dist/{chunk-JMZWTLTD.js → chunk-CPC45JQ7.js} +8 -4
- package/dist/{chunk-GZRUCYLP.js → chunk-MZAHIYA5.js} +1 -2
- package/dist/prosekit-lit-autocomplete-list.js +2 -2
- package/dist/prosekit-lit-autocomplete-popover.js +3 -2
- package/dist/prosekit-lit-combo-box.js +8 -4
- package/dist/prosekit-lit-inline-popover.js +1 -1
- package/package.json +2 -2
@@ -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) =>
|
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-
|
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
|
105
|
-
|
106
|
-
|
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
|
/**
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
AutocompleteList,
|
3
3
|
propNames
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-CPC45JQ7.js";
|
5
5
|
import "./chunk-I5EMQRE4.js";
|
6
6
|
import "./chunk-5CI65R73.js";
|
7
|
-
import "./chunk-
|
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-
|
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-
|
9
|
+
import "./chunk-MZAHIYA5.js";
|
10
10
|
import {
|
11
11
|
defineCustomElement
|
12
12
|
} from "./chunk-3AZDRLDR.js";
|
@@ -119,6 +119,7 @@ var AutocompletePopover = class extends Popover {
|
|
119
119
|
this.positioning = {
|
120
120
|
strategy: "fixed",
|
121
121
|
placement: "bottom-start",
|
122
|
+
fitViewport: true,
|
122
123
|
flip: false,
|
123
124
|
inline: true
|
124
125
|
};
|
@@ -3,7 +3,7 @@ import {
|
|
3
3
|
} from "./chunk-YOZJWJGG.js";
|
4
4
|
import {
|
5
5
|
ListManager
|
6
|
-
} from "./chunk-
|
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
|
-
|
67
|
-
|
68
|
-
|
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.
|
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.
|
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",
|