@prosekit/react 0.4.12 → 0.4.13
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/create-component-DATBjvTG.js +67 -0
- package/dist/create-props-B_K0wKYy.d.ts +6 -0
- package/dist/editor-context-Cci4uqN_.js +17 -0
- package/dist/prosekit-react-autocomplete.d.ts +40 -8
- package/dist/prosekit-react-autocomplete.js +17 -54
- package/dist/prosekit-react-block-handle.d.ts +32 -6
- package/dist/prosekit-react-block-handle.js +14 -42
- package/dist/prosekit-react-inline-popover.d.ts +16 -2
- package/dist/prosekit-react-inline-popover.js +8 -18
- package/dist/prosekit-react-popover.d.ts +32 -6
- package/dist/prosekit-react-popover.js +14 -42
- package/dist/prosekit-react-resizable.d.ts +24 -4
- package/dist/prosekit-react-resizable.js +11 -30
- package/dist/prosekit-react-table-handle.d.ts +64 -14
- package/dist/prosekit-react-table-handle.js +26 -90
- package/dist/prosekit-react-tooltip.d.ts +32 -6
- package/dist/prosekit-react-tooltip.js +14 -42
- package/dist/prosekit-react.d.ts +151 -17
- package/dist/prosekit-react.js +152 -195
- package/package.json +31 -14
- package/dist/_tsup-dts-rollup.d.ts +0 -574
- package/dist/chunk-BV2MZRRU.js +0 -15
- package/dist/chunk-VASCWPBI.js +0 -98
@@ -1,574 +0,0 @@
|
|
1
|
-
import { AutocompleteEmptyElement } from '@prosekit/web/autocomplete';
|
2
|
-
import { AutocompleteEmptyEvents } from '@prosekit/web/autocomplete';
|
3
|
-
import { AutocompleteEmptyProps as AutocompleteEmptyProps_2 } from '@prosekit/web/autocomplete';
|
4
|
-
import { AutocompleteItemElement } from '@prosekit/web/autocomplete';
|
5
|
-
import { AutocompleteItemEvents } from '@prosekit/web/autocomplete';
|
6
|
-
import { AutocompleteItemProps as AutocompleteItemProps_2 } from '@prosekit/web/autocomplete';
|
7
|
-
import { AutocompleteListElement } from '@prosekit/web/autocomplete';
|
8
|
-
import { AutocompleteListEvents } from '@prosekit/web/autocomplete';
|
9
|
-
import { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/web/autocomplete';
|
10
|
-
import { AutocompletePopoverElement } from '@prosekit/web/autocomplete';
|
11
|
-
import { AutocompletePopoverEvents } from '@prosekit/web/autocomplete';
|
12
|
-
import { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/web/autocomplete';
|
13
|
-
import { BlockHandleAddElement } from '@prosekit/web/block-handle';
|
14
|
-
import { BlockHandleAddEvents } from '@prosekit/web/block-handle';
|
15
|
-
import { BlockHandleAddProps as BlockHandleAddProps_2 } from '@prosekit/web/block-handle';
|
16
|
-
import { BlockHandleDraggableElement } from '@prosekit/web/block-handle';
|
17
|
-
import { BlockHandleDraggableEvents } from '@prosekit/web/block-handle';
|
18
|
-
import { BlockHandleDraggableProps as BlockHandleDraggableProps_2 } from '@prosekit/web/block-handle';
|
19
|
-
import { BlockHandlePopoverElement } from '@prosekit/web/block-handle';
|
20
|
-
import { BlockHandlePopoverEvents } from '@prosekit/web/block-handle';
|
21
|
-
import { BlockHandlePopoverProps as BlockHandlePopoverProps_2 } from '@prosekit/web/block-handle';
|
22
|
-
import { ComponentType } from 'react';
|
23
|
-
import type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core';
|
24
|
-
import type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core';
|
25
|
-
import { Editor } from '@prosekit/core';
|
26
|
-
import type { EditorState } from '@prosekit/pm/state';
|
27
|
-
import { Extension } from '@prosekit/core';
|
28
|
-
import { FC } from 'react';
|
29
|
-
import { ForwardRefExoticComponent } from 'react';
|
30
|
-
import { HTMLAttributes } from 'react';
|
31
|
-
import { InlinePopoverElement } from '@prosekit/web/inline-popover';
|
32
|
-
import { InlinePopoverEvents } from '@prosekit/web/inline-popover';
|
33
|
-
import { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/web/inline-popover';
|
34
|
-
import { Keymap } from '@prosekit/core';
|
35
|
-
import { MarkViewContext } from '@prosemirror-adapter/react';
|
36
|
-
import { NodeViewContext } from '@prosemirror-adapter/react';
|
37
|
-
import { PopoverContentElement } from '@prosekit/web/popover';
|
38
|
-
import { PopoverContentEvents } from '@prosekit/web/popover';
|
39
|
-
import { PopoverContentProps as PopoverContentProps_2 } from '@prosekit/web/popover';
|
40
|
-
import { PopoverRootElement } from '@prosekit/web/popover';
|
41
|
-
import { PopoverRootEvents } from '@prosekit/web/popover';
|
42
|
-
import { PopoverRootProps as PopoverRootProps_2 } from '@prosekit/web/popover';
|
43
|
-
import { PopoverTriggerElement } from '@prosekit/web/popover';
|
44
|
-
import { PopoverTriggerEvents } from '@prosekit/web/popover';
|
45
|
-
import { PopoverTriggerProps as PopoverTriggerProps_2 } from '@prosekit/web/popover';
|
46
|
-
import { Priority } from '@prosekit/core';
|
47
|
-
import type { ProseMirrorNode } from '@prosekit/pm/model';
|
48
|
-
import { Provider } from 'react';
|
49
|
-
import { ReactNode } from 'react';
|
50
|
-
import { RefAttributes } from 'react';
|
51
|
-
import { ResizableHandleElement } from '@prosekit/web/resizable';
|
52
|
-
import { ResizableHandleEvents } from '@prosekit/web/resizable';
|
53
|
-
import { ResizableHandleProps as ResizableHandleProps_2 } from '@prosekit/web/resizable';
|
54
|
-
import { ResizableRootElement } from '@prosekit/web/resizable';
|
55
|
-
import { ResizableRootEvents } from '@prosekit/web/resizable';
|
56
|
-
import { ResizableRootProps as ResizableRootProps_2 } from '@prosekit/web/resizable';
|
57
|
-
import { TableHandleColumnRootElement } from '@prosekit/web/table-handle';
|
58
|
-
import { TableHandleColumnRootEvents } from '@prosekit/web/table-handle';
|
59
|
-
import { TableHandleColumnRootProps as TableHandleColumnRootProps_2 } from '@prosekit/web/table-handle';
|
60
|
-
import { TableHandleColumnTriggerElement } from '@prosekit/web/table-handle';
|
61
|
-
import { TableHandleColumnTriggerEvents } from '@prosekit/web/table-handle';
|
62
|
-
import { TableHandleColumnTriggerProps as TableHandleColumnTriggerProps_2 } from '@prosekit/web/table-handle';
|
63
|
-
import { TableHandlePopoverContentElement } from '@prosekit/web/table-handle';
|
64
|
-
import { TableHandlePopoverContentEvents } from '@prosekit/web/table-handle';
|
65
|
-
import { TableHandlePopoverContentProps as TableHandlePopoverContentProps_2 } from '@prosekit/web/table-handle';
|
66
|
-
import { TableHandlePopoverItemElement } from '@prosekit/web/table-handle';
|
67
|
-
import { TableHandlePopoverItemEvents } from '@prosekit/web/table-handle';
|
68
|
-
import { TableHandlePopoverItemProps as TableHandlePopoverItemProps_2 } from '@prosekit/web/table-handle';
|
69
|
-
import { TableHandleRootElement } from '@prosekit/web/table-handle';
|
70
|
-
import { TableHandleRootEvents } from '@prosekit/web/table-handle';
|
71
|
-
import { TableHandleRootProps as TableHandleRootProps_2 } from '@prosekit/web/table-handle';
|
72
|
-
import { TableHandleRowRootElement } from '@prosekit/web/table-handle';
|
73
|
-
import { TableHandleRowRootEvents } from '@prosekit/web/table-handle';
|
74
|
-
import { TableHandleRowRootProps as TableHandleRowRootProps_2 } from '@prosekit/web/table-handle';
|
75
|
-
import { TableHandleRowTriggerElement } from '@prosekit/web/table-handle';
|
76
|
-
import { TableHandleRowTriggerEvents } from '@prosekit/web/table-handle';
|
77
|
-
import { TableHandleRowTriggerProps as TableHandleRowTriggerProps_2 } from '@prosekit/web/table-handle';
|
78
|
-
import { TooltipContentElement } from '@prosekit/web/tooltip';
|
79
|
-
import { TooltipContentEvents } from '@prosekit/web/tooltip';
|
80
|
-
import { TooltipContentProps as TooltipContentProps_2 } from '@prosekit/web/tooltip';
|
81
|
-
import { TooltipRootElement } from '@prosekit/web/tooltip';
|
82
|
-
import { TooltipRootEvents } from '@prosekit/web/tooltip';
|
83
|
-
import { TooltipRootProps as TooltipRootProps_2 } from '@prosekit/web/tooltip';
|
84
|
-
import { TooltipTriggerElement } from '@prosekit/web/tooltip';
|
85
|
-
import { TooltipTriggerEvents } from '@prosekit/web/tooltip';
|
86
|
-
import { TooltipTriggerProps as TooltipTriggerProps_2 } from '@prosekit/web/tooltip';
|
87
|
-
|
88
|
-
declare const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & RefAttributes<AutocompleteEmptyElement> & HTMLAttributes<AutocompleteEmptyElement>>;
|
89
|
-
export { AutocompleteEmpty }
|
90
|
-
export { AutocompleteEmpty as AutocompleteEmpty_alias_1 }
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Props for the {@link AutocompleteEmpty} component.
|
94
|
-
*/
|
95
|
-
declare interface AutocompleteEmptyProps extends Partial<CreateProps<AutocompleteEmptyProps_2, AutocompleteEmptyEvents>> {
|
96
|
-
}
|
97
|
-
export { AutocompleteEmptyProps }
|
98
|
-
export { AutocompleteEmptyProps as AutocompleteEmptyProps_alias_1 }
|
99
|
-
|
100
|
-
declare const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & RefAttributes<AutocompleteItemElement> & HTMLAttributes<AutocompleteItemElement>>;
|
101
|
-
export { AutocompleteItem }
|
102
|
-
export { AutocompleteItem as AutocompleteItem_alias_1 }
|
103
|
-
|
104
|
-
/**
|
105
|
-
* Props for the {@link AutocompleteItem} component.
|
106
|
-
*/
|
107
|
-
declare interface AutocompleteItemProps extends Partial<CreateProps<AutocompleteItemProps_2, AutocompleteItemEvents>> {
|
108
|
-
}
|
109
|
-
export { AutocompleteItemProps }
|
110
|
-
export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
|
111
|
-
|
112
|
-
declare const AutocompleteList: ForwardRefExoticComponent<AutocompleteListProps & RefAttributes<AutocompleteListElement> & HTMLAttributes<AutocompleteListElement>>;
|
113
|
-
export { AutocompleteList }
|
114
|
-
export { AutocompleteList as AutocompleteList_alias_1 }
|
115
|
-
|
116
|
-
/**
|
117
|
-
* Props for the {@link AutocompleteList} component.
|
118
|
-
*/
|
119
|
-
declare interface AutocompleteListProps extends Partial<CreateProps<AutocompleteListProps_2, AutocompleteListEvents>> {
|
120
|
-
}
|
121
|
-
export { AutocompleteListProps }
|
122
|
-
export { AutocompleteListProps as AutocompleteListProps_alias_1 }
|
123
|
-
|
124
|
-
declare const AutocompletePopover: ForwardRefExoticComponent<AutocompletePopoverProps & RefAttributes<AutocompletePopoverElement> & HTMLAttributes<AutocompletePopoverElement>>;
|
125
|
-
export { AutocompletePopover }
|
126
|
-
export { AutocompletePopover as AutocompletePopover_alias_1 }
|
127
|
-
|
128
|
-
/**
|
129
|
-
* Props for the {@link AutocompletePopover} component.
|
130
|
-
*/
|
131
|
-
declare interface AutocompletePopoverProps extends Partial<CreateProps<AutocompletePopoverProps_2, AutocompletePopoverEvents>> {
|
132
|
-
}
|
133
|
-
export { AutocompletePopoverProps }
|
134
|
-
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
135
|
-
|
136
|
-
declare const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & RefAttributes<BlockHandleAddElement> & HTMLAttributes<BlockHandleAddElement>>;
|
137
|
-
export { BlockHandleAdd }
|
138
|
-
export { BlockHandleAdd as BlockHandleAdd_alias_1 }
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Props for the {@link BlockHandleAdd} component.
|
142
|
-
*/
|
143
|
-
declare interface BlockHandleAddProps extends Partial<CreateProps<BlockHandleAddProps_2, BlockHandleAddEvents>> {
|
144
|
-
}
|
145
|
-
export { BlockHandleAddProps }
|
146
|
-
export { BlockHandleAddProps as BlockHandleAddProps_alias_1 }
|
147
|
-
|
148
|
-
declare const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & RefAttributes<BlockHandleDraggableElement> & HTMLAttributes<BlockHandleDraggableElement>>;
|
149
|
-
export { BlockHandleDraggable }
|
150
|
-
export { BlockHandleDraggable as BlockHandleDraggable_alias_1 }
|
151
|
-
|
152
|
-
/**
|
153
|
-
* Props for the {@link BlockHandleDraggable} component.
|
154
|
-
*/
|
155
|
-
declare interface BlockHandleDraggableProps extends Partial<CreateProps<BlockHandleDraggableProps_2, BlockHandleDraggableEvents>> {
|
156
|
-
}
|
157
|
-
export { BlockHandleDraggableProps }
|
158
|
-
export { BlockHandleDraggableProps as BlockHandleDraggableProps_alias_1 }
|
159
|
-
|
160
|
-
declare const BlockHandlePopover: ForwardRefExoticComponent<BlockHandlePopoverProps & RefAttributes<BlockHandlePopoverElement> & HTMLAttributes<BlockHandlePopoverElement>>;
|
161
|
-
export { BlockHandlePopover }
|
162
|
-
export { BlockHandlePopover as BlockHandlePopover_alias_1 }
|
163
|
-
|
164
|
-
/**
|
165
|
-
* Props for the {@link BlockHandlePopover} component.
|
166
|
-
*/
|
167
|
-
declare interface BlockHandlePopoverProps extends Partial<CreateProps<BlockHandlePopoverProps_2, BlockHandlePopoverEvents>> {
|
168
|
-
}
|
169
|
-
export { BlockHandlePopoverProps }
|
170
|
-
export { BlockHandlePopoverProps as BlockHandlePopoverProps_alias_1 }
|
171
|
-
|
172
|
-
export declare function createComponent<Props extends object, CustomElement extends HTMLElement>(tagName: string, displayName: string, propNames: string[], eventNames: string[]): ForwardRefExoticComponent<Partial<Props> & RefAttributes<CustomElement> & HTMLAttributes<CustomElement>>;
|
173
|
-
|
174
|
-
declare type CreateEventProps<Events extends {
|
175
|
-
[EventName in keyof Events]: CustomEvent;
|
176
|
-
}> = {
|
177
|
-
[EventName in keyof Events as `on${Capitalize<string & EventName>}`]: (event: EventName extends `${string}Change` ? Events[EventName]['detail'] : Events[EventName]) => void;
|
178
|
-
};
|
179
|
-
|
180
|
-
export declare type CreateProps<Props extends {
|
181
|
-
[PropName in keyof Props]: unknown;
|
182
|
-
}, Events extends {
|
183
|
-
[EventName in keyof Events]: CustomEvent;
|
184
|
-
}> = Props & CreateEventProps<Events>;
|
185
|
-
|
186
|
-
/**
|
187
|
-
* Defines a mark view using a React component.
|
188
|
-
*
|
189
|
-
* @public
|
190
|
-
*/
|
191
|
-
declare function defineReactMarkView(options: ReactMarkViewOptions): Extension;
|
192
|
-
export { defineReactMarkView }
|
193
|
-
export { defineReactMarkView as defineReactMarkView_alias_1 }
|
194
|
-
|
195
|
-
/**
|
196
|
-
* Defines a node view using a React component.
|
197
|
-
*
|
198
|
-
* @public
|
199
|
-
*/
|
200
|
-
declare function defineReactNodeView(options: ReactNodeViewOptions): Extension;
|
201
|
-
export { defineReactNodeView }
|
202
|
-
export { defineReactNodeView as defineReactNodeView_alias_1 }
|
203
|
-
|
204
|
-
/**
|
205
|
-
* @internal
|
206
|
-
*/
|
207
|
-
export declare const EditorContextProvider: Provider<Editor<any> | null>;
|
208
|
-
|
209
|
-
declare const InlinePopover: ForwardRefExoticComponent<InlinePopoverProps & RefAttributes<InlinePopoverElement> & HTMLAttributes<InlinePopoverElement>>;
|
210
|
-
export { InlinePopover }
|
211
|
-
export { InlinePopover as InlinePopover_alias_1 }
|
212
|
-
|
213
|
-
/**
|
214
|
-
* Props for the {@link InlinePopover} component.
|
215
|
-
*/
|
216
|
-
declare interface InlinePopoverProps extends Partial<CreateProps<InlinePopoverProps_2, InlinePopoverEvents>> {
|
217
|
-
}
|
218
|
-
export { InlinePopoverProps }
|
219
|
-
export { InlinePopoverProps as InlinePopoverProps_alias_1 }
|
220
|
-
|
221
|
-
declare const PopoverContent: ForwardRefExoticComponent<PopoverContentProps & RefAttributes<PopoverContentElement> & HTMLAttributes<PopoverContentElement>>;
|
222
|
-
export { PopoverContent }
|
223
|
-
export { PopoverContent as PopoverContent_alias_1 }
|
224
|
-
|
225
|
-
/**
|
226
|
-
* Props for the {@link PopoverContent} component.
|
227
|
-
*/
|
228
|
-
declare interface PopoverContentProps extends Partial<CreateProps<PopoverContentProps_2, PopoverContentEvents>> {
|
229
|
-
}
|
230
|
-
export { PopoverContentProps }
|
231
|
-
export { PopoverContentProps as PopoverContentProps_alias_1 }
|
232
|
-
|
233
|
-
declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & RefAttributes<PopoverRootElement> & HTMLAttributes<PopoverRootElement>>;
|
234
|
-
export { PopoverRoot }
|
235
|
-
export { PopoverRoot as PopoverRoot_alias_1 }
|
236
|
-
|
237
|
-
/**
|
238
|
-
* Props for the {@link PopoverRoot} component.
|
239
|
-
*/
|
240
|
-
declare interface PopoverRootProps extends Partial<CreateProps<PopoverRootProps_2, PopoverRootEvents>> {
|
241
|
-
}
|
242
|
-
export { PopoverRootProps }
|
243
|
-
export { PopoverRootProps as PopoverRootProps_alias_1 }
|
244
|
-
|
245
|
-
declare const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & RefAttributes<PopoverTriggerElement> & HTMLAttributes<PopoverTriggerElement>>;
|
246
|
-
export { PopoverTrigger }
|
247
|
-
export { PopoverTrigger as PopoverTrigger_alias_1 }
|
248
|
-
|
249
|
-
/**
|
250
|
-
* Props for the {@link PopoverTrigger} component.
|
251
|
-
*/
|
252
|
-
declare interface PopoverTriggerProps extends Partial<CreateProps<PopoverTriggerProps_2, PopoverTriggerEvents>> {
|
253
|
-
}
|
254
|
-
export { PopoverTriggerProps }
|
255
|
-
export { PopoverTriggerProps as PopoverTriggerProps_alias_1 }
|
256
|
-
|
257
|
-
/**
|
258
|
-
* @internal
|
259
|
-
*/
|
260
|
-
declare type PropsWithClassName<P = unknown> = P & {
|
261
|
-
className?: string | undefined;
|
262
|
-
};
|
263
|
-
export { PropsWithClassName }
|
264
|
-
export { PropsWithClassName as PropsWithClassName_alias_1 }
|
265
|
-
|
266
|
-
/**
|
267
|
-
* The root component for a ProseKit editor.
|
268
|
-
*
|
269
|
-
* @public
|
270
|
-
*/
|
271
|
-
declare const ProseKit: ComponentType<ProseKitProps>;
|
272
|
-
export { ProseKit }
|
273
|
-
export { ProseKit as ProseKit_alias_1 }
|
274
|
-
|
275
|
-
declare interface ProseKitProps {
|
276
|
-
editor: Editor;
|
277
|
-
children?: ReactNode;
|
278
|
-
}
|
279
|
-
export { ProseKitProps }
|
280
|
-
export { ProseKitProps as ProseKitProps_alias_1 }
|
281
|
-
|
282
|
-
/**
|
283
|
-
* @public
|
284
|
-
*/
|
285
|
-
declare type ReactMarkViewComponent = ComponentType<ReactMarkViewProps>;
|
286
|
-
export { ReactMarkViewComponent }
|
287
|
-
export { ReactMarkViewComponent as ReactMarkViewComponent_alias_1 }
|
288
|
-
|
289
|
-
/**
|
290
|
-
* @internal
|
291
|
-
*/
|
292
|
-
export declare const ReactMarkViewConsumer: FC;
|
293
|
-
|
294
|
-
/**
|
295
|
-
* Options for {@link defineReactMarkView}.
|
296
|
-
*
|
297
|
-
* @public
|
298
|
-
*/
|
299
|
-
declare interface ReactMarkViewOptions extends CoreMarkViewUserOptions<ReactMarkViewComponent> {
|
300
|
-
/**
|
301
|
-
* The name of the mark type.
|
302
|
-
*/
|
303
|
-
name: string;
|
304
|
-
}
|
305
|
-
export { ReactMarkViewOptions }
|
306
|
-
export { ReactMarkViewOptions as ReactMarkViewOptions_alias_1 }
|
307
|
-
|
308
|
-
/**
|
309
|
-
* @public
|
310
|
-
*/
|
311
|
-
declare interface ReactMarkViewProps extends MarkViewContext {
|
312
|
-
}
|
313
|
-
export { ReactMarkViewProps }
|
314
|
-
export { ReactMarkViewProps as ReactMarkViewProps_alias_1 }
|
315
|
-
|
316
|
-
/**
|
317
|
-
* @public
|
318
|
-
*/
|
319
|
-
declare type ReactNodeViewComponent = ComponentType<ReactNodeViewProps>;
|
320
|
-
export { ReactNodeViewComponent }
|
321
|
-
export { ReactNodeViewComponent as ReactNodeViewComponent_alias_1 }
|
322
|
-
|
323
|
-
/**
|
324
|
-
* @internal
|
325
|
-
*/
|
326
|
-
export declare const ReactNodeViewConsumer: FC;
|
327
|
-
|
328
|
-
/**
|
329
|
-
* Options for {@link defineReactNodeView}.
|
330
|
-
*
|
331
|
-
* @public
|
332
|
-
*/
|
333
|
-
declare interface ReactNodeViewOptions extends CoreNodeViewUserOptions<ReactNodeViewComponent> {
|
334
|
-
/**
|
335
|
-
* The name of the node type.
|
336
|
-
*/
|
337
|
-
name: string;
|
338
|
-
}
|
339
|
-
export { ReactNodeViewOptions }
|
340
|
-
export { ReactNodeViewOptions as ReactNodeViewOptions_alias_1 }
|
341
|
-
|
342
|
-
/**
|
343
|
-
* @public
|
344
|
-
*/
|
345
|
-
declare interface ReactNodeViewProps extends NodeViewContext {
|
346
|
-
}
|
347
|
-
export { ReactNodeViewProps }
|
348
|
-
export { ReactNodeViewProps as ReactNodeViewProps_alias_1 }
|
349
|
-
|
350
|
-
declare const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & RefAttributes<ResizableHandleElement> & HTMLAttributes<ResizableHandleElement>>;
|
351
|
-
export { ResizableHandle }
|
352
|
-
export { ResizableHandle as ResizableHandle_alias_1 }
|
353
|
-
|
354
|
-
/**
|
355
|
-
* Props for the {@link ResizableHandle} component.
|
356
|
-
*/
|
357
|
-
declare interface ResizableHandleProps extends Partial<CreateProps<ResizableHandleProps_2, ResizableHandleEvents>> {
|
358
|
-
}
|
359
|
-
export { ResizableHandleProps }
|
360
|
-
export { ResizableHandleProps as ResizableHandleProps_alias_1 }
|
361
|
-
|
362
|
-
declare const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & RefAttributes<ResizableRootElement> & HTMLAttributes<ResizableRootElement>>;
|
363
|
-
export { ResizableRoot }
|
364
|
-
export { ResizableRoot as ResizableRoot_alias_1 }
|
365
|
-
|
366
|
-
/**
|
367
|
-
* Props for the {@link ResizableRoot} component.
|
368
|
-
*/
|
369
|
-
declare interface ResizableRootProps extends Partial<CreateProps<ResizableRootProps_2, ResizableRootEvents>> {
|
370
|
-
}
|
371
|
-
export { ResizableRootProps }
|
372
|
-
export { ResizableRootProps as ResizableRootProps_alias_1 }
|
373
|
-
|
374
|
-
declare const TableHandleColumnRoot: ForwardRefExoticComponent<TableHandleColumnRootProps & RefAttributes<TableHandleColumnRootElement> & HTMLAttributes<TableHandleColumnRootElement>>;
|
375
|
-
export { TableHandleColumnRoot }
|
376
|
-
export { TableHandleColumnRoot as TableHandleColumnRoot_alias_1 }
|
377
|
-
|
378
|
-
/**
|
379
|
-
* Props for the {@link TableHandleColumnRoot} component.
|
380
|
-
*/
|
381
|
-
declare interface TableHandleColumnRootProps extends Partial<CreateProps<TableHandleColumnRootProps_2, TableHandleColumnRootEvents>> {
|
382
|
-
}
|
383
|
-
export { TableHandleColumnRootProps }
|
384
|
-
export { TableHandleColumnRootProps as TableHandleColumnRootProps_alias_1 }
|
385
|
-
|
386
|
-
declare const TableHandleColumnTrigger: ForwardRefExoticComponent<TableHandleColumnTriggerProps & RefAttributes<TableHandleColumnTriggerElement> & HTMLAttributes<TableHandleColumnTriggerElement>>;
|
387
|
-
export { TableHandleColumnTrigger }
|
388
|
-
export { TableHandleColumnTrigger as TableHandleColumnTrigger_alias_1 }
|
389
|
-
|
390
|
-
/**
|
391
|
-
* Props for the {@link TableHandleColumnTrigger} component.
|
392
|
-
*/
|
393
|
-
declare interface TableHandleColumnTriggerProps extends Partial<CreateProps<TableHandleColumnTriggerProps_2, TableHandleColumnTriggerEvents>> {
|
394
|
-
}
|
395
|
-
export { TableHandleColumnTriggerProps }
|
396
|
-
export { TableHandleColumnTriggerProps as TableHandleColumnTriggerProps_alias_1 }
|
397
|
-
|
398
|
-
declare const TableHandlePopoverContent: ForwardRefExoticComponent<TableHandlePopoverContentProps & RefAttributes<TableHandlePopoverContentElement> & HTMLAttributes<TableHandlePopoverContentElement>>;
|
399
|
-
export { TableHandlePopoverContent }
|
400
|
-
export { TableHandlePopoverContent as TableHandlePopoverContent_alias_1 }
|
401
|
-
|
402
|
-
/**
|
403
|
-
* Props for the {@link TableHandlePopoverContent} component.
|
404
|
-
*/
|
405
|
-
declare interface TableHandlePopoverContentProps extends Partial<CreateProps<TableHandlePopoverContentProps_2, TableHandlePopoverContentEvents>> {
|
406
|
-
}
|
407
|
-
export { TableHandlePopoverContentProps }
|
408
|
-
export { TableHandlePopoverContentProps as TableHandlePopoverContentProps_alias_1 }
|
409
|
-
|
410
|
-
declare const TableHandlePopoverItem: ForwardRefExoticComponent<TableHandlePopoverItemProps & RefAttributes<TableHandlePopoverItemElement> & HTMLAttributes<TableHandlePopoverItemElement>>;
|
411
|
-
export { TableHandlePopoverItem }
|
412
|
-
export { TableHandlePopoverItem as TableHandlePopoverItem_alias_1 }
|
413
|
-
|
414
|
-
/**
|
415
|
-
* Props for the {@link TableHandlePopoverItem} component.
|
416
|
-
*/
|
417
|
-
declare interface TableHandlePopoverItemProps extends Partial<CreateProps<TableHandlePopoverItemProps_2, TableHandlePopoverItemEvents>> {
|
418
|
-
}
|
419
|
-
export { TableHandlePopoverItemProps }
|
420
|
-
export { TableHandlePopoverItemProps as TableHandlePopoverItemProps_alias_1 }
|
421
|
-
|
422
|
-
declare const TableHandleRoot: ForwardRefExoticComponent<TableHandleRootProps & RefAttributes<TableHandleRootElement> & HTMLAttributes<TableHandleRootElement>>;
|
423
|
-
export { TableHandleRoot }
|
424
|
-
export { TableHandleRoot as TableHandleRoot_alias_1 }
|
425
|
-
|
426
|
-
/**
|
427
|
-
* Props for the {@link TableHandleRoot} component.
|
428
|
-
*/
|
429
|
-
declare interface TableHandleRootProps extends Partial<CreateProps<TableHandleRootProps_2, TableHandleRootEvents>> {
|
430
|
-
}
|
431
|
-
export { TableHandleRootProps }
|
432
|
-
export { TableHandleRootProps as TableHandleRootProps_alias_1 }
|
433
|
-
|
434
|
-
declare const TableHandleRowRoot: ForwardRefExoticComponent<TableHandleRowRootProps & RefAttributes<TableHandleRowRootElement> & HTMLAttributes<TableHandleRowRootElement>>;
|
435
|
-
export { TableHandleRowRoot }
|
436
|
-
export { TableHandleRowRoot as TableHandleRowRoot_alias_1 }
|
437
|
-
|
438
|
-
/**
|
439
|
-
* Props for the {@link TableHandleRowRoot} component.
|
440
|
-
*/
|
441
|
-
declare interface TableHandleRowRootProps extends Partial<CreateProps<TableHandleRowRootProps_2, TableHandleRowRootEvents>> {
|
442
|
-
}
|
443
|
-
export { TableHandleRowRootProps }
|
444
|
-
export { TableHandleRowRootProps as TableHandleRowRootProps_alias_1 }
|
445
|
-
|
446
|
-
declare const TableHandleRowTrigger: ForwardRefExoticComponent<TableHandleRowTriggerProps & RefAttributes<TableHandleRowTriggerElement> & HTMLAttributes<TableHandleRowTriggerElement>>;
|
447
|
-
export { TableHandleRowTrigger }
|
448
|
-
export { TableHandleRowTrigger as TableHandleRowTrigger_alias_1 }
|
449
|
-
|
450
|
-
/**
|
451
|
-
* Props for the {@link TableHandleRowTrigger} component.
|
452
|
-
*/
|
453
|
-
declare interface TableHandleRowTriggerProps extends Partial<CreateProps<TableHandleRowTriggerProps_2, TableHandleRowTriggerEvents>> {
|
454
|
-
}
|
455
|
-
export { TableHandleRowTriggerProps }
|
456
|
-
export { TableHandleRowTriggerProps as TableHandleRowTriggerProps_alias_1 }
|
457
|
-
|
458
|
-
declare const TooltipContent: ForwardRefExoticComponent<TooltipContentProps & RefAttributes<TooltipContentElement> & HTMLAttributes<TooltipContentElement>>;
|
459
|
-
export { TooltipContent }
|
460
|
-
export { TooltipContent as TooltipContent_alias_1 }
|
461
|
-
|
462
|
-
/**
|
463
|
-
* Props for the {@link TooltipContent} component.
|
464
|
-
*/
|
465
|
-
declare interface TooltipContentProps extends Partial<CreateProps<TooltipContentProps_2, TooltipContentEvents>> {
|
466
|
-
}
|
467
|
-
export { TooltipContentProps }
|
468
|
-
export { TooltipContentProps as TooltipContentProps_alias_1 }
|
469
|
-
|
470
|
-
declare const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttributes<TooltipRootElement> & HTMLAttributes<TooltipRootElement>>;
|
471
|
-
export { TooltipRoot }
|
472
|
-
export { TooltipRoot as TooltipRoot_alias_1 }
|
473
|
-
|
474
|
-
/**
|
475
|
-
* Props for the {@link TooltipRoot} component.
|
476
|
-
*/
|
477
|
-
declare interface TooltipRootProps extends Partial<CreateProps<TooltipRootProps_2, TooltipRootEvents>> {
|
478
|
-
}
|
479
|
-
export { TooltipRootProps }
|
480
|
-
export { TooltipRootProps as TooltipRootProps_alias_1 }
|
481
|
-
|
482
|
-
declare const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & RefAttributes<TooltipTriggerElement> & HTMLAttributes<TooltipTriggerElement>>;
|
483
|
-
export { TooltipTrigger }
|
484
|
-
export { TooltipTrigger as TooltipTrigger_alias_1 }
|
485
|
-
|
486
|
-
/**
|
487
|
-
* Props for the {@link TooltipTrigger} component.
|
488
|
-
*/
|
489
|
-
declare interface TooltipTriggerProps extends Partial<CreateProps<TooltipTriggerProps_2, TooltipTriggerEvents>> {
|
490
|
-
}
|
491
|
-
export { TooltipTriggerProps }
|
492
|
-
export { TooltipTriggerProps as TooltipTriggerProps_alias_1 }
|
493
|
-
|
494
|
-
/**
|
495
|
-
* Calls the given handler whenever the editor document changes.
|
496
|
-
*
|
497
|
-
* @public
|
498
|
-
*/
|
499
|
-
declare function useDocChange(handler: (doc: ProseMirrorNode) => void, options?: UseExtensionOptions): void;
|
500
|
-
export { useDocChange }
|
501
|
-
export { useDocChange as useDocChange_alias_1 }
|
502
|
-
|
503
|
-
/**
|
504
|
-
* Retrieves the editor instance from the nearest ProseKit component.
|
505
|
-
*
|
506
|
-
* @public
|
507
|
-
*/
|
508
|
-
declare function useEditor<E extends Extension = any>(options?: {
|
509
|
-
/**
|
510
|
-
* Whether to update the component when the editor is mounted or editor state
|
511
|
-
* is updated.
|
512
|
-
*
|
513
|
-
* @default false
|
514
|
-
*/
|
515
|
-
update?: boolean;
|
516
|
-
}): Editor<E>;
|
517
|
-
export { useEditor }
|
518
|
-
export { useEditor as useEditor_alias_1 }
|
519
|
-
|
520
|
-
/**
|
521
|
-
* @internal
|
522
|
-
*/
|
523
|
-
export declare function useEditorContext<E extends Extension>(): Editor<E> | null;
|
524
|
-
|
525
|
-
/**
|
526
|
-
* @internal
|
527
|
-
*/
|
528
|
-
export declare function useEditorExtension(editor: Editor | null | undefined, extension: Extension | null): void;
|
529
|
-
|
530
|
-
/**
|
531
|
-
* Add an extension to the editor.
|
532
|
-
*/
|
533
|
-
declare function useExtension(
|
534
|
-
/**
|
535
|
-
* The extension to add to the editor. If it changes, the previous
|
536
|
-
* extension will be removed and the new one (if not null) will be added.
|
537
|
-
*/
|
538
|
-
extension: Extension | null, options?: UseExtensionOptions): void;
|
539
|
-
export { useExtension }
|
540
|
-
export { useExtension as useExtension_alias_1 }
|
541
|
-
|
542
|
-
declare interface UseExtensionOptions {
|
543
|
-
/**
|
544
|
-
* The editor to add the extension to. If not provided, it will use the
|
545
|
-
* editor from the nearest `ProseKit` component.
|
546
|
-
*/
|
547
|
-
editor?: Editor;
|
548
|
-
/**
|
549
|
-
* Optional priority to add the extension with.
|
550
|
-
*/
|
551
|
-
priority?: Priority;
|
552
|
-
}
|
553
|
-
export { UseExtensionOptions }
|
554
|
-
export { UseExtensionOptions as UseExtensionOptions_alias_1 }
|
555
|
-
|
556
|
-
declare function useKeymap(keymap: Keymap, options?: UseExtensionOptions): void;
|
557
|
-
export { useKeymap }
|
558
|
-
export { useKeymap as useKeymap_alias_1 }
|
559
|
-
|
560
|
-
/**
|
561
|
-
* @internal
|
562
|
-
*/
|
563
|
-
export declare function usePriorityExtension<T extends Extension = Extension>(extension: T | null, priority?: Priority | null): T | null;
|
564
|
-
|
565
|
-
/**
|
566
|
-
* Calls the given handler whenever the editor state changes.
|
567
|
-
*
|
568
|
-
* @public
|
569
|
-
*/
|
570
|
-
declare function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void;
|
571
|
-
export { useStateUpdate }
|
572
|
-
export { useStateUpdate as useStateUpdate_alias_1 }
|
573
|
-
|
574
|
-
export { }
|
package/dist/chunk-BV2MZRRU.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
// src/contexts/editor-context.ts
|
2
|
-
import {
|
3
|
-
createContext,
|
4
|
-
useContext
|
5
|
-
} from "react";
|
6
|
-
var editorContext = createContext(null);
|
7
|
-
function useEditorContext() {
|
8
|
-
return useContext(editorContext);
|
9
|
-
}
|
10
|
-
var EditorContextProvider = editorContext.Provider;
|
11
|
-
|
12
|
-
export {
|
13
|
-
useEditorContext,
|
14
|
-
EditorContextProvider
|
15
|
-
};
|
package/dist/chunk-VASCWPBI.js
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
useEditorContext
|
3
|
-
} from "./chunk-BV2MZRRU.js";
|
4
|
-
|
5
|
-
// src/components/create-component.ts
|
6
|
-
import {
|
7
|
-
createElement,
|
8
|
-
forwardRef,
|
9
|
-
useEffect,
|
10
|
-
useLayoutEffect,
|
11
|
-
useRef,
|
12
|
-
useState
|
13
|
-
} from "react";
|
14
|
-
import { mergeRefs } from "react-merge-refs";
|
15
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
16
|
-
function createComponent(tagName, displayName, propNames, eventNames) {
|
17
|
-
const hasEditor = propNames.includes("editor");
|
18
|
-
const lowerCaseEventNameMap = Object.fromEntries(
|
19
|
-
eventNames.map((name) => [name.toLowerCase(), name])
|
20
|
-
);
|
21
|
-
const Component = forwardRef((props, ref) => {
|
22
|
-
const [el, setEl] = useState(null);
|
23
|
-
const properties = {};
|
24
|
-
const attributes = {};
|
25
|
-
const eventHandlersRef = useRef({});
|
26
|
-
const eventHandlers = {};
|
27
|
-
for (const [name, value] of Object.entries(props)) {
|
28
|
-
if (value === void 0) {
|
29
|
-
continue;
|
30
|
-
}
|
31
|
-
if (propNames.includes(name)) {
|
32
|
-
properties[name] = value;
|
33
|
-
continue;
|
34
|
-
}
|
35
|
-
if (name.startsWith("on")) {
|
36
|
-
const lowerCaseEventName = name.slice(2).toLowerCase();
|
37
|
-
const eventName = lowerCaseEventNameMap[lowerCaseEventName];
|
38
|
-
const handler = value;
|
39
|
-
if (eventName && handler) {
|
40
|
-
const extractDetail = eventName.endsWith("Change");
|
41
|
-
const normalizedHandler = extractDetail ? (event) => {
|
42
|
-
handler(event.detail);
|
43
|
-
} : handler;
|
44
|
-
eventHandlers[eventName] = normalizedHandler;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
if (name === "className") {
|
48
|
-
attributes["class"] = value;
|
49
|
-
} else {
|
50
|
-
attributes[name] = value;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
const editor = useEditorContext();
|
54
|
-
if (hasEditor && editor && !properties["editor"]) {
|
55
|
-
properties["editor"] = editor;
|
56
|
-
}
|
57
|
-
useIsomorphicLayoutEffect(() => {
|
58
|
-
if (!el) return;
|
59
|
-
for (const [name, value] of Object.entries(properties)) {
|
60
|
-
if (value !== void 0) {
|
61
|
-
el[name] = value;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}, [el, ...propNames.map((name) => properties[name])]);
|
65
|
-
useIsomorphicLayoutEffect(() => {
|
66
|
-
eventHandlersRef.current = eventHandlers;
|
67
|
-
});
|
68
|
-
useIsomorphicLayoutEffect(() => {
|
69
|
-
if (!el) {
|
70
|
-
return;
|
71
|
-
}
|
72
|
-
const fixedEventHandlers = {};
|
73
|
-
for (const eventName of eventNames) {
|
74
|
-
fixedEventHandlers[eventName] = (event) => {
|
75
|
-
eventHandlersRef.current[eventName]?.(event);
|
76
|
-
};
|
77
|
-
}
|
78
|
-
for (const [name, handler] of Object.entries(fixedEventHandlers)) {
|
79
|
-
el.addEventListener(name, handler);
|
80
|
-
}
|
81
|
-
return () => {
|
82
|
-
for (const [name, handler] of Object.entries(fixedEventHandlers)) {
|
83
|
-
el.removeEventListener(name, handler);
|
84
|
-
}
|
85
|
-
};
|
86
|
-
}, [el]);
|
87
|
-
return createElement(tagName, {
|
88
|
-
...attributes,
|
89
|
-
ref: mergeRefs([ref, setEl])
|
90
|
-
});
|
91
|
-
});
|
92
|
-
Component.displayName = displayName;
|
93
|
-
return Component;
|
94
|
-
}
|
95
|
-
|
96
|
-
export {
|
97
|
-
createComponent
|
98
|
-
};
|