@prosekit/lit 0.2.7 → 0.3.0

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.
Files changed (46) hide show
  1. package/dist/_tsup-dts-rollup.d.ts +27 -1088
  2. package/dist/prosekit-lit-autocomplete.d.ts +4 -0
  3. package/dist/prosekit-lit-autocomplete.js +11 -0
  4. package/dist/prosekit-lit-block-handle.d.ts +2 -0
  5. package/dist/prosekit-lit-block-handle.js +7 -0
  6. package/dist/prosekit-lit-inline-popover.d.ts +0 -3
  7. package/dist/prosekit-lit-inline-popover.js +2 -190
  8. package/dist/prosekit-lit-popover.d.ts +3 -6
  9. package/dist/prosekit-lit-popover.js +7 -8
  10. package/dist/prosekit-lit-resizable.d.ts +2 -3
  11. package/dist/prosekit-lit-resizable.js +5 -108
  12. package/dist/prosekit-lit-tooltip.d.ts +3 -0
  13. package/dist/prosekit-lit-tooltip.js +9 -0
  14. package/package.json +24 -95
  15. package/dist/chunk-3AZDRLDR.js +0 -39
  16. package/dist/chunk-3TPE2GKD.js +0 -51
  17. package/dist/chunk-5CI65R73.js +0 -9
  18. package/dist/chunk-C4MW43I4.js +0 -9
  19. package/dist/chunk-CPC45JQ7.js +0 -202
  20. package/dist/chunk-I5EMQRE4.js +0 -60
  21. package/dist/chunk-MZAHIYA5.js +0 -114
  22. package/dist/chunk-S72UTR5M.js +0 -9
  23. package/dist/chunk-WEUGKLVB.js +0 -9
  24. package/dist/chunk-XHBZNZ2L.js +0 -369
  25. package/dist/prosekit-lit-autocomplete-empty.d.ts +0 -3
  26. package/dist/prosekit-lit-autocomplete-empty.js +0 -44
  27. package/dist/prosekit-lit-autocomplete-item.d.ts +0 -3
  28. package/dist/prosekit-lit-autocomplete-item.js +0 -10
  29. package/dist/prosekit-lit-autocomplete-list.d.ts +0 -3
  30. package/dist/prosekit-lit-autocomplete-list.js +0 -12
  31. package/dist/prosekit-lit-autocomplete-popover.d.ts +0 -4
  32. package/dist/prosekit-lit-autocomplete-popover.js +0 -199
  33. package/dist/prosekit-lit-block-popover.d.ts +0 -3
  34. package/dist/prosekit-lit-block-popover.js +0 -169
  35. package/dist/prosekit-lit-combo-box-input.d.ts +0 -3
  36. package/dist/prosekit-lit-combo-box-input.js +0 -92
  37. package/dist/prosekit-lit-combo-box-item.d.ts +0 -3
  38. package/dist/prosekit-lit-combo-box-item.js +0 -10
  39. package/dist/prosekit-lit-combo-box-list.d.ts +0 -3
  40. package/dist/prosekit-lit-combo-box-list.js +0 -44
  41. package/dist/prosekit-lit-combo-box.d.ts +0 -3
  42. package/dist/prosekit-lit-combo-box.js +0 -130
  43. package/dist/prosekit-lit-drag-handle.d.ts +0 -3
  44. package/dist/prosekit-lit-drag-handle.js +0 -94
  45. package/dist/prosekit-lit-resizable-handle.d.ts +0 -3
  46. package/dist/prosekit-lit-resizable-handle.js +0 -159
