From fd53bafa9bcc113a8687536e930b4cf9f8af9396 Mon Sep 17 00:00:00 2001 From: mayank1513 Date: Sun, 22 Dec 2024 00:44:21 +0000 Subject: [PATCH] upgrade deps && docs --- docs/functions/client_core_core.Core.html | 2 +- .../client_core_no-fouc.noFOUCScript.html | 2 +- .../client_switch_switch.Switch.html | 2 +- docs/functions/hooks_use-mode.useMode.html | 2 +- docs/functions/utils.useStore.html | 2 +- .../client_core_core.CoreProps.html | 8 +-- .../client_switch_switch.SwitchProps.html | 8 +-- .../hooks_use-mode.UseModeYeild.html | 4 +- docs/interfaces/utils.Store.html | 4 +- docs/types/utils.ColorSchemePreference.html | 2 +- docs/types/utils.ResolvedScheme.html | 2 +- docs/variables/constants.DARK.html | 2 +- docs/variables/constants.LIGHT.html | 2 +- docs/variables/constants.SYSTEM.html | 2 +- docs/variables/constants.modes.html | 2 +- package.json | 2 +- pnpm-lock.yaml | 50 +++++++++---------- 17 files changed, 49 insertions(+), 49 deletions(-) diff --git a/docs/functions/client_core_core.Core.html b/docs/functions/client_core_core.Core.html index 1460c0c2..94f8dc6d 100644 --- a/docs/functions/client_core_core.Core.html +++ b/docs/functions/client_core_core.Core.html @@ -9,4 +9,4 @@
export const Core = ({ t = "none", nonce = "", k = "o" }: CoreProps) => {
const isWindowDefined = typeof window != "undefined";
// handle client side exceptions when script is not run. <- for client side apps like vite or CRA
if (isWindowDefined && !window.q) noFOUCScript(k, t, nonce);

const [{ m, s }, setThemeState] = useStore();

if (!updateDOM && isWindowDefined) {
// store global functions to local variables to avoid any interference
[media, updateDOM] = [q, u];
/** Updating media: prefers-color-scheme*/
media.addEventListener("change", () =>
setThemeState(state => ({ ...state, s: media.matches ? DARK : LIGHT })),
);
/** Sync the tabs */
addEventListener("storage", (e: StorageEvent): void => {
e.key === k && setThemeState(state => ({ ...state, m: e.newValue as ColorSchemePreference }));
});
}
updateDOM?.(m, s);

return <Script {...{ n: nonce, k, t }} />;
};
-
+
diff --git a/docs/functions/client_core_no-fouc.noFOUCScript.html b/docs/functions/client_core_no-fouc.noFOUCScript.html index 609b2424..fd58e2ec 100644 --- a/docs/functions/client_core_no-fouc.noFOUCScript.html +++ b/docs/functions/client_core_no-fouc.noFOUCScript.html @@ -1,2 +1,2 @@ noFOUCScript | React18 Loaders

function to be injected in script tag for avoiding FOUC

-
  • Parameters

    • storageKey: string
    • themeTransition: string
    • nonce: string

    Returns void

+
diff --git a/docs/functions/client_switch_switch.Switch.html b/docs/functions/client_switch_switch.Switch.html index 2e3604f6..23117246 100644 --- a/docs/functions/client_switch_switch.Switch.html +++ b/docs/functions/client_switch_switch.Switch.html @@ -8,4 +8,4 @@
export const Switch = ({
tag: Tag = "button",
size = 24,
skipSystem,
children,
...tagProps
}: SwitchProps) => {
const [{ m, s }, setState] = useStore();
const n = modes.length - (skipSystem ? 1 : 0);
/** toggle mode */
tagProps.onClick = () =>
setState({
s,
m: modes[(modes.indexOf(m) + 1) % n],
});

const className = styles.switch;
const style = { "--size": `${size}px` };

if (!children) {
tagProps.className += " " + className;
tagProps.style = { ...tagProps.style, ...style };
}

return (
// @ts-expect-error -- too complex types
<Tag suppressHydrationWarning {...tagProps} data-testid="switch">
{/* @ts-expect-error -> we are setting the CSS variable */}
{children && <div {...{ className, style }} />}
{children}
</Tag>
);
};
-
+
diff --git a/docs/functions/hooks_use-mode.useMode.html b/docs/functions/hooks_use-mode.useMode.html index 86ceec31..3c1c6efb 100644 --- a/docs/functions/hooks_use-mode.useMode.html +++ b/docs/functions/hooks_use-mode.useMode.html @@ -8,4 +8,4 @@
export const useMode = (): UseModeYeild => {
const [{ m, s }, setState] = useStore();
/** Set user preference */
return {
mode: m,
systemMode: s,
resolvedMode: (m === SYSTEM ? s : m) as ResolvedScheme,
setMode: (m: ColorSchemePreference) => setState({ s, m }),
};
};
-
+
diff --git a/docs/functions/utils.useStore.html b/docs/functions/utils.useStore.html index 71638627..806d4c29 100644 --- a/docs/functions/utils.useStore.html +++ b/docs/functions/utils.useStore.html @@ -1,2 +1,2 @@ useStore | React18 Loaders

