@cfx-dev/ui-components 2.1.15 → 2.1.17
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/dist/components/ClipboardButton/ClipboardButton.d.ts +2 -8
- package/dist/components/ClipboardButton/ClipboardButton.js +36 -43
- package/dist/components/ClipboardButton/index.d.ts +1 -1
- package/dist/components/ClipboardButton/index.js +1 -2
- package/dist/main.d.ts +5 -3
- package/dist/main.js +164 -162
- package/dist/utils/hooks/index.d.ts +2 -0
- package/dist/utils/hooks/index.js +9 -6
- package/dist/utils/hooks/useClipboardComponent.d.ts +15 -0
- package/dist/utils/hooks/useClipboardComponent.js +33 -0
- package/package.json +1 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/Button';
|
|
3
3
|
import { FixedOn } from '../Title/Title';
|
|
4
|
+
import { UseClipboardProps } from '../../utils/hooks';
|
|
4
5
|
|
|
5
|
-
export
|
|
6
|
-
export interface ClipboardButtonOnlyProps {
|
|
7
|
-
hoverTitle?: string;
|
|
8
|
-
copiedTitle: string;
|
|
9
|
-
textToCopy: string;
|
|
10
|
-
titleAppearanceTimeout?: number;
|
|
11
|
-
}
|
|
12
|
-
export type ClipboardButtonProps = ButtonProps & ClipboardButtonOnlyProps & {
|
|
6
|
+
export type ClipboardButtonProps = ButtonProps & UseClipboardProps & {
|
|
13
7
|
fixedOn?: FixedOn;
|
|
14
8
|
};
|
|
15
9
|
declare const _default: React.NamedExoticComponent<ClipboardButtonProps>;
|
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Title as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { noop as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { Button as C } from "../Button/Button.js";
|
|
4
|
+
import { Title as f } from "../Title/Title.js";
|
|
5
|
+
import { clsx as u } from "../../utils/clsx.js";
|
|
6
|
+
import { noop as _ } from "../../utils/functional.js";
|
|
7
|
+
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
8
|
+
import "../../utils/hooks/useKeyboardClose.js";
|
|
9
|
+
import "../../index-2hJuj4UN.js";
|
|
10
|
+
import { useClipboardComponent as k } from "../../utils/hooks/useClipboardComponent.js";
|
|
11
|
+
import '../../assets/ClipboardButton.css';const b = "_root_185u8_1", h = "_copied_185u8_1", e = {
|
|
12
|
+
root: b,
|
|
13
|
+
copied: h
|
|
14
|
+
};
|
|
15
|
+
function x(o) {
|
|
12
16
|
const {
|
|
13
|
-
hoverTitle:
|
|
14
|
-
copiedTitle:
|
|
15
|
-
textToCopy:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
e.current = null;
|
|
29
|
-
}), []), t.useEffect(
|
|
30
|
-
() => () => {
|
|
31
|
-
o.current !== null && clearTimeout(o.current);
|
|
32
|
-
},
|
|
33
|
-
[]
|
|
34
|
-
);
|
|
35
|
-
const T = c ? f : a, _ = A(s.root, { [s.copied]: c });
|
|
36
|
-
return /* @__PURE__ */ u(
|
|
37
|
-
x,
|
|
17
|
+
hoverTitle: T,
|
|
18
|
+
copiedTitle: B,
|
|
19
|
+
textToCopy: j,
|
|
20
|
+
fixedOn: n,
|
|
21
|
+
onClick: t = _,
|
|
22
|
+
...l
|
|
23
|
+
} = o, {
|
|
24
|
+
copied: p,
|
|
25
|
+
handleClick: i,
|
|
26
|
+
title: m
|
|
27
|
+
} = k(o), d = c.useCallback((a) => {
|
|
28
|
+
t(a), i();
|
|
29
|
+
}, [i, t]), s = u(e.root, { [e.copied]: p });
|
|
30
|
+
return /* @__PURE__ */ r(
|
|
31
|
+
f,
|
|
38
32
|
{
|
|
39
|
-
title:
|
|
40
|
-
fixedOn:
|
|
41
|
-
rootClassName:
|
|
42
|
-
children: /* @__PURE__ */
|
|
33
|
+
title: m,
|
|
34
|
+
fixedOn: n,
|
|
35
|
+
rootClassName: s,
|
|
36
|
+
children: /* @__PURE__ */ r(C, { ...l, onClick: d })
|
|
43
37
|
}
|
|
44
38
|
);
|
|
45
39
|
}
|
|
46
|
-
const
|
|
40
|
+
const z = c.memo(x);
|
|
47
41
|
export {
|
|
48
|
-
|
|
49
|
-
O as default
|
|
42
|
+
z as default
|
|
50
43
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as ClipboardButton
|
|
1
|
+
export { default as ClipboardButton } from './ClipboardButton';
|
|
2
2
|
export type { ClipboardButtonProps } from './ClipboardButton';
|
package/dist/main.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { mergeRefs } from './utils/mergeRefs';
|
|
2
2
|
export { clsx } from './utils/clsx';
|
|
3
3
|
export { getValue } from './utils/getValue';
|
|
4
|
-
export { useInstance, useDynamicRef, useGlobalKeyboardEvent, useKeyboardClose, useWindowResize, useOutlet, usePopoverController, } from './utils/hooks';
|
|
4
|
+
export { useInstance, useDynamicRef, useGlobalKeyboardEvent, useKeyboardClose, useWindowResize, useOutlet, usePopoverController, useClipboardComponent, CLIPBOARD_TITLE_APPEARANCE, } from './utils/hooks';
|
|
5
5
|
export { noop, returnTrue, returnFalse, identity, invoke, } from './utils/functional';
|
|
6
6
|
export { isExternalUrl, matchLinks, matchLinkNodes, defaultLinkReplacerx, defaultLinkReplacer, linkifyx, linkify, Linkify, } from './utils/links';
|
|
7
7
|
export { clamp01, clamp, } from './utils/math';
|
|
@@ -10,12 +10,12 @@ export { debounce, throttle, } from './utils/execution';
|
|
|
10
10
|
export { getColor } from './utils/color';
|
|
11
11
|
export type { ValueOrGetter } from './utils/getValue';
|
|
12
12
|
export type { ILinkSubstitute, ILinkMatch, LinkifyProps, } from './utils/links';
|
|
13
|
-
export type { OutletPosition } from './utils/hooks';
|
|
13
|
+
export type { OutletPosition, UseClipboardProps, } from './utils/hooks';
|
|
14
14
|
export type { SetTimeoutReturn } from './utils/execution';
|
|
15
15
|
export type { GetColorProps } from './utils/color';
|
|
16
16
|
export { IconButton } from './components/IconButton';
|
|
17
17
|
export { Accordion, AccordionTrigger, AccordionHeader, AccordionItem, AccordionContent, } from './components/Accordion';
|
|
18
|
-
export { ClipboardButton
|
|
18
|
+
export { ClipboardButton } from './components/ClipboardButton';
|
|
19
19
|
export { Checkbox } from './components/Checkbox';
|
|
20
20
|
export { Button } from './components/Button/Button';
|
|
21
21
|
export { LinkButton } from './components/Button/LinkButton';
|
|
@@ -65,6 +65,8 @@ export { Text, TextBlock, getTextOpacity, } from './components/Text';
|
|
|
65
65
|
export { Textarea } from './components/Textarea/Textarea';
|
|
66
66
|
export { Title, TITLE_OUTLET_ID } from './components/Title/Title';
|
|
67
67
|
export { InputDropzone } from './components/InputDropzone';
|
|
68
|
+
export type { ButtonProps, ButtonTheme } from './components/Button/Button';
|
|
69
|
+
export type { TitleProps, FixedOn } from './components/Title/Title';
|
|
68
70
|
export type { IconButtonProps } from './components/IconButton';
|
|
69
71
|
export type { ClipboardButtonProps } from './components/ClipboardButton';
|
|
70
72
|
export type { InputDropzoneProps, FileWithPath } from './components/InputDropzone';
|
package/dist/main.js
CHANGED
|
@@ -3,182 +3,184 @@ import { clsx as f } from "./utils/clsx.js";
|
|
|
3
3
|
import { getValue as m } from "./utils/getValue.js";
|
|
4
4
|
import { usePopoverController as l } from "./utils/hooks/usePopoverController.js";
|
|
5
5
|
import { useInstance as i } from "./utils/hooks/useInstance.js";
|
|
6
|
-
import { useDynamicRef as
|
|
6
|
+
import { useDynamicRef as u } from "./utils/hooks/useDynamicRef.js";
|
|
7
7
|
import { useGlobalKeyboardEvent as d } from "./utils/hooks/useGlobalKeyboardEvent.js";
|
|
8
8
|
import { useKeyboardClose as T } from "./utils/hooks/useKeyboardClose.js";
|
|
9
9
|
import { useWindowResize as B } from "./utils/hooks/useWindowResize.js";
|
|
10
|
-
import { useOutlet as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { default as no } from "./components/
|
|
10
|
+
import { useOutlet as C } from "./utils/hooks/useOutlet.js";
|
|
11
|
+
import { CLIPBOARD_TITLE_APPEARANCE as R, useClipboardComponent as S } from "./utils/hooks/useClipboardComponent.js";
|
|
12
|
+
import { identity as A, invoke as k, noop as O, returnFalse as P, returnTrue as E } from "./utils/functional.js";
|
|
13
|
+
import { Linkify as _, defaultLinkReplacer as h, defaultLinkReplacerx as v, isExternalUrl as F, linkify as U, linkifyx as z, matchLinkNodes as K, matchLinks as N } from "./utils/links.js";
|
|
14
|
+
import { clamp as w, clamp01 as G } from "./utils/math.js";
|
|
15
|
+
import { isFalseString as H, isTrueString as M, normalizeSlashes as W, replaceRange as j, splitByIndices as q, unicodeCharAt as J } from "./utils/string.js";
|
|
16
|
+
import { debounce as X, throttle as Z } from "./utils/execution.js";
|
|
17
|
+
import { getColor as oo } from "./utils/color.js";
|
|
18
|
+
import { default as eo } from "./components/IconButton/IconButton.js";
|
|
19
|
+
import { Accordion as po, AccordionContent as fo, AccordionHeader as xo, AccordionItem as mo, AccordionTrigger as ao } from "./components/Accordion/Accordion.js";
|
|
20
|
+
import { default as no } from "./components/ClipboardButton/ClipboardButton.js";
|
|
21
|
+
import { default as so } from "./components/Checkbox/Checkbox.js";
|
|
21
22
|
import { Button as co } from "./components/Button/Button.js";
|
|
22
|
-
import { LinkButton as
|
|
23
|
-
import { ButtonBar as
|
|
24
|
-
import { Avatar as
|
|
25
|
-
import { BACKDROP_OUTLET_ID as
|
|
26
|
-
import { Badge as
|
|
27
|
-
import { ControlBox as
|
|
28
|
-
import { CountryFlag as
|
|
29
|
-
import { Decorate as
|
|
30
|
-
import { Dot as
|
|
31
|
-
import { FLYOUT_OUTLET_ID as
|
|
32
|
-
import { Logos as
|
|
33
|
-
import { I as
|
|
34
|
-
import { I as
|
|
35
|
-
import { Icon as
|
|
36
|
-
import { IconBig as
|
|
37
|
-
import { Indicator as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { Interactive as
|
|
42
|
-
import { Island as
|
|
43
|
-
import { Box as
|
|
44
|
-
import { Center as
|
|
45
|
-
import { Flex as
|
|
46
|
-
import { FlexRestricter as
|
|
47
|
-
import { Pad as
|
|
48
|
-
import { Page as
|
|
49
|
-
import { R as
|
|
50
|
-
import { Scrollable as
|
|
51
|
-
import { VirtualScrollable as
|
|
52
|
-
import { Loaf as
|
|
53
|
-
import { Modal as
|
|
54
|
-
import { NavList as
|
|
55
|
-
import { OVERLAY_OUTLET_ID as
|
|
56
|
-
import { Popover as
|
|
57
|
-
import { PremiumBadge as
|
|
58
|
-
import { Prose as
|
|
59
|
-
import { Radio as
|
|
60
|
-
import { Select as
|
|
61
|
-
import { Separator as
|
|
62
|
-
import { Shroud as
|
|
63
|
-
import { Spacer as
|
|
64
|
-
import { Style as
|
|
65
|
-
import { default as
|
|
66
|
-
import { ToggleGroup as
|
|
67
|
-
import { Tabular as
|
|
68
|
-
import { Table as
|
|
69
|
-
import { Text as
|
|
70
|
-
import { Textarea as
|
|
71
|
-
import { TITLE_OUTLET_ID as ce, Title as
|
|
72
|
-
import { default as
|
|
23
|
+
import { LinkButton as To } from "./components/Button/LinkButton.js";
|
|
24
|
+
import { ButtonBar as Bo } from "./components/Button/ButtonBar.js";
|
|
25
|
+
import { Avatar as Co } from "./components/Avatar/Avatar.js";
|
|
26
|
+
import { BACKDROP_OUTLET_ID as Ro, BackdropPortal as So } from "./components/BackdropPortal/BackdropPortal.js";
|
|
27
|
+
import { Badge as Ao } from "./components/Badge/Badge.js";
|
|
28
|
+
import { ControlBox as Oo } from "./components/ControlBox/ControlBox.js";
|
|
29
|
+
import { CountryFlag as Eo } from "./components/CountryFlag/CountryFlag.js";
|
|
30
|
+
import { Decorate as _o } from "./components/Decorate/Decorate.js";
|
|
31
|
+
import { Dot as vo } from "./components/Dot/Dot.js";
|
|
32
|
+
import { FLYOUT_OUTLET_ID as Uo, Flyout as zo } from "./components/Flyout/Flyout.js";
|
|
33
|
+
import { Logos as No } from "./components/Logos/index.js";
|
|
34
|
+
import { I as wo } from "./cfxIcons-BlbKR-zU.js";
|
|
35
|
+
import { I as Yo } from "./cfxIconsBig-CNY8zL27.js";
|
|
36
|
+
import { Icon as Mo } from "./components/Icon/Icon.js";
|
|
37
|
+
import { IconBig as jo } from "./components/IconBig/IconBig.js";
|
|
38
|
+
import { Indicator as Jo } from "./components/Indicator/Indicator.js";
|
|
39
|
+
import { default as Xo } from "./components/InfoPanel/InfoPanel.js";
|
|
40
|
+
import { default as $o } from "./components/Input/Input.js";
|
|
41
|
+
import { default as rr } from "./components/Input/RichInput.js";
|
|
42
|
+
import { Interactive as tr } from "./components/Interactive/Interactive.js";
|
|
43
|
+
import { Island as fr } from "./components/Island/Island.js";
|
|
44
|
+
import { Box as mr } from "./components/Layout/Box/Box.js";
|
|
45
|
+
import { Center as lr } from "./components/Layout/Center/Center.js";
|
|
46
|
+
import { Flex as ir } from "./components/Layout/Flex/Flex.js";
|
|
47
|
+
import { FlexRestricter as ur } from "./components/Layout/Flex/FlexRestricter.js";
|
|
48
|
+
import { Pad as dr } from "./components/Layout/Pad/Pad.js";
|
|
49
|
+
import { Page as Tr } from "./components/Layout/Page/Page.js";
|
|
50
|
+
import { R as Br } from "./Rail-nVRissv6.js";
|
|
51
|
+
import { Scrollable as Cr } from "./components/Layout/Scrollable/Scrollable.js";
|
|
52
|
+
import { VirtualScrollable as Rr } from "./components/Layout/Scrollable/VirtualScrollable.js";
|
|
53
|
+
import { Loaf as br } from "./components/Loaf/Loaf.js";
|
|
54
|
+
import { Modal as kr } from "./components/Modal/Modal.js";
|
|
55
|
+
import { NavList as Pr } from "./components/NavList/NavList.js";
|
|
56
|
+
import { OVERLAY_OUTLET_ID as Dr, Overlay as _r } from "./components/Overlay/Overlay.js";
|
|
57
|
+
import { Popover as vr } from "./components/Popover/Popover.js";
|
|
58
|
+
import { PremiumBadge as Ur } from "./components/PremiumBadge/PremiumBadge.js";
|
|
59
|
+
import { Prose as Kr } from "./components/Prose/Prose.js";
|
|
60
|
+
import { Radio as Vr } from "./components/Radio/Radio.js";
|
|
61
|
+
import { Select as Gr } from "./components/Select/Select.js";
|
|
62
|
+
import { Separator as Hr } from "./components/Separator/Separator.js";
|
|
63
|
+
import { Shroud as Wr } from "./components/Shroud/Shroud.js";
|
|
64
|
+
import { Spacer as qr } from "./components/Spacer/Spacer.js";
|
|
65
|
+
import { Style as Qr, useContextualStyle as Xr } from "./components/Style/Style.js";
|
|
66
|
+
import { default as $r } from "./components/Switch/Switch.js";
|
|
67
|
+
import { ToggleGroup as re } from "./components/ToggleGroup/ToggleGroup.js";
|
|
68
|
+
import { Tabular as te } from "./components/Tabular/Tabular.js";
|
|
69
|
+
import { Table as fe, TableIconButton as xe } from "./components/Table/Table.js";
|
|
70
|
+
import { Text as ae, TextBlock as le, getTextOpacity as ne } from "./components/Text/Text.js";
|
|
71
|
+
import { Textarea as se } from "./components/Textarea/Textarea.js";
|
|
72
|
+
import { TITLE_OUTLET_ID as ce, Title as de } from "./components/Title/Title.js";
|
|
73
|
+
import { default as Te } from "./components/InputDropzone/InputDropzone.js";
|
|
73
74
|
import "./components/InputDropzone/ItemPreview.js";
|
|
74
|
-
import { OnScreenSensor as
|
|
75
|
-
import { ui as
|
|
76
|
-
import { Symbols as
|
|
75
|
+
import { OnScreenSensor as Be } from "./components/OnScreenSensor.js";
|
|
76
|
+
import { ui as Ce } from "./components/ui.js";
|
|
77
|
+
import { Symbols as Re } from "./components/Symbols.js";
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
po as Accordion,
|
|
80
|
+
fo as AccordionContent,
|
|
81
|
+
xo as AccordionHeader,
|
|
82
|
+
mo as AccordionItem,
|
|
83
|
+
ao as AccordionTrigger,
|
|
84
|
+
Co as Avatar,
|
|
85
|
+
Ro as BACKDROP_OUTLET_ID,
|
|
86
|
+
So as BackdropPortal,
|
|
87
|
+
Ao as Badge,
|
|
88
|
+
mr as Box,
|
|
88
89
|
co as Button,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
90
|
+
Bo as ButtonBar,
|
|
91
|
+
R as CLIPBOARD_TITLE_APPEARANCE,
|
|
92
|
+
lr as Center,
|
|
93
|
+
so as Checkbox,
|
|
94
|
+
no as ClipboardButton,
|
|
95
|
+
Oo as ControlBox,
|
|
96
|
+
Eo as CountryFlag,
|
|
97
|
+
_o as Decorate,
|
|
98
|
+
vo as Dot,
|
|
99
|
+
Uo as FLYOUT_OUTLET_ID,
|
|
100
|
+
ir as Flex,
|
|
101
|
+
ur as FlexRestricter,
|
|
102
|
+
zo as Flyout,
|
|
103
|
+
Mo as Icon,
|
|
104
|
+
jo as IconBig,
|
|
105
|
+
eo as IconButton,
|
|
106
|
+
wo as Icons,
|
|
107
|
+
Yo as IconsBig,
|
|
108
|
+
Jo as Indicator,
|
|
109
|
+
Xo as InfoPanel,
|
|
110
|
+
$o as Input,
|
|
111
|
+
Te as InputDropzone,
|
|
112
|
+
tr as Interactive,
|
|
113
|
+
fr as Island,
|
|
114
|
+
To as LinkButton,
|
|
115
|
+
_ as Linkify,
|
|
116
|
+
br as Loaf,
|
|
117
|
+
No as Logos,
|
|
118
|
+
kr as Modal,
|
|
119
|
+
Pr as NavList,
|
|
120
|
+
Dr as OVERLAY_OUTLET_ID,
|
|
121
|
+
Be as OnScreenSensor,
|
|
122
|
+
_r as Overlay,
|
|
123
|
+
dr as Pad,
|
|
124
|
+
Tr as Page,
|
|
125
|
+
vr as Popover,
|
|
126
|
+
Ur as PremiumBadge,
|
|
127
|
+
Kr as Prose,
|
|
128
|
+
Vr as Radio,
|
|
129
|
+
Br as Rail,
|
|
130
|
+
rr as RichInput,
|
|
131
|
+
Cr as Scrollable,
|
|
132
|
+
Gr as Select,
|
|
133
|
+
Hr as Separator,
|
|
134
|
+
Wr as Shroud,
|
|
135
|
+
qr as Spacer,
|
|
136
|
+
Qr as Style,
|
|
137
|
+
$r as Switch,
|
|
138
|
+
Re as Symbols,
|
|
138
139
|
ce as TITLE_OUTLET_ID,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
fe as Table,
|
|
141
|
+
xe as TableIconButton,
|
|
142
|
+
te as Tabular,
|
|
143
|
+
ae as Text,
|
|
144
|
+
le as TextBlock,
|
|
145
|
+
se as Textarea,
|
|
146
|
+
de as Title,
|
|
147
|
+
re as ToggleGroup,
|
|
148
|
+
Rr as VirtualScrollable,
|
|
149
|
+
w as clamp,
|
|
150
|
+
G as clamp01,
|
|
150
151
|
f as clsx,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
X as debounce,
|
|
153
|
+
h as defaultLinkReplacer,
|
|
154
|
+
v as defaultLinkReplacerx,
|
|
155
|
+
oo as getColor,
|
|
156
|
+
ne as getTextOpacity,
|
|
156
157
|
m as getValue,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
A as identity,
|
|
159
|
+
k as invoke,
|
|
160
|
+
F as isExternalUrl,
|
|
161
|
+
H as isFalseString,
|
|
162
|
+
M as isTrueString,
|
|
163
|
+
U as linkify,
|
|
164
|
+
z as linkifyx,
|
|
165
|
+
K as matchLinkNodes,
|
|
166
|
+
N as matchLinks,
|
|
166
167
|
t as mergeRefs,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
O as noop,
|
|
169
|
+
W as normalizeSlashes,
|
|
170
|
+
j as replaceRange,
|
|
171
|
+
P as returnFalse,
|
|
172
|
+
E as returnTrue,
|
|
173
|
+
q as splitByIndices,
|
|
174
|
+
Z as throttle,
|
|
175
|
+
Ce as ui,
|
|
176
|
+
J as unicodeCharAt,
|
|
177
|
+
S as useClipboardComponent,
|
|
178
|
+
Xr as useContextualStyle,
|
|
179
|
+
u as useDynamicRef,
|
|
178
180
|
d as useGlobalKeyboardEvent,
|
|
179
181
|
i as useInstance,
|
|
180
182
|
T as useKeyboardClose,
|
|
181
|
-
|
|
183
|
+
C as useOutlet,
|
|
182
184
|
l as usePopoverController,
|
|
183
185
|
B as useWindowResize
|
|
184
186
|
};
|
|
@@ -5,4 +5,6 @@ export { useGlobalKeyboardEvent } from './useGlobalKeyboardEvent';
|
|
|
5
5
|
export { useKeyboardClose } from './useKeyboardClose';
|
|
6
6
|
export { useWindowResize } from './useWindowResize';
|
|
7
7
|
export { useOutlet } from './useOutlet';
|
|
8
|
+
export { useClipboardComponent, CLIPBOARD_TITLE_APPEARANCE } from './useClipboardComponent';
|
|
8
9
|
export type { OutletPosition } from './useOutlet';
|
|
10
|
+
export type { UseClipboardProps } from './useClipboardComponent';
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { usePopoverController as r } from "./usePopoverController.js";
|
|
2
|
-
import { useInstance as
|
|
2
|
+
import { useInstance as p } from "./useInstance.js";
|
|
3
3
|
import { useDynamicRef as m } from "./useDynamicRef.js";
|
|
4
4
|
import { useGlobalKeyboardEvent as u } from "./useGlobalKeyboardEvent.js";
|
|
5
|
-
import { useKeyboardClose as
|
|
5
|
+
import { useKeyboardClose as x } from "./useKeyboardClose.js";
|
|
6
6
|
import { useWindowResize as a } from "./useWindowResize.js";
|
|
7
|
-
import { useOutlet as
|
|
7
|
+
import { useOutlet as b } from "./useOutlet.js";
|
|
8
|
+
import { CLIPBOARD_TITLE_APPEARANCE as i, useClipboardComponent as A } from "./useClipboardComponent.js";
|
|
8
9
|
export {
|
|
10
|
+
i as CLIPBOARD_TITLE_APPEARANCE,
|
|
11
|
+
A as useClipboardComponent,
|
|
9
12
|
m as useDynamicRef,
|
|
10
13
|
u as useGlobalKeyboardEvent,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
p as useInstance,
|
|
15
|
+
x as useKeyboardClose,
|
|
16
|
+
b as useOutlet,
|
|
14
17
|
r as usePopoverController,
|
|
15
18
|
a as useWindowResize
|
|
16
19
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseClipboardProps {
|
|
4
|
+
hoverTitle?: string;
|
|
5
|
+
copiedTitle: string;
|
|
6
|
+
textToCopy: string;
|
|
7
|
+
titleAppearanceTimeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const CLIPBOARD_TITLE_APPEARANCE = 1000;
|
|
10
|
+
export declare function useClipboardComponent(props: UseClipboardProps): {
|
|
11
|
+
handleClick: () => void;
|
|
12
|
+
title: string | undefined;
|
|
13
|
+
copied: boolean;
|
|
14
|
+
clipboardRef: React.MutableRefObject<Clipboard | null>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import t from "react";
|
|
2
|
+
const f = 1e3;
|
|
3
|
+
function T(i) {
|
|
4
|
+
const {
|
|
5
|
+
hoverTitle: c,
|
|
6
|
+
copiedTitle: s,
|
|
7
|
+
textToCopy: n,
|
|
8
|
+
titleAppearanceTimeout: o = f
|
|
9
|
+
} = i, [u, l] = t.useState(!1), e = t.useRef(null), r = t.useRef(null), a = t.useCallback(() => {
|
|
10
|
+
if (r.current === null)
|
|
11
|
+
throw new Error("Clipboard API is not supported in this browser");
|
|
12
|
+
r.current.writeText(n), e.current !== null && clearTimeout(e.current), e.current = setTimeout(() => {
|
|
13
|
+
e.current = null, l(!1);
|
|
14
|
+
}, o), l(!0);
|
|
15
|
+
}, [n, o]);
|
|
16
|
+
return t.useEffect(() => ("clipboard" in navigator && (r.current = navigator.clipboard), () => {
|
|
17
|
+
r.current = null;
|
|
18
|
+
}), []), t.useEffect(
|
|
19
|
+
() => () => {
|
|
20
|
+
e.current !== null && clearTimeout(e.current);
|
|
21
|
+
},
|
|
22
|
+
[]
|
|
23
|
+
), {
|
|
24
|
+
handleClick: a,
|
|
25
|
+
title: u ? s : c,
|
|
26
|
+
copied: u,
|
|
27
|
+
clipboardRef: r
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
f as CLIPBOARD_TITLE_APPEARANCE,
|
|
32
|
+
T as useClipboardComponent
|
|
33
|
+
};
|