@prosekit/solid 0.7.0-beta.0 → 0.7.0-beta.2

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.
Files changed (124) hide show
  1. package/dist/prosekit-solid-autocomplete.d.ts +225 -19
  2. package/dist/prosekit-solid-autocomplete.d.ts.map +1 -1
  3. package/dist/prosekit-solid-autocomplete.js +204 -9
  4. package/dist/prosekit-solid-autocomplete.js.map +1 -1
  5. package/dist/prosekit-solid-block-handle.d.ts +209 -15
  6. package/dist/prosekit-solid-block-handle.d.ts.map +1 -1
  7. package/dist/prosekit-solid-block-handle.js +160 -7
  8. package/dist/prosekit-solid-block-handle.js.map +1 -1
  9. package/dist/prosekit-solid-drop-indicator.d.ts +26 -7
  10. package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -1
  11. package/dist/prosekit-solid-drop-indicator.js +29 -3
  12. package/dist/prosekit-solid-drop-indicator.js.map +1 -1
  13. package/dist/prosekit-solid-inline-popover.d.ts +203 -9
  14. package/dist/prosekit-solid-inline-popover.d.ts.map +1 -1
  15. package/dist/prosekit-solid-inline-popover.js +128 -5
  16. package/dist/prosekit-solid-inline-popover.js.map +1 -1
  17. package/dist/prosekit-solid-menu.d.ts +287 -0
  18. package/dist/prosekit-solid-menu.d.ts.map +1 -0
  19. package/dist/prosekit-solid-menu.js +241 -0
  20. package/dist/prosekit-solid-menu.js.map +1 -0
  21. package/dist/prosekit-solid-popover.d.ts +226 -15
  22. package/dist/prosekit-solid-popover.d.ts.map +1 -1
  23. package/dist/prosekit-solid-popover.js +165 -7
  24. package/dist/prosekit-solid-popover.js.map +1 -1
  25. package/dist/prosekit-solid-resizable.d.ts +55 -13
  26. package/dist/prosekit-solid-resizable.d.ts.map +1 -1
  27. package/dist/prosekit-solid-resizable.js +69 -7
  28. package/dist/prosekit-solid-resizable.js.map +1 -1
  29. package/dist/prosekit-solid-table-handle.d.ts +446 -39
  30. package/dist/prosekit-solid-table-handle.d.ts.map +1 -1
  31. package/dist/prosekit-solid-table-handle.js +334 -19
  32. package/dist/prosekit-solid-table-handle.js.map +1 -1
  33. package/dist/prosekit-solid-tooltip.d.ts +210 -15
  34. package/dist/prosekit-solid-tooltip.d.ts.map +1 -1
  35. package/dist/prosekit-solid-tooltip.js +149 -7
  36. package/dist/prosekit-solid-tooltip.js.map +1 -1
  37. package/dist/prosekit-solid.d.ts +23 -2
  38. package/dist/prosekit-solid.d.ts.map +1 -1
  39. package/dist/prosekit-solid.js +37 -6
  40. package/dist/prosekit-solid.js.map +1 -1
  41. package/package.json +28 -16
  42. package/src/components/autocomplete/autocomplete-empty.gen.ts +22 -24
  43. package/src/components/autocomplete/autocomplete-item.gen.ts +82 -26
  44. package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
  45. package/src/components/autocomplete/autocomplete-positioner.gen.ts +167 -0
  46. package/src/components/autocomplete/autocomplete-root.gen.ts +110 -0
  47. package/src/components/autocomplete/index.gen.ts +12 -4
  48. package/src/components/autocomplete/index.ts +27 -0
  49. package/src/components/block-handle/block-handle-add.gen.ts +54 -26
  50. package/src/components/block-handle/block-handle-draggable.gen.ts +54 -26
  51. package/src/components/block-handle/block-handle-popup.gen.ts +27 -0
  52. package/src/components/block-handle/block-handle-positioner.gen.ts +185 -0
  53. package/src/components/block-handle/block-handle-root.gen.ts +82 -0
  54. package/src/components/block-handle/index.gen.ts +13 -3
  55. package/src/components/block-handle/index.ts +27 -0
  56. package/src/components/drop-indicator/drop-indicator.gen.ts +60 -26
  57. package/src/components/drop-indicator/index.gen.ts +5 -1
  58. package/src/components/drop-indicator/index.ts +14 -0
  59. package/src/components/inline-popover/index.gen.ts +11 -1
  60. package/src/components/inline-popover/index.ts +22 -0
  61. package/src/components/inline-popover/inline-popover-popup.gen.ts +27 -0
  62. package/src/components/inline-popover/inline-popover-positioner.gen.ts +191 -0
  63. package/src/components/inline-popover/inline-popover-root.gen.ts +106 -0
  64. package/src/components/menu/index.gen.ts +19 -0
  65. package/src/components/menu/index.ts +37 -0
  66. package/src/components/menu/menu-item.gen.ts +89 -0
  67. package/src/components/menu/menu-popup.gen.ts +53 -0
  68. package/src/components/menu/menu-positioner.gen.ts +192 -0
  69. package/src/components/menu/menu-root.gen.ts +86 -0
  70. package/src/components/menu/menu-submenu-root.gen.ts +27 -0
  71. package/src/components/menu/menu-submenu-trigger.gen.ts +27 -0
  72. package/src/components/menu/menu-trigger.gen.ts +77 -0
  73. package/src/components/popover/index.gen.ts +11 -3
  74. package/src/components/popover/index.ts +24 -0
  75. package/src/components/popover/popover-popup.gen.ts +27 -0
  76. package/src/components/popover/popover-positioner.gen.ts +192 -0
  77. package/src/components/popover/popover-root.gen.ts +90 -26
  78. package/src/components/popover/popover-trigger.gen.ts +90 -26
  79. package/src/components/resizable/index.gen.ts +8 -2
  80. package/src/components/resizable/index.ts +20 -0
  81. package/src/components/resizable/resizable-handle.gen.ts +49 -26
  82. package/src/components/resizable/resizable-root.gen.ts +89 -26
  83. package/src/components/table-handle/index.gen.ts +17 -9
  84. package/src/components/table-handle/index.ts +58 -0
  85. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +61 -0
  86. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +55 -0
  87. package/src/components/table-handle/table-handle-column-popup.gen.ts +27 -0
  88. package/src/components/table-handle/table-handle-column-positioner.gen.ts +196 -0
  89. package/src/components/table-handle/table-handle-drag-preview.gen.ts +52 -26
  90. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +52 -26
  91. package/src/components/table-handle/table-handle-root.gen.ts +54 -26
  92. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +61 -0
  93. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +55 -0
  94. package/src/components/table-handle/table-handle-row-popup.gen.ts +27 -0
  95. package/src/components/table-handle/table-handle-row-positioner.gen.ts +196 -0
  96. package/src/components/tooltip/index.gen.ts +11 -3
  97. package/src/components/tooltip/index.ts +24 -0
  98. package/src/components/tooltip/tooltip-popup.gen.ts +27 -0
  99. package/src/components/tooltip/tooltip-positioner.gen.ts +192 -0
  100. package/src/components/tooltip/tooltip-root.gen.ts +83 -26
  101. package/src/components/tooltip/tooltip-trigger.gen.ts +58 -26
  102. package/src/extensions/solid-mark-view.ts +13 -5
  103. package/src/extensions/solid-node-view.spec.tsx +141 -0
  104. package/src/extensions/solid-node-view.ts +28 -5
  105. package/dist/create-component.js +0 -41
  106. package/dist/create-component.js.map +0 -1
  107. package/dist/create-props.d.ts +0 -6
  108. package/dist/create-props.d.ts.map +0 -1
  109. package/dist/types.d.ts +0 -26
  110. package/dist/types.d.ts.map +0 -1
  111. package/src/components/autocomplete/autocomplete-list.gen.ts +0 -29
  112. package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -29
  113. package/src/components/block-handle/block-handle-popover.gen.ts +0 -29
  114. package/src/components/create-component.ts +0 -60
  115. package/src/components/create-props.ts +0 -13
  116. package/src/components/inline-popover/inline-popover.gen.ts +0 -29
  117. package/src/components/popover/popover-content.gen.ts +0 -29
  118. package/src/components/table-handle/table-handle-column-root.gen.ts +0 -29
  119. package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -29
  120. package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -29
  121. package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -29
  122. package/src/components/table-handle/table-handle-row-root.gen.ts +0 -29
  123. package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -29
  124. package/src/components/tooltip/tooltip-content.gen.ts +0 -29
