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