@prosekit/react 0.0.22 → 0.0.24

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.
@@ -8,8 +8,6 @@ import { AutocompleteList as AutocompleteList_2 } from '@prosekit/lit/autocomple
8
8
  import { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/lit/autocomplete-list';
9
9
  import { AutocompletePopover as AutocompletePopover_2 } from '@prosekit/lit/autocomplete-popover';
10
10
  import { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/lit/autocomplete-popover';
11
- import { CodeBlockPopover as CodeBlockPopover_2 } from '@prosekit/lit/code-block-popover';
12
- import { CodeBlockPopoverProps as CodeBlockPopoverProps_2 } from '@prosekit/lit/code-block-popover';
13
11
  import { ComboBox as ComboBox_2 } from '@prosekit/lit/combo-box';
14
12
  import { ComboBoxInput as ComboBoxInput_2 } from '@prosekit/lit/combo-box-input';
15
13
  import { ComboBoxInputProps as ComboBoxInputProps_2 } from '@prosekit/lit/combo-box-input';
@@ -25,6 +23,8 @@ import { Editor } from '@prosekit/core';
25
23
  import { Extension } from '@prosekit/core';
26
24
  import { ExtensionTyping } from '@prosekit/core';
27
25
  import type { ForwardRefExoticComponent } from 'react';
26
+ import { InlinePopover as InlinePopover_2 } from '@prosekit/lit/inline-popover';
27
+ import { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/lit/inline-popover';
28
28
  import { Keymap } from '@prosekit/core';
29
29
  import type { NodeViewContext } from '@prosemirror-adapter/react';
30
30
  import { Options } from 'tsup';
@@ -83,13 +83,6 @@ declare type AutocompletePopoverProps = SimplifyUnion<{
83
83
  export { AutocompletePopoverProps }
84
84
  export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
85
85
 
86
- export declare const CodeBlockPopover: ForwardRefExoticComponent<PropsWithoutRef<CodeBlockPopoverProps> & RefAttributes<CodeBlockPopover_2>>;
87
-
88
- export declare type CodeBlockPopoverProps = SimplifyUnion<{
89
- className?: string;
90
- children?: React_2.ReactNode;
91
- } & CodeBlockPopoverProps_2>;
92
-
93
86
  export declare const ComboBox: ForwardRefExoticComponent<PropsWithoutRef<ComboBoxProps> & RefAttributes<ComboBox_2>>;
94
87
 
95
88
  export declare const ComboBoxInput: ForwardRefExoticComponent<PropsWithoutRef<ComboBoxInputProps> & RefAttributes<ComboBoxInput_2>>;
@@ -136,6 +129,13 @@ export declare interface EditorContext {
136
129
 
137
130
  export declare const editorContext: Context<EditorContext | null>;
138
131
 
132
+ export declare const InlinePopover: ForwardRefExoticComponent<PropsWithoutRef<InlinePopoverProps> & RefAttributes<InlinePopover_2>>;
133
+
134
+ export declare type InlinePopoverProps = SimplifyUnion<{
135
+ className?: string;
136
+ children?: React_2.ReactNode;
137
+ } & InlinePopoverProps_2>;
138
+
139
139
  export declare const Popover: ForwardRefExoticComponent<PropsWithoutRef<PopoverProps> & RefAttributes<Popover_2>>;
140
140
 
141
141
  export { PopoverOptions }
@@ -179,17 +179,11 @@ declare interface UseEditorOptions {
179
179
  export { UseEditorOptions }
180
180
  export { UseEditorOptions as UseEditorOptions_alias_1 }
181
181
 
182
- declare function useExtension({ extension }: UseExtensionProps): void;
182
+ declare function useExtension<T extends Extension = Extension>(extension: T): void;
183
183
  export { useExtension }
184
184
  export { useExtension as useExtension_alias_1 }
185
185
 
186
- declare interface UseExtensionProps<T extends Extension = Extension> {
187
- extension: T;
188
- }
189
-
190
- declare function useKeymap({ keymap }: {
191
- keymap: Keymap;
192
- }): void;
186
+ declare function useKeymap(keymap: Keymap): void;
193
187
  export { useKeymap }
194
188
  export { useKeymap as useKeymap_alias_1 }
195
189
 
@@ -0,0 +1,2 @@
1
+ export { InlinePopoverProps } from './_tsup-dts-rollup';
2
+ export { InlinePopover } from './_tsup-dts-rollup';
@@ -0,0 +1,17 @@
1
+ // src/components/inline-popover.gen.ts
2
+ import { createComponent } from "@lit/react";
3
+ import { InlinePopover as InlinePopoverElement } from "@prosekit/lit/inline-popover";
4
+ import React from "react";
5
+ var InlinePopoverInner = createComponent({
6
+ tagName: "prosekit-inline-popover",
7
+ elementClass: InlinePopoverElement,
8
+ react: React,
9
+ displayName: "InlinePopoverInner"
10
+ });
11
+ var InlinePopover = React.forwardRef((props, ref) => {
12
+ return React.createElement(InlinePopoverInner, { ...props, ref });
13
+ });
14
+ InlinePopover.displayName = "InlinePopover";
15
+ export {
16
+ InlinePopover
17
+ };
@@ -57,7 +57,7 @@ import { useEffect as useEffect2 } from "react";
57
57
  // src/hooks/use-editor.ts
58
58
  import {
59
59
  ProseKitError,
60
- defineEventHandler
60
+ defineUpdateHandler
61
61
  } from "@prosekit/core";
62
62
  import { useContext, useEffect, useReducer } from "react";
63
63
  function useEditor(options) {
@@ -73,7 +73,7 @@ function useEditor(options) {
73
73
  const forceUpdate = useForceUpdate();
74
74
  useEffect(() => {
75
75
  if (update) {
76
- return editor.use(defineEventHandler({ update: forceUpdate }));
76
+ return editor.use(defineUpdateHandler(forceUpdate));
77
77
  }
78
78
  }, [editor, update, forceUpdate]);
79
79
  return editor;
@@ -84,7 +84,7 @@ function useForceUpdate() {
84
84
  }
85
85
 
86
86
  // src/hooks/use-extension.ts
87
- function useExtension({ extension }) {
87
+ function useExtension(extension) {
88
88
  const editor = useEditor();
89
89
  useEffect2(() => {
90
90
  return editor.use(extension);
@@ -111,7 +111,7 @@ function RendererRegister() {
111
111
  () => defineReactNodeViewRenderer({ nodeViewFactory }),
112
112
  [nodeViewFactory]
113
113
  );
114
- useExtension({ extension });
114
+ useExtension(extension);
115
115
  return null;
116
116
  }
117
117
  var EditorContextProvider = editorContext.Provider;
@@ -119,9 +119,9 @@ var EditorContextProvider = editorContext.Provider;
119
119
  // src/hooks/use-keymap.ts
120
120
  import { defineKeymap } from "@prosekit/core";
121
121
  import { useMemo as useMemo2 } from "react";
122
- function useKeymap({ keymap }) {
122
+ function useKeymap(keymap) {
123
123
  const extension = useMemo2(() => defineKeymap(keymap), [keymap]);
124
- useExtension({ extension });
124
+ useExtension(extension);
125
125
  }
126
126
  export {
127
127
  ProseKit,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/react",
3
3
  "type": "module",
4
- "version": "0.0.22",
4
+ "version": "0.0.24",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -50,11 +50,6 @@
50
50
  "import": "./dist/prosekit-react-autocomplete-popover.js",
51
51
  "default": "./dist/prosekit-react-autocomplete-popover.js"
52
52
  },
53
- "./code-block-popover": {
54
- "types": "./dist/prosekit-react-code-block-popover.d.ts",
55
- "import": "./dist/prosekit-react-code-block-popover.js",
56
- "default": "./dist/prosekit-react-code-block-popover.js"
57
- },
58
53
  "./combo-box": {
59
54
  "types": "./dist/prosekit-react-combo-box.d.ts",
60
55
  "import": "./dist/prosekit-react-combo-box.js",
@@ -75,6 +70,11 @@
75
70
  "import": "./dist/prosekit-react-combo-box-list.js",
76
71
  "default": "./dist/prosekit-react-combo-box-list.js"
77
72
  },
73
+ "./inline-popover": {
74
+ "types": "./dist/prosekit-react-inline-popover.d.ts",
75
+ "import": "./dist/prosekit-react-inline-popover.js",
76
+ "default": "./dist/prosekit-react-inline-popover.js"
77
+ },
78
78
  "./popover": {
79
79
  "types": "./dist/prosekit-react-popover.d.ts",
80
80
  "import": "./dist/prosekit-react-popover.js",
@@ -86,8 +86,8 @@
86
86
  ],
87
87
  "dependencies": {
88
88
  "@lit/react": "^1.0.1",
89
- "@prosekit/core": "^0.0.18",
90
- "@prosekit/lit": "^0.0.22",
89
+ "@prosekit/core": "^0.0.20",
90
+ "@prosekit/lit": "^0.0.24",
91
91
  "@prosemirror-adapter/react": "^0.2.6"
92
92
  },
93
93
  "peerDependencies": {
@@ -104,8 +104,8 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "@prosekit/dev": "*",
107
- "@types/react": "^18.2.34",
108
- "@types/react-dom": "^18.2.14",
107
+ "@types/react": "^18.2.37",
108
+ "@types/react-dom": "^18.2.15",
109
109
  "react": "^18.2.0",
110
110
  "react-dom": "^18.2.0",
111
111
  "tsup": "^7.2.0",
@@ -134,9 +134,6 @@
134
134
  "autocomplete-popover": [
135
135
  "./dist/prosekit-react-autocomplete-popover.d.ts"
136
136
  ],
137
- "code-block-popover": [
138
- "./dist/prosekit-react-code-block-popover.d.ts"
139
- ],
140
137
  "combo-box": [
141
138
  "./dist/prosekit-react-combo-box.d.ts"
142
139
  ],
@@ -149,6 +146,9 @@
149
146
  "combo-box-list": [
150
147
  "./dist/prosekit-react-combo-box-list.d.ts"
151
148
  ],
149
+ "inline-popover": [
150
+ "./dist/prosekit-react-inline-popover.d.ts"
151
+ ],
152
152
  "popover": [
153
153
  "./dist/prosekit-react-popover.d.ts"
154
154
  ]
@@ -1,2 +0,0 @@
1
- export { CodeBlockPopoverProps } from './_tsup-dts-rollup';
2
- export { CodeBlockPopover } from './_tsup-dts-rollup';
@@ -1,17 +0,0 @@
1
- // src/components/code-block-popover.gen.ts
2
- import { createComponent } from "@lit/react";
3
- import { CodeBlockPopover as CodeBlockPopoverElement } from "@prosekit/lit/code-block-popover";
4
- import React from "react";
5
- var CodeBlockPopoverInner = createComponent({
6
- tagName: "prosekit-code-block-popover",
7
- elementClass: CodeBlockPopoverElement,
8
- react: React,
9
- displayName: "CodeBlockPopoverInner"
10
- });
11
- var CodeBlockPopover = React.forwardRef((props, ref) => {
12
- return React.createElement(CodeBlockPopoverInner, { ...props, ref });
13
- });
14
- CodeBlockPopover.displayName = "CodeBlockPopover";
15
- export {
16
- CodeBlockPopover
17
- };