@admin-layout/tailwind-ui 12.2.4-alpha.97 → 12.2.4-alpha.98

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.
@@ -1 +1 @@
1
- {"version":3,"file":"403.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/403.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAuBpB,CAAC"}
1
+ {"version":3,"file":"403.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/403.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAwBpB,CAAC"}
@@ -1,6 +1,7 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import assets from'@admin-layout/assets';const Error403 = () => {
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import {useErrorAsset}from'./useErrorAsset.js';const Error403 = () => {
2
2
  const navigate = useNavigate();
3
3
  const goBack = () => navigate(-1);
4
+ const imgSrc = useErrorAsset('error-403-540x432.png');
4
5
  return jsx("div", {
5
6
  className: "flex justify-center items-center",
6
7
  children: jsxs("div", {
@@ -13,7 +14,7 @@ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/rea
13
14
  }), jsx("div", {
14
15
  className: "mt-10",
15
16
  children: jsx("img", {
16
- src: assets['error-403-540x432.png'],
17
+ src: imgSrc,
17
18
  alt: "403 Error"
18
19
  })
19
20
  }), jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"403.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"403.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"404.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/404.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAuBpB,CAAC"}
1
+ {"version":3,"file":"404.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/404.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAwBpB,CAAC"}
@@ -1,6 +1,7 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import assets from'@admin-layout/assets';const Error404 = () => {
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import {useErrorAsset}from'./useErrorAsset.js';const Error404 = () => {
2
2
  const navigate = useNavigate();
3
3
  const goBack = () => navigate(-1);
4
+ const imgSrc = useErrorAsset('error-404-540x432.png');
4
5
  return jsx("div", {
5
6
  className: "flex justify-center items-center",
6
7
  children: jsxs("div", {
@@ -13,7 +14,7 @@ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/rea
13
14
  }), jsx("div", {
14
15
  className: "mt-10",
15
16
  children: jsx("img", {
16
- src: assets['error-404-540x432.png'],
17
+ src: imgSrc,
17
18
  alt: "404 Error"
18
19
  })
19
20
  }), jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"404.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"404.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"500.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/500.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAuBpB,CAAC"}
1
+ {"version":3,"file":"500.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/500.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,+CAwBpB,CAAC"}
@@ -1,6 +1,7 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import assets from'@admin-layout/assets';const Error500 = () => {
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/react';import {useErrorAsset}from'./useErrorAsset.js';const Error500 = () => {
2
2
  const navigate = useNavigate();
3
3
  const goBack = () => navigate(-1);
4
+ const imgSrc = useErrorAsset('error-500-252x475.png');
4
5
  return jsx("div", {
5
6
  className: "flex justify-center items-center",
6
7
  children: jsxs("div", {
@@ -13,7 +14,7 @@ import {jsx,jsxs}from'react/jsx-runtime';import {useNavigate}from'@remix-run/rea
13
14
  }), jsx("div", {
14
15
  className: "mt-10",
15
16
  children: jsx("img", {
16
- src: assets['error-500-252x475.png'],
17
+ src: imgSrc,
17
18
  alt: "500 Error"
18
19
  })
19
20
  }), jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"500.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"500.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The `@admin-layout/assets` barrel bakes EVERY image in as a base64 data URI
3
+ * (~335 KB of JS, ~233 KB gzipped - login backgrounds, logos, error
4
+ * illustrations). A static `import assets from '@admin-layout/assets'` here
5
+ * dragged that whole blob into the initial bundle of every app that imports
6
+ * anything from the tailwind-ui barrel - to show images that only render on
7
+ * ERROR pages. Load the map on demand instead: the blob becomes one async
8
+ * chunk fetched the first time an error page actually renders.
9
+ */
10
+ export declare function useErrorAsset(key: string): string | undefined;
11
+ //# sourceMappingURL=useErrorAsset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useErrorAsset.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPages/useErrorAsset.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgB7D"}
@@ -0,0 +1,24 @@
1
+ import {useState,useEffect}from'react';/**
2
+ * The `@admin-layout/assets` barrel bakes EVERY image in as a base64 data URI
3
+ * (~335 KB of JS, ~233 KB gzipped - login backgrounds, logos, error
4
+ * illustrations). A static `import assets from '@admin-layout/assets'` here
5
+ * dragged that whole blob into the initial bundle of every app that imports
6
+ * anything from the tailwind-ui barrel - to show images that only render on
7
+ * ERROR pages. Load the map on demand instead: the blob becomes one async
8
+ * chunk fetched the first time an error page actually renders.
9
+ */
10
+ function useErrorAsset(key) {
11
+ const [src, setSrc] = useState(undefined);
12
+ useEffect(() => {
13
+ let cancelled = false;
14
+ import('@admin-layout/assets').then(mod => {
15
+ if (!cancelled) setSrc(mod.default[key]);
16
+ }).catch(() => {
17
+ /* image is decorative - the error text already rendered */
18
+ });
19
+ return () => {
20
+ cancelled = true;
21
+ };
22
+ }, [key]);
23
+ return src;
24
+ }export{useErrorAsset};//# sourceMappingURL=useErrorAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useErrorAsset.js","sources":["../../../src/components/ErrorPages/useErrorAsset.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAUG;AACH;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/tailwind-ui",
3
- "version": "12.2.4-alpha.97",
3
+ "version": "12.2.4-alpha.98",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -93,7 +93,7 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "2e160f665e73ab8d20cc1563363b7088393fc71e",
96
+ "gitHead": "31c7f5b350f4d052df1064e85d964f14d750bbe1",
97
97
  "typescript": {
98
98
  "definition": "lib/index.d.ts"
99
99
  }