local abstaction of RGS to avoid multiple imports

-
+
diff --git a/docs/interfaces/client_core_core.CoreProps.html b/docs/interfaces/client_core_core.CoreProps.html index e7d9bd80..14adcb9d 100644 --- a/docs/interfaces/client_core_core.CoreProps.html +++ b/docs/interfaces/client_core_core.CoreProps.html @@ -1,16 +1,16 @@ -CoreProps | React18 Loaders
interface CoreProps {
    k?: string;
    nonce?: string;
    t?: string;
}

Properties

k? +CoreProps | React18 Loaders
interface CoreProps {
    k?: string;
    nonce?: string;
    t?: string;
}

Properties

Properties

k?: string

storageKey

'o'
 
-
nonce?: string

The nonce value for your Content Security Policy.

+
nonce?: string

The nonce value for your Content Security Policy.

''
 
-
t?: string

themeTransition: force apply CSS transition property to all the elements during theme switching. E.g., all .3s

+
t?: string

themeTransition: force apply CSS transition property to all the elements during theme switching. E.g., all .3s

'none'
 
-
+
diff --git a/docs/interfaces/client_switch_switch.SwitchProps.html b/docs/interfaces/client_switch_switch.SwitchProps.html index cb0509f9..40c5719f 100644 --- a/docs/interfaces/client_switch_switch.SwitchProps.html +++ b/docs/interfaces/client_switch_switch.SwitchProps.html @@ -1,10 +1,10 @@ -SwitchProps | React18 Loaders
interface SwitchProps {
    size?: number;
    skipSystem?: boolean;
    tag?: "button" | "div";
}

Hierarchy

Properties

size? +SwitchProps | React18 Loaders
interface SwitchProps {
    size?: number;
    skipSystem?: boolean;
    tag?: "button" | "div";
}

Hierarchy

Properties

size?: number

Diameter of the color switch

-
skipSystem?: boolean

Skip system colorScheme while toggling

-
tag?: "button" | "div"

html tag

+
skipSystem?: boolean

Skip system colorScheme while toggling

+
tag?: "button" | "div"

html tag

'button'
 
-
+
diff --git a/docs/interfaces/hooks_use-mode.UseModeYeild.html b/docs/interfaces/hooks_use-mode.UseModeYeild.html index e69a9b9c..d4b8050d 100644 --- a/docs/interfaces/hooks_use-mode.UseModeYeild.html +++ b/docs/interfaces/hooks_use-mode.UseModeYeild.html @@ -1,5 +1,5 @@ -UseModeYeild | React18 Loaders
interface UseModeYeild {
    mode: ColorSchemePreference;
    resolvedMode: ResolvedScheme;
    setMode: (mode: ColorSchemePreference) => void;
    systemMode: ResolvedScheme;
}

Properties

mode +UseModeYeild | React18 Loaders
interface UseModeYeild {
    mode: ColorSchemePreference;
    resolvedMode: ResolvedScheme;
    setMode: (mode: ColorSchemePreference) => void;
    systemMode: ResolvedScheme;
}

Properties

resolvedMode: ResolvedScheme
setMode: (mode: ColorSchemePreference) => void
systemMode: ResolvedScheme
+

Properties

resolvedMode: ResolvedScheme
setMode: (mode: ColorSchemePreference) => void
systemMode: ResolvedScheme
diff --git a/docs/interfaces/utils.Store.html b/docs/interfaces/utils.Store.html index 322a7225..a88e24e9 100644 --- a/docs/interfaces/utils.Store.html +++ b/docs/interfaces/utils.Store.html @@ -1,3 +1,3 @@ -Store | React18 Loaders
interface Store {
    m: ColorSchemePreference;
    s: ResolvedScheme;
}

Properties

m +Store | React18 Loaders
interface Store {
    m: ColorSchemePreference;
    s: ResolvedScheme;
}

Properties

m s -

Properties

+

Properties

