@orion-studios/payload-studio 0.6.0-beta.158 → 0.6.0-beta.159

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.
@@ -1429,7 +1429,11 @@ var decorateBuilderNumericSteppers = (root = document) => {
1429
1429
  input.dataset.orionRawValue = nextValue2;
1430
1430
  const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
1431
1431
  input.setSelectionRange(nextCursor2, nextCursor2);
1432
- input.dispatchEvent(new InputEvent("input", { bubbles: true, inputType: "insertText" }));
1432
+ window.dispatchEvent(
1433
+ new CustomEvent("orion-builder-v2-negative-padding-input", {
1434
+ detail: { property, value: nextValue2 }
1435
+ })
1436
+ );
1433
1437
  return;
1434
1438
  }
1435
1439
  if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
@@ -2551,6 +2555,19 @@ function GrapesPageEditor({
2551
2555
  );
2552
2556
  editorRef.current?.select?.(selected);
2553
2557
  };
2558
+ const applyNegativePaddingInput = (property, value) => {
2559
+ const negativePaddingMargin = negativePaddingMarginProperty(property);
2560
+ const selected = getCurrentOrionBlockTarget(getCurrentStyleTarget());
2561
+ if (!selected || !negativePaddingMargin || !value.startsWith("-")) {
2562
+ return;
2563
+ }
2564
+ const unit = readStylePanelValue(property)?.querySelector("select")?.value.trim() || "px";
2565
+ const styleValue = `${value}${unit}`;
2566
+ selectedComponentRef.current = selected;
2567
+ lastSelectedComponentRef.current = selected;
2568
+ selected.addStyle?.({ [property]: "0px", [negativePaddingMargin]: styleValue });
2569
+ editorRef.current?.select?.(selected);
2570
+ };
2554
2571
  const updateSelectedOrionBlock = (updates) => {
2555
2572
  const component = selectedComponentRef.current;
2556
2573
  if (!component) {
@@ -3616,6 +3633,9 @@ function GrapesPageEditor({
3616
3633
  const onStylePanelInput = (event) => {
3617
3634
  const target = event.target;
3618
3635
  if (target?.closest("#orion-builder-v2-styles")) {
3636
+ if (target?.dataset?.orionRawValue?.startsWith("-")) {
3637
+ return;
3638
+ }
3619
3639
  const activeElement = document.activeElement;
3620
3640
  if (!sidebarPointerActiveRef.current && !activeElement?.closest("#orion-builder-v2-styles")) {
3621
3641
  return;
@@ -3670,6 +3690,13 @@ function GrapesPageEditor({
3670
3690
  closeBuilderHelpPopovers(wrapper);
3671
3691
  openBuilderHelpPopover(helpTrigger, wrapper, willOpen);
3672
3692
  };
3693
+ const onNegativePaddingInput = (event) => {
3694
+ const detail = event.detail || {};
3695
+ if (!detail.property || !detail.value) {
3696
+ return;
3697
+ }
3698
+ applyNegativePaddingInput(detail.property, detail.value);
3699
+ };
3673
3700
  const observer = new MutationObserver(() => {
3674
3701
  decorateBuilderControls();
3675
3702
  });
@@ -3683,6 +3710,7 @@ function GrapesPageEditor({
3683
3710
  document.addEventListener("input", refreshControls);
3684
3711
  document.addEventListener("input", onStylePanelInput, true);
3685
3712
  document.addEventListener("keydown", onDocumentKeydown, true);
3713
+ window.addEventListener("orion-builder-v2-negative-padding-input", onNegativePaddingInput);
3686
3714
  return () => {
3687
3715
  observer.disconnect();
3688
3716
  document.removeEventListener("change", refreshControls);
@@ -3691,6 +3719,7 @@ function GrapesPageEditor({
3691
3719
  document.removeEventListener("input", refreshControls);
3692
3720
  document.removeEventListener("input", onStylePanelInput, true);
3693
3721
  document.removeEventListener("keydown", onDocumentKeydown, true);
3722
+ window.removeEventListener("orion-builder-v2-negative-padding-input", onNegativePaddingInput);
3694
3723
  };
3695
3724
  }, []);
3696
3725
  (0, import_react.useEffect)(() => {
@@ -1305,7 +1305,11 @@ var decorateBuilderNumericSteppers = (root = document) => {
1305
1305
  input.dataset.orionRawValue = nextValue2;
1306
1306
  const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
1307
1307
  input.setSelectionRange(nextCursor2, nextCursor2);
1308
- input.dispatchEvent(new InputEvent("input", { bubbles: true, inputType: "insertText" }));
1308
+ window.dispatchEvent(
1309
+ new CustomEvent("orion-builder-v2-negative-padding-input", {
1310
+ detail: { property, value: nextValue2 }
1311
+ })
1312
+ );
1309
1313
  return;
1310
1314
  }
1311
1315
  if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
@@ -2427,6 +2431,19 @@ function GrapesPageEditor({
2427
2431
  );
2428
2432
  editorRef.current?.select?.(selected);
2429
2433
  };
2434
+ const applyNegativePaddingInput = (property, value) => {
2435
+ const negativePaddingMargin = negativePaddingMarginProperty(property);
2436
+ const selected = getCurrentOrionBlockTarget(getCurrentStyleTarget());
2437
+ if (!selected || !negativePaddingMargin || !value.startsWith("-")) {
2438
+ return;
2439
+ }
2440
+ const unit = readStylePanelValue(property)?.querySelector("select")?.value.trim() || "px";
2441
+ const styleValue = `${value}${unit}`;
2442
+ selectedComponentRef.current = selected;
2443
+ lastSelectedComponentRef.current = selected;
2444
+ selected.addStyle?.({ [property]: "0px", [negativePaddingMargin]: styleValue });
2445
+ editorRef.current?.select?.(selected);
2446
+ };
2430
2447
  const updateSelectedOrionBlock = (updates) => {
2431
2448
  const component = selectedComponentRef.current;
2432
2449
  if (!component) {
@@ -3492,6 +3509,9 @@ function GrapesPageEditor({
3492
3509
  const onStylePanelInput = (event) => {
3493
3510
  const target = event.target;
3494
3511
  if (target?.closest("#orion-builder-v2-styles")) {
3512
+ if (target?.dataset?.orionRawValue?.startsWith("-")) {
3513
+ return;
3514
+ }
3495
3515
  const activeElement = document.activeElement;
3496
3516
  if (!sidebarPointerActiveRef.current && !activeElement?.closest("#orion-builder-v2-styles")) {
3497
3517
  return;
@@ -3546,6 +3566,13 @@ function GrapesPageEditor({
3546
3566
  closeBuilderHelpPopovers(wrapper);
3547
3567
  openBuilderHelpPopover(helpTrigger, wrapper, willOpen);
3548
3568
  };
3569
+ const onNegativePaddingInput = (event) => {
3570
+ const detail = event.detail || {};
3571
+ if (!detail.property || !detail.value) {
3572
+ return;
3573
+ }
3574
+ applyNegativePaddingInput(detail.property, detail.value);
3575
+ };
3549
3576
  const observer = new MutationObserver(() => {
3550
3577
  decorateBuilderControls();
3551
3578
  });
@@ -3559,6 +3586,7 @@ function GrapesPageEditor({
3559
3586
  document.addEventListener("input", refreshControls);
3560
3587
  document.addEventListener("input", onStylePanelInput, true);
3561
3588
  document.addEventListener("keydown", onDocumentKeydown, true);
3589
+ window.addEventListener("orion-builder-v2-negative-padding-input", onNegativePaddingInput);
3562
3590
  return () => {
3563
3591
  observer.disconnect();
3564
3592
  document.removeEventListener("change", refreshControls);
@@ -3567,6 +3595,7 @@ function GrapesPageEditor({
3567
3595
  document.removeEventListener("input", refreshControls);
3568
3596
  document.removeEventListener("input", onStylePanelInput, true);
3569
3597
  document.removeEventListener("keydown", onDocumentKeydown, true);
3598
+ window.removeEventListener("orion-builder-v2-negative-padding-input", onNegativePaddingInput);
3570
3599
  };
3571
3600
  }, []);
3572
3601
  useEffect(() => {
package/dist/index.mjs CHANGED
@@ -8,10 +8,6 @@ import "./chunk-ZTXJG4K5.mjs";
8
8
  import {
9
9
  blocks_exports
10
10
  } from "./chunk-JQAHXYAM.mjs";
11
- import {
12
- admin_app_exports
13
- } from "./chunk-RKTIFEUY.mjs";
14
- import "./chunk-W2UOCJDX.mjs";
15
11
  import {
16
12
  studio_pages_exports
17
13
  } from "./chunk-276KAPGM.mjs";
@@ -20,6 +16,10 @@ import "./chunk-OQSEJXC4.mjs";
20
16
  import {
21
17
  studio_exports
22
18
  } from "./chunk-ADIIWIYL.mjs";
19
+ import {
20
+ admin_app_exports
21
+ } from "./chunk-RKTIFEUY.mjs";
22
+ import "./chunk-W2UOCJDX.mjs";
23
23
  import "./chunk-6BWS3CLP.mjs";
24
24
  export {
25
25
  admin_exports as admin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.158",
3
+ "version": "0.6.0-beta.159",
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",