@orion-studios/payload-studio 0.6.0-beta.176 → 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.
|
@@ -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;
|
|
@@ -2614,13 +2623,16 @@ function GrapesPageEditor({
|
|
|
2614
2623
|
if (side) {
|
|
2615
2624
|
const attrs = selected.getAttributes?.() || {};
|
|
2616
2625
|
const selectedStyle = selected.getStyle?.() || {};
|
|
2617
|
-
const
|
|
2618
|
-
(paddingSide) =>
|
|
2626
|
+
const nextNegativePaddingBySide = Object.fromEntries(
|
|
2627
|
+
negativePaddingSides.map((paddingSide) => [
|
|
2628
|
+
paddingSide,
|
|
2629
|
+
paddingSide === side ? "" : firstString(attrs[negativePaddingAttributeForSide(paddingSide)])
|
|
2630
|
+
])
|
|
2619
2631
|
);
|
|
2620
|
-
const
|
|
2621
|
-
|
|
2622
|
-
selectedStyle[negativePaddingBackgroundVariable]
|
|
2632
|
+
const hasOtherNegativePadding = negativePaddingSides.some(
|
|
2633
|
+
(paddingSide) => Boolean(nextNegativePaddingBySide[paddingSide])
|
|
2623
2634
|
);
|
|
2635
|
+
const negativePaddingBackground = getStoredOrionBackgroundColor(attrs, selectedStyle);
|
|
2624
2636
|
selected.removeStyle?.(negativePaddingVariableForSide(side));
|
|
2625
2637
|
selected.removeAttributes?.(negativePaddingAttributeForSide(side));
|
|
2626
2638
|
selected.removeClass?.(`is-orion-negative-padding-${side}`);
|
|
@@ -2630,7 +2642,18 @@ function GrapesPageEditor({
|
|
|
2630
2642
|
}
|
|
2631
2643
|
selected.removeStyle?.(negativePaddingBackgroundVariable);
|
|
2632
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
|
+
});
|
|
2633
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 });
|
|
2634
2657
|
}
|
|
2635
2658
|
}
|
|
2636
2659
|
}
|
|
@@ -2658,9 +2681,9 @@ function GrapesPageEditor({
|
|
|
2658
2681
|
const side = negativePaddingSideFromProperty(property);
|
|
2659
2682
|
const negativeStyleValue = `${Number.isInteger(adjustment) ? adjustment : Number(adjustment.toFixed(2))}${unit}`;
|
|
2660
2683
|
const currentStyle = selected.getStyle?.() || {};
|
|
2684
|
+
const currentAttributes = selected.getAttributes?.() || {};
|
|
2661
2685
|
const backgroundColor = firstString(
|
|
2662
|
-
currentStyle
|
|
2663
|
-
selected.getAttributes?.()[negativePaddingBackgroundAttribute],
|
|
2686
|
+
getStoredOrionBackgroundColor(currentAttributes, currentStyle),
|
|
2664
2687
|
getStyleColorValue(currentStyle, "background-color")
|
|
2665
2688
|
);
|
|
2666
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;
|
|
@@ -2490,13 +2499,16 @@ function GrapesPageEditor({
|
|
|
2490
2499
|
if (side) {
|
|
2491
2500
|
const attrs = selected.getAttributes?.() || {};
|
|
2492
2501
|
const selectedStyle = selected.getStyle?.() || {};
|
|
2493
|
-
const
|
|
2494
|
-
(paddingSide) =>
|
|
2502
|
+
const nextNegativePaddingBySide = Object.fromEntries(
|
|
2503
|
+
negativePaddingSides.map((paddingSide) => [
|
|
2504
|
+
paddingSide,
|
|
2505
|
+
paddingSide === side ? "" : firstString(attrs[negativePaddingAttributeForSide(paddingSide)])
|
|
2506
|
+
])
|
|
2495
2507
|
);
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2498
|
-
selectedStyle[negativePaddingBackgroundVariable]
|
|
2508
|
+
const hasOtherNegativePadding = negativePaddingSides.some(
|
|
2509
|
+
(paddingSide) => Boolean(nextNegativePaddingBySide[paddingSide])
|
|
2499
2510
|
);
|
|
2511
|
+
const negativePaddingBackground = getStoredOrionBackgroundColor(attrs, selectedStyle);
|
|
2500
2512
|
selected.removeStyle?.(negativePaddingVariableForSide(side));
|
|
2501
2513
|
selected.removeAttributes?.(negativePaddingAttributeForSide(side));
|
|
2502
2514
|
selected.removeClass?.(`is-orion-negative-padding-${side}`);
|
|
@@ -2506,7 +2518,18 @@ function GrapesPageEditor({
|
|
|
2506
2518
|
}
|
|
2507
2519
|
selected.removeStyle?.(negativePaddingBackgroundVariable);
|
|
2508
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
|
+
});
|
|
2509
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 });
|
|
2510
2533
|
}
|
|
2511
2534
|
}
|
|
2512
2535
|
}
|
|
@@ -2534,9 +2557,9 @@ function GrapesPageEditor({
|
|
|
2534
2557
|
const side = negativePaddingSideFromProperty(property);
|
|
2535
2558
|
const negativeStyleValue = `${Number.isInteger(adjustment) ? adjustment : Number(adjustment.toFixed(2))}${unit}`;
|
|
2536
2559
|
const currentStyle = selected.getStyle?.() || {};
|
|
2560
|
+
const currentAttributes = selected.getAttributes?.() || {};
|
|
2537
2561
|
const backgroundColor = firstString(
|
|
2538
|
-
currentStyle
|
|
2539
|
-
selected.getAttributes?.()[negativePaddingBackgroundAttribute],
|
|
2562
|
+
getStoredOrionBackgroundColor(currentAttributes, currentStyle),
|
|
2540
2563
|
getStyleColorValue(currentStyle, "background-color")
|
|
2541
2564
|
);
|
|
2542
2565
|
selected.addClass?.("orion-builder-v2-negative-padding");
|
package/dist/index.mjs
CHANGED
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
nextjs_exports
|
|
6
6
|
} from "./chunk-ZADL33R6.mjs";
|
|
7
7
|
import "./chunk-ZTXJG4K5.mjs";
|
|
8
|
-
import {
|
|
9
|
-
blocks_exports
|
|
10
|
-
} from "./chunk-JQAHXYAM.mjs";
|
|
11
8
|
import {
|
|
12
9
|
studio_pages_exports
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7HME6R2V.mjs";
|
|
14
11
|
import "./chunk-7ZMXZRBP.mjs";
|
|
15
|
-
import "./chunk-OQSEJXC4.mjs";
|
|
16
12
|
import {
|
|
17
13
|
studio_exports
|
|
18
14
|
} from "./chunk-ADIIWIYL.mjs";
|
|
15
|
+
import {
|
|
16
|
+
blocks_exports
|
|
17
|
+
} from "./chunk-JQAHXYAM.mjs";
|
|
18
|
+
import "./chunk-OQSEJXC4.mjs";
|
|
19
19
|
import {
|
|
20
20
|
admin_app_exports
|
|
21
21
|
} from "./chunk-RKTIFEUY.mjs";
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
pageStudioModuleManifest,
|
|
8
8
|
resolveBuilderThemeTokens,
|
|
9
9
|
toEditorInitialDoc
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7HME6R2V.mjs";
|
|
11
11
|
import {
|
|
12
12
|
createDefaultStudioDocument,
|
|
13
13
|
defaultBuilderThemeTokens,
|
|
14
14
|
layoutToStudioDocument,
|
|
15
15
|
studioDocumentToLayout
|
|
16
16
|
} from "../chunk-7ZMXZRBP.mjs";
|
|
17
|
-
import "../chunk-OQSEJXC4.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
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
migrateBlockToSettingsV2,
|
|
6
6
|
studioDocumentToLayout
|
|
7
7
|
} from "./chunk-7ZMXZRBP.mjs";
|
|
8
|
-
import {
|
|
9
|
-
sectionStyleDefaults
|
|
10
|
-
} from "./chunk-OQSEJXC4.mjs";
|
|
11
8
|
import {
|
|
12
9
|
assertStudioDocumentV1,
|
|
13
10
|
compileStudioDocument,
|
|
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";
|