Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dda0f4d
feat: live preview: added outside iframe code
contentstackMridul Jul 23, 2025
ecfc580
Merge pull request #468 from contentstack/VE_6811
contentstackMridul Jul 23, 2025
8371212
feat: live preview: added outside iframe code
contentstackMridul Aug 4, 2025
8e100d9
feat: live preview: added outside iframe code
contentstackMridul Aug 4, 2025
dffe855
test: added new test cases for livePreviewEventManager and postMessag…
contentstackMridul Aug 6, 2025
a3a14f6
Merge pull request #477 from contentstack/VE_6811
contentstackMridul Aug 6, 2025
7aeeb63
feat: disable editing when workflow stage rules restrict the same
faraazb-contentstack Aug 6, 2025
790875a
test: fix tests
faraazb-contentstack Aug 7, 2025
1af5522
Merge branch 'main' into VE-7062-disable-entry-edit-workflow-stage
faraazb-contentstack Aug 7, 2025
07f3c96
chore: remove sequential from unit tests
faraazb-contentstack Aug 7, 2025
10c763d
test: add cases for isFieldDisabled
faraazb-contentstack Aug 8, 2025
472e2e6
fix: handle empty stage name correctly
faraazb-contentstack Aug 11, 2025
5e216ea
chore: replace ifs with switch
faraazb-contentstack Aug 11, 2025
55adf72
fix:added offset
karancs06 Aug 18, 2025
57eb755
fix: test case fix
karancs06 Aug 18, 2025
ec96d6c
Merge branch '21st-august-2025-release' into VE-7071-apply-outline-of…
karancs06 Aug 19, 2025
92d2bcc
Merge pull request #493 from contentstack/VE-7071-apply-outline-offse…
karancs06 Aug 19, 2025
ab113eb
Merge branch 'main' of github.com:contentstack/live-preview-sdk into …
contentstackMridul Aug 20, 2025
c23798e
chore: update tooltip message
faraazb-contentstack Aug 20, 2025
729ac76
test: update message
faraazb-contentstack Aug 20, 2025
d6b9d01
Merge pull request #494 from contentstack/VE-7062-disable-entry-edit-…
faraazb Aug 20, 2025
b50c43e
fix: resolve new tab bugs
contentstackMridul Aug 20, 2025
ede97b9
chore: updated version
contentstackMridul Aug 20, 2025
42ee5c1
fix: removed unused imports and increased the version
contentstackMridul Aug 20, 2025
87f86a5
Merge pull request #492 from contentstack/live-preview-outside-iframe
contentstackMridul Aug 20, 2025
fab45bf
chore: updated the changelog.md
SahilCs15 Aug 21, 2025
4686298
chore: updated the .talismanrc
SahilCs15 Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ fileignoreconfig:
checksum: d0ef271ee5381d9feab06bda6e7e89bd0a882fee87495627bd811c1f0a5459c7
- filename: package-lock.json
checksum: fd06363871d0ee16ebfb5d9d0cc479e0922a615bb76584b80bb6933ee6c3e237
- filename: CHANGELOG.md
checksum: 8522880c11ce1518b18b8760a0f5a9cdcdd2d330575f50ba6ab403b7f8f7e74f
version: "1.0"
65 changes: 56 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,66 @@
# Changelog

## [v4.0.0](https://github.com/contentstack/live-preview-sdk/compare/v4.1.0...v4.0.0)

> 20 August 2025

### New Features