@@ -0,0 +1,55 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleColumnMenuTriggerElement, type TableHandleColumnMenuTriggerElement, type TableHandleColumnMenuTriggerProps as TableHandleColumnMenuTriggerElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleColumnMenuTrigger} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleColumnMenuTriggerProps extends JSX.HTMLAttributes<TableHandleColumnMenuTriggerElement> {
18
+ /**
19
+ * @default null
20
+ * @hidden
21
+ */
22
+ editor?: TableHandleColumnMenuTriggerElementProps['editor'];
23
+ }
24
+
25
+ /**
26
+ * A Solid component that renders an `prosekit-table-handle-column-menu-trigger` custom element.
27
+ *
28
+ * @public
29
+ */
30
+ export const TableHandleColumnMenuTrigger: Component<TableHandleColumnMenuTriggerProps> = (props): any => {
31
+ registerTableHandleColumnMenuTriggerElement();
32
+
33
+ const [getElement, setElement] = createSignal<TableHandleColumnMenuTriggerElement | null>(null);
34
+
35
+ const [elementProps, restProps] = splitProps(props, ['editor']);
36
+
37
+ const p0Fallback = useEditorContext();
38
+
39
+ createEffect(() => {
40
+ const element = getElement();
41
+ if (!element) return;
42
+
43
+ Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
44
+ });
45
+
46
+ return () =>
47
+ h(
48
+ 'prosekit-table-handle-column-menu-trigger',
49
+ mergeProps(restProps, {
50
+ ref: (el: TableHandleColumnMenuTriggerElement | null) => {
51
+ setElement(el);
52
+ },
53
+ }),
54
+ );
55
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleColumnPopupElement, type TableHandleColumnPopupElement } from '@prosekit/web/table-handle';
6
+ import type { Component, JSX } from 'solid-js';
7
+ import h from 'solid-js/h';
8
+
9
+ /**
10
+ * Props for the {@link TableHandleColumnPopup} Solid component.
11
+ *
12
+ * @public
13
+ */
14
+ export interface TableHandleColumnPopupProps extends JSX.HTMLAttributes<TableHandleColumnPopupElement> {}
15
+
16
+ /**
17
+ * A Solid component that renders an `prosekit-table-handle-column-popup` custom element.
18
+ *
19
+ * @public
20
+ */
21
+ export const TableHandleColumnPopup: Component<TableHandleColumnPopupProps> = (props): any => {
22
+ registerTableHandleColumnPopupElement();
23
+
24
+ const restProps = props;
25
+
26
+ return () => h('prosekit-table-handle-column-popup', restProps);
27
+ };
@@ -0,0 +1,196 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleColumnPositionerElement, type TableHandleColumnPositionerElement, type TableHandleColumnPositionerProps as TableHandleColumnPositionerElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleColumnPositioner} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleColumnPositionerProps extends JSX.HTMLAttributes<TableHandleColumnPositionerElement> {
18
+ /**
19
+ * The placement of the popover, relative to the hovered table cell.
20
+ *
21
+ * @default "top"
22
+ */
23
+ placement?: TableHandleColumnPositionerElementProps['placement'];
24
+ /**
25
+ * The strategy to use for positioning
26
+ *
27
+ * @default "absolute"
28
+ */
29
+ strategy?: TableHandleColumnPositionerElementProps['strategy'];
30
+ /**
31
+ * Options to activate auto-update listeners
32
+ *
33
+ * @see https://floating-ui.com/docs/autoUpdate
34
+ *
35
+ * @default true
36
+ */
37
+ autoUpdate?: TableHandleColumnPositionerElementProps['autoUpdate'];
38
+ /**
39
+ * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
40
+ * to place the floating element on top of other page content.
41
+ *
42
+ * @default false
43
+ */
44
+ hoist?: TableHandleColumnPositionerElementProps['hoist'];
45
+ /**
46
+ * @default 0
47
+ * @hidden
48
+ */
49
+ offset?: TableHandleColumnPositionerElementProps['offset'];
50
+ /**
51
+ * @default false
52
+ * @hidden
53
+ */
54
+ flip?: TableHandleColumnPositionerElementProps['flip'];
55
+ /**
56
+ * @default false
57
+ * @hidden
58
+ */
59
+ shift?: TableHandleColumnPositionerElementProps['shift'];
60
+ /**
61
+ * Whether the floating element can overlap the reference element to keep it
62
+ * in view.
63
+ *
64
+ * @default false
65
+ */
66
+ overlap?: TableHandleColumnPositionerElementProps['overlap'];
67
+ /**
68
+ * Whether to constrain the floating element's width and height to not exceed
69
+ * the viewport.
70
+ *
71
+ * @default false
72
+ */
73
+ fitViewport?: TableHandleColumnPositionerElementProps['fitViewport'];
74
+ /**
75
+ * Whether to constrain the floating element's width so that it matches the
76
+ * reference element.
77
+ *
78
+ * @default false
79
+ */
80
+ sameWidth?: TableHandleColumnPositionerElementProps['sameWidth'];
81
+ /**
82
+ * Whether to constrain the floating element's height so that it matches the
83
+ * reference element.
84
+ *
85
+ * @default false
86
+ */
87
+ sameHeight?: TableHandleColumnPositionerElementProps['sameHeight'];
88
+ /**
89
+ * Whether to improve positioning for inline reference elements that span over
90
+ * multiple lines.
91
+ *
92
+ * @default false
93
+ */
94
+ inline?: TableHandleColumnPositionerElementProps['inline'];
95
+ /**
96
+ * @default true
97
+ * @hidden
98
+ */
99
+ hide?: TableHandleColumnPositionerElementProps['hide'];
100
+ /**
101
+ * Describes the clipping element(s) or area that overflow will be checked relative to.
102
+ * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
103
+ *
104
+ * @default 'clippingAncestors'
105
+ */
106
+ boundary?: TableHandleColumnPositionerElementProps['boundary'];
107
+ /**
108
+ * Describes the root boundary that the element will be checked for overflow relative to.
109
+ * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
110
+ *
111
+ * @default 'viewport'
112
+ */
113
+ rootBoundary?: TableHandleColumnPositionerElementProps['rootBoundary'];
114
+ /**
115
+ * Describes the virtual padding around the boundary to check for overflow.
116
+ * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
117
+ *
118
+ * @default 4
119
+ */
120
+ overflowPadding?: TableHandleColumnPositionerElementProps['overflowPadding'];
121
+ /**
122
+ * The element that will be used to check for overflow. Please see
123
+ * https://floating-ui.com/docs/detectoverflow#elementcontext for more
124
+ * information.
125
+ *
126
+ * @default 'floating'
127
+ */
128
+ elementContext?: TableHandleColumnPositionerElementProps['elementContext'];
129
+ /**
130
+ * Whether to check the alternate elementContext's boundary. Please see
131
+ * https://floating-ui.com/docs/detectoverflow#altboundary for more
132
+ * information.
133
+ *
134
+ * @default false
135
+ */
136
+ altBoundary?: TableHandleColumnPositionerElementProps['altBoundary'];
137
+ /**
138
+ * The ProseKit editor instance.
139
+ *
140
+ * @default null
141
+ * @hidden
142
+ */
143
+ editor?: TableHandleColumnPositionerElementProps['editor'];
144
+ }
145
+
146
+ /**
147
+ * A Solid component that renders an `prosekit-table-handle-column-positioner` custom element.
148
+ *
149
+ * @public
150
+ */
151
+ export const TableHandleColumnPositioner: Component<TableHandleColumnPositionerProps> = (props): any => {
152
+ registerTableHandleColumnPositionerElement();
153
+
154
+ const [getElement, setElement] = createSignal<TableHandleColumnPositionerElement | null>(null);
155
+
156
+ const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'editor', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);
157
+
158
+ const p3Fallback = useEditorContext();
159
+
160
+ createEffect(() => {
161
+ const element = getElement();
162
+ if (!element) return;
163
+
164
+ Object.assign(element, {
165
+ altBoundary: elementProps.altBoundary,
166
+ autoUpdate: elementProps.autoUpdate,
167
+ boundary: elementProps.boundary,
168
+ editor: elementProps.editor ?? p3Fallback,
169
+ elementContext: elementProps.elementContext,
170
+ fitViewport: elementProps.fitViewport,
171
+ flip: elementProps.flip,
172
+ hide: elementProps.hide,
173
+ hoist: elementProps.hoist,
174
+ inline: elementProps.inline,
175
+ offset: elementProps.offset,
176
+ overflowPadding: elementProps.overflowPadding,
177
+ overlap: elementProps.overlap,
178
+ placement: elementProps.placement,
179
+ rootBoundary: elementProps.rootBoundary,
180
+ sameHeight: elementProps.sameHeight,
181
+ sameWidth: elementProps.sameWidth,
182
+ shift: elementProps.shift,
183
+ strategy: elementProps.strategy,
184
+ });
185
+ });
186
+
187
+ return () =>
188
+ h(
189
+ 'prosekit-table-handle-column-positioner',
190
+ mergeProps(restProps, {
191
+ ref: (el: TableHandleColumnPositionerElement | null) => {
192
+ setElement(el);
193
+ },
194
+ }),
195
+ );
196
+ };
@@ -1,29 +1,55 @@
1
- import {
2
- type TableHandleDragPreviewElement,
3
- type TableHandleDragPreviewProps as Props,
4
- type TableHandleDragPreviewEvents as Events,
5
- tableHandleDragPreviewProps,
6
- tableHandleDragPreviewEvents,
7
- } from '@prosekit/web/table-handle'
8
- import type { Component } from 'solid-js'
9
-
10
- import type { PropsWithElement } from '../../types.ts'
11
- import { createComponent } from '../create-component.ts'
12
- import type { CreateProps } from '../create-props.ts'
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleDragPreviewElement, type TableHandleDragPreviewElement, type TableHandleDragPreviewProps as TableHandleDragPreviewElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleDragPreview} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleDragPreviewProps extends JSX.HTMLAttributes<TableHandleDragPreviewElement> {
18
+ /**
19
+ * @default null
20
+ * @hidden
21
+ */
22
+ editor?: TableHandleDragPreviewElementProps['editor'];
23
+ }
13
24
 
