Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/live-preview

Package Overview
Dependencies
Maintainers
168
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/live-preview - npm Package Compare versions

Comparing version 2.4.11 to 2.5.0

dist/index-08e73509.js

2

dist/helpers/resolveReference.d.ts

@@ -7,2 +7,3 @@ import type { AssetProps, EntryProps } from 'contentful-management';

referenceId: string;
locale: string;
}): Promise<{

@@ -16,2 +17,3 @@ reference: EntryProps;

isAsset: true;
locale: string;
}): Promise<{

@@ -18,0 +20,0 @@ reference: AssetProps;

4

dist/helpers/utils.d.ts

@@ -1,2 +0,2 @@

import type { EditorMessage } from '../types';
import type { EditorMessage, PostMessageMethods } from '../types';
/**

@@ -6,3 +6,3 @@ * Sends the given message to the editor

*/
export declare function sendMessageToEditor(data: EditorMessage): void;
export declare function sendMessageToEditor(method: PostMessageMethods, data: EditorMessage): void;
type Callback = (...args: any[]) => void;

@@ -9,0 +9,0 @@ type DebouncedFunction<T extends Callback> = (...args: Parameters<T>) => void;

@@ -1,2 +0,2 @@

import { C as r } from "./index-b4b4ac5c.js";
import { C as r } from "./index-08e73509.js";
export {

@@ -3,0 +3,0 @@ r as ContentfulLivePreview

import * as V from "react";
import ke, { createContext as yr, useMemo as De, useState as hr, useRef as Pe, useContext as Ae, useCallback as gr } from "react";
import { C as Q, d as mr } from "./index-b4b4ac5c.js";
import { C as Q, d as mr } from "./index-08e73509.js";
var Z = { exports: {} }, F = {};

@@ -5,0 +5,0 @@ /**

@@ -0,1 +1,3 @@

import type { RequestEntitiesMessage, RequestedEntitiesMessage } from '@contentful/visual-sdk';
import { PostMessageMethods as StorePostMessageMethods } from '@contentful/visual-sdk';
import type { AssetProps, EntryProps, ContentTypeProps, SysLink } from 'contentful-management';

@@ -31,2 +33,20 @@ export type ContentType = ContentTypeProps;

export type SubscribeCallback = (data: Argument) => void;
export declare enum LivePreviewPostMessageMethods {
IFRAME_CONNECTED = "IFRAME_CONNECTED",
TAGGED_FIELD_CLICKED = "TAGGED_FIELD_CLICKED",
URL_CHANGED = "URL_CHANGED",
SUBSCRIBED = "SUBSCRIBED",
ENTRY_UPDATED = "ENTRY_UPDATED",
INSPECTOR_MODE_CHANGED = "INSPECTOR_MODE_CHANGED",
DEBUG_MODE_ENABLED = "DEBUG_MODE_ENABLED",
/**
* @deprecated use PostMessageStoreMethods instead
*/
ENTITY_NOT_KNOWN = "ENTITY_NOT_KNOWN",
/**
* @deprecated use PostMessageStoreMethods instead
*/
UNKNOWN_REFERENCE_LOADED = "UNKNOWN_REFERENCE_LOADED"
}
export type PostMessageMethods = LivePreviewPostMessageMethods | StorePostMessageMethods;
export interface CollectionItem {

@@ -36,4 +56,5 @@ sys: SysProps;

}
type IframeConnectedMessage = {
action: 'IFRAME_CONNECTED';
export type IframeConnectedMessage = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.IFRAME_CONNECTED;
connected: true;

@@ -43,4 +64,5 @@ tags: number;

};
type TaggedFieldClickMessage = {
action: 'TAGGED_FIELD_CLICKED';
export type TaggedFieldClickMessage = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.TAGGED_FIELD_CLICKED;
fieldId: string;

@@ -50,12 +72,16 @@ entryId: string;

};
type UnknownEntityMessage = {
action: 'ENTITY_NOT_KNOWN';
/** @deprecated use RequestEntitiesMessage instead */
export type UnknownEntityMessage = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.ENTITY_NOT_KNOWN;
referenceEntityId: string;
referenceContentType?: string;
};
type UrlChangedMessage = {
action: 'URL_CHANGED';
export type UrlChangedMessage = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.URL_CHANGED;
};
type SubscribedMessage = {
action: 'SUBSCRIBED';
export type SubscribedMessage = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.SUBSCRIBED;
type: 'GQL' | 'REST';

@@ -66,5 +92,8 @@ locale: string;

}
export type EditorMessage = IframeConnectedMessage | TaggedFieldClickMessage | UnknownEntityMessage | UrlChangedMessage | SubscribedMessage;
export type EditorMessage = IframeConnectedMessage | TaggedFieldClickMessage | UnknownEntityMessage | UrlChangedMessage | SubscribedMessage | RequestEntitiesMessage;
export type MessageFromSDK = EditorMessage & {
method: PostMessageMethods;
/** @deprecated use source instead */
from: 'live-preview';
source: 'live-preview-sdk';
location: string;

@@ -74,3 +103,5 @@ version: string;

export type EntryUpdatedMessage = {
action: 'ENTRY_UPDATED';
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.ENTRY_UPDATED;
method: LivePreviewPostMessageMethods.ENTRY_UPDATED;
entity: EntryProps | AssetProps;

@@ -80,4 +111,6 @@ contentType: ContentType;

};
type UnknownReferenceLoaded = {
action: 'UNKNOWN_REFERENCE_LOADED';
/** @deprecated use RequestEntitiesMessage instead */
export type UnknownReferenceLoaded = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.UNKNOWN_REFERENCE_LOADED;
reference: EntryProps | AssetProps;

@@ -87,11 +120,16 @@ contentType?: SysLink;

};
type InspectorModeChanged = {
action: 'INSPECTOR_MODE_CHANGED';
export type InspectorModeChanged = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.INSPECTOR_MODE_CHANGED;
isInspectorActive: boolean;
};
type DebugModeEnabled = {
action: 'DEBUG_MODE_ENABLED';
export type DebugModeEnabled = {
/** @deprecated use method instead */
action: LivePreviewPostMessageMethods.DEBUG_MODE_ENABLED;
};
export type MessageFromEditor = (EntryUpdatedMessage | UnknownReferenceLoaded | InspectorModeChanged | DebugModeEnabled) & {
export type MessageFromEditor = (EntryUpdatedMessage | UnknownReferenceLoaded | InspectorModeChanged | DebugModeEnabled | RequestedEntitiesMessage) & {
method: PostMessageMethods;
/** @deprecated use source instead */
from: 'live-preview';
source: 'live-preview-app';
};

@@ -146,2 +184,1 @@ export type UpdateEntryProps = {

export declare function isAsset(entity: EntryProps | (Entity & CollectionItem)): boolean;
export {};
{
"name": "@contentful/live-preview",
"version": "2.4.11",
"version": "2.5.0",
"author": "Contentful GmbH",

@@ -48,3 +48,3 @@ "license": "MIT",

"coverage": "vitest run --coverage",
"presemantic-release": "yarn build"
"prepublishOnly": "yarn build"
},

@@ -54,2 +54,3 @@ "homepage": "https://github.com/contentful/live-preview#readme",

"@contentful/rich-text-types": "^16.2.0",
"@contentful/visual-sdk": "^1.0.0-alpha.1",
"use-deep-compare-effect": "^1.8.1"

@@ -63,2 +64,3 @@ },

"@vitejs/plugin-react-swc": "^3.0.0",
"contentful": "^10.3.4",
"contentful-management": "^10.30.1",

@@ -79,3 +81,3 @@ "graphql": "^16.6.0",

},
"gitHead": "ea4db68605554b74f2b776685290d623f76f2aea"
"gitHead": "d03518468b009fa07635ff16064e15b7d6234cb7"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc