@prosekit/react 0.0.4 → 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.4",
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/command-empty": {
34
- "types": "./dist/prosekit-react-components-command-empty.d.ts",
35
- "import": "./dist/prosekit-react-components-command-empty.js",
36
- "default": "./dist/prosekit-react-components-command-empty.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/command-item": {
39
- "types": "./dist/prosekit-react-components-command-item.d.ts",
40
- "import": "./dist/prosekit-react-components-command-item.js",
41
- "default": "./dist/prosekit-react-components-command-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/command-list": {
44
- "types": "./dist/prosekit-react-components-command-list.d.ts",
45
- "import": "./dist/prosekit-react-components-command-list.js",
46
- "default": "./dist/prosekit-react-components-command-list.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/command-popover": {
49
- "types": "./dist/prosekit-react-components-command-popover.d.ts",
50
- "import": "./dist/prosekit-react-components-command-popover.js",
51
- "default": "./dist/prosekit-react-components-command-popover.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.4"
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/command-empty": [
95
- "./dist/prosekit-react-components-command-empty.d.ts"
94
+ "components/autocomplete-empty": [
95
+ "./dist/prosekit-react-components-autocomplete-empty.d.ts"
96
96
  ],
97
- "components/command-item": [
98
- "./dist/prosekit-react-components-command-item.d.ts"
97
+ "components/autocomplete-item": [
98
+ "./dist/prosekit-react-components-autocomplete-item.d.ts"
99
99
  ],
100
- "components/command-list": [
101
- "./dist/prosekit-react-components-command-list.d.ts"
100
+ "components/autocomplete-list": [
101
+ "./dist/prosekit-react-components-autocomplete-list.d.ts"
102
102
  ],
103
- "components/command-popover": [
104
- "./dist/prosekit-react-components-command-popover.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,11 +0,0 @@
1
- import { SimplifyUnion } from '@prosekit/core';
2
- import { CommandEmptyProps as CommandEmptyProps$1 } from '@prosekit/lit/components/command-empty';
3
- import React, { ComponentType } from 'react';
4
-
5
- type CommandEmptyProps = SimplifyUnion<{
6
- className?: string;
7
- children?: React.ReactNode;
8
- } & CommandEmptyProps$1>;
9
- declare const CommandEmpty: ComponentType<CommandEmptyProps>;
10
-
11
- export { CommandEmpty, CommandEmptyProps };
@@ -1,21 +0,0 @@
1
- // src/components/command-empty.gen.tsx
2
- import { createComponent } from "@lit-labs/react";
3
- import { CommandEmpty as CommandEmptyElement } from "@prosekit/lit/components/command-empty";
4
- import React from "react";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- var CommandEmptyComponent = createComponent({
7
- tagName: "prosekit-command-empty",
8
- elementClass: CommandEmptyElement,
9
- react: React,
10
- displayName: "CommandEmptyComponent"
11
- });
12
- var CommandEmpty = (props) => {
13
- return /* @__PURE__ */ jsxDEV(CommandEmptyComponent, { ...props }, void 0, false, {
14
- fileName: "src/components/command-empty.gen.tsx",
15
- lineNumber: 19,
16
- columnNumber: 10
17
- }, this);
18
- };
19
- export {
20
- CommandEmpty
21
- };
@@ -1,11 +0,0 @@
1
- import { SimplifyUnion } from '@prosekit/core';
2
- import { CommandItemProps as CommandItemProps$1 } from '@prosekit/lit/components/command-item';
3
- import React, { ComponentType } from 'react';
4
-
5
- type CommandItemProps = SimplifyUnion<{
6
- className?: string;
7
- children?: React.ReactNode;
8
- } & CommandItemProps$1>;
9
- declare const CommandItem: ComponentType<CommandItemProps>;
10
-
11
- export { CommandItem, CommandItemProps };
@@ -1,21 +0,0 @@
1
- // src/components/command-item.gen.tsx
2
- import { createComponent } from "@lit-labs/react";
3
- import { CommandItem as CommandItemElement } from "@prosekit/lit/components/command-item";
4
- import React from "react";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- var CommandItemComponent = createComponent({
7
- tagName: "prosekit-command-item",
8
- elementClass: CommandItemElement,
9
- react: React,
10
- displayName: "CommandItemComponent"
11
- });
12
- var CommandItem = (props) => {
13
- return /* @__PURE__ */ jsxDEV(CommandItemComponent, { ...props }, void 0, false, {
14
- fileName: "src/components/command-item.gen.tsx",
15
- lineNumber: 19,
16
- columnNumber: 10
17
- }, this);
18
- };
19
- export {
20
- CommandItem
21
- };
@@ -1,11 +0,0 @@
1
- import { SimplifyUnion } from '@prosekit/core';
2
- import { CommandListProps as CommandListProps$1 } from '@prosekit/lit/components/command-list';
3
- import React, { ComponentType } from 'react';
4
-
5
- type CommandListProps = SimplifyUnion<{
6
- className?: string;
7
- children?: React.ReactNode;
8
- } & CommandListProps$1>;
9
- declare const CommandList: ComponentType<CommandListProps>;
10
-
11
- export { CommandList, CommandListProps };
@@ -1,21 +0,0 @@
1
- // src/components/command-list.gen.tsx
2
- import { createComponent } from "@lit-labs/react";
3
- import { CommandList as CommandListElement } from "@prosekit/lit/components/command-list";
4
- import React from "react";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- var CommandListComponent = createComponent({
7
- tagName: "prosekit-command-list",
8
- elementClass: CommandListElement,
9
- react: React,
10
- displayName: "CommandListComponent"
11
- });
12
- var CommandList = (props) => {
13
- return /* @__PURE__ */ jsxDEV(CommandListComponent, { ...props }, void 0, false, {
14
- fileName: "src/components/command-list.gen.tsx",
15
- lineNumber: 19,
16
- columnNumber: 10
17
- }, this);
18
- };
19
- export {
20
- CommandList
21
- };
@@ -1,12 +0,0 @@
1
- import { CommandPopoverProps as CommandPopoverProps$1 } from '@prosekit/lit/components/command-popover';
2
- export { PopoverOptions, QueryBuilder } from '@prosekit/lit/components/command-popover';
3
- import { SimplifyUnion } from '@prosekit/core';
4
- import React, { ComponentType } from 'react';
5
-
6
- type CommandPopoverProps = SimplifyUnion<{
7
- className?: string;
8
- children?: React.ReactNode;
9
- } & CommandPopoverProps$1>;
10
- declare const CommandPopover: ComponentType<CommandPopoverProps>;
11
-
12
- export { CommandPopover, CommandPopoverProps };
@@ -1,21 +0,0 @@
1
- // src/components/command-popover.gen.tsx
2
- import { createComponent } from "@lit-labs/react";
3
- import { CommandPopover as CommandPopoverElement } from "@prosekit/lit/components/command-popover";
4
- import React from "react";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- var CommandPopoverComponent = createComponent({
7
- tagName: "prosekit-command-popover",
8
- elementClass: CommandPopoverElement,
9
- react: React,
10
- displayName: "CommandPopoverComponent"
11
- });
12
- var CommandPopover = (props) => {
13
- return /* @__PURE__ */ jsxDEV(CommandPopoverComponent, { ...props }, void 0, false, {
14
- fileName: "src/components/command-popover.gen.tsx",
15
- lineNumber: 19,
16
- columnNumber: 10
17
- }, this);
18
- };
19
- export {
20
- CommandPopover
21
- };