14
25
  /**
15
- * Props for the {@link TableHandleDragPreview} component.
26
+ * A Solid component that renders an `prosekit-table-handle-drag-preview` custom element.
27
+ *
28
+ * @public
16
29
  */
17
- export interface TableHandleDragPreviewProps extends Partial<CreateProps<Props, Events>> {}
18
-
19
- export const TableHandleDragPreview: Component<PropsWithElement<
20
- TableHandleDragPreviewProps,
21
- TableHandleDragPreviewElement
22
- >> = createComponent<
23
- TableHandleDragPreviewProps,
24
- TableHandleDragPreviewElement
25
- >(
26
- 'prosekit-table-handle-drag-preview',
27
- Object.keys(tableHandleDragPreviewProps),
28
- Object.keys(tableHandleDragPreviewEvents),
29
- )
30
+ export const TableHandleDragPreview: Component<TableHandleDragPreviewProps> = (props): any => {
31
+ registerTableHandleDragPreviewElement();
32
+
33
+ const [getElement, setElement] = createSignal<TableHandleDragPreviewElement | null>(null);
34
+
35
+ const [elementProps, restProps] = splitProps(props, ['editor']);
36
+
37
+ const p0Fallback = useEditorContext();
38
+
39
+ createEffect(() => {
40
+ const element = getElement();
41
+ if (!element) return;
42
+
43
+ Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
44
+ });
45
+
46
+ return () =>
47
+ h(
48
+ 'prosekit-table-handle-drag-preview',
49
+ mergeProps(restProps, {
50
+ ref: (el: TableHandleDragPreviewElement | null) => {
51
+ setElement(el);
52
+ },
53
+ }),
54
+ );
55
+ };
@@ -1,29 +1,55 @@
1
- import {
2
- type TableHandleDropIndicatorElement,
3
- type TableHandleDropIndicatorProps as Props,
4
- type TableHandleDropIndicatorEvents as Events,
5
- tableHandleDropIndicatorProps,
6
- tableHandleDropIndicatorEvents,
7
- } from '@prosekit/web/table-handle'
8
- import type { Component } from 'solid-js'
9
-
10
- import type { PropsWithElement } from '../../types.ts'
11
- import { createComponent } from '../create-component.ts'
12
- import type { CreateProps } from '../create-props.ts'
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleDropIndicatorElement, type TableHandleDropIndicatorElement, type TableHandleDropIndicatorProps as TableHandleDropIndicatorElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleDropIndicator} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleDropIndicatorProps extends JSX.HTMLAttributes<TableHandleDropIndicatorElement> {
18
+ /**
19
+ * @default null
20
+ * @hidden
21
+ */
22
+ editor?: TableHandleDropIndicatorElementProps['editor'];
23
+ }
13
24
 
