Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ jobs:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --fail-on=all
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
"default": "./dist/modern/index.cjs"
}
},
"./purged": {
"import": {
"types": "./dist/modern/index.purged.d.ts",
"default": "./dist/modern/index.purged.js"
},
"require": {
"types": "./dist/modern/index.purged.d.cts",
"default": "./dist/modern/index.purged.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
Expand Down
12 changes: 12 additions & 0 deletions src/index.purged.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this now?

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Purged entry: only the light SDK. Use this via resolve.alias in production
* to exclude the full SDK (edit button, Visual Builder) from the bundle.
* Same API as the main entry; no full HOC or DOM side effects.
*/
import { IStackSdk as ExternalStackSdkType } from "./types/types";
import LightLivePreviewHoC from "./light-sdk";

export type IStackSdk = ExternalStackSdkType;

export const VB_EmptyBlockParentClass = "visual-builder__empty-block-parent";
export default LightLivePreviewHoC;
6 changes: 6 additions & 0 deletions src/livePreview/editButton/editButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,12 @@ effect(function handleWindowTypeChange() {
// we need to specify when to run this effect.
// here, we run it when the value of windowType changes
if (typeof window === "undefined") return;
if (
typeof process !== "undefined" &&
(process?.env?.PURGE_PREVIEW_SDK === "true" ||
process?.env?.REACT_APP_PURGE_PREVIEW_SDK === "true")
)
return;
Config.get().windowType;
if (LivePreviewEditButton && !isOpeningInTimeline()) {
toggleEditButtonElement();
Expand Down
Loading