@prosekit/preact 0.2.6 → 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 -67
- 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 -88
- 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-resizable-handle.d.ts +0 -2
- package/dist/prosekit-preact-resizable-handle.js +0 -9
@@ -1,80 +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 {
|
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';
|
21
30
|
import { Priority } from '@prosekit/core';
|
22
31
|
import type { ProseMirrorNode } from '@prosekit/pm/model';
|
23
32
|
import { Provider } from 'preact';
|
24
|
-
import
|
25
|
-
import
|
26
|
-
|
27
|
-
|
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>>;
|
28
46
|
export { AutocompleteEmpty }
|
29
47
|
export { AutocompleteEmpty as AutocompleteEmpty_alias_1 }
|
30
48
|
|
31
|
-
declare
|
32
|
-
export { AutocompleteEmptyProps }
|
33
|
-
export { AutocompleteEmptyProps as AutocompleteEmptyProps_alias_1 }
|
34
|
-
|
35
|
-
declare const AutocompleteItem: ComponentType<AutocompleteItemProps>;
|
49
|
+
declare const AutocompleteItem: ForwardRefExoticComponent<Partial<AutocompleteItemProps> & RefAttributes<AutocompleteItemElement> & HTMLAttributes<AutocompleteItemElement>>;
|
36
50
|
export { AutocompleteItem }
|
37
51
|
export { AutocompleteItem as AutocompleteItem_alias_1 }
|
38
52
|
|
39
|
-
declare
|
40
|
-
export { AutocompleteItemProps }
|
41
|
-
export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
|
42
|
-
|
43
|
-
declare const AutocompleteList: ComponentType<AutocompleteListProps>;
|
53
|
+
declare const AutocompleteList: ForwardRefExoticComponent<Partial<AutocompleteListProps> & RefAttributes<AutocompleteListElement> & HTMLAttributes<AutocompleteListElement>>;
|
44
54
|
export { AutocompleteList }
|
45
55
|
export { AutocompleteList as AutocompleteList_alias_1 }
|
46
56
|
|
47
|
-
declare
|
48
|
-
export { AutocompleteListProps }
|
49
|
-
export { AutocompleteListProps as AutocompleteListProps_alias_1 }
|
50
|
-
|
51
|
-
declare const AutocompletePopover: ComponentType<AutocompletePopoverProps>;
|
57
|
+
declare const AutocompletePopover: ForwardRefExoticComponent<Partial<AutocompletePopoverProps> & RefAttributes<AutocompletePopoverElement> & HTMLAttributes<AutocompletePopoverElement>>;
|
52
58
|
export { AutocompletePopover }
|
53
59
|
export { AutocompletePopover as AutocompletePopover_alias_1 }
|
54
60
|
|
55
|
-
declare
|
56
|
-
export {
|
57
|
-
export {
|
58
|
-
|
59
|
-
export declare const BlockPopover: ComponentType<BlockPopoverProps>;
|
60
|
-
|
61
|
-
export declare type BlockPopoverProps = PropsWithChildren<PropsWithClass<BlockPopoverProps_2>>;
|
62
|
-
|
63
|
-
export declare const ComboBox: ComponentType<ComboBoxProps>;
|
64
|
-
|
65
|
-
export declare const ComboBoxInput: ComponentType<ComboBoxInputProps>;
|
61
|
+
declare const BlockDragHandle: ForwardRefExoticComponent<Partial<BlockDragHandleProps> & RefAttributes<BlockDragHandleElement> & HTMLAttributes<BlockDragHandleElement>>;
|
62
|
+
export { BlockDragHandle }
|
63
|
+
export { BlockDragHandle as BlockDragHandle_alias_1 }
|
66
64
|
|
67
|
-
|
65
|
+
declare const BlockPopover: ForwardRefExoticComponent<Partial<BlockPopoverProps> & RefAttributes<BlockPopoverElement> & HTMLAttributes<BlockPopoverElement>>;
|
66
|
+
export { BlockPopover }
|
67
|
+
export { BlockPopover as BlockPopover_alias_1 }
|
68
68
|
|
69
|
-
export declare
|
70
|
-
|
71
|
-
export declare type ComboBoxItemProps = PropsWithChildren<PropsWithClass<ComboBoxItemProps_2>>;
|
72
|
-
|
73
|
-
export declare const ComboBoxList: ComponentType<ComboBoxListProps>;
|
74
|
-
|
75
|
-
export declare type ComboBoxListProps = PropsWithChildren<PropsWithClass<ComboBoxListProps_2>>;
|
76
|
-
|
77
|
-
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>>;
|
78
70
|
|
79
71
|
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
80
72
|
|
@@ -84,24 +76,26 @@ export declare const default_alias_1: {
|
|
84
76
|
};
|
85
77
|
};
|
86
78
|
|
87
|
-
export declare const DragHandle: ComponentType<DragHandleProps>;
|
88
|
-
|
89
|
-
export declare type DragHandleProps = PropsWithChildren<PropsWithClass<DragHandleProps_2>>;
|
90
|
-
|
91
79
|
/**
|
92
80
|
* @internal
|
93
81
|
*/
|
94
82
|
export declare const EditorContextProvider: Provider<Editor<any> | null>;
|
95
83
|
|
96
|
-
|
84
|
+
declare const InlinePopover: ForwardRefExoticComponent<Partial<InlinePopoverProps> & RefAttributes<InlinePopoverElement> & HTMLAttributes<InlinePopoverElement>>;
|
85
|
+
export { InlinePopover }
|
86
|
+
export { InlinePopover as InlinePopover_alias_1 }
|
97
87
|
|
98
|
-
|
88
|
+
declare const PopoverContent: ForwardRefExoticComponent<Partial<PopoverContentProps> & RefAttributes<PopoverContentElement> & HTMLAttributes<PopoverContentElement>>;
|
89
|
+
export { PopoverContent }
|
90
|
+
export { PopoverContent as PopoverContent_alias_1 }
|
99
91
|
|
100
|
-
|
92
|
+
declare const PopoverRoot: ForwardRefExoticComponent<Partial<PopoverRootProps> & RefAttributes<PopoverRootElement> & HTMLAttributes<PopoverRootElement>>;
|
93
|
+
export { PopoverRoot }
|
94
|
+
export { PopoverRoot as PopoverRoot_alias_1 }
|
101
95
|
|
102
|
-
|
103
|
-
|
104
|
-
export {
|
96
|
+
declare const PopoverTrigger: ForwardRefExoticComponent<Partial<PopoverTriggerProps> & RefAttributes<PopoverTriggerElement> & HTMLAttributes<PopoverTriggerElement>>;
|
97
|
+
export { PopoverTrigger }
|
98
|
+
export { PopoverTrigger as PopoverTrigger_alias_1 }
|
105
99
|
|
106
100
|
/**
|
107
101
|
* @internal
|
@@ -138,13 +132,25 @@ declare interface ProseKitProps {
|
|
138
132
|
export { ProseKitProps }
|
139
133
|
export { ProseKitProps as ProseKitProps_alias_1 }
|
140
134
|
|
141
|
-
|
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 }
|
142
142
|
|
143
|
-
|
143
|
+
declare const TooltipContent: ForwardRefExoticComponent<Partial<TooltipContentProps> & RefAttributes<TooltipContentElement> & HTMLAttributes<TooltipContentElement>>;
|
144
|
+
export { TooltipContent }
|
145
|
+
export { TooltipContent as TooltipContent_alias_1 }
|
144
146
|
|
145
|
-
|
147
|
+
declare const TooltipRoot: ForwardRefExoticComponent<Partial<TooltipRootProps> & RefAttributes<TooltipRootElement> & HTMLAttributes<TooltipRootElement>>;
|
148
|
+
export { TooltipRoot }
|
149
|
+
export { TooltipRoot as TooltipRoot_alias_1 }
|
146
150
|
|
147
|
-
|
151
|
+
declare const TooltipTrigger: ForwardRefExoticComponent<Partial<TooltipTriggerProps> & RefAttributes<TooltipTriggerElement> & HTMLAttributes<TooltipTriggerElement>>;
|
152
|
+
export { TooltipTrigger }
|
153
|
+
export { TooltipTrigger as TooltipTrigger_alias_1 }
|
148
154
|
|
149
155
|
/**
|
150
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",
|
@@ -95,10 +55,10 @@
|
|
95
55
|
"import": "./dist/prosekit-preact-resizable.js",
|
96
56
|
"default": "./dist/prosekit-preact-resizable.js"
|
97
57
|
},
|
98
|
-
"./
|
99
|
-
"types": "./dist/prosekit-preact-
|
100
|
-
"import": "./dist/prosekit-preact-
|
101
|
-
"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"
|
102
62
|
}
|
103
63
|
},
|
104
64
|
"files": [
|
@@ -106,8 +66,10 @@
|
|
106
66
|
],
|
107
67
|
"dependencies": {
|
108
68
|
"@prosekit/core": "^0.4.0",
|
109
|
-
"@prosekit/lit": "^0.
|
110
|
-
"@prosekit/pm": "^0.1.
|
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"
|
111
73
|
},
|
112
74
|
"peerDependencies": {
|
113
75
|
"preact": ">= 9.0.0"
|
@@ -119,10 +81,10 @@
|
|
119
81
|
},
|
120
82
|
"devDependencies": {
|
121
83
|
"@prosekit/dev": "*",
|
122
|
-
"preact": "^10.
|
84
|
+
"preact": "^10.20.2",
|
123
85
|
"tsup": "^8.0.2",
|
124
|
-
"typescript": "^5.
|
125
|
-
"vitest": "^1.
|
86
|
+
"typescript": "^5.4.5",
|
87
|
+
"vitest": "^1.5.0"
|
126
88
|
},
|
127
89
|
"scripts": {
|
128
90
|
"build:tsup": "tsup",
|
@@ -134,35 +96,11 @@
|
|
134
96
|
".": [
|
135
97
|
"./dist/prosekit-preact.d.ts"
|
136
98
|
],
|
137
|
-
"autocomplete
|
138
|
-
"./dist/prosekit-preact-autocomplete
|
139
|
-
],
|
140
|
-
"autocomplete-item": [
|
141
|
-
"./dist/prosekit-preact-autocomplete-item.d.ts"
|
142
|
-
],
|
143
|
-
"autocomplete-list": [
|
144
|
-
"./dist/prosekit-preact-autocomplete-list.d.ts"
|
145
|
-
],
|
146
|
-
"autocomplete-popover": [
|
147
|
-
"./dist/prosekit-preact-autocomplete-popover.d.ts"
|
148
|
-
],
|
149
|
-
"block-popover": [
|
150
|
-
"./dist/prosekit-preact-block-popover.d.ts"
|
151
|
-
],
|
152
|
-
"combo-box": [
|
153
|
-
"./dist/prosekit-preact-combo-box.d.ts"
|
154
|
-
],
|
155
|
-
"combo-box-input": [
|
156
|
-
"./dist/prosekit-preact-combo-box-input.d.ts"
|
157
|
-
],
|
158
|
-
"combo-box-item": [
|
159
|
-
"./dist/prosekit-preact-combo-box-item.d.ts"
|
160
|
-
],
|
161
|
-
"combo-box-list": [
|
162
|
-
"./dist/prosekit-preact-combo-box-list.d.ts"
|
99
|
+
"autocomplete": [
|
100
|
+
"./dist/prosekit-preact-autocomplete.d.ts"
|
163
101
|
],
|
164
|
-
"
|
165
|
-
"./dist/prosekit-preact-
|
102
|
+
"block-handle": [
|
103
|
+
"./dist/prosekit-preact-block-handle.d.ts"
|
166
104
|
],
|
167
105
|
"inline-popover": [
|
168
106
|
"./dist/prosekit-preact-inline-popover.d.ts"
|
@@ -173,8 +111,8 @@
|
|
173
111
|
"resizable": [
|
174
112
|
"./dist/prosekit-preact-resizable.d.ts"
|
175
113
|
],
|
176
|
-
"
|
177
|
-
"./dist/prosekit-preact-
|
114
|
+
"tooltip": [
|
115
|
+
"./dist/prosekit-preact-tooltip.d.ts"
|
178
116
|
]
|
179
117
|
}
|
180
118
|
}
|