@contentful/live-preview
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -1,2 +0,2 @@ | ||
import { C as t, I as o, L as E, b as a, e as n, V as i, a as I, f as r, o as d, c as p } from "./index-DJiGEKYp.js"; | ||
import { C as t, I as o, L as E, b as a, e as n, V as i, a as I, f as r, o as d, c as p } from "./index-2NJWBdxg.js"; | ||
export { | ||
@@ -3,0 +3,0 @@ t as ContentfulLivePreview, |
import { useEffect, type PropsWithChildren, type ReactElement } from 'react'; | ||
import { DocumentNode } from 'graphql'; | ||
import { ContentfulLivePreviewInitConfig } from './index.js'; | ||
import type { InspectorModeTags } from './inspectorMode/types.js'; | ||
import { Argument, LivePreviewAssetProps, LivePreviewEntryProps, LivePreviewProps } from './types.js'; | ||
import { ContentfulLivePreview, ContentfulLivePreviewInitConfig } from './index.js'; | ||
import { Argument } from './types.js'; | ||
type UseEffectParams = Parameters<typeof useEffect>; | ||
@@ -28,11 +27,31 @@ type EffectCallback = UseEffectParams[0]; | ||
export declare function useContentfulLiveUpdates<T extends Argument | null | undefined>(data: T, locale?: string, skip?: boolean): T; | ||
type GetInspectorModeProps<T> = (props: ({ | ||
[K in Exclude<keyof LivePreviewEntryProps, keyof T | 'locale' | 'environment' | 'space'>]: LivePreviewEntryProps[K]; | ||
type SharedProps = { | ||
entryId?: string; | ||
assetId?: string; | ||
locale?: string; | ||
space?: string; | ||
environment?: string; | ||
}; | ||
type InspectorModeProps = SharedProps & { | ||
fieldId: string; | ||
}; | ||
type RequireEntryOrAssetId<T, U> = U extends { | ||
entryId: string; | ||
} | { | ||
[K in Exclude<keyof LivePreviewAssetProps, keyof T | 'locale' | 'environment' | 'space'>]: LivePreviewAssetProps[K]; | ||
}) & Pick<LivePreviewProps, 'environment' | 'locale' | 'space'>) => InspectorModeTags; | ||
/** | ||
* Generates the function to build the required properties for the inspector mode (field tagging) | ||
*/ | ||
export declare function useContentfulInspectorMode<T = undefined | Partial<LivePreviewAssetProps> | Partial<LivePreviewEntryProps>>(sharedProps?: T): GetInspectorModeProps<T>; | ||
assetId: string; | ||
} ? T & { | ||
locale?: string; | ||
space?: string; | ||
environment?: string; | ||
} : T & ({ | ||
entryId: string; | ||
} | { | ||
assetId: string; | ||
}) & { | ||
locale?: string; | ||
space?: string; | ||
environment?: string; | ||
}; | ||
type ConstrainedSharedProps<U> = U extends SharedProps ? U : never; | ||
export declare function useContentfulInspectorMode<U extends SharedProps>(sharedProps?: ConstrainedSharedProps<U>): (props: RequireEntryOrAssetId<Omit<InspectorModeProps, keyof SharedProps>, U>) => ReturnType<typeof ContentfulLivePreview.getProps> | null; | ||
export {}; |
import xe, { createContext as yr, useRef as N, useMemo as ee, useEffect as br, useState as hr, useContext as ke, useCallback as gr } from "react"; | ||
import { i as Er, C as re, d as Rr } from "./index-DJiGEKYp.js"; | ||
import { i as Er, C as re, d as Rr } from "./index-2NJWBdxg.js"; | ||
var Q = { exports: {} }, W = {}; | ||
@@ -4,0 +4,0 @@ /** |
{ | ||
"name": "@contentful/live-preview", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"author": "Contentful GmbH", | ||
@@ -75,3 +75,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "8f225235823488d73bed4a515de2785217c0f051" | ||
"gitHead": "b1c292be6cb412f1d06f840c066af266b849da54" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
615933
2819