@prosekit/lit 0.0.10 → 0.0.11

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.
@@ -0,0 +1,469 @@
1
+ import { AutoUpdateOptions } from '@floating-ui/dom';
2
+ import { CommandArgs } from '@prosekit/core';
3
+ import { ComputePositionConfig } from '@floating-ui/dom';
4
+ import { CSSResult } from 'lit';
5
+ import { CSSResultGroup } from 'lit';
6
+ import { Editor } from '@prosekit/core';
7
+ import { Extension } from '@prosekit/core';
8
+ import { ExtensionTyping } from '@prosekit/core';
9
+ import { Keymap } from '@prosekit/core';
10
+ import { LitElement } from 'lit';
11
+ import { Options } from 'tsup';
12
+ import { PropertyValues } from 'lit';
13
+ import type { ProseMirrorNode } from '@prosekit/pm/model';
14
+ import { ReactiveController } from 'lit';
15
+ import { ReactiveControllerHost } from 'lit';
16
+ import { TemplateResult } from 'lit-html';
17
+ import { UserProjectConfigExport } from 'vitest/dist/config.js';
18
+ import { VirtualElement } from '@floating-ui/dom';
19
+
20
+ /**
21
+ * Returns a ProseKit extension that call `onSelect` when the text selection is
22
+ * insert into a code block, and `onDismiss` when it is not.
23
+ */
24
+ export declare function addCodeBlockSelect(options: {
25
+ onSelect: (info: {
26
+ pos: number;
27
+ node: ProseMirrorNode;
28
+ dom: HTMLElement;
29
+ }) => void;
30
+ onDismiss: () => void;
31
+ }): Extension<ExtensionTyping<string, string, CommandArgs>>;
32
+
33
+ export declare class AutocompleteEmpty extends LitElement implements AutocompleteEmptyProps {
34
+ /** @hidden */
35
+ static styles: CSSResultGroup;
36
+ listContext?: AutocompleteListContext;
37
+ protected willUpdate(_changedProperties: PropertyValues<this>): void;
38
+ /** @hidden */
39
+ render(): TemplateResult<1> | null;
40
+ }
41
+
42
+ export declare interface AutocompleteEmptyProps {
43
+ }
44
+
45
+ /**
46
+ * Command menu item. Becomes active on pointer enter or through keyboard
47
+ * navigation. Preferably pass a `value`, otherwise the value will be inferred
48
+ * from the rendered item's `textContent`.
49
+ */
50
+ declare class AutocompleteItem extends LitElement implements Partial<AutocompleteItemProps> {
51
+ /** @hidden */
52
+ static styles: CSSResultGroup;
53
+ value: string;
54
+ selected: boolean;
55
+ /** @hidden */
56
+ onSelect?: VoidFunction;
57
+ /** @hidden */
58
+ defaultSlot?: HTMLSlotElement;
59
+ listContext?: AutocompleteListContext;
60
+ get content(): string;
61
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
62
+ protected updated(changedProperties: PropertyValues<this>): void;
63
+ /** @hidden */
64
+ render(): TemplateResult<1> | null;
65
+ }
66
+ export { AutocompleteItem }
67
+ export { AutocompleteItem as AutocompleteItem_alias_1 }
68
+
69
+ declare interface AutocompleteItemProps {
70
+ value?: string;
71
+ onSelect: VoidFunction;
72
+ }
73
+ export { AutocompleteItemProps }
74
+ export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
75
+
76
+ declare class AutocompleteList extends LitElement implements Partial<AutocompleteListProps> {
77
+ /** @hidden */
78
+ static styles: CSSResultGroup;
79
+ /** @hidden */
80
+ private listManager;
81
+ /** @hidden */
82
+ private controller;
83
+ private get active();
84
+ editor?: Editor;
85
+ popoverContext: AutocompletePopoverContext | null;
86
+ context: AutocompleteListContext;
87
+ protected firstUpdated(): void;
88
+ private get items();
89
+ selectFirstItem(): void;
90
+ private updateValue;
91
+ private registerValue;
92
+ /** @hidden */
93
+ defaultSlot?: HTMLSlotElement;
94
+ /** @hidden */
95
+ willUpdate(changedProperties: PropertyValues<this>): void;
96
+ /** @hidden */
97
+ render(): TemplateResult<1>;
98
+ }
99
+ export { AutocompleteList }
100
+ export { AutocompleteList as AutocompleteList_alias_1 }
101
+
102
+ export declare type AutocompleteListContext = {
103
+ scores: Map<string, number>;
104
+ selectedValue: string;
105
+ registerValue: (value: string) => VoidFunction;
106
+ };
107
+
108
+ export declare class AutocompleteListController implements ReactiveController {
109
+ private host;
110
+ private keymap;
111
+ private editor;
112
+ private cleanup;
113
+ constructor(host: ReactiveControllerHost, keymap: Keymap);
114
+ setEditor(editor: Editor): void;
115
+ hostDisconnected(): void;
116
+ private addExtension;
117
+ }
118
+
119
+ declare interface AutocompleteListProps {
120
+ editor: Editor;
121
+ }
122
+ export { AutocompleteListProps }
123
+ export { AutocompleteListProps as AutocompleteListProps_alias_1 }
124
+
125
+ export declare class AutocompletePopover extends LitElement implements Partial<AutocompletePopoverProps> {
126
+ /** @hidden */
127
+ static styles: CSSResultGroup;
128
+ /** @hidden */
129
+ private controller;
130
+ editor?: Editor;
131
+ regex?: RegExp;
132
+ popoverOptions: PopoverOptions;
133
+ context: AutocompletePopoverContext;
134
+ /** @hidden */
135
+ onSelect?: VoidFunction;
136
+ private get list();
137
+ private updateContext;
138
+ /** @hidden */
139
+ defaultSlot?: HTMLSlotElement;
140
+ /** @hidden */
141
+ protected get active(): boolean;
142
+ /** @hidden */
143
+ willUpdate(): void;
144
+ /** @hidden */
145
+ render(): TemplateResult<1>;
146
+ }
147
+
148
+ export declare type AutocompletePopoverContext = {
149
+ active: boolean;
150
+ query: string;
151
+ handleDismiss: VoidFunction;
152
+ handleSubmit: VoidFunction;
153
+ };
154
+
155
+ export declare class AutocompletePopoverController implements ReactiveController {
156
+ private host;
157
+ private onChange;
158
+ reference: Element | null;
159
+ private editor;
160
+ private regex;
161
+ private cleanup;
162
+ handleDismiss: VoidFunction | null;
163
+ handleSubmit: VoidFunction | null;
164
+ constructor(host: ReactiveControllerHost, onChange: (query: string, active: boolean) => void);
165
+ setEditor(editor: Editor): void;
166
+ setRegex(regex: RegExp): void;
167
+ private addExtension;
168
+ hostDisconnected(): void;
169
+ }
170
+
171
+ export declare interface AutocompletePopoverProps {
172
+ editor: Editor;
173
+ regex: RegExp;
174
+ popoverOptions?: PopoverOptions;
175
+ }
176
+
177
+ export { AutoUpdateOptions }
178
+
179
+ export declare const blockComponentStyles: CSSResult;
180
+
181
+ declare class BlockElement extends LitElement {
182
+ setHidden(hidden: boolean): void;
183
+ }
184
+
185
+ export declare class CodeBlockPopover extends Popover implements Partial<CodeBlockPopoverProps> {
186
+ editor?: Editor;
187
+ /** @hidden */
188
+ private controller;
189
+ protected updated(): void;
190
+ }
191
+
192
+ export declare class CodeBlockPopoverController implements ReactiveController {
193
+ private host;
194
+ reference: Element | null;
195
+ private editor;
196
+ private cleanup;
197
+ constructor(host: ReactiveControllerHost);
198
+ setEditor(editor: Editor): void;
199
+ private addExtension;
200
+ hostDisconnected(): void;
201
+ }
202
+
203
+ export declare interface CodeBlockPopoverProps {
204
+ editor: Editor;
205
+ }
206
+
207
+ export declare class ComboBox extends Popover {
208
+ onDismiss?: VoidFunction;
209
+ private listManager;
210
+ context: ComboBoxContext;
211
+ get items(): ComboBoxItem[];
212
+ }
213
+
214
+ export declare type ComboBoxContext = {
215
+ inputValue: string;
216
+ setInputValue: (val: string) => void;
217
+ selectedValue: string;
218
+ setSelectedValue: (val: string) => void;
219
+ listManager: ListManager<ComboBoxItem>;
220
+ };
221
+
222
+ export declare const comboBoxContext: {
223
+ __context__: ComboBoxContext;
224
+ };
225
+
226
+ export declare class ComboBoxInput extends LightBlockElement {
227
+ placeholder: string;
228
+ comboBoxContext: ComboBoxContext | null;
229
+ private visible;
230
+ private handleKeydown;
231
+ private handleInput;
232
+ protected firstUpdated(): void;
233
+ /** @hidden */
234
+ render(): TemplateResult<1>;
235
+ }
236
+
237
+ export declare type ComboBoxInputProps = {
238
+ placeholder?: string;
239
+ };
240
+
241
+ declare class ComboBoxItem extends LightBlockElement {
242
+ /** @hidden */
243
+ static styles: CSSResultGroup;
244
+ editor?: Editor;
245
+ /** @hidden */
246
+ defaultSlot?: HTMLSlotElement;
247
+ selected: boolean;
248
+ comboBoxContext?: ComboBoxContext;
249
+ /** @hidden */
250
+ onSelect?: VoidFunction;
251
+ protected updated(): void;
252
+ }
253
+ export { ComboBoxItem }
254
+ export { ComboBoxItem as ComboBoxItem_alias_1 }
255
+
256
+ declare type ComboBoxItemProps = Record<string, never>;
257
+ export { ComboBoxItemProps }
258
+ export { ComboBoxItemProps as ComboBoxItemProps_alias_1 }
259
+
260
+ declare class ComboBoxList extends LightBlockElement {
261
+ comboBoxContext: ComboBoxContext | null;
262
+ connectedCallback(): void;
263
+ }
264
+ export { ComboBoxList }
265
+ export { ComboBoxList as ComboBoxList_alias_1 }
266
+
267
+ declare type ComboBoxListProps = Record<string, never>;
268
+ export { ComboBoxListProps }
269
+ export { ComboBoxListProps as ComboBoxListProps_alias_1 }
270
+
271
+ export declare type ComboBoxProps = {
272
+ onDismiss?: VoidFunction;
273
+ };
274
+
275
+ export declare const commandListContext: {
276
+ __context__: AutocompleteListContext;
277
+ };
278
+
279
+ export declare const commandPopoverContext: {
280
+ __context__: AutocompletePopoverContext;
281
+ };
282
+
283
+ declare type CommandScore = (item: string, query: string) => number;
284
+
285
+ export declare const commandScore: CommandScore;
286
+
287
+ export declare const componentStyles: CSSResult;
288
+
289
+ export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
290
+
291
+ export declare const default_alias_1: UserProjectConfigExport;
292
+
293
+ /**
294
+ * Default popover options.
295
+ */
296
+ export declare const defaultPopoverOptions: PopoverOptions;
297
+
298
+ export declare const defaultPopoverOptions_alias_1: PopoverOptions;
299
+
300
+ export declare function defaultQueryBuilder(match: RegExpExecArray): string;
301
+
302
+ export declare function isAutocompleteItem(element?: Element | null): element is AutocompleteItem;
303
+
304
+ export declare function isAutocompleteList(element?: Element | null): element is AutocompleteList;
305
+
306
+ export declare function isComboBoxItem(element?: Element | null): element is ComboBoxItem;
307
+
308
+ export declare function isComboBoxList(element?: Element | null): element is ComboBoxList;
309
+
310
+ export declare class LightBlockElement extends BlockElement {
311
+ createRenderRoot(): this;
312
+ }
313
+
314
+ export declare class ListManager<Item extends {
315
+ hidden: boolean;
316
+ } & HTMLElement> {
317
+ private lastMouseMoveTime;
318
+ private getItems;
319
+ private getSelectedValue;
320
+ private setSelectedValue;
321
+ private getItemValue;
322
+ private queryClosestItem;
323
+ private getActive;
324
+ private onDismiss;
325
+ private onSelect;
326
+ constructor(options: {
327
+ getItems: () => Item[];
328
+ getSelectedValue: () => string;
329
+ setSelectedValue: (value: string) => void;
330
+ getItemValue: (item: Item) => string;
331
+ queryClosestItem: (element: HTMLElement) => Item | null;
332
+ getActive: () => boolean;
333
+ onDismiss: () => void;
334
+ onSelect: (item?: Item | null) => void;
335
+ });
336
+ get items(): Item[];
337
+ get availableItems(): Item[];
338
+ get firstItem(): Item | null;
339
+ get selectedItem(): Item | null;
340
+ private updateSelectedByChange;
341
+ private handleSelect;
342
+ selectFirstItem(): void;
343
+ handleMouseMove(_event: MouseEvent): void;
344
+ handleMouseOver(event: MouseEvent): void;
345
+ handleMouseDown(event: MouseEvent): void;
346
+ handleClick(event: MouseEvent): void;
347
+ handleArrowUp(): boolean;
348
+ handleArrowDown(): boolean;
349
+ handleEscape(): boolean;
350
+ handleEnter(): boolean;
351
+ }
352
+
353
+ /**
354
+ * A custom element that displays a popover anchored to a reference element.
355
+ */
356
+ export declare class Popover extends LightBlockElement implements Partial<PopoverProps> {
357
+ /** @hidden */
358
+ constructor();
359
+ /** @hidden */
360
+ static styles: CSSResultGroup;
361
+ /**
362
+ * Controls the visibility of the popover element. When set to `true`, the popover is displayed and positioned
363
+ * relative to its reference element. When set to `false`, the popover is hidden and its positioning logic is
364
+ * deactivated.
365
+ */
366
+ active: boolean;
367
+ /**
368
+ * The element that the popover is anchored to. This can be either a DOM element or an object that implements the
369
+ * virtual element interface from Floating UI.
370
+ */
371
+ reference?: Element | VirtualElement;
372
+ /**
373
+ * The options that are passed to the `computePosition` function from Floating UI. These options are used to
374
+ * configure the positioning of the popover element relative to its reference element. For more information on the
375
+ * available options, please refer to the Floating UI documentation.
376
+ */
377
+ options?: PopoverOptions;
378
+ /**
379
+ * Controls whether the popover position is automatically updated when the reference element changes position. When
380
+ * set to `true`, the popover position is updated automatically. When set to `false`, the popover position is only
381
+ * updated when the given properties are changed.
382
+ *
383
+ * @default false
384
+ */
385
+ autoUpdate: boolean;
386
+ /**
387
+ * The options that are passed to the `autoUpdate` function from Floating UI. These options are used to configure the
388
+ * automatic update behavior of the popover position. For more information on the available options, please refer to
389
+ * the Floating UI documentation. This property is only used when the `autoUpdate` property is set to `true`.
390
+ */
391
+ autoUpdateOptions?: AutoUpdateOptions;
392
+ /** @hidden */
393
+ private cleanupAutoUpdate?;
394
+ /** @hidden */
395
+ disconnectedCallback(): void;
396
+ /** @hidden */
397
+ protected updated(): void;
398
+ /** @hidden */
399
+ private start;
400
+ /** @hidden */
401
+ private compute;
402
+ /** @hidden */
403
+ private cleanup;
404
+ }
405
+
406
+ /**
407
+ * The `PopoverOptions` interface defines the options that can be passed to the
408
+ * `computePosition` function from Floating UI. These options are used to
409
+ * configure the positioning of the popover element relative to its reference
410
+ * element. For more information on the available options, please refer to the
411
+ * Floating UI documentation.
412
+ *
413
+ * https://floating-ui.com/docs/computeposition#options
414
+ */
415
+ declare type PopoverOptions = ComputePositionConfig;
416
+ export { PopoverOptions }
417
+ export { PopoverOptions as PopoverOptions_alias_1 }
418
+ export { PopoverOptions as PopoverOptions_alias_2 }
419
+
420
+ export declare interface PopoverProps {
421
+ active: boolean;
422
+ reference?: Element | VirtualElement;
423
+ options?: PopoverOptions;
424
+ autoUpdate?: boolean;
425
+ autoUpdateOptions?: AutoUpdateOptions;
426
+ }
427
+
428
+ export declare const propNames: readonly [];
429
+
430
+ declare const propNames_2: readonly ["value", "onSelect"];
431
+ export { propNames_2 as propNames_alias_1 }
432
+ export { propNames_2 as propNames_alias_2 }
433
+
434
+ declare const propNames_3: readonly ["editor"];
435
+ export { propNames_3 as propNames_alias_3 }
436
+ export { propNames_3 as propNames_alias_4 }
437
+
438
+ declare const propNames_4: never[];
439
+ export { propNames_4 as propNames_alias_10 }
440
+ export { propNames_4 as propNames_alias_9 }
441
+
442
+ declare const propNames_5: never[];
443
+ export { propNames_5 as propNames_alias_11 }
444
+ export { propNames_5 as propNames_alias_12 }
445
+
446
+ export declare const propNames_alias_13: string[];
447
+
448
+ export declare const propNames_alias_5: readonly ["editor", "regex", "popoverOptions"];
449
+
450
+ export declare const propNames_alias_6: readonly ["editor"];
451
+
452
+ export declare const propNames_alias_7: readonly ["onDismiss"];
453
+
454
+ export declare const propNames_alias_8: readonly ["placeholder"];
455
+
456
+ export declare function queryClosestAutocompleteItem(element?: Element | null): AutocompleteItem | null;
457
+
458
+ export declare function queryClosestComboBoxItem(element?: Element | null): ComboBoxItem | null;
459
+
460
+ /** Rounds a value to the nearest device pixel ratio. */
461
+ export declare function roundByDPR(value: number): number;
462
+
463
+ export declare class ShadowBlockElement extends BlockElement {
464
+ /** @hidden */
465
+ static styles: CSSResultGroup;
466
+ setHidden(hidden: boolean): void;
467
+ }
468
+
469
+ export { }
@@ -1,17 +1,3 @@
1
- import * as lit from 'lit';
2
- import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { A as AutocompleteListContext } from './context-19474449.js';
4
-
5
- declare const propNames: readonly [];
6
- interface AutocompleteEmptyProps {
7
- }
8
- declare class AutocompleteEmpty extends LitElement implements AutocompleteEmptyProps {
9
- /** @hidden */
10
- static styles: CSSResultGroup;
11
- listContext?: AutocompleteListContext;
12
- protected willUpdate(_changedProperties: PropertyValues<this>): void;
13
- /** @hidden */
14
- render(): lit.TemplateResult<1> | null;
15
- }
16
-
17
- export { AutocompleteEmpty, AutocompleteEmptyProps, propNames };
1
+ export { propNames } from './_tsup-dts-rollup';
2
+ export { AutocompleteEmptyProps } from './_tsup-dts-rollup';
3
+ export { AutocompleteEmpty } from './_tsup-dts-rollup';
@@ -1,32 +1,3 @@
1
- import * as lit from 'lit';
2
- import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { A as AutocompleteListContext } from './context-19474449.js';
4
-
5
- declare const propNames: readonly ["value", "onSelect"];
6
- interface AutocompleteItemProps {
7
- value?: string;
8
- onSelect: VoidFunction;
9
- }
10
- /**
11
- * Command menu item. Becomes active on pointer enter or through keyboard
12
- * navigation. Preferably pass a `value`, otherwise the value will be inferred
13
- * from the rendered item's `textContent`.
14
- */
15
- declare class AutocompleteItem extends LitElement implements Partial<AutocompleteItemProps> {
16
- /** @hidden */
17
- static styles: CSSResultGroup;
18
- value: string;
19
- selected: boolean;
20
- /** @hidden */
21
- onSelect?: VoidFunction;
22
- /** @hidden */
23
- defaultSlot?: HTMLSlotElement;
24
- listContext?: AutocompleteListContext;
25
- get content(): string;
26
- protected willUpdate(changedProperties: PropertyValues<this>): void;
27
- protected updated(changedProperties: PropertyValues<this>): void;
28
- /** @hidden */
29
- render(): lit.TemplateResult<1> | null;
30
- }
31
-
32
- export { AutocompleteItem, AutocompleteItemProps, propNames };
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,35 +1,3 @@
1
- import * as lit from 'lit';
2
- import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { Editor } from '@prosekit/core';
4
- import { A as AutocompletePopoverContext } from './context-436a56d3.js';
5
- import { A as AutocompleteListContext } from './context-19474449.js';
6
-
7
- declare const propNames: readonly ["editor"];
8
- interface AutocompleteListProps {
9
- editor: Editor;
10
- }
11
- declare class AutocompleteList extends LitElement implements Partial<AutocompleteListProps> {
12
- /** @hidden */
13
- static styles: CSSResultGroup;
14
- /** @hidden */
15
- private listManager;
16
- /** @hidden */
17
- private controller;
18
- private get active();
19
- editor?: Editor;
20
- popoverContext: AutocompletePopoverContext | null;
21
- context: AutocompleteListContext;
22
- protected firstUpdated(): void;
23
- private get items();
24
- selectFirstItem(): void;
25
- private updateValue;
26
- private registerValue;
27
- /** @hidden */
28
- defaultSlot?: HTMLSlotElement;
29
- /** @hidden */
30
- willUpdate(changedProperties: PropertyValues<this>): void;
31
- /** @hidden */
32
- render(): lit.TemplateResult<1>;
33
- }
34
-
35
- export { AutocompleteList, AutocompleteListProps, propNames };
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';
@@ -1,37 +1,4 @@
1
- import * as lit from 'lit';
2
- import { LitElement, CSSResultGroup } from 'lit';
3
- import { P as PopoverOptions } from './options-7235df55.js';
4
- import { Editor } from '@prosekit/core';
5
- import { A as AutocompletePopoverContext } from './context-436a56d3.js';
6
- import '@floating-ui/dom';
7
-
8
- declare const propNames: readonly ["editor", "regex", "popoverOptions"];
9
- interface AutocompletePopoverProps {
10
- editor: Editor;
11
- regex: RegExp;
12
- popoverOptions?: PopoverOptions;
13
- }
14
- declare class AutocompletePopover extends LitElement implements Partial<AutocompletePopoverProps> {
15
- /** @hidden */
16
- static styles: CSSResultGroup;
17
- /** @hidden */
18
- private controller;
19
- editor?: Editor;
20
- regex?: RegExp;
21
- popoverOptions: PopoverOptions;
22
- context: AutocompletePopoverContext;
23
- /** @hidden */
24
- onSelect?: VoidFunction;
25
- private get list();
26
- private updateContext;
27
- /** @hidden */
28
- defaultSlot?: HTMLSlotElement;
29
- /** @hidden */
30
- protected get active(): boolean;
31
- /** @hidden */
32
- willUpdate(): void;
33
- /** @hidden */
34
- render(): lit.TemplateResult<1>;
35
- }
36
-
37
- export { AutocompletePopover, AutocompletePopoverProps, PopoverOptions, propNames };
1
+ export { PopoverOptions } from './_tsup-dts-rollup';
2
+ export { propNames_alias_5 as propNames } from './_tsup-dts-rollup';
3
+ export { AutocompletePopoverProps } from './_tsup-dts-rollup';
4
+ export { AutocompletePopover } from './_tsup-dts-rollup';
@@ -1,19 +1,3 @@
1
- import { Editor } from '@prosekit/core';
2
- import { P as Popover } from './index-f7e15683.js';
3
- import '@floating-ui/dom';
4
- import 'lit';
5
- import './index-2645d161.js';
6
- import './options-7235df55.js';
7
-
8
- declare const propNames: readonly ["editor"];
9
- interface CodeBlockPopoverProps {
10
- editor: Editor;
11
- }
12
- declare class CodeBlockPopover extends Popover implements Partial<CodeBlockPopoverProps> {
13
- editor?: Editor;
14
- /** @hidden */
15
- private controller;
16
- protected updated(): void;
17
- }
18
-
19
- export { CodeBlockPopover, CodeBlockPopoverProps, propNames };
1
+ export { propNames_alias_6 as propNames } from './_tsup-dts-rollup';
2
+ export { CodeBlockPopoverProps } from './_tsup-dts-rollup';
3
+ export { CodeBlockPopover } from './_tsup-dts-rollup';
@@ -36,7 +36,7 @@ function addCodeBlockSelect(options) {
36
36
  };
