@orion-studios/payload-studio 0.6.0-beta.182 → 0.6.0-beta.183
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.
package/dist/admin/index.mjs
CHANGED
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
socialMediaConnectionsField,
|
|
8
8
|
themePreferenceField,
|
|
9
9
|
withTooltips
|
|
10
|
-
} from "../chunk-
|
|
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,
|
|
@@ -1160,7 +1160,8 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
1160
1160
|
const props = propsFromAttributes(attributes);
|
|
1161
1161
|
withoutUndoTracking(editor, () => {
|
|
1162
1162
|
const backgroundColor = defaultBackgroundForComponent(type, props);
|
|
1163
|
-
|
|
1163
|
+
const currentBackgroundColor = normalizeCssColor(this.model.getStyle?.()?.["background-color"]);
|
|
1164
|
+
if (backgroundColor && currentBackgroundColor !== backgroundColor) {
|
|
1164
1165
|
this.model.addStyle?.({ "background-color": backgroundColor });
|
|
1165
1166
|
this.model.addAttributes?.({ "data-orion-background-color": backgroundColor });
|
|
1166
1167
|
}
|
|
@@ -2030,6 +2031,11 @@ var stripLegacyNegativePadding = (component) => {
|
|
|
2030
2031
|
}
|
|
2031
2032
|
removeGeneratedSelectionMargins(component);
|
|
2032
2033
|
};
|
|
2034
|
+
var storedOrionBlockBackgroundColor = (component) => {
|
|
2035
|
+
const attrs = component?.getAttributes?.() || {};
|
|
2036
|
+
const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
|
|
2037
|
+
return firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2038
|
+
};
|
|
2033
2039
|
var spacingTargetForComponent = (component) => {
|
|
2034
2040
|
const element = component?.getEl?.();
|
|
2035
2041
|
return element || null;
|
|
@@ -2872,6 +2878,18 @@ function GrapesPageEditor({
|
|
|
2872
2878
|
}
|
|
2873
2879
|
stripLegacyNegativePadding(component);
|
|
2874
2880
|
const style = component.getStyle?.() || {};
|
|
2881
|
+
const storedBackgroundColor = firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2882
|
+
if (storedBackgroundColor && getStyleColorValue(style, "background-color") !== storedBackgroundColor) {
|
|
2883
|
+
component.addStyle?.({ "background-color": storedBackgroundColor });
|
|
2884
|
+
component.addAttributes?.({
|
|
2885
|
+
"data-orion-background-color": storedBackgroundColor,
|
|
2886
|
+
"data-orion-block": serializeOrionBlockAttribute({
|
|
2887
|
+
...block,
|
|
2888
|
+
backgroundColor: storedBackgroundColor
|
|
2889
|
+
})
|
|
2890
|
+
});
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2875
2893
|
const backgroundColor = getStyleColorValue(style, "background-color");
|
|
2876
2894
|
if (!backgroundColor || normalizeCssColorValue(block.backgroundColor) === backgroundColor && normalizeCssColorValue(attrs["data-orion-background-color"]) === backgroundColor) {
|
|
2877
2895
|
return;
|
|
@@ -2888,6 +2906,21 @@ function GrapesPageEditor({
|
|
|
2888
2906
|
syncingOrionBlockStylesRef.current = false;
|
|
2889
2907
|
}
|
|
2890
2908
|
};
|
|
2909
|
+
const hydrateAllOrionBlockBackgroundStyles = () => {
|
|
2910
|
+
const editor = editorRef.current;
|
|
2911
|
+
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2912
|
+
const blocks = wrapper?.find?.("[data-orion-block]") || [];
|
|
2913
|
+
blocks.forEach((component) => {
|
|
2914
|
+
stripLegacyNegativePadding(component);
|
|
2915
|
+
const backgroundColor = storedOrionBlockBackgroundColor(component);
|
|
2916
|
+
if (!backgroundColor) {
|
|
2917
|
+
return;
|
|
2918
|
+
}
|
|
2919
|
+
if (getStyleColorValue(component.getStyle?.() || {}, "background-color") !== backgroundColor) {
|
|
2920
|
+
component.addStyle?.({ "background-color": backgroundColor });
|
|
2921
|
+
}
|
|
2922
|
+
});
|
|
2923
|
+
};
|
|
2891
2924
|
const hydrateSelectedTypographyStyleFromOrionBlock = (component) => {
|
|
2892
2925
|
if (!component) {
|
|
2893
2926
|
return;
|
|
@@ -3443,6 +3476,8 @@ function GrapesPageEditor({
|
|
|
3443
3476
|
registerProjectDynamicComponents(editor, adapter);
|
|
3444
3477
|
historyReadyRef.current = false;
|
|
3445
3478
|
editor.loadProjectData(projectData);
|
|
3479
|
+
hydrateAllOrionBlockBackgroundStyles();
|
|
3480
|
+
window.requestAnimationFrame(() => hydrateAllOrionBlockBackgroundStyles());
|
|
3446
3481
|
void loadPayloadMediaAssets(editor);
|
|
3447
3482
|
window.setTimeout(() => {
|
|
3448
3483
|
customUndoStackRef.current = [];
|
|
@@ -1036,7 +1036,8 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
1036
1036
|
const props = propsFromAttributes(attributes);
|
|
1037
1037
|
withoutUndoTracking(editor, () => {
|
|
1038
1038
|
const backgroundColor = defaultBackgroundForComponent(type, props);
|
|
1039
|
-
|
|
1039
|
+
const currentBackgroundColor = normalizeCssColor(this.model.getStyle?.()?.["background-color"]);
|
|
1040
|
+
if (backgroundColor && currentBackgroundColor !== backgroundColor) {
|
|
1040
1041
|
this.model.addStyle?.({ "background-color": backgroundColor });
|
|
1041
1042
|
this.model.addAttributes?.({ "data-orion-background-color": backgroundColor });
|
|
1042
1043
|
}
|
|
@@ -1906,6 +1907,11 @@ var stripLegacyNegativePadding = (component) => {
|
|
|
1906
1907
|
}
|
|
1907
1908
|
removeGeneratedSelectionMargins(component);
|
|
1908
1909
|
};
|
|
1910
|
+
var storedOrionBlockBackgroundColor = (component) => {
|
|
1911
|
+
const attrs = component?.getAttributes?.() || {};
|
|
1912
|
+
const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
|
|
1913
|
+
return firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
1914
|
+
};
|
|
1909
1915
|
var spacingTargetForComponent = (component) => {
|
|
1910
1916
|
const element = component?.getEl?.();
|
|
1911
1917
|
return element || null;
|
|
@@ -2748,6 +2754,18 @@ function GrapesPageEditor({
|
|
|
2748
2754
|
}
|
|
2749
2755
|
stripLegacyNegativePadding(component);
|
|
2750
2756
|
const style = component.getStyle?.() || {};
|
|
2757
|
+
const storedBackgroundColor = firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2758
|
+
if (storedBackgroundColor && getStyleColorValue(style, "background-color") !== storedBackgroundColor) {
|
|
2759
|
+
component.addStyle?.({ "background-color": storedBackgroundColor });
|
|
2760
|
+
component.addAttributes?.({
|
|
2761
|
+
"data-orion-background-color": storedBackgroundColor,
|
|
2762
|
+
"data-orion-block": serializeOrionBlockAttribute({
|
|
2763
|
+
...block,
|
|
2764
|
+
backgroundColor: storedBackgroundColor
|
|
2765
|
+
})
|
|
2766
|
+
});
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2751
2769
|
const backgroundColor = getStyleColorValue(style, "background-color");
|
|
2752
2770
|
if (!backgroundColor || normalizeCssColorValue(block.backgroundColor) === backgroundColor && normalizeCssColorValue(attrs["data-orion-background-color"]) === backgroundColor) {
|
|
2753
2771
|
return;
|
|
@@ -2764,6 +2782,21 @@ function GrapesPageEditor({
|
|
|
2764
2782
|
syncingOrionBlockStylesRef.current = false;
|
|
2765
2783
|
}
|
|
2766
2784
|
};
|
|
2785
|
+
const hydrateAllOrionBlockBackgroundStyles = () => {
|
|
2786
|
+
const editor = editorRef.current;
|
|
2787
|
+
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2788
|
+
const blocks = wrapper?.find?.("[data-orion-block]") || [];
|
|
2789
|
+
blocks.forEach((component) => {
|
|
2790
|
+
stripLegacyNegativePadding(component);
|
|
2791
|
+
const backgroundColor = storedOrionBlockBackgroundColor(component);
|
|
2792
|
+
if (!backgroundColor) {
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
if (getStyleColorValue(component.getStyle?.() || {}, "background-color") !== backgroundColor) {
|
|
2796
|
+
component.addStyle?.({ "background-color": backgroundColor });
|
|
2797
|
+
}
|
|
2798
|
+
});
|
|
2799
|
+
};
|
|
2767
2800
|
const hydrateSelectedTypographyStyleFromOrionBlock = (component) => {
|
|
2768
2801
|
if (!component) {
|
|
2769
2802
|
return;
|
|
@@ -3319,6 +3352,8 @@ function GrapesPageEditor({
|
|
|
3319
3352
|
registerProjectDynamicComponents(editor, adapter);
|
|
3320
3353
|
historyReadyRef.current = false;
|
|
3321
3354
|
editor.loadProjectData(projectData);
|
|
3355
|
+
hydrateAllOrionBlockBackgroundStyles();
|
|
3356
|
+
window.requestAnimationFrame(() => hydrateAllOrionBlockBackgroundStyles());
|
|
3322
3357
|
void loadPayloadMediaAssets(editor);
|
|
3323
3358
|
window.setTimeout(() => {
|
|
3324
3359
|
customUndoStackRef.current = [];
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
admin_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KHK6RTGC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
blocks_exports
|
|
6
6
|
} from "./chunk-JQAHXYAM.mjs";
|
|
7
|
-
import {
|
|
8
|
-
admin_app_exports
|
|
9
|
-
} from "./chunk-RKTIFEUY.mjs";
|
|
10
|
-
import "./chunk-W2UOCJDX.mjs";
|
|
11
7
|
import {
|
|
12
8
|
nextjs_exports
|
|
13
9
|
} from "./chunk-ZADL33R6.mjs";
|
|
14
10
|
import "./chunk-ZTXJG4K5.mjs";
|
|
11
|
+
import {
|
|
12
|
+
admin_app_exports
|
|
13
|
+
} from "./chunk-RKTIFEUY.mjs";
|
|
14
|
+
import "./chunk-W2UOCJDX.mjs";
|
|
15
15
|
import {
|
|
16
16
|
studio_pages_exports
|
|
17
17
|
} from "./chunk-NGLIA2OE.mjs";
|
package/package.json
CHANGED
|
@@ -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
|