14
25
  /**
15
- * Props for the {@link TableHandleDropIndicator} component.
26
+ * A Solid component that renders an `prosekit-table-handle-drop-indicator` custom element.
27
+ *
28
+ * @public
16
29
  */
17
- export interface TableHandleDropIndicatorProps extends Partial<CreateProps<Props, Events>> {}
18
-
19
- export const TableHandleDropIndicator: Component<PropsWithElement<
20
- TableHandleDropIndicatorProps,
21
- TableHandleDropIndicatorElement
22
- >> = createComponent<
23
- TableHandleDropIndicatorProps,
24
- TableHandleDropIndicatorElement
25
- >(
26
- 'prosekit-table-handle-drop-indicator',
27
- Object.keys(tableHandleDropIndicatorProps),
28
- Object.keys(tableHandleDropIndicatorEvents),
29
- )
30
+ export const TableHandleDropIndicator: Component<TableHandleDropIndicatorProps> = (props): any => {
31
+ registerTableHandleDropIndicatorElement();
32
+
33
+ const [getElement, setElement] = createSignal<TableHandleDropIndicatorElement | null>(null);
34
+
35
+ const [elementProps, restProps] = splitProps(props, ['editor']);
36
+
37
+ const p0Fallback = useEditorContext();
38
+
39
+ createEffect(() => {
40
+ const element = getElement();
41
+ if (!element) return;
42
+
43
+ Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
44
+ });
45
+
46
+ return () =>
47
+ h(
48
+ 'prosekit-table-handle-drop-indicator',
49
+ mergeProps(restProps, {
50
+ ref: (el: TableHandleDropIndicatorElement | null) => {
51
+ setElement(el);
52
+ },
53
+ }),
54
+ );
55
+ };
@@ -1,29 +1,57 @@
1
- import {
2
- type TableHandleRootElement,
3
- type TableHandleRootProps as Props,
4
- type TableHandleRootEvents as Events,
5
- tableHandleRootProps,
6
- tableHandleRootEvents,
7
- } from '@prosekit/web/table-handle'
8
- import type { Component } from 'solid-js'
9
-
10
- import type { PropsWithElement } from '../../types.ts'
11
- import { createComponent } from '../create-component.ts'
12
- import type { CreateProps } from '../create-props.ts'
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleRootElement, type TableHandleRootElement, type TableHandleRootProps as TableHandleRootElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleRoot} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleRootProps extends JSX.HTMLAttributes<TableHandleRootElement> {
18
+ /**
19
+ * The ProseKit editor instance.
20
+ *
21
+ * @default null
22
+ * @hidden
23
+ */
24
+ editor?: TableHandleRootElementProps['editor'];
25
+ }
13
26
 