37
37
  }
38
38
  });
39
- return addPlugin({ plugins: [plugin] });
39
+ return addPlugin(plugin);
40
40
  }
41
41
  function getState(view) {
42
42
  const { $from, $to } = view.state.selection;
@@ -1,22 +1,3 @@
1
- import * as lit_html from 'lit-html';
2
- import { L as LightBlockElement } from './index-2645d161.js';
3
- import { C as ComboBoxContext } from './index-c461623f.js';
4
- import 'lit';
5
- import '@prosekit/core';
6
-
7
- declare const propNames: readonly ["placeholder"];
8
- type ComboBoxInputProps = {
9
- placeholder?: string;
10
- };
11
- declare class ComboBoxInput extends LightBlockElement {
12
- placeholder: string;
13
- comboBoxContext: ComboBoxContext | null;
14
- private visible;
15
- private handleKeydown;
16
- private handleInput;
17
- protected firstUpdated(): void;
18
- /** @hidden */
19
- render(): lit_html.TemplateResult<1>;
20
- }
21
-
22
- export { ComboBoxInput, ComboBoxInputProps, propNames };
1
+ export { propNames_alias_8 as propNames } from './_tsup-dts-rollup';
2
+ export { ComboBoxInputProps } from './_tsup-dts-rollup';
3
+ export { ComboBoxInput } from './_tsup-dts-rollup';
@@ -1,4 +1,3 @@
1
- export { a as ComboBoxItem, b as ComboBoxItemProps, p as propNames } from './index-c461623f.js';
2
- import '@prosekit/core';
3
- import 'lit';
4
- import './index-2645d161.js';
1
+ export { ComboBoxItem_alias_1 as ComboBoxItem } from './_tsup-dts-rollup';
2
+ export { ComboBoxItemProps_alias_1 as ComboBoxItemProps } from './_tsup-dts-rollup';
3
+ export { propNames_alias_10 as propNames } from './_tsup-dts-rollup';
@@ -1,13 +1,3 @@
1
- import { L as LightBlockElement } from './index-2645d161.js';
2
- import { C as ComboBoxContext } from './index-c461623f.js';
3
- import 'lit';
4
- import '@prosekit/core';
5
-
6
- declare const propNames: never[];
7
- type ComboBoxListProps = Record<string, never>;
8
- declare class ComboBoxList extends LightBlockElement {
9
- comboBoxContext: ComboBoxContext | null;
10
- connectedCallback(): void;
11
- }
12
-
13
- export { ComboBoxList, ComboBoxListProps, propNames };
1
+ export { ComboBoxList_alias_1 as ComboBoxList } from './_tsup-dts-rollup';
2
+ export { ComboBoxListProps_alias_1 as ComboBoxListProps } from './_tsup-dts-rollup';
3
+ export { propNames_alias_12 as propNames } from './_tsup-dts-rollup';
@@ -1,20 +1,3 @@
1
- import { C as ComboBoxContext, a as ComboBoxItem } from './index-c461623f.js';
2
- import { P as Popover } from './index-f7e15683.js';
3
- import '@prosekit/core';
4
- import 'lit';
5
- import './index-2645d161.js';
6
- import '@floating-ui/dom';
7
- import './options-7235df55.js';
8
-
9
- declare const propNames: readonly ["onDismiss"];
10
- type ComboBoxProps = {
11
- onDismiss?: VoidFunction;
12
- };
13
- declare class ComboBox extends Popover {
14
- onDismiss?: VoidFunction;
15
- private listManager;
16
- context: ComboBoxContext;
17
- get items(): ComboBoxItem[];
18
- }
19
-
20
- export { ComboBox, ComboBoxProps, propNames };
1
+ export { propNames_alias_7 as propNames } from './_tsup-dts-rollup';
2
+ export { ComboBoxProps } from './_tsup-dts-rollup';
3
+ export { ComboBox } from './_tsup-dts-rollup';
@@ -1,2 +1 @@
1
-
2
- export { }
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/lit",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -81,10 +81,10 @@
81
81
  ],
