@prosekit/react 0.4.13 → 0.4.14

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,12 +1,38 @@
1
1
  import { useEditorContext } from "./editor-context-Cci4uqN_.js";
2
- import { createElement, forwardRef, useEffect, useLayoutEffect, useRef, useState } from "react";
3
- import { mergeRefs } from "react-merge-refs";
2
+ import { createElement, forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
4
3
 
4
+ //#region src/components/merge-refs.ts
5
+ /**
6
+ * Assigns a value to a ref.
7
+ * @returns The ref cleanup callback, if any.
8
+ */
9
+ function assignRef(ref, value) {
10
+ if (typeof ref === "function") return ref(value);
11
+ else if (ref) ref.current = value;
12
+ }
13
+ /**
14
+ * Merges multiple refs into a single one.
15
+ */
16
+ function mergeRefs(refs) {
17
+ return (value) => {
18
+ const cleanups = [];
19
+ for (const ref of refs) {
20
+ const cleanup = assignRef(ref, value);
21
+ const isCleanup = typeof cleanup === "function";
22
+ cleanups.push(isCleanup ? cleanup : () => assignRef(ref, null));
23
+ }
24
+ return () => {
25
+ for (const cleanup of cleanups) cleanup();
26
+ };
27
+ };
28
+ }
29
+
30
+ //#endregion
5
31
  //#region src/components/create-component.ts
6
32
  const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
7
33
  function createComponent(tagName, displayName, propNames, eventNames) {
8
34
  const hasEditor = propNames.includes("editor");
9
- const lowerCaseEventNameMap = Object.fromEntries(eventNames.map((name) => [name.toLowerCase(), name]));
35
+ const lowerCaseEventNameMap = new Map(eventNames.map((name) => [name.toLowerCase(), name]));
10
36
  const Component = forwardRef((props, ref) => {
11
37
  const [el, setEl] = useState(null);
12
38
  const properties = {};
@@ -21,14 +47,14 @@ function createComponent(tagName, displayName, propNames, eventNames) {
21
47
  }
22
48
  if (name.startsWith("on")) {
23
49
  const lowerCaseEventName = name.slice(2).toLowerCase();
24
- const eventName = lowerCaseEventNameMap[lowerCaseEventName];
25
- const handler = value;
26
- if (eventName && handler) {
50
+ const eventName = lowerCaseEventNameMap.get(lowerCaseEventName);
51
+ if (eventName) {
27
52
  const extractDetail = eventName.endsWith("Change");
28
- const normalizedHandler = extractDetail ? (event) => {
29
- handler(event.detail);
30
- } : handler;
31
- eventHandlers[eventName] = normalizedHandler;
53
+ eventHandlers[eventName] = (event) => {
54
+ const handler = value;
55
+ if (typeof handler === "function") handler(extractDetail ? event.detail : event);
56
+ };
57
+ continue;
32
58
  }
33
59
  }
34
60
  if (name === "className") attributes["class"] = value;
@@ -54,9 +80,10 @@ function createComponent(tagName, displayName, propNames, eventNames) {
54
80
  for (const [name, handler] of Object.entries(fixedEventHandlers)) el.removeEventListener(name, handler);
55
81
  };
56
82
  }, [el]);
83
+ const mergedRef = useMemo(() => mergeRefs([ref, setEl]), [ref]);
57
84
  return createElement(tagName, {
58
85
  ...attributes,
59
- ref: mergeRefs([ref, setEl])
86
+ ref: mergedRef
60
87
  });
61
88
  });
62
89
  Component.displayName = displayName;
@@ -1,6 +1,5 @@
1
1
  //#region src/components/create-props.d.ts
2
2
  type CreateProps<Props extends { [PropName in keyof Props]: unknown }, Events extends { [EventName in keyof Events]: CustomEvent }> = Props & CreateEventProps<Events>;
3
3
  type CreateEventProps<Events extends { [EventName in keyof Events]: CustomEvent }> = { [EventName in keyof Events as `on${Capitalize<string & EventName>}`]: (event: EventName extends `${string}Change` ? Events[EventName]["detail"] : Events[EventName]) => void };
4
-
5
4
  //#endregion
6
5
  export { CreateProps };
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { AutocompleteEmptyElement, AutocompleteEmptyEvents, AutocompleteEmptyProps as AutocompleteEmptyProps$1, AutocompleteItemElement, AutocompleteItemEvents, AutocompleteItemProps as AutocompleteItemProps$1, AutocompleteListElement, AutocompleteListEvents, AutocompleteListProps as AutocompleteListProps$1, AutocompletePopoverElement, AutocompletePopoverEvents, AutocompletePopoverProps as AutocompletePopoverProps$1 } from "@prosekit/web/autocomplete";
4
4
 
5
5
  //#region src/components/autocomplete/autocomplete-empty.gen.d.ts
6
- /**
7
- * Props for the {@link AutocompleteEmpty} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link AutocompleteEmpty} component.
11
9
  */
12
10
  interface AutocompleteEmptyProps extends Partial<CreateProps<AutocompleteEmptyProps$1, AutocompleteEmptyEvents>> {}
13
11
  declare const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & RefAttributes<AutocompleteEmptyElement> & HTMLAttributes<AutocompleteEmptyElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/autocomplete/autocomplete-item.gen.d.ts
17
14
  /**
@@ -19,7 +16,6 @@ declare const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProp
19
16
  */
20
17
  interface AutocompleteItemProps extends Partial<CreateProps<AutocompleteItemProps$1, AutocompleteItemEvents>> {}
21
18
  declare const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & RefAttributes<AutocompleteItemElement> & HTMLAttributes<AutocompleteItemElement>>;
22
-
23
19
  //#endregion
24
20
  //#region src/components/autocomplete/autocomplete-list.gen.d.ts
25
21
  /**
@@ -27,7 +23,6 @@ declare const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps
27
23
  */
28
24
  interface AutocompleteListProps extends Partial<CreateProps<AutocompleteListProps$1, AutocompleteListEvents>> {}
29
25
  declare const AutocompleteList: ForwardRefExoticComponent<AutocompleteListProps & RefAttributes<AutocompleteListElement> & HTMLAttributes<AutocompleteListElement>>;
30
-
31
26
  //#endregion
32
27
  //#region src/components/autocomplete/autocomplete-popover.gen.d.ts
33
28
  /**
@@ -35,6 +30,5 @@ declare const AutocompleteList: ForwardRefExoticComponent<AutocompleteListProps
35
30
  */
36
31
  interface AutocompletePopoverProps extends Partial<CreateProps<AutocompletePopoverProps$1, AutocompletePopoverEvents>> {}
37
32
  declare const AutocompletePopover: ForwardRefExoticComponent<AutocompletePopoverProps & RefAttributes<AutocompletePopoverElement> & HTMLAttributes<AutocompletePopoverElement>>;
38
-
39
33
  //#endregion
40
34
  export { AutocompleteEmpty, AutocompleteEmptyProps, AutocompleteItem, AutocompleteItemProps, AutocompleteList, AutocompleteListProps, AutocompletePopover, AutocompletePopoverProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { autocompleteEmptyEvents, autocompleteEmptyProps, autocompleteItemEvents, autocompleteItemProps, autocompleteListEvents, autocompleteListProps, autocompletePopoverEvents, autocompletePopoverProps } from "@prosekit/web/autocomplete";
4
4
 
5
5
  //#region src/components/autocomplete/autocomplete-empty.gen.ts
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { BlockHandleAddElement, BlockHandleAddEvents, BlockHandleAddProps as BlockHandleAddProps$1, BlockHandleDraggableElement, BlockHandleDraggableEvents, BlockHandleDraggableProps as BlockHandleDraggableProps$1, BlockHandlePopoverElement, BlockHandlePopoverEvents, BlockHandlePopoverProps as BlockHandlePopoverProps$1 } from "@prosekit/web/block-handle";
4
4
 
5
5
  //#region src/components/block-handle/block-handle-add.gen.d.ts
6
- /**
7
- * Props for the {@link BlockHandleAdd} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link BlockHandleAdd} component.
11
9
  */
12
10
  interface BlockHandleAddProps extends Partial<CreateProps<BlockHandleAddProps$1, BlockHandleAddEvents>> {}
13
11
  declare const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & RefAttributes<BlockHandleAddElement> & HTMLAttributes<BlockHandleAddElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/block-handle/block-handle-draggable.gen.d.ts
17
14
  /**
@@ -19,7 +16,6 @@ declare const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & Re
19
16
  */
20
17
  interface BlockHandleDraggableProps extends Partial<CreateProps<BlockHandleDraggableProps$1, BlockHandleDraggableEvents>> {}
21
18
  declare const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & RefAttributes<BlockHandleDraggableElement> & HTMLAttributes<BlockHandleDraggableElement>>;
22
-
23
19
  //#endregion
24
20
  //#region src/components/block-handle/block-handle-popover.gen.d.ts
25
21
  /**
@@ -27,6 +23,5 @@ declare const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggab
27
23
  */
28
24
  interface BlockHandlePopoverProps extends Partial<CreateProps<BlockHandlePopoverProps$1, BlockHandlePopoverEvents>> {}
29
25
  declare const BlockHandlePopover: ForwardRefExoticComponent<BlockHandlePopoverProps & RefAttributes<BlockHandlePopoverElement> & HTMLAttributes<BlockHandlePopoverElement>>;
30
-
31
26
  //#endregion
32
27
  export { BlockHandleAdd, BlockHandleAddProps, BlockHandleDraggable, BlockHandleDraggableProps, BlockHandlePopover, BlockHandlePopoverProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { blockHandleAddEvents, blockHandleAddProps, blockHandleDraggableEvents, blockHandleDraggableProps, blockHandlePopoverEvents, blockHandlePopoverProps } from "@prosekit/web/block-handle";
4
4
 
5
5
  //#region src/components/block-handle/block-handle-add.gen.ts
@@ -1,16 +1,13 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { InlinePopoverElement, InlinePopoverEvents, InlinePopoverProps as InlinePopoverProps$1 } from "@prosekit/web/inline-popover";
4
4
 
5
5
  //#region src/components/inline-popover/inline-popover.gen.d.ts
6
- /**
7
- * Props for the {@link InlinePopover} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link InlinePopover} component.
11
9
  */
12
10
  interface InlinePopoverProps extends Partial<CreateProps<InlinePopoverProps$1, InlinePopoverEvents>> {}
13
11
  declare const InlinePopover: ForwardRefExoticComponent<InlinePopoverProps & RefAttributes<InlinePopoverElement> & HTMLAttributes<InlinePopoverElement>>;
14
-
15
12
  //#endregion
16
13
  export { InlinePopover, InlinePopoverProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { inlinePopoverEvents, inlinePopoverProps } from "@prosekit/web/inline-popover";
4
4
 
5
5
  //#region src/components/inline-popover/inline-popover.gen.ts
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { PopoverContentElement, PopoverContentEvents, PopoverContentProps as PopoverContentProps$1, PopoverRootElement, PopoverRootEvents, PopoverRootProps as PopoverRootProps$1, PopoverTriggerElement, PopoverTriggerEvents, PopoverTriggerProps as PopoverTriggerProps$1 } from "@prosekit/web/popover";
4
4
 
5
5
  //#region src/components/popover/popover-content.gen.d.ts
6
- /**
7
- * Props for the {@link PopoverContent} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link PopoverContent} component.
11
9
  */
12
10
  interface PopoverContentProps extends Partial<CreateProps<PopoverContentProps$1, PopoverContentEvents>> {}
13
11
  declare const PopoverContent: ForwardRefExoticComponent<PopoverContentProps & RefAttributes<PopoverContentElement> & HTMLAttributes<PopoverContentElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/popover/popover-root.gen.d.ts
17
14
  /**
@@ -19,7 +16,6 @@ declare const PopoverContent: ForwardRefExoticComponent<PopoverContentProps & Re
19
16
  */
20
17
  interface PopoverRootProps extends Partial<CreateProps<PopoverRootProps$1, PopoverRootEvents>> {}
21
18
  declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & RefAttributes<PopoverRootElement> & HTMLAttributes<PopoverRootElement>>;
22
-
23
19
  //#endregion
24
20
  //#region src/components/popover/popover-trigger.gen.d.ts
25
21
  /**
@@ -27,6 +23,5 @@ declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & RefAttri
27
23
  */
28
24
  interface PopoverTriggerProps extends Partial<CreateProps<PopoverTriggerProps$1, PopoverTriggerEvents>> {}
29
25
  declare const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & RefAttributes<PopoverTriggerElement> & HTMLAttributes<PopoverTriggerElement>>;
30
-
31
26
  //#endregion
32
27
  export { PopoverContent, PopoverContentProps, PopoverRoot, PopoverRootProps, PopoverTrigger, PopoverTriggerProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { popoverContentEvents, popoverContentProps, popoverRootEvents, popoverRootProps, popoverTriggerEvents, popoverTriggerProps } from "@prosekit/web/popover";
4
4
 
5
5
  //#region src/components/popover/popover-content.gen.ts
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { ResizableHandleElement, ResizableHandleEvents, ResizableHandleProps as ResizableHandleProps$1, ResizableRootElement, ResizableRootEvents, ResizableRootProps as ResizableRootProps$1 } from "@prosekit/web/resizable";
4
4
 
5
5
  //#region src/components/resizable/resizable-handle.gen.d.ts
6
- /**
7
- * Props for the {@link ResizableHandle} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link ResizableHandle} component.
11
9
  */
12
10
  interface ResizableHandleProps extends Partial<CreateProps<ResizableHandleProps$1, ResizableHandleEvents>> {}
13
11
  declare const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & RefAttributes<ResizableHandleElement> & HTMLAttributes<ResizableHandleElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/resizable/resizable-root.gen.d.ts
17
14
  /**
@@ -19,6 +16,5 @@ declare const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps &
19
16
  */
20
17
  interface ResizableRootProps extends Partial<CreateProps<ResizableRootProps$1, ResizableRootEvents>> {}
21
18
  declare const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & RefAttributes<ResizableRootElement> & HTMLAttributes<ResizableRootElement>>;
22
-
23
19
  //#endregion
24
20
  export { ResizableHandle, ResizableHandleProps, ResizableRoot, ResizableRootProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { resizableHandleEvents, resizableHandleProps, resizableRootEvents, resizableRootProps } from "@prosekit/web/resizable";
4
4
 
5
5
  //#region src/components/resizable/resizable-handle.gen.ts
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { TableHandleColumnRootElement, TableHandleColumnRootEvents, TableHandleColumnRootProps as TableHandleColumnRootProps$1, TableHandleColumnTriggerElement, TableHandleColumnTriggerEvents, TableHandleColumnTriggerProps as TableHandleColumnTriggerProps$1, TableHandlePopoverContentElement, TableHandlePopoverContentEvents, TableHandlePopoverContentProps as TableHandlePopoverContentProps$1, TableHandlePopoverItemElement, TableHandlePopoverItemEvents, TableHandlePopoverItemProps as TableHandlePopoverItemProps$1, TableHandleRootElement, TableHandleRootEvents, TableHandleRootProps as TableHandleRootProps$1, TableHandleRowRootElement, TableHandleRowRootEvents, TableHandleRowRootProps as TableHandleRowRootProps$1, TableHandleRowTriggerElement, TableHandleRowTriggerEvents, TableHandleRowTriggerProps as TableHandleRowTriggerProps$1 } from "@prosekit/web/table-handle";
4
4
 
5
5
  //#region src/components/table-handle/table-handle-column-root.gen.d.ts
6
- /**
7
- * Props for the {@link TableHandleColumnRoot} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link TableHandleColumnRoot} component.
11
9
  */
12
10
  interface TableHandleColumnRootProps extends Partial<CreateProps<TableHandleColumnRootProps$1, TableHandleColumnRootEvents>> {}
13
11
  declare const TableHandleColumnRoot: ForwardRefExoticComponent<TableHandleColumnRootProps & RefAttributes<TableHandleColumnRootElement> & HTMLAttributes<TableHandleColumnRootElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/table-handle/table-handle-column-trigger.gen.d.ts
17
14
  /**
@@ -19,7 +16,6 @@ declare const TableHandleColumnRoot: ForwardRefExoticComponent<TableHandleColumn
19
16
  */
20
17
  interface TableHandleColumnTriggerProps extends Partial<CreateProps<TableHandleColumnTriggerProps$1, TableHandleColumnTriggerEvents>> {}
21
18
  declare const TableHandleColumnTrigger: ForwardRefExoticComponent<TableHandleColumnTriggerProps & RefAttributes<TableHandleColumnTriggerElement> & HTMLAttributes<TableHandleColumnTriggerElement>>;
22
-
23
19
  //#endregion
24
20
  //#region src/components/table-handle/table-handle-popover-content.gen.d.ts
25
21
  /**
@@ -27,7 +23,6 @@ declare const TableHandleColumnTrigger: ForwardRefExoticComponent<TableHandleCol
27
23
  */
28
24
  interface TableHandlePopoverContentProps extends Partial<CreateProps<TableHandlePopoverContentProps$1, TableHandlePopoverContentEvents>> {}
29
25
  declare const TableHandlePopoverContent: ForwardRefExoticComponent<TableHandlePopoverContentProps & RefAttributes<TableHandlePopoverContentElement> & HTMLAttributes<TableHandlePopoverContentElement>>;
30
-
31
26
  //#endregion
32
27
  //#region src/components/table-handle/table-handle-popover-item.gen.d.ts
33
28
  /**
@@ -35,7 +30,6 @@ declare const TableHandlePopoverContent: ForwardRefExoticComponent<TableHandlePo
35
30
  */
36
31
  interface TableHandlePopoverItemProps extends Partial<CreateProps<TableHandlePopoverItemProps$1, TableHandlePopoverItemEvents>> {}
37
32
  declare const TableHandlePopoverItem: ForwardRefExoticComponent<TableHandlePopoverItemProps & RefAttributes<TableHandlePopoverItemElement> & HTMLAttributes<TableHandlePopoverItemElement>>;
38
-
39
33
  //#endregion
40
34
  //#region src/components/table-handle/table-handle-root.gen.d.ts
41
35
  /**
@@ -43,7 +37,6 @@ declare const TableHandlePopoverItem: ForwardRefExoticComponent<TableHandlePopov
43
37
  */
44
38
  interface TableHandleRootProps extends Partial<CreateProps<TableHandleRootProps$1, TableHandleRootEvents>> {}
45
39
  declare const TableHandleRoot: ForwardRefExoticComponent<TableHandleRootProps & RefAttributes<TableHandleRootElement> & HTMLAttributes<TableHandleRootElement>>;
46
-
47
40
  //#endregion
48
41
  //#region src/components/table-handle/table-handle-row-root.gen.d.ts
49
42
  /**
@@ -51,7 +44,6 @@ declare const TableHandleRoot: ForwardRefExoticComponent<TableHandleRootProps &
51
44
  */
52
45
  interface TableHandleRowRootProps extends Partial<CreateProps<TableHandleRowRootProps$1, TableHandleRowRootEvents>> {}
53
46
  declare const TableHandleRowRoot: ForwardRefExoticComponent<TableHandleRowRootProps & RefAttributes<TableHandleRowRootElement> & HTMLAttributes<TableHandleRowRootElement>>;
54
-
55
47
  //#endregion
56
48
  //#region src/components/table-handle/table-handle-row-trigger.gen.d.ts
57
49
  /**
@@ -59,6 +51,5 @@ declare const TableHandleRowRoot: ForwardRefExoticComponent<TableHandleRowRootPr
59
51
  */
60
52
  interface TableHandleRowTriggerProps extends Partial<CreateProps<TableHandleRowTriggerProps$1, TableHandleRowTriggerEvents>> {}
61
53
  declare const TableHandleRowTrigger: ForwardRefExoticComponent<TableHandleRowTriggerProps & RefAttributes<TableHandleRowTriggerElement> & HTMLAttributes<TableHandleRowTriggerElement>>;
62
-
63
54
  //#endregion
64
55
  export { TableHandleColumnRoot, TableHandleColumnRootProps, TableHandleColumnTrigger, TableHandleColumnTriggerProps, TableHandlePopoverContent, TableHandlePopoverContentProps, TableHandlePopoverItem, TableHandlePopoverItemProps, TableHandleRoot, TableHandleRootProps, TableHandleRowRoot, TableHandleRowRootProps, TableHandleRowTrigger, TableHandleRowTriggerProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { tableHandleColumnRootEvents, tableHandleColumnRootProps, tableHandleColumnTriggerEvents, tableHandleColumnTriggerProps, tableHandlePopoverContentEvents, tableHandlePopoverContentProps, tableHandlePopoverItemEvents, tableHandlePopoverItemProps, tableHandleRootEvents, tableHandleRootProps, tableHandleRowRootEvents, tableHandleRowRootProps, tableHandleRowTriggerEvents, tableHandleRowTriggerProps } from "@prosekit/web/table-handle";
4
4
 
5
5
  //#region src/components/table-handle/table-handle-column-root.gen.ts
@@ -1,17 +1,14 @@
1
- import { CreateProps } from "./create-props-B_K0wKYy.js";
1
+ import { CreateProps } from "./create-props-CkTwd_m_.js";
2
2
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
3
  import { TooltipContentElement, TooltipContentEvents, TooltipContentProps as TooltipContentProps$1, TooltipRootElement, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerElement, TooltipTriggerEvents, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
4
4
 
5
5
  //#region src/components/tooltip/tooltip-content.gen.d.ts
6
- /**
7
- * Props for the {@link TooltipContent} component.
8
- */
6
+
9
7
  /**
10
8
  * Props for the {@link TooltipContent} component.
11
9
  */
12
10
  interface TooltipContentProps extends Partial<CreateProps<TooltipContentProps$1, TooltipContentEvents>> {}
13
11
  declare const TooltipContent: ForwardRefExoticComponent<TooltipContentProps & RefAttributes<TooltipContentElement> & HTMLAttributes<TooltipContentElement>>;
14
-
15
12
  //#endregion
16
13
  //#region src/components/tooltip/tooltip-root.gen.d.ts
17
14
  /**
@@ -19,7 +16,6 @@ declare const TooltipContent: ForwardRefExoticComponent<TooltipContentProps & Re
19
16
  */
20
17
  interface TooltipRootProps extends Partial<CreateProps<TooltipRootProps$1, TooltipRootEvents>> {}
21
18
  declare const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttributes<TooltipRootElement> & HTMLAttributes<TooltipRootElement>>;
22
-
23
19
  //#endregion
24
20
  //#region src/components/tooltip/tooltip-trigger.gen.d.ts
25
21
  /**
@@ -27,6 +23,5 @@ declare const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttri
27
23
  */
28
24
  interface TooltipTriggerProps extends Partial<CreateProps<TooltipTriggerProps$1, TooltipTriggerEvents>> {}
29
25
  declare const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & RefAttributes<TooltipTriggerElement> & HTMLAttributes<TooltipTriggerElement>>;
30
-
31
26
  //#endregion
32
27
  export { TooltipContent, TooltipContentProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps };
@@ -1,5 +1,5 @@
1
1
  import "./editor-context-Cci4uqN_.js";
2
- import { createComponent } from "./create-component-DATBjvTG.js";
2
+ import { createComponent } from "./create-component-CBvs05W1.js";
3
3
  import { tooltipContentEvents, tooltipContentProps, tooltipRootEvents, tooltipRootProps, tooltipTriggerEvents, tooltipTriggerProps } from "@prosekit/web/tooltip";
4
4
 
5
5
  //#region src/components/tooltip/tooltip-content.gen.ts
@@ -16,7 +16,6 @@ interface ProseKitProps {
16
16
  * @public
17
17
  */
18
18
  declare const ProseKit: ComponentType<ProseKitProps>;
19
-
20
19
  //#endregion
21
20
  //#region src/extensions/react-mark-view.d.ts
22
21
  /**
@@ -48,7 +47,6 @@ interface ReactMarkViewOptions extends CoreMarkViewUserOptions<ReactMarkViewComp
48
47
  * @public
49
48
  */
50
49
  declare function defineReactMarkView(options: ReactMarkViewOptions): Extension;
51
-
52
50
  //#endregion
53
51
  //#region src/extensions/react-node-view.d.ts
54
52
  /**
@@ -80,7 +78,6 @@ interface ReactNodeViewOptions extends CoreNodeViewUserOptions<ReactNodeViewComp
80
78
  * @public
81
79
  */
82
80
  declare function defineReactNodeView(options: ReactNodeViewOptions): Extension;
83
-
84
81
  //#endregion
85
82
  //#region src/hooks/use-extension.d.ts
86
83
  interface UseExtensionOptions {
@@ -98,7 +95,6 @@ interface UseExtensionOptions {
98
95
  * Add an extension to the editor.
99
96
  */
100
97
  declare function useExtension(extension: Extension | null, options?: UseExtensionOptions): void;
101
-
102
98
  //#endregion
103
99
  //#region src/hooks/use-doc-change.d.ts
104
100
  /**
@@ -107,7 +103,6 @@ declare function useExtension(extension: Extension | null, options?: UseExtensio
107
103
  * @public
108
104
  */
109
105
  declare function useDocChange(handler: (doc: ProseMirrorNode) => void, options?: UseExtensionOptions): void;
110
-
111
106
  //#endregion
112
107
  //#region src/hooks/use-editor.d.ts
113
108
  /**
@@ -124,11 +119,9 @@ declare function useEditor<E extends Extension = any>(options?: {
124
119
  */
125
120
  update?: boolean;
126
121
  }): Editor<E>;
127
-
128
122
  //#endregion
129
123
  //#region src/hooks/use-keymap.d.ts
130
124
  declare function useKeymap(keymap: Keymap, options?: UseExtensionOptions): void;
131
-
132
125
  //#endregion
133
126
  //#region src/hooks/use-state-update.d.ts
134
127
  /**
@@ -137,7 +130,6 @@ declare function useKeymap(keymap: Keymap, options?: UseExtensionOptions): void;
137
130
  * @public
138
131
  */
139
132
  declare function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void;
140
-
141
133
  //#endregion
142
134
  //#region src/types.d.ts
143
135
  /**
@@ -146,6 +138,5 @@ declare function useStateUpdate(handler: (state: EditorState) => void, options?:
146
138
  type PropsWithClassName<P = unknown> = P & {
147
139
  className?: string | undefined;
148
140
  };
149
-
150
141
  //#endregion
151
142
  export { PropsWithClassName, ProseKit, ProseKitProps, ReactMarkViewComponent, ReactMarkViewOptions, ReactMarkViewProps, ReactNodeViewComponent, ReactNodeViewOptions, ReactNodeViewProps, UseExtensionOptions, defineReactMarkView, defineReactNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/react",
3
3
  "type": "module",
4
- "version": "0.4.13",
4
+ "version": "0.4.14",
5
5
  "private": false,
6
6
  "description": "React components and utilities for ProseKit",
7
7
  "author": {
@@ -65,10 +65,9 @@
65
65
  "dependencies": {
66
66
  "@prosemirror-adapter/core": "^0.4.0",
67
67
  "@prosemirror-adapter/react": "^0.4.1",
68
- "react-merge-refs": "^3.0.1",
69
- "@prosekit/core": "^0.8.1",
70
68
  "@prosekit/pm": "^0.1.10",
71
- "@prosekit/web": "^0.5.8"
69
+ "@prosekit/web": "^0.5.9",
70
+ "@prosekit/core": "^0.8.1"
72
71
  },
73
72
  "peerDependencies": {
74
73
  "react": ">= 18.2.0",
@@ -83,13 +82,13 @@
83
82
  }
84
83
  },
85
84
  "devDependencies": {
86
- "@types/react": "^19.1.3",
87
- "@types/react-dom": "^19.1.3",
85
+ "@types/react": "^19.1.6",
86
+ "@types/react-dom": "^19.1.5",
88
87
  "react": "^19.1.0",
89
88
  "react-dom": "^19.1.0",
90
- "tsdown": "^0.11.1",
89
+ "tsdown": "^0.12.4",
91
90
  "typescript": "~5.8.3",
92
- "vitest": "^3.1.3",
91
+ "vitest": "^3.1.4",
93
92
  "@prosekit/config-tsdown": "0.0.0",
94
93
  "@prosekit/config-vitest": "0.0.0"
95
94
  },