@@ -0,0 +1,4 @@
1
+ export { AutocompleteEmpty } from './_tsup-dts-rollup';
2
+ export { AutocompleteItem } from './_tsup-dts-rollup';
3
+ export { AutocompleteList } from './_tsup-dts-rollup';
4
+ export { AutocompletePopover } from './_tsup-dts-rollup';
@@ -0,0 +1,11 @@
1
+ // src/components/autocomplete/index.ts
2
+ import { AutocompleteEmptyElement } from "@prosekit/web/autocomplete";
3
+ import { AutocompleteItemElement } from "@prosekit/web/autocomplete";
4
+ import { AutocompleteListElement } from "@prosekit/web/autocomplete";
5
+ import { AutocompletePopoverElement } from "@prosekit/web/autocomplete";
6
+ export {
7
+ AutocompleteEmptyElement as AutocompleteEmpty,
8
+ AutocompleteItemElement as AutocompleteItem,
9
+ AutocompleteListElement as AutocompleteList,
10
+ AutocompletePopoverElement as AutocompletePopover
11
+ };
@@ -0,0 +1,2 @@
1
+ export { BlockDragHandle } from './_tsup-dts-rollup';
2
+ export { BlockPopover } from './_tsup-dts-rollup';
@@ -0,0 +1,7 @@
1
+ // src/components/block-handle/index.ts
2
+ import { BlockDragHandleElement } from "@prosekit/web/block-handle";
3
+ import { BlockPopoverElement } from "@prosekit/web/block-handle";
4
+ export {
5
+ BlockDragHandleElement as BlockDragHandle,
6
+ BlockPopoverElement as BlockPopover
7
+ };
@@ -1,4 +1 @@
1
- export { PositioningOptions_alias_1 as PositioningOptions } from './_tsup-dts-rollup';
2
- export { propNames_alias_14 as propNames } from './_tsup-dts-rollup';
3
- export { InlinePopoverProps } from './_tsup-dts-rollup';
4
1
  export { InlinePopover } from './_tsup-dts-rollup';
@@ -1,193 +1,5 @@
1
- import {
2
- Popover,
3
- popoverPropsNames
4
- } from "./chunk-XHBZNZ2L.js";
5
- import {
6
- defineCustomElement
7
- } from "./chunk-3AZDRLDR.js";
8
-
9
1
  // src/components/inline-popover/index.ts