82
82
  "dependencies": {
83
83
  "@floating-ui/dom": "^1.5.1",
84
- "@lit-labs/context": "^0.3.3",
84
+ "@lit-labs/context": "^0.4.0",
85
85
  "@lit/reactive-element": "^1.6.3",
86
- "@prosekit/core": "^0.0.7",
87
- "@prosekit/extensions": "^0.0.8",
86
+ "@prosekit/core": "^0.0.8",
87
+ "@prosekit/extensions": "^0.0.9",
88
88
  "@prosekit/pm": "^0.0.3",
89
89
  "@superhuman/command-score": "^0.5.0",
90
90
  "lit": "^2.8.0",
@@ -93,10 +93,10 @@
93
93
  },
94
94
  "devDependencies": {
95
95
  "@prosekit/dev": "*",
96
- "minify-literals": "^1.0.6",
96
+ "minify-literals": "^1.0.7",
97
97
  "tsup": "^7.2.0",
98
- "typescript": "^5.1.6",
99
- "vitest": "^0.34.1",
98
+ "typescript": "^5.2.2",
99
+ "vitest": "^0.34.3",
100
100
  "vue": "^3.3.4"
101
101
  },
102
102
  "scripts": {
@@ -1,7 +0,0 @@
1
- type AutocompleteListContext = {
2
- scores: Map<string, number>;
3
- selectedValue: string;
4
- registerValue: (value: string) => VoidFunction;
5
- };
6
-
7
- export { AutocompleteListContext as A };
@@ -1,8 +0,0 @@
1
- type AutocompletePopoverContext = {
2
- active: boolean;
3
- query: string;
4
- handleDismiss: VoidFunction;
5
- handleSubmit: VoidFunction;
6
- };
7
-
8
- export { AutocompletePopoverContext as A };
@@ -1,10 +0,0 @@
1
- import { LitElement } from 'lit';
2
-
3
- declare class BlockElement extends LitElement {
4
- setHidden(hidden: boolean): void;
5
- }
6
- declare class LightBlockElement extends BlockElement {
7
- createRenderRoot(): this;
8
- }
9
-
10
- export { LightBlockElement as L };
@@ -1,67 +0,0 @@
1
- import { Editor } from '@prosekit/core';
2
- import { CSSResultGroup } from 'lit';
3
- import { L as LightBlockElement } from './index-2645d161.js';
4
-
5
- declare class ListManager<Item extends {
6
- hidden: boolean;
7
- } & HTMLElement> {
8
- private lastMouseMoveTime;
9
- private getItems;
10
- private getSelectedValue;
11
- private setSelectedValue;
12
- private getItemValue;
13
- private queryClosestItem;
14
- private getActive;
15
- private onDismiss;
16
- private onSelect;
17
- constructor(options: {
18
- getItems: () => Item[];
19
- getSelectedValue: () => string;
20
- setSelectedValue: (value: string) => void;
21
- getItemValue: (item: Item) => string;
22
- queryClosestItem: (element: HTMLElement) => Item | null;
23
- getActive: () => boolean;
24
- onDismiss: () => void;
25
- onSelect: (item?: Item | null) => void;
26
- });
27
- get items(): Item[];
28
- get availableItems(): Item[];
29
- get firstItem(): Item | null;
30
- get selectedItem(): Item | null;
31
- private updateSelectedByChange;
32
- private handleSelect;
33
- selectFirstItem(): void;
34
- handleMouseMove(_event: MouseEvent): void;
35
- handleMouseOver(event: MouseEvent): void;
36
- handleMouseDown(event: MouseEvent): void;
37
- handleClick(event: MouseEvent): void;
38
- handleArrowUp(): boolean;
39
- handleArrowDown(): boolean;
40
- handleEscape(): boolean;
41
- handleEnter(): boolean;
42
- }
43
-
44
- type ComboBoxContext = {
45
- inputValue: string;
46
- setInputValue: (val: string) => void;
47
- selectedValue: string;
48
- setSelectedValue: (val: string) => void;
49
- listManager: ListManager<ComboBoxItem>;
50
- };
51
-
52
- declare const propNames: never[];
53
- type ComboBoxItemProps = Record<string, never>;
54
- declare class ComboBoxItem extends LightBlockElement {
55
- /** @hidden */
56
- static styles: CSSResultGroup;
57
- editor?: Editor;
58
- /** @hidden */
59
- defaultSlot?: HTMLSlotElement;
60
- selected: boolean;
61
- comboBoxContext?: ComboBoxContext;
62
- /** @hidden */
63
- onSelect?: VoidFunction;
64
- protected updated(): void;
65
- }
66
-
67
- export { ComboBoxContext as C, ComboBoxItem as a, ComboBoxItemProps as b, propNames as p };
@@ -1,66 +0,0 @@
1
- import { VirtualElement, AutoUpdateOptions } from '@floating-ui/dom';
2
- import { CSSResultGroup } from 'lit';
3
- import { L as LightBlockElement } from './index-2645d161.js';
4
- import { P as PopoverOptions } from './options-7235df55.js';
5
-
6
- interface PopoverProps {
7
- active: boolean;
8
- reference?: Element | VirtualElement;
9
- options?: PopoverOptions;
10
- autoUpdate?: boolean;
11
- autoUpdateOptions?: AutoUpdateOptions;
12
- }
13
- /**
14
- * A custom element that displays a popover anchored to a reference element.
15
- */
16
- declare class Popover extends LightBlockElement implements Partial<PopoverProps> {
17
- /** @hidden */
18
- constructor();
19
- /** @hidden */
20
- static styles: CSSResultGroup;
21
- /**
22
- * Controls the visibility of the popover element. When set to `true`, the popover is displayed and positioned
23
- * relative to its reference element. When set to `false`, the popover is hidden and its positioning logic is
24
- * deactivated.
25
- */
26
- active: boolean;
27
- /**
28
- * The element that the popover is anchored to. This can be either a DOM element or an object that implements the
29
- * virtual element interface from Floating UI.
30
- */
31
- reference?: Element | VirtualElement;
32
- /**
33
- * The options that are passed to the `computePosition` function from Floating UI. These options are used to
34
- * configure the positioning of the popover element relative to its reference element. For more information on the
35
- * available options, please refer to the Floating UI documentation.
36
- */
37
- options?: PopoverOptions;
38
- /**
39
- * Controls whether the popover position is automatically updated when the reference element changes position. When
40
- * set to `true`, the popover position is updated automatically. When set to `false`, the popover position is only
41
- * updated when the given properties are changed.
42
- *
43
- * @default false
44
- */
45
- autoUpdate: boolean;
46
- /**
47
- * The options that are passed to the `autoUpdate` function from Floating UI. These options are used to configure the
48
- * automatic update behavior of the popover position. For more information on the available options, please refer to
49
- * the Floating UI documentation. This property is only used when the `autoUpdate` property is set to `true`.
50
- */
51
- autoUpdateOptions?: AutoUpdateOptions;
52
- /** @hidden */
53
- private cleanupAutoUpdate?;
54
- /** @hidden */
55
- disconnectedCallback(): void;
56
- /** @hidden */
57
- protected updated(): void;
58
- /** @hidden */
59
- private start;
60
- /** @hidden */
61
- private compute;
62
- /** @hidden */
63
- private cleanup;
64
- }
65
-
66
- export { Popover as P };
@@ -1,14 +0,0 @@
1
- import { ComputePositionConfig } from '@floating-ui/dom';
2
-
3
- /**
4
- * The `PopoverOptions` interface defines the options that can be passed to the
5
- * `computePosition` function from Floating UI. These options are used to
6
- * configure the positioning of the popover element relative to its reference
7
- * element. For more information on the available options, please refer to the
8
- * Floating UI documentation.
9
- *
10
- * https://floating-ui.com/docs/computeposition#options
11
- */
12
- type PopoverOptions = ComputePositionConfig;
13
-
14
- export { PopoverOptions as P };