diff --git a/docs/types/utils.ColorSchemePreference.html b/docs/types/utils.ColorSchemePreference.html index 286310de..531933a7 100644 --- a/docs/types/utils.ColorSchemePreference.html +++ b/docs/types/utils.ColorSchemePreference.html @@ -1 +1 @@ -ColorSchemePreference | React18 Loaders

Type Alias ColorSchemePreference

ColorSchemePreference: "system" | "dark" | ""
+ColorSchemePreference | React18 Loaders

Type Alias ColorSchemePreference

ColorSchemePreference: "system" | "dark" | ""
diff --git a/docs/types/utils.ResolvedScheme.html b/docs/types/utils.ResolvedScheme.html index 72c13f06..32c3f01c 100644 --- a/docs/types/utils.ResolvedScheme.html +++ b/docs/types/utils.ResolvedScheme.html @@ -1 +1 @@ -ResolvedScheme | React18 Loaders

Type Alias ResolvedScheme

ResolvedScheme: "dark" | ""
+ResolvedScheme | React18 Loaders

Type Alias ResolvedScheme

ResolvedScheme: "dark" | ""
diff --git a/docs/variables/constants.DARK.html b/docs/variables/constants.DARK.html index f5974413..d0c25591 100644 --- a/docs/variables/constants.DARK.html +++ b/docs/variables/constants.DARK.html @@ -1 +1 @@ -DARK | React18 Loaders
DARK: ResolvedScheme = "dark"
+DARK | React18 Loaders
DARK: ResolvedScheme = "dark"
diff --git a/docs/variables/constants.LIGHT.html b/docs/variables/constants.LIGHT.html index 1ed61c12..11e35c95 100644 --- a/docs/variables/constants.LIGHT.html +++ b/docs/variables/constants.LIGHT.html @@ -1 +1 @@ -LIGHT | React18 Loaders
LIGHT: ResolvedScheme = ""
+LIGHT | React18 Loaders
LIGHT: ResolvedScheme = ""
diff --git a/docs/variables/constants.SYSTEM.html b/docs/variables/constants.SYSTEM.html index b7f7799b..8f364054 100644 --- a/docs/variables/constants.SYSTEM.html +++ b/docs/variables/constants.SYSTEM.html @@ -1 +1 @@ -SYSTEM | React18 Loaders

Variable SYSTEMConst

SYSTEM: ColorSchemePreference = "system"
+SYSTEM | React18 Loaders

Variable SYSTEMConst