- feat(VB-132 | VE-7062): disable editing when workflow stage rules restrict the same (Faraaz Biyabani - [#494](https://github.com/contentstack/live-preview-sdk/pull/494))
- feat: live preview: added outside iframe code (Mridul Sharma - [#477](https://github.com/contentstack/live-preview-sdk/pull/477))
- feat: live preview: added outside iframe code (Mridul Sharma - [#468](https://github.com/contentstack/live-preview-sdk/pull/468))

### General Changes

- Live preview outside iframe (Mridul Sharma - [#492](https://github.com/contentstack/live-preview-sdk/pull/492))

### New Features

- feat: disable editing when workflow stage rules restrict the same (Faraaz Biyabani - [7aeeb63](https://github.com/contentstack/live-preview-sdk/commit/7aeeb6381300b19f2d459ae030275c89a9f4d21f))

### Fixes

- fix: resolve new tab bugs (Mridul Sharma - [b50c43e](https://github.com/contentstack/live-preview-sdk/commit/b50c43ed14ef31de86a67bc57e346aa25c5d9679))
- fix: removed unused imports and increased the version (Mridul Sharma - [42ee5c1](https://github.com/contentstack/live-preview-sdk/commit/42ee5c1a2ef62af43ac82274e6f1809ee0be37c3))
- fix:added offset (Karan Gandhi - [55adf72](https://github.com/contentstack/live-preview-sdk/commit/55adf7291d307134d31fe2b09168fd84622426d9))
- fix: handle empty stage name correctly (Faraaz Biyabani - [472e2e6](https://github.com/contentstack/live-preview-sdk/commit/472e2e67687cf680b2276788e896d9c04f60a44f))
- fix: test case fix (Karan Gandhi - [57eb755](https://github.com/contentstack/live-preview-sdk/commit/57eb7552c19fbf731cdd18ee387acd4aba5acac8))

### Chores And Housekeeping

- chore: replace ifs with switch (Faraaz Biyabani - [5e216ea](https://github.com/contentstack/live-preview-sdk/commit/5e216ea01311dceee09405e1265190267745afc0))
- chore: updated version (Mridul Sharma - [ede97b9](https://github.com/contentstack/live-preview-sdk/commit/ede97b983727e69c5d44d8d9879d18592a47548a))
- chore: update tooltip message (Faraaz Biyabani - [c23798e](https://github.com/contentstack/live-preview-sdk/commit/c23798e0467c0a6318047ee2e4fdfeef4f74a5fd))
- chore: remove sequential from unit tests (Faraaz Biyabani - [07f3c96](https://github.com/contentstack/live-preview-sdk/commit/07f3c964950db86a2537988d53ad1b78af3f1860))

### Changes to Test Assests

- test: added new test cases for livePreviewEventManager and postMessageEvent (Mridul Sharma - [dffe855](https://github.com/contentstack/live-preview-sdk/commit/dffe8551a7de5912db6b8caf9a4d0f12b5bb384f))
- test: add cases for isFieldDisabled (Faraaz Biyabani - [10c763d](https://github.com/contentstack/live-preview-sdk/commit/10c763d51b539596e859ed7c1de4de5698715ccb))
- test: fix tests (Faraaz Biyabani - [790875a](https://github.com/contentstack/live-preview-sdk/commit/790875aef18c045f070de48f630bccdbf4cae5a9))
- test: update message (Faraaz Biyabani - [729ac76](https://github.com/contentstack/live-preview-sdk/commit/729ac763e04f82d0f848d9550bcc05458e36ba55))

### General Changes

- Merge pull request #493 from contentstack/VE-7071-apply-outline-offset-highlight-for-variant-fields-on-canvas (Karan Gandhi - [92d2bcc](https://github.com/contentstack/live-preview-sdk/commit/92d2bccc73082c80ca6f6ea8097a0cf1c1b4834b))

## [v3.4.0](https://github.com/contentstack/live-preview-sdk/compare/v3.3.0...v3.4.0)

> 6 August 2025
> 7 August 2025

### Fixes

- fix: multiple reloads in timeline (Mridul Sharma - [#484](https://github.com/contentstack/live-preview-sdk/pull/484))
- fix: removed edit icon when the click is on the container (#478) (Sahil Chalke - [#485](https://github.com/contentstack/live-preview-sdk/pull/485))
- fix: multiple reloads in timeline (Faraaz Biyabani - [#484](https://github.com/contentstack/live-preview-sdk/pull/484))
- fix: removed edit icon when the click is on the container (#478) (Faraaz Biyabani - [#485](https://github.com/contentstack/live-preview-sdk/pull/485))
- fix: removed edit icon when the click is on the container (Sahil Chalke - [#478](https://github.com/contentstack/live-preview-sdk/pull/478))
- Fix: Issue with hover toolbar click-ability (Ayush Dubey - [#467](https://github.com/contentstack/live-preview-sdk/pull/467))
- fix: modified the way we were handling fieldlocation data fetch (Sahil Chalke - [#462](https://github.com/contentstack/live-preview-sdk/pull/462))

### General Changes

- VE-6918 (Aditya Pachauri - [#487](https://github.com/contentstack/live-preview-sdk/pull/487))
- Hover Toolbar Click-ability Missed Commit (Ayush Dubey - [#482](https://github.com/contentstack/live-preview-sdk/pull/482))
- Ve 5474 clean (Sahil Chalke - [#481](https://github.com/contentstack/live-preview-sdk/pull/481))
- VE-6918 (Faraaz Biyabani - [#487](https://github.com/contentstack/live-preview-sdk/pull/487))
- Hover Toolbar Click-ability Missed Commit (Faraaz Biyabani - [#482](https://github.com/contentstack/live-preview-sdk/pull/482))
- Ve 5474 clean (Faraaz Biyabani - [#481](https://github.com/contentstack/live-preview-sdk/pull/481))

### Fixes

Expand All @@ -35,6 +80,7 @@
- chore: fieldlocation fetch completed (SahilCs15 - [bab5a47](https://github.com/contentstack/live-preview-sdk/commit/bab5a47953979af9cc5acc4fc05cbe6623caeb55))
- chore(VE-6918/error-text): unit test file added (Aditya Pachauri - [ed1c0bb](https://github.com/contentstack/live-preview-sdk/commit/ed1c0bb03bc21a92f61c63e8db6120b6b35cb17e))
- chore(VE-6918/error-text): warning message improved (Aditya Pachauri - [8122192](https://github.com/contentstack/live-preview-sdk/commit/8122192f46a29579da04ea7e7c6e0fb102a9043a))
- chore: skip tests (Faraaz Biyabani - [d470fcb](https://github.com/contentstack/live-preview-sdk/commit/d470fcb1962f26c48a7e4b71492a76b258d15cd6))
- chore(VE-6918/error-text): component name changed to title case (Aditya Pachauri - [dc3901f](https://github.com/contentstack/live-preview-sdk/commit/dc3901fafe5560b8a58f57303f934e21bbb73d98))
- chore: test fix from merge operation (Mridul Sharma - [e335877](https://github.com/contentstack/live-preview-sdk/commit/e335877c8f7d120f5f0549463f6ad1a1c81c9176))

Expand All @@ -44,6 +90,7 @@

### General Changes

- Merge pull request #488 from contentstack/stage_v3 (Karan Gandhi - [3bcf72d](https://github.com/contentstack/live-preview-sdk/commit/3bcf72dfc58525cf9c13add4302d44c0265a5401))
- redner the app on dom (SahilCs15 - [bd5095a](https://github.com/contentstack/live-preview-sdk/commit/bd5095a556930aeef55afc9de7f64d26f5e268d6))

## [v3.3.0](https://github.com/contentstack/live-preview-sdk/compare/v3.2.5...v3.3.0)
Expand Down Expand Up @@ -172,7 +219,6 @@

- v3.2.2 (Hitesh Shetty - [#435](https://github.com/contentstack/live-preview-sdk/pull/435))
- Stage v3.2.2 (Hitesh Shetty - [#433](https://github.com/contentstack/live-preview-sdk/pull/433))
- v3.2.1 (Faraaz Biyabani - [#430](https://github.com/contentstack/live-preview-sdk/pull/430))

### Fixes

Expand Down Expand Up @@ -202,15 +248,14 @@
### General Changes

- secrets-scan.yml (Aravind Kumar - [f9c5068](https://github.com/contentstack/live-preview-sdk/commit/f9c5068f3996d39aa73dcabac788950903513e32))
- policy-scan.yml (Aravind Kumar - [7ae545b](https://github.com/contentstack/live-preview-sdk/commit/7ae545b3167869dc01874c8a75ffaff118d0d00a))
- talismanrc file updated (Aravind Kumar - [8a70888](https://github.com/contentstack/live-preview-sdk/commit/8a70888d24083ff4f5f9c2878d3b94661dabbd08))
- Updated codeowners (Aravind Kumar - [86bc538](https://github.com/contentstack/live-preview-sdk/commit/86bc538fc3f1bb42f2d86cf39ae8568be94880dd))
- issues-jira.yml (Aravind Kumar - [84a292c](https://github.com/contentstack/live-preview-sdk/commit/84a292cc28491bdab4ea9ab819594de320a99e8e))
- policy-scan.yml (Aravind Kumar - [55a2765](https://github.com/contentstack/live-preview-sdk/commit/55a2765deefc7ba4ebc91e2af07496834ee3dce3))

## [v3.2.1](https://github.com/contentstack/live-preview-sdk/compare/v3.2.0...v3.2.1)

> 23 April 2025
> 24 April 2025

### Fixes

Expand All @@ -222,6 +267,7 @@

### General Changes

- v3.2.1 (Faraaz Biyabani - [#430](https://github.com/contentstack/live-preview-sdk/pull/430))
- Stage-v3.2.1 (Faraaz Biyabani - [#428](https://github.com/contentstack/live-preview-sdk/pull/428))

### Fixes
Expand All @@ -247,6 +293,7 @@
- Delete jira.yml (Aravind Kumar - [80a496c](https://github.com/contentstack/live-preview-sdk/commit/80a496c805ce52542221f9bafa11116211f24f73))
- issues-jira.yml (Aravind Kumar - [a429983](https://github.com/contentstack/live-preview-sdk/commit/a4299833949c80c274abd8af8ae81062fd78556f))
- policy-scan.yml (Aravind Kumar - [a4b69a0](https://github.com/contentstack/live-preview-sdk/commit/a4b69a07a50b0d8145122bf99b330c3b22d91e8f))
- policy-scan.yml (Aravind Kumar - [7ae545b](https://github.com/contentstack/live-preview-sdk/commit/7ae545b3167869dc01874c8a75ffaff118d0d00a))
- Delete sast-scan.yml (Aravind Kumar - [c0bffef](https://github.com/contentstack/live-preview-sdk/commit/c0bffefd3a100a96117b080bd5cd7d2f6302deea))
- Updated codeowners (Aravind Kumar - [b759727](https://github.com/contentstack/live-preview-sdk/commit/b759727225ca20ee5e4b5addb8783a87eb8bc385))
- codeql-analysis.yml (Aravind Kumar - [d90af9f](https://github.com/contentstack/live-preview-sdk/commit/d90af9f61ed6fca7f4fdfac6ad6993006ed771ea))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Alternatively, if you want to include the package directly in your website HTML

```html
<script type='module' integrity='sha384-b6G+ggU20rGxqCqsgaS6zludFgj5N11xsuXhMEIARMuQY2PtyDS04TU0H5goP+32' crossorigin="anonymous">
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@3.4.0';
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@4.0.0';

ContentstackLivePreview.init({
stackDetails: {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/live-preview-utils",
"version": "3.4.0",
"version": "4.0.0",
"description": "Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.",
"type": "module",
"types": "dist/legacy/index.d.ts",
Expand Down
13 changes: 13 additions & 0 deletions src/common/inIframe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { hasWindow } from "../utils";

export function inIframe(): boolean {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}

export function isOpeningInNewTab(): boolean {
try {
if(hasWindow()) {
return !!window.opener;
}
return false;
} catch (e) {
return false;
}
}
4 changes: 2 additions & 2 deletions src/livePreview/editButton/editButton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { effect } from "@preact/signals";
import { inIframe } from "../../common/inIframe";
import { inIframe, isOpeningInNewTab } from "../../common/inIframe";
import Config from "../../configManager/configManager";
import { addCslpOutline, extractDetailsFromCslp } from "../../cslp";
import { cslpTagStyles } from "./editButton.style";
Expand Down Expand Up @@ -448,7 +448,7 @@ export class LivePreviewEditButton {
fieldPathWithIndex,
} = extractDetailsFromCslp(cslpTag);

if (inIframe()) {
if (inIframe() || isOpeningInNewTab()) {
livePreviewPostMessage?.send("scroll", {
field: fieldPathWithIndex,
content_type_uid,
Expand Down
Loading
Loading