Skip to content

Commit d1a0246

Browse files
authored
Merge pull request #495 from contentstack/21st-august-2025-release
21st august 2025 release
2 parents 3bcf72d + 4686298 commit d1a0246

35 files changed

+1789
-357
lines changed

.talismanrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ fileignoreconfig:
1212
checksum: d0ef271ee5381d9feab06bda6e7e89bd0a882fee87495627bd811c1f0a5459c7
1313
- filename: package-lock.json
1414
checksum: fd06363871d0ee16ebfb5d9d0cc479e0922a615bb76584b80bb6933ee6c3e237
15+
- filename: CHANGELOG.md
16+
checksum: 8522880c11ce1518b18b8760a0f5a9cdcdd2d330575f50ba6ab403b7f8f7e74f
1517
version: "1.0"

CHANGELOG.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,66 @@
11
# Changelog
22

3+
## [v4.0.0](https://github.com/contentstack/live-preview-sdk/compare/v4.1.0...v4.0.0)
4+
5+
> 20 August 2025
6+
7+
### New Features
8+
9+
- 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))
10+
- feat: live preview: added outside iframe code (Mridul Sharma - [#477](https://github.com/contentstack/live-preview-sdk/pull/477))
11+
- feat: live preview: added outside iframe code (Mridul Sharma - [#468](https://github.com/contentstack/live-preview-sdk/pull/468))
12+
13+
### General Changes
14+
15+
- Live preview outside iframe (Mridul Sharma - [#492](https://github.com/contentstack/live-preview-sdk/pull/492))
16+
17+
### New Features
18+
19+
- feat: disable editing when workflow stage rules restrict the same (Faraaz Biyabani - [7aeeb63](https://github.com/contentstack/live-preview-sdk/commit/7aeeb6381300b19f2d459ae030275c89a9f4d21f))
20+
21+
### Fixes
22+
23+
- fix: resolve new tab bugs (Mridul Sharma - [b50c43e](https://github.com/contentstack/live-preview-sdk/commit/b50c43ed14ef31de86a67bc57e346aa25c5d9679))
24+
- fix: removed unused imports and increased the version (Mridul Sharma - [42ee5c1](https://github.com/contentstack/live-preview-sdk/commit/42ee5c1a2ef62af43ac82274e6f1809ee0be37c3))
25+
- fix:added offset (Karan Gandhi - [55adf72](https://github.com/contentstack/live-preview-sdk/commit/55adf7291d307134d31fe2b09168fd84622426d9))
26+
- fix: handle empty stage name correctly (Faraaz Biyabani - [472e2e6](https://github.com/contentstack/live-preview-sdk/commit/472e2e67687cf680b2276788e896d9c04f60a44f))
27+
- fix: test case fix (Karan Gandhi - [57eb755](https://github.com/contentstack/live-preview-sdk/commit/57eb7552c19fbf731cdd18ee387acd4aba5acac8))
28+
29+
### Chores And Housekeeping
30+
31+
- chore: replace ifs with switch (Faraaz Biyabani - [5e216ea](https://github.com/contentstack/live-preview-sdk/commit/5e216ea01311dceee09405e1265190267745afc0))
32+
- chore: updated version (Mridul Sharma - [ede97b9](https://github.com/contentstack/live-preview-sdk/commit/ede97b983727e69c5d44d8d9879d18592a47548a))
33+
- chore: update tooltip message (Faraaz Biyabani - [c23798e](https://github.com/contentstack/live-preview-sdk/commit/c23798e0467c0a6318047ee2e4fdfeef4f74a5fd))
34+
- chore: remove sequential from unit tests (Faraaz Biyabani - [07f3c96](https://github.com/contentstack/live-preview-sdk/commit/07f3c964950db86a2537988d53ad1b78af3f1860))
35+
36+
### Changes to Test Assests
37+
38+
- test: added new test cases for livePreviewEventManager and postMessageEvent (Mridul Sharma - [dffe855](https://github.com/contentstack/live-preview-sdk/commit/dffe8551a7de5912db6b8caf9a4d0f12b5bb384f))
39+
- test: add cases for isFieldDisabled (Faraaz Biyabani - [10c763d](https://github.com/contentstack/live-preview-sdk/commit/10c763d51b539596e859ed7c1de4de5698715ccb))
40+
- test: fix tests (Faraaz Biyabani - [790875a](https://github.com/contentstack/live-preview-sdk/commit/790875aef18c045f070de48f630bccdbf4cae5a9))
41+
- test: update message (Faraaz Biyabani - [729ac76](https://github.com/contentstack/live-preview-sdk/commit/729ac763e04f82d0f848d9550bcc05458e36ba55))
42+
43+
### General Changes
44+
45+
- 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))
46+
347
## [v3.4.0](https://github.com/contentstack/live-preview-sdk/compare/v3.3.0...v3.4.0)
448

5-
> 6 August 2025
49+
> 7 August 2025
650
751
### Fixes
852

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

1459
### General Changes
1560

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

2065
### Fixes
2166

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

@@ -44,6 +90,7 @@
4490

4591
### General Changes
4692

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

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

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

177223
### Fixes
178224

@@ -202,15 +248,14 @@
202248
### General Changes
203249

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

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

213-
> 23 April 2025
258+
> 24 April 2025
214259
215260
### Fixes
216261

@@ -222,6 +267,7 @@
222267

223268
### General Changes
224269

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

227273
### Fixes
@@ -247,6 +293,7 @@
247293
- Delete jira.yml (Aravind Kumar - [80a496c](https://github.com/contentstack/live-preview-sdk/commit/80a496c805ce52542221f9bafa11116211f24f73))
248294
- issues-jira.yml (Aravind Kumar - [a429983](https://github.com/contentstack/live-preview-sdk/commit/a4299833949c80c274abd8af8ae81062fd78556f))
249295
- policy-scan.yml (Aravind Kumar - [a4b69a0](https://github.com/contentstack/live-preview-sdk/commit/a4b69a07a50b0d8145122bf99b330c3b22d91e8f))
296+
- policy-scan.yml (Aravind Kumar - [7ae545b](https://github.com/contentstack/live-preview-sdk/commit/7ae545b3167869dc01874c8a75ffaff118d0d00a))
250297
- Delete sast-scan.yml (Aravind Kumar - [c0bffef](https://github.com/contentstack/live-preview-sdk/commit/c0bffefd3a100a96117b080bd5cd7d2f6302deea))
251298
- Updated codeowners (Aravind Kumar - [b759727](https://github.com/contentstack/live-preview-sdk/commit/b759727225ca20ee5e4b5addb8783a87eb8bc385))
252299
- codeql-analysis.yml (Aravind Kumar - [d90af9f](https://github.com/contentstack/live-preview-sdk/commit/d90af9f61ed6fca7f4fdfac6ad6993006ed771ea))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Alternatively, if you want to include the package directly in your website HTML
1616

1717
```html
1818
<script type='module' integrity='sha384-b6G+ggU20rGxqCqsgaS6zludFgj5N11xsuXhMEIARMuQY2PtyDS04TU0H5goP+32' crossorigin="anonymous">
19-
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@3.4.0';
19+
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@4.0.0';
2020
2121
ContentstackLivePreview.init({
2222
stackDetails: {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/live-preview-utils",
3-
"version": "3.4.0",
3+
"version": "4.0.0",
44
"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.",
55
"type": "module",
66
"types": "dist/legacy/index.d.ts",

src/common/inIframe.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
import { hasWindow } from "../utils";
2+
13
export function inIframe(): boolean {
24
try {
35
return window.self !== window.top;
46
} catch (e) {
57
return true;
68
}
79
}
10+
11+
export function isOpeningInNewTab(): boolean {
12+
try {
13+
if(hasWindow()) {
14+
return !!window.opener;
15+
}
16+
return false;
17+
} catch (e) {
18+
return false;
19+
}
20+
}

src/livePreview/editButton/editButton.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { effect } from "@preact/signals";
2-
import { inIframe } from "../../common/inIframe";
2+
import { inIframe, isOpeningInNewTab } from "../../common/inIframe";
33
import Config from "../../configManager/configManager";
44
import { addCslpOutline, extractDetailsFromCslp } from "../../cslp";
55
import { cslpTagStyles } from "./editButton.style";
@@ -448,7 +448,7 @@ export class LivePreviewEditButton {
448448
fieldPathWithIndex,
449449
} = extractDetailsFromCslp(cslpTag);
450450

451-
if (inIframe()) {
451+
if (inIframe() || isOpeningInNewTab()) {
452452
livePreviewPostMessage?.send("scroll", {
453453
field: fieldPathWithIndex,
454454
content_type_uid,

0 commit comments

Comments
 (0)