@indietabletop/appkit 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -4,3 +4,21 @@ A collection of modules used in Indie Tabletop Club's apps.
4
4
 
5
5
  - [Hobgoblin App](https://hobgoblin.indietabletop.club)
6
6
  - [Eternøl App](https://eternol.indietabletop.club)
7
+
8
+ ## Contents
9
+
10
+ ### Hooks
11
+
12
+ - useAsyncPp
13
+ - useDocumentBackgroundColor
14
+ - useIsInstalled
15
+ - useMediaQuery
16
+ - useRevertingState
17
+ - useScrollRestoration
18
+
19
+ ### Utils
20
+
21
+ - appendCopyToText
22
+ - asyncOp
23
+ - caughtValue
24
+ - classNames
@@ -0,0 +1,4 @@
1
+ import { AnchorHTMLAttributes } from "react";
2
+ type ExternalLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "target">;
3
+ export declare function ExternalLink(props: ExternalLinkProps): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ExternalLink(props) {
3
+ return _jsx("a", { ...props, target: "_blank", rel: "noreferrer noopener" });
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indietabletop/appkit",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A collection of modules used in apps built by Indie Tabletop Club",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,4 +0,0 @@
1
- /**
2
- * Sets document background color, reverting it to previous color on unmount.
3
- */
4
- export declare function useDocumentBackgroundColor(bodyColor: string): void;
@@ -1,14 +0,0 @@
1
- import { useEffect } from "react";
2
- /**
3
- * Sets document background color, reverting it to previous color on unmount.
4
- */
5
- export function useDocumentBackgroundColor(bodyColor) {
6
- useEffect(() => {
7
- const style = window.document.documentElement.style;
8
- const originalColor = style.backgroundColor;
9
- style.backgroundColor = bodyColor;
10
- return () => {
11
- style.backgroundColor = originalColor;
12
- };
13
- });
14
- }