@prosekit/preact 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.
- package/dist/_tsup-dts-rollup.d.ts +73 -82
- package/dist/chunk-5LWA54E4.js +50 -0
- package/dist/chunk-V253IGNY.js +13 -0
- package/dist/prosekit-preact-autocomplete.d.ts +4 -0
- package/dist/prosekit-preact-autocomplete.js +50 -0
- package/dist/prosekit-preact-block-handle.d.ts +2 -0
- package/dist/prosekit-preact-block-handle.js +28 -0
- package/dist/prosekit-preact-inline-popover.d.ts +0 -1
- package/dist/prosekit-preact-inline-popover.js +14 -6
- package/dist/prosekit-preact-popover.d.ts +3 -2
- package/dist/prosekit-preact-popover.js +37 -7
- package/dist/prosekit-preact-resizable.d.ts +2 -2
- package/dist/prosekit-preact-resizable.js +26 -7
- package/dist/prosekit-preact-tooltip.d.ts +3 -0
- package/dist/prosekit-preact-tooltip.js +39 -0
- package/dist/prosekit-preact.js +7 -13
- package/package.json +26 -112
- package/dist/prosekit-preact-autocomplete-empty.d.ts +0 -2
- package/dist/prosekit-preact-autocomplete-empty.js +0 -9
- package/dist/prosekit-preact-autocomplete-item.d.ts +0 -2
- package/dist/prosekit-preact-autocomplete-item.js +0 -9
- package/dist/prosekit-preact-autocomplete-list.d.ts +0 -2
- package/dist/prosekit-preact-autocomplete-list.js +0 -9
- package/dist/prosekit-preact-autocomplete-popover.d.ts +0 -3
- package/dist/prosekit-preact-autocomplete-popover.js +0 -9
- package/dist/prosekit-preact-block-popover.d.ts +0 -2
- package/dist/prosekit-preact-block-popover.js +0 -9
- package/dist/prosekit-preact-combo-box-input.d.ts +0 -2
- package/dist/prosekit-preact-combo-box-input.js +0 -9
- package/dist/prosekit-preact-combo-box-item.d.ts +0 -2
- package/dist/prosekit-preact-combo-box-item.js +0 -9
- package/dist/prosekit-preact-combo-box-list.d.ts +0 -2
- package/dist/prosekit-preact-combo-box-list.js +0 -9
- package/dist/prosekit-preact-combo-box.d.ts +0 -2
- package/dist/prosekit-preact-combo-box.js +0 -9
- package/dist/prosekit-preact-drag-handle.d.ts +0 -2
- package/dist/prosekit-preact-drag-handle.js +0 -9
- package/dist/prosekit-preact-popover-content.d.ts +0 -2
- package/dist/prosekit-preact-popover-content.js +0 -9
- package/dist/prosekit-preact-popover-root.d.ts +0 -2
- package/dist/prosekit-preact-popover-root.js +0 -9
- package/dist/prosekit-preact-popover-trigger.d.ts +0 -2
- package/dist/prosekit-preact-popover-trigger.js +0 -9
- package/dist/prosekit-preact-resizable-handle.d.ts +0 -2
- package/dist/prosekit-preact-resizable-handle.js +0 -9
@@ -1,83 +1,72 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
1
|
+
import { AutocompleteEmptyElement } from '@prosekit/web/autocomplete';
|
2
|
+
import { AutocompleteEmptyProps } from '@prosekit/web/autocomplete';
|
3
|
+
import { AutocompleteItemElement } from '@prosekit/web/autocomplete';
|
4
|
+
import { AutocompleteItemProps } from '@prosekit/web/autocomplete';
|
5
|
+
import { AutocompleteListElement } from '@prosekit/web/autocomplete';
|
6
|
+
import { AutocompleteListProps } from '@prosekit/web/autocomplete';
|
7
|
+
import { AutocompletePopoverElement } from '@prosekit/web/autocomplete';
|
8
|
+
import { AutocompletePopoverProps } from '@prosekit/web/autocomplete';
|
9
|
+
import { BlockDragHandleElement } from '@prosekit/web/block-handle';
|
10
|
+
import { BlockDragHandleProps } from '@prosekit/web/block-handle';
|
11
|
+
import { BlockPopoverElement } from '@prosekit/web/block-handle';
|
12
|
+
import { BlockPopoverProps } from '@prosekit/web/block-handle';
|
10
13
|
import { ComponentChildren } from 'preact';
|
11
14
|
import { ComponentType } from 'preact';
|
12
|
-
import type { DragHandleProps as DragHandleProps_2 } from '@prosekit/lit/drag-handle';
|
13
15
|
import { Editor } from '@prosekit/core';
|
14
16
|
import type { EditorState } from '@prosekit/pm/state';
|
15
17
|
import { Extension } from '@prosekit/core';
|
16
|
-
import
|
18
|
+
import { ForwardRefExoticComponent } from 'preact/compat';
|
19
|
+
import { HTMLAttributes } from 'preact/compat';
|
20
|
+
import { InlinePopoverElement } from '@prosekit/web/inline-popover';
|
21
|
+
import { InlinePopoverProps } from '@prosekit/web/inline-popover';
|
17
22
|
import { Keymap } from '@prosekit/core';
|
18
23
|
import { Options } from 'tsup';
|
19
|
-
import
|
20
|
-
import
|
21
|
-
import
|
22
|
-
import
|
23
|
-
import {
|
24
|
+
import { PopoverContentElement } from '@prosekit/web/popover';
|
25
|
+
import { PopoverContentProps } from '@prosekit/web/popover';
|
26
|
+
import { PopoverRootElement } from '@prosekit/web/popover';
|
27
|
+
import { PopoverRootProps } from '@prosekit/web/popover';
|
28
|
+
import { PopoverTriggerElement } from '@prosekit/web/popover';
|
29
|
+
import { PopoverTriggerProps } from '@prosekit/web/popover';
|
24
30
|
import { Priority } from '@prosekit/core';
|
25
31
|
import type { ProseMirrorNode } from '@prosekit/pm/model';
|
26
32
|
import { Provider } from 'preact';
|
27
|
-
import
|
28
|
-
import
|
29
|
-
|
30
|
-
|
33
|
+
import { RefAttributes } from 'preact/compat';
|
34
|
+
import { ResizableHandleElement } from '@prosekit/web/resizable';
|
35
|
+
import { ResizableHandleProps } from '@prosekit/web/resizable';
|
36
|
+
import { ResizableRootElement } from '@prosekit/web/resizable';
|
37
|
+
import { ResizableRootProps } from '@prosekit/web/resizable';
|
38
|
+
import { TooltipContentElement } from '@prosekit/web/tooltip';
|
39
|
+
import { TooltipContentProps } from '@prosekit/web/tooltip';
|
40
|
+
import { TooltipRootElement } from '@prosekit/web/tooltip';
|
41
|
+
import { TooltipRootProps } from '@prosekit/web/tooltip';
|
42
|
+
import { TooltipTriggerElement } from '@prosekit/web/tooltip';
|
43
|
+
import { TooltipTriggerProps } from '@prosekit/web/tooltip';
|
44
|
+
|
45
|
+
declare const AutocompleteEmpty: ForwardRefExoticComponent<Partial<AutocompleteEmptyProps> & RefAttributes<AutocompleteEmptyElement> & HTMLAttributes<AutocompleteEmptyElement>>;
|
31
46
|
export { AutocompleteEmpty }
|
32
47
|
export { AutocompleteEmpty as AutocompleteEmpty_alias_1 }
|
33
48
|
|
34
|
-
declare
|
35
|
-
export { AutocompleteEmptyProps }
|
36
|
-
export { AutocompleteEmptyProps as AutocompleteEmptyProps_alias_1 }
|
37
|
-
|
38
|
-
declare const AutocompleteItem: ComponentType<AutocompleteItemProps>;
|
49
|
+
declare const AutocompleteItem: ForwardRefExoticComponent<Partial<AutocompleteItemProps> & RefAttributes<AutocompleteItemElement> & HTMLAttributes<AutocompleteItemElement>>;
|
39
50
|
export { AutocompleteItem }
|
40
51
|
export { AutocompleteItem as AutocompleteItem_alias_1 }
|
41
52
|
|
42
|
-
declare
|
43
|
-
export { AutocompleteItemProps }
|
44
|
-
export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
|
45
|
-
|
46
|
-
declare const AutocompleteList: ComponentType<AutocompleteListProps>;
|
53
|
+
declare const AutocompleteList: ForwardRefExoticComponent<Partial<AutocompleteListProps> & RefAttributes<AutocompleteListElement> & HTMLAttributes<AutocompleteListElement>>;
|
47
54
|
export { AutocompleteList }
|
48
55
|
export { AutocompleteList as AutocompleteList_alias_1 }
|
49
56
|
|
50
|
-
declare
|
51
|
-
export { AutocompleteListProps }
|
52
|
-
export { AutocompleteListProps as AutocompleteListProps_alias_1 }
|
53
|
-
|
54
|
-
declare const AutocompletePopover: ComponentType<AutocompletePopoverProps>;
|
57
|
+
declare const AutocompletePopover: ForwardRefExoticComponent<Partial<AutocompletePopoverProps> & RefAttributes<AutocompletePopoverElement> & HTMLAttributes<AutocompletePopoverElement>>;
|
55
58
|
export { AutocompletePopover }
|
56
59
|
export { AutocompletePopover as AutocompletePopover_alias_1 }
|
57
60
|
|
58
|
-
declare
|
59
|
-
export {
|
60
|
-
export {
|
61
|
-
|
62
|
-
export declare const BlockPopover: ComponentType<BlockPopoverProps>;
|
63
|
-
|
64
|
-
export declare type BlockPopoverProps = PropsWithChildren<PropsWithClass<BlockPopoverProps_2>>;
|
65
|
-
|
66
|
-
export declare const ComboBox: ComponentType<ComboBoxProps>;
|
67
|
-
|
68
|
-
export declare const ComboBoxInput: ComponentType<ComboBoxInputProps>;
|
69
|
-
|
70
|
-
export declare type ComboBoxInputProps = PropsWithChildren<PropsWithClass<ComboBoxInputProps_2>>;
|
71
|
-
|
72
|
-
export declare const ComboBoxItem: ComponentType<ComboBoxItemProps>;
|
73
|
-
|
74
|
-
export declare type ComboBoxItemProps = PropsWithChildren<PropsWithClass<ComboBoxItemProps_2>>;
|
61
|
+
declare const BlockDragHandle: ForwardRefExoticComponent<Partial<BlockDragHandleProps> & RefAttributes<BlockDragHandleElement> & HTMLAttributes<BlockDragHandleElement>>;
|
62
|
+
export { BlockDragHandle }
|
63
|
+
export { BlockDragHandle as BlockDragHandle_alias_1 }
|
75
64
|
|
76
|
-
|
65
|
+
declare const BlockPopover: ForwardRefExoticComponent<Partial<BlockPopoverProps> & RefAttributes<BlockPopoverElement> & HTMLAttributes<BlockPopoverElement>>;
|
66
|
+
export { BlockPopover }
|
67
|
+
export { BlockPopover as BlockPopover_alias_1 }
|
77
68
|
|
78
|
-
export declare
|
79
|
-
|
80
|
-
export declare type ComboBoxProps = PropsWithChildren<PropsWithClass<ComboBoxProps_2>>;
|
69
|
+
export declare function createComponent<Props extends object, CustomElement extends HTMLElement>(tagName: string, displayName: string, defaultProps: Props): ForwardRefExoticComponent<Partial<Props> & RefAttributes<CustomElement> & HTMLAttributes<CustomElement>>;
|
81
70
|
|
82
71
|
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
83
72
|
|
@@ -87,36 +76,26 @@ export declare const default_alias_1: {
|
|
87
76
|
};
|
88
77
|
};
|
89
78
|
|
90
|
-
export declare const DragHandle: ComponentType<DragHandleProps>;
|
91
|
-
|
92
|
-
export declare type DragHandleProps = PropsWithChildren<PropsWithClass<DragHandleProps_2>>;
|
93
|
-
|
94
79
|
/**
|
95
80
|
* @internal
|
96
81
|
*/
|
97
82
|
export declare const EditorContextProvider: Provider<Editor<any> | null>;
|
98
83
|
|
99
|
-
|
100
|
-
|
101
|
-
export
|
102
|
-
|
103
|
-
export declare const Popover: ComponentType<PopoverProps>;
|
104
|
-
|
105
|
-
export declare const PopoverContent: ComponentType<PopoverContentProps>;
|
84
|
+
declare const InlinePopover: ForwardRefExoticComponent<Partial<InlinePopoverProps> & RefAttributes<InlinePopoverElement> & HTMLAttributes<InlinePopoverElement>>;
|
85
|
+
export { InlinePopover }
|
86
|
+
export { InlinePopover as InlinePopover_alias_1 }
|
106
87
|
|
107
|
-
|
88
|
+
declare const PopoverContent: ForwardRefExoticComponent<Partial<PopoverContentProps> & RefAttributes<PopoverContentElement> & HTMLAttributes<PopoverContentElement>>;
|
89
|
+
export { PopoverContent }
|
90
|
+
export { PopoverContent as PopoverContent_alias_1 }
|
108
91
|
|
109
|
-
|
92
|
+
declare const PopoverRoot: ForwardRefExoticComponent<Partial<PopoverRootProps> & RefAttributes<PopoverRootElement> & HTMLAttributes<PopoverRootElement>>;
|
93
|
+
export { PopoverRoot }
|
94
|
+
export { PopoverRoot as PopoverRoot_alias_1 }
|
110
95
|
|
111
|
-
|
112
|
-
|
113
|
-
export
|
114
|
-
|
115
|
-
export declare const PopoverTrigger: ComponentType<PopoverTriggerProps>;
|
116
|
-
|
117
|
-
export declare type PopoverTriggerProps = PropsWithChildren<PropsWithClass<PopoverTriggerProps_2>>;
|
118
|
-
|
119
|
-
export { PositioningOptions }
|
96
|
+
declare const PopoverTrigger: ForwardRefExoticComponent<Partial<PopoverTriggerProps> & RefAttributes<PopoverTriggerElement> & HTMLAttributes<PopoverTriggerElement>>;
|
97
|
+
export { PopoverTrigger }
|
98
|
+
export { PopoverTrigger as PopoverTrigger_alias_1 }
|
120
99
|
|
121
100
|
/**
|
122
101
|
* @internal
|
@@ -153,13 +132,25 @@ declare interface ProseKitProps {
|
|
153
132
|
export { ProseKitProps }
|
154
133
|
export { ProseKitProps as ProseKitProps_alias_1 }
|
155
134
|
|
156
|
-
|
135
|
+
declare const ResizableHandle: ForwardRefExoticComponent<Partial<ResizableHandleProps> & RefAttributes<ResizableHandleElement> & HTMLAttributes<ResizableHandleElement>>;
|
136
|
+
export { ResizableHandle }
|
137
|
+
export { ResizableHandle as ResizableHandle_alias_1 }
|
138
|
+
|
139
|
+
declare const ResizableRoot: ForwardRefExoticComponent<Partial<ResizableRootProps> & RefAttributes<ResizableRootElement> & HTMLAttributes<ResizableRootElement>>;
|
140
|
+
export { ResizableRoot }
|
141
|
+
export { ResizableRoot as ResizableRoot_alias_1 }
|
157
142
|
|
158
|
-
|
143
|
+
declare const TooltipContent: ForwardRefExoticComponent<Partial<TooltipContentProps> & RefAttributes<TooltipContentElement> & HTMLAttributes<TooltipContentElement>>;
|
144
|
+
export { TooltipContent }
|
145
|
+
export { TooltipContent as TooltipContent_alias_1 }
|
159
146
|
|
160
|
-
|
147
|
+
declare const TooltipRoot: ForwardRefExoticComponent<Partial<TooltipRootProps> & RefAttributes<TooltipRootElement> & HTMLAttributes<TooltipRootElement>>;
|
148
|
+
export { TooltipRoot }
|
149
|
+
export { TooltipRoot as TooltipRoot_alias_1 }
|
161
150
|
|
162
|
-
|
151
|
+
declare const TooltipTrigger: ForwardRefExoticComponent<Partial<TooltipTriggerProps> & RefAttributes<TooltipTriggerElement> & HTMLAttributes<TooltipTriggerElement>>;
|
152
|
+
export { TooltipTrigger }
|
153
|
+
export { TooltipTrigger as TooltipTrigger_alias_1 }
|
163
154
|
|
164
155
|
/**
|
165
156
|
* Calls the given handler whenever the editor document changes.
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import {
|
2
|
+
useEditorContext
|
3
|
+
} from "./chunk-V253IGNY.js";
|
4
|
+
|
5
|
+
// src/components/create-component.ts
|
6
|
+
import { createElement } from "preact";
|
7
|
+
import {
|
8
|
+
forwardRef
|
9
|
+
} from "preact/compat";
|
10
|
+
import { useLayoutEffect, useState } from "preact/hooks";
|
11
|
+
import { mergeRefs } from "react-merge-refs";
|
12
|
+
function createComponent(tagName, displayName, defaultProps) {
|
13
|
+
const propertyNames = Object.keys(defaultProps);
|
14
|
+
const hasEditor = Object.hasOwn(defaultProps, "editor");
|
15
|
+
const Component = forwardRef((props, ref) => {
|
16
|
+
const [el, setEl] = useState(null);
|
17
|
+
const properties = {};
|
18
|
+
const attributes = {};
|
19
|
+
for (const [name, value] of Object.entries(props)) {
|
20
|
+
if (propertyNames.includes(name)) {
|
21
|
+
properties[name] = value;
|
22
|
+
} else {
|
23
|
+
attributes[name === "className" ? "class" : name] = value;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
const editor = useEditorContext();
|
27
|
+
if (hasEditor && editor && !properties["editor"]) {
|
28
|
+
properties["editor"] = editor;
|
29
|
+
}
|
30
|
+
useLayoutEffect(() => {
|
31
|
+
if (el) {
|
32
|
+
for (const [name, value] of Object.entries(properties)) {
|
33
|
+
if (value !== void 0) {
|
34
|
+
el[name] = value;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}, [el, ...propertyNames.map((name) => properties[name])]);
|
39
|
+
return createElement(tagName, {
|
40
|
+
...attributes,
|
41
|
+
ref: mergeRefs([ref, setEl])
|
42
|
+
});
|
43
|
+
});
|
44
|
+
Component.displayName = displayName;
|
45
|
+
return Component;
|
46
|
+
}
|
47
|
+
|
48
|
+
export {
|
49
|
+
createComponent
|
50
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// src/contexts/editor-context.ts
|
2
|
+
import { createContext } from "preact";
|
3
|
+
import { useContext } from "preact/hooks";
|
4
|
+
var editorContext = createContext(null);
|
5
|
+
function useEditorContext() {
|
6
|
+
return useContext(editorContext);
|
7
|
+
}
|
8
|
+
var EditorContextProvider = editorContext.Provider;
|
9
|
+
|
10
|
+
export {
|
11
|
+
useEditorContext,
|
12
|
+
EditorContextProvider
|
13
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export { AutocompleteEmpty_alias_1 as AutocompleteEmpty } from './_tsup-dts-rollup';
|
2
|
+
export { AutocompleteItem_alias_1 as AutocompleteItem } from './_tsup-dts-rollup';
|
3
|
+
export { AutocompleteList_alias_1 as AutocompleteList } from './_tsup-dts-rollup';
|
4
|
+
export { AutocompletePopover_alias_1 as AutocompletePopover } from './_tsup-dts-rollup';
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/autocomplete/autocomplete-empty.gen.ts
|
7
|
+
import {
|
8
|
+
defaultAutocompleteEmptyProps
|
9
|
+
} from "@prosekit/web/autocomplete";
|
10
|
+
var AutocompleteEmpty = createComponent(
|
11
|
+
"prosekit-autocomplete-empty",
|
12
|
+
"AutocompleteEmpty",
|
13
|
+
defaultAutocompleteEmptyProps
|
14
|
+
);
|
15
|
+
|
16
|
+
// src/components/autocomplete/autocomplete-item.gen.ts
|
17
|
+
import {
|
18
|
+
defaultAutocompleteItemProps
|
19
|
+
} from "@prosekit/web/autocomplete";
|
20
|
+
var AutocompleteItem = createComponent(
|
21
|
+
"prosekit-autocomplete-item",
|
22
|
+
"AutocompleteItem",
|
23
|
+
defaultAutocompleteItemProps
|
24
|
+
);
|
25
|
+
|
26
|
+
// src/components/autocomplete/autocomplete-list.gen.ts
|
27
|
+
import {
|
28
|
+
defaultAutocompleteListProps
|
29
|
+
} from "@prosekit/web/autocomplete";
|
30
|
+
var AutocompleteList = createComponent(
|
31
|
+
"prosekit-autocomplete-list",
|
32
|
+
"AutocompleteList",
|
33
|
+
defaultAutocompleteListProps
|
34
|
+
);
|
35
|
+
|
36
|
+
// src/components/autocomplete/autocomplete-popover.gen.ts
|
37
|
+
import {
|
38
|
+
defaultAutocompletePopoverProps
|
39
|
+
} from "@prosekit/web/autocomplete";
|
40
|
+
var AutocompletePopover = createComponent(
|
41
|
+
"prosekit-autocomplete-popover",
|
42
|
+
"AutocompletePopover",
|
43
|
+
defaultAutocompletePopoverProps
|
44
|
+
);
|
45
|
+
export {
|
46
|
+
AutocompleteEmpty,
|
47
|
+
AutocompleteItem,
|
48
|
+
AutocompleteList,
|
49
|
+
AutocompletePopover
|
50
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/block-handle/block-drag-handle.gen.ts
|
7
|
+
import {
|
8
|
+
defaultBlockDragHandleProps
|
9
|
+
} from "@prosekit/web/block-handle";
|
10
|
+
var BlockDragHandle = createComponent(
|
11
|
+
"prosekit-block-drag-handle",
|
12
|
+
"BlockDragHandle",
|
13
|
+
defaultBlockDragHandleProps
|
14
|
+
);
|
15
|
+
|
16
|
+
// src/components/block-handle/block-popover.gen.ts
|
17
|
+
import {
|
18
|
+
defaultBlockPopoverProps
|
19
|
+
} from "@prosekit/web/block-handle";
|
20
|
+
var BlockPopover = createComponent(
|
21
|
+
"prosekit-block-popover",
|
22
|
+
"BlockPopover",
|
23
|
+
defaultBlockPopoverProps
|
24
|
+
);
|
25
|
+
export {
|
26
|
+
BlockDragHandle,
|
27
|
+
BlockPopover
|
28
|
+
};
|
@@ -1,9 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/inline-popover/inline-popover.gen.ts
|
7
|
+
import {
|
8
|
+
defaultInlinePopoverProps
|
9
|
+
} from "@prosekit/web/inline-popover";
|
10
|
+
var InlinePopover = createComponent(
|
11
|
+
"prosekit-inline-popover",
|
12
|
+
"InlinePopover",
|
13
|
+
defaultInlinePopoverProps
|
14
|
+
);
|
7
15
|
export {
|
8
16
|
InlinePopover
|
9
17
|
};
|
@@ -1,2 +1,3 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
1
|
+
export { PopoverContent } from './_tsup-dts-rollup';
|
2
|
+
export { PopoverRoot } from './_tsup-dts-rollup';
|
3
|
+
export { PopoverTrigger } from './_tsup-dts-rollup';
|
@@ -1,9 +1,39 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/popover/popover-content.gen.ts
|
7
|
+
import {
|
8
|
+
defaultPopoverContentProps
|
9
|
+
} from "@prosekit/web/popover";
|
10
|
+
var PopoverContent = createComponent(
|
11
|
+
"prosekit-popover-content",
|
12
|
+
"PopoverContent",
|
13
|
+
defaultPopoverContentProps
|
14
|
+
);
|
15
|
+
|
16
|
+
// src/components/popover/popover-root.gen.ts
|
17
|
+
import {
|
18
|
+
defaultPopoverRootProps
|
19
|
+
} from "@prosekit/web/popover";
|
20
|
+
var PopoverRoot = createComponent(
|
21
|
+
"prosekit-popover-root",
|
22
|
+
"PopoverRoot",
|
23
|
+
defaultPopoverRootProps
|
24
|
+
);
|
25
|
+
|
26
|
+
// src/components/popover/popover-trigger.gen.ts
|
27
|
+
import {
|
28
|
+
defaultPopoverTriggerProps
|
29
|
+
} from "@prosekit/web/popover";
|
30
|
+
var PopoverTrigger = createComponent(
|
31
|
+
"prosekit-popover-trigger",
|
32
|
+
"PopoverTrigger",
|
33
|
+
defaultPopoverTriggerProps
|
34
|
+
);
|
7
35
|
export {
|
8
|
-
|
36
|
+
PopoverContent,
|
37
|
+
PopoverRoot,
|
38
|
+
PopoverTrigger
|
9
39
|
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
1
|
+
export { ResizableHandle } from './_tsup-dts-rollup';
|
2
|
+
export { ResizableRoot } from './_tsup-dts-rollup';
|
@@ -1,9 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/resizable/resizable-handle.gen.ts
|
7
|
+
import {
|
8
|
+
defaultResizableHandleProps
|
9
|
+
} from "@prosekit/web/resizable";
|
10
|
+
var ResizableHandle = createComponent(
|
11
|
+
"prosekit-resizable-handle",
|
12
|
+
"ResizableHandle",
|
13
|
+
defaultResizableHandleProps
|
14
|
+
);
|
15
|
+
|
16
|
+
// src/components/resizable/resizable-root.gen.ts
|
17
|
+
import {
|
18
|
+
defaultResizableRootProps
|
19
|
+
} from "@prosekit/web/resizable";
|
20
|
+
var ResizableRoot = createComponent(
|
21
|
+
"prosekit-resizable-root",
|
22
|
+
"ResizableRoot",
|
23
|
+
defaultResizableRootProps
|
24
|
+
);
|
7
25
|
export {
|
8
|
-
|
26
|
+
ResizableHandle,
|
27
|
+
ResizableRoot
|
9
28
|
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import {
|
2
|
+
createComponent
|
3
|
+
} from "./chunk-5LWA54E4.js";
|
4
|
+
import "./chunk-V253IGNY.js";
|
5
|
+
|
6
|
+
// src/components/tooltip/tooltip-content.gen.ts
|
7
|
+
import {
|
8
|
+
defaultTooltipContentProps
|
9
|
+
} from "@prosekit/web/tooltip";
|
10
|
+
var TooltipContent = createComponent(
|
11
|
+
"prosekit-tooltip-content",
|
12
|
+
"TooltipContent",
|
13
|
+
defaultTooltipContentProps
|
14
|
+
);
|
15
|
+
|
16
|
+
// src/components/tooltip/tooltip-root.gen.ts
|
17
|
+
import {
|
18
|
+
defaultTooltipRootProps
|
19
|
+
} from "@prosekit/web/tooltip";
|
20
|
+
var TooltipRoot = createComponent(
|
21
|
+
"prosekit-tooltip-root",
|
22
|
+
"TooltipRoot",
|
23
|
+
defaultTooltipRootProps
|
24
|
+
);
|
25
|
+
|
26
|
+
// src/components/tooltip/tooltip-trigger.gen.ts
|
27
|
+
import {
|
28
|
+
defaultTooltipTriggerProps
|
29
|
+
} from "@prosekit/web/tooltip";
|
30
|
+
var TooltipTrigger = createComponent(
|
31
|
+
"prosekit-tooltip-trigger",
|
32
|
+
"TooltipTrigger",
|
33
|
+
defaultTooltipTriggerProps
|
34
|
+
);
|
35
|
+
export {
|
36
|
+
TooltipContent,
|
37
|
+
TooltipRoot,
|
38
|
+
TooltipTrigger
|
39
|
+
};
|
package/dist/prosekit-preact.js
CHANGED
@@ -1,16 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
import { createContext } from "preact";
|
6
|
-
import { useContext } from "preact/hooks";
|
7
|
-
var editorContext = createContext(null);
|
8
|
-
function useEditorContext() {
|
9
|
-
return useContext(editorContext);
|
10
|
-
}
|
11
|
-
var EditorContextProvider = editorContext.Provider;
|
1
|
+
import {
|
2
|
+
EditorContextProvider,
|
3
|
+
useEditorContext
|
4
|
+
} from "./chunk-V253IGNY.js";
|
12
5
|
|
13
6
|
// src/components/prosekit.ts
|
7
|
+
import { h } from "preact";
|
14
8
|
var ProseKit = (props) => {
|
15
9
|
const { editor, children } = props;
|
16
10
|
return h(EditorContextProvider, { value: editor, children });
|
@@ -78,9 +72,9 @@ function usePriorityExtension(extension, priority) {
|
|
78
72
|
|
79
73
|
// src/hooks/use-extension.ts
|
80
74
|
function useExtension(extension, options) {
|
81
|
-
const
|
75
|
+
const editorContext = useEditorContext();
|
82
76
|
useEditorExtension(
|
83
|
-
(options == null ? void 0 : options.editor) ||
|
77
|
+
(options == null ? void 0 : options.editor) || editorContext,
|
84
78
|
usePriorityExtension(extension, options == null ? void 0 : options.priority)
|
85
79
|
);
|
86
80
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/preact",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
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-preact.js",
|
31
31
|
"default": "./dist/prosekit-preact.js"
|
32
32
|
},
|
33
|
-
"./autocomplete
|
34
|
-
"types": "./dist/prosekit-preact-autocomplete
|
35
|
-
"import": "./dist/prosekit-preact-autocomplete
|
36
|
-
"default": "./dist/prosekit-preact-autocomplete
|
33
|
+
"./autocomplete": {
|
34
|
+
"types": "./dist/prosekit-preact-autocomplete.d.ts",
|
35
|
+
"import": "./dist/prosekit-preact-autocomplete.js",
|
36
|
+
"default": "./dist/prosekit-preact-autocomplete.js"
|
37
37
|
},
|
38
|
-
"./
|
39
|
-
"types": "./dist/prosekit-preact-
|
40
|
-
"import": "./dist/prosekit-preact-
|
41
|
-
"default": "./dist/prosekit-preact-
|
42
|
-
},
|
43
|
-
"./autocomplete-list": {
|
44
|
-
"types": "./dist/prosekit-preact-autocomplete-list.d.ts",
|
45
|
-
"import": "./dist/prosekit-preact-autocomplete-list.js",
|
46
|
-
"default": "./dist/prosekit-preact-autocomplete-list.js"
|
47
|
-
},
|
48
|
-
"./autocomplete-popover": {
|
49
|
-
"types": "./dist/prosekit-preact-autocomplete-popover.d.ts",
|
50
|
-
"import": "./dist/prosekit-preact-autocomplete-popover.js",
|
51
|
-
"default": "./dist/prosekit-preact-autocomplete-popover.js"
|
52
|
-
},
|
53
|
-
"./block-popover": {
|
54
|
-
"types": "./dist/prosekit-preact-block-popover.d.ts",
|
55
|
-
"import": "./dist/prosekit-preact-block-popover.js",
|
56
|
-
"default": "./dist/prosekit-preact-block-popover.js"
|
57
|
-
},
|
58
|
-
"./combo-box": {
|
59
|
-
"types": "./dist/prosekit-preact-combo-box.d.ts",
|
60
|
-
"import": "./dist/prosekit-preact-combo-box.js",
|
61
|
-
"default": "./dist/prosekit-preact-combo-box.js"
|
62
|
-
},
|
63
|
-
"./combo-box-input": {
|
64
|
-
"types": "./dist/prosekit-preact-combo-box-input.d.ts",
|
65
|
-
"import": "./dist/prosekit-preact-combo-box-input.js",
|
66
|
-
"default": "./dist/prosekit-preact-combo-box-input.js"
|
67
|
-
},
|
68
|
-
"./combo-box-item": {
|
69
|
-
"types": "./dist/prosekit-preact-combo-box-item.d.ts",
|
70
|
-
"import": "./dist/prosekit-preact-combo-box-item.js",
|
71
|
-
"default": "./dist/prosekit-preact-combo-box-item.js"
|
72
|
-
},
|
73
|
-
"./combo-box-list": {
|
74
|
-
"types": "./dist/prosekit-preact-combo-box-list.d.ts",
|
75
|
-
"import": "./dist/prosekit-preact-combo-box-list.js",
|
76
|
-
"default": "./dist/prosekit-preact-combo-box-list.js"
|
77
|
-
},
|
78
|
-
"./drag-handle": {
|
79
|
-
"types": "./dist/prosekit-preact-drag-handle.d.ts",
|
80
|
-
"import": "./dist/prosekit-preact-drag-handle.js",
|
81
|
-
"default": "./dist/prosekit-preact-drag-handle.js"
|
38
|
+
"./block-handle": {
|
39
|
+
"types": "./dist/prosekit-preact-block-handle.d.ts",
|
40
|
+
"import": "./dist/prosekit-preact-block-handle.js",
|
41
|
+
"default": "./dist/prosekit-preact-block-handle.js"
|
82
42
|
},
|
83
43
|
"./inline-popover": {
|
84
44
|
"types": "./dist/prosekit-preact-inline-popover.d.ts",
|
@@ -90,30 +50,15 @@
|
|
90
50
|
"import": "./dist/prosekit-preact-popover.js",
|
91
51
|
"default": "./dist/prosekit-preact-popover.js"
|
92
52
|
},
|
93
|
-
"./popover-content": {
|
94
|
-
"types": "./dist/prosekit-preact-popover-content.d.ts",
|
95
|
-
"import": "./dist/prosekit-preact-popover-content.js",
|
96
|
-
"default": "./dist/prosekit-preact-popover-content.js"
|
97
|
-
},
|
98
|
-
"./popover-root": {
|
99
|
-
"types": "./dist/prosekit-preact-popover-root.d.ts",
|
100
|
-
"import": "./dist/prosekit-preact-popover-root.js",
|
101
|
-
"default": "./dist/prosekit-preact-popover-root.js"
|
102
|
-
},
|
103
|
-
"./popover-trigger": {
|
104
|
-
"types": "./dist/prosekit-preact-popover-trigger.d.ts",
|
105
|
-
"import": "./dist/prosekit-preact-popover-trigger.js",
|
106
|
-
"default": "./dist/prosekit-preact-popover-trigger.js"
|
107
|
-
},
|
108
53
|
"./resizable": {
|
109
54
|
"types": "./dist/prosekit-preact-resizable.d.ts",
|
110
55
|
"import": "./dist/prosekit-preact-resizable.js",
|
111
56
|
"default": "./dist/prosekit-preact-resizable.js"
|
112
57
|
},
|
113
|
-
"./
|
114
|
-
"types": "./dist/prosekit-preact-
|
115
|
-
"import": "./dist/prosekit-preact-
|
116
|
-
"default": "./dist/prosekit-preact-
|
58
|
+
"./tooltip": {
|
59
|
+
"types": "./dist/prosekit-preact-tooltip.d.ts",
|
60
|
+
"import": "./dist/prosekit-preact-tooltip.js",
|
61
|
+
"default": "./dist/prosekit-preact-tooltip.js"
|
117
62
|
}
|
118
63
|
},
|
119
64
|
"files": [
|
@@ -121,8 +66,10 @@
|
|
121
66
|
],
|
122
67
|
"dependencies": {
|
123
68
|
"@prosekit/core": "^0.4.0",
|
124
|
-
"@prosekit/lit": "^0.
|
125
|
-
"@prosekit/pm": "^0.1.2"
|
69
|
+
"@prosekit/lit": "^0.3.0",
|
70
|
+
"@prosekit/pm": "^0.1.2",
|
71
|
+
"@prosekit/web": "^0.1.0",
|
72
|
+
"react-merge-refs": "^2.1.1"
|
126
73
|
},
|
127
74
|
"peerDependencies": {
|
128
75
|
"preact": ">= 9.0.0"
|
@@ -134,10 +81,10 @@
|
|
134
81
|
},
|
135
82
|
"devDependencies": {
|
136
83
|
"@prosekit/dev": "*",
|
137
|
-
"preact": "^10.20.
|
84
|
+
"preact": "^10.20.2",
|
138
85
|
"tsup": "^8.0.2",
|
139
|
-
"typescript": "^5.4.
|
140
|
-
"vitest": "^1.
|
86
|
+
"typescript": "^5.4.5",
|
87
|
+
"vitest": "^1.5.0"
|
141
88
|
},
|
142
89
|
"scripts": {
|
143
90
|
"build:tsup": "tsup",
|
@@ -149,35 +96,11 @@
|
|
149
96
|
".": [
|
150
97
|
"./dist/prosekit-preact.d.ts"
|
151
98
|
],
|
152
|
-
"autocomplete
|
153
|
-
"./dist/prosekit-preact-autocomplete
|
99
|
+
"autocomplete": [
|
100
|
+
"./dist/prosekit-preact-autocomplete.d.ts"
|
154
101
|
],
|
155
|
-
"
|
156
|
-
"./dist/prosekit-preact-
|
157
|
-
],
|
158
|
-
"autocomplete-list": [
|
159
|
-
"./dist/prosekit-preact-autocomplete-list.d.ts"
|
160
|
-
],
|
161
|
-
"autocomplete-popover": [
|
162
|
-
"./dist/prosekit-preact-autocomplete-popover.d.ts"
|
163
|
-
],
|
164
|
-
"block-popover": [
|
165
|
-
"./dist/prosekit-preact-block-popover.d.ts"
|
166
|
-
],
|
167
|
-
"combo-box": [
|
168
|
-
"./dist/prosekit-preact-combo-box.d.ts"
|
169
|
-
],
|
170
|
-
"combo-box-input": [
|
171
|
-
"./dist/prosekit-preact-combo-box-input.d.ts"
|
172
|
-
],
|
173
|
-
"combo-box-item": [
|
174
|
-
"./dist/prosekit-preact-combo-box-item.d.ts"
|
175
|
-
],
|
176
|
-
"combo-box-list": [
|
177
|
-
"./dist/prosekit-preact-combo-box-list.d.ts"
|
178
|
-
],
|
179
|
-
"drag-handle": [
|
180
|
-
"./dist/prosekit-preact-drag-handle.d.ts"
|
102
|
+
"block-handle": [
|
103
|
+
"./dist/prosekit-preact-block-handle.d.ts"
|
181
104
|
],
|
182
105
|
"inline-popover": [
|
183
106
|
"./dist/prosekit-preact-inline-popover.d.ts"
|
@@ -185,20 +108,11 @@
|
|
185
108
|
"popover": [
|
186
109
|
"./dist/prosekit-preact-popover.d.ts"
|
187
110
|
],
|
188
|
-
"popover-content": [
|
189
|
-
"./dist/prosekit-preact-popover-content.d.ts"
|
190
|
-
],
|
191
|
-
"popover-root": [
|
192
|
-
"./dist/prosekit-preact-popover-root.d.ts"
|
193
|
-
],
|
194
|
-
"popover-trigger": [
|
195
|
-
"./dist/prosekit-preact-popover-trigger.d.ts"
|
196
|
-
],
|
197
111
|
"resizable": [
|
198
112
|
"./dist/prosekit-preact-resizable.d.ts"
|
199
113
|
],
|
200
|
-
"
|
201
|
-
"./dist/prosekit-preact-
|
114
|
+
"tooltip": [
|
115
|
+
"./dist/prosekit-preact-tooltip.d.ts"
|
202
116
|
]
|
203
117
|
}
|
204
118
|
}
|