@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.
@@ -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 +1,4 @@
1
- export declare function PreviewBanner(): Promise<import("react").JSX.Element | null>;
1
+ export interface PreviewBannerProps {
2
+ releaseId?: string;
3
+ }
4
+ export declare function PreviewBanner({ releaseId }: PreviewBannerProps): import("react").JSX.Element | null;
@@ -1,7 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isPreviewMode } from './preview-mode.js';
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 const isPreviewMode: () => Promise<string>;
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 const isPreviewMode = cache(async () => {
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradial/aci",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",