@reykjavik/webtools 0.2.10 → 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/CHANGELOG.md +14 -5
- package/CookieHubConsent.d.ts +2 -2
- package/CookieHubConsent.js +2 -2
- package/README.md +21 -5
- package/SiteImprove.d.ts +3 -3
- package/SiteImprove.js +3 -3
- package/async.d.ts +4 -4
- package/async.js +3 -3
- package/errorhandling.d.ts +11 -10
- package/errorhandling.js +8 -7
- package/esm/CookieHubConsent.d.ts +2 -2
- package/esm/CookieHubConsent.js +2 -2
- package/esm/SiteImprove.d.ts +3 -3
- package/esm/SiteImprove.js +3 -3
- package/esm/async.d.ts +4 -4
- package/esm/async.js +3 -3
- package/esm/errorhandling.d.ts +11 -10
- package/esm/errorhandling.js +8 -7
- package/esm/hooks.d.ts +2 -2
- package/esm/hooks.js +2 -2
- package/esm/http.d.ts +11 -11
- package/esm/http.js +26 -18
- package/esm/next/http.d.ts +2 -2
- package/esm/next/http.js +3 -3
- package/esm/react-router/Wait.d.ts +2 -2
- package/esm/react-router/Wait.js +1 -1
- package/esm/react-router/http.d.ts +1 -1
- package/esm/react-router/http.js +1 -1
- package/esm/vanillaExtract.d.ts +4 -4
- package/esm/vanillaExtract.js +3 -3
- package/hooks.d.ts +2 -2
- package/hooks.js +2 -2
- package/http.d.ts +11 -11
- package/http.js +29 -21
- package/next/http.d.ts +2 -2
- package/next/http.js +3 -3
- package/package.json +1 -1
- package/react-router/Wait.d.ts +2 -2
- package/react-router/Wait.js +1 -1
- package/react-router/http.d.ts +1 -1
- package/react-router/http.js +1 -1
- package/vanillaExtract.d.ts +4 -4
- package/vanillaExtract.js +3 -3
package/react-router/Wait.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type WaitProps<T> = WaitPropsBase<T> & WaitFallbacks;
|
|
|
31
31
|
* custom properties for `meanwhile` and `error` fallbacks, and/or other
|
|
32
32
|
* behaviors.
|
|
33
33
|
*
|
|
34
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
34
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README-rr.md#type-waitcomponent
|
|
35
35
|
*/
|
|
36
36
|
export type WaitComponent<CustomProps extends Record<string, unknown> = Record<never, never>> = (<T>(props: WaitPropsBase<T> & CustomProps) => ReactElement) & {
|
|
37
37
|
displayName?: string;
|
|
@@ -43,7 +43,7 @@ export type WaitComponent<CustomProps extends Record<string, unknown> = Record<n
|
|
|
43
43
|
* If the awaited promise (`props.for`) resolves to an object with a truthy
|
|
44
44
|
* `$error` property, the `$error` will be thrown.
|
|
45
45
|
*
|
|
46
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
46
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README-rr.md#wait-component
|
|
47
47
|
*/
|
|
48
48
|
export declare const Wait: WaitComponent<WaitFallbacks>;
|
|
49
49
|
export {};
|
package/react-router/Wait.js
CHANGED
|
@@ -43,7 +43,7 @@ const react_router_1 = require("react-router");
|
|
|
43
43
|
* If the awaited promise (`props.for`) resolves to an object with a truthy
|
|
44
44
|
* `$error` property, the `$error` will be thrown.
|
|
45
45
|
*
|
|
46
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
46
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README-rr.md#wait-component
|
|
47
47
|
*/
|
|
48
48
|
const Wait = (props) => (react_1.default.createElement(react_1.Suspense, { fallback: props.meanwhile || 'Loading...' },
|
|
49
49
|
react_1.default.createElement(react_router_1.Await, { resolve: props.for, errorElement: props.error || 'An error occurred.' }, (value) => {
|
package/react-router/http.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Detects if the request is a client fetch, or an initial/full-page load.
|
|
3
3
|
* Useful for deciding whether to defer data fetching or not.
|
|
4
4
|
*
|
|
5
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
5
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README-rr.md#isclientfetch
|
|
6
6
|
*/
|
|
7
7
|
export declare const isClientFetch: (request: Request) => boolean;
|
package/react-router/http.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.isClientFetch = void 0;
|
|
|
5
5
|
* Detects if the request is a client fetch, or an initial/full-page load.
|
|
6
6
|
* Useful for deciding whether to defer data fetching or not.
|
|
7
7
|
*
|
|
8
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
8
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README-rr.md#isclientfetch
|
|
9
9
|
*/
|
|
10
10
|
/*#__NO_SIDE_EFFECTS__*/
|
|
11
11
|
const isClientFetch = (request) =>
|
package/vanillaExtract.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { GlobalStyleRule } from '@vanilla-extract/css';
|
|
|
2
2
|
/**
|
|
3
3
|
* Adds free-form CSS as a globalStyle
|
|
4
4
|
*
|
|
5
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
5
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillaglobal
|
|
6
6
|
*/
|
|
7
7
|
export declare const vanillaGlobal: (css: string) => void;
|
|
8
8
|
/**
|
|
9
9
|
* Spreads the return value into a style object, to inject free-form CSS
|
|
10
10
|
* properties (or nested blocks)
|
|
11
11
|
*
|
|
12
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
12
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillaprops
|
|
13
13
|
*/
|
|
14
14
|
export declare const vanillaProps: (css: string) => GlobalStyleRule;
|
|
15
15
|
type ClassNameCallback = (
|
|
@@ -27,7 +27,7 @@ classNameSelector: string) => string;
|
|
|
27
27
|
*
|
|
28
28
|
* To opt out of the `&&` replacement, use the callback function signature.
|
|
29
29
|
*
|
|
30
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
30
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillaclass
|
|
31
31
|
*/
|
|
32
32
|
export declare function vanillaClass(css: string | ClassNameCallback): string;
|
|
33
33
|
export declare function vanillaClass(debugId: string, css: string | ClassNameCallback): string;
|
|
@@ -35,7 +35,7 @@ export declare function vanillaClass(debugId: string, css: string | ClassNameCal
|
|
|
35
35
|
* Returns an object with privately scoped CSS variables props.
|
|
36
36
|
* Pass them around and use them in your CSS.
|
|
37
37
|
*
|
|
38
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
38
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillacvars
|
|
39
39
|
*/
|
|
40
40
|
export declare const vanillaVars: <T extends string>(...varNames: Array<T>) => Record<`var${Capitalize<T>}`, string> & {
|
|
41
41
|
/** Allows initializing all or some of the variables in CSS, without offending VSCode's CSS syntax parser too much. */
|
package/vanillaExtract.js
CHANGED
|
@@ -7,7 +7,7 @@ const css_1 = require("@vanilla-extract/css");
|
|
|
7
7
|
/**
|
|
8
8
|
* Adds free-form CSS as a globalStyle
|
|
9
9
|
*
|
|
10
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
10
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillaglobal
|
|
11
11
|
*/
|
|
12
12
|
const vanillaGlobal = (css) => (0, css_1.globalStyle)('x', { x: `} ${css} x{x:` });
|
|
13
13
|
exports.vanillaGlobal = vanillaGlobal;
|
|
@@ -16,7 +16,7 @@ exports.vanillaGlobal = vanillaGlobal;
|
|
|
16
16
|
* Spreads the return value into a style object, to inject free-form CSS
|
|
17
17
|
* properties (or nested blocks)
|
|
18
18
|
*
|
|
19
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
19
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillaprops
|
|
20
20
|
*/
|
|
21
21
|
const vanillaProps = (css) => ({ x: `; ${css}` });
|
|
22
22
|
exports.vanillaProps = vanillaProps;
|
|
@@ -37,7 +37,7 @@ function vanillaClass(cssOrDebugId, css) {
|
|
|
37
37
|
* Returns an object with privately scoped CSS variables props.
|
|
38
38
|
* Pass them around and use them in your CSS.
|
|
39
39
|
*
|
|
40
|
-
* @see https://github.com/reykjavikcity/webtools/blob/v0.
|
|
40
|
+
* @see https://github.com/reykjavikcity/webtools/blob/v0.3/README.md#vanillacvars
|
|
41
41
|
*/
|
|
42
42
|
const vanillaVars = (...varNames) => {
|
|
43
43
|
const id = vanillaClass(``);
|