@pronto-tools-and-more/custom-js-functions 12.20.0 → 12.21.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/dist/main.js +15 -0
- package/package.json +1 -1
- package/src/parts/Globals/Globals.ts +1 -0
- package/src/parts/Share/Share.ts +16 -0
package/dist/main.js
CHANGED
@@ -490,6 +490,7 @@
|
|
490
490
|
getBookmarkedArticles: () => getBookmarkedArticles,
|
491
491
|
isBookmarked: () => isBookmarked,
|
492
492
|
nativeShare: () => nativeShare,
|
493
|
+
nativeShare2: () => nativeShare2,
|
493
494
|
toggleBookmarkArticle: () => toggleBookmarkArticle
|
494
495
|
});
|
495
496
|
|
@@ -616,6 +617,20 @@
|
|
616
617
|
}
|
617
618
|
};
|
618
619
|
|
620
|
+
// src/parts/Share/Share.ts
|
621
|
+
var nativeShare2 = async (title, text, url) => {
|
622
|
+
const shareData = {
|
623
|
+
title,
|
624
|
+
text,
|
625
|
+
url
|
626
|
+
};
|
627
|
+
try {
|
628
|
+
await navigator.share(shareData);
|
629
|
+
} catch (error) {
|
630
|
+
alert(`Share Error: ${error}`);
|
631
|
+
}
|
632
|
+
};
|
633
|
+
|
619
634
|
// src/parts/DisableBookmark/DisableBookmark.ts
|
620
635
|
var disableBookmark = (info) => {
|
621
636
|
const bookmarks = getBookmarkedArticles();
|
package/package.json
CHANGED
@@ -2,4 +2,5 @@ export * from "../FixRender/FixRender.ts";
|
|
2
2
|
export * from "../GetBookmarkedArticles/GetBookmarkedArticles.ts";
|
3
3
|
export * from "../IsBookmarked/IsBookmarked.ts";
|
4
4
|
export * from "../NativeShare/NativeShare.ts";
|
5
|
+
export * from "../Share/Share.ts";
|
5
6
|
export * from "../ToggleBookmarkArticle/ToggleBookmarkArticle.ts";
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export const nativeShare2 = async (
|
2
|
+
title: string,
|
3
|
+
text: string,
|
4
|
+
url: string
|
5
|
+
): Promise<void> => {
|
6
|
+
const shareData = {
|
7
|
+
title,
|
8
|
+
text,
|
9
|
+
url,
|
10
|
+
};
|
11
|
+
try {
|
12
|
+
await navigator.share(shareData);
|
13
|
+
} catch (error) {
|
14
|
+
alert(`Share Error: ${error}`);
|
15
|
+
}
|
16
|
+
};
|