SYSTEM: ColorSchemePreference = "system"
diff --git a/docs/variables/constants.modes.html b/docs/variables/constants.modes.html index 5478d097..aa37f6bd 100644 --- a/docs/variables/constants.modes.html +++ b/docs/variables/constants.modes.html @@ -1 +1 @@ -modes | React18 Loaders
modes: ColorSchemePreference[] = ...
+modes | React18 Loaders
modes: ColorSchemePreference[] = ...
diff --git a/package.json b/package.json index efea5d67..ff6a02e7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "typedoc": "^0.27.5", "typedoc-plugin-extras": "^3.1.0", "typedoc-plugin-inline-sources": "^1.2.0", - "typedoc-plugin-mdn-links": "^4.0.5", + "typedoc-plugin-mdn-links": "^4.0.6", "typedoc-plugin-missing-exports": "^3.1.0", "typedoc-plugin-rename-defaults": "^0.7.2", "typedoc-plugin-zod": "^1.3.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d22db5f..674a9406 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,8 +37,8 @@ importers: specifier: ^1.2.0 version: 1.2.0(typedoc@0.27.5(typescript@5.7.2)) typedoc-plugin-mdn-links: - specifier: ^4.0.5 - version: 4.0.5(typedoc@0.27.5(typescript@5.7.2)) + specifier: ^4.0.6 + version: 4.0.6(typedoc@0.27.5(typescript@5.7.2)) typedoc-plugin-missing-exports: specifier: ^3.1.0 version: 3.1.0(typedoc@0.27.5(typescript@5.7.2)) @@ -1674,11 +1674,11 @@ packages: cpu: [x64] os: [win32] - '@shikijs/engine-oniguruma@1.24.3': - resolution: {integrity: sha512-iNnx950gs/5Nk+zrp1LuF+S+L7SKEhn8k9eXgFYPGhVshKppsYwRmW8tpmAMvILIMSDfrgqZ0w+3xWVQB//1Xw==} + '@shikijs/engine-oniguruma@1.24.4': + resolution: {integrity: sha512-Do2ry6flp2HWdvpj2XOwwa0ljZBRy15HKZITzPcNIBOGSeprnA8gOooA/bLsSPuy8aJBa+Q/r34dMmC3KNL/zw==} - '@shikijs/types@1.24.3': - resolution: {integrity: sha512-FPMrJ69MNxhRtldRk69CghvaGlbbN3pKRuvko0zvbfa2dXp4pAngByToqS5OY5jvN8D7LKR4RJE8UvzlCOuViw==} + '@shikijs/types@1.24.4': + resolution: {integrity: sha512-0r0XU7Eaow0PuDxuWC1bVqmWCgm3XqizIaT7SM42K03vc69LGooT0U8ccSR44xP/hGlNx4FKhtYpV+BU6aaKAA==} '@shikijs/vscode-textmate@9.3.1': resolution: {integrity: sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==} @@ -2190,8 +2190,8 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.4.0: - resolution: {integrity: sha512-ZkD35Mx92acjB2yNJgziGqT9oKHEOxjTBTDRpOsRWtdecL/0jM3z5kM/CTzHWvHIen1GvkM85p6TuFfDGfc8/Q==} + chalk@5.4.1: + resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} change-case@4.1.2: @@ -3070,8 +3070,8 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.16.0: - resolution: {integrity: sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g==} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} is-data-view@1.0.2: @@ -4764,8 +4764,8 @@ packages: peerDependencies: typedoc: 0.25.x || 0.26.x - typedoc-plugin-mdn-links@4.0.5: - resolution: {integrity: sha512-ja4zdtmO6UIq3HDsssWSMxhNn7RgVQ9vbE8OEmIuVmeeNsbRBpskcw1JMiZmud7Ozxfvgd+qKx4wa6RTWQxQVw==} + typedoc-plugin-mdn-links@4.0.6: + resolution: {integrity: sha512-7m9AA/SjSV5DAc0MrOPIfkTCI+qcK8NnNSLgknqakQwqd3OFRXGe4tiFNm3tKHqft8FDce6qva1akVxyLyQXrA==} peerDependencies: typedoc: 0.26.x || 0.27.x @@ -5756,8 +5756,8 @@ snapshots: '@gerrit0/mini-shiki@1.24.4': dependencies: - '@shikijs/engine-oniguruma': 1.24.3 - '@shikijs/types': 1.24.3 + '@shikijs/engine-oniguruma': 1.24.4 + '@shikijs/types': 1.24.4 '@shikijs/vscode-textmate': 9.3.1 '@humanfs/core@0.19.1': {} @@ -6240,12 +6240,12 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.29.1': optional: true - '@shikijs/engine-oniguruma@1.24.3': + '@shikijs/engine-oniguruma@1.24.4': dependencies: - '@shikijs/types': 1.24.3 + '@shikijs/types': 1.24.4 '@shikijs/vscode-textmate': 9.3.1 - '@shikijs/types@1.24.3': + '@shikijs/types@1.24.4': dependencies: '@shikijs/vscode-textmate': 9.3.1 '@types/hast': 3.0.4 @@ -6888,7 +6888,7 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.4.0: {} + chalk@5.4.1: {} change-case@4.1.2: dependencies: @@ -7964,7 +7964,7 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.16.0: + is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -8649,7 +8649,7 @@ snapshots: log-symbols@6.0.0: dependencies: - chalk: 5.4.0 + chalk: 5.4.1 is-unicode-supported: 1.3.0 loose-envify@1.4.0: @@ -8926,7 +8926,7 @@ snapshots: ora@8.1.1: dependencies: - chalk: 5.4.0 + chalk: 5.4.1 cli-cursor: 5.0.0 cli-spinners: 2.9.2 is-interactive: 2.0.0 @@ -9054,7 +9054,7 @@ snapshots: plop@4.0.1: dependencies: '@types/liftoff': 4.0.3 - chalk: 5.4.0 + chalk: 5.4.1 interpret: 3.1.1 liftoff: 4.0.0 minimist: 1.2.8 @@ -9344,13 +9344,13 @@ snapshots: resolve@1.22.10: dependencies: - is-core-module: 2.16.0 + is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 resolve@2.0.0-next.5: dependencies: - is-core-module: 2.16.0 + is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -9960,7 +9960,7 @@ snapshots: dependencies: typedoc: 0.27.5(typescript@5.7.2) - typedoc-plugin-mdn-links@4.0.5(typedoc@0.27.5(typescript@5.7.2)): + typedoc-plugin-mdn-links@4.0.6(typedoc@0.27.5(typescript@5.7.2)): dependencies: typedoc: 0.27.5(typescript@5.7.2)