@prosekit/lit 0.1.4 → 0.1.6
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 +2 -1
- package/dist/{chunk-L6FOAZFL.js → chunk-7RGGPFFK.js} +1 -1
- package/dist/{chunk-Z3PEQ6MW.js → chunk-CUH6G34Q.js} +2 -2
- package/dist/{chunk-PW3MTUZM.js → chunk-GZRUCYLP.js} +9 -4
- package/dist/{chunk-TGJAVLMZ.js → chunk-WWRKI6AU.js} +1 -1
- package/dist/prosekit-lit-autocomplete-list.js +2 -2
- package/dist/prosekit-lit-autocomplete-popover.js +3 -3
- package/dist/prosekit-lit-combo-box-item.js +1 -1
- package/dist/prosekit-lit-combo-box.js +3 -3
- package/dist/prosekit-lit-inline-popover.js +1 -1
- package/dist/prosekit-lit-popover.js +1 -1
- package/package.json +5 -6
@@ -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:
|
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
|
|
@@ -37,7 +37,7 @@ var defaultDetectOverflowOptions = {
|
|
37
37
|
var defaultPopoverOptions = {
|
38
38
|
placement: "bottom",
|
39
39
|
middleware: [
|
40
|
-
offset({ mainAxis:
|
40
|
+
offset({ mainAxis: 2, crossAxis: 0 }),
|
41
41
|
shift({ ...defaultDetectOverflowOptions }),
|
42
42
|
size({
|
43
43
|
apply: ({ availableWidth, availableHeight, elements }) => {
|
@@ -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
|
}
|
@@ -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.
|
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.
|
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.
|
100
|
+
if (!this.active)
|
96
101
|
return false;
|
97
102
|
this.onDismiss();
|
98
103
|
return true;
|
99
104
|
}
|
100
105
|
handleEnter() {
|
101
|
-
if (!this.
|
106
|
+
if (!this.active)
|
102
107
|
return false;
|
103
108
|
this.onSelect(this.selectedItem);
|
104
109
|
return true;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
AutocompleteList,
|
3
3
|
propNames
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-WWRKI6AU.js";
|
5
5
|
import "./chunk-MLUELLVA.js";
|
6
6
|
import "./chunk-5CI65R73.js";
|
7
|
-
import "./chunk-
|
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-
|
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-
|
10
|
-
import "./chunk-
|
9
|
+
} from "./chunk-CUH6G34Q.js";
|
10
|
+
import "./chunk-GZRUCYLP.js";
|
11
11
|
import {
|
12
12
|
defineCustomElement
|
13
13
|
} from "./chunk-S32IZIQF.js";
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
Popover
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-CUH6G34Q.js";
|
4
4
|
import {
|
5
5
|
ListManager
|
6
|
-
} from "./chunk-
|
7
|
-
import "./chunk-
|
6
|
+
} from "./chunk-GZRUCYLP.js";
|
7
|
+
import "./chunk-7RGGPFFK.js";
|
8
8
|
import {
|
9
9
|
comboBoxContext
|
10
10
|
} from "./chunk-C4MW43I4.js";
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/lit",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.1.
|
4
|
+
"version": "0.1.6",
|
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.
|
91
|
-
"@prosekit/extensions": "^0.
|
92
|
-
"@prosekit/pm": "^0.1.
|
90
|
+
"@prosekit/core": "^0.2.0",
|
91
|
+
"@prosekit/extensions": "^0.2.0",
|
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,7 @@
|
|
98
98
|
"minify-literals": "^1.0.8",
|
99
99
|
"tsup": "^8.0.1",
|
100
100
|
"typescript": "^5.3.3",
|
101
|
-
"vitest": "^1.0
|
102
|
-
"vue": "^3.3.11"
|
101
|
+
"vitest": "^1.1.0"
|
103
102
|
},
|
104
103
|
"scripts": {
|
105
104
|
"build:tsup": "tsup",
|