@orion-studios/payload-studio 0.6.0-beta.162 → 0.6.0-beta.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2592,7 +2592,7 @@ function GrapesPageEditor({
2592
2592
  selectedComponentRef.current = selected;
2593
2593
  lastSelectedComponentRef.current = selected;
2594
2594
  selected.addClass?.("orion-builder-v2-has-negative-padding");
2595
- selected.addStyle?.({ [property]: "0px", [variable]: styleValue });
2595
+ selected.addStyle?.({ [variable]: styleValue });
2596
2596
  editorRef.current?.select?.(selected);
2597
2597
  };
2598
2598
  const updateSelectedOrionBlock = (updates) => {
@@ -3654,6 +3654,19 @@ function GrapesPageEditor({
3654
3654
  (0, import_react.useEffect)(() => {
3655
3655
  saveRef.current = save;
3656
3656
  }, [saving]);
3657
+ (0, import_react.useEffect)(() => {
3658
+ const onBeforeUnload = (event) => {
3659
+ if (!isDirty) {
3660
+ return;
3661
+ }
3662
+ event.preventDefault();
3663
+ event.returnValue = "";
3664
+ };
3665
+ window.addEventListener("beforeunload", onBeforeUnload);
3666
+ return () => {
3667
+ window.removeEventListener("beforeunload", onBeforeUnload);
3668
+ };
3669
+ }, [isDirty]);
3657
3670
  (0, import_react.useEffect)(() => {
3658
3671
  decorateBuilderControls();
3659
3672
  const refreshControls = () => refreshSelectedState(selectedComponentRef.current);
@@ -2468,7 +2468,7 @@ function GrapesPageEditor({
2468
2468
  selectedComponentRef.current = selected;
2469
2469
  lastSelectedComponentRef.current = selected;
2470
2470
  selected.addClass?.("orion-builder-v2-has-negative-padding");
2471
- selected.addStyle?.({ [property]: "0px", [variable]: styleValue });
2471
+ selected.addStyle?.({ [variable]: styleValue });
2472
2472
  editorRef.current?.select?.(selected);
2473
2473
  };
2474
2474
  const updateSelectedOrionBlock = (updates) => {
@@ -3530,6 +3530,19 @@ function GrapesPageEditor({
3530
3530
  useEffect(() => {
3531
3531
  saveRef.current = save;
3532
3532
  }, [saving]);
3533
+ useEffect(() => {
3534
+ const onBeforeUnload = (event) => {
3535
+ if (!isDirty) {
3536
+ return;
3537
+ }
3538
+ event.preventDefault();
3539
+ event.returnValue = "";
3540
+ };
3541
+ window.addEventListener("beforeunload", onBeforeUnload);
3542
+ return () => {
3543
+ window.removeEventListener("beforeunload", onBeforeUnload);
3544
+ };
3545
+ }, [isDirty]);
3533
3546
  useEffect(() => {
3534
3547
  decorateBuilderControls();
3535
3548
  const refreshControls = () => refreshSelectedState(selectedComponentRef.current);
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  admin_exports
3
3
  } from "./chunk-KHK6RTGC.mjs";
4
+ import {
5
+ blocks_exports
6
+ } from "./chunk-JQAHXYAM.mjs";
4
7
  import {
5
8
  nextjs_exports
6
9
  } from "./chunk-ZADL33R6.mjs";
7
10
  import "./chunk-ZTXJG4K5.mjs";
8
- import {
9
- blocks_exports
10
- } from "./chunk-JQAHXYAM.mjs";
11
11
  import {
12
12
  studio_pages_exports
13
- } from "./chunk-276KAPGM.mjs";
14
- import "./chunk-7ZMXZRBP.mjs";
13
+ } from "./chunk-NGLIA2OE.mjs";
15
14
  import "./chunk-OQSEJXC4.mjs";
15
+ import "./chunk-7ZMXZRBP.mjs";
16
16
  import {
17
17
  studio_exports
18
18
  } from "./chunk-ADIIWIYL.mjs";
@@ -7,14 +7,14 @@ import {
7
7
  pageStudioModuleManifest,
8
8
  resolveBuilderThemeTokens,
9
9
  toEditorInitialDoc
10
- } from "../chunk-276KAPGM.mjs";
10
+ } from "../chunk-NGLIA2OE.mjs";
11
+ import "../chunk-OQSEJXC4.mjs";
11
12
  import {
12
13
  createDefaultStudioDocument,
13
14
  defaultBuilderThemeTokens,
14
15
  layoutToStudioDocument,
15
16
  studioDocumentToLayout
16
17
  } from "../chunk-7ZMXZRBP.mjs";
17
- import "../chunk-OQSEJXC4.mjs";
18
18
  import "../chunk-ADIIWIYL.mjs";
19
19
  import "../chunk-6BWS3CLP.mjs";
20
20
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.162",
3
+ "version": "0.6.0-beta.163",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -1,3 +1,6 @@
1
+ import {
2
+ sectionStyleDefaults
3
+ } from "./chunk-OQSEJXC4.mjs";
1
4
  import {
2
5
  createDefaultStudioDocument,
3
6
  defaultBuilderThemeTokens,
@@ -5,9 +8,6 @@ import {
5
8
  migrateBlockToSettingsV2,
6
9
  studioDocumentToLayout
7
10
  } from "./chunk-7ZMXZRBP.mjs";
8
- import {
9
- sectionStyleDefaults
10
- } from "./chunk-OQSEJXC4.mjs";
11
11
  import {
12
12
  assertStudioDocumentV1,
13
13
  compileStudioDocument,