@indietabletop/appkit 3.2.0-0 → 3.2.0-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/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@indietabletop/appkit",
3
- "version": "3.2.0-0",
3
+ "version": "3.2.0-1",
4
4
  "description": "A collection of modules used in apps built by Indie Tabletop Club",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "scripts": {
8
- "release": "npm run build && np",
8
+ "release": "np",
9
9
  "build": "tsc",
10
10
  "dev": "tsc --watch",
11
- "test": "vitest"
11
+ "test": "vitest",
12
+ "prepare": "npm run build"
12
13
  },
13
14
  "exports": {
14
15
  ".": "./dist/index.js",
@@ -1 +0,0 @@
1
- export declare function IndieTabletopClubFooter(): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { interactiveText } from "./common.css.js";
3
- import { ExternalLink } from "./external-link.js";
4
- import { IndieTabletopClubLogo } from "./IndieTabletopClubLogo.js";
5
- export function IndieTabletopClubFooter() {
6
- return (_jsxs("div", { style: {
7
- textAlign: "center",
8
- paddingBlockStart: "2rem",
9
- borderBlockStart: "1px solid #ececec",
10
- marginBlockStart: "3rem",
11
- }, children: [_jsx(IndieTabletopClubLogo, { style: { margin: "0 auto 1.125rem" } }), _jsxs("p", { style: {
12
- margin: "0 auto",
13
- maxInlineSize: "25rem",
14
- fontSize: "0.875rem",
15
- lineHeight: "1.25rem",
16
- }, children: ["Indie Tabletop Club supports independent game creators with high-quality digital tools.", " ", _jsx(ExternalLink, { href: "https://indietabletop.club", className: interactiveText, children: "Learn more" }), "."] })] }));
17
- }
@@ -1,34 +0,0 @@
1
- import type { ConfigEnv, PluginOption, UserConfig } from "vite";
2
- export declare function defineNetlifyConfig(props: {
3
- /**
4
- * The server port number.
5
- *
6
- * Game apps start from 8000, automation apps from 9000. So far, we got:
7
- *
8
- * - API: 8000
9
- * - Hobgoblin: 8001
10
- * - Eternol: 8002
11
- * - Gregbot: 9000
12
- */
13
- port: number;
14
- /**
15
- * By default, react and vanilla extract are always configured.
16
- */
17
- additionalPlugins?: PluginOption[];
18
- /**
19
- * Can be used to import from `@` at the path specified here. Has to match
20
- * tsconfig > compilerOptions > paths.
21
- *
22
- * Do not use this, just use relative imports.
23
- *
24
- * @deprecated
25
- */
26
- resolveAlias?: string;
27
- /**
28
- * Determines whether input is "/index.html", or "index.html" or
29
- * "/src/main.tsx" depnending on command.
30
- *
31
- * This is useful when using pre-rendered HTML as input.
32
- */
33
- conditionalInput?: boolean;
34
- }): ({ command }: ConfigEnv) => UserConfig;
@@ -1,35 +0,0 @@
1
- import { vanillaExtractPlugin as vanilla } from "@vanilla-extract/vite-plugin";
2
- import react from "@vitejs/plugin-react";
3
- export function defineNetlifyConfig(props) {
4
- const { additionalPlugins = [], conditionalInput = false, resolveAlias, } = props;
5
- return function configureVite({ command }) {
6
- return {
7
- define: {
8
- // These vars are supplied by Netlify
9
- BRANCH: JSON.stringify(process.env.BRANCH),
10
- COMMIT_SHORTCODE: JSON.stringify(process.env.COMMIT_REF?.slice(0, 7)),
11
- },
12
- plugins: [react(), vanilla(), ...additionalPlugins],
13
- esbuild: {
14
- target: "es2022",
15
- },
16
- server: {
17
- port: props.port,
18
- },
19
- resolve: {
20
- alias: resolveAlias ? { "@": resolveAlias } : undefined,
21
- },
22
- build: {
23
- sourcemap: true,
24
- manifest: true,
25
- rollupOptions: {
26
- // During `build`, we want to only deal with JS files. Production HTML
27
- // entrypoint is generated via the `build:entrypoint` package script.
28
- input: conditionalInput && command === "build"
29
- ? "/src/main.tsx"
30
- : "/index.html",
31
- },
32
- },
33
- };
34
- };
35
- }
@@ -1,4 +0,0 @@
1
- import type { 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 {};
@@ -1,4 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- import { type FormSubmitProps } from "@ariakit/react";
2
- import type { ReactNode } from "react";
3
- export type FormSubmitButtonProps = FormSubmitProps & {
4
- children: ReactNode;
5
- loading: ReactNode;
6
- };
7
- export declare function FormSubmitButton(props: FormSubmitButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FormSubmit, useFormContext, useStoreState, } from "@ariakit/react";
3
- import { fadeIn } from "./animations.css.js";
4
- export function FormSubmitButton(props) {
5
- const { children, className, style, loading, ...submitProps } = props;
6
- const form = useFormContext();
7
- const isSubmitting = useStoreState(form, (s) => s?.submitting);
8
- return (_jsxs(FormSubmit, { ...submitProps, className: className, style: { position: "relative", ...style }, children: [_jsx("span", { style: { opacity: isSubmitting ? 0 : 1, transition: "200ms opacity" }, children: children }), isSubmitting && (_jsx("div", { style: {
9
- display: "flex",
10
- position: "absolute",
11
- inset: "0",
12
- alignItems: "center",
13
- justifyContent: "center",
14
- animation: `${fadeIn} 200ms 200ms both`,
15
- }, children: loading }))] }));
16
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * This component prevents the default MacOS behaviour where a fullscreen window
3
- * gets minimised by pressing Escape.
4
- */
5
- export declare function FullscreenDismissBlocker(): null;
@@ -1,19 +0,0 @@
1
- import { useEffect } from "react";
2
- function handleKeydown(event) {
3
- if (event.key === "Escape") {
4
- event.preventDefault();
5
- }
6
- }
7
- /**
8
- * This component prevents the default MacOS behaviour where a fullscreen window
9
- * gets minimised by pressing Escape.
10
- */
11
- export function FullscreenDismissBlocker() {
12
- useEffect(() => {
13
- window.addEventListener("keydown", handleKeydown);
14
- return () => {
15
- window.removeEventListener("keydown", handleKeydown);
16
- };
17
- }, []);
18
- return null;
19
- }
@@ -1,11 +0,0 @@
1
- import { type ReactNode } from "react";
2
- /**
3
- * This component handles the installation of a service worker.
4
- *
5
- * Currently it doesn't do much, but, eventually, it should provide context
6
- * to nested components communicating the status of the service worker installation.
7
- */
8
- export declare function ServiceWorkerHandler(props: {
9
- children: ReactNode;
10
- path: string;
11
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,42 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect } from "react";
3
- /**
4
- * This component handles the installation of a service worker.
5
- *
6
- * Currently it doesn't do much, but, eventually, it should provide context
7
- * to nested components communicating the status of the service worker installation.
8
- */
9
- export function ServiceWorkerHandler(props) {
10
- useEffect(() => {
11
- async function registerWorker() {
12
- // Although modern browsers all support service workers, native app's
13
- // web views (eg. the Facebook app's embedded browsers) do not.
14
- if ("serviceWorker" in navigator) {
15
- try {
16
- const registration = await navigator.serviceWorker.register(props.path);
17
- console.info("Service worker registration obtained.");
18
- registration.addEventListener("updatefound", () => {
19
- const worker = registration.installing;
20
- console.info("Installing new service worker.");
21
- worker?.addEventListener("statechange", ({ target }) => {
22
- if (target instanceof ServiceWorker) {
23
- console.info(`Service worker state changed: '${target.state}'.`);
24
- }
25
- });
26
- });
27
- }
28
- catch (error) {
29
- // In rare cases, service worker installation can fail, e.g. due to network
30
- // connectivity. There is no need to report the error as there is nothing
31
- // that can be done to prevent this from occassionally happening.
32
- console.error(error);
33
- }
34
- }
35
- }
36
- void registerWorker();
37
- // Note that it is not necessary to 'cleanup' the registration in
38
- // the useEffect hook. Calling register() multiple times is a no-op.
39
- // See https://web.dev/articles/service-workers-registration#subsequent_visits
40
- }, [props.path]);
41
- return _jsx(_Fragment, { children: props.children });
42
- }