@gradial/aci 0.1.16 → 0.1.18
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/dist/next/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DevRefresh, type DevRefreshProps } from './dev-refresh.js';
|
|
2
2
|
export { withGradial, type WithGradialOptions } from './config.js';
|
|
3
|
-
export { PreviewBanner } from './preview-banner.js';
|
|
3
|
+
export { PreviewBanner, type PreviewBannerProps } from './preview-banner.js';
|
|
4
4
|
export { isPreviewMode } from './preview-mode.js';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
export async function PreviewBanner() {
|
|
4
|
-
const releaseId = await isPreviewMode();
|
|
2
|
+
export function PreviewBanner({ releaseId }) {
|
|
5
3
|
if (!releaseId)
|
|
6
4
|
return null;
|
|
7
5
|
const shortId = releaseId.length > 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function isPreviewMode(): Promise<string>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { cache } from 'react';
|
|
2
1
|
import { headers } from 'next/headers.js';
|
|
3
2
|
const RELEASE_HEADER = 'x-gradial-release-id';
|
|
4
3
|
const PREVIEW_HEADER = 'x-gradial-preview';
|
|
5
|
-
export
|
|
4
|
+
export async function isPreviewMode() {
|
|
6
5
|
try {
|
|
7
6
|
const current = await headers();
|
|
8
7
|
const previewFlag = current.get(PREVIEW_HEADER);
|
|
@@ -16,4 +15,4 @@ export const isPreviewMode = cache(async () => {
|
|
|
16
15
|
console.log('[gradial/server] isPreviewMode error:', String(err));
|
|
17
16
|
}
|
|
18
17
|
return '';
|
|
19
|
-
}
|
|
18
|
+
}
|