10
- import "@prosekit/core";
11
-
12
- // src/controllers/use-editor-focus-event.ts
13
- import {
14
- defineFocusChangeHandler
15
- } from "@prosekit/core";
16
-
17
- // src/controllers/use-editor-extension.ts
18
- import "@prosekit/core";
19
- function useEditorExtension(host, extension) {
20
- let cleanup;
21
- let editor;
22
- const update = () => {
23
- cleanup == null ? void 0 : cleanup();
24
- cleanup = editor == null ? void 0 : editor.use(extension);
25
- };
26
- const hostConnected = () => {
27
- editor = host.editor;
28
- update();
29
- };
30
- const hostUpdated = () => {
31
- const newEditor = host.editor;
32
- if (editor !== newEditor) {
33
- editor = newEditor;
34
- update();
35
- }
36
- };
37
- const hostDisconnected = () => {
38
- cleanup == null ? void 0 : cleanup();
39
- cleanup = void 0;
40
- };
41
- host.addController({
42
- hostConnected,
43
- hostDisconnected,
44
- hostUpdated
45
- });
46
- }
47
-
48
- // src/controllers/use-editor-focus-event.ts
49
- function useEditorFocusChangeEvent(host, handler) {
50
- const extension = defineFocusChangeHandler(handler);
51
- useEditorExtension(host, extension);
52
- }
53
-
54
- // src/controllers/use-editor-update-event.ts
55
- import { defineUpdateHandler } from "@prosekit/core";
56
- function useEditorUpdateEvent(host, handler) {
57
- const extension = defineUpdateHandler(handler);
58
- useEditorExtension(host, extension);
59
- }
60
-
61
- // src/components/inline-popover/virtual-selection-element.ts
62
- import { isNodeSelection, isTextSelection } from "@prosekit/core";
63
-
64
- // src/utils/is-in-code-block.ts
65
- function isInCodeBlock(selection) {
66
- const type = selection.$from.parent.type;
67
- return type.spec.code && type.isBlock;
68
- }
69
-
70
- // src/components/inline-popover/virtual-selection-element.ts
71
- function getVirtualSelectionElement(view) {
72
- if (typeof window === "undefined" || view.isDestroyed) {
73
- return;
74
- }
75
- const selection = view.state.selection;
76
- if (!selection.empty && !isInCodeBlock(selection) && (isTextSelection(selection) || isNodeSelection(selection))) {
77
- const decoration = getInlineDecoration(view);
78
- if (decoration) {
79
- return decoration;
80
- }
81
- const range = getDomRange();
82
- if (range) {
83
- return {
84
- contextElement: view.dom,
85
- getBoundingClientRect: () => range.getBoundingClientRect(),
86
- getClientRects: () => range.getClientRects()
87
- };
88
- }
89
- }
90
- }
91
- function getDomRange() {
92
- const selection = window.getSelection();
93
- if (!selection || selection.isCollapsed) {
94
- return;
95
- }
96
- const range = typeof selection.rangeCount === "number" && selection.rangeCount > 0 && selection.getRangeAt(0);
97
- if (!range) {
98
- return;
99
- }
100
- return range;
101
- }
102
- function getInlineDecoration(view) {
103
- const match = view.dom.querySelectorAll(".prosekit-virtual-selection");
104
- if (match.length === 0) {
105
- return;
106
- }
107
- if (match.length === 1) {
108
- return match[0];
109
- }
110
- const items = Array.from(match);
111
- return {
112
- contextElement: items[0],
113
- getBoundingClientRect: () => items[0].getBoundingClientRect(),
114
- getClientRects: () => items.map((item) => item.getBoundingClientRect())
115
- };
116
- }
117
-
118
- // src/components/inline-popover/use-inline-popover.ts
119
- function useInlinePopover(host, onReferenceChange) {
120
- let reference;
121
- let editorFocused = false;
122
- const isPopoverFocused = () => {
123
- return !editorFocused && host.contains(host.ownerDocument.activeElement);
124
- };
125
- useEditorFocusChangeEvent(host, (focus) => {
126
- editorFocused = focus;
127
- });
128
- useEditorUpdateEvent(host, (view) => {
129
- if (isPopoverFocused())
130
- return;
131
- const ref = getVirtualSelectionElement(view);
132
- if (reference !== ref) {
133
- reference = ref;
134
- onReferenceChange(reference);
135
- host.requestUpdate();
136
- }
137
- });
138
- const getReference = () => reference;
139
- return getReference;
140
- }
141
-
142
- // src/components/inline-popover/index.ts
143
- var propNames = ["editor", "available", ...popoverPropsNames];
144
- var InlinePopover = class extends Popover {
145
- /**
146
- * @hidden
147
- */
148
- constructor() {
149
- super();
150
- this.available = true;
151
- this.positioning = {
152
- strategy: "fixed",
153
- placement: "top",
154
- offset: 12,
155
- flip: false,
156
- hide: true,
157
- shift: true,
158
- overlap: true,
159
- fitViewport: true,
160
- inline: true
161
- };
162
- useInlinePopover(this, (reference) => {
163
- this.reference = reference;
164
- });
165
- }
166
- /**
167
- * @hidden
168
- */
169
- updated(changedProperties) {
170
- super.updated(changedProperties);
171
- this.open = !!(this.reference && this.available);
172
- }
173
- /**
174
- * @hidden
175
- */
176
- hide() {
177
- super.hide();
178
- this.reference = void 0;
179
- }
180
- };
181
- /**
182
- * @hidden
183
- */
184
- InlinePopover.properties = {
185
- ...Popover.properties,
186
- editor: { attribute: false },
187
- available: { attribute: false }
188
- };
189
- defineCustomElement("prosekit-inline-popover", InlinePopover);
2
+ import { InlinePopoverElement } from "@prosekit/web/inline-popover";
190
3
  export {
191
- InlinePopover,
192
- propNames
4
+ InlinePopoverElement as InlinePopover
193
5
  };
@@ -1,6 +1,3 @@
1
- export { AutoUpdateOptions } from './_tsup-dts-rollup';
2
- export { PositioningOptions_alias_2 as PositioningOptions } from './_tsup-dts-rollup';
3
- export { popoverPropsNames } from './_tsup-dts-rollup';
4
- export { propNames_alias_15 as propNames } from './_tsup-dts-rollup';
5
- export { PopoverProps } from './_tsup-dts-rollup';
6
- export { Popover } from './_tsup-dts-rollup';
1
+ export { PopoverContent } from './_tsup-dts-rollup';
2
+ export { PopoverRoot } from './_tsup-dts-rollup';
3
+ export { PopoverTrigger } from './_tsup-dts-rollup';
@@ -1,10 +1,9 @@
1
- import {
2
- Popover,
3
- popoverPropsNames
4
- } from "./chunk-XHBZNZ2L.js";
5
- import "./chunk-3AZDRLDR.js";
1
+ // src/components/popover/index.ts
2
+ import { PopoverContentElement } from "@prosekit/web/popover";
3
+ import { PopoverRootElement } from "@prosekit/web/popover";
4
+ import { PopoverTriggerElement } from "@prosekit/web/popover";
6
5
  export {
7
- Popover,
8
- popoverPropsNames,
9
- popoverPropsNames as propNames
6
+ PopoverContentElement as PopoverContent,
7
+ PopoverRootElement as PopoverRoot,
8
+ PopoverTriggerElement as PopoverTrigger
10
9
  };
