@prosekit/solid 0.3.29 → 0.4.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.
@@ -1,24 +1,27 @@
1
1
  import { Accessor } from 'solid-js';
2
2
  import type { Attrs } from '@prosekit/pm/model';
3
3
  import { AutocompleteEmptyElement } from '@prosekit/web/autocomplete';
4
- import { AutocompleteEmptyProps } from '@prosekit/web/autocomplete';
4
+ import { AutocompleteEmptyEvents } from '@prosekit/web/autocomplete';
5
+ import { AutocompleteEmptyProps as AutocompleteEmptyProps_2 } from '@prosekit/web/autocomplete';
5
6
  import { AutocompleteItemElement } from '@prosekit/web/autocomplete';
6
- import { AutocompleteItemProps } from '@prosekit/web/autocomplete';
7
+ import { AutocompleteItemEvents } from '@prosekit/web/autocomplete';
8
+ import { AutocompleteItemProps as AutocompleteItemProps_2 } from '@prosekit/web/autocomplete';
7
9
  import { AutocompleteListElement } from '@prosekit/web/autocomplete';
8
- import { AutocompleteListProps } from '@prosekit/web/autocomplete';
10
+ import { AutocompleteListEvents } from '@prosekit/web/autocomplete';
11
+ import { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/web/autocomplete';
9
12
  import { AutocompletePopoverElement } from '@prosekit/web/autocomplete';
10
- import { AutocompletePopoverProps } from '@prosekit/web/autocomplete';
13
+ import { AutocompletePopoverEvents } from '@prosekit/web/autocomplete';
14
+ import { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/web/autocomplete';
11
15
  import { BaseNodeViewOptions } from '@prosekit/core';
12
- import { BlockDragHandleElement } from '@prosekit/web/block-handle';
13
- import { BlockDragHandleProps } from '@prosekit/web/block-handle';
14
16
  import { BlockHandleAddElement } from '@prosekit/web/block-handle';
15
- import { BlockHandleAddProps } from '@prosekit/web/block-handle';
17
+ import { BlockHandleAddEvents } from '@prosekit/web/block-handle';
18
+ import { BlockHandleAddProps as BlockHandleAddProps_2 } from '@prosekit/web/block-handle';
16
19
  import { BlockHandleDraggableElement } from '@prosekit/web/block-handle';
17
- import { BlockHandleDraggableProps } from '@prosekit/web/block-handle';
20
+ import { BlockHandleDraggableEvents } from '@prosekit/web/block-handle';
21
+ import { BlockHandleDraggableProps as BlockHandleDraggableProps_2 } from '@prosekit/web/block-handle';
18
22
  import { BlockHandlePopoverElement } from '@prosekit/web/block-handle';
19
- import { BlockHandlePopoverProps } from '@prosekit/web/block-handle';
20
- import { BlockPopoverElement } from '@prosekit/web/block-handle';
21
- import { BlockPopoverProps } from '@prosekit/web/block-handle';
23
+ import { BlockHandlePopoverEvents } from '@prosekit/web/block-handle';
24
+ import { BlockHandlePopoverProps as BlockHandlePopoverProps_2 } from '@prosekit/web/block-handle';
22
25
  import { Component } from 'solid-js';
23
26
  import { ContextProviderComponent } from 'solid-js';
24
27
  import type { Decoration } from '@prosekit/pm/view';
@@ -29,87 +32,163 @@ import type { EditorState } from '@prosekit/pm/state';
29
32
  import type { EditorView } from '@prosekit/pm/view';
30
33
  import { Extension } from '@prosekit/core';
31
34
  import { InlinePopoverElement } from '@prosekit/web/inline-popover';
32
- import { InlinePopoverProps } from '@prosekit/web/inline-popover';
35
+ import { InlinePopoverEvents } from '@prosekit/web/inline-popover';
36
+ import { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/web/inline-popover';
33
37
  import { JSX } from 'solid-js';
34
38
  import type { JSXElement } from 'solid-js';
35
39
  import { Keymap } from '@prosekit/core';
36
40
  import { Options } from 'tsup';
37
41
  import { ParentProps } from 'solid-js';
38
42
  import { PopoverContentElement } from '@prosekit/web/popover';
39
- import { PopoverContentProps } from '@prosekit/web/popover';
43
+ import { PopoverContentEvents } from '@prosekit/web/popover';
44
+ import { PopoverContentProps as PopoverContentProps_2 } from '@prosekit/web/popover';
40
45
  import { PopoverRootElement } from '@prosekit/web/popover';
41
- import { PopoverRootProps } from '@prosekit/web/popover';
46
+ import { PopoverRootEvents } from '@prosekit/web/popover';
47
+ import { PopoverRootProps as PopoverRootProps_2 } from '@prosekit/web/popover';
42
48
  import { PopoverTriggerElement } from '@prosekit/web/popover';
43
- import { PopoverTriggerProps } from '@prosekit/web/popover';
49
+ import { PopoverTriggerEvents } from '@prosekit/web/popover';
50
+ import { PopoverTriggerProps as PopoverTriggerProps_2 } from '@prosekit/web/popover';
44
51
  import { Priority } from '@prosekit/core';
45
52
  import type { ProseMirrorNode } from '@prosekit/pm/model';
46
53
  import { ResizableHandleElement } from '@prosekit/web/resizable';
47
- import { ResizableHandleProps } from '@prosekit/web/resizable';
54
+ import { ResizableHandleEvents } from '@prosekit/web/resizable';
55
+ import { ResizableHandleProps as ResizableHandleProps_2 } from '@prosekit/web/resizable';
48
56
  import { ResizableRootElement } from '@prosekit/web/resizable';
49
- import { ResizableRootProps } from '@prosekit/web/resizable';
57
+ import { ResizableRootEvents } from '@prosekit/web/resizable';
58
+ import { ResizableRootProps as ResizableRootProps_2 } from '@prosekit/web/resizable';
50
59
  import { TableHandleColumnRootElement } from '@prosekit/web/table-handle';
51
- import { TableHandleColumnRootProps } from '@prosekit/web/table-handle';
60
+ import { TableHandleColumnRootEvents } from '@prosekit/web/table-handle';
61
+ import { TableHandleColumnRootProps as TableHandleColumnRootProps_2 } from '@prosekit/web/table-handle';
52
62
  import { TableHandleColumnTriggerElement } from '@prosekit/web/table-handle';
53
- import { TableHandleColumnTriggerProps } from '@prosekit/web/table-handle';
63
+ import { TableHandleColumnTriggerEvents } from '@prosekit/web/table-handle';
64
+ import { TableHandleColumnTriggerProps as TableHandleColumnTriggerProps_2 } from '@prosekit/web/table-handle';
54
65
  import { TableHandlePopoverContentElement } from '@prosekit/web/table-handle';
55
- import { TableHandlePopoverContentProps } from '@prosekit/web/table-handle';
66
+ import { TableHandlePopoverContentEvents } from '@prosekit/web/table-handle';
67
+ import { TableHandlePopoverContentProps as TableHandlePopoverContentProps_2 } from '@prosekit/web/table-handle';
56
68
  import { TableHandlePopoverItemElement } from '@prosekit/web/table-handle';
57
- import { TableHandlePopoverItemProps } from '@prosekit/web/table-handle';
69
+ import { TableHandlePopoverItemEvents } from '@prosekit/web/table-handle';
70
+ import { TableHandlePopoverItemProps as TableHandlePopoverItemProps_2 } from '@prosekit/web/table-handle';
58
71
  import { TableHandleRootElement } from '@prosekit/web/table-handle';
59
- import { TableHandleRootProps } from '@prosekit/web/table-handle';
72
+ import { TableHandleRootEvents } from '@prosekit/web/table-handle';
73
+ import { TableHandleRootProps as TableHandleRootProps_2 } from '@prosekit/web/table-handle';
60
74
  import { TableHandleRowRootElement } from '@prosekit/web/table-handle';
61
- import { TableHandleRowRootProps } from '@prosekit/web/table-handle';
75
+ import { TableHandleRowRootEvents } from '@prosekit/web/table-handle';
76
+ import { TableHandleRowRootProps as TableHandleRowRootProps_2 } from '@prosekit/web/table-handle';
62
77
  import { TableHandleRowTriggerElement } from '@prosekit/web/table-handle';
63
- import { TableHandleRowTriggerProps } from '@prosekit/web/table-handle';
78
+ import { TableHandleRowTriggerEvents } from '@prosekit/web/table-handle';
79
+ import { TableHandleRowTriggerProps as TableHandleRowTriggerProps_2 } from '@prosekit/web/table-handle';
64
80
  import { TooltipContentElement } from '@prosekit/web/tooltip';
65
- import { TooltipContentProps } from '@prosekit/web/tooltip';
81
+ import { TooltipContentEvents } from '@prosekit/web/tooltip';
82
+ import { TooltipContentProps as TooltipContentProps_2 } from '@prosekit/web/tooltip';
66
83
  import { TooltipRootElement } from '@prosekit/web/tooltip';
67
- import { TooltipRootProps } from '@prosekit/web/tooltip';
84
+ import { TooltipRootEvents } from '@prosekit/web/tooltip';
85
+ import { TooltipRootProps as TooltipRootProps_2 } from '@prosekit/web/tooltip';
68
86
  import { TooltipTriggerElement } from '@prosekit/web/tooltip';
69
- import { TooltipTriggerProps } from '@prosekit/web/tooltip';
87
+ import { TooltipTriggerEvents } from '@prosekit/web/tooltip';
88
+ import { TooltipTriggerProps as TooltipTriggerProps_2 } from '@prosekit/web/tooltip';
70
89
 
71
90
  declare const AutocompleteEmpty: Component<Partial<AutocompleteEmptyProps> & JSX<AutocompleteEmptyElement>>;
72
91
  export { AutocompleteEmpty }
73
92
  export { AutocompleteEmpty as AutocompleteEmpty_alias_1 }
74
93
 
94
+ /**
95
+ * Props for the {@link AutocompleteEmpty} component.
96
+ */
97
+ declare interface AutocompleteEmptyProps extends Partial<CreateProps<AutocompleteEmptyProps_2, AutocompleteEmptyEvents>> {
98
+ }
99
+ export { AutocompleteEmptyProps }
100
+ export { AutocompleteEmptyProps as AutocompleteEmptyProps_alias_1 }
101
+
75
102
  declare const AutocompleteItem: Component<Partial<AutocompleteItemProps> & JSX<AutocompleteItemElement>>;
76
103
  export { AutocompleteItem }
77
104
  export { AutocompleteItem as AutocompleteItem_alias_1 }
78
105
 
106
+ /**
107
+ * Props for the {@link AutocompleteItem} component.
108
+ */
109
+ declare interface AutocompleteItemProps extends Partial<CreateProps<AutocompleteItemProps_2, AutocompleteItemEvents>> {
110
+ }
111
+ export { AutocompleteItemProps }
112
+ export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
113
+
79
114
  declare const AutocompleteList: Component<Partial<AutocompleteListProps> & JSX<AutocompleteListElement>>;
80
115
  export { AutocompleteList }
81
116
  export { AutocompleteList as AutocompleteList_alias_1 }
82
117
 
118
+ /**
119
+ * Props for the {@link AutocompleteList} component.
120
+ */
121
+ declare interface AutocompleteListProps extends Partial<CreateProps<AutocompleteListProps_2, AutocompleteListEvents>> {
122
+ }
123
+ export { AutocompleteListProps }
124
+ export { AutocompleteListProps as AutocompleteListProps_alias_1 }
125
+
83
126
  declare const AutocompletePopover: Component<Partial<AutocompletePopoverProps> & JSX<AutocompletePopoverElement>>;
84
127
  export { AutocompletePopover }
85
128
  export { AutocompletePopover as AutocompletePopover_alias_1 }
86
129
 
87
- declare const BlockDragHandle: Component<Partial<BlockDragHandleProps> & JSX<BlockDragHandleElement>>;
88
- export { BlockDragHandle }
89
- export { BlockDragHandle as BlockDragHandle_alias_1 }
130
+ /**
131
+ * Props for the {@link AutocompletePopover} component.
132
+ */
133
+ declare interface AutocompletePopoverProps extends Partial<CreateProps<AutocompletePopoverProps_2, AutocompletePopoverEvents>> {
134
+ }
135
+ export { AutocompletePopoverProps }
136
+ export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
90
137
 
91
138
  declare const BlockHandleAdd: Component<Partial<BlockHandleAddProps> & JSX<BlockHandleAddElement>>;
92
139
  export { BlockHandleAdd }
93
140
  export { BlockHandleAdd as BlockHandleAdd_alias_1 }
94
141
 
142
+ /**
143
+ * Props for the {@link BlockHandleAdd} component.
144
+ */
145
+ declare interface BlockHandleAddProps extends Partial<CreateProps<BlockHandleAddProps_2, BlockHandleAddEvents>> {
146
+ }
147
+ export { BlockHandleAddProps }
148
+ export { BlockHandleAddProps as BlockHandleAddProps_alias_1 }
149
+
95
150
  declare const BlockHandleDraggable: Component<Partial<BlockHandleDraggableProps> & JSX<BlockHandleDraggableElement>>;
96
151
  export { BlockHandleDraggable }
97
152
  export { BlockHandleDraggable as BlockHandleDraggable_alias_1 }
98
153
 
154
+ /**
155
+ * Props for the {@link BlockHandleDraggable} component.
156
+ */
157
+ declare interface BlockHandleDraggableProps extends Partial<CreateProps<BlockHandleDraggableProps_2, BlockHandleDraggableEvents>> {
158
+ }
159
+ export { BlockHandleDraggableProps }
160
+ export { BlockHandleDraggableProps as BlockHandleDraggableProps_alias_1 }
161
+
99
162
  declare const BlockHandlePopover: Component<Partial<BlockHandlePopoverProps> & JSX<BlockHandlePopoverElement>>;
100
163
  export { BlockHandlePopover }
101
164
  export { BlockHandlePopover as BlockHandlePopover_alias_1 }
102
165
 
103
- declare const BlockPopover: Component<Partial<BlockPopoverProps> & JSX<BlockPopoverElement>>;
104
- export { BlockPopover }
105
- export { BlockPopover as BlockPopover_alias_1 }
166
+ /**
167
+ * Props for the {@link BlockHandlePopover} component.
168
+ */
169
+ declare interface BlockHandlePopoverProps extends Partial<CreateProps<BlockHandlePopoverProps_2, BlockHandlePopoverEvents>> {
170
+ }
171
+ export { BlockHandlePopoverProps }
172
+ export { BlockHandlePopoverProps as BlockHandlePopoverProps_alias_1 }
106
173
 
107
174
  /**
108
175
  * @internal
109
176
  */
110
177
  export declare function consumeSolidViews(): void;
111
178
 
112
- export declare function createComponent<Props extends object, CustomElement extends HTMLElement>(tagName: string, defaultProps: Props): Component<Partial<Props> & JSX.HTMLAttributes<CustomElement>>;
179
+ export declare function createComponent<Props extends object, CustomElement extends HTMLElement>(tagName: string, propNames: string[], eventNames: string[]): Component<Partial<Props> & JSX.HTMLAttributes<CustomElement>>;
180
+
181
+ declare type CreateEventProps<Events extends {
182
+ [EventName in keyof Events]: CustomEvent;
183
+ }> = {
184
+ [EventName in keyof Events as `on${Capitalize<string & EventName>}`]: (event: EventName extends `${string}Change` ? Events[EventName]['detail'] : Events[EventName]) => void;
185
+ };
186
+
187
+ export declare type CreateProps<Props extends {
188
+ [PropName in keyof Props]: unknown;
189
+ }, Events extends {
190
+ [EventName in keyof Events]: CustomEvent;
191
+ }> = Props & CreateEventProps<Events>;
113
192
 
114
193
  export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
115
194
 
@@ -133,6 +212,14 @@ declare const InlinePopover: Component<Partial<InlinePopoverProps> & JSX<InlineP
133
212
  export { InlinePopover }
134
213
  export { InlinePopover as InlinePopover_alias_1 }
135
214
 
215
+ /**
216
+ * Props for the {@link InlinePopover} component.
217
+ */
218
+ declare interface InlinePopoverProps extends Partial<CreateProps<InlinePopoverProps_2, InlinePopoverEvents>> {
219
+ }
220
+ export { InlinePopoverProps }
221
+ export { InlinePopoverProps as InlinePopoverProps_alias_1 }
222
+
136
223
  /**
137
224
  * T or a reactive/non-reactive function returning T
138
225
  */
@@ -160,14 +247,38 @@ declare const PopoverContent: Component<Partial<PopoverContentProps> & JSX<Popov
160
247
  export { PopoverContent }
161
248
  export { PopoverContent as PopoverContent_alias_1 }
162
249
 
250
+ /**
251
+ * Props for the {@link PopoverContent} component.
252
+ */
253
+ declare interface PopoverContentProps extends Partial<CreateProps<PopoverContentProps_2, PopoverContentEvents>> {
254
+ }
255
+ export { PopoverContentProps }
256
+ export { PopoverContentProps as PopoverContentProps_alias_1 }
257
+
163
258
  declare const PopoverRoot: Component<Partial<PopoverRootProps> & JSX<PopoverRootElement>>;
164
259
  export { PopoverRoot }
165
260
  export { PopoverRoot as PopoverRoot_alias_1 }
166
261
 
262
+ /**
263
+ * Props for the {@link PopoverRoot} component.
264
+ */
265
+ declare interface PopoverRootProps extends Partial<CreateProps<PopoverRootProps_2, PopoverRootEvents>> {
266
+ }
267
+ export { PopoverRootProps }
268
+ export { PopoverRootProps as PopoverRootProps_alias_1 }
269
+
167
270
  declare const PopoverTrigger: Component<Partial<PopoverTriggerProps> & JSX<PopoverTriggerElement>>;
168
271
  export { PopoverTrigger }
169
272
  export { PopoverTrigger as PopoverTrigger_alias_1 }
170
273
 
274
+ /**
275
+ * Props for the {@link PopoverTrigger} component.
276
+ */
277
+ declare interface PopoverTriggerProps extends Partial<CreateProps<PopoverTriggerProps_2, PopoverTriggerEvents>> {
278
+ }
279
+ export { PopoverTriggerProps }
280
+ export { PopoverTriggerProps as PopoverTriggerProps_alias_1 }
281
+
171
282
  /**
172
283
  * @internal
173
284
  */
@@ -205,10 +316,26 @@ declare const ResizableHandle: Component<Partial<ResizableHandleProps> & JSX<Res
205
316
  export { ResizableHandle }
206
317
  export { ResizableHandle as ResizableHandle_alias_1 }
207
318
 
319
+ /**
320
+ * Props for the {@link ResizableHandle} component.
321
+ */
322
+ declare interface ResizableHandleProps extends Partial<CreateProps<ResizableHandleProps_2, ResizableHandleEvents>> {
323
+ }
324
+ export { ResizableHandleProps }
325
+ export { ResizableHandleProps as ResizableHandleProps_alias_1 }
326
+
208
327
  declare const ResizableRoot: Component<Partial<ResizableRootProps> & JSX<ResizableRootElement>>;
209
328
  export { ResizableRoot }
210
329
  export { ResizableRoot as ResizableRoot_alias_1 }
211
330
 
331
+ /**
332
+ * Props for the {@link ResizableRoot} component.
333
+ */
334
+ declare interface ResizableRootProps extends Partial<CreateProps<ResizableRootProps_2, ResizableRootEvents>> {
335
+ }
336
+ export { ResizableRootProps }
337
+ export { ResizableRootProps as ResizableRootProps_alias_1 }
338
+
212
339
  /**
213
340
  * @public
214
341
  */
@@ -254,42 +381,122 @@ declare const TableHandleColumnRoot: Component<Partial<TableHandleColumnRootProp
254
381
  export { TableHandleColumnRoot }
255
382
  export { TableHandleColumnRoot as TableHandleColumnRoot_alias_1 }
256
383
 
384
+ /**
385
+ * Props for the {@link TableHandleColumnRoot} component.
386
+ */
387
+ declare interface TableHandleColumnRootProps extends Partial<CreateProps<TableHandleColumnRootProps_2, TableHandleColumnRootEvents>> {
388
+ }
389
+ export { TableHandleColumnRootProps }
390
+ export { TableHandleColumnRootProps as TableHandleColumnRootProps_alias_1 }
391
+
257
392
  declare const TableHandleColumnTrigger: Component<Partial<TableHandleColumnTriggerProps> & JSX<TableHandleColumnTriggerElement>>;
258
393
  export { TableHandleColumnTrigger }
259
394
  export { TableHandleColumnTrigger as TableHandleColumnTrigger_alias_1 }
260
395
 
396
+ /**
397
+ * Props for the {@link TableHandleColumnTrigger} component.
398
+ */
399
+ declare interface TableHandleColumnTriggerProps extends Partial<CreateProps<TableHandleColumnTriggerProps_2, TableHandleColumnTriggerEvents>> {
400
+ }
401
+ export { TableHandleColumnTriggerProps }
402
+ export { TableHandleColumnTriggerProps as TableHandleColumnTriggerProps_alias_1 }
403
+
261
404
  declare const TableHandlePopoverContent: Component<Partial<TableHandlePopoverContentProps> & JSX<TableHandlePopoverContentElement>>;
262
405
  export { TableHandlePopoverContent }
263
406
  export { TableHandlePopoverContent as TableHandlePopoverContent_alias_1 }
264
407
 
408
+ /**
409
+ * Props for the {@link TableHandlePopoverContent} component.
410
+ */
411
+ declare interface TableHandlePopoverContentProps extends Partial<CreateProps<TableHandlePopoverContentProps_2, TableHandlePopoverContentEvents>> {
412
+ }
413
+ export { TableHandlePopoverContentProps }
414
+ export { TableHandlePopoverContentProps as TableHandlePopoverContentProps_alias_1 }
415
+
265
416
  declare const TableHandlePopoverItem: Component<Partial<TableHandlePopoverItemProps> & JSX<TableHandlePopoverItemElement>>;
266
417
  export { TableHandlePopoverItem }
267
418
  export { TableHandlePopoverItem as TableHandlePopoverItem_alias_1 }
268
419
 
420
+ /**
421
+ * Props for the {@link TableHandlePopoverItem} component.
422
+ */
423
+ declare interface TableHandlePopoverItemProps extends Partial<CreateProps<TableHandlePopoverItemProps_2, TableHandlePopoverItemEvents>> {
424
+ }
425
+ export { TableHandlePopoverItemProps }
426
+ export { TableHandlePopoverItemProps as TableHandlePopoverItemProps_alias_1 }
427
+
269
428
  declare const TableHandleRoot: Component<Partial<TableHandleRootProps> & JSX<TableHandleRootElement>>;
270
429
  export { TableHandleRoot }
271
430
  export { TableHandleRoot as TableHandleRoot_alias_1 }
272
431
 
432
+ /**
433
+ * Props for the {@link TableHandleRoot} component.
434
+ */
435
+ declare interface TableHandleRootProps extends Partial<CreateProps<TableHandleRootProps_2, TableHandleRootEvents>> {
436
+ }
437
+ export { TableHandleRootProps }
438
+ export { TableHandleRootProps as TableHandleRootProps_alias_1 }
439
+
273
440
  declare const TableHandleRowRoot: Component<Partial<TableHandleRowRootProps> & JSX<TableHandleRowRootElement>>;
274
441
  export { TableHandleRowRoot }
275
442
  export { TableHandleRowRoot as TableHandleRowRoot_alias_1 }
276
443
 
444
+ /**
445
+ * Props for the {@link TableHandleRowRoot} component.
446
+ */
447
+ declare interface TableHandleRowRootProps extends Partial<CreateProps<TableHandleRowRootProps_2, TableHandleRowRootEvents>> {
448
+ }
449
+ export { TableHandleRowRootProps }
450
+ export { TableHandleRowRootProps as TableHandleRowRootProps_alias_1 }
451
+
277
452
  declare const TableHandleRowTrigger: Component<Partial<TableHandleRowTriggerProps> & JSX<TableHandleRowTriggerElement>>;
278
453
  export { TableHandleRowTrigger }
279
454
  export { TableHandleRowTrigger as TableHandleRowTrigger_alias_1 }
280
455
 
456
+ /**
457
+ * Props for the {@link TableHandleRowTrigger} component.
458
+ */
459
+ declare interface TableHandleRowTriggerProps extends Partial<CreateProps<TableHandleRowTriggerProps_2, TableHandleRowTriggerEvents>> {
460
+ }
461
+ export { TableHandleRowTriggerProps }
462
+ export { TableHandleRowTriggerProps as TableHandleRowTriggerProps_alias_1 }
463
+
281
464
  declare const TooltipContent: Component<Partial<TooltipContentProps> & JSX<TooltipContentElement>>;
282
465
  export { TooltipContent }
283
466
  export { TooltipContent as TooltipContent_alias_1 }
284
467
 
468
+ /**
469
+ * Props for the {@link TooltipContent} component.
470
+ */
471
+ declare interface TooltipContentProps extends Partial<CreateProps<TooltipContentProps_2, TooltipContentEvents>> {
472
+ }
473
+ export { TooltipContentProps }
474
+ export { TooltipContentProps as TooltipContentProps_alias_1 }
475
+
285
476
  declare const TooltipRoot: Component<Partial<TooltipRootProps> & JSX<TooltipRootElement>>;
286
477
  export { TooltipRoot }
287
478
  export { TooltipRoot as TooltipRoot_alias_1 }
288
479
 
480
+ /**
481
+ * Props for the {@link TooltipRoot} component.
482
+ */
483
+ declare interface TooltipRootProps extends Partial<CreateProps<TooltipRootProps_2, TooltipRootEvents>> {
484
+ }
485
+ export { TooltipRootProps }
486
+ export { TooltipRootProps as TooltipRootProps_alias_1 }
487
+
289
488
  declare const TooltipTrigger: Component<Partial<TooltipTriggerProps> & JSX<TooltipTriggerElement>>;
290
489
  export { TooltipTrigger }
291
490
  export { TooltipTrigger as TooltipTrigger_alias_1 }
292
491
 
492
+ /**
493
+ * Props for the {@link TooltipTrigger} component.
494
+ */
495
+ declare interface TooltipTriggerProps extends Partial<CreateProps<TooltipTriggerProps_2, TooltipTriggerEvents>> {
496
+ }
497
+ export { TooltipTriggerProps }
498
+ export { TooltipTriggerProps as TooltipTriggerProps_alias_1 }
499
+
293
500
  /**
294
501
  * Accesses the value of a MaybeAccessor
295
502
  *
@@ -0,0 +1,45 @@
1
+ import {
2
+ useEditorContext
3
+ } from "./chunk-XXXIBXNC.js";
4
+
5
+ // src/components/create-component.ts
6
+ import h from "solid-js/h";
7
+ function createComponent(tagName, propNames, eventNames) {
8
+ const hasEditor = propNames.includes("editor");
9
+ const lowerCaseEventNameMap = Object.fromEntries(
10
+ eventNames.map((name) => [name.toLowerCase(), name])
11
+ );
12
+ const Component = (props) => {
13
+ const properties = {};
14
+ const eventHandlers = {};
15
+ for (const name of Object.keys(props)) {
16
+ if (propNames.includes(name)) {
17
+ properties["prop:" + name] = () => props[name];
18
+ continue;
19
+ }
20
+ if (name.startsWith("on")) {
21
+ const lowerCaseEventName = name.slice(2).toLowerCase();
22
+ const eventName = lowerCaseEventNameMap[lowerCaseEventName];
23
+ if (eventName) {
24
+ const extractDetail = eventName.endsWith("Change");
25
+ eventHandlers["on:" + eventName] = (event) => {
26
+ const handler = props[name];
27
+ handler(extractDetail ? event.detail : event);
28
+ };
29
+ continue;
30
+ }
31
+ }
32
+ properties[name] = () => props[name];
33
+ }
34
+ const editor = useEditorContext();
35
+ if (hasEditor && editor) {
36
+ properties["prop:editor"] = () => props["editor"] || editor;
37
+ }
38
+ return h(tagName, { ...properties, ...eventHandlers });
39
+ };
40
+ return Component;
41
+ }
42
+
43
+ export {
44
+ createComponent
45
+ };
@@ -1,4 +1,8 @@
1
1
  export { AutocompleteEmpty_alias_1 as AutocompleteEmpty } from './_tsup-dts-rollup';
2
+ export { AutocompleteEmptyProps_alias_1 as AutocompleteEmptyProps } from './_tsup-dts-rollup';
2
3
  export { AutocompleteItem_alias_1 as AutocompleteItem } from './_tsup-dts-rollup';
4
+ export { AutocompleteItemProps_alias_1 as AutocompleteItemProps } from './_tsup-dts-rollup';
3
5
  export { AutocompleteList_alias_1 as AutocompleteList } from './_tsup-dts-rollup';
6
+ export { AutocompleteListProps_alias_1 as AutocompleteListProps } from './_tsup-dts-rollup';
4
7
  export { AutocompletePopover_alias_1 as AutocompletePopover } from './_tsup-dts-rollup';
8
+ export { AutocompletePopoverProps_alias_1 as AutocompletePopoverProps } from './_tsup-dts-rollup';
@@ -1,42 +1,50 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/autocomplete/autocomplete-empty.gen.ts
7
7
  import {
8
- defaultAutocompleteEmptyProps
8
+ autocompleteEmptyProps,
9
+ autocompleteEmptyEvents
9
10
  } from "@prosekit/web/autocomplete";
10
11
  var AutocompleteEmpty = createComponent(
11
12
  "prosekit-autocomplete-empty",
12
- defaultAutocompleteEmptyProps
13
+ Object.keys(autocompleteEmptyProps),
14
+ Object.keys(autocompleteEmptyEvents)
13
15
  );
14
16
 
15
17
  // src/components/autocomplete/autocomplete-item.gen.ts
16
18
  import {
17
- defaultAutocompleteItemProps
19
+ autocompleteItemProps,
20
+ autocompleteItemEvents
18
21
  } from "@prosekit/web/autocomplete";
19
22
  var AutocompleteItem = createComponent(
20
23
  "prosekit-autocomplete-item",
21
- defaultAutocompleteItemProps
24
+ Object.keys(autocompleteItemProps),
25
+ Object.keys(autocompleteItemEvents)
22
26
  );
23
27
 
24
28
  // src/components/autocomplete/autocomplete-list.gen.ts
25
29
  import {
26
- defaultAutocompleteListProps
30
+ autocompleteListProps,
31
+ autocompleteListEvents
27
32
  } from "@prosekit/web/autocomplete";
28
33
  var AutocompleteList = createComponent(
29
34
  "prosekit-autocomplete-list",
30
- defaultAutocompleteListProps
35
+ Object.keys(autocompleteListProps),
36
+ Object.keys(autocompleteListEvents)
31
37
  );
32
38
 
33
39
  // src/components/autocomplete/autocomplete-popover.gen.ts
34
40
  import {
35
- defaultAutocompletePopoverProps
41
+ autocompletePopoverProps,
42
+ autocompletePopoverEvents
36
43
  } from "@prosekit/web/autocomplete";
37
44
  var AutocompletePopover = createComponent(
38
45
  "prosekit-autocomplete-popover",
39
- defaultAutocompletePopoverProps
46
+ Object.keys(autocompletePopoverProps),
47
+ Object.keys(autocompletePopoverEvents)
40
48
  );
41
49
  export {
42
50
  AutocompleteEmpty,
@@ -1,5 +1,6 @@
1
- export { BlockDragHandle_alias_1 as BlockDragHandle } from './_tsup-dts-rollup';
2
1
  export { BlockHandleAdd_alias_1 as BlockHandleAdd } from './_tsup-dts-rollup';
2
+ export { BlockHandleAddProps_alias_1 as BlockHandleAddProps } from './_tsup-dts-rollup';
3
3
  export { BlockHandleDraggable_alias_1 as BlockHandleDraggable } from './_tsup-dts-rollup';
4
+ export { BlockHandleDraggableProps_alias_1 as BlockHandleDraggableProps } from './_tsup-dts-rollup';
4
5
  export { BlockHandlePopover_alias_1 as BlockHandlePopover } from './_tsup-dts-rollup';
5
- export { BlockPopover_alias_1 as BlockPopover } from './_tsup-dts-rollup';
6
+ export { BlockHandlePopoverProps_alias_1 as BlockHandlePopoverProps } from './_tsup-dts-rollup';
@@ -1,56 +1,42 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
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
- defaultBlockDragHandleProps
13
- );
14
-
15
6
  // src/components/block-handle/block-handle-add.gen.ts
16
7
  import {
17
- defaultBlockHandleAddProps
8
+ blockHandleAddProps,
9
+ blockHandleAddEvents
18
10
  } from "@prosekit/web/block-handle";
19
11
  var BlockHandleAdd = createComponent(
20
12
  "prosekit-block-handle-add",
21
- defaultBlockHandleAddProps
13
+ Object.keys(blockHandleAddProps),
14
+ Object.keys(blockHandleAddEvents)
22
15
  );
23
16
 
24
17
  // src/components/block-handle/block-handle-draggable.gen.ts
25
18
  import {
26
- defaultBlockHandleDraggableProps
19
+ blockHandleDraggableProps,
20
+ blockHandleDraggableEvents
27
21
  } from "@prosekit/web/block-handle";
28
22
  var BlockHandleDraggable = createComponent(
29
23
  "prosekit-block-handle-draggable",
30
- defaultBlockHandleDraggableProps
24
+ Object.keys(blockHandleDraggableProps),
25
+ Object.keys(blockHandleDraggableEvents)
31
26
  );
32
27
 
33
28
  // src/components/block-handle/block-handle-popover.gen.ts
34
29
  import {
35
- defaultBlockHandlePopoverProps
30
+ blockHandlePopoverProps,
31
+ blockHandlePopoverEvents
36
32
  } from "@prosekit/web/block-handle";
37
33
  var BlockHandlePopover = createComponent(
38
34
  "prosekit-block-handle-popover",
39
- defaultBlockHandlePopoverProps
40
- );
41
-
42
- // src/components/block-handle/block-popover.gen.ts
43
- import {
44
- defaultBlockPopoverProps
45
- } from "@prosekit/web/block-handle";
46
- var BlockPopover = createComponent(
47
- "prosekit-block-popover",
48
- defaultBlockPopoverProps
35
+ Object.keys(blockHandlePopoverProps),
36
+ Object.keys(blockHandlePopoverEvents)
49
37
  );
50
38
  export {
51
- BlockDragHandle,
52
39
  BlockHandleAdd,
53
40
  BlockHandleDraggable,
54
- BlockHandlePopover,
55
- BlockPopover
41
+ BlockHandlePopover
56
42
  };
@@ -1 +1,2 @@
1
1
  export { InlinePopover } from './_tsup-dts-rollup';
2
+ export { InlinePopoverProps } from './_tsup-dts-rollup';
@@ -1,15 +1,17 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/inline-popover/inline-popover.gen.ts
7
7
  import {
8
- defaultInlinePopoverProps
8
+ inlinePopoverProps,
9
+ inlinePopoverEvents
9
10
  } from "@prosekit/web/inline-popover";
10
11
  var InlinePopover = createComponent(
11
12
  "prosekit-inline-popover",
12
- defaultInlinePopoverProps
13
+ Object.keys(inlinePopoverProps),
14
+ Object.keys(inlinePopoverEvents)
13
15
  );
14
16
  export {
15
17
  InlinePopover
@@ -1,3 +1,6 @@
1
1
  export { PopoverContent } from './_tsup-dts-rollup';
2
+ export { PopoverContentProps } from './_tsup-dts-rollup';
2
3
  export { PopoverRoot } from './_tsup-dts-rollup';
4
+ export { PopoverRootProps } from './_tsup-dts-rollup';
3
5
  export { PopoverTrigger } from './_tsup-dts-rollup';
6
+ export { PopoverTriggerProps } from './_tsup-dts-rollup';
@@ -1,33 +1,39 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/popover/popover-content.gen.ts
7
7
  import {
8
- defaultPopoverContentProps
8
+ popoverContentProps,
9
+ popoverContentEvents
9
10
  } from "@prosekit/web/popover";
10
11
  var PopoverContent = createComponent(
11
12
  "prosekit-popover-content",
12
- defaultPopoverContentProps
13
+ Object.keys(popoverContentProps),
14
+ Object.keys(popoverContentEvents)
13
15
  );
14
16
 
15
17
  // src/components/popover/popover-root.gen.ts
16
18
  import {
17
- defaultPopoverRootProps
19
+ popoverRootProps,
20
+ popoverRootEvents
18
21
  } from "@prosekit/web/popover";
19
22
  var PopoverRoot = createComponent(
20
23
  "prosekit-popover-root",
21
- defaultPopoverRootProps
24
+ Object.keys(popoverRootProps),
25
+ Object.keys(popoverRootEvents)
22
26
  );
23
27
 
24
28
  // src/components/popover/popover-trigger.gen.ts
25
29
  import {
26
- defaultPopoverTriggerProps
30
+ popoverTriggerProps,
31
+ popoverTriggerEvents
27
32
  } from "@prosekit/web/popover";
28
33
  var PopoverTrigger = createComponent(
29
34
  "prosekit-popover-trigger",
30
- defaultPopoverTriggerProps
35
+ Object.keys(popoverTriggerProps),
36
+ Object.keys(popoverTriggerEvents)
31
37
  );
32
38
  export {
33
39
  PopoverContent,
@@ -1,2 +1,4 @@
1
1
  export { ResizableHandle } from './_tsup-dts-rollup';
2
+ export { ResizableHandleProps } from './_tsup-dts-rollup';
2
3
  export { ResizableRoot } from './_tsup-dts-rollup';
4
+ export { ResizableRootProps } from './_tsup-dts-rollup';
@@ -1,24 +1,28 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/resizable/resizable-handle.gen.ts
7
7
  import {
8
- defaultResizableHandleProps
8
+ resizableHandleProps,
9
+ resizableHandleEvents
9
10
  } from "@prosekit/web/resizable";
10
11
  var ResizableHandle = createComponent(
11
12
  "prosekit-resizable-handle",
12
- defaultResizableHandleProps
13
+ Object.keys(resizableHandleProps),
14
+ Object.keys(resizableHandleEvents)
13
15
  );
14
16
 
15
17
  // src/components/resizable/resizable-root.gen.ts
16
18
  import {
17
- defaultResizableRootProps
19
+ resizableRootProps,
20
+ resizableRootEvents
18
21
  } from "@prosekit/web/resizable";
19
22
  var ResizableRoot = createComponent(
20
23
  "prosekit-resizable-root",
21
- defaultResizableRootProps
24
+ Object.keys(resizableRootProps),
25
+ Object.keys(resizableRootEvents)
22
26
  );
23
27
  export {
24
28
  ResizableHandle,
@@ -1,7 +1,14 @@
1
1
  export { TableHandleColumnRoot } from './_tsup-dts-rollup';
2
+ export { TableHandleColumnRootProps } from './_tsup-dts-rollup';
2
3
  export { TableHandleColumnTrigger } from './_tsup-dts-rollup';
4
+ export { TableHandleColumnTriggerProps } from './_tsup-dts-rollup';
3
5
  export { TableHandlePopoverContent } from './_tsup-dts-rollup';
6
+ export { TableHandlePopoverContentProps } from './_tsup-dts-rollup';
4
7
  export { TableHandlePopoverItem } from './_tsup-dts-rollup';
8
+ export { TableHandlePopoverItemProps } from './_tsup-dts-rollup';
5
9
  export { TableHandleRoot } from './_tsup-dts-rollup';
10
+ export { TableHandleRootProps } from './_tsup-dts-rollup';
6
11
  export { TableHandleRowRoot } from './_tsup-dts-rollup';
12
+ export { TableHandleRowRootProps } from './_tsup-dts-rollup';
7
13
  export { TableHandleRowTrigger } from './_tsup-dts-rollup';
14
+ export { TableHandleRowTriggerProps } from './_tsup-dts-rollup';
@@ -1,69 +1,83 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/table-handle/table-handle-column-root.gen.ts
7
7
  import {
8
- defaultTableHandleColumnRootProps
8
+ tableHandleColumnRootProps,
9
+ tableHandleColumnRootEvents
9
10
  } from "@prosekit/web/table-handle";
10
11
  var TableHandleColumnRoot = createComponent(
11
12
  "prosekit-table-handle-column-root",
12
- defaultTableHandleColumnRootProps
13
+ Object.keys(tableHandleColumnRootProps),
14
+ Object.keys(tableHandleColumnRootEvents)
13
15
  );
14
16
 
15
17
  // src/components/table-handle/table-handle-column-trigger.gen.ts
16
18
  import {
17
- defaultTableHandleColumnTriggerProps
19
+ tableHandleColumnTriggerProps,
20
+ tableHandleColumnTriggerEvents
18
21
  } from "@prosekit/web/table-handle";
19
22
  var TableHandleColumnTrigger = createComponent(
20
23
  "prosekit-table-handle-column-trigger",
21
- defaultTableHandleColumnTriggerProps
24
+ Object.keys(tableHandleColumnTriggerProps),
25
+ Object.keys(tableHandleColumnTriggerEvents)
22
26
  );
23
27
 
24
28
  // src/components/table-handle/table-handle-popover-content.gen.ts
25
29
  import {
26
- defaultTableHandlePopoverContentProps
30
+ tableHandlePopoverContentProps,
31
+ tableHandlePopoverContentEvents
27
32
  } from "@prosekit/web/table-handle";
28
33
  var TableHandlePopoverContent = createComponent(
29
34
  "prosekit-table-handle-popover-content",
30
- defaultTableHandlePopoverContentProps
35
+ Object.keys(tableHandlePopoverContentProps),
36
+ Object.keys(tableHandlePopoverContentEvents)
31
37
  );
32
38
 
33
39
  // src/components/table-handle/table-handle-popover-item.gen.ts
34
40
  import {
35
- defaultTableHandlePopoverItemProps
41
+ tableHandlePopoverItemProps,
42
+ tableHandlePopoverItemEvents
36
43
  } from "@prosekit/web/table-handle";
37
44
  var TableHandlePopoverItem = createComponent(
38
45
  "prosekit-table-handle-popover-item",
39
- defaultTableHandlePopoverItemProps
46
+ Object.keys(tableHandlePopoverItemProps),
47
+ Object.keys(tableHandlePopoverItemEvents)
40
48
  );
41
49
 
42
50
  // src/components/table-handle/table-handle-root.gen.ts
43
51
  import {
44
- defaultTableHandleRootProps
52
+ tableHandleRootProps,
53
+ tableHandleRootEvents
45
54
  } from "@prosekit/web/table-handle";
46
55
  var TableHandleRoot = createComponent(
47
56
  "prosekit-table-handle-root",
48
- defaultTableHandleRootProps
57
+ Object.keys(tableHandleRootProps),
58
+ Object.keys(tableHandleRootEvents)
49
59
  );
50
60
 
51
61
  // src/components/table-handle/table-handle-row-root.gen.ts
52
62
  import {
53
- defaultTableHandleRowRootProps
63
+ tableHandleRowRootProps,
64
+ tableHandleRowRootEvents
54
65
  } from "@prosekit/web/table-handle";
55
66
  var TableHandleRowRoot = createComponent(
56
67
  "prosekit-table-handle-row-root",
57
- defaultTableHandleRowRootProps
68
+ Object.keys(tableHandleRowRootProps),
69
+ Object.keys(tableHandleRowRootEvents)
58
70
  );
59
71
 
60
72
  // src/components/table-handle/table-handle-row-trigger.gen.ts
61
73
  import {
62
- defaultTableHandleRowTriggerProps
74
+ tableHandleRowTriggerProps,
75
+ tableHandleRowTriggerEvents
63
76
  } from "@prosekit/web/table-handle";
64
77
  var TableHandleRowTrigger = createComponent(
65
78
  "prosekit-table-handle-row-trigger",
66
- defaultTableHandleRowTriggerProps
79
+ Object.keys(tableHandleRowTriggerProps),
80
+ Object.keys(tableHandleRowTriggerEvents)
67
81
  );
68
82
  export {
69
83
  TableHandleColumnRoot,
@@ -1,3 +1,6 @@
1
1
  export { TooltipContent } from './_tsup-dts-rollup';
2
+ export { TooltipContentProps } from './_tsup-dts-rollup';
2
3
  export { TooltipRoot } from './_tsup-dts-rollup';
4
+ export { TooltipRootProps } from './_tsup-dts-rollup';
3
5
  export { TooltipTrigger } from './_tsup-dts-rollup';
6
+ export { TooltipTriggerProps } from './_tsup-dts-rollup';
@@ -1,33 +1,39 @@
1
1
  import {
2
2
  createComponent
3
- } from "./chunk-4QNJABUA.js";
3
+ } from "./chunk-SGL36LNK.js";
4
4
  import "./chunk-XXXIBXNC.js";
5
5
 
6
6
  // src/components/tooltip/tooltip-content.gen.ts
7
7
  import {
8
- defaultTooltipContentProps
8
+ tooltipContentProps,
9
+ tooltipContentEvents
9
10
  } from "@prosekit/web/tooltip";
10
11
  var TooltipContent = createComponent(
11
12
  "prosekit-tooltip-content",
12
- defaultTooltipContentProps
13
+ Object.keys(tooltipContentProps),
14
+ Object.keys(tooltipContentEvents)
13
15
  );
14
16
 
15
17
  // src/components/tooltip/tooltip-root.gen.ts
16
18
  import {
17
- defaultTooltipRootProps
19
+ tooltipRootProps,
20
+ tooltipRootEvents
18
21
  } from "@prosekit/web/tooltip";
19
22
  var TooltipRoot = createComponent(
20
23
  "prosekit-tooltip-root",
21
- defaultTooltipRootProps
24
+ Object.keys(tooltipRootProps),
25
+ Object.keys(tooltipRootEvents)
22
26
  );
23
27
 
24
28
  // src/components/tooltip/tooltip-trigger.gen.ts
25
29
  import {
26
- defaultTooltipTriggerProps
30
+ tooltipTriggerProps,
31
+ tooltipTriggerEvents
27
32
  } from "@prosekit/web/tooltip";
28
33
  var TooltipTrigger = createComponent(
29
34
  "prosekit-tooltip-trigger",
30
- defaultTooltipTriggerProps
35
+ Object.keys(tooltipTriggerProps),
36
+ Object.keys(tooltipTriggerEvents)
31
37
  );
32
38
  export {
33
39
  TooltipContent,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/solid",
3
3
  "type": "module",
4
- "version": "0.3.29",
4
+ "version": "0.4.0",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -71,9 +71,9 @@
71
71
  ],
72
72
  "dependencies": {
73
73
  "@prosemirror-adapter/solid": "^0.2.6",
74
+ "@prosekit/pm": "^0.1.8",
74
75
  "@prosekit/core": "^0.7.11",
75
- "@prosekit/web": "^0.3.19",
76
- "@prosekit/pm": "^0.1.8"
76
+ "@prosekit/web": "^0.4.0"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "solid-js": ">= 1.7.0"
@@ -1,26 +0,0 @@
1
- import {
2
- useEditorContext
3
- } from "./chunk-XXXIBXNC.js";
4
-
5
- // src/components/create-component.ts
6
- import h from "solid-js/h";
7
- function createComponent(tagName, defaultProps) {
8
- const propertyNames = Object.keys(defaultProps);
9
- const hasEditor = Object.hasOwn(defaultProps, "editor");
10
- const Component = (props) => {
11
- const properties = {};
12
- for (const key of Object.keys(props)) {
13
- properties[propertyNames.includes(key) ? "prop:" + key : key] = () => props[key];
14
- }
15
- const editor = useEditorContext();
16
- if (hasEditor && editor) {
17
- properties["prop:editor"] = () => props["editor"] || editor;
18
- }
19
- return h(tagName, properties);
20
- };
21
- return Component;
22
- }
23
-
24
- export {
25
- createComponent
26
- };