@kendew-agency/react-feedback-layer 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +1156 -0
- package/dist/comment.types-B7xO89Wt.d.cts +240 -0
- package/dist/comment.types-B7xO89Wt.d.ts +240 -0
- package/dist/index.cjs +756 -0
- package/dist/index.d.cts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +712 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +39 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.js +0 -0
- package/package.json +83 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactNode, ElementType, ButtonHTMLAttributes, HTMLProps } from 'react';
|
|
4
|
+
import { C as CommentType, a as CommentOverlayProps, b as CommentContext } from './comment.types-B7xO89Wt.cjs';
|
|
5
|
+
|
|
6
|
+
declare const CommentOverlay: ({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
|
+
|
|
10
|
+
type CommentRendererProps = {
|
|
11
|
+
Comment: ElementType<{
|
|
12
|
+
comment: CommentType;
|
|
13
|
+
}>;
|
|
14
|
+
DraftComment: ElementType<{
|
|
15
|
+
comment: CommentType;
|
|
16
|
+
}>;
|
|
17
|
+
ResolvingComment: ElementType<{
|
|
18
|
+
comment: CommentType;
|
|
19
|
+
}>;
|
|
20
|
+
ResolvedComment: ElementType<{
|
|
21
|
+
comment: CommentType;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
declare const CommentRenderer: ({ Comment, DraftComment, ResolvingComment, ResolvedComment, }: CommentRendererProps) => react_jsx_runtime.JSX.Element | null;
|
|
30
|
+
|
|
31
|
+
interface CommentButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
32
|
+
asChild?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const ToggleOverlayButton: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const ConfirmComments: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare const ResolveComments: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
interface CommentRootProps extends HTMLProps<HTMLDivElement> {
|
|
39
|
+
comment: CommentType;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
defaultDraft?: string;
|
|
42
|
+
}
|
|
43
|
+
interface CommentIndicatorProps extends HTMLProps<HTMLDivElement> {
|
|
44
|
+
}
|
|
45
|
+
interface CommentContentProps extends HTMLProps<HTMLParagraphElement> {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface CommentEditProps extends HTMLProps<HTMLTextAreaElement> {
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
}
|
|
51
|
+
interface CommentConfirmProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface CommentDeleteProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface CommentResolveProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
}
|
|
60
|
+
declare const Comment: {
|
|
61
|
+
Root: ({ comment, children, defaultDraft, ...rest }: CommentRootProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Indicator: ({ ...rest }: CommentIndicatorProps) => react_jsx_runtime.JSX.Element | null;
|
|
63
|
+
Content: ({ asChild, ...rest }: CommentContentProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
Edit: ({ asChild, ...rest }: CommentEditProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
Confirm: ({ asChild, ...rest }: CommentConfirmProps) => react_jsx_runtime.JSX.Element;
|
|
66
|
+
Delete: ({ asChild, ...rest }: CommentDeleteProps) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
Resolve: ({ asChild, ...rest }: CommentResolveProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Comment context provider to provide the comments to the children components
|
|
72
|
+
*
|
|
73
|
+
* @param initialComments as the initial comments from the document
|
|
74
|
+
*/
|
|
75
|
+
declare const CommentContextProvider: ({ children, initialComments, initialOverlayState, onConfirm, onResolve, currentUser, subscription, config, onError, }: CommentOverlayProps) => react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare const useComments: () => CommentContext;
|
|
77
|
+
|
|
78
|
+
type CommentScope = {
|
|
79
|
+
comment: CommentType;
|
|
80
|
+
isActive: boolean;
|
|
81
|
+
draft: string;
|
|
82
|
+
setDraft: React.Dispatch<React.SetStateAction<string>>;
|
|
83
|
+
};
|
|
84
|
+
declare const CommentScopeContext: React.Context<CommentScope | null>;
|
|
85
|
+
declare function useCommentScope(): CommentScope;
|
|
86
|
+
|
|
87
|
+
export { Comment, CommentContextProvider, CommentOverlay, CommentRenderer, CommentScopeContext, ConfirmComments, ResolveComments, ToggleOverlayButton, useCommentScope, useComments };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactNode, ElementType, ButtonHTMLAttributes, HTMLProps } from 'react';
|
|
4
|
+
import { C as CommentType, a as CommentOverlayProps, b as CommentContext } from './comment.types-B7xO89Wt.js';
|
|
5
|
+
|
|
6
|
+
declare const CommentOverlay: ({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
|
+
|
|
10
|
+
type CommentRendererProps = {
|
|
11
|
+
Comment: ElementType<{
|
|
12
|
+
comment: CommentType;
|
|
13
|
+
}>;
|
|
14
|
+
DraftComment: ElementType<{
|
|
15
|
+
comment: CommentType;
|
|
16
|
+
}>;
|
|
17
|
+
ResolvingComment: ElementType<{
|
|
18
|
+
comment: CommentType;
|
|
19
|
+
}>;
|
|
20
|
+
ResolvedComment: ElementType<{
|
|
21
|
+
comment: CommentType;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
declare const CommentRenderer: ({ Comment, DraftComment, ResolvingComment, ResolvedComment, }: CommentRendererProps) => react_jsx_runtime.JSX.Element | null;
|
|
30
|
+
|
|
31
|
+
interface CommentButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
32
|
+
asChild?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const ToggleOverlayButton: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const ConfirmComments: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare const ResolveComments: ({ asChild, ...rest }: CommentButtonProps) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
interface CommentRootProps extends HTMLProps<HTMLDivElement> {
|
|
39
|
+
comment: CommentType;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
defaultDraft?: string;
|
|
42
|
+
}
|
|
43
|
+
interface CommentIndicatorProps extends HTMLProps<HTMLDivElement> {
|
|
44
|
+
}
|
|
45
|
+
interface CommentContentProps extends HTMLProps<HTMLParagraphElement> {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface CommentEditProps extends HTMLProps<HTMLTextAreaElement> {
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
}
|
|
51
|
+
interface CommentConfirmProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface CommentDeleteProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface CommentResolveProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
}
|
|
60
|
+
declare const Comment: {
|
|
61
|
+
Root: ({ comment, children, defaultDraft, ...rest }: CommentRootProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Indicator: ({ ...rest }: CommentIndicatorProps) => react_jsx_runtime.JSX.Element | null;
|
|
63
|
+
Content: ({ asChild, ...rest }: CommentContentProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
Edit: ({ asChild, ...rest }: CommentEditProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
Confirm: ({ asChild, ...rest }: CommentConfirmProps) => react_jsx_runtime.JSX.Element;
|
|
66
|
+
Delete: ({ asChild, ...rest }: CommentDeleteProps) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
Resolve: ({ asChild, ...rest }: CommentResolveProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Comment context provider to provide the comments to the children components
|
|
72
|
+
*
|
|
73
|
+
* @param initialComments as the initial comments from the document
|
|
74
|
+
*/
|
|
75
|
+
declare const CommentContextProvider: ({ children, initialComments, initialOverlayState, onConfirm, onResolve, currentUser, subscription, config, onError, }: CommentOverlayProps) => react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare const useComments: () => CommentContext;
|
|
77
|
+
|
|
78
|
+
type CommentScope = {
|
|
79
|
+
comment: CommentType;
|
|
80
|
+
isActive: boolean;
|
|
81
|
+
draft: string;
|
|
82
|
+
setDraft: React.Dispatch<React.SetStateAction<string>>;
|
|
83
|
+
};
|
|
84
|
+
declare const CommentScopeContext: React.Context<CommentScope | null>;
|
|
85
|
+
declare function useCommentScope(): CommentScope;
|
|
86
|
+
|
|
87
|
+
export { Comment, CommentContextProvider, CommentOverlay, CommentRenderer, CommentScopeContext, ConfirmComments, ResolveComments, ToggleOverlayButton, useCommentScope, useComments };
|