@arkyn/components 3.0.6 → 3.0.7
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/hooks/useCopyToClipboard.d.ts +38 -0
- package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -20
- package/dist/index.js.map +1 -1
- package/dist/modules/hooks/useCopyToClipboard.js +28 -0
- package/dist/modules/hooks/useCopyToClipboard.js.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* copyWithFallback, copies `text` using a hidden `<textarea>` + `document.execCommand("copy")`.
|
|
3
|
+
*
|
|
4
|
+
* Used internally by `useCopyToClipboard` when `navigator.clipboard` is unavailable or rejects,
|
|
5
|
+
* e.g. insecure contexts (non-HTTPS) or older browsers.
|
|
6
|
+
*
|
|
7
|
+
* @param text - Text to copy.
|
|
8
|
+
* @returns `true` if the copy command succeeded, `false` otherwise.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* useCopyToClipboard, copies text to the clipboard and reports whether it succeeded.
|
|
12
|
+
*
|
|
13
|
+
* Tries `navigator.clipboard.writeText` first. If it's unavailable or rejects, falls back
|
|
14
|
+
* to a hidden `<textarea>` with `document.execCommand("copy")`. Never throws; any failure
|
|
15
|
+
* simply resolves to `false`.
|
|
16
|
+
*
|
|
17
|
+
* @returns An object with `copyToClipboard`, an async function that copies `text` and resolves
|
|
18
|
+
* to `true` on success, `false` on failure.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* function CopyButton({ value }) {
|
|
23
|
+
* const { copyToClipboard } = useCopyToClipboard();
|
|
24
|
+
*
|
|
25
|
+
* async function handleClick() {
|
|
26
|
+
* const success = await copyToClipboard(value);
|
|
27
|
+
* if (success) console.log("Copied!");
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* return <button onClick={handleClick}>Copy</button>;
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function useCopyToClipboard(): {
|
|
35
|
+
copyToClipboard: (text: string) => Promise<boolean>;
|
|
36
|
+
};
|
|
37
|
+
export { useCopyToClipboard };
|
|
38
|
+
//# sourceMappingURL=useCopyToClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../../src/hooks/useCopyToClipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iBAAS,kBAAkB;4BACW,MAAM;EAc3C;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { TableHeader } from "./components/table/tableHeader";
|
|
|
54
54
|
export { Textarea } from "./components/textarea";
|
|
55
55
|
export { Tooltip } from "./components/tooltip";
|
|
56
56
|
export { useAutomation } from "./hooks/useAutomation";
|
|
57
|
+
export { useCopyToClipboard } from "./hooks/useCopyToClipboard";
|
|
57
58
|
export { useDrawer } from "./hooks/useDrawer";
|
|
58
59
|
export { useForm } from "./hooks/useForm";
|
|
59
60
|
export { useHydrated } from "./hooks/useHydrated";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA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src/hooks/useCopyToClipboard.ts
|
|
4516
|
+
function gi(e) {
|
|
4517
|
+
let t = document.createElement("textarea");
|
|
4518
|
+
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select();
|
|
4519
|
+
try {
|
|
4520
|
+
return document.execCommand("copy");
|
|
4521
|
+
} finally {
|
|
4522
|
+
document.body.removeChild(t);
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
function _i() {
|
|
4526
|
+
async function e(e) {
|
|
4527
|
+
try {
|
|
4528
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
4529
|
+
} catch {
|
|
4530
|
+
try {
|
|
4531
|
+
return gi(e);
|
|
4532
|
+
} catch {
|
|
4533
|
+
return !1;
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
return { copyToClipboard: e };
|
|
4538
|
+
}
|
|
4539
|
+
//#endregion
|
|
4515
4540
|
//#region src/providers/drawerProvider.tsx
|
|
4516
|
-
var
|
|
4517
|
-
function
|
|
4541
|
+
var vi = n({});
|
|
4542
|
+
function yi(e) {
|
|
4518
4543
|
let { children: t = !1 } = e, [n, r] = u([]);
|
|
4519
4544
|
function i(e) {
|
|
4520
4545
|
return !!n.some((t) => t.key === e);
|
|
@@ -4534,7 +4559,7 @@ function _i(e) {
|
|
|
4534
4559
|
function s(e) {
|
|
4535
4560
|
r(n.filter((t) => t.key !== e));
|
|
4536
4561
|
}
|
|
4537
|
-
return /* @__PURE__ */ p(
|
|
4562
|
+
return /* @__PURE__ */ p(vi.Provider, {
|
|
4538
4563
|
value: {
|
|
4539
4564
|
drawerIsOpen: i,
|
|
4540
4565
|
drawerData: a,
|
|
@@ -4546,8 +4571,8 @@ function _i(e) {
|
|
|
4546
4571
|
}
|
|
4547
4572
|
//#endregion
|
|
4548
4573
|
//#region src/hooks/useDrawer.ts
|
|
4549
|
-
function
|
|
4550
|
-
let t = a(
|
|
4574
|
+
function bi(e) {
|
|
4575
|
+
let t = a(vi);
|
|
4551
4576
|
if (Object.entries(t).length === 0) throw Error("useDrawer must be used within a Provider");
|
|
4552
4577
|
if (e) {
|
|
4553
4578
|
let { drawerData: n, drawerIsOpen: r, openDrawer: i, closeDrawer: a } = t;
|
|
@@ -4561,7 +4586,7 @@ function vi(e) {
|
|
|
4561
4586
|
}
|
|
4562
4587
|
//#endregion
|
|
4563
4588
|
//#region src/hooks/useScopedParams.ts
|
|
4564
|
-
function
|
|
4589
|
+
function xi(e, t = "") {
|
|
4565
4590
|
let n = new URLSearchParams(e), r = t ? `${t}:` : "", i = (e) => {
|
|
4566
4591
|
Object.entries(e).forEach(([e, t]) => {
|
|
4567
4592
|
t === void 0 ? n.delete(`${r}${e}`) : n.set(`${r}${e}`, String(t));
|
|
@@ -4578,8 +4603,8 @@ function yi(e, t = "") {
|
|
|
4578
4603
|
}
|
|
4579
4604
|
//#endregion
|
|
4580
4605
|
//#region src/hooks/useSearchAutomation.ts
|
|
4581
|
-
function
|
|
4582
|
-
let { closeAll: n } = ui(), { showToast: r } = mi(), { getParam: i } =
|
|
4606
|
+
function Si(e, t = "") {
|
|
4607
|
+
let { closeAll: n } = ui(), { showToast: r } = mi(), { getParam: i } = xi(e, t), a = i("closeModal") === "true", s = i("message"), c = i("name"), l = i("type");
|
|
4583
4608
|
o(() => {
|
|
4584
4609
|
a && n(), s && (l === "success" && r({
|
|
4585
4610
|
message: s,
|
|
@@ -4605,28 +4630,28 @@ function bi(e, t = "") {
|
|
|
4605
4630
|
}
|
|
4606
4631
|
//#endregion
|
|
4607
4632
|
//#region src/providers/placesProvider.tsx
|
|
4608
|
-
var
|
|
4633
|
+
var Ci = [
|
|
4609
4634
|
"places",
|
|
4610
4635
|
"marker",
|
|
4611
4636
|
"maps"
|
|
4612
4637
|
];
|
|
4613
|
-
function
|
|
4638
|
+
function wi(e) {
|
|
4614
4639
|
let { apiKey: t, children: n, preventFontsLoading: r = !0 } = e, { isLoaded: i } = xe({
|
|
4615
4640
|
googleMapsApiKey: t,
|
|
4616
|
-
libraries:
|
|
4641
|
+
libraries: Ci,
|
|
4617
4642
|
preventGoogleFontsLoading: r
|
|
4618
4643
|
});
|
|
4619
4644
|
return /* @__PURE__ */ p(f, { children: n(i) });
|
|
4620
4645
|
}
|
|
4621
4646
|
//#endregion
|
|
4622
4647
|
//#region src/utils/richTextUtilities.ts
|
|
4623
|
-
function
|
|
4648
|
+
function Ti(e) {
|
|
4624
4649
|
if (fe.isText(e)) {
|
|
4625
4650
|
let t = e?.text;
|
|
4626
4651
|
return e?.bold && (t = `<strong>${t}</strong>`), e?.code && (t = `<code>${t}</code>`), e?.italic && (t = `<em>${t}</em>`), e?.underline && (t = `<u>${t}</u>`), e?.link && (t = `<a href="${e.href}">${t}</a>`), t;
|
|
4627
4652
|
}
|
|
4628
4653
|
if (le.isElement(e)) {
|
|
4629
|
-
let t = e.children?.map((e) =>
|
|
4654
|
+
let t = e.children?.map((e) => Ti(e)).join(""), n = e.align || "left";
|
|
4630
4655
|
switch (e.type) {
|
|
4631
4656
|
case "video": return `<iframe src="${e.src}" class="align_${n}" />`;
|
|
4632
4657
|
case "image": return `<img src="${e.src}" class="align_${n}" />`;
|
|
@@ -4642,10 +4667,10 @@ function Ci(e) {
|
|
|
4642
4667
|
}
|
|
4643
4668
|
return "";
|
|
4644
4669
|
}
|
|
4645
|
-
function
|
|
4670
|
+
function Ei(e) {
|
|
4646
4671
|
if (typeof e == "string") return { text: e };
|
|
4647
4672
|
let t = e.props.children, n;
|
|
4648
|
-
n = Array.isArray(t) ? t.map((e) =>
|
|
4673
|
+
n = Array.isArray(t) ? t.map((e) => Ei(e)) : typeof t == "string" || !t ? [{ text: t || "" }] : [Ei(t)];
|
|
4649
4674
|
let r = e.props.className?.replace("align_", "");
|
|
4650
4675
|
switch (e.type) {
|
|
4651
4676
|
case "img": return {
|
|
@@ -4715,16 +4740,16 @@ function wi(e) {
|
|
|
4715
4740
|
}
|
|
4716
4741
|
//#endregion
|
|
4717
4742
|
//#region src/services/toHtml.ts
|
|
4718
|
-
function
|
|
4719
|
-
return e.map((e) =>
|
|
4743
|
+
function Di(e) {
|
|
4744
|
+
return e.map((e) => Ti(e)).join("");
|
|
4720
4745
|
}
|
|
4721
4746
|
//#endregion
|
|
4722
4747
|
//#region src/services/toRichTextValue.ts
|
|
4723
|
-
function
|
|
4748
|
+
function Oi(e) {
|
|
4724
4749
|
let t = Te(e);
|
|
4725
|
-
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? { text: e } :
|
|
4750
|
+
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? { text: e } : Ei(e)) : typeof t == "string" ? [{ text: t }] : [Ei(t)];
|
|
4726
4751
|
}
|
|
4727
4752
|
//#endregion
|
|
4728
|
-
export { ke as AlertContainer, Ae as AlertContent, je as AlertDescription, Me as AlertIcon, Ee as AlertTitle, Fe as AudioPlayer, Ke as AudioUpload, qe as Badge, $ as Button, gt as Calendar, bt as CardTabButton, xt as CardTabContainer, St as Checkbox, Tt as ClientOnly, Ot as CurrencyInput, Lt as DatePicker, Ve as Divider, Vt as DrawerContainer, Ht as DrawerHeader,
|
|
4753
|
+
export { ke as AlertContainer, Ae as AlertContent, je as AlertDescription, Me as AlertIcon, Ee as AlertTitle, Fe as AudioPlayer, Ke as AudioUpload, qe as Badge, $ as Button, gt as Calendar, bt as CardTabButton, xt as CardTabContainer, St as Checkbox, Tt as ClientOnly, Ot as CurrencyInput, Lt as DatePicker, Ve as Divider, Vt as DrawerContainer, Ht as DrawerHeader, yi as DrawerProvider, Gt as FacebookPixel, Re as FieldError, ze as FieldLabel, Be as FieldWrapper, Jt as FileUpload, Le as FormProvider, Sn as FullCalendar, En as GoogleAnalytics, jn as GoogleTagManager, He as IconButton, Pn as ImageUpload, ot as Input, Ln as MapView, zn as MaskedInput, Un as ModalContainer, Wn as ModalFooter, Gn as ModalHeader, li as ModalProvider, er as MultiSelect, or as Pagination, br as PhoneInput, wi as PlacesProvider, xr as Popover, Tr as RadioBox, Er as RadioGroup, Zr as RichText, Qr as SearchPlaces, ut as Select, Pe as Slider, $r as Switch, Hr as TabButton, Ur as TabContainer, ei as TableBody, ti as TableCaption, ni as TableContainer, ri as TableFooter, ii as TableHeader, ai as Textarea, pi as ToastProvider, Ue as Tooltip, Di as toHtml, Oi as toRichTextValue, hi as useAutomation, _i as useCopyToClipboard, bi as useDrawer, Z as useForm, wt as useHydrated, ui as useModal, xi as useScopedParams, at as useScrollLock, Si as useSearchAutomation, Ne as useSlider, mi as useToast };
|
|
4729
4754
|
|
|
4730
4755
|
//# sourceMappingURL=index.js.map
|