@@ -1,3 +1,2 @@
1
- export { Resizable_alias_1 as Resizable } from './_tsup-dts-rollup';
2
- export { propNames_alias_17 as propNames } from './_tsup-dts-rollup';
3
- export { ResizableProps_alias_1 as ResizableProps } from './_tsup-dts-rollup';
1
+ export { ResizableHandle } from './_tsup-dts-rollup';
2
+ export { ResizableRoot } from './_tsup-dts-rollup';
@@ -1,110 +1,7 @@
1
- import {
2
- resizableContext
3
- } from "./chunk-WEUGKLVB.js";
4
- import {
5
- LightElement,
6
- defineCustomElement
7
- } from "./chunk-3AZDRLDR.js";
8
-
9
- // src/components/resizable/component.ts
10
- import { ContextProvider } from "@lit/context";
11
- var propNames = [
12
- "width",
13
- "height",
14
- "aspectRatio",
15
- "onSizeChangeStart",
16
- "onSizeChange",
17
- "onSizeChangeEnd"
18
- ];
19
- var Resizable = class extends LightElement {
20
- /**
21
- * @hidden
22
- */
23
- constructor() {
24
- super();
25
- this.startWidth = 0;
26
- this.startHeight = 0;
27
- new ContextProvider(this, {
28
- context: resizableContext,
29
- initialValue: {
30
- onResizeStart: () => this.handleResizeStart(),
31
- onResize: (w, h) => this.handleResize(w, h),
32
- onResizeEnd: () => this.handleResizeEnd()
33
- }
34
- });
35
- }
36
- handleResizeStart() {
37
- var _a, _b;
38
- const { width, height } = this.getBoundingClientRect();
39
- this.startWidth = width;
40
- this.startHeight = height;
41
- (_a = this.onSizeChangeStart) == null ? void 0 : _a.call(this, { width, height });
42
- this.resizing = true;
43
- return [width, height, (_b = this.aspectRatio) != null ? _b : width / height];
44
- }
45
- handleResize(width, height) {
46
- var _a, _b, _c;
47
- const output = (_a = this.onSizeChange) == null ? void 0 : _a.call(this, { width, height });
48
- this.width = (_b = output == null ? void 0 : output.width) != null ? _b : width;
49
- this.height = (_c = output == null ? void 0 : output.height) != null ? _c : height;
50
- }
51
- handleResizeEnd() {
52
- var _a;
53
- const { width, height } = this.getBoundingClientRect();
54
- this.resizing = false;
55
- (_a = this.onSizeChangeEnd) == null ? void 0 : _a.call(this, { width, height });
56
- }
57
- updateStyle() {
58
- const w = this.width;
59
- const h = this.height;
60
- const r = this.aspectRatio;
61
- if (w != null && w !== "" && Number.isFinite(w)) {
62
- this.style.width = typeof w === "number" ? `${w}px` : w;
63
- } else {
64
- this.style.width = "";
65
- }
66
- if (h != null && h !== "" && Number.isFinite(h)) {
67
- this.style.height = typeof h === "number" ? `${h}px` : h;
68
- } else {
69
- this.style.height = "";
70
- }
71
- if (r && Number.isFinite(r)) {
72
- this.style.aspectRatio = `${r}`;
73
- if (this.style.width && this.startWidth >= this.startHeight && r >= 1) {
74
- this.style.height = "auto";
75
- } else if (this.style.height && this.startWidth <= this.startHeight && r <= 1) {
76
- this.style.width = "auto";
77
- }
78
- }
79
- }
80
- /**
81
- * @hidden
82
- */
83
- connectedCallback() {
84
- super.connectedCallback();
85
- this.updateStyle();
86
- }
87
- /**
88
- * @hidden
89
- */
90
- updated(changedProperties) {
91
- super.updated(changedProperties);
92
- this.updateStyle();
93
- }
94
- };
95
- /**
96
- * @hidden
97
- */
98
- Resizable.properties = {
99
- width: { attribute: false },
100
- height: { attribute: false },
101
- aspectRatio: { attribute: false },
102
- onResize: { attribute: false },
103
- onResizeEnd: { attribute: false },
104
- resizing: { attribute: "data-resizing", type: Boolean, reflect: true }
105
- };
106
- defineCustomElement("prosekit-resizable", Resizable);
1
+ // src/components/resizable/index.ts
2
+ import { ResizableHandleElement } from "@prosekit/web/resizable";
3
+ import { ResizableRootElement } from "@prosekit/web/resizable";
107
4
  export {
108
- Resizable,
109
- propNames
5
+ ResizableHandleElement as ResizableHandle,
6
+ ResizableRootElement as ResizableRoot
110
7
  };
