@accelerated-agency/visual-editor 0.2.3 → 0.2.5
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/index.js +20 -10
- package/dist/vite.cjs +2426 -203
- package/dist/vite.js +2426 -203
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2896,6 +2896,19 @@ function convertChainSetsToMutations(chainSets) {
|
|
|
2896
2896
|
case "remove":
|
|
2897
2897
|
mutations.push({ id, selector: cs.selector, action: "hide", value: "none", timestamp });
|
|
2898
2898
|
break;
|
|
2899
|
+
case "reorder":
|
|
2900
|
+
if (cs.selector && cs.targetSelector) {
|
|
2901
|
+
mutations.push({
|
|
2902
|
+
id,
|
|
2903
|
+
selector: cs.selector,
|
|
2904
|
+
action: "reorderElement",
|
|
2905
|
+
value: "",
|
|
2906
|
+
targetSelector: cs.targetSelector,
|
|
2907
|
+
insertPosition: cs.action === "before" ? "before" : "after",
|
|
2908
|
+
timestamp
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
break;
|
|
2899
2912
|
}
|
|
2900
2913
|
}
|
|
2901
2914
|
return mutations;
|
|
@@ -4771,11 +4784,12 @@ function PlatformVisualEditorV2({
|
|
|
4771
4784
|
status,
|
|
4772
4785
|
tabs = [],
|
|
4773
4786
|
activeTab = "Visual Editor",
|
|
4774
|
-
loading = false,
|
|
4787
|
+
loading: _loading = false,
|
|
4775
4788
|
error = null,
|
|
4776
4789
|
showCloseButton = true,
|
|
4777
4790
|
closeLabel = "Close",
|
|
4778
|
-
loadingText = "Loading visual editor...",
|
|
4791
|
+
loadingText: _loadingText = "Loading visual editor...",
|
|
4792
|
+
renderLoading: _renderLoading,
|
|
4779
4793
|
saveDebounceSkips = 2,
|
|
4780
4794
|
experiment,
|
|
4781
4795
|
onClose,
|
|
@@ -4788,7 +4802,6 @@ function PlatformVisualEditorV2({
|
|
|
4788
4802
|
onNavigateRequested,
|
|
4789
4803
|
onDiscardDirty,
|
|
4790
4804
|
renderHeader,
|
|
4791
|
-
renderLoading,
|
|
4792
4805
|
renderError
|
|
4793
4806
|
}) {
|
|
4794
4807
|
const iframeRef = useRef(null);
|
|
@@ -4852,6 +4865,10 @@ function PlatformVisualEditorV2({
|
|
|
4852
4865
|
setDirty(true);
|
|
4853
4866
|
}
|
|
4854
4867
|
break;
|
|
4868
|
+
case "editor-dirty":
|
|
4869
|
+
setDirty(!!payload?.dirty);
|
|
4870
|
+
if (!payload?.dirty) mutationSkipCountRef.current = 0;
|
|
4871
|
+
break;
|
|
4855
4872
|
case "save-experiment":
|
|
4856
4873
|
if (!onRequestSave) return;
|
|
4857
4874
|
try {
|
|
@@ -4910,13 +4927,6 @@ function PlatformVisualEditorV2({
|
|
|
4910
4927
|
(tab) => onTabChange?.(tab),
|
|
4911
4928
|
[onTabChange]
|
|
4912
4929
|
);
|
|
4913
|
-
if (loading) {
|
|
4914
|
-
if (renderLoading) return renderLoading();
|
|
4915
|
-
return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center bg-slate-50", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3", children: [
|
|
4916
|
-
/* @__PURE__ */ jsx("div", { className: "w-8 h-8 border-2 border-slate-200 border-t-indigo-500 rounded-full animate-spin" }),
|
|
4917
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-slate-400", children: loadingText })
|
|
4918
|
-
] }) });
|
|
4919
|
-
}
|
|
4920
4930
|
if (error) {
|
|
4921
4931
|
if (renderError) return renderError(error);
|
|
4922
4932
|
return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center bg-slate-50", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-center px-8", children: [
|