@orion-studios/payload-studio 0.6.0-beta.175 → 0.6.0-beta.177

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.
@@ -7,14 +7,14 @@ import {
7
7
  socialMediaConnectionsField,
8
8
  themePreferenceField,
9
9
  withTooltips
10
- } from "../chunk-JC3UV74N.mjs";
11
- import "../chunk-W2UOCJDX.mjs";
10
+ } from "../chunk-KHK6RTGC.mjs";
12
11
  import {
13
12
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
14
13
  SOCIAL_MEDIA_ICON_OPTIONS,
15
14
  SOCIAL_MEDIA_PLATFORMS,
16
15
  SOCIAL_MEDIA_PLATFORM_LABELS
17
16
  } from "../chunk-ZTXJG4K5.mjs";
17
+ import "../chunk-W2UOCJDX.mjs";
18
18
  import "../chunk-6BWS3CLP.mjs";
19
19
  export {
20
20
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
@@ -2025,6 +2025,15 @@ var negativePaddingAttributeForSide = (side) => `data-orion-negative-padding-${s
2025
2025
  var negativePaddingVariableForSide = (side) => `--orion-negative-padding-${side}`;
2026
2026
  var negativePaddingBackgroundAttribute = "data-orion-negative-padding-background";
2027
2027
  var negativePaddingBackgroundVariable = "--orion-negative-padding-background";
2028
+ var getStoredOrionBackgroundColor = (attrs, style) => {
2029
+ const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
2030
+ return firstString(
2031
+ attrs[negativePaddingBackgroundAttribute],
2032
+ style[negativePaddingBackgroundVariable],
2033
+ attrs["data-orion-background-color"],
2034
+ block.backgroundColor
2035
+ );
2036
+ };
2028
2037
  var spacingTargetForComponent = (component) => {
2029
2038
  const element = component?.getEl?.();
2030
2039
  return element || null;
@@ -2612,24 +2621,39 @@ function GrapesPageEditor({
2612
2621
  if (property.startsWith("padding-") && !String(value).trim().startsWith("-")) {
2613
2622
  const side = negativePaddingSideFromProperty(property);
2614
2623
  if (side) {
2615
- selected.removeStyle?.(negativePaddingVariableForSide(side));
2616
- selected.removeAttributes?.(negativePaddingAttributeForSide(side));
2617
- selected.removeClass?.(`is-orion-negative-padding-${side}`);
2618
2624
  const attrs = selected.getAttributes?.() || {};
2625
+ const selectedStyle = selected.getStyle?.() || {};
2626
+ const nextNegativePaddingBySide = Object.fromEntries(
2627
+ negativePaddingSides.map((paddingSide) => [
2628
+ paddingSide,
2629
+ paddingSide === side ? "" : firstString(attrs[negativePaddingAttributeForSide(paddingSide)])
2630
+ ])
2631
+ );
2619
2632
  const hasOtherNegativePadding = negativePaddingSides.some(
2620
- (paddingSide) => paddingSide !== side && Boolean(attrs[negativePaddingAttributeForSide(paddingSide)])
2633
+ (paddingSide) => Boolean(nextNegativePaddingBySide[paddingSide])
2621
2634
  );
2635
+ const negativePaddingBackground = getStoredOrionBackgroundColor(attrs, selectedStyle);
2636
+ selected.removeStyle?.(negativePaddingVariableForSide(side));
2637
+ selected.removeAttributes?.(negativePaddingAttributeForSide(side));
2638
+ selected.removeClass?.(`is-orion-negative-padding-${side}`);
2622
2639
  if (!hasOtherNegativePadding) {
2623
- const negativePaddingBackground = firstString(
2624
- attrs[negativePaddingBackgroundAttribute],
2625
- selected.getStyle?.()[negativePaddingBackgroundVariable]
2626
- );
2627
2640
  if (negativePaddingBackground) {
2628
2641
  selected.addStyle?.({ "background-color": negativePaddingBackground });
2629
2642
  }
2630
2643
  selected.removeStyle?.(negativePaddingBackgroundVariable);
2631
2644
  selected.removeAttributes?.(negativePaddingBackgroundAttribute);
2645
+ negativePaddingSides.forEach((paddingSide) => {
2646
+ selected.removeStyle?.(negativePaddingVariableForSide(paddingSide));
2647
+ selected.removeAttributes?.(negativePaddingAttributeForSide(paddingSide));
2648
+ selected.removeClass?.(`is-orion-negative-padding-${paddingSide}`);
2649
+ });
2632
2650
  selected.removeClass?.("orion-builder-v2-negative-padding");
2651
+ } else if (negativePaddingBackground) {
2652
+ selected.addStyle?.({
2653
+ [negativePaddingBackgroundVariable]: negativePaddingBackground,
2654
+ "background-color": "transparent"
2655
+ });
2656
+ selected.addAttributes?.({ [negativePaddingBackgroundAttribute]: negativePaddingBackground });
2633
2657
  }
2634
2658
  }
2635
2659
  }
@@ -2657,9 +2681,9 @@ function GrapesPageEditor({
2657
2681
  const side = negativePaddingSideFromProperty(property);
2658
2682
  const negativeStyleValue = `${Number.isInteger(adjustment) ? adjustment : Number(adjustment.toFixed(2))}${unit}`;
2659
2683
  const currentStyle = selected.getStyle?.() || {};
2684
+ const currentAttributes = selected.getAttributes?.() || {};
2660
2685
  const backgroundColor = firstString(
2661
- currentStyle[negativePaddingBackgroundVariable],
2662
- selected.getAttributes?.()[negativePaddingBackgroundAttribute],
2686
+ getStoredOrionBackgroundColor(currentAttributes, currentStyle),
2663
2687
  getStyleColorValue(currentStyle, "background-color")
2664
2688
  );
2665
2689
  selected.addClass?.("orion-builder-v2-negative-padding");
@@ -1901,6 +1901,15 @@ var negativePaddingAttributeForSide = (side) => `data-orion-negative-padding-${s
1901
1901
  var negativePaddingVariableForSide = (side) => `--orion-negative-padding-${side}`;
1902
1902
  var negativePaddingBackgroundAttribute = "data-orion-negative-padding-background";
1903
1903
  var negativePaddingBackgroundVariable = "--orion-negative-padding-background";
1904
+ var getStoredOrionBackgroundColor = (attrs, style) => {
1905
+ const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
1906
+ return firstString(
1907
+ attrs[negativePaddingBackgroundAttribute],
1908
+ style[negativePaddingBackgroundVariable],
1909
+ attrs["data-orion-background-color"],
1910
+ block.backgroundColor
1911
+ );
1912
+ };
1904
1913
  var spacingTargetForComponent = (component) => {
1905
1914
  const element = component?.getEl?.();
1906
1915
  return element || null;
@@ -2488,24 +2497,39 @@ function GrapesPageEditor({
2488
2497
  if (property.startsWith("padding-") && !String(value).trim().startsWith("-")) {
2489
2498
  const side = negativePaddingSideFromProperty(property);
2490
2499
  if (side) {
2491
- selected.removeStyle?.(negativePaddingVariableForSide(side));
2492
- selected.removeAttributes?.(negativePaddingAttributeForSide(side));
2493
- selected.removeClass?.(`is-orion-negative-padding-${side}`);
2494
2500
  const attrs = selected.getAttributes?.() || {};
2501
+ const selectedStyle = selected.getStyle?.() || {};
2502
+ const nextNegativePaddingBySide = Object.fromEntries(
2503
+ negativePaddingSides.map((paddingSide) => [
2504
+ paddingSide,
2505
+ paddingSide === side ? "" : firstString(attrs[negativePaddingAttributeForSide(paddingSide)])
2506
+ ])
2507
+ );
2495
2508
  const hasOtherNegativePadding = negativePaddingSides.some(
2496
- (paddingSide) => paddingSide !== side && Boolean(attrs[negativePaddingAttributeForSide(paddingSide)])
2509
+ (paddingSide) => Boolean(nextNegativePaddingBySide[paddingSide])
2497
2510
  );
2511
+ const negativePaddingBackground = getStoredOrionBackgroundColor(attrs, selectedStyle);
2512
+ selected.removeStyle?.(negativePaddingVariableForSide(side));
2513
+ selected.removeAttributes?.(negativePaddingAttributeForSide(side));
2514
+ selected.removeClass?.(`is-orion-negative-padding-${side}`);
2498
2515
  if (!hasOtherNegativePadding) {
2499
- const negativePaddingBackground = firstString(
2500
- attrs[negativePaddingBackgroundAttribute],
2501
- selected.getStyle?.()[negativePaddingBackgroundVariable]
2502
- );
2503
2516
  if (negativePaddingBackground) {
2504
2517
  selected.addStyle?.({ "background-color": negativePaddingBackground });
2505
2518
  }
2506
2519
  selected.removeStyle?.(negativePaddingBackgroundVariable);
2507
2520
  selected.removeAttributes?.(negativePaddingBackgroundAttribute);
2521
+ negativePaddingSides.forEach((paddingSide) => {
2522
+ selected.removeStyle?.(negativePaddingVariableForSide(paddingSide));
2523
+ selected.removeAttributes?.(negativePaddingAttributeForSide(paddingSide));
2524
+ selected.removeClass?.(`is-orion-negative-padding-${paddingSide}`);
2525
+ });
2508
2526
  selected.removeClass?.("orion-builder-v2-negative-padding");
2527
+ } else if (negativePaddingBackground) {
2528
+ selected.addStyle?.({
2529
+ [negativePaddingBackgroundVariable]: negativePaddingBackground,
2530
+ "background-color": "transparent"
2531
+ });
2532
+ selected.addAttributes?.({ [negativePaddingBackgroundAttribute]: negativePaddingBackground });
2509
2533
  }
2510
2534
  }
2511
2535
  }
@@ -2533,9 +2557,9 @@ function GrapesPageEditor({
2533
2557
  const side = negativePaddingSideFromProperty(property);
2534
2558
  const negativeStyleValue = `${Number.isInteger(adjustment) ? adjustment : Number(adjustment.toFixed(2))}${unit}`;
2535
2559
  const currentStyle = selected.getStyle?.() || {};
2560
+ const currentAttributes = selected.getAttributes?.() || {};
2536
2561
  const backgroundColor = firstString(
2537
- currentStyle[negativePaddingBackgroundVariable],
2538
- selected.getAttributes?.()[negativePaddingBackgroundAttribute],
2562
+ getStoredOrionBackgroundColor(currentAttributes, currentStyle),
2539
2563
  getStyleColorValue(currentStyle, "background-color")
2540
2564
  );
2541
2565
  selected.addClass?.("orion-builder-v2-negative-padding");
package/dist/index.mjs CHANGED
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  admin_exports
3
- } from "./chunk-JC3UV74N.mjs";
4
- import {
5
- admin_app_exports
6
- } from "./chunk-RKTIFEUY.mjs";
7
- import "./chunk-W2UOCJDX.mjs";
8
- import {
9
- blocks_exports
10
- } from "./chunk-JQAHXYAM.mjs";
3
+ } from "./chunk-KHK6RTGC.mjs";
11
4
  import {
12
5
  nextjs_exports
13
6
  } from "./chunk-ZADL33R6.mjs";
14
7
  import "./chunk-ZTXJG4K5.mjs";
15
8
  import {
16
9
  studio_pages_exports
17
- } from "./chunk-NGLIA2OE.mjs";
18
- import "./chunk-OQSEJXC4.mjs";
10
+ } from "./chunk-7HME6R2V.mjs";
19
11
  import "./chunk-7ZMXZRBP.mjs";
20
12
  import {
21
13
  studio_exports
22
14
  } from "./chunk-ADIIWIYL.mjs";
15
+ import {
16
+ blocks_exports
17
+ } from "./chunk-JQAHXYAM.mjs";
18
+ import "./chunk-OQSEJXC4.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,
@@ -7,8 +7,7 @@ import {
7
7
  pageStudioModuleManifest,
8
8
  resolveBuilderThemeTokens,
9
9
  toEditorInitialDoc
10
- } from "../chunk-NGLIA2OE.mjs";
11
- import "../chunk-OQSEJXC4.mjs";
10
+ } from "../chunk-7HME6R2V.mjs";
12
11
  import {
13
12
  createDefaultStudioDocument,
14
13
  defaultBuilderThemeTokens,
@@ -16,6 +15,7 @@ import {
16
15
  studioDocumentToLayout
17
16
  } from "../chunk-7ZMXZRBP.mjs";
18
17
  import "../chunk-ADIIWIYL.mjs";
18
+ import "../chunk-OQSEJXC4.mjs";
19
19
  import "../chunk-6BWS3CLP.mjs";
20
20
  export {
21
21
  createDefaultStudioDocument,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.175",
3
+ "version": "0.6.0-beta.177",
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,6 +1,3 @@
1
- import {
2
- sectionStyleDefaults
3
- } from "./chunk-OQSEJXC4.mjs";
4
1
  import {
5
2
  createDefaultStudioDocument,
6
3
  defaultBuilderThemeTokens,
@@ -14,6 +11,9 @@ import {
14
11
  createEmptyStudioDocument,
15
12
  validateStudioDocument
16
13
  } from "./chunk-ADIIWIYL.mjs";
14
+ import {
15
+ sectionStyleDefaults
16
+ } from "./chunk-OQSEJXC4.mjs";
17
17
  import {
18
18
  __export
19
19
  } from "./chunk-6BWS3CLP.mjs";
@@ -1,12 +1,12 @@
1
- import {
2
- adminNavIcons
3
- } from "./chunk-W2UOCJDX.mjs";
4
1
  import {
5
2
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
6
3
  SOCIAL_MEDIA_ICON_OPTIONS,
7
4
  SOCIAL_MEDIA_PLATFORMS,
8
5
  SOCIAL_MEDIA_PLATFORM_LABELS
9
6
  } from "./chunk-ZTXJG4K5.mjs";
7
+ import {
8
+ adminNavIcons
9
+ } from "./chunk-W2UOCJDX.mjs";
10
10
  import {
11
11
  __export,
12
12
  __require