Skip to content

Commit 175e25b

Browse files
authored
Merge pull request #381 from contentstack/stage_v3
feat: v3.1.2
2 parents 3afb9eb + 0ab602c commit 175e25b

24 files changed

Lines changed: 972 additions & 136 deletions

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
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+
361
## [v3.1.1](https://github.com/contentstack/live-preview-sdk/compare/v3.1.0...v3.1.1)
462

563
> 3 February 2025

README.md

Lines changed: 2 additions & 2 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.1';
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: {

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.1",
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export function getUserInitData(): IInitData {
1616
position: "top",
1717
includeByQueryParameter: true,
1818
},
19+
editInVisualBuilderButton: {
20+
enable: true,
21+
position: "bottom-right"
22+
},
1923

2024
mode: "preview",
2125

@@ -50,6 +54,10 @@ export function getDefaultConfig(): IConfig {
5054
position: "top",
5155
includeByQueryParameter: true,
5256
},
57+
editInVisualBuilderButton: {
58+
enable: true,
59+
position: "bottom-right"
60+
},
5361

5462
hash: "",
5563
mode: 1,

src/configManager/handleUserConfig.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ export const handleInitData = (initData: Partial<IInitData>): void => {
108108
config.editButton.includeByQueryParameter ??
109109
true,
110110
});
111+
112+
Config.set("editInVisualBuilderButton", {
113+
enable:
114+
initData.editInVisualBuilderButton?.enable ??
115+
stackSdk.live_preview?.editInVisualBuilderButton?.enable ??
116+
config.editInVisualBuilderButton.enable,
117+
position:
118+
initData.editInVisualBuilderButton?.position ??
119+
stackSdk.live_preview?.position ??
120+
config.editInVisualBuilderButton.position ??
121+
"bottom-right",
122+
})
111123

112124
// client URL params
113125
handleClientUrlParams(

0 commit comments

Comments
 (0)