@orion-studios/payload-studio 0.6.0-beta.182 → 0.6.0-beta.184
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 +2 -2
- package/dist/builder-v2/client.js +49 -1
- package/dist/builder-v2/client.mjs +49 -1
- package/dist/builder-v2/styles.css +12 -0
- package/dist/index.mjs +10 -10
- package/dist/studio-pages/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/{chunk-NGLIA2OE.mjs → chunk-7HME6R2V.mjs} +3 -3
- package/dist/{chunk-JC3UV74N.mjs → chunk-KHK6RTGC.mjs} +3 -3
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,
|
|
@@ -720,6 +720,16 @@ var spacingLonghands = [
|
|
|
720
720
|
"padding-right"
|
|
721
721
|
];
|
|
722
722
|
var hasSpacingStyle = (style, property) => Boolean(style[property] || style[property.replace(/-([a-z])/g, (_, char) => char.toUpperCase())]);
|
|
723
|
+
var isZeroCssLength = (value) => {
|
|
724
|
+
const normalized = String(value || "").trim().toLowerCase();
|
|
725
|
+
return normalized === "0" || /^0(?:\.0+)?(?:px|pt|rem|em|%)?$/.test(normalized);
|
|
726
|
+
};
|
|
727
|
+
var hasZeroVerticalPadding = (style) => {
|
|
728
|
+
if (isZeroCssLength(style.padding)) {
|
|
729
|
+
return true;
|
|
730
|
+
}
|
|
731
|
+
return isZeroCssLength(style["padding-top"] || style.paddingTop) && isZeroCssLength(style["padding-bottom"] || style.paddingBottom);
|
|
732
|
+
};
|
|
723
733
|
var hoistPreviewSpacingToModel = (view) => {
|
|
724
734
|
const element = view.el;
|
|
725
735
|
const preview = element?.querySelector?.(".xo-builder-preview");
|
|
@@ -753,6 +763,9 @@ var hoistPreviewSpacingToModel = (view) => {
|
|
|
753
763
|
preview.style.paddingRight = "0";
|
|
754
764
|
preview.style.paddingBottom = "0";
|
|
755
765
|
preview.style.paddingLeft = "0";
|
|
766
|
+
if (hasZeroVerticalPadding(style)) {
|
|
767
|
+
preview.style.minHeight = "0";
|
|
768
|
+
}
|
|
756
769
|
};
|
|
757
770
|
var previewForDefinition = (definition, props) => definition.editorPreview?.(props) || `<div class="orion-builder-v2-dynamic-placeholder"><strong>${definition.label}</strong></div>`;
|
|
758
771
|
var blockPreviewForDefinition = (type) => {
|
|
@@ -1160,7 +1173,8 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
1160
1173
|
const props = propsFromAttributes(attributes);
|
|
1161
1174
|
withoutUndoTracking(editor, () => {
|
|
1162
1175
|
const backgroundColor = defaultBackgroundForComponent(type, props);
|
|
1163
|
-
|
|
1176
|
+
const currentBackgroundColor = normalizeCssColor(this.model.getStyle?.()?.["background-color"]);
|
|
1177
|
+
if (backgroundColor && currentBackgroundColor !== backgroundColor) {
|
|
1164
1178
|
this.model.addStyle?.({ "background-color": backgroundColor });
|
|
1165
1179
|
this.model.addAttributes?.({ "data-orion-background-color": backgroundColor });
|
|
1166
1180
|
}
|
|
@@ -2030,6 +2044,11 @@ var stripLegacyNegativePadding = (component) => {
|
|
|
2030
2044
|
}
|
|
2031
2045
|
removeGeneratedSelectionMargins(component);
|
|
2032
2046
|
};
|
|
2047
|
+
var storedOrionBlockBackgroundColor = (component) => {
|
|
2048
|
+
const attrs = component?.getAttributes?.() || {};
|
|
2049
|
+
const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
|
|
2050
|
+
return firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2051
|
+
};
|
|
2033
2052
|
var spacingTargetForComponent = (component) => {
|
|
2034
2053
|
const element = component?.getEl?.();
|
|
2035
2054
|
return element || null;
|
|
@@ -2872,6 +2891,18 @@ function GrapesPageEditor({
|
|
|
2872
2891
|
}
|
|
2873
2892
|
stripLegacyNegativePadding(component);
|
|
2874
2893
|
const style = component.getStyle?.() || {};
|
|
2894
|
+
const storedBackgroundColor = firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2895
|
+
if (storedBackgroundColor && getStyleColorValue(style, "background-color") !== storedBackgroundColor) {
|
|
2896
|
+
component.addStyle?.({ "background-color": storedBackgroundColor });
|
|
2897
|
+
component.addAttributes?.({
|
|
2898
|
+
"data-orion-background-color": storedBackgroundColor,
|
|
2899
|
+
"data-orion-block": serializeOrionBlockAttribute({
|
|
2900
|
+
...block,
|
|
2901
|
+
backgroundColor: storedBackgroundColor
|
|
2902
|
+
})
|
|
2903
|
+
});
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2875
2906
|
const backgroundColor = getStyleColorValue(style, "background-color");
|
|
2876
2907
|
if (!backgroundColor || normalizeCssColorValue(block.backgroundColor) === backgroundColor && normalizeCssColorValue(attrs["data-orion-background-color"]) === backgroundColor) {
|
|
2877
2908
|
return;
|
|
@@ -2888,6 +2919,21 @@ function GrapesPageEditor({
|
|
|
2888
2919
|
syncingOrionBlockStylesRef.current = false;
|
|
2889
2920
|
}
|
|
2890
2921
|
};
|
|
2922
|
+
const hydrateAllOrionBlockBackgroundStyles = () => {
|
|
2923
|
+
const editor = editorRef.current;
|
|
2924
|
+
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2925
|
+
const blocks = wrapper?.find?.("[data-orion-block]") || [];
|
|
2926
|
+
blocks.forEach((component) => {
|
|
2927
|
+
stripLegacyNegativePadding(component);
|
|
2928
|
+
const backgroundColor = storedOrionBlockBackgroundColor(component);
|
|
2929
|
+
if (!backgroundColor) {
|
|
2930
|
+
return;
|
|
2931
|
+
}
|
|
2932
|
+
if (getStyleColorValue(component.getStyle?.() || {}, "background-color") !== backgroundColor) {
|
|
2933
|
+
component.addStyle?.({ "background-color": backgroundColor });
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2891
2937
|
const hydrateSelectedTypographyStyleFromOrionBlock = (component) => {
|
|
2892
2938
|
if (!component) {
|
|
2893
2939
|
return;
|
|
@@ -3443,6 +3489,8 @@ function GrapesPageEditor({
|
|
|
3443
3489
|
registerProjectDynamicComponents(editor, adapter);
|
|
3444
3490
|
historyReadyRef.current = false;
|
|
3445
3491
|
editor.loadProjectData(projectData);
|
|
3492
|
+
hydrateAllOrionBlockBackgroundStyles();
|
|
3493
|
+
window.requestAnimationFrame(() => hydrateAllOrionBlockBackgroundStyles());
|
|
3446
3494
|
void loadPayloadMediaAssets(editor);
|
|
3447
3495
|
window.setTimeout(() => {
|
|
3448
3496
|
customUndoStackRef.current = [];
|
|
@@ -596,6 +596,16 @@ var spacingLonghands = [
|
|
|
596
596
|
"padding-right"
|
|
597
597
|
];
|
|
598
598
|
var hasSpacingStyle = (style, property) => Boolean(style[property] || style[property.replace(/-([a-z])/g, (_, char) => char.toUpperCase())]);
|
|
599
|
+
var isZeroCssLength = (value) => {
|
|
600
|
+
const normalized = String(value || "").trim().toLowerCase();
|
|
601
|
+
return normalized === "0" || /^0(?:\.0+)?(?:px|pt|rem|em|%)?$/.test(normalized);
|
|
602
|
+
};
|
|
603
|
+
var hasZeroVerticalPadding = (style) => {
|
|
604
|
+
if (isZeroCssLength(style.padding)) {
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
return isZeroCssLength(style["padding-top"] || style.paddingTop) && isZeroCssLength(style["padding-bottom"] || style.paddingBottom);
|
|
608
|
+
};
|
|
599
609
|
var hoistPreviewSpacingToModel = (view) => {
|
|
600
610
|
const element = view.el;
|
|
601
611
|
const preview = element?.querySelector?.(".xo-builder-preview");
|
|
@@ -629,6 +639,9 @@ var hoistPreviewSpacingToModel = (view) => {
|
|
|
629
639
|
preview.style.paddingRight = "0";
|
|
630
640
|
preview.style.paddingBottom = "0";
|
|
631
641
|
preview.style.paddingLeft = "0";
|
|
642
|
+
if (hasZeroVerticalPadding(style)) {
|
|
643
|
+
preview.style.minHeight = "0";
|
|
644
|
+
}
|
|
632
645
|
};
|
|
633
646
|
var previewForDefinition = (definition, props) => definition.editorPreview?.(props) || `<div class="orion-builder-v2-dynamic-placeholder"><strong>${definition.label}</strong></div>`;
|
|
634
647
|
var blockPreviewForDefinition = (type) => {
|
|
@@ -1036,7 +1049,8 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
1036
1049
|
const props = propsFromAttributes(attributes);
|
|
1037
1050
|
withoutUndoTracking(editor, () => {
|
|
1038
1051
|
const backgroundColor = defaultBackgroundForComponent(type, props);
|
|
1039
|
-
|
|
1052
|
+
const currentBackgroundColor = normalizeCssColor(this.model.getStyle?.()?.["background-color"]);
|
|
1053
|
+
if (backgroundColor && currentBackgroundColor !== backgroundColor) {
|
|
1040
1054
|
this.model.addStyle?.({ "background-color": backgroundColor });
|
|
1041
1055
|
this.model.addAttributes?.({ "data-orion-background-color": backgroundColor });
|
|
1042
1056
|
}
|
|
@@ -1906,6 +1920,11 @@ var stripLegacyNegativePadding = (component) => {
|
|
|
1906
1920
|
}
|
|
1907
1921
|
removeGeneratedSelectionMargins(component);
|
|
1908
1922
|
};
|
|
1923
|
+
var storedOrionBlockBackgroundColor = (component) => {
|
|
1924
|
+
const attrs = component?.getAttributes?.() || {};
|
|
1925
|
+
const block = parseOrionBlockAttribute(attrs["data-orion-block"]);
|
|
1926
|
+
return firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
1927
|
+
};
|
|
1909
1928
|
var spacingTargetForComponent = (component) => {
|
|
1910
1929
|
const element = component?.getEl?.();
|
|
1911
1930
|
return element || null;
|
|
@@ -2748,6 +2767,18 @@ function GrapesPageEditor({
|
|
|
2748
2767
|
}
|
|
2749
2768
|
stripLegacyNegativePadding(component);
|
|
2750
2769
|
const style = component.getStyle?.() || {};
|
|
2770
|
+
const storedBackgroundColor = firstString(attrs["data-orion-background-color"], block.backgroundColor);
|
|
2771
|
+
if (storedBackgroundColor && getStyleColorValue(style, "background-color") !== storedBackgroundColor) {
|
|
2772
|
+
component.addStyle?.({ "background-color": storedBackgroundColor });
|
|
2773
|
+
component.addAttributes?.({
|
|
2774
|
+
"data-orion-background-color": storedBackgroundColor,
|
|
2775
|
+
"data-orion-block": serializeOrionBlockAttribute({
|
|
2776
|
+
...block,
|
|
2777
|
+
backgroundColor: storedBackgroundColor
|
|
2778
|
+
})
|
|
2779
|
+
});
|
|
2780
|
+
return;
|
|
2781
|
+
}
|
|
2751
2782
|
const backgroundColor = getStyleColorValue(style, "background-color");
|
|
2752
2783
|
if (!backgroundColor || normalizeCssColorValue(block.backgroundColor) === backgroundColor && normalizeCssColorValue(attrs["data-orion-background-color"]) === backgroundColor) {
|
|
2753
2784
|
return;
|
|
@@ -2764,6 +2795,21 @@ function GrapesPageEditor({
|
|
|
2764
2795
|
syncingOrionBlockStylesRef.current = false;
|
|
2765
2796
|
}
|
|
2766
2797
|
};
|
|
2798
|
+
const hydrateAllOrionBlockBackgroundStyles = () => {
|
|
2799
|
+
const editor = editorRef.current;
|
|
2800
|
+
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2801
|
+
const blocks = wrapper?.find?.("[data-orion-block]") || [];
|
|
2802
|
+
blocks.forEach((component) => {
|
|
2803
|
+
stripLegacyNegativePadding(component);
|
|
2804
|
+
const backgroundColor = storedOrionBlockBackgroundColor(component);
|
|
2805
|
+
if (!backgroundColor) {
|
|
2806
|
+
return;
|
|
2807
|
+
}
|
|
2808
|
+
if (getStyleColorValue(component.getStyle?.() || {}, "background-color") !== backgroundColor) {
|
|
2809
|
+
component.addStyle?.({ "background-color": backgroundColor });
|
|
2810
|
+
}
|
|
2811
|
+
});
|
|
2812
|
+
};
|
|
2767
2813
|
const hydrateSelectedTypographyStyleFromOrionBlock = (component) => {
|
|
2768
2814
|
if (!component) {
|
|
2769
2815
|
return;
|
|
@@ -3319,6 +3365,8 @@ function GrapesPageEditor({
|
|
|
3319
3365
|
registerProjectDynamicComponents(editor, adapter);
|
|
3320
3366
|
historyReadyRef.current = false;
|
|
3321
3367
|
editor.loadProjectData(projectData);
|
|
3368
|
+
hydrateAllOrionBlockBackgroundStyles();
|
|
3369
|
+
window.requestAnimationFrame(() => hydrateAllOrionBlockBackgroundStyles());
|
|
3322
3370
|
void loadPayloadMediaAssets(editor);
|
|
3323
3371
|
window.setTimeout(() => {
|
|
3324
3372
|
customUndoStackRef.current = [];
|
|
@@ -1357,11 +1357,23 @@
|
|
|
1357
1357
|
}
|
|
1358
1358
|
|
|
1359
1359
|
.orion-builder-v2-editor .gjs-sm-sector {
|
|
1360
|
+
background: #fffdf9;
|
|
1360
1361
|
border: 1px solid var(--builder-v2-border);
|
|
1361
1362
|
border-radius: 12px;
|
|
1362
1363
|
overflow: visible;
|
|
1363
1364
|
}
|
|
1364
1365
|
|
|
1366
|
+
.orion-builder-v2-editor .gjs-sm-sector .gjs-sm-sector-title {
|
|
1367
|
+
border: 0;
|
|
1368
|
+
border-radius: 11px;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.orion-builder-v2-editor .gjs-sm-sector.gjs-sm-open .gjs-sm-sector-title,
|
|
1372
|
+
.orion-builder-v2-editor .gjs-sm-sector.gjs-open .gjs-sm-sector-title {
|
|
1373
|
+
border-bottom: 1px solid var(--builder-v2-border);
|
|
1374
|
+
border-radius: 11px 11px 0 0;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1365
1377
|
.orion-builder-v2-editor .gjs-sm-properties {
|
|
1366
1378
|
display: grid;
|
|
1367
1379
|
gap: 8px;
|
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
admin_exports
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
blocks_exports
|
|
6
|
-
} from "./chunk-JQAHXYAM.mjs";
|
|
7
|
-
import {
|
|
8
|
-
admin_app_exports
|
|
9
|
-
} from "./chunk-RKTIFEUY.mjs";
|
|
10
|
-
import "./chunk-W2UOCJDX.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";
|
|
8
|
+
import {
|
|
9
|
+
blocks_exports
|
|
10
|
+
} from "./chunk-JQAHXYAM.mjs";
|
|
15
11
|
import {
|
|
16
12
|
studio_pages_exports
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-OQSEJXC4.mjs";
|
|
13
|
+
} from "./chunk-7HME6R2V.mjs";
|
|
19
14
|
import "./chunk-7ZMXZRBP.mjs";
|
|
20
15
|
import {
|
|
21
16
|
studio_exports
|
|
22
17
|
} from "./chunk-ADIIWIYL.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-
|
|
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,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
|