Skip to content

Commit 4e8d5e8

Browse files
authored
Merge branch 'develop_v4' into VB-248-dev
2 parents 07ffb6e + 14b1f37 commit 4e8d5e8

File tree

20 files changed

+857
-38
lines changed

20 files changed

+857
-38
lines changed

.talismanrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ fileignoreconfig:
44
- filecontent
55
- filename: README.md
66
checksum: 568289bbe7c088967493db246dbf29e465382648ac574c1b1236be57d5662a38
7-
- filename: CHANGELOG.md
8-
checksum: 8e2495db48ed58704b0883b052c5d44b9f1a96cff7556235f924d16a47442688
97
- filename: src/visualBuilder/components/__test__/fieldToolbar.test.tsx
108
checksum: 3badd6a142456b6a361569e6fc546349a38ac6b366bef7fd5255d1e93220444e
119
- filename: src/visualBuilder/components/Collab/ThreadPopup/__test__/CommentTextArea.test.tsx
@@ -14,4 +12,6 @@ fileignoreconfig:
1412
checksum: fd06363871d0ee16ebfb5d9d0cc479e0922a615bb76584b80bb6933ee6c3e237
1513
- filename: src/visualBuilder/utils/__test__/handleFieldMouseDown.test.ts
1614
checksum: dc20802eab76834de7aadb797b14076f1f1a9c0662b32493563fe68fd5cd6e16
15+
- filename: CHANGELOG.md
16+
checksum: 873106e25dafe0355c55724936cfe0ecc9d0192a2a82c98eddaf5648f23d5ee7
1717
version: "1.0"

CHANGELOG.md

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

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

5-
> 6 August 2025
60+
> 7 August 2025
661
762
### Fixes
863

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))
64+
- fix: multiple reloads in timeline (Faraaz Biyabani - [#484](https://github.com/contentstack/live-preview-sdk/pull/484))
65+
- fix: removed edit icon when the click is on the container (#478) (Faraaz Biyabani - [#485](https://github.com/contentstack/live-preview-sdk/pull/485))
66+
- fix: removed edit icon when the click is on the container (Sahil Chalke - [#478](https://github.com/contentstack/live-preview-sdk/pull/478))
1167
- Fix: Issue with hover toolbar click-ability (Ayush Dubey - [#467](https://github.com/contentstack/live-preview-sdk/pull/467))
1268
- fix: modified the way we were handling fieldlocation data fetch (Sahil Chalke - [#462](https://github.com/contentstack/live-preview-sdk/pull/462))
1369

1470
### General Changes
1571

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))
72+
- VE-6918 (Faraaz Biyabani - [#487](https://github.com/contentstack/live-preview-sdk/pull/487))
73+
- Hover Toolbar Click-ability Missed Commit (Faraaz Biyabani - [#482](https://github.com/contentstack/live-preview-sdk/pull/482))
74+
- Ve 5474 clean (Faraaz Biyabani - [#481](https://github.com/contentstack/live-preview-sdk/pull/481))
1975

2076
### Fixes
2177

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

@@ -44,6 +101,7 @@
44101

45102
### General Changes
46103

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

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

173231
- v3.2.2 (Hitesh Shetty - [#435](https://github.com/contentstack/live-preview-sdk/pull/435))
174232
- 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))
176233

177234
### Fixes
178235

@@ -202,15 +259,14 @@
202259
### General Changes
203260

204261
- 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))
206262
- talismanrc file updated (Aravind Kumar - [8a70888](https://github.com/contentstack/live-preview-sdk/commit/8a70888d24083ff4f5f9c2878d3b94661dabbd08))
207263
- Updated codeowners (Aravind Kumar - [86bc538](https://github.com/contentstack/live-preview-sdk/commit/86bc538fc3f1bb42f2d86cf39ae8568be94880dd))
208264
- issues-jira.yml (Aravind Kumar - [84a292c](https://github.com/contentstack/live-preview-sdk/commit/84a292cc28491bdab4ea9ab819594de320a99e8e))
209265
- policy-scan.yml (Aravind Kumar - [55a2765](https://github.com/contentstack/live-preview-sdk/commit/55a2765deefc7ba4ebc91e2af07496834ee3dce3))
210266

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

213-
> 23 April 2025
269+
> 24 April 2025
214270
215271
### Fixes
216272

@@ -222,6 +278,7 @@
222278

223279
### General Changes
224280

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

227284
### Fixes
@@ -247,6 +304,7 @@
247304
- Delete jira.yml (Aravind Kumar - [80a496c](https://github.com/contentstack/live-preview-sdk/commit/80a496c805ce52542221f9bafa11116211f24f73))
248305
- issues-jira.yml (Aravind Kumar - [a429983](https://github.com/contentstack/live-preview-sdk/commit/a4299833949c80c274abd8af8ae81062fd78556f))
249306
- policy-scan.yml (Aravind Kumar - [a4b69a0](https://github.com/contentstack/live-preview-sdk/commit/a4b69a07a50b0d8145122bf99b330c3b22d91e8f))
307+
- policy-scan.yml (Aravind Kumar - [7ae545b](https://github.com/contentstack/live-preview-sdk/commit/7ae545b3167869dc01874c8a75ffaff118d0d00a))
250308
- Delete sast-scan.yml (Aravind Kumar - [c0bffef](https://github.com/contentstack/live-preview-sdk/commit/c0bffefd3a100a96117b080bd5cd7d2f6302deea))
251309
- Updated codeowners (Aravind Kumar - [b759727](https://github.com/contentstack/live-preview-sdk/commit/b759727225ca20ee5e4b5addb8783a87eb8bc385))
252310
- 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.1';
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.1",
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)