14
27
  /**
15
- * Props for the {@link TableHandleRoot} component.
28
+ * A Solid component that renders an `prosekit-table-handle-root` custom element.
29
+ *
30
+ * @public
16
31
  */
17
- export interface TableHandleRootProps extends Partial<CreateProps<Props, Events>> {}
18
-
19
- export const TableHandleRoot: Component<PropsWithElement<
20
- TableHandleRootProps,
21
- TableHandleRootElement
22
- >> = createComponent<
23
- TableHandleRootProps,
24
- TableHandleRootElement
25
- >(
26
- 'prosekit-table-handle-root',
27
- Object.keys(tableHandleRootProps),
28
- Object.keys(tableHandleRootEvents),
29
- )
32
+ export const TableHandleRoot: Component<TableHandleRootProps> = (props): any => {
33
+ registerTableHandleRootElement();
34
+
35
+ const [getElement, setElement] = createSignal<TableHandleRootElement | null>(null);
36
+
37
+ const [elementProps, restProps] = splitProps(props, ['editor']);
38
+
39
+ const p0Fallback = useEditorContext();
40
+
41
+ createEffect(() => {
42
+ const element = getElement();
43
+ if (!element) return;
44
+
45
+ Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
46
+ });
47
+
48
+ return () =>
49
+ h(
50
+ 'prosekit-table-handle-root',
51
+ mergeProps(restProps, {
52
+ ref: (el: TableHandleRootElement | null) => {
53
+ setElement(el);
54
+ },
55
+ }),
56
+ );
57
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleRowMenuRootElement, type TableHandleRowMenuRootElement, type TableHandleRowMenuRootProps as TableHandleRowMenuRootElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ /**
11
+ * Props for the {@link TableHandleRowMenuRoot} Solid component.
12
+ *
13
+ * @public
14
+ */
15
+ export interface TableHandleRowMenuRootProps extends JSX.HTMLAttributes<TableHandleRowMenuRootElement> {
16
+ /**
17
+ * Whether the overlay is initially open.
18
+ * @default false
19
+ */
20
+ defaultOpen?: TableHandleRowMenuRootElementProps['defaultOpen'];
21
+ /**
22
+ * Whether the overlay is currently open.
23
+ * @default null
24
+ */
25
+ open?: TableHandleRowMenuRootElementProps['open'];
26
+ /**
27
+ * Whether the component should ignore user interaction.
28
+ * @default false
29
+ */
30
+ disabled?: TableHandleRowMenuRootElementProps['disabled'];
31
+ }
32
+
33
+ /**
34
+ * A Solid component that renders an `prosekit-table-handle-row-menu-root` custom element.
35
+ *
36
+ * @public
37
+ */
38
+ export const TableHandleRowMenuRoot: Component<TableHandleRowMenuRootProps> = (props): any => {
39
+ registerTableHandleRowMenuRootElement();
40
+
41
+ const [getElement, setElement] = createSignal<TableHandleRowMenuRootElement | null>(null);
42
+
43
+ const [elementProps, restProps] = splitProps(props, ['defaultOpen', 'disabled', 'open']);
44
+
45
+ createEffect(() => {
46
+ const element = getElement();
47
+ if (!element) return;
48
+
49
+ Object.assign(element, { defaultOpen: elementProps.defaultOpen, disabled: elementProps.disabled, open: elementProps.open });
50
+ });
51
+
52
+ return () =>
53
+ h(
54
+ 'prosekit-table-handle-row-menu-root',
55
+ mergeProps(restProps, {
56
+ ref: (el: TableHandleRowMenuRootElement | null) => {
57
+ setElement(el);
58
+ },
59
+ }),
60
+ );
61
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleRowMenuTriggerElement, type TableHandleRowMenuTriggerElement, type TableHandleRowMenuTriggerProps as TableHandleRowMenuTriggerElementProps } from '@prosekit/web/table-handle';
6
+ import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
7
+ import type { Component, JSX } from 'solid-js';
8
+ import h from 'solid-js/h';
9
+
10
+ import { useEditorContext } from '../../contexts/editor-context.ts';
11
+
12
+ /**
13
+ * Props for the {@link TableHandleRowMenuTrigger} Solid component.
14
+ *
15
+ * @public
16
+ */
17
+ export interface TableHandleRowMenuTriggerProps extends JSX.HTMLAttributes<TableHandleRowMenuTriggerElement> {
18
+ /**
19
+ * @default null
20
+ * @hidden
21
+ */
22
+ editor?: TableHandleRowMenuTriggerElementProps['editor'];
23
+ }
24
+
25
+ /**
26
+ * A Solid component that renders an `prosekit-table-handle-row-menu-trigger` custom element.
27
+ *
28
+ * @public
29
+ */
30
+ export const TableHandleRowMenuTrigger: Component<TableHandleRowMenuTriggerProps> = (props): any => {
31
+ registerTableHandleRowMenuTriggerElement();
32
+
33
+ const [getElement, setElement] = createSignal<TableHandleRowMenuTriggerElement | null>(null);
34
+
35
+ const [elementProps, restProps] = splitProps(props, ['editor']);
36
+
37
+ const p0Fallback = useEditorContext();
38
+
39
+ createEffect(() => {
40
+ const element = getElement();
41
+ if (!element) return;
42
+
43
+ Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
44
+ });
45
+
46
+ return () =>
47
+ h(
48
+ 'prosekit-table-handle-row-menu-trigger',
49
+ mergeProps(restProps, {
50
+ ref: (el: TableHandleRowMenuTriggerElement | null) => {
51
+ setElement(el);
52
+ },
53
+ }),
54
+ );
55
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
+ */
4
+
5
+ import { registerTableHandleRowPopupElement, type TableHandleRowPopupElement } from '@prosekit/web/table-handle';
6
+ import type { Component, JSX } from 'solid-js';
7
+ import h from 'solid-js/h';
8
+
9
+ /**
10
+ * Props for the {@link TableHandleRowPopup} Solid component.
11
+ *
12
+ * @public
13
+ */
14
+ export interface TableHandleRowPopupProps extends JSX.HTMLAttributes<TableHandleRowPopupElement> {}
15
+
16
+ /**
17
+ * A Solid component that renders an `prosekit-table-handle-row-popup` custom element.
18
+ *
19
+ * @public
20
+ */
21
+ export const TableHandleRowPopup: Component<TableHandleRowPopupProps> = (props): any => {
22
+ registerTableHandleRowPopupElement();
23
+
24
+ const restProps = props;
25
+
26
+ return () => h('prosekit-table-handle-row-popup', restProps);
27
+ };