@@ -0,0 +1,3 @@
1
+ export { TooltipContent } from './_tsup-dts-rollup';
2
+ export { TooltipRoot } from './_tsup-dts-rollup';
3
+ export { TooltipTrigger } from './_tsup-dts-rollup';
@@ -0,0 +1,9 @@
1
+ // src/components/tooltip/index.ts
2
+ import { TooltipContentElement } from "@prosekit/web/tooltip";
3
+ import { TooltipRootElement } from "@prosekit/web/tooltip";
4
+ import { TooltipTriggerElement } from "@prosekit/web/tooltip";
5
+ export {
6
+ TooltipContentElement as TooltipContent,
7
+ TooltipRootElement as TooltipRoot,
8
+ TooltipTriggerElement as TooltipTrigger
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/lit",
3
3
  "type": "module",
4
- "version": "0.2.7",
4
+ "version": "0.3.0",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -30,55 +30,15 @@
30
30
  "import": "./dist/prosekit-lit.js",
31
31
  "default": "./dist/prosekit-lit.js"
32
32
  },
33
- "./autocomplete-empty": {
34
- "types": "./dist/prosekit-lit-autocomplete-empty.d.ts",
35
- "import": "./dist/prosekit-lit-autocomplete-empty.js",
36
- "default": "./dist/prosekit-lit-autocomplete-empty.js"
33
+ "./autocomplete": {
34
+ "types": "./dist/prosekit-lit-autocomplete.d.ts",
35
+ "import": "./dist/prosekit-lit-autocomplete.js",
36
+ "default": "./dist/prosekit-lit-autocomplete.js"
37
37
  },
38
- "./autocomplete-item": {
39
- "types": "./dist/prosekit-lit-autocomplete-item.d.ts",
40
- "import": "./dist/prosekit-lit-autocomplete-item.js",
41
- "default": "./dist/prosekit-lit-autocomplete-item.js"
42
- },
43
- "./autocomplete-list": {
44
- "types": "./dist/prosekit-lit-autocomplete-list.d.ts",
45
- "import": "./dist/prosekit-lit-autocomplete-list.js",
46
- "default": "./dist/prosekit-lit-autocomplete-list.js"
47
- },
48
- "./autocomplete-popover": {
49
- "types": "./dist/prosekit-lit-autocomplete-popover.d.ts",
50
- "import": "./dist/prosekit-lit-autocomplete-popover.js",
51
- "default": "./dist/prosekit-lit-autocomplete-popover.js"
52
- },
53
- "./block-popover": {
54
- "types": "./dist/prosekit-lit-block-popover.d.ts",
55
- "import": "./dist/prosekit-lit-block-popover.js",
56
- "default": "./dist/prosekit-lit-block-popover.js"
57
- },
58
- "./combo-box": {
59
- "types": "./dist/prosekit-lit-combo-box.d.ts",
60
- "import": "./dist/prosekit-lit-combo-box.js",
61
- "default": "./dist/prosekit-lit-combo-box.js"
62
- },
63
- "./combo-box-input": {
64
- "types": "./dist/prosekit-lit-combo-box-input.d.ts",
65
- "import": "./dist/prosekit-lit-combo-box-input.js",
66
- "default": "./dist/prosekit-lit-combo-box-input.js"
67
- },
68
- "./combo-box-item": {
69
- "types": "./dist/prosekit-lit-combo-box-item.d.ts",
70
- "import": "./dist/prosekit-lit-combo-box-item.js",
71
- "default": "./dist/prosekit-lit-combo-box-item.js"
72
- },
73
- "./combo-box-list": {
74
- "types": "./dist/prosekit-lit-combo-box-list.d.ts",
75
- "import": "./dist/prosekit-lit-combo-box-list.js",
76
- "default": "./dist/prosekit-lit-combo-box-list.js"
77
- },
78
- "./drag-handle": {
79
- "types": "./dist/prosekit-lit-drag-handle.d.ts",
80
- "import": "./dist/prosekit-lit-drag-handle.js",
81
- "default": "./dist/prosekit-lit-drag-handle.js"
38
+ "./block-handle": {
39
+ "types": "./dist/prosekit-lit-block-handle.d.ts",
40
+ "import": "./dist/prosekit-lit-block-handle.js",
41
+ "default": "./dist/prosekit-lit-block-handle.js"
82
42
  },
83
43
  "./inline-popover": {
84
44
  "types": "./dist/prosekit-lit-inline-popover.d.ts",
@@ -95,32 +55,25 @@
95
55
  "import": "./dist/prosekit-lit-resizable.js",
96
56
  "default": "./dist/prosekit-lit-resizable.js"
97
57
  },
98
- "./resizable-handle": {
99
- "types": "./dist/prosekit-lit-resizable-handle.d.ts",
100
- "import": "./dist/prosekit-lit-resizable-handle.js",
101
- "default": "./dist/prosekit-lit-resizable-handle.js"
58
+ "./tooltip": {
59
+ "types": "./dist/prosekit-lit-tooltip.d.ts",
60
+ "import": "./dist/prosekit-lit-tooltip.js",
61
+ "default": "./dist/prosekit-lit-tooltip.js"
102
62
  }
103
63
  },
104
64
  "files": [
105
65
  "dist"
106
66
  ],
107
67
  "dependencies": {
108
- "@floating-ui/dom": "^1.6.3",
109
- "@lit/context": "^1.1.0",
110
- "@prosekit/core": "^0.4.0",
111
- "@prosekit/extensions": "^0.4.0",
112
- "@prosekit/pm": "^0.1.1",
113
- "@superhuman/command-score": "^0.5.0",
114
- "@zag-js/dismissable": "^0.35.0",
115
- "@zag-js/dom-query": "^0.35.0",
116
- "@zag-js/utils": "^0.35.0",
117
- "lit": "^3.1.2"
68
+ "@lit/context": "^1.1.1",
69
+ "@prosekit/web": "^0.1.0",
70
+ "lit": "^3.1.3"
118
71
  },
119
72
  "devDependencies": {
120
73
  "@prosekit/dev": "*",
121
74
  "tsup": "^8.0.2",
122
- "typescript": "^5.3.3",
123
- "vitest": "^1.2.2"
75
+ "typescript": "^5.4.5",
76
+ "vitest": "^1.5.0"
124
77
  },
125
78
  "scripts": {
126
79
  "build:tsup": "tsup",
@@ -132,35 +85,11 @@
132
85
  ".": [
133
86
  "./dist/prosekit-lit.d.ts"
134
87
  ],
135
- "autocomplete-empty": [
136
- "./dist/prosekit-lit-autocomplete-empty.d.ts"
137
- ],
138
- "autocomplete-item": [
139
- "./dist/prosekit-lit-autocomplete-item.d.ts"
140
- ],
141
- "autocomplete-list": [
142
- "./dist/prosekit-lit-autocomplete-list.d.ts"
143
- ],
144
- "autocomplete-popover": [
145
- "./dist/prosekit-lit-autocomplete-popover.d.ts"
146
- ],
147
- "block-popover": [
148
- "./dist/prosekit-lit-block-popover.d.ts"
149
- ],
150
- "combo-box": [
151
- "./dist/prosekit-lit-combo-box.d.ts"
152
- ],
153
- "combo-box-input": [
154
- "./dist/prosekit-lit-combo-box-input.d.ts"
155
- ],
156
- "combo-box-item": [
157
- "./dist/prosekit-lit-combo-box-item.d.ts"
158
- ],
159
- "combo-box-list": [
160
- "./dist/prosekit-lit-combo-box-list.d.ts"
88
+ "autocomplete": [
89
+ "./dist/prosekit-lit-autocomplete.d.ts"
161
90
  ],
162
- "drag-handle": [
163
- "./dist/prosekit-lit-drag-handle.d.ts"
91
+ "block-handle": [
92
+ "./dist/prosekit-lit-block-handle.d.ts"
164
93
  ],
165
94
  "inline-popover": [
166
95
  "./dist/prosekit-lit-inline-popover.d.ts"
@@ -171,8 +100,8 @@
171
100
  "resizable": [
172
101
  "./dist/prosekit-lit-resizable.d.ts"
173
102
  ],
174
- "resizable-handle": [
175
- "./dist/prosekit-lit-resizable-handle.d.ts"
103
+ "tooltip": [
104
+ "./dist/prosekit-lit-tooltip.d.ts"
176
105
  ]
177
106
  }
178
107
  }
@@ -1,39 +0,0 @@
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
- /**
19
- * @hidden
20
- */
21
- createRenderRoot() {
22
- return this;
23
- }
24
- /**
25
- * @hidden
26
- */
27
- setHidden(hidden) {
28
- if (this.hidden !== hidden) {
29
- this.hidden = hidden;
30
- const display = this.style.display;
31
- this.style.display = hidden ? "none" : display === "none" ? "" : display;
32
- }
33
- }
34
- };
35
-
36
- export {
37
- defineCustomElement,
38
- LightElement
39
- };
@@ -1,51 +0,0 @@
1
- import {
2
- comboBoxContext
3
- } from "./chunk-C4MW43I4.js";
4
- import {
5
- LightElement,
6
- defineCustomElement
7
- } from "./chunk-3AZDRLDR.js";
8
-
9
- // src/components/combo-box-item/component.ts
10
- import { ContextConsumer } from "@lit/context";
11
- var propNames = ["onSelect"];
12
- var ComboBoxItem = class extends LightElement {
13
- constructor() {
14
- super(...arguments);
15
- this.selected = false;
16
- this.comboBoxContext = new ContextConsumer(this, {
17
- context: comboBoxContext,
18
- subscribe: true
19
- });
20
- }
21
- /**
22
- * @hidden
23
- */
24
- updated(changedProperties) {
25
- var _a, _b, _c, _d, _e;
26
- super.updated(changedProperties);
27
- const content = ((_a = this.textContent) != null ? _a : "").trim();
28
- const query = ((_c = (_b = this.comboBoxContext.value) == null ? void 0 : _b.inputValue) != null ? _c : "").trim();
29
- const match = content.toLowerCase().includes(query.toLowerCase());
30
- this.selected = match && content === ((_d = this.comboBoxContext.value) == null ? void 0 : _d.selectedValue);
31
- this.ariaSelected = String(this.selected);
32
- this.setHidden(!match);
33
- if (this.selected && changedProperties.has("selected") && !changedProperties.get("selected") && ((_e = this.comboBoxContext.value) == null ? void 0 : _e.selectedReason) === "keyboard") {
34
- this.scrollIntoView({ block: "nearest" });
35
- }
36
- }
37
- };
38
- /**
39
- * @hidden
40
- */
41
- ComboBoxItem.properties = {
42
- editor: { attribute: false },
43
- selected: { type: Boolean, reflect: true, attribute: "data-selected" },
44
- onSelect: { attribute: false }
45
- };
46
- defineCustomElement("prosekit-combo-box-item", ComboBoxItem);
47
-
48
- export {
49
- propNames,
50
- ComboBoxItem
51
- };
@@ -1,9 +0,0 @@
1
- // src/components/autocomplete-list/context.ts
2
- import { createContext } from "@lit/context";
3
- var autocompleteListContext = createContext(
4
- "prosekit-autocomplete-list-context"
5
- );
6
-
7
- export {
8
- autocompleteListContext
9
- };
@@ -1,9 +0,0 @@
1
- // src/components/combo-box/context.ts
2
- import { createContext } from "@lit/context";
3
- var comboBoxContext = createContext(
4
- "prosekit-combo-box-context"
5
- );
6
-
7
- export {
8
- comboBoxContext
9
- };