@prosekit/react 0.0.3 → 0.0.5

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.
@@ -0,0 +1,11 @@
1
+ import { SimplifyUnion } from '@prosekit/core';
2
+ import { AutocompleteEmptyProps as AutocompleteEmptyProps$1 } from '@prosekit/lit/components/autocomplete-empty';
3
+ import React, { ComponentType } from 'react';
4
+
5
+ type AutocompleteEmptyProps = SimplifyUnion<{
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ } & AutocompleteEmptyProps$1>;
9
+ declare const AutocompleteEmpty: ComponentType<AutocompleteEmptyProps>;
10
+
11
+ export { AutocompleteEmpty, AutocompleteEmptyProps };
@@ -0,0 +1,16 @@
1
+ // src/components/autocomplete-empty.gen.ts
2
+ import { createComponent } from "@lit-labs/react";
3
+ import { AutocompleteEmpty as AutocompleteEmptyElement } from "@prosekit/lit/components/autocomplete-empty";
4
+ import React from "react";
5
+ var AutocompleteEmptyComponent = createComponent({
6
+ tagName: "prosekit-autocomplete-empty",
7
+ elementClass: AutocompleteEmptyElement,
8
+ react: React,
9
+ displayName: "AutocompleteEmptyComponent"
10
+ });
11
+ var AutocompleteEmpty = (props) => {
12
+ return React.createElement(AutocompleteEmptyComponent, props);
13
+ };
14
+ export {
15
+ AutocompleteEmpty
16
+ };
@@ -0,0 +1,11 @@
1
+ import { SimplifyUnion } from '@prosekit/core';
2
+ import { AutocompleteItemProps as AutocompleteItemProps$1 } from '@prosekit/lit/components/autocomplete-item';
3
+ import React, { ComponentType } from 'react';
4
+
5
+ type AutocompleteItemProps = SimplifyUnion<{
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ } & AutocompleteItemProps$1>;
9
+ declare const AutocompleteItem: ComponentType<AutocompleteItemProps>;
10
+
11
+ export { AutocompleteItem, AutocompleteItemProps };
@@ -0,0 +1,16 @@
1
+ // src/components/autocomplete-item.gen.ts
2
+ import { createComponent } from "@lit-labs/react";
3
+ import { AutocompleteItem as AutocompleteItemElement } from "@prosekit/lit/components/autocomplete-item";
4
+ import React from "react";
5
+ var AutocompleteItemComponent = createComponent({
6
+ tagName: "prosekit-autocomplete-item",
7
+ elementClass: AutocompleteItemElement,
8
+ react: React,
9
+ displayName: "AutocompleteItemComponent"
10
+ });
11
+ var AutocompleteItem = (props) => {
12
+ return React.createElement(AutocompleteItemComponent, props);
13
+ };
14
+ export {
15
+ AutocompleteItem
16
+ };
@@ -0,0 +1,11 @@
1
+ import { SimplifyUnion } from '@prosekit/core';
2
+ import { AutocompleteListProps as AutocompleteListProps$1 } from '@prosekit/lit/components/autocomplete-list';
3
+ import React, { ComponentType } from 'react';
4
+
5
+ type AutocompleteListProps = SimplifyUnion<{
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ } & AutocompleteListProps$1>;
9
+ declare const AutocompleteList: ComponentType<AutocompleteListProps>;
10
+
11
+ export { AutocompleteList, AutocompleteListProps };
@@ -0,0 +1,16 @@
1
+ // src/components/autocomplete-list.gen.ts
2
+ import { createComponent } from "@lit-labs/react";
3
+ import { AutocompleteList as AutocompleteListElement } from "@prosekit/lit/components/autocomplete-list";
4
+ import React from "react";
5
+ var AutocompleteListComponent = createComponent({
6
+ tagName: "prosekit-autocomplete-list",
7
+ elementClass: AutocompleteListElement,
8
+ react: React,
9
+ displayName: "AutocompleteListComponent"
10
+ });
11
+ var AutocompleteList = (props) => {
12
+ return React.createElement(AutocompleteListComponent, props);
13
+ };
14
+ export {
15
+ AutocompleteList
16
+ };
@@ -0,0 +1,12 @@
1
+ import { AutocompletePopoverProps as AutocompletePopoverProps$1 } from '@prosekit/lit/components/autocomplete-popover';
2
+ export { PopoverOptions } from '@prosekit/lit/components/autocomplete-popover';
3
+ import { SimplifyUnion } from '@prosekit/core';
4
+ import React, { ComponentType } from 'react';
5
+
6
+ type AutocompletePopoverProps = SimplifyUnion<{
7
+ className?: string;
8
+ children?: React.ReactNode;
9
+ } & AutocompletePopoverProps$1>;
10
+ declare const AutocompletePopover: ComponentType<AutocompletePopoverProps>;
11
+
12
+ export { AutocompletePopover, AutocompletePopoverProps };
@@ -0,0 +1,16 @@
1
+ // src/components/autocomplete-popover.gen.ts
2
+ import { createComponent } from "@lit-labs/react";
3
+ import { AutocompletePopover as AutocompletePopoverElement } from "@prosekit/lit/components/autocomplete-popover";
4
+ import React from "react";
5
+ var AutocompletePopoverComponent = createComponent({
6
+ tagName: "prosekit-autocomplete-popover",
7
+ elementClass: AutocompletePopoverElement,
8
+ react: React,
9
+ displayName: "AutocompletePopoverComponent"
10
+ });
11
+ var AutocompletePopover = (props) => {
12
+ return React.createElement(AutocompletePopoverComponent, props);
13
+ };
14
+ export {
15
+ AutocompletePopover
16
+ };
@@ -1,16 +1,15 @@
1
- // src/contexts/editor-context.tsx
1
+ // src/components/prosekit.ts
2
+ import "@prosekit/core";
3
+ import { createElement } from "react";
4
+
5
+ // src/contexts/editor-context.ts
2
6
  import { createContext } from "react";
