Skip to content

Commit 269b852

Browse files
Merge branch 'main' into VE-5279-onchange-when-live-preview-parameter-is-present
2 parents 98562c7 + 175e25b commit 269b852

16 files changed

Lines changed: 587 additions & 78 deletions

File tree

CHANGELOG.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,100 @@
11
# Changelog
22

3+
## [v3.1.2](https://github.com/contentstack/live-preview-sdk/compare/v3.1.1...v3.1.2)
4+
5+
> 3 March 2025
6+
7+
### New Features
8+
9+
- feat: improve edit button rendering (Faraaz Biyabani - [#371](https://github.com/contentstack/live-preview-sdk/pull/371))
10+
- feat(VE-5170): add plus button configuration (Sairaj - [#349](https://github.com/contentstack/live-preview-sdk/pull/349))
11+
- feat: allow click on elements with studio-ui attribute (Faraaz Biyabani - [#355](https://github.com/contentstack/live-preview-sdk/pull/355))
12+
- feat(VE-4043): add start editing button configuration for builder mode (Sairaj - [#346](https://github.com/contentstack/live-preview-sdk/pull/346))
13+
14+
### Fixes
15+
16+
- fix(VE-5118): add variant revert actions for blocks and groups (srinad007 - [#372](https://github.com/contentstack/live-preview-sdk/pull/372))
17+
- fix(VE-5370): start edit url updates on navigation (Sairaj - [#370](https://github.com/contentstack/live-preview-sdk/pull/370))
18+
- fix: add buttons fix for multiple fields (Sairaj - [#359](https://github.com/contentstack/live-preview-sdk/pull/359))
19+
- fix(VE-5061): add observer to observe cslp of selected element (srinad007 - [#356](https://github.com/contentstack/live-preview-sdk/pull/356))
20+
- fix(VE-5012): add variant classes in case of adding multiple instances (srinad007 - [#351](https://github.com/contentstack/live-preview-sdk/pull/351))
21+
- fix(VE-5080): fix z-index for hover outline and add button (srinad007 - [#341](https://github.com/contentstack/live-preview-sdk/pull/341))
22+
23+
### Documentation Changes
24+
25+
- docs: add docs for start edit button configuration (Sairaj - [#376](https://github.com/contentstack/live-preview-sdk/pull/376))
26+
27+
### General Changes
28+
29+
- Ve 5139 (srinad007 - [#343](https://github.com/contentstack/live-preview-sdk/pull/343))
30+
- sync main for upcoming release (Hitesh Shetty - [#338](https://github.com/contentstack/live-preview-sdk/pull/338))
31+
32+
### New Features
33+
34+
- feat(VE-5170): customize add button position (Sairaj Chouhan - [4c026eb](https://github.com/contentstack/live-preview-sdk/commit/4c026eb5b6db4aa2a79d1a0e34922619c79fb3f1))
35+
- feat(VE-4043): add basic start editing button configuration (Sairaj Chouhan - [c006c68](https://github.com/contentstack/live-preview-sdk/commit/c006c684a349e958208bdd0ea6e14fb05cbabc7b))
36+
- feat: allow clicks on elements with data-studio-ui attribute set to true (Faraaz Biyabani - [957bae1](https://github.com/contentstack/live-preview-sdk/commit/957bae138622e63dfcdd849746e0327884d07747))
37+
38+
### Fixes
39+
40+
- fix(VE-5061): refactor handleBuilderInteraction (Srinadh Reddy - [bd71fb4](https://github.com/contentstack/live-preview-sdk/commit/bd71fb42970f6320330626b92dbd918cf80ea5d5))
41+
- fix(VE-5139): fix test cases (Srinadh Reddy - [2a29a81](https://github.com/contentstack/live-preview-sdk/commit/2a29a81d187117e9f86b1e2c2348414159c45afb))
42+
- fix(VE-5139): fix event doesnt exist logs in console (Srinadh Reddy - [89ca3d8](https://github.com/contentstack/live-preview-sdk/commit/89ca3d8e4522dd7644769968efdb17b28d4f39b5))
43+
- fix(VE-5118): fix unit test cases (Srinadh Reddy - [9d5b24a](https://github.com/contentstack/live-preview-sdk/commit/9d5b24a6e406bf49c8126a3fae111af7eb17b0ab))
44+
45+
### Chores And Housekeeping
46+
47+
- chore: remove else block (Sairaj Chouhan - [834c3e7](https://github.com/contentstack/live-preview-sdk/commit/834c3e78250f36b32e21c948bda313818f0db7bc))
48+
- chore: remove `describe.only` (Faraaz Biyabani - [5aa5958](https://github.com/contentstack/live-preview-sdk/commit/5aa59587217ff7f64d495240f9e252bcf5b60a9c))
49+
- chore: update ContentstackLivePreview version to 3.1.1 in README (hiteshshetty-dev - [d885fa5](https://github.com/contentstack/live-preview-sdk/commit/d885fa5f65ef32e22bfb86fa3871238bdec02d61))
50+
51+
### Changes to Test Assests
52+
53+
- test: isPointerWithinEditButtonSafeZone (Faraaz Biyabani - [3c340e8](https://github.com/contentstack/live-preview-sdk/commit/3c340e8ce52d768f06fbb6b2050ab541a6ac47cb))
54+
- test: add tests for start editing button in builder (Sairaj Chouhan - [f9988a7](https://github.com/contentstack/live-preview-sdk/commit/f9988a74ed9416cc99ce30ed9f3d25314f7eef5c))
55+
- test: increase timeout for contenteditable tests (Sairaj Chouhan - [66fee50](https://github.com/contentstack/live-preview-sdk/commit/66fee50387f0a8a9b0ec61b945bec00418dc34f9))
56+
57+
### General Changes
58+
59+
- Update README.md (Hitesh Shetty - [66ef1f1](https://github.com/contentstack/live-preview-sdk/commit/66ef1f1d863d5f252172a427c1851a08372433f8))
60+
61+
## [v3.1.1](https://github.com/contentstack/live-preview-sdk/compare/v3.1.0...v3.1.1)
62+
63+
> 3 February 2025
64+
65+
### Fixes
66+
67+
- fix: remove ^ from preact versions in package json (Hitesh Shetty - [#337](https://github.com/contentstack/live-preview-sdk/pull/337))
68+
- fix(VE-5019): remove ^ from preact versions in package json (Hitesh Shetty - [#336](https://github.com/contentstack/live-preview-sdk/pull/336))
69+
70+
### Refactoring and Updates
71+
72+
- refactor: replace hardcoded class names with constants for empty block parent (Hitesh Shetty - [#331](https://github.com/contentstack/live-preview-sdk/pull/331))
73+
74+
### Changes to Test Assests
75+
76+
- test: add unit tests for error handling and field state validation in visual builder (Hitesh Shetty - [#329](https://github.com/contentstack/live-preview-sdk/pull/329))
77+
78+
### Fixes
79+
80+
- fix: live preview doc (Kirtesh Suthar - [8fcdcc5](https://github.com/contentstack/live-preview-sdk/commit/8fcdcc5127ea722bd9c01f74b1168d9f579e5f30))
81+
82+
### Changes to Test Assests
83+
84+
- test: remove skipped number field tests and add validation for numeric input (hiteshshetty-dev - [ba0062e](https://github.com/contentstack/live-preview-sdk/commit/ba0062e6c9a5769d124707d6f02e7956a083acb2))
85+
- test: wrap attribute checks in waitFor for visual builder tests (hiteshshetty-dev - [a7a0d53](https://github.com/contentstack/live-preview-sdk/commit/a7a0d5382eab40e84b94699a43a479277808f35c))
86+
87+
### General Changes
88+
89+
- Updated codeowners (Aravind Kumar - [fe41624](https://github.com/contentstack/live-preview-sdk/commit/fe41624a179035f8ed8a2f9ee88c65c958edd29b))
90+
- codeql-analysis.yml (Aravind Kumar - [45c63a2](https://github.com/contentstack/live-preview-sdk/commit/45c63a2e2fbd8fd162520b8e2208fa19e864b3e8))
91+
- sast-scan.yml (Aravind Kumar - [8971dfb](https://github.com/contentstack/live-preview-sdk/commit/8971dfbe798ae4e7d036b86ee30b4b120cf8a6ea))
92+
- jira.yml (Aravind Kumar - [30e4861](https://github.com/contentstack/live-preview-sdk/commit/30e4861e33d5f7c89cffef109e50aa811f6b346a))
93+
- sca-scan.yml (Aravind Kumar - [bcb5ca8](https://github.com/contentstack/live-preview-sdk/commit/bcb5ca8a3a820fab6199166882ae80e8438a074d))
94+
395
## [v3.1.0](https://github.com/contentstack/live-preview-sdk/compare/v3.0.2...v3.1.0)
496

5-
> 10 January 2025
97+
> 16 January 2025
698
799
### New Features
8100

@@ -19,6 +111,7 @@
19111

20112
### General Changes
21113

114+
- 3.1.0 (Kirtesh Suthar - [#323](https://github.com/contentstack/live-preview-sdk/pull/323))
22115
- Feat/auto changelog (Kirtesh Suthar - [#321](https://github.com/contentstack/live-preview-sdk/pull/321))
23116

24117
### New Features
@@ -29,6 +122,7 @@
29122
### Fixes
30123

31124
- fix: issue with variant revert dropdown in canvas and show variant icon for multiple fields (Srinadh Reddy - [8718c48](https://github.com/contentstack/live-preview-sdk/commit/8718c4832f30606437da1fd18513006f21e0fd34))
125+
- fix: live preview doc (Kirtesh Suthar - [f81fdf5](https://github.com/contentstack/live-preview-sdk/commit/f81fdf55fd2ab2ce4cac3bf974b0a31566c24001))
32126

33127
### Chores And Housekeeping
34128

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ npm install @contentstack/live-preview-utils
1515
Alternatively, if you want to include the package directly in your website HTML code, use the following command:
1616

1717
```html
18-
<script type='module' integrity='sha384-9M4o9H23Ax5ZTzsMRLgdlFBYk2hy+ub6XDiZhHWJjfebQ+MZ9iZw+GNep9ac0uFV' crossorigin="anonymous">
19-
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@3.1.0';
18+
<script type='module' integrity='sha384-LQQFdnInqHR0YPq3ypmbejKtYGi+kb43FlR7STQHgZtSrkLXPrN1eovxsdlxofuL' crossorigin="anonymous">
19+
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@3.1.2';
2020
2121
ContentstackLivePreview.init({
2222
stackDetails: {
@@ -51,7 +51,7 @@ ContentstackLivePreview.init({
5151

5252
MIT License
5353

54-
Copyright © 2025 [Contentstack](https://www.contentstack.com/). All Rights Reserved
54+
Copyright © 2024 [Contentstack](https://www.contentstack.com/). All Rights Reserved
5555

5656
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5757

docs/live-preview-configs.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,27 @@ ContentstackLivePreview.init({
124124
});
125125
```
126126

127+
### `editInVisualBuilderButton`
128+
the editInVisualBuilderButton object allows you to manage the "Start Editing" button outside Visual Builder. It offers the following features:
129+
- Enable/disable the "Start Editing" button
130+
- Adjust the position of the "Start Editing" button using four predefined positions
131+
132+
The editInVisualBuilderButton object contains two keys:
133+
134+
1. #### `enable`
135+
| type | default | optional |
136+
| ------- | ------- | -------- |
137+
| boolean | true | yes |
138+
139+
This key lets you specify whether you want to display the “Start Editing” button or not. It is of type “Boolean” with value true/false.
140+
2. #### `position`
141+
| type | default | optional |
142+
| ------- | ------- | -------- |
143+
| string | bottom-right | yes |
144+
145+
The user can place the "Start Editing" button in four predefined positions
146+
top-left, top-right, bottom-left, and bottom-right.
147+
127148
### `cleanCslpOnProduction`
128149

129150
| type | default | optional |

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.1.0",
3+
"version": "3.1.2",
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/configManager/config.default.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function getUserInitData(): IInitData {
1616
position: "top",
1717
includeByQueryParameter: true,
1818
},
19-
editButtonBuilder: {
19+
editInVisualBuilderButton: {
2020
enable: true,
2121
position: "bottom-right"
2222
},
@@ -54,7 +54,7 @@ export function getDefaultConfig(): IConfig {
5454
position: "top",
5555
includeByQueryParameter: true,
5656
},
57-
editButtonBuilder: {
57+
editInVisualBuilderButton: {
5858
enable: true,
5959
position: "bottom-right"
6060
},

src/configManager/handleUserConfig.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ export const handleInitData = (initData: Partial<IInitData>): void => {
109109
true,
110110
});
111111

112-
Config.set("editButtonBuilder", {
112+
Config.set("editInVisualBuilderButton", {
113113
enable:
114-
initData.editButtonBuilder?.enable ??
115-
stackSdk.live_preview?.editButtonBuilder?.enable ??
116-
config.editButtonBuilder.enable,
114+
initData.editInVisualBuilderButton?.enable ??
115+
stackSdk.live_preview?.editInVisualBuilderButton?.enable ??
116+
config.editInVisualBuilderButton.enable,
117117
position:
118-
initData.editButtonBuilder?.position ??
118+
initData.editInVisualBuilderButton?.position ??
119119
stackSdk.live_preview?.position ??
120-
config.editButtonBuilder.position ??
120+
config.editInVisualBuilderButton.position ??
121121
"bottom-right",
122122
})
123123

0 commit comments

Comments
 (0)