@orion-studios/payload-studio 0.6.0-beta.126 → 0.6.0-beta.128
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.
|
@@ -685,9 +685,6 @@ var defaultBackgroundForComponent = (type, props) => {
|
|
|
685
685
|
if (explicit) {
|
|
686
686
|
return explicit;
|
|
687
687
|
}
|
|
688
|
-
if (type === "xoCta") {
|
|
689
|
-
return typeof block.style === "string" && block.style.toLowerCase() === "dark" ? "#243654" : "#304b70";
|
|
690
|
-
}
|
|
691
688
|
if (type === "xoFeatureGrid" || type === "xoRichText") {
|
|
692
689
|
return "#fbfaf7";
|
|
693
690
|
}
|
|
@@ -1117,6 +1114,9 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
1117
1114
|
},
|
|
1118
1115
|
components: "",
|
|
1119
1116
|
droppable: false,
|
|
1117
|
+
highlightable: true,
|
|
1118
|
+
hoverable: true,
|
|
1119
|
+
selectable: true,
|
|
1120
1120
|
tagName: "div",
|
|
1121
1121
|
traits: [
|
|
1122
1122
|
...(definition.traits || []).map((trait) => ({
|
|
@@ -1524,6 +1524,12 @@ var canvasSelectionCss = `
|
|
|
1524
1524
|
outline-color: #c7643d !important;
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
|
+
.orion-builder-v2-selected-block {
|
|
1528
|
+
outline: 2px solid #c7643d !important;
|
|
1529
|
+
outline-offset: -2px !important;
|
|
1530
|
+
position: relative;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1527
1533
|
.xo-builder-preview-grid {
|
|
1528
1534
|
display: grid;
|
|
1529
1535
|
gap: 22px;
|
|
@@ -2108,7 +2114,7 @@ function GrapesPageEditor({
|
|
|
2108
2114
|
};
|
|
2109
2115
|
const getCurrentStyleTarget = () => selectedComponentRef.current || lastSelectedComponentRef.current || (editorRef.current?.getSelected?.() || null);
|
|
2110
2116
|
const findOrionBlockByElement = (element) => {
|
|
2111
|
-
const target = element?.closest("[data-orion-block]");
|
|
2117
|
+
const target = element?.closest("[data-orion-block], [data-orion-component]");
|
|
2112
2118
|
const targetID = target?.id || "";
|
|
2113
2119
|
if (!targetID) {
|
|
2114
2120
|
return null;
|
|
@@ -2116,14 +2122,14 @@ function GrapesPageEditor({
|
|
|
2116
2122
|
const editor = editorRef.current;
|
|
2117
2123
|
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2118
2124
|
const component = wrapper?.find?.(`#${CSS.escape(targetID)}`)?.[0] || null;
|
|
2119
|
-
return
|
|
2125
|
+
return isOrionBlockComponent(component) ? component : null;
|
|
2120
2126
|
};
|
|
2121
2127
|
const findOrionBlockAncestor = (component) => {
|
|
2122
2128
|
let current = component;
|
|
2123
2129
|
const visited = /* @__PURE__ */ new Set();
|
|
2124
2130
|
while (current && !visited.has(current)) {
|
|
2125
2131
|
visited.add(current);
|
|
2126
|
-
if (
|
|
2132
|
+
if (isOrionBlockComponent(current)) {
|
|
2127
2133
|
return current;
|
|
2128
2134
|
}
|
|
2129
2135
|
current = current.parent?.() || null;
|
|
@@ -2134,7 +2140,10 @@ function GrapesPageEditor({
|
|
|
2134
2140
|
const findSelectedCanvasOrionBlock = () => {
|
|
2135
2141
|
const editor = editorRef.current;
|
|
2136
2142
|
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2137
|
-
const candidates =
|
|
2143
|
+
const candidates = [
|
|
2144
|
+
...wrapper?.find?.("[data-orion-block]") || [],
|
|
2145
|
+
...wrapper?.find?.("[data-orion-component]") || []
|
|
2146
|
+
];
|
|
2138
2147
|
return candidates.find((candidate) => {
|
|
2139
2148
|
const element = candidate.getEl?.();
|
|
2140
2149
|
return Boolean(
|
|
@@ -2164,10 +2173,11 @@ function GrapesPageEditor({
|
|
|
2164
2173
|
}
|
|
2165
2174
|
const candidates = [
|
|
2166
2175
|
...selectedID ? wrapper.find?.(`#${selectedID}`) || [] : [],
|
|
2167
|
-
...wrapper.find?.("[data-orion-block]") || []
|
|
2176
|
+
...wrapper.find?.("[data-orion-block]") || [],
|
|
2177
|
+
...wrapper.find?.("[data-orion-component]") || []
|
|
2168
2178
|
];
|
|
2169
2179
|
return candidates.find(
|
|
2170
|
-
(candidate) =>
|
|
2180
|
+
(candidate) => isOrionBlockComponent(candidate)
|
|
2171
2181
|
) || component || selected || null;
|
|
2172
2182
|
};
|
|
2173
2183
|
const selectStyleManagerTarget = (component) => {
|
|
@@ -2177,6 +2187,11 @@ function GrapesPageEditor({
|
|
|
2177
2187
|
const editor = editorRef.current;
|
|
2178
2188
|
editor?.StyleManager?.select?.(component);
|
|
2179
2189
|
};
|
|
2190
|
+
const markSelectedCanvasBlock = (component) => {
|
|
2191
|
+
const canvasDocument = editorRef.current?.Canvas?.getDocument?.();
|
|
2192
|
+
canvasDocument?.querySelectorAll(".orion-builder-v2-selected-block").forEach((element) => element.classList.remove("orion-builder-v2-selected-block"));
|
|
2193
|
+
component?.getEl?.()?.classList.add("orion-builder-v2-selected-block");
|
|
2194
|
+
};
|
|
2180
2195
|
const updateSelectedItems = (updater) => {
|
|
2181
2196
|
const component = getCurrentOrionBlockTarget();
|
|
2182
2197
|
if (!component) {
|
|
@@ -2539,6 +2554,7 @@ function GrapesPageEditor({
|
|
|
2539
2554
|
}
|
|
2540
2555
|
hydrateSelectedTypographyStyleFromOrionBlock(component);
|
|
2541
2556
|
rememberComponentSnapshot(component);
|
|
2557
|
+
markSelectedCanvasBlock(component);
|
|
2542
2558
|
refreshSelectedState(component);
|
|
2543
2559
|
window.requestAnimationFrame(() => {
|
|
2544
2560
|
const element = spacingTargetForComponent(component);
|
|
@@ -2692,6 +2708,7 @@ function GrapesPageEditor({
|
|
|
2692
2708
|
editorRef.current?.select?.(snapshot.component);
|
|
2693
2709
|
selectStyleManagerTarget(snapshot.component);
|
|
2694
2710
|
lastComponentSnapshotRef.current.set(snapshot.component, snapshot);
|
|
2711
|
+
markSelectedCanvasBlock(snapshot.component);
|
|
2695
2712
|
refreshSelectedState(snapshot.component);
|
|
2696
2713
|
};
|
|
2697
2714
|
const restoreCustomHistoryEntry = (entry, target) => {
|
|
@@ -2748,6 +2765,7 @@ function GrapesPageEditor({
|
|
|
2748
2765
|
selectedComponentRef.current = selected;
|
|
2749
2766
|
lastSelectedComponentRef.current = selected;
|
|
2750
2767
|
selectStyleManagerTarget(selected);
|
|
2768
|
+
markSelectedCanvasBlock(selected);
|
|
2751
2769
|
refreshSelectedState(selected);
|
|
2752
2770
|
}
|
|
2753
2771
|
updateHistoryState(editor);
|
|
@@ -3057,9 +3075,11 @@ function GrapesPageEditor({
|
|
|
3057
3075
|
editor.select?.(target);
|
|
3058
3076
|
}
|
|
3059
3077
|
selectStyleManagerTarget(target);
|
|
3078
|
+
markSelectedCanvasBlock(target);
|
|
3060
3079
|
rehydrateSelectedComponentControls(target);
|
|
3061
3080
|
window.setTimeout(() => {
|
|
3062
3081
|
selectStyleManagerTarget(target);
|
|
3082
|
+
markSelectedCanvasBlock(target);
|
|
3063
3083
|
rehydrateSelectedComponentControls(target);
|
|
3064
3084
|
}, 120);
|
|
3065
3085
|
});
|
|
@@ -3082,6 +3102,7 @@ function GrapesPageEditor({
|
|
|
3082
3102
|
return;
|
|
3083
3103
|
}
|
|
3084
3104
|
selectedComponentRef.current = null;
|
|
3105
|
+
markSelectedCanvasBlock(null);
|
|
3085
3106
|
refreshSelectedState(null);
|
|
3086
3107
|
});
|
|
3087
3108
|
const bindCanvasSelectionTracking = () => {
|
|
@@ -3097,6 +3118,9 @@ function GrapesPageEditor({
|
|
|
3097
3118
|
selectedComponentRef.current = target;
|
|
3098
3119
|
lastSelectedComponentRef.current = target;
|
|
3099
3120
|
rememberComponentSnapshot(target);
|
|
3121
|
+
editor.select?.(target);
|
|
3122
|
+
selectStyleManagerTarget(target);
|
|
3123
|
+
markSelectedCanvasBlock(target);
|
|
3100
3124
|
refreshSelectedState(target);
|
|
3101
3125
|
};
|
|
3102
3126
|
canvasDocument.addEventListener("pointerdown", trackCanvasSelection, true);
|
|
@@ -561,9 +561,6 @@ var defaultBackgroundForComponent = (type, props) => {
|
|
|
561
561
|
if (explicit) {
|
|
562
562
|
return explicit;
|
|
563
563
|
}
|
|
564
|
-
if (type === "xoCta") {
|
|
565
|
-
return typeof block.style === "string" && block.style.toLowerCase() === "dark" ? "#243654" : "#304b70";
|
|
566
|
-
}
|
|
567
564
|
if (type === "xoFeatureGrid" || type === "xoRichText") {
|
|
568
565
|
return "#fbfaf7";
|
|
569
566
|
}
|
|
@@ -993,6 +990,9 @@ var registerProjectDynamicComponents = (editor, adapter) => {
|
|
|
993
990
|
},
|
|
994
991
|
components: "",
|
|
995
992
|
droppable: false,
|
|
993
|
+
highlightable: true,
|
|
994
|
+
hoverable: true,
|
|
995
|
+
selectable: true,
|
|
996
996
|
tagName: "div",
|
|
997
997
|
traits: [
|
|
998
998
|
...(definition.traits || []).map((trait) => ({
|
|
@@ -1400,6 +1400,12 @@ var canvasSelectionCss = `
|
|
|
1400
1400
|
outline-color: #c7643d !important;
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
1403
|
+
.orion-builder-v2-selected-block {
|
|
1404
|
+
outline: 2px solid #c7643d !important;
|
|
1405
|
+
outline-offset: -2px !important;
|
|
1406
|
+
position: relative;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1403
1409
|
.xo-builder-preview-grid {
|
|
1404
1410
|
display: grid;
|
|
1405
1411
|
gap: 22px;
|
|
@@ -1984,7 +1990,7 @@ function GrapesPageEditor({
|
|
|
1984
1990
|
};
|
|
1985
1991
|
const getCurrentStyleTarget = () => selectedComponentRef.current || lastSelectedComponentRef.current || (editorRef.current?.getSelected?.() || null);
|
|
1986
1992
|
const findOrionBlockByElement = (element) => {
|
|
1987
|
-
const target = element?.closest("[data-orion-block]");
|
|
1993
|
+
const target = element?.closest("[data-orion-block], [data-orion-component]");
|
|
1988
1994
|
const targetID = target?.id || "";
|
|
1989
1995
|
if (!targetID) {
|
|
1990
1996
|
return null;
|
|
@@ -1992,14 +1998,14 @@ function GrapesPageEditor({
|
|
|
1992
1998
|
const editor = editorRef.current;
|
|
1993
1999
|
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
1994
2000
|
const component = wrapper?.find?.(`#${CSS.escape(targetID)}`)?.[0] || null;
|
|
1995
|
-
return
|
|
2001
|
+
return isOrionBlockComponent(component) ? component : null;
|
|
1996
2002
|
};
|
|
1997
2003
|
const findOrionBlockAncestor = (component) => {
|
|
1998
2004
|
let current = component;
|
|
1999
2005
|
const visited = /* @__PURE__ */ new Set();
|
|
2000
2006
|
while (current && !visited.has(current)) {
|
|
2001
2007
|
visited.add(current);
|
|
2002
|
-
if (
|
|
2008
|
+
if (isOrionBlockComponent(current)) {
|
|
2003
2009
|
return current;
|
|
2004
2010
|
}
|
|
2005
2011
|
current = current.parent?.() || null;
|
|
@@ -2010,7 +2016,10 @@ function GrapesPageEditor({
|
|
|
2010
2016
|
const findSelectedCanvasOrionBlock = () => {
|
|
2011
2017
|
const editor = editorRef.current;
|
|
2012
2018
|
const wrapper = editor?.DomComponents?.getWrapper?.() || null;
|
|
2013
|
-
const candidates =
|
|
2019
|
+
const candidates = [
|
|
2020
|
+
...wrapper?.find?.("[data-orion-block]") || [],
|
|
2021
|
+
...wrapper?.find?.("[data-orion-component]") || []
|
|
2022
|
+
];
|
|
2014
2023
|
return candidates.find((candidate) => {
|
|
2015
2024
|
const element = candidate.getEl?.();
|
|
2016
2025
|
return Boolean(
|
|
@@ -2040,10 +2049,11 @@ function GrapesPageEditor({
|
|
|
2040
2049
|
}
|
|
2041
2050
|
const candidates = [
|
|
2042
2051
|
...selectedID ? wrapper.find?.(`#${selectedID}`) || [] : [],
|
|
2043
|
-
...wrapper.find?.("[data-orion-block]") || []
|
|
2052
|
+
...wrapper.find?.("[data-orion-block]") || [],
|
|
2053
|
+
...wrapper.find?.("[data-orion-component]") || []
|
|
2044
2054
|
];
|
|
2045
2055
|
return candidates.find(
|
|
2046
|
-
(candidate) =>
|
|
2056
|
+
(candidate) => isOrionBlockComponent(candidate)
|
|
2047
2057
|
) || component || selected || null;
|
|
2048
2058
|
};
|
|
2049
2059
|
const selectStyleManagerTarget = (component) => {
|
|
@@ -2053,6 +2063,11 @@ function GrapesPageEditor({
|
|
|
2053
2063
|
const editor = editorRef.current;
|
|
2054
2064
|
editor?.StyleManager?.select?.(component);
|
|
2055
2065
|
};
|
|
2066
|
+
const markSelectedCanvasBlock = (component) => {
|
|
2067
|
+
const canvasDocument = editorRef.current?.Canvas?.getDocument?.();
|
|
2068
|
+
canvasDocument?.querySelectorAll(".orion-builder-v2-selected-block").forEach((element) => element.classList.remove("orion-builder-v2-selected-block"));
|
|
2069
|
+
component?.getEl?.()?.classList.add("orion-builder-v2-selected-block");
|
|
2070
|
+
};
|
|
2056
2071
|
const updateSelectedItems = (updater) => {
|
|
2057
2072
|
const component = getCurrentOrionBlockTarget();
|
|
2058
2073
|
if (!component) {
|
|
@@ -2415,6 +2430,7 @@ function GrapesPageEditor({
|
|
|
2415
2430
|
}
|
|
2416
2431
|
hydrateSelectedTypographyStyleFromOrionBlock(component);
|
|
2417
2432
|
rememberComponentSnapshot(component);
|
|
2433
|
+
markSelectedCanvasBlock(component);
|
|
2418
2434
|
refreshSelectedState(component);
|
|
2419
2435
|
window.requestAnimationFrame(() => {
|
|
2420
2436
|
const element = spacingTargetForComponent(component);
|
|
@@ -2568,6 +2584,7 @@ function GrapesPageEditor({
|
|
|
2568
2584
|
editorRef.current?.select?.(snapshot.component);
|
|
2569
2585
|
selectStyleManagerTarget(snapshot.component);
|
|
2570
2586
|
lastComponentSnapshotRef.current.set(snapshot.component, snapshot);
|
|
2587
|
+
markSelectedCanvasBlock(snapshot.component);
|
|
2571
2588
|
refreshSelectedState(snapshot.component);
|
|
2572
2589
|
};
|
|
2573
2590
|
const restoreCustomHistoryEntry = (entry, target) => {
|
|
@@ -2624,6 +2641,7 @@ function GrapesPageEditor({
|
|
|
2624
2641
|
selectedComponentRef.current = selected;
|
|
2625
2642
|
lastSelectedComponentRef.current = selected;
|
|
2626
2643
|
selectStyleManagerTarget(selected);
|
|
2644
|
+
markSelectedCanvasBlock(selected);
|
|
2627
2645
|
refreshSelectedState(selected);
|
|
2628
2646
|
}
|
|
2629
2647
|
updateHistoryState(editor);
|
|
@@ -2933,9 +2951,11 @@ function GrapesPageEditor({
|
|
|
2933
2951
|
editor.select?.(target);
|
|
2934
2952
|
}
|
|
2935
2953
|
selectStyleManagerTarget(target);
|
|
2954
|
+
markSelectedCanvasBlock(target);
|
|
2936
2955
|
rehydrateSelectedComponentControls(target);
|
|
2937
2956
|
window.setTimeout(() => {
|
|
2938
2957
|
selectStyleManagerTarget(target);
|
|
2958
|
+
markSelectedCanvasBlock(target);
|
|
2939
2959
|
rehydrateSelectedComponentControls(target);
|
|
2940
2960
|
}, 120);
|
|
2941
2961
|
});
|
|
@@ -2958,6 +2978,7 @@ function GrapesPageEditor({
|
|
|
2958
2978
|
return;
|
|
2959
2979
|
}
|
|
2960
2980
|
selectedComponentRef.current = null;
|
|
2981
|
+
markSelectedCanvasBlock(null);
|
|
2961
2982
|
refreshSelectedState(null);
|
|
2962
2983
|
});
|
|
2963
2984
|
const bindCanvasSelectionTracking = () => {
|
|
@@ -2973,6 +2994,9 @@ function GrapesPageEditor({
|
|
|
2973
2994
|
selectedComponentRef.current = target;
|
|
2974
2995
|
lastSelectedComponentRef.current = target;
|
|
2975
2996
|
rememberComponentSnapshot(target);
|
|
2997
|
+
editor.select?.(target);
|
|
2998
|
+
selectStyleManagerTarget(target);
|
|
2999
|
+
markSelectedCanvasBlock(target);
|
|
2976
3000
|
refreshSelectedState(target);
|
|
2977
3001
|
};
|
|
2978
3002
|
canvasDocument.addEventListener("pointerdown", trackCanvasSelection, true);
|
|
@@ -864,7 +864,6 @@
|
|
|
864
864
|
|
|
865
865
|
.orion-builder-v2-block-preview.is-xoCta,
|
|
866
866
|
.orion-builder-v2-block-preview.is-cta {
|
|
867
|
-
background: #243654;
|
|
868
867
|
align-content: center;
|
|
869
868
|
}
|
|
870
869
|
|
|
@@ -881,13 +880,13 @@
|
|
|
881
880
|
|
|
882
881
|
.orion-builder-v2-block-preview.is-xoCta .wire-title,
|
|
883
882
|
.orion-builder-v2-block-preview.is-cta .wire-title {
|
|
884
|
-
background: rgba(
|
|
883
|
+
background: rgba(31, 45, 77, 0.38);
|
|
885
884
|
grid-column: 2 / 12;
|
|
886
885
|
}
|
|
887
886
|
|
|
888
887
|
.orion-builder-v2-block-preview.is-xoCta .wire-button,
|
|
889
888
|
.orion-builder-v2-block-preview.is-cta .wire-button {
|
|
890
|
-
background:
|
|
889
|
+
background: rgba(199, 100, 61, 0.5);
|
|
891
890
|
grid-column: 5 / 9;
|
|
892
891
|
}
|
|
893
892
|
|
package/package.json
CHANGED