@prosekit/lit 0.1.2 → 0.1.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 +307 -60
- package/dist/{chunk-6P3YKUWI.js → chunk-5CI65R73.js} +2 -2
- package/dist/chunk-L6FOAZFL.js +51 -0
- package/dist/chunk-MLUELLVA.js +60 -0
- package/dist/{chunk-PCXKL6TA.js → chunk-PW3MTUZM.js} +7 -6
- package/dist/chunk-S32IZIQF.js +33 -0
- package/dist/{chunk-XBNMYITV.js → chunk-TGJAVLMZ.js} +48 -41
- package/dist/{chunk-7WLKD2U6.js → chunk-Z3PEQ6MW.js} +81 -41
- package/dist/prosekit-lit-autocomplete-empty.d.ts +0 -45
- package/dist/prosekit-lit-autocomplete-empty.js +14 -14
- package/dist/prosekit-lit-autocomplete-item.d.ts +3 -48
- package/dist/prosekit-lit-autocomplete-item.js +3 -3
- package/dist/prosekit-lit-autocomplete-list.d.ts +3 -48
- package/dist/prosekit-lit-autocomplete-list.js +5 -5
- package/dist/prosekit-lit-autocomplete-popover.d.ts +1 -45
- package/dist/prosekit-lit-autocomplete-popover.js +53 -50
- package/dist/prosekit-lit-combo-box-input.d.ts +1 -46
- package/dist/prosekit-lit-combo-box-input.js +39 -26
- package/dist/prosekit-lit-combo-box-item.d.ts +3 -48
- package/dist/prosekit-lit-combo-box-item.js +2 -2
- package/dist/prosekit-lit-combo-box-list.d.ts +3 -48
- package/dist/prosekit-lit-combo-box-list.js +12 -16
- package/dist/prosekit-lit-combo-box.d.ts +1 -46
- package/dist/prosekit-lit-combo-box.js +60 -44
- package/dist/prosekit-lit-inline-popover.d.ts +2 -46
- package/dist/prosekit-lit-inline-popover.js +23 -18
- package/dist/prosekit-lit-popover.d.ts +2 -45
- package/dist/prosekit-lit-popover.js +2 -2
- package/dist/prosekit-lit.d.ts +1 -48
- package/package.json +6 -6
- package/dist/chunk-55G7TJI3.js +0 -48
- package/dist/chunk-GWGDLLFN.js +0 -61
- package/dist/chunk-O5JP3B34.js +0 -31
@@ -42,16 +42,17 @@ var ListManager = class {
|
|
42
42
|
nextIndex = items.length - 1;
|
43
43
|
}
|
44
44
|
if (selectedIndex !== nextIndex) {
|
45
|
-
this.setSelectedValue(this.getItemValue(items[nextIndex]));
|
45
|
+
this.setSelectedValue(this.getItemValue(items[nextIndex]), "keyboard");
|
46
46
|
}
|
47
47
|
}
|
48
|
-
handleSelect(item) {
|
49
|
-
this.setSelectedValue(this.getItemValue(item));
|
48
|
+
handleSelect(item, reason) {
|
49
|
+
this.setSelectedValue(this.getItemValue(item), reason);
|
50
50
|
}
|
51
51
|
selectFirstItem() {
|
52
52
|
const item = this.firstItem;
|
53
53
|
const value = item ? this.getItemValue(item) : "";
|
54
|
-
this.setSelectedValue(value);
|
54
|
+
this.setSelectedValue(value, "keyboard");
|
55
|
+
item == null ? void 0 : item.scrollIntoView({ block: "nearest" });
|
55
56
|
}
|
56
57
|
handleMouseMove(_event) {
|
57
58
|
this.lastMouseMoveTime = Date.now();
|
@@ -63,7 +64,7 @@ var ListManager = class {
|
|
63
64
|
const target = event.target;
|
64
65
|
const item = target && this.queryClosestItem(target);
|
65
66
|
if (item) {
|
66
|
-
this.setSelectedValue(this.getItemValue(item));
|
67
|
+
this.setSelectedValue(this.getItemValue(item), "mouse");
|
67
68
|
}
|
68
69
|
}
|
69
70
|
handleMouseDown(event) {
|
@@ -74,7 +75,7 @@ var ListManager = class {
|
|
74
75
|
const target = event.target;
|
75
76
|
const item = target && this.queryClosestItem(target);
|
76
77
|
if (item) {
|
77
|
-
this.handleSelect(item);
|
78
|
+
this.handleSelect(item, "mouse");
|
78
79
|
this.onSelect(item);
|
79
80
|
}
|
80
81
|
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// src/utils/define-custom-element.ts
|
2
|
+
function defineCustomElement(name, constructor, options) {
|
3
|
+
if (typeof customElements === "undefined") {
|
4
|
+
return;
|
5
|
+
}
|
6
|
+
customElements.define(name, constructor, options);
|
7
|
+
}
|
8
|
+
|
9
|
+
// src/components/block-element/index.ts
|
10
|
+
import { LitElement } from "lit";
|
11
|
+
var LightElement = class extends LitElement {
|
12
|
+
/**
|
13
|
+
* @hidden
|
14
|
+
*/
|
15
|
+
constructor() {
|
16
|
+
super();
|
17
|
+
}
|
18
|
+
createRenderRoot() {
|
19
|
+
return this;
|
20
|
+
}
|
21
|
+
setHidden(hidden) {
|
22
|
+
if (this.hidden !== hidden) {
|
23
|
+
this.hidden = hidden;
|
24
|
+
const display = this.style.display;
|
25
|
+
this.style.display = hidden ? "none" : display === "none" ? "" : display;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
};
|
29
|
+
|
30
|
+
export {
|
31
|
+
defineCustomElement,
|
32
|
+
LightElement
|
33
|
+
};
|
@@ -1,25 +1,24 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "./chunk-
|
2
|
+
autocompleteListContext
|
3
|
+
} from "./chunk-5CI65R73.js";
|
4
4
|
import {
|
5
5
|
ListManager
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-PW3MTUZM.js";
|
7
7
|
import {
|
8
8
|
LightElement,
|
9
|
-
|
10
|
-
} from "./chunk-
|
9
|
+
defineCustomElement
|
10
|
+
} from "./chunk-S32IZIQF.js";
|
11
11
|
|
12
12
|
// src/components/autocomplete-popover/context.ts
|
13
13
|
import { createContext } from "@lit/context";
|
14
|
-
var
|
14
|
+
var autocompletePopoverContext = createContext(
|
15
15
|
"prosekit-autocomplete-popover-context"
|
16
16
|
);
|
17
17
|
|
18
18
|
// src/components/autocomplete-list/component.ts
|
19
|
-
import {
|
19
|
+
import { ContextConsumer, ContextProvider } from "@lit/context";
|
20
20
|
import "@prosekit/core";
|
21
21
|
import "lit";
|
22
|
-
import { customElement, property, state } from "lit/decorators.js";
|
23
22
|
|
24
23
|
// src/utils/command-score.ts
|
25
24
|
import commandScoreModule from "@superhuman/command-score";
|
@@ -87,40 +86,51 @@ var propNames = ["editor"];
|
|
87
86
|
var AutocompleteList = class extends LightElement {
|
88
87
|
constructor() {
|
89
88
|
super(...arguments);
|
90
|
-
/**
|
89
|
+
/**
|
90
|
+
* @hidden
|
91
|
+
*/
|
91
92
|
this.listManager = new ListManager({
|
92
93
|
getItems: () => this.items,
|
93
|
-
getSelectedValue: () => this.context.selectedValue,
|
94
|
-
setSelectedValue: (value) => this.updateValue(value),
|
94
|
+
getSelectedValue: () => this.context.value.selectedValue,
|
95
|
+
setSelectedValue: (value, reason) => this.updateValue(value, reason),
|
95
96
|
getItemValue: (item) => item.content,
|
96
97
|
queryClosestItem: queryClosestAutocompleteItem,
|
97
98
|
getActive: () => this.active,
|
98
99
|
onDismiss: () => {
|
99
100
|
var _a, _b;
|
100
|
-
return (_b = (_a = this.popoverContext) == null ? void 0 : _a.handleDismiss) == null ? void 0 : _b.call(_a);
|
101
|
+
return (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.handleDismiss) == null ? void 0 : _b.call(_a);
|
101
102
|
},
|
102
103
|
onSelect: (item) => {
|
103
104
|
var _a, _b, _c;
|
104
|
-
(_b = (_a = this.popoverContext) == null ? void 0 : _a.handleSubmit) == null ? void 0 : _b.call(_a);
|
105
|
+
(_b = (_a = this.popoverContext.value) == null ? void 0 : _a.handleSubmit) == null ? void 0 : _b.call(_a);
|
105
106
|
(_c = item == null ? void 0 : item.onSelect) == null ? void 0 : _c.call(item);
|
106
107
|
}
|
107
108
|
});
|
108
|
-
/**
|
109
|
+
/**
|
110
|
+
* @hidden
|
111
|
+
*/
|
109
112
|
this.controller = new AutocompleteListController(this, {
|
110
113
|
ArrowUp: () => this.listManager.handleArrowUp(),
|
111
114
|
ArrowDown: () => this.listManager.handleArrowDown(),
|
112
115
|
Escape: () => this.listManager.handleEscape(),
|
113
116
|
Enter: () => this.listManager.handleEnter()
|
114
117
|
});
|
115
|
-
this.popoverContext =
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
118
|
+
this.popoverContext = new ContextConsumer(this, {
|
119
|
+
context: autocompletePopoverContext,
|
120
|
+
subscribe: true
|
121
|
+
});
|
122
|
+
this.context = new ContextProvider(this, {
|
123
|
+
context: autocompleteListContext,
|
124
|
+
initialValue: {
|
125
|
+
scores: /* @__PURE__ */ new Map(),
|
126
|
+
selectedValue: "",
|
127
|
+
selectedReason: "keyboard"
|
128
|
+
}
|
129
|
+
});
|
120
130
|
}
|
121
131
|
get active() {
|
122
132
|
var _a, _b;
|
123
|
-
return (_b = (_a = this.popoverContext) == null ? void 0 : _a.active) != null ? _b : false;
|
133
|
+
return (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.active) != null ? _b : false;
|
124
134
|
}
|
125
135
|
connectedCallback() {
|
126
136
|
super.connectedCallback();
|
@@ -146,19 +156,22 @@ var AutocompleteList = class extends LightElement {
|
|
146
156
|
selectFirstItem() {
|
147
157
|
this.listManager.selectFirstItem();
|
148
158
|
}
|
149
|
-
updateValue(selectedValue) {
|
150
|
-
|
159
|
+
updateValue(selectedValue, selectedReason) {
|
160
|
+
const context = this.context.value;
|
161
|
+
if (context.selectedValue === selectedValue) {
|
151
162
|
return;
|
152
163
|
}
|
153
|
-
this.context
|
164
|
+
this.context.setValue({ ...context, selectedValue, selectedReason });
|
154
165
|
}
|
155
|
-
/**
|
166
|
+
/**
|
167
|
+
* @hidden
|
168
|
+
*/
|
156
169
|
willUpdate(changedProperties) {
|
157
170
|
var _a, _b;
|
158
171
|
if (changedProperties.has("editor") && this.editor) {
|
159
172
|
this.controller.setEditor(this.editor);
|
160
173
|
}
|
161
|
-
const query = (_b = (_a = this.popoverContext) == null ? void 0 : _a.query) != null ? _b : "";
|
174
|
+
const query = (_b = (_a = this.popoverContext.value) == null ? void 0 : _a.query) != null ? _b : "";
|
162
175
|
const scores = new Map(
|
163
176
|
this.items.map((item) => {
|
164
177
|
const content = item.content;
|
@@ -166,26 +179,20 @@ var AutocompleteList = class extends LightElement {
|
|
166
179
|
return [content, score];
|
167
180
|
})
|
168
181
|
);
|
169
|
-
|
182
|
+
const context = this.context.value;
|
183
|
+
this.context.setValue({ ...context, scores });
|
170
184
|
}
|
171
185
|
};
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
__decorateClass([
|
180
|
-
provide({ context: commandListContext }),
|
181
|
-
state()
|
182
|
-
], AutocompleteList.prototype, "context", 2);
|
183
|
-
AutocompleteList = __decorateClass([
|
184
|
-
customElement("prosekit-autocomplete-list")
|
185
|
-
], AutocompleteList);
|
186
|
+
/**
|
187
|
+
* @hidden
|
188
|
+
*/
|
189
|
+
AutocompleteList.properties = {
|
190
|
+
editor: { attribute: false }
|
191
|
+
};
|
192
|
+
defineCustomElement("prosekit-autocomplete-list", AutocompleteList);
|
186
193
|
|
187
194
|
export {
|
188
|
-
|
195
|
+
autocompletePopoverContext,
|
189
196
|
propNames,
|
190
197
|
AutocompleteList
|
191
198
|
};
|
@@ -1,14 +1,17 @@
|
|
1
1
|
import {
|
2
2
|
LightElement,
|
3
|
-
|
4
|
-
} from "./chunk-
|
3
|
+
defineCustomElement
|
4
|
+
} from "./chunk-S32IZIQF.js";
|
5
5
|
|
6
6
|
// src/components/popover/index.ts
|
7
7
|
import {
|
8
8
|
autoUpdate,
|
9
9
|
computePosition
|
10
10
|
} from "@floating-ui/dom";
|
11
|
-
|
11
|
+
|
12
|
+
// src/utils/popover-api.ts
|
13
|
+
var popoverAvailable = typeof HTMLElement !== "undefined" && HTMLElement.prototype.hasOwnProperty("popover");
|
14
|
+
var boundary = popoverAvailable && typeof document !== "undefined" && document.body || void 0;
|
12
15
|
|
13
16
|
// src/utils/round-by-dpr.ts
|
14
17
|
function roundByDPR(value) {
|
@@ -17,17 +20,25 @@ function roundByDPR(value) {
|
|
17
20
|
}
|
18
21
|
|
19
22
|
// src/components/popover/default-popover-options.ts
|
20
|
-
import {
|
23
|
+
import {
|
24
|
+
offset,
|
25
|
+
shift,
|
26
|
+
size
|
27
|
+
} from "@floating-ui/dom";
|
21
28
|
|
22
29
|
// src/components/popover/options.ts
|
23
30
|
import "@floating-ui/dom";
|
24
31
|
|
25
32
|
// src/components/popover/default-popover-options.ts
|
33
|
+
var defaultDetectOverflowOptions = {
|
34
|
+
padding: 8,
|
35
|
+
boundary
|
36
|
+
};
|
26
37
|
var defaultPopoverOptions = {
|
27
38
|
placement: "bottom",
|
28
39
|
middleware: [
|
29
40
|
offset({ mainAxis: 8, crossAxis: 8 }),
|
30
|
-
shift({
|
41
|
+
shift({ ...defaultDetectOverflowOptions }),
|
31
42
|
size({
|
32
43
|
apply: ({ availableWidth, availableHeight, elements }) => {
|
33
44
|
elements.floating.style.setProperty(
|
@@ -39,7 +50,7 @@ var defaultPopoverOptions = {
|
|
39
50
|
`${Math.floor(availableHeight)}px`
|
40
51
|
);
|
41
52
|
},
|
42
|
-
|
53
|
+
...defaultDetectOverflowOptions
|
43
54
|
})
|
44
55
|
]
|
45
56
|
};
|
@@ -53,11 +64,36 @@ var propNames = [
|
|
53
64
|
"autoUpdateOptions"
|
54
65
|
];
|
55
66
|
var Popover = class extends LightElement {
|
56
|
-
/** @hidden */
|
57
67
|
constructor() {
|
58
|
-
super();
|
68
|
+
super(...arguments);
|
69
|
+
/**
|
70
|
+
* Controls the visibility of the popover element. When set to `true`, the
|
71
|
+
* popover is displayed and positioned relative to its reference element. When
|
72
|
+
* set to `false`, the popover is hidden and its positioning logic is
|
73
|
+
* deactivated.
|
74
|
+
*/
|
59
75
|
this.active = false;
|
76
|
+
/**
|
77
|
+
* Controls whether the popover position is automatically updated when the
|
78
|
+
* reference element changes position. When set to `true`, the popover
|
79
|
+
* position is updated automatically. When set to `false`, the popover
|
80
|
+
* position is only updated when the given properties are changed.
|
81
|
+
*
|
82
|
+
* @default false
|
83
|
+
*/
|
60
84
|
this.autoUpdate = false;
|
85
|
+
/**
|
86
|
+
* Controls whether the popover should be dismissed based on user interaction.
|
87
|
+
*
|
88
|
+
* Available options:
|
89
|
+
*
|
90
|
+
* - "off": The popover is not dismissed.
|
91
|
+
* - "on": The popover is dismissed when the user clicks outside of the popover or presses the escape key.
|
92
|
+
* - "click": The popover is dismissed when the user clicks outside of the popover.
|
93
|
+
* - "escape": The popover is dismissed when the user presses the escape key.
|
94
|
+
*
|
95
|
+
* @default "on"
|
96
|
+
*/
|
61
97
|
this.dismiss = "on";
|
62
98
|
this.handleDocumentMouseDown = (event) => {
|
63
99
|
const path = event.composedPath();
|
@@ -73,7 +109,9 @@ var Popover = class extends LightElement {
|
|
73
109
|
}
|
74
110
|
};
|
75
111
|
}
|
76
|
-
/**
|
112
|
+
/**
|
113
|
+
* @hidden
|
114
|
+
*/
|
77
115
|
connectedCallback() {
|
78
116
|
super.connectedCallback();
|
79
117
|
const clickEnabled = this.dismiss === "on" || this.dismiss === "click";
|
@@ -87,7 +125,9 @@ var Popover = class extends LightElement {
|
|
87
125
|
handleKeyDown && document.removeEventListener("keydown", handleKeyDown);
|
88
126
|
};
|
89
127
|
}
|
90
|
-
/**
|
128
|
+
/**
|
129
|
+
* @hidden
|
130
|
+
*/
|
91
131
|
disconnectedCallback() {
|
92
132
|
var _a, _b;
|
93
133
|
super.disconnectedCallback();
|
@@ -96,13 +136,22 @@ var Popover = class extends LightElement {
|
|
96
136
|
(_b = this.disposeEventListeners) == null ? void 0 : _b.call(this);
|
97
137
|
this.disposeEventListeners = void 0;
|
98
138
|
}
|
99
|
-
/**
|
139
|
+
/**
|
140
|
+
* @hidden
|
141
|
+
*/
|
100
142
|
updated(changedProperties) {
|
143
|
+
var _a;
|
101
144
|
super.updated(changedProperties);
|
145
|
+
if (popoverAvailable) {
|
146
|
+
this.popover = "manual";
|
147
|
+
(_a = this.togglePopover) == null ? void 0 : _a.call(this, this.active);
|
148
|
+
}
|
102
149
|
this.start();
|
103
150
|
this.setHidden(!this.active);
|
104
151
|
}
|
105
|
-
/**
|
152
|
+
/**
|
153
|
+
* @hidden
|
154
|
+
*/
|
106
155
|
start() {
|
107
156
|
var _a;
|
108
157
|
(_a = this.disposeAutoUpdate) == null ? void 0 : _a.call(this);
|
@@ -123,7 +172,9 @@ var Popover = class extends LightElement {
|
|
123
172
|
void this.compute();
|
124
173
|
}
|
125
174
|
}
|
126
|
-
/**
|
175
|
+
/**
|
176
|
+
* @hidden
|
177
|
+
*/
|
127
178
|
async compute() {
|
128
179
|
var _a, _b, _c;
|
129
180
|
const reference = this.reference;
|
@@ -132,6 +183,7 @@ var Popover = class extends LightElement {
|
|
132
183
|
if (!this.active)
|
133
184
|
return;
|
134
185
|
this.setHidden(false);
|
186
|
+
this.style.setProperty("margin", "0");
|
135
187
|
this.style.setProperty("top", "0");
|
136
188
|
this.style.setProperty("left", "0");
|
137
189
|
this.style.setProperty("position", (_b = (_a = this.options) == null ? void 0 : _a.strategy) != null ? _b : "absolute");
|
@@ -145,40 +197,28 @@ var Popover = class extends LightElement {
|
|
145
197
|
`translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`
|
146
198
|
);
|
147
199
|
}
|
148
|
-
/**
|
200
|
+
/**
|
201
|
+
* @hidden
|
202
|
+
*/
|
149
203
|
hide() {
|
150
204
|
this.active = false;
|
151
205
|
}
|
152
206
|
};
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
reflect: true
|
166
|
-
})
|
167
|
-
], Popover.prototype, "autoUpdate", 2);
|
168
|
-
__decorateClass([
|
169
|
-
property({ type: Object })
|
170
|
-
], Popover.prototype, "autoUpdateOptions", 2);
|
171
|
-
__decorateClass([
|
172
|
-
property({
|
173
|
-
type: String,
|
174
|
-
reflect: true
|
175
|
-
})
|
176
|
-
], Popover.prototype, "dismiss", 2);
|
177
|
-
Popover = __decorateClass([
|
178
|
-
customElement("prosekit-popover")
|
179
|
-
], Popover);
|
207
|
+
/**
|
208
|
+
* @hidden
|
209
|
+
*/
|
210
|
+
Popover.properties = {
|
211
|
+
active: { type: Boolean, reflect: true },
|
212
|
+
reference: { attribute: false },
|
213
|
+
options: { attribute: false },
|
214
|
+
autoUpdate: { type: Boolean, reflect: true },
|
215
|
+
autoUpdateOptions: { type: Object },
|
216
|
+
dismiss: { type: String, reflect: true }
|
217
|
+
};
|
218
|
+
defineCustomElement("prosekit-popover", Popover);
|
180
219
|
|
181
220
|
export {
|
221
|
+
boundary,
|
182
222
|
propNames,
|
183
223
|
Popover
|
184
224
|
};
|
@@ -1,48 +1,3 @@
|
|
1
1
|
export { propNames } from './_tsup-dts-rollup';
|
2
2
|
export { AutocompleteEmptyProps } from './_tsup-dts-rollup';
|
3
3
|
export { AutocompleteEmpty } from './_tsup-dts-rollup';
|
4
|
-
export { AutocompleteItemProps } from './_tsup-dts-rollup';
|
5
|
-
export { AutocompleteItem } from './_tsup-dts-rollup';
|
6
|
-
export { isAutocompleteItem } from './_tsup-dts-rollup';
|
7
|
-
export { queryClosestAutocompleteItem } from './_tsup-dts-rollup';
|
8
|
-
export { AutocompleteListProps } from './_tsup-dts-rollup';
|
9
|
-
export { AutocompleteList } from './_tsup-dts-rollup';
|
10
|
-
export { AutocompleteListContext } from './_tsup-dts-rollup';
|
11
|
-
export { commandListContext } from './_tsup-dts-rollup';
|
12
|
-
export { AutocompleteListController } from './_tsup-dts-rollup';
|
13
|
-
export { isAutocompleteList } from './_tsup-dts-rollup';
|
14
|
-
export { AutocompletePopoverContext } from './_tsup-dts-rollup';
|
15
|
-
export { commandPopoverContext } from './_tsup-dts-rollup';
|
16
|
-
export { AutocompletePopoverController } from './_tsup-dts-rollup';
|
17
|
-
export { defaultPopoverOptions } from './_tsup-dts-rollup';
|
18
|
-
export { defaultQueryBuilder } from './_tsup-dts-rollup';
|
19
|
-
export { PopoverOptions } from './_tsup-dts-rollup';
|
20
|
-
export { AutocompletePopoverProps } from './_tsup-dts-rollup';
|
21
|
-
export { AutocompletePopover } from './_tsup-dts-rollup';
|
22
|
-
export { LightElement } from './_tsup-dts-rollup';
|
23
|
-
export { ComboBoxContext } from './_tsup-dts-rollup';
|
24
|
-
export { comboBoxContext } from './_tsup-dts-rollup';
|
25
|
-
export { ComboBoxProps } from './_tsup-dts-rollup';
|
26
|
-
export { ComboBox } from './_tsup-dts-rollup';
|
27
|
-
export { ComboBoxInputProps } from './_tsup-dts-rollup';
|
28
|
-
export { ComboBoxInput } from './_tsup-dts-rollup';
|
29
|
-
export { ComboBoxItemProps } from './_tsup-dts-rollup';
|
30
|
-
export { ComboBoxItem } from './_tsup-dts-rollup';
|
31
|
-
export { isComboBoxItem } from './_tsup-dts-rollup';
|
32
|
-
export { queryClosestComboBoxItem } from './_tsup-dts-rollup';
|
33
|
-
export { ComboBoxListProps } from './_tsup-dts-rollup';
|
34
|
-
export { ComboBoxList } from './_tsup-dts-rollup';
|
35
|
-
export { isComboBoxList } from './_tsup-dts-rollup';
|
36
|
-
export { InlinePopoverController } from './_tsup-dts-rollup';
|
37
|
-
export { getVirtualSelectionElement } from './_tsup-dts-rollup';
|
38
|
-
export { InlinePopoverProps } from './_tsup-dts-rollup';
|
39
|
-
export { InlinePopover } from './_tsup-dts-rollup';
|
40
|
-
export { AutoUpdateOptions } from './_tsup-dts-rollup';
|
41
|
-
export { PopoverProps } from './_tsup-dts-rollup';
|
42
|
-
export { Popover } from './_tsup-dts-rollup';
|
43
|
-
export { ListManager } from './_tsup-dts-rollup';
|
44
|
-
export { blockComponentStyles } from './_tsup-dts-rollup';
|
45
|
-
export { componentStyles } from './_tsup-dts-rollup';
|
46
|
-
export { commandScore } from './_tsup-dts-rollup';
|
47
|
-
export { roundByDPR } from './_tsup-dts-rollup';
|
48
|
-
export { default_alias as default } from './_tsup-dts-rollup';
|
@@ -1,24 +1,30 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "./chunk-
|
2
|
+
autocompleteListContext
|
3
|
+
} from "./chunk-5CI65R73.js";
|
4
4
|
import {
|
5
5
|
LightElement,
|
6
|
-
|
7
|
-
} from "./chunk-
|
6
|
+
defineCustomElement
|
7
|
+
} from "./chunk-S32IZIQF.js";
|
8
8
|
|
9
9
|
// src/components/autocomplete-empty/index.ts
|
10
|
-
import {
|
10
|
+
import { ContextConsumer } from "@lit/context";
|
11
11
|
import "lit";
|
12
|
-
import { customElement, state } from "lit/decorators.js";
|
13
12
|
var propNames = [];
|
14
13
|
var AutocompleteEmpty = class extends LightElement {
|
14
|
+
constructor() {
|
15
|
+
super(...arguments);
|
16
|
+
this.listContext = new ContextConsumer(this, {
|
17
|
+
context: autocompleteListContext,
|
18
|
+
subscribe: true
|
19
|
+
});
|
20
|
+
}
|
15
21
|
connectedCallback() {
|
16
22
|
super.connectedCallback();
|
17
23
|
this.role = "option";
|
18
24
|
}
|
19
25
|
willUpdate(_changedProperties) {
|
20
26
|
var _a;
|
21
|
-
const scores = (_a = this.listContext) == null ? void 0 : _a.scores;
|
27
|
+
const scores = (_a = this.listContext.value) == null ? void 0 : _a.scores;
|
22
28
|
let hasMatch = false;
|
23
29
|
if (scores) {
|
24
30
|
for (const score of scores.values()) {
|
@@ -31,13 +37,7 @@ var AutocompleteEmpty = class extends LightElement {
|
|
31
37
|
this.setHidden(hasMatch);
|
32
38
|
}
|
33
39
|
};
|
34
|
-
|
35
|
-
consume({ context: commandListContext, subscribe: true }),
|
36
|
-
state()
|
37
|
-
], AutocompleteEmpty.prototype, "listContext", 2);
|
38
|
-
AutocompleteEmpty = __decorateClass([
|
39
|
-
customElement("prosekit-autocomplete-empty")
|
40
|
-
], AutocompleteEmpty);
|
40
|
+
defineCustomElement("prosekit-autocomplete-empty", AutocompleteEmpty);
|
41
41
|
export {
|
42
42
|
AutocompleteEmpty,
|
43
43
|
propNames
|
@@ -1,48 +1,3 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export { AutocompleteItemProps } from './_tsup-dts-rollup';
|
5
|
-
export { AutocompleteItem } from './_tsup-dts-rollup';
|
6
|
-
export { isAutocompleteItem } from './_tsup-dts-rollup';
|
7
|
-
export { queryClosestAutocompleteItem } from './_tsup-dts-rollup';
|
8
|
-
export { AutocompleteListProps } from './_tsup-dts-rollup';
|
9
|
-
export { AutocompleteList } from './_tsup-dts-rollup';
|
10
|
-
export { AutocompleteListContext } from './_tsup-dts-rollup';
|
11
|
-
export { commandListContext } from './_tsup-dts-rollup';
|
12
|
-
export { AutocompleteListController } from './_tsup-dts-rollup';
|
13
|
-
export { isAutocompleteList } from './_tsup-dts-rollup';
|
14
|
-
export { AutocompletePopoverContext } from './_tsup-dts-rollup';
|
15
|
-
export { commandPopoverContext } from './_tsup-dts-rollup';
|
16
|
-
export { AutocompletePopoverController } from './_tsup-dts-rollup';
|
17
|
-
export { defaultPopoverOptions } from './_tsup-dts-rollup';
|
18
|
-
export { defaultQueryBuilder } from './_tsup-dts-rollup';
|
19
|
-
export { PopoverOptions } from './_tsup-dts-rollup';
|
20
|
-
export { AutocompletePopoverProps } from './_tsup-dts-rollup';
|
21
|
-
export { AutocompletePopover } from './_tsup-dts-rollup';
|
22
|
-
export { LightElement } from './_tsup-dts-rollup';
|
23
|
-
export { ComboBoxContext } from './_tsup-dts-rollup';
|
24
|
-
export { comboBoxContext } from './_tsup-dts-rollup';
|
25
|
-
export { ComboBoxProps } from './_tsup-dts-rollup';
|
26
|
-
export { ComboBox } from './_tsup-dts-rollup';
|
27
|
-
export { ComboBoxInputProps } from './_tsup-dts-rollup';
|
28
|
-
export { ComboBoxInput } from './_tsup-dts-rollup';
|
29
|
-
export { ComboBoxItemProps } from './_tsup-dts-rollup';
|
30
|
-
export { ComboBoxItem } from './_tsup-dts-rollup';
|
31
|
-
export { isComboBoxItem } from './_tsup-dts-rollup';
|
32
|
-
export { queryClosestComboBoxItem } from './_tsup-dts-rollup';
|
33
|
-
export { ComboBoxListProps } from './_tsup-dts-rollup';
|
34
|
-
export { ComboBoxList } from './_tsup-dts-rollup';
|
35
|
-
export { isComboBoxList } from './_tsup-dts-rollup';
|
36
|
-
export { InlinePopoverController } from './_tsup-dts-rollup';
|
37
|
-
export { getVirtualSelectionElement } from './_tsup-dts-rollup';
|
38
|
-
export { InlinePopoverProps } from './_tsup-dts-rollup';
|
39
|
-
export { InlinePopover } from './_tsup-dts-rollup';
|
40
|
-
export { AutoUpdateOptions } from './_tsup-dts-rollup';
|
41
|
-
export { PopoverProps } from './_tsup-dts-rollup';
|
42
|
-
export { Popover } from './_tsup-dts-rollup';
|
43
|
-
export { ListManager } from './_tsup-dts-rollup';
|
44
|
-
export { blockComponentStyles } from './_tsup-dts-rollup';
|
45
|
-
export { componentStyles } from './_tsup-dts-rollup';
|
46
|
-
export { commandScore } from './_tsup-dts-rollup';
|
47
|
-
export { roundByDPR } from './_tsup-dts-rollup';
|
48
|
-
export { default_alias as default } from './_tsup-dts-rollup';
|
1
|
+
export { AutocompleteItemProps_alias_1 as AutocompleteItemProps } from './_tsup-dts-rollup';
|
2
|
+
export { AutocompleteItem_alias_1 as AutocompleteItem } from './_tsup-dts-rollup';
|
3
|
+
export { propNames_alias_2 as propNames } from './_tsup-dts-rollup';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
2
|
AutocompleteItem,
|
3
3
|
propNames
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-MLUELLVA.js";
|
5
|
+
import "./chunk-5CI65R73.js";
|
6
|
+
import "./chunk-S32IZIQF.js";
|
7
7
|
export {
|
8
8
|
AutocompleteItem,
|
9
9
|
propNames
|
@@ -1,48 +1,3 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export { AutocompleteItemProps } from './_tsup-dts-rollup';
|
5
|
-
export { AutocompleteItem } from './_tsup-dts-rollup';
|
6
|
-
export { isAutocompleteItem } from './_tsup-dts-rollup';
|
7
|
-
export { queryClosestAutocompleteItem } from './_tsup-dts-rollup';
|
8
|
-
export { AutocompleteListProps } from './_tsup-dts-rollup';
|
9
|
-
export { AutocompleteList } from './_tsup-dts-rollup';
|
10
|
-
export { AutocompleteListContext } from './_tsup-dts-rollup';
|
11
|
-
export { commandListContext } from './_tsup-dts-rollup';
|
12
|
-
export { AutocompleteListController } from './_tsup-dts-rollup';
|
13
|
-
export { isAutocompleteList } from './_tsup-dts-rollup';
|
14
|
-
export { AutocompletePopoverContext } from './_tsup-dts-rollup';
|
15
|
-
export { commandPopoverContext } from './_tsup-dts-rollup';
|
16
|
-
export { AutocompletePopoverController } from './_tsup-dts-rollup';
|
17
|
-
export { defaultPopoverOptions } from './_tsup-dts-rollup';
|
18
|
-
export { defaultQueryBuilder } from './_tsup-dts-rollup';
|
19
|
-
export { PopoverOptions } from './_tsup-dts-rollup';
|
20
|
-
export { AutocompletePopoverProps } from './_tsup-dts-rollup';
|
21
|
-
export { AutocompletePopover } from './_tsup-dts-rollup';
|
22
|
-
export { LightElement } from './_tsup-dts-rollup';
|
23
|
-
export { ComboBoxContext } from './_tsup-dts-rollup';
|
24
|
-
export { comboBoxContext } from './_tsup-dts-rollup';
|
25
|
-
export { ComboBoxProps } from './_tsup-dts-rollup';
|
26
|
-
export { ComboBox } from './_tsup-dts-rollup';
|
27
|
-
export { ComboBoxInputProps } from './_tsup-dts-rollup';
|
28
|
-
export { ComboBoxInput } from './_tsup-dts-rollup';
|
29
|
-
export { ComboBoxItemProps } from './_tsup-dts-rollup';
|
30
|
-
export { ComboBoxItem } from './_tsup-dts-rollup';
|
31
|
-
export { isComboBoxItem } from './_tsup-dts-rollup';
|
32
|
-
export { queryClosestComboBoxItem } from './_tsup-dts-rollup';
|
33
|
-
export { ComboBoxListProps } from './_tsup-dts-rollup';
|
34
|
-
export { ComboBoxList } from './_tsup-dts-rollup';
|
35
|
-
export { isComboBoxList } from './_tsup-dts-rollup';
|
36
|
-
export { InlinePopoverController } from './_tsup-dts-rollup';
|
37
|
-
export { getVirtualSelectionElement } from './_tsup-dts-rollup';
|
38
|
-
export { InlinePopoverProps } from './_tsup-dts-rollup';
|
39
|
-
export { InlinePopover } from './_tsup-dts-rollup';
|
40
|
-
export { AutoUpdateOptions } from './_tsup-dts-rollup';
|
41
|
-
export { PopoverProps } from './_tsup-dts-rollup';
|
42
|
-
export { Popover } from './_tsup-dts-rollup';
|
43
|
-
export { ListManager } from './_tsup-dts-rollup';
|
44
|
-
export { blockComponentStyles } from './_tsup-dts-rollup';
|
45
|
-
export { componentStyles } from './_tsup-dts-rollup';
|
46
|
-
export { commandScore } from './_tsup-dts-rollup';
|
47
|
-
export { roundByDPR } from './_tsup-dts-rollup';
|
48
|
-
export { default_alias as default } from './_tsup-dts-rollup';
|
1
|
+
export { AutocompleteList_alias_1 as AutocompleteList } from './_tsup-dts-rollup';
|
2
|
+
export { AutocompleteListProps_alias_1 as AutocompleteListProps } from './_tsup-dts-rollup';
|
3
|
+
export { propNames_alias_4 as propNames } from './_tsup-dts-rollup';
|