@lets-events/react 12.6.2 → 12.6.4
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -2
- package/dist/index.mjs +11 -2
- package/package.json +1 -1
- package/src/components/RichEditor/QuillComponent.tsx +69 -58
- package/src/components/Tooltip/index.tsx +38 -32
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@12.6.
|
|
2
|
+
> @lets-events/react@12.6.4 build
|
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Target: es6
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
12
|
+
[32mCJS[39m [1mdist\index.js [22m[32m404.29 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 200ms
|
|
14
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m389.28 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 201ms
|
|
16
16
|
[34mDTS[39m Build start
|
|
17
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 4558ms
|
|
18
18
|
[32mDTS[39m [1mdist\index.d.mts [22m[32m402.87 KB[39m
|
|
19
19
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m402.87 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -12758,7 +12758,7 @@ interface TooltipProps {
|
|
|
12758
12758
|
children: React$1.ReactNode;
|
|
12759
12759
|
content: React$1.ReactNode;
|
|
12760
12760
|
delayDuration?: number;
|
|
12761
|
-
side?:
|
|
12761
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
12762
12762
|
}
|
|
12763
12763
|
declare function Tooltip({ children, content, delayDuration, side, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
12764
12764
|
|
package/dist/index.d.ts
CHANGED
|
@@ -12758,7 +12758,7 @@ interface TooltipProps {
|
|
|
12758
12758
|
children: React$1.ReactNode;
|
|
12759
12759
|
content: React$1.ReactNode;
|
|
12760
12760
|
delayDuration?: number;
|
|
12761
|
-
side?:
|
|
12761
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
12762
12762
|
}
|
|
12763
12763
|
declare function Tooltip({ children, content, delayDuration, side, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
12764
12764
|
|
package/dist/index.js
CHANGED
|
@@ -9690,7 +9690,7 @@ function Tooltip({
|
|
|
9690
9690
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipRoot, { delayDuration, children: [
|
|
9691
9691
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
9692
9692
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipContent, { side, sideOffset: 5, children: [
|
|
9693
|
-
typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "tooltip", children: content }) : content,
|
|
9693
|
+
typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "tooltip", color: "grey50", children: content }) : content,
|
|
9694
9694
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipArrow, {})
|
|
9695
9695
|
] })
|
|
9696
9696
|
] }) });
|
|
@@ -12548,7 +12548,16 @@ var QuillComponent = ({
|
|
|
12548
12548
|
matchVisual: false
|
|
12549
12549
|
}
|
|
12550
12550
|
};
|
|
12551
|
-
const formats = simpleVersion ? [
|
|
12551
|
+
const formats = simpleVersion ? [
|
|
12552
|
+
"header",
|
|
12553
|
+
"bold",
|
|
12554
|
+
"italic",
|
|
12555
|
+
"underline",
|
|
12556
|
+
"color",
|
|
12557
|
+
"background",
|
|
12558
|
+
"align",
|
|
12559
|
+
"list"
|
|
12560
|
+
] : [
|
|
12552
12561
|
"header",
|
|
12553
12562
|
"bold",
|
|
12554
12563
|
"italic",
|
package/dist/index.mjs
CHANGED
|
@@ -9576,7 +9576,7 @@ function Tooltip({
|
|
|
9576
9576
|
return /* @__PURE__ */ jsx26(TooltipProvider, { children: /* @__PURE__ */ jsxs15(TooltipRoot, { delayDuration, children: [
|
|
9577
9577
|
/* @__PURE__ */ jsx26(TooltipTrigger, { asChild: true, children }),
|
|
9578
9578
|
/* @__PURE__ */ jsxs15(TooltipContent, { side, sideOffset: 5, children: [
|
|
9579
|
-
typeof content === "string" ? /* @__PURE__ */ jsx26(Text, { typography: "tooltip", children: content }) : content,
|
|
9579
|
+
typeof content === "string" ? /* @__PURE__ */ jsx26(Text, { typography: "tooltip", color: "grey50", children: content }) : content,
|
|
9580
9580
|
/* @__PURE__ */ jsx26(TooltipArrow, {})
|
|
9581
9581
|
] })
|
|
9582
9582
|
] }) });
|
|
@@ -12443,7 +12443,16 @@ var QuillComponent = ({
|
|
|
12443
12443
|
matchVisual: false
|
|
12444
12444
|
}
|
|
12445
12445
|
};
|
|
12446
|
-
const formats = simpleVersion ? [
|
|
12446
|
+
const formats = simpleVersion ? [
|
|
12447
|
+
"header",
|
|
12448
|
+
"bold",
|
|
12449
|
+
"italic",
|
|
12450
|
+
"underline",
|
|
12451
|
+
"color",
|
|
12452
|
+
"background",
|
|
12453
|
+
"align",
|
|
12454
|
+
"list"
|
|
12455
|
+
] : [
|
|
12447
12456
|
"header",
|
|
12448
12457
|
"bold",
|
|
12449
12458
|
"italic",
|
package/package.json
CHANGED
|
@@ -35,59 +35,70 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
35
35
|
};
|
|
36
36
|
const modules = simpleVersion
|
|
37
37
|
? {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
: disableVideo
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
38
|
+
toolbar: [
|
|
39
|
+
[{ header: [1, 2, false] }],
|
|
40
|
+
["bold", "italic", "underline"],
|
|
41
|
+
[{ color: [] }, { background: [] }],
|
|
42
|
+
[{ align: [] }],
|
|
43
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
44
|
+
],
|
|
45
|
+
clipboard: {
|
|
46
|
+
matchVisual: false,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
: disableVideo
|
|
50
|
+
? {
|
|
51
|
+
toolbar: [
|
|
52
|
+
[{ header: [1, 2, false] }],
|
|
53
|
+
["bold", "italic", "underline", "strike"],
|
|
54
|
+
[{ color: [] }, { background: [] }],
|
|
55
|
+
[{ align: [] }],
|
|
56
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
57
|
+
["link", "image"],
|
|
58
|
+
],
|
|
59
|
+
clipboard: {
|
|
60
|
+
matchVisual: false,
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
: {
|
|
64
|
+
toolbar: [
|
|
65
|
+
[{ header: [1, 2, false] }],
|
|
66
|
+
["bold", "italic", "underline", "strike"],
|
|
67
|
+
[{ color: [] }, { background: [] }],
|
|
68
|
+
[{ align: [] }],
|
|
69
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
70
|
+
["link", "image", "video"],
|
|
71
|
+
],
|
|
72
|
+
clipboard: {
|
|
73
|
+
matchVisual: false,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
74
76
|
|
|
75
77
|
const formats = simpleVersion
|
|
76
|
-
? [
|
|
78
|
+
? [
|
|
79
|
+
"header",
|
|
80
|
+
"bold",
|
|
81
|
+
"italic",
|
|
82
|
+
"underline",
|
|
83
|
+
"color",
|
|
84
|
+
"background",
|
|
85
|
+
"align",
|
|
86
|
+
"list",
|
|
87
|
+
]
|
|
77
88
|
: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
"header",
|
|
90
|
+
"bold",
|
|
91
|
+
"italic",
|
|
92
|
+
"underline",
|
|
93
|
+
"strike",
|
|
94
|
+
"color",
|
|
95
|
+
"background",
|
|
96
|
+
"align",
|
|
97
|
+
"list",
|
|
98
|
+
"link",
|
|
99
|
+
"image",
|
|
100
|
+
"video",
|
|
101
|
+
];
|
|
91
102
|
|
|
92
103
|
const { quill, quillRef } = useQuill({
|
|
93
104
|
theme: "snow",
|
|
@@ -134,7 +145,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
134
145
|
});
|
|
135
146
|
}
|
|
136
147
|
},
|
|
137
|
-
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
148
|
+
[disabled, quill, addToast, removeToast, uploadConfig, onChange],
|
|
138
149
|
);
|
|
139
150
|
|
|
140
151
|
useEffect(() => {
|
|
@@ -157,15 +168,15 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
157
168
|
if (quill) {
|
|
158
169
|
quill.on("text-change", (delta: any, oldDelta: any, source: string) => {
|
|
159
170
|
if (source === "user") {
|
|
160
|
-
const text = quill.getText().trim()
|
|
161
|
-
const count = text.length
|
|
171
|
+
const text = quill.getText().trim();
|
|
172
|
+
const count = text.length;
|
|
162
173
|
|
|
163
174
|
if (maxLength !== undefined && count > maxLength) {
|
|
164
|
-
quill.deleteText(maxLength, count - maxLength)
|
|
165
|
-
return
|
|
175
|
+
quill.deleteText(maxLength, count - maxLength);
|
|
176
|
+
return;
|
|
166
177
|
}
|
|
167
|
-
onChange?.(formatHTML(quill.root.innerHTML))
|
|
168
|
-
onCharacterCountChange?.(count)
|
|
178
|
+
onChange?.(formatHTML(quill.root.innerHTML));
|
|
179
|
+
onCharacterCountChange?.(count);
|
|
169
180
|
}
|
|
170
181
|
});
|
|
171
182
|
|
|
@@ -193,7 +204,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
193
204
|
quillRef.current?.parentElement?.querySelector(".ql-toolbar");
|
|
194
205
|
if (toolbarElement) {
|
|
195
206
|
const headerSelect = toolbarElement.querySelector(
|
|
196
|
-
"select[data-value]"
|
|
207
|
+
"select[data-value]",
|
|
197
208
|
) as HTMLSelectElement;
|
|
198
209
|
if (headerSelect) {
|
|
199
210
|
const options = headerSelect.querySelectorAll("option");
|
|
@@ -1,67 +1,73 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as TooltipPrimitive from
|
|
3
|
-
import { styled } from
|
|
4
|
-
import { Text } from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import { styled } from "../../styles";
|
|
4
|
+
import { Text } from "../Text";
|
|
5
5
|
|
|
6
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
-
const TooltipRoot = TooltipPrimitive.Root
|
|
8
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
const TooltipRoot = TooltipPrimitive.Root;
|
|
8
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
9
9
|
|
|
10
10
|
const TooltipContent = styled(TooltipPrimitive.Content, {
|
|
11
|
-
backgroundColor:
|
|
12
|
-
color:
|
|
13
|
-
borderRadius:
|
|
14
|
-
padding:
|
|
15
|
-
fontSize:
|
|
11
|
+
backgroundColor: "$dark800",
|
|
12
|
+
color: "$neutral50",
|
|
13
|
+
borderRadius: "4px",
|
|
14
|
+
padding: "10px 15px",
|
|
15
|
+
fontSize: "14px",
|
|
16
16
|
lineHeight: 1,
|
|
17
17
|
zIndex: 100,
|
|
18
|
-
boxShadow:
|
|
19
|
-
userSelect:
|
|
20
|
-
animationDuration:
|
|
21
|
-
animationTimingFunction:
|
|
22
|
-
willChange:
|
|
18
|
+
boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
|
|
19
|
+
userSelect: "none",
|
|
20
|
+
animationDuration: "400ms",
|
|
21
|
+
animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
22
|
+
willChange: "transform, opacity",
|
|
23
23
|
'&[data-state="delayed-open"][data-side="top"]': {
|
|
24
|
-
animationName:
|
|
24
|
+
animationName: "slideDownAndFade",
|
|
25
25
|
},
|
|
26
26
|
'&[data-state="delayed-open"][data-side="right"]': {
|
|
27
|
-
animationName:
|
|
27
|
+
animationName: "slideLeftAndFade",
|
|
28
28
|
},
|
|
29
29
|
'&[data-state="delayed-open"][data-side="bottom"]': {
|
|
30
|
-
animationName:
|
|
30
|
+
animationName: "slideUpAndFade",
|
|
31
31
|
},
|
|
32
32
|
'&[data-state="delayed-open"][data-side="left"]': {
|
|
33
|
-
animationName:
|
|
33
|
+
animationName: "slideRightAndFade",
|
|
34
34
|
},
|
|
35
|
-
})
|
|
35
|
+
});
|
|
36
36
|
|
|
37
37
|
const TooltipArrow = styled(TooltipPrimitive.Arrow, {
|
|
38
|
-
fill:
|
|
39
|
-
})
|
|
38
|
+
fill: "$dark800",
|
|
39
|
+
});
|
|
40
40
|
|
|
41
41
|
export interface TooltipProps {
|
|
42
|
-
children: React.ReactNode
|
|
43
|
-
content: React.ReactNode
|
|
44
|
-
delayDuration?: number
|
|
45
|
-
side?:
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
content: React.ReactNode;
|
|
44
|
+
delayDuration?: number;
|
|
45
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export function Tooltip({
|
|
49
49
|
children,
|
|
50
50
|
content,
|
|
51
51
|
delayDuration = 200,
|
|
52
|
-
side =
|
|
52
|
+
side = "top",
|
|
53
53
|
}: TooltipProps) {
|
|
54
54
|
return (
|
|
55
55
|
<TooltipProvider>
|
|
56
56
|
<TooltipRoot delayDuration={delayDuration}>
|
|
57
57
|
<TooltipTrigger asChild>{children}</TooltipTrigger>
|
|
58
58
|
<TooltipContent side={side} sideOffset={5}>
|
|
59
|
-
{typeof content ===
|
|
59
|
+
{typeof content === "string" ? (
|
|
60
|
+
<Text typography={"tooltip"} color="grey50">
|
|
61
|
+
{content}
|
|
62
|
+
</Text>
|
|
63
|
+
) : (
|
|
64
|
+
content
|
|
65
|
+
)}
|
|
60
66
|
<TooltipArrow />
|
|
61
67
|
</TooltipContent>
|
|
62
68
|
</TooltipRoot>
|
|
63
69
|
</TooltipProvider>
|
|
64
|
-
)
|
|
70
|
+
);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
export { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent }
|
|
73
|
+
export { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent };
|