3
7
  var editorContext = createContext(null);
4
8
 
5
- // src/components/prosekit.tsx
6
- import { jsxDEV } from "react/jsx-dev-runtime";
9
+ // src/components/prosekit.ts
7
10
  var ProseKit = (props) => {
8
- const editor = props.editor;
9
- return /* @__PURE__ */ jsxDEV(EditorContextProvider, { value: { editor }, children: props.children }, void 0, false, {
10
- fileName: "src/components/prosekit.tsx",
11
- lineNumber: 15,
12
- columnNumber: 5
13
- }, this);
11
+ const { editor, children } = props;
12
+ return createElement(EditorContextProvider, { value: { editor } }, children);
14
13
  };
15
14
  var EditorContextProvider = editorContext.Provider;
16
15
 
@@ -28,6 +27,7 @@ function useEditor() {
28
27
  }
29
28
 
30
29
  // src/hooks/use-extension.ts
30
+ import "@prosekit/core";
31
31
  import { useEffect } from "react";
32
32
  function useExtension({ extension }) {
33
33
  const editor = useEditor();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/react",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -30,25 +30,25 @@
30
30
  "import": "./dist/prosekit-react.js",
31
31
  "default": "./dist/prosekit-react.js"
32
32
  },
33
- "./components/menu": {
34
- "types": "./dist/prosekit-react-components-menu.d.ts",
35
- "import": "./dist/prosekit-react-components-menu.js",
36
- "default": "./dist/prosekit-react-components-menu.js"
33
+ "./components/autocomplete-empty": {
34
+ "types": "./dist/prosekit-react-components-autocomplete-empty.d.ts",
35
+ "import": "./dist/prosekit-react-components-autocomplete-empty.js",
36
+ "default": "./dist/prosekit-react-components-autocomplete-empty.js"
37
37
  },
38
- "./components/menu-item": {
39
- "types": "./dist/prosekit-react-components-menu-item.d.ts",
40
- "import": "./dist/prosekit-react-components-menu-item.js",
41
- "default": "./dist/prosekit-react-components-menu-item.js"
38
+ "./components/autocomplete-item": {
39
+ "types": "./dist/prosekit-react-components-autocomplete-item.d.ts",
40
+ "import": "./dist/prosekit-react-components-autocomplete-item.js",
41
+ "default": "./dist/prosekit-react-components-autocomplete-item.js"
42
42
  },
43
- "./components/popover": {
44
- "types": "./dist/prosekit-react-components-popover.d.ts",
45
- "import": "./dist/prosekit-react-components-popover.js",
46
- "default": "./dist/prosekit-react-components-popover.js"
43
+ "./components/autocomplete-list": {
44
+ "types": "./dist/prosekit-react-components-autocomplete-list.d.ts",
45
+ "import": "./dist/prosekit-react-components-autocomplete-list.js",
46
+ "default": "./dist/prosekit-react-components-autocomplete-list.js"
47
47
  },
48
- "./components/popover-suggestion": {
49
- "types": "./dist/prosekit-react-components-popover-suggestion.d.ts",
50
- "import": "./dist/prosekit-react-components-popover-suggestion.js",
51
- "default": "./dist/prosekit-react-components-popover-suggestion.js"
48
+ "./components/autocomplete-popover": {
49
+ "types": "./dist/prosekit-react-components-autocomplete-popover.d.ts",
50
+ "import": "./dist/prosekit-react-components-autocomplete-popover.js",
51
+ "default": "./dist/prosekit-react-components-autocomplete-popover.js"
52
52
  }
53
53
  },
54
54
  "files": [
@@ -56,8 +56,8 @@
56
56
  ],
57
57
  "dependencies": {
58
58
  "@lit-labs/react": "latest",
59
- "@prosekit/core": "^0.0.3",
60
- "@prosekit/lit": "^0.0.3"
59
+ "@prosekit/core": "^0.0.4",
60
+ "@prosekit/lit": "^0.0.5"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "react": ">= 17.0.0",
@@ -73,8 +73,8 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@prosekit/dev": "*",
76
- "@types/react": "^18.2.14",
77
- "@types/react-dom": "^18.2.6",
76
+ "@types/react": "^18.2.15",
77
+ "@types/react-dom": "^18.2.7",
78
78
  "react": "^18.2.0",
79
79
  "react-dom": "^18.2.0",
80
80
  "tsup": "^7.1.0",
@@ -91,17 +91,17 @@
91
91
  ".": [
92
92
  "./dist/prosekit-react.d.ts"
93
93
  ],
94
- "components/menu": [
95
- "./dist/prosekit-react-components-menu.d.ts"
94
+ "components/autocomplete-empty": [
95
+ "./dist/prosekit-react-components-autocomplete-empty.d.ts"
96
96
  ],
97
- "components/menu-item": [
98
- "./dist/prosekit-react-components-menu-item.d.ts"
97
+ "components/autocomplete-item": [
98
+ "./dist/prosekit-react-components-autocomplete-item.d.ts"
99
99
  ],
100
- "components/popover": [
101
- "./dist/prosekit-react-components-popover.d.ts"
100
+ "components/autocomplete-list": [
101
+ "./dist/prosekit-react-components-autocomplete-list.d.ts"
102
102
  ],
103
- "components/popover-suggestion": [
104
- "./dist/prosekit-react-components-popover-suggestion.d.ts"
103
+ "components/autocomplete-popover": [
104
+ "./dist/prosekit-react-components-autocomplete-popover.d.ts"
105
105
  ]
106
106
  }
107
107
  }
package/src/index.ts CHANGED
@@ -1,7 +1,3 @@
1
- /**
2
- * @module @prosekit/react
3
- */
4
-
5
1
  export { ProseKit, type ProseKitProps } from './components/prosekit'
6
2
  export { useEditor } from './hooks/use-editor'
7
3
  export { useExtension } from './hooks/use-extension'
@@ -1,6 +0,0 @@
1
- import * as _lit_labs_react from '@lit-labs/react';
2
- import { MenuItem as MenuItem$1 } from '@prosekit/lit/elements/menu-item';
3
-
4
- declare const MenuItem: _lit_labs_react.ReactWebComponent<MenuItem$1, {}>;
5
-
6
- export { MenuItem };
@@ -1,13 +0,0 @@
1
- // src/components/menu-item.gen.ts
2
- import { createComponent } from "@lit-labs/react";
3
- import { MenuItem as MenuItemElement } from "@prosekit/lit/elements/menu-item";
4
- import React from "react";
5
- var MenuItem = createComponent({
6
- tagName: "prosekit-menu-item",
7
- elementClass: MenuItemElement,
8
- react: React,
9
- displayName: "MenuItem"
10
- });
11
- export {
12
- MenuItem
13
- };
@@ -1,16 +0,0 @@
1
- import { Editor } from '@prosekit/core';
2
- import { Menu as Menu$1 } from '@prosekit/lit/elements/menu';
3
- import { ComponentType, ForwardedRef, ReactNode } from 'react';
4
-
5
- /**
6
- * @module @prosekit/react/components/menu
7
- */
8
-
9
- declare const Menu: ComponentType<{
10
- editor?: Editor;
11
- ref?: ForwardedRef<Menu$1>;
12
- children?: ReactNode | undefined;
13
- className?: string;
14
- }>;
15
-
16
- export { Menu };
@@ -1,16 +0,0 @@
1
- // src/components/menu.gen.ts
2
- import { createComponent } from "@lit-labs/react";
3
- import { Menu as MenuElement } from "@prosekit/lit/elements/menu";
4
- import React from "react";
5
- var Menu = createComponent({
6
- tagName: "prosekit-menu",
7
- elementClass: MenuElement,
8
- react: React,
9
- displayName: "Menu"
10
- });
11
-
12
- // src/components/menu.tsx
13
- var Menu2 = Menu;
14
- export {
15
- Menu2 as Menu
16
- };
@@ -1,16 +0,0 @@
1
- import { Editor } from '@prosekit/core';
2
- import { PredictionRule, PopoverSuggestionContext } from '@prosekit/lit/elements/popover-suggestion';
3
- export { PopoverSuggestionContext, PredictionRule } from '@prosekit/lit/elements/popover-suggestion';
4
- import React, { FC } from 'react';
5
-
6
- /**
7
- * @module @prosekit/react/components/popover-slash
8
- */
9
-
10
- declare const PopoverSuggestion: FC<{
11
- editor: Editor;
12
- rules: PredictionRule[];
13
- render: (context: PopoverSuggestionContext) => React.ReactNode;
14
- }>;
15
-
16
- export { PopoverSuggestion };
@@ -1,27 +0,0 @@
1
- // src/components/popover-suggestion.tsx
2
- import { useState } from "react";
3
-
4
- // src/components/popover-suggestion.gen.ts
5
- import { createComponent } from "@lit-labs/react";
6
- import { PopoverSuggestion as PopoverSuggestionElement } from "@prosekit/lit/elements/popover-suggestion";
7
- import React from "react";
8
- var PopoverSuggestion = createComponent({
9
- tagName: "prosekit-popover-suggestion",
10
- elementClass: PopoverSuggestionElement,
11
- react: React,
12
- displayName: "PopoverSuggestion"
13
- });
14
-
15
- // src/components/popover-suggestion.tsx
16
- import { jsxDEV } from "react/jsx-dev-runtime";
17
- var PopoverSuggestion2 = ({ editor, rules, render }) => {
18
- const [context, setContext] = useState(null);
19
- return /* @__PURE__ */ jsxDEV(PopoverSuggestion, { editor, rules, onContext: setContext, children: context ? render(context) : null }, void 0, false, {
20
- fileName: "src/components/popover-suggestion.tsx",
21
- lineNumber: 23,
22
- columnNumber: 5
23
- }, this);
24
- };
25
- export {
26
- PopoverSuggestion2 as PopoverSuggestion
27
- };
@@ -1,6 +0,0 @@
1
- import * as _lit_labs_react from '@lit-labs/react';
2
- import { Popover as Popover$1 } from '@prosekit/lit/elements/popover';
3
-
4
- declare const Popover: _lit_labs_react.ReactWebComponent<Popover$1, {}>;
5
-
6
- export { Popover };
@@ -1,13 +0,0 @@
1
- // src/components/popover.gen.ts
2
- import { createComponent } from "@lit-labs/react";
3
- import { Popover as PopoverElement } from "@prosekit/lit/elements/popover";
4
- import React from "react";
5
- var Popover = createComponent({
6
- tagName: "prosekit-popover",
7
- elementClass: PopoverElement,
8
- react: React,
9
- displayName: "Popover"
10
- });
11
- export {
12
- Popover
13
- };