@prosekit/lit 0.0.0-next-20231120040948 → 0.0.0-next-20240421132240
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 +33 -433
- package/dist/prosekit-lit-autocomplete.d.ts +4 -0
- package/dist/prosekit-lit-autocomplete.js +11 -0
- package/dist/prosekit-lit-block-handle.d.ts +2 -0
- package/dist/prosekit-lit-block-handle.js +7 -0
- package/dist/prosekit-lit-inline-popover.d.ts +0 -3
- package/dist/prosekit-lit-inline-popover.js +2 -151
- package/dist/prosekit-lit-popover.d.ts +3 -5
- package/dist/prosekit-lit-popover.js +7 -7
- package/dist/prosekit-lit-resizable.d.ts +2 -0
- package/dist/prosekit-lit-resizable.js +7 -0
- package/dist/prosekit-lit-tooltip.d.ts +3 -0
- package/dist/prosekit-lit-tooltip.js +9 -0
- package/package.json +35 -73
- package/dist/chunk-55G7TJI3.js +0 -48
- package/dist/chunk-6P3YKUWI.js +0 -9
- package/dist/chunk-7WLKD2U6.js +0 -184
- package/dist/chunk-C4MW43I4.js +0 -9
- package/dist/chunk-GWGDLLFN.js +0 -61
- package/dist/chunk-O5JP3B34.js +0 -31
- package/dist/chunk-PCXKL6TA.js +0 -109
- package/dist/chunk-XBNMYITV.js +0 -191
- package/dist/prosekit-lit-autocomplete-empty.d.ts +0 -3
- package/dist/prosekit-lit-autocomplete-empty.js +0 -44
- package/dist/prosekit-lit-autocomplete-item.d.ts +0 -3
- package/dist/prosekit-lit-autocomplete-item.js +0 -10
- package/dist/prosekit-lit-autocomplete-list.d.ts +0 -3
- package/dist/prosekit-lit-autocomplete-list.js +0 -12
- package/dist/prosekit-lit-autocomplete-popover.d.ts +0 -4
- package/dist/prosekit-lit-autocomplete-popover.js +0 -252
- package/dist/prosekit-lit-combo-box-input.d.ts +0 -3
- package/dist/prosekit-lit-combo-box-input.js +0 -72
- package/dist/prosekit-lit-combo-box-item.d.ts +0 -3
- package/dist/prosekit-lit-combo-box-item.js +0 -10
- package/dist/prosekit-lit-combo-box-list.d.ts +0 -3
- package/dist/prosekit-lit-combo-box-list.js +0 -48
- package/dist/prosekit-lit-combo-box.d.ts +0 -3
- package/dist/prosekit-lit-combo-box.js +0 -110
- package/src/index.ts +0 -1
@@ -1,110 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Popover
|
3
|
-
} from "./chunk-7WLKD2U6.js";
|
4
|
-
import {
|
5
|
-
ListManager
|
6
|
-
} from "./chunk-PCXKL6TA.js";
|
7
|
-
import "./chunk-55G7TJI3.js";
|
8
|
-
import {
|
9
|
-
comboBoxContext
|
10
|
-
} from "./chunk-C4MW43I4.js";
|
11
|
-
import {
|
12
|
-
__decorateClass
|
13
|
-
} from "./chunk-O5JP3B34.js";
|
14
|
-
|
15
|
-
// src/components/combo-box/index.ts
|
16
|
-
import { provide } from "@lit/context";
|
17
|
-
import { customElement, property, state } from "lit/decorators.js";
|
18
|
-
|
19
|
-
// src/components/combo-box-item/helpers.ts
|
20
|
-
function isComboBoxItem(element) {
|
21
|
-
var _a;
|
22
|
-
return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === "prosekit-combo-box-item";
|
23
|
-
}
|
24
|
-
function queryClosestComboBoxItem(element) {
|
25
|
-
if (!element) {
|
26
|
-
return null;
|
27
|
-
}
|
28
|
-
if (isComboBoxItem(element)) {
|
29
|
-
return element;
|
30
|
-
}
|
31
|
-
const item = element.closest("prosekit-combo-box-item");
|
32
|
-
if (isComboBoxItem(item)) {
|
33
|
-
return item;
|
34
|
-
}
|
35
|
-
return null;
|
36
|
-
}
|
37
|
-
|
38
|
-
// src/components/combo-box/index.ts
|
39
|
-
var propNames = ["onDismiss"];
|
40
|
-
var ComboBox = class extends Popover {
|
41
|
-
constructor() {
|
42
|
-
super(...arguments);
|
43
|
-
this.listManager = new ListManager({
|
44
|
-
getItems: () => {
|
45
|
-
return this.items;
|
46
|
-
},
|
47
|
-
getSelectedValue: () => {
|
48
|
-
var _a;
|
49
|
-
return ((_a = this.context.selectedValue) != null ? _a : "").trim();
|
50
|
-
},
|
51
|
-
setSelectedValue: (value) => {
|
52
|
-
return this.context.setSelectedValue(value);
|
53
|
-
},
|
54
|
-
getItemValue: (item) => {
|
55
|
-
var _a;
|
56
|
-
return ((_a = item.textContent) != null ? _a : "").trim();
|
57
|
-
},
|
58
|
-
queryClosestItem: queryClosestComboBoxItem,
|
59
|
-
getActive: () => {
|
60
|
-
return true;
|
61
|
-
},
|
62
|
-
onDismiss: () => {
|
63
|
-
var _a;
|
64
|
-
(_a = this.onDismiss) == null ? void 0 : _a.call(this);
|
65
|
-
},
|
66
|
-
onSelect: (item) => {
|
67
|
-
var _a, _b;
|
68
|
-
this.context.setSelectedValue("");
|
69
|
-
this.context.setInputValue("");
|
70
|
-
(_a = item == null ? void 0 : item.onSelect) == null ? void 0 : _a.call(item);
|
71
|
-
(_b = this.onDismiss) == null ? void 0 : _b.call(this);
|
72
|
-
}
|
73
|
-
});
|
74
|
-
this.context = {
|
75
|
-
inputValue: "",
|
76
|
-
setInputValue: (inputValue) => {
|
77
|
-
if (this.context.inputValue === inputValue) {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
this.context = { ...this.context, inputValue };
|
81
|
-
},
|
82
|
-
selectedValue: "",
|
83
|
-
setSelectedValue: (selectedValue) => {
|
84
|
-
if (this.context.selectedValue === selectedValue) {
|
85
|
-
return;
|
86
|
-
}
|
87
|
-
this.context = { ...this.context, selectedValue };
|
88
|
-
},
|
89
|
-
listManager: this.listManager
|
90
|
-
};
|
91
|
-
}
|
92
|
-
get items() {
|
93
|
-
const items = this.querySelectorAll("\u220Fprosekit-combo-box-item");
|
94
|
-
return Array.from(items).filter(isComboBoxItem);
|
95
|
-
}
|
96
|
-
};
|
97
|
-
__decorateClass([
|
98
|
-
property({ attribute: false })
|
99
|
-
], ComboBox.prototype, "onDismiss", 2);
|
100
|
-
__decorateClass([
|
101
|
-
provide({ context: comboBoxContext }),
|
102
|
-
state()
|
103
|
-
], ComboBox.prototype, "context", 2);
|
104
|
-
ComboBox = __decorateClass([
|
105
|
-
customElement("prosekit-combo-box")
|
106
|
-
], ComboBox);
|
107
|
-
export {
|
108
|
-
ComboBox,
|
109
|
-
propNames
|
110
|
-
};
|
package/src/index.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {}
|